UNPKG

1.22 kBTypeScriptView Raw
1import type { Vec } from '@polkadot/types-codec';
2import type { AnyNumber, AnyU8a, IU8a, Registry } from '@polkadot/types-codec/types';
3import type { GenericExtrinsic } from '../extrinsic/Extrinsic';
4import type { Digest, DigestItem, Header } from '../interfaces/runtime';
5import { Struct } from '@polkadot/types-codec';
6export interface HeaderValue {
7 digest?: Digest | {
8 logs: DigestItem[] | string[];
9 };
10 extrinsicsRoot?: AnyU8a;
11 number?: AnyNumber;
12 parentHash?: AnyU8a;
13 stateRoot?: AnyU8a;
14}
15export interface BlockValue {
16 extrinsics?: AnyU8a[];
17 header?: HeaderValue;
18}
19/**
20 * @name GenericBlock
21 * @description
22 * A block encoded with header and extrinsics
23 */
24export declare class GenericBlock extends Struct {
25 constructor(registry: Registry, value?: BlockValue | Uint8Array);
26 /**
27 * @description Encodes a content [[Hash]] for the block
28 */
29 get contentHash(): IU8a;
30 /**
31 * @description The [[Extrinsic]] contained in the block
32 */
33 get extrinsics(): Vec<GenericExtrinsic>;
34 /**
35 * @description Block/header [[Hash]]
36 */
37 get hash(): IU8a;
38 /**
39 * @description The [[Header]] of the block
40 */
41 get header(): Header;
42}