Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-03 11:21:00 +04:00
parent dff5b1f27c
commit 978d7c1da4
20 changed files with 202 additions and 855 deletions

View file

@ -15,7 +15,6 @@ import com.tangem.datasource.local.preferences.PreferencesKeys
import com.tangem.datasource.local.preferences.utils.getObjectList
import com.tangem.datasource.local.preferences.utils.getObjectListSync
import com.tangem.datasource.local.preferences.utils.getObjectMap
import com.tangem.domain.account.featuretoggle.AccountsFeatureToggles
import com.tangem.domain.account.supplier.MultiAccountListSupplier
import com.tangem.domain.models.account.Account
import com.tangem.domain.models.account.AccountId
@ -30,7 +29,6 @@ import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.extensions.addOrReplace
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOn
internal class DefaultSwapTransactionRepository(
@ -39,7 +37,6 @@ internal class DefaultSwapTransactionRepository(
private val networkFactory: NetworkFactory,
private val dispatchers: CoroutineDispatcherProvider,
private val multiAccountListSupplier: MultiAccountListSupplier,
private val accountsFeatureToggles: AccountsFeatureToggles,
) : SwapTransactionRepository {
private val listConverter by lazy(LazyThreadSafetyMode.NONE) {
@ -122,11 +119,7 @@ internal class DefaultSwapTransactionRepository(
flow2 = appPreferencesStore.getObjectMap<SwapStatusDTO>(
key = PreferencesKeys.SWAP_TRANSACTIONS_STATUSES_KEY,
),
flow3 = if (accountsFeatureToggles.isFeatureEnabled) {
multiAccountListSupplier()
} else {
flowOf(emptyList())
},
flow3 = multiAccountListSupplier(),
) { savedTransactions, txStatuses, multiAccountList ->
val currencyTxs = savedTransactions
?.filter { swapTxList ->

View file

@ -12,7 +12,6 @@ import com.tangem.datasource.api.express.models.response.ExpressErrorResponse
import com.tangem.datasource.crypto.DataSignatureVerifier
import com.tangem.datasource.di.NetworkMoshi
import com.tangem.datasource.local.preferences.AppPreferencesStore
import com.tangem.domain.account.featuretoggle.AccountsFeatureToggles
import com.tangem.domain.account.supplier.MultiAccountListSupplier
import com.tangem.domain.express.ExpressRepository
import com.tangem.domain.quotes.single.SingleQuoteStatusFetcher
@ -71,7 +70,6 @@ internal object SwapDataModule {
responseCryptoCurrenciesFactory: ResponseCryptoCurrenciesFactory,
networkFactory: NetworkFactory,
multiAccountListSupplier: MultiAccountListSupplier,
accountsFeatureToggles: AccountsFeatureToggles,
dispatchers: CoroutineDispatcherProvider,
): SwapTransactionRepository {
return DefaultSwapTransactionRepository(
@ -79,7 +77,6 @@ internal object SwapDataModule {
responseCryptoCurrenciesFactory = responseCryptoCurrenciesFactory,
networkFactory = networkFactory,
multiAccountListSupplier = multiAccountListSupplier,
accountsFeatureToggles = accountsFeatureToggles,
dispatchers = dispatchers,
)
}