GET /trade/v1/{chainId}/swap/single
Generate transaction data for single-chain trade via Unizen DEX Aggregator
Last updated
Was this helpful?
Generate transaction data for single-chain trade via Unizen DEX Aggregator
Last updated
Was this helpful?
The chain ID of the chain where the swap will be conducted
56
Possible values: 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
Possible values: POST /trade/v1/{chainId}/swap/single HTTP/1.1
Host:
Authorization: Bearer Bearer
Content-Type: application/json
Accept: */*
Content-Length: 167
{
"transactionData": "{}",
"nativeValue": "0",
"account": "0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1",
"receiver": "0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1",
"tradeType": 0
}
Generate transaction data for single-chain trade
{
"data": {},
"contractVersion": "v1",
"estimateGas": "11231133211313",
"estimateGasError": "Execution reverted",
"nativeValue": "0",
"allowance": "56442235035",
"insufficientFunds": false,
"insufficientAllowance": false,
"insufficientGas": false,
"maxFeePerGas": "20748300881",
"maxPriorityFeePerGas": "maxPriorityFeePerGas",
"gasPrice": "56442235035",
"estimateGasRawError": "Error: invalid BigNumber string (argument=\"value\", value=\"\", code=INVALID_ARGUMENT, version=bignumber/5.7.0)"
}