Struct lwk_signer::SwSigner
source · pub struct SwSigner { /* private fields */ }
Expand description
A software signer
Implementations§
source§impl SwSigner
impl SwSigner
sourcepub fn new(mnemonic: &str, is_mainnet: bool) -> Result<Self, NewError>
pub fn new(mnemonic: &str, is_mainnet: bool) -> Result<Self, NewError>
Creates a new software signer from the given mnemonic.
Takes also a flag if the network is mainnet so that generated extended keys are in the correct form xpub/tpub (there is no need to discriminate between regtest and testnet)
pub fn random(is_mainnet: bool) -> Result<(Self, Mnemonic), NewError>
pub fn from_xprv(xprv: Xpriv) -> Self
pub fn xpub(&self) -> Xpub
pub fn seed(&self) -> Option<[u8; 64]>
pub fn mnemonic(&self) -> Option<Mnemonic>
pub fn fingerprint(&self) -> Fingerprint
Trait Implementations§
source§impl Signer for SwSigner
impl Signer for SwSigner
type Error = SignError
source§fn sign(
&self,
pset: &mut PartiallySignedTransaction
) -> Result<u32, Self::Error>
fn sign( &self, pset: &mut PartiallySignedTransaction ) -> Result<u32, Self::Error>
Try to sign the given pset, mutating it in place.
returns how many signatures were added or overwritten
source§fn derive_xpub(&self, path: &DerivationPath) -> Result<Xpub, Self::Error>
fn derive_xpub(&self, path: &DerivationPath) -> Result<Xpub, Self::Error>
Derive an xpub from the master, path can contains hardened derivations
source§fn slip77_master_blinding_key(&self) -> Result<MasterBlindingKey, Self::Error>
fn slip77_master_blinding_key(&self) -> Result<MasterBlindingKey, Self::Error>
Return the slip77 master blinding key
source§fn identifier(&self) -> Result<XKeyIdentifier, Self::Error>
fn identifier(&self) -> Result<XKeyIdentifier, Self::Error>
Return the full identifier of the signer
source§fn fingerprint(&self) -> Result<Fingerprint, Self::Error>
fn fingerprint(&self) -> Result<Fingerprint, Self::Error>
Return the fingerprint of the signer (4 bytes)
source§fn keyorigin_xpub(
&self,
bip: Bip,
is_mainnet: bool
) -> Result<String, Self::Error>
fn keyorigin_xpub( &self, bip: Bip, is_mainnet: bool ) -> Result<String, Self::Error>
Return keyorigin and xpub, like “[73c5da0a/84h/1h/0h]tpub…”
fn is_mainnet(&self) -> Result<bool, Self::Error>
Auto Trait Implementations§
impl Freeze for SwSigner
impl RefUnwindSafe for SwSigner
impl Send for SwSigner
impl Sync for SwSigner
impl Unpin for SwSigner
impl UnwindSafe for SwSigner
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