Skip to content

UseRefreshExchangeRates

katanakit-js / useRefreshExchangeRates

function useRefreshExchangeRates(): Promise<
SafeResult<{
base:
| "USD"
| "EUR"
| "GBP"
| "JPY"
| "CHF"
| "CAD"
| "AUD"
| "NZD"
| "MXN"
| "BRL"
| "ARS"
| "COP"
| "CLP"
| "SEK"
| "NOK"
| "DKK"
| "PLN"
| "CZK"
| "HUF"
| "RON"
| "TRY"
| "ISK"
| "CNY"
| "HKD"
| "SGD"
| "INR"
| "KRW"
| "THB"
| "IDR"
| "MYR"
| "PHP"
| "ILS"
| "ZAR";
date: string;
rates: Record<string, number>;
}>
>;

Defined in: infrastructure/currency/currency.service.ts:113

Forces a rate refresh, bypassing the cache. Subscribers get onRatesUpdate.

Promise<SafeResult<{ base: | "USD" | "EUR" | "GBP" | "JPY" | "CHF" | "CAD" | "AUD" | "NZD" | "MXN" | "BRL" | "ARS" | "COP" | "CLP" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "RON" | "TRY" | "ISK" | "CNY" | "HKD" | "SGD" | "INR" | "KRW" | "THB" | "IDR" | "MYR" | "PHP" | "ILS" | "ZAR"; date: string; rates: Record<string, number>; }>>

{ data, error, ok } with the snapshot quoted against the pivot. Never throws.

await useRefreshExchangeRates();