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.
Structure | Type | Description |
---|---|---|
chain_id | numeric | Chain id |
Structure | Type | Description |
---|---|---|
dst_amount | number | Destination token amount, in coins units. |
tokens | list | Optional. A list of standard 1inchTokenInfo objects showing available tokens for trade. |
Structure | Type | Description |
---|---|---|
address | string | Token contract address. |
symbol | string | Token symbol. |
name | string | Token name. |
decimals | numeric | Number of digits after decimal point for the token amount. |
eip2612 | boolean | Is Eip-2612 supported. |
is_fot | boolean | Is FoT token. |
logo_uri | string | Token logo uri. |
tags | list | Token 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
}
}