Updated on 2026-08-14

This commit is contained in:
Tangem 2025-07-14 14:23:17 +03:00
parent ebc4350919
commit 7e23a3a63b
18 changed files with 336 additions and 42 deletions

View file

@ -9,13 +9,23 @@ import com.tangem.domain.wallets.models.requireColdWallet
internal class DefaultAuthProvider(private val userWalletsListManager: UserWalletsListManager) : AuthProvider {
override fun getCardPublicKey(): String {
return userWalletsListManager.selectedUserWalletSync
?.requireColdWallet()?.scanResponse?.card?.cardPublicKey?.toHexString() ?: ""
val userWallet = userWalletsListManager.selectedUserWalletSync
return when (userWallet) {
is UserWallet.Cold -> userWallet.scanResponse.card.cardPublicKey.toHexString()
is UserWallet.Hot -> userWallet.wallets?.firstOrNull()?.publicKey?.toHexString() ?: ""
null -> ""
}
}
override fun getCardId(): String {
return userWalletsListManager.selectedUserWalletSync
?.requireColdWallet()?.scanResponse?.card?.cardId ?: ""
val userWallet = userWalletsListManager.selectedUserWalletSync
if (userWallet !is UserWallet.Cold) {
return ""
}
return userWallet.requireColdWallet().scanResponse.card.cardId
}
override fun getCardsPublicKeys(): Map<String, String> {