Updated on 2026-08-14
This commit is contained in:
parent
a075d9737b
commit
a4e8e059a7
2 changed files with 25 additions and 7 deletions
|
|
@ -170,6 +170,14 @@ sealed class NotificationUM(val config: NotificationConfig) {
|
|||
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(
|
||||
title = resourceReference(id = R.string.send_validation_destination_tag_required_title),
|
||||
subtitle = resourceReference(id = R.string.send_validation_destination_tag_required_description),
|
||||
|
|
|
|||
|
|
@ -136,14 +136,24 @@ object NotificationsFactory {
|
|||
// 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(feeCryptoCurrency ?: cryptoCurrency)
|
||||
},
|
||||
),
|
||||
)
|
||||
// account not funded, sending coin amount < reserve (send coin with less amount OR send any token)
|
||||
|
||||
if (cryptoCurrency is CryptoCurrency.Coin) {
|
||||
// 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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue