[][src]Struct libra_wallet::WalletLibrary

pub struct WalletLibrary { /* fields omitted */ }

WalletLibrary contains all the information needed to recreate a particular wallet


impl WalletLibrary[src]

pub fn new() -> Self[src]

Constructor that generates a Mnemonic from OS randomness and subsequently instantiates an empty WalletLibrary from that Mnemonic

pub fn new_from_mnemonic(mnemonic: Mnemonic) -> Self[src]

Constructor that instantiates a new WalletLibrary from Mnemonic

pub fn mnemonic(&self) -> String[src]

Function that returns the string representation of the WalletLibrary Mnemonic NOTE: This is not secure, and in general the mnemonic should be stored in encrypted format

pub fn write_recovery(&self, output_file_path: &Path) -> Result<()>[src]

Function that writes the wallet Mnemonic to file NOTE: This is not secure, and in general the Mnemonic would need to be decrypted before it can be written to file; otherwise the encrypted Mnemonic should be written to file

pub fn recover(input_file_path: &Path) -> Result<WalletLibrary>[src]

Recover wallet from input_file_path

pub fn key_leaf(&self) -> u64[src]

Get the current ChildNumber in u64 format

pub fn generate_addresses(&mut self, depth: u64) -> Result<()>[src]

Function that iterates from the current key_leaf until the supplied depth

pub fn new_address_at_child_number(
    &mut self,
    child_number: ChildNumber
) -> Result<AccountAddress>

Function that allows to get the address of a particular key at a certain ChildNumber

pub fn new_address(&mut self) -> Result<(AuthenticationKey, ChildNumber)>[src]

Function that generates a new key and adds it to the addr_map and subsequently returns the AuthenticationKey associated to the PrivateKey, along with it's ChildNumber

pub fn get_addresses(&self) -> Result<Vec<AccountAddress>>[src]

Returns a list of all addresses controlled by this wallet that are currently held by the addr_map

pub fn sign_txn(&self, txn: RawTransaction) -> Result<SignedTransaction>[src]

Simple public function that allows to sign a Libra RawTransaction with the PrivateKey associated to a particular AccountAddress. If the PrivateKey associated to an AccountAddress is not contained in the addr_map, then this function will return an Error

pub fn get_private_key(
    address: &AccountAddress
) -> Result<Ed25519PrivateKey>

Return private key for an address in the wallet

pub fn get_authentication_key(
    address: &AccountAddress
) -> Result<AuthenticationKey>

Return authentication key (AuthenticationKey) for an address in the wallet

Trait Implementations

impl TransactionSigner for WalletLibrary[src]

WalletLibrary naturally support TransactionSigner trait.

Auto Trait Implementations

impl RefUnwindSafe for WalletLibrary

impl Send for WalletLibrary

impl Sync for WalletLibrary

impl Unpin for WalletLibrary

impl UnwindSafe for WalletLibrary

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,