stakewiz_rs/lib.rs
1//! # stakewiz-rs
2//!
3//! Unofficial Rust client for the [Stakewiz API](https://docs.stakewiz.com/) —
4//! Solana validator analytics, Wiz Score, epoch info, and more.
5//!
6//! ## Quick Start
7//!
8//! ```no_run
9//! use stakewiz_rs::{StakewizClient, QueryParams};
10//!
11//! #[tokio::main]
12//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
13//! let client = StakewizClient::new();
14//!
15//! // Get a single validator by vote account
16//! let v = client.get_validator("GE6atKoWiQ2pt3zL7N13pjNHjdLVys8LinG8qeJLcAiL").await?;
17//! println!("{} — APY: {:?}%", v.name.unwrap_or_default(), v.apy_estimate);
18//!
19//! // Get all stake accounts for a validator
20//! let stakes = client.get_validator_stakes("LSTmLs1DENX82ihc7jU134mydiV3NDEPXsRrekAY6Ys").await?;
21//! println!("Total stake accounts: {}", stakes.len());
22//!
23//! // Get current epoch info
24//! let epoch = client.get_epoch_info().await?;
25//! println!("Epoch {} — {:.0}s remaining", epoch.epoch, epoch.remaining_seconds);
26//!
27//! Ok(())
28//! }
29//! ```
30
31pub mod client;
32pub mod error;
33pub mod models;
34pub mod params;
35
36pub use client::StakewizClient;
37pub use error::{Result, StakewizError};
38pub use models::*;
39pub use params::QueryParams;