Trait bdk::psbt::PsbtUtils

source ·
pub trait PsbtUtils {
    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§

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

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.

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§

Implementors§