Updated on 2026-08-14
This commit is contained in:
parent
7dbfbdd2ac
commit
029e4e1cd8
8 changed files with 24 additions and 10 deletions
|
|
@ -9,7 +9,12 @@ sealed class WalletWarning(
|
|||
) : WalletWarning(1)
|
||||
|
||||
object TransactionInProgress : WalletWarning(10)
|
||||
data class BalanceNotEnoughForFee(val blockchainFullName: String) : WalletWarning(30)
|
||||
data class BalanceNotEnoughForFee(
|
||||
val tokenName: String,
|
||||
val blockchainFullName: String,
|
||||
val blockchainCurrencyName: String,
|
||||
) : WalletWarning(30)
|
||||
|
||||
data class Rent(val walletRent: WalletRent) : WalletWarning(40)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -370,11 +370,16 @@ data class WalletData(
|
|||
}
|
||||
|
||||
private fun assembleTokenWarnings(walletWarnings: MutableList<WalletWarning>){
|
||||
if (!currency.isToken()) return
|
||||
if (currency !is Currency.Token) return
|
||||
|
||||
val blockchainFullName = currency.blockchain.fullName
|
||||
if ((blockchainAmountIsEmpty() && !tokenAmountIsEmpty())) {
|
||||
walletWarnings.add(WalletWarning.BalanceNotEnoughForFee(blockchainFullName))
|
||||
walletWarnings.add(
|
||||
WalletWarning.BalanceNotEnoughForFee(
|
||||
tokenName = currency.token.name,
|
||||
blockchainFullName = currency.blockchain.fullName,
|
||||
blockchainCurrencyName = currency.blockchain.currency,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,11 @@ class WalletWarningConverter(
|
|||
is WalletWarning.BalanceNotEnoughForFee -> {
|
||||
context.getString(
|
||||
R.string.token_details_send_blocked_fee_format,
|
||||
message.blockchainFullName, message.blockchainFullName,
|
||||
message.tokenName,
|
||||
message.blockchainFullName,
|
||||
message.tokenName,
|
||||
message.blockchainFullName,
|
||||
message.blockchainCurrencyName,
|
||||
)
|
||||
}
|
||||
WalletWarning.TransactionInProgress -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue