import { Digest, DigestItem, Hash, Header } from '../../interfaces/runtime'; import { AnyNumber, AnyU8a } from '../../types'; import Extrinsic from '../Extrinsic/Extrinsic'; import Struct from '../../codec/Struct'; import Vec from '../../codec/Vec'; export interface HeaderValue { digest?: Digest | { logs: DigestItem[]; }; extrinsicsRoot?: AnyU8a; number?: AnyNumber; parentHash?: AnyU8a; stateRoot?: AnyU8a; } export interface BlockValue { extrinsics?: AnyU8a[]; header?: HeaderValue; } /** * @name Block * @description * A block encoded with header and extrinsics */ export default class Block extends Struct { constructor(value?: BlockValue | Uint8Array); /** * @description Encodes a content [[Hash]] for the block */ readonly contentHash: Hash; /** * @description The [[Extrinsic]] contained in the block */ readonly extrinsics: Vec; /** * @description Block/header [[Hash]] */ readonly hash: Hash; /** * @description The [[Header]] of the block */ readonly header: Header; }