LogoLogo
  • Introduction to Unizen
    • Unizen Overview
      • Unizen Liquidity Distribution Mechanism (ULDM)
        • ULDM Performance
      • Unizen Interoperability Protocol (UIP)
        • LayerZero
        • DeBridge
        • Stargate
        • Celer
        • Axelar
        • Thorchain
    • Unizen Dashboard
      • General
      • Portfolio
      • History
    • Unizen Trade
      • Fees
    • Unizen Explore
      • Unizen Omni-Chain Data Pool
    • Unizen Earn
  • ZCX
    • Token Utility
    • Tokenomics
  • API - Introduction
    • Introduction
    • Before you get started
      • Understanding Price Impact and Price Slippage in Token Swaps
      • Token Allowance Management for Non-updatable Allowance Tokens
      • Tokens with taxes
      • Wrapping and Unwrapping Native Tokens
      • Quote expiration deadline
    • Security Best Practices for Integrating Unizen
      • Why disable CORS
      • How to integrate with a reverse proxy
    • Version 2 of our smart contracts
      • Migration to smart contract v2
  • API - GET STARTED
    • QuickStart guide
    • Swagger
    • Information endpoints
      • GET /trade/v1/info/chains
      • GET /trade/v1/info/sources
      • GET/v1/info/cross-providers
      • GET /trade/v1/info/token/search
      • GET /v1/info/token/popular
      • GET /trade/v1/info/token/{chainId}/{tokenAddress}
      • GET /trade/v1/info/tokenLogo/{chainId}/{tokenAddress}
      • GET /info/thorchain-inbound-address
      • GET /trade/v1/info/tx/{txHash}
      • GET /trade/v1/info/trade/{chainId}/{txHash}
      • GET /trade/v1/info/trades
    • Approval
      • GET /trade/v1/{chainId}/approval/spender
      • GET /trade/v1/{chainId}/approval/transaction
      • GET /trade/v1/{chainId}/approval/allowance
    • Single-Chain Swap
      • GET /trade/v1/{chainId}/quote/single
      • GET /trade/v1/{chainId}/swap/single
      • Send transaction in evm chains
      • Send transaction in Solana
    • Cross-Chain Swap
      • GET /trade/v1/{chainId}/quote/cross
      • GET /trade/v1/{chainId}/swap/cross
      • Send transaction
    • Gasless orders
      • POST /trade/v1/gasless/typed-data
      • POST /v1/gasless/estimate
      • POST /v1/gasless/create
      • POST /v1/gasless/cancel
      • GET /trade/v1/gasless/status/{orderId}
      • GET /v1/gasless/orderByAddress/{address}
    • UTXO Assets and Cosmos Swap
      • GET /trade/v1/{chainId}/quote/cross 1
      • GET /trade/v1/{chainId}/swap/cross
      • Sending transactions
    • Efficient Quote Retrieval with Batch Processing
      • GET /trade/v1/{chainId}/batch_quote/single
    • Error Messages
  • GASLESS TRADES
    • Obtaining gasless quotes
    • Gas estimation
    • Executing the trade
    • Following the orders
  • On-Chain Contracts - Get Started
    • Integration with Unizen Contracts for Token Swapping
    • Registering Errors on Smart Contract Calls
  • PERMIT2
    • What is Permit2?
    • Usage in our api
  • WIDGET - Get Started
    • Embed the Unizen Widget
    • Playground
  • Other
    • Smart Contracts
    • Security Audits
    • Roadmap
  • links
    • Unizen
    • Marketing Website
    • Medium
    • Twitter
    • Discord
    • Telegram
Powered by GitBook
On this page

Was this helpful?

  1. GASLESS TRADES

Following the orders

Tracking the Status of a Gasless Order

To monitor the status of a gasless order and provide updates to the user, use the following endpoint:

Endpoint:

/v1/gasless/status/{orderId}


Description

This endpoint allows you to query the status of an order created via the gasless trading flow. It provides real-time information about the order's current state, enabling you to keep the user informed.


How to Use

  1. Call the Endpoint: Replace {orderId} with the unique identifier of the order you want to track:

    GET /v1/gasless/status/12345
  2. Response: The endpoint returns the current status of the order. Example response:

    
    {
        "response": {
            "id": "561e1e2f-c32b-48c7-bb85-b9bc599d4d91",
            "address": "0x2472d3EF4bF71af00c3dE490a5a53A99CbAC0791",
            "chainFrom": 42161,
            "tokenFrom": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
            "chainTo": 0,
            "tokenTo": "0x0000000000000000000000000000000000000000",
            "amount": "6623429",
            "fee": "19898",
            "amountOutMin": "1972679740777741",
            "swapCall": "{\"order\":{\"user\":\"0x2472d3...6bacb2526197387b9e41c\"}",
            "status": "completed", // Possible values: "pending", "processing", "completed", "cancelled", "faile
            "createdAt": "2024-12-23T13:51:34.188129Z",
            "deadLineAt": "2024-12-23T14:21:30Z",
            "canceledAt": null,
            "completedAt": "2024-12-23T13:51:38.019587Z",
            "failedAt": null,
            "signatureCreated": "0x2728c5bd1d666623533d899f6f60d4a49a0d597d4ba1fc7e24079e1cea8d9db26f8b9b63f927f9614060fcafaef60f0ca769a7a77f2af6bacb2526197387b9e41c",
            "signatureCancel": null,
            "failureMsg": null,
            "txCompleted": "0x49fdec98eac1fd27...9361b375", // tx hash when the order is created 
            "apiKey": 17,
            "amountDeducted": "19898",
            "gasPrice": "20000000",
            "estimatedGas": "1304999",
            "gasUsed": "1117733",
            "nativeUsdPrice": "3312.41"
        }
    }

Possible Status Values

Status
Description

pending

The order has been created and is awaiting processing.

processing

The order is currently being executed by the system.

completed

The order has been successfully processed and finalized.

cancelled

The order was cancelled before it could be executed.

failed

The order could not be processed due to an error.


Key Notes

  • Real-Time Updates: Poll this endpoint to get real-time updates about the order status.

  • Order Information: Use the orderId provided when the order was created to query its status.

  • User Feedback: Use the returned status and message to display appropriate feedback to the user.

This endpoint ensures transparency and allows you to keep users informed about the progress of their gasless trades. 🚀

PreviousExecuting the tradeNextIntegration with Unizen Contracts for Token Swapping

Last updated 5 months ago

Was this helpful?