Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-19 13:58:25 +04:00
parent 032fbe824a
commit afddda1198
4 changed files with 71 additions and 13 deletions

View file

@ -20,16 +20,15 @@ internal class YieldSupplyPromoBannerKeyConverter(
is TokenConverterParams.Wallet -> value.tokenList.flattenCurrencies()
is TokenConverterParams.Account -> value.accountList.flattenCurrencies()
}.filter { status ->
status.value is CryptoCurrencyStatus.Loaded ||
status.value is CryptoCurrencyStatus.Custom
status.value is CryptoCurrencyStatus.Loaded
}
val tokens = currencies.filter { it.currency is CryptoCurrency.Token }
val cryptoCurrencyStatuses = currencies.filter { it.currency is CryptoCurrency.Token }
if (tokens.any { it.value.yieldSupplyStatus?.isActive == true }) return null
if (cryptoCurrencyStatuses.any { it.value.yieldSupplyStatus?.isActive == true }) return null
if (yieldModuleApyMap.isEmpty()) return null
val max = tokens.asSequence()
val max = cryptoCurrencyStatuses.asSequence()
.mapNotNull { status ->
val token = status.currency as? CryptoCurrency.Token ?: return@mapNotNull null
val tokenKey = token.yieldSupplyKey()