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

Approval

The approval endpoints facilitate the authorization process required for conducting trades on the Unizen smart contract. These endpoints provide essential functionality for managing permissions and ensuring secure and efficient trade execution on the Unizen platform. While it's not mandatory to use these endpoints, they offer convenient and streamlined methods for handling approvals.

1. /trade/v1/{chainId}/approval/spender:

Method: GET

Description:

This endpoint retrieves the address of the Unizen DEX Aggregator, which is essential for performing approval actions. Users need to approve this address to authorize the DEX Aggregator to spend funds on their behalf during trades.

2. /trade/v1/{chainId}/approval/transaction:

Method: GET

Description:

This endpoint generates the data required to call the Unizen smart contract, facilitating the approval process for allowing the Unizen DEX Aggregator to spend funds. It streamlines the process by providing the necessary transaction data for executing approvals efficiently.

3. /trade/v1/{chainId}/approval/allowance:

Method: GET

Description:

This endpoint retrieves the number of tokens that the Unizen DEX Aggregator is currently allowed to spend on behalf of the user. It offers transparency and visibility into the approved token allowance, enabling users to monitor and manage their permissions effectively.

Usage:

Developers and users can utilize these endpoints to handle approval actions conveniently and securely. By leveraging these endpoints, users can streamline the authorization process and ensure smooth and efficient trade execution on the Unizen platform.

Note:

While direct operations on the blockchain using the address from the @unizen-io/unizen-contract-addresses package are possible, utilizing these endpoints provides a more user-friendly and integrated approach to managing approvals. They offer a centralized and standardized method for handling authorization, enhancing the overall trading experience on Unizen.

PreviousGET /trade/v1/info/tradesNextGET /trade/v1/{chainId}/approval/spender

Last updated 1 year ago

Was this helpful?