@@ -8,11 +8,13 @@ import { useDisplayDenom } from '../../hooks/useDisplayDenom'
88import { useHandler } from '../../hooks/useHandler'
99import { lstrings } from '../../locales/strings'
1010import { getExchangeDenom } from '../../selectors/DenominationSelectors'
11- import { getExchangeRate } from '../../selectors/WalletSelectors'
11+ import {
12+ convertCurrency ,
13+ getExchangeRate
14+ } from '../../selectors/WalletSelectors'
1215import { useSelector } from '../../types/reactRedux'
1316import { getCurrencyCode } from '../../util/CurrencyInfoHelpers'
1417import {
15- convertCurrencyFromExchangeRates ,
1618 DECIMAL_PRECISION ,
1719 getDenomFromIsoCode ,
1820 maxPrimaryCurrencyConversionDecimals ,
@@ -132,14 +134,14 @@ const ExchangedFlipInput2Component = React.forwardRef<
132134 }
133135 ]
134136
135- const convertCurrency = useHandler (
137+ const convertCurrencyHandler = useHandler (
136138 (
137139 amount : string ,
138140 pluginId : string ,
139141 tokenId : EdgeTokenId ,
140142 isoFiatCode : string
141143 ) : string => {
142- return convertCurrencyFromExchangeRates (
144+ return convertCurrency (
143145 exchangeRates ,
144146 pluginId ,
145147 tokenId ,
@@ -162,7 +164,7 @@ const ExchangedFlipInput2Component = React.forwardRef<
162164 cryptoDisplayDenom . multiplier ,
163165 DECIMAL_PRECISION
164166 )
165- const fiatAmountLong = convertCurrency (
167+ const fiatAmountLong = convertCurrencyHandler (
166168 exchangeAmount ,
167169 pluginId ,
168170 tokenId ,
@@ -258,7 +260,7 @@ const ExchangedFlipInput2Component = React.forwardRef<
258260 const { exchangeAmount, displayAmount } = convertFromCryptoNative (
259261 startNativeAmount ?? ''
260262 )
261- const initFiat = convertCurrency (
263+ const initFiat = convertCurrencyHandler (
262264 exchangeAmount ,
263265 pluginId ,
264266 tokenId ,
@@ -267,7 +269,7 @@ const ExchangedFlipInput2Component = React.forwardRef<
267269 setRenderDisplayAmount ( displayAmount )
268270 setRenderFiatAmount ( initFiat )
269271 } , [
270- convertCurrency ,
272+ convertCurrencyHandler ,
271273 convertFromCryptoNative ,
272274 cryptoCurrencyCode ,
273275 defaultIsoFiat ,
@@ -296,10 +298,10 @@ const ExchangedFlipInput2Component = React.forwardRef<
296298 */
297299 const overrideForceField = useMemo (
298300 ( ) =>
299- convertCurrency ( '100' , pluginId , tokenId , defaultIsoFiat ) === '0'
301+ convertCurrencyHandler ( '100' , pluginId , tokenId , defaultIsoFiat ) === '0'
300302 ? 'crypto'
301303 : forceField ,
302- [ convertCurrency , defaultIsoFiat , forceField , pluginId , tokenId ]
304+ [ convertCurrencyHandler , defaultIsoFiat , forceField , pluginId , tokenId ]
303305 )
304306
305307 const pluginInfo = getSpecialCurrencyInfo ( pluginId )
0 commit comments