This service allows users to register cryptocurrencies, and convert between fiat and crypto currencies using real-time exchange rates. It integrates with external APIs for accurate pricing and runs a background worker to update exchange rates regularly.
- Fiat to Crypto: Convert any amount in fiat currency (e.g., USD, EUR, GHS) to its equivalent in a registered cryptocurrency (e.g., BTC, ETH).
- Crypto to Fiat: Convert cryptocurrency amounts to their fiat currency equivalent.
- Easily register new coins you want to support in your application.
- Each registered coin is tracked and updated with the latest exchange rate.
A background worker runs at scheduled intervals to fetch and update exchange rates from two main sources:
- CoinGecko – for cryptocurrency rates.
- OpenExchangeRates – for fiat currency rates.
Rates are stored in the cache for fast access during conversions.
POST /api/CoinData/create-coin
{
"symbol": "btc",
"name": "Bitcoin"
}POST /api/CoinData/convert-coin-to-coin
{
"amount":0.25,
"fromCryptoSymbol": "btc",
"toCryptoSymbol": "eth"
}{
"amount": 100,
"cryptoSymbol": "btc",
"toCurrency": "ghs"
}