const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dstAddress: '<string>',
path: {
steps: [
[
{
exchanger: {address: '<string>', fee: 1, name: '<string>', poolType: 'UniswapV2'},
percentBps: 1,
tokenIn: '<string>',
tokenOut: '<string>'
}
]
],
totalAmountOut: '<string>',
totalPriceImpact: 1,
addressTokenIn: '<string>',
addressTokenOut: '<string>',
amountIn: '<string>'
}
})
};
fetch('https://swap.ggp.gg/api/{blockchain}/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": "<string>",
"minReturnAmountOut": "<string>",
"computeUnits": 1
}POST building swap calldata for 8dx aggregation smart contract
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
dstAddress: '<string>',
path: {
steps: [
[
{
exchanger: {address: '<string>', fee: 1, name: '<string>', poolType: 'UniswapV2'},
percentBps: 1,
tokenIn: '<string>',
tokenOut: '<string>'
}
]
],
totalAmountOut: '<string>',
totalPriceImpact: 1,
addressTokenIn: '<string>',
addressTokenOut: '<string>',
amountIn: '<string>'
}
})
};
fetch('https://swap.ggp.gg/api/{blockchain}/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": "<string>",
"minReturnAmountOut": "<string>",
"computeUnits": 1
}ethereum, bsc, arbitrum Params for building swap calldata