Skip to main content
POST
/
api
/
{blockchain}
/
swap
JavaScript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    dstAddress: '<string>',
    path: {
      steps: [
        [
          {
            exchanger: {
              address: '<string>',
              extraFeeMask: [1],
              fee: 1,
              name: '<string>',
              poolType: 'WrappedToken'
            },
            percentBps: 1,
            tokenIn: '<string>',
            tokenOut: '<string>'
          }
        ]
      ],
      totalAmountOut: '<string>',
      totalPriceImpact: 1,
      addressTokenIn: '<string>',
      addressTokenOut: '<string>',
      amountIn: '<string>'
    },
    deadline: 1,
    fromAddress: '<string>',
    permit: '<unknown>',
    skipSimulation: true,
    slippageBps: 1,
    usePermit: true
  })
};

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
}

Path Parameters

blockchain
enum<string>
required
Available options:
ethereum,
bsc,
arbitrum

Body

application/json
dstAddress
string
required
path
object
required
deadline
integer<int64> | null
Required range: x >= 0
fromAddress
string | null
permit
object
skipSimulation
boolean | null
slippageBps
integer<int32> | null
Required range: x >= 0
usePermit
boolean | null

Response

data
string
required
minReturnAmountOut
string
required
computeUnits
integer<int64> | null
Required range: x >= 0