pub struct HDNodeBuilder<'a> { /* private fields */ }
Expand description

Builder for HDNode: use this to construct a node from different sources.

Implementations§

source§

impl<'a> HDNodeBuilder<'a>

source

pub fn path(self, path: DerivationPath) -> Self

Set a derivation path to use.

If not called, defaults to VET_EXTERNAL_PATH.

source

pub fn seed(self, seed: [u8; 64]) -> Self

Set a seed to use.

source

pub fn mnemonic(self, mnemonic: Mnemonic) -> Self

Set a mnemonic to use. You may optionally provide a password as well.

Derivation from mnemonic is compatible with Sync2 wallet (with empty password).

source

pub fn mnemonic_with_password( self, mnemonic: Mnemonic, password: &'a str ) -> Self

Set a password for the mnemonic to use.

Replaces previous mnemonic, if any.

source

pub fn master_private_key_bytes<T: Into<ChainCode>>( self, key: [u8; 33], chain_code: T ) -> Self

Create an HDNode from private key bytes and chain code.

source

pub fn private_key(self, ext_key: ExtendedKey) -> Self

Create an HDNode from extended private key structure.

source

pub fn master_public_key_bytes<T: Into<ChainCode>>( self, key: [u8; 33], chain_code: T ) -> Self

Create an HDNode from private key bytes and chain code.

Beware that this node cannot be used to derive new private keys.

source

pub fn public_key(self, ext_key: ExtendedKey) -> Self

Create an HDNode from extended public key structure.

Beware that this node cannot be used to derive new private keys.

source

pub fn build(self) -> Result<HDNode, HDNodeError>

Create an HDNode from given arguments.

Trait Implementations§

source§

impl<'a> Clone for HDNodeBuilder<'a>

source§

fn clone(&self) -> HDNodeBuilder<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Default for HDNodeBuilder<'a>

source§

fn default() -> HDNodeBuilder<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for HDNodeBuilder<'a>

§

impl<'a> Send for HDNodeBuilder<'a>

§

impl<'a> Sync for HDNodeBuilder<'a>

§

impl<'a> Unpin for HDNodeBuilder<'a>

§

impl<'a> UnwindSafe for HDNodeBuilder<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V