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
  }
}

{
  "mmrpc": "2.0",
  "result": {
    "tokens": {
      "0x328c4c80bc7aca0834db37e6600a6c49e12da4de": {
        "address": "0x328c4c80bc7aca0834db37e6600a6c49e12da4de",
        "symbol": "aSNXv1",
        "name": "Aave Interest bearing SNX",
        "decimals": 18,
        "eip2612": false,
        "isFoT": false,
        "logoURI": "https://tokens.1inch.io/0x328c4c80bc7aca0834db37e6600a6c49e12da4de.png",
        "tags": [
          "crosschain",
          "tokens"
        ]
      },
      "0x5165d24277cd063f5ac44efd447b27025e888f37": {
        "address": "0x5165d24277cd063f5ac44efd447b27025e888f37",
        "symbol": "aYFI",
        "name": "Aave interest bearing YFI",
        "decimals": 18,
        "eip2612": true,
        "isFoT": false,
        "logoURI": "https://tokens.1inch.io/0x5165d24277cd063f5ac44efd447b27025e888f37.png",
        "tags": [
          "crosschain",
          "tokens"
        ]
      },
      "0xce111a198eb04f388aceb78c40ced6daf1b0514a": {
        "address": "0xce111a198eb04f388aceb78c40ced6daf1b0514a",
        "symbol": "REALTOKEN-272-NE42nd-COURT-DEERFIELDBEACH-FL",
        "name": "RealToken S 272 N.E. 42nd Court Deerfield Beach FL",
        "decimals": 18,
        "eip2612": false,
        "isFoT": false,
        "logoURI": "https://tokens.1inch.io/0xe5f7ef61443fc36ae040650aa585b0395aef77c8.png",
        "tags": [
          "crosschain",
          "tokens"
        ]
      }
    }
  }
}