Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-08 10:54:38 +03:00
parent 3b33b9753b
commit 76a9691e0d
4 changed files with 2 additions and 5 deletions

View file

@ -16,7 +16,7 @@ class CreateFirstTwinWalletTask : CardSessionRunnable<CreateWalletResponse> {
callback: (result: CompletionResult<CreateWalletResponse>) -> Unit,
) {
val card = session.environment.card
val publicKey = card?.getSingleWallet()?.publicKey
val publicKey = card?.wallets?.firstOrNull()?.publicKey
if (publicKey != null) {
if (TwinsHelper.getTwinCardNumber(card.cardId) == TwinCardNumber.Second) {
callback(CompletionResult.Failure(WrongTwinCard(TwinCardNumber.First)))

View file

@ -12,7 +12,6 @@ import com.tangem.domain.common.TwinsHelper
import com.tangem.operations.wallet.CreateWalletResponse
import com.tangem.operations.wallet.CreateWalletTask
import com.tangem.operations.wallet.PurgeWalletCommand
import com.tangem.tap.domain.extensions.getSingleWallet
class CreateSecondTwinWalletTask(
private val firstPublicKey: String,

View file

@ -48,7 +48,6 @@ class TwinCardsManager(
): CompletionResult<CreateWalletResponse> {
val task = CreateSecondTwinWalletTask(
firstPublicKey = currentCardPublicKey!!,
firstCardId = firstCardId,
issuerKeys = issuerKeyPair,
preparingMessage = preparingMessage,
creatingWalletMessage = creatingWalletMessage,

View file

@ -5,8 +5,7 @@ import com.tangem.domain.common.TwinCardNumber
import com.tangem.tap.tangemSdkManager
import com.tangem.wallet.R
data class WrongTwinCard(private val twinCardNumber: TwinCardNumber) : TangemError {
override val code: Int = 50005
data class WrongTwinCard(private val twinCardNumber: TwinCardNumber) : TangemError(code = 50005) {
override var customMessage: String = tangemSdkManager.getString(
R.string.twin_error_same_card,
twinCardNumber.number,