Updated on 2026-08-14
This commit is contained in:
parent
233a85632f
commit
03b11300e3
1 changed files with 9 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue