1 | import type { BTreeSet, Bytes, Enum, Option, Struct, U64, Vec, u32, u64 } from '@polkadot/types-codec';
|
2 | import type { ITuple } from '@polkadot/types-codec/types';
|
3 | import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
4 | import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
5 | import type { AuthoritySignature } from '@polkadot/types/interfaces/imOnline';
|
6 | import type { BlockNumber, Hash, Header } from '@polkadot/types/interfaces/runtime';
|
7 | import type { MembershipProof } from '@polkadot/types/interfaces/session';
|
8 |
|
9 | export interface AuthorityIndex extends u64 {
|
10 | }
|
11 |
|
12 | export interface AuthorityList extends Vec<NextAuthority> {
|
13 | }
|
14 |
|
15 | export 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 |
|
23 | export interface AuthoritySetChange extends ITuple<[U64, BlockNumber]> {
|
24 | }
|
25 |
|
26 | export interface AuthoritySetChanges extends Vec<AuthoritySetChange> {
|
27 | }
|
28 |
|
29 | export interface AuthorityWeight extends u64 {
|
30 | }
|
31 |
|
32 | export interface DelayKind extends Enum {
|
33 | readonly isFinalized: boolean;
|
34 | readonly isBest: boolean;
|
35 | readonly asBest: DelayKindBest;
|
36 | readonly type: 'Finalized' | 'Best';
|
37 | }
|
38 |
|
39 | export interface DelayKindBest extends Struct {
|
40 | readonly medianLastFinalized: BlockNumber;
|
41 | }
|
42 |
|
43 | export interface EncodedFinalityProofs extends Bytes {
|
44 | }
|
45 |
|
46 | export interface ForkTreePendingChange extends Struct {
|
47 | readonly roots: Vec<ForkTreePendingChangeNode>;
|
48 | readonly bestFinalizedNumber: Option<BlockNumber>;
|
49 | }
|
50 |
|
51 | export interface ForkTreePendingChangeNode extends Struct {
|
52 | readonly hash: BlockHash;
|
53 | readonly number: BlockNumber;
|
54 | readonly data: PendingChange;
|
55 | readonly children: Vec<ForkTreePendingChangeNode>;
|
56 | }
|
57 |
|
58 | export interface GrandpaCommit extends Struct {
|
59 | readonly targetHash: BlockHash;
|
60 | readonly targetNumber: BlockNumber;
|
61 | readonly precommits: Vec<GrandpaSignedPrecommit>;
|
62 | }
|
63 |
|
64 | export 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 |
|
72 | export interface GrandpaEquivocationProof extends Struct {
|
73 | readonly setId: SetId;
|
74 | readonly equivocation: GrandpaEquivocation;
|
75 | }
|
76 |
|
77 | export 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 |
|
84 | export interface GrandpaJustification extends Struct {
|
85 | readonly round: u64;
|
86 | readonly commit: GrandpaCommit;
|
87 | readonly votesAncestries: Vec<Header>;
|
88 | }
|
89 |
|
90 | export interface GrandpaPrecommit extends Struct {
|
91 | readonly targetHash: BlockHash;
|
92 | readonly targetNumber: BlockNumber;
|
93 | }
|
94 |
|
95 | export interface GrandpaPrevote extends Struct {
|
96 | readonly targetHash: Hash;
|
97 | readonly targetNumber: BlockNumber;
|
98 | }
|
99 |
|
100 | export interface GrandpaSignedPrecommit extends Struct {
|
101 | readonly precommit: GrandpaPrecommit;
|
102 | readonly signature: AuthoritySignature;
|
103 | readonly id: AuthorityId;
|
104 | }
|
105 |
|
106 | export interface JustificationNotification extends Bytes {
|
107 | }
|
108 |
|
109 | export interface KeyOwnerProof extends MembershipProof {
|
110 | }
|
111 |
|
112 | export interface NextAuthority extends ITuple<[AuthorityId, AuthorityWeight]> {
|
113 | }
|
114 |
|
115 | export 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 |
|
123 | export interface PendingPause extends Struct {
|
124 | readonly scheduledAt: BlockNumber;
|
125 | readonly delay: BlockNumber;
|
126 | }
|
127 |
|
128 | export interface PendingResume extends Struct {
|
129 | readonly scheduledAt: BlockNumber;
|
130 | readonly delay: BlockNumber;
|
131 | }
|
132 |
|
133 | export interface Precommits extends Struct {
|
134 | readonly currentWeight: u32;
|
135 | readonly missing: BTreeSet<AuthorityId>;
|
136 | }
|
137 |
|
138 | export interface Prevotes extends Struct {
|
139 | readonly currentWeight: u32;
|
140 | readonly missing: BTreeSet<AuthorityId>;
|
141 | }
|
142 |
|
143 | export interface ReportedRoundStates extends Struct {
|
144 | readonly setId: u32;
|
145 | readonly best: RoundState;
|
146 | readonly background: Vec<RoundState>;
|
147 | }
|
148 |
|
149 | export 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 |
|
157 | export interface SetId extends u64 {
|
158 | }
|
159 |
|
160 | export interface StoredPendingChange extends Struct {
|
161 | readonly scheduledAt: BlockNumber;
|
162 | readonly delay: BlockNumber;
|
163 | readonly nextAuthorities: AuthorityList;
|
164 | }
|
165 |
|
166 | export 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 | }
|
175 | export type PHANTOM_GRANDPA = 'grandpa';
|