Quickstart
Concepts
- What is Smart Wallet?
- Features
- Usage Details
- Base Gasless Campaign
Guides
Technical Reference
- Coinbase Wallet SDK
- Coinbase Wallet SDK
- Overview
- eth_accounts
- eth_blockNumber
- eth_chainId
- eth_coinbase
- eth_estimateGas
- eth_feeHistory
- eth_gasPrice
- eth_getBalance
- eth_getBlockByHash
- eth_getBlockByNumber
- eth_getBlockTransactionCountByHash
- eth_getBlockTransactionCountByNumber
- eth_getCode
- eth_getLogs
- eth_getProof
- eth_getStorageAt
- eth_getTransactionByBlockHashAndIndex
- eth_getTransactionByBlockNumberAndIndex
- eth_getTransactionByHash
- eth_getTransactionCount
- eth_getTransactionReceipt
- eth_getUncleCountByBlockHash
- eth_getUncleCountByBlockNumber
- eth_requestAccounts
- eth_sendRawTransaction
- eth_sendTransaction
- eth_signTypedData_v4
- personal_sign
- wallet_addEthereumChain
- wallet_addSubAccount
- wallet_connect
- wallet_switchEthereumChain
- wallet_watchAsset
- web3_clientVersion
- Spend Permissions
- Sub Accounts Reference
- Profiles Reference
eth_getBlockByHash
Get information about a block by block hash
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
true
]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"number": "0x1b4",
"hash": "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"parentHash": "0x6c0f2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x0e670ec64341...",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"miner": "0x4e65fda2159562a496f9f3522f89122a3088497a",
"difficulty": "0x027f07",
"totalDifficulty": "0x027f07",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"size": "0x027f07",
"gasLimit": "0x9f759",
"gasUsed": "0x9f759",
"timestamp": "0x54e34e8e",
"transactions": ["0x..."],
"uncles": []
}
}
Defined in the Ethereum JSON-RPC Specification
Returns information about a block by hash.
Parameters
Hash of a block (32 bytes).
If true, returns the full transaction objects; if false, returns only the hashes of the transactions.
Returns
A block object, or null when no block was found.
The block number. null when its pending block.
Hash of the block. null when its pending block.
Hash of the parent block.
Hash of the generated proof-of-work. null when its pending block.
SHA3 of the uncles data in the block.
The bloom filter for the logs of the block. null when its pending block.
The root of the transaction trie of the block.
The root of the final state trie of the block.
The root of the receipts trie of the block.
The address of the beneficiary to whom the mining rewards were given.
Integer of the difficulty for this block.
Integer of the total difficulty of the chain until this block.
The “extra data” field of this block.
Integer the size of this block in bytes.
The maximum gas allowed in this block.
The total used gas by all transactions in this block.
The unix timestamp for when the block was collated.
Array of transaction objects, or 32 Bytes transaction hashes depending on the fullTransactionObjects parameter.
Array of uncle hashes.
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
true
]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"number": "0x1b4",
"hash": "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"parentHash": "0x6c0f2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x0e670ec64341...",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"miner": "0x4e65fda2159562a496f9f3522f89122a3088497a",
"difficulty": "0x027f07",
"totalDifficulty": "0x027f07",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"size": "0x027f07",
"gasLimit": "0x9f759",
"gasUsed": "0x9f759",
"timestamp": "0x54e34e8e",
"transactions": ["0x..."],
"uncles": []
}
}
Error Handling
Code | Message | Description |
---|---|---|
-32602 | Invalid block hash | The provided block hash is invalid |
4100 | Requested method not supported | The method is not supported by the wallet |
Setting fullTransactionObjects
to true returns complete transaction details, while false returns only transaction hashes for better performance.
Was this page helpful?
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
true
]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"number": "0x1b4",
"hash": "0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"parentHash": "0x6c0f2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b",
"nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x0e670ec64341...",
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"miner": "0x4e65fda2159562a496f9f3522f89122a3088497a",
"difficulty": "0x027f07",
"totalDifficulty": "0x027f07",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"size": "0x027f07",
"gasLimit": "0x9f759",
"gasUsed": "0x9f759",
"timestamp": "0x54e34e8e",
"transactions": ["0x..."],
"uncles": []
}
}