pub struct Output {
pub amount: Sats,
pub script: ScriptPubkey,
pub redeem_script: Option<RedeemScript>,
pub witness_script: Option<WitnessScript>,
pub bip32_derivation: IndexMap<CompressedPk, KeyOrigin>,
pub tap_internal_key: Option<InternalPk>,
pub tap_tree: Option<TapTree>,
pub tap_bip32_derivation: IndexMap<XOnlyPk, TapDerivation>,
pub proprietary: IndexMap<PropKey, ValueData>,
pub unknown: IndexMap<u8, IndexMap<KeyData, ValueData>>,
/* private fields */
}
Fields§
§amount: Sats
The output’s amount in satoshis.
script: ScriptPubkey
The script for this output, also known as the scriptPubKey.
redeem_script: Option<RedeemScript>
The redeem script for this output.
witness_script: Option<WitnessScript>
The witness script for this output.
bip32_derivation: IndexMap<CompressedPk, KeyOrigin>
A map from public keys needed to spend this output to their corresponding master key fingerprints and derivation paths.
tap_internal_key: Option<InternalPk>
The X-only pubkey used as the internal key in this output.
tap_tree: Option<TapTree>
One or more tuples representing the depth, leaf version, and script for a leaf in the Taproot tree, allowing the entire tree to be reconstructed. The tuples must be in depth first search order so that the tree is correctly reconstructed. Each tuple is an 8-bit unsigned integer representing the depth in the Taproot tree for this script, an 8-bit unsigned integer representing the leaf version, the length of the script as a compact size unsigned integer, and the script itself.
tap_bip32_derivation: IndexMap<XOnlyPk, TapDerivation>
A compact size unsigned integer representing the number of leaf hashes, followed by a list
of leaf hashes, followed by the 4 byte master key fingerprint concatenated with the
derivation path of the public key. The derivation path is represented as 32-bit little
endian unsigned integer indexes concatenated with each other. Public keys are those needed
to spend this output. The leaf hashes are of the leaves which involve this public key. The
internal key does not have leaf hashes, so can be indicated with a hashes len of 0.
Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS
is constructed.
proprietary: IndexMap<PropKey, ValueData>
Proprietary keys
unknown: IndexMap<u8, IndexMap<KeyData, ValueData>>
Unknown keys
Implementations§
source§impl Output
impl Output
pub fn new(index: usize) -> Self
pub fn with_txout(txout: TxOut, index: usize) -> Self
pub fn from_txout((index, txout): (usize, TxOut)) -> Self
pub fn to_txout(&self) -> TxOut
pub fn value(&self) -> Sats
pub fn index(&self) -> usize
pub fn vout(&self) -> Vout
pub fn terminal_derivation(&self) -> Option<Terminal>
Trait Implementations§
source§impl KeyMap for Output
impl KeyMap for Output
type Keys = OutputKey
const PROPRIETARY_TYPE: Self::Keys = OutputKey::Proprietary
fn retrieve_key_pair<'enc>( &'enc self, _: PsbtVer, key_type: Self::Keys ) -> Vec<KeyPair<Self::Keys, Box<dyn Encode + 'enc>, Box<dyn Encode + 'enc>>>
fn insert_singular( &mut self, key_type: Self::Keys, value_data: ValueData ) -> Result<(), PsbtError>
fn insert_plural( &mut self, key_type: Self::Keys, key_data: KeyData, value_data: ValueData ) -> Result<(), PsbtError>
fn encode_map( &self, version: PsbtVer, writer: &mut dyn Write ) -> Result<usize, IoError>
fn parse_map( &mut self, version: PsbtVer, map: Map<Self::Keys> ) -> Result<(), PsbtError>
fn has_proprietary(&self, key: &PropKey) -> bool
fn proprietary(&self, key: &PropKey) -> Option<&ValueData>
fn proprietary_mut(&mut self, key: &PropKey) -> Option<&mut ValueData>
fn push_proprietary( &mut self, key: PropKey, value: impl Into<ValueData> ) -> Result<(), KeyAlreadyPresent>
fn remove_proprietary(&mut self, key: &PropKey) -> Option<ValueData>
fn insert_proprietary(&mut self, prop_key: PropKey, value_data: ValueData)
fn insert_unknown( &mut self, key_type: u8, key_data: KeyData, value_data: ValueData )
source§impl PartialEq for Output
impl PartialEq for Output
impl Eq for Output
impl StructuralEq for Output
impl StructuralPartialEq for Output
Auto Trait Implementations§
impl RefUnwindSafe for Output
impl Send for Output
impl Sync for Output
impl Unpin for Output
impl UnwindSafe for Output
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.