Updated on 2026-08-14
This commit is contained in:
parent
d82dbdd1e6
commit
075db99e51
13 changed files with 32 additions and 8 deletions
|
|
@ -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)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue