chainstream-sdk 2.0.10

SDK for interacting with the ChainStream API
Documentation
//! WebSocket Stream API for real-time data subscriptions
//!
//! This module provides real-time streaming capabilities using the Centrifuge protocol.
//!
//! # Example
//!
//! ```rust,no_run
//! use chainstream_sdk::stream::{StreamApi, TokenCandle};
//!
//! #[tokio::main]
//! async fn main() {
//!     let api = StreamApi::new(
//!         "wss://realtime-dex.chainstream.io/connection/websocket",
//!         "your-access-token",
//!     );
//!
//!     // Connect to the WebSocket server
//!     api.connect().await.unwrap();
//!
//!     // Subscribe to token candles
//!     let unsub = api.subscribe_token_candles(
//!         "sol",
//!         "So11111111111111111111111111111111111111112",
//!         "1s",
//!         |candle: TokenCandle| {
//!             println!("Candle: {:?}", candle);
//!         },
//!         None,
//!     ).await.unwrap();
//!
//!     // Later: unsubscribe
//!     // unsub.unsubscribe();
//! }
//! ```

mod client;
mod fields;
mod models;

pub use client::{StreamApi, StreamCallback, Unsubscribe};
pub use fields::{get_available_fields, get_field_mappings, replace_filter_fields};
pub use models::*;