|
@ -30,8 +30,11 @@ import { |
|
|
HistoricalDividendsResult, |
|
|
HistoricalDividendsResult, |
|
|
HistoricalHistoryResult |
|
|
HistoricalHistoryResult |
|
|
} from 'yahoo-finance2/esm/src/modules/historical'; |
|
|
} from 'yahoo-finance2/esm/src/modules/historical'; |
|
|
import { Quote } from 'yahoo-finance2/esm/src/modules/quote'; |
|
|
import { |
|
|
import { SearchQuoteNonYahoo } from 'yahoo-finance2/script/src/modules/search'; |
|
|
Quote, |
|
|
|
|
|
QuoteResponseArray |
|
|
|
|
|
} from 'yahoo-finance2/esm/src/modules/quote'; |
|
|
|
|
|
import { SearchQuoteNonYahoo } from 'yahoo-finance2/esm/src/modules/search'; |
|
|
|
|
|
|
|
|
@Injectable() |
|
|
@Injectable() |
|
|
export class YahooFinanceService implements DataProviderInterface { |
|
|
export class YahooFinanceService implements DataProviderInterface { |
|
@ -281,11 +284,19 @@ export class YahooFinanceService implements DataProviderInterface { |
|
|
return true; |
|
|
return true; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const marketData = await this.yahooFinance.quote( |
|
|
let marketData: QuoteResponseArray = []; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
marketData = await this.yahooFinance.quote( |
|
|
quotes.map(({ symbol }) => { |
|
|
quotes.map(({ symbol }) => { |
|
|
return symbol; |
|
|
return symbol; |
|
|
}) |
|
|
}) |
|
|
); |
|
|
); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
if (error?.result?.length > 0) { |
|
|
|
|
|
marketData = error.result; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for (const marketDataItem of marketData) { |
|
|
for (const marketDataItem of marketData) { |
|
|
const quote = quotes.find((currentQuote) => { |
|
|
const quote = quotes.find((currentQuote) => { |
|
|