API Parameters
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
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.
Directional Parameters
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)
Offer Parameters
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
Authorities and recipient address
These optional parameters define which entities are authorized to cancel 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.
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 cancel it.
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.
Affiliate Fee parameters
Affiliate fee-related settings can be included to specify a percentage of the trade value and the recipient address. More details are available here.
affiliateFeePercent
0.1
Input asset amount percentage to cut off in favor of the affiliate fee recipient during order creation.
affiliateFeeRecipient
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
or 862oLANNqhdXyUCwLJPBqUHrScrqNR4yoGWGTxjZftKs
Referral Code
An optional referral code can be included for tracking and rewards. More details are available here.
referralCode
31805
Example Request
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.
Last updated
Was this helpful?