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
walletIduintThe wallet_id to wrap
walletProxyWalletProxyWallet 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
uristringThe uri
keystringThe type of uri:
- u Uri for the NFT data
- mu Uri for NFT metadata
- lu Uri for the NFT license
nftCoinIdstringThe nft coin id
reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetDID(CancellationToken)
Gets the DID
public Task<string> GetDID(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
startIndexintnumintignoreSizeLimitboolcancellationTokenCancellationTokenA 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
infoNFTMintingInfoInfo about the NFT to be minted
reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
infoNFTBulkMintingInfoA list of dictionaries containing the metadata for each NFT to be minted
reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
didIdstringThe DID ID
nftCoinIdstringThe coin id for the nft
reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA 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
coinIdstringThe coin ID
inTransactionboolIn transaction indicator
cancellationTokenCancellationTokenA 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
targetAddressstringThe target address
coinIdstringThe coin ID
reusePuzhashbool?feeulongFee (in units of mojos)
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
Validate(CancellationToken)
public override Task Validate(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken- Wraps an NFT wallet
Returns
- Task
True if the wallet is an NFT wallet