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.
Copy 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);
Copy 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.
Copy 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.
Copy 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);#