diff --git a/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListManager.kt b/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListManager.kt index 788a17198d..6a43ac5437 100644 --- a/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListManager.kt +++ b/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListManager.kt @@ -109,6 +109,16 @@ internal class TxHistoryListManager( ) } + fun txInfoFlow(txHash: String, type: TxInfo.TransactionType): Flow = state + .map { st -> + st.rawBatches.asSequence() + .flatMap { it.data.items } + .firstOrNull { it.txHash == txHash && it.type == type } + } + .filterNotNull() + .distinctUntilChanged() + .flowOn(dispatchers.default) + private fun updateState( batchListState: BatchListState>, lookupContext: TxHistoryLookupContext?, @@ -121,6 +131,7 @@ internal class TxHistoryListManager( val isRedesignEnabled = designFeatureToggles.isRedesignEnabled state.copy( status = batchListState.status, + rawBatches = batchListState.data, uiBatches = if (isRedesignEnabled) { val converter = TxHistoryItemToTransactionItemUMConverter( currency = currency, diff --git a/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListState.kt b/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListState.kt index 6c402e865a..e1b9a8ccf9 100644 --- a/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListState.kt +++ b/features/txhistory/impl/src/main/kotlin/com/tangem/features/txhistory/utils/TxHistoryListState.kt @@ -1,5 +1,7 @@ package com.tangem.features.txhistory.utils +import com.tangem.domain.models.network.TxInfo +import com.tangem.domain.txhistory.models.PaginationWrapper import com.tangem.features.txhistory.entity.TxHistoryItemsUM import com.tangem.features.txhistory.entity.TxHistoryUM import com.tangem.pagination.Batch @@ -7,6 +9,7 @@ import com.tangem.pagination.PaginationStatus data class TxHistoryListState( val status: PaginationStatus<*> = PaginationStatus.None, + val rawBatches: List>> = emptyList(), val uiBatches: List>> = emptyList(), val legacyUiBatches: List>> = emptyList(), ) \ No newline at end of file