Struct thor_devkit::hdnode::HDNodeBuilder
source · 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>
impl<'a> HDNodeBuilder<'a>
sourcepub fn path(self, path: DerivationPath) -> Self
pub fn path(self, path: DerivationPath) -> Self
Set a derivation path to use.
If not called, defaults to VET_EXTERNAL_PATH.
sourcepub fn mnemonic(self, mnemonic: Mnemonic) -> Self
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).
sourcepub fn mnemonic_with_password(
self,
mnemonic: Mnemonic,
password: &'a str
) -> Self
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.
sourcepub fn master_private_key_bytes<T: Into<ChainCode>>(
self,
key: [u8; 33],
chain_code: T
) -> Self
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.
sourcepub fn private_key(self, ext_key: ExtendedKey) -> Self
pub fn private_key(self, ext_key: ExtendedKey) -> Self
Create an HDNode from extended private key structure.
sourcepub fn master_public_key_bytes<T: Into<ChainCode>>(
self,
key: [u8; 33],
chain_code: T
) -> Self
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.
sourcepub fn public_key(self, ext_key: ExtendedKey) -> Self
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.
sourcepub fn build(self) -> Result<HDNode, HDNodeError>
pub fn build(self) -> Result<HDNode, HDNodeError>
Create an HDNode from given arguments.
Trait Implementations§
source§impl<'a> Clone for HDNodeBuilder<'a>
impl<'a> Clone for HDNodeBuilder<'a>
source§fn clone(&self) -> HDNodeBuilder<'a>
fn clone(&self) -> HDNodeBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'a> Default for HDNodeBuilder<'a>
impl<'a> Default for HDNodeBuilder<'a>
source§fn default() -> HDNodeBuilder<'a>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more