Commission rate of affiliate, denominator is 1000000. Affiliate must be provided when passing commissionRate.
bridgeProviderstringOptional
Provider of bridge operation.
srcBridgeTokenAddressstringOptional
Source chain bridge token address
dstBridgeTokenAddressstringOptional
Destination chain bridge token address
srcSwapProviderstringOptional
Provider of source chain swap.
dstSwapProviderstringOptional
Provider of destination chain swap.
Responses
200
Successful Response
application/json
Responseany of
or
get
/buildTx
200
Successful Response
When building transaction, there are 6 additional parameters along with quote input.
Field name
Requirement
receiver
Required
srcSwapProvider
Required when srcSwapDescription is presented in quote result
dstSwapProvider
Required when dstSwapDescription is presented in quote result
bridgeProvider
Required when bridgeDescription is presented in quote result
srcBridgeTokenAddress
Required when bridgeDescription is presented in quote result
dstBridgeTokenAddress
Required when bridgeDescription is presented in quote result
To build transaction, please fill the corresponding fields (srcSwapDescription, bridgeDescription and dstSwapDescription) from quote response's route to buildTx input . If parameters are not filled properly, it may not return the desired routing result. You can review the transaction calldata route by checking route field in buildTx response.
For example, following response is quote result of Arbitrum USDT to KCC native token.
srcSwapDescription is null because these is no source chain swap needed in this route, so we don't have to fill srcSwapProvider when calling buildTx.
We have a non-empty bridgeDescription because it's a cross-chain quote. We need to fill corresponding bridgeProvider, srcBridgeTokenAddress and dstBridgeTokenAddress when calling buildTx. For single chain quote, we can skip these parameters.
dstSwapDescription is needed in this route. So we need to fill dstSwapProvider when calling buildTx.
Therefore, we can create the following buildTx request from above information:
Parameter/Response Details
Use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE as the address for the native token in your parameter.
If you would like to know more about commissionRate fields and fee collection function, please refer to Monetization / Take Fees
The estimatedGas field in the API response is an estimated value. For now, please use a method similar to RPC, such as eth_estimateGas, to re-estimate the actual gas limit. You can refer to the following sample code to do that:
Example Request
This request is asking to bridge 1ETH from Optimism for ETH on the BNB Chain
IMPORTANT: Note that the amount parameter should be padded with zeroes. For example, pass 100000000 instead of 100 if the decimals of the token is 6.