Skip to main content

RPC API Reference

Complete reference for all RPC methods available on Nexis Appchain, including standard Ethereum JSON-RPC, Optimism-specific methods, and custom Nexis AI agent methods.

Quick Start

Endpoint Information

HTTP RPC

https://testnet-rpc.nex-t1.aiRate Limit: 100 req/s

WebSocket

wss://testnet-ws.nex-t1.aiReal-time subscriptions

Testnet Chain ID

84532 (0x14A34)Same as Base Sepolia

Block Time

2 secondsFast finality

Standard Ethereum JSON-RPC Methods

Block Methods

eth_blockNumber

Get the latest block number.
Response:

eth_getBlockByNumber

Get block information by block number. Parameters:
  1. QUANTITY|TAG - Block number or tag (“earliest”, “latest”, “pending”, “safe”, “finalized”)
  2. Boolean - If true, returns full transaction objects; if false, only transaction hashes
Response:

eth_getBlockByHash

Get block information by block hash. Parameters:
  1. DATA - 32-byte block hash
  2. Boolean - If true, returns full transaction objects

eth_getBlockTransactionCountByNumber

Get transaction count in a block.

Transaction Methods

eth_getTransactionByHash

Get transaction details by hash.
Response:

eth_getTransactionReceipt

Get transaction receipt (confirmation status, logs, gas used).
Response:

eth_sendRawTransaction

Send a signed transaction.

eth_getTransactionCount

Get transaction count (nonce) for an address.

Account Methods

eth_getBalance

Get account balance.
Response:

eth_getCode

Get contract bytecode at an address.

eth_getStorageAt

Get storage value at a specific position.

State Query Methods

eth_call

Execute a contract function without creating a transaction (read-only).

eth_estimateGas

Estimate gas needed for a transaction.

Gas & Fee Methods

eth_gasPrice

Get current gas price.

eth_feeHistory

Get historical gas fee data. Parameters:
  1. QUANTITY - Number of blocks
  2. QUANTITY|TAG - Newest block
  3. Array - Reward percentiles (e.g., [25, 50, 75])
Response:

Event & Log Methods

eth_getLogs

Get event logs matching filter criteria. Parameters:
  • fromBlock: Starting block (number or “earliest”, “latest”)
  • toBlock: Ending block
  • address: Contract address(es) to filter
  • topics: Event signature and indexed parameters
Advanced filtering:

eth_newFilter

Create a log filter.

eth_newBlockFilter

Create a block filter for new blocks.

Chain Information Methods

eth_chainId

Get chain ID.
Response:

net_version

Get network ID (same as chain ID).

web3_clientVersion

Get client version information.
Response:

Optimism-Specific Methods

Nexis is built on the OP Stack, so Optimism-specific methods are available.

optimism_syncStatus

Get L2 sync status relative to L1.
Response:
Sync states explained:
  • Unsafe L2: Latest block received from sequencer (may be reorged)
  • Safe L2: Block derived from finalized L1 data (unlikely to reorg)
  • Finalized L2: Block based on finalized L1 block (cannot reorg)

optimism_rollupConfig

Get rollup configuration.
Response:

optimism_outputAtBlock

Get output root at a specific block (for withdrawals).

WebSocket Subscriptions

Connect via WebSocket for real-time events.

Subscribe to New Blocks


Subscribe to Pending Transactions


Subscribe to Event Logs


Python WebSocket Example


Batch Requests

Send multiple RPC requests in a single HTTP call.

Rate Limiting

Rate Limit Information

Handling Rate Limits


Error Handling

Common Error Codes

Error Handling Examples


Performance Optimization

1. Use Batch Requests

2. Cache Immutable Data

3. Use WebSockets for Real-time Data


Complete Integration Example


Resources

RPC Infrastructure

Learn about RPC architecture

Run Your Own Node

Setup your own RPC node

Smart Contracts

Integrate with Nexis contracts

Building Guide

Complete development guide

Pro Tip: Use WebSocket subscriptions for real-time updates and HTTP for one-off queries. This combination provides the best performance!
For production applications, consider running your own RPC node for better reliability and no rate limits.