UNPKG

1.73 kBTypeScriptView Raw
1import type { Bytes } from '@polkadot/types-codec';
2import type { AnyU8a, Registry } from '@polkadot/types-codec/types';
3import type { AccountId } from '../interfaces/index.js';
4import { U8aFixed } from '@polkadot/types-codec';
5export declare const CID_AURA: Uint8Array;
6export declare const CID_BABE: Uint8Array;
7export declare const CID_GRPA: Uint8Array;
8export declare const CID_POW: Uint8Array;
9export declare const CID_NMBS: Uint8Array;
10/**
11 * @name GenericConsensusEngineId
12 * @description
13 * A 4-byte identifier identifying the engine
14 */
15export declare class GenericConsensusEngineId extends U8aFixed {
16 constructor(registry: Registry, value?: AnyU8a);
17 /**
18 * @description `true` if the engine matches aura
19 */
20 get isAura(): boolean;
21 /**
22 * @description `true` is the engine matches babe
23 */
24 get isBabe(): boolean;
25 /**
26 * @description `true` is the engine matches grandpa
27 */
28 get isGrandpa(): boolean;
29 /**
30 * @description `true` is the engine matches pow
31 */
32 get isPow(): boolean;
33 /**
34 * @description `true` is the engine matches nimbus
35 */
36 get isNimbus(): boolean;
37 /**
38 * @description From the input bytes, decode into an author
39 */
40 extractAuthor(bytes: Bytes, sessionValidators: AccountId[]): AccountId | undefined;
41 /**
42 * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
43 */
44 toHuman(): string;
45 /**
46 * @description Returns the base runtime type name for this instance
47 */
48 toRawType(): string;
49 /**
50 * @description Override the default toString to return a 4-byte string
51 */
52 toString(): string;
53}