Header
Composite 520 v393ethereum::header::Header
About This Type
Structured type: Header.
A struct-like type where each field is encoded in declaration order.
Encoding: Fields encoded consecutively in declaration order, no field names or separators.
Fields (15)
SCALE Encoding
- Rule
- 15 fields encoded consecutively in declaration order. No field names or delimiters.
- Size
- sum of field sizes
Examples
Struct with 15 fields = parent_hash: H256, ommers_hash: H256, beneficiary: H160, state_root: H256, transactions_root: H256, receipts_root: H256, logs_bloom: Bloom, difficulty: U256, number: U256, gas_limit: U256, gas_used: U256, timestamp: u64, extra_data: Vec<u8>, mix_hash: H256, nonce: H64
0x<field0><field1><field2><field3><field4><field5><field6><field7><field8><field9><field10><field11><field12><field13><field14>field 0 parent_hash: H256field 1 ommers_hash: H256field 2 beneficiary: H160field 3 state_root: H256field 4 transactions_root: H256field 5 receipts_root: H256field 6 logs_bloom: Bloomfield 7 difficulty: U256field 8 number: U256field 9 gas_limit: U256field 10 gas_used: U256field 11 timestamp: u64field 12 extra_data: Vec<u8>field 13 mix_hash: H256field 14 nonce: H64Code Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode Header
const value = registry.createType("Header", {
parent_hash: 0,
ommers_hash: 0,
beneficiary: 0,
state_root: 0,
transactions_root: 0,
receipts_root: 0,
logs_bloom: 0,
difficulty: 0,
number: 0,
gas_limit: 0,
gas_used: 0,
timestamp: 1_000_000_000n,
extra_data: 0,
mix_hash: 0,
nonce: 0
});
console.log("Hex:", value.toHex());Referenced By (5)
Type Information
- Type ID
- 520
- Kind
- Composite
- Path
- ethereum::header::Header
- Runtime
- v393