Skip to main content

Use Case

Here is a simple use case of our exchange API:

  1. API — get a list of currently available currencies using the getCurrencies or getCurrenciesFull method;
  2. GUI — ask user to select a currency pair they want to exchange. For example, it can be LTC (Litecoin) to ETH (Ethereum);
  3. GUI — ask user to enter the amount to exchange;
  4. 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;
  5. GUI — show the calculated value to user and ask for confirmation;
  6. GUI — ask user for their wallet address to send coins after exchange;
  7. API — call the validateAddress method to validate the user's wallet address for a given currency (ETH);
  8. API — call the createTransaction method to get the LTC address to which user should send their funds;
  9. GUI — ask user to send LTC coins to the address for exchange;
  10. User sends LTC. We receive LTC and exchange it for ETH. We send ETH to the address that was submitted to createTransaction method;
  11. To get transaction details or see the transactions history, use the getTransactions method.