2 unstable releases
| 0.2.0 | Jan 2, 2026 |
|---|---|
| 0.1.0 | Jan 2, 2026 |
#166 in #cryptocurrency
60KB
1K
SLoC
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
- Multi-network - Support for mainnet, testnet, and signet
Quick Start
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);
// Get address balance
let info = client.get_address("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa").await?;
println!("Balance: {} sats", info.confirmed_balance());
// Get UTXOs
let utxos = client.get_utxos("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa").await?;
println!("UTXOs: {}", utxos.len());
Ok(())
}
Networks
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");
API Reference
Fee Estimation
get_fees()- Get recommended fee rates (fastest, half_hour, hour, economy, minimum)
Address Methods
get_address(address)- Get address info (balance, tx count)get_utxos(address)- Get UTXOs for addressget_address_txs(address)- Get transaction history
Transaction Methods
get_tx(txid)- Get transaction detailsget_tx_hex(txid)- Get raw transaction hexbroadcast(hex)- Broadcast signed transaction
Block Methods
get_block_height()- Get current block heightget_block_hash(height)- Get block hash by heightget_block(hash)- Get block details
License
MIT
Dependencies
~5–13MB
~204K SLoC