GET v1/firm-quote/calldata
Very similar to `/firm-quote`. Just that response is raw calldata that can be submitted on-chain directly
Header and params are exactly the same as /firm-quote.
Headers
apiKey
Contact Native to get your API key.
Params
chain
Blockchain name. Supported chains: ethereum, bsc
token_in
Token address for the token to be sold.
token_out
Token address for the token to be bought.
amount
Amount of token to be sold, in ether unit.
address
Address of the user making the swap.
slippage
Optional. Number in percent. For example, passing the value 5 means 5%, 0.1 means 0.1% slippage tolerance. By default it's 0
Example
In this example, wallet 0x42d4e9ee3f725c84b7934e4fda64f2be0f803130 requests for transaction data for swapping 1 ETH to USDT on Ethereum.
Response
from
,to
,calldata
: Thecalldata
could be sent to theto
address from thefrom
address to execute the swap.from
address should have enough allowance to NativeRouter (which is theto
address)amountInOffset
: The offset position (in bytes) of the paramamountIn
. For example in the sample response above theamountIn
(uint256
) is taking the bytes in 100-131. Useful when the user wants to adjust the amount in in calldata.amountOutMinimumOffset
: The offset position (in bytes) of the paramamountOutMinimum
. For example in the sample response above theamountIn
(uint256
) is taking the bytes in 132-163. Useful when the user wants to adjust the amount out minimum (for slippage protection) in calldata.
Last updated