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.1
// yarn add @tatumio/tatum
2
3
import { TatumSDK, Ethereum, Network } from '@tatumio/tatum'
4
5
const tatum = await TatumSDK.init<Ethereum>({network: Network.ETHEREUM})
6
7
const rate = await tatum.rates.getCurrentRate("BTC","EUR")
1
export class RateBatchDto {
2
// fiat
3
basePair: Fiat
4
5
// crypto currency/fiat
6
currency: Fiat | Currency
7
}
1
export class Rate {
2
// crypto currency/fiat
3
_id: Fiat | Currency
4
5
// the amount of basePair that can be exchanged for 1 _id (crypto currency/fiat)
6
value: string
7
8
// fiat
9
basePair: Fiat
10
11
// timestamp of rate information from source
12
timestamp: number
13
14
// source of rate
15
source: string
16
}