get_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 recieve 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 our with our team on the KomodoPlatform Discord.
Structure | Type | Description |
---|---|---|
protocol.type | string | Token type - e.g ERC20 for tokens on the Ethereum network |
protocol.protocol_data | object | Required for tokens only. |
protocol.protocol_data.platform | string | The parent coin of the token's platform - e.g MATIC for PLG20 tokens |
protocol.protocol_data.contract_address | string | Must be mixed case The identifying hex string for the token's contract. Can be found on sites like EthScan, BscScan & PolygonScan |
Structure | Type | 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 a 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"
}
}
}
}
{
"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
}