Struct ethers::signers::coins_bip39::Mnemonic [−]
pub struct Mnemonic<W> where
W: Wordlist, { /* fields omitted */ }
Expand description
Mnemonic represents entropy that can be represented as a phrase. A mnemonic can be used to deterministically generate an extended private key or derive its child keys.
Implementations
Returns a new mnemonic generated using the provided random number generator.
pub fn new_with_count<R>(
rng: &mut R,
count: usize
) -> Result<Mnemonic<W>, MnemonicError> where
R: Rng,
pub fn new_with_count<R>(
rng: &mut R,
count: usize
) -> Result<Mnemonic<W>, MnemonicError> where
R: Rng,
Returns a new mnemonic given the word count, generated using the provided random number generator.
pub fn new_from_phrase(phrase: &str) -> Result<Mnemonic<W>, MnemonicError>
pub fn new_from_phrase(phrase: &str) -> Result<Mnemonic<W>, MnemonicError>
Returns a new mnemonic for a given phrase. The 12-24 space-separated words are used to calculate the entropy that must have produced it.
pub fn to_phrase(&self) -> Result<String, MnemonicError>
pub fn to_phrase(&self) -> Result<String, MnemonicError>
Converts the mnemonic into phrase.
pub fn master_key(&self, password: Option<&str>) -> Result<XPriv, MnemonicError>
pub fn master_key(&self, password: Option<&str>) -> Result<XPriv, MnemonicError>
Returns the master private key of the corresponding mnemonic.
pub fn derive_key<E, P>(
&self,
path: P,
password: Option<&str>
) -> Result<XPriv, MnemonicError> where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
pub fn derive_key<E, P>(
&self,
path: P,
password: Option<&str>
) -> Result<XPriv, MnemonicError> where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
Returns the derived child private key of the corresponding mnemonic at the given index.
Trait Implementations
Auto Trait Implementations
impl<W> RefUnwindSafe for Mnemonic<W> where
W: RefUnwindSafe,
impl<W> UnwindSafe for Mnemonic<W> where
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more