File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import BigNumber from "bignumber.js";
22import { getAddressPrefix , getCurrencyTypeFromAddress } from "./address" ;
33import { resolveNumber } from "./number" ;
44import { Currency , CurrencyObject , Transaction } from "./types" ;
5- import { DECIMALS } from "./constants" ;
5+ import { CRYPTO_CURRENCIES , DECIMALS } from "./constants" ;
66
77export const shouldTriggerOnSuccess = (
88 transaction : Transaction ,
@@ -33,7 +33,7 @@ export const shouldTriggerOnSuccess = (
3333 const transactionCurrency : Currency = getCurrencyTypeFromAddress ( address ) ;
3434 if ( transactionCurrency !== currency ) {
3535 if ( currencyObject ) {
36- const value = ( currencyObject . float / price ) . toFixed ( DECIMALS [ transactionCurrency ] )
36+ const value = CRYPTO_CURRENCIES . includes ( currencyObject . currency ) ? currencyObject . float : ( currencyObject . float / price ) . toFixed ( DECIMALS [ transactionCurrency ] )
3737 isAmountValid = resolveNumber ( value ) . isEqualTo ( amount )
3838 } else {
3939 isAmountValid = false
You can’t perform that action at this time.
0 commit comments