diff --git a/src/hooks/usePoolLists.ts b/src/hooks/usePoolLists.ts index 05fbe98..b7a3a5f 100644 --- a/src/hooks/usePoolLists.ts +++ b/src/hooks/usePoolLists.ts @@ -77,6 +77,14 @@ const calculateVolumeChange = (pool: PoolListItem, tokenPrices: TokenPrices): nu return res.toNumber(); }; +export const getReefInfuraUrl = (url:string)=>{ + if(!url)return url; + if(url.includes("cloudflare-ipfs.com")){ + return url.replace("cloudflare-ipfs.com","reef.infura-ipfs.io") + } + return url; +} + const calculateUSDTVL = ({ reserved1, reserved2, @@ -188,12 +196,12 @@ export const usePoolsList = ({ const mappedPools = poolsList.map((pool) => ({ address: pool.id, token1: { - image: !pool.iconUrl1 ? mergedTokenIconsMap[pool.token1]??getIconUrl(pool.token1) : pool.iconUrl1, + image: getReefInfuraUrl(!pool.iconUrl1 ? mergedTokenIconsMap[pool.token1]??getIconUrl(pool.token1) : pool.iconUrl1), name: pool.name1, address:pool.token1 }, token2: { - image: !pool.iconUrl2 ? mergedTokenIconsMap[pool.token2]??getIconUrl(pool.token2) : pool.iconUrl2, + image: getReefInfuraUrl(!pool.iconUrl2 ? mergedTokenIconsMap[pool.token2]??getIconUrl(pool.token2) : pool.iconUrl2), name: pool.name2, address:pool.token2 }, @@ -203,11 +211,14 @@ export const usePoolsList = ({ myLiquidity: calculateUserLiquidity(pool, tokenPrices), })); + return queryType === 'User' ? mappedPools.filter(pool => pool.myLiquidity && new BigNumber(pool.myLiquidity).isGreaterThan(0.1)) : mappedPools; + }, [dataPoolsList,tokenIconsMap]); + let count = 0; if (dataPoolsCount) { diff --git a/src/hooks/usePoolStats.ts b/src/hooks/usePoolStats.ts index 5c6ebea..d8535b7 100644 --- a/src/hooks/usePoolStats.ts +++ b/src/hooks/usePoolStats.ts @@ -19,6 +19,7 @@ import { graphqlRequest } from '../graphql/utils'; import { getIconUrl } from '../components/common/Icons'; import { useAsyncEffect } from './useAsyncEffect'; import { useObservableState } from './useObservableState'; +import { getReefInfuraUrl } from './usePoolLists'; const getPoolTotalValueLockedQry = (toTime: string): PoolQueryObject => ({ query: POOLS_TOTAL_VALUE_LOCKED, @@ -266,7 +267,7 @@ export const usePoolInfo = (address: string, signerAddress: string, tokenPrices: return { firstToken: { address: token1.id, - icon: token1.iconUrl === '' ? tokenIconsMap? tokenIconsMap[token1.id]: getIconUrl(token1.id) : token1.iconUrl, + icon: getReefInfuraUrl(token1.iconUrl === '' ? tokenIconsMap? tokenIconsMap[token1.id]: getIconUrl(token1.id) : token1.iconUrl), name: token1.name, symbol: token1.symbol, decimals: token1.decimals, @@ -282,7 +283,7 @@ export const usePoolInfo = (address: string, signerAddress: string, tokenPrices: }, secondToken: { address: token2.id, - icon: token2.iconUrl === '' ? tokenIconsMap? tokenIconsMap[token2.id]: getIconUrl(token2.id) : token2.iconUrl, + icon: getReefInfuraUrl(token2.iconUrl === '' ? tokenIconsMap? tokenIconsMap[token2.id]: getIconUrl(token2.id) : token2.iconUrl), name: token2.name, symbol: token2.symbol, decimals: token2.decimals,