eth namespace
eth_blobBaseFee
Returns the base fee per blob gas in wei
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_blobBaseFee",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_blockNumber
Returns current block number
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_blockNumber",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_call
Executes a tx call (does not create a transaction)
- Parameters
- Request
- Response
-
transactionCall
: objectblockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
stateOverride
: map of object
balance
: string (hex integer)code
: string (hex data)movePrecompileToAddress
: string (address)nonce
: string (hex integer)state
: map of string (hash)stateDiff
: map of string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_call",
"params": [transactionCall, blockParameter, stateOverride]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string
eth_chainId
Returns ChainID
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_chainId",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_createAccessList
Creates an EIP2930 type AccessList for the given transaction
- Parameters
- Request
- Response
-
transactionCall
: objectblockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
optimize
: boolean
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_createAccessList",
"params": [transactionCall, blockParameter, optimize]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
accessList
: objectgasUsed
: string (hex integer)
eth_estimateGas
Executes a tx call and returns gas used (does not create a transaction)
- Parameters
- Request
- Response
-
transactionCall
: objectblockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
stateOverride
: map of object
balance
: string (hex integer)code
: string (hex data)movePrecompileToAddress
: string (address)nonce
: string (hex integer)state
: map of string (hash)stateDiff
: map of string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_estimateGas",
"params": [transactionCall, blockParameter, stateOverride]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_feeHistory
Returns block fee history.
- Parameters
- Request
- Response
-
blockCount
: string (hex integer) -
newestBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
rewardPercentiles
: array of object
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_feeHistory",
"params": [blockCount, newestBlock, rewardPercentiles]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
baseFeePerBlobGas
: array of string (hex integer)baseFeePerGas
: array of string (hex integer)blobGasUsedRatio
: array of objectgasUsedRatio
: array of objectoldestBlock
: string (hex integer)reward
: array of array of string (hex integer)
eth_gasPrice
Returns miner's gas price
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_gasPrice",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_getAccount
Retrieves Accounts via Address and Blocknumber
- Parameters
- Request
- Response
-
accountAddress
: string (address) -
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getAccount",
"params": [accountAddress, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
balance
: string (hex integer)codeHash
: objectbytes
: objectisEmpty
: booleanitem
: objectlength
: string (hex integer)
bytesAsSpan
: objectisEmpty
: booleanitem
: objectlength
: string (hex integer)
nonce
: string (hex integer)storageRoot
: objectbytes
: objectisEmpty
: booleanitem
: objectlength
: string (hex integer)
bytesAsSpan
: objectisEmpty
: booleanitem
: objectlength
: string (hex integer)
eth_getBalance
Returns account balance
- Parameters
- Request
- Response
-
address
: string (address) -
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBalance",
"params": [address, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_getBlockByHash
Retrieves a block by hash
- Parameters
- Request
- Response
-
blockHash
: string (hash) -
returnFullTransactionObjects
: boolean
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockByHash",
"params": [blockHash, returnFullTransactionObjects]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: 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)requestsHash
: 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 objecttransactionsRoot
: string (hash)uncles
: array of string (hash)withdrawals
: array of objectaddress
: string (address)amountInGwei
: string (hex integer)amountInWei
: string (hex integer)index
: string (hex integer)validatorIndex
: string (hex integer)
withdrawalsRoot
: string (hash)
eth_getBlockByNumber
Retrieves a block by number
- Parameters
- Request
- Response
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
returnFullTransactionObjects
: boolean
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockByNumber",
"params": [blockParameter, returnFullTransactionObjects]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: 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)requestsHash
: 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 objecttransactionsRoot
: string (hash)uncles
: array of string (hash)withdrawals
: array of objectaddress
: string (address)amountInGwei
: string (hex integer)amountInWei
: string (hex integer)index
: string (hex integer)validatorIndex
: string (hex integer)
withdrawalsRoot
: string (hash)
eth_getBlockReceipts
Get receipts from all transactions from particular block, more efficient than fetching the receipts one-by-one.
- Parameters
- Request
- Response
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockReceipts",
"params": [blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
blobGasPrice
: string (hex integer)blobGasUsed
: string (hex integer)blockHash
: string (hash)blockNumber
: string (hex integer)contractAddress
: string (address)cumulativeGasUsed
: string (hex integer)effectiveGasPrice
: string (hex integer)error
: stringfrom
: string (address)gasUsed
: string (hex integer)logs
: array of objectaddress
: string (address)blockHash
: string (hash)blockNumber
: string (hex integer)data
: string (hex data)logIndex
: string (hex integer)removed
: booleantopics
: array of string (hash)transactionHash
: string (hash)transactionIndex
: string (hex integer)
logsBloom
: string (hex data)root
: string (hash)status
: string (hex integer)to
: string (address)transactionHash
: string (hash)transactionIndex
: string (hex integer)type
: integer
eth_getBlockTransactionCountByHash
Returns number of transactions in the block block hash
- Parameters
- Request
- Response
blockHash
: string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockTransactionCountByHash",
"params": [blockHash]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_getBlockTransactionCountByNumber
Returns number of transactions in the block by block number
- Parameters
- Request
- Response
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getBlockTransactionCountByNumber",
"params": [blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_getCode
Returns account code at given address and block
- Parameters
- Request
- Response
-
address
: string (address) -
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getCode",
"params": [address, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex data)
eth_getFilterChanges
Reads filter changes
- Parameters
- Request
- Response
filterId
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getFilterChanges",
"params": [filterId]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
eth_getFilterLogs
Reads filter changes
- Parameters
- Request
- Response
filterId
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getFilterLogs",
"params": [filterId]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
address
: string (address)blockHash
: string (hash)blockNumber
: string (hex integer)data
: string (hex data)logIndex
: string (hex integer)removed
: booleantopics
: array of string (hash)transactionHash
: string (hash)transactionIndex
: string (hex integer)transactionLogIndex
: string (hex integer)
eth_getLogs
Reads logs
- Parameters
- Request
- Response
filter
: objectaddress
: objectfromBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)toBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)topics
: array of object
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getLogs",
"params": [filter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
address
: string (address)blockHash
: string (hash)blockNumber
: string (hex integer)data
: string (hex data)logIndex
: string (hex integer)removed
: booleantopics
: array of string (hash)transactionHash
: string (hash)transactionIndex
: string (hex integer)transactionLogIndex
: string (hex integer)
eth_getProof
https://github.com/ethereum/EIPs/issues/1186
- Parameters
- Request
- Response
-
accountAddress
: string (address) -
hashRate
: array of string (hex integer) -
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getProof",
"params": [accountAddress, hashRate, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
address
: string (address)balance
: string (hex integer)codeHash
: string (hash)nonce
: string (hex integer)proof
: array of string (hex data)storageProofs
: array of objectkey
: string (hex data)proof
: array of string (hex data)value
: objecthasValue
: booleanvalue
: objectisEmpty
: booleanlength
: string (hex integer)span
: objectisEmpty
: booleanitem
: objectlength
: string (hex integer)
storageRoot
: string (hash)
eth_getRawTransactionByHash
Retrieves a transaction RLP by hash
- Parameters
- Request
- Response
transactionHash
: string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getRawTransactionByHash",
"params": [transactionHash]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string
eth_getStorageAt
Returns storage data at address. storage_index
- Parameters
- Request
- Response
-
address
: string (address) -
positionIndex
: string (hex integer) -
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getStorageAt",
"params": [address, positionIndex, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex data)
eth_getTransactionByBlockHashAndIndex
Retrieves a transaction by block hash and index
- Parameters
- Request
- Response
-
blockHash
: string (hash) -
positionIndex
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByBlockHashAndIndex",
"params": [blockHash, positionIndex]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
blockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
eth_getTransactionByBlockNumberAndIndex
Retrieves a transaction by block number and index
- Parameters
- Request
- Response
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
positionIndex
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
blockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
eth_getTransactionByHash
Retrieves a transaction by hash
- Parameters
- Request
- Response
transactionHash
: string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionByHash",
"params": [transactionHash]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
blockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
eth_getTransactionCount
Returns account nonce (number of trnsactions from the account since genesis) at the given block number
- Parameters
- Request
- Response
-
address
: string (address) -
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionCount",
"params": [address, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_getTransactionReceipt
Retrieves a transaction receipt by tx hash
- Parameters
- Request
- Response
txHashData
: string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getTransactionReceipt",
"params": [txHashData]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
blobGasPrice
: string (hex integer)blobGasUsed
: string (hex integer)blockHash
: string (hash)blockNumber
: string (hex integer)contractAddress
: string (address)cumulativeGasUsed
: string (hex integer)effectiveGasPrice
: string (hex integer)error
: stringfrom
: string (address)gasUsed
: string (hex integer)logs
: array of objectaddress
: string (address)blockHash
: string (hash)blockNumber
: string (hex integer)data
: string (hex data)logIndex
: string (hex integer)removed
: booleantopics
: array of string (hash)transactionHash
: string (hash)transactionIndex
: string (hex integer)
logsBloom
: string (hex data)root
: string (hash)status
: string (hex integer)to
: string (address)transactionHash
: string (hash)transactionIndex
: string (hex integer)type
: integer
eth_getUncleByBlockHashAndIndex
Retrieves an uncle block header by block hash and uncle index
- Parameters
- Request
- Response
-
blockHashData
: string (hash) -
positionIndex
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleByBlockHashAndIndex",
"params": [blockHashData, positionIndex]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: 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)requestsHash
: 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 objecttransactionsRoot
: string (hash)uncles
: array of string (hash)withdrawals
: array of objectaddress
: string (address)amountInGwei
: string (hex integer)amountInWei
: string (hex integer)index
: string (hex integer)validatorIndex
: string (hex integer)
withdrawalsRoot
: string (hash)
eth_getUncleByBlockNumberAndIndex
Retrieves an uncle block header by block number and uncle index
- Parameters
- Request
- Response
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
) -
positionIndex
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [blockParameter, positionIndex]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: 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)requestsHash
: 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 objecttransactionsRoot
: string (hash)uncles
: array of string (hash)withdrawals
: array of objectaddress
: string (address)amountInGwei
: string (hex integer)amountInWei
: string (hex integer)index
: string (hex integer)validatorIndex
: string (hex integer)
withdrawalsRoot
: string (hash)
eth_getUncleCountByBlockHash
Returns number of uncles in the block by block hash
- Parameters
- Request
- Response
blockHash
: string (hash)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleCountByBlockHash",
"params": [blockHash]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_getUncleCountByBlockNumber
Returns number of uncles in the block by block number
- Parameters
- Request
- Response
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_getUncleCountByBlockNumber",
"params": [blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_newBlockFilter
Creates an update filter
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newBlockFilter",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_newFilter
Creates an update filter
- Parameters
- Request
- Response
filter
: objectaddress
: objectfromBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)toBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)topics
: array of object
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newFilter",
"params": [filter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_newPendingTransactionFilter
Creates an update filter
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_newPendingTransactionFilter",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hex integer)
eth_pendingTransactions
Returns the pending transactions list
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_pendingTransactions",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
blockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
eth_protocolVersion
Returns ETH protocol version
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_protocolVersion",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string
eth_sendRawTransaction
Send a raw transaction to the tx pool and broadcasting
- Parameters
- Request
- Response
transaction
: string (hex data)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendRawTransaction",
"params": [transaction]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hash)
eth_sendTransaction
Send a transaction to the tx pool and broadcasting
- Parameters
- Request
- Response
rpcTx
: objectblockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_sendTransaction",
"params": [rpcTx]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: string (hash)
eth_simulateV1
Executes a simulation across multiple blocks (does not create a transaction or block)
- Parameters
- Request
- Response
-
payload
: objectblockStateCalls
: array of objectblockOverrides
: objectbaseFeePerGas
: string (hex integer)blobBaseFee
: string (hex integer)feeRecipient
: string (address)gasLimit
: string (hex integer)number
: string (hex integer)prevRandao
: string (hash)time
: string (hex integer)
calls
: array of objectblockHash
: string (hash)blockNumber
: string (hex integer)hash
: string (hash)transactionIndex
: string (hex integer)type
: integer
stateOverrides
: map of objectbalance
: string (hex integer)code
: string (hex data)movePrecompileToAddress
: string (address)nonce
: string (hex integer)state
: map of string (hash)stateDiff
: map of string (hash)
returnFullTransactionObjects
: booleantraceTransfers
: booleanvalidation
: boolean
-
blockParameter
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_simulateV1",
"params": [payload, blockParameter]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: array of object
calls
: array of objecterror
: objectcode
: string (hex integer)data
: stringmessage
: string
gasUsed
: string (hex integer)logs
: array of objectaddress
: string (address)blockHash
: string (hash)blockNumber
: string (hex integer)data
: string (hex data)logIndex
: string (hex integer)removed
: booleantopics
: array of string (hash)transactionHash
: string (hash)transactionIndex
: string (hex integer)
returnData
: string (hex data)status
: string (hex integer)
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.
This method is enabled by adding subscribe
to --JsonRpc.EnabledModules
.
- Parameters
- Request
- Response
- Notification
-
subscriptionName
: string -
filter
: objectaddress
: string (address)fromBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)toBlock
: string (block number or hash or either ofearliest
,finalized
,latest
,pending
, orsafe
)topics
: array of string (hex data)
wscat -c ws://localhost:8545
{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_subscribe",
"params": [subscriptionName, args]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": "0x..." // subscription id
}
result
: string
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0x...", // subscription id
"result": payload
}
}
See specific subcription topic below for payload
details.
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 objecttransactionsRoot
: string (hash)uncles
: array of string (hash)withdrawals
: array of objectaddress
: 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
: booleantopics
: 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
: booleanstartingBlock
: string (hex integer)
eth_syncing
Returns syncing status
- Request
- Response
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_syncing",
"params": []
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: object
currentBlock
: string (hex integer)highestBlock
: string (hex integer)isSyncing
: booleanstartingBlock
: string (hex integer)syncMode
: integer
eth_uninstallFilter
Creates an update filter
- Parameters
- Request
- Response
filterId
: string (hex integer)
curl localhost:8545 \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_uninstallFilter",
"params": [filterId]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: boolean
eth_unsubscribe
Unsubscribes from a subscription.
This method is enabled by adding subscribe
to --JsonRpc.EnabledModules
.
- Parameters
- Request
- Response
subscriptionId
: string
wscat -c ws://localhost:8545
{
"jsonrpc": "2.0",
"id": 0,
"method": "eth_unsubscribe",
"params": [subscriptionId]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": result
}
result
: boolean (true
if unsubscribed successfully; otherwise, false
)