Commit 3aa04530 authored by Moody Salem's avatar Moody Salem

remove a few unused isToken calls

parent e0a7c379
......@@ -114,7 +114,7 @@ function CurrencyRow({
const { account } = useActiveWeb3React()
const key = currencyKey(currency)
const selectedTokenList = useCombinedActiveList()
const isOnSelectedList = isTokenOnList(selectedTokenList, currency)
const isOnSelectedList = isTokenOnList(selectedTokenList, currency.isToken ? currency : undefined)
const customAdded = useIsUserAddedToken(currency)
const balance = useCurrencyBalance(account ?? undefined, currency)
......@@ -133,7 +133,7 @@ function CurrencyRow({
{currency.symbol}
</Text>
<TYPE.darkGray ml="0px" fontSize={'12px'} fontWeight={300}>
{currency.name} {!isOnSelectedList && customAdded && '• Added by user'}
{currency.name} {!currency.isEther && !isOnSelectedList && customAdded && '• Added by user'}
</TYPE.darkGray>
</Column>
<TokenTags currency={currency} />
......
......@@ -83,9 +83,7 @@ export default function PoolCard({ stakingInfo }: { stakingInfo: StakingInfo })
const WETH = currency0.isEther ? token0 : token1
const backgroundColor = useColor(token)
const totalSupplyOfStakingToken = useTotalSupply(
stakingInfo.stakedAmount.currency.isToken ? stakingInfo.stakedAmount.currency : undefined
)
const totalSupplyOfStakingToken = useTotalSupply(stakingInfo.stakedAmount.currency)
const [, stakingTokenPair] = useV2Pair(...stakingInfo.tokens)
// let returnOverMonth: Percent = new Percent('0')
......
......@@ -50,7 +50,7 @@ export default function StakingModal({ isOpen, onDismiss, stakingInfo, userLiqui
const [typedValue, setTypedValue] = useState('')
const { parsedAmount, error } = useDerivedStakeInfo(
typedValue,
stakingInfo.stakedAmount.currency.isToken ? stakingInfo.stakedAmount.currency : undefined,
stakingInfo.stakedAmount.currency,
userLiquidityUnstaked
)
const parsedAmountWrapped = wrappedCurrencyAmount(parsedAmount, chainId)
......
......@@ -89,9 +89,7 @@ export function useBestV3TradeExactIn(
route: bestRoute,
tradeType: TradeType.EXACT_INPUT,
inputAmount: amountIn,
outputAmount: currencyOut.isToken
? CurrencyAmount.fromRawAmount(currencyOut, amountOut.toString())
: CurrencyAmount.ether(amountOut.toString()),
outputAmount: CurrencyAmount.fromRawAmount(currencyOut, amountOut.toString()),
}),
}
}, [amountIn, currencyOut, quotesResults, routes, routesLoading])
......
......@@ -14,8 +14,8 @@ export function useIsSwapUnsupported(currencyIn?: Currency, currencyOut?: Curren
// if unsupported list loaded & either token on list, mark as unsupported
return Boolean(
unsupportedTokens &&
((currencyIn && currencyIn.isToken && unsupportedTokens[currencyIn.address]) ||
(currencyOut && currencyOut.isToken && unsupportedTokens[currencyOut.address]))
((currencyIn?.isToken && unsupportedTokens[currencyIn.address]) ||
(currencyOut?.isToken && unsupportedTokens[currencyOut.address]))
)
}, [currencyIn, currencyOut, unsupportedTokens])
}
......@@ -3,7 +3,7 @@ import { getAddress } from '@ethersproject/address'
import { AddressZero } from '@ethersproject/constants'
import { JsonRpcSigner, Web3Provider } from '@ethersproject/providers'
import { BigNumber } from '@ethersproject/bignumber'
import { ChainId, Percent, CurrencyAmount, Currency, Fraction } from '@uniswap/sdk-core'
import { ChainId, Percent, CurrencyAmount, Currency, Fraction, Token } from '@uniswap/sdk-core'
import { FeeAmount } from '@uniswap/v3-sdk/dist/'
import JSBI from 'jsbi'
import { TokenAddressMap } from '../state/lists/hooks'
......@@ -92,9 +92,8 @@ export function escapeRegExp(string: string): string {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // $& means the whole matched string
}
export function isTokenOnList(defaultTokens: TokenAddressMap, currency?: Currency): boolean {
if (currency?.isEther) return true
return Boolean(currency?.isToken && defaultTokens[currency.chainId as ChainId]?.[currency.address])
export function isTokenOnList(tokenAddressMap: TokenAddressMap, token?: Token): boolean {
return Boolean(token?.isToken && tokenAddressMap[token.chainId as ChainId]?.[token.address])
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment