Updated on 2026-08-14
This commit is contained in:
parent
64693f66ca
commit
43f27a2f33
26 changed files with 21 additions and 370 deletions
|
|
@ -19,7 +19,6 @@ import com.tangem.datasource.api.common.response.getOrThrow
|
|||
import com.tangem.datasource.api.markets.TangemTechMarketsApi
|
||||
import com.tangem.datasource.api.markets.models.response.TokenMarketExchangesResponse
|
||||
import com.tangem.datasource.local.datastore.RuntimeStateStore
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.common.wallets.UserWalletsListRepository
|
||||
import com.tangem.domain.common.wallets.getSyncStrict
|
||||
import com.tangem.domain.markets.*
|
||||
|
|
@ -31,7 +30,6 @@ import com.tangem.pagination.*
|
|||
import com.tangem.pagination.fetcher.LimitOffsetBatchFetcher
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.withContext
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
|
|
@ -294,26 +292,6 @@ internal class DefaultMarketsTokenRepository(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun showYieldModePromo(
|
||||
appCurrency: AppCurrency,
|
||||
interval: TokenMarketListConfig.Interval,
|
||||
): Boolean = try {
|
||||
val hasYieldSupplyTokens = marketsApi.getCoinsList(
|
||||
currency = appCurrency.code,
|
||||
interval = interval.toRequestParam(),
|
||||
order = TokenMarketListConfig.Order.YieldSupply.toRequestParam(),
|
||||
offset = 0,
|
||||
limit = 40,
|
||||
timestamp = null,
|
||||
search = null,
|
||||
).getOrThrow().tokens.isNotEmpty()
|
||||
|
||||
hasYieldSupplyTokens
|
||||
} catch (error: Exception) {
|
||||
Timber.e(error)
|
||||
false
|
||||
}
|
||||
|
||||
inline fun <T> catchListErrorAndSendEvent(block: () -> T): T {
|
||||
return catchErrorAndSendEvent(block, ::createListErrorEvent)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ internal fun TokenMarketListConfig.Order.toRequestParam(): String = when (this)
|
|||
TokenMarketListConfig.Order.Buyers -> "buyers"
|
||||
TokenMarketListConfig.Order.TopGainers -> "gainers"
|
||||
TokenMarketListConfig.Order.TopLosers -> "losers"
|
||||
TokenMarketListConfig.Order.Staking -> "staking"
|
||||
TokenMarketListConfig.Order.YieldSupply -> "yield"
|
||||
}
|
||||
|
||||
internal fun PriceChangeInterval.toRequestParam(): String = when (this) {
|
||||
|
|
|
|||
|
|
@ -96,20 +96,6 @@ internal class DefaultPromoRepository(
|
|||
appPreferencesStore.store(PreferencesKeys.getShouldShowPromoKey(promoId = promoId.name), false)
|
||||
}
|
||||
|
||||
override fun isMarketsYieldSupplyNotificationHideClicked(): Flow<Boolean> {
|
||||
return appPreferencesStore.get(
|
||||
key = PreferencesKeys.MARKETS_YIELD_SUPPLY_NOTIFICATION_HIDE_CLICKED_KEY,
|
||||
default = false,
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun setMarketsYieldSupplyNotificationHideClicked() {
|
||||
appPreferencesStore.store(
|
||||
key = PreferencesKeys.MARKETS_YIELD_SUPPLY_NOTIFICATION_HIDE_CLICKED_KEY,
|
||||
value = true,
|
||||
)
|
||||
}
|
||||
|
||||
override suspend fun isMoonpayPromoActive(): Boolean {
|
||||
val banner = runCatching(dispatchers.io) {
|
||||
val response = promoBannerStore.getSyncOrNull(MOONPAY_NAME) ?: run {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue