Initial commit
This commit is contained in:
24
docs/-sdk-synchronizer/-init-.md
Normal file
24
docs/-sdk-synchronizer/-init-.md
Normal file
@@ -0,0 +1,24 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [<init>](./-init-.md)
|
||||
|
||||
# <init>
|
||||
|
||||
`SdkSynchronizer(wallet: `[`Wallet`](../../cash.z.ecc.android.sdk.secure/-wallet/index.md)`, ledger: `[`TransactionRepository`](../-transaction-repository/index.md)`, sender: `[`TransactionSender`](../-transaction-sender/index.md)`, processor: `[`CompactBlockProcessor`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/index.md)`, encoder: `[`TransactionEncoder`](../-transaction-encoder/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.
|
||||
|
||||
### Parameters
|
||||
|
||||
`wallet` - the component that wraps the JNI layer that interacts with the rust backend and manages wallet config.
|
||||
|
||||
`repository` - the component that exposes streams of wallet transaction information.
|
||||
|
||||
`sender` - the component responsible for sending transactions to lightwalletd in order to spend funds.
|
||||
|
||||
`processor` - the component that saves the downloaded compact blocks to the cache and then scans those blocks for
|
||||
data related to this wallet.
|
||||
|
||||
`encoder` - the component that creates a signed transaction, used for spending funds.
|
||||
14
docs/-sdk-synchronizer/-sync-state/-cache-only/-init-.md
Normal file
14
docs/-sdk-synchronizer/-sync-state/-cache-only/-init-.md
Normal file
@@ -0,0 +1,14 @@
|
||||
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.ecc.android.sdk.data](../../../index.md) / [SdkSynchronizer](../../index.md) / [SyncState](../index.md) / [CacheOnly](index.md) / [<init>](./-init-.md)
|
||||
|
||||
# <init>
|
||||
|
||||
`CacheOnly(startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = Int.MAX_VALUE)`
|
||||
|
||||
State for when compact blocks have been downloaded but not scanned. This state is typically achieved when the
|
||||
app was previously started but killed before the first scan took place. In this case, we do not need to
|
||||
download compact blocks that we already have.
|
||||
|
||||
### Parameters
|
||||
|
||||
`startingBlockHeight` - the last block that has been downloaded into the cache. We do not need to download
|
||||
any blocks before this height because we already have them.
|
||||
26
docs/-sdk-synchronizer/-sync-state/-cache-only/README.md
Normal file
26
docs/-sdk-synchronizer/-sync-state/-cache-only/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.ecc.android.sdk.data](../../../index.md) / [SdkSynchronizer](../../index.md) / [SyncState](../index.md) / [CacheOnly](./index.md)
|
||||
|
||||
# CacheOnly
|
||||
|
||||
`class CacheOnly : `[`SdkSynchronizer.SyncState`](../index.md)
|
||||
|
||||
State for when compact blocks have been downloaded but not scanned. This state is typically achieved when the
|
||||
app was previously started but killed before the first scan took place. In this case, we do not need to
|
||||
download compact blocks that we already have.
|
||||
|
||||
### Parameters
|
||||
|
||||
`startingBlockHeight` - the last block that has been downloaded into the cache. We do not need to download
|
||||
any blocks before this height because we already have them.
|
||||
|
||||
### Constructors
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [<init>](-init-.md) | `CacheOnly(startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = Int.MAX_VALUE)`<br>State for when compact blocks have been downloaded but not scanned. This state is typically achieved when the app was previously started but killed before the first scan took place. In this case, we do not need to download compact blocks that we already have. |
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [startingBlockHeight](starting-block-height.md) | `val startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>the last block that has been downloaded into the cache. We do not need to download any blocks before this height because we already have them. |
|
||||
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.ecc.android.sdk.data](../../../index.md) / [SdkSynchronizer](../../index.md) / [SyncState](../index.md) / [CacheOnly](index.md) / [startingBlockHeight](./starting-block-height.md)
|
||||
|
||||
# startingBlockHeight
|
||||
|
||||
`val startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
|
||||
|
||||
the last block that has been downloaded into the cache. We do not need to download
|
||||
any blocks before this height because we already have them.
|
||||
|
||||
8
docs/-sdk-synchronizer/-sync-state/-first-run.md
Normal file
8
docs/-sdk-synchronizer/-sync-state/-first-run.md
Normal file
@@ -0,0 +1,8 @@
|
||||
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk.data](../../index.md) / [SdkSynchronizer](../index.md) / [SyncState](index.md) / [FirstRun](./-first-run.md)
|
||||
|
||||
# FirstRun
|
||||
|
||||
`object FirstRun : `[`SdkSynchronizer.SyncState`](index.md)
|
||||
|
||||
State for the first run of the Synchronizer, when the database has not been initialized.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.ecc.android.sdk.data](../../../index.md) / [SdkSynchronizer](../../index.md) / [SyncState](../index.md) / [ReadyToProcess](index.md) / [<init>](./-init-.md)
|
||||
|
||||
# <init>
|
||||
|
||||
`ReadyToProcess(startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = Int.MAX_VALUE)`
|
||||
|
||||
The final state of the Synchronizer, when all initialization is complete and the starting block is known.
|
||||
|
||||
### Parameters
|
||||
|
||||
`startingBlockHeight` - the height that will be fed to the downloader. In most cases, it will represent
|
||||
either the wallet birthday or the last block that was processed in the previous session.
|
||||
@@ -0,0 +1,24 @@
|
||||
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.ecc.android.sdk.data](../../../index.md) / [SdkSynchronizer](../../index.md) / [SyncState](../index.md) / [ReadyToProcess](./index.md)
|
||||
|
||||
# ReadyToProcess
|
||||
|
||||
`class ReadyToProcess : `[`SdkSynchronizer.SyncState`](../index.md)
|
||||
|
||||
The final state of the Synchronizer, when all initialization is complete and the starting block is known.
|
||||
|
||||
### Parameters
|
||||
|
||||
`startingBlockHeight` - the height that will be fed to the downloader. In most cases, it will represent
|
||||
either the wallet birthday or the last block that was processed in the previous session.
|
||||
|
||||
### Constructors
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [<init>](-init-.md) | `ReadyToProcess(startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = Int.MAX_VALUE)`<br>The final state of the Synchronizer, when all initialization is complete and the starting block is known. |
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [startingBlockHeight](starting-block-height.md) | `val startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)<br>the height that will be fed to the downloader. In most cases, it will represent either the wallet birthday or the last block that was processed in the previous session. |
|
||||
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../../../index.md) / [cash.z.ecc.android.sdk.data](../../../index.md) / [SdkSynchronizer](../../index.md) / [SyncState](../index.md) / [ReadyToProcess](index.md) / [startingBlockHeight](./starting-block-height.md)
|
||||
|
||||
# startingBlockHeight
|
||||
|
||||
`val startingBlockHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
|
||||
|
||||
the height that will be fed to the downloader. In most cases, it will represent
|
||||
either the wallet birthday or the last block that was processed in the previous session.
|
||||
|
||||
23
docs/-sdk-synchronizer/-sync-state/README.md
Normal file
23
docs/-sdk-synchronizer/-sync-state/README.md
Normal file
@@ -0,0 +1,23 @@
|
||||
[zcash-android-wallet-sdk](../../../index.md) / [cash.z.ecc.android.sdk.data](../../index.md) / [SdkSynchronizer](../index.md) / [SyncState](./index.md)
|
||||
|
||||
# SyncState
|
||||
|
||||
`sealed class SyncState`
|
||||
|
||||
Represents the initial state of the Synchronizer.
|
||||
|
||||
### Types
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [CacheOnly](-cache-only/index.md) | `class CacheOnly : `[`SdkSynchronizer.SyncState`](./index.md)<br>State for when compact blocks have been downloaded but not scanned. This state is typically achieved when the app was previously started but killed before the first scan took place. In this case, we do not need to download compact blocks that we already have. |
|
||||
| [FirstRun](-first-run.md) | `object FirstRun : `[`SdkSynchronizer.SyncState`](./index.md)<br>State for the first run of the Synchronizer, when the database has not been initialized. |
|
||||
| [ReadyToProcess](-ready-to-process/index.md) | `class ReadyToProcess : `[`SdkSynchronizer.SyncState`](./index.md)<br>The final state of the Synchronizer, when all initialization is complete and the starting block is known. |
|
||||
|
||||
### Inheritors
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [CacheOnly](-cache-only/index.md) | `class CacheOnly : `[`SdkSynchronizer.SyncState`](./index.md)<br>State for when compact blocks have been downloaded but not scanned. This state is typically achieved when the app was previously started but killed before the first scan took place. In this case, we do not need to download compact blocks that we already have. |
|
||||
| [FirstRun](-first-run.md) | `object FirstRun : `[`SdkSynchronizer.SyncState`](./index.md)<br>State for the first run of the Synchronizer, when the database has not been initialized. |
|
||||
| [ReadyToProcess](-ready-to-process/index.md) | `class ReadyToProcess : `[`SdkSynchronizer.SyncState`](./index.md)<br>The final state of the Synchronizer, when all initialization is complete and the starting block is known. |
|
||||
53
docs/-sdk-synchronizer/README.md
Normal file
53
docs/-sdk-synchronizer/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk](../index.md) / [SdkSynchronizer](./index.md)
|
||||
|
||||
# SdkSynchronizer
|
||||
|
||||
`@ExperimentalCoroutinesApi class SdkSynchronizer : `[`Synchronizer`](../-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.
|
||||
|
||||
### Parameters
|
||||
|
||||
`ledger` - exposes flows of wallet transaction information.
|
||||
|
||||
`manager` - manages and tracks outbound transactions.
|
||||
|
||||
`processor` - saves the downloaded compact blocks to the cache and then scans those blocks for
|
||||
data related to this wallet.
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [balances](balances.md) | `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) | `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. |
|
||||
| [coroutineScope](coroutine-scope.md) | `lateinit var coroutineScope: CoroutineScope`<br>The lifespan of this Synchronizer. This scope is initialized once the Synchronizer starts because it will be a child of the parentScope that gets passed into the [start](start.md) function. Everything launched by this Synchronizer will be cancelled once the Synchronizer or its parentScope stops. This is a lateinit rather than nullable property so that it fails early rather than silently, whenever the scope is used before the Synchronizer has been started. |
|
||||
| [onCriticalErrorHandler](on-critical-error-handler.md) | `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>A callback to invoke whenever an uncaught error is encountered. By definition, the return value of the function is ignored because this error is unrecoverable. The only reason the function has a return value is so that all error handlers work with the same signature which allows one function to handle all errors in simple apps. This callback is not called on the main thread so any UI work would need to switch context to the main thread. |
|
||||
| [onProcessorErrorHandler](on-processor-error-handler.md) | `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>A callback to invoke whenever a processor error is encountered. Returning true signals that the error was handled and a retry attempt should be made, if possible. This callback is not called on the main thread so any UI work would need to switch context to the main thread. |
|
||||
| [onSubmissionErrorHandler](on-submission-error-handler.md) | `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>A callback to invoke whenever a server error is encountered while submitting a transaction to lightwalletd. Returning true signals that the error was handled and a retry attempt should be made, if possible. This callback is not called on the main thread so any UI work would need to switch context to the main thread. |
|
||||
| [pendingTransactions](pending-transactions.md) | `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. |
|
||||
| [processor](processor.md) | `val processor: `[`CompactBlockProcessor`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/index.md)<br>saves the downloaded compact blocks to the cache and then scans those blocks for data related to this wallet. |
|
||||
| [processorInfo](processor-info.md) | `val processorInfo: Flow<`[`CompactBlockProcessor.ProcessorInfo`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/-processor-info/index.md)`>`<br>Indicates the latest information about the blocks that have been processed by the SDK. This is very helpful for conveying detailed progress and status to the user. |
|
||||
| [progress](progress.md) | `val progress: Flow<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>`<br>Indicates the download progress of the Synchronizer. When progress reaches 100, that signals that the Synchronizer is in sync with the network. Balances should be considered inaccurate and outbound transactions should be prevented until this sync is complete. It is a simplified version of [processorInfo](processor-info.md). |
|
||||
| [receivedTransactions](received-transactions.md) | `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) | `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) | `val status: Flow<`[`Synchronizer.Status`](../-synchronizer/-status/index.md)`>`<br>Indicates the status of this Synchronizer. This implementation basically simplifies the status of the processor to focus only on the high level states that matter most. Whenever the processor is finished scanning, the synchronizer updates transaction and balance info and then emits a [SYNCED](../-synchronizer/-status/-s-y-n-c-e-d.md) status. |
|
||||
|
||||
### Functions
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [cancelSpend](cancel-spend.md) | `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) | `suspend fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`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) | `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) | `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 |
|
||||
| [refreshBalance](refresh-balance.md) | `suspend fun refreshBalance(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [sendToAddress](send-to-address.md) | `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)`): Flow<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.entity/-pending-transaction/index.md)`>`<br>Sends zatoshi. |
|
||||
| [start](start.md) | `fun start(parentScope: CoroutineScope?): `[`Synchronizer`](../-synchronizer/index.md)<br>Starts this synchronizer within the given scope. For simplicity, attempting to start an instance that has already been started will throw a [SynchronizerException.FalseStart](../../cash.z.ecc.android.sdk.exception/-synchronizer-exception/-false-start.md) exception. This reduces the complexity of managing resources that must be recycled. Instead, each synchronizer is designed to have a long lifespan and should be started from an activity, application or session. |
|
||||
| [stop](stop.md) | `fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stop this synchronizer and all of its child jobs. Once a synchronizer has been stopped it should not be restarted and attempting to do so will result in an error. Also, this function will throw an exception if the synchronizer was never previously started. |
|
||||
| [validateAddress](validate-address.md) | `suspend fun validateAddress(address: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Synchronizer.AddressType`](../-synchronizer/-address-type/index.md)<br>Validates the given address, returning information about why it is invalid. |
|
||||
10
docs/-sdk-synchronizer/active-transactions.md
Normal file
10
docs/-sdk-synchronizer/active-transactions.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [activeTransactions](./active-transactions.md)
|
||||
|
||||
# activeTransactions
|
||||
|
||||
`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)`>>`
|
||||
|
||||
Overrides [Synchronizer.activeTransactions](../-synchronizer/active-transactions.md)
|
||||
|
||||
A stream of all the wallet transactions, delegated to the [activeTransactionManager](#).
|
||||
|
||||
10
docs/-sdk-synchronizer/all-transactions.md
Normal file
10
docs/-sdk-synchronizer/all-transactions.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [allTransactions](./all-transactions.md)
|
||||
|
||||
# allTransactions
|
||||
|
||||
`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)`>>`
|
||||
|
||||
Overrides [Synchronizer.allTransactions](../-synchronizer/all-transactions.md)
|
||||
|
||||
A stream of all the wallet transactions, delegated to the [repository](#).
|
||||
|
||||
10
docs/-sdk-synchronizer/balance.md
Normal file
10
docs/-sdk-synchronizer/balance.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [balance](./balance.md)
|
||||
|
||||
# balance
|
||||
|
||||
`fun balance(): ReceiveChannel<`[`Wallet.WalletBalance`](../../cash.z.ecc.android.sdk.secure/-wallet/-wallet-balance/index.md)`>`
|
||||
|
||||
Overrides [Synchronizer.balance](../-synchronizer/balance.md)
|
||||
|
||||
A stream of balance values, delegated to the [wallet](#).
|
||||
|
||||
8
docs/-sdk-synchronizer/balances.md
Normal file
8
docs/-sdk-synchronizer/balances.md
Normal file
@@ -0,0 +1,8 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [balances](./balances.md)
|
||||
|
||||
# balances
|
||||
|
||||
`val balances: Flow<WalletBalance>`
|
||||
|
||||
A stream of balance values, separately reflecting both the available and total balance.
|
||||
|
||||
18
docs/-sdk-synchronizer/cancel-send.md
Normal file
18
docs/-sdk-synchronizer/cancel-send.md
Normal file
@@ -0,0 +1,18 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [cancelSend](./cancel-send.md)
|
||||
|
||||
# cancelSend
|
||||
|
||||
`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)
|
||||
|
||||
Overrides [Synchronizer.cancelSend](../-synchronizer/cancel-send.md)
|
||||
|
||||
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.
|
||||
|
||||
16
docs/-sdk-synchronizer/cancel-spend.md
Normal file
16
docs/-sdk-synchronizer/cancel-spend.md
Normal file
@@ -0,0 +1,16 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [cancelSpend](./cancel-spend.md)
|
||||
|
||||
# cancelSpend
|
||||
|
||||
`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.
|
||||
|
||||
12
docs/-sdk-synchronizer/channel.md
Normal file
12
docs/-sdk-synchronizer/channel.md
Normal file
@@ -0,0 +1,12 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [channel](./channel.md)
|
||||
|
||||
# channel
|
||||
|
||||
`val channel: ManagedChannel`
|
||||
|
||||
The channel that this Synchronizer uses to communicate with lightwalletd. In most cases, this
|
||||
should not be needed or used. Instead, APIs should be added to the synchronizer to
|
||||
enable the desired behavior. In the rare case, such as testing, it can be helpful to share
|
||||
the underlying channel to connect to the same service, and use other APIs
|
||||
(such as darksidewalletd) because channels are heavyweight.
|
||||
|
||||
8
docs/-sdk-synchronizer/cleared-transactions.md
Normal file
8
docs/-sdk-synchronizer/cleared-transactions.md
Normal file
@@ -0,0 +1,8 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [clearedTransactions](./cleared-transactions.md)
|
||||
|
||||
# clearedTransactions
|
||||
|
||||
`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.
|
||||
|
||||
12
docs/-sdk-synchronizer/coroutine-scope.md
Normal file
12
docs/-sdk-synchronizer/coroutine-scope.md
Normal file
@@ -0,0 +1,12 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [coroutineScope](./coroutine-scope.md)
|
||||
|
||||
# coroutineScope
|
||||
|
||||
`var coroutineScope: CoroutineScope`
|
||||
|
||||
The lifespan of this Synchronizer. This scope is initialized once the Synchronizer starts
|
||||
because it will be a child of the parentScope that gets passed into the [start](start.md) function.
|
||||
Everything launched by this Synchronizer will be cancelled once the Synchronizer or its
|
||||
parentScope stops. This coordinates with [isStarted](is-started.md) so that it fails early
|
||||
rather than silently, whenever the scope is used before the Synchronizer has been started.
|
||||
|
||||
5
docs/-sdk-synchronizer/find-block-hash-as-hex.md
Normal file
5
docs/-sdk-synchronizer/find-block-hash-as-hex.md
Normal file
@@ -0,0 +1,5 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [findBlockHashAsHex](./find-block-hash-as-hex.md)
|
||||
|
||||
# findBlockHashAsHex
|
||||
|
||||
`fun findBlockHashAsHex(height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`
|
||||
5
docs/-sdk-synchronizer/find-block-hash.md
Normal file
5
docs/-sdk-synchronizer/find-block-hash.md
Normal file
@@ -0,0 +1,5 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [findBlockHash](./find-block-hash.md)
|
||||
|
||||
# findBlockHash
|
||||
|
||||
`fun findBlockHash(height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`ByteArray`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)`?`
|
||||
16
docs/-sdk-synchronizer/get-address.md
Normal file
16
docs/-sdk-synchronizer/get-address.md
Normal file
@@ -0,0 +1,16 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [getAddress](./get-address.md)
|
||||
|
||||
# getAddress
|
||||
|
||||
`suspend fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`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.
|
||||
|
||||
10
docs/-sdk-synchronizer/get-server-info.md
Normal file
10
docs/-sdk-synchronizer/get-server-info.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [getServerInfo](./get-server-info.md)
|
||||
|
||||
# getServerInfo
|
||||
|
||||
`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.
|
||||
|
||||
5
docs/-sdk-synchronizer/get-transaction-count.md
Normal file
5
docs/-sdk-synchronizer/get-transaction-count.md
Normal file
@@ -0,0 +1,5 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [getTransactionCount](./get-transaction-count.md)
|
||||
|
||||
# getTransactionCount
|
||||
|
||||
`fun getTransactionCount(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
|
||||
54
docs/-sdk-synchronizer/index.md
Normal file
54
docs/-sdk-synchronizer/index.md
Normal file
@@ -0,0 +1,54 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](./index.md)
|
||||
|
||||
# SdkSynchronizer
|
||||
|
||||
`@ExperimentalCoroutinesApi class SdkSynchronizer : `[`Synchronizer`](../-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.
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Summary |
|
||||
|---|---|
|
||||
| [balances](balances.md) | A stream of balance values, separately reflecting both the available and total balance.`val balances: Flow<WalletBalance>` |
|
||||
| [channel](channel.md) | The channel that this Synchronizer uses to communicate with lightwalletd. In most cases, this should not be needed or used. Instead, APIs should be added to the synchronizer to enable the desired behavior. In the rare case, such as testing, it can be helpful to share the underlying channel to connect to the same service, and use other APIs (such as darksidewalletd) because channels are heavyweight.`val channel: ManagedChannel` |
|
||||
| [clearedTransactions](cleared-transactions.md) | A flow of all the transactions that are on the blockchain.`val clearedTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>` |
|
||||
| [coroutineScope](coroutine-scope.md) | The lifespan of this Synchronizer. This scope is initialized once the Synchronizer starts because it will be a child of the parentScope that gets passed into the [start](start.md) function. Everything launched by this Synchronizer will be cancelled once the Synchronizer or its parentScope stops. This coordinates with [isStarted](is-started.md) so that it fails early rather than silently, whenever the scope is used before the Synchronizer has been started.`var coroutineScope: CoroutineScope` |
|
||||
| [isStarted](is-started.md) | `var isStarted: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
|
||||
| [latestBalance](latest-balance.md) | Convenience function for the latest balance. Instead of using this, a wallet will more likely want to consume the flow of balances using [balances](balances.md).`val latestBalance: WalletBalance` |
|
||||
| [latestHeight](latest-height.md) | Convenience function for the latest height. Specifically, this value represents the last height that the synchronizer has observed from the lightwalletd server. Instead of using this, a wallet will more likely want to consume the flow of processor info using [processorInfo](processor-info.md).`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).`var onChainErrorHandler: ((errorHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, rewindHeight: `[`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) | A callback to invoke whenever an uncaught error is encountered. By definition, the return value of the function is ignored because this error is unrecoverable. The only reason the function has a return value is so that all error handlers work with the same signature which allows one function to handle all errors in simple apps. This callback is not called on the main thread so any UI work would need to switch context to the main thread.`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) | A callback to invoke whenever a processor error is encountered. Returning true signals that the error was handled and a retry attempt should be made, if possible. This callback is not called on the main thread so any UI work would need to switch context to the main thread.`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) | A callback to invoke whenever a server error is encountered while submitting a transaction to lightwalletd. Returning true signals that the error was handled and a retry attempt should be made, if possible. This callback is not called on the main thread so any UI work would need to switch context to the main thread.`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.`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)`>>` |
|
||||
| [processor](processor.md) | saves the downloaded compact blocks to the cache and then scans those blocks for data related to this wallet.`val processor: `[`CompactBlockProcessor`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/index.md) |
|
||||
| [processorInfo](processor-info.md) | Indicates the latest information about the blocks that have been processed by the SDK. This is very helpful for conveying detailed progress and status to the user.`val processorInfo: Flow<ProcessorInfo>` |
|
||||
| [progress](progress.md) | Indicates the download progress of the Synchronizer. When progress reaches 100, that signals that the Synchronizer is in sync with the network. Balances should be considered inaccurate and outbound transactions should be prevented until this sync is complete. It is a simplified version of [processorInfo](processor-info.md).`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.`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.`val sentTransactions: Flow<PagedList<`[`ConfirmedTransaction`](../../cash.z.ecc.android.sdk.db.entity/-confirmed-transaction/index.md)`>>` |
|
||||
| [status](status.md) | Indicates the status of this Synchronizer. This implementation basically simplifies the status of the processor to focus only on the high level states that matter most. Whenever the processor is finished scanning, the synchronizer updates transaction and balance info and then emits a [SYNCED](../-synchronizer/-status/-s-y-n-c-e-d.md) status.`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.`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) |
|
||||
| [findBlockHash](find-block-hash.md) | `fun findBlockHash(height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`ByteArray`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)`?` |
|
||||
| [findBlockHashAsHex](find-block-hash-as-hex.md) | `fun findBlockHashAsHex(height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` |
|
||||
| [getAddress](get-address.md) | Gets the address for the given account.`suspend fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`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.`suspend fun getServerInfo(): <ERROR CLASS>` |
|
||||
| [getTransactionCount](get-transaction-count.md) | `fun getTransactionCount(): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
|
||||
| [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`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`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) |
|
||||
| [refreshBalance](refresh-balance.md) | Calculate the latest balance, based on the blocks that have been scanned and transmit this information into the flow of [balances](balances.md).`suspend fun refreshBalance(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
|
||||
| [sendToAddress](send-to-address.md) | Sends zatoshi.`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)`): Flow<`[`PendingTransaction`](../../cash.z.ecc.android.sdk.db.entity/-pending-transaction/index.md)`>` |
|
||||
| [start](start.md) | Starts this synchronizer within the given scope. For simplicity, attempting to start an instance that has already been started will throw a [SynchronizerException.FalseStart](../../cash.z.ecc.android.sdk.exception/-synchronizer-exception/-false-start.md) exception. This reduces the complexity of managing resources that must be recycled. Instead, each synchronizer is designed to have a long lifespan and should be started from an activity, application or session.`fun start(parentScope: CoroutineScope?): `[`Synchronizer`](../-synchronizer/index.md) |
|
||||
| [stop](stop.md) | Stop this synchronizer and all of its child jobs. Once a synchronizer has been stopped it should not be restarted and attempting to do so will result in an error. Also, this function will throw an exception if the synchronizer was never previously started.`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](../-synchronizer/is-valid-shielded-addr.md) and [isValidTransparentAddr](../-synchronizer/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.`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.`suspend fun validateConsensusBranch(): `[`ConsensusMatchType`](../../cash.z.ecc.android.sdk.validate/-consensus-match-type/index.md) |
|
||||
10
docs/-sdk-synchronizer/is-connected.md
Normal file
10
docs/-sdk-synchronizer/is-connected.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [isConnected](./is-connected.md)
|
||||
|
||||
# isConnected
|
||||
|
||||
`val isConnected: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [Synchronizer.isConnected](../-synchronizer/is-connected.md)
|
||||
|
||||
A property that is true while a connection to the lightwalletd server exists.
|
||||
|
||||
15
docs/-sdk-synchronizer/is-first-run.md
Normal file
15
docs/-sdk-synchronizer/is-first-run.md
Normal file
@@ -0,0 +1,15 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [isFirstRun](./is-first-run.md)
|
||||
|
||||
# isFirstRun
|
||||
|
||||
`suspend fun isFirstRun(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [Synchronizer.isFirstRun](../-synchronizer/is-first-run.md)
|
||||
|
||||
A flag to indicate that the initial state of this synchronizer was firstRun. This is useful for knowing whether
|
||||
initializing the database is required and whether to show things like"first run walk-throughs."
|
||||
|
||||
**Return**
|
||||
true when this synchronizer has not been run before on this device or when cache has been cleared since
|
||||
the last run.
|
||||
|
||||
10
docs/-sdk-synchronizer/is-scanning.md
Normal file
10
docs/-sdk-synchronizer/is-scanning.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [isScanning](./is-scanning.md)
|
||||
|
||||
# isScanning
|
||||
|
||||
`val isScanning: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [Synchronizer.isScanning](../-synchronizer/is-scanning.md)
|
||||
|
||||
A property that is true while actively scanning the cache of compact blocks for transactions.
|
||||
|
||||
18
docs/-sdk-synchronizer/is-stale.md
Normal file
18
docs/-sdk-synchronizer/is-stale.md
Normal file
@@ -0,0 +1,18 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [isStale](./is-stale.md)
|
||||
|
||||
# isStale
|
||||
|
||||
`suspend fun isStale(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [Synchronizer.isStale](../-synchronizer/is-stale.md)
|
||||
|
||||
A flag to indicate that this Synchronizer is significantly out of sync with it's server. This is determined by
|
||||
the delta between the current block height reported by the server and the latest block we have stored in cache.
|
||||
Whenever this delta is greater than the [staleTolerance](#), this function returns true. This is intended for
|
||||
showing progress indicators when the user returns to the app after having not used it for a long period.
|
||||
Typically, this means the user may have to wait for downloading to occur and the current balance and transaction
|
||||
information cannot be trusted as 100% accurate.
|
||||
|
||||
**Return**
|
||||
true when the local data is significantly out of sync with the remote server and the app data is stale.
|
||||
|
||||
5
docs/-sdk-synchronizer/is-started.md
Normal file
5
docs/-sdk-synchronizer/is-started.md
Normal file
@@ -0,0 +1,5 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [isStarted](./is-started.md)
|
||||
|
||||
# isStarted
|
||||
|
||||
`var isStarted: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
10
docs/-sdk-synchronizer/is-syncing.md
Normal file
10
docs/-sdk-synchronizer/is-syncing.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [isSyncing](./is-syncing.md)
|
||||
|
||||
# isSyncing
|
||||
|
||||
`val isSyncing: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
|
||||
|
||||
Overrides [Synchronizer.isSyncing](../-synchronizer/is-syncing.md)
|
||||
|
||||
A property that is true while actively downloading blocks from lightwalletd.
|
||||
|
||||
20
docs/-sdk-synchronizer/is-valid-shielded-addr.md
Normal file
20
docs/-sdk-synchronizer/is-valid-shielded-addr.md
Normal file
@@ -0,0 +1,20 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [isValidShieldedAddr](./is-valid-shielded-addr.md)
|
||||
|
||||
# isValidShieldedAddr
|
||||
|
||||
`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.
|
||||
|
||||
20
docs/-sdk-synchronizer/is-valid-transparent-addr.md
Normal file
20
docs/-sdk-synchronizer/is-valid-transparent-addr.md
Normal file
@@ -0,0 +1,20 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [isValidTransparentAddr](./is-valid-transparent-addr.md)
|
||||
|
||||
# isValidTransparentAddr
|
||||
|
||||
`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.
|
||||
|
||||
11
docs/-sdk-synchronizer/last-balance.md
Normal file
11
docs/-sdk-synchronizer/last-balance.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [lastBalance](./last-balance.md)
|
||||
|
||||
# lastBalance
|
||||
|
||||
`fun lastBalance(): `[`Wallet.WalletBalance`](../../cash.z.ecc.android.sdk.secure/-wallet/-wallet-balance/index.md)
|
||||
|
||||
Overrides [Synchronizer.lastBalance](../-synchronizer/last-balance.md)
|
||||
|
||||
Holds the most recent value that was transmitted through the [balances](../-synchronizer/balances.md) channel. Typically, if the
|
||||
underlying channel is a BroadcastChannel (and it should be), then this value is simply [balanceChannel.value](#)
|
||||
|
||||
11
docs/-sdk-synchronizer/last-cleared.md
Normal file
11
docs/-sdk-synchronizer/last-cleared.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [lastCleared](./last-cleared.md)
|
||||
|
||||
# lastCleared
|
||||
|
||||
`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)`>`
|
||||
|
||||
Overrides [Synchronizer.lastCleared](../-synchronizer/last-cleared.md)
|
||||
|
||||
Holds the most recent value that was transmitted through the [clearedTransactions](../-synchronizer/cleared-transactions.md) channel. Typically, if the
|
||||
underlying channel is a BroadcastChannel (and it should be), then this value is simply [clearedChannel.value](#)
|
||||
|
||||
11
docs/-sdk-synchronizer/last-pending.md
Normal file
11
docs/-sdk-synchronizer/last-pending.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [lastPending](./last-pending.md)
|
||||
|
||||
# lastPending
|
||||
|
||||
`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)`>`
|
||||
|
||||
Overrides [Synchronizer.lastPending](../-synchronizer/last-pending.md)
|
||||
|
||||
Holds the most recent value that was transmitted through the [pendingTransactions](../-synchronizer/pending-transactions.md) channel. Typically, if the
|
||||
underlying channel is a BroadcastChannel (and it should be),then this value is simply [pendingChannel.value](#)
|
||||
|
||||
9
docs/-sdk-synchronizer/latest-balance.md
Normal file
9
docs/-sdk-synchronizer/latest-balance.md
Normal file
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [latestBalance](./latest-balance.md)
|
||||
|
||||
# latestBalance
|
||||
|
||||
`val latestBalance: WalletBalance`
|
||||
|
||||
Convenience function for the latest balance. Instead of using this, a wallet will more likely
|
||||
want to consume the flow of balances using [balances](balances.md).
|
||||
|
||||
11
docs/-sdk-synchronizer/latest-height.md
Normal file
11
docs/-sdk-synchronizer/latest-height.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [latestHeight](./latest-height.md)
|
||||
|
||||
# latestHeight
|
||||
|
||||
`val latestHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
|
||||
|
||||
Convenience function for the latest height. Specifically, this value represents the last
|
||||
height that the synchronizer has observed from the lightwalletd server. Instead of using
|
||||
this, a wallet will more likely want to consume the flow of processor info using
|
||||
[processorInfo](processor-info.md).
|
||||
|
||||
9
docs/-sdk-synchronizer/on-chain-error-handler.md
Normal file
9
docs/-sdk-synchronizer/on-chain-error-handler.md
Normal file
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [onChainErrorHandler](./on-chain-error-handler.md)
|
||||
|
||||
# onChainErrorHandler
|
||||
|
||||
`var onChainErrorHandler: ((errorHeight: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, rewindHeight: `[`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).
|
||||
|
||||
12
docs/-sdk-synchronizer/on-critical-error-handler.md
Normal file
12
docs/-sdk-synchronizer/on-critical-error-handler.md
Normal file
@@ -0,0 +1,12 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [onCriticalErrorHandler](./on-critical-error-handler.md)
|
||||
|
||||
# onCriticalErrorHandler
|
||||
|
||||
`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)`)?`
|
||||
|
||||
A callback to invoke whenever an uncaught error is encountered. By definition, the return
|
||||
value of the function is ignored because this error is unrecoverable. The only reason the
|
||||
function has a return value is so that all error handlers work with the same signature which
|
||||
allows one function to handle all errors in simple apps. This callback is not called on the
|
||||
main thread so any UI work would need to switch context to the main thread.
|
||||
|
||||
10
docs/-sdk-synchronizer/on-processor-error-handler.md
Normal file
10
docs/-sdk-synchronizer/on-processor-error-handler.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [onProcessorErrorHandler](./on-processor-error-handler.md)
|
||||
|
||||
# onProcessorErrorHandler
|
||||
|
||||
`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)`)?`
|
||||
|
||||
A callback to invoke whenever a processor error is encountered. Returning true signals that
|
||||
the error was handled and a retry attempt should be made, if possible. This callback is not
|
||||
called on the main thread so any UI work would need to switch context to the main thread.
|
||||
|
||||
11
docs/-sdk-synchronizer/on-submission-error-handler.md
Normal file
11
docs/-sdk-synchronizer/on-submission-error-handler.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [onSubmissionErrorHandler](./on-submission-error-handler.md)
|
||||
|
||||
# onSubmissionErrorHandler
|
||||
|
||||
`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)`)?`
|
||||
|
||||
A callback to invoke whenever a server error is encountered while submitting a transaction to
|
||||
lightwalletd. Returning true signals that the error was handled and a retry attempt should be
|
||||
made, if possible. This callback is not called on the main thread so any UI work would need
|
||||
to switch context to the main thread.
|
||||
|
||||
10
docs/-sdk-synchronizer/on-synchronizer-error-listener.md
Normal file
10
docs/-sdk-synchronizer/on-synchronizer-error-listener.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [onSynchronizerErrorListener](./on-synchronizer-error-listener.md)
|
||||
|
||||
# onSynchronizerErrorListener
|
||||
|
||||
`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)`)?`
|
||||
|
||||
Overrides [Synchronizer.onSynchronizerErrorListener](../-synchronizer/on-synchronizer-error-listener.md)
|
||||
|
||||
Sets a listener to be notified of uncaught Synchronizer errors. When null, errors will only be logged.
|
||||
|
||||
5
docs/-sdk-synchronizer/on-transactions-changed.md
Normal file
5
docs/-sdk-synchronizer/on-transactions-changed.md
Normal file
@@ -0,0 +1,5 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk.data](../index.md) / [SdkSynchronizer](index.md) / [onTransactionsChanged](./on-transactions-changed.md)
|
||||
|
||||
# onTransactionsChanged
|
||||
|
||||
`fun onTransactionsChanged(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
9
docs/-sdk-synchronizer/pending-transactions.md
Normal file
9
docs/-sdk-synchronizer/pending-transactions.md
Normal file
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [pendingTransactions](./pending-transactions.md)
|
||||
|
||||
# pendingTransactions
|
||||
|
||||
`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.
|
||||
|
||||
9
docs/-sdk-synchronizer/processor-info.md
Normal file
9
docs/-sdk-synchronizer/processor-info.md
Normal file
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [processorInfo](./processor-info.md)
|
||||
|
||||
# processorInfo
|
||||
|
||||
`val processorInfo: Flow<ProcessorInfo>`
|
||||
|
||||
Indicates the latest information about the blocks that have been processed by the SDK. This
|
||||
is very helpful for conveying detailed progress and status to the user.
|
||||
|
||||
13
docs/-sdk-synchronizer/processor.md
Normal file
13
docs/-sdk-synchronizer/processor.md
Normal file
@@ -0,0 +1,13 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [processor](./processor.md)
|
||||
|
||||
# processor
|
||||
|
||||
`val processor: `[`CompactBlockProcessor`](../../cash.z.ecc.android.sdk.block/-compact-block-processor/index.md)
|
||||
|
||||
saves the downloaded compact blocks to the cache and then scans those blocks for
|
||||
data related to this wallet.
|
||||
|
||||
### Property
|
||||
|
||||
`processor` - saves the downloaded compact blocks to the cache and then scans those blocks for
|
||||
data related to this wallet.
|
||||
11
docs/-sdk-synchronizer/progress.md
Normal file
11
docs/-sdk-synchronizer/progress.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [progress](./progress.md)
|
||||
|
||||
# progress
|
||||
|
||||
`val progress: Flow<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>`
|
||||
|
||||
Indicates the download progress of the Synchronizer. When progress reaches 100, that
|
||||
signals that the Synchronizer is in sync with the network. Balances should be considered
|
||||
inaccurate and outbound transactions should be prevented until this sync is complete. It is
|
||||
a simplified version of [processorInfo](processor-info.md).
|
||||
|
||||
8
docs/-sdk-synchronizer/received-transactions.md
Normal file
8
docs/-sdk-synchronizer/received-transactions.md
Normal file
@@ -0,0 +1,8 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [receivedTransactions](./received-transactions.md)
|
||||
|
||||
# receivedTransactions
|
||||
|
||||
`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.
|
||||
|
||||
9
docs/-sdk-synchronizer/refresh-balance.md
Normal file
9
docs/-sdk-synchronizer/refresh-balance.md
Normal file
@@ -0,0 +1,9 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [refreshBalance](./refresh-balance.md)
|
||||
|
||||
# refreshBalance
|
||||
|
||||
`suspend fun refreshBalance(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Calculate the latest balance, based on the blocks that have been scanned and transmit this
|
||||
information into the flow of [balances](balances.md).
|
||||
|
||||
26
docs/-sdk-synchronizer/send-to-address.md
Normal file
26
docs/-sdk-synchronizer/send-to-address.md
Normal file
@@ -0,0 +1,26 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [sendToAddress](./send-to-address.md)
|
||||
|
||||
# sendToAddress
|
||||
|
||||
`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)`): 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.
|
||||
|
||||
8
docs/-sdk-synchronizer/sent-transactions.md
Normal file
8
docs/-sdk-synchronizer/sent-transactions.md
Normal file
@@ -0,0 +1,8 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [sentTransactions](./sent-transactions.md)
|
||||
|
||||
# sentTransactions
|
||||
|
||||
`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.
|
||||
|
||||
23
docs/-sdk-synchronizer/start.md
Normal file
23
docs/-sdk-synchronizer/start.md
Normal file
@@ -0,0 +1,23 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [start](./start.md)
|
||||
|
||||
# start
|
||||
|
||||
`fun start(parentScope: CoroutineScope?): `[`Synchronizer`](../-synchronizer/index.md)
|
||||
|
||||
Starts this synchronizer within the given scope. For simplicity, attempting to start an
|
||||
instance that has already been started will throw a [SynchronizerException.FalseStart](../../cash.z.ecc.android.sdk.exception/-synchronizer-exception/-false-start.md)
|
||||
exception. This reduces the complexity of managing resources that must be recycled. Instead,
|
||||
each synchronizer is designed to have a long lifespan and should be started from an activity,
|
||||
application or session.
|
||||
|
||||
### Parameters
|
||||
|
||||
`parentScope` - the scope to use for this synchronizer, typically something with a
|
||||
lifecycle such as an Activity for single-activity apps or a logged in user session. This
|
||||
scope is only used for launching this synchronizer's job as a child. If no scope is provided,
|
||||
then this synchronizer and all of its coroutines will run until stop is called, which is not
|
||||
recommended since it can leak resources. That type of behavior is more useful for tests.
|
||||
|
||||
**Return**
|
||||
an instance of this class so that this function can be used fluidly.
|
||||
|
||||
11
docs/-sdk-synchronizer/status.md
Normal file
11
docs/-sdk-synchronizer/status.md
Normal file
@@ -0,0 +1,11 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [status](./status.md)
|
||||
|
||||
# status
|
||||
|
||||
`val status: Flow<Status>`
|
||||
|
||||
Indicates the status of this Synchronizer. This implementation basically simplifies the
|
||||
status of the processor to focus only on the high level states that matter most. Whenever the
|
||||
processor is finished scanning, the synchronizer updates transaction and balance info and
|
||||
then emits a [SYNCED](../-synchronizer/-status/-s-y-n-c-e-d.md) status.
|
||||
|
||||
10
docs/-sdk-synchronizer/stop.md
Normal file
10
docs/-sdk-synchronizer/stop.md
Normal file
@@ -0,0 +1,10 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [stop](./stop.md)
|
||||
|
||||
# stop
|
||||
|
||||
`fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
|
||||
|
||||
Stop this synchronizer and all of its child jobs. Once a synchronizer has been stopped it
|
||||
should not be restarted and attempting to do so will result in an error. Also, this function
|
||||
will throw an exception if the synchronizer was never previously started.
|
||||
|
||||
19
docs/-sdk-synchronizer/validate-address.md
Normal file
19
docs/-sdk-synchronizer/validate-address.md
Normal file
@@ -0,0 +1,19 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [validateAddress](./validate-address.md)
|
||||
|
||||
# validateAddress
|
||||
|
||||
`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](../-synchronizer/is-valid-shielded-addr.md) and
|
||||
[isValidTransparentAddr](../-synchronizer/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.
|
||||
|
||||
17
docs/-sdk-synchronizer/validate-consensus-branch.md
Normal file
17
docs/-sdk-synchronizer/validate-consensus-branch.md
Normal file
@@ -0,0 +1,17 @@
|
||||
[zcash-android-wallet-sdk](../../index.md) / [cash.z.ecc.android.sdk](../index.md) / [SdkSynchronizer](index.md) / [validateConsensusBranch](./validate-consensus-branch.md)
|
||||
|
||||
# validateConsensusBranch
|
||||
|
||||
`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.
|
||||
|
||||
Reference in New Issue
Block a user