Header
Composite 375 v393sp_runtime::generic::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 (5)
| # | Name | Type |
|---|---|---|
| 0 | parent_hash | H256 |
| 1 | number | Compact<u32> |
| 2 | state_root | H256 |
| 3 | extrinsics_root | H256 |
| 4 | digest | Digest |
SCALE Encoding
- Rule
- 5 fields encoded consecutively in declaration order. No field names or delimiters.
- Size
- sum of field sizes
Examples
Struct with 5 fields = parent_hash: H256, number: Compact<u32>, state_root: H256, extrinsics_root: H256, digest: Digest
0x<field0><field1><field2><field3><field4>field 0 parent_hash: H256field 1 number: Compact<u32>field 2 state_root: H256field 3 extrinsics_root: H256field 4 digest: DigestCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode Header
const value = registry.createType("Header", {
parent_hash: 0,
number: 0,
state_root: 0,
extrinsics_root: 0,
digest: 0
});
console.log("Hex:", value.toHex());Type Parameters
Number = u32
Hash
Referenced By (5)
Type Information
- Type ID
- 375
- Kind
- Composite
- Path
- sp_runtime::generic::header::Header
- Runtime
- v393