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

OutboundTransactionManager

interface OutboundTransactionManager

Manage outbound transactions with the main purpose of reporting which ones are still pending, particularly after failed attempts or dropped connectivity. The intent is to help see outbound transactions through to completion.

Functions

applyMinedHeight

Given a transaction and the height at which it was mined, update the transaction to indicate that it was mined.

abstract suspend fun applyMinedHeight(pendingTx: PendingTransaction, minedHeight: Int): Unit

cancel

Attempt to cancel a transaction.

abstract suspend fun cancel(pendingTx: PendingTransaction): Boolean

encode

Encode the pending transaction using the given spending key. This is a local operation that produces a raw transaction to submit to lightwalletd.

abstract suspend fun encode(spendingKey: String, pendingTx: PendingTransaction): PendingTransaction

getAll

Get all pending transactions known to this wallet as a flow that is updated anytime the list changes.

abstract fun getAll(): Flow<List<PendingTransaction>>

initSpend

Initialize a spend with the main purpose of creating an idea to use for tracking it until completion.

abstract suspend fun initSpend(zatoshi: Long, toAddress: String, memo: String, fromAccountIndex: Int): PendingTransaction

isValidShieldedAddress

Return true when the given address is a valid t-addr.

abstract suspend fun isValidShieldedAddress(address: String): Boolean

isValidTransparentAddress

Return true when the given address is a valid z-addr.

abstract suspend fun isValidTransparentAddress(address: String): Boolean

monitorById

Generate a flow of information about the given id where a new pending transaction is emitted every time its state changes.

abstract suspend fun monitorById(id: Long): Flow<PendingTransaction>

submit

Submits the transaction represented by pendingTx to lightwalletd to broadcast to the network and, hopefully, include in the next block.

abstract suspend fun submit(pendingTx: PendingTransaction): PendingTransaction

Inheritors

PersistentTransactionManager

Facilitates persistent attempts to ensure that an outbound transaction is completed.

class PersistentTransactionManager : OutboundTransactionManager