Get quote with custom preset details (v1.2 with fee support)

POSThttps://api.1inch.com/fusion-plus/quoter/v1.2/quote/receive
Supported on:
EthereumBaseSolanaBNB ChainGnosisOptimismPolygonLineaSonicUnichainArbitrumAvalancheZKsync

Parameters

srcChain
* number query
dstChain
* number query
srcTokenAddress
* string query
dstTokenAddress
* string query
amount
* string query
walletAddress
* string query
enableEstimate
* boolean query
isPermit2
string query
fee
number query
feeReceiver
string query
permit
string query

Request Body

CustomPresetParams object
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
const axios = require('axios');

async function httpCall() {
  const url = 'https://api.1inch.com/fusion-plus/quoter/v1.2/quote/receive';

  const config = {
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
    params: {
      srcChain: 1,
      dstChain: 137,
      srcTokenAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
      dstTokenAddress: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
      amount: '100000000000000000',
      walletAddress: '0x0000000000000000000000000000000000000000',
      enableEstimate: false,
    },
    paramsSerializer: {
      indexes: null,
    },
  };
  const body = {};

  try {
    const response = await axios.post(url, body, config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
}

Returns

200
400
default

200 response doesn’t have payload.

Did you find what you need?