Search
⌘K
Classic Swap
API version: All versions
Introduction
Quick start
Methods
Find the best quote to swap with 1inch Router GET
Generate calldata to swap on 1inch Router GET
Address of the 1inch Router that is trusted to spend funds for the swap GET
Generate approve calldata to allow 1inch Router to perform a swap GET
Get the number of tokens that the 1inch Router is allowed to swap GET
List of liquidity sources that are available for routing in the 1inch Aggregation Protocol GET
List of tokens that are available for swap in the 1inch Aggregation protocol GET
Migration
Migration from v5.0 to v5.2
Migration from v5.2 to v6.0
Migration from v6.0 to v6.1
Docs·APIs·Swap API·Classic Swap·Migration·Migration from v6.0 to v6.1

Migration from v6.0 to v6.1

The following changes must be made when migrating from v6.0 to v6.1.

Changes in /swap and /quote responses

Structural updates

  • The protocols[][][] structure remains, but the format of protocol data has changed.
  • fromTokenAddress and toTokenAddress have been removed. Instead, a single token field is used at a higher level.

Changed and renamed parameters

  • fromTokenAddress → Removed (source token is now referenced at the top level).

  • toTokenAddress → Removed (destination is now handled via dst).

  • name → Moved inside protocols array within swaps.

  • part → Now nested inside swaps and protocols.

Compare the old version of that part of response with a new one below.

Old response example

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"protocols": [
  [
    [
      {
        "name": "UNISWAP_V2",
        "part": 2,
        "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
      },
      {
        "name": "UNISWAP_V4",
        "part": 2,
        "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
      },
      {
        "name": "SUSHI",
        "part": 4,
        "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
      },
      {
        "name": "UNISWAP_V3",
        "part": 6,
        "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
      },
      {
        "name": "UNISWAP_V3",
        "part": 86,
        "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "toTokenAddress": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
      }
    ],
  //...
  ]
]

New response example

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"protocols": [
    {
      "token": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
      "hops": [
        {
          "part": 62.5,
          "dst": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "fromTokenId": 0,
          "toTokenId": 1,
          "protocols": [
            {
              "name": "UNISWAP_V4",
              "part": 1
            },
            {
              "name": "CURVE_V2_TRICRYPTO_NG",
              "part": 1
            },
            {
              "name": "UNISWAP_V3",
              "part": 1
            },
            {
              "name": "UNISWAP_V2",
              "part": 3
            },
            {
              "name": "UNISWAP_V3",
              "part": 5
            },
            {
              "name": "UNISWAP_V3",
              "part": 20
            },
            {
              "name": "FLUID_DEX_T1",
              "part": 69
            }
          ]
        }
      //...
      ]
    }
  ]

For full schemas, see Swagger documentation for the /swap and /quote endpoints.

If you disabled includeProtocols, change the version to a newer one. No additional actions are required.

Did you find what you need?