From e0fb0e3587ed71f5d4d11ee47890cf6e52b7e2cb Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 19 Nov 2025 14:22:53 +0300 Subject: [PATCH 1/6] Updated on 2026-08-14 --- .../api/tangemTech/TangemTechApi.kt | 9 +++++ .../tangemTech/models/TransactionEventBody.kt | 23 +++++++++++ .../DefaultTransactionRepository.kt | 32 +++++++++++++++ .../transaction/di/TransactionDataModule.kt | 3 ++ .../models/EventTransactionTypeDto.kt | 11 +++++ .../transaction/TransactionRepository.kt | 3 ++ .../usecase/SendTransactionUseCase.kt | 40 +++++++++++++++++-- 7 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/TransactionEventBody.kt create mode 100644 domain/transaction/models/src/main/kotlin/com/tangem/domain/transaction/models/EventTransactionTypeDto.kt diff --git a/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/TangemTechApi.kt b/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/TangemTechApi.kt index e838002aa8..89e68bbe2e 100644 --- a/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/TangemTechApi.kt +++ b/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/TangemTechApi.kt @@ -172,4 +172,13 @@ interface TangemTechApi { @Header("Cache-Control") cacheControl: String = "max-age=600", ): ApiResponse // endregion + + /** + * Stores transaction hash in cache to prevent duplicate push + * notifications for yield operations (deposit, withdraw, send). + * Used when yield operations generate intermediate transactions + * that should not trigger notifications. + */ + @POST("v1/transaction-events") + suspend fun transactionEvents(@Body name: TransactionEventBody): ApiResponse } \ No newline at end of file diff --git a/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/TransactionEventBody.kt b/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/TransactionEventBody.kt new file mode 100644 index 0000000000..806b775af1 --- /dev/null +++ b/core/datasource/src/main/java/com/tangem/datasource/api/tangemTech/models/TransactionEventBody.kt @@ -0,0 +1,23 @@ +package com.tangem.datasource.api.tangemTech.models + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class TransactionEventBody( + @Json(name = "transactionId") val transactionId: String, + @Json(name = "operationType") val operationType: OperationType, +) + +@JsonClass(generateAdapter = false) +enum class OperationType { + + @Json(name = "YIELD_DEPOSIT") + YIELD_DEPOSIT, + + @Json(name = "YIELD_WITHDRAW") + YIELD_WITHDRAW, + + @Json(name = "YIELD_SEND") + YIELD_SEND, +} \ No newline at end of file diff --git a/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt b/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt index 3ac0f16721..26cb2d893e 100644 --- a/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt +++ b/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt @@ -20,13 +20,19 @@ import com.tangem.blockchain.common.transaction.Fee import com.tangem.blockchain.nft.models.NFTAsset import com.tangem.blockchainsdk.utils.fromNetworkId import com.tangem.blockchainsdk.utils.toBlockchain +import com.tangem.datasource.api.common.response.fold +import com.tangem.datasource.api.tangemTech.TangemTechApi +import com.tangem.datasource.api.tangemTech.models.OperationType +import com.tangem.datasource.api.tangemTech.models.TransactionEventBody import com.tangem.datasource.local.walletmanager.WalletManagersStore import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.network.Network import com.tangem.domain.models.wallet.UserWalletId import com.tangem.domain.transaction.TransactionRepository +import com.tangem.domain.transaction.models.EventTransactionTypeDto import com.tangem.domain.walletmanager.WalletManagersFacade import com.tangem.utils.coroutines.CoroutineDispatcherProvider +import com.tangem.utils.coroutines.runCatching import kotlinx.coroutines.withContext import timber.log.Timber import java.math.BigDecimal @@ -34,6 +40,7 @@ import java.math.BigInteger @Suppress("LargeClass") internal class DefaultTransactionRepository( + private val tangemTechApi: TangemTechApi, private val walletManagersFacade: WalletManagersFacade, private val walletManagersStore: WalletManagersStore, private val dispatchers: CoroutineDispatcherProvider, @@ -415,6 +422,31 @@ internal class DefaultTransactionRepository( preparer.prepareAndSignMultiple(transactionData, signer) } + override suspend fun sendTransactionHash(hash: String, transactionType: EventTransactionTypeDto) { + runCatching(dispatchers.io) { + val operationType = when (transactionType) { + EventTransactionTypeDto.DEPOSIT -> OperationType.YIELD_DEPOSIT + EventTransactionTypeDto.WITHDRAW -> OperationType.YIELD_WITHDRAW + EventTransactionTypeDto.SEND -> OperationType.YIELD_SEND + } + val body = TransactionEventBody( + operationType = operationType, + transactionId = hash, + ) + val response = tangemTechApi.transactionEvents(body) + response.fold( + onSuccess = { + Timber.d("Successfully sent yield supply transaction hash: $hash") + }, + onError = { error -> + Timber.e(error, "Failed to send yield supply transaction hash: $hash") + }, + ) + }.onFailure { error -> + Timber.e(error, "Failed to send yield supply transaction hash: $hash") + } + } + private suspend fun getPreparer(network: Network, userWalletId: UserWalletId): TransactionPreparer { val blockchain = network.toBlockchain() val walletManager = walletManagersFacade.getOrCreateWalletManager( diff --git a/data/transaction/src/main/java/com/tangem/data/transaction/di/TransactionDataModule.kt b/data/transaction/src/main/java/com/tangem/data/transaction/di/TransactionDataModule.kt index 267e449c57..e6b6616813 100644 --- a/data/transaction/src/main/java/com/tangem/data/transaction/di/TransactionDataModule.kt +++ b/data/transaction/src/main/java/com/tangem/data/transaction/di/TransactionDataModule.kt @@ -4,6 +4,7 @@ import com.tangem.data.transaction.DefaultFeeRepository import com.tangem.data.transaction.DefaultTransactionRepository import com.tangem.data.transaction.DefaultWalletAddressServiceRepository import com.tangem.data.transaction.error.DefaultFeeErrorResolver +import com.tangem.datasource.api.tangemTech.TangemTechApi import com.tangem.datasource.local.walletmanager.WalletManagersStore import com.tangem.domain.demo.models.DemoConfig import com.tangem.domain.transaction.FeeRepository @@ -25,11 +26,13 @@ internal object TransactionDataModule { @Provides @Singleton fun providesTransactionRepository( + tangemTechApi: TangemTechApi, walletManagersFacade: WalletManagersFacade, walletManagersStore: WalletManagersStore, dispatchers: CoroutineDispatcherProvider, ): TransactionRepository { return DefaultTransactionRepository( + tangemTechApi = tangemTechApi, walletManagersFacade = walletManagersFacade, walletManagersStore = walletManagersStore, dispatchers = dispatchers, diff --git a/domain/transaction/models/src/main/kotlin/com/tangem/domain/transaction/models/EventTransactionTypeDto.kt b/domain/transaction/models/src/main/kotlin/com/tangem/domain/transaction/models/EventTransactionTypeDto.kt new file mode 100644 index 0000000000..b814d46717 --- /dev/null +++ b/domain/transaction/models/src/main/kotlin/com/tangem/domain/transaction/models/EventTransactionTypeDto.kt @@ -0,0 +1,11 @@ +package com.tangem.domain.transaction.models + +/** + * DTO representing the type of a transaction event on tangem backend to send + * info about transaction happens and its hash + */ +enum class EventTransactionTypeDto { + DEPOSIT, + WITHDRAW, + SEND, +} \ No newline at end of file diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/TransactionRepository.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/TransactionRepository.kt index f6171137cd..efa2d59016 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/TransactionRepository.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/TransactionRepository.kt @@ -9,6 +9,7 @@ import com.tangem.blockchain.nft.models.NFTAsset import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.network.Network import com.tangem.domain.models.wallet.UserWalletId +import com.tangem.domain.transaction.models.EventTransactionTypeDto import java.math.BigDecimal import java.math.BigInteger @@ -123,4 +124,6 @@ interface TransactionRepository { userWalletId: UserWalletId, network: Network, ): com.tangem.blockchain.extensions.Result> + + suspend fun sendTransactionHash(hash: String, transactionType: EventTransactionTypeDto) } \ No newline at end of file diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt index 6c0417c870..34a254668f 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt @@ -3,6 +3,7 @@ package com.tangem.domain.transaction.usecase import arrow.core.Either import arrow.core.left import arrow.core.right +import com.tangem.blockchain.blockchains.ethereum.EthereumTransactionExtras import com.tangem.blockchain.common.BlockchainSdkError import com.tangem.blockchain.common.TransactionData import com.tangem.blockchain.common.TransactionSender @@ -10,21 +11,25 @@ import com.tangem.blockchain.common.TransactionSigner import com.tangem.blockchain.common.transaction.TransactionsSendResult import com.tangem.blockchain.extensions.Result import com.tangem.blockchain.network.ResultChecker +import com.tangem.blockchain.yieldsupply.providers.ethereum.yield.EthereumYieldSupplyEnterCallData +import com.tangem.blockchain.yieldsupply.providers.ethereum.yield.EthereumYieldSupplyExitCallData +import com.tangem.blockchain.yieldsupply.providers.ethereum.yield.EthereumYieldSupplySendCallData import com.tangem.core.ui.format.bigdecimal.format import com.tangem.core.ui.format.bigdecimal.simple import com.tangem.domain.card.common.TapWorkarounds.isStart2Coin import com.tangem.domain.card.common.TapWorkarounds.isTangemTwins import com.tangem.domain.card.models.TwinKey import com.tangem.domain.card.repository.CardSdkConfigRepository -import com.tangem.domain.demo.models.DemoConfig import com.tangem.domain.demo.DemoTransactionSender +import com.tangem.domain.demo.models.DemoConfig import com.tangem.domain.models.network.Network +import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.networks.single.SingleNetworkStatusFetcher import com.tangem.domain.transaction.TransactionRepository import com.tangem.domain.transaction.error.SendTransactionError import com.tangem.domain.transaction.error.parseWrappedError +import com.tangem.domain.transaction.models.EventTransactionTypeDto import com.tangem.domain.walletmanager.WalletManagersFacade -import com.tangem.domain.models.wallet.UserWallet class SendTransactionUseCase( private val demoConfig: DemoConfig, @@ -100,7 +105,10 @@ class SendTransactionUseCase( ) } .fold( - ifRight = { result -> result.hashes.right() }, + ifRight = { result -> + processSentTransactionsHashes(txsData, result.hashes) + result.hashes.right() + }, ifLeft = { it.left() }, ) } @@ -114,6 +122,32 @@ class SendTransactionUseCase( .map { it.first() } } + private suspend fun processSentTransactionsHashes(transactions: List, hashes: List) { + transactions.forEachIndexed { ind, tx -> + sendHashToBackendIfNeeded(tx, hashes[ind]) + } + } + + /** + * Sends tx hash to backend for specific transaction types + */ + private suspend fun sendHashToBackendIfNeeded(transaction: TransactionData, txHash: String) { + (transaction as? TransactionData.Uncompiled)?.let { + val extras = it.extras + when (extras) { + is EthereumTransactionExtras -> { + val txType = when (extras.callData) { + is EthereumYieldSupplyEnterCallData -> EventTransactionTypeDto.DEPOSIT + is EthereumYieldSupplySendCallData -> EventTransactionTypeDto.SEND + is EthereumYieldSupplyExitCallData -> EventTransactionTypeDto.WITHDRAW + else -> return + } + transactionRepository.sendTransactionHash(txHash, txType) + } + } + } + } + private suspend fun sendDemo( userWallet: UserWallet, network: Network, From 4038e1b134f5efa257a6f7a7a283d977363c6a6a Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 20 Nov 2025 19:07:32 +0500 Subject: [PATCH 2/6] Updated on 2026-08-14 --- .../currency/CryptoCurrencyExtensions.kt | 22 ++++-- .../impl/main/model/YieldSupplyModel.kt | 37 ++++++++-- .../active/model/YieldSupplyActiveModel.kt | 57 +--------------- .../YieldSupplyActiveMinAmountTransformer.kt | 67 ++++++++++++++++++- 4 files changed, 118 insertions(+), 65 deletions(-) diff --git a/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrencyExtensions.kt b/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrencyExtensions.kt index 532c2f1621..4937c3c0af 100644 --- a/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrencyExtensions.kt +++ b/domain/models/src/main/kotlin/com/tangem/domain/models/currency/CryptoCurrencyExtensions.kt @@ -1,21 +1,33 @@ package com.tangem.domain.models.currency +import java.math.BigDecimal + fun CryptoCurrency.Token.yieldSupplyKey(): String { return "${network.backendId}_$contractAddress" } -fun CryptoCurrencyStatus.yieldSupplyNotAllAmountSupplied(): Boolean { - if (this.currency !is CryptoCurrency.Token) return false +fun CryptoCurrencyStatus.hasNotSuppliedAmount(): Boolean { + val notSupplied = notSuppliedAmountOrNull() ?: return false + return notSupplied > BigDecimal.ZERO +} + +fun CryptoCurrencyStatus.shouldShowNotSuppliedInfoIcon(minAmount: BigDecimal): Boolean { + val notSupplied = notSuppliedAmountOrNull() ?: return false + return notSupplied >= minAmount +} + +fun CryptoCurrencyStatus.notSuppliedAmountOrNull(): BigDecimal? { + if (this.currency !is CryptoCurrency.Token) return null val supplyStatus = this.value.yieldSupplyStatus - if (supplyStatus?.isActive != true) return false + if (supplyStatus?.isActive != true) return null val protocolBalance = supplyStatus.effectiveProtocolBalance val amount = this.value.amount return if (protocolBalance != null && amount != null) { - amount > protocolBalance + amount.minus(protocolBalance) } else { - false + null } } \ No newline at end of file diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt index a6ab368dc5..186a7c5bdc 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt @@ -17,7 +17,8 @@ import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase import com.tangem.domain.models.StatusSource import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus -import com.tangem.domain.models.currency.yieldSupplyNotAllAmountSupplied +import com.tangem.domain.models.currency.hasNotSuppliedAmount +import com.tangem.domain.models.currency.shouldShowNotSuppliedInfoIcon import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.yield.supply.YieldSupplyStatus import com.tangem.domain.networks.single.SingleNetworkStatusFetcher @@ -29,6 +30,7 @@ import com.tangem.domain.yield.supply.usecase.YieldSupplyActivateUseCase import com.tangem.domain.yield.supply.usecase.YieldSupplyDeactivateUseCase import com.tangem.domain.yield.supply.usecase.YieldSupplyGetTokenStatusUseCase import com.tangem.domain.yield.supply.usecase.YieldSupplyIsAvailableUseCase +import com.tangem.domain.yield.supply.usecase.YieldSupplyMinAmountUseCase import com.tangem.features.yield.supply.api.YieldSupplyComponent import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics import com.tangem.features.yield.supply.impl.R @@ -64,6 +66,7 @@ internal class YieldSupplyModel @Inject constructor( private val yieldSupplyActivateUseCase: YieldSupplyActivateUseCase, private val yieldSupplyDeactivateUseCase: YieldSupplyDeactivateUseCase, private val yieldSupplyRepository: YieldSupplyRepository, + private val yieldSupplyMinAmountUseCase: YieldSupplyMinAmountUseCase, ) : Model(), YieldSupplyClickIntents { private val params = paramsContainer.require() @@ -303,7 +306,10 @@ internal class YieldSupplyModel @Inject constructor( private fun loadActiveState(cryptoCurrencyStatus: CryptoCurrencyStatus, yieldSupplyStatus: YieldSupplyStatus) { val cryptoCurrencyToken = cryptoCurrency as? CryptoCurrency.Token ?: return val showWarningIcon = !yieldSupplyStatus.isAllowedToSpend - val showInfoIcon = cryptoCurrencyStatus.yieldSupplyNotAllAmountSupplied() + val showInfoIconPrevState = when (uiState) { + is YieldSupplyUM.Content -> uiState.showInfoIcon + else -> false + } if (!yieldSupplyStatus.isAllowedToSpend) { analyticsEventsHandler.send( YieldSupplyAnalytics.NoticeApproveNeeded( @@ -331,10 +337,11 @@ internal class YieldSupplyModel @Inject constructor( ), onClick = ::onActiveClick, showWarningIcon = showWarningIcon, - showInfoIcon = showInfoIcon, + showInfoIcon = showInfoIconPrevState, apy = tokenStatus.apy.toString(), ) } + computeAndApplyShowInfoIcon(cryptoCurrencyStatus) }.onLeft { Timber.e(it) uiState.update { @@ -348,14 +355,36 @@ internal class YieldSupplyModel @Inject constructor( rewardsApy = TextReference.EMPTY, onClick = ::onActiveClick, showWarningIcon = showWarningIcon, - showInfoIcon = showInfoIcon, + showInfoIcon = showInfoIconPrevState, apy = "", ) } + computeAndApplyShowInfoIcon(cryptoCurrencyStatus) } } } + private fun computeAndApplyShowInfoIcon(cryptoCurrencyStatus: CryptoCurrencyStatus) { + modelScope.launch(dispatchers.default) { + val showInfoIcon = if (cryptoCurrencyStatus.hasNotSuppliedAmount()) { + val minAmount = yieldSupplyMinAmountUseCase(userWallet, cryptoCurrencyStatus).getOrNull() + if (minAmount != null) { + cryptoCurrencyStatus.shouldShowNotSuppliedInfoIcon(minAmount) + } else { + false + } + } else { + false + } + uiState.update { state -> + when (state) { + is YieldSupplyUM.Content -> state.copy(showInfoIcon = showInfoIcon) + else -> state + } + } + } + } + private fun sendInfoAboutProtocolStatus(cryptoCurrencyStatus: CryptoCurrencyStatus) { if (lastYieldSupplyStatus == cryptoCurrencyStatus.value.yieldSupplyStatus) return val token = cryptoCurrency as? CryptoCurrency.Token ?: return 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 414cd7a29d..094fa330fa 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 @@ -1,12 +1,10 @@ package com.tangem.features.yield.supply.impl.subcomponents.active.model import arrow.core.getOrElse -import com.tangem.common.ui.notifications.NotificationUM import com.tangem.core.analytics.api.AnalyticsEventHandler import com.tangem.core.decompose.di.ModelScoped import com.tangem.core.decompose.model.Model import com.tangem.core.decompose.model.ParamsContainer -import com.tangem.core.ui.components.notifications.NotificationConfig import com.tangem.core.ui.extensions.TextReference import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference @@ -16,7 +14,6 @@ import com.tangem.core.ui.format.bigdecimal.format import com.tangem.domain.appcurrency.GetSelectedAppCurrencyUseCase import com.tangem.domain.appcurrency.model.AppCurrency import com.tangem.domain.models.currency.CryptoCurrency -import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.yield.supply.usecase.YieldSupplyGetProtocolBalanceUseCase import com.tangem.domain.yield.supply.usecase.YieldSupplyGetTokenStatusUseCase import com.tangem.domain.yield.supply.usecase.YieldSupplyMinAmountUseCase @@ -31,13 +28,10 @@ import com.tangem.features.yield.supply.impl.subcomponents.active.model.transfor import com.tangem.utils.StringsSigns.DASH_SIGN import com.tangem.utils.coroutines.CoroutineDispatcherProvider import com.tangem.utils.transformer.update -import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf -import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.flow.* import kotlinx.coroutines.launch import timber.log.Timber -import java.math.BigDecimal import javax.inject.Inject @Suppress("LongParameterList") @@ -121,7 +115,6 @@ internal class YieldSupplyActiveModel @Inject constructor( uiState.update { it.copy( - notifications = getNotifications(cryptoCurrencyStatus), availableBalance = stringReference( protocolBalance.format { crypto( @@ -156,54 +149,6 @@ internal class YieldSupplyActiveModel @Inject constructor( } } - private fun getNotifications(cryptoCurrencyStatus: CryptoCurrencyStatus): ImmutableList { - val approvalNotification = if (cryptoCurrencyStatus.value.yieldSupplyStatus?.isAllowedToSpend != true) { - NotificationUM.Error( - title = resourceReference(R.string.yield_module_approve_needed_notification_title), - subtitle = resourceReference(R.string.yield_module_approve_needed_notification_description), - iconResId = R.drawable.ic_alert_triangle_20, - buttonState = NotificationConfig.ButtonsState.PrimaryButtonConfig( - text = resourceReference(R.string.yield_module_approve_needed_notification_cta), - onClick = params.callback::onApprove, - ), - ) - } else { - null - } - val notSuppliedNotification = getNotSuppliedNotification(cryptoCurrencyStatus) - return listOfNotNull( - approvalNotification, - notSuppliedNotification, - ).toPersistentList() - } - - private fun getNotSuppliedNotification(cryptoCurrencyStatus: CryptoCurrencyStatus): NotificationUM? { - val value = cryptoCurrencyStatus.value - val isActive = value.yieldSupplyStatus?.isActive == true - val effectiveProtocolBalance = value.yieldSupplyStatus?.effectiveProtocolBalance ?: null - val amount = value.amount - - if (!isActive || effectiveProtocolBalance == null || amount == null) return null - - val notDepositedAmount = amount.minus(effectiveProtocolBalance) - return if (notDepositedAmount > BigDecimal.ZERO) { - val formattedAmount = - notDepositedAmount.format { crypto(symbol = "", decimals = cryptoCurrencyStatus.currency.decimals) } - analyticsHandler.send( - YieldSupplyAnalytics.NoticeAmountNotDeposited( - token = cryptoCurrency.symbol, - blockchain = cryptoCurrency.network.name, - ), - ) - NotificationUM.Info.YieldSupplyNotAllAmountSupplied( - formattedAmount = formattedAmount, - symbol = cryptoCurrency.symbol, - ) - } else { - null - } - } - private fun loadMinAmount() { modelScope.launch(dispatchers.default) { yieldSupplyMinAmountUseCase( @@ -215,6 +160,8 @@ internal class YieldSupplyActiveModel @Inject constructor( cryptoCurrencyStatus = cryptoCurrencyStatusFlow.value, appCurrency = appCurrency, minAmount = minAmount, + analyticsHandler = analyticsHandler, + onApprove = params.callback::onApprove, ), ) }.onLeft { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/transformers/YieldSupplyActiveMinAmountTransformer.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/transformers/YieldSupplyActiveMinAmountTransformer.kt index 91fa089b91..1bea08e058 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/transformers/YieldSupplyActiveMinAmountTransformer.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/transformers/YieldSupplyActiveMinAmountTransformer.kt @@ -1,5 +1,8 @@ package com.tangem.features.yield.supply.impl.subcomponents.active.model.transformers +import com.tangem.common.ui.notifications.NotificationUM +import com.tangem.core.analytics.api.AnalyticsEventHandler +import com.tangem.core.ui.components.notifications.NotificationConfig import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.wrappedList @@ -8,18 +11,37 @@ import com.tangem.core.ui.format.bigdecimal.fiat import com.tangem.core.ui.format.bigdecimal.format import com.tangem.domain.appcurrency.model.AppCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus +import com.tangem.domain.models.currency.notSuppliedAmountOrNull +import com.tangem.domain.models.currency.shouldShowNotSuppliedInfoIcon +import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics import com.tangem.features.yield.supply.impl.R import com.tangem.features.yield.supply.impl.subcomponents.active.entity.YieldSupplyActiveContentUM import com.tangem.utils.transformer.Transformer +import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.toPersistentList import java.math.BigDecimal /** - * Computes and sets minimum amount (fiat) and fee description note + * Transformer that populates minimum supply amount and related hints for the active Yield Supply screen. + * + * - Sets the displayed minimum amount in fiat and crypto. + * - Builds the fee policy note text using the minimum amount. + * - Adds contextual notifications: + * - Approval required notification when spending is not yet allowed (emits analytics on CTA). + * - "Not all amount supplied" info when wallet balance exceeds the supplied balance by more than [minAmount]. + * + * @property cryptoCurrencyStatus Current currency status used to calculate values and flags. + * @property appCurrency Preferred fiat currency for formatting. + * @property minAmount Protocol-required minimal amount to deposit/supply (in crypto units). + * @property analyticsHandler Analytics reporter for user actions. + * @property onApprove Action invoked when the "Approve" notification button is tapped. */ internal class YieldSupplyActiveMinAmountTransformer( private val cryptoCurrencyStatus: CryptoCurrencyStatus, private val appCurrency: AppCurrency, private val minAmount: BigDecimal, + private val analyticsHandler: AnalyticsEventHandler, + private val onApprove: () -> Unit, ) : Transformer { override fun transform(prevState: YieldSupplyActiveContentUM): YieldSupplyActiveContentUM { @@ -41,6 +63,49 @@ internal class YieldSupplyActiveMinAmountTransformer( return prevState.copy( minAmount = stringReference(minAmountFiatText), minFeeDescription = minFeeNoteValue, + notifications = getNotifications(), ) } + + private fun getNotifications(): ImmutableList { + val approvalNotification = if (cryptoCurrencyStatus.value.yieldSupplyStatus?.isAllowedToSpend != true) { + NotificationUM.Error( + title = resourceReference(R.string.yield_module_approve_needed_notification_title), + subtitle = resourceReference(R.string.yield_module_approve_needed_notification_description), + iconResId = R.drawable.ic_alert_triangle_20, + buttonState = NotificationConfig.ButtonsState.PrimaryButtonConfig( + text = resourceReference(R.string.yield_module_approve_needed_notification_cta), + onClick = onApprove, + ), + ) + } else { + null + } + val notSuppliedNotification = getNotSuppliedNotification(cryptoCurrencyStatus) + return listOfNotNull( + approvalNotification, + notSuppliedNotification, + ).toPersistentList() + } + + private fun getNotSuppliedNotification(cryptoCurrencyStatus: CryptoCurrencyStatus): NotificationUM? { + return if (cryptoCurrencyStatus.shouldShowNotSuppliedInfoIcon(minAmount)) { + val cryptoCurrency = cryptoCurrencyStatus.currency + val notDepositedAmount = cryptoCurrencyStatus.notSuppliedAmountOrNull() + val formattedAmount = + notDepositedAmount.format { crypto(symbol = "", decimals = cryptoCurrencyStatus.currency.decimals) } + analyticsHandler.send( + YieldSupplyAnalytics.NoticeAmountNotDeposited( + token = cryptoCurrency.symbol, + blockchain = cryptoCurrency.network.name, + ), + ) + NotificationUM.Info.YieldSupplyNotAllAmountSupplied( + formattedAmount = formattedAmount, + symbol = cryptoCurrency.symbol, + ) + } else { + null + } + } } \ No newline at end of file From 0d8422ec5f7a2aa91d2c3969a051ca9f0ef02b74 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 20 Nov 2025 19:23:24 +0500 Subject: [PATCH 3/6] 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(), From b95807397da3d8d6673b51035dac1567e2b21712 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 21 Nov 2025 13:28:59 +0300 Subject: [PATCH 4/6] Updated on 2026-08-14 --- .../tap/di/domain/TransactionDomainModule.kt | 5 +++++ .../usecase/SendTransactionUseCase.kt | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/di/domain/TransactionDomainModule.kt b/app/src/main/java/com/tangem/tap/di/domain/TransactionDomainModule.kt index 887376f2a3..1a5ebb1043 100644 --- a/app/src/main/java/com/tangem/tap/di/domain/TransactionDomainModule.kt +++ b/app/src/main/java/com/tangem/tap/di/domain/TransactionDomainModule.kt @@ -12,10 +12,13 @@ import com.tangem.domain.transaction.TransactionRepository import com.tangem.domain.transaction.WalletAddressServiceRepository import com.tangem.domain.transaction.usecase.* import com.tangem.domain.walletmanager.WalletManagersFacade +import com.tangem.utils.coroutines.CoroutineDispatcherProvider import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.SupervisorJob import javax.inject.Singleton @Suppress("TooManyFunctions") @@ -46,6 +49,7 @@ internal object TransactionDomainModule { walletManagersFacade: WalletManagersFacade, singleNetworkStatusFetcher: SingleNetworkStatusFetcher, tangemHotWalletSignerFactory: TangemHotWalletSigner.Factory, + dispatchers: CoroutineDispatcherProvider, ): SendTransactionUseCase { return SendTransactionUseCase( demoConfig = DemoConfig(), @@ -53,6 +57,7 @@ internal object TransactionDomainModule { transactionRepository = transactionRepository, walletManagersFacade = walletManagersFacade, singleNetworkStatusFetcher = singleNetworkStatusFetcher, + parallelUpdatingScope = CoroutineScope(SupervisorJob() + dispatchers.io), getHotWalletSigner = tangemHotWalletSignerFactory::create, ) } diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt index 34a254668f..5c26d2efdd 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt @@ -30,13 +30,19 @@ import com.tangem.domain.transaction.error.SendTransactionError import com.tangem.domain.transaction.error.parseWrappedError import com.tangem.domain.transaction.models.EventTransactionTypeDto import com.tangem.domain.walletmanager.WalletManagersFacade +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.NonCancellable +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +@Suppress("LongParameterList") class SendTransactionUseCase( private val demoConfig: DemoConfig, private val cardSdkConfigRepository: CardSdkConfigRepository, private val transactionRepository: TransactionRepository, private val walletManagersFacade: WalletManagersFacade, private val singleNetworkStatusFetcher: SingleNetworkStatusFetcher, + private val parallelUpdatingScope: CoroutineScope, private val getHotWalletSigner: (UserWallet.Hot) -> TransactionSigner, ) { suspend operator fun invoke( @@ -122,9 +128,13 @@ class SendTransactionUseCase( .map { it.first() } } - private suspend fun processSentTransactionsHashes(transactions: List, hashes: List) { - transactions.forEachIndexed { ind, tx -> - sendHashToBackendIfNeeded(tx, hashes[ind]) + private fun processSentTransactionsHashes(transactions: List, hashes: List) { + parallelUpdatingScope.launch { + withContext(NonCancellable) { + transactions.forEachIndexed { ind, tx -> + sendHashToBackendIfNeeded(tx, hashes[ind]) + } + } } } From c2678cec80ae96026ee0c01357b425a82af88dfa Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 21 Nov 2025 10:29:25 +0000 Subject: [PATCH 5/6] 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 98c8350883..cd431f6dd6 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.30-1307" +tangemBlockchainSdk = "develop-1306" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds -tangemCardSdk = "releases-5.30-567" +tangemCardSdk = "develop-564" #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-528" +tangemHotSdk = "develop-529" #tangemHotSdk = "0.0.1" # Keep it! - used for local builds ^ From b597786638729c1f540dfd15e637bb7a6139027e Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 21 Nov 2025 16:37:35 +0300 Subject: [PATCH 6/6] Updated on 2026-08-14 --- app/src/main/assets/tangem-app-config | 2 +- .../usecase/SendTransactionUseCase.kt | 4 ++-- .../supply/impl/main/model/YieldSupplyModel.kt | 17 +++++++++-------- gradle/tangem_dependencies.toml | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/src/main/assets/tangem-app-config b/app/src/main/assets/tangem-app-config index 27ddebaece..7c568701ed 160000 --- a/app/src/main/assets/tangem-app-config +++ b/app/src/main/assets/tangem-app-config @@ -1 +1 @@ -Subproject commit 27ddebaece01b8e13a9bbafd51f5ff1d64efc2a6 +Subproject commit 7c568701ed57a31b0f1086820435dfc5761714c1 diff --git a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt index 5c26d2efdd..17b9fc38cc 100644 --- a/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt +++ b/domain/transaction/src/main/java/com/tangem/domain/transaction/usecase/SendTransactionUseCase.kt @@ -142,8 +142,8 @@ class SendTransactionUseCase( * Sends tx hash to backend for specific transaction types */ private suspend fun sendHashToBackendIfNeeded(transaction: TransactionData, txHash: String) { - (transaction as? TransactionData.Uncompiled)?.let { - val extras = it.extras + (transaction as? TransactionData.Uncompiled)?.let { tx -> + val extras = tx.extras when (extras) { is EthereumTransactionExtras -> { val txType = when (extras.callData) { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt index 186a7c5bdc..f56722b5ec 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/YieldSupplyModel.kt @@ -306,8 +306,9 @@ internal class YieldSupplyModel @Inject constructor( private fun loadActiveState(cryptoCurrencyStatus: CryptoCurrencyStatus, yieldSupplyStatus: YieldSupplyStatus) { val cryptoCurrencyToken = cryptoCurrency as? CryptoCurrency.Token ?: return val showWarningIcon = !yieldSupplyStatus.isAllowedToSpend - val showInfoIconPrevState = when (uiState) { - is YieldSupplyUM.Content -> uiState.showInfoIcon + val state = uiState.value + val isShowInfoIconPrevState = when (state) { + is YieldSupplyUM.Content -> state.showInfoIcon else -> false } if (!yieldSupplyStatus.isAllowedToSpend) { @@ -337,13 +338,13 @@ internal class YieldSupplyModel @Inject constructor( ), onClick = ::onActiveClick, showWarningIcon = showWarningIcon, - showInfoIcon = showInfoIconPrevState, + showInfoIcon = isShowInfoIconPrevState, apy = tokenStatus.apy.toString(), ) } computeAndApplyShowInfoIcon(cryptoCurrencyStatus) - }.onLeft { - Timber.e(it) + }.onLeft { t -> + Timber.e(t) uiState.update { YieldSupplyUM.Content( title = resourceReference( @@ -355,7 +356,7 @@ internal class YieldSupplyModel @Inject constructor( rewardsApy = TextReference.EMPTY, onClick = ::onActiveClick, showWarningIcon = showWarningIcon, - showInfoIcon = showInfoIconPrevState, + showInfoIcon = isShowInfoIconPrevState, apy = "", ) } @@ -366,7 +367,7 @@ internal class YieldSupplyModel @Inject constructor( private fun computeAndApplyShowInfoIcon(cryptoCurrencyStatus: CryptoCurrencyStatus) { modelScope.launch(dispatchers.default) { - val showInfoIcon = if (cryptoCurrencyStatus.hasNotSuppliedAmount()) { + val isShowInfoIcon = if (cryptoCurrencyStatus.hasNotSuppliedAmount()) { val minAmount = yieldSupplyMinAmountUseCase(userWallet, cryptoCurrencyStatus).getOrNull() if (minAmount != null) { cryptoCurrencyStatus.shouldShowNotSuppliedInfoIcon(minAmount) @@ -378,7 +379,7 @@ internal class YieldSupplyModel @Inject constructor( } uiState.update { state -> when (state) { - is YieldSupplyUM.Content -> state.copy(showInfoIcon = showInfoIcon) + is YieldSupplyUM.Content -> state.copy(showInfoIcon = isShowInfoIcon) else -> state } } diff --git a/gradle/tangem_dependencies.toml b/gradle/tangem_dependencies.toml index 37ddcf8a7f..e9b32503d3 100644 --- a/gradle/tangem_dependencies.toml +++ b/gradle/tangem_dependencies.toml @@ -5,7 +5,7 @@ # https://github.com/tangem/tangem-sdk-android/ # https://github.com/tangem/vico -tangemBlockchainSdk = "develop-1308" +tangemBlockchainSdk = "develop-1309" #tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds tangemCardSdk = "develop-564" #tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^