API Parameters
Last updated
Was this helpful?
Last updated
Was this helpful?
Below is a succinct breakdown of the parameters used in the create-tx
API endpoint. Detailed descriptions and usage examples are provided in dedicated subpages.
These parameters define the origin and destination of the transaction, including the assets being sold on the source chain and the assets being purchased on the destination chain.
srcChainId
56
srcChainTokenIn
0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d
Input asset address (what the user sells)
dstChainId
43114
dstChainTokenOut
0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7
Output asset address (what the user buys)
These parameters specify the amounts of tokens to be sold and received. The API can also be configured to automatically determine the output amount to ensure a reasonably profitable market order.
srcChainTokenInAmount
100000000000000000000
or
auto
The amount of input token the user is selling, with decimals. It can be set to auto
as well, but make sure to set the amount of output token in that case.
dstChainTokenOutAmount
auto
or
100000000000000000000
prependOperatingExpense
true
These optional parameters define which entities are authorized to or modify the order, as well as the recipient of the funds upon fulfillment. Typically, user wallet addresses are used.
These parameters are optional, making it possible to use the create-tx
endpoint even before a wallet address is availableβe.g., before a user connects a wallet in a dApp. However, in such cases, the API will not return a transaction payload that can be signed and submitted to the blockchain.
srcChainOrderAuthorityAddress
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
dstChainOrderAuthorityAddress
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
Authorized to patch the order on the destination chain and cancel the order. Usually the user's address.
dstChainTokenOutRecipient
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
Destination chain beneficiary address - receives the funds after the order is fulfilled. Usually the user's address.
affiliateFeePercent
0.1
Input asset amount percentage to cut off in favor of the affiliate fee recipient during order creation.
affiliateFeeRecipient
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
Source chain address where the accrued affiliate fees will be transferred to when the order is fulfilled and unlocked.
referralCode
31805
The following is a sample call to the create-tx
endpoint, which generates a JSON-formatted response containing all required fields:
This request demonstrates how all core parameters are combined to generate a valid and executable cross-chain order.
The internal chainId
of the .
The internal chainId
of the .
The amount of output token the user is buying. It is recommended to let the API calculate the reasonable outcome by setting this parameter to auto
, otherwise you are risking the created order being ignored by solvers and stuck until .
for better user experience. Moves the calculated amount of out of the spread and adds it on top the amount of input token.
Ensure that the address specified for dstChainOrderAuthorityAddress
is accessible to the user. Otherwise, the order and its associated funds may become permanently inaccessible if the user cannot it.
Authorized to patch the order after it is created on source chain. Also receive the funds if the . Usually the user's address.
Affiliate fee-related settings can be included to specify a percentage of the trade value and the recipient address. More details are available .
An optional referral code can be included for tracking and rewards. More details are available .
Integrator's referral code. You can generate it .