deBridge
  • Introduction
  • The deBridge Messaging Protocol
    • Protocol Overview
    • Fees and Supported Chains
    • 🟢Deployed Contracts
    • Development Guides
      • Building an EVM-based dApp
        • EVM smart contract interfaces
          • Interfaces
            • ICallProxy
            • IDeBridgeGate
            • IDeBridgeToken
            • IDeBridgeTokenDeployer
            • IOraclesManager
            • ISignatureVerifier
            • IWethGate
          • Libraries
            • Flags
          • Periphery
            • CallProxy
            • DeBridgeToken
            • DeBridgeTokenProxy
            • SimpleFeeProxy
          • Transfers
            • DeBridgeGate
            • DeBridgeTokenDeployer
            • OraclesManager
            • SignatureVerifier
            • WethGate
      • Sending cross-chain messages from Solana
        • On-Chain external call preparation for Solana
        • Off-chain external call preparation for Solana
      • Lifecycle of a cross-chain call
      • Gathering data for the claim
    • Development Tools
    • Security
    • Slashing and Delegated Staking
  • 🔁DLN: The deBridge Liquidity Network Protocol
    • Introduction
    • Protocol Overview
    • deBridge Hooks
    • Fees and Supported Chains
    • 🟢Deployed Contracts
    • Market and Limit Orders
    • Integration Guidelines
      • Interacting with the API
        • Authentication
        • Creating an Order
          • Quick Start
          • API Parameters
            • Estimation-Only
            • prependOperatingExpenses
          • API Response
            • JSON Example
          • Refreshing Estimates
        • Tracking Order Status
          • Order States
        • Integrating deBridge hooks
          • Creating Hook data for Solana
        • Submitting an Order Creation Transaction
        • Cancelling the Order
      • deBridge Widget
      • Interacting with smart contracts
        • Placing orders
        • Filling orders
      • Under the Hood
        • Reserve Assets
        • Bridging Reserve Assets
        • Bridging Non-Reserve Assets
        • Order Fulfillment
          • Detecting the Order
          • Fulfilling the Order
            • Pre-Fill-Swap
          • Claiming the Order
      • Affiliate fees
        • Withdrawing Affiliate Fees
      • Fees and operating expenses
    • Interacting with the deBridge App
      • Custom Linking
    • Protocol specs
      • Deterministic order ID
      • Hook data
        • Anatomy of a Hook for the EVM-based chains
        • Anatomy of a Hook for Solana
  • 💸dePort
    • Getting started
    • Transfers Flow
  • ⚡deBridge Points
    • Referrers Overview
    • Integrators Overview
  • 🌐deBridge IaaS
    • Getting started
  • 🌐Legal
    • SDK & API License Agreement
  • External Links
    • deBridge Use Cases
      • 💡Examples
    • Talks, Videos, and Articles
    • Website
    • Github
    • Twitter
    • Social channels
      • Discord
      • Facebook
      • LinkedIn
      • Medium
      • Telegram
      • YouTube
Powered by GitBook
On this page

Was this helpful?

  1. DLN: The deBridge Liquidity Network Protocol
  2. Integration Guidelines
  3. Interacting with the API

Tracking a Status of the Order

Last updated 11 months ago

Was this helpful?

After the transaction has been successfully included in the source blockchain, it is time to retrieve the status of an order created within the given transaction. There are several ways to track the status of the trade.

The first way is method of dedicated stats-api that allows retrieving the history of all trades performed by the wallet and their statuses. Check for more details. Stats-API Swagger is available at .

Example of trade history for address 0xB779DaeAD6031Ef189cAD4Ac438c991Efe7635A7:

curl -X 'POST' \
  'https://stats-api.dln.trade/api/Orders/filteredList' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "skip": 0,
  "take": 20,
  "creator":"0xB779DaeAD6031Ef189cAD4Ac438c991Efe7635A7"
}’

To understand the data structure and how trade history can be reflected in your app, you can check the page of deExplorer which is using this endpoint to obtain data.

In case detailed information on one specific trade is needed, endpoint of DLN API can be used. It returns the status and all the order parameters that are reflected on the order page of deExplorer.

Example of how to retrieve DLN trade details based on orderID: and in deExplorer

If multiple DLN orders were created in the same transaction, /creationTxHash will return information about the first one only

If multiple trades were created in a single transaction, there is an endpoint which returns the list of orderIds of the orders that were created by the given transaction: /v1.0/dln/tx/:hash/order-ids.

Let's say, a transaction has been submitted to the BNB Chain. Calling the endpoint:

gives an array with only one orderId within it:

{
    "orderIds": [
        "0x9ee6c3d0aa68a7504e619b02df7c71539d0ce10e27f593bf8604b62e51955a01"
    ]
}

An array instead of a single orderId is returned because a top-level transaction may perform several calls to DLN, thus leading to multiple order creation.

gives a status for the given order:

{
    "status": "ClaimedUnlock"
}

The order may have different statuses across its lifecycle, but the most important are Fulfilled, SentUnlock and ClaimedUnlock — all indicating that the order has been successfully fulfilled, and a recipient has received a precise amount of the output token.

If an order is in any of Fulfilled, SentUnlock, or ClaimedUnlock statuses, it can be displayed as fulfilled for the end-user.

The affiliate fee (if set) that has been accrued during order creation is transferred to the affiliateFeeRecipient when the ClaimedUnlock status is reached.

This is a complete set of all possible statuses that an order may have, according to the DLN API:

Status
Description

Created

The order has been placed on the DLN and is awaiting fulfillment.

Fulfilled

The order has been fulfilled. The take amount of the output token has been transferred to dstChainTokenOutRecipient

SentUnlock

An unlock procedure has been initiated by the taker (who fulfilled the order) on the destination chain to unlock the give amount of the input token on the source chain, as per taker request

ClaimedUnlock

An unlock procedure has been completed, effectively unlocking the input funds to the taker beneficiary, and the affiliate fee to the affiliateFeeRecipient on the source chain

OrderCancelled

A cancel procedure has been initiated by the dstChainOrderAuthorityAddress on the destination chain to unlock the given funds on the source chain, as per order's srcChainRefundAddress request

SentOrderCancel

A cancel procedure has been sent to the source chain to unlock the given funds on the source chain, as per order's srcChainRefundAddress request

ClaimedOrderCancel

A cancel procedure has been completed, effectively refunding locked funds to the srcChainRefundAddress on the source chain

After the orderId has been revealed, it can be used to track the order's status by orderId specifically (instead of creation txHash). Use the GET endpoint supplying the given orderId. Calling the endpoint:

🔁
/filteredList
redoc
this link
DLN trade history
/api/Orders/creationTxHash/
https://stats-api.dln.trade/api/Orders/creationTxHash/0x3fe11542154f53dcf3134eacb30ea5ca586c9e134c223e56bbe1893862469bc5
Link to the same order
0x40ee524d5bb9c4ecd8e55d23c66c5465a3f137be7ae24df366c3fd06daf7de7e
https://stats-api.dln.trade/api/Transaction/0x40ee524d5bb9c4ecd8e55d23c66c5465a3f137be7ae24df366c3fd06daf7de7e/orderIds
/api/Orders/{orderId}
https://stats-api.dln.trade/api/Orders/0x9ee6c3d0aa68a7504e619b02df7c71539d0ce10e27f593bf8604b62e51955a01