diff --git a/src/components/swap/ConfirmSwapModal.tsx b/src/components/swap/ConfirmSwapModal.tsx index 98796538d2..147762a9c2 100644 --- a/src/components/swap/ConfirmSwapModal.tsx +++ b/src/components/swap/ConfirmSwapModal.tsx @@ -31,7 +31,6 @@ import { ThemedText } from 'theme/components' import invariant from 'tiny-invariant' import { isL2ChainId } from 'utils/chains' import { SignatureExpiredError } from 'utils/errors' -import { NumberType, useFormatter } from 'utils/formatNumbers' import { formatSwapPriceUpdatedEventProperties } from 'utils/loggingFormatters' import { didUserReject } from 'utils/swapErrorToUserReadableMessage' import { tradeMeaningfullyDiffers } from 'utils/tradeMeaningFullyDiffer' @@ -82,7 +81,6 @@ function useConfirmModalState({ const [confirmModalState, setConfirmModalState] = useState(ConfirmModalState.REVIEWING) const [approvalError, setApprovalError] = useState() const [pendingModalSteps, setPendingModalSteps] = useState([]) - const { formatCurrencyAmount } = useFormatter() // This is a function instead of a memoized value because we do _not_ want it to update as the allowance changes. // For example, if the user needs to complete 3 steps initially, we should always show 3 step indicators @@ -117,14 +115,7 @@ function useConfirmModalState({ const nativeCurrency = useNativeCurrency(chainId) const [wrapTxHash, setWrapTxHash] = useState() - const { execute: onWrap } = useWrapCallback( - nativeCurrency, - trade.inputAmount.currency, - formatCurrencyAmount({ - amount: trade.inputAmount, - type: NumberType.SwapTradeAmount, - }) - ) + const { execute: onWrap } = useWrapCallback(nativeCurrency, trade.inputAmount.currency, trade.inputAmount.toExact()) const wrapConfirmed = useIsTransactionConfirmed(wrapTxHash) const prevWrapConfirmed = usePrevious(wrapConfirmed) const catchUserReject = async (e: any, errorType: PendingModalError) => {