[][src]Trait grin_wallet::libwallet::types::WalletBackend

pub trait WalletBackend<C, K> where
    C: NodeClient,
    K: Keychain
{ fn open_with_credentials(&mut self) -> Result<(), Error>;
fn close(&mut self) -> Result<(), Error>;
fn keychain(&mut self) -> &mut K;
fn w2n_client(&mut self) -> &mut C;
fn set_parent_key_id_by_name(&mut self, label: &str) -> Result<(), Error>;
fn set_parent_key_id(&mut self, _: Identifier);
fn parent_key_id(&mut self) -> Identifier;
fn iter<'a>(&'a self) -> Box<dyn Iterator<Item = OutputData> + 'a>;
fn get(&self, id: &Identifier) -> Result<OutputData, Error>;
fn get_commitment(&mut self, id: &Identifier) -> Result<Commitment, Error>;
fn get_tx_log_entry(&self, uuid: &Uuid) -> Result<Option<TxLogEntry>, Error>;
fn get_private_context(&mut self, slate_id: &[u8]) -> Result<Context, Error>;
fn tx_log_iter<'a>(&'a self) -> Box<dyn Iterator<Item = TxLogEntry> + 'a>;
fn acct_path_iter<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = AcctPathMapping> + 'a>;
fn get_acct_path(
        &self,
        label: String
    ) -> Result<Option<AcctPathMapping>, Error>;
fn batch<'a>(
        &'a mut self
    ) -> Result<Box<dyn WalletOutputBatch<K> + 'a>, Error>;
fn next_child<'a>(&mut self) -> Result<Identifier, Error>;
fn last_confirmed_height<'a>(&mut self) -> Result<u64, Error>;
fn restore(&mut self) -> Result<(), Error>; }

TODO: Wallets should implement this backend for their storage. All functions here expect that the wallet instance has instantiated itself or stored whatever credentials it needs

Required Methods

Initialize with whatever stored credentials we have

Close wallet and remove any stored credentials (TBD)

Return the keychain being used

Return the client being used to communicate with the node

Set parent key id by stored account name

The BIP32 path of the parent path to use for all output-related functions, (essentially 'accounts' within a wallet.

return the parent path

Iterate over all output data stored by the backend

Get output data by id

Get associated output commitment by id.

Get an (Optional) tx log entry by uuid

Retrieves the private context associated with a given slate id

Iterate over all output data stored by the backend

Iterate over all stored account paths

Gets an account path for a given label

Create a new write batch to update or remove output data

Next child ID when we want to create a new output, based on current parent

last verified height of outputs directly descending from the given parent key

Attempt to restore the contents of a wallet from seed

Implementors

impl<C, K> WalletBackend<C, K> for LMDBBackend<C, K> where
    C: NodeClient,
    K: Keychain
[src]

Initialise with whatever stored credentials we have

Close wallet and remove any stored credentials (TBD)

Return the keychain being used

Return the node client being used

Set parent path by account name

set parent path