pub struct HyperliquidWebSocketInnerClient { /* private fields */ }
Expand description
Low-level Hyperliquid WebSocket client that wraps Nautilus WebSocketClient.
This is the inner client that handles the transport layer and provides low-level
WebSocket methods with ws_*
prefixes.
Implementations§
Source§impl HyperliquidWebSocketInnerClient
impl HyperliquidWebSocketInnerClient
Sourcepub async fn connect(url: &str) -> Result<Self>
pub async fn connect(url: &str) -> Result<Self>
Creates a new Hyperliquid WebSocket inner client with reconnection/backoff/heartbeat. Returns a client that owns the inbound message receiver.
Sourcepub async fn ws_send(&self, request: &HyperliquidWsRequest) -> Result<()>
pub async fn ws_send(&self, request: &HyperliquidWsRequest) -> Result<()>
Low-level method to send a Hyperliquid WebSocket request.
Sourcepub async fn ws_send_once(
&mut self,
request: &HyperliquidWsRequest,
) -> Result<()>
pub async fn ws_send_once( &mut self, request: &HyperliquidWsRequest, ) -> Result<()>
Low-level method to send a request only once (dedup by JSON serialization).
Sourcepub async fn ws_subscribe(
&mut self,
subscription: SubscriptionRequest,
) -> Result<()>
pub async fn ws_subscribe( &mut self, subscription: SubscriptionRequest, ) -> Result<()>
Low-level method to subscribe to a specific channel.
Sourcepub async fn ws_next_event(&mut self) -> Option<HyperliquidWsMessage>
pub async fn ws_next_event(&mut self) -> Option<HyperliquidWsMessage>
Get the next event from the WebSocket stream. Returns None when the connection is closed or the receiver is exhausted.
Sourcepub fn is_reconnecting(&self) -> bool
pub fn is_reconnecting(&self) -> bool
Returns true if the WebSocket is reconnecting.
Sourcepub fn is_disconnecting(&self) -> bool
pub fn is_disconnecting(&self) -> bool
Returns true if the WebSocket is disconnecting.
Sourcepub async fn ws_disconnect(&mut self) -> Result<()>
pub async fn ws_disconnect(&mut self) -> Result<()>
Disconnect the WebSocket client.
Sourcepub async fn post_info_raw(
&self,
payload: Value,
timeout: Duration,
) -> HyperliquidResult<PostResponsePayload>
pub async fn post_info_raw( &self, payload: Value, timeout: Duration, ) -> HyperliquidResult<PostResponsePayload>
Core: send an Info post and await response with timeout.
Sourcepub async fn post_action_raw(
&self,
action: ActionPayload,
timeout: Duration,
) -> HyperliquidResult<PostResponsePayload>
pub async fn post_action_raw( &self, action: ActionPayload, timeout: Duration, ) -> HyperliquidResult<PostResponsePayload>
Core: send an Action post and await response with timeout.
Sourcepub async fn info_l2_book(
&self,
coin: &str,
timeout: Duration,
) -> HyperliquidResult<HyperliquidL2Book>
pub async fn info_l2_book( &self, coin: &str, timeout: Duration, ) -> HyperliquidResult<HyperliquidL2Book>
Get l2Book via WS post and parse using shared REST model.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HyperliquidWebSocketInnerClient
impl !RefUnwindSafe for HyperliquidWebSocketInnerClient
impl Send for HyperliquidWebSocketInnerClient
impl Sync for HyperliquidWebSocketInnerClient
impl Unpin for HyperliquidWebSocketInnerClient
impl !UnwindSafe for HyperliquidWebSocketInnerClient
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more