diff --git a/src/entries/popup/hooks/swap/useSwapReviewDetails.ts b/src/entries/popup/hooks/swap/useSwapReviewDetails.ts index e964092890..e3ce7d0a34 100644 --- a/src/entries/popup/hooks/swap/useSwapReviewDetails.ts +++ b/src/entries/popup/hooks/swap/useSwapReviewDetails.ts @@ -1,20 +1,16 @@ import { CrosschainQuote, Quote } from '@rainbow-me/swaps'; import { useMemo } from 'react'; -import { useCurrentCurrencyStore } from '~/core/state'; import { ParsedSearchAsset } from '~/core/types/assets'; import { ChainName } from '~/core/types/chains'; import { convertRawAmountToBalance, convertRawAmountToDecimalFormat, - convertRawAmountToNativeDisplay, divide, handleSignificantDecimals, multiply, } from '~/core/utils/numbers'; -import { useNativeAsset } from '../useNativeAsset'; - const getExchangeIconUrl = (protocol: string): string | null => { if (!protocol) return null; const parsedProtocol = protocol?.replace(' ', '')?.toLowerCase(); @@ -45,11 +41,6 @@ export const useSwapReviewDetails = ({ assetToSell: ParsedSearchAsset; quote: Quote | CrosschainQuote; }) => { - const { currentCurrency } = useCurrentCurrencyStore(); - const nativeAsset = useNativeAsset({ - chainId: assetToSell.chainId, - }); - const bridges = useMemo( () => (quote as CrosschainQuote)?.routes?.[0]?.usedBridgeNames || [], [quote], @@ -84,19 +75,16 @@ export const useSwapReviewDetails = ({ }, ).amount; return [ - convertRawAmountToNativeDisplay( - quote.feeInEth.toString(), - nativeAsset?.decimals || 18, - nativeAsset?.price?.value || '0', - currentCurrency, - ).display, + convertRawAmountToBalance(quote.fee.toString(), { + decimals: quote.feeTokenAsset?.decimals || 18, + symbol: quote.feeTokenAsset?.symbol, + })?.display, `${handleSignificantDecimals(multiply(feePercentage, 100), 2)}%`, ]; }, [ - currentCurrency, - nativeAsset?.decimals, - nativeAsset?.price?.value, - quote.feeInEth, + quote.feeTokenAsset?.decimals, + quote.feeTokenAsset?.symbol, + quote.fee, quote.feePercentageBasisPoints, ]);