pub trait SyncWallet {
type Error: Debug + Display + Error;
// Required methods
fn get_birthday(&self) -> Result<BlockHeight, Self::Error>;
fn get_sync_state(&self) -> Result<&SyncState, Self::Error>;
fn get_sync_state_mut(&mut self) -> Result<&mut SyncState, Self::Error>;
fn get_unified_full_viewing_keys(
&self,
) -> Result<HashMap<AccountId, UnifiedFullViewingKey>, Self::Error>;
fn add_orchard_address(
&mut self,
account_id: AccountId,
address: Address,
diversifier_index: DiversifierIndex,
) -> Result<(), Self::Error>;
fn add_sapling_address(
&mut self,
account_id: AccountId,
address: PaymentAddress,
diversifier_index: DiversifierIndex,
) -> Result<(), Self::Error>;
fn get_transparent_addresses(
&self,
) -> Result<&BTreeMap<TransparentAddressId, String>, Self::Error>;
fn get_transparent_addresses_mut(
&mut self,
) -> Result<&mut BTreeMap<TransparentAddressId, String>, Self::Error>;
// Provided method
fn set_save_flag(&mut self) -> Result<(), Self::Error> { ... }
}Expand description
Trait for interfacing wallet with the sync engine.
Required Associated Types§
Required Methods§
Sourcefn get_birthday(&self) -> Result<BlockHeight, Self::Error>
fn get_birthday(&self) -> Result<BlockHeight, Self::Error>
Returns the block height wallet was created.
Sourcefn get_sync_state(&self) -> Result<&SyncState, Self::Error>
fn get_sync_state(&self) -> Result<&SyncState, Self::Error>
Returns a reference to wallet sync state.
Sourcefn get_sync_state_mut(&mut self) -> Result<&mut SyncState, Self::Error>
fn get_sync_state_mut(&mut self) -> Result<&mut SyncState, Self::Error>
Returns a mutable reference to wallet sync state.
Sourcefn get_unified_full_viewing_keys(
&self,
) -> Result<HashMap<AccountId, UnifiedFullViewingKey>, Self::Error>
fn get_unified_full_viewing_keys( &self, ) -> Result<HashMap<AccountId, UnifiedFullViewingKey>, Self::Error>
Returns all unified full viewing keys known to this wallet.
Sourcefn add_orchard_address(
&mut self,
account_id: AccountId,
address: Address,
diversifier_index: DiversifierIndex,
) -> Result<(), Self::Error>
fn add_orchard_address( &mut self, account_id: AccountId, address: Address, diversifier_index: DiversifierIndex, ) -> Result<(), Self::Error>
Add orchard address to wallet’s unified address list.
Sourcefn add_sapling_address(
&mut self,
account_id: AccountId,
address: PaymentAddress,
diversifier_index: DiversifierIndex,
) -> Result<(), Self::Error>
fn add_sapling_address( &mut self, account_id: AccountId, address: PaymentAddress, diversifier_index: DiversifierIndex, ) -> Result<(), Self::Error>
Add sapling address to wallet’s unified address list.
Sourcefn get_transparent_addresses(
&self,
) -> Result<&BTreeMap<TransparentAddressId, String>, Self::Error>
fn get_transparent_addresses( &self, ) -> Result<&BTreeMap<TransparentAddressId, String>, Self::Error>
Returns a reference to all transparent addresses known to this wallet.
Sourcefn get_transparent_addresses_mut(
&mut self,
) -> Result<&mut BTreeMap<TransparentAddressId, String>, Self::Error>
fn get_transparent_addresses_mut( &mut self, ) -> Result<&mut BTreeMap<TransparentAddressId, String>, Self::Error>
Returns a mutable reference to all transparent addresses known to this wallet.
Provided Methods§
Sourcefn set_save_flag(&mut self) -> Result<(), Self::Error>
fn set_save_flag(&mut self) -> Result<(), Self::Error>
Aids in-memory wallets to only save when the wallet state has changed by setting a flag to mark that save is required. Persitance wallets may use the default implementation.