This request doesn’t have any request body.
const axios = require('axios');
async function httpCall() {
const url = 'https://api.1inch.com/swap/v6.1/{chain}/swap';
const config = {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: {
src: '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
dst: '0x111111111117dc0aa78b770fa6a738034120c302',
amount: '10000000000000000',
slippage: 1,
minReturn: '1000000000000000000',
},
paramsSerializer: {
indexes: null,
},
};
const body = {};
try {
const response = await axios.get(url, body, config);
console.log(response.data);
} catch (error) {
console.error(error);
}
}
{
"srcToken": {
"address": "0x111111111117dc0aa78b770fa6a738034120c302",
"symbol": "1INCH",
"name": "1INCH Token",
"decimals": 18,
"logoURI": "https://tokens.1inch.io/0x111111111117dc0aa78b770fa6a738034120c302.png",
"domainVersion": "string",
"eip2612": true,
"isFoT": false,
"tags": ["tokens"]
},
"dstToken": {
"address": "0x111111111117dc0aa78b770fa6a738034120c302",
"symbol": "1INCH",
"name": "1INCH Token",
"decimals": 18,
"logoURI": "https://tokens.1inch.io/0x111111111117dc0aa78b770fa6a738034120c302.png",
"domainVersion": "string",
"eip2612": true,
"isFoT": false,
"tags": ["tokens"]
},
"dstAmount": "62131879850006790961",
"protocols": [
{
"token": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"hops": [
{
"part": 100,
"dst": "0x111111111117dc0aa78b770fa6a738034120c302",
"fromTokenId": 0,
"toTokenId": 1,
"protocols": [
{
"name": "UNISWAP_V3",
"part": 100
}
]
}
]
}
],
"tx": {
"from": "0x1111111111111111111111111111111111111111",
"to": "0x1111111254eeb25477b68fb85ed929f73a960582",
"data": "0x0502b1c50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000003556e53186804ca3e0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000180000000000000003b6d034026aad2da94c59524ac0d93f6d6cbf9071d7086f2",
"value": "10000000000000000",
"gasPrice": "6994090150",
"gas": 121363
}
}