bdk_wallet::psbt

Trait PsbtUtils

Source
pub trait PsbtUtils {
    // Required methods
    fn get_utxo_for(&self, input_index: usize) -> Option<TxOut>;
    fn fee_amount(&self) -> Option<Amount>;
    fn fee_rate(&self) -> Option<FeeRate>;
}
Expand description

Trait to add functions to extract utxos and calculate fees.

Required Methods§

Source

fn get_utxo_for(&self, input_index: usize) -> Option<TxOut>

Get the TxOut for the specified input index, if it doesn’t exist in the PSBT None is returned.

Source

fn fee_amount(&self) -> Option<Amount>

The total transaction fee amount, sum of input amounts minus sum of output amounts, in sats. If the PSBT is missing a TxOut for an input returns None.

Source

fn fee_rate(&self) -> Option<FeeRate>

The transaction’s fee rate. This value will only be accurate if calculated AFTER the Psbt is finalized and all witness/signature data is added to the transaction. If the PSBT is missing a TxOut for an input returns None.

Implementations on Foreign Types§

Source§

impl PsbtUtils for Psbt

Source§

fn get_utxo_for(&self, input_index: usize) -> Option<TxOut>

Source§

fn fee_amount(&self) -> Option<Amount>

Source§

fn fee_rate(&self) -> Option<FeeRate>

Implementors§