Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-11 15:07:05 +04:00
parent 7dbfbdd2ac
commit 029e4e1cd8
8 changed files with 24 additions and 10 deletions

View file

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

View file

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

View file

@ -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 -> {

View file

@ -37,7 +37,7 @@
<string name="search_tokens_title">Search tokens</string>
<string name="alert_demo_message">You are currently running in Demo mode. All funds are not real.</string>
<string name="alert_demo_feature_disabled">This feature is disabled in Demo mode</string>
<string name="token_details_send_blocked_fee_format">Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first.</string>
<string name="token_details_send_blocked_fee_format">%s is a token in the %s network. To make a %s transaction you need to deposit some %s (%s) to cover the network fee.</string>
<string name="currency_subtitle_expanded">Available networks</string>
<string name="alert_manage_tokens_addresses_message">Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds.</string>
<string name="alert_manage_tokens_unsupported_message">Tokens in Solana network are not supported by this card due to firmware limitation.</string>

View file

@ -37,7 +37,7 @@
<string name="search_tokens_title">Search tokens</string>
<string name="alert_demo_message">You are currently running in Demo mode. All funds are not real.</string>
<string name="alert_demo_feature_disabled">This feature is disabled in Demo mode</string>
<string name="token_details_send_blocked_fee_format">Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first.</string>
<string name="token_details_send_blocked_fee_format">%s is a token in the %s network. To make a %s transaction you need to deposit some %s (%s) to cover the network fee.</string>
<string name="currency_subtitle_expanded">Available networks</string>
<string name="alert_manage_tokens_addresses_message">Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds.</string>
<string name="alert_manage_tokens_unsupported_message">Tokens in Solana network are not supported by this card due to firmware limitation.</string>

View file

@ -37,7 +37,7 @@
<string name="search_tokens_title">Search tokens</string>
<string name="alert_demo_message">You are currently running in Demo mode. All funds are not real.</string>
<string name="alert_demo_feature_disabled">This feature is disabled in Demo mode</string>
<string name="token_details_send_blocked_fee_format">Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first.</string>
<string name="token_details_send_blocked_fee_format">%s is a token in the %s network. To make a %s transaction you need to deposit some %s (%s) to cover the network fee.</string>
<string name="currency_subtitle_expanded">Available networks</string>
<string name="alert_manage_tokens_addresses_message">Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds.</string>
<string name="alert_manage_tokens_unsupported_message">Tokens in Solana network are not supported by this card due to firmware limitation.</string>

View file

@ -37,7 +37,7 @@
<string name="search_tokens_title">Поиск токенов</string>
<string name="alert_demo_message">Приложение работает в демонстрационном режиме. Средства на всех счетах ненастоящие.</string>
<string name="alert_demo_feature_disabled">Эта функция недоступна в демонстрационном режиме</string>
<string name="token_details_send_blocked_fee_format">Недостаточно средств для комиссии на вашем %s кошельке для отправки транзакции. Сначала пополните свой %s кошелек.</string>
<string name="token_details_send_blocked_fee_format">%s — это токен в сети %s. Чтобы отправить транзакцию %s, необходимо пополнить баланс %s (%s) для оплаты комиссии сети.</string>
<string name="currency_subtitle_expanded">Доступные сети</string>
<string name="alert_manage_tokens_addresses_message">Внимание! Валюты на разных сетях имеют разные адреса. Убедитесь, что адрес соответствует сети, в которой вы отправляете средства.</string>
<string name="alert_manage_tokens_unsupported_message">Токены в сети Solana не поддерживаются этой картой из-за ограничений прошивки.</string>

View file

@ -37,7 +37,7 @@
<string name="search_tokens_title">Search tokens</string>
<string name="alert_demo_message">You are currently running in Demo mode. All funds are not real.</string>
<string name="alert_demo_feature_disabled">This feature is disabled in Demo mode</string>
<string name="token_details_send_blocked_fee_format">Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first.</string>
<string name="token_details_send_blocked_fee_format">%s is a token in the %s network. To make a %s transaction you need to deposit some %s (%s) to cover the network fee.</string>
<string name="currency_subtitle_expanded">Available networks</string>
<string name="alert_manage_tokens_addresses_message">Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds.</string>
<string name="alert_manage_tokens_unsupported_message">Tokens in Solana network are not supported by this card due to firmware limitation.</string>