Token Module
2.1 Get Native Token Balance
get_native_balanceaddress (str): The address to get the balance for (CronosIds with the `.cro` suffix are supported, e.g. `xyz.cro`)from crypto_com_developer_platform_client import Token balance = Token.get_native_balance('example-wallet') print(balance)
The balance of the native token.ValueError: If the Token class is not initialized with a Client instance.{'status': 'Success', 'data': {'balance': 'example-balance'}}
getNativeTokenBalance{string} address: The wallet address (or CronosId `.cro`) to check.import { Token } from '@crypto.com/developer-platform-client'; try { const balance = await Token.getNativeTokenBalance('example-wallet'); console.log(balance); } catch(err) { console.log(err); }
{Promise<ApiResponse<Balance>>}: A promise that resolves to the native token balance.{Error}: Throws an error if the request fails.{ status: 'Success', data: { balance: 'example-balance' } }
2.2 Get ERC20 Token Balance
get_erc20_balancewallet_address (str): The address to get the balance for (CronosIds with the `.cro` suffix are supported, e.g. `xyz.cro`) contract_address (str): The contract address to get the balance for. block_height (str): The block height to get the balance for.from crypto_com_developer_platform_client import Token balance = Token.get_erc20_balance('example-wallet', 'example-contract', 'latest') print(balance)
The balance of the ERC20 token.ValueError: If the Token class is not initialized with a Client instance.{'status': 'Success', 'data': {'balance': 'example-balance'}}
getERC20TokenBalance{string} address: The wallet address (or CronosId `.cro`) to check. {string} contractAddress: The ERC20 contract address. {string} [blockHeight='latest']: Optional block height (default 'latest').import { Token } from '@crypto.com/developer-platform-client'; try { const balance = await Token.getERC20TokenBalance('example-wallet', 'example-contract'); console.log(balance); } catch(err) { console.log(err); }
{Promise<ApiResponse<TokenBalance>>}: A promise that resolves to the ERC20 token balance.{Error}: Throws an error if the request fails.{ status: 'Success', data: { balance: 'example-balance' } }
2.3 Transfer Token
2.4 Wrap Token
2.5 Swap Token
2.6 Get ERC721 Token Balance
2.7 Get ERC721 Token Owner
2.8 Get Token URI
2.9 Get ERC721 Metadata
2.10 Get ERC20 Metadata
Last updated
Was this helpful?