pub struct HyperliquidInfoClient { /* private fields */ }Expand description
Minimal Hyperliquid /info reader for TEE perp readbacks.
Implementations§
Source§impl HyperliquidInfoClient
impl HyperliquidInfoClient
pub fn new(url: impl Into<String>) -> Self
pub fn mainnet() -> Self
pub fn testnet() -> Self
Sourcepub fn for_chain_id(chain_id: u64) -> Result<Self>
pub fn for_chain_id(chain_id: u64) -> Result<Self>
The info client for a Hypercall directive chain id (999 or 998).
Sourcepub async fn user_role(
&self,
address: AccountAddress,
) -> Result<HyperliquidUserRole>
pub async fn user_role( &self, address: AccountAddress, ) -> Result<HyperliquidUserRole>
Hyperliquid’s role for address.
Sourcepub async fn is_tee_api_wallet_active(
&self,
account: AccountAddress,
api_wallet: AccountAddress,
) -> Result<bool>
pub async fn is_tee_api_wallet_active( &self, account: AccountAddress, api_wallet: AccountAddress, ) -> Result<bool>
Whether Hyperliquid has api_wallet bound as an agent of account:
the TEE API wallet enrollment status.
Sourcepub async fn active_asset_leverage(
&self,
account: AccountAddress,
coin: &str,
) -> Result<HyperliquidLeverage>
pub async fn active_asset_leverage( &self, account: AccountAddress, coin: &str, ) -> Result<HyperliquidLeverage>
The account’s leverage and margin mode for coin (e.g. BTC or
xyz:SNDK), read back from Hyperliquid after a leverage change.
Trait Implementations§
Source§impl Clone for HyperliquidInfoClient
impl Clone for HyperliquidInfoClient
Auto Trait Implementations§
impl !RefUnwindSafe for HyperliquidInfoClient
impl !UnwindSafe for HyperliquidInfoClient
impl Forget for HyperliquidInfoClient
impl Freeze for HyperliquidInfoClient
impl Move for HyperliquidInfoClient
impl Send for HyperliquidInfoClient
impl Sync for HyperliquidInfoClient
impl Unpin for HyperliquidInfoClient
impl UnsafeUnpin for HyperliquidInfoClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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