gas-network-sdk 0.1.0

Rust SDK for Gas Network API - gas price prediction and optimization
Documentation
use thiserror::Error;

pub type Result<T> = std::result::Result<T, GasNetworkError>;

#[derive(Error, Debug)]
pub enum GasNetworkError {
    #[error("HTTP request failed: {0}")]
    Http(#[from] reqwest::Error),

    #[error("JSON parsing failed: {0}")]
    Json(#[from] serde_json::Error),

    #[error("Invalid API key")]
    InvalidApiKey,

    #[error("Unsupported chain: {0}")]
    UnsupportedChain(String),

    #[error("API error: {message}")]
    Api { message: String },

    #[error("Invalid URL: {0}")]
    InvalidUrl(#[from] url::ParseError),
}