API Parameters

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045Below 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.

Parameter
Example value
Description

srcChainId

56

The internal chainId of the supported source chain.

srcChainTokenIn

0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d

Input asset address (what the user sells)

dstChainId

43114

The internal chainId of the supported destination chain.

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.

Parameter
Example value
Description

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

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 cancelled.

prependOperatingExpense

true

Recommended for better user experience. Moves the calculated amount of operating expenses out of the spread and adds it on top the amount of input token.

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.

Parameter
Example value
Description

srcChainOrderAuthorityAddress

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Authorized to patch the order after it is created on source chain. Also receive the funds if the order is cancelled. Usually the user's address.

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.

Parameter
Example value
Description

affiliateFeePercent

0.1

Input asset amount percentage to cut off in favor of the affiliate fee recipient during order creation.

affiliateFeeRecipient

0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 or 862oLANNqhdXyUCwLJPBqUHrScrqNR4yoGWGTxjZftKs

Source chain address (EVM) or public key (Solana) where the accrued affiliate fees will be transferred when the order reaches ClaimUnlocked state.

Referral Code

An optional referral code can be included for tracking and rewards. More details are available here.

Parameter
Example value
Description

referralCode

31805

Integrator's referral code. You can generate it here.

Example Request

The following is a sample call to the create-tx endpoint, which generates a JSON-formatted response containing all required fields:

https://dln.debridge.finance/v1.0/dln/order/create-tx?srcChainId=56&srcChainTokenIn=0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d&srcChainTokenInAmount=100000000000000000000&dstChainId=43114&dstChainTokenOut=0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7&dstChainTokenOutAmount=auto&dstChainTokenOutRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&srcChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&dstChainOrderAuthorityAddress=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&affiliateFeePercent=0.1&affiliateFeeRecipient=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

This request demonstrates how all core parameters are combined to generate a valid and executable cross-chain order.

Last updated

Was this helpful?