Initial commit

This commit is contained in:
fekt
2022-06-30 01:53:12 -04:00
commit 0131016214
703 changed files with 33394 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.wallet.sdk](../../../index.md) / [Synchronizer](../../index.md) / [AddressType](../index.md) / [Invalid](index.md) / [<init>](./-init-.md)
# <init>
`Invalid(reason: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "Invalid")`

View File

@@ -0,0 +1,23 @@
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.wallet.sdk](../../../index.md) / [Synchronizer](../../index.md) / [AddressType](../index.md) / [Invalid](./index.md)
# Invalid
`class Invalid : `[`Synchronizer.AddressType`](../index.md)
### Constructors
| Name | Summary |
|---|---|
| [<init>](-init-.md) | `Invalid(reason: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "Invalid")` |
### Properties
| Name | Summary |
|---|---|
| [reason](reason.md) | `val reason: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
### Inherited Properties
| Name | Summary |
|---|---|
| [isNotValid](../is-not-valid.md) | `val isNotValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |

View File

@@ -0,0 +1,5 @@
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.wallet.sdk](../../../index.md) / [Synchronizer](../../index.md) / [AddressType](../index.md) / [Invalid](index.md) / [reason](./reason.md)
# reason
`val reason: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)

View File

@@ -0,0 +1,11 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.wallet.sdk](../../index.md) / [Synchronizer](../index.md) / [AddressType](index.md) / [Shielded](./-shielded.md)
# Shielded
`object Shielded : `[`Synchronizer.AddressType.Valid`](-valid.md)`, `[`Synchronizer.AddressType`](index.md)
### Inherited Properties
| Name | Summary |
|---|---|
| [isNotValid](is-not-valid.md) | `val isNotValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |

View File

@@ -0,0 +1,11 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.wallet.sdk](../../index.md) / [Synchronizer](../index.md) / [AddressType](index.md) / [Transparent](./-transparent.md)
# Transparent
`object Transparent : `[`Synchronizer.AddressType.Valid`](-valid.md)`, `[`Synchronizer.AddressType`](index.md)
### Inherited Properties
| Name | Summary |
|---|---|
| [isNotValid](is-not-valid.md) | `val isNotValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |

View File

@@ -0,0 +1,12 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.wallet.sdk](../../index.md) / [Synchronizer](../index.md) / [AddressType](index.md) / [Valid](./-valid.md)
# Valid
`interface Valid`
### Inheritors
| Name | Summary |
|---|---|
| [Shielded](-shielded.md) | `object Shielded : `[`Synchronizer.AddressType.Valid`](./-valid.md)`, `[`Synchronizer.AddressType`](index.md) |
| [Transparent](-transparent.md) | `object Transparent : `[`Synchronizer.AddressType.Valid`](./-valid.md)`, `[`Synchronizer.AddressType`](index.md) |

View File

@@ -0,0 +1,28 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.wallet.sdk](../../index.md) / [Synchronizer](../index.md) / [AddressType](./index.md)
# AddressType
`sealed class AddressType`
### Types
| Name | Summary |
|---|---|
| [Invalid](-invalid/index.md) | `class Invalid : `[`Synchronizer.AddressType`](./index.md) |
| [Shielded](-shielded.md) | `object Shielded : `[`Synchronizer.AddressType.Valid`](-valid.md)`, `[`Synchronizer.AddressType`](./index.md) |
| [Transparent](-transparent.md) | `object Transparent : `[`Synchronizer.AddressType.Valid`](-valid.md)`, `[`Synchronizer.AddressType`](./index.md) |
| [Valid](-valid.md) | `interface Valid` |
### Properties
| Name | Summary |
|---|---|
| [isNotValid](is-not-valid.md) | `val isNotValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
### Inheritors
| Name | Summary |
|---|---|
| [Invalid](-invalid/index.md) | `class Invalid : `[`Synchronizer.AddressType`](./index.md) |
| [Shielded](-shielded.md) | `object Shielded : `[`Synchronizer.AddressType.Valid`](-valid.md)`, `[`Synchronizer.AddressType`](./index.md) |
| [Transparent](-transparent.md) | `object Transparent : `[`Synchronizer.AddressType.Valid`](-valid.md)`, `[`Synchronizer.AddressType`](./index.md) |

