[][src]Trait wagyu_model::mnemonic::Mnemonic

pub trait Mnemonic: Clone + Debug + Display + FromStr + Send + Sync + 'static + Eq + Sized {
    type Address: Address;
    type Format: Format;
    type PrivateKey: PrivateKey;
    type PublicKey: PublicKey;
    fn new<R: Rng>(rng: &mut R) -> Result<Self, MnemonicError>;
fn from_phrase(phrase: &str) -> Result<Self, MnemonicError>;
fn to_phrase(&self) -> Result<String, MnemonicError>;
fn to_private_key(
        &self,
        password: Option<&str>
    ) -> Result<Self::PrivateKey, MnemonicError>;
fn to_public_key(
        &self,
        password: Option<&str>
    ) -> Result<Self::PublicKey, MnemonicError>;
fn to_address(
        &self,
        password: Option<&str>,
        format: &Self::Format
    ) -> Result<Self::Address, MnemonicError>; }

The interface for a generic mnemonic.

Associated Types

Loading content...

Required methods

fn new<R: Rng>(rng: &mut R) -> Result<Self, MnemonicError>

Returns a new mnemonic.

fn from_phrase(phrase: &str) -> Result<Self, MnemonicError>

Returns the mnemonic for the given phrase.

fn to_phrase(&self) -> Result<String, MnemonicError>

Returns the phrase of the corresponding mnemonic.

fn to_private_key(
    &self,
    password: Option<&str>
) -> Result<Self::PrivateKey, MnemonicError>

Returns the private key of the corresponding mnemonic.

fn to_public_key(
    &self,
    password: Option<&str>
) -> Result<Self::PublicKey, MnemonicError>

Returns the public key of the corresponding mnemonic.

fn to_address(
    &self,
    password: Option<&str>,
    format: &Self::Format
) -> Result<Self::Address, MnemonicError>

Returns the address of the corresponding mnemonic.

Loading content...

Implementors

Loading content...