This section contains the different types of EVM methods that can be used in the Unity SDK. For additional operations and methods please refer to the
PlayerPrefs.GetString("Account") is the user's wallet account accessed after the LoginScene.
string account = PlayerPrefs.GetString("Account");
print(account);
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
int blockNumber = await EVM.BlockNumber(chain, network);
print(blockNumber); Some code
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string account = "WALLET_ADDRESS";
string balance = await EVM.BalanceOf(chain, network, account, rpc);
print(balance);
Verify a signed message.
string message = "YOUR_MESSAGE";
string signature = "YOUR_SIGNATURE";
string address = await EVM.Verify(message, signature);
print(address);
Print Nonce.
string chain = "cronos";
string network = "mainnet"; // mainnet or testnet
string account = "WALLET_ADDRESS";
string rpc = "https://evm-dev.cronos.org";
string nonce = await EVM.Nonce(chain, network, account, rpc);
print(nonce);
float cro = float.Parse("0.1");
float decimals = 1000000000000000000; // 18 decimals
float wei = cro * decimals;
print(Convert.ToDecimal(wei).ToString());
float wei = float.Parse("10123755");
float decimals = 1000000000000000000; // 18 decimals
float cro = wei / decimals;
print(Convert.ToDecimal(cro).ToString());