Optimism API overview

These endpoints allow to retrieve information about blocks, transactions, balances, logs, and more, facilitating efficient blockchain development and integration.

Accounts info#

Retrieves data about an account’s on-chain storage, balance, and contract code.

eth_accounts
eth_getBalance
eth_getCode
eth_getProof
eth_getStorageAt

Blocks info#

Retrieves detailed information about a specific block using its number or hash

eth_blockNumber
eth_getBlockByHash
eth_getBlockByHash#full
eth_getBlockByNumber
eth_getBlockByNumber#full
eth_newBlockFilter
eth_getBlockReceipts
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber

Chain info#

Gathers essential details about the Optimism network and its protocol settings.

eth_chainId
eth_protocolVersion
net_listening
net_version
net_peerCount
eth_syncing
eth_hashrate

Debug and trace#

Available only on paid tier. Contains advanced debugging and tracing tools.

trace_filter
trace_rawTransaction
trace_block
trace_replayBlockTransactions
trace_replayBlockTransactions#vmTrace
debug_traceBlockByHash
debug_traceBlockByNumber
trace_transaction
debug_traceTransaction
trace_replayTransaction
trace_replayTransaction#vmTrace
trace_callMany
trace_get
trace_call

Event logs#

Extracts logs related to smart contract events like token transfers or ownership changes.

eth_getLogs
eth_newFilter
eth_getFilterChanges
eth_uninstallFilter
eth_getFilterLogs

Executing transactions#

Enables the sending of ETH, contract interaction, or writing data to the chain.

eth_call
eth_sendRawTransaction

Gas estimation#

Estimates gas prices and consumption for transactions.

eth_feeHistory
eth_estimateGas
eth_gasPrice
eth_createAccessList
eth_maxPriorityFeePerGas

Getting uncles#

Retrieves information about uncle blocks (blocks rejected by the network).

eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getUncleCountByBlockHash
eth_getUncleCountByBlockNumber

Mining#

Consists of methods that provide information related to the mining.

eth_coinbase
eth_mining

Subscriptions#

Enables WebSocket connections for continuous monitoring of blockchain changes.

eth_subscribe
eth_unsubscribe

Transactions info#

Accesses transaction details, such as their state, count, or receipts.

eth_getTransactionByHash
eth_getTransactionCount
eth_getTransactionReceipt
eth_newPendingTransactionFilter
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
txpool_content

Web3#

Provides utility functions to interact with the blockchain.

web3_clientVersion
web3_sha3