|
|
@ -112,7 +112,7 @@ export class CoinGeckoService implements DataProviderInterface { |
|
|
|
[symbol: string]: { [date: string]: IDataProviderHistoricalResponse }; |
|
|
|
}> { |
|
|
|
try { |
|
|
|
const { prices } = await fetch( |
|
|
|
const { error, prices, status } = await fetch( |
|
|
|
`${ |
|
|
|
this.apiUrl |
|
|
|
}/coins/${symbol}/market_chart/range?vs_currency=${DEFAULT_CURRENCY.toLowerCase()}&from=${getUnixTime( |
|
|
@ -124,6 +124,14 @@ export class CoinGeckoService implements DataProviderInterface { |
|
|
|
} |
|
|
|
).then((res) => res.json()); |
|
|
|
|
|
|
|
if (error?.status) { |
|
|
|
throw new Error(error.status.error_message); |
|
|
|
} |
|
|
|
|
|
|
|
if (status) { |
|
|
|
throw new Error(status.error_message); |
|
|
|
} |
|
|
|
|
|
|
|
const result: { |
|
|
|
[symbol: string]: { [date: string]: IDataProviderHistoricalResponse }; |
|
|
|
} = { |
|
|
|