(rates: Record<string, number>)
| 53 | } |
| 54 | |
| 55 | function createPayload(rates: Record<string, number>): CurrencyRatesPayload { |
| 56 | return { |
| 57 | rates: normalizeRates(rates), |
| 58 | fetchedAt: Date.now(), |
| 59 | source: 'live', |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | async function fetchFiatRates(): Promise<Record<string, number>> { |
| 64 | const response = await fetch('https://open.er-api.com/v6/latest/USD') |
no test coverage detected