Class WalletProxy
Proxy that communicates with the wallet endpoint
public sealed class WalletProxy : ServiceProxy, IServiceProxy
- Inheritance
-
WalletProxy
- Implements
- Inherited Members
- Extension Methods
Remarks
ctor
Constructors
WalletProxy(IRpcClient, string)
Proxy that communicates with the wallet endpoint
public WalletProxy(IRpcClient rpcClient, string originService)
Parameters
rpcClientIRpcClientIRpcClient instance to use for rpc communication
originServicestring
Remarks
ctor
Methods
AddKey(IEnumerable<string>, CancellationToken)
Adds a new key to the wallet
public Task<uint> AddKey(IEnumerable<string> mnemonic, CancellationToken cancellationToken = default)
Parameters
mnemonicIEnumerable<string>The key mnemonic
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
CalculateRoyalties(IEnumerable<FungibleAsset>, IEnumerable<RoyaltyAsset>, CancellationToken)
Transfers an NFT to another address.
public Task<IDictionary<string, IEnumerable<AssetInfo>>> CalculateRoyalties(IEnumerable<FungibleAsset> fungibleAssets, IEnumerable<RoyaltyAsset> royaltyAssets, CancellationToken cancellationToken = default)
Parameters
fungibleAssetsIEnumerable<FungibleAsset>royaltyAssetsIEnumerable<RoyaltyAsset>cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IDictionary<string, IEnumerable<AssetInfo>>>
An awaitable Task
CheckDeleteKey(uint, CancellationToken)
Check the key use prior to possible deletion checks whether key is used for either farm or pool rewards checks if any wallets have a non-zero balance
public Task<(uint Fingerprint, bool UsedForFarmerRewards, bool UsedForPoolRewards, bool WalletBalance)> CheckDeleteKey(uint fingerprint, CancellationToken cancellationToken = default)
Parameters
fingerprintuintThe key's fingerprint
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(uint Fingerprint, bool UsedForFarmerRewards, bool UsedForPoolRewards, bool WalletBalance)>
Indicators of how the wallet is used
CreateCATWallet(string, ulong, ulong, CancellationToken)
Create a new CAT wallet
public Task<(WalletType Type, string AssetId, uint WalletId, IEnumerable<TransactionRecord> Transactions)> CreateCATWallet(string name, ulong amount, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
namestringThe wallet name
amountulongThe amount to put in the wallet (in units of mojos)
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(WalletType Type, string AssetId, uint WalletId, IEnumerable<TransactionRecord> Transactions)>
Information about the wallet
CreateCATWallet(ulong, ulong, CancellationToken)
Create a new CAT wallet
public Task<(WalletType Type, string AssetId, uint WalletId, IEnumerable<TransactionRecord> Transactions)> CreateCATWallet(ulong amount, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
amountulongThe amount to put in the wallet (in units of mojos)
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(WalletType Type, string AssetId, uint WalletId, IEnumerable<TransactionRecord> Transactions)>
Information about the wallet
CreateDIDWallet(IEnumerable<string>, ulong, string, IDictionary<string, string>?, ulong, CancellationToken)
Creates a new DID wallet
public Task<(WalletType Type, string MyDID, uint WalletId)> CreateDIDWallet(IEnumerable<string> backupDIDs, ulong numOfBackupIdsNeeded, string name, IDictionary<string, string>? metaData = null, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
backupDIDsIEnumerable<string>Backup DIDs
numOfBackupIdsNeededulongThe number of back ids needed to create the wallet
namestringmetaDataIDictionary<string, string>feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
CreateExistingDAOWallet(string, ulong, CancellationToken)
Create a new CAT wallet
public Task<(WalletType Type, string TreasuryId, uint WalletId, uint CatWalletId, uint DaoCatWalletId, IEnumerable<TransactionRecord> Transactions)> CreateExistingDAOWallet(string treasuryId, ulong filterAmount = 1, CancellationToken cancellationToken = default)
Parameters
treasuryIdstringfilterAmountulongcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(WalletType Type, string TreasuryId, uint WalletId, uint CatWalletId, uint DaoCatWalletId, IEnumerable<TransactionRecord> Transactions)>
Information about the wallet
CreateNFTWallet(string?, CancellationToken)
Creates a new NFT wallet
public Task<(uint Id, WalletType Type)> CreateNFTWallet(string? didId = null, CancellationToken cancellationToken = default)
Parameters
didIdstringAn optional DID ID
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(uint Id, WalletType Type)>
Information about the wallet
CreateNewDAOWallet(DAORules?, ulong?, ulong, ulong, ulong, CancellationToken)
Create a new CAT wallet
public Task<(WalletType Type, string TreasuryId, uint WalletId, uint CatWalletId, uint DaoCatWalletId, IEnumerable<TransactionRecord> Transactions)> CreateNewDAOWallet(DAORules? daoRules = null, ulong? amountOfCats = null, ulong filterAmount = 1, ulong feeForCat = 0, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
daoRulesDAORulesamountOfCatsulong?filterAmountulongfeeForCatulongFee (in units of mojos)
feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(WalletType Type, string TreasuryId, uint WalletId, uint CatWalletId, uint DaoCatWalletId, IEnumerable<TransactionRecord> Transactions)>
Information about the wallet
CreateNewDl(string, ulong, CancellationToken)
Initialize the new data layer wallets.
public Task<(IEnumerable<TransactionRecord> Transactions, string LauncherId)> CreateNewDl(string root, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
rootstringfeeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<TransactionRecord> Transactions, string LauncherId)>
An awaitable Task
CreatePoolWallet(PoolState, ulong?, string?, CancellationToken)
Creates a new pool wallet
public Task<(TransactionRecord Transaction, string LauncherId, string P2SingletonHash, ulong TotalFee, IEnumerable<TransactionRecord> Transactions)> CreatePoolWallet(PoolState initialTargetState, ulong? p2SingletonDelayTime = null, string? p2SingletonDelayedPH = null, CancellationToken cancellationToken = default)
Parameters
initialTargetStatePoolStateThe desired initial state of the wallet
p2SingletonDelayTimeulong?Delay time to create the wallet
p2SingletonDelayedPHstringA delayed address (can be null or empty to not use)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(TransactionRecord Transaction, string LauncherId, string P2SingletonHash, ulong TotalFee, IEnumerable<TransactionRecord> Transactions)>
Information about the wallet
CreateSignedTransaction(IEnumerable<AmountWithPuzzlehash>, IEnumerable<ulong>?, IEnumerable<Coin>?, IEnumerable<PuzzleAnnouncement>?, IEnumerable<CoinAnnouncement>?, IEnumerable<Coin>?, ulong?, ulong?, ulong, CancellationToken)
Creates and signs a transaction.
public Task<(TransactionRecord SignedTx, IEnumerable<TransactionRecord> SignedTxs, IEnumerable<TransactionRecord> Transactions)> CreateSignedTransaction(IEnumerable<AmountWithPuzzlehash> additions, IEnumerable<ulong>? excludeCoinAmounts = null, IEnumerable<Coin>? excludeCoins = null, IEnumerable<PuzzleAnnouncement>? puzzleAnnouncements = null, IEnumerable<CoinAnnouncement>? coinAnnouncements = null, IEnumerable<Coin>? coins = null, ulong? minCoinAmount = null, ulong? maxCoinAmount = null, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
additionsIEnumerable<AmountWithPuzzlehash>excludeCoinAmountsIEnumerable<ulong>excludeCoinsIEnumerable<Coin>puzzleAnnouncementsIEnumerable<PuzzleAnnouncement>coinAnnouncementsIEnumerable<CoinAnnouncement>coinsIEnumerable<Coin>minCoinAmountulong?maxCoinAmountulong?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(TransactionRecord SignedTx, IEnumerable<TransactionRecord> SignedTxs, IEnumerable<TransactionRecord> Transactions)>
The signed TransactionRecord
CreateWalletForCAT(string, CancellationToken)
Create a wallet for an existing CAT
public Task<(WalletType Type, string AssetID, uint WalletId)> CreateWalletForCAT(string assetId, CancellationToken cancellationToken = default)
Parameters
assetIdstringThe id of the CAT
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
DeleteAllKeys(CancellationToken)
Deletes all keys from the wallet
public Task DeleteAllKeys(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
DeleteKey(uint, CancellationToken)
Deletes a specific key from the wallet
public Task DeleteKey(uint fingerprint, CancellationToken cancellationToken = default)
Parameters
fingerprintuintThe key's fingerprint
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
DeleteNotifications(IEnumerable<string>, CancellationToken)
Deletes notifications.
public Task DeleteNotifications(IEnumerable<string> ids, CancellationToken cancellationToken = default)
Parameters
idsIEnumerable<string>cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
DidFindLostDid(string, CancellationToken)
Recover a missing or un-spendable DID wallet by a coin id of the DID.
public Task<string> DidFindLostDid(string coinId, CancellationToken cancellationToken = default)
Parameters
coinIdstringcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
DidGetInfo(string, bool, CancellationToken)
Retrieves information about a DID.
public Task<DIDInfo> DidGetInfo(string coinId, bool latest = true, CancellationToken cancellationToken = default)
Parameters
coinIdstringlatestboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
DlVerifyProof(DLProof, CancellationToken)
Verifies a proof.
public Task<(bool CurrentRoot, ProofResultInclusions VerifiedClvmHashes)> DlVerifyProof(DLProof proof, CancellationToken cancellationToken = default)
Parameters
proofDLProofcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(bool CurrentRoot, ProofResultInclusions VerifiedClvmHashes)>
Proof verification
ExtendDerivationIndex(uint, CancellationToken)
Extends the current derivation index.
public Task<uint> ExtendDerivationIndex(uint index, CancellationToken cancellationToken = default)
Parameters
indexuintcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GenerateMnemonic(CancellationToken)
Generates a new mnemonic phrase
public Task<IEnumerable<string>> GenerateMnemonic(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<string>>
The new mnemonic as an IEnumerable<T> of 24 words
GetAutoClaim(CancellationToken)
Get auto claim merkle coins config
public Task<AutoClaimSettings> GetAutoClaim(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetCoinRecords(UInt32Range?, UInt32Range?, UInt64Range?, AmountFilter?, HashFilter?, HashFilter?, HashFilter?, CoinType?, WalletType?, uint?, uint?, CoinRecordOrder, uint, bool, bool, CancellationToken)
public Task<(IEnumerable<CoinRecord> CoinRecords, int? TotalCount)> GetCoinRecords(UInt32Range? spentRange = null, UInt32Range? confirmedRange = null, UInt64Range? amountRange = null, AmountFilter? amountFilter = null, HashFilter? parentCoinIdFilter = null, HashFilter? puzzleHashFilter = null, HashFilter? coinIdFilter = null, CoinType? coinType = null, WalletType? walletType = null, uint? walletId = null, uint? limit = null, CoinRecordOrder order = CoinRecordOrder.ConfirmedHeight, uint offset = 0, bool includeTotalCount = false, bool reverse = false, CancellationToken cancellationToken = default)
Parameters
spentRangeUInt32RangeconfirmedRangeUInt32RangeamountRangeUInt64RangeamountFilterAmountFilterparentCoinIdFilterHashFilterpuzzleHashFilterHashFiltercoinIdFilterHashFiltercoinTypeCoinType?walletTypeWalletType?walletIduint?limituint?orderCoinRecordOrderoffsetuintincludeTotalCountboolreverseboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetCoinRecordsByNames(IEnumerable<string>, bool, uint?, uint?, CancellationToken)
Retrieves the coins for given coin IDs
public Task<IEnumerable<CoinRecord>> GetCoinRecordsByNames(IEnumerable<string> names, bool includeSpentCoins, uint? startHeight = null, uint? endHeight = null, CancellationToken cancellationToken = default)
Parameters
namesIEnumerable<string>The coin names
includeSpentCoinsboolFlag indicating whether to include spent coins or not
startHeightuint?confirmation start height for search
endHeightuint?confirmation end height for search
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<CoinRecord>>
A list of CoinRecords
GetCurrentDerivationIndex(CancellationToken)
Gets the current derivation index.
public Task<uint> GetCurrentDerivationIndex(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetFarmedAmount(CancellationToken)
Get the amount farmed
public Task<(ulong FarmedAmount, ulong FarmerRewardAmount, ulong FeeAmount, uint LastHeightFarmed, ulong PoolRewardAmount)> GetFarmedAmount(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(ulong FarmedAmount, ulong FarmerRewardAmount, ulong FeeAmount, uint LastHeightFarmed, ulong PoolRewardAmount)>
The amount farmed
GetHeightInfo(CancellationToken)
Get blockchain height info
public Task<uint> GetHeightInfo(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetLoggedInFingerprint(CancellationToken)
Retrieves the logged in fingerprint
public Task<uint?> GetLoggedInFingerprint(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetNFTByDID(string, CancellationToken)
Get an NFT wallet by DID ID
public Task<uint> GetNFTByDID(string didId, CancellationToken cancellationToken = default)
Parameters
didIdstringThe DID ID
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetNFTInfo(string, bool, bool, bool?, CancellationToken)
Get info about an NFT
public Task<NFTInfo> GetNFTInfo(string coinId, bool latest = true, bool ignoreSizeLimit = false, bool? reusePuzhash = null, CancellationToken cancellationToken = default)
Parameters
coinIdstringlatestboolGet latest NFT
ignoreSizeLimitboolreusePuzhashbool?cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetPoolInfo(Uri, CancellationToken)
Gets basic info about a pool that is used for pool wallet creation
public static Task<PoolInfo> GetPoolInfo(Uri poolUri, CancellationToken cancellationToken = default)
Parameters
poolUriUriThe uri of the pool (not including 'pool_info')
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetPrivateKey(uint, CancellationToken)
Get the private key accessible by the wallet
public Task<PrivateKey> GetPrivateKey(uint fingerprint, CancellationToken cancellationToken = default)
Parameters
fingerprintuintThe fingerprint
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<PrivateKey>
The private key for the fingerprint
GetPublicKeys(CancellationToken)
Get all root public keys accessible by the wallet
public Task<IEnumerable<uint>> GetPublicKeys(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<uint>>
All root public keys accessible by the wallet
GetSyncStatus(CancellationToken)
Get the wallet's sync status
public Task<(bool GenesisInitialized, bool Synced, bool Syncing)> GetSyncStatus(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetTimestampForHeight(uint, CancellationToken)
Retrieve the timestamp for a given block height.
public Task<(ulong Timestamp, DateTime DateTimestamp)> GetTimestampForHeight(uint height, CancellationToken cancellationToken = default)
Parameters
heightuintcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(ulong Timestamp, DateTime DateTimestamp)>
A timestamp
GetTransaction(string, CancellationToken)
Get a specific transaction
public Task<TransactionRecord> GetTransaction(string transactionId, CancellationToken cancellationToken = default)
Parameters
transactionIdstringThe id of the transaction to find
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetTransactionMemo(string, CancellationToken)
Retrieves the memo from a transaction.
public Task<IDictionary<string, IDictionary<string, IEnumerable<string>>>> GetTransactionMemo(string transactionId, CancellationToken cancellationToken = default)
Parameters
transactionIdstringcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IDictionary<string, IDictionary<string, IEnumerable<string>>>>
An awaitable Task
GetWalletBalances(IEnumerable<uint>, CancellationToken)
Retrieves the balance of a specific list of wallets.
public Task<IDictionary<string, WalletBalance>> GetWalletBalances(IEnumerable<uint> walletIds, CancellationToken cancellationToken = default)
Parameters
walletIdsIEnumerable<uint>cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IDictionary<string, WalletBalance>>
A list of WalletBalance
GetWallets(bool, CancellationToken)
Get the list of wallets
public Task<(IEnumerable<WalletInfo> Wallets, uint Fingerprint)> GetWallets(bool includeData = true, CancellationToken cancellationToken = default)
Parameters
includeDataboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<WalletInfo> Wallets, uint Fingerprint)>
The list of wallets
GetWallets(WalletType, bool, CancellationToken)
Get the list of wallets
public Task<IEnumerable<WalletInfo>> GetWallets(WalletType type, bool includeData = true, CancellationToken cancellationToken = default)
Parameters
typeWalletTypeReturn only wallets of this type
includeDataboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<WalletInfo>>
The list of wallets
GetWalletsWithDIDs(CancellationToken)
Gets all the wallets with DIDs
public Task<IEnumerable<(uint WalletId, string DIDId, uint DIDWalletID)>> GetWalletsWithDIDs(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<(uint WalletId, string DIDId, uint DIDWalletID)>>
The list of wallets
LogIn(uint, CancellationToken)
Sets a key to active.
public Task<uint> LogIn(uint fingerprint, CancellationToken cancellationToken = default)
Parameters
fingerprintuintThe fingerprint
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
LogInAndWaitForSync(uint, int, CancellationToken)
Sets a fingerprint to active. Waits for the wallet to sync.
public Task<uint> LogInAndWaitForSync(uint fingerprint, int millisecondsDelay = 10000, CancellationToken cancellationToken = default)
Parameters
fingerprintuintThe fingerprint
millisecondsDelayintThe number of milliseconds to wait each time before checking sync status
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
NftSetDidBulk(string, IEnumerable<NFTCoinInfo>, bool?, ulong, CancellationToken)
Bulk set DID for NFTs across different wallets.
public Task<(int TxNum, SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)> NftSetDidBulk(string didId, IEnumerable<NFTCoinInfo> nftCoinList, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
didIdstringnftCoinListIEnumerable<NFTCoinInfo>reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(int TxNum, SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)>
Transaction number and SpendBundle
NftTransferBulk(string, IEnumerable<NFTCoinInfo>, bool?, ulong, CancellationToken)
Bulk transfer NFTs to an address.
public Task<(int TxNum, SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)> NftTransferBulk(string targetAddress, IEnumerable<NFTCoinInfo> nftCoinList, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
targetAddressstringnftCoinListIEnumerable<NFTCoinInfo>reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(int TxNum, SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)>
Transaction number and a SpendBundle
OnEventMessage(Message)
protected override void OnEventMessage(Message msg)
Parameters
msgMessage
PushTransactions(IEnumerable<TransactionRecord>, CancellationToken)
Pushes a list of transactions to the mempool and blockchain.
public Task PushTransactions(IEnumerable<TransactionRecord> transactions, CancellationToken cancellationToken = default)
Parameters
transactionsIEnumerable<TransactionRecord>cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable task
PushTx(SpendBundle, CancellationToken)
Pushes a transaction / spend bundle to the mempool and blockchain. Returns whether the spend bundle was successfully included into the mempool
public Task<bool> PushTx(SpendBundle spendBundle, CancellationToken cancellationToken = default)
Parameters
spendBundleSpendBundlecancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
RecoverDIDWallet(string, CancellationToken)
public Task<(WalletType Type, string MyDID, uint WalletId, string CoinName, Coin coin, string NewPuzHash, string Pubkey, IEnumerable<byte> BackupDIDs, ulong NumVerificationsRequired)> RecoverDIDWallet(string backupData, CancellationToken cancellationToken = default)
Parameters
backupDatastringcancellationTokenCancellationToken
Returns
- Task<(WalletType Type, string MyDID, uint WalletId, string CoinName, Coin coin, string NewPuzHash, string Pubkey, IEnumerable<byte> BackupDIDs, ulong NumVerificationsRequired)>
Exceptions
SendNotification(ulong, string, string, ulong, CancellationToken)
Sends a notification.
public Task<TransactionRecord> SendNotification(ulong amount, string message, string target, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
amountulongmessagestringIn hex
targetstringfeeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
SetAutoClaim(bool, CancellationToken)
Set auto claim merkle coins config
public Task<AutoClaimSettings> SetAutoClaim(bool enabled, CancellationToken cancellationToken = default)
Parameters
enabledboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
SetAutoClaim(bool, ushort, ulong, ulong, CancellationToken)
Set auto claim merkle coins config
public Task<AutoClaimSettings> SetAutoClaim(bool enabled = true, ushort batchSize = 50, ulong minAmount = 0, ulong txFee = 0, CancellationToken cancellationToken = default)
Parameters
enabledboolbatchSizeushortminAmountulongtxFeeulongcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
SetWalletResyncOnStartup(bool, CancellationToken)
Resync the current logged in wallet. The transaction and offer records will be kept.
public Task SetWalletResyncOnStartup(bool enable = true, CancellationToken cancellationToken = default)
Parameters
enableboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task
An awaitable Task
SignMessageByAddress(string, string, bool, CancellationToken)
Given a derived P2 address, sign the message by its private key.
public Task<(string PubKey, string Signature, string SigningMode)> SignMessageByAddress(string message, string address, bool isHex = false, CancellationToken cancellationToken = default)
Parameters
messagestringaddressstringisHexboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
SignMessageById(string, string, bool, CancellationToken)
Given a NFT/DID ID, sign the message by the P2 private key.
public Task<(string PubKey, string Signature, string SigningMode, string LatestCoinId)> SignMessageById(string message, string id, bool isHex = false, CancellationToken cancellationToken = default)
Parameters
messagestringidstringisHexboolcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(string PubKey, string Signature, string SigningMode, string LatestCoinId)>
PubKey, Signature, and SigningMode
SpendClawbackCoins(IEnumerable<string>, ushort, ulong, CancellationToken)
Spend clawback coins that were sent (to claw them back) or received (to claim them).
public Task<(IEnumerable<string> TransactionsIds, IEnumerable<TransactionRecord> Transactions)> SpendClawbackCoins(IEnumerable<string> coinIds, ushort batchSize = 50, ulong fee = 0, CancellationToken cancellationToken = default)
Parameters
coinIdsIEnumerable<string>batchSizeushortfeeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<string> TransactionsIds, IEnumerable<TransactionRecord> Transactions)>
A list of string
VerifySignature(string, string, string, string?, string?, CancellationToken)
Given a public key, message and signature, verify if it is valid.
public Task<bool> VerifySignature(string signature, string message, string pubkey, string? address = null, string? signingMode = null, CancellationToken cancellationToken = default)
Parameters
signaturestringmessagestringpubkeystringaddressstringsigningModestringcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
WaitForSync(int, CancellationToken)
Will wait until GetSyncStatus(CancellationToken) indicates that the wallet has synced or until the cancellation token is canceled
public Task WaitForSync(int millisecondsDelay = 10000, CancellationToken cancellationToken = default)
Parameters
millisecondsDelayintThe number of milliseconds to wait each time before checking sync status
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
Exceptions
- TaskCanceledException
When cancellation token expires or is cancelled
Events
CoinAdded
Event raised when a coin is added
public event EventHandler<dynamic>? CoinAdded
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the wallet endpoint
Remarks
Requires registering as the metrics service
StateChanged
Event raised when the wallet state changes
public event EventHandler<dynamic>? StateChanged
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the wallet endpoint
SyncChanged
Event raised when the sync state changes
public event EventHandler<dynamic>? SyncChanged
Event Type
- EventHandler<dynamic>
- Proxy that communicates with the wallet endpoint
Remarks
Requires registering as the metrics service