Optimism
Ready to call this in production?
Free tier covers personal projects. Pay-as-you-go scales without a card.
Optimism
Free tier covers personal projects. Pay-as-you-go scales without a card.
This page lists every JSON-RPC method TheRPC supports on OP Mainnet (chain ID 10), grouped by namespace, with a short note on what each one does and when you'd reach for it. Because OP Mainnet is an OP Stack rollup that stays bytecode-equivalent with Ethereum, the method surface mirrors a standard Ethereum execution client, so anything you already run against Ethereum L1 works against https://optimism.therpc.io/YOUR_API_KEY unchanged. Click any method name to open its full documentation — parameters, return shape, error codes, CU cost, and copy-paste examples.
The eth_ namespace carries the core functionality for working with OP Mainnet: reading account balances and ETH transfers, querying ~2-second Bedrock blocks and receipts, calling and estimating gas for smart contracts, and submitting signed transactions. These are the methods most dApps built on Velodrome, Synthetix, and the wider Superchain depend on for day-to-day reads and writes.
eth_blockNumberGet the latest L2 block height on OP Mainnet (chain ID 10) with eth_blockNumber over the optimism.therpc.io JSON-RPC endpoint.
eth_callRun read-only contract calls on OP Mainnet (chain ID 10) with eth_call — no gas, no transaction — via the optimism.therpc.io JSON-RPC endpoint.
eth_chainIdConfirm you are on OP Mainnet (EIP-155 chain ID 10, 0xa) with eth_chainId via the optimism.therpc.io JSON-RPC endpoint before signing transactions.
eth_estimateGasEstimate the L2 execution gas for a transaction on OP Mainnet (chain ID 10) with eth_estimateGas via the optimism.therpc.io JSON-RPC endpoint.
eth_feeHistoryPull historical base fees and priority-fee percentiles on OP Mainnet (chain ID 10) with eth_feeHistory via the optimism.therpc.io JSON-RPC endpoint.
eth_gasPriceGet the node's suggested gas price in ETH wei on OP Mainnet (chain ID 10) with eth_gasPrice via the optimism.therpc.io JSON-RPC endpoint.
eth_getBalanceRead an account's ETH balance on OP Mainnet (chain ID 10) at any block with eth_getBalance via the optimism.therpc.io JSON-RPC endpoint.
eth_getBlockByHashFetch a block by its hash on OP Mainnet (chain ID 10) with eth_getBlockByHash via the optimism.therpc.io JSON-RPC endpoint.
eth_getBlockByNumberFetch a block by height or tag on OP Mainnet (chain ID 10) with eth_getBlockByNumber via the optimism.therpc.io JSON-RPC endpoint.
eth_getBlockReceiptsFetch every transaction receipt in a block in one call on OP Mainnet (chain ID 10) with eth_getBlockReceipts via the optimism.therpc.io endpoint.
eth_getBlockTransactionCountByHashCount the transactions in a block by hash on OP Mainnet (chain ID 10) with eth_getBlockTransactionCountByHash via the optimism.therpc.io endpoint.
eth_getBlockTransactionCountByNumberCall eth_getBlockTransactionCountByNumber on OP Mainnet to count the transactions in a block by height or tag via TheRPC JSON-RPC.
eth_getCodeCall eth_getCode on OP Mainnet to read the deployed EVM bytecode at an address for any block via TheRPC JSON-RPC.
eth_getFilterChangesCall eth_getFilterChanges on OP Mainnet to poll a filter for new logs, block, or tx hashes since the last call via TheRPC.
eth_getFilterLogsCall eth_getFilterLogs on OP Mainnet to fetch every log matching an existing log filter, independent of poll state, via TheRPC.
eth_getLogsCall eth_getLogs on OP Mainnet to fetch event logs matching a filter object — the core method for backfill indexing via TheRPC.
eth_getProofCall eth_getProof on OP Mainnet to get account fields and Merkle-Patricia trie proofs for an account and its storage slots via TheRPC.
eth_getStorageAtCall eth_getStorageAt on OP Mainnet to read the 32-byte value at a contract storage slot for any block via TheRPC JSON-RPC.
eth_getTransactionByBlockHashAndIndexCall eth_getTransactionByBlockHashAndIndex on OP Mainnet to fetch a transaction by its index inside a block hash via TheRPC.
eth_getTransactionByBlockNumberAndIndexCall eth_getTransactionByBlockNumberAndIndex on OP Mainnet to fetch a transaction by its index inside a block number or tag via TheRPC.
eth_getTransactionByHashCall eth_getTransactionByHash on OP Mainnet to fetch the full transaction object for a given tx hash via TheRPC JSON-RPC.
eth_getTransactionCountCall eth_getTransactionCount on OP Mainnet to read an account nonce at a given block — essential for building transactions via TheRPC.
eth_getTransactionReceiptFetch the execution receipt of a mined OP Mainnet transaction with eth_getTransactionReceipt: status, gas used, and emitted logs.
eth_getUncleByBlockHashAndIndexeth_getUncleByBlockHashAndIndex on OP Mainnet returns null: the rollup uses a single sequencer and produces no uncle (ommer) blocks.
eth_getUncleByBlockNumberAndIndexeth_getUncleByBlockNumberAndIndex on OP Mainnet returns null: the single-sequencer rollup produces no uncle (ommer) blocks at any height.
eth_getUncleCountByBlockHasheth_getUncleCountByBlockHash on OP Mainnet always returns 0x0: the single-sequencer OP Stack rollup references no uncle blocks.
eth_getUncleCountByBlockNumbereth_getUncleCountByBlockNumber on OP Mainnet always returns 0x0: the single-sequencer OP Stack rollup references no uncle blocks at any height.
eth_maxPriorityFeePerGasGet OP Mainnet's suggested priority fee (tip) per gas for EIP-1559 transactions with eth_maxPriorityFeePerGas over JSON-RPC.
eth_newBlockFilterCreate an OP Mainnet server-side filter that tracks new block arrivals with eth_newBlockFilter and poll it via eth_getFilterChanges.
eth_newFilterCreate an OP Mainnet server-side log filter with eth_newFilter and poll it incrementally via eth_getFilterChanges over JSON-RPC.
eth_newPendingTransactionFilterCreate an OP Mainnet filter for incoming pending transactions with eth_newPendingTransactionFilter and poll it via eth_getFilterChanges.
eth_sendRawTransactionBroadcast a signed, RLP-encoded transaction to OP Mainnet with eth_sendRawTransaction and get back its hash over JSON-RPC.
eth_subscribeUse eth_subscribe on OP Mainnet to push new heads, logs, and pending txs over WebSocket — no polling. Chain ID 10 via optimism.therpc.io.
eth_syncingCall eth_syncing on OP Mainnet to read sync progress, or false when fully synced. Chain ID 10 via optimism.therpc.io JSON-RPC.
eth_uninstallFilterCall eth_uninstallFilter on OP Mainnet to remove a server-side filter by ID and free node resources. Chain ID 10 via optimism.therpc.io.
eth_unsubscribeCall eth_unsubscribe on OP Mainnet to cancel a WebSocket subscription by ID and stop notifications. Chain ID 10 via optimism.therpc.io.
The debug_ namespace lets you inspect OP Mainnet execution in fine detail — replaying a transaction step by step, dumping raw block and state data, and surfacing the internal calls a regular receipt hides. They are the go-to tools for diagnosing a failed swap on an OP Stack DEX or auditing exactly how a contract behaved at a given block.
debug_getBadBlocksCall debug_getBadBlocks on OP Mainnet (chain ID 10) to list the invalid blocks an op-geth node has observed and rejected since it last started.
debug_storageRangeAtUse debug_storageRangeAt on OP Mainnet (chain ID 10) to read a paginated slice of a contract's raw storage slots after a given transaction in a block.
debug_traceBlockCall debug_traceBlock on OP Mainnet (chain ID 10) for opcode-level execution traces of every transaction in a block supplied as RLP-encoded bytes.
debug_traceBlockByHashCall debug_traceBlockByHash on OP Mainnet (chain ID 10) for opcode-level execution traces of every transaction in a block identified by its hash.
debug_traceBlockByNumberCall debug_traceBlockByNumber on OP Mainnet (chain ID 10) for opcode-level execution traces of every transaction in a block by number or tag.
debug_traceCallCall debug_traceCall on OP Mainnet (chain ID 10) to run a call against a chosen block state and get a full opcode-level trace without sending a transaction.
debug_traceTransactionCall debug_traceTransaction on OP Mainnet (chain ID 10) to replay a transaction at opcode level and reproduce the exact EVM state of its block.
The trace_ namespace returns detailed execution traces for OP Mainnet transactions and whole blocks, exposing every internal call, value transfer, and state change. Analytics platforms, accounting tools, and indexers use these traces to reconstruct full activity across the Superchain rollup that a top-level receipt alone cannot reveal.
trace_blockCall trace_block on OP Mainnet (chain ID 10) to get call-tree traces for every transaction in a block, identified by block number or tag.
trace_callCall trace_call on OP Mainnet (chain ID 10) to simulate a call against a block state and get a Parity-style call tree, VM trace, and state diff.
trace_filterCall trace_filter on OP Mainnet (chain ID 10) to search traces by address and block range with pagination across a span of blocks.
trace_replayBlockTransactionsCall trace_replayBlockTransactions on OP Mainnet (chain ID 10) to replay every transaction in a block with selectable trace, VM trace, and state diff.
trace_replayTransactionCall trace_replayTransaction on OP Mainnet (chain ID 10) to replay a transaction with selectable call-tree trace, VM trace, and state diff.
trace_transactionCall trace_transaction on OP Mainnet (chain ID 10) for the Parity-style call tree of a transaction, showing every internal call, create, and self-destruct.
The net_ namespace exposes network-level status and connection information for OP Mainnet — confirming you are connected to chain ID 10, reporting peer count, and checking whether the node is actively listening. They are useful as a quick sanity check that your client is pointed at OP Mainnet rather than another Superchain network or an L1.
net_listeningCall net_listening on OP Mainnet to check whether the node listens for P2P connections. Chain ID 10 via optimism.therpc.io JSON-RPC.
net_peerCountCall net_peerCount on OP Mainnet to get the number of connected peers as a hex integer. Chain ID 10 via optimism.therpc.io JSON-RPC.
net_versionCall net_version on OP Mainnet to read the network ID as a decimal string (10). Chain ID 10 via optimism.therpc.io JSON-RPC.
The txpool_ namespace lets you inspect the pending and queued transaction pool on OP Mainnet before transactions are sequenced into a block. With ~2-second block times, this view is short-lived but valuable for monitoring in-flight ETH transfers and contract calls, and for debugging why a transaction is stuck waiting on a nonce.
txpool_inspectCall txpool_inspect on OP Mainnet for a human-readable summary of pending and queued txs by sender and nonce. Chain ID 10 via optimism.therpc.io.
txpool_statusCall txpool_status on OP Mainnet for pending and queued tx counts as hex integers. Chain ID 10 via optimism.therpc.io JSON-RPC.
The web3_ namespace holds small utility helpers for general interaction with OP Mainnet — reporting the client version of the underlying OP Stack node and computing Keccak-256 hashes server-side. They are handy for connectivity checks and lightweight hashing without pulling in a full crypto library.