description |
---|
A standard interface for non-fungible tokens |
This section contains the different types of ERC721 methods that can be used in the Unity SDK. For additional operations and methods please refer to the ChainSafe Documentation.
Counts all ERC721 tokens assigned to an owner
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string account = "WALLET_ADDRESS";
int balance = await ERC721.BalanceOf(chain, network, contract, account);
print(balance);
Find the owner of an ERC721 token
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string tokenId = "TOKEN_ID";
string ownerOf = await ERC721.OwnerOf(chain, network, contract, tokenId);
print(ownerOf);
Balance of batch will get the balance of a list of token ids
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string[] tokenIds = {"TOKEN_ID", "TOKEN_ID"};
List<string> batchOwners = await ERC721.OwnerOfBatch(chain, network, contract, tokenIds);
foreach (string owner in batchOwners)
{
print ("OwnerOfBatch: " + owner);
}
Returns meta data about the token.
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string tokenId = "TOKEN_ID";
string uri = await ERC721.URI(chain, network, contract, tokenId);
print(uri)
Get all 721 tokens from an account
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string account = "WALLET_ADDRESS";
string contract = "";
int first = 500;
int skip = 0;
string response = await EVM.AllErc721(chain, network, account, contract, first, skip);
print(response);