diff --git a/CHANGELOG.md b/CHANGELOG.md index 425aa20cb..0877bcf74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 2.63.0 - 2024-03-11 +## 2.63.1 - 2024-03-11 ### Added - Extended the content of the _Self-Hosting_ section by available home server systems on the Frequently Asked Questions (FAQ) page +- Added support for the cryptocurrency _Real Smurf Cat_ (`SMURFCAT-USD`) ### Changed @@ -21,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue in the performance calculation caused by multiple `SELL` activities on the same day - Fixed an issue in the calculation on the allocations page caused by liabilities +- Fixed an issue with the currency in the request to get quotes from _EOD Historical Data_ ## 2.62.0 - 2024-03-09 diff --git a/apps/api/src/assets/cryptocurrencies/custom.json b/apps/api/src/assets/cryptocurrencies/custom.json index ffda9c526..ef08ca449 100644 --- a/apps/api/src/assets/cryptocurrencies/custom.json +++ b/apps/api/src/assets/cryptocurrencies/custom.json @@ -4,6 +4,7 @@ "LUNA1": "Terra", "LUNA2": "Terra", "SGB1": "Songbird", + "SMURFCAT": "Real Smurf Cat", "UNI1": "Uniswap", "UNI7083": "Uniswap", "UST": "TerraUSD" diff --git a/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts b/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts index af67d62e9..d8e7a2e0b 100644 --- a/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts +++ b/apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts @@ -11,7 +11,6 @@ import { IDataProviderHistoricalResponse, IDataProviderResponse } from '@ghostfolio/api/services/interfaces/interfaces'; -import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service'; import { DEFAULT_CURRENCY, REPLACE_NAME_PARTS @@ -36,8 +35,7 @@ export class EodHistoricalDataService implements DataProviderInterface { private readonly URL = 'https://eodhistoricaldata.com/api'; public constructor( - private readonly configurationService: ConfigurationService, - private readonly symbolProfileService: SymbolProfileService + private readonly configurationService: ConfigurationService ) { this.apiKey = this.configurationService.get('API_KEY_EOD_HISTORICAL_DATA'); } @@ -232,29 +230,24 @@ export class EodHistoricalDataService implements DataProviderInterface { ? [realTimeResponse] : realTimeResponse; - const symbolProfiles = await this.symbolProfileService.getSymbolProfiles( - symbols.map((symbol) => { - return { - symbol, - dataSource: this.getName() - }; - }) - ); - response = quotes.reduce( - ( + async ( result: { [symbol: string]: IDataProviderResponse }, { close, code, timestamp } ) => { - const currency = symbolProfiles.find(({ symbol }) => { - return symbol === code; - })?.currency; + let currency: string; + + if (symbols.length === 1) { + const { items } = await this.search({ query: symbols[0] }); + + if (items.length === 1) { + currency = items[0].currency; + } + } if (isNumber(close)) { result[this.convertFromEodSymbol(code)] = { - currency: - currency ?? - this.convertFromEodSymbol(code)?.replace(DEFAULT_CURRENCY, ''), + currency, dataSource: this.getName(), marketPrice: close, marketState: isToday(new Date(timestamp * 1000)) diff --git a/package.json b/package.json index b5f7d9c3d..579c4151e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ghostfolio", - "version": "2.63.0", + "version": "2.63.1", "homepage": "https://ghostfol.io", "license": "AGPL-3.0", "repository": "https://github.com/ghostfolio/ghostfolio",