Use Case
Here is a simple use case of our exchange API:
- API — get a list of currently available currencies using the getCurrencies or getCurrenciesFull method;
- GUI — ask user to select a currency pair they want to exchange. For example, it can be LTC (Litecoin) to ETH (Ethereum);
- GUI — ask user to enter the amount to exchange;
- API — call the getExchangeAmount method to get estimated ETH amount. Deduct
networkFee
from the estimated ETH amount (amountTo
) to get the amount that user will receive after the exchange; - GUI — show the calculated value to user and ask for confirmation;
- GUI — ask user for their wallet address to send coins after exchange;
- API — call the validateAddress method to validate the user's wallet address for a given currency (ETH);
- API — call the createTransaction method to get the LTC address to which user should send their funds;
- GUI — ask user to send LTC coins to the address for exchange;
- User sends LTC. We receive LTC and exchange it for ETH. We send ETH to the address that was submitted to createTransaction method;
- To get transaction details or see the transactions history, use the getTransactions method.