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
//! Hyperliquid SDK for Rust
//!
//! A simple, performant SDK for trading on Hyperliquid.
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use hyperliquid_sdk::{HyperliquidSDK, Side, TIF};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Initialize with private key (or set PRIVATE_KEY env var)
//! let sdk = HyperliquidSDK::new()
//! .endpoint("https://your-endpoint.hype-mainnet.quiknode.pro/TOKEN")
//! .private_key("0x...")
//! .build()
//! .await?;
//!
//! // Market buy $100 worth of BTC
//! let order = sdk.market_buy("BTC").await.notional(100.0).await?;
//! println!("Order placed: {:?}", order.oid);
//!
//! // Or use the fluent builder
//! use hyperliquid_sdk::Order;
//! let order = sdk.order(
//! Order::buy("BTC").size(0.001).price(65000.0).gtc()
//! ).await?;
//!
//! Ok(())
//! }
//! ```
//!
//! # Features
//!
//! - **Trading**: Market/limit orders, stop-loss, take-profit, TWAP
//! - **Order Management**: Cancel, modify, batch operations
//! - **Info API**: Market data, positions, open orders, account state
//! - **HyperCore**: Real-time block data, trades, order book updates
//! - **Streaming**: WebSocket and gRPC (optional) for real-time data
//! - **HyperEVM**: Ethereum JSON-RPC compatibility
// Re-export main types for convenience
pub use ;
pub use ;
pub use ;
pub use ;
pub use Info;
pub use HyperCore;
pub use EVM;
pub use Stream;
pub use ;
pub use GRPCStream;
// Re-export serde_json::Value for convenience since many API methods return it
pub use Value;