get_token_allowance

The get_token_allowance method returns token allowance for address.

Refer to the 1inch Classic Swap documentation for more information.

Arguments

StructureTypeDescription
coinstringToken ticker
spenderstringSmart contract address to query spendable coins amount granted prior approval

Response

StructureTypeDescription
resultfloatAmount of coins approved for spending via the smart contract (in coins units).

📌 Examples

Command

POST get_token_allowance
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "get_token_allowance",
  "params": {
    "coin": "AAVE-PLG20",
    "spender": "0x083C32B38e8050473f6999e22f670d1404235592"
  }
}
Show Response

Response: Success

{
  "mmrpc": "2.0",
  "result": "1.23",
  "id": null
}
Show Error Responses

Error: Token config not activated

{
    "mmrpc": "2.0",
    "error": "No such coin USDT-ERC20",
    "error_path": "tokens",
    "error_trace": "tokens:171]",
    "error_type": "NoSuchCoin",
    "error_data": {
        "coin": "USDT-ERC20"
    },
    "id": null
}