Updated on 2026-08-14
This commit is contained in:
parent
33986b6290
commit
daa57f5ff2
7 changed files with 18 additions and 9 deletions
|
|
@ -38,7 +38,6 @@ sealed class TapError(
|
|||
object InvalidFeeValue : TapError(R.string.send_error_invalid_fee_value)
|
||||
data class DustAmount(override val args: List<Any>) : TapError(R.string.send_error_dust_amount_format)
|
||||
object DustChange : TapError(R.string.send_error_dust_change)
|
||||
data class CreateAccountUnderfunded(override val args: List<Any>) : TapError(R.string.send_error_no_target_account)
|
||||
|
||||
data class UnsupportedState(
|
||||
val stateError: String,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<string name="send_error_invalid_fee_value">Falsche Gebühr</string>
|
||||
<string name="send_error_dust_amount_format">Minimaler Betrag ist %s</string>
|
||||
<string name="send_error_dust_change">Restbestand zu klein</string>
|
||||
<string name="send_error_no_target_account">Das Zielkonto ist nicht erstellt. Der abzusendende Betrag soll %s %s + Gebühr oder mehr sein</string>
|
||||
<string name="send_error_no_target_account">Das Zielkonto ist nicht erstellt. Der abzusendende Betrag soll %s + Gebühr oder mehr sein</string>
|
||||
<string name="send_error_no_account_xlm">Um ein Konto zu erstellen, senden Sie 1+ XLM an diese Adresse</string>
|
||||
<string name="send_error_fee_request_failed">Erhalt der Gebühr fehlgeschlagen</string>
|
||||
<string name="send_error_unknown">Unbekannter Fehler</string>
|
||||
|
|
@ -23,4 +23,5 @@
|
|||
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction</string>
|
||||
<string name="warning_existential_deposit_message">%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.</string>
|
||||
<string name="no_account_polkadot">Destination account is not active. Send %s or more to activate the account.</string>
|
||||
</resources>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<string name="send_error_invalid_fee_value">Commission non valide</string>
|
||||
<string name="send_error_dust_amount_format">Le montant minimal est de %s</string>
|
||||
<string name="send_error_dust_change">Le reste est trop petit</string>
|
||||
<string name="send_error_no_target_account">Le compte cible n\'a pas été créé. Le montant à envoyer doit être de %s %s + commissions ou plus</string>
|
||||
<string name="send_error_no_target_account">Le compte cible n\'a pas été créé. Le montant à envoyer doit être de %s + commissions ou plus</string>
|
||||
<string name="send_error_no_account_xlm">Pour créer un compte, envoyez 1+ XLM à cette adresse</string>
|
||||
<string name="send_error_fee_request_failed">Échec de réception des commissions</string>
|
||||
<string name="send_error_unknown">Erreur inconnue</string>
|
||||
|
|
@ -23,4 +23,5 @@
|
|||
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction</string>
|
||||
<string name="warning_existential_deposit_message">%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.</string>
|
||||
<string name="no_account_polkadot">Destination account is not active. Send %s or more to activate the account.</string>
|
||||
</resources>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<string name="send_error_dust_change">L\'importo residuo è molto basso</string>
|
||||
<string name="send_error_unknown">Errore sconosciuto</string>
|
||||
<string name="send_validation_amount_exceeds_balance">L\'importo supera il saldo</string>
|
||||
<string name="send_error_no_target_account">Per creare un account, invia %s %s a questo indirizzo</string>
|
||||
<string name="send_error_no_target_account">Per creare un account, invia %s a questo indirizzo</string>
|
||||
<string name="send_error_fee_request_failed">Impossibile ottenere la commissione</string>
|
||||
<string name="send_error_no_account_xlm">Per creare un account, invia 1+ XLM a questo indirizzo</string>
|
||||
<string name="send_validation_invalid_address">Indirizzo non valido</string>
|
||||
|
|
@ -23,4 +23,5 @@
|
|||
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction</string>
|
||||
<string name="warning_existential_deposit_message">%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.</string>
|
||||
<string name="no_account_polkadot">Destination account is not active. Send %s or more to activate the account.</string>
|
||||
</resources>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<string name="send_error_dust_change">Сдача слишком мала</string>
|
||||
<string name="send_error_no_account_xlm">Для создания учетной записи отправьте 1+ XLM на этот адрес</string>
|
||||
<string name="send_error_fee_request_failed">Не удалось получить комиссию</string>
|
||||
<string name="send_error_no_target_account">Целевая учетная запись не создана. Сумма для отправки должна быть %1$s %2$s + плата за создание или больше</string>
|
||||
<string name="send_error_no_target_account">Целевая учетная запись не создана. Сумма для отправки должна быть %s + плата за создание или больше</string>
|
||||
<string name="send_error_unknown">Неизвестная ошибка</string>
|
||||
<string name="send_validation_invalid_address">Неверный адрес</string>
|
||||
<string name="send_validation_invalid_amount">Недопустимая сумма</string>
|
||||
|
|
@ -18,4 +18,5 @@
|
|||
<string name="xtz_withdrawal_message_reduce">Уменьшить на %s XTZ</string>
|
||||
<string name="xtz_withdrawal_message_ignore">Нет, отправить все</string>
|
||||
<string name="send_error_minimum_balance_format">Минимальный баланс: %s</string>
|
||||
<string name="no_account_polkadot">Аккаунт получателя не активирован. Отправьте %s или более для активации аккаунта.</string>
|
||||
</resources>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<string name="send_error_dust_change">Change is too small</string>
|
||||
<string name="send_error_no_account_xlm">To create account send 1+ XLM to this address</string>
|
||||
<string name="send_error_fee_request_failed">Failed to get fee</string>
|
||||
<string name="send_error_no_target_account">Target account is not created. Amount to send should be %s %s + fee or more to create</string>
|
||||
<string name="send_error_no_target_account">Target account is not created. Amount to send should be %s + fee or more to create</string>
|
||||
<string name="send_error_unknown">Unknown error</string>
|
||||
<string name="send_validation_invalid_address">Invalid address</string>
|
||||
<string name="send_validation_invalid_amount">Invalid amount</string>
|
||||
|
|
@ -23,4 +23,5 @@
|
|||
<string name="send_extras_error_invalid_memo">Invalid Memo. It won\'t be added to the transaction</string>
|
||||
<string name="send_extras_error_invalid_destination_tag">Invalid Tag. It won\'t be added to the transaction</string>
|
||||
<string name="warning_existential_deposit_message">%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.</string>
|
||||
<string name="no_account_polkadot">Destination account is not active. Send %s or more to activate the account.</string>
|
||||
</resources>
|
||||
Loading…
Add table
Add a link
Reference in a new issue