MCPcopy Index your code
hub / github.com/massCodeIO/massCode / refreshFiatRatesForced

Function refreshFiatRatesForced

src/main/currencyRates.ts:170–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168}
169
170export 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
187export async function refreshCryptoRatesForced(): Promise<CurrencyRatesPayload> {
188 const cryptoRates = await fetchCryptoRates()

Callers 2

registerSystemHandlersFunction · 0.90

Calls 4

fetchFiatRatesFunction · 0.85
createPayloadFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected