1import { getConfig, updateConfig, EXCHANGE_INFO } from '../config.js'; 2import { getExchangeRate } from './index.js'; 3export async function convertCurrencyValues(data, fromCurrency, toCurrency, date) { 4 const exchangeRate = await getExchangeRate(fromCurrency, toCurrency, date); 5 return data.map(item => ({ 6 ...item, 7 value: item.value / exchangeRate, 8 marketCap: item.marketCap / exchangeRate, 9 })); 10} 11export function toggleCurrency() { 12 const config = getConfig(); 13 const exchangeInfo = EXCHANGE_INFO[config.exchange]; 14 const nativeCurrency = exchangeInfo?.nativeCurrency || 'USD'; 15 const newCurrency = config.currency === 'USD' ? nativeCurrency : 'USD'; 16 updateConfig({ currency: newCurrency }); 17} 18//# sourceMappingURL=data.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.