Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-26 15:06:51 +04:00
parent d1798a2c49
commit 6dee2eeed7
112 changed files with 2146 additions and 1562 deletions

View file

@ -10,6 +10,9 @@ import com.tangem.operations.wallet.CreateWalletTask
import com.tangem.operations.wallet.PurgeWalletCommand
class CreateFirstTwinWalletTask(private val firstCardId: String) : CardSessionRunnable<CreateWalletResponse> {
override val allowsRequestAccessCodeFromRepository: Boolean = false
override fun run(
session: CardSession,
callback: (result: CompletionResult<CreateWalletResponse>) -> Unit,

View file

@ -20,6 +20,8 @@ class CreateSecondTwinWalletTask(
private val creatingWalletMessage: Message,
) : CardSessionRunnable<CreateWalletResponse> {
override val allowsRequestAccessCodeFromRepository: Boolean = false
override fun run(session: CardSession, callback: (result: CompletionResult<CreateWalletResponse>) -> Unit) {
val card = session.environment.card
val publicKey = card?.wallets?.firstOrNull()?.publicKey

View file

@ -13,6 +13,8 @@ class FinalizeTwinTask(
private val twinPublicKey: ByteArray, private val issuerKeys: KeyPair,
) : CardSessionRunnable<ScanResponse> {
override val allowsRequestAccessCodeFromRepository: Boolean = false
override fun run(
session: CardSession,
callback: (result: CompletionResult<ScanResponse>) -> Unit,

View file

@ -20,11 +20,9 @@ class TwinCardsManager(
assetReader: AssetReader,
) {
private val firstCardId: String = card.cardId
private var secondCardId: String? = null
private var currentCardPublicKey: String? = null
var secondCardPublicKey: String? = null
private set
private var secondCardPublicKey: String? = null
private val issuerKeyPair: KeyPair = getIssuerKeys(assetReader, card.issuer.publicKey.toHexString())
@ -57,7 +55,6 @@ class TwinCardsManager(
when (response) {
is CompletionResult.Success -> {
secondCardPublicKey = response.data.wallet.publicKey.toHexString()
secondCardId = response.data.cardId
}
is CompletionResult.Failure -> {}
}