View Source Hyperliquid.Rpc.Net (hyperliquid v0.2.2)
Network-related JSON-RPC methods for Hyperliquid EVM.
Usage
alias Hyperliquid.Rpc.Net
{:ok, version} = Net.version()
Summary
Functions
Check if the client is actively listening for network connections.
Get the number of peers currently connected.
Get the current network ID.
Types
@type opts() :: Hyperliquid.Transport.Rpc.rpc_opts()
@type result() :: Hyperliquid.Transport.Rpc.rpc_result()
Functions
Check if the client is actively listening for network connections.
Returns
{:ok, boolean}- True if listening
Get the number of peers currently connected.
Returns
{:ok, hex_string}- Peer count as hex string
Get the current network ID.
Returns
{:ok, string}- Network ID as string (e.g., "1" for mainnet)
Example
{:ok, "999"} = Net.version()