|
|
@ -120,7 +120,11 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
yahooSymbol = symbol; |
|
|
yahooSymbol = symbol; |
|
|
} else if (isin) { |
|
|
} else if (isin) { |
|
|
const { quotes } = await this.yahooFinance.search(isin); |
|
|
const { quotes } = await this.yahooFinance.search(isin); |
|
|
yahooSymbol = (quotes?.[0] as { symbol?: string })?.symbol; |
|
|
const firstQuote = quotes?.[0]; |
|
|
|
|
|
|
|
|
|
|
|
if (firstQuote?.isYahooFinance) { |
|
|
|
|
|
yahooSymbol = firstQuote.symbol; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!yahooSymbol) { |
|
|
if (!yahooSymbol) { |
|
|
@ -209,7 +213,7 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (!assetProfile?.price?.symbol) { |
|
|
if (!assetProfile?.price?.symbol) { |
|
|
return undefined; |
|
|
throw new Error(`No price data found for ${symbol}`); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const { assetClass, assetSubClass } = this.parseAssetClass({ |
|
|
const { assetClass, assetSubClass } = this.parseAssetClass({ |
|
|
@ -317,11 +321,11 @@ export class YahooFinanceDataEnhancerService implements DataEnhancerInterface { |
|
|
quoteType?: string; |
|
|
quoteType?: string; |
|
|
shortName?: string | null; |
|
|
shortName?: string | null; |
|
|
}): { |
|
|
}): { |
|
|
assetClass?: AssetClass; |
|
|
assetClass: AssetClass; |
|
|
assetSubClass?: AssetSubClass; |
|
|
assetSubClass: AssetSubClass; |
|
|
} { |
|
|
} { |
|
|
let assetClass: AssetClass | undefined; |
|
|
let assetClass: AssetClass; |
|
|
let assetSubClass: AssetSubClass | undefined; |
|
|
let assetSubClass: AssetSubClass; |
|
|
|
|
|
|
|
|
switch (quoteType?.toLowerCase()) { |
|
|
switch (quoteType?.toLowerCase()) { |
|
|
case 'cryptocurrency': |
|
|
case 'cryptocurrency': |
|
|
|