From 494a1220254405780c71323ff0cef3d037947a30 Mon Sep 17 00:00:00 2001 From: Pedro Pablo Aste Kompen Date: Tue, 9 Jul 2024 16:02:47 -0400 Subject: [PATCH] refactor(ramp): use Hex type --- app/components/UI/Ramp/hooks/useBalance.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/UI/Ramp/hooks/useBalance.ts b/app/components/UI/Ramp/hooks/useBalance.ts index 461dd011ca2..2ab6a1f6f03 100644 --- a/app/components/UI/Ramp/hooks/useBalance.ts +++ b/app/components/UI/Ramp/hooks/useBalance.ts @@ -1,5 +1,6 @@ -import { hexToBN } from '@metamask/controller-utils'; import { useSelector } from 'react-redux'; +import { hexToBN } from '@metamask/controller-utils'; +import { Hex } from '@metamask/utils'; import { NATIVE_ADDRESS } from '../../../../constants/on-ramp'; import { selectAccountsByChainId } from '../../../../selectors/accountTrackerController'; import { @@ -62,8 +63,7 @@ export default function useBalance(asset?: Asset) { ); balanceFiat = weiToFiat(balanceBN, conversionRate, currentCurrency); } else { - const exchangeRate = - tokenExchangeRates?.[assetAddress as `0x${string}`]?.price; + const exchangeRate = tokenExchangeRates?.[assetAddress as Hex]?.price; balance = assetAddress && assetAddress in balances ? renderFromTokenMinimalUnit(