1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//! # rustywallet-mempool
//!
//! Mempool.space API client for fee estimation, address info, and transaction tracking.
//!
//! ## Features
//!
//! - **Fee estimation** - Get recommended fee rates for different confirmation targets
//! - **Address info** - Get balance, transaction count, and UTXOs
//! - **Transaction tracking** - Get transaction details and confirmation status
//! - **Broadcasting** - Broadcast signed transactions to the network
//! - **Block info** - Get current block height and block details
//! - **WebSocket support** - Real-time updates for blocks, fees, and addresses
//! - **Lightning stats** - Lightning Network capacity, nodes, and channels
//! - **Mining stats** - Pool hashrate distribution and difficulty adjustments
//!
//! ## Quick Start
//!
//! ```no_run
//! use rustywallet_mempool::MempoolClient;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = MempoolClient::new();
//!
//! // Get fee estimates
//! let fees = client.get_fees().await?;
//! println!("Next block: {} sat/vB", fees.fastest_fee);
//! println!("1 hour: {} sat/vB", fees.hour_fee);
//! println!("Economy: {} sat/vB", fees.economy_fee);
//!
//! // Get address balance
//! let info = client.get_address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa").await?;
//! println!("Balance: {} sats", info.confirmed_balance());
//! println!("Transactions: {}", info.tx_count());
//!
//! // Get UTXOs
//! let utxos = client.get_utxos("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa").await?;
//! println!("UTXOs: {}", utxos.len());
//!
//! // Get current block height
//! let height = client.get_block_height().await?;
//! println!("Block height: {}", height);
//!
//! Ok(())
//! }
//! ```
//!
//! ## WebSocket Real-time Updates
//!
//! ```no_run
//! use rustywallet_mempool::websocket::{MempoolWsClient, WsSubscription};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let ws = MempoolWsClient::new();
//!
//! // Configure subscriptions
//! let sub = WsSubscription::new()
//! .with_blocks()
//! .with_fees()
//! .track_address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa");
//!
//! ws.set_subscription(sub).await;
//!
//! Ok(())
//! }
//! ```
//!
//! ## Lightning Network Stats
//!
//! ```no_run
//! use rustywallet_mempool::MempoolClient;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = MempoolClient::new();
//!
//! // Get Lightning Network statistics
//! let stats = client.get_lightning_stats().await?;
//! println!("Capacity: {} BTC", stats.latest.capacity_btc());
//! println!("Channels: {}", stats.latest.channel_count);
//! println!("Nodes: {}", stats.latest.node_count);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Mining Pool Stats
//!
//! ```no_run
//! use rustywallet_mempool::MempoolClient;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = MempoolClient::new();
//!
//! // Get hashrate distribution
//! let dist = client.get_hashrate_distribution("1w").await?;
//! for pool in dist.top_pools(5) {
//! println!("{}: {:.1}%", pool.pool.name, pool.share_percent());
//! }
//!
//! // Get difficulty adjustment
//! let adj = client.get_difficulty_adjustment().await?;
//! println!("Next adjustment: {:.2}%", adj.difficulty_change_percent());
//!
//! Ok(())
//! }
//! ```
//!
//! ## Networks
//!
//! ```no_run
//! use rustywallet_mempool::MempoolClient;
//!
//! // Mainnet (default)
//! let mainnet = MempoolClient::new();
//!
//! // Testnet
//! let testnet = MempoolClient::testnet();
//!
//! // Signet
//! let signet = MempoolClient::signet();
//!
//! // Custom endpoint
//! let custom = MempoolClient::with_base_url("https://my-mempool.example.com/api");
//! ```
// Re-exports
pub use ;
pub use ;
pub use ;
// v0.2 re-exports
pub use ;
pub use ;
pub use ;