@dfinity/nns 10.2.0 → 10.3.1-next-2025-10-15
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 +42 -41
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +56 -0
- package/dist/candid/governance.d.ts +42 -0
- package/dist/candid/governance.did +45 -1
- package/dist/candid/governance.idl.js +56 -0
- package/dist/candid/governance_test.certified.idl.js +56 -0
- package/dist/candid/governance_test.d.ts +187 -0
- package/dist/candid/governance_test.did +170 -8
- package/dist/candid/governance_test.idl.js +56 -0
- package/dist/candid/sns_wasm.did +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-HK4WSMGK.js +8 -0
- package/dist/esm/chunk-HK4WSMGK.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/types/canisters/governance/request.converters.d.ts +3 -2
- package/dist/types/governance.canister.d.ts +5 -3
- package/dist/types/types/governance_converters.d.ts +2 -0
- package/package.json +7 -7
- package/dist/esm/chunk-OLVLMWTQ.js +0 -8
- package/dist/esm/chunk-OLVLMWTQ.js.map +0 -7
package/README.md
CHANGED
|
@@ -176,7 +176,7 @@ Parameters:
|
|
|
176
176
|
|
|
177
177
|
### :factory: GovernanceCanister
|
|
178
178
|
|
|
179
|
-
[: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#L101)
|
|
180
180
|
|
|
181
181
|
#### Static Methods
|
|
182
182
|
|
|
@@ -188,7 +188,7 @@ Parameters:
|
|
|
188
188
|
| -------- | ------------------------------------------------------------- |
|
|
189
189
|
| `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
|
|
190
190
|
|
|
191
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
191
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L116)
|
|
192
192
|
|
|
193
193
|
#### Methods
|
|
194
194
|
|
|
@@ -246,7 +246,7 @@ combined into a single return value.
|
|
|
246
246
|
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
247
247
|
| `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<...>` |
|
|
248
248
|
|
|
249
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
249
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L159)
|
|
250
250
|
|
|
251
251
|
##### :gear: listKnownNeurons
|
|
252
252
|
|
|
@@ -260,7 +260,7 @@ it is fetched using a query call.
|
|
|
260
260
|
| ------------------ | ------------------------------------------------- |
|
|
261
261
|
| `listKnownNeurons` | `(certified?: boolean) => Promise<KnownNeuron[]>` |
|
|
262
262
|
|
|
263
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
263
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L292)
|
|
264
264
|
|
|
265
265
|
##### :gear: getLatestRewardEvent
|
|
266
266
|
|
|
@@ -273,7 +273,7 @@ it's fetched using a query call.
|
|
|
273
273
|
| ---------------------- | ----------------------------------------------- |
|
|
274
274
|
| `getLatestRewardEvent` | `(certified?: boolean) => Promise<RewardEvent>` |
|
|
275
275
|
|
|
276
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
276
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L319)
|
|
277
277
|
|
|
278
278
|
##### :gear: listProposals
|
|
279
279
|
|
|
@@ -292,7 +292,7 @@ Parameters:
|
|
|
292
292
|
- `request`: the options to list the proposals (limit number of results, topics to search for, etc.)
|
|
293
293
|
- `certified`: query or update calls
|
|
294
294
|
|
|
295
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
295
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L332)
|
|
296
296
|
|
|
297
297
|
##### :gear: stakeNeuron
|
|
298
298
|
|
|
@@ -300,7 +300,7 @@ Parameters:
|
|
|
300
300
|
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
301
301
|
| `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<...>` |
|
|
302
302
|
|
|
303
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
303
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L351)
|
|
304
304
|
|
|
305
305
|
##### :gear: increaseDissolveDelay
|
|
306
306
|
|
|
@@ -310,7 +310,7 @@ Increases dissolve delay of a neuron
|
|
|
310
310
|
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
311
311
|
| `increaseDissolveDelay` | `({ neuronId, additionalDissolveDelaySeconds, }: { neuronId: bigint; additionalDissolveDelaySeconds: number; }) => Promise<void>` |
|
|
312
312
|
|
|
313
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
313
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L412)
|
|
314
314
|
|
|
315
315
|
##### :gear: setDissolveDelay
|
|
316
316
|
|
|
@@ -321,7 +321,7 @@ The new date is now + dissolveDelaySeconds.
|
|
|
321
321
|
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
322
322
|
| `setDissolveDelay` | `({ neuronId, dissolveDelaySeconds, }: { neuronId: bigint; dissolveDelaySeconds: number; }) => Promise<void>` |
|
|
323
323
|
|
|
324
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
324
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L438)
|
|
325
325
|
|
|
326
326
|
##### :gear: startDissolving
|
|
327
327
|
|
|
@@ -331,7 +331,7 @@ Start dissolving process of a neuron
|
|
|
331
331
|
| ----------------- | ------------------------------------- |
|
|
332
332
|
| `startDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
333
333
|
|
|
334
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
334
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L461)
|
|
335
335
|
|
|
336
336
|
##### :gear: stopDissolving
|
|
337
337
|
|
|
@@ -341,7 +341,7 @@ Stop dissolving process of a neuron
|
|
|
341
341
|
| ---------------- | ------------------------------------- |
|
|
342
342
|
| `stopDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
343
343
|
|
|
344
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
344
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L475)
|
|
345
345
|
|
|
346
346
|
##### :gear: joinCommunityFund
|
|
347
347
|
|
|
@@ -351,7 +351,7 @@ Neuron joins the community fund
|
|
|
351
351
|
| ------------------- | ------------------------------------- |
|
|
352
352
|
| `joinCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
353
353
|
|
|
354
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
354
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L489)
|
|
355
355
|
|
|
356
356
|
##### :gear: autoStakeMaturity
|
|
357
357
|
|
|
@@ -366,7 +366,7 @@ Parameters:
|
|
|
366
366
|
- `neuronId`: The id of the neuron for which to request a change of the auto stake feature
|
|
367
367
|
- `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
|
|
368
368
|
|
|
369
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
369
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L507)
|
|
370
370
|
|
|
371
371
|
##### :gear: leaveCommunityFund
|
|
372
372
|
|
|
@@ -376,7 +376,7 @@ Neuron leaves the community fund
|
|
|
376
376
|
| -------------------- | ------------------------------------- |
|
|
377
377
|
| `leaveCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
378
378
|
|
|
379
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
379
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L522)
|
|
380
380
|
|
|
381
381
|
##### :gear: setVisibility
|
|
382
382
|
|
|
@@ -386,7 +386,7 @@ Set visibility of a neuron
|
|
|
386
386
|
| --------------- | ------------------------------------------------------------------- |
|
|
387
387
|
| `setVisibility` | `(neuronId: bigint, visibility: NeuronVisibility) => Promise<void>` |
|
|
388
388
|
|
|
389
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
389
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L537)
|
|
390
390
|
|
|
391
391
|
##### :gear: setNodeProviderAccount
|
|
392
392
|
|
|
@@ -397,7 +397,7 @@ Where the reward is paid to.
|
|
|
397
397
|
| ------------------------ | ---------------------------------------------- |
|
|
398
398
|
| `setNodeProviderAccount` | `(accountIdentifier: string) => Promise<void>` |
|
|
399
399
|
|
|
400
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
400
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L557)
|
|
401
401
|
|
|
402
402
|
##### :gear: mergeNeurons
|
|
403
403
|
|
|
@@ -407,7 +407,7 @@ Merge two neurons
|
|
|
407
407
|
| -------------- | --------------------------------------------------------------------------------- |
|
|
408
408
|
| `mergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<void>` |
|
|
409
409
|
|
|
410
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
410
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L577)
|
|
411
411
|
|
|
412
412
|
##### :gear: simulateMergeNeurons
|
|
413
413
|
|
|
@@ -417,7 +417,7 @@ Simulate merging two neurons
|
|
|
417
417
|
| ---------------------- | --------------------------------------------------------------------------------------- |
|
|
418
418
|
| `simulateMergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<NeuronInfo>` |
|
|
419
419
|
|
|
420
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
420
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L594)
|
|
421
421
|
|
|
422
422
|
##### :gear: splitNeuron
|
|
423
423
|
|
|
@@ -431,7 +431,7 @@ Returns:
|
|
|
431
431
|
|
|
432
432
|
newNeuronId
|
|
433
433
|
|
|
434
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
434
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L639)
|
|
435
435
|
|
|
436
436
|
##### :gear: getProposal
|
|
437
437
|
|
|
@@ -444,7 +444,7 @@ it is fetched using a query call.
|
|
|
444
444
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
445
445
|
| `getProposal` | `({ proposalId, certified, }: { proposalId: bigint; certified?: boolean or undefined; }) => Promise<ProposalInfo or undefined>` |
|
|
446
446
|
|
|
447
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
447
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L682)
|
|
448
448
|
|
|
449
449
|
##### :gear: makeProposal
|
|
450
450
|
|
|
@@ -458,7 +458,7 @@ Returns:
|
|
|
458
458
|
|
|
459
459
|
The newly created proposal ID or undefined if the success response returned by the Governance canister does not provide such information.
|
|
460
460
|
|
|
461
|
-
[: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#L700)
|
|
462
462
|
|
|
463
463
|
##### :gear: registerVote
|
|
464
464
|
|
|
@@ -468,7 +468,7 @@ Registers vote for a proposal from the neuron passed.
|
|
|
468
468
|
| -------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
469
469
|
| `registerVote` | `({ neuronId, vote, proposalId, }: { neuronId: bigint; vote: Vote; proposalId: bigint; }) => Promise<void>` |
|
|
470
470
|
|
|
471
|
-
[: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#L721)
|
|
472
472
|
|
|
473
473
|
##### :gear: setFollowees
|
|
474
474
|
|
|
@@ -478,7 +478,7 @@ Edit neuron followees per topic
|
|
|
478
478
|
| -------------- | ------------------------------------------------- |
|
|
479
479
|
| `setFollowees` | `(followRequest: FollowRequest) => Promise<void>` |
|
|
480
480
|
|
|
481
|
-
[: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#L743)
|
|
482
482
|
|
|
483
483
|
##### :gear: disburse
|
|
484
484
|
|
|
@@ -488,7 +488,7 @@ Disburse neuron on Account
|
|
|
488
488
|
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
489
489
|
| `disburse` | `({ neuronId, toAccountId, amount, }: { neuronId: bigint; toAccountId?: string or undefined; amount?: bigint or undefined; }) => Promise<void>` |
|
|
490
490
|
|
|
491
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
491
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L758)
|
|
492
492
|
|
|
493
493
|
##### :gear: refreshVotingPower
|
|
494
494
|
|
|
@@ -500,7 +500,7 @@ parameter of the neuron to the current time).
|
|
|
500
500
|
| -------------------- | --------------------------------------------------------- |
|
|
501
501
|
| `refreshVotingPower` | `({ neuronId, }: { neuronId: bigint; }) => Promise<void>` |
|
|
502
502
|
|
|
503
|
-
[: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#L794)
|
|
504
504
|
|
|
505
505
|
##### :gear: mergeMaturity
|
|
506
506
|
|
|
@@ -510,7 +510,7 @@ Merge Maturity of a neuron
|
|
|
510
510
|
| --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
511
511
|
| `mergeMaturity` | `({ neuronId, percentageToMerge, }: { neuronId: bigint; percentageToMerge: number; }) => Promise<void>` |
|
|
512
512
|
|
|
513
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
513
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L816)
|
|
514
514
|
|
|
515
515
|
##### :gear: stakeMaturity
|
|
516
516
|
|
|
@@ -525,7 +525,7 @@ Parameters:
|
|
|
525
525
|
- `neuronId`: The id of the neuron for which to stake the maturity
|
|
526
526
|
- `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
|
|
527
527
|
|
|
528
|
-
[: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#L845)
|
|
529
529
|
|
|
530
530
|
##### :gear: spawnNeuron
|
|
531
531
|
|
|
@@ -535,7 +535,7 @@ Merge Maturity of a neuron
|
|
|
535
535
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
536
536
|
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
|
|
537
537
|
|
|
538
|
-
[: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#L867)
|
|
539
539
|
|
|
540
540
|
##### :gear: addHotkey
|
|
541
541
|
|
|
@@ -545,7 +545,7 @@ Add hotkey to neuron
|
|
|
545
545
|
| ----------- | ------------------------------------------------------------------------------------------ |
|
|
546
546
|
| `addHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
547
547
|
|
|
548
|
-
[: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#L914)
|
|
549
549
|
|
|
550
550
|
##### :gear: removeHotkey
|
|
551
551
|
|
|
@@ -555,7 +555,7 @@ Remove hotkey to neuron
|
|
|
555
555
|
| -------------- | ------------------------------------------------------------------------------------------ |
|
|
556
556
|
| `removeHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
557
557
|
|
|
558
|
-
[: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#L934)
|
|
559
559
|
|
|
560
560
|
##### :gear: claimOrRefreshNeuronFromAccount
|
|
561
561
|
|
|
@@ -565,7 +565,7 @@ Gets the NeuronID of a newly created neuron.
|
|
|
565
565
|
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
566
566
|
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal or undefined; }) => Promise<bigint or undefined>` |
|
|
567
567
|
|
|
568
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
568
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L952)
|
|
569
569
|
|
|
570
570
|
##### :gear: claimOrRefreshNeuron
|
|
571
571
|
|
|
@@ -576,7 +576,7 @@ Uses query call only.
|
|
|
576
576
|
| ---------------------- | ------------------------------------------------------------------------ |
|
|
577
577
|
| `claimOrRefreshNeuron` | `(request: ClaimOrRefreshNeuronRequest) => Promise<bigint or undefined>` |
|
|
578
578
|
|
|
579
|
-
[: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#L983)
|
|
580
580
|
|
|
581
581
|
##### :gear: getNeuron
|
|
582
582
|
|
|
@@ -586,7 +586,7 @@ Return the data of the neuron provided as id.
|
|
|
586
586
|
| ----------- | ----------------------------------------------------------------------------------------------------------- |
|
|
587
587
|
| `getNeuron` | `({ certified, neuronId, }: { certified: boolean; neuronId: bigint; }) => Promise<NeuronInfo or undefined>` |
|
|
588
588
|
|
|
589
|
-
[: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#L1008)
|
|
590
590
|
|
|
591
591
|
##### :gear: getNetworkEconomicsParameters
|
|
592
592
|
|
|
@@ -596,24 +596,25 @@ Return the [Network Economics](https://github.com/dfinity/ic/blob/d90e934eb440c7
|
|
|
596
596
|
| ------------------------------- | ------------------------------------------------------------------------ |
|
|
597
597
|
| `getNetworkEconomicsParameters` | `({ certified, }: { certified: boolean; }) => Promise<NetworkEconomics>` |
|
|
598
598
|
|
|
599
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
599
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1029)
|
|
600
600
|
|
|
601
601
|
##### :gear: disburseMaturity
|
|
602
602
|
|
|
603
603
|
Disburses a neuron's maturity (always certified).
|
|
604
604
|
Reference: https://github.com/dfinity/ic/blob/ca2be53acf413bb92478ee7694ac0fb92af07030/rs/sns/governance/src/governance.rs#L1614
|
|
605
605
|
|
|
606
|
-
| Method | Type
|
|
607
|
-
| ------------------ |
|
|
608
|
-
| `disburseMaturity` | `({ neuronId, percentageToDisburse, toAccountIdentifier, }: { neuronId: bigint; percentageToDisburse: number; toAccountIdentifier?: string or undefined; }) => Promise<void>` |
|
|
606
|
+
| Method | Type |
|
|
607
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
608
|
+
| `disburseMaturity` | `({ neuronId, percentageToDisburse, toAccountIdentifier, toAccount, }: { neuronId: bigint; percentageToDisburse: number; toAccountIdentifier?: string or undefined; toAccount?: Account or undefined; }) => Promise<void>` |
|
|
609
609
|
|
|
610
610
|
Parameters:
|
|
611
611
|
|
|
612
612
|
- `params.neuronId`: The id of the neuron for which to disburse maturity
|
|
613
613
|
- `params.percentageToDisburse`: The percentage of the neuron's maturity to disburse, between 1 and 100 (inclusive).
|
|
614
|
-
- `params.
|
|
614
|
+
- `params.toAccountIdentifier`: Optional. The account identifier to which the maturity will be disbursed. If not provided, the maturity will be disbursed to the caller's Main account.
|
|
615
|
+
- `params.toAccount`: Optional. The ICRC account to which the maturity will be disbursed. If not provided, the maturity will be disbursed to the caller's Main account.
|
|
615
616
|
|
|
616
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
617
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1058)
|
|
617
618
|
|
|
618
619
|
##### :gear: setFollowing
|
|
619
620
|
|
|
@@ -628,7 +629,7 @@ Parameters:
|
|
|
628
629
|
- `params.neuronId`: The id of the neuron for which to set the following topics
|
|
629
630
|
- `params.topicFollowing`: The topics and the followees for each topic that the neuron should follow.
|
|
630
631
|
|
|
631
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
632
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1089)
|
|
632
633
|
|
|
633
634
|
##### :gear: getMetrics
|
|
634
635
|
|
|
@@ -636,7 +637,7 @@ Parameters:
|
|
|
636
637
|
| ------------ | ------------------------------------------------------------------------------- |
|
|
637
638
|
| `getMetrics` | `({ certified, }: { certified: boolean; }) => Promise<GovernanceCachedMetrics>` |
|
|
638
639
|
|
|
639
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
640
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1104)
|
|
640
641
|
|
|
641
642
|
### :factory: SnsWasmCanister
|
|
642
643
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit c211885f7c (2025-10-09) 'rs/nns/gtc/canister/gtc.did' by import-candid
|
|
2
2
|
|
|
3
3
|
type AccountState = record {
|
|
4
4
|
authenticated_principal_id : opt principal;
|
|
@@ -262,8 +262,29 @@ export const idlFactory = ({ IDL }) => {
|
|
|
262
262
|
'total' : IDL.Nat64,
|
|
263
263
|
'timestamp_seconds' : IDL.Nat64,
|
|
264
264
|
});
|
|
265
|
+
const TopicToFollow = IDL.Variant({
|
|
266
|
+
'Kyc' : IDL.Null,
|
|
267
|
+
'ServiceNervousSystemManagement' : IDL.Null,
|
|
268
|
+
'ApiBoundaryNodeManagement' : IDL.Null,
|
|
269
|
+
'ApplicationCanisterManagement' : IDL.Null,
|
|
270
|
+
'SubnetRental' : IDL.Null,
|
|
271
|
+
'NeuronManagement' : IDL.Null,
|
|
272
|
+
'NodeProviderRewards' : IDL.Null,
|
|
273
|
+
'SubnetManagement' : IDL.Null,
|
|
274
|
+
'ExchangeRate' : IDL.Null,
|
|
275
|
+
'CatchAll' : IDL.Null,
|
|
276
|
+
'NodeAdmin' : IDL.Null,
|
|
277
|
+
'IcOsVersionElection' : IDL.Null,
|
|
278
|
+
'ProtocolCanisterManagement' : IDL.Null,
|
|
279
|
+
'NetworkEconomics' : IDL.Null,
|
|
280
|
+
'IcOsVersionDeployment' : IDL.Null,
|
|
281
|
+
'ParticipantManagement' : IDL.Null,
|
|
282
|
+
'Governance' : IDL.Null,
|
|
283
|
+
'SnsAndCommunityFund' : IDL.Null,
|
|
284
|
+
});
|
|
265
285
|
const KnownNeuronData = IDL.Record({
|
|
266
286
|
'name' : IDL.Text,
|
|
287
|
+
'committed_topics' : IDL.Opt(IDL.Vec(IDL.Opt(TopicToFollow))),
|
|
267
288
|
'description' : IDL.Opt(IDL.Text),
|
|
268
289
|
'links' : IDL.Opt(IDL.Vec(IDL.Text)),
|
|
269
290
|
});
|
|
@@ -706,6 +727,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
706
727
|
'Ok' : MonthlyNodeProviderRewards,
|
|
707
728
|
'Err' : GovernanceError,
|
|
708
729
|
});
|
|
730
|
+
const GetNeuronIndexRequest = IDL.Record({
|
|
731
|
+
'page_size' : IDL.Opt(IDL.Nat32),
|
|
732
|
+
'exclusive_start_neuron_id' : IDL.Opt(NeuronId),
|
|
733
|
+
});
|
|
709
734
|
const NeuronInfo = IDL.Record({
|
|
710
735
|
'dissolve_delay_seconds' : IDL.Nat64,
|
|
711
736
|
'recent_ballots' : IDL.Vec(BallotInfo),
|
|
@@ -723,6 +748,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
723
748
|
'voting_power' : IDL.Nat64,
|
|
724
749
|
'age_seconds' : IDL.Nat64,
|
|
725
750
|
});
|
|
751
|
+
const NeuronIndexData = IDL.Record({ 'neurons' : IDL.Vec(NeuronInfo) });
|
|
752
|
+
const GetNeuronIndexResult = IDL.Variant({
|
|
753
|
+
'Ok' : NeuronIndexData,
|
|
754
|
+
'Err' : GovernanceError,
|
|
755
|
+
});
|
|
726
756
|
const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError });
|
|
727
757
|
const GetNeuronsFundAuditInfoRequest = IDL.Record({
|
|
728
758
|
'nns_proposal_id' : IDL.Opt(ProposalId),
|
|
@@ -978,6 +1008,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
978
1008
|
),
|
|
979
1009
|
'get_network_economics_parameters' : IDL.Func([], [NetworkEconomics], []),
|
|
980
1010
|
'get_neuron_ids' : IDL.Func([], [IDL.Vec(IDL.Nat64)], []),
|
|
1011
|
+
'get_neuron_index' : IDL.Func(
|
|
1012
|
+
[GetNeuronIndexRequest],
|
|
1013
|
+
[GetNeuronIndexResult],
|
|
1014
|
+
[],
|
|
1015
|
+
),
|
|
981
1016
|
'get_neuron_info' : IDL.Func([IDL.Nat64], [Result_5], []),
|
|
982
1017
|
'get_neuron_info_by_id_or_subaccount' : IDL.Func(
|
|
983
1018
|
[NeuronIdOrSubaccount],
|
|
@@ -1292,8 +1327,29 @@ export const init = ({ IDL }) => {
|
|
|
1292
1327
|
'total' : IDL.Nat64,
|
|
1293
1328
|
'timestamp_seconds' : IDL.Nat64,
|
|
1294
1329
|
});
|
|
1330
|
+
const TopicToFollow = IDL.Variant({
|
|
1331
|
+
'Kyc' : IDL.Null,
|
|
1332
|
+
'ServiceNervousSystemManagement' : IDL.Null,
|
|
1333
|
+
'ApiBoundaryNodeManagement' : IDL.Null,
|
|
1334
|
+
'ApplicationCanisterManagement' : IDL.Null,
|
|
1335
|
+
'SubnetRental' : IDL.Null,
|
|
1336
|
+
'NeuronManagement' : IDL.Null,
|
|
1337
|
+
'NodeProviderRewards' : IDL.Null,
|
|
1338
|
+
'SubnetManagement' : IDL.Null,
|
|
1339
|
+
'ExchangeRate' : IDL.Null,
|
|
1340
|
+
'CatchAll' : IDL.Null,
|
|
1341
|
+
'NodeAdmin' : IDL.Null,
|
|
1342
|
+
'IcOsVersionElection' : IDL.Null,
|
|
1343
|
+
'ProtocolCanisterManagement' : IDL.Null,
|
|
1344
|
+
'NetworkEconomics' : IDL.Null,
|
|
1345
|
+
'IcOsVersionDeployment' : IDL.Null,
|
|
1346
|
+
'ParticipantManagement' : IDL.Null,
|
|
1347
|
+
'Governance' : IDL.Null,
|
|
1348
|
+
'SnsAndCommunityFund' : IDL.Null,
|
|
1349
|
+
});
|
|
1295
1350
|
const KnownNeuronData = IDL.Record({
|
|
1296
1351
|
'name' : IDL.Text,
|
|
1352
|
+
'committed_topics' : IDL.Opt(IDL.Vec(IDL.Opt(TopicToFollow))),
|
|
1297
1353
|
'description' : IDL.Opt(IDL.Text),
|
|
1298
1354
|
'links' : IDL.Opt(IDL.Vec(IDL.Text)),
|
|
1299
1355
|
});
|
|
@@ -267,6 +267,13 @@ export interface FulfillSubnetRentalRequest {
|
|
|
267
267
|
*/
|
|
268
268
|
node_ids: [] | [Array<Principal>];
|
|
269
269
|
}
|
|
270
|
+
export interface GetNeuronIndexRequest {
|
|
271
|
+
page_size: [] | [number];
|
|
272
|
+
exclusive_start_neuron_id: [] | [NeuronId];
|
|
273
|
+
}
|
|
274
|
+
export type GetNeuronIndexResult =
|
|
275
|
+
| { Ok: NeuronIndexData }
|
|
276
|
+
| { Err: GovernanceError };
|
|
270
277
|
export interface GetNeuronsFundAuditInfoRequest {
|
|
271
278
|
nns_proposal_id: [] | [ProposalId];
|
|
272
279
|
}
|
|
@@ -397,6 +404,12 @@ export interface KnownNeuron {
|
|
|
397
404
|
}
|
|
398
405
|
export interface KnownNeuronData {
|
|
399
406
|
name: string;
|
|
407
|
+
/**
|
|
408
|
+
* The first `opt` makes it so that the field can be renamed/deprecated in the future, and
|
|
409
|
+
* the second `opt` makes it so that an older client not recognizing a new variant can still
|
|
410
|
+
* get the rest of the `vec`.
|
|
411
|
+
*/
|
|
412
|
+
committed_topics: [] | [Array<[] | [TopicToFollow]>];
|
|
400
413
|
description: [] | [string];
|
|
401
414
|
links: [] | [Array<string>];
|
|
402
415
|
}
|
|
@@ -701,6 +714,9 @@ export interface NeuronInFlightCommand {
|
|
|
701
714
|
command: [] | [Command_2];
|
|
702
715
|
timestamp: bigint;
|
|
703
716
|
}
|
|
717
|
+
export interface NeuronIndexData {
|
|
718
|
+
neurons: Array<NeuronInfo>;
|
|
719
|
+
}
|
|
704
720
|
/**
|
|
705
721
|
* A limit view of Neuron that allows some aspects of all neurons to be read by
|
|
706
722
|
* anyone (i.e. without having to be the neuron's controller nor one of its
|
|
@@ -1106,6 +1122,31 @@ export interface TimeWindow {
|
|
|
1106
1122
|
export interface Tokens {
|
|
1107
1123
|
e8s: [] | [bigint];
|
|
1108
1124
|
}
|
|
1125
|
+
/**
|
|
1126
|
+
* A topic that can be followed. It is almost the same as the topic on the
|
|
1127
|
+
* proposal, except that the `CatchAll` is a special value and following on this
|
|
1128
|
+
* `topic` will let the neuron follow the votes on all topics except for
|
|
1129
|
+
* Governance and SnsAndCommunityFund.
|
|
1130
|
+
*/
|
|
1131
|
+
export type TopicToFollow =
|
|
1132
|
+
| { Kyc: null }
|
|
1133
|
+
| { ServiceNervousSystemManagement: null }
|
|
1134
|
+
| { ApiBoundaryNodeManagement: null }
|
|
1135
|
+
| { ApplicationCanisterManagement: null }
|
|
1136
|
+
| { SubnetRental: null }
|
|
1137
|
+
| { NeuronManagement: null }
|
|
1138
|
+
| { NodeProviderRewards: null }
|
|
1139
|
+
| { SubnetManagement: null }
|
|
1140
|
+
| { ExchangeRate: null }
|
|
1141
|
+
| { CatchAll: null }
|
|
1142
|
+
| { NodeAdmin: null }
|
|
1143
|
+
| { IcOsVersionElection: null }
|
|
1144
|
+
| { ProtocolCanisterManagement: null }
|
|
1145
|
+
| { NetworkEconomics: null }
|
|
1146
|
+
| { IcOsVersionDeployment: null }
|
|
1147
|
+
| { ParticipantManagement: null }
|
|
1148
|
+
| { Governance: null }
|
|
1149
|
+
| { SnsAndCommunityFund: null };
|
|
1109
1150
|
export interface UpdateCanisterSettings {
|
|
1110
1151
|
canister_id: [] | [Principal];
|
|
1111
1152
|
settings: [] | [CanisterSettings];
|
|
@@ -1183,6 +1224,7 @@ export interface _SERVICE {
|
|
|
1183
1224
|
>;
|
|
1184
1225
|
get_network_economics_parameters: ActorMethod<[], NetworkEconomics>;
|
|
1185
1226
|
get_neuron_ids: ActorMethod<[], BigUint64Array | bigint[]>;
|
|
1227
|
+
get_neuron_index: ActorMethod<[GetNeuronIndexRequest], GetNeuronIndexResult>;
|
|
1186
1228
|
get_neuron_info: ActorMethod<[bigint], Result_5>;
|
|
1187
1229
|
get_neuron_info_by_id_or_subaccount: ActorMethod<
|
|
1188
1230
|
[NeuronIdOrSubaccount],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit c211885f7c (2025-10-09) 'rs/nns/governance/canister/governance.did' by import-candid
|
|
2
2
|
|
|
3
3
|
type AccountIdentifier = record {
|
|
4
4
|
hash : blob;
|
|
@@ -451,6 +451,10 @@ type KnownNeuronData = record {
|
|
|
451
451
|
name : text;
|
|
452
452
|
description : opt text;
|
|
453
453
|
links : opt vec text;
|
|
454
|
+
// The first `opt` makes it so that the field can be renamed/deprecated in the future, and
|
|
455
|
+
// the second `opt` makes it so that an older client not recognizing a new variant can still
|
|
456
|
+
// get the rest of the `vec`.
|
|
457
|
+
committed_topics : opt vec opt TopicToFollow;
|
|
454
458
|
};
|
|
455
459
|
|
|
456
460
|
type LedgerParameters = record {
|
|
@@ -793,6 +797,20 @@ type NeuronInFlightCommand = record {
|
|
|
793
797
|
timestamp : nat64;
|
|
794
798
|
};
|
|
795
799
|
|
|
800
|
+
type GetNeuronIndexRequest = record {
|
|
801
|
+
exclusive_start_neuron_id: opt NeuronId;
|
|
802
|
+
page_size: opt nat32;
|
|
803
|
+
};
|
|
804
|
+
|
|
805
|
+
type NeuronIndexData = record {
|
|
806
|
+
neurons: vec NeuronInfo;
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
type GetNeuronIndexResult = variant {
|
|
810
|
+
Ok : NeuronIndexData;
|
|
811
|
+
Err : GovernanceError;
|
|
812
|
+
};
|
|
813
|
+
|
|
796
814
|
// A limit view of Neuron that allows some aspects of all neurons to be read by
|
|
797
815
|
// anyone (i.e. without having to be the neuron's controller nor one of its
|
|
798
816
|
// hotkeys).
|
|
@@ -1335,6 +1353,31 @@ type MaturityDisbursement = record {
|
|
|
1335
1353
|
account_identifier_to_disburse_to : opt AccountIdentifier;
|
|
1336
1354
|
};
|
|
1337
1355
|
|
|
1356
|
+
// A topic that can be followed. It is almost the same as the topic on the
|
|
1357
|
+
// proposal, except that the `CatchAll` is a special value and following on this
|
|
1358
|
+
// `topic` will let the neuron follow the votes on all topics except for
|
|
1359
|
+
// Governance and SnsAndCommunityFund.
|
|
1360
|
+
type TopicToFollow = variant {
|
|
1361
|
+
CatchAll;
|
|
1362
|
+
NeuronManagement;
|
|
1363
|
+
ExchangeRate;
|
|
1364
|
+
NetworkEconomics;
|
|
1365
|
+
Governance;
|
|
1366
|
+
NodeAdmin;
|
|
1367
|
+
ParticipantManagement;
|
|
1368
|
+
SubnetManagement;
|
|
1369
|
+
Kyc;
|
|
1370
|
+
NodeProviderRewards;
|
|
1371
|
+
IcOsVersionDeployment;
|
|
1372
|
+
IcOsVersionElection;
|
|
1373
|
+
SnsAndCommunityFund;
|
|
1374
|
+
ApiBoundaryNodeManagement;
|
|
1375
|
+
SubnetRental;
|
|
1376
|
+
ApplicationCanisterManagement;
|
|
1377
|
+
ProtocolCanisterManagement;
|
|
1378
|
+
ServiceNervousSystemManagement;
|
|
1379
|
+
};
|
|
1380
|
+
|
|
1338
1381
|
service : (Governance) -> {
|
|
1339
1382
|
claim_gtc_neurons : (principal, vec NeuronId) -> (Result);
|
|
1340
1383
|
claim_or_refresh_neuron_from_account : (ClaimOrRefreshNeuronFromAccount) -> (
|
|
@@ -1353,6 +1396,7 @@ service : (Governance) -> {
|
|
|
1353
1396
|
) query;
|
|
1354
1397
|
get_network_economics_parameters : () -> (NetworkEconomics) query;
|
|
1355
1398
|
get_neuron_ids : () -> (vec nat64) query;
|
|
1399
|
+
get_neuron_index: (GetNeuronIndexRequest) -> (GetNeuronIndexResult) query;
|
|
1356
1400
|
get_neuron_info : (nat64) -> (Result_5) query;
|
|
1357
1401
|
get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> (
|
|
1358
1402
|
Result_5,
|