|
1 | 1 | //! Responses |
2 | 2 |
|
| 3 | +use bitcoin::Amount; |
| 4 | +use bitcoin::address::{Address, NetworkUnchecked}; |
3 | 5 | use serde::{Deserialize, Serialize}; |
4 | 6 |
|
5 | 7 | /// Prices |
@@ -64,3 +66,29 @@ pub struct DifficultyAdjustment { |
64 | 66 | #[serde(rename = "timeOffset")] |
65 | 67 | pub time_offset: i64, |
66 | 68 | } |
| 69 | + |
| 70 | +/// Bitcoin address statistics |
| 71 | +#[derive(Debug, Serialize, Deserialize)] |
| 72 | +pub struct AddressStats { |
| 73 | + /// Bitcoin address |
| 74 | + pub address: Address<NetworkUnchecked>, |
| 75 | + /// On-chain statistics |
| 76 | + pub chain_stats: TransactionStats, |
| 77 | + /// Mempool statistics |
| 78 | + pub mempool_stats: TransactionStats, |
| 79 | +} |
| 80 | + |
| 81 | +/// Transaction statistics for an address |
| 82 | +#[derive(Debug, Serialize, Deserialize)] |
| 83 | +pub struct TransactionStats { |
| 84 | + /// Number of funded transaction outputs |
| 85 | + pub funded_txo_count: u32, |
| 86 | + /// Total amount of funded transaction outputs |
| 87 | + pub funded_txo_sum: Amount, |
| 88 | + /// Number of spent transaction outputs |
| 89 | + pub spent_txo_count: u32, |
| 90 | + /// Total amount of spent transaction outputs |
| 91 | + pub spent_txo_sum: Amount, |
| 92 | + /// Total number of transactions |
| 93 | + pub tx_count: u32, |
| 94 | +} |
0 commit comments