API

Endpoints for Trial and Usage

Where Can I Trial the Endpoints?

You can trial the endpoints at the following link: API Documentation and Testing

Endpoints Used by the Front-End

The front-end interacts with several key endpoints to ensure smooth operation and user experience. Here’s how these endpoints are utilized:

On Load: Reading Available Chains and Assets

  • Endpoint: get_config

  • Description: On load, the front-end reads the available chains and assets from the configuration to present the user with the latest options.

Estimating Gas Costs

  • Endpoint: estimate_gas

  • Description: When a user specifies the send token and buy token, the front-end estimates the gas cost for the transaction.

Placing a Trade

  • Endpoint: PlaceTrade

  • Description: When a user places a trade using MetaMask, the front-end retrieves the price and fee from the following endpoints:

    • get_price: Retrieves the current price for the trade.

    • get_fee: Retrieves the applicable fee for the trade.

Order Clearing and Backend Fix

  • Endpoint: make_order

  • Description: Immediately after the order has cleared on the source chain, this endpoint is called to have the backend finalize and fix the order.

Displaying Order History

  • Endpoint: get_orders

  • Description: After the trade is complete, the front-end uses this endpoint to display the user's order history.

Last updated