Skip to content

This site describes solve-engine 2.44.0, the version npm installs.

HistoricalRateProvider

type HistoricalRateProvider = (from, to, isoDate, signal) => Promise<
| number
| HistoricalRate>;

Defined in: packages/engine/src/uom/HistoricalCurrency.ts:71

Resolve one historical exchange rate: the value of 1 unit of from in to on isoDate (YYYY-MM-DD), as a number or a HistoricalRate. The default currency package uses Frankfurter’s; a host supplies its own to use another source. Receives an AbortSignal that fires on caller cancellation or the fetch timeout, pass it to fetch(). A result that is not a finite, positive number is refused as a failed query rather than converted through.

ParameterType
fromstring
tostring
isoDatestring
signalAbortSignal

Promise< | number | HistoricalRate>