Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-19 17:34:42 +02:00
commit bf0a8efd7e
97 changed files with 1537 additions and 507 deletions

View file

@ -28,6 +28,7 @@ import com.tangem.domain.express.models.ExpressOperationType
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
import com.tangem.feature.swap.converters.*
import com.tangem.feature.swap.domain.api.SwapRepository
import com.tangem.feature.swap.domain.models.ExpressDataError
@ -50,6 +51,7 @@ internal class DefaultSwapRepository(
private val dataSignatureVerifier: DataSignatureVerifier,
private val appPreferencesStore: AppPreferencesStore,
private val expressHistoryDao: ExpressHistoryDao,
private val txHistoryFeatureToggles: TxHistoryFeatureToggles,
moshi: Moshi,
) : SwapRepository {
@ -156,7 +158,9 @@ internal class DefaultSwapRepository(
.getOrThrow()
val entity = response.toEntity(ownerAddress = response.fromAddress.orEmpty())
expressHistoryDao.upsertExchanges(listOf(entity))
if (txHistoryFeatureToggles.isNewTxHistoryEnabled) {
expressHistoryDao.upsertExchanges(listOf(entity))
}
exchangeStatusConverter.convert(response)
},

View file

@ -12,6 +12,7 @@ import com.tangem.datasource.local.config.environment.EnvironmentConfig
import com.tangem.datasource.local.preferences.AppPreferencesStore
import com.tangem.datasource.local.txhistory.db.dao.ExpressHistoryDao
import com.tangem.domain.account.supplier.SingleAccountListSupplier
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
import com.tangem.feature.swap.DefaultSwapFeedbackRepository
import com.tangem.feature.swap.DefaultSwapRepository
import com.tangem.feature.swap.NoOpSwapFeedbackRepository
@ -41,6 +42,7 @@ internal class SwapDataModule {
@NetworkMoshi moshi: Moshi,
appPreferencesStore: AppPreferencesStore,
expressHistoryDao: ExpressHistoryDao,
txHistoryFeatureToggles: TxHistoryFeatureToggles,
): SwapRepository {
return DefaultSwapRepository(
tangemExpressApi = tangemExpressApi,
@ -50,6 +52,7 @@ internal class SwapDataModule {
moshi = moshi,
appPreferencesStore = appPreferencesStore,
expressHistoryDao = expressHistoryDao,
txHistoryFeatureToggles = txHistoryFeatureToggles,
)
}