Browse Source

Merge remote-tracking branch 'origin/main' into feature/enable-strict-null-checks-in-ui

pull/6264/head
KenTandrian 2 weeks ago
parent
commit
7e7af90d85
  1. 11
      CHANGELOG.md
  2. 1
      apps/api/src/assets/cryptocurrencies/custom.json
  3. 7
      apps/api/src/services/cryptocurrency/cryptocurrency.module.ts
  4. 34
      apps/api/src/services/cryptocurrency/cryptocurrency.service.ts
  5. 2
      apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.spec.ts
  6. 1
      libs/common/src/lib/config.ts
  7. 12
      package-lock.json
  8. 2
      package.json

11
CHANGELOG.md

@ -5,6 +5,17 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Added
- Added support for custom cryptocurrencies defined in the database
- Added support for the cryptocurrency _Sky_
### Changed
- Upgraded `ngx-markdown` from version `21.0.1` to `21.1.0`
## 2.239.0 - 2026-02-15 ## 2.239.0 - 2026-02-15
### Added ### Added

1
apps/api/src/assets/cryptocurrencies/custom.json

@ -4,6 +4,7 @@
"LUNA1": "Terra", "LUNA1": "Terra",
"LUNA2": "Terra", "LUNA2": "Terra",
"SGB1": "Songbird", "SGB1": "Songbird",
"SKY33038": "Sky",
"SMURFCAT": "Real Smurf Cat", "SMURFCAT": "Real Smurf Cat",
"TON11419": "Toncoin", "TON11419": "Toncoin",
"UNI1": "Uniswap", "UNI1": "Uniswap",

7
apps/api/src/services/cryptocurrency/cryptocurrency.module.ts

@ -1,9 +1,12 @@
import { PropertyModule } from '@ghostfolio/api/services/property/property.module';
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { CryptocurrencyService } from './cryptocurrency.service'; import { CryptocurrencyService } from './cryptocurrency.service';
@Module({ @Module({
providers: [CryptocurrencyService], exports: [CryptocurrencyService],
exports: [CryptocurrencyService] imports: [PropertyModule],
providers: [CryptocurrencyService]
}) })
export class CryptocurrencyModule {} export class CryptocurrencyModule {}

34
apps/api/src/services/cryptocurrency/cryptocurrency.service.ts

@ -1,31 +1,39 @@
import { DEFAULT_CURRENCY } from '@ghostfolio/common/config'; import { PropertyService } from '@ghostfolio/api/services/property/property.service';
import {
DEFAULT_CURRENCY,
PROPERTY_CUSTOM_CRYPTOCURRENCIES
} from '@ghostfolio/common/config';
import { Injectable } from '@nestjs/common'; import { Injectable, OnModuleInit } from '@nestjs/common';
const cryptocurrencies = require('../../assets/cryptocurrencies/cryptocurrencies.json'); const cryptocurrencies = require('../../assets/cryptocurrencies/cryptocurrencies.json');
const customCryptocurrencies = require('../../assets/cryptocurrencies/custom.json'); const customCryptocurrencies = require('../../assets/cryptocurrencies/custom.json');
@Injectable() @Injectable()
export class CryptocurrencyService { export class CryptocurrencyService implements OnModuleInit {
private combinedCryptocurrencies: string[]; private combinedCryptocurrencies: string[];
public isCryptocurrency(aSymbol = '') { public constructor(private readonly propertyService: PropertyService) {}
const cryptocurrencySymbol = aSymbol.substring(0, aSymbol.length - 3);
return ( public async onModuleInit() {
aSymbol.endsWith(DEFAULT_CURRENCY) && const customCryptocurrenciesFromDatabase =
this.getCryptocurrencies().includes(cryptocurrencySymbol) await this.propertyService.getByKey<Record<string, string>>(
PROPERTY_CUSTOM_CRYPTOCURRENCIES
); );
}
private getCryptocurrencies() {
if (!this.combinedCryptocurrencies) {
this.combinedCryptocurrencies = [ this.combinedCryptocurrencies = [
...Object.keys(cryptocurrencies), ...Object.keys(cryptocurrencies),
...Object.keys(customCryptocurrencies) ...Object.keys(customCryptocurrencies),
...Object.keys(customCryptocurrenciesFromDatabase ?? {})
]; ];
} }
return this.combinedCryptocurrencies; public isCryptocurrency(aSymbol = '') {
const cryptocurrencySymbol = aSymbol.substring(0, aSymbol.length - 3);
return (
aSymbol.endsWith(DEFAULT_CURRENCY) &&
this.combinedCryptocurrencies.includes(cryptocurrencySymbol)
);
} }
} }

2
apps/api/src/services/data-provider/data-enhancer/yahoo-finance/yahoo-finance.service.spec.ts

