Table of Contents

Class NFTWallet

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

Wraps an NFT wallet

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

Remarks

ctor

Constructors

NFTWallet(uint, WalletProxy)

Wraps an NFT wallet

public NFTWallet(uint walletId, WalletProxy walletProxy)

Parameters

walletId uint

The wallet_id to wrap

walletProxy WalletProxy

Wallet RPC proxy to use for communication

Remarks

ctor

Methods

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

Adds an Uri to an NFT

public Task<(SpendBundle SpendBundle, IEnumerable<TransactionRecord> Transactions)> AddUri(string uri, string key, string nftCoinId, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

uri string

The uri

key string

The type of uri:

  • u Uri for the NFT data
  • mu Uri for NFT metadata
  • lu Uri for the NFT license
nftCoinId string

The nft coin id

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

CountNFTs(CancellationToken)

Retrieves the number of NFTs in a wallet.

public Task<int> CountNFTs(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<int>

The number of NFTs in the wallet

GetDID(CancellationToken)

Gets the DID

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

Parameters

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<string>

The Did

GetNFTs(int, int, bool, CancellationToken)

Gets NFTs from a wallet

public Task<IEnumerable<NFTInfo>> GetNFTs(int startIndex = 0, int num = 0, bool ignoreSizeLimit = false, CancellationToken cancellationToken = default)

Parameters

startIndex int
num int
ignoreSizeLimit bool
cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task<IEnumerable<NFTInfo>>

A list of NFTInfo

Mint(NFTMintingInfo, bool?, ulong, CancellationToken)

Mints an NFT

public Task<(SpendBundle SpendBundle, string NftId, IEnumerable<TransactionRecord> Transactions)> Mint(NFTMintingInfo info, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

info NFTMintingInfo

Info about the NFT to be minted

reusePuzhash bool?
fee ulong

Fee (in units of mojos)

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

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

A SpendBundle

MintBulk(NFTBulkMintingInfo, bool?, ulong, CancellationToken)

Mints an set NFTs in bulk

public Task<(SpendBundle SpendBundle, IEnumerable<string> NftIdList, IEnumerable<TransactionRecord> Transactions)> MintBulk(NFTBulkMintingInfo info, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

info NFTBulkMintingInfo

A list of dictionaries containing the metadata for each NFT to be minted

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<string> NftIdList, IEnumerable<TransactionRecord> Transactions)>

SpendBundle and a list of string

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

Sets the DID for an NFT

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

Parameters

didId string

The DID ID

nftCoinId string

The coin id for the nft

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)>

A SpendBundle

SetStatus(string, bool, CancellationToken)

Sets the status of an NFT

public Task SetStatus(string coinId, bool inTransaction = true, CancellationToken cancellationToken = default)

Parameters

coinId string

The coin ID

inTransaction bool

In transaction indicator

cancellationToken CancellationToken

A token to allow the call to be cancelled

Returns

Task

An awaitable Task

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

Sets the status of an NFT

public Task<(SpendBundle SpendBudle, IEnumerable<TransactionRecord> Transactions)> Transfer(string targetAddress, string coinId, bool? reusePuzhash = null, ulong fee = 0, CancellationToken cancellationToken = default)

Parameters

targetAddress string

The target address

coinId string

The coin ID

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)>

A SpendBundle

Validate(CancellationToken)

Validates that WalletId is a NFT

public override Task Validate(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
Wraps an NFT wallet

Returns

Task

True if the wallet is an NFT wallet