const options = {method: 'GET'};
fetch('https://swap.ggp.gg/api/{blockchain}/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"rawTotalGasEstimate": 1,
"steps": [
[
{
"exchanger": {
"address": "<string>",
"fee": 1,
"name": "<string>",
"poolType": "UniswapV2"
},
"amountIn": "<string>",
"amountOut": "<string>",
"percentBps": 1,
"tokenIn": "<string>",
"tokenOut": "<string>",
"priceImpact": 1
}
]
],
"totalAmountOut": "<string>",
"totalPriceImpact": 1,
"addressTokenIn": "<string>",
"addressTokenOut": "<string>",
"amountIn": "<string>",
"amountInUsd": 123,
"amountOutUsd": 123,
"usdDifference": 123
}
}GET quote for aggregation swap
const options = {method: 'GET'};
fetch('https://swap.ggp.gg/api/{blockchain}/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"rawTotalGasEstimate": 1,
"steps": [
[
{
"exchanger": {
"address": "<string>",
"fee": 1,
"name": "<string>",
"poolType": "UniswapV2"
},
"amountIn": "<string>",
"amountOut": "<string>",
"percentBps": 1,
"tokenIn": "<string>",
"tokenOut": "<string>",
"priceImpact": 1
}
]
],
"totalAmountOut": "<string>",
"totalPriceImpact": 1,
"addressTokenIn": "<string>",
"addressTokenOut": "<string>",
"amountIn": "<string>",
"amountInUsd": 123,
"amountOutUsd": 123,
"usdDifference": 123
}
}