Skip to content

Commit c910ab0

Browse files
committed
feat(api): add ScriptHashStats and ScriptHashTxsSummary structs
1 parent 1bb149e commit c910ab0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/api.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@ pub struct AddressTxsSummary {
176176
pub tx_count: u32,
177177
}
178178

179+
/// Statistics about a particular [`Script`] hash's confirmed and mempool transactions.
180+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize)]
181+
pub struct ScriptHashStats {
182+
/// The summary of confirmed transactions for this [`Script`] hash.
183+
pub chain_stats: ScriptHashTxsSummary,
184+
/// The summary of mempool transactions for this [`Script`] hash.
185+
pub mempool_stats: ScriptHashTxsSummary,
186+
}
187+
188+
/// Contains a summary of the transactions for a particular [`Script`] hash.
189+
pub type ScriptHashTxsSummary = AddressTxsSummary;
190+
179191
/// Information about an UTXO's status: confirmation status,
180192
/// confirmation height, confirmation block hash and confirmation block time.
181193
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize)]

0 commit comments

Comments
 (0)