Class DataLayerProxy
Proxy that communicates with the Data Layer
public sealed class DataLayerProxy : ServiceProxy, IServiceProxy
- Inheritance
-
DataLayerProxy
- Implements
- Inherited Members
- Extension Methods
Remarks
ctor
Constructors
DataLayerProxy(IRpcClient, string)
Proxy that communicates with the Data Layer
public DataLayerProxy(IRpcClient rpcClient, string originService)
Parameters
rpcClient
IRpcClientIRpcClient instance to use for rpc communication
originService
string
Remarks
ctor
Methods
AddMirror(string, ulong, IEnumerable<string>, ulong, CancellationToken)
Adds a mirror
public Task AddMirror(string id, ulong amount, IEnumerable<string> urls, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
id
stringMirror id
amount
ulongThe Amount
urls
IEnumerable<string>List of mirror urls
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
AddMissingFiles(string[], string, bool, CancellationToken)
Adds missing files
public Task AddMissingFiles(string[] ids, string foldername, bool overwrite = false, CancellationToken cancellationToken = default)
Parameters
ids
string[]List of file id's
foldername
stringThe folder name
overwrite
boolIndicator whether to overwrite files
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
BatchUpdate(string, IDictionary<string, string>, bool, ulong, CancellationToken)
Applies a batch of updates.
public Task<string> BatchUpdate(string id, IDictionary<string, string> changeList, bool submitOnChain = true, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
id
stringId
changeList
IDictionary<string, string>Name value pairs of changes
submitOnChain
boolIndicates to submit the updates on the blockchain
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
CancelOffer(string, bool, ulong, CancellationToken)
Cancels an offer using a transaction
public Task CancelOffer(string tradeId, bool secure = false, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
tradeId
stringThe trade id of the offer
secure
boolThis will create a transaction that includes coins that were offered
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
CheckPlugins(CancellationToken)
Checks the status of plugins.
public Task<PluginStatus> CheckPlugins(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken- Proxy that communicates with the Data Layer
Returns
ClearPendingRoots(string, CancellationToken)
Clears pending roots.
public Task<Root> ClearPendingRoots(string storeId, CancellationToken cancellationToken = default)
Parameters
storeId
stringcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
CreateDataStore(ulong, CancellationToken)
Creates a data store.
public Task<(string id, IEnumerable<TransactionRecord> txs)> CreateDataStore(ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(string id, IEnumerable<TransactionRecord> txs)>
The tree id and list of transactions
DeleteKey(string, string, ulong, CancellationToken)
Deletes a data store.
public Task<string> DeleteKey(string key, string id, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
key
stringRow key
id
stringRow id
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
DeleteMirror(string, ulong, CancellationToken)
Deletes a mirror.
public Task DeleteMirror(string coinId, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
coinId
stringMirror coin id
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetAncestors(string, string, CancellationToken)
Gets the list of ancestors for a given id/hash pair.
public Task<IEnumerable<InternalNode>> GetAncestors(string id, string hash, CancellationToken cancellationToken = default)
Parameters
id
stringId
hash
stringHash
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetKVDiff(string, string, string, int, int, CancellationToken)
Get the keys and values for a given id/root_hash pair.
public Task<(KVDiff diff, int totalPages, int totalBytes)> GetKVDiff(string id, string hash1, string hash2, int page = 1, int maxPageSize = 41943040, CancellationToken cancellationToken = default)
Parameters
id
stringStore id
hash1
stringFirst Hash
hash2
stringSecond Hash
page
intThe page to get
maxPageSize
intThe max size of each page
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(KVDiff diff, int totalPages, int totalBytes)>
The list of keys and paging information
GetKVDiff(string, string, string, CancellationToken)
Get kv diff between two root hashes.
public Task<KVDiff> GetKVDiff(string id, string hash1, string hash2, CancellationToken cancellationToken = default)
Parameters
id
stringId
hash1
stringFirst Hash
hash2
stringSecond Hash
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetKeys(string, string?, int, int, CancellationToken)
Gets the list of keys for a given id/hash pair.
public Task<(IEnumerable<string> keys, int totalPages, int totalBytes, string rootHash)> GetKeys(string id, string? rootHash, int page = 1, int maxPageSize = 41943040, CancellationToken cancellationToken = default)
Parameters
id
stringStore id
rootHash
stringRoot Hash
page
intThe page to get
maxPageSize
intThe max size of each page
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<string> keys, int totalPages, int totalBytes, string rootHash)>
The list of keys and paging information
GetKeys(string, string?, CancellationToken)
Gets the list of keys for a given id/hash pair.
public Task<IEnumerable<string>> GetKeys(string id, string? rootHash, CancellationToken cancellationToken = default)
Parameters
id
stringStore id
rootHash
stringRoot Hash
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<string>>
The list of keys
GetKeysValues(string, string?, int, int, CancellationToken)
Get the keys and values for a given id/root_hash pair.
public Task<(IEnumerable<TerminalNode> keys, int totalPages, int totalBytes, string rootHash)> GetKeysValues(string id, string? rootHash, int page = 1, int maxPageSize = 41943040, CancellationToken cancellationToken = default)
Parameters
id
stringStore id
rootHash
stringRoot Hash
page
intThe page to get
maxPageSize
intThe max size of each page
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<TerminalNode> keys, int totalPages, int totalBytes, string rootHash)>
The list of keys and paging information
GetKeysValues(string, string, CancellationToken)
Get the keys and values for a given id/root_hash pair.
public Task<IEnumerable<TerminalNode>> GetKeysValues(string id, string rootHash, CancellationToken cancellationToken = default)
Parameters
id
stringId
rootHash
stringRoot Hash
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetLocalRoot(string, CancellationToken)
Gets hash of latest tree root saved in our local datastore.
public Task<KVDiff> GetLocalRoot(string id, CancellationToken cancellationToken = default)
Parameters
id
stringId
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetMirrors(string, CancellationToken)
Gets the mirrors for a given store id.
public Task<IEnumerable<Mirror>> GetMirrors(string id, CancellationToken cancellationToken = default)
Parameters
id
stringStore Id
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<Mirror>>
A list of Mirror
GetOwnedStores(CancellationToken)
Gets the list of owned store ids.
public Task<IEnumerable<string>> GetOwnedStores(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<string>>
A list of Mirror
GetProof(string, IEnumerable<string>, CancellationToken)
Retrieves a proof.
public Task<DLProof> GetProof(string storeId, IEnumerable<string> keys, CancellationToken cancellationToken = default)
Parameters
storeId
stringkeys
IEnumerable<string>cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetRoot(string, CancellationToken)
Gets hash of latest tree root.
public Task<RootHash> GetRoot(string id, CancellationToken cancellationToken = default)
Parameters
id
stringcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetRootHistory(string, CancellationToken)
Get history of state hashes for a store.
public Task<IEnumerable<RootHistory>> GetRootHistory(string id, CancellationToken cancellationToken = default)
Parameters
id
stringcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<RootHistory>>
A list of RootHistory
GetRoots(IEnumerable<string>, CancellationToken)
Gets state hashes for a list of roots
public Task<IEnumerable<RootHash>> GetRoots(IEnumerable<string> ids, CancellationToken cancellationToken = default)
Parameters
ids
IEnumerable<string>cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<RootHash>>
A list of RootHash
GetSyncStatus(string, CancellationToken)
Gets the sync status of a store.
public Task<DataLayerSyncStatus> GetSyncStatus(string id, CancellationToken cancellationToken = default)
Parameters
id
stringcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<DataLayerSyncStatus>
A list of DataLayerSyncStatus
GetValue(string, string, string?, CancellationToken)
Get the value for a given id/key pair.
public Task<string> GetValue(string id, string key, string? rootHash, CancellationToken cancellationToken = default)
Parameters
id
stringkey
stringrootHash
stringcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
Insert(string, string, ulong, CancellationToken)
Adds a list of clvm objects as bytes to add to table.
public Task<string> Insert(string id, string value, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
id
stringvalue
stringfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
MakeOffer(IEnumerable<OfferStore>, IEnumerable<OfferStore>, ulong, CancellationToken)
Makes an offer.
public Task<DataLayerOffer> MakeOffer(IEnumerable<OfferStore> maker, IEnumerable<OfferStore> taker, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
maker
IEnumerable<OfferStore>taker
IEnumerable<OfferStore>fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
RemoveSubscriptions(string, IEnumerable<string>, CancellationToken)
Removes subscriptions for the given id.
public Task RemoveSubscriptions(string id, IEnumerable<string> urls, CancellationToken cancellationToken = default)
Parameters
id
stringurls
IEnumerable<string>cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
SubmitPendingRoot(string, ulong, CancellationToken)
Submits a pending root
public Task<string> SubmitPendingRoot(string storeId, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
storeId
stringThe store id
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
Subscribe(string, IEnumerable<string>, CancellationToken)
Subscribe to singleton.
public Task Subscribe(string id, IEnumerable<string> urls, CancellationToken cancellationToken = default)
Parameters
id
stringurls
IEnumerable<string>cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
Subscriptions(CancellationToken)
List current subscriptions.
public Task<IEnumerable<string>> Subscriptions(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<string>>
A list of string
TakeOffer(object, ulong, CancellationToken)
Takes an offer.
public Task<string> TakeOffer(object offer, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
offer
objectfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
Unsubscribe(string, bool, CancellationToken)
Unsubscribe from singleton.
public Task Unsubscribe(string id, bool retain = false, CancellationToken cancellationToken = default)
Parameters
id
stringretain
boolcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
VerifyOffer(DataLayerOffer, ulong, CancellationToken)
Verifies an offer.
public Task<(bool Valid, ulong Fee)> VerifyOffer(DataLayerOffer offer, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
offer
DataLayerOfferfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
VerifyProof(DLProof, CancellationToken)
Verifies a proof.
public Task<(bool CurrentRoot, ProofResultInclusions VerifiedClvmHashes)> VerifyProof(DLProof proof, CancellationToken cancellationToken = default)
Parameters
proof
DLProofcancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task<(bool CurrentRoot, ProofResultInclusions VerifiedClvmHashes)>
Proof verification
WalletLogIn(uint, CancellationToken)
Sets a key to active.
public Task WalletLogIn(uint fingerprint, CancellationToken cancellationToken = default)
Parameters
fingerprint
uintThe fingerprint
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable task