Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-23 19:42:30 +05:00
parent 7e469fe376
commit 04905aca19
2 changed files with 13 additions and 2 deletions

View file

@ -9,6 +9,7 @@ import com.tangem.core.ui.extensions.wrappedList
import com.tangem.core.ui.format.bigdecimal.crypto
import com.tangem.core.ui.format.bigdecimal.format
import com.tangem.core.ui.format.bigdecimal.shorted
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.tokens.model.warnings.CryptoCurrencyWarning
import java.math.BigDecimal
@ -399,11 +400,16 @@ sealed class NotificationUM(val config: NotificationConfig) {
data class RentExemptionDestination(
private val rentExemptionAmount: BigDecimal,
private val cryptoCurrency: CryptoCurrency,
) : Error(
title = TextReference.Res(R.string.send_notification_invalid_amount_title),
subtitle = TextReference.Res(
id = R.string.send_notification_invalid_amount_rent_destination,
formatArgs = wrappedList(rentExemptionAmount),
formatArgs = wrappedList(
rentExemptionAmount.format {
crypto(cryptoCurrency)
},
),
),
)
}

View file

@ -368,6 +368,7 @@ object NotificationsFactory {
is BlockchainSdkError.DestinationTagRequired -> addRequireDestinationTagErrorNotification()
is BlockchainSdkError.Solana.DestinationRentExemption -> addRentExemptionDestinationNotification(
rentExemptionAmount = validationError.rentAmount,
cryptoCurrency = cryptoCurrency,
)
is BlockchainSdkError.TransactionDustChangeError -> add(
NotificationUM.Error.MinimumAmountError(
@ -462,10 +463,14 @@ object NotificationsFactory {
add(NotificationUM.Solana.RentInfo(rentWarning))
}
fun MutableList<NotificationUM>.addRentExemptionDestinationNotification(rentExemptionAmount: BigDecimal) {
private fun MutableList<NotificationUM>.addRentExemptionDestinationNotification(
rentExemptionAmount: BigDecimal,
cryptoCurrency: CryptoCurrency,
) {
add(
NotificationUM.Solana.RentExemptionDestination(
rentExemptionAmount = rentExemptionAmount,
cryptoCurrency = cryptoCurrency,
),
)
}