Updated on 2026-08-14
This commit is contained in:
commit
76393d2fae
13 changed files with 90 additions and 13 deletions
|
|
@ -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())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue