Updated on 2026-08-14
This commit is contained in:
parent
21ef61585b
commit
154de76c6d
37 changed files with 695 additions and 989 deletions
|
|
@ -143,7 +143,13 @@ internal class TangemCardTypesResolver(
|
|||
|
||||
override fun getRemainingSignatures(): Int? = card.wallets.firstOrNull()?.remainingSignatures
|
||||
|
||||
override fun getCardId(): String = card.cardId
|
||||
override fun getCardId(): String {
|
||||
return if (isTangemTwins()) {
|
||||
card.getTwinCardIdForUser()
|
||||
} else {
|
||||
card.cardId
|
||||
}
|
||||
}
|
||||
|
||||
override fun isTestCard(): Boolean = card.isTestCard
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.tangem.domain.common.TapWorkarounds.isTestCard
|
|||
import com.tangem.domain.common.configs.CardConfig
|
||||
import com.tangem.domain.common.configs.Wallet2CardConfig
|
||||
import com.tangem.domain.models.scan.ScanResponse
|
||||
import com.tangem.domain.wallets.models.UserWallet
|
||||
|
||||
val ScanResponse.cardTypesResolver: CardTypesResolver
|
||||
get() = TangemCardTypesResolver(
|
||||
|
|
@ -27,6 +28,9 @@ val ScanResponse.derivationStyleProvider: DerivationStyleProvider
|
|||
card,
|
||||
)
|
||||
|
||||
val UserWallet.cardTypesResolver: CardTypesResolver
|
||||
get() = scanResponse.cardTypesResolver
|
||||
|
||||
fun ScanResponse.twinsIsTwinned(): Boolean = card.isTangemTwins && walletData != null && secondTwinPublicKey != null
|
||||
fun ScanResponse.supportsHdWallet(): Boolean = card.settings.isHDWalletAllowed
|
||||
fun ScanResponse.supportsBackup(): Boolean = card.settings.isBackupAllowed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue