pub struct HyperliquidRpcClient { /* private fields */ }Expand description
Hyperliquid HyperEVM mainnet read-only JSON-RPC namespace.
It targets HyperEVM mainnet chain ID 999 (0x3e7); HYPE is represented
only as the native balance in this read-only surface.
The deliberately narrow surface has compile-fail coverage for forbidden escape hatches and state-changing operations:
ⓘ
let rpc = ErpcClient::new(ErpcClientConfig::new("key"))?.hyperliquid.rpc;
let _ = rpc.raw::<String>("eth_chainId", None);ⓘ
let rpc = ErpcClient::new(ErpcClientConfig::new("key"))?.hyperliquid.rpc;
let _ = rpc.request::<String>("eth_chainId", Vec::<serde_json::Value>::new());ⓘ
let rpc = ErpcClient::new(ErpcClientConfig::new("key"))?.hyperliquid.rpc;
let _ = rpc.batch(Vec::new());ⓘ
let rpc = ErpcClient::new(ErpcClientConfig::new("key"))?.hyperliquid.rpc;
let _ = rpc.subscribe("newHeads", Vec::new());ⓘ
let rpc = ErpcClient::new(ErpcClientConfig::new("key"))?.hyperliquid.rpc;
let _ = rpc.eth_send_raw_transaction(["0xdeadbeef"]);Implementations§
Source§impl HyperliquidRpcClient
impl HyperliquidRpcClient
Sourcepub fn endpoint(&self) -> String
pub fn endpoint(&self) -> String
Returns the credential-free Hyperliquid HyperEVM mainnet read-only JSON-RPC origin and root.
Sourcepub fn eth_chain_id(&self) -> PendingRpcRequest<String>
pub fn eth_chain_id(&self) -> PendingRpcRequest<String>
Creates a pending Hyperliquid HyperEVM mainnet read-only JSON-RPC eth_chainId read.
§Panics
The empty parameter array is infallible to serialize.
Sourcepub fn eth_get_balance<P: Serialize>(
&self,
params: P,
) -> Result<PendingRpcRequest<String>>
pub fn eth_get_balance<P: Serialize>( &self, params: P, ) -> Result<PendingRpcRequest<String>>
Creates a pending positional Hyperliquid HyperEVM mainnet read-only JSON-RPC eth_getBalance read.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HyperliquidRpcClient
impl !UnwindSafe for HyperliquidRpcClient
impl Freeze for HyperliquidRpcClient
impl Send for HyperliquidRpcClient
impl Sync for HyperliquidRpcClient
impl Unpin for HyperliquidRpcClient
impl UnsafeUnpin for HyperliquidRpcClient
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