Trait bdk::psbt::PsbtUtils

source ·
pub trait PsbtUtils {
    // Required methods
    fn get_utxo_for(&self, input_index: usize) -> Option<TxOut>;
    fn fee_amount(&self) -> Option<u64>;
    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<u64>

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 PartiallySignedTransaction 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 PartiallySignedTransaction

source§

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

source§

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

source§

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

Implementors§