Crate lighter_rust

Crate lighter_rust 

Source
Expand description

§Lighter Rust SDK

A Rust SDK for the Lighter trading platform, providing async API access to trading operations, account management, and real-time market data.

§Features

  • Async/await support - Built with Tokio for high-performance async operations
  • Type-safe API - Comprehensive Rust types for all API responses
  • WebSocket & REST - Support for both REST API and real-time WebSocket feeds
  • Account management - Handle Standard and Premium account tiers
  • Trading operations - Place orders, manage positions, query market data
  • Ethereum signing - Built-in support for Ethereum-compatible wallet signing

§Quick Start

use lighter_rust::{LighterClient, Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Config::new().with_api_key("your-api-key");
    let client = LighterClient::new(config, "your-private-key")?;
     
    // Get account info
    let account = client.account().get_account().await?;
    println!("Account: {:?}", account);
     
    Ok(())
}

Re-exports§

pub use config::Config;
pub use error::LighterError;
pub use error::Result;
pub use logging::init_logging;
pub use logging::init_logging_with_filter;
pub use api::*;
pub use client::*;
pub use models::*;
pub use signers::*;

Modules§

api
client
config
error
logging
models
nonce
signers

Structs§

LighterClient
Main client for interacting with the Lighter API