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. API - GET STARTED

Gasless orders

These endpoints facilitate you the creation of gasless orders, to be conducted on our system.

List of endpoints

1. Create Gasless Order

Endpoint: POST /v1/gasless/create

Description: Initiates a new gasless order by submitting the necessary trade details along with the user's signature.

Request Body:

{
  "signature": "string",        // User's digital signature
  "tokenFrom": "string",        // Address of the source token
  "tokenTo": "string",          // Address of the destination token
  "amount": "string",           // Amount to be traded (in smallest units)
  "chainFrom": "integer",       // Source blockchain chain ID
  "chainTo": "integer",         // Destination blockchain chain ID
  "bestDex": "string"           // Preferred decentralized exchange
}

Response:

{
  "success": true,
  "orderId": "string"           // Unique identifier for the created order
}

2. Retrieve Typed Data for Signing

Endpoint: POST /v1/gasless/typed-data

Description: Generates the structured data that the user needs to sign, ensuring the integrity and authorization of the gasless transaction.

Request Body:

{
  "tokenFrom": "string",        // Address of the source token
  "tokenTo": "string",          // Address of the destination token
  "amount": "string",           // Amount to be traded (in smallest units)
  "chainFrom": "integer",       // Source blockchain chain ID
  "chainTo": "integer",         // Destination blockchain chain ID
  "bestDex": "string"           // Preferred decentralized exchange
}

Response:

{
  "success": true,
  "typedData": {
    // Structured data object for user signature
  }
}

3. Cancel Gasless Order

Endpoint: POST /v1/gasless/cancel

Description: Allows the user to cancel a previously created gasless order, provided it hasn't been processed yet.

Request Body:

{
  "orderId": "string"           // Unique identifier of the order to be cancelled
}

Response:

{
  "success": true,
  "message": "Order cancelled successfully"
}

4. Check Gasless Order Status

Endpoint: GET /v1/gasless/status/{orderId}

Description: Retrieves the current status of a specific gasless order, enabling users to monitor its progress.

Path Parameter:

  • orderId: Unique identifier of the order whose status is being queried.

Response:

{
  "success": true,
  "orderId": "string",
  "status": "string",           // Current status (e.g., pending, processing, completed, cancelled, failed)
  "message": "string"           // Additional information about the order status
}

5. Estimate Gas for Gasless Transaction

Endpoint: POST /v1/gasless/estimate

Description: Provides an estimation of the gas costs associated with a proposed gasless transaction, aiding in understanding potential fees.

Request Body:

{
  "tokenFrom": "string",        // Address of the source token
  "tokenTo": "string",          // Address of the destination token
  "amount": "string",           // Amount to be traded (in smallest units)
  "chainFrom": "integer",       // Source blockchain chain ID
  "chainTo": "integer",         // Destination blockchain chain ID
  "bestDex": "string"           // Preferred decentralized exchange
}

Response:

{
  "success": true,
  "gasEstimation": "string",    // Estimated gas units required
  "feeEquivalent": "string"     // Equivalent fee in the specified token (if applicable)
}

These endpoints facilitate the creation, management, and monitoring of gasless orders, streamlining the trading process by covering gas fees on behalf of the user.

For detailed information and additional parameters, please refer to the official API documentation at https://api.zcx.com/trade/docs#/Gasless%20Orders.

PreviousSend transactionNextPOST /trade/v1/gasless/typed-data

Last updated 6 months ago

Was this helpful?