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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//! # allenhark-slipstream - Rust SDK for Slipstream
//!
//! Slipstream is a sender-agnostic Solana transaction relay system with
//! leader-proximity-aware routing.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use allenhark_slipstream::{Config, SlipstreamClient};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create configuration
//! let config = Config::builder()
//! .api_key("sk_test_12345678")
//! .region("us-west")
//! .build()?;
//!
//! // Connect to Slipstream
//! let client = SlipstreamClient::connect(config).await?;
//!
//! // Submit a transaction
//! let tx_bytes = vec![/* signed transaction bytes */];
//! let result = client.submit_transaction(&tx_bytes).await?;
//! println!("Transaction signature: {:?}", result.signature);
//!
//! Ok(())
//! }
//! ```
//!
//! ## Streaming
//!
//! The SDK supports real-time streaming of leader hints, tip instructions,
//! and priority fees:
//!
//! ```rust,no_run
//! use allenhark_slipstream::{Config, SlipstreamClient};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = Config::builder()
//! .api_key("sk_test_12345678")
//! .leader_hints(true)
//! .build()?;
//!
//! let client = SlipstreamClient::connect(config).await?;
//!
//! // Subscribe to leader hints
//! let mut hints = client.subscribe_leader_hints().await?;
//! while let Some(hint) = hints.recv().await {
//! println!("Preferred region: {} (confidence: {})",
//! hint.preferred_region, hint.confidence);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Protocol Fallback
//!
//! The SDK automatically falls back through protocols if the preferred one
//! is unavailable:
//!
//! 1. **QUIC** (2s timeout) - Primary high-performance protocol
//! 2. **gRPC** (3s timeout) - Streaming fallback
//! 3. **WebSocket** (3s timeout) - Browser-compatible streaming
//! 4. **HTTP** (5s timeout) - Polling fallback
//!
//! ## Features
//!
//! - **Persistent connections** - Single connection reused for all operations
//! - **Auto-reconnect** - Automatic reconnection on connection loss
//! - **Leader hints** - Real-time region recommendations
//! - **Tip instructions** - Dynamic tip wallet selection
//! - **Priority fees** - Compute unit price recommendations
// Re-export main types for convenience
pub use SlipstreamClient;
pub use ;
pub use ;
pub use MultiRegionClient;
pub use ;
/// SDK version
pub const VERSION: &str = env!;