()
| 168 | } |
| 169 | |
| 170 | export async function refreshFiatRatesForced(): Promise<CurrencyRatesPayload> { |
| 171 | const fiatRates = await fetchFiatRates() |
| 172 | const cached = store.currencyRates.get('cache') |
| 173 | |
| 174 | if (!cached) { |
| 175 | return createPayload(fiatRates) |
| 176 | } |
| 177 | |
| 178 | const payload = createPayload({ ...cached.rates, ...fiatRates }) |
| 179 | store.currencyRates.set('cache', { |
| 180 | rates: payload.rates, |
| 181 | fetchedAt: payload.fetchedAt, |
| 182 | }) |
| 183 | |
| 184 | return payload |
| 185 | } |
| 186 | |
| 187 | export async function refreshCryptoRatesForced(): Promise<CurrencyRatesPayload> { |
| 188 | const cryptoRates = await fetchCryptoRates() |
no test coverage detected