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
}
}ethereum, bsc, arbitrum Source token contract address (ERC20 or native token)
Destination token contract address (ERC20 or native token)
Amount of source token to swap (in token's normalized unit, e.g., eth for ETH)
Quote for aggregation swap through POST /{blockchain}/swap
Show child attributes