Updated on 2026-08-14

This commit is contained in:
Tangem 2025-06-10 12:10:53 +04:00
parent bfd371bc33
commit c9e78f485d
10 changed files with 164 additions and 47 deletions

View file

@ -19,7 +19,7 @@ import com.tangem.domain.appcurrency.repository.AppCurrencyRepository
import com.tangem.domain.demo.IsDemoCardUseCase
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.network.Network
import com.tangem.domain.quotes.QuotesRepositoryV2
import com.tangem.domain.quotes.QuotesRepository
import com.tangem.domain.tokens.FetchCurrencyStatusUseCase
import com.tangem.domain.tokens.GetCurrencyCheckUseCase
import com.tangem.domain.tokens.GetMultiCryptoCurrencyStatusUseCase
@ -65,7 +65,7 @@ internal class SwapInteractorImpl @AssistedInject constructor(
private val createTransactionExtrasUseCase: CreateTransactionDataExtrasUseCase,
private val createApprovalTransactionUseCase: CreateApprovalTransactionUseCase,
private val isDemoCardUseCase: IsDemoCardUseCase,
private val quotesRepositoryV2: QuotesRepositoryV2,
private val quotesRepository: QuotesRepository,
private val swapTransactionRepository: SwapTransactionRepository,
private val currencyChecksRepository: CurrencyChecksRepository,
private val appCurrencyRepository: AppCurrencyRepository,
@ -1809,7 +1809,7 @@ internal class SwapInteractorImpl @AssistedInject constructor(
}
private suspend fun Set<CryptoCurrency.RawID>.getQuotesOrEmpty(): Set<QuoteStatus> {
return runCatching { quotesRepositoryV2.getMultiQuoteSyncOrNull(currenciesIds = this) }
return runCatching { quotesRepository.getMultiQuoteSyncOrNull(currenciesIds = this) }
.getOrNull()
.orEmpty()
}

View file

@ -6,7 +6,7 @@ import com.tangem.datasource.local.swaptx.ExpressAnalyticsStatus
import com.tangem.datasource.local.swaptx.SwapTransactionStatusStore
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.quotes.QuotesRepositoryV2
import com.tangem.domain.quotes.QuotesRepository
import com.tangem.domain.tokens.AddCryptoCurrenciesUseCase
import com.tangem.domain.tokens.model.QuoteStatus
import com.tangem.domain.tokens.model.analytics.TokenExchangeAnalyticsEvent
@ -32,7 +32,7 @@ import kotlinx.coroutines.flow.map
internal class ExchangeStatusFactory @AssistedInject constructor(
private val swapTransactionRepository: SwapTransactionRepository,
private val swapRepository: SwapRepository,
private val quotesRepositoryV2: QuotesRepositoryV2,
private val quotesRepository: QuotesRepository,
private val addCryptoCurrenciesUseCase: AddCryptoCurrenciesUseCase,
private val swapTransactionStatusStore: SwapTransactionStatusStore,
private val analyticsEventsHandler: AnalyticsEventHandler,
@ -190,7 +190,7 @@ internal class ExchangeStatusFactory @AssistedInject constructor(
private suspend fun Set<CryptoCurrency.ID>.getQuotesOrEmpty(): Set<QuoteStatus> {
val rawIds = mapNotNull { it.rawCurrencyId }.toSet()
return runCatching { quotesRepositoryV2.getMultiQuoteSyncOrNull(currenciesIds = rawIds) }
return runCatching { quotesRepository.getMultiQuoteSyncOrNull(currenciesIds = rawIds) }
.getOrNull()
.orEmpty()
}