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
rpcClientIRpcClientIRpcClient instance to use for rpc communication
originServicestring
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
idstringMirror id
amountulongThe Amount
urlsIEnumerable<string>List of mirror urls
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
idsstring[]List of file id's
foldernamestringThe folder name
overwriteboolIndicator whether to overwrite files
cancellationTokenCancellationTokenA 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
idstringId
changeListIDictionary<string, string>Name value pairs of changes
submitOnChainboolIndicates to submit the updates on the blockchain
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
tradeIdstringThe trade id of the offer
secureboolThis will create a transaction that includes coins that were offered
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationToken- Proxy that communicates with the Data Layer
 
Returns
ClearPendingRoots(string, CancellationToken)
Clears pending roots.
public Task<Root> ClearPendingRoots(string storeId, CancellationToken cancellationToken = default)
  Parameters
storeIdstringcancellationTokenCancellationTokenA 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
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
keystringRow key
idstringRow id
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
coinIdstringMirror coin id
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
idstringId
hashstringHash
cancellationTokenCancellationTokenA 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
idstringStore id
hash1stringFirst Hash
hash2stringSecond Hash
pageintThe page to get
maxPageSizeintThe max size of each page
cancellationTokenCancellationTokenA 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
idstringId
hash1stringFirst Hash
hash2stringSecond Hash
cancellationTokenCancellationTokenA 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
idstringStore id
rootHashstringRoot Hash
pageintThe page to get
maxPageSizeintThe max size of each page
cancellationTokenCancellationTokenA 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
idstringStore id
rootHashstringRoot Hash
cancellationTokenCancellationTokenA 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
idstringStore id
rootHashstringRoot Hash
pageintThe page to get
maxPageSizeintThe max size of each page
cancellationTokenCancellationTokenA 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
idstringId
rootHashstringRoot Hash
cancellationTokenCancellationTokenA 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
idstringId
cancellationTokenCancellationTokenA 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
idstringStore Id
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA 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
storeIdstringkeysIEnumerable<string>cancellationTokenCancellationTokenA 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
idstringcancellationTokenCancellationTokenA 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
idstringcancellationTokenCancellationTokenA 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
idsIEnumerable<string>cancellationTokenCancellationTokenA 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
idstringcancellationTokenCancellationTokenA 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
idstringkeystringrootHashstringcancellationTokenCancellationTokenA 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
idstringvaluestringfeeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
makerIEnumerable<OfferStore>takerIEnumerable<OfferStore>feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
idstringurlsIEnumerable<string>cancellationTokenCancellationTokenA 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
storeIdstringThe store id
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
idstringurlsIEnumerable<string>cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA 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
offerobjectfeeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
idstringretainboolcancellationTokenCancellationTokenA 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
offerDataLayerOfferfeeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
proofDLProofcancellationTokenCancellationTokenA 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
fingerprintuintThe fingerprint
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task
 An awaitable task