hyperstack_sdk/lib.rs
1//! Rust client SDK for connecting to HyperStack streaming servers.
2//!
3//! ```rust,ignore
4//! use hyperstack_sdk::{HyperStack, Entity, Update};
5//! use futures_util::StreamExt;
6//! use my_stack::{PumpfunToken, PumpfunTokenEntity};
7//!
8//! #[tokio::main]
9//! async fn main() -> anyhow::Result<()> {
10//! let hs = HyperStack::connect("wss://mainnet.hyperstack.xyz").await?;
11//!
12//! if let Some(token) = hs.get::<PumpfunTokenEntity>("mint_address").await {
13//! println!("Token: {:?}", token);
14//! }
15//!
16//! let mut stream = hs.watch::<PumpfunTokenEntity>().await;
17//! while let Some(update) = stream.next().await {
18//! match update {
19//! Update::Upsert { key, data } => println!("Updated: {}", key),
20//! Update::Delete { key } => println!("Deleted: {}", key),
21//! _ => {}
22//! }
23//! }
24//!
25//! Ok(())
26//! }
27//! ```
28
29mod client;
30mod config;
31mod connection;
32mod entity;
33mod error;
34mod frame;
35mod store;
36mod stream;
37mod subscription;
38
39pub use client::{HyperStack, HyperStackBuilder};
40pub use config::HyperStackConfig;
41pub use connection::ConnectionState;
42pub use entity::{Entity, Filterable};
43pub use error::HyperStackError;
44pub use frame::{Frame, Mode, Operation};
45pub use store::{SharedStore, StoreUpdate};
46pub use stream::{EntityStream, Update};
47pub use subscription::Subscription;
48
49pub use serde_json::Value;