UNPKG

6.13 kBTypeScriptView Raw
1import type { BTreeSet, Bytes, Enum, Option, Struct, U64, Vec, u32, u64 } from '@polkadot/types-codec';
2import type { ITuple } from '@polkadot/types-codec/types';
3import type { BlockHash } from '@polkadot/types/interfaces/chain';
4import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
5import type { AuthoritySignature } from '@polkadot/types/interfaces/imOnline';
6import type { BlockNumber, Hash, Header } from '@polkadot/types/interfaces/runtime';
7import type { MembershipProof } from '@polkadot/types/interfaces/session';
8/** @name AuthorityIndex */
9export interface AuthorityIndex extends u64 {
10}
11/** @name AuthorityList */
12export interface AuthorityList extends Vec<NextAuthority> {
13}
14/** @name AuthoritySet */
15export interface AuthoritySet extends Struct {
16 readonly currentAuthorities: AuthorityList;
17 readonly setId: u64;
18 readonly pendingStandardChanges: ForkTreePendingChange;
19 readonly pendingForcedChanges: Vec<PendingChange>;
20 readonly authoritySetChanges: AuthoritySetChanges;
21}
22/** @name AuthoritySetChange */
23export interface AuthoritySetChange extends ITuple<[U64, BlockNumber]> {
24}
25/** @name AuthoritySetChanges */
26export interface AuthoritySetChanges extends Vec<AuthoritySetChange> {
27}
28/** @name AuthorityWeight */
29export interface AuthorityWeight extends u64 {
30}
31/** @name DelayKind */
32export interface DelayKind extends Enum {
33 readonly isFinalized: boolean;
34 readonly isBest: boolean;
35 readonly asBest: DelayKindBest;
36 readonly type: 'Finalized' | 'Best';
37}
38/** @name DelayKindBest */
39export interface DelayKindBest extends Struct {
40 readonly medianLastFinalized: BlockNumber;
41}
42/** @name EncodedFinalityProofs */
43export interface EncodedFinalityProofs extends Bytes {
44}
45/** @name ForkTreePendingChange */
46export interface ForkTreePendingChange extends Struct {
47 readonly roots: Vec<ForkTreePendingChangeNode>;
48 readonly bestFinalizedNumber: Option<BlockNumber>;
49}
50/** @name ForkTreePendingChangeNode */
51export interface ForkTreePendingChangeNode extends Struct {
52 readonly hash: BlockHash;
53 readonly number: BlockNumber;
54 readonly data: PendingChange;
55 readonly children: Vec<ForkTreePendingChangeNode>;
56}
57/** @name GrandpaCommit */
58export interface GrandpaCommit extends Struct {
59 readonly targetHash: BlockHash;
60 readonly targetNumber: BlockNumber;
61 readonly precommits: Vec<GrandpaSignedPrecommit>;
62}
63/** @name GrandpaEquivocation */
64export interface GrandpaEquivocation extends Enum {
65 readonly isPrevote: boolean;
66 readonly asPrevote: GrandpaEquivocationValue;
67 readonly isPrecommit: boolean;
68 readonly asPrecommit: GrandpaEquivocationValue;
69 readonly type: 'Prevote' | 'Precommit';
70}
71/** @name GrandpaEquivocationProof */
72export interface GrandpaEquivocationProof extends Struct {
73 readonly setId: SetId;
74 readonly equivocation: GrandpaEquivocation;
75}
76/** @name GrandpaEquivocationValue */
77export interface GrandpaEquivocationValue extends Struct {
78 readonly roundNumber: u64;
79 readonly identity: AuthorityId;
80 readonly first: ITuple<[GrandpaPrevote, AuthoritySignature]>;
81 readonly second: ITuple<[GrandpaPrevote, AuthoritySignature]>;
82}
83/** @name GrandpaJustification */
84export interface GrandpaJustification extends Struct {
85 readonly round: u64;
86 readonly commit: GrandpaCommit;
87 readonly votesAncestries: Vec<Header>;
88}
89/** @name GrandpaPrecommit */
90export interface GrandpaPrecommit extends Struct {
91 readonly targetHash: BlockHash;
92 readonly targetNumber: BlockNumber;
93}
94/** @name GrandpaPrevote */
95export interface GrandpaPrevote extends Struct {
96 readonly targetHash: Hash;
97 readonly targetNumber: BlockNumber;
98}
99/** @name GrandpaSignedPrecommit */
100export interface GrandpaSignedPrecommit extends Struct {
101 readonly precommit: GrandpaPrecommit;
102 readonly signature: AuthoritySignature;
103 readonly id: AuthorityId;
104}
105/** @name JustificationNotification */
106export interface JustificationNotification extends Bytes {
107}
108/** @name KeyOwnerProof */
109export interface KeyOwnerProof extends MembershipProof {
110}
111/** @name NextAuthority */
112export interface NextAuthority extends ITuple<[AuthorityId, AuthorityWeight]> {
113}
114/** @name PendingChange */
115export interface PendingChange extends Struct {
116 readonly nextAuthorities: AuthorityList;
117 readonly delay: BlockNumber;
118 readonly canonHeight: BlockNumber;
119 readonly canonHash: BlockHash;
120 readonly delayKind: DelayKind;
121}
122/** @name PendingPause */
123export interface PendingPause extends Struct {
124 readonly scheduledAt: BlockNumber;
125 readonly delay: BlockNumber;
126}
127/** @name PendingResume */
128export interface PendingResume extends Struct {
129 readonly scheduledAt: BlockNumber;
130 readonly delay: BlockNumber;
131}
132/** @name Precommits */
133export interface Precommits extends Struct {
134 readonly currentWeight: u32;
135 readonly missing: BTreeSet<AuthorityId>;
136}
137/** @name Prevotes */
138export interface Prevotes extends Struct {
139 readonly currentWeight: u32;
140 readonly missing: BTreeSet<AuthorityId>;
141}
142/** @name ReportedRoundStates */
143export interface ReportedRoundStates extends Struct {
144 readonly setId: u32;
145 readonly best: RoundState;
146 readonly background: Vec<RoundState>;
147}
148/** @name RoundState */
149export interface RoundState extends Struct {
150 readonly round: u32;
151 readonly totalWeight: u32;
152 readonly thresholdWeight: u32;
153 readonly prevotes: Prevotes;
154 readonly precommits: Precommits;
155}
156/** @name SetId */
157export interface SetId extends u64 {
158}
159/** @name StoredPendingChange */
160export interface StoredPendingChange extends Struct {
161 readonly scheduledAt: BlockNumber;
162 readonly delay: BlockNumber;
163 readonly nextAuthorities: AuthorityList;
164}
165/** @name StoredState */
166export interface StoredState extends Enum {
167 readonly isLive: boolean;
168 readonly isPendingPause: boolean;
169 readonly asPendingPause: PendingPause;
170 readonly isPaused: boolean;
171 readonly isPendingResume: boolean;
172 readonly asPendingResume: PendingResume;
173 readonly type: 'Live' | 'PendingPause' | 'Paused' | 'PendingResume';
174}
175export type PHANTOM_GRANDPA = 'grandpa';