Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-08 17:43:42 +05:00
parent a075d9737b
commit a4e8e059a7
2 changed files with 25 additions and 7 deletions

View file

@ -170,6 +170,14 @@ sealed class NotificationUM(val config: NotificationConfig) {
subtitle = resourceReference(id = R.string.send_notification_invalid_reserve_amount_text), subtitle = resourceReference(id = R.string.send_notification_invalid_reserve_amount_text),
) )
data class NetworkAccountNotFunded(val coinName: String) : Error(
title = resourceReference(R.string.alert_failed_to_send_transaction_title),
subtitle = resourceReference(
id = R.string.no_account_generic,
formatArgs = wrappedList(coinName),
),
)
data object DestinationTagRequired : Error( data object DestinationTagRequired : Error(
title = resourceReference(id = R.string.send_validation_destination_tag_required_title), title = resourceReference(id = R.string.send_validation_destination_tag_required_title),
subtitle = resourceReference(id = R.string.send_validation_destination_tag_required_description), subtitle = resourceReference(id = R.string.send_validation_destination_tag_required_description),

View file

@ -136,14 +136,24 @@ object NotificationsFactory {
// No need to show reserve amount warning if fee currency is unknown for token transfer // No need to show reserve amount warning if fee currency is unknown for token transfer
return return
} else if (!isAccountFunded && reserveAmount != null && reserveAmount > sendingCoinAmount) { } else if (!isAccountFunded && reserveAmount != null && reserveAmount > sendingCoinAmount) {
add( // account not funded, sending coin amount < reserve (send coin with less amount OR send any token)
NotificationUM.Error.ReserveAmount(
reserveAmount.format { if (cryptoCurrency is CryptoCurrency.Coin) {
crypto(feeCryptoCurrency ?: cryptoCurrency) // Try to send coin amount less than reserve amount (e.g. less than 1 XLM in Stellar)
}, add(
), NotificationUM.Error.ReserveAmount(
) reserveAmount.format {
crypto(feeCryptoCurrency ?: cryptoCurrency)
},
),
)
} else {
checkNotNull(feeCryptoCurrency)
// Try to send any token (e.g. USDC in Stellar, but account not funded -> user must send XLM at first)
add(NotificationUM.Error.NetworkAccountNotFunded(coinName = feeCryptoCurrency.name))
}
} }
// TODO: check the RECEIVER account trustline before sending
} }
fun MutableList<NotificationUM>.addMinimumAmountErrorNotification( fun MutableList<NotificationUM>.addMinimumAmountErrorNotification(