Reference Testnet · v1.10 · all tests passing
Estimated read time: 9 minutes

JSON-RPC API

Endpoint and shape

Every Valdium node exposes a JSON-RPC 2.0 endpoint over HTTP and WebSocket. The public testnet endpoint is https://testnet.valdium.xyz/rpc (HTTP) and wss://testnet.valdium.xyz/ws (WebSocket). The wire format is standard JSON-RPC 2.0:

POST /rpc Content-Type: application/json { "jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": [] } // response { "jsonrpc": "2.0", "id": 1, "result": "0x37e9" }

The method namespace is val_* — Valdium's native JSON-RPC surface. The request/response envelope follows the familiar JSON-RPC 2.0 shape used across the ecosystem, and breaks away cleanly where Valdium differs (Dilithium3 signature scheme, BLAKE3 hashing, account-model deltas).

Chain state methods

MethodReturns
eth_chainIdChain ID hex (0x539 on testnet)
eth_blockNumberLatest block number, hex
eth_getBlockByNumberFull block by height
eth_getBlockByHashFull block by hash
eth_getBlockTransactionCountByNumberNumber of txs in a block
eth_syncingfalse or sync status object

Account methods

MethodReturns
eth_getBalanceBase unit balance of an address at a block
eth_getTransactionCountNext nonce for an address
eth_getCodeContract bytecode at an address (empty for EOAs)
eth_getStorageAtStorage slot value at an address
eth_getProofFull account object — balance, nonce, codeHash, storageRoot

Transaction methods

MethodReturns
eth_sendRawTransactionTx hash; broadcasts a signed tx
eth_getTransactionByHashTx object
eth_getTransactionReceiptReceipt with logs, gasUsed, status
eth_getTransactionsByAddressPage of txs for an address
eth_estimateGasGas a call would consume
eth_callEth-style read call against a contract; never broadcast

Validator and consensus methods

MethodReturns
val_validatorsActive validator set at a height
val_validatorInfoPer-validator stats: stake, missed slots, jailed
val_epochCurrent epoch number and boundaries
val_proposerScheduleUpcoming N slots with the proposer for each

Fee market methods

MethodReturns
eth_gasPriceSuggested gas price (legacy)
eth_feeHistoryRecent base fees and priority-fee percentiles
eth_maxPriorityFeePerGasSuggested tip for inclusion

Wallet-bridging methods

These are intercepted by browser wallets and not directly served by nodes — included here because dapps call them through the same provider object:

MethodReturns
eth_requestAccountsPermitted accounts after user approval
eth_accountsAlready-permitted accounts (no prompt)
eth_signTransactionSigned (but not broadcast) tx
eth_sendTransactionSigned and broadcast tx — hash
personal_signDilithium3 signature over a domain-separated digest

Subscriptions (WebSocket only)

The WebSocket endpoint accepts eth_subscribe with one of the following channels:

ChannelFires on
newHeadsEvery new block
newPendingTransactionsEvery tx entering the mempool
logsEvent logs matching a filter
syncingSync state changes
// subscribe to new blocks ws.send(JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_subscribe', params: ['newHeads'] })); // → { result: '0x9c…', id: 1 } // → { method: 'eth_subscription', params: { subscription: '0x9c…', result: { ...block } } }

Batching

The endpoint accepts JSON-RPC batch requests — an array of calls in one POST. The response is an array of results in the same order. Useful for indexers and frontends that need many cold reads in flight; cuts round-trip overhead by 5-10x for cold caches.

Errors

Error codes follow JSON-RPC 2.0 conventions plus Valdium-specific application codes:

CodeMeaning
-32600Invalid request
-32601Method not found
-32602Invalid params
-32603Internal error
-32000Invalid input (e.g. malformed address)
-32001Resource not found
-32010Transaction underpriced
-32011Nonce too low
-32012Insufficient funds
4001User rejected request (wallet only)

Rate limits on public endpoints

The public testnet RPC enforces 60 requests/second per IP and a daily soft cap of 1,000,000 requests. Self-hosted nodes have no such limits. If you're indexing the chain or running a high-traffic dapp, run your own node — it's 10 GB of disk and zero ongoing cost.