chain_getHeader - Asset Hub RPC Method
Get block header on Asset Hub. Lightweight alternative to chain_getBlock.
Returns the block header for a given hash on Asset Hub.
Use Cases
- Lightweight queries - Get header without full block data
- Chain synchronization - Track block production for native stablecoin transfers (USDC, USDT), DOT staking and governance, and cross-chain asset management via XCM
- Parent chain navigation - Follow parentHash links
Request Parameters
Block hash. If omitted, returns latest header
Response Body
Code Examples
curl https://api-asset-hub-polkadot.n.dwellir.com/<YOUR_API_KEY>/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "chain_getHeader",
"params": [],
"id": 1
}'import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
// Get latest header
const header = await api.rpc.chain.getHeader();
console.log('Block number:', header.number.toNumber());
console.log('Parent hash:', header.parentHash.toHex());
await api.disconnect();import requests
def get_header(block_hash=None):
url = 'https://api-asset-hub-polkadot.n.dwellir.com/<YOUR_API_KEY>/YOUR_API_KEY'
params = [block_hash] if block_hash else []
payload = {
'jsonrpc': '2.0',
'method': 'chain_getHeader',
'params': params,
'id': 1
}
response = requests.post(url, json=payload)
return response.json()['result']
header = get_header()
print(f"Block number: {int(header['number'], 16)}")Related Methods
chain_getBlock- Get full block with extrinsicschain_getBlockHash- Get block hash by number
chain_getFinalizedHead
Get the finalized block hash on Asset Hub. Essential for confirmed state queries on Polkadot's system parachain managing $4.5B+ in DOT tokens, native USDC/USDT, and NFTs.
chain_subscribeNewHeads
Subscribe to new block headers on Asset Hub. Real-time notifications for new blocks as they are produced.