header_by_hash - Cosmos
header_by_hash. Track the number of unconfirmed transactions
header_by_hash - Cosmos [Value: 20CU]
Retrieves the number of unconfirmed transactions
Use cases
- Retrieve block header by its hash
- Validate block details using its hash
- Cross-check header information with block hash
Constraints
- Requires exact block hash for retrieval
- Returns header, not full block data
- Real-time chain reorganizations may affect accuracy
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --location 'https://cosmos-hub.drpc.org' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "header_by_hash",
"params": [
"0x645507DC48B4EF4BFF51826A0A5B73FD8CF926036AA4F6697D748FFC0B56D134"
],
"id": 1
}'
Response
200
{
"jsonrpc": "2.0",
"result": {
"header": {
"version": {
"block": "11",
"app": "0"
},
"chain_id": "cosmoshub-4",
"height": "13735848",
"time": "2022-03-10T15:19:10.385Z",
"last_block_id": {
"hash": "0x1234567890...",
"parts": {
"total": 1,
"hash": "0x9876543210..."
}
},
"last_commit_hash": "0xABCDE12345...",
"data_hash": "0x56789ABCDEF...",
"validators_hash": "0x123456789ABC...",
"next_validators_hash": "0xDEF123456789...",
"consensus_hash": "0xABCDEF123456...",
"app_hash": "0x12345ABCDEF...",
"last_results_hash": "0xFEDCBA54321...",
"evidence_hash": "0x98765ABCDE...",
"proposer_address": "12345ABCDE..."
}
},
"id": 1
}
Request params
idinteger
jsonrpcstring
methodstring
integer
hashstring
The hash of the block for which the header information is being requested.
Response
200
Contains the header information of the specified blockResponse params
object
idinteger
jsonrpcstring
resultobject
object
versionobject
The version of the block and application.
object
blockstring
The version of the block.
appstring
The version of the application.
chain_idstring
The identifier of the blockchain.
heightstring
The height of the block in the blockchain.
timestring
The timestamp when the block was created.
last_block_idobject
The ID of the previous block.
object
hashstring
The hash of the previous block.
partsobject
Information about the parts of the previous block.
object
totalinteger
The total number of parts in the previous block.
hashstring
The hash of the parts of the previous block.
last_commit_hashstring
The hash of the last commit.
data_hashstring
The hash of the block's data.
validators_hashstring
The hash of the validators set for this block.
next_validators_hashstring
The hash of the next validators set.
consensus_hashstring
The hash of the consensus parameters.
app_hashstring
The hash of the application state after this block.
last_results_hashstring
The hash of the results from the last block.
evidence_hashstring
The hash of any evidence of misbehavior included in the block.
proposer_addressstring
The address of the block proposer.