Updated on 2026-08-14

This commit is contained in:
Tangem 2025-11-20 19:23:24 +05:00
parent 4038e1b134
commit 0d8422ec5f
6 changed files with 21 additions and 5 deletions

View file

@ -22,6 +22,7 @@ dependencies {
/** Core */
implementation(projects.core.datasource)
implementation(projects.core.utils)
implementation(projects.core.analytics)
/** Domain */
implementation(projects.domain.yieldSupply)

View file

@ -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<String, YieldSupplyEnterStatus> = 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
}

View file

@ -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,
)
}

View file

@ -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,
)

View file

@ -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()

View file

@ -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(),