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
//! # Hyperliquid DEX Connector
//!
//! Implementation of Hyperliquid perpetuals and spot DEX connector.
//!
//! ## Architecture
//!
//! - `endpoints` - API URLs and endpoint enum
//! - `auth` - EIP-712 signature implementation
//! - `parser` - JSON response parsing
//! - `connector` - HyperliquidConnector + trait implementations
//! - `websocket` - WebSocket connection with auto-reconnect
//!
//! ## Authentication
//!
//! Hyperliquid uses EIP-712 wallet signatures instead of API keys:
//! - L1 actions (trading) use phantom agent construction
//! - User-signed actions (transfers, withdrawals) use direct EIP-712
//!
//! ## Symbol Format
//!
//! - Perpetuals: Direct coin name ("BTC", "ETH") → asset ID from metadata
//! - Spot: "@{index}" format ("@0" for PURR/USDC, "@107" for HYPE/USDC)
//!
//! ## Usage
//!
//! ```ignore
//! use connectors_v5::exchanges::hyperliquid::HyperliquidConnector;
//!
//! let connector = HyperliquidConnector::new(wallet_private_key, false).await?;
//!
//! // Core methods (from traits)
//! let price = connector.get_price("BTC".into(), AccountType::FuturesCross).await?;
//! let orderbook = connector.get_orderbook("BTC".into(), None, AccountType::FuturesCross).await?;
//!
//! // Extended methods (Hyperliquid-specific)
//! let metadata = connector.get_metadata().await?;
//! let all_mids = connector.get_all_mids().await?;
//! ```
pub use ;
pub use HyperliquidAuth;
pub use HyperliquidParser;
pub use HyperliquidConnector;
pub use HyperliquidWebSocket;
pub use ;