GET /firm-quote
Obtaining Signed Order data for selling an ERC20 or Native Token and submitting to Native Router for swap execution.
This endpoint provides transaction data based on the requested token and token amount. For examples of using this endpoint, please refer to this section.
For native token swaps, Native uses 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
to represent the token address of the native token.
Headers
Name | Description |
---|---|
| API Key retrieved from the Native app |
Params
Name | Description |
---|---|
| The blockchain name belonging to the token_in address - Refer to the |
| The blockchain name belonging to the token_out address - Refer to the |
| Address of the token to be sold |
| Address of the token to be bought |
| Amount of token to be sold, in ether unit |
| Amount of token to be sold, in wei unit |
| Address of the user that sells the |
| Address of the end user that initiated the swap request |
| Address of the user that receives the |
| Expiry time in seconds This variable will be passed on to the market makers to consider when they give the quote. Market makers would be able to give better quote for a shorter expiry time. It will affect the deadlineTimestamp in the response if the quote from that market maker is chosen. If not provided, we will just use the default expiry time by the liquidity source. |
| Number in percentage value 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 transaction data for swapping 1 ETH to USDT on the Ethereum network.
Response
Name | Description |
---|---|
| Indicates if the signing of the firm quote was successful |
| Array of order objects. Refer to Params for more details. |
| Contains the widgetFee details. |
| The signature of the transaction request and the widget fee |
| The address of the seller/swapper |
| The byte encoding for the |
| The amount of sellerToken in wei, that will be sold to the buyer |
| The amount of buyerToken in wei, that the buyer will be receiving |
| Indicates if the order needs to be wrapped |
| Indicates if the order needs to be unwrapped |
| This is the raw input data that will be executed by Native fallback |
| Indicates the liquidity provider that is providing this firm-quote |
| The transaction request to be executed by the NativeRouter. The |
Example
In the response above, Native returns 1,864.151208 USDT for the order submitted.
Note: To send the transaction on-chain, you can utilize the txRequest
response. This response will be identical to the one provided by the GET /calldata
API endpoint.
Explore this endpoint and see how it works here.
Last updated