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.
Last updated