Trait bdk_wallet::psbt::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§