diff --git a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationUM.kt b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationUM.kt
index 8c2f75bb85..66b28de458 100644
--- a/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationUM.kt
+++ b/common/ui/src/main/java/com/tangem/common/ui/notifications/NotificationUM.kt
@@ -274,6 +274,14 @@ sealed class NotificationUM(val config: NotificationConfig) {
title = resourceReference(id = R.string.yield_module_balance_info_sheet_title, wrappedList(tokenName)),
subtitle = resourceReference(id = R.string.yield_module_balance_info_sheet_subtitle),
)
+
+ data class YieldSupplyNotAllAmountSupplied(val formattedAmount: String, val symbol: String) : Warning(
+ title = resourceReference(
+ id = R.string.yield_module_amount_not_transfered_to_aave_title,
+ formatArgs = wrappedList(formattedAmount, symbol),
+ ),
+ subtitle = TextReference.EMPTY,
+ )
}
open class Info(
diff --git a/common/ui/src/main/java/com/tangem/common/ui/tokens/TokenItemStateConverter.kt b/common/ui/src/main/java/com/tangem/common/ui/tokens/TokenItemStateConverter.kt
index 0c5042c6d8..17aa2184d7 100644
--- a/common/ui/src/main/java/com/tangem/common/ui/tokens/TokenItemStateConverter.kt
+++ b/common/ui/src/main/java/com/tangem/common/ui/tokens/TokenItemStateConverter.kt
@@ -20,7 +20,6 @@ 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.yieldSupplyKey
-import com.tangem.domain.models.currency.yieldSupplyNotAllAmountSupplied
import com.tangem.domain.models.staking.YieldBalance
import com.tangem.domain.staking.utils.getTotalWithRewardsStakingBalance
import com.tangem.utils.StringsSigns.DASH_SIGN
@@ -271,8 +270,7 @@ class TokenItemStateConverter(
isFlickering = status.value.isFlickering(),
icons = buildList {
if (status.value.yieldSupplyStatus?.isActive == true &&
- status.value.yieldSupplyStatus?.isAllowedToSpend == false ||
- status.yieldSupplyNotAllAmountSupplied()
+ status.value.yieldSupplyStatus?.isAllowedToSpend == false
) {
TokenItemState.FiatAmountState.Content.IconUM(
iconRes = R.drawable.ic_alert_triangle_20,
diff --git a/core/res/src/main/res/values-de/strings.xml b/core/res/src/main/res/values-de/strings.xml
index c5d3a6d70e..ee000bb82f 100644
--- a/core/res/src/main/res/values-de/strings.xml
+++ b/core/res/src/main/res/values-de/strings.xml
@@ -1679,6 +1679,7 @@
Der erhaltene Betrag %1$s %2$s wurde nicht auf Aave eingezahlt.
Aktuelle Gebühr
Maximale Gebühr
+ Dies ist die niedrigste Einzahlung, die an Aave gesendet werden kann. Um Einzahlungen rentabel zu halten, verarbeiten wir sie nicht, wenn die Netzwerkgebühren 4 % des Betrags übersteigen.
Gebührenpolitik
Die Netzwerkgebühr ist derzeit zu hoch. Warte, bis sie unter Dein Limit fällt.
Historische Renditen
diff --git a/core/res/src/main/res/values-ja/strings.xml b/core/res/src/main/res/values-ja/strings.xml
index 16107ea2c1..c1f18f6577 100644
--- a/core/res/src/main/res/values-ja/strings.xml
+++ b/core/res/src/main/res/values-ja/strings.xml
@@ -30,6 +30,7 @@
このアカウントをアーカイブしますが、いつでも復元できます。
アカウント
アカウントが保存されました
+ 報酬用のアカウント
アカウント番号%s — アドレス導出に使用されます。
アカウントを追加
保存
@@ -969,6 +970,10 @@
このカードを使用して、現在のウォレットの他のカードのアクセスコードを回復させられないことを認識しています。
工場出荷時設定にリセットすると、選択したカードやリングからウォレットが完全に削除されます。現在のウォレットを復元したり、カードやリングを使用してアクセスコードを復元することはできません。
工場出荷時の状態にリセットすると、選択したカードやリングからウォレットが完全に削除され、アプリから削除されます。現在のウォレットを復元することはできません。
+ すべてのTangemデバイスがリセットされました。
+ アクティベーション処理中に問題が発生しました。カードを1枚ずつリセットしてください。
+ カード認証に失敗しました
+ 続行するには次のデバイスをリセットしてください
Tangem Ringユーザーは、11/15日までChangelly経由でスワップを3回手数料ゼロで行えます!
今すぐ手数料0% でスワップしましょう!
アプリにログインして、カードまたはリングをスキャンせずに残高を確認できます
@@ -1728,8 +1733,8 @@
いいえ、すべて送信します
%s XTZを減らす
次回ウォレットにチャージするときに手数料の増加を避けるには、金額を%s XTZ減らしてください。
- 資産残高に関するテキスト [プレースホルダー]
%sはAaveに預けられています
+ 受け取った金額%1$s %2$sはAaveに入金されませんでした。
承認する
前回の承認に問題があったため、新しい承認が必要です。手続き方法を選択してください。
承認が必要
@@ -1743,6 +1748,8 @@
年利%1$s%%
利用可能
現在のAPY
+ 貸付のためにチャージする際は、ネットワーク手数料が金額から差し引かれます(手数料は常に%1$s以下です)。
+ 現在、ネットワーク手数料が高すぎるため貸付を実行できません。手数料が%1$s以下に下がり次第、資金が供給されます。
私の資金
あなたの%1$sはAaveに預けられ、利息が付きます。あなたは%2$sトークンを保有しており、これは残高を表し、時間の経過とともに増加します。入金すると、資金はAaveに預け入れられ、取引手数料を差し引いた利息が付きます。
利回りを得る
@@ -1758,7 +1765,7 @@
最低入金額
手数料ポリシー
Tangemはまた、得られた利回りに対して3%のサービス手数料を差し引きます。
- ネットワーク手数料が現在高すぎます。設定した上限を下回るまで待機しています。
+ ネットワーク手数料が下がるか、残高が必要な最低額に達すると、自動的にAaveへ送金されます。
過去のリターン
ここに説明を入力してください。1〜3行が理想的です。[プレースホルダー]
トークン承認が必要
@@ -1787,14 +1794,14 @@
次回以降の入金は自動的にAaveに供給されます。
アクティブ
停止中
- 収益を停止する
+ 利回りモードを無効にする
オフにすると、Aaveから資金が引き出され、ウォレットの%sに戻され、報酬の獲得が停止されます。
出金金額からネットワーク手数料が差し引かれます。
供給APY
APY
- あなたの資産を眠らせない — 残高を運用して利息を得ましょう。
+ 自分で管理しながら、資金をバックグラウンドで運用しましょう。
利息は自動的に発生します
- Aaveの利回り
+ 利回りモード
入金の処理中
残高を活用
自動
diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml
index 168ba8b435..9b73434b2d 100644
--- a/core/res/src/main/res/values-ru/strings.xml
+++ b/core/res/src/main/res/values-ru/strings.xml
@@ -1569,6 +1569,7 @@
Нет, отправить все
Уменьшить на %s XTZ
Чтобы не платить повышенную комиссию при следующем пополнении кошелька, уменьшите сумму на %s XTZ
+ Ваши средства сейчас размещены в протоколе AAVE, но вы можете управлять ими в любое время.
Ваш %s внесён в Aave
Выдать разрешение
Что-то пошло не так с вашим предыдущим разрешением, поэтому требуется новое. Выберите, как хотите продолжить.
@@ -1592,7 +1593,7 @@
Все следующие пополнения %s автоматически поступят в Aave с удержанием комиссии за транзакцию.
Если комиссия сети превысит максимальный лимит, транзакция не будет выполнена до тех пор, пока комиссия не снизится. Вы сможете изменить этот лимит позже.
Максимальная комиссия
- Комиссия за транзакцию должна быть ниже 4% от суммы депозита. Tangem переведёт средства в Aave, как только это условие будет выполнено.
+ Это минимальный депозит, который можно отправить в Aave. Чтобы депозиты оставались прибыльными, мы не обрабатываем их, когда комиссия сети превышает 4% от суммы.
Минимальный депозит
Политика комиссий
Tangem взимает комиссию за обслуживание в размере 3% от полученного дохода.
@@ -1602,7 +1603,7 @@
Проверьте ваше интернет соединение
Информация о комиссии недоступна
Каждое пополнение вашего адреса автоматически будет отправляться в Aave.
- Ваш баланс работает автоматически
+ Автоперевод в AAVE
Отправляйте, обменивайте или продавайте свои средства мгновенно, когда захотите.
Мгновенный вывод средств
Как это работает?
diff --git a/core/res/src/main/res/values-uk-rUA/strings.xml b/core/res/src/main/res/values-uk-rUA/strings.xml
index 4e66cabc58..b13f5ecb1d 100644
--- a/core/res/src/main/res/values-uk-rUA/strings.xml
+++ b/core/res/src/main/res/values-uk-rUA/strings.xml
@@ -1430,4 +1430,5 @@
Ні, відправити все
Зменшити на %s XTZ
Щоб не платити підвищену комісію при наступному поповненні гаманця, зменште суму на %s XTZ
+ Це найменший депозит, який можна надіслати в Aave. Щоб депозити залишалися прибутковими, ми не обробляємо їх, коли комісія мережі перевищує 4% від суми.
diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml
index fa0fd9a2ea..e77d811c07 100644
--- a/core/res/src/main/res/values/strings.xml
+++ b/core/res/src/main/res/values/strings.xml
@@ -23,6 +23,8 @@
Can\'t recover account
Archived
We couldn’t archive account. Please try again later.
+ This account participates in the referral program.
+ This account cannot be archived.
We couldn’t create account. Please try again later.
Account created
Archive account
@@ -555,6 +557,7 @@
Other methods
Physical devices that securely store your private key offline.
Recovery phrase
+ To upgrade your wallet to hardware, back it up first.
Your private keys are securely encrypted and stored on your phone
Keys are stored in the app
Create or restore your wallet using a recovery phrase — your built-in backup.
@@ -993,7 +996,7 @@
Factory Reset will completely delete the wallet from the selected card or ring. You will not be able to restore the current wallet or use the card or ring to recover the access code.
Factory Reset will completely delete the wallet from the selected card or ring and remove it from the app. You will not be able to restore the current wallet.
All Tangem devices have been reset.
- Something went wrong with activation process. Please reset cards one by one.
+ Something went wrong with the activation process. Please reset the cards one by one.
Card verification failed
Please reset the next device to continue
Ring owners get 3 commission-free swaps on Changelly until 15.11!
@@ -1326,6 +1329,8 @@
This fee goes to cover the cost of handling your transfer.
Withdrawal
Change PIN
+ The card is fully ready for payments.
+ PIN code created
Failed to load data. Try again later.
Freeze Card
Hide
@@ -1805,9 +1810,9 @@
No, send all
Reduce by %s XTZ
To avoid paying an increased commission the next time you top up your wallet, reduce the amount by %s XTZ
- Text about your money in balance [PLACEHOLDER]
- Your %s is deposited in Aave
- The amount received, %1$s %2$s was not deposited to Aave.
+ Your funds are currently supplied to the Aave protocol, but you can manage them at any time.
+ Your %s is supplied to Aave
+ Supplying %1$s %2$s to Aave is pending
Give Approve
Something went wrong with your previous approval, so we need a new one. Choose how you’d like to proceed.
Approve needed
@@ -1817,66 +1822,66 @@
Text about your money in balance [PLACEHOLDER]
Your %s is deposited in Aave
Unable to load chart...
- The amount received, %1$s %2$s was not deposited to Aave.
+ The amount received, %1$s %2$s was not supplied to Aave.
APY %1$s%%
Available
Current APY
- When topping up for lending, a network fee will be deducted from the amount — never more than %1$s
+ When topping up for lending, a network fee not exceeding %1$s will be deducted from the balance.
The network fee is currently too high to execute lending. Funds will be supplied once it drops to %1$s or below.
My funds
- Your %1$s is now deposited in Aave and earning interest. You hold a%2$s token, which represents your balance and grows over time. When you top up, funds go to Aave to earn interest, minus a transaction fee.
+ Your %1$s is now deposited in Aave and earning interest. You hold a%2$s token, which represents your balance and grows over time. When you deposit more funds, they\'ll be supplied to Aave to earn interest, minus a transaction fee.
Earn
Total earnings
Transfers to Aave
Explore Aave
- This is the current supply fee on %s. The live cost will be shown on the Receive Screen.
+ This is the current supply fee on %s. The actual cost will be shown on the activation tab.
Current fee
- All future %s top-ups will be supplied to Aave automatically, with the transaction fee deducted.
+ All future %s deposits will be supplied to Aave automatically, with the transaction fee deducted.
If network fees rise above maximum fee, the transaction won’t go through until they decrease. You can change this limit later.
Maximum fee
- The transaction fee must stay below 4% of your deposit. Tangem will transfer funds to Aave only once your balance is large enough to meet this condition.
- Minimal top-up
+ This is the lowest amount that can be supplied to Aave. To keep the yield mode profitable, we won’t supply assets when network fees exceed 4% of the amount.
+ Minimal deposit
Fee policy
- Tangem also takes a 3% service fee on the yield earned.
- Your funds will be automatically transferred to Aave once network fees are lower or your balance meets the minimum required amount.
+ Tangem also takes a 3% service fee on yield earned.
+ Your funds will be automatically supplied to Aave once network fees are lower or your balance meets the minimum required amount.
Historical returns
Write description here. In one, two or three lines will be awesome. [PLACEHOLDER]
- Some token approve needed
+ Token approvals needed
Check your network connection
Network fee info unreachable
- Every top-up of your account will be lended to Aave automatically.
- Your balance works automatically
+ Every deposit you make will be suplied to Aave automatically.
+ Auto-Transfer to Aave
Send, swap, or sell your funds instantly, anytime you want.
- Access to funds at any time
+ Access your funds anytime
How it works?
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
+ By using this service, you agree with provider\n%1$s and %2$s
Connect Aave
Aave %1$s%% • Variable Interest Rate
Aave
Avg %s
- Last year returns
- Current interest rate is always variable and automatically computed by AAVE on-chain smart-contract based on real-time supply and demand.
+ Last year\'s returns
+ Current interest rate is always variable and automatically computed by the Aave on-chain smart-contract, based on real-time supply and demand.
Powered by
Interest rate is variable
- When you top up, your funds will be automatically sent to Aave to start earning interest. A small fee equal to %s will be deducted to cover the transaction.
+ When you top up, your funds will be automatically sent to Aave to start earning interest. %s will be deducted to cover the transaction fee.
Supply assets
- Your %s will be supplied to Aave and will stay instantly available
+ Your %s will be supplied to Aave, but will remain manageable.
See fee policy
- Your next top-ups will be automatically supplied to Aave.
+ Your next deposits will be automatically supplied to Aave.
Active
Paused
Disable yield mode
- Turning off will withdraw your funds from Aave, return them to %s in your wallet, and stop earning rewards.
+ Turning this off will withdraw your funds from Aave to %s in your wallet and it will stop earning rewards.
The network fee will be deducted from the amount you withdraw.
Supply APY
APY
- Let your funds work in the background while you stay in control.
+ Let your funds do the work while you stay in control.
Interest accrues automatically
Yield mode
Processing your deposit
- Make your balance work for you
+ Make your assets work for you
Automatic
Deposit some %1$s %2$s to cover the network fee for transactions
Unable to cover %s fee
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 48ac28966a..0d179fc31e 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
@@ -2,7 +2,6 @@ package com.tangem.data.tokens.repository
import com.tangem.blockchain.blockchains.polkadot.ExistentialDepositProvider
import com.tangem.blockchain.common.*
-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
@@ -19,7 +18,6 @@ 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(
@@ -168,27 +166,4 @@ internal class DefaultCurrencyChecksRepository(
else -> null
}
}
-
- override suspend fun getProtocolBalance(
- userWalletId: UserWalletId,
- cryptoCurrencyStatus: CryptoCurrencyStatus,
- ): BigDecimal? {
- val token = cryptoCurrencyStatus.currency as? CryptoCurrency.Token ?: return null
- val isActive = cryptoCurrencyStatus.value.yieldSupplyStatus?.isActive ?: false
- if (!isActive) return null
- return runCatching {
- val walletManager = walletManagersFacade.getOrCreateWalletManager(
- userWalletId = userWalletId,
- blockchain = token.network.toBlockchain(),
- derivationPath = token.network.derivationPath.value,
- ) ?: error("Wallet manager not found")
- walletManager.getEffectiveProtocolBalance(
- token = Token(
- symbol = token.symbol,
- contractAddress = token.contractAddress,
- decimals = token.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 cb4b78542e..9edbf243da 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
@@ -73,10 +73,4 @@ 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 d491aff2a6..d4611e9d40 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,8 +51,7 @@ class GetCurrencyWarningsUseCase(
flowOf(currencyChecksRepository.getRentInfoWarning(userWalletId, currencyStatus)),
flowOf(currencyChecksRepository.getExistentialDeposit(userWalletId, currency.network)),
flowOf(currencyChecksRepository.getFeeResourceAmount(userWalletId, currency.network)),
- flowOf(currencyChecksRepository.getProtocolBalance(userWalletId, currencyStatus)),
- ) { coinRelatedWarnings, maybeRentWarning, maybeEdWarning, maybeFeeResource, yieldSupplyProtocolBalance ->
+ ) { coinRelatedWarnings, maybeRentWarning, maybeEdWarning, maybeFeeResource ->
setOfNotNull(
maybeRentWarning,
maybeEdWarning?.let { getExistentialDepositWarning(currency, it) },
@@ -63,7 +62,6 @@ class GetCurrencyWarningsUseCase(
getBeaconChainShutdownWarning(rawId = currency.network.id.rawId),
getAssetRequirementsWarning(userWalletId = userWalletId, currency = currency),
getMigrationFromMaticToPolWarning(currency),
- getYieldSupplyWarning(cryptoCurrencyStatus = currencyStatus, yieldSupplyProtocolBalance),
)
}.flowOn(dispatchers.io)
}
@@ -263,28 +261,6 @@ 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 d1b4b99d81..8351958b10 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,11 +61,4 @@ 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, cryptoCurrencyStatus: CryptoCurrencyStatus): BigDecimal?
}
\ No newline at end of file
diff --git a/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/usecase/YieldSupplyGetMaxFeeUseCase.kt b/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/usecase/YieldSupplyGetMaxFeeUseCase.kt
index e463368cd3..3c8c7aa671 100644
--- a/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/usecase/YieldSupplyGetMaxFeeUseCase.kt
+++ b/domain/yield-supply/src/main/java/com/tangem/domain/yield/supply/usecase/YieldSupplyGetMaxFeeUseCase.kt
@@ -4,6 +4,7 @@ import arrow.core.Either
import arrow.core.Either.Companion.catch
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.currency.CryptoCurrencyStatus
+import com.tangem.domain.models.currency.yieldSupplyKey
import com.tangem.domain.models.quote.QuoteStatus
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.quotes.QuotesRepository
@@ -51,7 +52,9 @@ class YieldSupplyGetMaxFeeUseCase(
?: error("Native fiat rate is missing")
require(nativeFiatRate > BigDecimal.ZERO) { "Native fiat rate must be > 0" }
- val marketToken = yieldSupplyRepository.getTokenStatus(token)
+ val cachedMarketToken = yieldSupplyRepository.getCachedMarkets().orEmpty()
+ .firstOrNull { it.yieldSupplyKey == token.yieldSupplyKey() }
+ val marketToken = cachedMarketToken ?: yieldSupplyRepository.getTokenStatus(token)
val maxFeeNative = marketToken.maxFeeNative.toBigDecimal()
val rateRatio = nativeFiatRate.divide(
diff --git a/features/token-recieve/impl/src/main/java/com/tangem/features/tokenreceive/entity/TokenReceiveStateFactory.kt b/features/token-recieve/impl/src/main/java/com/tangem/features/tokenreceive/entity/TokenReceiveStateFactory.kt
index 2d014adf53..ee3dd1a028 100644
--- a/features/token-recieve/impl/src/main/java/com/tangem/features/tokenreceive/entity/TokenReceiveStateFactory.kt
+++ b/features/token-recieve/impl/src/main/java/com/tangem/features/tokenreceive/entity/TokenReceiveStateFactory.kt
@@ -19,7 +19,6 @@ import com.tangem.features.tokenreceive.entity.ReceiveAddress.Type.Ens
import com.tangem.features.tokenreceive.entity.ReceiveAddress.Type.Primary
import com.tangem.features.tokenreceive.ui.state.TokenReceiveUM
import com.tangem.utils.Provider
-import com.tangem.utils.extensions.addIf
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
import kotlinx.collections.immutable.toPersistentList
@@ -138,12 +137,7 @@ internal class TokenReceiveStateFactory(
tokenName: String,
tokenReceiveNotification: List,
): List {
- val yieldSupplyNotification: TokenReceiveNotification? =
- tokenReceiveNotification.firstOrNull { it.isYieldSupplyNotification }
return buildList {
- addIf(yieldSupplyNotification != null) {
- NotificationUM.Warning.YieldSupplyIsActive(tokenName)
- }
add(
NotificationUM.Info(
title = resourceReference(
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 c5081a966c..dfb37410b9 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
@@ -156,10 +156,6 @@ 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/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 112b1dbb24..2d7419ea4b 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
@@ -24,7 +24,7 @@ internal sealed class YieldSupplyUM {
val subtitle: TextReference,
val rewardsApy: TextReference,
val onClick: () -> Unit,
- val isAllowedToSpend: Boolean,
+ val showWarningIcon: Boolean,
) : YieldSupplyUM()
@Immutable
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 5d1d974638..70ab6a6a95 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
@@ -15,6 +15,7 @@ import com.tangem.core.ui.extensions.stringReference
import com.tangem.domain.balancehiding.GetBalanceHidingSettingsUseCase
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.network.TxInfo
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.yield.supply.YieldSupplyStatus
@@ -238,28 +239,29 @@ internal class YieldSupplyModel @Inject constructor(
}
}
yieldSupplyStatus?.isActive == true -> {
- val cryptoCurrencyToken = cryptoCurrency as? CryptoCurrency.Token ?: return
- if (!yieldSupplyStatus.isAllowedToSpend) {
- analyticsEventsHandler.send(
- YieldSupplyAnalytics.NoticeApproveNeeded(
- token = cryptoCurrency.symbol,
- blockchain = cryptoCurrency.network.name,
- ),
- )
- }
loadActiveState(
- cryptoCurrencyToken = cryptoCurrencyToken,
+ cryptoCurrencyStatus = cryptoCurrencyStatus,
yieldSupplyStatus = yieldSupplyStatus,
)
}
-
else -> {
loadTokenStatus()
}
}
}
- private fun loadActiveState(cryptoCurrencyToken: CryptoCurrency.Token, yieldSupplyStatus: YieldSupplyStatus) {
+ private fun loadActiveState(cryptoCurrencyStatus: CryptoCurrencyStatus, yieldSupplyStatus: YieldSupplyStatus) {
+ val cryptoCurrencyToken = cryptoCurrency as? CryptoCurrency.Token ?: return
+ val showWarningIcon = !yieldSupplyStatus.isAllowedToSpend ||
+ cryptoCurrencyStatus.yieldSupplyNotAllAmountSupplied()
+ if (!yieldSupplyStatus.isAllowedToSpend) {
+ analyticsEventsHandler.send(
+ YieldSupplyAnalytics.NoticeApproveNeeded(
+ token = cryptoCurrency.symbol,
+ blockchain = cryptoCurrency.network.name,
+ ),
+ )
+ }
modelScope.launch(dispatchers.default) {
yieldSupplyGetTokenStatusUseCase(cryptoCurrencyToken)
.onRight { tokenStatus ->
@@ -278,7 +280,7 @@ internal class YieldSupplyModel @Inject constructor(
stringReference(" ${tokenStatus.apy}%"),
),
onClick = ::onActiveClick,
- isAllowedToSpend = yieldSupplyStatus.isAllowedToSpend,
+ showWarningIcon = showWarningIcon,
apy = tokenStatus.apy.toString(),
)
}
@@ -294,7 +296,7 @@ internal class YieldSupplyModel @Inject constructor(
),
rewardsApy = TextReference.EMPTY,
onClick = ::onActiveClick,
- isAllowedToSpend = yieldSupplyStatus.isAllowedToSpend,
+ showWarningIcon = showWarningIcon,
apy = "",
)
}
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 49ea1ef511..913def042b 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
@@ -132,7 +132,7 @@ private fun SupplyContent(supplyUM: YieldSupplyUM.Content) {
)
}
SpacerW8()
- AnimatedVisibility(supplyUM.isAllowedToSpend.not()) {
+ AnimatedVisibility(supplyUM.showWarningIcon) {
Icon(
imageVector = ImageVector.vectorResource(R.drawable.ic_alert_triangle_20),
contentDescription = null,
@@ -317,7 +317,7 @@ private class PreviewProvider : PreviewParameterProvider {
rewardsApy = stringReference("5.1 % APY"),
onClick = {},
apy = "5.1",
- isAllowedToSpend = false,
+ showWarningIcon = false,
),
YieldSupplyUM.Content(
title = stringReference("Aave lending is active"),
@@ -325,7 +325,7 @@ private class PreviewProvider : PreviewParameterProvider {
rewardsApy = stringReference("5.1 % APY"),
onClick = {},
apy = "5.1",
- isAllowedToSpend = true,
+ showWarningIcon = true,
),
YieldSupplyUM.Loading,
YieldSupplyUM.Processing.Enter,
diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt
index db0f137890..0dccc9df82 100644
--- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt
+++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/YieldSupplyActiveComponent.kt
@@ -50,6 +50,7 @@ internal class YieldSupplyActiveComponent(
state = state,
isBalanceHidden = isBalanceHidden,
chartComponent = chartComponent,
+ onReadMoreClick = params.callback::onReadMoreClick,
modifier = Modifier,
)
}
@@ -76,5 +77,6 @@ internal class YieldSupplyActiveComponent(
fun onBackClick()
fun onStopEarning()
fun onApprove()
+ fun onReadMoreClick()
}
}
\ No newline at end of file
diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/entity/YieldSupplyActiveContentUM.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/entity/YieldSupplyActiveContentUM.kt
index 9b93df6c2a..2e7b5c14dc 100644
--- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/entity/YieldSupplyActiveContentUM.kt
+++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/entity/YieldSupplyActiveContentUM.kt
@@ -2,6 +2,7 @@ package com.tangem.features.yield.supply.impl.subcomponents.active.entity
import com.tangem.common.ui.notifications.NotificationUM
import com.tangem.core.ui.extensions.TextReference
+import kotlinx.collections.immutable.ImmutableList
internal data class YieldSupplyActiveContentUM(
val totalEarnings: TextReference,
@@ -9,7 +10,7 @@ internal data class YieldSupplyActiveContentUM(
val providerTitle: TextReference,
val subtitle: TextReference,
val subtitleLink: TextReference,
- val notificationUM: NotificationUM?,
+ val notifications: ImmutableList,
val minAmount: TextReference?,
val currentFee: TextReference?,
val feeDescription: TextReference?,
diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt
index 1d60926512..02fc956678 100644
--- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt
+++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/model/YieldSupplyActiveEntryModel.kt
@@ -4,10 +4,12 @@ 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.decompose.navigation.Router
+import com.tangem.core.navigation.url.UrlOpener
import com.tangem.features.yield.supply.impl.subcomponents.active.YieldSupplyActiveComponent
import com.tangem.features.yield.supply.impl.subcomponents.active.YieldSupplyActiveEntryComponent
import com.tangem.features.yield.supply.impl.subcomponents.approve.YieldSupplyApproveComponent
import com.tangem.features.yield.supply.impl.subcomponents.stopearning.YieldSupplyStopEarningComponent
+import com.tangem.utils.TangemBlogUrlBuilder
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import javax.inject.Inject
@@ -16,6 +18,7 @@ internal class YieldSupplyActiveEntryModel @Inject constructor(
override val dispatchers: CoroutineDispatcherProvider,
paramsContainer: ParamsContainer,
private val router: Router,
+ private val urlOpener: UrlOpener,
) : Model(), YieldSupplyActiveComponent.ModelCallback,
YieldSupplyStopEarningComponent.ModelCallback,
YieldSupplyApproveComponent.ModelCallback {
@@ -37,4 +40,8 @@ internal class YieldSupplyActiveEntryModel @Inject constructor(
override fun onApprove() {
router.push(YieldSupplyActiveRoute.Approve)
}
+
+ override fun onReadMoreClick() {
+ urlOpener.openUrl(TangemBlogUrlBuilder.YIELD_SUPPLY_HOW_IT_WORKS_URL)
+ }
}
\ No newline at end of file
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 a74719003c..42617b38f5 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
@@ -17,6 +17,7 @@ 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
@@ -29,9 +30,13 @@ import com.tangem.features.yield.supply.impl.subcomponents.active.YieldSupplyAct
import com.tangem.features.yield.supply.impl.subcomponents.active.entity.YieldSupplyActiveContentUM
import com.tangem.utils.StringsSigns.DASH_SIGN
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
+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")
@@ -65,7 +70,7 @@ internal class YieldSupplyActiveModel @Inject constructor(
formatArgs = wrappedList(cryptoCurrency.symbol, cryptoCurrency.symbol),
),
subtitleLink = resourceReference(R.string.common_read_more),
- notificationUM = null,
+ notifications = persistentListOf(),
minAmount = null,
currentFee = null,
feeDescription = null,
@@ -108,27 +113,13 @@ internal class YieldSupplyActiveModel @Inject constructor(
cryptoCurrency = cryptoCurrency,
).getOrNull()
- 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
- }
-
loadApy()
loadMinAmount()
loadFees()
uiState.update {
it.copy(
- notificationUM = approvalNotification,
+ notifications = getNotifications(cryptoCurrencyStatus),
availableBalance = stringReference(
protocolBalance.format {
crypto(
@@ -153,11 +144,58 @@ internal class YieldSupplyActiveModel @Inject constructor(
)
}
}.onLeft {
+ uiState.update {
+ it.copy(
+ apy = TextReference.Str(DASH_SIGN),
+ )
+ }
Timber.e("Error loading token status")
}
}
}
+ 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) }
+ NotificationUM.Warning.YieldSupplyNotAllAmountSupplied(
+ formattedAmount = formattedAmount,
+ symbol = cryptoCurrency.symbol,
+ )
+ } else {
+ null
+ }
+ }
+
private fun loadMinAmount() {
modelScope.launch(dispatchers.default) {
yieldSupplyMinAmountUseCase(
diff --git a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt
index 9e2346fe2f..867fdefd59 100644
--- a/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt
+++ b/features/yield-supply/impl/src/main/java/com/tangem/features/yield/supply/impl/subcomponents/active/ui/YieldSupplyActiveContent.kt
@@ -28,17 +28,20 @@ import androidx.compose.ui.unit.dp
import com.tangem.common.ui.notifications.NotificationUM
import com.tangem.core.ui.components.*
import com.tangem.core.ui.components.notifications.Notification
+import com.tangem.core.ui.components.notifications.NotificationConfig
import com.tangem.core.ui.decompose.ComposableContentComponent
import com.tangem.core.ui.extensions.*
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.features.yield.supply.impl.R
import com.tangem.features.yield.supply.impl.subcomponents.active.entity.YieldSupplyActiveContentUM
+import kotlinx.collections.immutable.persistentListOf
@Composable
internal fun YieldSupplyActiveContent(
state: YieldSupplyActiveContentUM,
isBalanceHidden: Boolean,
+ onReadMoreClick: () -> Unit,
chartComponent: ComposableContentComponent,
modifier: Modifier = Modifier,
) {
@@ -61,16 +64,23 @@ internal fun YieldSupplyActiveContent(
chartComponent.Content(Modifier.padding(bottom = 12.dp))
}
- AnimatedVisibility(state.notificationUM != null) {
- val wrappedNotification = remember(this) { requireNotNull(state.notificationUM) }
- Notification(
- config = wrappedNotification.config,
- iconTint = null,
- containerColor = TangemTheme.colors.background.action,
- )
+ AnimatedVisibility(state.notifications.isNotEmpty()) {
+ val notifications = remember(state.notifications) { state.notifications }
+ Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
+ notifications.forEach { notificationUM ->
+ Notification(
+ config = notificationUM.config,
+ containerColor = TangemTheme.colors.background.action,
+ )
+ }
+ }
}
- YieldSupplyActiveMyFunds(state = state, isBalanceHidden = isBalanceHidden)
+ YieldSupplyActiveMyFunds(
+ state = state,
+ isBalanceHidden = isBalanceHidden,
+ onReadMoreClick = onReadMoreClick,
+ )
AnimatedVisibility(state.feeDescription != null) {
Text(
@@ -108,7 +118,7 @@ private fun CurrentApy(apy: TextReference?, modifier: Modifier = Modifier) {
TextShimmer(
modifier = modifier.width(94.dp),
text = "",
- style = TangemTheme.typography.head,
+ style = TangemTheme.typography.h2,
)
} else {
Row(verticalAlignment = Alignment.CenterVertically) {
@@ -123,7 +133,7 @@ private fun CurrentApy(apy: TextReference?, modifier: Modifier = Modifier) {
Text(
modifier = modifier,
text = apyText,
- style = TangemTheme.typography.body1,
+ style = TangemTheme.typography.h2,
color = TangemTheme.colors.text.accent,
)
}
@@ -134,7 +144,11 @@ private fun CurrentApy(apy: TextReference?, modifier: Modifier = Modifier) {
@Suppress("LongMethod")
@Composable
-private fun YieldSupplyActiveMyFunds(state: YieldSupplyActiveContentUM, isBalanceHidden: Boolean) {
+private fun YieldSupplyActiveMyFunds(
+ state: YieldSupplyActiveContentUM,
+ onReadMoreClick: () -> Unit,
+ isBalanceHidden: Boolean,
+) {
Column(
modifier = Modifier
.clip(RoundedCornerShape(16.dp))
@@ -164,7 +178,7 @@ private fun YieldSupplyActiveMyFunds(state: YieldSupplyActiveContentUM, isBalanc
)
}
SpacerH8()
- DescriptionText(state = state)
+ DescriptionText(state = state, onReadMoreClick = onReadMoreClick)
SpacerH8()
HorizontalDivider(
thickness = 0.5.dp,
@@ -206,14 +220,14 @@ private fun YieldSupplyActiveMyFunds(state: YieldSupplyActiveContentUM, isBalanc
}
@Composable
-private fun DescriptionText(state: YieldSupplyActiveContentUM) {
+private fun DescriptionText(state: YieldSupplyActiveContentUM, onReadMoreClick: () -> Unit) {
val subtitle = annotatedReference {
append(state.subtitle.resolveReference())
appendSpace()
withLink(
LinkAnnotation.Clickable(
tag = "LINK_TAG",
- linkInteractionListener = {},
+ linkInteractionListener = { onReadMoreClick() },
),
{
appendColored(
@@ -324,6 +338,7 @@ private fun YieldSupplyActiveBottomSheet_Preview(
state = params,
isBalanceHidden = true,
chartComponent = ComposableContentComponent.EMPTY,
+ onReadMoreClick = {},
)
}
}
@@ -340,15 +355,27 @@ private class YieldSupplyActiveBottomSheetPreviewProvider : PreviewParameterProv
wrappedList("USDT", "USDT"),
),
subtitleLink = resourceReference(R.string.common_read_more),
- notificationUM = NotificationUM.Error.InvalidAmount,
- apy = stringReference("5,14%"),
+ notifications = persistentListOf(
+ NotificationUM.Error.InvalidAmount,
+ NotificationUM.Info(
+ title = resourceReference(
+ R.string.yield_module_amount_not_transfered_to_aave_title,
+ wrappedList(
+ "0,03",
+ ),
+ ),
+ subtitle = TextReference.EMPTY,
+ iconTint = NotificationConfig.IconTint.Accent,
+ ),
+ ),
minAmount = stringReference("50 USDT"),
- isHighFee = true,
+ currentFee = stringReference("30 USDT"),
feeDescription = stringReference(
"The network fee is currently too high to execute lending." +
"Funds will be supplied once it drops to \$12 or below. ",
),
- currentFee = stringReference("30 USDT"),
+ apy = stringReference("5,14%"),
+ isHighFee = true,
),
)
}