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

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

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

post
Authorizations
HTTPRequired

[just text field] Please enter token in following format: Bearer

Path parameters
chainIdnumber · enumRequired

The chain ID of the chain where the swap will be conducted

Example: 56Possible values:
Body
transactionDatastringRequired

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

Example: {}
nativeValuestringRequired

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

Example: 0
accountstringRequired

The user's address that conducts the trade.

Example: 0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1
receiverstringOptional

The wallet address that will receive the funds.

Example: 0xF0Fbf42C54Ac40dA016003baD35E5AefaC6E1CE1
tradeTypenumber · enumRequired

tradeType obtained from the /quote API response

Example: 0Possible values:
Responses
chevron-right
200

Generate transaction data for single-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
allowancestringRequired

Allowance of the user for the involved token

Example: 56442235035
insufficientFundsbooleanRequired

It is true if the amount to trade exceeds user's funds

Example: false
insufficientAllowancebooleanRequired

It is true if the there is not enough allowance for the token sold

Example: false
insufficientGasbooleanRequired

It is true if there is not enough gas for the transaction

Example: false
maxFeePerGasstringRequired

For EIP1559 usage

Example: 20748300881
maxPriorityFeePerGasstringRequired

For EIP1559 usage

Example: maxPriorityFeePerGas
gasPricestringRequired

Gas Price

Example: 56442235035
estimateGasRawErrorobjectRequired

The raw error returned from RPC or our smart contract

Example: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.7.0)
post
/v1/{chainId}/swap/single
200

Generate transaction data for single-chain trade

Last updated