File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
app/selectors/earnController/earn Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import {
3535import { EarnTokenDetails } from '../../../components/UI/Earn/types/lending.types' ;
3636import { isNonEvmAddress } from '../../../core/Multichain/utils' ;
3737import { createDeepEqualSelector } from '../../util' ;
38+ import { toFormattedAddress } from '../../../util/address' ;
3839
3940const selectEarnControllerState = ( state : RootState ) =>
4041 state . engine . backgroundState . EarnController ;
@@ -191,19 +192,13 @@ const selectEarnTokens = createDeepEqualSelector(
191192 }
192193
193194 // TODO: balance logic, extract to utils then use when we are clear to add token
195+ const formattedAddress = toFormattedAddress ( selectedAddress as Hex ) ;
194196 const rawAccountBalance = selectedAddress
195- ? accountsByChainId [ token ?. chainId as Hex ] ?. [
196- isEvmAddress
197- ? getChecksumAddress ( selectedAddress as Hex )
198- : selectedAddress
199- ] ?. balance
197+ ? accountsByChainId [ token ?. chainId as Hex ] ?. [ formattedAddress ] ?. balance
200198 : '0' ;
201199 const rawStakedAccountBalance = selectedAddress
202- ? accountsByChainId [ token ?. chainId as Hex ] ?. [
203- isEvmAddress
204- ? getChecksumAddress ( selectedAddress as Hex )
205- : selectedAddress
206- ] ?. stakedBalance
200+ ? accountsByChainId [ token ?. chainId as Hex ] ?. [ formattedAddress ]
201+ ?. stakedBalance
207202 : '0' ;
208203 const balanceWei = hexToBN ( rawAccountBalance ) ;
209204 const stakedBalanceWei = hexToBN ( rawStakedAccountBalance ) ;
You can’t perform that action at this time.
0 commit comments