Get Call Data
Generate the complete calldata required to execute a token swap transaction on-chain. This API prepares the encoded calldata based on the selected route, amount, tokens, slippage, and fee configurations. It supports both same-chain and cross-chain swaps and includes optional permit data for approvals. Check out the getCallData
API template script for implementation details.
Authorization
x-authorization-secret
<token>Trade Service Secret (set this to the value of TRADE_SERVICE_SECRET from .env)
In: header
Request Body
application/json
RequiredrouteId
RequiredstringfromToken
RequiredstringfromChain
RequiredstringtoToken
RequiredstringtoChain
RequiredstringsameChainFee
stringsameChainFeeCollector
stringcrossChainFee
stringcrossChainFeeCollector
stringfromAmount
RequiredstringtoTokenAmountMinimum
Requiredstringslippage
stringfromUserWalletAddress
RequiredstringtoUserWalletAddress
RequiredstringpermitData
stringpermitSignature
stringFetched