From 1ca1fc0500fe88b5dad4ad7d6c0397bffb016e20 Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 12 Aug 2022 14:52:02 +0500 Subject: [PATCH 1/3] added estm fallback block --- src/providers/ecency/ecency.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/providers/ecency/ecency.ts b/src/providers/ecency/ecency.ts index 304171913..a22b9913c 100644 --- a/src/providers/ecency/ecency.ts +++ b/src/providers/ecency/ecency.ts @@ -31,7 +31,16 @@ export const getLatestQuotes = async (currencyRate: number): Promise Date: Fri, 12 Aug 2022 15:36:09 +0500 Subject: [PATCH 2/3] migrated currency-rate to private-api --- src/providers/ecency/ecency.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/providers/ecency/ecency.ts b/src/providers/ecency/ecency.ts index a22b9913c..95a44275b 100644 --- a/src/providers/ecency/ecency.ts +++ b/src/providers/ecency/ecency.ts @@ -18,8 +18,8 @@ import { CommentHistoryItem, LatestMarketPrices, ReceivedVestingShare, Referral, */ export const getCurrencyRate = (currency) => - api - .get(`/market-data/currency-rate/${currency}/hbd?fixed=1`) + ecencyApi + .get(`/private-api/market-data/${currency}/hbd?fixed=1`) .then((resp) => resp.data) .catch((err) => { bugsnagInstance.notify(err); @@ -58,8 +58,8 @@ export const getLatestQuotes = async (currencyRate: number): Promise - api - .get(`/market-data/currency-rate/${currency}/${token}`) + ecencyApi + .get(`/private-api/market-data/${currency}/${token}`) .then((resp) => resp.data) .catch((err) => { bugsnagInstance.notify(err); From d8ff5979c399defcb3bb023f0c2b637df8c948fd Mon Sep 17 00:00:00 2001 From: Nouman Tahir Date: Fri, 12 Aug 2022 15:45:42 +0500 Subject: [PATCH 3/3] parsing estm data from market-data/latest response --- src/providers/ecency/converters.ts | 9 ++------- src/providers/ecency/ecency.ts | 17 ++++------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/providers/ecency/converters.ts b/src/providers/ecency/converters.ts index 1746a2df0..2114bb8e4 100644 --- a/src/providers/ecency/converters.ts +++ b/src/providers/ecency/converters.ts @@ -30,17 +30,12 @@ export const convertQuoteItem = (rawData:any, currencyRate:number) => { } as QuoteItem } -export const convertLatestQuotes = (rawData: any, estmPrice:number, currencyRate:number) => { +export const convertLatestQuotes = (rawData: any, currencyRate:number) => { return { [COIN_IDS.HIVE]:convertQuoteItem(rawData.hive.quotes.usd, currencyRate), [COIN_IDS.HP]:convertQuoteItem(rawData.hive.quotes.usd, currencyRate), [COIN_IDS.HBD]:convertQuoteItem(rawData.hbd.quotes.usd, currencyRate), - [COIN_IDS.ECENCY]:convertQuoteItem({ - price:estmPrice, - percent_change:0, - last_updated:new Date().toISOString() - }, currencyRate) - + [COIN_IDS.ECENCY]:convertQuoteItem(rawData.estm.quotes.usd, currencyRate) } as LatestQuotes; }; diff --git a/src/providers/ecency/ecency.ts b/src/providers/ecency/ecency.ts index 95a44275b..c5a022d2e 100644 --- a/src/providers/ecency/ecency.ts +++ b/src/providers/ecency/ecency.ts @@ -32,22 +32,13 @@ export const getLatestQuotes = async (currencyRate: number): Promise