11import React , { useEffect } from 'react' ;
2- import { Pair } from '@uniswap/sdk' ;
2+ import { ETHER , Pair } from '@uniswap/sdk' ;
33import { Ether } from '@uniswap/sdk-core' ;
44import { Currency , CurrencyAmount , Percent , Token } from '@uniswap/sdk-core' ;
55import { ReactNode , useCallback , useMemo , useState } from 'react' ;
66import { LockOutlined } from '@material-ui/icons' ;
77import { useActiveWeb3React } from 'hooks' ;
88import CurrencyLogo from 'components/CurrencyLogo' ;
9- import { useCurrencyBalance } from 'state/wallet/v3/ hooks' ;
9+ import { useCurrencyBalance } from 'state/wallet/hooks' ;
1010import CurrencySearchModal from 'components/CurrencySearchModal' ;
1111import { Box , Typography } from '@material-ui/core' ;
1212import NumericalInput from 'components/NumericalInput' ;
@@ -89,7 +89,7 @@ export default function CurrencyInputPanel({
8989 const [ modalOpen , setModalOpen ] = useState ( false ) ;
9090 const { chainId, account } = useActiveWeb3React ( ) ;
9191 const { t } = useTranslation ( ) ;
92- const nativeCurrency = chainId ? Ether . onChain ( chainId ) : undefined ;
92+ const nativeCurrency = chainId ? ETHER [ chainId ] : undefined ;
9393 const ethBalance = useCurrencyBalance ( account ?? undefined , nativeCurrency ) ;
9494 const balance = useCurrencyBalance (
9595 account ?? undefined ,
@@ -107,15 +107,15 @@ export default function CurrencyInputPanel({
107107 const latestBlockNumber = useBlockNumber ( ) ;
108108 useEffect ( ( ) => {
109109 if ( updatedEthBalance == undefined ) {
110- setUpdatedEthBalance ( ethBalance ) ;
110+ setUpdatedEthBalance ( ethBalance as any ) ;
111111 } else {
112112 if ( ! multicallContract || ! latestBlockNumber || ! account ) return ;
113113 getCurrencyBalanceImmediately (
114114 multicallContract ,
115115 chainId ,
116116 latestBlockNumber ,
117117 account ,
118- nativeCurrency ,
118+ nativeCurrency as any ,
119119 ) . then ( ( value ) => {
120120 setUpdatedEthBalance ( value ) ;
121121 if ( currency ?. isNative ) {
@@ -124,7 +124,7 @@ export default function CurrencyInputPanel({
124124 } ) ;
125125 }
126126 if ( updatedBalance == undefined ) {
127- setUpdatedBalance ( balance ) ;
127+ setUpdatedBalance ( balance as any ) ;
128128 } else {
129129 if (
130130 currency ?. isNative ||
@@ -148,8 +148,8 @@ export default function CurrencyInputPanel({
148148 const ethBalanceDependency = JSON . stringify ( ethBalance ) ;
149149 const balanceDependency = JSON . stringify ( balance ) ;
150150 useEffect ( ( ) => {
151- setUpdatedEthBalance ( ethBalance ) ;
152- setUpdatedBalance ( balance ) ;
151+ setUpdatedEthBalance ( ethBalance as any ) ;
152+ setUpdatedBalance ( balance as any ) ;
153153 // eslint-disable-next-line react-hooks/exhaustive-deps
154154 } , [ ethBalanceDependency , balanceDependency ] ) ;
155155
0 commit comments