zcash-android-wallet-sdk / cash.z.wallet.sdk.transaction / TransactionRepository

TransactionRepository

interface TransactionRepository

Repository of wallet transactions, providing an agnostic interface to the underlying information.

Properties

allTransactions

A flow of all the inbound and outbound confirmed transactions

abstract val allTransactions: Flow<PagedList<ConfirmedTransaction>>

receivedTransactions

A flow of all the inbound confirmed transactions

abstract val receivedTransactions: Flow<PagedList<ConfirmedTransaction>>

sentTransactions

A flow of all the outbound confirmed transactions

abstract val sentTransactions: Flow<PagedList<ConfirmedTransaction>>

Functions

findEncodedTransactionById

Find the encoded transaction associated with the given id.

abstract suspend fun findEncodedTransactionById(txId: Long): EncodedTransaction?

findMinedHeight

Find the mined height that matches the given raw tx_id in bytes. This is useful for matching a pending transaction with one that we've decrypted from the blockchain.

abstract suspend fun findMinedHeight(rawTransactionId: ByteArray): Int?

invalidate

Provides a way for other components to signal that the underlying data has been modified.

abstract fun invalidate(): Unit

isInitialized

Returns true when this repository has been initialized and seeded with the initial checkpoint.

abstract fun isInitialized(): Boolean

lastScannedHeight

The last height scanned by this repository.

abstract fun lastScannedHeight(): Int

Inheritors

PagedTransactionRepository

Example of a repository that leverages the Room paging library to return a PagedList of transactions. Consumers can register as a page listener and receive an interface that allows for efficiently paging data.

open class PagedTransactionRepository : TransactionRepository