rustchain-client 0.1.0

HTTP client library for the RustChain Proof-of-Antiquity blockchain API. Query node health, epochs, miners, wallets, attestations, and governance proposals.
Documentation
//! Error types for the RustChain client.

/// Errors that can occur when using the RustChain API client.
#[derive(Debug, thiserror::Error)]
pub enum Error {
    /// HTTP transport error (network, TLS, timeout, etc.).
    #[error("HTTP error: {0}")]
    Http(#[from] reqwest::Error),

    /// The API returned a non-success status code.
    #[error("API error (HTTP {status}): {message}")]
    Api {
        /// HTTP status code.
        status: u16,
        /// Response body or error message.
        message: String,
    },

    /// Failed to parse JSON response.
    #[error("JSON parse error: {0}")]
    Json(#[from] serde_json::Error),
}