For the complete documentation index, see llms.txt. This page is also available as Markdown.

GET Firm quote

In src_chain and dst_chain please ensure the parameters are passed with standardised chain names. Reference: Networks

Get signed order data for selling a ERC20 / native token. Submit the return data to Native router to execute swap.

get
Query parameters
from_addressstringRequired

Effectively recipient. This is the pay out address of the final swapped tokens. Funding address will always be the address calls Native Router.

Example: 0x1111111111111111111111111111111111111111Pattern: ^0x[a-fA-F0-9]{40}$
beneficiary_addressstringOptional

Address of the end user that initiated the swap request. This is REQUIRED if you are an aggregator/widget/wallet. Optional for solvers.

Example: 0x1111111111111111111111111111111111111111Pattern: ^0x[a-fA-F0-9]{40}$
src_chainstring · enumRequired

Blockchain name, eg: ethereum, bsc, ... (refer to network name reference)

Example: bscPossible values:
dst_chainstring · enumOptional

Blockchain name, eg: ethereum, bsc, ... (refer to network name reference). Optional, defaults to src_chain.

Example: bscPossible values:
token_instringRequired

Address of the token to be sold

Example: 0x55d398326f99059ff775485246999027b3197955Pattern: ^0x[a-fA-F0-9]{40}$
token_outstringRequired

Address of the token to be bought

Example: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095cPattern: ^0x[a-fA-F0-9]{40}$
amountnumberOptional

Amount of token to be sold, in ether unit. (Skip if already passing amount_wei)

Default: 0Example: 100
amount_weistringOptional

Amount of token to be sold, in wei unit. (Skip if already passing amount)

Default: 0
expiry_timenumberOptional

The expiry time of the quote, in seconds. If omitted, the API key / pair default applies. Maximum 60 (error 171018).

Default: 60Example: 60
slippagenumberOptional

Number in percent. For example, passing the value 5 means 5%, 0.1 means 0.1% slippage tolerance. If omitted, a pair-specific default from Native risk settings applies. Recommend passing 0.5 explicitly.

Example: 0.5
versionnumberOptional

The swap router version. Use 6 (latest). If omitted, version 4 is used for backwards compatibility only. Version 4 will be deprecated soon, so always pass version=6 explicitly.

Example: 6
allow_multihopstringOptional

Whether to use multihop within all Native supported pairs for quoting. Recommended true for wallets/widgets.

Default: false
show_blacklist_statusbooleanOptional

When true, the response includes is_black_address indicating whether from_address or beneficiary_address is blacklisted. Omit or pass false to keep the default response (field not included).

Default: falseExample: true
Header parameters
apiKeystringRequired

The API key that was assigned to you by Native

Responses
200

Success

application/json
successbooleanRead-onlyRequired
functionCallstringRead-onlyOptional
widgetFeeSignaturestringRead-onlyRequired
recipientstringRead-onlyRequired
calldatastringRead-onlyOptional
amountInstringRead-onlyRequired
amountOutstringRead-onlyRequired
amountOutBeforeFeestringRead-onlyRequired
toWrapbooleanRead-onlyRequired
toUnwrapbooleanRead-onlyRequired
fallbackSwapDataArraystring[]Read-onlyOptional
tokenTransferFeeOnPercentnumberRead-onlyRequired
sourcenumber[]Required

Quote source identifiers

quoteSourcenumber[]Required

Quote source identifiers used for this quote

errorMessagestringRead-onlyRequired
router_versionstringRead-onlyRequired
gasCostUsdnumberRead-onlyOptional
estimateDurationnumberRead-onlyOptional
bridgeobjectRead-onlyOptional
amountInOffsetnumberRead-onlyRequired
amountOutMinimumOffsetnumberRead-onlyRequired
is_black_addressbooleanRead-onlyOptional

Present only when show_blacklist_status=true. True if from_address or beneficiary_address is blacklisted.

get/v1/firm-quote
GET /swap-api-v2/v1/firm-quote?from_address=text&src_chain=ethereum&token_in=text&token_out=text HTTP/1.1
Host: v2.api.native.org
apiKey: text
Accept: */*
{
  "success": true,
  "orders": [
    {
      "pool": "text",
      "signer": "text",
      "recipient": "text",
      "sellerToken": "text",
      "buyerToken": "text",
      "effectiveSellerTokenAmount": "text",
      "sellerTokenAmount": "text",
      "buyerTokenAmount": "text",
      "deadlineTimestamp": 1,
      "nonce": 1,
      "quoteId": "text",
      "multiHop": true,
      "signature": "text",
      "externalSwapCalldata": "text",
      "amountOutMinimum": "text",
      "widgetFee": {
        "signer": "text",
        "feeRecipient": "text",
        "feeRate": 1
      },
      "widgetFeeSignature": "text"
    }
  ],
  "functionCall": "text",
  "widgetFee": {
    "signer": "text",
    "feeRecipient": "text",
    "feeRate": 1
  },
  "widgetFeeSignature": "text",
  "recipient": "text",
  "calldata": "text",
  "amountIn": "text",
  "amountOut": "text",
  "amountOutBeforeFee": "text",
  "toWrap": true,
  "toUnwrap": true,
  "fallbackSwapDataArray": [
    "text"
  ],
  "tokenTransferFeeOnPercent": 1,
  "txRequest": {
    "target": "text",
    "calldata": "text",
    "value": "text",
    "function": "text"
  },
  "source": [
    1
  ],
  "quoteSource": [
    1
  ],
  "errorMessage": "text",
  "router_version": "text",
  "gasCostUsd": 1,
  "estimateDuration": 1,
  "bridge": {},
  "amountInOffset": 1,
  "amountOutMinimumOffset": 1,
  "is_black_address": true
}

Last updated