Returns swap events for the user
Supported on: Ethereum Base BNB Chain Optimism Polygon Sonic Unichain Robinhood Chain Arbitrum Avalanche Cronos ZKsync Gnosis HyperEVM Arc Monad
Parameters
address
* string pathAccount address
Request Body
filter
*HistorySwapFilterDto object chain_ids
* array items
string token_address_from
*UnifiedTokenAddress object token_address_to
*UnifiedTokenAddress object limit
number to_time_ms
object JavaScript
Copy
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
const axios = require('axios');
async function httpCall() {
const url =
'https://api.1inch.com/history/v2.0/history/{address}/events/swaps';
const config = {
headers: {
Authorization: `Bearer ${API_KEY}`,
},
params: {},
paramsSerializer: {
indexes: null,
},
};
const body = {
filter: {
chain_ids: ['string'],
token_address_from: {},
token_address_to: {},
limit: 0,
to_time_ms: null,
},
};
try {
const response = await axios.post(url, body, config);
console.log(response.data);
} catch (error) {
console.error(error);
}
}
Returns
items
HistoryEventResponseDto object item
* object cache_counter
* number JSON
Copy
1
2
3
4
5
6
7
[
{
"item": null,
"cache_counter": 0
}
]