Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-19 17:02:56 +04:00
parent d82dbdd1e6
commit 075db99e51
13 changed files with 32 additions and 8 deletions

View file

@ -43,6 +43,7 @@ dependencies {
implementation(projects.domain.transaction.models)
implementation(projects.domain.express.models)
implementation(projects.domain.account.status)
implementation(projects.domain.txhistory)
implementation(projects.libs.blockchainSdk)
implementation(projects.libs.crypto)

View file

@ -29,6 +29,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.domain.walletmanager.WalletManagersFacade
import com.tangem.feature.swap.converters.*
import com.tangem.feature.swap.domain.api.SwapRepository
@ -55,6 +56,7 @@ internal class DefaultSwapRepository(
private val appPreferencesStore: AppPreferencesStore,
private val rampStateManager: RampStateManager,
private val expressHistoryDao: ExpressHistoryDao,
private val txHistoryFeatureToggles: TxHistoryFeatureToggles,
moshi: Moshi,
) : SwapRepository {
@ -253,7 +255,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

@ -13,6 +13,7 @@ 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.exchange.RampStateManager
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
import com.tangem.domain.walletmanager.WalletManagersFacade
import com.tangem.feature.swap.DefaultSwapFeedbackRepository
import com.tangem.feature.swap.DefaultSwapRepository
@ -45,6 +46,7 @@ internal class SwapDataModule {
appPreferencesStore: AppPreferencesStore,
rampStateManager: RampStateManager,
expressHistoryDao: ExpressHistoryDao,
txHistoryFeatureToggles: TxHistoryFeatureToggles,
): SwapRepository {
return DefaultSwapRepository(
tangemExpressApi = tangemExpressApi,
@ -56,6 +58,7 @@ internal class SwapDataModule {
appPreferencesStore = appPreferencesStore,
rampStateManager = rampStateManager,
expressHistoryDao = expressHistoryDao,
txHistoryFeatureToggles = txHistoryFeatureToggles,
)
}

View file

@ -1,6 +0,0 @@
package com.tangem.features.txhistory
interface TxHistoryFeatureToggles {
val isSolanaTxHistoryEnabled: Boolean
val isNewTxHistoryEnabled: Boolean
}

View file

@ -2,7 +2,7 @@ package com.tangem.features.txhistory.di
import com.tangem.core.configtoggle.FeatureToggles
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.features.txhistory.TxHistoryFeatureToggles
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
import javax.inject.Inject
internal class DefaultTxHistoryFeatureToggles @Inject constructor(

View file

@ -1,6 +1,6 @@
package com.tangem.features.txhistory.di
import com.tangem.features.txhistory.TxHistoryFeatureToggles
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
import com.tangem.features.txhistory.component.DefaultTxHistoryComponent
import com.tangem.features.txhistory.component.DefaultTxHistoryDetailsComponent
import com.tangem.features.txhistory.component.TxHistoryComponent

View file

@ -26,7 +26,7 @@ import com.tangem.domain.txhistory.repository.TxHistoryRepositoryV2
import com.tangem.domain.txhistory.usecase.GetExplorerTransactionUrlUseCase
import com.tangem.domain.txhistory.usecase.GetTxHistoryItemsCountUseCase
import com.tangem.domain.wallets.usecase.GetWalletIconUseCase
import com.tangem.features.txhistory.TxHistoryFeatureToggles
import com.tangem.domain.txhistory.TxHistoryFeatureToggles
import com.tangem.features.txhistory.component.TxHistoryComponent
import com.tangem.features.txhistory.converter.TxHistoryInfoToTransactionItemUMConverter
import com.tangem.features.txhistory.converter.TxHistoryItemToTransactionItemUMConverter