Updated on 2026-08-14

This commit is contained in:
Tangem 2023-08-22 19:06:17 +03:00
parent 233a85632f
commit 03b11300e3

View file

@ -3,6 +3,7 @@ package com.tangem.tap.domain.tasks.product
import com.tangem.blockchain.common.Blockchain
import com.tangem.common.CompletionResult
import com.tangem.common.card.Card
import com.tangem.common.card.FirmwareVersion
import com.tangem.common.core.CardSession
import com.tangem.common.core.CardSessionRunnable
import com.tangem.common.core.TangemError
@ -53,7 +54,7 @@ class ScanProductTask(
}
val cardDto = CardDTO(card)
val error = getErrorIfExcludedCard(cardDto)
val error = getErrorIfExcludedCard(cardDto, card)
if (error != null) {
callback(CompletionResult.Failure(error))
return
@ -83,9 +84,15 @@ class ScanProductTask(
}
}
private fun getErrorIfExcludedCard(cardDto: CardDTO): TangemError? {
private fun getErrorIfExcludedCard(cardDto: CardDTO, card: Card): TangemError? {
if (cardDto.isExcluded) return TapSdkError.CardForDifferentApp
if (cardDto.isNotSupportedInThatRelease) return TapSdkError.CardNotSupportedByRelease
// according ios decline card lower Ed25519Slip0010Available version and contains imported wallets
if (card.firmwareVersion < FirmwareVersion.Ed25519Slip0010Available &&
card.wallets.any { it.isImported }
) {
return TapSdkError.CardNotSupportedByRelease
}
return null
}
}