Skip to main content

Module client

Module client 

Source
Expand description

Lightcone REST API client implementation.

The LightconeApiClient provides a type-safe interface for interacting with the Lightcone REST API.

§Example

use lightcone_sdk::api::LightconeApiClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = LightconeApiClient::new("https://api.lightcone.xyz");

    // Get all markets
    let markets = client.get_markets().await?;
    println!("Found {} markets", markets.total);

    // Get orderbook
    let orderbook = client.get_orderbook("orderbook_id", None).await?;
    println!("Best bid: {:?}", orderbook.best_bid);

    Ok(())
}

Structs§

LightconeApiClient
Lightcone REST API client.
LightconeApiClientBuilder
Builder for configuring LightconeApiClient.
RetryConfig
Retry configuration for the API client.