@dfinity/nns 8.3.2 → 8.4.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 +67 -46
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +25 -22
- package/dist/candid/governance.d.ts +15 -11
- package/dist/candid/governance.did +27 -17
- package/dist/candid/governance.idl.js +25 -22
- package/dist/candid/governance_test.certified.idl.js +25 -22
- package/dist/candid/governance_test.d.ts +15 -11
- package/dist/candid/governance_test.did +26 -16
- package/dist/candid/governance_test.idl.js +25 -22
- package/dist/candid/sns_wasm.certified.idl.js +0 -4
- package/dist/candid/sns_wasm.d.ts +0 -4
- package/dist/candid/sns_wasm.did +1 -6
- package/dist/candid/sns_wasm.idl.js +0 -4
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-DDPO5I3O.js +19 -0
- package/dist/esm/chunk-DDPO5I3O.js.map +7 -0
- package/dist/esm/chunk-GQ6HQ3NJ.js +2 -0
- package/dist/esm/chunk-GQ6HQ3NJ.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/sns_wasm.canister.js +1 -1
- package/dist/types/canisters/governance/request.converters.d.ts +4 -0
- package/dist/types/governance.canister.d.ts +15 -0
- package/dist/types/types/governance_converters.d.ts +13 -0
- package/package.json +3 -3
- package/dist/esm/chunk-4KESFT3P.js +0 -2
- package/dist/esm/chunk-4KESFT3P.js.map +0 -7
- package/dist/esm/chunk-SHZMGWWU.js +0 -19
- package/dist/esm/chunk-SHZMGWWU.js.map +0 -7
package/README.md
CHANGED
|
@@ -150,10 +150,9 @@ Parameters:
|
|
|
150
150
|
|
|
151
151
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/genesis_token.canister.ts#L9)
|
|
152
152
|
|
|
153
|
-
#### Methods
|
|
153
|
+
#### Static Methods
|
|
154
154
|
|
|
155
155
|
- [create](#gear-create)
|
|
156
|
-
- [claimNeurons](#gear-claimneurons)
|
|
157
156
|
|
|
158
157
|
##### :gear: create
|
|
159
158
|
|
|
@@ -163,6 +162,10 @@ Parameters:
|
|
|
163
162
|
|
|
164
163
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/genesis_token.canister.ts#L14)
|
|
165
164
|
|
|
165
|
+
#### Methods
|
|
166
|
+
|
|
167
|
+
- [claimNeurons](#gear-claimneurons)
|
|
168
|
+
|
|
166
169
|
##### :gear: claimNeurons
|
|
167
170
|
|
|
168
171
|
| Method | Type |
|
|
@@ -173,11 +176,22 @@ Parameters:
|
|
|
173
176
|
|
|
174
177
|
### :factory: GovernanceCanister
|
|
175
178
|
|
|
176
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
179
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L93)
|
|
177
180
|
|
|
178
|
-
#### Methods
|
|
181
|
+
#### Static Methods
|
|
179
182
|
|
|
180
183
|
- [create](#gear-create)
|
|
184
|
+
|
|
185
|
+
##### :gear: create
|
|
186
|
+
|
|
187
|
+
| Method | Type |
|
|
188
|
+
| -------- | ------------------------------------------------------------- |
|
|
189
|
+
| `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
|
|
190
|
+
|
|
191
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L108)
|
|
192
|
+
|
|
193
|
+
#### Methods
|
|
194
|
+
|
|
181
195
|
- [listNeurons](#gear-listneurons)
|
|
182
196
|
- [listKnownNeurons](#gear-listknownneurons)
|
|
183
197
|
- [getLastestRewardEvent](#gear-getlastestrewardevent)
|
|
@@ -210,14 +224,7 @@ Parameters:
|
|
|
210
224
|
- [claimOrRefreshNeuron](#gear-claimorrefreshneuron)
|
|
211
225
|
- [getNeuron](#gear-getneuron)
|
|
212
226
|
- [getNetworkEconomicsParameters](#gear-getnetworkeconomicsparameters)
|
|
213
|
-
|
|
214
|
-
##### :gear: create
|
|
215
|
-
|
|
216
|
-
| Method | Type |
|
|
217
|
-
| -------- | ------------------------------------------------------------- |
|
|
218
|
-
| `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
|
|
219
|
-
|
|
220
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L107)
|
|
227
|
+
- [disburseMaturity](#gear-disbursematurity)
|
|
221
228
|
|
|
222
229
|
##### :gear: listNeurons
|
|
223
230
|
|
|
@@ -237,7 +244,7 @@ combined into a single return value.
|
|
|
237
244
|
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
238
245
|
| `listNeurons` | `({ certified, neuronIds, includeEmptyNeurons, includePublicNeurons, neuronSubaccounts, }: { certified: boolean; neuronIds?: bigint[] or undefined; includeEmptyNeurons?: boolean or undefined; includePublicNeurons?: boolean or undefined; neuronSubaccounts?: NeuronSubaccount[] or undefined; }) => Promise<...>` |
|
|
239
246
|
|
|
240
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
247
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L151)
|
|
241
248
|
|
|
242
249
|
##### :gear: listKnownNeurons
|
|
243
250
|
|
|
@@ -251,7 +258,7 @@ it is fetched using a query call.
|
|
|
251
258
|
| ------------------ | ------------------------------------------------- |
|
|
252
259
|
| `listKnownNeurons` | `(certified?: boolean) => Promise<KnownNeuron[]>` |
|
|
253
260
|
|
|
254
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
261
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L279)
|
|
255
262
|
|
|
256
263
|
##### :gear: getLastestRewardEvent
|
|
257
264
|
|
|
@@ -264,7 +271,7 @@ it's fetched using a query call.
|
|
|
264
271
|
| ----------------------- | ----------------------------------------------- |
|
|
265
272
|
| `getLastestRewardEvent` | `(certified?: boolean) => Promise<RewardEvent>` |
|
|
266
273
|
|
|
267
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
274
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L301)
|
|
268
275
|
|
|
269
276
|
##### :gear: listProposals
|
|
270
277
|
|
|
@@ -283,7 +290,7 @@ Parameters:
|
|
|
283
290
|
- `request`: the options to list the proposals (limit number of results, topics to search for, etc.)
|
|
284
291
|
- `certified`: query or update calls
|
|
285
292
|
|
|
286
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
293
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L317)
|
|
287
294
|
|
|
288
295
|
##### :gear: stakeNeuron
|
|
289
296
|
|
|
@@ -291,7 +298,7 @@ Parameters:
|
|
|
291
298
|
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
292
299
|
| `stakeNeuron` | `({ stake, principal, fromSubAccount, ledgerCanister, createdAt, fee, }: { stake: bigint; principal: Principal; fromSubAccount?: number[] or undefined; ledgerCanister: LedgerCanister; createdAt?: bigint or undefined; fee?: bigint or undefined; }) => Promise<...>` |
|
|
293
300
|
|
|
294
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
301
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L336)
|
|
295
302
|
|
|
296
303
|
##### :gear: increaseDissolveDelay
|
|
297
304
|
|
|
@@ -301,7 +308,7 @@ Increases dissolve delay of a neuron
|
|
|
301
308
|
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
302
309
|
| `increaseDissolveDelay` | `({ neuronId, additionalDissolveDelaySeconds, }: { neuronId: bigint; additionalDissolveDelaySeconds: number; }) => Promise<void>` |
|
|
303
310
|
|
|
304
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
311
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L397)
|
|
305
312
|
|
|
306
313
|
##### :gear: setDissolveDelay
|
|
307
314
|
|
|
@@ -312,7 +319,7 @@ The new date is now + dissolveDelaySeconds.
|
|
|
312
319
|
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
313
320
|
| `setDissolveDelay` | `({ neuronId, dissolveDelaySeconds, }: { neuronId: bigint; dissolveDelaySeconds: number; }) => Promise<void>` |
|
|
314
321
|
|
|
315
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
322
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L423)
|
|
316
323
|
|
|
317
324
|
##### :gear: startDissolving
|
|
318
325
|
|
|
@@ -322,7 +329,7 @@ Start dissolving process of a neuron
|
|
|
322
329
|
| ----------------- | ------------------------------------- |
|
|
323
330
|
| `startDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
324
331
|
|
|
325
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
332
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L446)
|
|
326
333
|
|
|
327
334
|
##### :gear: stopDissolving
|
|
328
335
|
|
|
@@ -332,7 +339,7 @@ Stop dissolving process of a neuron
|
|
|
332
339
|
| ---------------- | ------------------------------------- |
|
|
333
340
|
| `stopDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
334
341
|
|
|
335
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
342
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L460)
|
|
336
343
|
|
|
337
344
|
##### :gear: joinCommunityFund
|
|
338
345
|
|
|
@@ -342,7 +349,7 @@ Neuron joins the community fund
|
|
|
342
349
|
| ------------------- | ------------------------------------- |
|
|
343
350
|
| `joinCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
344
351
|
|
|
345
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
352
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L474)
|
|
346
353
|
|
|
347
354
|
##### :gear: autoStakeMaturity
|
|
348
355
|
|
|
@@ -357,7 +364,7 @@ Parameters:
|
|
|
357
364
|
- `neuronId`: The id of the neuron for which to request a change of the auto stake feature
|
|
358
365
|
- `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
|
|
359
366
|
|
|
360
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
367
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L492)
|
|
361
368
|
|
|
362
369
|
##### :gear: leaveCommunityFund
|
|
363
370
|
|
|
@@ -367,7 +374,7 @@ Neuron leaves the community fund
|
|
|
367
374
|
| -------------------- | ------------------------------------- |
|
|
368
375
|
| `leaveCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
369
376
|
|
|
370
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
377
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L507)
|
|
371
378
|
|
|
372
379
|
##### :gear: setVisibility
|
|
373
380
|
|
|
@@ -377,7 +384,7 @@ Set visibility of a neuron
|
|
|
377
384
|
| --------------- | ------------------------------------------------------------------- |
|
|
378
385
|
| `setVisibility` | `(neuronId: bigint, visibility: NeuronVisibility) => Promise<void>` |
|
|
379
386
|
|
|
380
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
387
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L521)
|
|
381
388
|
|
|
382
389
|
##### :gear: setNodeProviderAccount
|
|
383
390
|
|
|
@@ -388,7 +395,7 @@ Where the reward is paid to.
|
|
|
388
395
|
| ------------------------ | ---------------------------------------------- |
|
|
389
396
|
| `setNodeProviderAccount` | `(accountIdentifier: string) => Promise<void>` |
|
|
390
397
|
|
|
391
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
398
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L541)
|
|
392
399
|
|
|
393
400
|
##### :gear: mergeNeurons
|
|
394
401
|
|
|
@@ -398,7 +405,7 @@ Merge two neurons
|
|
|
398
405
|
| -------------- | --------------------------------------------------------------------------------- |
|
|
399
406
|
| `mergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<void>` |
|
|
400
407
|
|
|
401
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
408
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L561)
|
|
402
409
|
|
|
403
410
|
##### :gear: simulateMergeNeurons
|
|
404
411
|
|
|
@@ -408,7 +415,7 @@ Simulate merging two neurons
|
|
|
408
415
|
| ---------------------- | --------------------------------------------------------------------------------------- |
|
|
409
416
|
| `simulateMergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<NeuronInfo>` |
|
|
410
417
|
|
|
411
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
418
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L578)
|
|
412
419
|
|
|
413
420
|
##### :gear: splitNeuron
|
|
414
421
|
|
|
@@ -418,7 +425,7 @@ Splits a neuron creating a new one
|
|
|
418
425
|
| ------------- | ----------------------------------------------------------------------------------- |
|
|
419
426
|
| `splitNeuron` | `({ neuronId, amount, }: { neuronId: bigint; amount: bigint; }) => Promise<bigint>` |
|
|
420
427
|
|
|
421
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
428
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L623)
|
|
422
429
|
|
|
423
430
|
##### :gear: getProposal
|
|
424
431
|
|
|
@@ -431,7 +438,7 @@ it is fetched using a query call.
|
|
|
431
438
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
432
439
|
| `getProposal` | `({ proposalId, certified, }: { proposalId: bigint; certified?: boolean or undefined; }) => Promise<ProposalInfo or undefined>` |
|
|
433
440
|
|
|
434
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
441
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L663)
|
|
435
442
|
|
|
436
443
|
##### :gear: makeProposal
|
|
437
444
|
|
|
@@ -441,7 +448,7 @@ Create new proposal
|
|
|
441
448
|
| -------------- | ---------------------------------------------------------------- |
|
|
442
449
|
| `makeProposal` | `(request: MakeProposalRequest) => Promise<bigint or undefined>` |
|
|
443
450
|
|
|
444
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
451
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L681)
|
|
445
452
|
|
|
446
453
|
##### :gear: registerVote
|
|
447
454
|
|
|
@@ -451,7 +458,7 @@ Registers vote for a proposal from the neuron passed.
|
|
|
451
458
|
| -------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
452
459
|
| `registerVote` | `({ neuronId, vote, proposalId, }: { neuronId: bigint; vote: Vote; proposalId: bigint; }) => Promise<void>` |
|
|
453
460
|
|
|
454
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
461
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L702)
|
|
455
462
|
|
|
456
463
|
##### :gear: setFollowees
|
|
457
464
|
|
|
@@ -461,7 +468,7 @@ Edit neuron followees per topic
|
|
|
461
468
|
| -------------- | ------------------------------------------------- |
|
|
462
469
|
| `setFollowees` | `(followRequest: FollowRequest) => Promise<void>` |
|
|
463
470
|
|
|
464
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
471
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L724)
|
|
465
472
|
|
|
466
473
|
##### :gear: disburse
|
|
467
474
|
|
|
@@ -471,7 +478,7 @@ Disburse neuron on Account
|
|
|
471
478
|
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
472
479
|
| `disburse` | `({ neuronId, toAccountId, amount, }: { neuronId: bigint; toAccountId?: string or undefined; amount?: bigint or undefined; }) => Promise<void>` |
|
|
473
480
|
|
|
474
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
481
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L739)
|
|
475
482
|
|
|
476
483
|
##### :gear: refreshVotingPower
|
|
477
484
|
|
|
@@ -483,7 +490,7 @@ parameter of the neuron to the current time).
|
|
|
483
490
|
| -------------------- | --------------------------------------------------------- |
|
|
484
491
|
| `refreshVotingPower` | `({ neuronId, }: { neuronId: bigint; }) => Promise<void>` |
|
|
485
492
|
|
|
486
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
493
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L775)
|
|
487
494
|
|
|
488
495
|
##### :gear: mergeMaturity
|
|
489
496
|
|
|
@@ -493,7 +500,7 @@ Merge Maturity of a neuron
|
|
|
493
500
|
| --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
494
501
|
| `mergeMaturity` | `({ neuronId, percentageToMerge, }: { neuronId: bigint; percentageToMerge: number; }) => Promise<void>` |
|
|
495
502
|
|
|
496
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
503
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L797)
|
|
497
504
|
|
|
498
505
|
##### :gear: stakeMaturity
|
|
499
506
|
|
|
@@ -508,7 +515,7 @@ Parameters:
|
|
|
508
515
|
- `neuronId`: The id of the neuron for which to stake the maturity
|
|
509
516
|
- `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
|
|
510
517
|
|
|
511
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
518
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L826)
|
|
512
519
|
|
|
513
520
|
##### :gear: spawnNeuron
|
|
514
521
|
|
|
@@ -518,7 +525,7 @@ Merge Maturity of a neuron
|
|
|
518
525
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
519
526
|
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
|
|
520
527
|
|
|
521
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
528
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L848)
|
|
522
529
|
|
|
523
530
|
##### :gear: addHotkey
|
|
524
531
|
|
|
@@ -528,7 +535,7 @@ Add hotkey to neuron
|
|
|
528
535
|
| ----------- | ------------------------------------------------------------------------------------------ |
|
|
529
536
|
| `addHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
530
537
|
|
|
531
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
538
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L895)
|
|
532
539
|
|
|
533
540
|
##### :gear: removeHotkey
|
|
534
541
|
|
|
@@ -538,7 +545,7 @@ Remove hotkey to neuron
|
|
|
538
545
|
| -------------- | ------------------------------------------------------------------------------------------ |
|
|
539
546
|
| `removeHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
540
547
|
|
|
541
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
548
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L915)
|
|
542
549
|
|
|
543
550
|
##### :gear: claimOrRefreshNeuronFromAccount
|
|
544
551
|
|
|
@@ -548,7 +555,7 @@ Gets the NeuronID of a newly created neuron.
|
|
|
548
555
|
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
549
556
|
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal or undefined; }) => Promise<bigint or undefined>` |
|
|
550
557
|
|
|
551
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
558
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L933)
|
|
552
559
|
|
|
553
560
|
##### :gear: claimOrRefreshNeuron
|
|
554
561
|
|
|
@@ -559,7 +566,7 @@ Uses query call only.
|
|
|
559
566
|
| ---------------------- | ------------------------------------------------------------------------ |
|
|
560
567
|
| `claimOrRefreshNeuron` | `(request: ClaimOrRefreshNeuronRequest) => Promise<bigint or undefined>` |
|
|
561
568
|
|
|
562
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
569
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L964)
|
|
563
570
|
|
|
564
571
|
##### :gear: getNeuron
|
|
565
572
|
|
|
@@ -569,7 +576,7 @@ Return the data of the neuron provided as id.
|
|
|
569
576
|
| ----------- | ----------------------------------------------------------------------------------------------------------- |
|
|
570
577
|
| `getNeuron` | `({ certified, neuronId, }: { certified: boolean; neuronId: bigint; }) => Promise<NeuronInfo or undefined>` |
|
|
571
578
|
|
|
572
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
579
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L989)
|
|
573
580
|
|
|
574
581
|
##### :gear: getNetworkEconomicsParameters
|
|
575
582
|
|
|
@@ -579,16 +586,26 @@ Return the [Network Economics](https://github.com/dfinity/ic/blob/d90e934eb440c7
|
|
|
579
586
|
| ------------------------------- | ------------------------------------------------------------------------ |
|
|
580
587
|
| `getNetworkEconomicsParameters` | `({ certified, }: { certified: boolean; }) => Promise<NetworkEconomics>` |
|
|
581
588
|
|
|
582
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
589
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1010)
|
|
590
|
+
|
|
591
|
+
##### :gear: disburseMaturity
|
|
592
|
+
|
|
593
|
+
Disburses a neuron's maturity (always certified).
|
|
594
|
+
Reference: https://github.com/dfinity/ic/blob/ca2be53acf413bb92478ee7694ac0fb92af07030/rs/sns/governance/src/governance.rs#L1614
|
|
595
|
+
|
|
596
|
+
| Method | Type |
|
|
597
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
598
|
+
| `disburseMaturity` | `({ neuronId, percentageToDisburse, }: { neuronId: bigint; percentageToDisburse: number; }) => Promise<void>` |
|
|
599
|
+
|
|
600
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1033)
|
|
583
601
|
|
|
584
602
|
### :factory: SnsWasmCanister
|
|
585
603
|
|
|
586
604
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/sns_wasm.canister.ts#L10)
|
|
587
605
|
|
|
588
|
-
#### Methods
|
|
606
|
+
#### Static Methods
|
|
589
607
|
|
|
590
608
|
- [create](#gear-create)
|
|
591
|
-
- [listSnses](#gear-listsnses)
|
|
592
609
|
|
|
593
610
|
##### :gear: create
|
|
594
611
|
|
|
@@ -598,6 +615,10 @@ Return the [Network Economics](https://github.com/dfinity/ic/blob/d90e934eb440c7
|
|
|
598
615
|
|
|
599
616
|
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/sns_wasm.canister.ts#L16)
|
|
600
617
|
|
|
618
|
+
#### Methods
|
|
619
|
+
|
|
620
|
+
- [listSnses](#gear-listsnses)
|
|
621
|
+
|
|
601
622
|
##### :gear: listSnses
|
|
602
623
|
|
|
603
624
|
| Method | Type |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 3ae3649 (2025-03-26 tags: release-2025-03-27_03-14-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
|
|
2
2
|
type AccountState = record {
|
|
3
3
|
authenticated_principal_id : opt principal;
|
|
4
4
|
successfully_transferred_neurons : vec TransferredNeuron;
|
|
@@ -22,6 +22,14 @@ export const idlFactory = ({ IDL }) => {
|
|
|
22
22
|
'topic' : IDL.Int32,
|
|
23
23
|
'followees' : IDL.Vec(NeuronId),
|
|
24
24
|
});
|
|
25
|
+
const Account = IDL.Record({
|
|
26
|
+
'owner' : IDL.Opt(IDL.Principal),
|
|
27
|
+
'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
28
|
+
});
|
|
29
|
+
const DisburseMaturity = IDL.Record({
|
|
30
|
+
'to_account' : IDL.Opt(Account),
|
|
31
|
+
'percentage_to_disburse' : IDL.Nat32,
|
|
32
|
+
});
|
|
25
33
|
const RefreshVotingPower = IDL.Record({});
|
|
26
34
|
const ClaimOrRefreshNeuronFromAccount = IDL.Record({
|
|
27
35
|
'controller' : IDL.Opt(IDL.Principal),
|
|
@@ -87,6 +95,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
87
95
|
'Spawn' : Spawn,
|
|
88
96
|
'Split' : Split,
|
|
89
97
|
'Follow' : Follow,
|
|
98
|
+
'DisburseMaturity' : DisburseMaturity,
|
|
90
99
|
'RefreshVotingPower' : RefreshVotingPower,
|
|
91
100
|
'ClaimOrRefresh' : ClaimOrRefresh,
|
|
92
101
|
'Configure' : Configure,
|
|
@@ -279,6 +288,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
279
288
|
});
|
|
280
289
|
const VotingPowerEconomics = IDL.Record({
|
|
281
290
|
'start_reducing_voting_power_after_seconds' : IDL.Opt(IDL.Nat64),
|
|
291
|
+
'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
|
|
282
292
|
'clear_following_after_seconds' : IDL.Opt(IDL.Nat64),
|
|
283
293
|
});
|
|
284
294
|
const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
|
|
@@ -481,16 +491,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
481
491
|
const FollowersMap = IDL.Record({
|
|
482
492
|
'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)),
|
|
483
493
|
});
|
|
484
|
-
const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId });
|
|
485
|
-
const Migration = IDL.Record({
|
|
486
|
-
'status' : IDL.Opt(IDL.Int32),
|
|
487
|
-
'failure_reason' : IDL.Opt(IDL.Text),
|
|
488
|
-
'progress' : IDL.Opt(Progress),
|
|
489
|
-
});
|
|
490
|
-
const Migrations = IDL.Record({
|
|
491
|
-
'neuron_indexes_migration' : IDL.Opt(Migration),
|
|
492
|
-
'copy_inactive_neurons_to_stable_memory_migration' : IDL.Opt(Migration),
|
|
493
|
-
});
|
|
494
494
|
const GovernanceError = IDL.Record({
|
|
495
495
|
'error_message' : IDL.Text,
|
|
496
496
|
'error_type' : IDL.Int32,
|
|
@@ -661,7 +661,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
661
661
|
'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
|
|
662
662
|
'short_voting_period_seconds' : IDL.Nat64,
|
|
663
663
|
'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)),
|
|
664
|
-
'migrations' : IDL.Opt(Migrations),
|
|
665
664
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
666
665
|
'xdr_conversion_rate' : IDL.Opt(XdrConversionRate),
|
|
667
666
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
|
|
@@ -817,6 +816,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
817
816
|
'Spawn' : Spawn,
|
|
818
817
|
'Split' : Split,
|
|
819
818
|
'Follow' : Follow,
|
|
819
|
+
'DisburseMaturity' : DisburseMaturity,
|
|
820
820
|
'RefreshVotingPower' : RefreshVotingPower,
|
|
821
821
|
'ClaimOrRefresh' : ClaimOrRefresh,
|
|
822
822
|
'Configure' : Configure,
|
|
@@ -836,6 +836,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
836
836
|
})
|
|
837
837
|
);
|
|
838
838
|
const SpawnResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });
|
|
839
|
+
const DisburseMaturityResponse = IDL.Record({
|
|
840
|
+
'amount_disbursed_e8s' : IDL.Opt(IDL.Nat64),
|
|
841
|
+
});
|
|
839
842
|
const RefreshVotingPowerResponse = IDL.Record({});
|
|
840
843
|
const ClaimOrRefreshResponse = IDL.Record({
|
|
841
844
|
'refreshed_neuron_id' : IDL.Opt(NeuronId),
|
|
@@ -864,6 +867,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
864
867
|
'Spawn' : SpawnResponse,
|
|
865
868
|
'Split' : SpawnResponse,
|
|
866
869
|
'Follow' : IDL.Record({}),
|
|
870
|
+
'DisburseMaturity' : DisburseMaturityResponse,
|
|
867
871
|
'RefreshVotingPower' : RefreshVotingPowerResponse,
|
|
868
872
|
'ClaimOrRefresh' : ClaimOrRefreshResponse,
|
|
869
873
|
'Configure' : IDL.Record({}),
|
|
@@ -1021,6 +1025,14 @@ export const init = ({ IDL }) => {
|
|
|
1021
1025
|
'topic' : IDL.Int32,
|
|
1022
1026
|
'followees' : IDL.Vec(NeuronId),
|
|
1023
1027
|
});
|
|
1028
|
+
const Account = IDL.Record({
|
|
1029
|
+
'owner' : IDL.Opt(IDL.Principal),
|
|
1030
|
+
'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
1031
|
+
});
|
|
1032
|
+
const DisburseMaturity = IDL.Record({
|
|
1033
|
+
'to_account' : IDL.Opt(Account),
|
|
1034
|
+
'percentage_to_disburse' : IDL.Nat32,
|
|
1035
|
+
});
|
|
1024
1036
|
const RefreshVotingPower = IDL.Record({});
|
|
1025
1037
|
const ClaimOrRefreshNeuronFromAccount = IDL.Record({
|
|
1026
1038
|
'controller' : IDL.Opt(IDL.Principal),
|
|
@@ -1086,6 +1098,7 @@ export const init = ({ IDL }) => {
|
|
|
1086
1098
|
'Spawn' : Spawn,
|
|
1087
1099
|
'Split' : Split,
|
|
1088
1100
|
'Follow' : Follow,
|
|
1101
|
+
'DisburseMaturity' : DisburseMaturity,
|
|
1089
1102
|
'RefreshVotingPower' : RefreshVotingPower,
|
|
1090
1103
|
'ClaimOrRefresh' : ClaimOrRefresh,
|
|
1091
1104
|
'Configure' : Configure,
|
|
@@ -1278,6 +1291,7 @@ export const init = ({ IDL }) => {
|
|
|
1278
1291
|
});
|
|
1279
1292
|
const VotingPowerEconomics = IDL.Record({
|
|
1280
1293
|
'start_reducing_voting_power_after_seconds' : IDL.Opt(IDL.Nat64),
|
|
1294
|
+
'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
|
|
1281
1295
|
'clear_following_after_seconds' : IDL.Opt(IDL.Nat64),
|
|
1282
1296
|
});
|
|
1283
1297
|
const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
|
|
@@ -1480,16 +1494,6 @@ export const init = ({ IDL }) => {
|
|
|
1480
1494
|
const FollowersMap = IDL.Record({
|
|
1481
1495
|
'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)),
|
|
1482
1496
|
});
|
|
1483
|
-
const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId });
|
|
1484
|
-
const Migration = IDL.Record({
|
|
1485
|
-
'status' : IDL.Opt(IDL.Int32),
|
|
1486
|
-
'failure_reason' : IDL.Opt(IDL.Text),
|
|
1487
|
-
'progress' : IDL.Opt(Progress),
|
|
1488
|
-
});
|
|
1489
|
-
const Migrations = IDL.Record({
|
|
1490
|
-
'neuron_indexes_migration' : IDL.Opt(Migration),
|
|
1491
|
-
'copy_inactive_neurons_to_stable_memory_migration' : IDL.Opt(Migration),
|
|
1492
|
-
});
|
|
1493
1497
|
const GovernanceError = IDL.Record({
|
|
1494
1498
|
'error_message' : IDL.Text,
|
|
1495
1499
|
'error_type' : IDL.Int32,
|
|
@@ -1660,7 +1664,6 @@ export const init = ({ IDL }) => {
|
|
|
1660
1664
|
'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
|
|
1661
1665
|
'short_voting_period_seconds' : IDL.Nat64,
|
|
1662
1666
|
'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)),
|
|
1663
|
-
'migrations' : IDL.Opt(Migrations),
|
|
1664
1667
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
1665
1668
|
'xdr_conversion_rate' : IDL.Opt(XdrConversionRate),
|
|
1666
1669
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
|
|
@@ -2,6 +2,10 @@ import type { ActorMethod } from "@dfinity/agent";
|
|
|
2
2
|
import type { IDL } from "@dfinity/candid";
|
|
3
3
|
import type { Principal } from "@dfinity/principal";
|
|
4
4
|
|
|
5
|
+
export interface Account {
|
|
6
|
+
owner: [] | [Principal];
|
|
7
|
+
subaccount: [] | [Uint8Array | number[]];
|
|
8
|
+
}
|
|
5
9
|
export interface AccountIdentifier {
|
|
6
10
|
hash: Uint8Array | number[];
|
|
7
11
|
}
|
|
@@ -92,6 +96,7 @@ export type Command =
|
|
|
92
96
|
| { Spawn: Spawn }
|
|
93
97
|
| { Split: Split }
|
|
94
98
|
| { Follow: Follow }
|
|
99
|
+
| { DisburseMaturity: DisburseMaturity }
|
|
95
100
|
| { RefreshVotingPower: RefreshVotingPower }
|
|
96
101
|
| { ClaimOrRefresh: ClaimOrRefresh }
|
|
97
102
|
| { Configure: Configure }
|
|
@@ -107,6 +112,7 @@ export type Command_1 =
|
|
|
107
112
|
| { Spawn: SpawnResponse }
|
|
108
113
|
| { Split: SpawnResponse }
|
|
109
114
|
| { Follow: {} }
|
|
115
|
+
| { DisburseMaturity: DisburseMaturityResponse }
|
|
110
116
|
| { RefreshVotingPower: RefreshVotingPowerResponse }
|
|
111
117
|
| { ClaimOrRefresh: ClaimOrRefreshResponse }
|
|
112
118
|
| { Configure: {} }
|
|
@@ -175,6 +181,13 @@ export interface Disburse {
|
|
|
175
181
|
to_account: [] | [AccountIdentifier];
|
|
176
182
|
amount: [] | [Amount];
|
|
177
183
|
}
|
|
184
|
+
export interface DisburseMaturity {
|
|
185
|
+
to_account: [] | [Account];
|
|
186
|
+
percentage_to_disburse: number;
|
|
187
|
+
}
|
|
188
|
+
export interface DisburseMaturityResponse {
|
|
189
|
+
amount_disbursed_e8s: [] | [bigint];
|
|
190
|
+
}
|
|
178
191
|
export interface DisburseResponse {
|
|
179
192
|
transfer_block_height: bigint;
|
|
180
193
|
}
|
|
@@ -234,7 +247,6 @@ export interface Governance {
|
|
|
234
247
|
to_claim_transfers: Array<NeuronStakeTransfer>;
|
|
235
248
|
short_voting_period_seconds: bigint;
|
|
236
249
|
topic_followee_index: Array<[number, FollowersMap]>;
|
|
237
|
-
migrations: [] | [Migrations];
|
|
238
250
|
proposals: Array<[bigint, ProposalData]>;
|
|
239
251
|
xdr_conversion_rate: [] | [XdrConversionRate];
|
|
240
252
|
in_flight_commands: Array<[bigint, NeuronInFlightCommand]>;
|
|
@@ -410,6 +422,7 @@ export type ManageNeuronCommandRequest =
|
|
|
410
422
|
| { Spawn: Spawn }
|
|
411
423
|
| { Split: Split }
|
|
412
424
|
| { Follow: Follow }
|
|
425
|
+
| { DisburseMaturity: DisburseMaturity }
|
|
413
426
|
| { RefreshVotingPower: RefreshVotingPower }
|
|
414
427
|
| { ClaimOrRefresh: ClaimOrRefresh }
|
|
415
428
|
| { Configure: Configure }
|
|
@@ -444,15 +457,6 @@ export interface MergeResponse {
|
|
|
444
457
|
target_neuron_info: [] | [NeuronInfo];
|
|
445
458
|
source_neuron_info: [] | [NeuronInfo];
|
|
446
459
|
}
|
|
447
|
-
export interface Migration {
|
|
448
|
-
status: [] | [number];
|
|
449
|
-
failure_reason: [] | [string];
|
|
450
|
-
progress: [] | [Progress];
|
|
451
|
-
}
|
|
452
|
-
export interface Migrations {
|
|
453
|
-
neuron_indexes_migration: [] | [Migration];
|
|
454
|
-
copy_inactive_neurons_to_stable_memory_migration: [] | [Migration];
|
|
455
|
-
}
|
|
456
460
|
export interface MonthlyNodeProviderRewards {
|
|
457
461
|
minimum_xdr_permyriad_per_icp: [] | [bigint];
|
|
458
462
|
registry_version: [] | [bigint];
|
|
@@ -674,7 +678,6 @@ export interface Percentage {
|
|
|
674
678
|
export interface Principals {
|
|
675
679
|
principals: Array<Principal>;
|
|
676
680
|
}
|
|
677
|
-
export type Progress = { LastNeuronId: NeuronId };
|
|
678
681
|
export interface Proposal {
|
|
679
682
|
url: string;
|
|
680
683
|
title: [] | [string];
|
|
@@ -907,6 +910,7 @@ export interface UpdateNodeProvider {
|
|
|
907
910
|
}
|
|
908
911
|
export interface VotingPowerEconomics {
|
|
909
912
|
start_reducing_voting_power_after_seconds: [] | [bigint];
|
|
913
|
+
neuron_minimum_dissolve_delay_to_vote_seconds: [] | [bigint];
|
|
910
914
|
clear_following_after_seconds: [] | [bigint];
|
|
911
915
|
}
|
|
912
916
|
export interface VotingRewardParameters {
|