bitcoinsv_rpc/lib.rs
1//! # bitcoinsv-rpc
2//!
3//! Async Rust library for Bitcoin SV node communication.
4//!
5//! This library provides a high-level interface for interacting with Bitcoin SV nodes
6//! via their JSON-RPC API and REST interface.
7//!
8//! ## Features
9//!
10//! - Async/await support with Tokio
11//! - JSON-RPC interface for node commands
12//! - REST API interface for efficient block retrieval
13//! - Type-safe integration with the bitcoinsv crate
14//!
15//! ## Example
16//!
17//! ```no_run
18//! use bitcoinsv_rpc::{NodeClient, SvNodeClient};
19//!
20//! #[tokio::main]
21//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
22//! let client = SvNodeClient::new(
23//! "http://localhost:8332",
24//! Some("user".to_string()),
25//! Some("password".to_string()),
26//! )?;
27//!
28//! let best_block_hash = client.get_best_block_hash().await?;
29//! println!("Best block hash: {}", best_block_hash);
30//!
31//! Ok(())
32//! }
33//! ```
34
35mod client;
36mod error;
37mod rest;
38mod rpc;
39
40pub use client::{NodeClient, SvNodeClient};
41pub use error::{Error, Result};