Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-27 16:33:48 +05:00
parent 9fe1b22210
commit e376a88b44
4 changed files with 14 additions and 2 deletions

View file

@ -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)
},
),
)

View file

@ -272,6 +272,7 @@ internal class NotificationsModel @Inject constructor(
reserveAmount = currencyCheck.reserveAmount,
sendingAmount = sendingAmount,
cryptoCurrency = currency,
feeCryptoCurrency = feeCryptoCurrencyStatus.currency,
isAccountFunded = currencyCheck.isAccountFunded,
)
addMinimumAmountErrorNotification(

View file

@ -214,6 +214,7 @@ internal class AddStakingNotificationsTransformer(
reserveAmount = currencyCheck.reserveAmount,
sendingAmount = sendingAmount,
cryptoCurrency = cryptoCurrency,
feeCryptoCurrency = feeCryptoCurrencyStatus?.currency,
isAccountFunded = false,
)
}

View file

@ -192,6 +192,7 @@ internal class SwapNotificationsFactory(
reserveAmount = quoteModel.currencyCheck?.reserveAmount,
sendingAmount = amountToRequest.value,
cryptoCurrency = fromCurrencyStatus.currency,
feeCryptoCurrency = feeCryptoCurrencyStatus?.currency,
isAccountFunded = false,
)
addReduceAmountNotification(