Table of Contents

Class WalletProxy

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

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 IRpcClient

IRpcClient instance to use for rpc communication

originService string

Origin

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 CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

The new key's fingerprint

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 CancellationToken

A 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 uint

The key's fingerprint

cancellationToken CancellationToken

A 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 string

The wallet name

amount ulong

The amount to put in the wallet (in units of mojos)

fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 ulong

The amount to put in the wallet (in units of mojos)

fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 ulong

The number of back ids needed to create the wallet

name string
metaData IDictionary<string, string>
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(WalletType Type, string AssetID, uint WalletId)>

Information about the wallet

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 string
filterAmount ulong
cancellationToken CancellationToken

A 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 string

An optional DID ID

cancellationToken CancellationToken

A 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 DAORules
amountOfCats ulong?
filterAmount ulong
feeForCat ulong

Fee (in units of mojos)

fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 string
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 PoolState

The desired initial state of the wallet

p2SingletonDelayTime ulong?

Delay time to create the wallet

p2SingletonDelayedPH string

A delayed address (can be null or empty to not use)

cancellationToken CancellationToken

A 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 ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 string

The id of the CAT

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(WalletType Type, string AssetID, uint WalletId)>

The wallet type

DeleteAllKeys(CancellationToken)

Deletes all keys from the wallet

public Task DeleteAllKeys(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

DeleteKey(uint, CancellationToken)

Deletes a specific key from the wallet

public Task DeleteKey(uint fingerprint, CancellationToken cancellationToken = default)

Parameters

fingerprint uint

The key's fingerprint

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

DeleteNotifications(IEnumerable<string>, CancellationToken)

Deletes notifications.

public Task DeleteNotifications(IEnumerable<string> ids, CancellationToken cancellationToken = default)

Parameters

ids IEnumerable<string>
cancellationToken CancellationToken

A 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 string
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

string

DidGetInfo(string, bool, CancellationToken)

Retrieves information about a DID.

public Task<DIDInfo> DidGetInfo(string coinId, bool latest = true, CancellationToken cancellationToken = default)

Parameters

coinId string
latest bool
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<DIDInfo>

An awaitable Task

DlVerifyProof(DLProof, CancellationToken)

Verifies a proof.

public Task<(bool CurrentRoot, ProofResultInclusions VerifiedClvmHashes)> DlVerifyProof(DLProof proof, CancellationToken cancellationToken = default)

Parameters

proof DLProof
cancellationToken CancellationToken

A 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 uint
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

uint

GenerateMnemonic(CancellationToken)

Generates a new mnemonic phrase

public Task<IEnumerable<string>> GenerateMnemonic(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A 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 CancellationToken

A token to allow the call to be cancelled

Returns

Task<AutoClaimSettings>

AutoClaimSettings

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 UInt32Range
confirmedRange UInt32Range
amountRange UInt64Range
amountFilter AmountFilter
parentCoinIdFilter HashFilter
puzzleHashFilter HashFilter
coinIdFilter HashFilter
coinType CoinType?
walletType WalletType?
walletId uint?
limit uint?
order CoinRecordOrder
offset uint
includeTotalCount bool
reverse bool
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(IEnumerable<CoinRecord> CoinRecords, int? TotalCount)>

IEnumerable<T>

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 bool

Flag indicating whether to include spent coins or not

startHeight uint?

confirmation start height for search

endHeight uint?

confirmation end height for search

cancellationToken CancellationToken

A 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 CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

uint

GetFarmedAmount(CancellationToken)

Get the amount farmed

public Task<(ulong FarmedAmount, ulong FarmerRewardAmount, ulong FeeAmount, uint LastHeightFarmed, ulong PoolRewardAmount)> GetFarmedAmount(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A 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 CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

Current block height

GetLoggedInFingerprint(CancellationToken)

Retrieves the logged in fingerprint

public Task<uint?> GetLoggedInFingerprint(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint?>

The logged in fingerprint

GetNFTByDID(string, CancellationToken)

Get an NFT wallet by DID ID

public Task<uint> GetNFTByDID(string didId, CancellationToken cancellationToken = default)

Parameters

didId string

The DID ID

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

The wallet id

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 string
latest bool

Get latest NFT

ignoreSizeLimit bool
reusePuzhash bool?
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<NFTInfo>

The wallet id

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 Uri

The uri of the pool (not including 'pool_info')

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<PoolInfo>

PoolInfo that can be used to create a pool wallet and join this pool

GetPrivateKey(uint, CancellationToken)

Get the private key accessible by the wallet

public Task<PrivateKey> GetPrivateKey(uint fingerprint, CancellationToken cancellationToken = default)

Parameters

fingerprint uint

The fingerprint

cancellationToken CancellationToken

A 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 CancellationToken

A 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 CancellationToken

A token to allow the call to be cancelled

Returns

Task<(bool GenesisInitialized, bool Synced, bool Syncing)>

The current sync status

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 uint
cancellationToken CancellationToken

A 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 string

The id of the transaction to find

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<TransactionRecord>

The TransactionRecord

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 string
cancellationToken CancellationToken

A 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 CancellationToken

A 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 bool
cancellationToken CancellationToken

A 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 WalletType

Return only wallets of this type

includeData bool
cancellationToken CancellationToken

A 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 CancellationToken

A 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 uint

The fingerprint

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

The key fingerprint

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 uint

The fingerprint

millisecondsDelay int

The number of milliseconds to wait each time before checking sync status

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<uint>

The key fingerprint

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 string
nftCoinList IEnumerable<NFTCoinInfo>
reusePuzhash bool?
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 string
nftCoinList IEnumerable<NFTCoinInfo>
reusePuzhash bool?
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 CancellationToken

A 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 SpendBundle
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<bool>

Indicator of whether the spend bundle was successfully included in the mempool

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 string
cancellationToken CancellationToken

Returns

Task<(WalletType Type, string MyDID, uint WalletId, string CoinName, Coin coin, string NewPuzHash, string Pubkey, IEnumerable<byte> BackupDIDs, ulong NumVerificationsRequired)>

Exceptions

ArgumentNullException

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 ulong
message string

In hex

target string
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<TransactionRecord>

TransactionRecord

SetAutoClaim(bool, CancellationToken)

Set auto claim merkle coins config

public Task<AutoClaimSettings> SetAutoClaim(bool enabled, CancellationToken cancellationToken = default)

Parameters

enabled bool
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<AutoClaimSettings>

AutoClaimSettings

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 bool
batchSize ushort
minAmount ulong
txFee ulong
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<AutoClaimSettings>

AutoClaimSettings

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 bool
cancellationToken CancellationToken

A 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 string
address string
isHex bool
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string PubKey, string Signature, string SigningMode)>

PubKey, Signature, and SigningMode

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 string
id string
isHex bool
cancellationToken CancellationToken

A 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 ushort
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A 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 string
message string
pubkey string
address string
signingMode string
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<bool>

bool

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 int

The number of milliseconds to wait each time before checking sync status

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

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