diff --git a/app/src/main/java/com/tangem/tap/domain/twins/CreateSecondTwinWalletTask.kt b/app/src/main/java/com/tangem/tap/domain/twins/CreateSecondTwinWalletTask.kt index 966fe4f1d1..a1436169f6 100644 --- a/app/src/main/java/com/tangem/tap/domain/twins/CreateSecondTwinWalletTask.kt +++ b/app/src/main/java/com/tangem/tap/domain/twins/CreateSecondTwinWalletTask.kt @@ -6,12 +6,13 @@ import com.tangem.common.KeyPair import com.tangem.common.card.EllipticCurve import com.tangem.common.core.CardSession import com.tangem.common.core.CardSessionRunnable -import com.tangem.common.core.TangemSdkError +import com.tangem.common.core.TangemError import com.tangem.common.extensions.hexToBytes import com.tangem.operations.wallet.CreateWalletCommand import com.tangem.operations.wallet.CreateWalletResponse import com.tangem.operations.wallet.PurgeWalletCommand import com.tangem.tap.domain.extensions.getSingleWallet +import com.tangem.wallet.R class CreateSecondTwinWalletTask( private val firstPublicKey: String, @@ -25,7 +26,7 @@ class CreateSecondTwinWalletTask( val publicKey = card?.getSingleWallet()?.publicKey if (publicKey != null) { if (!card.cardId.startsWith(TwinsHelper.getPairCardSeries(firstCardId) ?: "")) { - callback(CompletionResult.Failure(TangemSdkError.WrongCardType())) + callback(CompletionResult.Failure(WrongTwinCard())) return } @@ -65,4 +66,10 @@ class CreateSecondTwinWalletTask( } } } + + private class WrongTwinCard : TangemError { + override val code: Int = 50005 + override var customMessage: String = code.toString() + override val messageResId = R.string.twins_wrong_card_error + } } diff --git a/app/src/main/res/values/strings_untranslated.xml b/app/src/main/res/values/strings_untranslated.xml index 5178ff7292..afc4818861 100644 --- a/app/src/main/res/values/strings_untranslated.xml +++ b/app/src/main/res/values/strings_untranslated.xml @@ -29,6 +29,7 @@ The wallet creation procedure consists of three steps. You must complete it to the end, otherwise you will have to start from the beginning. Tap the card #%s You have already started the process of recreating twin wallet. If you interrupt it, you won\'t be able to use your twin cards until you start it again and complete recreating the wallet. + You\'ve tapped the same card. To create twin wallet you need to tap a second twin card. The twin address was successfully created