PsbtConstructor

Trait PsbtConstructor 

Source
pub trait PsbtConstructor {
    type Key;
    type Descr: Descriptor<Self::Key>;

    // Required methods
    fn descriptor(&self) -> &Self::Descr;
    fn utxo(&self, outpoint: Outpoint) -> Option<(Utxo, ScriptPubkey)>;
    fn network(&self) -> Network;
    fn next_derivation_index(
        &mut self,
        keychain: impl Into<Keychain>,
        shift: bool,
    ) -> NormalIndex;

    // Provided methods
    fn construct_psbt(
        &mut self,
        coins: impl IntoIterator<Item = Outpoint>,
        beneficiaries: impl IntoIterator<Item = Beneficiary>,
        params: TxParams,
    ) -> Result<(Psbt, PsbtMeta), ConstructionError> { ... }
    fn after_construct_psbt(&mut self, _psbt: &Psbt, _meta: &PsbtMeta) { ... }
}

Required Associated Types§

Required Methods§

Source

fn descriptor(&self) -> &Self::Descr

Source

fn utxo(&self, outpoint: Outpoint) -> Option<(Utxo, ScriptPubkey)>

Source

fn network(&self) -> Network

Source

fn next_derivation_index( &mut self, keychain: impl Into<Keychain>, shift: bool, ) -> NormalIndex

Provided Methods§

Source

fn construct_psbt( &mut self, coins: impl IntoIterator<Item = Outpoint>, beneficiaries: impl IntoIterator<Item = Beneficiary>, params: TxParams, ) -> Result<(Psbt, PsbtMeta), ConstructionError>

Source

fn after_construct_psbt(&mut self, _psbt: &Psbt, _meta: &PsbtMeta)

A hook which is called by the default Self::construct_psbt before returning the newly constructed PSBT to the caller.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<K, D: Descriptor<K>, L2: Layer2> PsbtConstructor for Wallet<K, D, L2>

Source§

type Key = K

Source§

type Descr = D