Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-18 18:16:55 +01:00
parent 64693f66ca
commit 43f27a2f33
26 changed files with 21 additions and 370 deletions

View file

@ -9,7 +9,7 @@ data class TokenMarketListConfig(
) {
enum class Order {
ByRating, Trending, Buyers, TopGainers, TopLosers, Staking, YieldSupply,
ByRating, Trending, Buyers, TopGainers, TopLosers
}
enum class Interval {

View file

@ -1,24 +0,0 @@
package com.tangem.domain.markets
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.markets.repositories.MarketsTokenRepository
import com.tangem.domain.promo.PromoRepository
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
class ShouldShowYieldModeMarketPromoUseCase(
private val promoRepository: PromoRepository,
private val marketsTokenRepository: MarketsTokenRepository,
) {
operator fun invoke(appCurrency: AppCurrency, interval: TokenMarketListConfig.Interval): Flow<Boolean> {
val hideClickedFlow = promoRepository.isMarketsYieldSupplyNotificationHideClicked()
return hideClickedFlow.map { hideClicked ->
!hideClicked && marketsTokenRepository.showYieldModePromo(
appCurrency = appCurrency,
interval = interval,
)
}
}
}

View file

@ -1,6 +1,5 @@
package com.tangem.domain.markets.repositories
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.markets.*
import com.tangem.domain.models.account.DerivationIndex
import com.tangem.domain.models.currency.CryptoCurrency
@ -54,6 +53,4 @@ interface MarketsTokenRepository {
* @param tokenId token id
*/
suspend fun getTokenExchanges(tokenId: CryptoCurrency.RawID): List<TokenMarketExchange>
suspend fun showYieldModePromo(appCurrency: AppCurrency, interval: TokenMarketListConfig.Interval): Boolean
}