Table of Contents

Class DIDWallet

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

Wraps a Distributed Identity Wallet

public sealed class DIDWallet : Wallet
Inheritance
DIDWallet
Inherited Members
Extension Methods

Remarks

ctor

Constructors

DIDWallet(uint, WalletProxy)

Wraps a Distributed Identity Wallet

public DIDWallet(uint walletId, WalletProxy walletProxy)

Parameters

walletId uint

The wallet_id to wrap

walletProxy WalletProxy

Wallet RPC proxy to use for communication

Remarks

ctor

Methods

CreateAttest(string, string, string, CancellationToken)

Create an attest file

public Task<(string MessageSpendBundle, (string Parent, string InnerPuzzleHash, ulong Amount) Info, string AttestData, IEnumerable<TransactionRecord> Transactions)> CreateAttest(string coinName, string pubkey, string puzHash, CancellationToken cancellationToken = default)

Parameters

coinName string

The coin name

pubkey string

The public key

puzHash string

The puzzlehash

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string MessageSpendBundle, (string Parent, string InnerPuzzleHash, ulong Amount) Info, string AttestData, IEnumerable<TransactionRecord> Transactions)>

A spendbundle and information about the attest

CreateBackupFile(CancellationToken)

Create a backup of the wallet

public Task<string> CreateBackupFile(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

The backup data

GetCurrentCoinInfo(CancellationToken)

Gets information about the DID wallets current coin

public Task<(string MyDid, string Parent, string InnerPuzzle, ulong Amount)> GetCurrentCoinInfo(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string MyDid, string Parent, string InnerPuzzle, ulong Amount)>

The coin info

GetDid(CancellationToken)

Get the distributed identity and coin if present

public Task<(string MyDid, string? CoinID)> GetDid(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string MyDid, string CoinID)>

A DID and optional CoinID

GetInformationNeededForRecovery(CancellationToken)

Create an attestment

public Task<(string MyDID, string CoinName, string NewPuzzleHash, string PublicKey, IEnumerable<byte> BackUpIds)> GetInformationNeededForRecovery(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(string MyDID, string CoinName, string NewPuzzleHash, string PublicKey, IEnumerable<byte> BackUpIds)>

A spendbundle and information about the attest

GetMetadata(CancellationToken)

Updates the metadata

public Task<IDictionary<string, string>> GetMetadata(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IDictionary<string, string>>

The metadata

GetName(CancellationToken)

Get the wallet name

public Task<string> GetName(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

The name

GetPubKey(CancellationToken)

Get the wallet pubkey

public Task<string> GetPubKey(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

The pubkey

GetRecoveryList(CancellationToken)

Get the recover list

public Task<(IEnumerable<string> RecoverList, int NumRequired)> GetRecoveryList(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(IEnumerable<string> IPs, int Total)>

The recover list and num required property of the wallet

MessageSpend(IEnumerable<string>, IEnumerable<string>, CancellationToken)

Spends a DID message.

public Task<SpendBundle> MessageSpend(IEnumerable<string> puzzleAnnouncements, IEnumerable<string> coinAnnouncements, CancellationToken cancellationToken = default)

Parameters

puzzleAnnouncements IEnumerable<string>
coinAnnouncements IEnumerable<string>
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<SpendBundle>

SpendBundle

RecoverySpend(IEnumerable<string>, string?, string?, CancellationToken)

Recovery spend

public Task<(SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)> RecoverySpend(IEnumerable<string> attestData, string? pubkey, string? puzzlehash, CancellationToken cancellationToken = default)

Parameters

attestData IEnumerable<string>

List of attest messages. Must be >= num_of_backup_ids_needed

pubkey string

The public key

puzzlehash string

The puzzlehash of the spend

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)>

An SpendBundle

SetName(string, CancellationToken)

Sets the name

public Task SetName(string name, CancellationToken cancellationToken = default)

Parameters

name string

The name

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

Spend(string, CancellationToken)

Spend from the DID wallet

public Task Spend(string puzzlehash, CancellationToken cancellationToken = default)

Parameters

puzzlehash string

The puzzle-hash to spend

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

Transfer(string, bool, bool?, ulong, CancellationToken)

Transfer the DID wallet to another owner

public Task<(TransactionRecord Transaction, IEnumerable<TransactionRecord> Transactions)> Transfer(string innerAddress, bool withRecoveryInfo = true, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

innerAddress string

the address

withRecoveryInfo bool

Indicator whether to include recovery info

reusePuzhash bool?
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(TransactionRecord txRecord, IEnumerable<TransactionRecord> transactions)>

The backup data

UpdateMetadata(string, bool?, ulong, CancellationToken)

Updates the metadata

public Task<(SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)> UpdateMetadata(string metadata, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

metadata string

The name

reusePuzhash bool?
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<(SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)>

An SpendBundle

UpdateRecoveryIds(IEnumerable<string>, ulong?, bool?, CancellationToken)

Updates recovery ID's

public Task<IEnumerable<TransactionRecord>> UpdateRecoveryIds(IEnumerable<string> newList, ulong? numVerificationsRequired = null, bool? reusePuzhash = null, CancellationToken cancellationToken = default)

Parameters

newList IEnumerable<string>

The new ids

numVerificationsRequired ulong?

The number of verifications required

reusePuzhash bool?
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IEnumerable<TransactionRecord>>

A ist of TransactionRecords

UpdateRecoveryIds(IEnumerable<string>, ulong, CancellationToken)

Updates recovery ID's

public Task<IEnumerable<TransactionRecord>> UpdateRecoveryIds(IEnumerable<string> newList, ulong numVerificationsRequired, CancellationToken cancellationToken = default)

Parameters

newList IEnumerable<string>

The new ids

numVerificationsRequired ulong

The number of verifications required

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IEnumerable<TransactionRecord>>

A ist of TransactionRecords

Validate(CancellationToken)

Validates that WalletId is a DISTRIBUTED_ID

public override Task Validate(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Wraps a Distributed Identity Wallet

Returns

Task

True if the wallet is a DID wallet