@ -29,7 +29,7 @@ describe('YahooFinanceDataEnhancerService', () => {
let yahooFinanceDataEnhancerService: YahooFinanceDataEnhancerService; let yahooFinanceDataEnhancerService: YahooFinanceDataEnhancerService;
beforeAll(async () => { beforeAll(async () => {
cryptocurrencyService = new CryptocurrencyService(); cryptocurrencyService = new CryptocurrencyService(null);
yahooFinanceDataEnhancerService = new YahooFinanceDataEnhancerService( yahooFinanceDataEnhancerService = new YahooFinanceDataEnhancerService(
cryptocurrencyService cryptocurrencyService

1
libs/common/src/lib/config.ts

@ -199,6 +199,7 @@ export const PROPERTY_BETTER_UPTIME_MONITOR_ID = 'BETTER_UPTIME_MONITOR_ID';
export const PROPERTY_COUNTRIES_OF_SUBSCRIBERS = 'COUNTRIES_OF_SUBSCRIBERS'; export const PROPERTY_COUNTRIES_OF_SUBSCRIBERS = 'COUNTRIES_OF_SUBSCRIBERS';
export const PROPERTY_COUPONS = 'COUPONS'; export const PROPERTY_COUPONS = 'COUPONS';
export const PROPERTY_CURRENCIES = 'CURRENCIES'; export const PROPERTY_CURRENCIES = 'CURRENCIES';
export const PROPERTY_CUSTOM_CRYPTOCURRENCIES = 'CUSTOM_CRYPTOCURRENCIES';
export const PROPERTY_DATA_SOURCE_MAPPING = 'DATA_SOURCE_MAPPING'; export const PROPERTY_DATA_SOURCE_MAPPING = 'DATA_SOURCE_MAPPING';
export const PROPERTY_DATA_SOURCES_GHOSTFOLIO_DATA_PROVIDER_MAX_REQUESTS = export const PROPERTY_DATA_SOURCES_GHOSTFOLIO_DATA_PROVIDER_MAX_REQUESTS =
'DATA_SOURCES_GHOSTFOLIO_DATA_PROVIDER_MAX_REQUESTS'; 'DATA_SOURCES_GHOSTFOLIO_DATA_PROVIDER_MAX_REQUESTS';

12
package-lock.json

@ -74,7 +74,7 @@
"ms": "3.0.0-canary.1", "ms": "3.0.0-canary.1",
"ng-extract-i18n-merge": "3.2.1", "ng-extract-i18n-merge": "3.2.1",
"ngx-device-detector": "11.0.0", "ngx-device-detector": "11.0.0",
"ngx-markdown": "21.0.1", "ngx-markdown": "21.1.0",
"ngx-skeleton-loader": "12.0.0", "ngx-skeleton-loader": "12.0.0",
"open-color": "1.9.1", "open-color": "1.9.1",
"papaparse": "5.3.1", "papaparse": "5.3.1",
@ -26308,16 +26308,16 @@
} }
}, },
"node_modules/ngx-markdown": { "node_modules/ngx-markdown": {
"version": "21.0.1", "version": "21.1.0",
"resolved": "https://registry.npmjs.org/ngx-markdown/-/ngx-markdown-21.0.1.tgz", "resolved": "https://registry.npmjs.org/ngx-markdown/-/ngx-markdown-21.1.0.tgz",
"integrity": "sha512-TQnxrU9b+JclgXBFVg0Xp/6YEMom+hpiEjBMlE56cIWzONNh7pshMeMkz972wWzvQvTP+55/BmEZQc+4Vq1MWg==", "integrity": "sha512-qiyn9Je20F9yS4/q0p1Xhk2b/HW0rHWWlJNRm8DIzJKNck9Rmn/BfFxq0webmQHPPyYkg2AjNq/ZeSqDTQJbsQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"tslib": "^2.3.0" "tslib": "^2.3.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"emoji-toolkit": ">= 8.0.0 < 10.0.0", "emoji-toolkit": ">= 8.0.0 < 11.0.0",
"katex": "^0.16.0", "katex": "^0.16.0",
"mermaid": ">= 10.6.0 < 12.0.0", "mermaid": ">= 10.6.0 < 12.0.0",
"prismjs": "^1.30.0" "prismjs": "^1.30.0"
@ -26326,7 +26326,7 @@
"@angular/common": "^21.0.0", "@angular/common": "^21.0.0",
"@angular/core": "^21.0.0", "@angular/core": "^21.0.0",
"@angular/platform-browser": "^21.0.0", "@angular/platform-browser": "^21.0.0",
"marked": "^17.0.0 || ^16.0.0", "marked": "^17.0.0",
"rxjs": "^6.5.3 || ^7.4.0", "rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.15.0 || ~0.16.0" "zone.js": "~0.15.0 || ~0.16.0"
} }

2
package.json

@ -118,7 +118,7 @@
"ms": "3.0.0-canary.1", "ms": "3.0.0-canary.1",
"ng-extract-i18n-merge": "3.2.1", "ng-extract-i18n-merge": "3.2.1",
"ngx-device-detector": "11.0.0", "ngx-device-detector": "11.0.0",
"ngx-markdown": "21.0.1", "ngx-markdown": "21.1.0",
"ngx-skeleton-loader": "12.0.0", "ngx-skeleton-loader": "12.0.0",
"open-color": "1.9.1", "open-color": "1.9.1",
"papaparse": "5.3.1", "papaparse": "5.3.1",

Loading…
Cancel
Save