File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
src/components/transactions/Switch Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -674,10 +674,10 @@ export const BaseSwitchModalContent = ({
674674 chainId = { selectedChainId }
675675 destDecimals = { selectedOutputToken . decimals }
676676 srcDecimals = { selectedInputToken . decimals }
677- outAmount = { (
678- Number ( normalize ( switchRates . destAmount , switchRates . destDecimals ) ) *
679- ( 1 - safeSlippage )
680- ) . toString ( ) }
677+ outAmount = { normalizeBN ( switchRates . destAmount , switchRates . destDecimals )
678+ . multipliedBy ( 1 - safeSlippage )
679+ . decimalPlaces ( switchRates . destDecimals , BigNumber . ROUND_UP )
680+ . toString ( ) }
681681 />
682682 ) ;
683683 }
Original file line number Diff line number Diff line change 99 Skeleton ,
1010 Typography ,
1111} from '@mui/material' ;
12+ import { BigNumber } from 'bignumber.js' ;
1213import { useState } from 'react' ;
1314import { FormattedNumber } from 'src/components/primitives/FormattedNumber' ;
1415import { Link } from 'src/components/primitives/Link' ;
@@ -178,6 +179,11 @@ const IntentTxDetails = ({
178179 </ TextWithTooltip >
179180 ) ;
180181
182+ const destAmountAfterSlippage = normalizeBN ( switchRates . destAmount , switchRates . destDecimals )
183+ . multipliedBy ( 1 - safeSlippage )
184+ . decimalPlaces ( switchRates . destDecimals , BigNumber . ROUND_UP )
185+ . toString ( ) ;
186+
181187 return (
182188 < >
183189 < Accordion
@@ -309,10 +315,7 @@ const IntentTxDetails = ({
309315 sx = { { mr : 2 , ml : 4 , fontSize : '16px' } }
310316 />
311317 < FormattedNumber
312- value = {
313- Number ( normalize ( switchRates . destAmount , switchRates . destDecimals ) ) *
314- ( 1 - safeSlippage )
315- }
318+ value = { destAmountAfterSlippage }
316319 variant = "secondary14"
317320 compact
318321 roundDown = { true }
You can’t perform that action at this time.
0 commit comments