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

GET /trade/v1/{chainId}/swap/cross

Generate transaction data for single-chain trade via Unizen DEX Aggregator

Get a cross swap quote.

post
Path parameters
chainIdnumber · enumRequired

The chain ID of the chain to quote on.

Example: 56Possible values:
Header parameters
X-Api-KeystringOptional

Api key

Body
transactionDatastringRequired

The transactionData object obtained from the /quote API, parsed as a string.

nativeValuestringRequired

The native currency value for this transaction, obtained from the /quote API response.

Example: 29422186306758765852
accountstringRequired

The user's address.

Example: 0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1
Responses
200

Generate transaction data for cross-chain trade

application/json
datastringRequired

The data associated with the transaction

contractVersionstringRequired

Contract version to execute the trade

Example: V1
estimateGasstringRequired

the estimated amount of gas needed for the transaction

Example: 11231133211313
estimateGasErrorobjectRequired

the estimate gas error, returned from RPC

Example: Execution reverted
nativeValuestringRequired

The value of the transaction in the native currency.

Example: 0
post/trade/v1/{chainId}/swap/cross
POST /trade/v1/{chainId}/swap/cross HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 114

{
  "transactionData": {},
  "nativeValue": "29422186306758765852",
  "account": "0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1"
}
200

Generate transaction data for cross-chain trade

{
  "data": {},
  "contractVersion": "V1",
  "estimateGas": "11231133211313",
  "estimateGasError": "Execution reverted",
  "nativeValue": "0"
}

Last updated