API Response

Detailed descriptions of the `create-tx` API response structure.

There are several sections to a create-tx response. You can see a full, real-world API response example here. They are:

  • estimation contains gas and fee-related estimates used in the transaction planning process.

srcChainTokenIn

This response field is always present. Represents the structure of what the user wants to sell on the source chain.

Field name
Type
Description

address

string

Source chain input asset address - what the user is trying to sell on the source chain.

chainId

integer

Source chain id.

decimals

integer

Source chain input asset decimals.

name

string

Source chain input asset name.

symbol

string

Source chain input asset symbol.

amount

string

Source chain input asset amount, taking the decimals into account.

It will be different from the srcChainTokenInAmount if the request had prepended operating expenses. If it had, this will be the amount to use in the approve call.

approximateOperatingExpense

string

Solver's operating expense for this swap.

mutatedWithOperatingExpense

boolean

Signifies if the request had prepended operating expenses.

approximateUsdValue

integer

Approximate USD value of the source chain input assets. Informative purposes only - not for real-time trading.

originApproximateUsdValue

integer

Approximate USD value of the source chain input assets. Informative purposes only - not for real-time trading.

srcChainTokenOut

This response field is only present if the source chain input assets were not reserve assets.

Field name
Type
Description

address

string

Source chain output asset address - what the source chain input asset was swapped for in the pre-swap.

This asset will be used for cross-chain settlement, and what the solver fulfilling the order will receive. This is also the asset that the user will receive if the order is cancelled.

chainId

integer

Source chain id.

decimals

integer

Source chain output asset decimals.

name

string

Source chain output asset name.

symbol

string

Source chain output asset symbol.

amount

string

Source chain output asset amount, taking the decimals into account.

maxRefundAmount

string

Solver's operating expense for this swap.

approximateUsdValue

integer

Approximate USD value of the input assets. Informative purposes only - not for real-time trading.

dstChainTokenOut

This response field is always present. Represents the structure of what the user wants to buy on the destination chain.

Field name
Type
Description

address

string

Destination chain output asset address - what the user wants to receive when the order is fulfilled.

chainId

integer

Destination chain id.

decimals

integer

Destination chain output asset decimals.

name

string

Destination chain output asset name.

symbol

string

Destination chain output asset symbol.

amount

string

Destination chain output asset amount, taking the decimals into account.

recommendedAmount

string

Destination chain output asset amount, taking the decimals into account.

approximateUsdValue

integer

recommendedApproximateUsdValue

integer

costDetails

An array describing the cost components associated with the trade. Possible entry types include:

  • PreSwap

  • PreSwapEstimatedSlippage

  • DlnProtocolFee

  • TakerMargin

  • EstimatedOperatingExpenses

  • AfterSwap

  • AfterSwapEstimatedSlippage

  • tx

    • data is the data that must be signed and submitted. It contains all necessary information to initiate a cross-chain order, including cases involving non-reserve assets. It is either a calldata (for EVM-based chains) or a serialized transaction (for Solana)

    • to is a destination address for the transaction. Acts as the spender in the approve call for ERC-20 tokens. Applicable to EVM source chains only.

    • value is a flat fee in the source chain's native currency charged by the DLN protocol. Applicable to EVM source chains only.

  • prependedOperatingExpenseCost is the estimated operating cost added to the transaction, adjusted for token decimals. Present only if the request was made with prependOperatingExpenses enabled.

  • order is an object containing details required to facilitate the cross-chain trade.

    • approximateFulfillmentDelay

      • Estimated delay, in seconds, for the order to be fulfilled.

    • salt

      • Randomized value used to ensure uniqueness in the order hash.

    • metadata

      • Additional contextual information about the order.

  • orderId

    • A deterministic identifier for the order. The same ID is used on both source and destination chains and can be used to track order status.

  • fixFee

    • Flat fee charged in the source chain's native currency. This matches tx.value for EVM-based chains.

  • userPoints

  • integratorPoints

Last updated

Was this helpful?