@@ -13,7 +13,6 @@ import { useIsPoolOutOfSync } from 'hooks/useIsPoolOutOfSync'
13
13
import { PoolState , usePool } from 'hooks/usePools'
14
14
import { useSwapTaxes } from 'hooks/useSwapTaxes'
15
15
import { PairState , useV2Pair } from 'hooks/useV2Pairs'
16
- import { useCurrencyBalances } from 'lib/hooks/useCurrencyBalance'
17
16
import tryParseCurrencyAmount from 'lib/utils/tryParseCurrencyAmount'
18
17
import { useCreatePositionContext , usePriceRangeContext } from 'pages/Pool/Positions/create/CreatePositionContext'
19
18
import {
@@ -53,6 +52,7 @@ import { useUrlContext } from 'uniswap/src/contexts/UrlContext'
53
52
import { useGetPoolsByTokens } from 'uniswap/src/data/rest/getPools'
54
53
import { useEnabledChains } from 'uniswap/src/features/chains/hooks/useEnabledChains'
55
54
import { useSupportedChainId } from 'uniswap/src/features/chains/hooks/useSupportedChainId'
55
+ import { useOnChainCurrencyBalance } from 'uniswap/src/features/portfolio/api'
56
56
import { useUSDCValue } from 'uniswap/src/features/transactions/swap/hooks/useUSDCPrice'
57
57
import { getParsedChainId } from 'utils/chainParams'
58
58
@@ -350,7 +350,8 @@ export function useDepositInfo(state: UseDepositInfoProps): DepositInfo {
350
350
const { protocolVersion, address, token0, token1, exactField, exactAmounts, deposit0Disabled, deposit1Disabled } =
351
351
state
352
352
353
- const [ token0Balance , token1Balance ] = useCurrencyBalances ( address , [ token0 , token1 ] )
353
+ const { balance : token0Balance } = useOnChainCurrencyBalance ( token0 , address )
354
+ const { balance : token1Balance } = useOnChainCurrencyBalance ( token1 , address )
354
355
355
356
const [ independentToken , dependentToken ] = exactField === PositionField . TOKEN0 ? [ token0 , token1 ] : [ token1 , token0 ]
356
357
const independentAmount = tryParseCurrencyAmount ( exactAmounts [ exactField ] , independentToken )
0 commit comments