diff --git a/app/src/main/java/com/tangem/tap/routing/utils/ChildFactory.kt b/app/src/main/java/com/tangem/tap/routing/utils/ChildFactory.kt index f2f3a36937..e75766a69a 100644 --- a/app/src/main/java/com/tangem/tap/routing/utils/ChildFactory.kt +++ b/app/src/main/java/com/tangem/tap/routing/utils/ChildFactory.kt @@ -628,7 +628,11 @@ internal class ChildFactory @Inject constructor( is AppRoute.YieldSupplyPromo -> { createComponentChild( context = context, - params = YieldSupplyPromoComponent.Params(route.userWalletId, route.cryptoCurrency), + params = YieldSupplyPromoComponent.Params( + userWalletId = route.userWalletId, + currency = route.cryptoCurrency, + apy = route.apy, + ), componentFactory = yieldSupplyPromoComponentFactory, ) } diff --git a/common/routing/src/main/kotlin/com/tangem/common/routing/AppRoute.kt b/common/routing/src/main/kotlin/com/tangem/common/routing/AppRoute.kt index 41c3ede5ee..ea0474e6e9 100644 --- a/common/routing/src/main/kotlin/com/tangem/common/routing/AppRoute.kt +++ b/common/routing/src/main/kotlin/com/tangem/common/routing/AppRoute.kt @@ -410,5 +410,6 @@ sealed class AppRoute(val path: String) : Route { data class YieldSupplyPromo( val userWalletId: UserWalletId, val cryptoCurrency: CryptoCurrency, + val apy: String, ) : AppRoute(path = "/yield_supply_promo/${userWalletId.stringValue}/${cryptoCurrency.symbol}") } \ No newline at end of file diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml index c4d939bbf7..86569cbb95 100644 --- a/core/res/src/main/res/values-de/strings.xml +++ b/core/res/src/main/res/values-de/strings.xml @@ -262,7 +262,7 @@ Importieren In Arbeit Später - Mehr erfahren + Mehr erfahren %1$s übrig Legacy Bitcoin Gesperrt diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml index 7384640798..ccca2a4779 100644 --- a/core/res/src/main/res/values-ja/strings.xml +++ b/core/res/src/main/res/values-ja/strings.xml @@ -895,7 +895,7 @@ 最大%d日 %s分 - 下記より利用可能 + 下記より利用可能 以下が手に入ります。 サービスは外部プロバイダーによって提供されます。 \nTangemは責任を負いません。 この画面を閉じて、トークンの詳細画面で取引状況を確認できます。 diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index c24dfefd62..5ed2ce02b7 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -202,7 +202,7 @@ Импортировать В процессе Позже - Узнать больше + Узнать больше Осталось %1$s Заблокирован Основная сеть diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index acc79a2262..f6e86e035a 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -22,6 +22,7 @@ You have already exceeded the limit of 20 active accounts. Archive one to recover. Can\'t recover account Archived + We couldn’t archive account. Please try again later. We couldn’t create account. Please try again later. Account created Archive account @@ -260,6 +261,7 @@ From Synchronize addresses Get started + Get token Go to provider Go to token Got it @@ -268,7 +270,7 @@ Import In progress Later - Learn more + Learn more %1$s left Legacy Bitcoin Locked @@ -617,6 +619,7 @@ The selected token is currently unavailable for actions within the crypto wallet. But worry not, you can express your interest by upvoting it. Upvote The wallet doesn\'t support more than one network + About coin To buy, exchange, or receive this asset, add it to your portfolio This asset is currently not supported in the wallet This asset is not available for this wallet @@ -652,6 +655,7 @@ Trending Staking is the easiest way to receive rewards on your crypto. %s Earn up to %s APY + Token Added About %s %d exchange @@ -917,7 +921,7 @@ up to %d days %s min - Available from + Available from You get Service is provided by an external provider. \nTangem is not responsible. You can close this screen and check the transaction status on the token details screen. @@ -1300,6 +1304,10 @@ You receive Choose token not available + Deposit + Service fees + Fee + Withdrawal Failed to load data. Try again later. Hide Technical issues detected. Please try again later or contact support. @@ -1335,6 +1343,7 @@ Sending funds will be available once the pending transaction(s) in network %s is complete Selling %s is not supported by current providers, but we are working to add more options. Staking %s is not supported by current providers, but we are working to add more options. + Text here Generate XPUB Hide You are about to hide this token from the main screen. You can add it back anytime through the manage tokens page. @@ -1822,8 +1831,8 @@ Aave is a decentralized protocol managing over $81.9 billion in total value. Decentralized and self-custodial By using service, you agree with provider\n%1$s and %2$s - Earn %s%% yearly - Aave • Variable Interest Rate + Connect Aave + Aave %1$s%% • Variable Interest Rate Aave Avg %s Last year returns diff --git a/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultCurrencyChecksRepository.kt b/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultCurrencyChecksRepository.kt index f374404cbe..362d59b4a9 100644 --- a/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultCurrencyChecksRepository.kt +++ b/data/tokens/src/main/kotlin/com/tangem/data/tokens/repository/DefaultCurrencyChecksRepository.kt @@ -4,7 +4,9 @@ import com.tangem.blockchain.blockchains.polkadot.ExistentialDepositProvider import com.tangem.blockchain.common.FeeResourceAmountProvider import com.tangem.blockchain.common.MinimumSendAmountProvider import com.tangem.blockchain.common.ReserveAmountProvider +import com.tangem.blockchain.common.Token import com.tangem.blockchain.common.UtxoAmountLimitProvider +import com.tangem.blockchainsdk.utils.toBlockchain import com.tangem.data.tokens.converters.UtxoConverter import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus @@ -21,6 +23,7 @@ import com.tangem.utils.coroutines.CoroutineDispatcherProvider import com.tangem.utils.extensions.isZero import com.tangem.utils.extensions.orZero import kotlinx.coroutines.withContext +import timber.log.Timber import java.math.BigDecimal internal class DefaultCurrencyChecksRepository( @@ -161,4 +164,22 @@ internal class DefaultCurrencyChecksRepository( else -> null } } + + override suspend fun getProtocolBalance(userWalletId: UserWalletId, cryptoCurrency: CryptoCurrency): BigDecimal? { + require(cryptoCurrency is CryptoCurrency.Token) + return runCatching { + val walletManager = walletManagersFacade.getOrCreateWalletManager( + userWalletId = userWalletId, + blockchain = cryptoCurrency.network.toBlockchain(), + derivationPath = cryptoCurrency.network.derivationPath.value, + ) ?: error("Wallet manager not found") + walletManager.getProtocolBalance( + token = Token( + symbol = cryptoCurrency.symbol, + contractAddress = cryptoCurrency.contractAddress, + decimals = cryptoCurrency.decimals, + ), + ) + }.onFailure(Timber::e).getOrThrow() + } } \ No newline at end of file diff --git a/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/warnings/CryptoCurrencyWarning.kt b/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/warnings/CryptoCurrencyWarning.kt index 083b0aba95..a00521acac 100644 --- a/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/warnings/CryptoCurrencyWarning.kt +++ b/domain/tokens/models/src/main/java/com/tangem/domain/tokens/model/warnings/CryptoCurrencyWarning.kt @@ -68,4 +68,10 @@ sealed class CryptoCurrencyWarning { val requiredAmount: BigDecimal, val currencyDecimals: Int, ) : CryptoCurrencyWarning() + + data class YieldSupplyNotDepositedAmount( + val currency: CryptoCurrency, + val currencySymbol: String, + val amount: BigDecimal, + ) : CryptoCurrencyWarning() } \ No newline at end of file diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt index d4611e9d40..3afc61c48b 100644 --- a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/GetCurrencyWarningsUseCase.kt @@ -51,7 +51,8 @@ class GetCurrencyWarningsUseCase( flowOf(currencyChecksRepository.getRentInfoWarning(userWalletId, currencyStatus)), flowOf(currencyChecksRepository.getExistentialDeposit(userWalletId, currency.network)), flowOf(currencyChecksRepository.getFeeResourceAmount(userWalletId, currency.network)), - ) { coinRelatedWarnings, maybeRentWarning, maybeEdWarning, maybeFeeResource -> + flowOf(currencyChecksRepository.getProtocolBalance(userWalletId, currency)), + ) { coinRelatedWarnings, maybeRentWarning, maybeEdWarning, maybeFeeResource, yieldSupplyProtocolBalance -> setOfNotNull( maybeRentWarning, maybeEdWarning?.let { getExistentialDepositWarning(currency, it) }, @@ -62,6 +63,7 @@ class GetCurrencyWarningsUseCase( getBeaconChainShutdownWarning(rawId = currency.network.id.rawId), getAssetRequirementsWarning(userWalletId = userWalletId, currency = currency), getMigrationFromMaticToPolWarning(currency), + getYieldSupplyWarning(cryptoCurrencyStatus = currencyStatus, yieldSupplyProtocolBalance), ) }.flowOn(dispatchers.io) } @@ -261,6 +263,28 @@ class GetCurrencyWarningsUseCase( } } + private fun getYieldSupplyWarning( + cryptoCurrencyStatus: CryptoCurrencyStatus, + protocolBalance: BigDecimal?, + ): CryptoCurrencyWarning? { + val value = cryptoCurrencyStatus.value + val isActive = value.yieldSupplyStatus?.isActive == true + val amount = value.amount + + if (!isActive || protocolBalance == null || amount == null) return null + + val notDepositedAmount = amount.minus(protocolBalance) + return if (notDepositedAmount > BigDecimal.ZERO) { + CryptoCurrencyWarning.YieldSupplyNotDepositedAmount( + currency = cryptoCurrencyStatus.currency, + amount = notDepositedAmount, + currencySymbol = cryptoCurrencyStatus.currency.symbol, + ) + } else { + null + } + } + private fun BigDecimal?.isZero(): Boolean { return this?.signum() == 0 } diff --git a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/repository/CurrencyChecksRepository.kt b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/repository/CurrencyChecksRepository.kt index 8351958b10..46307255e9 100644 --- a/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/repository/CurrencyChecksRepository.kt +++ b/domain/tokens/src/main/kotlin/com/tangem/domain/tokens/repository/CurrencyChecksRepository.kt @@ -61,4 +61,11 @@ interface CurrencyChecksRepository { currencyStatus: CryptoCurrencyStatus, balanceAfterTransaction: BigDecimal, ): CryptoCurrencyWarning.Rent? + + /** + * Returns the YieldSupplied protocol balance in Aave for the given `cryptoCurrency`. + * This represents the amount supplied to the protocol for the specified `userWalletId` + * (e.g., aTokens balance). Returns null if not applicable or unknown. + */ + suspend fun getProtocolBalance(userWalletId: UserWalletId, cryptoCurrency: CryptoCurrency): BigDecimal? } \ No newline at end of file diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/analytics/TokenDetailsNotificationsAnalyticsSender.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/analytics/TokenDetailsNotificationsAnalyticsSender.kt index c02b4801b9..3eba98c4e1 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/analytics/TokenDetailsNotificationsAnalyticsSender.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/analytics/TokenDetailsNotificationsAnalyticsSender.kt @@ -7,6 +7,7 @@ import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.tokens.model.analytics.TokenSwapPromoAnalyticsEvent import com.tangem.feature.tokendetails.presentation.tokendetails.state.TokenDetailsState import com.tangem.feature.tokendetails.presentation.tokendetails.state.components.TokenDetailsNotification +import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics internal class TokenDetailsNotificationsAnalyticsSender( private val cryptoCurrency: CryptoCurrency, @@ -44,6 +45,10 @@ internal class TokenDetailsNotificationsAnalyticsSender( is TokenDetailsNotification.KaspaIncompleteTransactionWarning -> TokenDetailsAnalyticsEvent.Notice.Reveal( currency = cryptoCurrency, ) + is TokenDetailsNotification.YieldSupplyNotTransferedToAave -> YieldSupplyAnalytics.NoticeNotEnoughMinAmount( + token = cryptoCurrency.symbol, + blockchain = cryptoCurrency.network.name, + ) is TokenDetailsNotification.NetworksUnreachable, is TokenDetailsNotification.ExistentialDeposit, is TokenDetailsNotification.NetworksNoAccount, diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsNotification.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsNotification.kt index 35937498ee..97ce580d0d 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsNotification.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/components/TokenDetailsNotification.kt @@ -6,6 +6,7 @@ import com.tangem.core.ui.components.notifications.NotificationConfig import com.tangem.core.ui.extensions.TextReference import com.tangem.core.ui.extensions.networkIconResId import com.tangem.core.ui.extensions.resourceReference +import com.tangem.core.ui.extensions.stringReference import com.tangem.core.ui.extensions.wrappedList import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.wallet.UserWallet @@ -257,4 +258,12 @@ internal sealed class TokenDetailsNotification(val config: NotificationConfig) { iconResId = R.drawable.ic_error_sync_24, ), ) + + data class YieldSupplyNotTransferedToAave(val tokenName: String, val amount: String) : Warning( + title = resourceReference( + id = R.string.yield_module_amount_not_transfered_to_aave_title, + wrappedList(amount, tokenName), + ), + subtitle = stringReference(""), + ) } \ No newline at end of file diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsNotificationConverter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsNotificationConverter.kt index a192ef46d0..c5081a966c 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsNotificationConverter.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsNotificationConverter.kt @@ -24,6 +24,7 @@ import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.toImmutableList import timber.log.Timber import java.math.BigDecimal +import kotlin.String internal class TokenDetailsNotificationConverter( private val userWalletId: UserWalletId, @@ -155,6 +156,10 @@ internal class TokenDetailsNotificationConverter( ) is CryptoCurrencyWarning.MigrationMaticToPol -> MigrationMaticToPol is CryptoCurrencyWarning.UsedOutdatedDataWarning -> UsedOutdatedData + is CryptoCurrencyWarning.YieldSupplyNotDepositedAmount -> YieldSupplyNotTransferedToAave( + tokenName = warning.currencySymbol, + amount = warning.amount.format { crypto(symbol = "", decimals = warning.currency.decimals) }, + ) } } diff --git a/features/yield-supply/api/src/main/java/com/tangem/features/yield/supply/api/YieldSupplyPromoComponent.kt b/features/yield-supply/api/src/main/java/com/tangem/features/yield/supply/api/YieldSupplyPromoComponent.kt index 0516efb037..0b98f700df 100644 --- a/features/yield-supply/api/src/main/java/com/tangem/features/yield/supply/api/YieldSupplyPromoComponent.kt +++ b/features/yield-supply/api/src/main/java/com/tangem/features/yield/supply/api/YieldSupplyPromoComponent.kt @@ -10,6 +10,7 @@ interface YieldSupplyPromoComponent : ComposableContentComponent { data class Params( val userWalletId: UserWalletId, val currency: CryptoCurrency, + val apy: String, ) interface Factory : ComponentFactory diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/entity/YieldSupplyUM.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/entity/YieldSupplyUM.kt index 30008334c4..112b1dbb24 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/entity/YieldSupplyUM.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/entity/YieldSupplyUM.kt @@ -9,6 +9,7 @@ internal sealed class YieldSupplyUM { data object Initial : YieldSupplyUM() data class Available( + val apy: String, val title: TextReference, val onClick: () -> Unit, ) : YieldSupplyUM() @@ -18,6 +19,7 @@ internal sealed class YieldSupplyUM { data object Unavailable : YieldSupplyUM() data class Content( + val apy: String, val title: TextReference, val subtitle: TextReference, val rewardsApy: TextReference, 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 0895525f5e..8b1e2a09d7 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 @@ -144,10 +144,17 @@ internal class YieldSupplyModel @Inject constructor( } override fun onStartEarningClick() { + val yieldSupplyUM = uiState.value + val apy = when (yieldSupplyUM) { + is YieldSupplyUM.Available -> yieldSupplyUM.apy + is YieldSupplyUM.Content -> yieldSupplyUM.apy + else -> "" + } appRouter.push( YieldSupplyPromo( userWalletId = params.userWalletId, cryptoCurrency = params.cryptoCurrency, + apy = apy, ), ) } @@ -218,6 +225,7 @@ internal class YieldSupplyModel @Inject constructor( ), onClick = ::onActiveClick, isAllowedToSpend = yieldSupplyStatus.isAllowedToSpend, + apy = tokenStatus.apy.toString(), ) } }.onLeft { diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/transformers/YieldSupplyTokenStatusSuccessTransformer.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/transformers/YieldSupplyTokenStatusSuccessTransformer.kt index 4fed5db894..338012ba0e 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/transformers/YieldSupplyTokenStatusSuccessTransformer.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/main/model/transformers/YieldSupplyTokenStatusSuccessTransformer.kt @@ -21,6 +21,7 @@ internal class YieldSupplyTokenStatusSuccessTransformer( formatArgs = wrappedList(tokenStatus.apy), ), onClick = onStartEarningClick, + apy = tokenStatus.apy.toString(), ) } } \ No newline at end of file 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 b596d93729..49ea1ef511 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 @@ -308,6 +308,7 @@ private class PreviewProvider : PreviewParameterProvider { R.string.yield_module_token_details_earn_notification_title, wrappedList("5.1"), ), + apy = "5.1", onClick = {}, ), YieldSupplyUM.Content( @@ -315,6 +316,7 @@ private class PreviewProvider : PreviewParameterProvider { subtitle = stringReference("Interest accrues automatically"), rewardsApy = stringReference("5.1 % APY"), onClick = {}, + apy = "5.1", isAllowedToSpend = false, ), YieldSupplyUM.Content( @@ -322,6 +324,7 @@ private class PreviewProvider : PreviewParameterProvider { subtitle = stringReference("Interest accrues automatically"), rewardsApy = stringReference("5.1 % APY"), onClick = {}, + apy = "5.1", isAllowedToSpend = true, ), YieldSupplyUM.Loading, diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt index 51eefdad41..fca29d33ea 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/entity/YieldSupplyPromoUM.kt @@ -6,4 +6,5 @@ data class YieldSupplyPromoUM( val tosLink: String, val policyLink: String, val title: TextReference, + val subtitle: TextReference, ) \ No newline at end of file diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt index 4a3d0411df..812323df89 100644 --- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt +++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/promo/model/YieldSupplyPromoModel.kt @@ -33,7 +33,11 @@ internal class YieldSupplyPromoModel @Inject constructor( val uiState: YieldSupplyPromoUM = YieldSupplyPromoUM( tosLink = "https://tangem.com/terms-of-service/", // TODO replace with real link policyLink = "https://tangem.com/privacy-policy/", // TODO replace with real link - title = resourceReference(R.string.yield_module_promo_screen_title, wrappedList("5.3")), + title = resourceReference(R.string.yield_module_promo_screen_title), + subtitle = resourceReference( + R.string.yield_module_promo_screen_variable_rate_info, + wrappedList(params.apy), + ), ) init { 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 5839f6fb28..e036e90dd0 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 @@ -73,7 +73,7 @@ internal fun YieldSupplyPromoContent( SpacerH8() Label( state = LabelUM( - text = resourceReference(R.string.yield_module_promo_screen_variable_rate_info), + text = yieldSupplyPromoUM.subtitle, style = LabelStyle.REGULAR, icon = R.drawable.ic_information_24, onIconClick = clickIntents::onApyInfoClick, @@ -223,7 +223,8 @@ private fun YieldSupplyPromoContent_Preview() { yieldSupplyPromoUM = YieldSupplyPromoUM( tosLink = "https://tangem.com/terms-of-service/", policyLink = "https://tangem.com/privacy-policy/", - title = resourceReference(R.string.yield_module_promo_screen_title, wrappedList("5.3")), + title = resourceReference(R.string.yield_module_promo_screen_title), + subtitle = resourceReference(R.string.yield_module_promo_screen_variable_rate_info, wrappedList("5.3")), ), clickIntents = object : YieldSupplyPromoClickIntents { override fun onBackClick() {}