Class NFTWallet
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
uintThe wallet_id to wrap
walletProxy
WalletProxyWallet 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
stringThe uri
key
stringThe type of uri:
- u Uri for the NFT data
- mu Uri for NFT metadata
- lu Uri for the NFT license
nftCoinId
stringThe nft coin id
reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
CountNFTs(CancellationToken)
Retrieves the number of NFTs in a wallet.
public Task<int> CountNFTs(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
GetDID(CancellationToken)
Gets the DID
public Task<string> GetDID(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
intnum
intignoreSizeLimit
boolcancellationToken
CancellationTokenA 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
NFTMintingInfoInfo about the NFT to be minted
reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
NFTBulkMintingInfoA list of dictionaries containing the metadata for each NFT to be minted
reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA 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
stringThe DID ID
nftCoinId
stringThe coin id for the nft
reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
SetStatus(string, bool, CancellationToken)
Sets the status of an NFT
public Task SetStatus(string coinId, bool inTransaction = true, CancellationToken cancellationToken = default)
Parameters
coinId
stringThe coin ID
inTransaction
boolIn transaction indicator
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
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
stringThe target address
coinId
stringThe coin ID
reusePuzhash
bool?fee
ulongFee (in units of mojos)
cancellationToken
CancellationTokenA token to allow the call to be cancelled
Returns
Validate(CancellationToken)
public override Task Validate(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationToken- Wraps an NFT wallet
Returns
- Task
True if the wallet is an NFT wallet