Updated on 2026-08-14

This commit is contained in:
Tangem 2024-03-17 21:59:37 +08:00
parent 7d9f1f0cf4
commit 2720e5588c
9 changed files with 36 additions and 11 deletions

View file

@ -10,10 +10,7 @@ import com.tangem.datasource.local.preferences.PreferencesKeys
import com.tangem.datasource.local.preferences.utils.getObjectMap
import com.tangem.datasource.local.userwallet.UserWalletsStore
import com.tangem.datasource.local.walletmanager.WalletManagersStore
import com.tangem.domain.feedback.models.AppLogModel
import com.tangem.domain.feedback.models.BlockchainInfo
import com.tangem.domain.feedback.models.CardInfo
import com.tangem.domain.feedback.models.PhoneInfo
import com.tangem.domain.feedback.models.*
import com.tangem.domain.feedback.repository.FeedbackRepository
import com.tangem.domain.wallets.models.UserWallet
import timber.log.Timber
@ -38,6 +35,13 @@ internal class DefaultFeedbackRepository(
private val context: Context,
) : FeedbackRepository {
override suspend fun getUserWalletsInfo(): UserWalletsInfo {
return UserWalletsInfo(
selectedUserWalletId = getSelectedUserWallet().walletId.stringValue,
totalUserWallets = userWalletsStore.getAllSyncOrNull()?.size ?: error("No user wallets found"),
)
}
override suspend fun getCardInfo(): CardInfo {
return CardInfoConverter.convert(value = getSelectedUserWallet())
}

View file

@ -15,13 +15,13 @@ internal object CardInfoConverter : Converter<UserWallet, CardInfo> {
override fun convert(value: UserWallet): CardInfo {
return with(value.scanResponse) {
CardInfo(
userWalletId = value.walletId.stringValue,
cardId = card.cardId,
firmwareVersion = card.firmwareVersion.stringValue,
cardBlockchain = walletData?.blockchain,
signedHashesList = card.wallets.map {
CardInfo.SignedHashes(curve = it.curve.curve, total = it.totalSignedHashes?.toString())
},
isImported = value.isImported,
isStart2Coin = value.scanResponse.card.isStart2Coin,
)
}