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

Functions

@spec listening(opts()) :: result()

Check if the client is actively listening for network connections.

Returns

  • {:ok, boolean} - True if listening
@spec peer_count(opts()) :: result()

Get the number of peers currently connected.

Returns

  • {:ok, hex_string} - Peer count as hex string
@spec version(opts()) :: result()

Get the current network ID.

Returns

  • {:ok, string} - Network ID as string (e.g., "1" for mainnet)

Example

{:ok, "999"} = Net.version()