@@ -123,6 +123,33 @@ pub struct AddressTxsSummary {
123
123
pub tx_count : u32 ,
124
124
}
125
125
126
+ /// Information about an UTXO's status: confirmation status,
127
+ /// confirmation height, confirmation block hash and confirmation block time.
128
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Deserialize ) ]
129
+ pub struct UtxoStatus {
130
+ /// Whether or not the UTXO is confirmed.
131
+ pub confirmed : bool ,
132
+ /// The block height in which the UTXO was confirmed.
133
+ pub block_height : Option < u32 > ,
134
+ /// The block hash in which the UTXO was confirmed.
135
+ pub block_hash : Option < BlockHash > ,
136
+ /// The UNIX timestamp in which the UTXO was confirmed.
137
+ pub block_time : Option < u64 > ,
138
+ }
139
+
140
+ /// Information about an UTXO's outpoint, confirmation status and value.
141
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Deserialize ) ]
142
+ pub struct Utxo {
143
+ /// The [`Txid`] of the transaction that created the UTXO.
144
+ pub txid : Txid ,
145
+ /// The output index of the UTXO on the transaction that created the it.
146
+ pub vout : u32 ,
147
+ /// The confirmation status of the UTXO.
148
+ pub status : UtxoStatus ,
149
+ /// The value of the UTXO as an [`Amount`].
150
+ pub value : Amount ,
151
+ }
152
+
126
153
impl Tx {
127
154
pub fn to_tx ( & self ) -> Transaction {
128
155
Transaction {
0 commit comments