On this page

latest contributor to this doc

Last Edit:

@smk762

1inch_v6_0_classic_swap_tokens

The 1inch_v6_0_classic_swap_tokens method returns tokens for classic swaps from 1inch API version 6.0.

To use methods which interface with the 1inch API, you need to set the 1inch_api url in your MM2.json file. You'll also need to set your 1inch API key as an environment variable called ONE_INCH_API_TEST_AUTH, e.g. ONE_INCH_API_TEST_AUTH="Bearer YourAPIkey".

As this feature is still experimental, you will need to build KDF from source on the dev branch with a build flag, e.g. cargo build --features test-ext-api.

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

StructureTypeDescription
chain_idnumericChain id

StructureTypeDescription
dst_amountnumberDestination token amount, in coins units.
tokenslistOptional. A list of standard 1inchTokenInfo objects showing available tokens for trade.

StructureTypeDescription
addressstringToken contract address.
symbolstringToken symbol.
namestringToken name.
decimalsnumericNumber of digits after decimal point for the token amount.
eip2612booleanIs Eip-2612 supported.
is_fotbooleanIs FoT token.
logo_uristringToken logo uri.
tagslistToken tags.

POST
1inch_v6_0_classic_swap_tokens
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "1inch_v6_0_classic_swap_tokens",
  "params": {
    "chain_id": 1
  }
}