Trait bdk::wallet::signer::Signer [−][src]
pub trait Signer: Debug + Send + Sync { fn sign(
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>; fn sign_whole_tx(&self) -> bool; fn id(&self, secp: &Secp256k1<All>) -> SignerId; fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey> { ... } }
Expand description
Trait for signers
This trait can be implemented to provide customized signers to the wallet. For an example see
this module
’s documentation.
Required methods
fn sign(
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>
[src]
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>
Expand description
Sign a PSBT
The input_index
argument is only provided if the wallet doesn’t declare to sign the whole
transaction in one go (see Signer::sign_whole_tx
). Otherwise its value is None
and
can be ignored.
fn sign_whole_tx(&self) -> bool
[src]
Expand description
Return whether or not the signer signs the whole transaction in one go instead of every input individually
fn id(&self, secp: &Secp256k1<All>) -> SignerId
[src]
Provided methods
fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>
[src]
Expand description
Return the secret key for the signer
This is used internally to reconstruct the original descriptor that may contain secrets.
External signers that are meant to keep key isolated should just return None
here (which
is the default for this method, if not overridden).
Implementations on Foreign Types
impl Signer for DescriptorXKey<ExtendedPrivKey>
[src]
impl Signer for DescriptorXKey<ExtendedPrivKey>
[src]fn sign(
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>
[src]
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>
fn sign_whole_tx(&self) -> bool
[src]
fn id(&self, secp: &Secp256k1<All>) -> SignerId
[src]
fn descriptor_secret_key(&self) -> Option<DescriptorSecretKey>
[src]
impl Signer for PrivateKey
[src]
impl Signer for PrivateKey
[src]fn sign(
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>
[src]
&self,
psbt: &mut PartiallySignedTransaction,
input_index: Option<usize>,
secp: &Secp256k1<All>
) -> Result<(), SignerError>