pub struct HyperliquidExecutionClient { /* private fields */ }Implementations§
Source§impl HyperliquidExecutionClient
impl HyperliquidExecutionClient
Sourcepub fn config(&self) -> &HyperliquidExecClientConfig
pub fn config(&self) -> &HyperliquidExecClientConfig
Returns a reference to the configuration.
Sourcepub fn ws_dispatch_state(&self) -> &Arc<WsDispatchState> ⓘ
pub fn ws_dispatch_state(&self) -> &Arc<WsDispatchState> ⓘ
Returns a reference to the shared WebSocket dispatch state.
Exposes the identity map, pending-modify markers, and cached venue
order ids used by the two-tier dispatch contract. The state is
read-write via an Arc; callers must not mutate it directly, but
it is useful for inspection in tests and for live debugging.
Sourcepub fn pending_tasks_all_finished(&self) -> bool
pub fn pending_tasks_all_finished(&self) -> bool
Returns true when every background task spawned via spawn_task
has completed.
Used in tests to wait for submit / modify / cancel HTTP round-trips
that fire on the runtime to finish before asserting on dispatch
state, avoiding bare sleep calls when a negative condition needs
to be checked after the spawned work is done.
Sourcepub fn new(
core: ExecutionClientCore,
config: HyperliquidExecClientConfig,
) -> Result<Self>
pub fn new( core: ExecutionClientCore, config: HyperliquidExecClientConfig, ) -> Result<Self>
Creates a new HyperliquidExecutionClient.
§Errors
Returns an error if either the HTTP or WebSocket client fail to construct.
Trait Implementations§
Source§impl Debug for HyperliquidExecutionClient
impl Debug for HyperliquidExecutionClient
Source§impl ExecutionClient for HyperliquidExecutionClient
impl ExecutionClient for HyperliquidExecutionClient
fn is_connected(&self) -> bool
fn client_id(&self) -> ClientId
fn account_id(&self) -> AccountId
fn venue(&self) -> Venue
fn oms_type(&self) -> OmsType
fn get_account(&self) -> Option<AccountAny>
Source§fn generate_account_state(
&self,
balances: Vec<AccountBalance>,
margins: Vec<MarginBalance>,
reported: bool,
ts_event: UnixNanos,
) -> Result<()>
fn generate_account_state( &self, balances: Vec<AccountBalance>, margins: Vec<MarginBalance>, reported: bool, ts_event: UnixNanos, ) -> Result<()>
Source§fn submit_order(&self, cmd: SubmitOrder) -> Result<()>
fn submit_order(&self, cmd: SubmitOrder) -> Result<()>
Source§fn submit_order_list(&self, cmd: SubmitOrderList) -> Result<()>
fn submit_order_list(&self, cmd: SubmitOrderList) -> Result<()>
Source§fn batch_cancel_orders(&self, cmd: BatchCancelOrders) -> Result<()>
fn batch_cancel_orders(&self, cmd: BatchCancelOrders) -> Result<()>
Source§fn query_account(&self, _cmd: QueryAccount) -> Result<()>
fn query_account(&self, _cmd: QueryAccount) -> Result<()>
Source§fn query_order(&self, cmd: QueryOrder) -> Result<()>
fn query_order(&self, cmd: QueryOrder) -> Result<()>
Source§fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_order_status_report<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReport,
) -> Pin<Box<dyn Future<Output = Result<Option<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_order_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GenerateOrderStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<OrderStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_fill_reports<'life0, 'async_trait>(
&'life0 self,
cmd: GenerateFillReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<FillReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn generate_position_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GeneratePositionStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<PositionStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_position_status_reports<'life0, 'life1, 'async_trait>(
&'life0 self,
cmd: &'life1 GeneratePositionStatusReports,
) -> Pin<Box<dyn Future<Output = Result<Vec<PositionStatusReport>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn generate_mass_status<'life0, 'async_trait>(
&'life0 self,
lookback_mins: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<ExecutionMassStatus>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_mass_status<'life0, 'async_trait>(
&'life0 self,
lookback_mins: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Option<ExecutionMassStatus>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
§fn register_external_order(
&self,
_client_order_id: ClientOrderId,
_venue_order_id: VenueOrderId,
_instrument_id: InstrumentId,
_strategy_id: StrategyId,
_ts_init: UnixNanos,
)
fn register_external_order( &self, _client_order_id: ClientOrderId, _venue_order_id: VenueOrderId, _instrument_id: InstrumentId, _strategy_id: StrategyId, _ts_init: UnixNanos, )
§fn on_instrument(&mut self, _instrument: InstrumentAny)
fn on_instrument(&mut self, _instrument: InstrumentAny)
§fn calculate_commission(
&self,
instrument: &InstrumentAny,
last_qty: Quantity,
last_px: Price,
liquidity_side: LiquiditySide,
) -> Option<Money>
fn calculate_commission( &self, instrument: &InstrumentAny, last_qty: Quantity, last_px: Price, liquidity_side: LiquiditySide, ) -> Option<Money>
Auto Trait Implementations§
impl !Freeze for HyperliquidExecutionClient
impl !RefUnwindSafe for HyperliquidExecutionClient
impl !Send for HyperliquidExecutionClient
impl !Sync for HyperliquidExecutionClient
impl Unpin for HyperliquidExecutionClient
impl UnsafeUnpin for HyperliquidExecutionClient
impl !UnwindSafe for HyperliquidExecutionClient
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