diff --git a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt index 362f8ad5a4..404a8fcf28 100644 --- a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt +++ b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationsFactory.kt @@ -112,13 +112,22 @@ object NotificationsFactory { reserveAmount: BigDecimal?, sendingAmount: BigDecimal, cryptoCurrency: CryptoCurrency, + feeCryptoCurrency: CryptoCurrency?, isAccountFunded: Boolean, ) { - if (!isAccountFunded && reserveAmount != null && reserveAmount > sendingAmount) { + val sendingCoinAmount = when (cryptoCurrency) { + is CryptoCurrency.Coin -> sendingAmount + is CryptoCurrency.Token -> BigDecimal.ZERO + } + + if (feeCryptoCurrency == null && cryptoCurrency is CryptoCurrency.Token) { + // No need to show reserve amount warning if fee currency is unknown for token transfer + return + } else if (!isAccountFunded && reserveAmount != null && reserveAmount > sendingCoinAmount) { add( NotificationUM.Error.ReserveAmount( reserveAmount.format { - crypto(cryptoCurrency) + crypto(feeCryptoCurrency ?: cryptoCurrency) }, ), ) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt index 23e1fec6c3..7642f338a8 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/notifications/model/NotificationsModel.kt @@ -272,6 +272,7 @@ internal class NotificationsModel @Inject constructor( reserveAmount = currencyCheck.reserveAmount, sendingAmount = sendingAmount, cryptoCurrency = currency, + feeCryptoCurrency = feeCryptoCurrencyStatus.currency, isAccountFunded = currencyCheck.isAccountFunded, ) addMinimumAmountErrorNotification( diff --git a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/notifications/AddStakingNotificationsTransformer.kt b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/notifications/AddStakingNotificationsTransformer.kt index 1681808734..b4daf2050b 100644 --- a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/notifications/AddStakingNotificationsTransformer.kt +++ b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/state/transformers/notifications/AddStakingNotificationsTransformer.kt @@ -214,6 +214,7 @@ internal class AddStakingNotificationsTransformer( reserveAmount = currencyCheck.reserveAmount, sendingAmount = sendingAmount, cryptoCurrency = cryptoCurrency, + feeCryptoCurrency = feeCryptoCurrencyStatus?.currency, isAccountFunded = false, ) } diff --git a/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt b/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt index 9710aa7b07..00e5e36c6d 100644 --- a/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt +++ b/features/swap/impl/src/main/java/com/tangem/feature/swap/model/SwapNotificationsFactory.kt @@ -192,6 +192,7 @@ internal class SwapNotificationsFactory( reserveAmount = quoteModel.currencyCheck?.reserveAmount, sendingAmount = amountToRequest.value, cryptoCurrency = fromCurrencyStatus.currency, + feeCryptoCurrency = feeCryptoCurrencyStatus?.currency, isAccountFunded = false, ) addReduceAmountNotification(