Skip to content

Commit e32fb11

Browse files
committed
feat(api): create OutputSpendStatus struct
1 parent e910810 commit e32fb11

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/api.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,19 @@ pub struct Utxo {
150150
pub value: Amount,
151151
}
152152

153+
/// Information about a single [`TxOut`]'s spend status.
154+
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
155+
pub struct OutputSpendStatus {
156+
/// Wheter this output is spent or not.
157+
pub spent: bool,
158+
/// The [`Txid`] of the [`Transaction`] that spent this [`TxOut`].
159+
pub txid: Option<Txid>,
160+
/// The input index of the [`Transaction`] that spent this [`Txout`].
161+
pub vin: Option<u32>,
162+
/// The status of the [`TxOut`], as a [`UtxoStatus`].
163+
pub status: Option<UtxoStatus>,
164+
}
165+
153166
impl Tx {
154167
pub fn to_tx(&self) -> Transaction {
155168
Transaction {

0 commit comments

Comments
 (0)