Class BitcoinExchangeRate
Methods
convertToFiat
- convertToFiat(amounts, rate?, unit?): Promise<number[]>
Parameters
- amounts: number[]
Optional
rate: number- unit: BitcoinUnit = 'SAT'
Returns Promise<number[]>
fromPriceToSats
- fromPriceToSats(price): Promise<number>
Returns Promise<number>
getDatedBitcoinExchangeRate
- getDatedBitcoinExchangeRate(date, currency?): Promise<DatedRate>
getExchangeRate
- getExchangeRate(forcedUpdate?): Promise<undefined | number>
Parameters
Optional
forcedUpdate: boolean
Returns Promise<undefined | number>
getLatestUpdate
- getLatestUpdate(): undefined | Date
Returns undefined | Date
getUpdateInterval
- getUpdateInterval(): number
Returns number
setActiveFiatCurrency
- setActiveFiatCurrency(currency): void
Returns void
setUpdateInterval
- setUpdateInterval(interval): void
Returns void
Static
getInstance
- getInstance(defaultFiatCurrency?, updateInterval?): BitcoinExchangeRate
Parameters
- defaultFiatCurrency: FiatCurrency = FiatCurrency.USD
- updateInterval: number = 5