Updated on 2026-08-14
This commit is contained in:
parent
d1798a2c49
commit
6dee2eeed7
112 changed files with 2146 additions and 1562 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 -> {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue