From 0d8422ec5f7a2aa91d2c3969a051ca9f0ef02b74 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 20 Nov 2025 19:23:24 +0500 Subject: [PATCH] Updated on 2026-08-14 --- data/yield-supply/build.gradle.kts | 1 + .../yield/supply/DefaultYieldSupplyRepository.kt | 13 ++++++++++++- .../data/yield/supply/di/YieldSupplyDataModule.kt | 3 +++ .../supply/impl/main/ui/YieldSupplyBlockContent.kt | 6 +++--- .../supply/impl/promo/ui/YieldSupplyPromoContent.kt | 1 + .../active/model/YieldSupplyActiveModel.kt | 2 +- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/data/yield-supply/build.gradle.kts b/data/yield-supply/build.gradle.kts index b53babcf05..4fbb4f314a 100644 --- a/data/yield-supply/build.gradle.kts +++ b/data/yield-supply/build.gradle.kts @@ -22,6 +22,7 @@ dependencies { /** Core */ implementation(projects.core.datasource) implementation(projects.core.utils) + implementation(projects.core.analytics) /** Domain */ implementation(projects.domain.yieldSupply) diff --git a/data/yield-supply/src/main/java/com/tangem/data/yield/supply/DefaultYieldSupplyRepository.kt b/data/yield-supply/src/main/java/com/tangem/data/yield/supply/DefaultYieldSupplyRepository.kt index 75f2634213..e652292644 100644 --- a/data/yield-supply/src/main/java/com/tangem/data/yield/supply/DefaultYieldSupplyRepository.kt +++ b/data/yield-supply/src/main/java/com/tangem/data/yield/supply/DefaultYieldSupplyRepository.kt @@ -5,6 +5,8 @@ import com.tangem.blockchain.yieldsupply.YieldSupplyProvider import com.tangem.blockchainsdk.utils.fromNetworkId import com.tangem.blockchainsdk.utils.toBlockchain import com.tangem.blockchainsdk.utils.toNetworkId +import com.tangem.core.analytics.api.AnalyticsExceptionHandler +import com.tangem.core.analytics.models.ExceptionAnalyticsEvent import com.tangem.data.yield.supply.converters.YieldMarketTokenConverter import com.tangem.data.yield.supply.converters.YieldTokenChartConverter import com.tangem.datasource.api.common.response.getOrThrow @@ -32,6 +34,7 @@ internal class DefaultYieldSupplyRepository( private val store: YieldMarketsStore, private val walletManagersFacade: WalletManagersFacade, private val dispatchers: CoroutineDispatcherProvider, + private val analyticsExceptionHandler: AnalyticsExceptionHandler, ) : YieldSupplyRepository { private val statusMap: MutableMap = ConcurrentHashMap() @@ -74,7 +77,15 @@ internal class DefaultYieldSupplyRepository( userWalletId = userWalletId, blockchain = cryptoCurrency.network.toBlockchain(), derivationPath = cryptoCurrency.network.derivationPath.value, - ) ?: error("Wallet manager not found") + ) + if (walletManager == null) { + analyticsExceptionHandler.sendException( + ExceptionAnalyticsEvent( + exception = IllegalStateException("Wallet manager not found"), + ), + ) + return@withContext false + } (walletManager as? YieldSupplyProvider)?.isSupported() ?: false } diff --git a/data/yield-supply/src/main/java/com/tangem/data/yield/supply/di/YieldSupplyDataModule.kt b/data/yield-supply/src/main/java/com/tangem/data/yield/supply/di/YieldSupplyDataModule.kt index 69ce23f67e..409d1da57f 100644 --- a/data/yield-supply/src/main/java/com/tangem/data/yield/supply/di/YieldSupplyDataModule.kt +++ b/data/yield-supply/src/main/java/com/tangem/data/yield/supply/di/YieldSupplyDataModule.kt @@ -1,5 +1,6 @@ package com.tangem.data.yield.supply.di +import com.tangem.core.analytics.api.AnalyticsExceptionHandler import com.tangem.data.yield.supply.DefaultYieldSupplyRepository import com.tangem.data.yield.supply.DefaultYieldSupplyErrorResolver import com.tangem.data.yield.supply.DefaultYieldSupplyTransactionRepository @@ -39,12 +40,14 @@ internal object YieldSupplyDataModule { store: YieldMarketsStore, walletManagersFacade: WalletManagersFacade, dispatchers: CoroutineDispatcherProvider, + analyticsExceptionHandler: AnalyticsExceptionHandler, ): YieldSupplyRepository { return DefaultYieldSupplyRepository( yieldSupplyApi = yieldSupplyApi, store = store, dispatchers = dispatchers, walletManagersFacade = walletManagersFacade, + analyticsExceptionHandler = analyticsExceptionHandler, ) } diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt index 08381eab85..36a30575b7 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/ui/YieldSupplyBlockContent.kt @@ -108,7 +108,7 @@ private fun SupplyContent(supplyUM: YieldSupplyUM.Content, modifier: Modifier = Text( modifier = Modifier.weight(1.0f, fill = false), text = supplyUM.title.resolveReference(), - style = TangemTheme.typography.subtitle1, + style = TangemTheme.typography.subtitle2, maxLines = 1, overflow = TextOverflow.Ellipsis, color = TangemTheme.colors.text.primary1, @@ -119,12 +119,12 @@ private fun SupplyContent(supplyUM: YieldSupplyUM.Content, modifier: Modifier = ) { Text( text = StringsSigns.DOT, - style = TangemTheme.typography.subtitle1, + style = TangemTheme.typography.subtitle2, color = TangemTheme.colors.text.tertiary, ) Text( text = supplyUM.rewardsApy.resolveReference(), - style = TangemTheme.typography.subtitle1, + style = TangemTheme.typography.subtitle2, maxLines = 1, color = TangemTheme.colors.text.accent, ) diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt index 24eac0bb13..5092260b9c 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/ui/YieldSupplyPromoContent.kt @@ -110,6 +110,7 @@ private fun ColumnScope.Content(yieldSupplyPromoUM: YieldSupplyPromoUM, clickInt style = LabelStyle.REGULAR, icon = R.drawable.ic_information_24, onClick = clickIntents::onApyInfoClick, + onIconClick = clickIntents::onApyInfoClick, ), ) SpacerH32() diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveModel.kt index 094fa330fa..fc9af56dc8 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveModel.kt @@ -62,7 +62,7 @@ internal class YieldSupplyActiveModel @Inject constructor( providerTitle = resourceReference(R.string.yield_module_provider), subtitle = resourceReference( id = R.string.yield_module_earn_sheet_provider_description, - formatArgs = wrappedList(cryptoCurrency.symbol, cryptoCurrency.symbol), + formatArgs = wrappedList(cryptoCurrency.symbol, AAVEV3_PREFIX + cryptoCurrency.symbol), ), subtitleLink = resourceReference(R.string.common_read_more), notifications = persistentListOf(),