rustywallet_mempool/
lib.rs

1//! # rustywallet-mempool
2//!
3//! Mempool.space API client for fee estimation, address info, and transaction tracking.
4//!
5//! ## Features
6//!
7//! - **Fee estimation** - Get recommended fee rates for different confirmation targets
8//! - **Address info** - Get balance, transaction count, and UTXOs
9//! - **Transaction tracking** - Get transaction details and confirmation status
10//! - **Broadcasting** - Broadcast signed transactions to the network
11//! - **Block info** - Get current block height and block details
12//!
13//! ## Quick Start
14//!
15//! ```no_run
16//! use rustywallet_mempool::MempoolClient;
17//!
18//! #[tokio::main]
19//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
20//!     let client = MempoolClient::new();
21//!     
22//!     // Get fee estimates
23//!     let fees = client.get_fees().await?;
24//!     println!("Next block: {} sat/vB", fees.fastest_fee);
25//!     println!("1 hour: {} sat/vB", fees.hour_fee);
26//!     println!("Economy: {} sat/vB", fees.economy_fee);
27//!     
28//!     // Get address balance
29//!     let info = client.get_address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa").await?;
30//!     println!("Balance: {} sats", info.confirmed_balance());
31//!     println!("Transactions: {}", info.tx_count());
32//!     
33//!     // Get UTXOs
34//!     let utxos = client.get_utxos("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa").await?;
35//!     println!("UTXOs: {}", utxos.len());
36//!     
37//!     // Get current block height
38//!     let height = client.get_block_height().await?;
39//!     println!("Block height: {}", height);
40//!     
41//!     Ok(())
42//! }
43//! ```
44//!
45//! ## Networks
46//!
47//! ```no_run
48//! use rustywallet_mempool::MempoolClient;
49//!
50//! // Mainnet (default)
51//! let mainnet = MempoolClient::new();
52//!
53//! // Testnet
54//! let testnet = MempoolClient::testnet();
55//!
56//! // Signet
57//! let signet = MempoolClient::signet();
58//!
59//! // Custom endpoint
60//! let custom = MempoolClient::with_base_url("https://my-mempool.example.com/api");
61//! ```
62
63#![warn(missing_docs)]
64#![warn(rustdoc::missing_crate_level_docs)]
65
66pub mod client;
67pub mod error;
68pub mod types;
69
70// Re-exports
71pub use client::{MempoolClient, MAINNET_URL, SIGNET_URL, TESTNET_URL};
72pub use error::{MempoolError, Result};
73pub use types::{AddressInfo, BlockInfo, ChainStats, FeeEstimates, MempoolStats, Transaction, TxStatus, Utxo, UtxoStatus};