Use cases
API — provides a list of supported blockchains upon request GET
v1/platforms
.GUI — the user selects a network the exchange is made within. For example, Ethereum, ChainID=1.
API — provides a list of blockchain tokens upon request POST
v2/tokens/list
.API (optional) – provides calculated gas price values in GWEI (nAVAX for Avalanche) for fast, medium, low transaction time GET
v1/{chainID}/gasprices
(in the example GETv1/1/gasprices
).GUI — the user selects the exchange tokens and the sale amount. For example, 1000 USDT to WBTC.
GUI — the user sets the slippage tolerance value as a percentage. The recommended value is 1%.
GUI (optional) — the user selects the gas price value from #4.
API — endpoint GET
v1/{chainID}/price
(GETv1/1/price
) provides the number of tokens that the user will receive for the purchase (0.05 WBTC).GUI — the user connects the wallet.
API — endpoint GET
v1/{chainID}/transaction/allowance
(GETv1/1/transaction/allowance
) returns the amount of tokens that the exchange smart contract has access to (not required for native coins).GUI — if the value of the sale is greater than the value from #10, the user is prompted to provide access for the tokens exchange (otherwise the exchange transaction will not be processed).
API — endpoint GET
v1/{chainID}/transaction/approve
returns the input parameters (calldata) for a transaction to provide access to tokens, and the address of the contract where the transaction should be sent to.GUI — generates an unsigned transaction based on the data from #12 and sends it to the user's connected wallet.
WALLET — the user confirms the operation in the wallet, and the wallet then signs the transaction and sends it to the blockchain.
GUI — after successful confirmation of the transaction from #14, the user is offered a button to exchange the selected tokens.
API — by endpoint GET
v1/{chainID}/quote
(GETv1/1/quote
) provides the number of the tokens purchased (0.05 WBTC), transaction input parameters.GUI — generates an unsigned transaction based on the data from #16 and sends it to the user's connected wallet.
WALLET — the user confirms the operation in the wallet, and the wallet then signs the transaction and sends it to the blockchain.
Last updated