@dfinity/nns 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/dist/cjs/index.cjs.js +869 -0
- package/dist/cjs/index.cjs.js.map +7 -0
- package/dist/esm/account_identifier.js +2 -0
- package/dist/esm/account_identifier.js.map +7 -0
- package/dist/esm/chunk-4FZAJTYF.js +2 -0
- package/dist/esm/chunk-4FZAJTYF.js.map +7 -0
- package/dist/esm/chunk-AM5HOKAH.js +2 -0
- package/dist/esm/chunk-AM5HOKAH.js.map +7 -0
- package/dist/esm/chunk-FVDRR6PO.js +17 -0
- package/dist/esm/chunk-FVDRR6PO.js.map +7 -0
- package/dist/esm/chunk-HFWTAZD7.js +825 -0
- package/dist/esm/chunk-HFWTAZD7.js.map +7 -0
- package/dist/esm/chunk-IQ5S76MI.js +4 -0
- package/dist/esm/chunk-IQ5S76MI.js.map +7 -0
- package/dist/esm/chunk-LNMGZ6W7.js +3 -0
- package/dist/esm/chunk-LNMGZ6W7.js.map +7 -0
- package/dist/esm/chunk-NYI672WX.js +14 -0
- package/dist/esm/chunk-NYI672WX.js.map +7 -0
- package/dist/esm/chunk-SO23SIWX.js +3 -0
- package/dist/esm/chunk-SO23SIWX.js.map +7 -0
- package/dist/esm/chunk-X2SHUWG3.js +2 -0
- package/dist/esm/chunk-X2SHUWG3.js.map +7 -0
- package/dist/esm/governance.js +2 -0
- package/dist/esm/governance.js.map +7 -0
- package/dist/esm/icp.js +2 -0
- package/dist/esm/icp.js.map +7 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/ledger.js +2 -0
- package/dist/esm/ledger.js.map +7 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -12
- package/dist/{account_identifier.d.ts → types/account_identifier.d.ts} +5 -2
- package/dist/types/canisters/governance/payloads.d.ts +3 -0
- package/dist/types/canisters/governance/request.converters.d.ts +26 -0
- package/dist/types/canisters/governance/response.converters.d.ts +35 -0
- package/dist/types/constants/canister_ids.d.ts +4 -0
- package/dist/types/constants/constants.d.ts +5 -0
- package/dist/types/governance.d.ts +29 -0
- package/dist/{icp.d.ts → types/icp.d.ts} +2 -5
- package/dist/types/index.d.ts +8 -0
- package/dist/types/ledger.d.ts +33 -0
- package/dist/types/types/common.d.ts +8 -0
- package/dist/types/types/governance.d.ts +9 -0
- package/dist/types/types/governance_converters.d.ts +532 -0
- package/dist/types/types/icp.d.ts +4 -0
- package/dist/types/types/ledger.d.ts +30 -0
- package/dist/types/types/option.d.ts +1 -0
- package/dist/types/utils/agent.utils.d.ts +5 -0
- package/dist/types/utils/converter.utils.d.ts +18 -0
- package/dist/{utils/proto.d.ts → types/utils/proto.utils.d.ts} +0 -0
- package/package.json +47 -36
- package/candid/governance.certified.did +0 -12
- package/candid/governance.certified.idl.d.ts +0 -2
- package/candid/governance.certified.idl.js +0 -18
- package/candid/governance.did +0 -10
- package/candid/governance.idl.d.ts +0 -5
- package/candid/governance.idl.js +0 -18
- package/candid/governanceTypes.d.ts +0 -16
- package/dist/account_identifier.js +0 -95
- package/dist/governance.d.ts +0 -30
- package/dist/governance.js +0 -55
- package/dist/icp.js +0 -65
- package/dist/index.d.ts +0 -4
- package/dist/ledger.d.ts +0 -54
- package/dist/ledger.js +0 -131
- package/dist/utils/proto.js +0 -59
- package/proto/base_types.proto +0 -60
- package/proto/base_types_pb.d.ts +0 -144
- package/proto/base_types_pb.js +0 -1142
- package/proto/ledger.proto +0 -277
- package/proto/ledger_pb.d.ts +0 -911
- package/proto/ledger_pb.js +0 -7151
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { DerEncodedPublicKey } from "@dfinity/agent";
|
|
2
|
+
import { Principal } from "@dfinity/principal";
|
|
3
|
+
import { AccountIdentifier, CanisterIdString, E8s, NeuronId, PrincipalString } from "./common";
|
|
4
|
+
import { Option } from "./option";
|
|
5
|
+
export declare type Action = {
|
|
6
|
+
RegisterKnownNeuron: KnownNeuron;
|
|
7
|
+
} | {
|
|
8
|
+
ExecuteNnsFunction: ExecuteNnsFunction;
|
|
9
|
+
} | {
|
|
10
|
+
ManageNeuron: ManageNeuron;
|
|
11
|
+
} | {
|
|
12
|
+
ApproveGenesisKyc: ApproveGenesisKyc;
|
|
13
|
+
} | {
|
|
14
|
+
ManageNetworkEconomics: NetworkEconomics;
|
|
15
|
+
} | {
|
|
16
|
+
RewardNodeProvider: RewardNodeProvider;
|
|
17
|
+
} | {
|
|
18
|
+
RewardNodeProviders: RewardNodeProviders;
|
|
19
|
+
} | {
|
|
20
|
+
AddOrRemoveNodeProvider: AddOrRemoveNodeProvider;
|
|
21
|
+
} | {
|
|
22
|
+
SetDefaultFollowees: SetDefaultFollowees;
|
|
23
|
+
} | {
|
|
24
|
+
Motion: Motion;
|
|
25
|
+
};
|
|
26
|
+
export interface AddHotKey {
|
|
27
|
+
newHotKey: Option<PrincipalString>;
|
|
28
|
+
}
|
|
29
|
+
export interface AddOrRemoveNodeProvider {
|
|
30
|
+
change: Option<Change>;
|
|
31
|
+
}
|
|
32
|
+
export interface ApproveGenesisKyc {
|
|
33
|
+
principals: Array<PrincipalString>;
|
|
34
|
+
}
|
|
35
|
+
export declare type AuthzChangeOp = {
|
|
36
|
+
Authorize: {
|
|
37
|
+
addSelf: boolean;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
Deauthorize: null;
|
|
41
|
+
};
|
|
42
|
+
export interface Ballot {
|
|
43
|
+
neuronId: bigint;
|
|
44
|
+
vote: Vote;
|
|
45
|
+
votingPower: bigint;
|
|
46
|
+
}
|
|
47
|
+
export interface BallotInfo {
|
|
48
|
+
vote: Vote;
|
|
49
|
+
proposalId: Option<ProposalId>;
|
|
50
|
+
}
|
|
51
|
+
export declare type By = {
|
|
52
|
+
NeuronIdOrSubaccount: Record<string, never>;
|
|
53
|
+
} | {
|
|
54
|
+
MemoAndController: ClaimOrRefreshNeuronFromAccount;
|
|
55
|
+
} | {
|
|
56
|
+
Memo: bigint;
|
|
57
|
+
};
|
|
58
|
+
export interface CanisterAuthzInfo {
|
|
59
|
+
methodsAuthz: Array<MethodAuthzInfo>;
|
|
60
|
+
}
|
|
61
|
+
export declare type Change = {
|
|
62
|
+
ToRemove: NodeProvider;
|
|
63
|
+
} | {
|
|
64
|
+
ToAdd: NodeProvider;
|
|
65
|
+
};
|
|
66
|
+
export declare type ClaimOrRefresh = {
|
|
67
|
+
by: Option<By>;
|
|
68
|
+
};
|
|
69
|
+
export interface ClaimOrRefreshNeuronFromAccount {
|
|
70
|
+
controller: Option<Principal>;
|
|
71
|
+
memo: bigint;
|
|
72
|
+
}
|
|
73
|
+
export declare type ClaimOrRefreshNeuronRequest = {
|
|
74
|
+
neuronId: NeuronId;
|
|
75
|
+
by: Option<By>;
|
|
76
|
+
};
|
|
77
|
+
export declare type Command = {
|
|
78
|
+
Spawn: Spawn;
|
|
79
|
+
} | {
|
|
80
|
+
Split: Split;
|
|
81
|
+
} | {
|
|
82
|
+
Follow: Follow;
|
|
83
|
+
} | {
|
|
84
|
+
ClaimOrRefresh: ClaimOrRefresh;
|
|
85
|
+
} | {
|
|
86
|
+
Configure: Configure;
|
|
87
|
+
} | {
|
|
88
|
+
RegisterVote: RegisterVote;
|
|
89
|
+
} | {
|
|
90
|
+
Merge: Merge;
|
|
91
|
+
} | {
|
|
92
|
+
DisburseToNeuron: DisburseToNeuron;
|
|
93
|
+
} | {
|
|
94
|
+
MergeMaturity: MergeMaturity;
|
|
95
|
+
} | {
|
|
96
|
+
MakeProposal: Proposal;
|
|
97
|
+
} | {
|
|
98
|
+
Disburse: Disburse;
|
|
99
|
+
};
|
|
100
|
+
export interface Configure {
|
|
101
|
+
operation: Option<Operation>;
|
|
102
|
+
}
|
|
103
|
+
export interface Disburse {
|
|
104
|
+
toAccountId: Option<AccountIdentifier>;
|
|
105
|
+
amount: Option<E8s>;
|
|
106
|
+
}
|
|
107
|
+
export interface DisburseResponse {
|
|
108
|
+
transferBlockHeight: bigint;
|
|
109
|
+
}
|
|
110
|
+
export interface DisburseToNeuron {
|
|
111
|
+
dissolveDelaySeconds: bigint;
|
|
112
|
+
kycVerified: boolean;
|
|
113
|
+
amount: E8s;
|
|
114
|
+
newController: Option<PrincipalString>;
|
|
115
|
+
nonce: bigint;
|
|
116
|
+
}
|
|
117
|
+
export declare type DissolveState = {
|
|
118
|
+
DissolveDelaySeconds: bigint;
|
|
119
|
+
} | {
|
|
120
|
+
WhenDissolvedTimestampSeconds: bigint;
|
|
121
|
+
};
|
|
122
|
+
export interface ExecuteNnsFunction {
|
|
123
|
+
nnsFunctionId: number;
|
|
124
|
+
nnsFunctionName: Option<string>;
|
|
125
|
+
payload: Option<Record<string, unknown>>;
|
|
126
|
+
payloadBytes: ArrayBuffer;
|
|
127
|
+
}
|
|
128
|
+
export interface Follow {
|
|
129
|
+
topic: Topic;
|
|
130
|
+
followees: Array<NeuronId>;
|
|
131
|
+
}
|
|
132
|
+
export interface Followees {
|
|
133
|
+
topic: Topic;
|
|
134
|
+
followees: Array<NeuronId>;
|
|
135
|
+
}
|
|
136
|
+
export interface GovernanceError {
|
|
137
|
+
errorMessage: string;
|
|
138
|
+
errorType: number;
|
|
139
|
+
}
|
|
140
|
+
export interface IncreaseDissolveDelay {
|
|
141
|
+
additionalDissolveDelaySeconds: number;
|
|
142
|
+
}
|
|
143
|
+
export interface KnownNeuron {
|
|
144
|
+
id: NeuronId;
|
|
145
|
+
name: string;
|
|
146
|
+
description: Option<string>;
|
|
147
|
+
}
|
|
148
|
+
export interface SetDissolveTimestamp {
|
|
149
|
+
dissolveTimestampSeconds: bigint;
|
|
150
|
+
}
|
|
151
|
+
export interface ListProposalsRequest {
|
|
152
|
+
limit: number;
|
|
153
|
+
beforeProposal: Option<ProposalId>;
|
|
154
|
+
includeRewardStatus: Array<ProposalRewardStatus>;
|
|
155
|
+
excludeTopic: Array<Topic>;
|
|
156
|
+
includeStatus: Array<ProposalStatus>;
|
|
157
|
+
}
|
|
158
|
+
export interface ListProposalsResponse {
|
|
159
|
+
proposals: Array<ProposalInfo>;
|
|
160
|
+
}
|
|
161
|
+
export interface MakeProposalResponse {
|
|
162
|
+
proposalId: ProposalId;
|
|
163
|
+
}
|
|
164
|
+
export interface ManageNeuron {
|
|
165
|
+
id: Option<NeuronId>;
|
|
166
|
+
command: Option<Command>;
|
|
167
|
+
neuronIdOrSubaccount: Option<NeuronIdOrSubaccount>;
|
|
168
|
+
}
|
|
169
|
+
export interface Merge {
|
|
170
|
+
sourceNeuronId: Option<NeuronId>;
|
|
171
|
+
}
|
|
172
|
+
export interface MergeMaturity {
|
|
173
|
+
percentageToMerge: number;
|
|
174
|
+
}
|
|
175
|
+
export interface MergeMaturityRequest {
|
|
176
|
+
neuronId: NeuronId;
|
|
177
|
+
percentageToMerge: number;
|
|
178
|
+
}
|
|
179
|
+
export interface MergeMaturityResponse {
|
|
180
|
+
mergedMaturityE8s: bigint;
|
|
181
|
+
newStakeE8s: bigint;
|
|
182
|
+
}
|
|
183
|
+
export interface MethodAuthzChange {
|
|
184
|
+
principal: Option<PrincipalString>;
|
|
185
|
+
methodName: string;
|
|
186
|
+
canister: CanisterIdString;
|
|
187
|
+
operation: AuthzChangeOp;
|
|
188
|
+
}
|
|
189
|
+
export interface MethodAuthzInfo {
|
|
190
|
+
methodName: string;
|
|
191
|
+
principalIds: Array<ArrayBuffer>;
|
|
192
|
+
}
|
|
193
|
+
export interface Motion {
|
|
194
|
+
motionText: string;
|
|
195
|
+
}
|
|
196
|
+
export interface NetworkEconomics {
|
|
197
|
+
neuronMinimumStake: E8s;
|
|
198
|
+
maxProposalsToKeepPerTopic: number;
|
|
199
|
+
neuronManagementFeePerProposal: E8s;
|
|
200
|
+
rejectCost: E8s;
|
|
201
|
+
transactionFee: E8s;
|
|
202
|
+
neuronSpawnDissolveDelaySeconds: bigint;
|
|
203
|
+
minimumIcpXdrRate: bigint;
|
|
204
|
+
maximumNodeProviderRewards: bigint;
|
|
205
|
+
}
|
|
206
|
+
export interface Neuron {
|
|
207
|
+
id: Option<NeuronId>;
|
|
208
|
+
isCurrentUserController: Option<boolean>;
|
|
209
|
+
controller: Option<PrincipalString>;
|
|
210
|
+
recentBallots: Array<BallotInfo>;
|
|
211
|
+
kycVerified: boolean;
|
|
212
|
+
notForProfit: boolean;
|
|
213
|
+
cachedNeuronStake: E8s;
|
|
214
|
+
createdTimestampSeconds: bigint;
|
|
215
|
+
maturityE8sEquivalent: bigint;
|
|
216
|
+
agingSinceTimestampSeconds: bigint;
|
|
217
|
+
neuronFees: E8s;
|
|
218
|
+
hotKeys: Array<PrincipalString>;
|
|
219
|
+
accountIdentifier: AccountIdentifier;
|
|
220
|
+
joinedCommunityFundTimestampSeconds: Option<bigint>;
|
|
221
|
+
dissolveState: Option<DissolveState>;
|
|
222
|
+
followees: Array<Followees>;
|
|
223
|
+
}
|
|
224
|
+
export declare type NeuronIdOrSubaccount = {
|
|
225
|
+
Subaccount: Array<number>;
|
|
226
|
+
} | {
|
|
227
|
+
NeuronId: NeuronId;
|
|
228
|
+
};
|
|
229
|
+
export declare enum NeuronState {
|
|
230
|
+
UNSPECIFIED = 0,
|
|
231
|
+
LOCKED = 1,
|
|
232
|
+
DISSOLVING = 2,
|
|
233
|
+
DISSOLVED = 3
|
|
234
|
+
}
|
|
235
|
+
export interface NeuronInfo {
|
|
236
|
+
neuronId: NeuronId;
|
|
237
|
+
dissolveDelaySeconds: bigint;
|
|
238
|
+
recentBallots: Array<BallotInfo>;
|
|
239
|
+
createdTimestampSeconds: bigint;
|
|
240
|
+
state: NeuronState;
|
|
241
|
+
joinedCommunityFundTimestampSeconds: Option<bigint>;
|
|
242
|
+
retrievedAtTimestampSeconds: bigint;
|
|
243
|
+
votingPower: bigint;
|
|
244
|
+
ageSeconds: bigint;
|
|
245
|
+
fullNeuron: Option<Neuron>;
|
|
246
|
+
}
|
|
247
|
+
export interface NeuronInfoForHw {
|
|
248
|
+
id: string;
|
|
249
|
+
amount: string;
|
|
250
|
+
hotKeys: Array<PrincipalString>;
|
|
251
|
+
}
|
|
252
|
+
export interface NodeProvider {
|
|
253
|
+
id: Option<PrincipalString>;
|
|
254
|
+
rewardAccount: Option<AccountIdentifier>;
|
|
255
|
+
}
|
|
256
|
+
export declare type Operation = {
|
|
257
|
+
RemoveHotKey: RemoveHotKey;
|
|
258
|
+
} | {
|
|
259
|
+
AddHotKey: AddHotKey;
|
|
260
|
+
} | {
|
|
261
|
+
StopDissolving: Record<string, never>;
|
|
262
|
+
} | {
|
|
263
|
+
StartDissolving: Record<string, never>;
|
|
264
|
+
} | {
|
|
265
|
+
IncreaseDissolveDelay: IncreaseDissolveDelay;
|
|
266
|
+
} | {
|
|
267
|
+
JoinCommunityFund: Record<string, never>;
|
|
268
|
+
} | {
|
|
269
|
+
SetDissolveTimestamp: SetDissolveTimestamp;
|
|
270
|
+
};
|
|
271
|
+
export interface Proposal {
|
|
272
|
+
title: Option<string>;
|
|
273
|
+
url: string;
|
|
274
|
+
action: Option<Action>;
|
|
275
|
+
summary: string;
|
|
276
|
+
}
|
|
277
|
+
export declare type ProposalId = bigint;
|
|
278
|
+
export interface ProposalInfo {
|
|
279
|
+
id: Option<ProposalId>;
|
|
280
|
+
ballots: Array<Ballot>;
|
|
281
|
+
rejectCost: E8s;
|
|
282
|
+
proposalTimestampSeconds: bigint;
|
|
283
|
+
rewardEventRound: bigint;
|
|
284
|
+
failedTimestampSeconds: bigint;
|
|
285
|
+
decidedTimestampSeconds: bigint;
|
|
286
|
+
latestTally: Option<Tally>;
|
|
287
|
+
proposal: Option<Proposal>;
|
|
288
|
+
proposer: Option<NeuronId>;
|
|
289
|
+
executedTimestampSeconds: bigint;
|
|
290
|
+
topic: Topic;
|
|
291
|
+
status: ProposalStatus;
|
|
292
|
+
rewardStatus: ProposalRewardStatus;
|
|
293
|
+
}
|
|
294
|
+
export declare enum ProposalRewardStatus {
|
|
295
|
+
PROPOSAL_REWARD_STATUS_UNKNOWN = 0,
|
|
296
|
+
PROPOSAL_REWARD_STATUS_ACCEPT_VOTES = 1,
|
|
297
|
+
PROPOSAL_REWARD_STATUS_READY_TO_SETTLE = 2,
|
|
298
|
+
PROPOSAL_REWARD_STATUS_SETTLED = 3,
|
|
299
|
+
PROPOSAL_REWARD_STATUS_INELIGIBLE = 4
|
|
300
|
+
}
|
|
301
|
+
export declare enum ProposalStatus {
|
|
302
|
+
PROPOSAL_STATUS_UNKNOWN = 0,
|
|
303
|
+
PROPOSAL_STATUS_OPEN = 1,
|
|
304
|
+
PROPOSAL_STATUS_REJECTED = 2,
|
|
305
|
+
PROPOSAL_STATUS_ACCEPTED = 3,
|
|
306
|
+
PROPOSAL_STATUS_EXECUTED = 4,
|
|
307
|
+
PROPOSAL_STATUS_FAILED = 5
|
|
308
|
+
}
|
|
309
|
+
export declare enum Vote {
|
|
310
|
+
UNSPECIFIED = 0,
|
|
311
|
+
YES = 1,
|
|
312
|
+
NO = 2
|
|
313
|
+
}
|
|
314
|
+
export interface RegisterVote {
|
|
315
|
+
vote: Vote;
|
|
316
|
+
proposal: Option<ProposalId>;
|
|
317
|
+
}
|
|
318
|
+
export interface RemoveHotKey {
|
|
319
|
+
hotKeyToRemove: Option<PrincipalString>;
|
|
320
|
+
}
|
|
321
|
+
export declare type RewardMode = {
|
|
322
|
+
RewardToNeuron: RewardToNeuron;
|
|
323
|
+
} | {
|
|
324
|
+
RewardToAccount: RewardToAccount;
|
|
325
|
+
};
|
|
326
|
+
export declare type RewardNodeProviders = {
|
|
327
|
+
rewards: Array<RewardNodeProvider>;
|
|
328
|
+
};
|
|
329
|
+
export interface RewardToAccount {
|
|
330
|
+
toAccount: Option<AccountIdentifier>;
|
|
331
|
+
}
|
|
332
|
+
export interface RewardToNeuron {
|
|
333
|
+
dissolveDelaySeconds: bigint;
|
|
334
|
+
}
|
|
335
|
+
export declare type ClaimNeuronRequest = {
|
|
336
|
+
publicKey: DerEncodedPublicKey;
|
|
337
|
+
nonce: bigint;
|
|
338
|
+
dissolveDelayInSecs: bigint;
|
|
339
|
+
};
|
|
340
|
+
export declare type ClaimNeuronResponse = {
|
|
341
|
+
Ok: null;
|
|
342
|
+
} | {
|
|
343
|
+
Err: GovernanceError;
|
|
344
|
+
};
|
|
345
|
+
export declare type GetFullNeuronResponse = {
|
|
346
|
+
Ok: Neuron;
|
|
347
|
+
} | {
|
|
348
|
+
Err: GovernanceError;
|
|
349
|
+
};
|
|
350
|
+
export declare type GetNeuronInfoResponse = {
|
|
351
|
+
Ok: NeuronInfo;
|
|
352
|
+
} | {
|
|
353
|
+
Err: GovernanceError;
|
|
354
|
+
};
|
|
355
|
+
export interface RewardNodeProvider {
|
|
356
|
+
nodeProvider: Option<NodeProvider>;
|
|
357
|
+
rewardMode: Option<RewardMode>;
|
|
358
|
+
amountE8s: bigint;
|
|
359
|
+
}
|
|
360
|
+
export interface SetDefaultFollowees {
|
|
361
|
+
defaultFollowees: Array<Followees>;
|
|
362
|
+
}
|
|
363
|
+
export interface Spawn {
|
|
364
|
+
newController: Option<PrincipalString>;
|
|
365
|
+
}
|
|
366
|
+
export interface SpawnResponse {
|
|
367
|
+
createdNeuronId: NeuronId;
|
|
368
|
+
}
|
|
369
|
+
export interface Split {
|
|
370
|
+
amount: E8s;
|
|
371
|
+
}
|
|
372
|
+
export interface Tally {
|
|
373
|
+
no: bigint;
|
|
374
|
+
yes: bigint;
|
|
375
|
+
total: bigint;
|
|
376
|
+
timestampSeconds: bigint;
|
|
377
|
+
}
|
|
378
|
+
export declare enum Topic {
|
|
379
|
+
Unspecified = 0,
|
|
380
|
+
ManageNeuron = 1,
|
|
381
|
+
ExchangeRate = 2,
|
|
382
|
+
NetworkEconomics = 3,
|
|
383
|
+
Governance = 4,
|
|
384
|
+
NodeAdmin = 5,
|
|
385
|
+
ParticipantManagement = 6,
|
|
386
|
+
SubnetManagement = 7,
|
|
387
|
+
NetworkCanisterManagement = 8,
|
|
388
|
+
Kyc = 9,
|
|
389
|
+
NodeProviderRewards = 10
|
|
390
|
+
}
|
|
391
|
+
export interface AddHotKeyRequest {
|
|
392
|
+
neuronId: NeuronId;
|
|
393
|
+
principal: PrincipalString;
|
|
394
|
+
}
|
|
395
|
+
export interface RemoveHotKeyRequest {
|
|
396
|
+
neuronId: NeuronId;
|
|
397
|
+
principal: PrincipalString;
|
|
398
|
+
}
|
|
399
|
+
export interface StartDissolvingRequest {
|
|
400
|
+
neuronId: NeuronId;
|
|
401
|
+
}
|
|
402
|
+
export interface StopDissolvingRequest {
|
|
403
|
+
neuronId: NeuronId;
|
|
404
|
+
}
|
|
405
|
+
export interface IncreaseDissolveDelayRequest {
|
|
406
|
+
neuronId: NeuronId;
|
|
407
|
+
additionalDissolveDelaySeconds: number;
|
|
408
|
+
}
|
|
409
|
+
export interface FollowRequest {
|
|
410
|
+
neuronId: NeuronId;
|
|
411
|
+
topic: Topic;
|
|
412
|
+
followees: Array<NeuronId>;
|
|
413
|
+
}
|
|
414
|
+
export interface RegisterVoteRequest {
|
|
415
|
+
neuronId: NeuronId;
|
|
416
|
+
vote: Vote;
|
|
417
|
+
proposal: ProposalId;
|
|
418
|
+
}
|
|
419
|
+
export interface SpawnRequest {
|
|
420
|
+
neuronId: NeuronId;
|
|
421
|
+
newController: Option<PrincipalString>;
|
|
422
|
+
}
|
|
423
|
+
export interface SplitRequest {
|
|
424
|
+
neuronId: NeuronId;
|
|
425
|
+
amount: E8s;
|
|
426
|
+
}
|
|
427
|
+
export interface DisburseRequest {
|
|
428
|
+
neuronId: NeuronId;
|
|
429
|
+
toAccountId?: AccountIdentifier;
|
|
430
|
+
amount?: E8s;
|
|
431
|
+
}
|
|
432
|
+
export interface DisburseToNeuronRequest {
|
|
433
|
+
neuronId: NeuronId;
|
|
434
|
+
dissolveDelaySeconds: bigint;
|
|
435
|
+
kycVerified: boolean;
|
|
436
|
+
amount: E8s;
|
|
437
|
+
newController: Option<PrincipalString>;
|
|
438
|
+
nonce: bigint;
|
|
439
|
+
}
|
|
440
|
+
export interface JoinCommunityFundRequest {
|
|
441
|
+
neuronId: NeuronId;
|
|
442
|
+
}
|
|
443
|
+
export interface MakeProposalRequest {
|
|
444
|
+
neuronId: NeuronId;
|
|
445
|
+
title: Option<string>;
|
|
446
|
+
url: string;
|
|
447
|
+
summary: string;
|
|
448
|
+
action: Action;
|
|
449
|
+
}
|
|
450
|
+
export interface MakeMotionProposalRequest {
|
|
451
|
+
neuronId: NeuronId;
|
|
452
|
+
title: Option<string>;
|
|
453
|
+
url: string;
|
|
454
|
+
text: string;
|
|
455
|
+
summary: string;
|
|
456
|
+
}
|
|
457
|
+
export interface MakeNetworkEconomicsProposalRequest {
|
|
458
|
+
neuronId: NeuronId;
|
|
459
|
+
title: Option<string>;
|
|
460
|
+
summary: string;
|
|
461
|
+
url: string;
|
|
462
|
+
networkEconomics: NetworkEconomics;
|
|
463
|
+
}
|
|
464
|
+
export interface MakeRewardNodeProviderProposalRequest {
|
|
465
|
+
neuronId: NeuronId;
|
|
466
|
+
title: Option<string>;
|
|
467
|
+
summary: string;
|
|
468
|
+
url: string;
|
|
469
|
+
nodeProvider: PrincipalString;
|
|
470
|
+
amount: E8s;
|
|
471
|
+
rewardMode: Option<RewardMode>;
|
|
472
|
+
}
|
|
473
|
+
export interface MakeSetDefaultFolloweesProposalRequest {
|
|
474
|
+
neuronId: NeuronId;
|
|
475
|
+
title: Option<string>;
|
|
476
|
+
summary: string;
|
|
477
|
+
url: string;
|
|
478
|
+
followees: Array<Followees>;
|
|
479
|
+
}
|
|
480
|
+
export interface MakeExecuteNnsFunctionProposalRequest {
|
|
481
|
+
neuronId: NeuronId;
|
|
482
|
+
title: Option<string>;
|
|
483
|
+
summary: string;
|
|
484
|
+
url: string;
|
|
485
|
+
nnsFunction: number;
|
|
486
|
+
payload: ArrayBuffer;
|
|
487
|
+
}
|
|
488
|
+
export interface DisburseToNeuronResponse {
|
|
489
|
+
createdNeuronId: NeuronId;
|
|
490
|
+
}
|
|
491
|
+
export interface SpawnResponse {
|
|
492
|
+
createdNeuronId: NeuronId;
|
|
493
|
+
}
|
|
494
|
+
export declare type EmptyResponse = {
|
|
495
|
+
Ok: null;
|
|
496
|
+
} | {
|
|
497
|
+
Err: GovernanceError;
|
|
498
|
+
};
|
|
499
|
+
export default interface ServiceInterface {
|
|
500
|
+
getNeurons: (certified: boolean, neuronIds?: NeuronId[]) => Promise<Array<NeuronInfo>>;
|
|
501
|
+
getNeuronsForHW: () => Promise<Array<NeuronInfoForHw>>;
|
|
502
|
+
getPendingProposals: () => Promise<Array<ProposalInfo>>;
|
|
503
|
+
getProposalInfo: (proposalId: bigint) => Promise<Option<ProposalInfo>>;
|
|
504
|
+
listKnownNeurons: (certified: boolean) => Promise<Array<KnownNeuron>>;
|
|
505
|
+
listProposals: (request: ListProposalsRequest) => Promise<ListProposalsResponse>;
|
|
506
|
+
addHotKey: (request: AddHotKeyRequest) => Promise<EmptyResponse>;
|
|
507
|
+
removeHotKey: (request: RemoveHotKeyRequest) => Promise<EmptyResponse>;
|
|
508
|
+
startDissolving: (request: StartDissolvingRequest) => Promise<EmptyResponse>;
|
|
509
|
+
stopDissolving: (request: StopDissolvingRequest) => Promise<EmptyResponse>;
|
|
510
|
+
increaseDissolveDelay: (request: IncreaseDissolveDelayRequest) => Promise<EmptyResponse>;
|
|
511
|
+
joinCommunityFund: (request: JoinCommunityFundRequest) => Promise<EmptyResponse>;
|
|
512
|
+
follow: (request: FollowRequest) => Promise<EmptyResponse>;
|
|
513
|
+
mergeMaturity: (request: MergeMaturityRequest) => Promise<MergeMaturityResponse>;
|
|
514
|
+
registerVote: (request: RegisterVoteRequest) => Promise<EmptyResponse>;
|
|
515
|
+
spawn: (request: SpawnRequest) => Promise<SpawnResponse>;
|
|
516
|
+
split: (request: SplitRequest) => Promise<NeuronId>;
|
|
517
|
+
disburse: (request: DisburseRequest) => Promise<DisburseResponse>;
|
|
518
|
+
disburseToNeuron: (request: DisburseToNeuronRequest) => Promise<DisburseToNeuronResponse>;
|
|
519
|
+
makeMotionProposal: (request: MakeMotionProposalRequest) => Promise<MakeProposalResponse>;
|
|
520
|
+
makeNetworkEconomicsProposal: (request: MakeNetworkEconomicsProposalRequest) => Promise<MakeProposalResponse>;
|
|
521
|
+
makeRewardNodeProviderProposal: (request: MakeRewardNodeProviderProposalRequest) => Promise<MakeProposalResponse>;
|
|
522
|
+
makeSetDefaultFolloweesProposal: (request: MakeSetDefaultFolloweesProposalRequest) => Promise<MakeProposalResponse>;
|
|
523
|
+
makeExecuteNnsFunctionProposal: (request: MakeExecuteNnsFunctionProposalRequest) => Promise<MakeProposalResponse>;
|
|
524
|
+
claimOrRefreshNeuron: (request: ClaimOrRefreshNeuronRequest) => Promise<Option<NeuronId>>;
|
|
525
|
+
claimOrRefreshNeuronFromAccount: (request: ClaimOrRefreshNeuronFromAccount) => Promise<NeuronId>;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* An error used to ensure at compile-time that it's never reached.
|
|
529
|
+
*/
|
|
530
|
+
export declare class UnsupportedValueError extends Error {
|
|
531
|
+
constructor(value: never);
|
|
532
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Agent } from "@dfinity/agent";
|
|
2
|
+
import { Principal } from "@dfinity/principal";
|
|
3
|
+
import { ICP } from "../icp";
|
|
4
|
+
export declare type BlockHeight = bigint;
|
|
5
|
+
export declare type TransferError = InvalidSender | InsufficientFunds | TxTooOld | TxCreatedInFuture | TxDuplicate | BadFee;
|
|
6
|
+
export declare class InvalidSender {
|
|
7
|
+
}
|
|
8
|
+
export declare class BadFee {
|
|
9
|
+
}
|
|
10
|
+
export declare class InsufficientFunds {
|
|
11
|
+
readonly balance: ICP;
|
|
12
|
+
constructor(balance: ICP);
|
|
13
|
+
}
|
|
14
|
+
export declare class TxTooOld {
|
|
15
|
+
readonly allowed_window_secs: number;
|
|
16
|
+
constructor(allowed_window_secs: number);
|
|
17
|
+
}
|
|
18
|
+
export declare class TxCreatedInFuture {
|
|
19
|
+
}
|
|
20
|
+
export declare class TxDuplicate {
|
|
21
|
+
readonly duplicateOf: BlockHeight;
|
|
22
|
+
constructor(duplicateOf: BlockHeight);
|
|
23
|
+
}
|
|
24
|
+
export declare type Fetcher = (agent: Agent, canisterId: Principal, methodName: string, arg: ArrayBuffer) => Promise<Uint8Array | Error>;
|
|
25
|
+
export interface LedgerCanisterOptions {
|
|
26
|
+
agent?: Agent;
|
|
27
|
+
canisterId?: Principal;
|
|
28
|
+
updateCallOverride?: Fetcher;
|
|
29
|
+
queryCallOverride?: Fetcher;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Option<T> = T | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Principal } from "@dfinity/principal";
|
|
2
|
+
import { AccountIdentifier, SubAccount } from "../types/common";
|
|
3
|
+
export declare const uint8ArrayToBigInt: (array: Uint8Array) => bigint;
|
|
4
|
+
export declare const bigIntToUint8Array: (value: bigint) => Uint8Array;
|
|
5
|
+
export declare const arrayBufferToArrayOfNumber: (buffer: ArrayBuffer) => Array<number>;
|
|
6
|
+
export declare const arrayOfNumberToUint8Array: (numbers: Array<number>) => Uint8Array;
|
|
7
|
+
export declare const arrayOfNumberToArrayBuffer: (numbers: Array<number>) => ArrayBuffer;
|
|
8
|
+
export declare const arrayBufferToNumber: (buffer: ArrayBuffer) => number;
|
|
9
|
+
export declare const numberToArrayBuffer: (value: number, byteLength: number) => ArrayBuffer;
|
|
10
|
+
export declare const asciiStringToByteArray: (text: string) => Array<number>;
|
|
11
|
+
export declare const toSubAccountId: (subAccount: Array<number>) => number;
|
|
12
|
+
export declare const fromSubAccountId: (subAccountId: number) => Array<number>;
|
|
13
|
+
export declare const accountIdentifierToBytes: (accountIdentifier: AccountIdentifier) => Uint8Array;
|
|
14
|
+
export declare const accountIdentifierFromBytes: (accountIdentifier: Uint8Array) => AccountIdentifier;
|
|
15
|
+
export declare const principalToAccountIdentifier: (principal: Principal, subAccount?: Uint8Array | undefined) => string;
|
|
16
|
+
export declare const principalToSubAccount: (principal: Principal) => SubAccount;
|
|
17
|
+
export declare const toHexString: (bytes: Uint8Array) => string;
|
|
18
|
+
export declare const calculateCrc32: (bytes: Uint8Array) => Uint8Array;
|
|
File without changes
|