description |
---|
A standard interface for contracts that manage multiple token types. A single deployed contract may include any combination of fungible tokens, non-fungible tokens or other configurations |
This section contains the different types of ERC1155 methods that can be used in the Unity SDK. For additional operations and methods please refer to the ChainSafe Documentation.
Counts all ERC1155 tokens assigned to an owner
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string account = "WALLET_ADDRESS";
string tokenId = "TOKEN_ID";
BigInteger balanceOf = await ERC1155.BalanceOf(chain, network, contract, account, tokenId);
print(balanceOf);
Balance of batch will get the balance of a list of accounts and token ids
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string contract = "CONTRACT_ADDRESS";
string[] accounts = { "WALLET_ADDRESS", "WALLET_ADDRESS" };
string[] tokenIds = { "TOKEN_ID", "TOKEN_ID" };
List<BigInteger> batchBalances = await ERC1155.BalanceOfBatch(chain, network, contract, accounts, tokenIds);
foreach (var balance in batchBalances)
{
print ("BalanceOfBatch: " + balance);
}
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 ERC1155.URI(chain, network, contract, tokenId);
print(uri);
Get all 1155 tokens from an account.
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string account = "WALLET_ADDRESS";
string contract = "CONTRACT_ADDRESS";
int first = 500;
int skip = 0;
string response = await EVM.AllErc1155(chain, network, account, contract, first, skip);
print(response);#