Skip to main content
Version: 2.0.0

eth namespace

eth_accounts​

Returns a list of addresses owned by the client

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_accounts",
"params": []
}'

eth_baseFee​

Returns the base fee of the next block in wei

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_baseFee",
"params": []
}'

eth_blobBaseFee​

Returns the base fee per blob gas in wei

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_blobBaseFee",
"params": []
}'

eth_blockNumber​

Returns current block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_blockNumber",
"params": []
}'

eth_call​

Executes a tx call (does not create a transaction)

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_call",
"params": [transactionCall, blockParameter, stateOverride, blockOverride]
}'

eth_capabilities​

Returns the node's historical data availability for routing and capability discovery.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_capabilities",
"params": []
}'

eth_chainId​

Returns ChainID

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_chainId",
"params": []
}'

eth_config​

Provides configuration data for the current and next fork

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_config",
"params": []
}'

eth_createAccessList​

Creates an EIP2930 type AccessList for the given transaction

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_createAccessList",
"params": [transactionCall, blockParameter, stateOverride, optimize]
}'

eth_estimateGas​

Executes a tx call and returns gas used (does not create a transaction)

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_estimateGas",
"params": [transactionCall, blockParameter, stateOverride, blockOverride]
}'

eth_feeHistory​

Returns block fee history.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_feeHistory",
"params": [blockCount, newestBlock, rewardPercentiles]
}'

eth_fillTransaction​

Fills in the missing fields of a transaction (nonce, gas, fees and chain id) and returns the unsigned transaction, ready to be signed and submitted.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_fillTransaction",
"params": [rpcTx]
}'

eth_gasPrice​

Returns miner's gas price

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_gasPrice",
"params": []
}'

eth_getAccount​

Retrieves Accounts via Address and Blocknumber

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getAccount",
"params": [accountAddress, blockParameter]
}'

eth_getAccountInfo​

Retrieves Account with code and no storageRoot via Address and Blocknumber

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getAccountInfo",
"params": [accountAddress, blockParameter]
}'

eth_getBalance​

Returns account balance

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBalance",
"params": [address, blockParameter]
}'

eth_getBlockAccessList​

Returns the block access list for a given block.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockAccessList",
"params": [blockParameter]
}'

eth_getBlockByHash​

Retrieves a block by hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockByHash",
"params": [blockHash, returnFullTransactionObjects]
}'

eth_getBlockByNumber​

Retrieves a block by number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockByNumber",
"params": [blockParameter, returnFullTransactionObjects]
}'

eth_getBlockReceipts​

Get receipts from all transactions from particular block, more efficient than fetching the receipts one-by-one.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockReceipts",
"params": [blockParameter]
}'

eth_getBlockTransactionCountByHash​

Returns number of transactions in the block block hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockTransactionCountByHash",
"params": [blockHash]
}'

eth_getBlockTransactionCountByNumber​

Returns number of transactions in the block by block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockTransactionCountByNumber",
"params": [blockParameter]
}'

eth_getCode​

Returns account code at given address and block

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getCode",
"params": [address, blockParameter]
}'

eth_getFilterChanges​

Reads filter changes

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getFilterChanges",
"params": [filterId]
}'

eth_getFilterLogs​

Reads filter changes

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getFilterLogs",
"params": [filterId]
}'

eth_getHeaderByHash​

Retrieves a block header by hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getHeaderByHash",
"params": [blockHash]
}'

eth_getHeaderByNumber​

Retrieves a block header by number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getHeaderByNumber",
"params": [blockParameter]
}'

eth_getLogs​

Reads logs

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getLogs",
"params": [filter]
}'

eth_getProof​

https://github.com/ethereum/EIPs/issues/1186

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getProof",
"params": [accountAddress, storageKeys, blockParameter]
}'

eth_getRawTransactionByBlockHashAndIndex​

Retrieves a transaction RLP by block hash and index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getRawTransactionByBlockHashAndIndex",
"params": [blockHash, positionIndex]
}'

eth_getRawTransactionByBlockNumberAndIndex​

Retrieves a transaction RLP by block number and index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getRawTransactionByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'

eth_getRawTransactionByHash​

Retrieves a transaction RLP by hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getRawTransactionByHash",
"params": [transactionHash]
}'

eth_getStorageAt​

Returns storage data at address. storage_index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getStorageAt",
"params": [address, positionIndex, blockParameter]
}'

eth_getStorageValues​

Returns storage values for multiple slots across multiple accounts in a single request. Total slot count across all addresses must not exceed 1024.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getStorageValues",
"params": [requests, blockParameter]
}'

eth_getTransactionByBlockHashAndIndex​

Retrieves a transaction by block hash and index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByBlockHashAndIndex",
"params": [blockHash, positionIndex]
}'

eth_getTransactionByBlockNumberAndIndex​

Retrieves a transaction by block number and index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'

eth_getTransactionByHash​

Retrieves a transaction by hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByHash",
"params": [transactionHash]
}'

eth_getTransactionCount​

Returns account nonce (number of transactions from the account since genesis) at the given block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionCount",
"params": [address, blockParameter]
}'

eth_getTransactionReceipt​

Retrieves a transaction receipt by tx hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionReceipt",
"params": [txHashData]
}'

