From daa57f5ff22de703d2dea3c5727d3a3df664add7 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 16 Sep 2022 12:35:41 +0300 Subject: [PATCH] Updated on 2026-08-14 --- app/src/main/java/com/tangem/tap/domain/TapErrors.kt | 1 - .../send/ui/dialogs/SendTransactionFailsDialog.kt | 11 ++++++++--- app/src/main/res/values-de/strings_blockchain.xml | 3 ++- app/src/main/res/values-fr/strings_blockchain.xml | 3 ++- app/src/main/res/values-it/strings_blockchain.xml | 3 ++- app/src/main/res/values-ru/strings_blockchain.xml | 3 ++- app/src/main/res/values/strings_blockchain.xml | 3 ++- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/domain/TapErrors.kt b/app/src/main/java/com/tangem/tap/domain/TapErrors.kt index 1db3b2194f..674487ff78 100644 --- a/app/src/main/java/com/tangem/tap/domain/TapErrors.kt +++ b/app/src/main/java/com/tangem/tap/domain/TapErrors.kt @@ -38,7 +38,6 @@ sealed class TapError( object InvalidFeeValue : TapError(R.string.send_error_invalid_fee_value) data class DustAmount(override val args: List) : TapError(R.string.send_error_dust_amount_format) object DustChange : TapError(R.string.send_error_dust_change) - data class CreateAccountUnderfunded(override val args: List) : TapError(R.string.send_error_no_target_account) data class UnsupportedState( val stateError: String, diff --git a/app/src/main/java/com/tangem/tap/features/send/ui/dialogs/SendTransactionFailsDialog.kt b/app/src/main/java/com/tangem/tap/features/send/ui/dialogs/SendTransactionFailsDialog.kt index a4b5ff7539..0e35552e43 100644 --- a/app/src/main/java/com/tangem/tap/features/send/ui/dialogs/SendTransactionFailsDialog.kt +++ b/app/src/main/java/com/tangem/tap/features/send/ui/dialogs/SendTransactionFailsDialog.kt @@ -2,6 +2,7 @@ package com.tangem.tap.features.send.ui.dialogs import android.content.Context import androidx.appcompat.app.AlertDialog +import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.BlockchainSdkError import com.tangem.common.module.ModuleMessageConverter import com.tangem.tangem_sdk_new.extensions.localizedDescription @@ -47,9 +48,13 @@ private class BlockchainSdkErrorConverter( override fun convert(message: BlockchainSdkError): String { return when (message) { is BlockchainSdkError.CreateAccountUnderfunded -> { - val reserve = message.minReserve.value?.stripZeroPlainString() ?: "0" - val symbol = message.minReserve.currencySymbol - context.getString(R.string.send_error_no_target_account, reserve, symbol) + val resStringId = when (message.blockchain) { + Blockchain.Polkadot, Blockchain.PolkadotTestnet -> R.string.no_account_polkadot + else -> R.string.send_error_no_target_account + } + val reserveValueString = message.minReserve.value?.stripZeroPlainString() ?: "0" + val argument = "$reserveValueString ${message.minReserve.currencySymbol}" + context.getString(resStringId, argument) } else -> message.customMessage } diff --git a/app/src/main/res/values-de/strings_blockchain.xml b/app/src/main/res/values-de/strings_blockchain.xml index 98c248c381..5cb1360d71 100644 --- a/app/src/main/res/values-de/strings_blockchain.xml +++ b/app/src/main/res/values-de/strings_blockchain.xml @@ -5,7 +5,7 @@ Falsche Gebühr Minimaler Betrag ist %s Restbestand zu klein - Das Zielkonto ist nicht erstellt. Der abzusendende Betrag soll %s %s + Gebühr oder mehr sein + Das Zielkonto ist nicht erstellt. Der abzusendende Betrag soll %s + Gebühr oder mehr sein Um ein Konto zu erstellen, senden Sie 1+ XLM an diese Adresse Erhalt der Gebühr fehlgeschlagen Unbekannter Fehler @@ -23,4 +23,5 @@ Invalid Memo. It won\'t be added to the transaction Invalid Tag. It won\'t be added to the transaction %s network has a concept of Existential Deposit. If your account drops below %s %s it will be deactivated and any remaining funds will be destroyed. + Destination account is not active. Send %s or more to activate the account. \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings_blockchain.xml b/app/src/main/res/values-fr/strings_blockchain.xml index 43e0d8c933..5bbb85c2f3 100644 --- a/app/src/main/res/values-fr/strings_blockchain.xml +++ b/app/src/main/res/values-fr/strings_blockchain.xml @@ -5,7 +5,7 @@ Commission non valide Le montant minimal est de %s Le reste est trop petit - Le compte cible n\'a pas été créé. Le montant à envoyer doit être de %s %s + commissions ou plus + Le compte cible n\'a pas été créé. Le montant à envoyer doit être de %s + commissions ou plus Pour créer un compte, envoyez 1+ XLM à cette adresse Échec de réception des commissions Erreur inconnue @@ -23,4 +23,5 @@ Invalid Memo. It won\'t be added to the transaction Invalid Tag. It won\'t be added to the transaction %s network has a concept of Existential Deposit. If your account drops below %s %s it will be deactivated and any remaining funds will be destroyed. + Destination account is not active. Send %s or more to activate the account. \ No newline at end of file diff --git a/app/src/main/res/values-it/strings_blockchain.xml b/app/src/main/res/values-it/strings_blockchain.xml index d4e7c01f40..775778dbb0 100644 --- a/app/src/main/res/values-it/strings_blockchain.xml +++ b/app/src/main/res/values-it/strings_blockchain.xml @@ -7,7 +7,7 @@ L\'importo residuo è molto basso Errore sconosciuto L\'importo supera il saldo - Per creare un account, invia %s %s a questo indirizzo + Per creare un account, invia %s a questo indirizzo Impossibile ottenere la commissione Per creare un account, invia 1+ XLM a questo indirizzo Indirizzo non valido @@ -23,4 +23,5 @@ Invalid Memo. It won\'t be added to the transaction Invalid Tag. It won\'t be added to the transaction %s network has a concept of Existential Deposit. If your account drops below %s %s it will be deactivated and any remaining funds will be destroyed. + Destination account is not active. Send %s or more to activate the account. \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings_blockchain.xml b/app/src/main/res/values-ru/strings_blockchain.xml index 102a5145b4..61a4c91467 100644 --- a/app/src/main/res/values-ru/strings_blockchain.xml +++ b/app/src/main/res/values-ru/strings_blockchain.xml @@ -7,7 +7,7 @@ Сдача слишком мала Для создания учетной записи отправьте 1+ XLM на этот адрес Не удалось получить комиссию - Целевая учетная запись не создана. Сумма для отправки должна быть %1$s %2$s + плата за создание или больше + Целевая учетная запись не создана. Сумма для отправки должна быть %s + плата за создание или больше Неизвестная ошибка Неверный адрес Недопустимая сумма @@ -18,4 +18,5 @@ Уменьшить на %s XTZ Нет, отправить все Минимальный баланс: %s + Аккаунт получателя не активирован. Отправьте %s или более для активации аккаунта. \ No newline at end of file diff --git a/app/src/main/res/values/strings_blockchain.xml b/app/src/main/res/values/strings_blockchain.xml index 1d6e8df503..6a496314b1 100644 --- a/app/src/main/res/values/strings_blockchain.xml +++ b/app/src/main/res/values/strings_blockchain.xml @@ -7,7 +7,7 @@ Change is too small To create account send 1+ XLM to this address Failed to get fee - Target account is not created. Amount to send should be %s %s + fee or more to create + Target account is not created. Amount to send should be %s + fee or more to create Unknown error Invalid address Invalid amount @@ -23,4 +23,5 @@ Invalid Memo. It won\'t be added to the transaction Invalid Tag. It won\'t be added to the transaction %s network has a concept of Existential Deposit. If your account drops below %s %s it will be deactivated and any remaining funds will be destroyed. + Destination account is not active. Send %s or more to activate the account. \ No newline at end of file