-
public final class WalletCoordinator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classWalletCoordinator.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<Synchronizer>synchronizerprivate final Flow<PersistableWallet>persistableWalletprivate final Flow<Boolean>isTorEnabledprivate final Flow<Boolean>isExchangeRateEnabledprivate final StringaccountNameprivate final StringkeySource
-
Constructor Summary
Constructors Constructor Description WalletCoordinator(Context context, Flow<PersistableWallet> persistableWallet, Flow<Boolean> isTorEnabled, Flow<Boolean> isExchangeRateEnabled, String accountName, String keySource)
-
Method Summary
Modifier and Type Method Description final StateFlow<Synchronizer>getSynchronizer()Synchronizer for the Zcash SDK. final Flow<PersistableWallet>getPersistableWallet()final Flow<Boolean>getIsTorEnabled()final Flow<Boolean>getIsExchangeRateEnabled()final StringgetAccountName()final StringgetKeySource()final BooleanrescanBlockchain()Rescans the blockchain. final UnitresetSynchronizer()final UnitresetSdk()Resets persisted data in the SDK, but preserves the wallet secret. final Flow<Boolean>deleteSdkDataFlow()This Flow-providing function deletes all the persisted data in the SDK (databases associated with this wallet, all compact blocks, and data derived from those blocks) but preserves the wallet secrets. -
-
Constructor Detail
-
WalletCoordinator
WalletCoordinator(Context context, Flow<PersistableWallet> persistableWallet, Flow<Boolean> isTorEnabled, Flow<Boolean> isExchangeRateEnabled, String accountName, String keySource)
- Parameters:
persistableWallet- flow of the user's stored wallet.isTorEnabled- flow indicating whether tor has been enabled for Synchronizer features supporting tor connectionaccountName- A human-readable name for the account, that will be used while instantiating Synchronizer.newkeySource- A string identifier or other metadata describing the source of the seed, that will be used while instantiating Synchronizer.newOne area where this class needs to change before it can be moved out of the incubator is that we need to be able to start synchronization without necessarily decrypting the wallet.
-
-
Method Detail
-
getSynchronizer
final StateFlow<Synchronizer> getSynchronizer()
Synchronizer for the Zcash SDK. Emits null until a wallet secret is persisted.
Note that this synchronizer is closed as soon as it stops being collected. For UI use cases, see WalletViewModel.
-
getPersistableWallet
final Flow<PersistableWallet> getPersistableWallet()
-
getIsTorEnabled
final Flow<Boolean> getIsTorEnabled()
-
getIsExchangeRateEnabled
final Flow<Boolean> getIsExchangeRateEnabled()
-
getAccountName
final String getAccountName()
-
getKeySource
final String getKeySource()
-
rescanBlockchain
final Boolean rescanBlockchain()
Rescans the blockchain.
In order for a rescan to occur, the synchronizer must be loaded already which would happen if the UI is collecting it.
-
resetSynchronizer
final Unit resetSynchronizer()
-
resetSdk
final Unit resetSdk()
Resets persisted data in the SDK, but preserves the wallet secret. This will cause the WalletCoordinator to emit a new synchronizer instance.
-
deleteSdkDataFlow
final Flow<Boolean> deleteSdkDataFlow()
This Flow-providing function deletes all the persisted data in the SDK (databases associated with this wallet, all compact blocks, and data derived from those blocks) but preserves the wallet secrets. This function requires secrets available on the device at the time of running.
-
-
-
-