stakewiz-rs 0.1.0

Unofficial Rust client for the Stakewiz API - Solana validator analytics
Documentation
use serde::{Deserialize, Serialize};

/// Current epoch info from `/epoch_info`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EpochInfo {
    pub epoch: u64,
    pub start_slot: u64,
    pub start_time: String,
    pub slot_height: u64,
    pub duration_seconds: u64,
    pub elapsed_seconds: u64,
    pub remaining_seconds: u64,
    pub epochs_per_year: f64,
}

/// Historical epoch from `/epoch_history/{epoch}`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EpochHistory {
    pub epoch: u64,
    pub start_time: Option<String>,
    pub end_time: Option<String>,
    pub duration_seconds: Option<u64>,
}

/// Epoch entry from `/all_epochs_history`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EpochHistoryEntry {
    pub epoch: u64,
    pub start: Option<String>,
    pub end: Option<String>,
    pub duration_seconds: Option<u64>,
}