eth_getUncleByBlockHashAndIndex​

Retrieves an uncle block header by block hash and uncle index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleByBlockHashAndIndex",
"params": [blockHashData, positionIndex]
}'

eth_getUncleByBlockNumberAndIndex​

Retrieves an uncle block header by block number and uncle index

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'

eth_getUncleCountByBlockHash​

Returns number of uncles in the block by block hash

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleCountByBlockHash",
"params": [blockHash]
}'

eth_getUncleCountByBlockNumber​

Returns number of uncles in the block by block number

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleCountByBlockNumber",
"params": [blockParameter]
}'

eth_newBlockFilter​

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newBlockFilter",
"params": []
}'

eth_newFilter​

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newFilter",
"params": [filter]
}'

eth_newPendingTransactionFilter​

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newPendingTransactionFilter",
"params": []
}'

eth_pendingTransactions​

Returns the pending transactions list

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_pendingTransactions",
"params": []
}'

eth_protocolVersion​

Returns ETH protocol version

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_protocolVersion",
"params": []
}'

eth_sendRawTransaction​

Send a raw transaction to the tx pool and broadcasting

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendRawTransaction",
"params": [transaction]
}'

eth_sendRawTransactionSync​

Submits a raw transaction and waits for inclusion in a block, returning the receipt or a timeout error.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendRawTransactionSync",
"params": [transaction, timeoutMs]
}'

eth_sendTransaction​

Send a transaction to the tx pool and broadcasting

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendTransaction",
"params": [rpcTx]
}'

eth_sign​

Returns an EIP-191 signature over the provided message

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sign",
"params": [addressData, message]
}'

eth_signTransaction​

Signs the transaction using the unlocked sender account and returns the RLP-encoded signed transaction together with the parsed object.

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_signTransaction",
"params": [rpcTx]
}'

eth_simulateV1​

Executes a simulation across multiple blocks (does not create a transaction or block)

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_simulateV1",
"params": [payload, blockParameter]
}'

eth_subscribe​

Starts a subscription to a particular event over WebSockets. A JSON-RPC notification with event payload and subscription id is sent to a client for every event matching the subscription topic.

info

This method is enabled by adding subscribe to JsonRpc.EnabledModules.

wscat -c localhost:8545
{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_subscribe",
"params": [subscriptionName, args]
}

Subscription topics​

newHeads​

Subscribes to incoming block headers. Fires a notification each time a new header is appended to the chain, including chain reorganizations.

Notification payload: object

  • author: string (address)
  • baseFeePerGas: string (hex integer)
  • blobGasUsed: string (hex integer)
  • difficulty: string (hex integer)
  • excessBlobGas: string (hex integer)
  • extraData: string (hex data)
  • gasLimit: string (hex integer)
  • gasUsed: string (hex integer)
  • hash: string (hash)
  • logsBloom: string (hex data)
  • miner: string (address)
  • mixHash: string (hash)
  • nonce: string (hex data)
  • number: string (hex integer)
  • parentBeaconBlockRoot: string (hash)
  • parentHash: string (hash)
  • receiptsRoot: string (hash)
  • sha3Uncles: string (hash)
  • signature: string (hex data)
  • size: string (hex integer)
  • stateRoot: string (hash)
  • step: string (hex integer)
  • timestamp: string (hex integer)
  • totalDifficulty: string (hex integer)
  • transactions: array of object
  • transactionsRoot: string (hash)
  • uncles: array of string (hash)
  • withdrawals: array of object
    • address: string (address)
    • amount: string (hex integer)
    • index: string (hex integer)
    • validatorIndex: string (hex integer)
  • withdrawalsRoot: string (hash)
logs​

Subscribes to incoming logs filtered by the given options. In case of a chain reorganization, previously sent logs on the old chain will be re-sent with the removed field set to true.

Notification payload: object

  • address: string (address)
  • blockHash: string (hash)
  • blockNumber: string (hex integer)
  • data: string (hex data)
  • logIndex: string (hex integer)
  • removed: boolean
  • topics: array of string (hash)
  • transactionHash: string (hash)
  • transactionIndex: string (hex integer)
  • transactionLogIndex: string (hex integer)
newPendingTransactions​

Subscribes to incoming pending transactions. Returns the transaction hash.

Notification payload: string (hash)

droppedPendingTransactions​

Subscribes to transactions evicted from the transaction pool. Returns the transaction hash.

Notification payload: string (hash)

syncing​

Subscribes to syncing events. Returns false (once) if the node is synced or an object with statistics (once) when the node starts syncing.

Notification payload:

  • if synced: boolean
  • if syncing: object
    • currentBlock: string (hex integer)
    • highestBlock: string (hex integer)
    • isSyncing: boolean
    • startingBlock: string (hex integer)

eth_syncing​

Returns syncing status

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_syncing",
"params": []
}'

eth_uninstallFilter​

Creates an update filter

curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_uninstallFilter",
"params": [filterId]
}'

eth_unsubscribe​

Unsubscribes from a subscription.

info

This method is enabled by adding subscribe to JsonRpc.EnabledModules.

wscat -c localhost:8545
{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_unsubscribe",
"params": [subscriptionId]
}