Struct psbt::Psbt

source · []
pub struct Psbt {
    pub psbt_version: PsbtVersion,
    pub tx_version: u32,
    pub fallback_locktime: Option<LockTime>,
    pub inputs: Vec<Input>,
    pub outputs: Vec<Output>,
    pub xpub: BTreeMap<ExtendedPubKey, KeySource>,
    pub proprietary: BTreeMap<ProprietaryKey, Vec<u8>>,
    pub unknown: BTreeMap<Key, Vec<u8>>,
}

Fields

psbt_version: PsbtVersion

The version number of this PSBT. If omitted, the version number is 0.

tx_version: u32

Transaction version.

fallback_locktime: Option<LockTime>

Fallback locktime (used if none of the inputs specifies their locktime).

inputs: Vec<Input>

The corresponding key-value map for each input.

outputs: Vec<Output>

The corresponding key-value map for each output.

xpub: BTreeMap<ExtendedPubKey, KeySource>

A global map from extended public keys to the used key fingerprint and derivation path as defined by BIP 32

proprietary: BTreeMap<ProprietaryKey, Vec<u8>>

Global proprietary key-value pairs.

unknown: BTreeMap<Key, Vec<u8>>

Unknown global key-value pairs.

Implementations

Checks that unsigned transaction does not have scriptSig’s or witness data

Returns fee for a transaction, or returns error reporting resolver problem or wrong transaction structure

Returns transaction ID for an unsigned transaction. For SegWit transactions this is equal to the signed transaction id.

Constructs transaction with empty scriptSig and witness

Returns transaction with empty scriptSig and witness

Extract the (partially) signed transaction from this PSBT by filling in the available signature information in place.

Combines this Psbt with other PSBT as described by BIP 174.

In accordance with BIP 174 this function is commutative i.e., A.combine(B) == B.combine(A)

Extension trait for Psbt for working with proprietary LNPBP4 keys.

Returns an information about the given LNPBP4 ProtocolId, if any.

Errors

If the key is present, but it’s value can’t be deserialized as a valid protocol information block.

Adds LNPBP4 protocol information.

Returns

true, if the protocol information was successfully added, false if it was already present.

Errors

If the key for the given ProtocolId is already present and the information was different.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize a value from raw data.

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize a value as raw data.

Decode with the given std::io::Read instance; must either construct an instance or return implementation-specific error type. Read more

Tries to deserialize byte array into the current type using StrictDecode::strict_decode. If there are some data remains in the buffer once deserialization is completed, fails with Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and StrictDecode::strict_decode to avoid such failures. Read more

Reads data from file at path and reconstructs object from it. Fails with Error::DataNotEntirelyConsumed if file contains remaining data after the object reconstruction. Read more

Encode with the given std::io::Write instance; must return result with either amount of bytes encoded – or implementation-specific error type. Read more

Serializes data as a byte array using StrictEncode::strict_encode function Read more

Saves data to a file at a given path. If the file does not exists, attempts to create the file. If the file already exists, it gets truncated. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Verifies commit-equivalence of two instances of the same type.