Get Token Info

get_token_infoAPI-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.

Request Parameters

Parameter Type Required Description
protocol object A standard TokenProtocol object.

Response Parameters

Parameter Type Required Description
type string Token type—e.g., PLG20 for tokens on the Polygon network.
info.symbol string The ticker of the token linked to the contract address and network requested.
info.decimals integer Defines 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.

📌 Examples

POST Get Token Info 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"
      }
    }
  }
}
Show Get Token Info Response

Response (success)

{
    "mmrpc": "2.0",
    "result": {
        "type": "ERC20",
        "info": {
            "symbol": "PNIC",
            "decimals": 18
        }
    },
    "id": null
}

Error Types

Parameter Type Required Description
NoSuchCoin string The specified platform coin was not found or is not activated yet.
Show Error Responses

⚠️ Error Responses

NoSuchCoin
{
    "mmrpc": "2.0",
    "error": "No such coin AVAX",
    "error_path": "tokens.lp_coins",
    "error_trace": "tokens:68] lp_coins:4744]",
    "error_type": "NoSuchCoin",
    "error_data": {
        "coin": "AVAX"
    },
    "id": null
}