Detailed JSON RPC reference
This page shows detailed overview of supported Ethereum JSON RPC calls. Find a brief list of supported calls.
eth_getBlockByHash
Returns information about a block by hash.
Params
- Block hashThe hash of the block
STRING
32 byte hex value - Hydrated transactions
BOOLEAN
hydrated
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
false
]
}
Result
Block information Block object OBJECT
- parentHash
STRING
Parent block hash - sha3Uncles
STRING
Ommers hash - miner
STRING
Coinbase - stateRoot
STRING
State root - transactionsRoot
STRING
Transactions root - receiptsRoot
STRING
Receipts root - logsBloom
STRING
Bloom filter - difficulty (optional)
STRING
Difficulty - number
STRING
Number - gasLimit
STRING
Gas limit - gasUsed
STRING
Gas used - timestamp
STRING
Timestamp - extraData
STRING
Extra data - mixHash
STRING
Mix hash - nonce
STRING
Nonce - totalDifficulty (optional)
STRING
Total difficult - baseFeePerGas (optional)
STRING
Base fee per gas - size
STRING
Block size - transactions
ANYOF
of- Transaction hashes
ARRAY
ofSTRING
32 byte hex value - Full transactions
ARRAY
of- Signed 1559 Transaction
OBJECT
- type
STRING
type - nonce
STRING
nonce - to (optional)
STRING
to address - gas
STRING
gas limit - value
STRING
value - input
STRING
input data - maxPriorityFeePerGas
STRING
max priority fee per gas: Maximum fee per gas the sender is willing to pay to miners in wei - maxFeePerGas
STRING
max fee per gas: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei - accessList accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value
- address (optional)
- chainId
STRING
chainId: Chain ID that this transaction is valid on. - yParity
STRING
yParity: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature. - r
STRING
r - s
STRING
s
- type
- Signed 2930 Transaction
OBJECT
- type
STRING
type - nonce
STRING
nonce - to (optional)
STRING
to address - gas
STRING
gas limit - value
STRING
value - input
STRING
input data - gasPrice
STRING
gas price: The gas price willing to be paid by the sender in wei - accessList accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value
- address (optional)
- chainId
STRING
chainId: Chain ID that this transaction is valid on. - yParity
STRING
yParity: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature. - r
STRING
r - s
STRING
s
- type
- Signed Legacy Transaction
OBJECT
- type
STRING
type - nonce
STRING
nonce - to (optional)
STRING
to address - gas
STRING
gas limit - value
STRING
value - input
STRING
input data - gasPrice
STRING
gas price: The gas price willing to be paid by the sender in wei - chainId (optional)
STRING
chainId: Chain ID that this transaction is valid on. - v
STRING
v - r
STRING
r - s
STRING
s
- type
- Signed 1559 Transaction
- Transaction hashes
- uncles Uncles
ARRAY
ofSTRING
32 byte hex value
eth_getBlockByNumber
Returns information about a block by number.
Params
1. Block
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
2. Hydrated transactions BOOLEAN
hydrated
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", false]
}
Result
Block information Block object OBJECT
- parentHash
STRING
Parent block hash - sha3Uncles
STRING
Ommers hash - miner
STRING
Coinbase - stateRoot
STRING
State root - transactionsRoot
STRING
Transactions root - receiptsRoot
STRING
Receipts root - logsBloom
STRING
Bloom filter - difficulty (optional)
STRING
Difficulty - number
STRING
Number - gasLimit
STRING
Gas limit - gasUsed
STRING
Gas used - timestamp
STRING
Timestamp - extraData
STRING
Extra data - mixHash
STRING
Mix hash - nonce
STRING
Nonce - totalDifficulty (optional)
STRING
Total difficult - baseFeePerGas (optional)
STRING
Base fee per gas - size
STRING
Block size - transactions
ANYOF
of- Transaction hashes
ARRAY
ofSTRING
32 byte hex value - Full transactions
ARRAY
of- Signed 1559 Transaction
OBJECT
- type
STRING
type - nonce
STRING
nonce - to (optional)
STRING
to address - gas
STRING
gas limit - value
STRING
value - input
STRING
input data - maxPriorityFeePerGas
STRING
max priority fee per gas: Maximum fee per gas the sender is willing to pay to miners in wei - maxFeePerGas
STRING
max fee per gas: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei - accessList accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value
- address (optional)
- chainId
STRING
chainId: Chain ID that this transaction is valid on. - yParity
STRING
yParity: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature. - r
STRING
r - s
STRING
s
- type
- Signed 2930 Transaction
OBJECT
- type
STRING
type - nonce
STRING
nonce - to (optional)
STRING
to address - gas
STRING
gas limit - value
STRING
value - input
STRING
input data - gasPrice
STRING
gas price: The gas price willing to be paid by the sender in wei - accessList accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value
- address (optional)
- chainId
STRING
chainId: Chain ID that this transaction is valid on. - yParity
STRING
yParity: The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature. - r
STRING
r - s
STRING
s
- type
- Signed Legacy Transaction
OBJECT
- type
STRING
type - nonce
STRING
nonce - to (optional)
STRING
to address - gas
STRING
gas limit - value
STRING
value - input
STRING
input data - gasPrice
STRING
gas price: The gas price willing to be paid by the sender in wei - chainId (optional)
STRING
chainId: Chain ID that this transaction is valid on. - v
STRING
v - r
STRING
r - s
STRING
s
- type
- Signed 1559 Transaction
- Transaction hashes
- uncles Uncles
ARRAY
ofSTRING
32 byte hex value
eth_getBlockTransactionCountByHash
Returns the number of transactions in a block from a block matching the given block hash.
Params
- Block hash (optional)
STRING
32 byte hex value
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e"
]
}
Result
Transaction count STRING
hex encoded unsigned integer
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the given block number.
Params
- Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": ["latest"]
}
Result
Transaction count STRING
hex encoded unsigned integer
eth_getUncleCountByBlockHash
Returns the number of uncles in a block from a block matching the given block hash.
Params
- Block hash (optional)
STRING
32 byte hex value
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e"
]
}
Result
Uncle count STRING
hex encoded unsigned integer
eth_getUncleCountByBlockNumber
Returns the number of transactions in a block matching the given block number.
Params
- Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": ["latest"]
}
Result
Uncle count STRING
hex encoded unsigned integer
eth_chainId
Returns the chain ID of the current network.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": []
}
Result
Chain ID STRING
hex encoded unsigned integer
eth_syncing
Returns an object with data about the sync status or false.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": []
}
Result
Syncing status ONEOF
- Syncing progress
OBJECT
- startingBlock (optional)
STRING
Starting block - currentBlock (optional)
STRING
Current block - highestBlock (optional)
STRING
Highest block
- startingBlock (optional)
BOOLEAN
Not syncing
eth_accounts
Returns a list of addresses owned by client.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_accounts",
"params": []
}
Result
Accounts ARRAY
of STRING
hex encoded address
eth_blockNumber
Returns the number of most recent block.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}
Result
Block number STRING
hex encoded unsigned integer
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
Params
- Transaction Transaction object generic to all types
OBJECT
- type (optional)
STRING
type - nonce (optional)
STRING
nonce - to (optional)
STRING
to address - from (optional)
STRING
from address - gas (optional)
STRING
gas limit - value (optional)
STRING
value - input (optional)
STRING
input data - gasPrice (optional)
STRING
gas price: The gas price willing to be paid by the sender in wei - maxPriorityFeePerGas (optional)
STRING
max priority fee per gas: Maximum fee per gas the sender is willing to pay to miners in wei - maxFeePerGas (optional)
STRING
max fee per gas: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei - accessList (optional) accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value - chainId (optional)
STRING
chainId: Chain ID that this transaction is valid on.
- type (optional)
- Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
- State Overrides (optional)
MAP
: mapping from an account (address) to override specification- key
STRING
: the account this override applies to - value
OBJECT
: the override specification- nonce (optional)
STRING
: hex encoded 8 byte nonce override for the account - code (optional)
STRING
: data of the code override for the account - balance (optional)
STRING
: hex encoded 32 byte balance override for the account in wei - stateDiff (optional)
MAP
: mapping of storage key to storage value override- key
STRING
: the storage key - value
STRING
: the value override for the given storage key
- key
- nonce (optional)
- key
- Block Overrides (optional)
OBJECT
: The set of header fields to override in a block.- number (optional)
STRING
: hex, overrides the block number - difficulty (optional)
STRING
: hex, overrides the block difficulty - time (optional)
STRING
: hex, overrides block timestamp - gasLimit (optional)
STRING
: hex, overrides block timestamp - coinbase (optional)
STRING
: hex, overrides block miner - random (optional)
STRING
: hex, overrides the blocks extra data which feeds into the RANDOM opcode - baseFee (optional)
STRING
: hex, overrides block base fee
- number (optional)
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}
Result
Return data STRING
hex encoded bytes
eth_estimateGas
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
Params
- Transaction Transaction object generic to all types
OBJECT
- type (optional)
STRING
type - nonce (optional)
STRING
nonce - to (optional)
STRING
to address - from (optional)
STRING
from address - gas (optional)
STRING
gas limit - value (optional)
STRING
value - input (optional)
STRING
input data - gasPrice (optional)
STRING
gas price: The gas price willing to be paid by the sender in wei - maxPriorityFeePerGas (optional)
STRING
max priority fee per gas: Maximum fee per gas the sender is willing to pay to miners in wei - maxFeePerGas (optional)
STRING
max fee per gas: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei - accessList (optional) accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value - chainId (optional)
STRING
chainId: Chain ID that this transaction is valid on.
- type (optional)
- Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
- State Overrides (optional)
MAP
: mapping from an account (address) to override specification- key
STRING
: the account this override applies to - value
OBJECT
: the override specification- nonce (optional)
STRING
: hex encoded 8 byte nonce override for the account - code (optional)
STRING
: data of the code override for the account - balance (optional)
STRING
: hex encoded 32 byte balance override for the account in wei - stateDiff (optional)
MAP
: mapping of storage key to storage value override- key
STRING
: the storage key - value
STRING
: the value override for the given storage key
- key
- nonce (optional)
- key
- Block Overrides (optional)
OBJECT
: The set of header fields to override in a block.- number (optional)
STRING
: hex, overrides the block number - difficulty (optional)
STRING
: hex, overrides the block difficulty - time (optional)
STRING
: hex, overrides block timestamp - gasLimit (optional)
STRING
: hex, overrides block timestamp - coinbase (optional)
STRING
: hex, overrides block miner - random (optional)
STRING
: hex, overrides the blocks extra data which feeds into the RANDOM opcode - baseFee (optional)
STRING
: hex, overrides block base fee
- number (optional)
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}
Result
Gas used STRING
hex encoded unsigned integer
eth_createAccessList
Generates an access list for a transaction.
Params
- Transaction Transaction object generic to all types
OBJECT
- type (optional)
STRING
type - nonce (optional)
STRING
nonce - to (optional)
STRING
to address - from (optional)
STRING
from address - gas (optional)
STRING
gas limit - value (optional)
STRING
value - input (optional)
STRING
input data - gasPrice (optional)
STRING
gas price: The gas price willing to be paid by the sender in wei - maxPriorityFeePerGas (optional)
STRING
max priority fee per gas: Maximum fee per gas the sender is willing to pay to miners in wei - maxFeePerGas (optional)
STRING
max fee per gas: The maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei - accessList (optional) accessList: EIP-2930 access list
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value
- address (optional)
- chainId (optional)
STRING
chainId: Chain ID that this transaction is valid on.
- Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_createAccessList",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}
Result
Gas used Access list result OBJECT
- accessList (optional) accessList
ARRAY
of Access list entryOBJECT
- address (optional)
STRING
hex encoded address - storageKeys (optional)
ARRAY
ofSTRING
32 byte hex value
- address (optional)
- error (optional)
STRING
error - gasUsed (optional)
STRING
Gas used
eth_gasPrice
Returns the current price per gas in wei.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": []
}
Result
Gas price STRING
Gas price
eth_maxPriorityFeePerGas
Returns the current maxPriorityFeePerGas per gas in wei.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_maxPriorityFeePerGas",
"params": []
}
Result
Max priority fee per gas STRING
Max priority fee per gas
eth_feeHistory
Transaction fee history
Params
- blockCountRequested range of blocks. Clients will return less than the requested range if not all blocks are available.
STRING
hex encoded unsigned integer - newestBlockHighest block of the requested range.
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
- rewardPercentilesA monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the coresponding effective tip for the percentile will be determined, accounting for gas consumed.
ARRAY
ofNUMBER
NaN
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_feeHistory",
"params": [2, "latest", []]
}
Result
feeHistoryResult Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.feeHistoryResults OBJECT
- oldestBlock
STRING
oldestBlock: Lowest number block of returned range. - baseFeePerGas baseFeePerGasArray: An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.
ARRAY
ofSTRING
hex encoded unsigned integer - reward (optional) rewardArray: A two-dimensional array of effective priority fees per gas at the requested block percentiles.
ARRAY
ofARRAY
ofSTRING
rewardPercentile
eth_newFilter
Creates a filter object, based on filter options, to notify when the state changes (logs).
Params
- Filter (optional) filter
OBJECT
-
fromBlock (optional)
STRING
from block -
toBlock (optional)
STRING
to block -
address (optional)
ONEOF
of Address(es)STRING
AddressARRAY
ofSTRING
hex encoded address
-
topics (optional) Topics
ARRAY
of -NULL
- `STRING` Single Topic Match - `ARRAY` of `STRING` 32 hex encoded bytes
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [
{
"fromBlock": 7878500,
"toBlock": 7878700,
"topics": [
"0x5445f318f4f5fcfb66592e68e0cc5822aa15664039bd5f0ffde24c5a8142b1ac",
"0x000000000000000000000000dc6bdc37b2714ee601734cf55a05625c9e512461",
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}
]
}
Result
Filter Identifier STRING
hex encoded unsigned integer
eth_newBlockFilter
Creates a filter in the node, to notify when a new block arrives.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_newBlockFilter",
"params": []
}
Result
Filter Identifier STRING
hex encoded unsigned integer
eth_newPendingTransactionFilter
Creates a filter in the node, to notify when a new pending transaction arrives.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_newPendingTransactionFilter",
"params": []
}
Result
Filter Identifier STRING
hex encoded unsigned integer
eth_getFilterChanges
Polling method for a filter, which returns an array of logs which occurred since last poll.
Params
- Filter Identifier (optional)
STRING
hex encoded unsigned integer
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": [
"0x433e8e72506124c82ccbb4095b73544422b46a5cc6b2557c386bddf1b0d1f736"
]
}
Result
Log objects ONEOF
ARRAY
ofSTRING
32 byte hex valueARRAY
ofSTRING
32 byte hex valueARRAY
of logOBJECT
- removed (optional)
BOOLEAN
removed - logIndex (optional)
STRING
log index - transactionIndex (optional)
STRING
transaction index - transactionHash
STRING
transaction hash - blockHash (optional)
STRING
block hash - blockNumber (optional)
STRING
block number - address (optional)
STRING
address - data (optional)
STRING
data - topics (optional) topics
ARRAY
ofSTRING
32 hex encoded bytes
- removed (optional)
eth_getFilterLogs
Returns an array of all logs matching filter with given id.
Params
- Filter Identifier (optional)
STRING
hex encoded unsigned integer
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": [
"0x433e8e72506124c82ccbb4095b73544422b46a5cc6b2557c386bddf1b0d1f736"
]
}
Result
Log objects ONEOF
ARRAY
ofSTRING
32 byte hex valueARRAY
ofSTRING
32 byte hex valueARRAY
of logOBJECT
- removed (optional)
BOOLEAN
removed - logIndex (optional)
STRING
log index - transactionIndex (optional)
STRING
transaction index - transactionHash
STRING
transaction hash - blockHash (optional)
STRING
block hash - blockNumber (optional)
STRING
block number - address (optional)
STRING
address - data (optional)
STRING
data - topics (optional) topics
ARRAY
ofSTRING
32 hex encoded bytes
- removed (optional)
eth_getLogs
Returns an array of all logs matching filter with given id.
Params
- Filter (optional) filter
OBJECT
-
fromBlock (optional)
STRING
from block -
toBlock (optional)
STRING
to block -
address (optional)
ONEOF
of Address(es)STRING
AddressARRAY
ofSTRING
hex encoded address
-
topics (optional) Topics
ARRAY
of -NULL
- `STRING` Single Topic Match - `ARRAY` of `STRING` 32 hex encoded bytes
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [
{
"fromBlock": 7878500,
"toBlock": 7878700,
"topics": [
"0x5445f318f4f5fcfb66592e68e0cc5822aa15664039bd5f0ffde24c5a8142b1ac",
"0x000000000000000000000000dc6bdc37b2714ee601734cf55a05625c9e512461",
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}
]
}
Result
Log objects ONEOF
ARRAY
ofSTRING
32 byte hex valueARRAY
ofSTRING
32 byte hex valueARRAY
of logOBJECT
- removed (optional)
BOOLEAN
removed - logIndex (optional)
STRING
log index - transactionIndex (optional)
STRING
transaction index - transactionHash
STRING
transaction hash - blockHash (optional)
STRING
block hash - blockNumber (optional)
STRING
block number - address (optional)
STRING
address - data (optional)
STRING
data - topics (optional) topics
ARRAY
ofSTRING
32 hex encoded bytes
- removed (optional)
eth_mining
Returns whether the client is actively mining new blocks.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_mining",
"params": []
}
Result
Mining status BOOLEAN
miningStatus
eth_hashrate
Returns the number of hashes per second that the node is mining with.
Params
none
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_hashrate",
"params": []
}
Result
Mining status STRING
Hashrate
eth_getBalance
Returns the balance of the account of given address.
Params
- Address
STRING
hex encoded address - Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x05c476a8b9a1a69c47ca81944fbb13a1ac55d62b", "latest"]
}
Result
Balance STRING
hex encoded unsigned integer
eth_getStorageAt
Returns the value from a storage position at a given address.
Params
- Address
STRING
hex encoded address - Storage slot
STRING
hex encoded unsigned integer - Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x05c476a8b9a1a69c47ca81944fbb13a1ac55d62b",
"0x0000000000000000000000000000000000000000000000000000000000000001",
"latest"
]
}
Result
Value STRING
hex encoded bytes
eth_getTransactionCount
Returns the number of transactions sent from an address.
Params
- Address
STRING
hex encoded address - Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0x05c476a8b9a1a69c47ca81944fbb13a1ac55d62b", "latest"]
}
Result
Transaction count STRING
hex encoded unsigned integer
eth_getCode
Returns code at a given address.
Params
- Address
STRING
hex encoded address - Block (optional)
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": ["0x05c476a8b9a1a69c47ca81944fbb13a1ac55d62b", "latest"]
}
Result
Bytecode STRING
hex encoded bytes
eth_sendTransaction
eth_sendTransaction
Tenderly doesn't store private keys, so this method is not supported
eth_sendRawTransaction
Submits a raw transaction.
Params
- Transaction
STRING
hex encoded bytes
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": [
"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
]
}
Result
Transaction hash STRING
32 byte hex value
eth_getTransactionByHash
Returns the information about a transaction requested by transaction hash.
Params
- Transaction hash
STRING
32 byte hex value
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [
"0xd9724b68ad04ac3919678e3158f5d474d3c129cfb4cb7fafcde9b4c756fce188"
]
}
Result
Transaction information Transaction information OBJECT
- blockHash
STRING
block hash - blockNumber
STRING
block number - from
STRING
from address - hash
STRING
transaction hash - transactionIndex
STRING
transaction index
eth_getTransactionByBlockHashAndIndex
Returns information about a transaction by block hash and transaction index position.
Params
- Block hash
STRING
32 byte hex value - Transaction index
STRING
hex encoded unsigned integer
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockHashAndIndex",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
"0x1"
]
}
Result
Transaction information Transaction information OBJECT
- blockHash
STRING
block hash - blockNumber
STRING
block number - from
STRING
from address - hash
STRING
transaction hash - transactionIndex
STRING
transaction index
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
Params
- Block
STRING
Block numberENUM
of Block tagearliest|finalized|safe|latest|pending
- Transaction index
STRING
hex encoded unsigned integer
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": ["latest", "0x1"]
}
Result
Transaction information Transaction information OBJECT
- blockHash
STRING
block hash - blockNumber
STRING
block number - from
STRING
from address - hash
STRING
transaction hash - transactionIndex
STRING
transaction index
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
Params
- Transaction hash (optional)
STRING
32 byte hex value
Example
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": [
"0xd9724b68ad04ac3919678e3158f5d474d3c129cfb4cb7fafcde9b4c756fce188"
]
}
Result
Receipt Information Receipt info OBJECT
- transactionHash
STRING
transaction hash - transactionIndex
STRING
transaction index - blockHash
STRING
block hash - blockNumber
STRING
block number - from
STRING
from - to (optional)
STRING
to: Address of the receiver or null in a contract creation transaction. - cumulativeGasUsed
STRING
cumulative gas used: The sum of gas used by this transaction and all preceding transactions in the same block. - gasUsed
STRING
gas used: The amount of gas used for this specific transaction alone. - contractAddress (optional)
ONEOF
of contract address: The contract address created, if the transaction was a contract creation, otherwise null.STRING
hex encoded addressNULL
- logs logs
ARRAY
of logOBJECT
- removed (optional)
BOOLEAN
removed - logIndex (optional)
STRING
log index - transactionIndex (optional)
STRING
transaction index - transactionHash
STRING
transaction hash - blockHash (optional)
STRING
block hash - blockNumber (optional)
STRING
block number - address (optional)
STRING
address - data (optional)
STRING
data - topics (optional) topics
ARRAY
ofSTRING
32 hex encoded bytes
- removed (optional)
- logsBloom
STRING
logs bloom - root (optional)
STRING
state root: The post-transaction state root. Only specified for transactions included before the Byzantium upgrade. - status (optional)
STRING
status: Either 1 (success) or 0 (failure). Only specified for transactions included after the Byzantium upgrade. - effectiveGasPrice
STRING
effective gas price: The actual value per gas deducted from the senders account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).
eth_subscribe
Subscribes user to a Ethereum event notification stream.
Params
- Event type
STRING
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": ["newHeads"]
}
Supported events are listed in the following table.
Event type | Description | |
---|---|---|
newHeads | Fires a notification each time a new header is appended to the chain, including chain reorganisations. | |
logs | Returns logs that are included in new imported blocks and match the given filter criteria. | |
newPendingTransaction | Returns the hash for transactions that are added to the pending state. | |
syncing | Indicates when the node starts or stops synchronising. |
- Filter
JSON object
This parameter have effect only if subscription type is set to logs
. User can filter logs that match given address and one of several topics listed in the filter.
Example
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"logs",
{
"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd",
"topics": ["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"]
}
]
}
Result
Subscription ID Hex value
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x4a8a4c0517381924f9838102c5a4dcb7"
}
Notifications
eth_subscribe
should only be used over a websocket connections. After the subscription is established, the same websocket connection will be used to send notifications.
Notifications are JSON objects. The objects have different form for different event types. Examples for each event type follows.
New head notification.
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"result": {
"difficulty": "0x15d9223a23aa",
"extraData": "0xd983010305844765746887676f312e342e328777696e646f7773",
"gasLimit": "0x47e7c4",
"gasUsed": "0x38658",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
"nonce": "0x084149998194cc5f",
"number": "0x1348c9",
"parentHash": "0x7736fab79e05dc611604d22470dadad26f56fe494421b5b333de816ce1f25701",
"receiptRoot": "0x2fab35823ad00c7bb388595cb46652fe7886e00660a01e867824d3dceb1c8d36",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"stateRoot": "0xb3346685172db67de536d8765c43c31009d0eb3bd9c501c9be3229203f15f378",
"timestamp": "0x56ffeff8",
"transactionsRoot": "0x0167ffa60e3ebc0b080cdb95f7c0087dd6c0e61413140e39d94d3468d7c9689f"
},
"subscription": "0x9ce59a13059e417087c02d3236a0b1cc"
}
}
Logs notification.
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0x4a8a4c0517381924f9838102c5a4dcb7",
"result": {
"address": "0x8320fe7702b96808f7bbc0d4a888ed1468216cfd",
"blockHash": "0x61cdb2a09ab99abf791d474f20c2ea89bf8de2923a2d42bb49944c8c993cbf04",
"blockNumber": "0x29e87",
"data": "0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003",
"logIndex": "0x0",
"topics": ["0xd78a0cb8bb633d06981248b816e7bd33c2a35a6089241d099fa519e361cab902"],
"transactionHash": "0xe044554a0a55067caafd07f8020ab9f2af60bdfe337e395ecd84b4877a3d1ab4",
"transactionIndex": "0x0"
}
}
}
New pending transaction notification.
{
"jsonrpc": "2.0",
"method": "eth_subscription",
"params": {
"subscription": "0xc3b33aa549fb9a60e95d21862596617c",
"result": "0xd6fdc5cc41a9959e922f30cb772a9aef46f4daea279307bc5f7024edc4ccd7fa"
}
}
Sync notification.
{
"subscription": "0xe2ffeb2703bcf602d42922385829ce96",
"result": {
"syncing": false
}
}
eth_unsubscribe
Unsubscribes user from a previously subscribed Ethereum event notification stream.
Params
- Subscription ID
STRING that represents hex value
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_unsubscribe",
"params": ["0x9cef478923ff08bf67fde6c64013158d"]
}
Result
Boolean
Flag that represents if unsubscribe call is successful
{
"jsonrpc": "2.0",
"id": 1,
"result": true
}
Note: eth_unsubscribe have to be issued on the websocket connection previously used to establish the subscription.