Struct hwi::types::HWIPartiallySignedTransaction
source · pub struct HWIPartiallySignedTransaction {
pub psbt: Psbt,
}
Fields§
§psbt: Psbt
Methods from Deref<Target = Psbt>§
sourcepub fn serialize_hex(&self) -> String
pub fn serialize_hex(&self) -> String
Serialize a value as bytes in hex.
sourcepub fn iter_funding_utxos(&self) -> impl Iterator<Item = Result<&TxOut, Error>>
pub fn iter_funding_utxos(&self) -> impl Iterator<Item = Result<&TxOut, Error>>
Returns an iterator for the funding UTXOs of the psbt
For each PSBT input that contains UTXO information Ok
is returned containing that information.
The order of returned items is same as the order of inputs.
§Errors
The function returns error when UTXO information is not present or is invalid.
§Panics
The function panics if the length of transaction inputs is not equal to the length of PSBT inputs.
pub const DEFAULT_MAX_FEE_RATE: FeeRate = _
sourcepub fn sighash_ecdsa<T>(
&self,
input_index: usize,
cache: &mut SighashCache<T>
) -> Result<(Message, EcdsaSighashType), SignError>where
T: Borrow<Transaction>,
pub fn sighash_ecdsa<T>(
&self,
input_index: usize,
cache: &mut SighashCache<T>
) -> Result<(Message, EcdsaSighashType), SignError>where
T: Borrow<Transaction>,
Returns the sighash message to sign an ECDSA input along with the sighash type.
Uses the EcdsaSighashType
from this input if one is specified. If no sighash type is
specified uses EcdsaSighashType::All
. This function does not support scripts that
contain OP_CODESEPARATOR
.
sourcepub fn spend_utxo(&self, input_index: usize) -> Result<&TxOut, SignError>
pub fn spend_utxo(&self, input_index: usize) -> Result<&TxOut, SignError>
Returns the spending utxo for this PSBT’s input at input_index
.
sourcepub fn fee(&self) -> Result<Amount, Error>
pub fn fee(&self) -> Result<Amount, Error>
Calculates transaction fee.
‘Fee’ being the amount that will be paid for mining a transaction with the current inputs and outputs i.e., the difference in value of the total inputs and the total outputs.
§Errors
Error::MissingUtxo
when UTXO information for any input is not present or is invalid.Error::NegativeFee
if calculated value is negative.Error::FeeOverflow
if an integer overflow occurs.
Trait Implementations§
source§impl Clone for HWIPartiallySignedTransaction
impl Clone for HWIPartiallySignedTransaction
source§fn clone(&self) -> HWIPartiallySignedTransaction
fn clone(&self) -> HWIPartiallySignedTransaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'de> Deserialize<'de> for HWIPartiallySignedTransaction
impl<'de> Deserialize<'de> for HWIPartiallySignedTransaction
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for HWIPartiallySignedTransaction
impl PartialEq for HWIPartiallySignedTransaction
source§fn eq(&self, other: &HWIPartiallySignedTransaction) -> bool
fn eq(&self, other: &HWIPartiallySignedTransaction) -> bool
self
and other
values to be equal, and is used
by ==
.