zcash-android-wallet-sdk/docs/-synchronizer
Kevin Gorham 1f18042d52
Implement versioning and other cleanup.
- Correct typo and compiler warning in Rust.
'trait objects without an explicity dyn' are deprecated and this is a warning as of Rust 1.37
- update dependencies
- update documentation

docs
2019-09-12 01:31:23 -04:00
..
README.md Update docs 2019-03-30 12:22:20 -04:00
active-transactions.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
all-transactions.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
balance.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
balances.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
cancel-send.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
cleared-transactions.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
get-address.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
index.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
is-connected.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
is-first-run.md Update docs 2019-03-30 12:22:20 -04:00
is-scanning.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
is-stale.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
is-syncing.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
last-balance.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
last-cleared.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
last-pending.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
on-critical-error-handler.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
on-processor-error-handler.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
on-submission-error-handler.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
on-synchronizer-error-listener.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
pending-transactions.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
progress.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
send-to-address.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00
start.md Add docs folder with Synchronizer documentation 2019-03-29 02:31:25 -04:00
stop.md Implement versioning and other cleanup. 2019-09-12 01:31:23 -04:00

README.md

zcash-android-wallet-sdk / cash.z.wallet.sdk.data / Synchronizer

Synchronizer

interface Synchronizer

Primary interface for interacting with the SDK. Defines the contract that specific implementations like MockSynchronizer and SdkSynchronizer fulfill. Given the language-level support for coroutines, we favor their use in the SDK and incorporate that choice into this contract.

Properties

Name Summary
onSynchronizerErrorListener abstract var onSynchronizerErrorListener: ((Throwable?) -> Boolean)?
Gets or sets a global error listener. This is a useful hook for handling unexpected critical errors.

Functions

Name Summary
activeTransactions abstract fun activeTransactions(): ReceiveChannel<Map<ActiveTransaction, TransactionState>>
A stream of all the active transactions.
allTransactions abstract fun allTransactions(): ReceiveChannel<List<WalletTransaction>>
A stream of all the wallet transactions.
balance abstract fun balance(): ReceiveChannel<Wallet.WalletBalance>
A stream of balance values.
cancelSend abstract fun cancelSend(transaction: ActiveSendTransaction): Boolean
Attempts to cancel a previously sent transaction. Typically, cancellation is only an option if the transaction has not yet been submitted to the server.
getAddress abstract fun getAddress(accountId: Int= 0):String
Gets the address for the given account.
isFirstRun abstract suspend fun isFirstRun(): Boolean
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.
isStale abstract suspend fun isStale(): Boolean
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.
progress abstract fun progress(): ReceiveChannel<Int>
A stream 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.
sendToAddress abstract suspend fun sendToAddress(zatoshi: Long, toAddress: String, memo: String= "", fromAccountId:Int= 0):Unit
Sends zatoshi.
start abstract fun start(parentScope: CoroutineScope): Synchronizer
Starts this synchronizer within the given scope.
stop abstract fun stop(): Unit
Stop this synchronizer.

Inheritors

Name Summary
MockSynchronizer open class MockSynchronizer : Synchronizer, CoroutineScope
Utility for building UIs. It does the best it can to mock the SDKSynchronizer so that it can be dropped into any project and drive the UI. It generates active transactions in response to funds being sent and generates random received transactions, periodically.
SdkSynchronizer class SdkSynchronizer : Synchronizer
The glue. Downloads compact blocks to the database and then scans them for transactions. In order to serve that purpose, this class glues together a variety of key components. Each component contributes to the team effort of providing a simple source of truth to interact with.