View File

@@ -0,0 +1,5 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.wallet.sdk](../../index.md) / [Synchronizer](../index.md) / [AddressType](index.md) / [isNotValid](./is-not-valid.md)
# isNotValid
`val isNotValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [DISCONNECTED](./-d-i-s-c-o-n-n-e-c-t-e-d.md)
# DISCONNECTED
`DISCONNECTED`
Indicates that this Synchronizer is disconnected from its lightwalletd server.
When set, a UI element may want to turn red.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [DOWNLOADING](./-d-o-w-n-l-o-a-d-i-n-g.md)
# DOWNLOADING
`DOWNLOADING`
Indicates that this Synchronizer is actively downloading new blocks from the server.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [ENHANCING](./-e-n-h-a-n-c-i-n-g.md)
# ENHANCING
`ENHANCING`
Indicates that this Synchronizer is actively enhancing newly scanned blocks with
additional transaction details, fetched from the server.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [SCANNING](./-s-c-a-n-n-i-n-g.md)
# SCANNING
`SCANNING`
Indicates that this Synchronizer is actively decrypting new blocks that were downloaded
from the server.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [STOPPED](./-s-t-o-p-p-e-d.md)
# STOPPED
`STOPPED`
Indicates that [stop](../stop.md) has been called on this Synchronizer and it will no longer be used.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [SYNCED](./-s-y-n-c-e-d.md)
# SYNCED
`SYNCED`
Indicates that this Synchronizer is fully up to date and ready for all wallet functions.
When set, a UI element may want to turn green. In this state, the balance can be trusted.

View File

@@ -0,0 +1,10 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](index.md) / [VALIDATING](./-v-a-l-i-d-a-t-i-n-g.md)
# VALIDATING
`VALIDATING`
Indicates that this Synchronizer is actively validating new blocks that were downloaded
from the server. Blocks need to be verified before they are scanned. This confirms that
each block is chain-sequential, thereby detecting missing blocks and reorgs.

View File

@@ -0,0 +1,19 @@
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk](../../index.md) / [Synchronizer](../index.md) / [Status](./index.md)
# Status
`enum class Status`
Represents the status of this Synchronizer, which is useful for communicating to the user.
### Enum Values
| Name | Summary |
|---|---|
| [STOPPED](-s-t-o-p-p-e-d.md) | Indicates that [stop](../stop.md) has been called on this Synchronizer and it will no longer be used. |
| [DISCONNECTED](-d-i-s-c-o-n-n-e-c-t-e-d.md) | Indicates that this Synchronizer is disconnected from its lightwalletd server. When set, a UI element may want to turn red. |
| [DOWNLOADING](-d-o-w-n-l-o-a-d-i-n-g.md) | Indicates that this Synchronizer is actively downloading new blocks from the server. |
| [VALIDATING](-v-a-l-i-d-a-t-i-n-g.md) | Indicates that this Synchronizer is actively validating new blocks that were downloaded from the server. Blocks need to be verified before they are scanned. This confirms that each block is chain-sequential, thereby detecting missing blocks and reorgs. |
| [SCANNING](-s-c-a-n-n-i-n-g.md) | Indicates that this Synchronizer is actively decrypting new blocks that were downloaded from the server. |
| [ENHANCING](-e-n-h-a-n-c-i-n-g.md) | Indicates that this Synchronizer is actively enhancing newly scanned blocks with additional transaction details, fetched from the server. |
| [SYNCED](-s-y-n-c-e-d.md) | Indicates that this Synchronizer is fully up to date and ready for all wallet functions. When set, a UI element may want to turn green. In this state, the balance can be trusted. |

View File

@@ -0,0 +1,52 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk](../index.md) / [Synchronizer](./index.md)
# Synchronizer
`interface Synchronizer`
Primary interface for interacting with the SDK. Defines the contract that specific
implementations like [MockSynchronizer](#) and [SdkSynchronizer](../-sdk-synchronizer/index.md) fulfill. Given the language-level
support for coroutines, we favor their use in the SDK and incorporate that choice into this
contract.
### Types
| Name | Summary |
|---|---|
| [AddressType](-address-type/index.md) | `sealed class AddressType` |
| [Status](-status/index.md) | `enum class Status` |
### Properties
| Name | Summary |
|---|---|
| [balances](balances.md) | `abstract val balances: Flow<`[`CompactBlockProcessor.WalletBalance`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/-wallet-balance/index.md)`>`<br>A stream of balance values, separately reflecting both the available and total balance. |
| [clearedTransactions](cleared-transactions.md) | `abstract val clearedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.entity/-confirmed-transaction/index.md)`>>`<br>A flow of all the transactions that are on the blockchain. |
| [onCriticalErrorHandler](on-critical-error-handler.md) | `abstract var onCriticalErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`<br>Gets or sets a global error handler. This is a useful hook for handling unexpected critical errors. |
| [onProcessorErrorHandler](on-processor-error-handler.md) | `abstract var onProcessorErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`<br>An error handler for exceptions during processing. For instance, a block might be missing or a reorg may get mishandled or the database may get corrupted. |
| [onSubmissionErrorHandler](on-submission-error-handler.md) | `abstract var onSubmissionErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`<br>An error handler for exceptions while submitting transactions to lightwalletd. For instance, a transaction may get rejected because it would be a double-spend or the user might lose their cellphone signal. |
| [pendingTransactions](pending-transactions.md) | `abstract val pendingTransactions: Flow<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.entity/-pending-transaction/index.md)`>>`<br>A flow of all the outbound pending transaction that have been sent but are awaiting confirmations. |
| [processorInfo](processor-info.md) | `abstract val processorInfo: Flow<`[`CompactBlockProcessor.ProcessorInfo`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/-processor-info/index.md)`>`<br>A flow of processor details, updated every time blocks are processed to include the latest block height, blocks downloaded and blocks scanned. Similar to the [progress](progress.md) flow but with a lot more detail. |
| [progress](progress.md) | `abstract val progress: Flow<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>`<br>A flow of progress values, typically corresponding to this Synchronizer downloading blocks. Typically, any non- zero value below 100 indicates that progress indicators can be shown and a value of 100 signals that progress is complete and any progress indicators can be hidden. |
| [receivedTransactions](received-transactions.md) | `abstract val receivedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.entity/-confirmed-transaction/index.md)`>>`<br>A flow of all transactions related to receiving funds. |
| [sentTransactions](sent-transactions.md) | `abstract val sentTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.entity/-confirmed-transaction/index.md)`>>`<br>A flow of all transactions related to sending funds. |
| [status](status.md) | `abstract val status: Flow<`[`Synchronizer.Status`](-status/index.md)`>`<br>A flow of values representing the [Status](-status/index.md) of this Synchronizer. As the status changes, a new value will be emitted by this flow. |
### Functions
| Name | Summary |
|---|---|
| [cancelSpend](cancel-spend.md) | `abstract suspend fun cancelSpend(transaction: `[`PendingTransaction`](../../cash.z.ecc.android.sdk.entity/-pending-transaction/index.md)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Attempts to cancel a transaction that is about to be sent. Typically, cancellation is only an option if the transaction has not yet been submitted to the server. |
| [getAddress](get-address.md) | `abstract suspend fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Gets the address for the given account. |
| [isValidShieldedAddr](is-valid-shielded-addr.md) | `abstract suspend fun isValidShieldedAddr(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Returns true when the given address is a valid z-addr. Invalid addresses will throw an exception. Valid z-addresses have these characteristics: //TODO |
| [isValidTransparentAddr](is-valid-transparent-addr.md) | `abstract suspend fun isValidTransparentAddr(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Returns true when the given address is a valid t-addr. Invalid addresses will throw an exception. Valid t-addresses have these characteristics: //TODO |
| [sendToAddress](send-to-address.md) | `abstract fun sendToAddress(spendingKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, zatoshi: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, toAddress: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, memo: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "", fromAccountIndex: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): Flow<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.entity/-pending-transaction/index.md)`>`<br>Sends zatoshi. |
| [start](start.md) | `abstract fun start(parentScope: CoroutineScope? = null): `[`Synchronizer`](./index.md)<br>Starts this synchronizer within the given scope. |
| [stop](stop.md) | `abstract fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stop this synchronizer. Implementations should ensure that calling this method cancels all jobs that were created by this instance. |
| [validateAddress](validate-address.md) | `abstract suspend fun validateAddress(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Synchronizer.AddressType`](-address-type/index.md)<br>Validates the given address, returning information about why it is invalid. |
### Inheritors
| Name | Summary |
|---|---|
| [SdkSynchronizer](../-sdk-synchronizer/index.md) | `class SdkSynchronizer : `[`Synchronizer`](./index.md)<br>A Synchronizer that attempts to remain operational, despite any number of errors that can occur. It acts as the glue that ties all the pieces of the SDK together. Each component of the SDK is designed for the potential of stand-alone usage but coordinating all the interactions is non- trivial. So the Synchronizer facilitates this, acting as reference that demonstrates how all the pieces can be tied together. Its goal is to allow a developer to focus on their app rather than the nuances of how Zcash works. |

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [activeTransactions](./active-transactions.md)
# activeTransactions
`abstract fun activeTransactions(): ReceiveChannel<`[`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[`ActiveTransaction`](../-active-transaction/index.md)`, `[`TransactionState`](../-transaction-state/index.md)`>>`
A stream of all the active transactions.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [allTransactions](./all-transactions.md)
# allTransactions
`abstract fun allTransactions(): ReceiveChannel<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`WalletTransaction`](../../cash.z.ecc.android.sdk.dao/-wallet-transaction/index.md)`>>`
A stream of all the wallet transactions.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [balance](./balance.md)
# balance
`abstract fun balance(): ReceiveChannel<`[`Wallet.WalletBalance`](../../cash.z.ecc.android.sdk.secure/-wallet/-wallet-balance/index.md)`>`
A stream of balance values.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [balances](./balances.md)
# balances
`abstract val balances: Flow<WalletBalance>`
A stream of balance values, separately reflecting both the available and total balance.

View File

@@ -0,0 +1,16 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [cancelSend](./cancel-send.md)
# cancelSend
`abstract fun cancelSend(transaction: `[`SentTransaction`](../../cash.z.ecc.android.sdk.entity/-sent-transaction/index.md)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Attempts to cancel a previously sent transaction. Typically, cancellation is only an option if the transaction
has not yet been submitted to the server.
### Parameters
`transaction` - the transaction to cancel.
**Return**
true when the cancellation request was successful. False when it is too late to cancel.

View File

@@ -0,0 +1,16 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [cancelSpend](./cancel-spend.md)
# cancelSpend
`abstract suspend fun cancelSpend(transaction: `[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Attempts to cancel a transaction that is about to be sent. Typically, cancellation is only
an option if the transaction has not yet been submitted to the server.
### Parameters
`transaction` - the transaction to cancel.
**Return**
true when the cancellation request was successful. False when it is too late.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [clearedTransactions](./cleared-transactions.md)
# clearedTransactions
`abstract val clearedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>`
A flow of all the transactions that are on the blockchain.

View File

@@ -0,0 +1,16 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [getAddress](./get-address.md)
# getAddress
`abstract suspend fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Gets the address for the given account.
### Parameters
`accountId` - the optional accountId whose address is of interest. By default, the first
account is used.
**Return**
the address for the given account.

View File

@@ -0,0 +1,10 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [getServerInfo](./get-server-info.md)
# getServerInfo
`abstract suspend fun getServerInfo(): <ERROR CLASS>`
Convenience function that exposes the underlying server information, like its name and
consensus branch id. Most wallets should already have a different source of truth for the
server(s) with which they operate and thereby not need this function.

View File

@@ -0,0 +1,56 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](./index.md)
# Synchronizer
`interface Synchronizer`
Primary interface for interacting with the SDK. Defines the contract that specific
implementations like [MockSynchronizer](#) and [SdkSynchronizer](../-sdk-synchronizer/index.md) fulfill. Given the language-level
support for coroutines, we favor their use in the SDK and incorporate that choice into this
contract.
### Types
| Name | Summary |
|---|---|
| [Status](-status/index.md) | Represents the status of this Synchronizer, which is useful for communicating to the user.`enum class Status` |
### Properties
| Name | Summary |
|---|---|
| [balances](balances.md) | A stream of balance values, separately reflecting both the available and total balance.`abstract val balances: Flow<WalletBalance>` |
| [clearedTransactions](cleared-transactions.md) | A flow of all the transactions that are on the blockchain.`abstract val clearedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>` |
| [latestBalance](latest-balance.md) | An in-memory reference to the most recently calculated balance.`abstract val latestBalance: WalletBalance` |
| [latestHeight](latest-height.md) | An in-memory reference to the latest height seen on the network.`abstract val latestHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
| [onChainErrorHandler](on-chain-error-handler.md) | A callback to invoke whenever a chain error is encountered. These occur whenever the processor detects a missing or non-chain-sequential block (i.e. a reorg).`abstract var onChainErrorHandler: ((`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`) -> `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`)?` |
| [onCriticalErrorHandler](on-critical-error-handler.md) | Gets or sets a global error handler. This is a useful hook for handling unexpected critical errors.`abstract var onCriticalErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?` |
| [onProcessorErrorHandler](on-processor-error-handler.md) | An error handler for exceptions during processing. For instance, a block might be missing or a reorg may get mishandled or the database may get corrupted.`abstract var onProcessorErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?` |
| [onSubmissionErrorHandler](on-submission-error-handler.md) | An error handler for exceptions while submitting transactions to lightwalletd. For instance, a transaction may get rejected because it would be a double-spend or the user might lose their cellphone signal.`abstract var onSubmissionErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?` |
| [pendingTransactions](pending-transactions.md) | A flow of all the outbound pending transaction that have been sent but are awaiting confirmations.`abstract val pendingTransactions: Flow<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`>>` |
| [processorInfo](processor-info.md) | A flow of processor details, updated every time blocks are processed to include the latest block height, blocks downloaded and blocks scanned. Similar to the [progress](progress.md) flow but with a lot more detail.`abstract val processorInfo: Flow<ProcessorInfo>` |
| [progress](progress.md) | A flow of progress values, typically corresponding to this Synchronizer downloading blocks. Typically, any non- zero value below 100 indicates that progress indicators can be shown and a value of 100 signals that progress is complete and any progress indicators can be hidden.`abstract val progress: Flow<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>` |
| [receivedTransactions](received-transactions.md) | A flow of all transactions related to receiving funds.`abstract val receivedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>` |
| [sentTransactions](sent-transactions.md) | A flow of all transactions related to sending funds.`abstract val sentTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>` |
| [status](status.md) | A flow of values representing the [Status](-status/index.md) of this Synchronizer. As the status changes, a new value will be emitted by this flow.`abstract val status: Flow<Status>` |
### Functions
| Name | Summary |
|---|---|
| [cancelSpend](cancel-spend.md) | Attempts to cancel a transaction that is about to be sent. Typically, cancellation is only an option if the transaction has not yet been submitted to the server.`abstract suspend fun cancelSpend(transaction: `[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
| [getAddress](get-address.md) | Gets the address for the given account.`abstract suspend fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
| [getServerInfo](get-server-info.md) | Convenience function that exposes the underlying server information, like its name and consensus branch id. Most wallets should already have a different source of truth for the server(s) with which they operate and thereby not need this function.`abstract suspend fun getServerInfo(): <ERROR CLASS>` |
| [isValidShieldedAddr](is-valid-shielded-addr.md) | Returns true when the given address is a valid z-addr. Invalid addresses will throw an exception. Valid z-addresses have these characteristics: //TODO copy info from related ZIP`abstract suspend fun isValidShieldedAddr(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
| [isValidTransparentAddr](is-valid-transparent-addr.md) | Returns true when the given address is a valid t-addr. Invalid addresses will throw an exception. Valid t-addresses have these characteristics: //TODO copy info from related ZIP`abstract suspend fun isValidTransparentAddr(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
| [sendToAddress](send-to-address.md) | Sends zatoshi.`abstract fun sendToAddress(spendingKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, zatoshi: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, toAddress: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, memo: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "", fromAccountIndex: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): Flow<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`>` |
| [start](start.md) | Starts this synchronizer within the given scope.`abstract fun start(parentScope: CoroutineScope? = null): `[`Synchronizer`](./index.md) |
| [stop](stop.md) | Stop this synchronizer. Implementations should ensure that calling this method cancels all jobs that were created by this instance.`abstract fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
| [validateAddress](validate-address.md) | Validates the given address, returning information about why it is invalid. This is a convenience method that combines the behavior of [isValidShieldedAddr](is-valid-shielded-addr.md) and [isValidTransparentAddr](is-valid-transparent-addr.md) into one call so that the developer doesn't have to worry about handling the exceptions that they throw. Rather, exceptions are converted to [AddressType.Invalid](../../cash.z.ecc.android.sdk.validate/-address-type/-invalid/index.md) which has a `reason` property describing why it is invalid.`abstract suspend fun validateAddress(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`AddressType`](../../cash.z.ecc.android.sdk.validate/-address-type/index.md) |
| [validateConsensusBranch](validate-consensus-branch.md) | Validate whether the server and this SDK share the same consensus branch. This is particularly important to check around network updates so that any wallet that's connected to an incompatible server can surface that information effectively. For the SDK, the consensus branch is used when creating transactions as each one needs to target a specific branch. This function compares the server's branch id to this SDK's and returns information that helps determine whether they match.`abstract suspend fun validateConsensusBranch(): `[`ConsensusMatchType`](../../cash.z.ecc.android.sdk.validate/-consensus-match-type/index.md) |
### Inheritors
| Name | Summary |
|---|---|
| [SdkSynchronizer](../-sdk-synchronizer/index.md) | A Synchronizer that attempts to remain operational, despite any number of errors that can occur. It acts as the glue that ties all the pieces of the SDK together. Each component of the SDK is designed for the potential of stand-alone usage but coordinating all the interactions is non- trivial. So the Synchronizer facilitates this, acting as reference that demonstrates how all the pieces can be tied together. Its goal is to allow a developer to focus on their app rather than the nuances of how Zcash works.`class SdkSynchronizer : `[`Synchronizer`](./index.md) |

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [isConnected](./is-connected.md)
# isConnected
`abstract val isConnected: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
A flag indicating whether this Synchronizer is connected to its lightwalletd server. When false, a UI element
may want to turn red.

View File

@@ -0,0 +1,13 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [isFirstRun](./is-first-run.md)
# isFirstRun
`abstract suspend fun isFirstRun(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
A flag to indicate that this is the first run of this Synchronizer on this device. This is useful for knowing
whether to initialize databases or other required resources, as well as whether to show walk-throughs.
**Return**
true when this is the first run. Implementations can set criteria for that but typically it will be when
the database needs to be initialized.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [isScanning](./is-scanning.md)
# isScanning
`abstract val isScanning: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
A flag indicating whether this Synchronizer is actively decrypting compact blocks, searching for transactions.
When true, a UI element may want to turn yellow.

View File

@@ -0,0 +1,15 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [isStale](./is-stale.md)
# isStale
`abstract suspend fun isStale(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
A flag to indicate that this Synchronizer is significantly out of sync with it's server. Typically, this means
that the balance and other data cannot be completely trusted because a significant amount of data has not been
processed. This is intended for showing progress indicators when the user returns to the app after having not
used it for days. Typically, this means minor sync issues should be ignored and this should be leveraged in order
to alert a user that the balance information is stale.
**Return**
true when the local data is significantly out of sync with the remote server and the app data is stale.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [isSyncing](./is-syncing.md)
# isSyncing
`abstract val isSyncing: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
A flag indicating whether this Synchronizer is actively downloading compact blocks. When true, a UI element
may want to turn yellow.

View File

@@ -0,0 +1,20 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [isValidShieldedAddr](./is-valid-shielded-addr.md)
# isValidShieldedAddr
`abstract suspend fun isValidShieldedAddr(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Returns true when the given address is a valid z-addr. Invalid addresses will throw an
exception. Valid z-addresses have these characteristics: //TODO copy info from related ZIP
### Parameters
`address` - the address to validate.
### Exceptions
`RuntimeException` - when the address is invalid.
**Return**
true when the given address is a valid z-addr.

View File

@@ -0,0 +1,20 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [isValidTransparentAddr](./is-valid-transparent-addr.md)
# isValidTransparentAddr
`abstract suspend fun isValidTransparentAddr(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Returns true when the given address is a valid t-addr. Invalid addresses will throw an
exception. Valid t-addresses have these characteristics: //TODO copy info from related ZIP
### Parameters
`address` - the address to validate.
### Exceptions
`RuntimeException` - when the address is invalid.
**Return**
true when the given address is a valid t-addr.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [lastBalance](./last-balance.md)
# lastBalance
`abstract fun lastBalance(): `[`Wallet.WalletBalance`](../../cash.z.ecc.android.sdk.secure/-wallet/-wallet-balance/index.md)
Holds the most recent value that was transmitted through the [balances](balances.md) channel. Typically, if the
underlying channel is a BroadcastChannel (and it should be), then this value is simply [balanceChannel.value](#)

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [lastCleared](./last-cleared.md)
# lastCleared
`abstract fun lastCleared(): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`ClearedTransaction`](../../cash.z.ecc.android.sdk.entity/-cleared-transaction/index.md)`>`
Holds the most recent value that was transmitted through the [clearedTransactions](cleared-transactions.md) channel. Typically, if the
underlying channel is a BroadcastChannel (and it should be), then this value is simply [clearedChannel.value](#)

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [lastPending](./last-pending.md)
# lastPending
`abstract fun lastPending(): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.entity/-pending-transaction/index.md)`>`
Holds the most recent value that was transmitted through the [pendingTransactions](pending-transactions.md) channel. Typically, if the
underlying channel is a BroadcastChannel (and it should be),then this value is simply [pendingChannel.value](#)

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [latestBalance](./latest-balance.md)
# latestBalance
`abstract val latestBalance: WalletBalance`
An in-memory reference to the most recently calculated balance.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [latestHeight](./latest-height.md)
# latestHeight
`abstract val latestHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
An in-memory reference to the latest height seen on the network.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [onChainErrorHandler](./on-chain-error-handler.md)
# onChainErrorHandler
`abstract var onChainErrorHandler: ((`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`) -> `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`)?`
A callback to invoke whenever a chain error is encountered. These occur whenever the
processor detects a missing or non-chain-sequential block (i.e. a reorg).

View File

@@ -0,0 +1,13 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [onCriticalErrorHandler](./on-critical-error-handler.md)
# onCriticalErrorHandler
`abstract var onCriticalErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`
Gets or sets a global error handler. This is a useful hook for handling unexpected critical
errors.
**Return**
true when the error has been handled and the Synchronizer should attempt to continue.
False when the error is unrecoverable and the Synchronizer should [stop](stop.md).

View File

@@ -0,0 +1,13 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [onProcessorErrorHandler](./on-processor-error-handler.md)
# onProcessorErrorHandler
`abstract var onProcessorErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`
An error handler for exceptions during processing. For instance, a block might be missing or
a reorg may get mishandled or the database may get corrupted.
**Return**
true when the error has been handled and the processor should attempt to continue.
False when the error is unrecoverable and the processor should [stop](stop.md).

View File

@@ -0,0 +1,14 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [onSubmissionErrorHandler](./on-submission-error-handler.md)
# onSubmissionErrorHandler
`abstract var onSubmissionErrorHandler: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`
An error handler for exceptions while submitting transactions to lightwalletd. For instance,
a transaction may get rejected because it would be a double-spend or the user might lose
their cellphone signal.
**Return**
true when the error has been handled and the sender should attempt to resend. False
when the error is unrecoverable and the sender should [stop](stop.md).

View File

@@ -0,0 +1,12 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [Synchronizer](index.md) / [onSynchronizerErrorListener](./on-synchronizer-error-listener.md)
# onSynchronizerErrorListener
`abstract var onSynchronizerErrorListener: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`
Gets or sets a global error listener. This is a useful hook for handling unexpected critical errors.
**Return**
true when the error has been handled and the Synchronizer should continue. False when the error is
unrecoverable and the Synchronizer should [stop](stop.md).

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [pendingTransactions](./pending-transactions.md)
# pendingTransactions
`abstract val pendingTransactions: Flow<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`>>`
A flow of all the outbound pending transaction that have been sent but are awaiting
confirmations.

View File

@@ -0,0 +1,10 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [processorInfo](./processor-info.md)
# processorInfo
`abstract val processorInfo: Flow<ProcessorInfo>`
A flow of processor details, updated every time blocks are processed to include the latest
block height, blocks downloaded and blocks scanned. Similar to the [progress](progress.md) flow but with a
lot more detail.

View File

@@ -0,0 +1,10 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [progress](./progress.md)
# progress
`abstract val progress: Flow<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>`
A flow of progress values, typically corresponding to this Synchronizer downloading blocks.
Typically, any non- zero value below 100 indicates that progress indicators can be shown and
a value of 100 signals that progress is complete and any progress indicators can be hidden.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [receivedTransactions](./received-transactions.md)
# receivedTransactions
`abstract val receivedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>`
A flow of all transactions related to receiving funds.

View File

@@ -0,0 +1,26 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [sendToAddress](./send-to-address.md)
# sendToAddress
`abstract fun sendToAddress(spendingKey: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, zatoshi: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, toAddress: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, memo: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = "", fromAccountIndex: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0): Flow<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`>`
Sends zatoshi.
### Parameters
`spendingKey` - the key associated with the notes that will be spent.
`zatoshi` - the amount of zatoshi to send.
`toAddress` - the recipient's address.
`memo` - the optional memo to include as part of the transaction.
`fromAccountIndex` - the optional account id to use. By default, the first account is used.
**Return**
a flow of PendingTransaction objects representing changes to the state of the
transaction. Any time the state changes a new instance will be emitted by this flow. This is
useful for updating the UI without needing to poll. Of course, polling is always an option
for any wallet that wants to ignore this return value.

View File

@@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [sentTransactions](./sent-transactions.md)
# sentTransactions
`abstract val sentTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>`
A flow of all transactions related to sending funds.

View File

@@ -0,0 +1,17 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [start](./start.md)
# start
`abstract fun start(parentScope: CoroutineScope? = null): `[`Synchronizer`](index.md)
Starts this synchronizer within the given scope.
### Parameters
`parentScope` - the scope to use for this synchronizer, typically something with a
lifecycle such as an Activity. Implementations should leverage structured concurrency and
cancel all jobs when this scope completes.
**Return**
an instance of the class so that this function can be used fluidly.

View File

@@ -0,0 +1,9 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [status](./status.md)
# status
`abstract val status: Flow<Status>`
A flow of values representing the [Status](-status/index.md) of this Synchronizer. As the status changes, a new
value will be emitted by this flow.

View File

@@ -0,0 +1,15 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [stop](./stop.md)
# stop
`abstract fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Stop this synchronizer. Implementations should ensure that calling this method cancels all
jobs that were created by this instance.
Note that in most cases, there is no need to call [stop](./stop.md) because the Synchronizer will
automatically stop whenever the parentScope is cancelled. For instance, if that scope is
bound to the lifecycle of the activity, the Synchronizer will stop when the activity stops.
However, if no scope is provided to the start method, then the Synchronizer must be stopped
with this function.

View File

@@ -0,0 +1,19 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [validateAddress](./validate-address.md)
# validateAddress
`abstract suspend fun validateAddress(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`AddressType`](../../cash.z.ecc.android.sdk.validate/-address-type/index.md)
Validates the given address, returning information about why it is invalid. This is a
convenience method that combines the behavior of [isValidShieldedAddr](is-valid-shielded-addr.md) and
[isValidTransparentAddr](is-valid-transparent-addr.md) into one call so that the developer doesn't have to worry about
handling the exceptions that they throw. Rather, exceptions are converted to
[AddressType.Invalid](../../cash.z.ecc.android.sdk.validate/-address-type/-invalid/index.md) which has a `reason` property describing why it is invalid.
### Parameters
`address` - the address to validate.
**Return**
an instance of [AddressType](../../cash.z.ecc.android.sdk.validate/-address-type/index.md) providing validation info regarding the given address.

View File

@@ -0,0 +1,17 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [Synchronizer](index.md) / [validateConsensusBranch](./validate-consensus-branch.md)
# validateConsensusBranch
`abstract suspend fun validateConsensusBranch(): `[`ConsensusMatchType`](../../cash.z.ecc.android.sdk.validate/-consensus-match-type/index.md)
Validate whether the server and this SDK share the same consensus branch. This is
particularly important to check around network updates so that any wallet that's connected to
an incompatible server can surface that information effectively. For the SDK, the consensus
branch is used when creating transactions as each one needs to target a specific branch. This
function compares the server's branch id to this SDK's and returns information that helps
determine whether they match.
**Return**
an instance of [ConsensusMatchType](../../cash.z.ecc.android.sdk.validate/-consensus-match-type/index.md) that is essentially a wrapper for both branch ids
and provides helper functions for communicating detailed errors to the user.