mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-24 05:42:33 +03:00
added estm fallback block
This commit is contained in:
parent
f95b008c2e
commit
1ca1fc0500
@ -31,7 +31,16 @@ export const getLatestQuotes = async (currencyRate: number): Promise<LatestMarke
|
||||
try {
|
||||
console.log('using currency rate', currencyRate);
|
||||
const res = await ecencyApi.get(`/private-api/market-data/latest`);
|
||||
const estmRes = await getCurrencyTokenRate('usd', 'estm')
|
||||
|
||||
|
||||
//TODO: remove block when estm working/stable endpoint is available
|
||||
let estmRes = 0.002 //hardcoded fallback value for estm
|
||||
try{
|
||||
estmRes = await getCurrencyTokenRate('usd', 'estm')
|
||||
} catch(err){
|
||||
console.warn('estm price get failed, using fallback value. ', err);
|
||||
}
|
||||
|
||||
|
||||
if (!res.data || !estmRes) {
|
||||
throw new Error("No quote data returned");
|
||||
|
Loading…
Reference in New Issue
Block a user