On this page

latest contributor to this doc

Last Edit:

@smk762↗

Get Token Info

API-v2get_token_info

The get_token_info method returns the ticker and decimals values (required for activation) given a platform and contract as input. The platform parent coin (e.g., ETH, AVAX, MATIC, etc.) must be activated before using this method. After requesting the token info, you will be able to activate the custom token.

Custom tokens will be wallet_only—i.e., you can send and receive tokens, but will not be able to do atomic swaps. To apply for a formal listing of the custom token, please review the requirements in our "coins" GitHub repository, and get in touch with our team on the KomodoPlatform Discord.

ParameterTypeRequiredDescription
protocolobject✓A standard TokenProtocol object.

ParameterTypeDescription
typestringToken type—e.g., PLG20 for tokens on the Polygon network.
info.symbolstringThe ticker of the token linked to the contract address and network requested.
info.decimalsintegerDefines the number of digits after the decimal point that should be used to display the orderbook amounts, balance, and the value of inputs to be used in the case of order creation or a withdraw transaction. The default value used for a UTXO type coin (Bitcoin protocol) is 8, and the default value used for an ERC20 token is 18. It is very important for this value to be set correctly. For example, if this value was set as 9 for BTC, a command to withdraw 1 BTC tries to withdraw 10^9 satoshis of Bitcoin, i.e., 10 BTC.

Get Token Info

POST
get_token_info
{
  "userpass": "RPC_UserP@SSW0RD",
  "mmrpc": "2.0",
  "method": "get_token_info",
  "params": {
    "protocol": {
      "type": "ERC20",
      "protocol_data": {
        "platform": "AVAX",
        "contract_address": "0x4f3c5C53279536fFcfe8bCafb78E612E933D53c6"
      }
    }
  }
}

ParameterTypeDescription
NoSuchCoinstringThe specified platform coin was not found or is not activated yet.