From 7231a5dd40b494c2237cda7996e9203eef50976f Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 19 Feb 2026 14:31:51 +0300 Subject: [PATCH 1/2] Updated on 2026-08-14 --- .../utils/TokenListAnalyticsSender.kt | 13 +++-- .../MultiWalletContentLoaderV2.kt | 2 + .../TokenListAnalyticsSubscriber.kt | 49 +++++++++++++++++++ 3 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/subscribers/TokenListAnalyticsSubscriber.kt diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/TokenListAnalyticsSender.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/TokenListAnalyticsSender.kt index 5cfa978a2a..d4d08e2e70 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/TokenListAnalyticsSender.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/analytics/utils/TokenListAnalyticsSender.kt @@ -48,7 +48,8 @@ internal class TokenListAnalyticsSender @Inject constructor( if (screenLifecycleProvider.isBackgroundState.value) return if (displayedUiState == null || displayedUiState.pullToRefreshConfig.isRefreshing) return - if (totalFiatBalance is TotalFiatBalance.Loading) { + val isFlickering = totalFiatBalance is TotalFiatBalance.Loaded && totalFiatBalance.source == StatusSource.CACHE + if (totalFiatBalance is TotalFiatBalance.Loading || isFlickering) { startLoadingTraceIfNeeded(userWallet.walletId, flattenCurrencies) return } @@ -57,12 +58,10 @@ internal class TokenListAnalyticsSender @Inject constructor( stopLoadingTraceIfNeeded(userWallet.walletId, totalFiatBalance) } - val currenciesStatuses = flattenCurrencies - - sendBalanceLoadedEventIfNeeded(totalFiatBalance, currenciesStatuses) - sendToppedUpEventIfNeeded(userWallet, totalFiatBalance, currenciesStatuses) - sendUnreachableNetworksEventIfNeeded(currenciesStatuses) - sendTokenBalancesIfNeeded(currenciesStatuses) + sendBalanceLoadedEventIfNeeded(totalFiatBalance, flattenCurrencies) + sendToppedUpEventIfNeeded(userWallet, totalFiatBalance, flattenCurrencies) + sendUnreachableNetworksEventIfNeeded(flattenCurrencies) + sendTokenBalancesIfNeeded(flattenCurrencies) } private suspend fun startLoadingTraceIfNeeded( diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/loaders/implementors/MultiWalletContentLoaderV2.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/loaders/implementors/MultiWalletContentLoaderV2.kt index df43ae0292..bced5a1f46 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/loaders/implementors/MultiWalletContentLoaderV2.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/loaders/implementors/MultiWalletContentLoaderV2.kt @@ -19,6 +19,7 @@ import dagger.assisted.AssistedInject internal class MultiWalletContentLoaderV2 @AssistedInject constructor( @Assisted private val userWallet: UserWallet, private val accountListSubscriberFactory: AccountListSubscriber.Factory, + private val tokenListAnalyticsSubscriberFactory: TokenListAnalyticsSubscriber.Factory, private val walletNFTListSubscriberV2Factory: WalletNFTListSubscriberV2.Factory, private val stateController: WalletStateController, private val clickIntents: WalletClickIntents, @@ -35,6 +36,7 @@ internal class MultiWalletContentLoaderV2 @AssistedInject constructor( override fun create(): List = listOfNotNull( accountListSubscriberFactory.create(userWallet = userWallet), + tokenListAnalyticsSubscriberFactory.create(userWallet = userWallet), walletNFTListSubscriberV2Factory.create(userWallet = userWallet), checkWalletWithFundsSubscriberFactory.create(userWallet = userWallet), MultiWalletWarningsSubscriber( diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/subscribers/TokenListAnalyticsSubscriber.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/subscribers/TokenListAnalyticsSubscriber.kt new file mode 100644 index 0000000000..7fb410838e --- /dev/null +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/subscribers/TokenListAnalyticsSubscriber.kt @@ -0,0 +1,49 @@ +package com.tangem.feature.wallet.presentation.wallet.subscribers + +import com.tangem.domain.account.models.AccountStatusList +import com.tangem.domain.account.status.supplier.SingleAccountStatusListSupplier +import com.tangem.domain.models.wallet.UserWallet +import com.tangem.feature.wallet.presentation.wallet.analytics.utils.TokenListAnalyticsSender +import com.tangem.feature.wallet.presentation.wallet.state.WalletStateController +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.onEach + +/** + * Subscriber that monitors account list changes and sends token list analytics + * when the total fiat balance changes. + * +[REDACTED_AUTHOR] + */ +internal class TokenListAnalyticsSubscriber @AssistedInject constructor( + @Assisted override val userWallet: UserWallet, + override val singleAccountStatusListSupplier: SingleAccountStatusListSupplier, + private val stateHolder: WalletStateController, + private val tokenListAnalyticsSender: TokenListAnalyticsSender, +) : BasicWalletSubscriber() { + + override fun create(coroutineScope: CoroutineScope): Flow<*> = getAccountStatusListFlow() + .distinctUntilChanged { old, new -> old.totalFiatBalance == new.totalFiatBalance } + .onEach(::sendTokenListAnalytics) + + private suspend fun sendTokenListAnalytics(accountStatusList: AccountStatusList) { + val displayedState = stateHolder.getWalletStateIfSelected(userWallet.walletId) + + val flattenCurrencies = accountStatusList.flattenCurrencies() + tokenListAnalyticsSender.send( + displayedUiState = displayedState, + userWallet = userWallet, + flattenCurrencies = flattenCurrencies, + totalFiatBalance = accountStatusList.totalFiatBalance, + ) + } + + @AssistedFactory + interface Factory { + fun create(userWallet: UserWallet): TokenListAnalyticsSubscriber + } +} \ No newline at end of file From cd504ed349a3d8c31a6aa773fd374bd229bac429 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 24 Feb 2026 22:14:43 +0000 Subject: [PATCH 2/2] Updated on 2026-08-14 --- gradle/tangem_dependencies.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/tangem_dependencies.toml b/gradle/tangem_dependencies.toml index 4372af7f4b..283bf15238 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -5,13 +5,13 @@ # https://github.com/tangem/tangem-sdk-android/ # https://github.com/tangem/vico -tangemBlockchainSdk = "releases-5.33-1423" +tangemBlockchainSdk = "releases-5.34-1430" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "releases-5.33-576" +tangemCardSdk = "releases-5.34-580" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^ tangemVico = "2.0.0-alpha.25-tangem12" #tangemVico = "0.0.1" # Keep it! - used for local builds ^ -tangemHotSdk = "develop-545" +tangemHotSdk = "develop-539" #tangemHotSdk = "0.0.1" # Keep it! - used for local builds ^