@dfinity/nns 10.2.0 → 10.3.1
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.did +1 -1
- package/dist/candid/governance_test.d.ts +145 -0
- package/dist/candid/governance_test.did +126 -8
- 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-NABC6URC.js +8 -0
- package/dist/esm/chunk-NABC6URC.js.map +7 -0
- package/dist/esm/governance.canister.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/canisters/governance/request.converters.d.ts +3 -2
- package/dist/types/governance.canister.d.ts +5 -3
- package/package.json +1 -1
- 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#L318)
|
|
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#L331)
|
|
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#L350)
|
|
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#L411)
|
|
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#L437)
|
|
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#L460)
|
|
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#L474)
|
|
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#L488)
|
|
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#L506)
|
|
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#L521)
|
|
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#L536)
|
|
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#L556)
|
|
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#L576)
|
|
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#L593)
|
|
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#L638)
|
|
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#L681)
|
|
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#L699)
|
|
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#L720)
|
|
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#L742)
|
|
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#L757)
|
|
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#L793)
|
|
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#L815)
|
|
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#L844)
|
|
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#L866)
|
|
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#L913)
|
|
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#L933)
|
|
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#L951)
|
|
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#L982)
|
|
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#L1007)
|
|
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#L1028)
|
|
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#L1057)
|
|
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#L1088)
|
|
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#L1103)
|
|
640
641
|
|
|
641
642
|
### :factory: SnsWasmCanister
|
|
642
643
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 285897d (2025-10-08 tags: release-2025-10-09_03-15-base) 'rs/nns/gtc/canister/gtc.did' by import-candid
|
|
2
2
|
|
|
3
3
|
type AccountState = record {
|
|
4
4
|
authenticated_principal_id : opt principal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 285897d (2025-10-08 tags: release-2025-10-09_03-15-base) 'rs/nns/governance/canister/governance.did' by import-candid
|
|
2
2
|
|
|
3
3
|
type AccountIdentifier = record {
|
|
4
4
|
hash : blob;
|
|
@@ -94,6 +94,9 @@ export interface ClaimOrRefreshNeuronFromAccountResponse {
|
|
|
94
94
|
export interface ClaimOrRefreshResponse {
|
|
95
95
|
refreshed_neuron_id: [] | [NeuronId];
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
|
|
99
|
+
*/
|
|
97
100
|
export type Command =
|
|
98
101
|
| { Spawn: Spawn }
|
|
99
102
|
| { Split: Split }
|
|
@@ -406,17 +409,45 @@ export interface LedgerParameters {
|
|
|
406
409
|
export interface ListKnownNeuronsResponse {
|
|
407
410
|
known_neurons: Array<KnownNeuron>;
|
|
408
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Parameters of the list_neurons method.
|
|
414
|
+
*/
|
|
409
415
|
export interface ListNeurons {
|
|
410
416
|
page_size: [] | [bigint];
|
|
417
|
+
/**
|
|
418
|
+
* When a public neuron is a member of the result set, include it in the
|
|
419
|
+
* full_neurons field (of ListNeuronsResponse). This does not affect which
|
|
420
|
+
* neurons are part of the result set.
|
|
421
|
+
*/
|
|
411
422
|
include_public_neurons_in_full_neurons: [] | [boolean];
|
|
423
|
+
/**
|
|
424
|
+
* These fields select neurons to be in the result set.
|
|
425
|
+
*/
|
|
412
426
|
neuron_ids: BigUint64Array | bigint[];
|
|
413
427
|
page_number: [] | [bigint];
|
|
428
|
+
/**
|
|
429
|
+
* Only has an effect when include_neurons_readable_by_caller.
|
|
430
|
+
*/
|
|
414
431
|
include_empty_neurons_readable_by_caller: [] | [boolean];
|
|
415
432
|
neuron_subaccounts: [] | [Array<NeuronSubaccount>];
|
|
416
433
|
include_neurons_readable_by_caller: boolean;
|
|
417
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Output of the list_neurons method.
|
|
437
|
+
*/
|
|
418
438
|
export interface ListNeuronsResponse {
|
|
439
|
+
/**
|
|
440
|
+
* Per the NeuronInfo type, this is a redacted view of the neurons in the
|
|
441
|
+
* result set consisting of information that require no special privileges to
|
|
442
|
+
* view.
|
|
443
|
+
*/
|
|
419
444
|
neuron_infos: Array<[bigint, NeuronInfo]>;
|
|
445
|
+
/**
|
|
446
|
+
* If the caller has the necessary special privileges (or the neuron is
|
|
447
|
+
* public, and the request sets include_public_neurons_in_full_neurons to
|
|
448
|
+
* true), then all the information about the neurons in the result set is made
|
|
449
|
+
* available here.
|
|
450
|
+
*/
|
|
420
451
|
full_neurons: Array<Neuron>;
|
|
421
452
|
total_pages_available: [] | [bigint];
|
|
422
453
|
}
|
|
@@ -451,11 +482,18 @@ export interface MakeProposalResponse {
|
|
|
451
482
|
message: [] | [string];
|
|
452
483
|
proposal_id: [] | [ProposalId];
|
|
453
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Not to be confused with ManageNeuronRequest. (Yes, this is very structurally
|
|
487
|
+
* similar to that, but not actually exactly equivalent.)
|
|
488
|
+
*/
|
|
454
489
|
export interface ManageNeuron {
|
|
455
490
|
id: [] | [NeuronId];
|
|
456
491
|
command: [] | [Command];
|
|
457
492
|
neuron_id_or_subaccount: [] | [NeuronIdOrSubaccount];
|
|
458
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* KEEP THIS IN SYNC WITH COMMAND!
|
|
496
|
+
*/
|
|
459
497
|
export type ManageNeuronCommandRequest =
|
|
460
498
|
| { Spawn: Spawn }
|
|
461
499
|
| { Split: Split }
|
|
@@ -472,12 +510,31 @@ export type ManageNeuronCommandRequest =
|
|
|
472
510
|
| { StakeMaturity: StakeMaturity }
|
|
473
511
|
| { MergeMaturity: MergeMaturity }
|
|
474
512
|
| { Disburse: Disburse };
|
|
513
|
+
/**
|
|
514
|
+
* Parameters of the manage_neuron method.
|
|
515
|
+
*/
|
|
475
516
|
export interface ManageNeuronRequest {
|
|
517
|
+
/**
|
|
518
|
+
* Deprecated. Use neuron_id_or_subaccount instead.
|
|
519
|
+
*/
|
|
476
520
|
id: [] | [NeuronId];
|
|
521
|
+
/**
|
|
522
|
+
* What operation to perform on the neuron.
|
|
523
|
+
*/
|
|
477
524
|
command: [] | [ManageNeuronCommandRequest];
|
|
525
|
+
/**
|
|
526
|
+
* Which neuron to operate on.
|
|
527
|
+
*/
|
|
478
528
|
neuron_id_or_subaccount: [] | [NeuronIdOrSubaccount];
|
|
479
529
|
}
|
|
530
|
+
/**
|
|
531
|
+
* Output of the manage_neuron method.
|
|
532
|
+
*/
|
|
480
533
|
export interface ManageNeuronResponse {
|
|
534
|
+
/**
|
|
535
|
+
* Corresponds to the command field in ManageNeuronRequest, which determines
|
|
536
|
+
* what operation was performed.
|
|
537
|
+
*/
|
|
481
538
|
command: [] | [Command_1];
|
|
482
539
|
}
|
|
483
540
|
export interface MaturityDisbursement {
|
|
@@ -537,10 +594,67 @@ export interface Neuron {
|
|
|
537
594
|
recent_ballots: Array<BallotInfo>;
|
|
538
595
|
voting_power_refreshed_timestamp_seconds: [] | [bigint];
|
|
539
596
|
kyc_verified: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* The amount of "sway" this neuron can have if it refreshes its voting power
|
|
599
|
+
* frequently enough.
|
|
600
|
+
*
|
|
601
|
+
* Unlike deciding_voting_power, this does NOT take refreshing into account.
|
|
602
|
+
* Rather, this only takes three factors into account:
|
|
603
|
+
*
|
|
604
|
+
* 1. (Net) staked amount - This is the "base" of a neuron's voting power.
|
|
605
|
+
* This primarily consists of the neuron's ICP balance.
|
|
606
|
+
*
|
|
607
|
+
* 2. Age - Neurons with more age have more voting power (all else being
|
|
608
|
+
* equal).
|
|
609
|
+
*
|
|
610
|
+
* 3. Dissolve delay - Neurons with longer dissolve delay have more voting
|
|
611
|
+
* power (all else being equal). Neurons with a dissolve delay of less
|
|
612
|
+
* than six months are not eligible to vote. Therefore, such neurons
|
|
613
|
+
* are considered to have 0 voting power.
|
|
614
|
+
*
|
|
615
|
+
* Per NNS policy, this is opt. Nevertheless, it will never be null.
|
|
616
|
+
*/
|
|
540
617
|
potential_voting_power: [] | [bigint];
|
|
541
618
|
neuron_type: [] | [number];
|
|
542
619
|
not_for_profit: boolean;
|
|
543
620
|
maturity_e8s_equivalent: bigint;
|
|
621
|
+
/**
|
|
622
|
+
* The amount of "sway" this neuron has when voting on proposals.
|
|
623
|
+
*
|
|
624
|
+
* When a proposal is created, each eligible neuron gets a "blank" ballot. The
|
|
625
|
+
* amount of voting power in that ballot is set to the neuron's deciding
|
|
626
|
+
* voting power at the time of proposal creation. There are two ways that a
|
|
627
|
+
* proposal can become decided:
|
|
628
|
+
*
|
|
629
|
+
* 1. Early: Either more than half of the total voting power in the ballots
|
|
630
|
+
* votes in favor (then the proposal is approved), or at least half of the
|
|
631
|
+
* votal voting power in the ballots votes against (then, the proposal is
|
|
632
|
+
* rejected).
|
|
633
|
+
*
|
|
634
|
+
* 2. The proposal's voting deadline is reached. At that point, if there is
|
|
635
|
+
* more voting power in favor than against, and at least 3% of the total
|
|
636
|
+
* voting power voted in favor, then the proposal is approved. Otherwise, it
|
|
637
|
+
* is rejected.
|
|
638
|
+
*
|
|
639
|
+
* If a neuron regularly refreshes its voting power, this has the same value
|
|
640
|
+
* as potential_voting_power. Actions that cause a refresh are as follows:
|
|
641
|
+
*
|
|
642
|
+
* 1. voting directly (not via following)
|
|
643
|
+
* 2. set following
|
|
644
|
+
* 3. refresh voting power
|
|
645
|
+
*
|
|
646
|
+
* (All of these actions are performed via the manage_neuron method.)
|
|
647
|
+
*
|
|
648
|
+
* However, if a neuron has not refreshed in a "long" time, this will be less
|
|
649
|
+
* than potential voting power. See VotingPowerEconomics. As a further result
|
|
650
|
+
* of less deciding voting power, not only does it have less influence on the
|
|
651
|
+
* outcome of proposals, the neuron receives less voting rewards (when it
|
|
652
|
+
* votes indirectly via following).
|
|
653
|
+
*
|
|
654
|
+
* For details, see https://dashboard.internetcomputer.org/proposal/132411.
|
|
655
|
+
*
|
|
656
|
+
* Per NNS policy, this is opt. Nevertheless, it will never be null.
|
|
657
|
+
*/
|
|
544
658
|
deciding_voting_power: [] | [bigint];
|
|
545
659
|
cached_neuron_stake_e8s: bigint;
|
|
546
660
|
created_timestamp_seconds: bigint;
|
|
@@ -549,6 +663,10 @@ export interface Neuron {
|
|
|
549
663
|
hot_keys: Array<Principal>;
|
|
550
664
|
account: Uint8Array | number[];
|
|
551
665
|
joined_community_fund_timestamp_seconds: [] | [bigint];
|
|
666
|
+
/**
|
|
667
|
+
* The maturity disbursements in progress, i.e. the disbursements that are initiated but not
|
|
668
|
+
* finalized. The finalization happens 7 days after the disbursement is initiated.
|
|
669
|
+
*/
|
|
552
670
|
maturity_disbursements_in_progress: [] | [Array<MaturityDisbursement>];
|
|
553
671
|
dissolve_state: [] | [DissolveState];
|
|
554
672
|
followees: Array<[number, Followees]>;
|
|
@@ -583,6 +701,14 @@ export interface NeuronInFlightCommand {
|
|
|
583
701
|
command: [] | [Command_2];
|
|
584
702
|
timestamp: bigint;
|
|
585
703
|
}
|
|
704
|
+
/**
|
|
705
|
+
* A limit view of Neuron that allows some aspects of all neurons to be read by
|
|
706
|
+
* anyone (i.e. without having to be the neuron's controller nor one of its
|
|
707
|
+
* hotkeys).
|
|
708
|
+
*
|
|
709
|
+
* As such, the meaning of each field in this type is generally the same as the
|
|
710
|
+
* one of the same (or at least similar) name in Neuron.
|
|
711
|
+
*/
|
|
586
712
|
export interface NeuronInfo {
|
|
587
713
|
dissolve_delay_seconds: bigint;
|
|
588
714
|
recent_ballots: Array<BallotInfo>;
|
|
@@ -592,11 +718,27 @@ export interface NeuronInfo {
|
|
|
592
718
|
deciding_voting_power: [] | [bigint];
|
|
593
719
|
created_timestamp_seconds: bigint;
|
|
594
720
|
state: number;
|
|
721
|
+
/**
|
|
722
|
+
* The amount of ICP (and staked maturity) locked in this neuron.
|
|
723
|
+
*
|
|
724
|
+
* This is the foundation of the neuron's voting power.
|
|
725
|
+
*
|
|
726
|
+
* cached_neuron_stake_e8s - neuron_fees_e8s + staked_maturity_e8s_equivalent
|
|
727
|
+
*/
|
|
595
728
|
stake_e8s: bigint;
|
|
596
729
|
joined_community_fund_timestamp_seconds: [] | [bigint];
|
|
597
730
|
retrieved_at_timestamp_seconds: bigint;
|
|
598
731
|
visibility: [] | [number];
|
|
599
732
|
known_neuron_data: [] | [KnownNeuronData];
|
|
733
|
+
/**
|
|
734
|
+
* Deprecated. Use either deciding_voting_power or potential_voting_power
|
|
735
|
+
* instead. Has the same value as deciding_voting_power.
|
|
736
|
+
*
|
|
737
|
+
* Previously, if a neuron had < 6 months dissolve delay (making it ineligible
|
|
738
|
+
* to vote), this would not get set to 0 (zero). That was pretty confusing.
|
|
739
|
+
* Now that this is set to deciding_voting_power, this actually does get
|
|
740
|
+
* zeroed out.
|
|
741
|
+
*/
|
|
600
742
|
voting_power: bigint;
|
|
601
743
|
age_seconds: bigint;
|
|
602
744
|
}
|
|
@@ -1076,6 +1218,9 @@ export interface _SERVICE {
|
|
|
1076
1218
|
ManageNeuronResponse
|
|
1077
1219
|
>;
|
|
1078
1220
|
transfer_gtc_neuron: ActorMethod<[NeuronId, NeuronId], Result>;
|
|
1221
|
+
/**
|
|
1222
|
+
* The following are methods for feature = "test"
|
|
1223
|
+
*/
|
|
1079
1224
|
update_neuron: ActorMethod<[Neuron], [] | [GovernanceError]>;
|
|
1080
1225
|
update_node_provider: ActorMethod<[UpdateNodeProvider], Result>;
|
|
1081
1226
|
}
|