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
rpcClient
IRpcClientIRpcClient instance to use for rpc communication
originService
string
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
mnemonic
IEnumerable<string>The key mnemonic
cancellationToken
CancellationTokenA 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
fungibleAssets
IEnumerable<FungibleAsset>royaltyAssets
IEnumerable<RoyaltyAsset>cancellationToken
CancellationTokenA 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
fingerprint
uintThe key's fingerprint
cancellationToken
CancellationTokenA 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
name
stringThe wallet name
amount
ulongThe amount to put in the wallet (in units of mojos)
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
amount
ulongThe amount to put in the wallet (in units of mojos)
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
backupDIDs
IEnumerable<string>Backup DIDs
numOfBackupIdsNeeded
ulongThe number of back ids needed to create the wallet
name
stringmetaData
IDictionary<string, string>fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
treasuryId
stringfilterAmount
ulongcancellationToken
CancellationTokenA 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
didId
stringAn optional DID ID
cancellationToken
CancellationTokenA 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
daoRules
DAORulesamountOfCats
ulong?filterAmount
ulongfeeForCat
ulongFee (in units of mojos)
fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
root
stringfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
initialTargetState
PoolStateThe desired initial state of the wallet
p2SingletonDelayTime
ulong?Delay time to create the wallet
p2SingletonDelayedPH
stringA delayed address (can be null or empty to not use)
cancellationToken
CancellationTokenA 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
additions
IEnumerable<AmountWithPuzzlehash>excludeCoinAmounts
IEnumerable<ulong>excludeCoins
IEnumerable<Coin>puzzleAnnouncements
IEnumerable<PuzzleAnnouncement>coinAnnouncements
IEnumerable<CoinAnnouncement>coins
IEnumerable<Coin>minCoinAmount
ulong?maxCoinAmount
ulong?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
assetId
stringThe id of the CAT
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
DeleteAllKeys(CancellationToken)
Deletes all keys from the wallet
public Task DeleteAllKeys(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA 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
fingerprint
uintThe key's fingerprint
cancellationToken
CancellationTokenA 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
ids
IEnumerable<string>cancellationToken
CancellationTokenA 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
coinId
stringcancellationToken
CancellationTokenA 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
coinId
stringlatest
boolcancellationToken
CancellationTokenA 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
proof
DLProofcancellationToken
CancellationTokenA 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
index
uintcancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
spentRange
UInt32RangeconfirmedRange
UInt32RangeamountRange
UInt64RangeamountFilter
AmountFilterparentCoinIdFilter
HashFilterpuzzleHashFilter
HashFiltercoinIdFilter
HashFiltercoinType
CoinType?walletType
WalletType?walletId
uint?limit
uint?order
CoinRecordOrderoffset
uintincludeTotalCount
boolreverse
boolcancellationToken
CancellationTokenA 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
names
IEnumerable<string>The coin names
includeSpentCoins
boolFlag indicating whether to include spent coins or not
startHeight
uint?confirmation start height for search
endHeight
uint?confirmation end height for search
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetLoggedInFingerprint(CancellationToken)
Retrieves the logged in fingerprint
public Task<uint?> GetLoggedInFingerprint(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA 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
didId
stringThe DID ID
cancellationToken
CancellationTokenA 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
coinId
stringlatest
boolGet latest NFT
ignoreSizeLimit
boolreusePuzhash
bool?cancellationToken
CancellationTokenA 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
poolUri
UriThe uri of the pool (not including 'pool_info')
cancellationToken
CancellationTokenA 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
fingerprint
uintThe fingerprint
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
height
uintcancellationToken
CancellationTokenA 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
transactionId
stringThe id of the transaction to find
cancellationToken
CancellationTokenA 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
transactionId
stringcancellationToken
CancellationTokenA 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
walletIds
IEnumerable<uint>cancellationToken
CancellationTokenA 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
includeData
boolcancellationToken
CancellationTokenA 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
type
WalletTypeReturn only wallets of this type
includeData
boolcancellationToken
CancellationTokenA 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
cancellationToken
CancellationTokenA 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
fingerprint
uintThe fingerprint
cancellationToken
CancellationTokenA 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
fingerprint
uintThe fingerprint
millisecondsDelay
intThe number of milliseconds to wait each time before checking sync status
cancellationToken
CancellationTokenA 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
didId
stringnftCoinList
IEnumerable<NFTCoinInfo>reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
targetAddress
stringnftCoinList
IEnumerable<NFTCoinInfo>reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
msg
Message
PushTransactions(IEnumerable<TransactionRecord>, CancellationToken)
Pushes a list of transactions to the mempool and blockchain.
public Task PushTransactions(IEnumerable<TransactionRecord> transactions, CancellationToken cancellationToken = default)
Parameters
transactions
IEnumerable<TransactionRecord>cancellationToken
CancellationTokenA 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
spendBundle
SpendBundlecancellationToken
CancellationTokenA 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
backupData
stringcancellationToken
CancellationToken
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
amount
ulongmessage
stringIn hex
target
stringfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
enabled
boolcancellationToken
CancellationTokenA 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
enabled
boolbatchSize
ushortminAmount
ulongtxFee
ulongcancellationToken
CancellationTokenA 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
enable
boolcancellationToken
CancellationTokenA 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
message
stringaddress
stringisHex
boolcancellationToken
CancellationTokenA 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
message
stringid
stringisHex
boolcancellationToken
CancellationTokenA 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
coinIds
IEnumerable<string>batchSize
ushortfee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
signature
stringmessage
stringpubkey
stringaddress
stringsigningMode
stringcancellationToken
CancellationTokenA 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
millisecondsDelay
intThe number of milliseconds to wait each time before checking sync status
cancellationToken
CancellationTokenA 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