pub struct EsploraTx {
pub txid: Txid,
pub version: Version,
pub locktime: LockTime,
pub vin: Vec<Vin>,
pub vout: Vec<Vout>,
pub size: usize,
pub weight: Weight,
pub status: TxStatus,
pub fee: Amount,
}Expand description
A transaction in the format returned by Esplora.
Unlike the native rust-bitcoin Transaction, EsploraTx
includes additional metadata such as the TxStatus, transaction fee,
and transaction Weight, as indexed and reported by Esplora servers.
To convert it into a Transaction, use EsploraTx::to_tx or .into().
Fields§
§txid: TxidThe Txid of the Transaction.
version: VersionThe version of the Transaction.
locktime: LockTimeThe locktime of the Transaction.
Sets a time or height after which the Transaction can be mined.
vin: Vec<Vin>The array of inputs in the Transaction.
vout: Vec<Vout>The array of outputs in the Transaction.
size: usizeThe Transaction size in raw bytes (NOT virtual bytes).
weight: WeightThe Transaction’s weight.
status: TxStatusThe confirmation status of the Transaction.
fee: AmountThe fee paid by the Transaction, in satoshis.
Implementations§
Source§impl EsploraTx
impl EsploraTx
Sourcepub fn to_tx(&self) -> Transaction
pub fn to_tx(&self) -> Transaction
Convert this EsploraTx into a Transaction.
This will drop the Esplora-specific metadata (fee, weight, confirmation status)
and reconstructs the Transaction from its inputs and outputs.
Sourcepub fn confirmation_time(&self) -> Option<BlockTime>
pub fn confirmation_time(&self) -> Option<BlockTime>
Sourcepub fn previous_outputs(&self) -> Vec<Option<TxOut>>
pub fn previous_outputs(&self) -> Vec<Option<TxOut>>
Get the previous TxOuts spent by this transaction’s inputs.
Returns one Option<TxOut> per input, in order.
None if the input spends a coinbase output.