From 4e1a0d6c1feaad495dbc4dd98da3a0ade9429157 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 6 Sep 2022 18:38:48 +0300 Subject: [PATCH] Updated on 2026-08-14 --- app/src/main/assets/testnet_tokens.json | 10 +++++ .../tap/common/extensions/Blockchain.kt | 2 + .../redux/middlewares/AmountMiddleware.kt | 45 ++++++++++++++----- .../send/redux/middlewares/SendMiddleware.kt | 35 ++------------- .../ui/dialogs/SendTransactionFailsDialog.kt | 23 +++++++++- .../features/wallet/models/WalletWarning.kt | 5 +++ .../tap/features/wallet/redux/WalletState.kt | 34 ++++++++++---- .../redux/reducers/MultiWalletReducer.kt | 21 ++++++++- .../wallet/ui/WalletWarningConverter.kt | 6 +++ app/src/main/res/values-de/strings_final.xml | 10 +---- app/src/main/res/values-fr/strings_final.xml | 10 +---- app/src/main/res/values-it/strings_final.xml | 11 +---- app/src/main/res/values-ru/strings_final.xml | 16 +------ app/src/main/res/values/strings_final.xml | 16 +------ dependencies.gradle | 2 +- .../domain/common/extensions/Blockchain.kt | 5 +++ 16 files changed, 137 insertions(+), 114 deletions(-) diff --git a/app/src/main/assets/testnet_tokens.json b/app/src/main/assets/testnet_tokens.json index 84c055f105..179a72b282 100644 --- a/app/src/main/assets/testnet_tokens.json +++ b/app/src/main/assets/testnet_tokens.json @@ -420,6 +420,16 @@ "networkId" : "stellar/test" } ] + }, + { + "id" : "polkadot", + "symbol" : "DOT", + "name" : "Polkadot", + "networks" : [ + { + "networkId" : "polkadot/test" + } + ] } ], diff --git a/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt b/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt index e2490e7886..73f63aa2a8 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/Blockchain.kt @@ -28,6 +28,7 @@ fun Blockchain.getRoundIconRes(): Int { Blockchain.Dogecoin -> R.drawable.ic_dogecoin_round Blockchain.Tron, Blockchain.TronTestnet -> R.drawable.ic_tron_round Blockchain.Gnosis -> R.drawable.ic_gnosis_round + Blockchain.Polkadot, Blockchain.PolkadotTestnet -> R.drawable.ic_polkadot_round else -> R.drawable.ic_tangem_logo } } @@ -55,6 +56,7 @@ fun Blockchain.getGreyedOutIconRes(): Int { Blockchain.Dogecoin -> R.drawable.ic_dogecoin_no_color Blockchain.Tron, Blockchain.TronTestnet -> R.drawable.ic_tron_no_color Blockchain.Gnosis -> R.drawable.ic_gnosis_no_color + Blockchain.Polkadot, Blockchain.PolkadotTestnet -> R.drawable.ic_polkadot_no_color else -> R.drawable.ic_tangem_logo } } diff --git a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/AmountMiddleware.kt b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/AmountMiddleware.kt index 3d59d0a270..bfcbc36889 100644 --- a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/AmountMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/AmountMiddleware.kt @@ -4,11 +4,17 @@ import com.tangem.blockchain.common.Amount import com.tangem.blockchain.common.TransactionError import com.tangem.common.extensions.isZero import com.tangem.tap.common.redux.AppState -import com.tangem.tap.features.send.redux.* +import com.tangem.tap.features.send.redux.AmountAction +import com.tangem.tap.features.send.redux.AmountActionUi +import com.tangem.tap.features.send.redux.FeeAction +import com.tangem.tap.features.send.redux.FeeActionUi +import com.tangem.tap.features.send.redux.ReceiptAction +import com.tangem.tap.features.send.redux.SendAction import com.tangem.tap.features.send.redux.states.MainCurrencyType import com.tangem.tap.features.send.redux.states.SendState import org.rekotlin.Action import java.math.BigDecimal +import java.util.* /** [REDACTED_AUTHOR] @@ -62,18 +68,11 @@ class AmountMiddleware { val amountToSend = Amount(typedAmount, sendState.getTotalAmountToSend(inputCrypto)) val transactionErrors = walletManager.validateTransaction(amountToSend, sendState.feeState.currentFee) - transactionErrors.remove(TransactionError.TezosSendAll) - if (transactionErrors.isEmpty()) { + val amountFieldErrors = filterErrorsForAmountField(transactionErrors) + if (amountFieldErrors.isEmpty()) { dispatch(AmountAction.SetAmountError(null)) } else { - val amountErrors = extractErrorsForAmountField(transactionErrors) - if (amountErrors.isNotEmpty()) { - transactionErrors.removeAll(amountErrors) - dispatch(AmountAction.SetAmountError(createValidateTransactionError(amountErrors, walletManager))) - } - if (transactionErrors.isNotEmpty()) { - dispatch(SendAction.SendError(createValidateTransactionError(transactionErrors, walletManager))) - } + dispatch(AmountAction.SetAmountError(createValidateTransactionError(amountFieldErrors, walletManager))) } dispatch(ReceiptAction.RefreshReceipt) dispatch(SendAction.ChangeSendButtonState(sendState.getButtonState())) @@ -104,4 +103,28 @@ class AmountMiddleware { dispatch(AmountActionUi.SetMainCurrency(type)) } +} + +private fun filterErrorsForAmountField(errors: EnumSet): EnumSet { + val showIntoAmountField = EnumSet.noneOf(TransactionError::class.java) + errors.forEach { + when (it) { + TransactionError.AmountExceedsBalance -> { + showIntoAmountField.remove(TransactionError.TotalExceedsBalance) + showIntoAmountField.add(it) + } + TransactionError.FeeExceedsBalance -> { + showIntoAmountField.remove(TransactionError.TotalExceedsBalance) + showIntoAmountField.add(it) + } + TransactionError.TotalExceedsBalance -> { + val notAcceptable = listOf(TransactionError.AmountExceedsBalance, TransactionError.FeeExceedsBalance) + if (!showIntoAmountField.containsAll(notAcceptable)) showIntoAmountField.add(it) + } + else -> showIntoAmountField.add(it) + } + } + showIntoAmountField.remove(TransactionError.TezosSendAll) + + return showIntoAmountField } \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt index df1e3dd5ba..ee1b5eb1d2 100644 --- a/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/send/redux/middlewares/SendMiddleware.kt @@ -114,9 +114,8 @@ private fun verifyAndSendTransaction( val amountToSend = Amount(typedAmount, sendState.getTotalAmountToSend()) val transactionErrors = walletManager.validateTransaction(amountToSend, feeAmount) - val hadTezosError = transactionErrors.remove(TransactionError.TezosSendAll) when { - hadTezosError -> { + transactionErrors.contains(TransactionError.TezosSendAll) -> { val reduceAmount = walletManager.wallet.blockchain.minimalAmount() dispatch( SendAction.Dialog.TezosWarningDialog( @@ -135,9 +134,6 @@ private fun verifyAndSendTransaction( ), ) } - transactionErrors.isNotEmpty() -> { - dispatch(SendAction.SendError(createValidateTransactionError(transactionErrors, walletManager))) - } else -> { sendTransaction( action, walletManager, amountToSend, feeAmount, destinationAddress, @@ -272,10 +268,8 @@ private fun sendTransaction( dispatch(SendAction.Dialog.SendTransactionFails.CardSdkError(tangemSdkError)) } is BlockchainSdkError.CreateAccountUnderfunded -> { - // from XLM, XRP - val reserve = error.minReserve.value?.stripZeroPlainString() ?: "0" - val symbol = error.minReserve.currencySymbol - dispatch(SendAction.SendError(TapError.CreateAccountUnderfunded(listOf(reserve, symbol)))) + // from XLM, XRP, Polkadot + dispatch(SendAction.Dialog.SendTransactionFails.BlockchainSdkError(error)) } else -> { when { @@ -300,29 +294,6 @@ private fun sendTransaction( } } -fun extractErrorsForAmountField(errors: EnumSet): EnumSet { - val showIntoAmountField = EnumSet.noneOf(TransactionError::class.java) - errors.forEach { - when (it) { - TransactionError.AmountExceedsBalance -> { - showIntoAmountField.remove(TransactionError.TotalExceedsBalance) - showIntoAmountField.add(it) - } - TransactionError.FeeExceedsBalance -> { - showIntoAmountField.remove(TransactionError.TotalExceedsBalance) - showIntoAmountField.add(it) - } - TransactionError.TotalExceedsBalance -> { - val notAcceptable = listOf(TransactionError.AmountExceedsBalance, TransactionError.FeeExceedsBalance) - if (!showIntoAmountField.containsAll(notAcceptable)) showIntoAmountField.add(it) - } - TransactionError.InvalidAmountValue -> showIntoAmountField.add(it) - TransactionError.InvalidFeeValue -> showIntoAmountField.add(it) - } - } - return showIntoAmountField -} - fun createValidateTransactionError( errorList: EnumSet, walletManager: WalletManager, 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 a01c048058..a4b5ff7539 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,7 +2,10 @@ package com.tangem.tap.features.send.ui.dialogs import android.content.Context import androidx.appcompat.app.AlertDialog +import com.tangem.blockchain.common.BlockchainSdkError +import com.tangem.common.module.ModuleMessageConverter import com.tangem.tangem_sdk_new.extensions.localizedDescription +import com.tangem.tap.common.extensions.stripZeroPlainString import com.tangem.tap.common.feedback.SendTransactionFailedEmail import com.tangem.tap.common.redux.global.GlobalAction import com.tangem.tap.features.send.redux.SendAction @@ -13,14 +16,14 @@ import com.tangem.wallet.R [REDACTED_AUTHOR] */ class SendTransactionFailsDialog { - companion object { fun create(context: Context, dialog: SendAction.Dialog.SendTransactionFails.CardSdkError): AlertDialog { return create(context, dialog.error.localizedDescription(context)) } fun create(context: Context, dialog: SendAction.Dialog.SendTransactionFails.BlockchainSdkError): AlertDialog { - return create(context, dialog.error.customMessage) + val errorConverter = BlockchainSdkErrorConverter(context) + return create(context, errorConverter.convert(dialog.error)) } private fun create(context: Context, errorMessage: String): AlertDialog { @@ -35,4 +38,20 @@ class SendTransactionFailsDialog { }.create() } } +} + +private class BlockchainSdkErrorConverter( + private val context: Context, +) : ModuleMessageConverter { + + 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) + } + else -> message.customMessage + } + } } \ No newline at end of file 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 0b4a56fa11..8923b18d6e 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 @@ -3,6 +3,11 @@ package com.tangem.tap.features.wallet.models sealed class WalletWarning( val showingPosition: Int, ) { + data class ExistentialDeposit( + val blockchainFullName: String, + val existentialDepositString: String, + ) : WalletWarning(1) + object TransactionInProgress : WalletWarning(10) data class BalanceNotEnoughForFee(val blockchainFullName: 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 48c886d939..a5c85a49fb 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 @@ -325,9 +325,6 @@ data class Artwork( const val MARTA_CARD_ID = "BC02" const val TWIN_CARD_1 = "https://app.tangem.com/cards/card_tg085.png" const val TWIN_CARD_2 = "https://app.tangem.com/cards/card_tg086.png" - - const val TEMP_CARDANO = - "https://verify.tangem.com/card/artwork?artworkId=card_ru039&CID=CB19000000040976&publicKey=0416E29423A6CC77CD07CBA52873E8F6F894B1AFB18EB3688ACC2C8D8E5AC84B80B0BA1B17B85E578E47044CE96BCFF3FB4499FA4941CAD3C1EF300A492B5B9659" } } @@ -342,6 +339,7 @@ data class WalletData( val mainButton: WalletMainButton = WalletMainButton.SendButton(false), val currency: Currency, val walletRent: WalletRent? = null, + val existentialDepositString: String? = null, ) { val isAvailableToBuy: Boolean get() = store.state.globalState.exchangeManager.availableForBuy(currency) @@ -362,18 +360,38 @@ data class WalletData( fun assembleWarnings(): List { val walletWarnings = mutableListOf() + assembleNonTypedWarnings(walletWarnings) + assembleBlockchainWarnings(walletWarnings) + assembleTokenWarnings(walletWarnings) + + return walletWarnings.sortedBy { it.showingPosition } + } + + private fun assembleNonTypedWarnings(walletWarnings: MutableList) { if (currencyData.status == BalanceStatus.SameCurrencyTransactionInProgress) { walletWarnings.add(WalletWarning.TransactionInProgress) } + } + + private fun assembleBlockchainWarnings(walletWarnings: MutableList) { + if (!currency.isBlockchain()) return + + val blockchainFullName = currency.blockchain.fullName + if (existentialDepositString != null) { + walletWarnings.add(WalletWarning.ExistentialDeposit(blockchainFullName, existentialDepositString)) + } if (walletRent != null) { walletWarnings.add(WalletWarning.Rent(walletRent)) } - if (!currency.isBlockchain() && (blockchainAmountIsEmpty() && !tokenAmountIsEmpty())) { - val fullName = currency.blockchain.fullName - walletWarnings.add(WalletWarning.BalanceNotEnoughForFee(fullName)) - } + } - return walletWarnings.sortedBy { it.showingPosition } + private fun assembleTokenWarnings(walletWarnings: MutableList){ + if (!currency.isToken()) return + + val blockchainFullName = currency.blockchain.fullName + if ((blockchainAmountIsEmpty() && !tokenAmountIsEmpty())) { + walletWarnings.add(WalletWarning.BalanceNotEnoughForFee(blockchainFullName)) + } } private fun blockchainAmountIsEmpty(): Boolean = currencyData.blockchainAmount?.isZero() == true diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt index e8f9551910..9821f1f6a7 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt @@ -1,15 +1,25 @@ package com.tangem.tap.features.wallet.redux.reducers +import com.tangem.blockchain.blockchains.polkadot.ExistentialDepositProvider import com.tangem.blockchain.common.AmountType import com.tangem.blockchain.common.Token +import com.tangem.blockchain.common.WalletManager import com.tangem.common.extensions.guard import com.tangem.tap.common.extensions.toFiatString import com.tangem.tap.common.extensions.toFormattedCurrencyString import com.tangem.tap.domain.getFirstToken import com.tangem.tap.domain.tokens.models.BlockchainNetwork -import com.tangem.tap.features.wallet.models.* -import com.tangem.tap.features.wallet.redux.* +import com.tangem.tap.features.wallet.models.Currency +import com.tangem.tap.features.wallet.models.WalletRent +import com.tangem.tap.features.wallet.models.filterByToken +import com.tangem.tap.features.wallet.models.getPendingTransactions +import com.tangem.tap.features.wallet.models.removeUnknownTransactions +import com.tangem.tap.features.wallet.redux.WalletAction +import com.tangem.tap.features.wallet.redux.WalletData +import com.tangem.tap.features.wallet.redux.WalletMainButton +import com.tangem.tap.features.wallet.redux.WalletState import com.tangem.tap.features.wallet.redux.WalletState.Companion.UNKNOWN_AMOUNT_SIGN +import com.tangem.tap.features.wallet.redux.WalletStore import com.tangem.tap.features.wallet.ui.BalanceStatus import com.tangem.tap.features.wallet.ui.BalanceWidgetData import com.tangem.tap.features.wallet.ui.TokenData @@ -25,6 +35,7 @@ class MultiWalletReducer { it.wallet.blockchain == blockchain.blockchain && (it.wallet.publicKey.derivationPath?.rawPath == blockchain.derivationPath) } ?: return@mapNotNull null + val wallet = walletManager.wallet val cardToken = if (!state.isMultiwalletAllowed) { wallet.getFirstToken()?.symbol?.let { TokenData("", tokenSymbol = it) } @@ -44,6 +55,7 @@ class MultiWalletReducer { blockchain.blockchain, blockchain.derivationPath ), + existentialDepositString = getExistentialDeposit(walletManager), ) WalletStore( @@ -79,6 +91,7 @@ class MultiWalletReducer { action.blockchain.blockchain, action.blockchain.derivationPath ), + existentialDepositString = getExistentialDeposit(walletManager), ) val walletStore = WalletStore( walletManager = walletManager, @@ -166,6 +179,10 @@ class MultiWalletReducer { it.walletRent != null }?.walletRent } + + private fun getExistentialDeposit(walletManager: WalletManager?): String? { + return (walletManager as? ExistentialDepositProvider)?.getExistentialDeposit()?.toPlainString() + } } private fun addTokens( 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 1e9e127e59..1f319a2a0b 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 @@ -15,6 +15,12 @@ class WalletWarningConverter( override fun convert(message: WalletWarning): WalletWarningDescription { val warningMessage = when (message) { + is WalletWarning.ExistentialDeposit -> { + context.getString( + R.string.warning_existential_deposit_message, + message.blockchainFullName, message.existentialDepositString + ) + } is WalletWarning.BalanceNotEnoughForFee -> { context.getString( R.string.token_details_send_blocked_fee_format, diff --git a/app/src/main/res/values-de/strings_final.xml b/app/src/main/res/values-de/strings_final.xml index 96c0876eff..20ebb2312d 100644 --- a/app/src/main/res/values-de/strings_final.xml +++ b/app/src/main/res/values-de/strings_final.xml @@ -38,30 +38,25 @@ 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. - 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. Do not transfer your funds to tokens in this blockchain, otherwise it may lead to their irretrievable loss. Contract address copied! If you chose the wrong network during your crypto transfer from the exchange, this guide will help you recover your funds - Custom Notice Attention The server is not available, please try again later - Hide token Hide %s Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. Unable to hide %s The %s token is the main currency on the %s network and cannot be hidden as long as you have other tokens on this network in the list. - %s network not found. Please, add it first and try again. This network is not supported. Please select another network. %s network - Card Settings Security Mode Selected application protection method @@ -81,18 +76,15 @@ This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. WalletConnect Connect to Dapps - Link More Cards You can synchronize up to three cards into one wallet. It can only be done once. - Privacy policy - Reset to factory settings This action will completely remove the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. I understand that after performing this action, I will no longer have access to the current wallet Reset the card Reset to Factory Settings Factory Reset will completely delete the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. - Select network + %s network has a concept of Existential Deposit. If your account drops below %s it will be deactivated and any remaining funds will be destroyed. \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings_final.xml b/app/src/main/res/values-fr/strings_final.xml index 3fe6eb9f17..9433ca3e3a 100644 --- a/app/src/main/res/values-fr/strings_final.xml +++ b/app/src/main/res/values-fr/strings_final.xml @@ -38,30 +38,25 @@ 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. - 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. Do not transfer your funds to tokens in this blockchain, otherwise it may lead to their irretrievable loss. Contract address copied! If you chose the wrong network during your crypto transfer from the exchange, this guide will help you recover your funds - Custom The server is not available, please try again later Notice Attention - Hide token Hide %s Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. Unable to hide %s The %s token is the main currency on the %s network and cannot be hidden as long as you have other tokens on this network in the list. - %s network not found. Please, add it first and try again. This network is not supported. Please select another network. %s network - Card Settings Security Mode Selected application protection method @@ -81,18 +76,15 @@ This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. WalletConnect Connect to Dapps - Link More Cards You can synchronize up to three cards into one wallet. It can only be done once. - Privacy policy - Reset to factory settings This action will completely remove the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. I understand that after performing this action, I will no longer have access to the current wallet Reset the card Reset to Factory Settings Factory Reset will completely delete the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. - Select network + %s network has a concept of Existential Deposit. If your account drops below %s it will be deactivated and any remaining funds will be destroyed. \ No newline at end of file diff --git a/app/src/main/res/values-it/strings_final.xml b/app/src/main/res/values-it/strings_final.xml index afe988cb58..9433ca3e3a 100644 --- a/app/src/main/res/values-it/strings_final.xml +++ b/app/src/main/res/values-it/strings_final.xml @@ -38,31 +38,25 @@ 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. - 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. Do not transfer your funds to tokens in this blockchain, otherwise it may lead to their irretrievable loss. Contract address copied! If you chose the wrong network during your crypto transfer from the exchange, this guide will help you recover your funds - Custom The server is not available, please try again later Notice Attention - Hide token Hide %s Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. Unable to hide %s The %s token is the main currency on the %s network and cannot be hidden as long as you have other tokens on this network in the list. - %s network not found. Please, add it first and try again. This network is not supported. Please select another network. - %s network - Card Settings Security Mode Selected application protection method @@ -82,18 +76,15 @@ This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. WalletConnect Connect to Dapps - Link More Cards You can synchronize up to three cards into one wallet. It can only be done once. - Privacy policy - Reset to factory settings This action will completely remove the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. I understand that after performing this action, I will no longer have access to the current wallet Reset the card Reset to Factory Settings Factory Reset will completely delete the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. - Select network + %s network has a concept of Existential Deposit. If your account drops below %s it will be deactivated and any remaining funds will be destroyed. \ No newline at end of file diff --git a/app/src/main/res/values-ru/strings_final.xml b/app/src/main/res/values-ru/strings_final.xml index 359b5c0488..f475af97dc 100644 --- a/app/src/main/res/values-ru/strings_final.xml +++ b/app/src/main/res/values-ru/strings_final.xml @@ -38,47 +38,36 @@ Приложение работает в демонстрационном режиме. Средства на всех счетах ненастоящие. Эта функция недоступна в демонстрационном режиме Недостаточно средств для комиссии на вашем %s кошельке для отправки транзакции. Сначала пополните свой %s кошелек. - Доступные сети Внимание! Валюты на разных сетях имеют разные адреса. Убедитесь, что адрес соответствует сети, в которой вы отправляете средства. Токены в сети Solana не поддерживаются этой картой из-за ограничений прошивки. Не осуществляйте перевод на токены в данной сети, иначе это может привести к их безвозвратной утере. Адрес контракта скопирован! Если вы совершили ошибку с выбором сети при переводе средств с биржи, эта инструкция поможет вам восстановить средства - Пользовательский Уведомление Внимание Сервер недоступен, повторите попытку позднее - Баланс В сумме учтены не все монеты Управление токенами Нет цены - Скрыть токен Скрыть %s Скрыть Вы скрываете токен с главного экрана, но в любой момент сможете добавить его обратно через страницу управления токенами. Невозможно скрыть %s - Токен %s является основной валютой в сети %s и не может быть скрыт до тех пор, пока у вас в списке есть другие токены этой сети. - Сеть %s не найдена. Пожалуйста, добавьте её и попробуйте заново. Сеть не поддерживается. Пожалуйста, выберите другую сеть. - Сеть %s - Бэкап кошелька не был произведен Чтобы защитить свои активы, мы советуем вам выполнить эту процедуру - Карты банков РФ в данный момент не принимаются У вас есть карта банка другой страны или платежной системы UnionPay? Да - Чат Tangem Bot - Настройки карты Тип безопасности Выбранный способ защиты приложения @@ -98,18 +87,15 @@ Все сохраненные коды доступа будут удалены. Вам потребуется вводить код доступа при работе с кошельком. WalletConnect Подключение к Dapps - Добавить еще карты Вы можете объединить до трех карт в одном кошельке. Это можно сделать только один раз. - Privacy policy - Сброс к заводским настройкам Это действие приведет к полному удалению кошелька на этой карте. Кошелек невозможно будет восстановить или использовать данную карту для восстановления кода доступа Я понимаю, что после выполнения этого действия у меня больше не будет доступа к текущему кошельку Сбросить карту Сброс к заводским настройкам Сброс к заводским настройкам приведет к полному удалению кошелька с выбранной карты. Вы не сможете восстановить текущий кошелек или использовать эту карту для восстановления кода доступа. - Выберите сеть + Сеть %s использует концепцию экзистенциального депозита. Если баланс вашего счета опустится ниже %s, он будет деактивирован, а все оставшиеся средства будут уничтожены. diff --git a/app/src/main/res/values/strings_final.xml b/app/src/main/res/values/strings_final.xml index ca04743898..c0c24db28f 100644 --- a/app/src/main/res/values/strings_final.xml +++ b/app/src/main/res/values/strings_final.xml @@ -38,49 +38,38 @@ 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. - 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. Do not transfer your funds to tokens in this blockchain, otherwise it may lead to their irretrievable loss. Contract address copied! If you chose the wrong network during your crypto transfer from the exchange, this guide will help you recover your funds - Custom Notice Attention The server is not available, please try again later - Total balance The amount does not include some of your funds Manage tokens No rate - Hide token Hide %s Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. Unable to hide %s The %s token is the main currency on the %s network and cannot be hidden as long as you have other tokens on this network in the list. - %s network not found. Please, add it first and try again. This network is not supported. Please select another network. - %s network - Your wallet has not been backed up To protect your assets, we advise you to carry out this procedure Remove token - Russian bank cards are not accepted at the moment Do you have a bank card of another country or a UnionPay card? Yes No - Chat Tangem Bot - - Card Settings Security Mode Selected application protection method @@ -100,18 +89,15 @@ This will delete all the saved wallet access codes. Any further operation with the wallet will require submitting the access code. WalletConnect Connect to Dapps - Link More Cards You can synchronize up to three cards into one wallet. It can only be done once. - Privacy policy - Reset to factory settings This action will completely remove the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. I understand that after performing this action, I will no longer have access to the current wallet Reset the card Reset to Factory Settings Factory Reset will completely delete the wallet from the selected card. You will not be able to restore the current wallet or use the card to recover the access code. - Select network + %s network has a concept of Existential Deposit. If your account drops below %s it will be deactivated and any remaining funds will be destroyed. diff --git a/dependencies.gradle b/dependencies.gradle index e1c383532f..4717ab51df 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ ext.versions = [ kotlin : '1.6.10', build_gradle : '7.1.3', tangem_card_sdk : 'develop-159', - tangem_blockchain_sdk: 'develop-105', + tangem_blockchain_sdk: 'develop-107', // tangem_blockchain_sdk: '0.0.1', ] diff --git a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt index 8708f1a0a8..139bc99365 100644 --- a/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt +++ b/domain/src/main/java/com/tangem/domain/common/extensions/Blockchain.kt @@ -38,6 +38,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? { "tron/test" -> Blockchain.TronTestnet "xrp", "ripple" -> Blockchain.XRP "xdai" -> Blockchain.Gnosis + "polkadot" -> Blockchain.Polkadot + "polkadot/test" -> Blockchain.PolkadotTestnet else -> null } } @@ -80,6 +82,8 @@ fun Blockchain.toNetworkId(): String { Blockchain.Tron -> "tron" Blockchain.TronTestnet -> "tron/test" Blockchain.Gnosis -> "xdai" + Blockchain.Polkadot -> "polkadot" + Blockchain.PolkadotTestnet -> "polkadot/test" } } @@ -105,6 +109,7 @@ fun Blockchain.toCoinId(): String { Blockchain.Dogecoin -> "dogecoin" Blockchain.Tron, Blockchain.TronTestnet -> "tron" Blockchain.Gnosis -> "xdai" + Blockchain.Polkadot, Blockchain.PolkadotTestnet -> "polkadot" Blockchain.Unknown -> "unknown" } } \ No newline at end of file