add additional currency parsing

This commit is contained in:
tomato6966 2025-03-08 16:41:11 +01:00
parent 8c4dba0734
commit ee5f002271

View file

@ -100,11 +100,10 @@ export const getHistoricalData = async (symbol: string, startDate: Date, endDate
const quotes = indicators.quote[0];
const lessThenADay = ["60m", "1h", "90m", "45m", "30m", "15m", "5m", "2m", "1m"].includes(interval);
return {
historicalData: new Map(timestamp.map((time: number, index: number) => [formatDateToISO(new Date(time * 1000), lessThenADay), quotes.close[index]])),
longName: meta.longName,
currency: meta.currency,
currency: meta.currency || symbol.toUpperCase().includes("USD") ? "USD" : symbol.toUpperCase().includes("GBP") ? "GBP" : symbol.toUpperCase().includes("EUR") ? "EUR" : null,
lastPrice: meta.chartPreviousClose
}
} catch (error) {