pub struct HyperLiquidWs { /* private fields */ }Expand description
HyperLiquid WebSocket client.
Provides real-time data streaming for HyperLiquid exchange.
Implementations§
Source§impl HyperLiquidWs
impl HyperLiquidWs
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnects from the WebSocket server.
Sourcepub async fn state(&self) -> WsConnectionState
pub async fn state(&self) -> WsConnectionState
Returns the current connection state.
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Checks if the WebSocket is connected.
Sourcepub async fn subscribe_all_mids(&self) -> Result<()>
pub async fn subscribe_all_mids(&self) -> Result<()>
Subscribes to all mid prices.
Sourcepub async fn subscribe_l2_book(&self, symbol: &str) -> Result<()>
pub async fn subscribe_l2_book(&self, symbol: &str) -> Result<()>
Sourcepub async fn subscribe_trades(&self, symbol: &str) -> Result<()>
pub async fn subscribe_trades(&self, symbol: &str) -> Result<()>
Sourcepub async fn subscribe_candle(&self, symbol: &str, interval: &str) -> Result<()>
pub async fn subscribe_candle(&self, symbol: &str, interval: &str) -> Result<()>
Subscribes to candle updates.
§Arguments
symbol- Trading pair symbol (e.g., “BTC”)interval- Candle interval (e.g., “1m”, “1h”)
Sourcepub async fn subscribe_user_events(&self, address: &str) -> Result<()>
pub async fn subscribe_user_events(&self, address: &str) -> Result<()>
Sourcepub async fn subscribe_user_fills(&self, address: &str) -> Result<()>
pub async fn subscribe_user_fills(&self, address: &str) -> Result<()>
Source§impl HyperLiquidWs
impl HyperLiquidWs
Sourcepub fn subscriptions(&self) -> &Arc<RwLock<Vec<Subscription>>>
pub fn subscriptions(&self) -> &Arc<RwLock<Vec<Subscription>>>
Returns a reference to the subscriptions.
Auto Trait Implementations§
impl Freeze for HyperLiquidWs
impl !RefUnwindSafe for HyperLiquidWs
impl Send for HyperLiquidWs
impl Sync for HyperLiquidWs
impl Unpin for HyperLiquidWs
impl !UnwindSafe for HyperLiquidWs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more