Expand description
Connecting to Hyperliquid: /info and /exchange over HTTP, the websocket, HyperEVM RPC, rate limits, and the Client that signs and sends.
Re-exports§
pub use api::Api;pub use api::Clock;pub use limit::Spent;pub use network::L1_CHAIN_ID;pub use network::MAINNET_HYPE;pub use network::MAINNET_USDC;pub use network::Network;pub use network::TESTNET_HYPE;pub use network::TESTNET_USDC;pub use network::Token;pub use network::USDC_INDEX;pub use network::UnknownNetwork;pub use transport::Accepted;pub use transport::ApiError;pub use transport::ExchangeResponse;pub use transport::Http;pub use transport::Method;pub use transport::Request;pub use transport::Response;pub use transport::Status;pub use transport::Transport;pub use transport::TransportError;pub use transport::exchange;pub use transport::info;pub use transport::info_request;pub use transport::user_request;
Modules§
- api
- One network’s
/infoand/exchangebehind one rate-limit gate.Apiis aTransport, so every read and send passes the gate and the meter; theHttpunderneath knows nothing of networks. - body
- The
/exchangebody, keys in the official Python SDK’s order. The venue reads it as JSON, so only the action’s own key order reaches a hash. - evm
- HyperEVM and the Arbitrum side of the bridge: typed JSON-RPC, ABI, RLP, EIP-1559
transactions, HyperCore’s read precompiles and CoreWriter actions. Sans-IO;
quantities are exact integers (
U256) and amounts convert tocrate::utils::Dec. - limit
- Request weights against Hyperliquid’s rate limit (the docs’ “Rate limits and user limits”), the last minute’s spend, and the gate a 429 closes. No clock and no I/O: every call is handed the time.
- native
- HTTP and websocket for native programs:
Nativesends requests through reqwest on rustls, andclockis the system clock. Hand both tocrate::client::Api: - network
- Mainnet and testnet. Everything that differs between them is a method on
Network; an action signed for one is never valid on the other, so the network is never assumed. - transport
- The
TransportandHttptraits, and the/infoand/exchangecalls every read and action goes through. - web
- HTTP and websocket for the browser and Workers:
Websends requests through the globalfetch,clockisDate.now(), and aFeedkeeps the websocket open over the globalWebSocket. Hand the first two tocrate::client::Api:
Structs§
- Client
- Reads for any module (
markets::perps::meta(&client)) and, with aSigner, actions.Sis()for a client that only reads.
Enums§
- Send
Error - Why an action was not taken. An action whose answer never came
(
TransportError::Unreachable) may have landed, so it is never resent.