rustywallet-mempool

Crates.iorustywallet-mempool
lib.rsrustywallet-mempool
version0.2.0
created_at2026-01-02 09:33:52.719354+00
updated_at2026-01-02 23:43:09.74258+00
descriptionMempool.space API client for fee estimation, address info, and transaction tracking
homepage
repositoryhttps://github.com/nirvagold/rustywallet
max_upload_size
id2018238
size102,584
Septian Fariz Faturohman (nirvagold)

documentation

https://docs.rs/rustywallet-mempool

README

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 address
  • get_address_txs(address) - Get transaction history

Transaction Methods

  • get_tx(txid) - Get transaction details
  • get_tx_hex(txid) - Get raw transaction hex
  • broadcast(hex) - Broadcast signed transaction

Block Methods

  • get_block_height() - Get current block height
  • get_block_hash(height) - Get block hash by height
  • get_block(hash) - Get block details

License

MIT

Commit count: 0

cargo fmt