From 32a061182fb70633b02cd77b0a998ad6787db3f4 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 29 Apr 2026 17:15:39 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../repository/DefaultUserWalletsListRepository.kt | 7 +++++++ .../component/impl/DefaultRoutingComponent.kt | 12 ++++++++++-- .../java/com/tangem/core/analytics/models/Basic.kt | 6 ++++++ .../features/welcome/impl/model/WelcomeModel.kt | 7 +++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt index 80cbe137b9..5b02dce01c 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt @@ -20,6 +20,7 @@ import com.tangem.domain.common.wallets.error.* import com.tangem.domain.hotwallet.repository.HotWalletRepository import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWalletId +import com.tangem.domain.models.wallet.isImported import com.tangem.domain.models.wallet.isLocked import com.tangem.domain.wallets.R import com.tangem.domain.wallets.analytics.WalletSettingsAnalyticEvents @@ -586,10 +587,16 @@ internal class DefaultUserWalletsListRepository( private fun trackSignInEvent(userWallet: UserWallet, type: Basic.SignedIn.SignInType) { trackingContextProxy.addContext(userWallet) + val isBackedUp = when (userWallet) { + is UserWallet.Cold -> userWallet.scanResponse.card.backupStatus?.isActive == true + is UserWallet.Hot -> userWallet.backedUp + } analyticsEventHandler.send( event = Basic.SignedIn( signInType = type, walletsCount = userWallets.value?.size ?: 0, + isImported = userWallet.isImported(), + hasBackup = isBackedUp, ), ) } diff --git a/app/src/main/java/com/tangem/tap/routing/component/impl/DefaultRoutingComponent.kt b/app/src/main/java/com/tangem/tap/routing/component/impl/DefaultRoutingComponent.kt index d922ce744d..be5208d6d8 100644 --- a/app/src/main/java/com/tangem/tap/routing/component/impl/DefaultRoutingComponent.kt +++ b/app/src/main/java/com/tangem/tap/routing/component/impl/DefaultRoutingComponent.kt @@ -29,6 +29,8 @@ import com.tangem.core.ui.message.SnackbarMessage import com.tangem.domain.card.repository.CardRepository import com.tangem.domain.common.wallets.UserWalletsListRepository import com.tangem.domain.models.scan.ScanResponse +import com.tangem.domain.models.wallet.UserWallet +import com.tangem.domain.models.wallet.isImported import com.tangem.domain.models.wallet.isLocked import com.tangem.domain.onboarding.repository.OnboardingRepository import com.tangem.features.hotwallet.HotAccessCodeRequestComponent @@ -40,11 +42,11 @@ import com.tangem.hot.sdk.android.create import com.tangem.sdk.api.BackupServiceHolder import com.tangem.tap.common.SnackbarHandler import com.tangem.tap.common.analytics.events.Onboarding -import com.tangem.tap.features.scanfails.ScanFailsComponent -import com.tangem.tap.features.scanfails.ScanFailsRequesterProxy import com.tangem.tap.features.demo.DemoHelper import com.tangem.tap.features.hot.TangemHotSDKProxy import com.tangem.tap.features.root.RootDetectedWarningComponent +import com.tangem.tap.features.scanfails.ScanFailsComponent +import com.tangem.tap.features.scanfails.ScanFailsRequesterProxy import com.tangem.tap.routing.RootContent import com.tangem.tap.routing.component.RoutingComponent import com.tangem.tap.routing.component.RoutingComponent.Child @@ -342,10 +344,16 @@ internal class DefaultRoutingComponent @AssistedInject constructor( val userWallets = userWalletsListRepository.userWalletsSync() val selectedWallet = userWalletsListRepository.selectedUserWalletSync() ?: return trackingContextProxy.addContext(selectedWallet) + val isBackedUp = when (selectedWallet) { + is UserWallet.Cold -> selectedWallet.scanResponse.card.backupStatus?.isActive == true + is UserWallet.Hot -> selectedWallet.backedUp + } analyticsEventHandler.send( event = Basic.SignedIn( signInType = Basic.SignedIn.SignInType.NoSecurity, walletsCount = userWallets.size, + isImported = selectedWallet.isImported(), + hasBackup = isBackedUp, ), ) } diff --git a/core/analytics/models/src/main/java/com/tangem/core/analytics/models/Basic.kt b/core/analytics/models/src/main/java/com/tangem/core/analytics/models/Basic.kt index 3e71b47241..0e916a0e2d 100644 --- a/core/analytics/models/src/main/java/com/tangem/core/analytics/models/Basic.kt +++ b/core/analytics/models/src/main/java/com/tangem/core/analytics/models/Basic.kt @@ -42,11 +42,17 @@ sealed class Basic( class SignedIn( signInType: SignInType, walletsCount: Int, + isImported: Boolean, + hasBackup: Boolean?, ) : Basic( event = "Signed in", params = buildMap { put("Sign in type", signInType.value) put("Wallets Count", walletsCount.toString()) + put("Wallet Type", if (isImported) "Seed Phrase" else "Seedless") + if (hasBackup != null) { + put("Backuped", if (hasBackup) "Yes" else "No") + } }, ) { enum class SignInType(val value: String) { diff --git a/features/welcome/impl/src/main/kotlin/com/tangem/features/welcome/impl/model/WelcomeModel.kt b/features/welcome/impl/src/main/kotlin/com/tangem/features/welcome/impl/model/WelcomeModel.kt index 5c16293dd7..416222e193 100644 --- a/features/welcome/impl/src/main/kotlin/com/tangem/features/welcome/impl/model/WelcomeModel.kt +++ b/features/welcome/impl/src/main/kotlin/com/tangem/features/welcome/impl/model/WelcomeModel.kt @@ -21,6 +21,7 @@ import com.tangem.domain.common.wallets.error.SaveWalletError import com.tangem.domain.common.wallets.error.UnlockWalletError import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWalletId +import com.tangem.domain.models.wallet.isImported import com.tangem.domain.models.wallet.isLocked import com.tangem.domain.settings.CanUseBiometryUseCase import com.tangem.domain.wallets.builder.ColdUserWalletBuilder @@ -305,10 +306,16 @@ internal class WelcomeModel @Inject constructor( private suspend fun trackSignInEvent(userWallet: UserWallet, type: Basic.SignedIn.SignInType) { val walletsCount = userWalletsListRepository.userWalletsSync().size trackingContextProxy.addContext(userWallet) + val isBackedUp = when (userWallet) { + is UserWallet.Cold -> userWallet.scanResponse.card.backupStatus?.isActive == true + is UserWallet.Hot -> userWallet.backedUp + } analyticsEventHandler.send( event = Basic.SignedIn( signInType = type, walletsCount = walletsCount, + isImported = userWallet.isImported(), + hasBackup = isBackedUp, ), ) }