Trait lwk_common::Signer
source · pub trait Signer {
type Error: Debug;
// Required methods
fn sign(
&self,
pset: &mut PartiallySignedTransaction
) -> Result<u32, Self::Error>;
fn derive_xpub(&self, path: &DerivationPath) -> Result<Xpub, Self::Error>;
fn slip77_master_blinding_key(
&self
) -> Result<MasterBlindingKey, Self::Error>;
// Provided methods
fn xpub(&self) -> Result<Xpub, Self::Error> { ... }
fn identifier(&self) -> Result<XKeyIdentifier, Self::Error> { ... }
fn fingerprint(&self) -> Result<Fingerprint, Self::Error> { ... }
fn keyorigin_xpub(
&self,
bip: Bip,
is_mainnet: bool
) -> Result<String, Self::Error> { ... }
fn is_mainnet(&self) -> Result<bool, Self::Error> { ... }
}
Expand description
A trait defining methods of signers, providing blanket implementations for some methods.
Required Associated Types§
Required Methods§
sourcefn 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
sourcefn 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
sourcefn 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
Provided Methods§
sourcefn identifier(&self) -> Result<XKeyIdentifier, Self::Error>
fn identifier(&self) -> Result<XKeyIdentifier, Self::Error>
Return the full identifier of the signer
sourcefn fingerprint(&self) -> Result<Fingerprint, Self::Error>
fn fingerprint(&self) -> Result<Fingerprint, Self::Error>
Return the fingerprint of the signer (4 bytes)
sourcefn 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…”