View Source Hyperliquid.Rpc.Custom (hyperliquid v0.2.2)
Hyperliquid-specific custom JSON-RPC methods.
These methods are unique to Hyperliquid and not part of the standard Ethereum JSON-RPC spec.
Usage
alias Hyperliquid.Rpc.Custom
{:ok, gas_price} = Custom.big_block_gas_price()
{:ok, using_big} = Custom.using_big_blocks("0x...")
{:ok, sys_txs} = Custom.get_system_txs_by_block_number("0x1")
Summary
Functions
Get the base fee for the next big block.
Compare gas prices between small and big blocks.
Get system transactions by block hash.
Get system transactions by block number.
Check if an address is using big blocks.
Types
@type address() :: String.t()
@type block_tag() :: String.t()
@type hash() :: String.t()
@type opts() :: Hyperliquid.Transport.Rpc.rpc_opts()
@type result() :: Hyperliquid.Transport.Rpc.rpc_result()
Functions
Get the base fee for the next big block.
Big blocks are larger blocks used for batch processing on Hyperliquid.
Returns
{:ok, hex_string}- Gas price in wei as hex string
Example
{:ok, "0x3b9aca00"} = Custom.big_block_gas_price()
Compare gas prices between small and big blocks.
Convenience function to get both gas prices at once.
Returns
{:ok, %{small_block: hex, big_block: hex}}- Both gas prices
Example
{:ok, %{small_block: "0x...", big_block: "0x..."}} = Custom.compare_gas_prices()
Get system transactions by block hash.
Returns system transactions that originate from HyperCore.
Parameters
block_hash: Hash of the block
Returns
{:ok, transactions}- List of system transactions
Example
{:ok, sys_txs} = Custom.get_system_txs_by_block_hash("0x...")
Get system transactions by block number.
Returns system transactions that originate from HyperCore.
Parameters
block_number: Block number as hex string
Returns
{:ok, transactions}- List of system transactions
Example
{:ok, sys_txs} = Custom.get_system_txs_by_block_number("0x1")
Check if an address is using big blocks.
Parameters
address: Address to check
Returns
{:ok, boolean}- True if using big blocks
Example
{:ok, true} = Custom.using_big_blocks("0x...")