|
@ -6,6 +6,7 @@ import { |
|
|
IDataProviderResponse |
|
|
IDataProviderResponse |
|
|
} from '@ghostfolio/api/services/interfaces/interfaces'; |
|
|
} from '@ghostfolio/api/services/interfaces/interfaces'; |
|
|
import { DATE_FORMAT } from '@ghostfolio/common/helper'; |
|
|
import { DATE_FORMAT } from '@ghostfolio/common/helper'; |
|
|
|
|
|
import { DataProviderInfo } from '@ghostfolio/common/interfaces'; |
|
|
import { Granularity } from '@ghostfolio/common/types'; |
|
|
import { Granularity } from '@ghostfolio/common/types'; |
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { Injectable, Logger } from '@nestjs/common'; |
|
|
import { |
|
|
import { |
|
@ -145,6 +146,7 @@ export class CoinGeckoService implements DataProviderInterface { |
|
|
if (Object.prototype.hasOwnProperty.call(response, symbol)) { |
|
|
if (Object.prototype.hasOwnProperty.call(response, symbol)) { |
|
|
results[symbol] = { |
|
|
results[symbol] = { |
|
|
currency: this.baseCurrency, |
|
|
currency: this.baseCurrency, |
|
|
|
|
|
dataProviderInfo: this.getDataProviderInfo(), |
|
|
dataSource: DataSource.COINGECKO, |
|
|
dataSource: DataSource.COINGECKO, |
|
|
marketPrice: response[symbol][this.baseCurrency.toLowerCase()], |
|
|
marketPrice: response[symbol][this.baseCurrency.toLowerCase()], |
|
|
marketState: 'open' |
|
|
marketState: 'open' |
|
@ -188,4 +190,11 @@ export class CoinGeckoService implements DataProviderInterface { |
|
|
|
|
|
|
|
|
return { items }; |
|
|
return { items }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private getDataProviderInfo(): DataProviderInfo { |
|
|
|
|
|
return { |
|
|
|
|
|
name: 'CoinGecko', |
|
|
|
|
|
url: 'https://coingecko.com' |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|