Browse Source

Extend markets

pull/5076/head
Thomas Kaul 2 months ago
parent
commit
2ba4e66583
  1. 7
      apps/api/src/app/endpoints/market-data/market-data.controller.ts
  2. 7
      apps/api/src/app/info/info.service.ts
  3. 4
      apps/api/src/services/twitter-bot/twitter-bot.service.ts
  4. 4
      libs/common/src/lib/config.ts

7
apps/api/src/app/endpoints/market-data/market-data.controller.ts

@ -5,7 +5,8 @@ import { HasPermissionGuard } from '@ghostfolio/api/guards/has-permission.guard'
import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service';
import { SymbolProfileService } from '@ghostfolio/api/services/symbol-profile/symbol-profile.service';
import {
ghostfolioFearAndGreedIndexDataSource,
ghostfolioFearAndGreedIndexDataSourceCryptocurrencies,
ghostfolioFearAndGreedIndexDataSourceStocks,
ghostfolioFearAndGreedIndexSymbolCryptocurrencies,
ghostfolioFearAndGreedIndexSymbolStocks
} from '@ghostfolio/common/config';
@ -59,14 +60,14 @@ export class MarketDataController {
this.symbolService.get({
includeHistoricalData,
dataGatheringItem: {
dataSource: 'MANUAL',
dataSource: ghostfolioFearAndGreedIndexDataSourceCryptocurrencies,
symbol: ghostfolioFearAndGreedIndexSymbolCryptocurrencies
}
}),
this.symbolService.get({
includeHistoricalData,
dataGatheringItem: {
dataSource: ghostfolioFearAndGreedIndexDataSource,
dataSource: ghostfolioFearAndGreedIndexDataSourceStocks,
symbol: ghostfolioFearAndGreedIndexSymbolStocks
}
})

7
apps/api/src/app/info/info.service.ts

@ -14,7 +14,7 @@ import {
PROPERTY_DEMO_USER_ID,
PROPERTY_IS_READ_ONLY_MODE,
PROPERTY_SLACK_COMMUNITY_USERS,
ghostfolioFearAndGreedIndexDataSource
ghostfolioFearAndGreedIndexDataSourceStocks
} from '@ghostfolio/common/config';
import {
DATE_FORMAT,
@ -54,10 +54,11 @@ export class InfoService {
if (this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX')) {
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) {
info.fearAndGreedDataSource = encodeDataSource(
ghostfolioFearAndGreedIndexDataSource
ghostfolioFearAndGreedIndexDataSourceStocks
);
} else {
info.fearAndGreedDataSource = ghostfolioFearAndGreedIndexDataSource;
info.fearAndGreedDataSource =
ghostfolioFearAndGreedIndexDataSourceStocks;
}
globalPermissions.push(permissions.enableFearAndGreedIndex);

4
apps/api/src/services/twitter-bot/twitter-bot.service.ts

@ -2,7 +2,7 @@ import { SymbolService } from '@ghostfolio/api/app/symbol/symbol.service';
import { BenchmarkService } from '@ghostfolio/api/services/benchmark/benchmark.service';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import {
ghostfolioFearAndGreedIndexDataSource,
ghostfolioFearAndGreedIndexDataSourceStocks,
ghostfolioFearAndGreedIndexSymbol
} from '@ghostfolio/common/config';
import {
@ -44,7 +44,7 @@ export class TwitterBotService {
try {
const symbolItem = await this.symbolService.get({
dataGatheringItem: {
dataSource: ghostfolioFearAndGreedIndexDataSource,
dataSource: ghostfolioFearAndGreedIndexDataSourceStocks,
symbol: ghostfolioFearAndGreedIndexSymbol
}
});

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

@ -4,7 +4,9 @@ import ms from 'ms';
export const ghostfolioPrefix = 'GF';
export const ghostfolioScraperApiSymbolPrefix = `_${ghostfolioPrefix}_`;
export const ghostfolioFearAndGreedIndexDataSource = DataSource.RAPID_API;
export const ghostfolioFearAndGreedIndexDataSourceCryptocurrencies =
DataSource.MANUAL;
export const ghostfolioFearAndGreedIndexDataSourceStocks = DataSource.RAPID_API;
export const ghostfolioFearAndGreedIndexSymbol = `${ghostfolioScraperApiSymbolPrefix}FEAR_AND_GREED_INDEX`;
export const ghostfolioFearAndGreedIndexSymbolCryptocurrencies = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_CRYPTOCURRENCIES`;
export const ghostfolioFearAndGreedIndexSymbolStocks = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_STOCKS`;

Loading…
Cancel
Save