From 029e4e1cd8a0aa0b1508adf80fbb42519a0ade52 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 11 Jan 2023 15:07:05 +0400 Subject: [PATCH] Updated on 2026-08-14 --- .../tap/features/wallet/models/WalletWarning.kt | 7 ++++++- .../tangem/tap/features/wallet/redux/WalletState.kt | 11 ++++++++--- .../tap/features/wallet/ui/WalletWarningConverter.kt | 6 +++++- app/src/main/res/values-de/strings_final.xml | 2 +- app/src/main/res/values-fr/strings_final.xml | 2 +- app/src/main/res/values-it/strings_final.xml | 2 +- app/src/main/res/values-ru/strings_final.xml | 2 +- app/src/main/res/values/strings_final.xml | 2 +- 8 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/wallet/models/WalletWarning.kt b/app/src/main/java/com/tangem/tap/features/wallet/models/WalletWarning.kt index 3b80a95845..3e960b5123 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/models/WalletWarning.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/models/WalletWarning.kt @@ -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) } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt index 6219fea552..2973700363 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt @@ -370,11 +370,16 @@ data class WalletData( } private fun assembleTokenWarnings(walletWarnings: MutableList){ - 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, + ), + ) } } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletWarningConverter.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletWarningConverter.kt index 624d34da3e..321d88db1c 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletWarningConverter.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletWarningConverter.kt @@ -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 -> { diff --git a/app/src/main/res/values-de/strings_final.xml b/app/src/main/res/values-de/strings_final.xml index b7e64d53df..4a635afd9a 100644 --- a/app/src/main/res/values-de/strings_final.xml +++ b/app/src/main/res/values-de/strings_final.xml @@ -37,7 +37,7 @@ Search tokens You are currently running in Demo mode. All funds are not real. This feature is disabled in Demo mode - Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first. + %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. Available networks Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. Tokens in Solana network are not supported by this card due to firmware limitation. diff --git a/app/src/main/res/values-fr/strings_final.xml b/app/src/main/res/values-fr/strings_final.xml index b7e64d53df..4a635afd9a 100644 --- a/app/src/main/res/values-fr/strings_final.xml +++ b/app/src/main/res/values-fr/strings_final.xml @@ -37,7 +37,7 @@ Search tokens You are currently running in Demo mode. All funds are not real. This feature is disabled in Demo mode - Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first. + %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. Available networks Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. Tokens in Solana network are not supported by this card due to firmware limitation. diff --git a/app/src/main/res/values-it/strings_final.xml b/app/src/main/res/values-it/strings_final.xml index b7e64d53df..4a635afd9a 100644 --- a/app/src/main/res/values-it/strings_final.xml +++ b/app/src/main/res/values-it/strings_final.xml @@ -37,7 +37,7 @@ Search tokens You are currently running in Demo mode. All funds are not real. This feature is disabled in Demo mode - Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first. + %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. Available networks Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. Tokens in Solana network are not supported by this card due to firmware limitation. diff --git a/app/src/main/res/values-ru/strings_final.xml b/app/src/main/res/values-ru/strings_final.xml index ad4f23ca35..21c250d6c4 100644 --- a/app/src/main/res/values-ru/strings_final.xml +++ b/app/src/main/res/values-ru/strings_final.xml @@ -37,7 +37,7 @@ Поиск токенов Приложение работает в демонстрационном режиме. Средства на всех счетах ненастоящие. Эта функция недоступна в демонстрационном режиме - Недостаточно средств для комиссии на вашем %s кошельке для отправки транзакции. Сначала пополните свой %s кошелек. + %s — это токен в сети %s. Чтобы отправить транзакцию %s, необходимо пополнить баланс %s (%s) для оплаты комиссии сети. Доступные сети Внимание! Валюты на разных сетях имеют разные адреса. Убедитесь, что адрес соответствует сети, в которой вы отправляете средства. Токены в сети Solana не поддерживаются этой картой из-за ограничений прошивки. diff --git a/app/src/main/res/values/strings_final.xml b/app/src/main/res/values/strings_final.xml index 70e85346c6..4a8c50e734 100644 --- a/app/src/main/res/values/strings_final.xml +++ b/app/src/main/res/values/strings_final.xml @@ -37,7 +37,7 @@ Search tokens You are currently running in Demo mode. All funds are not real. This feature is disabled in Demo mode - Not enough funds for fee on your %s wallet to send a transaction. Top up your %s wallet first. + %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. Available networks Note that tokens on different networks have different addresses. Double check that your address matches the network when you transfer funds. Tokens in Solana network are not supported by this card due to firmware limitation.