GET /trade/v1/{chainId}/swap/single
Generate transaction data for single-chain trade via Unizen DEX Aggregator
Last updated
Generate transaction data for single-chain trade via Unizen DEX Aggregator
Last updated
The chain ID of the chain where the swap will be conducted
56
Needed params, obtained from /quote/single endpoint
The transactionData object obtained from the /quote API, parsed as a string.
"{}"
The native currency value for this transaction, obtained from the /quote API response.
"0"
The user's address that conducts the trade.
"0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1"
The wallet address that will receive the funds.
"0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1"
tradeType obtained from the /quote API response
0
Generate transaction data for single-chain trade
The data associated with the transaction
Contract version to execute the trade
"v1"
the estimated amount of gas needed for the transaction
"11231133211313"
the estimate gas error, returned from RPC
"Execution reverted"
The value of the transaction in the native currency.
"0"
Allowance of the user for the involved token
"56442235035"
It is true if the amount to trade exceeds user's funds
false
It is true if the there is not enough allowance for the token sold
false
It is true if there is not enough gas for the transaction
false
For EIP1559 usage
"20748300881"
For EIP1559 usage
"maxPriorityFeePerGas"
Gas Price
"56442235035"
The raw error returned from RPC or our smart contract
"Error: invalid BigNumber string (argument=\"value\", value=\"\", code=INVALID_ARGUMENT, version=bignumber/5.7.0)"