1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! # predict-fun-sdk
//!
//! Rust SDK for the [Predict.fun](https://predict.fun) prediction market API on BNB Chain.
//!
//! ## Modules
//!
//! - [`api`] — REST client for all 30 endpoints (BNB Chain mainnet + testnet)
//! - [`ws`] — WebSocket client for real-time orderbook, price, and cross-venue feeds
//! - [`order`] — EIP-712 order structs, signing, and amount calculation
//! - [`execution`] — Auth → sign → submit pipeline with market metadata cache
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use predict_fun_sdk::{PredictApiClient, PredictExecutionClient, PredictExecConfig};
//! use predict_fun_sdk::ws::{PredictWsClient, PredictWsMessage, Topic};
//! use predict_fun_sdk::order::BNB_MAINNET_CHAIN_ID;
//!
//! # async fn example() -> anyhow::Result<()> {
//! // REST
//! let client = PredictApiClient::new_mainnet("your-api-key")?;
//! let markets = client.list_markets(&[("limit", "10".to_string())]).await?;
//!
//! // WebSocket
//! let (ws, mut rx) = PredictWsClient::connect_mainnet().await?;
//! ws.subscribe(Topic::Orderbook { market_id: 12345 }).await?;
//!
//! // Execution (with market metadata cache)
//! let exec = PredictExecutionClient::new(PredictExecConfig {
//! api_key: "key".into(),
//! private_key: "0x...".into(),
//! chain_id: BNB_MAINNET_CHAIN_ID,
//! live_execution: false,
//! fill_or_kill: true,
//! }).await?;
//!
//! // Pre-warm cache for markets you'll trade
//! exec.preload_markets(&[12345, 67890]).await?;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
pub use ;