Get current exchange rate of the crypto asset
This endpoint allows you to obtain current exchange rate between fiat/crypto or fiat/fiat.
The getExchangeRate()
method offers a seamless way to retrieve up-to-date exchange rate information for cryptocurrencies. By invoking this method, you can effortlessly access the current exchange rate, along with the corresponding timestamp and the reliable source of the data.
How to use it
// yarn add @tatumio/tatum
import { TatumSDK, Ethereum, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
const rate = await tatum.rates.getCurrentRate("BTC","EUR")
Request Interface
export class RateBatchDto {
// fiat
basePair: Fiat
// crypto currency/fiat
currency: Fiat | Currency
}
Response interface
export class Rate {
// crypto currency/fiat
_id: Fiat | Currency
// the amount of basePair that can be exchanged for 1 _id (crypto currency/fiat)
value: string
// fiat
basePair: Fiat
// timestamp of rate information from source
timestamp: number
// source of rate
source: string
}
Supported FIAT
See the full wide range of fiat currencies we support for the exchange submodule on this page.
Supported Crypto Currency
See the full wide range of crypto currencies we support for the exchange submodule on this page.
Updated 8 months ago