diff --git a/src/components/PositionListItem/index.tsx b/src/components/PositionListItem/index.tsx index 8c8cbdd2..b11a6fb3 100644 --- a/src/components/PositionListItem/index.tsx +++ b/src/components/PositionListItem/index.tsx @@ -173,8 +173,7 @@ export default function PositionListItem({ tick_lower: tickLower, tick_upper: tickUpper, }: PositionListItemProps) { - const { formatDelta, formatTickPrice } = useFormatter() - + const { formatTickPrice } = useFormatter() const token0 = useToken(token0Address) const token1 = useToken(token1Address) diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index dad69d75..15278f5b 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -13,6 +13,7 @@ export const isBsc = false export const isPolygon = false export const isCelo = false export const MAX_UINT128 = BigInt(2) ** BigInt(128) - BigInt(1) +export const ETH_ADDRESS = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' export const NATIVE_CHAIN_ID = 'NATIVE' export const ZERO_ADDRESS_STARKNET = '0x0000000000000000000000000000000000000000000000000000000000000000' diff --git a/src/hooks/Tokens.ts b/src/hooks/Tokens.ts index 80ee2335..4b0d551c 100644 --- a/src/hooks/Tokens.ts +++ b/src/hooks/Tokens.ts @@ -15,6 +15,7 @@ import { deserializeToken, useUserAddedTokens } from '../state/user/hooks' import { isAddressValidForStarknet } from 'utils/addresses' import { useTokenContract } from './useContractV2' import { NEVER_RELOAD, useSingleCallResult } from 'state/multicall/hooks' +import { ETH_ADDRESS, WETH } from 'constants/tokens' type Maybe = T | null | undefined @@ -203,6 +204,7 @@ export function useToken(tokenAddress?: string | null): Token | null | undefined return useMemo(() => { if (token) return token if (!chainId || !address) return undefined + if (address === ETH_ADDRESS) return WETH[chainId] if (decimals.loading || symbol.loading || tokenName.loading) return null if (decimals.result) { const token = new Token( diff --git a/src/utils/unwrappedToken.ts b/src/utils/unwrappedToken.ts index afaf314c..c2ef6170 100644 --- a/src/utils/unwrappedToken.ts +++ b/src/utils/unwrappedToken.ts @@ -4,9 +4,5 @@ import { Currency } from '@vnaysn/jediswap-sdk-core' // import { nativeOnChain, WRAPPED_NATIVE_CURRENCY } from '../constants/tokens' export function unwrappedToken(currency: Currency): Currency { - if (currency.isNative) return currency - // const formattedChainId = asSupportedChain(currency.chainId) - // if (formattedChainId && WRAPPED_NATIVE_CURRENCY[formattedChainId]?.equals(currency)) - // return nativeOnChain(currency.chainId) return currency }