@dfinity/nns 7.0.2 → 8.0.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.
Files changed (32) hide show
  1. package/README.md +53 -44
  2. package/dist/candid/genesis_token.did +1 -1
  3. package/dist/candid/governance.certified.idl.js +6 -0
  4. package/dist/candid/governance.d.ts +4 -0
  5. package/dist/candid/governance.did +5 -1
  6. package/dist/candid/governance.idl.js +6 -0
  7. package/dist/candid/governance_test.certified.idl.js +6 -0
  8. package/dist/candid/governance_test.d.ts +4 -0
  9. package/dist/candid/governance_test.did +5 -1
  10. package/dist/candid/governance_test.idl.js +6 -0
  11. package/dist/candid/sns_wasm.did +1 -1
  12. package/dist/cjs/index.cjs.js +1 -1
  13. package/dist/cjs/index.cjs.js.map +4 -4
  14. package/dist/esm/{chunk-3GMJYFVP.js → chunk-4KESFT3P.js} +2 -2
  15. package/dist/esm/{chunk-KCY3PAEP.js → chunk-IIFH2XLR.js} +1 -1
  16. package/dist/esm/{chunk-YKKQOXDQ.js → chunk-UZGLNEQP.js} +2 -2
  17. package/dist/esm/chunk-XGNDCDDQ.js +19 -0
  18. package/dist/esm/chunk-XGNDCDDQ.js.map +7 -0
  19. package/dist/esm/genesis_token.canister.js +1 -1
  20. package/dist/esm/governance.canister.js +1 -1
  21. package/dist/esm/index.js +1 -1
  22. package/dist/esm/index.js.map +4 -4
  23. package/dist/esm/sns_wasm.canister.js +1 -1
  24. package/dist/types/governance.canister.d.ts +0 -16
  25. package/dist/types/types/governance_converters.d.ts +1 -0
  26. package/dist/types/utils/neurons.utils.d.ts +11 -0
  27. package/package.json +3 -3
  28. package/dist/esm/chunk-BL4SIQCO.js +0 -19
  29. package/dist/esm/chunk-BL4SIQCO.js.map +0 -7
  30. /package/dist/esm/{chunk-3GMJYFVP.js.map → chunk-4KESFT3P.js.map} +0 -0
  31. /package/dist/esm/{chunk-KCY3PAEP.js.map → chunk-IIFH2XLR.js.map} +0 -0
  32. /package/dist/esm/{chunk-YKKQOXDQ.js.map → chunk-UZGLNEQP.js.map} +0 -0
package/README.md CHANGED
@@ -77,6 +77,8 @@ const myNeurons = await listNeurons({ certified: false });
77
77
  - [ineligibleNeurons](#gear-ineligibleneurons)
78
78
  - [votableNeurons](#gear-votableneurons)
79
79
  - [votedNeurons](#gear-votedneurons)
80
+ - [memoToNeuronSubaccount](#gear-memotoneuronsubaccount)
81
+ - [memoToNeuronAccountIdentifier](#gear-memotoneuronaccountidentifier)
80
82
 
81
83
  #### :gear: ineligibleNeurons
82
84
 
@@ -96,7 +98,7 @@ Parameters:
96
98
  - `params.neurons`: The neurons to filter.
97
99
  - `params.proposal`: The proposal to match against the selected neurons.
98
100
 
99
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L29)
101
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L37)
100
102
 
101
103
  #### :gear: votableNeurons
102
104
 
@@ -111,7 +113,7 @@ Parameters:
111
113
  - `params.neurons`: The neurons to filter.
112
114
  - `params.proposal`: The proposal to match against the selected neurons.
113
115
 
114
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L58)
116
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L66)
115
117
 
116
118
  #### :gear: votedNeurons
117
119
 
@@ -126,7 +128,23 @@ Parameters:
126
128
  - `params.neurons`: The neurons to filter.
127
129
  - `params.proposal`: The proposal for which some neurons might have already voted.
128
130
 
129
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L81)
131
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L89)
132
+
133
+ #### :gear: memoToNeuronSubaccount
134
+
135
+ | Function | Type |
136
+ | ------------------------ | --------------------------------------------------------------------------------- |
137
+ | `memoToNeuronSubaccount` | `({ controller, memo, }: { controller: Principal; memo: bigint; }) => SubAccount` |
138
+
139
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L101)
140
+
141
+ #### :gear: memoToNeuronAccountIdentifier
142
+
143
+ | Function | Type |
144
+ | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
145
+ | `memoToNeuronAccountIdentifier` | `({ controller, memo, governanceCanisterId, }: { controller: Principal; memo: bigint; governanceCanisterId: Principal; }) => AccountIdentifier` |
146
+
147
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/utils/neurons.utils.ts#L122)
130
148
 
131
149
  ### :factory: GenesisTokenCanister
132
150
 
@@ -155,7 +173,7 @@ Parameters:
155
173
 
156
174
  ### :factory: GovernanceCanister
157
175
 
158
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L94)
176
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L88)
159
177
 
160
178
  #### Methods
161
179
 
@@ -165,7 +183,6 @@ Parameters:
165
183
  - [getLastestRewardEvent](#gear-getlastestrewardevent)
166
184
  - [listProposals](#gear-listproposals)
167
185
  - [stakeNeuron](#gear-stakeneuron)
168
- - [stakeNeuronIcrc1](#gear-stakeneuronicrc1)
169
186
  - [increaseDissolveDelay](#gear-increasedissolvedelay)
170
187
  - [setDissolveDelay](#gear-setdissolvedelay)
171
188
  - [startDissolving](#gear-startdissolving)
@@ -198,7 +215,7 @@ Parameters:
198
215
  | -------- | ------------------------------------------------------------- |
199
216
  | `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
200
217
 
201
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L109)
218
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L103)
202
219
 
203
220
  ##### :gear: listNeurons
204
221
 
@@ -215,7 +232,7 @@ The backend treats `includeEmptyNeurons` as true if absent.
215
232
  | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
216
233
  | `listNeurons` | `({ certified, neuronIds, includeEmptyNeurons, includePublicNeurons, }: { certified: boolean; neuronIds?: bigint[] or undefined; includeEmptyNeurons?: boolean or undefined; includePublicNeurons?: boolean or undefined; }) => Promise<NeuronInfo[]>` |
217
234
 
218
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L149)
235
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L143)
219
236
 
220
237
  ##### :gear: listKnownNeurons
221
238
 
@@ -229,7 +246,7 @@ it is fetched using a query call.
229
246
  | ------------------ | ------------------------------------------------- |
230
247
  | `listKnownNeurons` | `(certified?: boolean) => Promise<KnownNeuron[]>` |
231
248
 
232
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L192)
249
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L186)
233
250
 
234
251
  ##### :gear: getLastestRewardEvent
235
252
 
@@ -242,7 +259,7 @@ it's fetched using a query call.
242
259
  | ----------------------- | ----------------------------------------------- |
243
260
  | `getLastestRewardEvent` | `(certified?: boolean) => Promise<RewardEvent>` |
244
261
 
245
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L214)
262
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L208)
246
263
 
247
264
  ##### :gear: listProposals
248
265
 
@@ -261,7 +278,7 @@ Parameters:
261
278
  - `request`: the options to list the proposals (limit number of results, topics to search for, etc.)
262
279
  - `certified`: query or update calls
263
280
 
264
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L230)
281
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L224)
265
282
 
266
283
  ##### :gear: stakeNeuron
267
284
 
@@ -269,15 +286,7 @@ Parameters:
269
286
  | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
270
287
  | `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<...>` |
271
288
 
272
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L249)
273
-
274
- ##### :gear: stakeNeuronIcrc1
275
-
276
- | Method | Type |
277
- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
278
- | `stakeNeuronIcrc1` | `({ stake, principal, fromSubAccount, ledgerCanister, createdAt, fee, }: { stake: bigint; principal: Principal; fromSubAccount?: Uint8Array or undefined; ledgerCanister: LedgerCanister; createdAt?: bigint or undefined; fee?: bigint or undefined; }) => Promise<...>` |
279
-
280
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L315)
289
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L243)
281
290
 
282
291
  ##### :gear: increaseDissolveDelay
283
292
 
@@ -287,7 +296,7 @@ Increases dissolve delay of a neuron
287
296
  | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
288
297
  | `increaseDissolveDelay` | `({ neuronId, additionalDissolveDelaySeconds, }: { neuronId: bigint; additionalDissolveDelaySeconds: number; }) => Promise<void>` |
289
298
 
290
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L380)
299
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L304)
291
300
 
292
301
  ##### :gear: setDissolveDelay
293
302
 
@@ -298,7 +307,7 @@ The new date is now + dissolveDelaySeconds.
298
307
  | ------------------ | ------------------------------------------------------------------------------------------------------------- |
299
308
  | `setDissolveDelay` | `({ neuronId, dissolveDelaySeconds, }: { neuronId: bigint; dissolveDelaySeconds: number; }) => Promise<void>` |
300
309
 
301
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L406)
310
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L330)
302
311
 
303
312
  ##### :gear: startDissolving
304
313
 
@@ -308,7 +317,7 @@ Start dissolving process of a neuron
308
317
  | ----------------- | ------------------------------------- |
309
318
  | `startDissolving` | `(neuronId: bigint) => Promise<void>` |
310
319
 
311
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L429)
320
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L353)
312
321
 
313
322
  ##### :gear: stopDissolving
314
323
 
@@ -318,7 +327,7 @@ Stop dissolving process of a neuron
318
327
  | ---------------- | ------------------------------------- |
319
328
  | `stopDissolving` | `(neuronId: bigint) => Promise<void>` |
320
329
 
321
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L443)
330
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L367)
322
331
 
323
332
  ##### :gear: joinCommunityFund
324
333
 
@@ -328,7 +337,7 @@ Neuron joins the community fund
328
337
  | ------------------- | ------------------------------------- |
329
338
  | `joinCommunityFund` | `(neuronId: bigint) => Promise<void>` |
330
339
 
331
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L457)
340
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L381)
332
341
 
333
342
  ##### :gear: autoStakeMaturity
334
343
 
@@ -343,7 +352,7 @@ Parameters:
343
352
  - `neuronId`: The id of the neuron for which to request a change of the auto stake feature
344
353
  - `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
345
354
 
346
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L475)
355
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L399)
347
356
 
348
357
  ##### :gear: leaveCommunityFund
349
358
 
@@ -353,7 +362,7 @@ Neuron leaves the community fund
353
362
  | -------------------- | ------------------------------------- |
354
363
  | `leaveCommunityFund` | `(neuronId: bigint) => Promise<void>` |
355
364
 
356
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L490)
365
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L414)
357
366
 
358
367
  ##### :gear: setVisibility
359
368
 
@@ -363,7 +372,7 @@ Set visibility of a neuron
363
372
  | --------------- | ------------------------------------------------------------------- |
364
373
  | `setVisibility` | `(neuronId: bigint, visibility: NeuronVisibility) => Promise<void>` |
365
374
 
366
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L504)
375
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L428)
367
376
 
368
377
  ##### :gear: setNodeProviderAccount
369
378
 
@@ -374,7 +383,7 @@ Where the reward is paid to.
374
383
  | ------------------------ | ---------------------------------------------- |
375
384
  | `setNodeProviderAccount` | `(accountIdentifier: string) => Promise<void>` |
376
385
 
377
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L524)
386
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L448)
378
387
 
379
388
  ##### :gear: mergeNeurons
380
389
 
@@ -384,7 +393,7 @@ Merge two neurons
384
393
  | -------------- | --------------------------------------------------------------------------------- |
385
394
  | `mergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<void>` |
386
395
 
387
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L544)
396
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L468)
388
397
 
389
398
  ##### :gear: simulateMergeNeurons
390
399
 
@@ -394,7 +403,7 @@ Simulate merging two neurons
394
403
  | ---------------------- | --------------------------------------------------------------------------------------- |
395
404
  | `simulateMergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<NeuronInfo>` |
396
405
 
397
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L561)
406
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L485)
398
407
 
399
408
  ##### :gear: splitNeuron
400
409
 
@@ -404,7 +413,7 @@ Splits a neuron creating a new one
404
413
  | ------------- | ----------------------------------------------------------------------------------- |
405
414
  | `splitNeuron` | `({ neuronId, amount, }: { neuronId: bigint; amount: bigint; }) => Promise<bigint>` |
406
415
 
407
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L606)
416
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L530)
408
417
 
409
418
  ##### :gear: getProposal
410
419
 
@@ -417,7 +426,7 @@ it is fetched using a query call.
417
426
  | ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
418
427
  | `getProposal` | `({ proposalId, certified, }: { proposalId: bigint; certified?: boolean or undefined; }) => Promise<ProposalInfo or undefined>` |
419
428
 
420
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L646)
429
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L570)
421
430
 
422
431
  ##### :gear: makeProposal
423
432
 
@@ -427,7 +436,7 @@ Create new proposal
427
436
  | -------------- | ---------------------------------------------------------------- |
428
437
  | `makeProposal` | `(request: MakeProposalRequest) => Promise<bigint or undefined>` |
429
438
 
430
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L664)
439
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L588)
431
440
 
432
441
  ##### :gear: registerVote
433
442
 
@@ -437,7 +446,7 @@ Registers vote for a proposal from the neuron passed.
437
446
  | -------------- | ----------------------------------------------------------------------------------------------------------- |
438
447
  | `registerVote` | `({ neuronId, vote, proposalId, }: { neuronId: bigint; vote: Vote; proposalId: bigint; }) => Promise<void>` |
439
448
 
440
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L685)
449
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L609)
441
450
 
442
451
  ##### :gear: setFollowees
443
452
 
@@ -447,7 +456,7 @@ Edit neuron followees per topic
447
456
  | -------------- | ------------------------------------------------- |
448
457
  | `setFollowees` | `(followRequest: FollowRequest) => Promise<void>` |
449
458
 
450
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L707)
459
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L631)
451
460
 
452
461
  ##### :gear: disburse
453
462
 
@@ -457,7 +466,7 @@ Disburse neuron on Account
457
466
  | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
458
467
  | `disburse` | `({ neuronId, toAccountId, amount, }: { neuronId: bigint; toAccountId?: string or undefined; amount?: bigint or undefined; }) => Promise<void>` |
459
468
 
460
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L722)
469
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L646)
461
470
 
462
471
  ##### :gear: mergeMaturity
463
472
 
@@ -467,7 +476,7 @@ Merge Maturity of a neuron
467
476
  | --------------- | ------------------------------------------------------------------------------------------------------- |
468
477
  | `mergeMaturity` | `({ neuronId, percentageToMerge, }: { neuronId: bigint; percentageToMerge: number; }) => Promise<void>` |
469
478
 
470
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L758)
479
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L682)
471
480
 
472
481
  ##### :gear: stakeMaturity
473
482
 
@@ -482,7 +491,7 @@ Parameters:
482
491
  - `neuronId`: The id of the neuron for which to stake the maturity
483
492
  - `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
484
493
 
485
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L787)
494
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L711)
486
495
 
487
496
  ##### :gear: spawnNeuron
488
497
 
@@ -492,7 +501,7 @@ Merge Maturity of a neuron
492
501
  | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
493
502
  | `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
494
503
 
495
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L809)
504
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L733)
496
505
 
497
506
  ##### :gear: addHotkey
498
507
 
@@ -502,7 +511,7 @@ Add hotkey to neuron
502
511
  | ----------- | ------------------------------------------------------------------------------------------ |
503
512
  | `addHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
504
513
 
505
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L856)
514
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L780)
506
515
 
507
516
  ##### :gear: removeHotkey
508
517
 
@@ -512,7 +521,7 @@ Remove hotkey to neuron
512
521
  | -------------- | ------------------------------------------------------------------------------------------ |
513
522
  | `removeHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
514
523
 
515
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L876)
524
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L800)
516
525
 
517
526
  ##### :gear: claimOrRefreshNeuronFromAccount
518
527
 
@@ -522,7 +531,7 @@ Gets the NeuronID of a newly created neuron.
522
531
  | --------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
523
532
  | `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal or undefined; }) => Promise<bigint or undefined>` |
524
533
 
525
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L894)
534
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L818)
526
535
 
527
536
  ##### :gear: claimOrRefreshNeuron
528
537
 
@@ -533,7 +542,7 @@ Uses query call only.
533
542
  | ---------------------- | ------------------------------------------------------------------------ |
534
543
  | `claimOrRefreshNeuron` | `(request: ClaimOrRefreshNeuronRequest) => Promise<bigint or undefined>` |
535
544
 
536
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L925)
545
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L849)
537
546
 
538
547
  ##### :gear: getNeuron
539
548
 
@@ -543,7 +552,7 @@ Return the data of the neuron provided as id.
543
552
  | ----------- | ----------------------------------------------------------------------------------------------------------- |
544
553
  | `getNeuron` | `({ certified, neuronId, }: { certified: boolean; neuronId: bigint; }) => Promise<NeuronInfo or undefined>` |
545
554
 
546
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L976)
555
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L874)
547
556
 
548
557
  ### :factory: SnsWasmCanister
549
558
 
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit a6ef593 (2024-10-24 tags: release-2024-10-23_03-07-ubuntu20.04) 'rs/nns/gtc/canister/gtc.did' by import-candid
1
+ // Generated from IC repo commit cb3cb61 (2024-11-14 tags: release-2024-11-14_03-07-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;
@@ -561,6 +561,7 @@ export const idlFactory = ({ IDL }) => {
561
561
  'reject_cost_e8s' : IDL.Nat64,
562
562
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
563
563
  'latest_tally' : IDL.Opt(Tally),
564
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
564
565
  'sns_token_swap_lifecycle' : IDL.Opt(IDL.Int32),
565
566
  'decided_timestamp_seconds' : IDL.Nat64,
566
567
  'proposal' : IDL.Opt(Proposal),
@@ -599,6 +600,7 @@ export const idlFactory = ({ IDL }) => {
599
600
  'staked_maturity_e8s_equivalent' : IDL.Opt(IDL.Nat64),
600
601
  'controller' : IDL.Opt(IDL.Principal),
601
602
  'recent_ballots' : IDL.Vec(BallotInfo),
603
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
602
604
  'kyc_verified' : IDL.Bool,
603
605
  'neuron_type' : IDL.Opt(IDL.Int32),
604
606
  'not_for_profit' : IDL.Bool,
@@ -666,6 +668,7 @@ export const idlFactory = ({ IDL }) => {
666
668
  const NeuronInfo = IDL.Record({
667
669
  'dissolve_delay_seconds' : IDL.Nat64,
668
670
  'recent_ballots' : IDL.Vec(BallotInfo),
671
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
669
672
  'neuron_type' : IDL.Opt(IDL.Int32),
670
673
  'created_timestamp_seconds' : IDL.Nat64,
671
674
  'state' : IDL.Int32,
@@ -710,6 +713,7 @@ export const idlFactory = ({ IDL }) => {
710
713
  'reject_cost_e8s' : IDL.Nat64,
711
714
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
712
715
  'latest_tally' : IDL.Opt(Tally),
716
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
713
717
  'reward_status' : IDL.Int32,
714
718
  'decided_timestamp_seconds' : IDL.Nat64,
715
719
  'proposal' : IDL.Opt(Proposal),
@@ -1526,6 +1530,7 @@ export const init = ({ IDL }) => {
1526
1530
  'reject_cost_e8s' : IDL.Nat64,
1527
1531
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
1528
1532
  'latest_tally' : IDL.Opt(Tally),
1533
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
1529
1534
  'sns_token_swap_lifecycle' : IDL.Opt(IDL.Int32),
1530
1535
  'decided_timestamp_seconds' : IDL.Nat64,
1531
1536
  'proposal' : IDL.Opt(Proposal),
@@ -1564,6 +1569,7 @@ export const init = ({ IDL }) => {
1564
1569
  'staked_maturity_e8s_equivalent' : IDL.Opt(IDL.Nat64),
1565
1570
  'controller' : IDL.Opt(IDL.Principal),
1566
1571
  'recent_ballots' : IDL.Vec(BallotInfo),
1572
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
1567
1573
  'kyc_verified' : IDL.Bool,
1568
1574
  'neuron_type' : IDL.Opt(IDL.Int32),
1569
1575
  'not_for_profit' : IDL.Bool,
@@ -471,6 +471,7 @@ export interface Neuron {
471
471
  staked_maturity_e8s_equivalent: [] | [bigint];
472
472
  controller: [] | [Principal];
473
473
  recent_ballots: Array<BallotInfo>;
474
+ voting_power_refreshed_timestamp_seconds: [] | [bigint];
474
475
  kyc_verified: boolean;
475
476
  neuron_type: [] | [number];
476
477
  not_for_profit: boolean;
@@ -518,6 +519,7 @@ export interface NeuronInFlightCommand {
518
519
  export interface NeuronInfo {
519
520
  dissolve_delay_seconds: bigint;
520
521
  recent_ballots: Array<BallotInfo>;
522
+ voting_power_refreshed_timestamp_seconds: [] | [bigint];
521
523
  neuron_type: [] | [number];
522
524
  created_timestamp_seconds: bigint;
523
525
  state: number;
@@ -682,6 +684,7 @@ export interface ProposalData {
682
684
  reject_cost_e8s: bigint;
683
685
  derived_proposal_information: [] | [DerivedProposalInformation];
684
686
  latest_tally: [] | [Tally];
687
+ total_potential_voting_power: [] | [bigint];
685
688
  sns_token_swap_lifecycle: [] | [number];
686
689
  decided_timestamp_seconds: bigint;
687
690
  proposal: [] | [Proposal];
@@ -706,6 +709,7 @@ export interface ProposalInfo {
706
709
  reject_cost_e8s: bigint;
707
710
  derived_proposal_information: [] | [DerivedProposalInformation];
708
711
  latest_tally: [] | [Tally];
712
+ total_potential_voting_power: [] | [bigint];
709
713
  reward_status: number;
710
714
  decided_timestamp_seconds: bigint;
711
715
  proposal: [] | [Proposal];
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit a6ef593 (2024-10-24 tags: release-2024-10-23_03-07-ubuntu20.04) 'rs/nns/governance/canister/governance.did' by import-candid
1
+ // Generated from IC repo commit cb3cb61 (2024-11-14 tags: release-2024-11-14_03-07-base) 'rs/nns/governance/canister/governance.did' by import-candid
2
2
  type AccountIdentifier = record {
3
3
  hash : blob;
4
4
  };
@@ -578,6 +578,7 @@ type Neuron = record {
578
578
  transfer : opt NeuronStakeTransfer;
579
579
  known_neuron_data : opt KnownNeuronData;
580
580
  spawn_at_timestamp_seconds : opt nat64;
581
+ voting_power_refreshed_timestamp_seconds : opt nat64;
581
582
  };
582
583
 
583
584
  type NeuronBasketConstructionParameters = record {
@@ -629,6 +630,7 @@ type NeuronInfo = record {
629
630
  known_neuron_data : opt KnownNeuronData;
630
631
  voting_power : nat64;
631
632
  age_seconds : nat64;
633
+ voting_power_refreshed_timestamp_seconds : opt nat64;
632
634
  };
633
635
 
634
636
  type NeuronStakeTransfer = record {
@@ -810,6 +812,7 @@ type ProposalData = record {
810
812
  wait_for_quiet_state : opt WaitForQuietState;
811
813
  executed_timestamp_seconds : nat64;
812
814
  original_total_community_fund_maturity_e8s_equivalent : opt nat64;
815
+ total_potential_voting_power : opt nat64;
813
816
  };
814
817
 
815
818
  type ProposalInfo = record {
@@ -830,6 +833,7 @@ type ProposalInfo = record {
830
833
  proposal : opt Proposal;
831
834
  proposer : opt NeuronId;
832
835
  executed_timestamp_seconds : nat64;
836
+ total_potential_voting_power : opt nat64;
833
837
  };
834
838
 
835
839
  type RegisterVote = record {
@@ -561,6 +561,7 @@ export const idlFactory = ({ IDL }) => {
561
561
  'reject_cost_e8s' : IDL.Nat64,
562
562
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
563
563
  'latest_tally' : IDL.Opt(Tally),
564
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
564
565
  'sns_token_swap_lifecycle' : IDL.Opt(IDL.Int32),
565
566
  'decided_timestamp_seconds' : IDL.Nat64,
566
567
  'proposal' : IDL.Opt(Proposal),
@@ -599,6 +600,7 @@ export const idlFactory = ({ IDL }) => {
599
600
  'staked_maturity_e8s_equivalent' : IDL.Opt(IDL.Nat64),
600
601
  'controller' : IDL.Opt(IDL.Principal),
601
602
  'recent_ballots' : IDL.Vec(BallotInfo),
603
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
602
604
  'kyc_verified' : IDL.Bool,
603
605
  'neuron_type' : IDL.Opt(IDL.Int32),
604
606
  'not_for_profit' : IDL.Bool,
@@ -666,6 +668,7 @@ export const idlFactory = ({ IDL }) => {
666
668
  const NeuronInfo = IDL.Record({
667
669
  'dissolve_delay_seconds' : IDL.Nat64,
668
670
  'recent_ballots' : IDL.Vec(BallotInfo),
671
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
669
672
  'neuron_type' : IDL.Opt(IDL.Int32),
670
673
  'created_timestamp_seconds' : IDL.Nat64,
671
674
  'state' : IDL.Int32,
@@ -710,6 +713,7 @@ export const idlFactory = ({ IDL }) => {
710
713
  'reject_cost_e8s' : IDL.Nat64,
711
714
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
712
715
  'latest_tally' : IDL.Opt(Tally),
716
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
713
717
  'reward_status' : IDL.Int32,
714
718
  'decided_timestamp_seconds' : IDL.Nat64,
715
719
  'proposal' : IDL.Opt(Proposal),
@@ -1542,6 +1546,7 @@ export const init = ({ IDL }) => {
1542
1546
  'reject_cost_e8s' : IDL.Nat64,
1543
1547
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
1544
1548
  'latest_tally' : IDL.Opt(Tally),
1549
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
1545
1550
  'sns_token_swap_lifecycle' : IDL.Opt(IDL.Int32),
1546
1551
  'decided_timestamp_seconds' : IDL.Nat64,
1547
1552
  'proposal' : IDL.Opt(Proposal),
@@ -1580,6 +1585,7 @@ export const init = ({ IDL }) => {
1580
1585
  'staked_maturity_e8s_equivalent' : IDL.Opt(IDL.Nat64),
1581
1586
  'controller' : IDL.Opt(IDL.Principal),
1582
1587
  'recent_ballots' : IDL.Vec(BallotInfo),
1588
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
1583
1589
  'kyc_verified' : IDL.Bool,
1584
1590
  'neuron_type' : IDL.Opt(IDL.Int32),
1585
1591
  'not_for_profit' : IDL.Bool,
@@ -561,6 +561,7 @@ export const idlFactory = ({ IDL }) => {
561
561
  'reject_cost_e8s' : IDL.Nat64,
562
562
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
563
563
  'latest_tally' : IDL.Opt(Tally),
564
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
564
565
  'sns_token_swap_lifecycle' : IDL.Opt(IDL.Int32),
565
566
  'decided_timestamp_seconds' : IDL.Nat64,
566
567
  'proposal' : IDL.Opt(Proposal),
@@ -599,6 +600,7 @@ export const idlFactory = ({ IDL }) => {
599
600
  'staked_maturity_e8s_equivalent' : IDL.Opt(IDL.Nat64),
600
601
  'controller' : IDL.Opt(IDL.Principal),
601
602
  'recent_ballots' : IDL.Vec(BallotInfo),
603
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
602
604
  'kyc_verified' : IDL.Bool,
603
605
  'neuron_type' : IDL.Opt(IDL.Int32),
604
606
  'not_for_profit' : IDL.Bool,
@@ -666,6 +668,7 @@ export const idlFactory = ({ IDL }) => {
666
668
  const NeuronInfo = IDL.Record({
667
669
  'dissolve_delay_seconds' : IDL.Nat64,
668
670
  'recent_ballots' : IDL.Vec(BallotInfo),
671
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
669
672
  'neuron_type' : IDL.Opt(IDL.Int32),
670
673
  'created_timestamp_seconds' : IDL.Nat64,
671
674
  'state' : IDL.Int32,
@@ -710,6 +713,7 @@ export const idlFactory = ({ IDL }) => {
710
713
  'reject_cost_e8s' : IDL.Nat64,
711
714
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
712
715
  'latest_tally' : IDL.Opt(Tally),
716
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
713
717
  'reward_status' : IDL.Int32,
714
718
  'decided_timestamp_seconds' : IDL.Nat64,
715
719
  'proposal' : IDL.Opt(Proposal),
@@ -1527,6 +1531,7 @@ export const init = ({ IDL }) => {
1527
1531
  'reject_cost_e8s' : IDL.Nat64,
1528
1532
  'derived_proposal_information' : IDL.Opt(DerivedProposalInformation),
1529
1533
  'latest_tally' : IDL.Opt(Tally),
1534
+ 'total_potential_voting_power' : IDL.Opt(IDL.Nat64),
1530
1535
  'sns_token_swap_lifecycle' : IDL.Opt(IDL.Int32),
1531
1536
  'decided_timestamp_seconds' : IDL.Nat64,
1532
1537
  'proposal' : IDL.Opt(Proposal),
@@ -1565,6 +1570,7 @@ export const init = ({ IDL }) => {
1565
1570
  'staked_maturity_e8s_equivalent' : IDL.Opt(IDL.Nat64),
1566
1571
  'controller' : IDL.Opt(IDL.Principal),
1567
1572
  'recent_ballots' : IDL.Vec(BallotInfo),
1573
+ 'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
1568
1574
  'kyc_verified' : IDL.Bool,
1569
1575
  'neuron_type' : IDL.Opt(IDL.Int32),
1570
1576
  'not_for_profit' : IDL.Bool,
@@ -471,6 +471,7 @@ export interface Neuron {
471
471
  staked_maturity_e8s_equivalent: [] | [bigint];
472
472
  controller: [] | [Principal];
473
473
  recent_ballots: Array<BallotInfo>;
474
+ voting_power_refreshed_timestamp_seconds: [] | [bigint];
474
475
  kyc_verified: boolean;
475
476
  neuron_type: [] | [number];
476
477
  not_for_profit: boolean;
@@ -518,6 +519,7 @@ export interface NeuronInFlightCommand {
518
519
  export interface NeuronInfo {
519
520
  dissolve_delay_seconds: bigint;
520
521
  recent_ballots: Array<BallotInfo>;
522
+ voting_power_refreshed_timestamp_seconds: [] | [bigint];
521
523
  neuron_type: [] | [number];
522
524
  created_timestamp_seconds: bigint;
523
525
  state: number;
@@ -682,6 +684,7 @@ export interface ProposalData {
682
684
  reject_cost_e8s: bigint;
683
685
  derived_proposal_information: [] | [DerivedProposalInformation];
684
686
  latest_tally: [] | [Tally];
687
+ total_potential_voting_power: [] | [bigint];
685
688
  sns_token_swap_lifecycle: [] | [number];
686
689
  decided_timestamp_seconds: bigint;
687
690
  proposal: [] | [Proposal];
@@ -706,6 +709,7 @@ export interface ProposalInfo {
706
709
  reject_cost_e8s: bigint;
707
710
  derived_proposal_information: [] | [DerivedProposalInformation];
708
711
  latest_tally: [] | [Tally];
712
+ total_potential_voting_power: [] | [bigint];
709
713
  reward_status: number;
710
714
  decided_timestamp_seconds: bigint;
711
715
  proposal: [] | [Proposal];
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit a6ef593 (2024-10-24 tags: release-2024-10-23_03-07-ubuntu20.04) 'rs/nns/governance/canister/governance_test.did' by import-candid
1
+ // Generated from IC repo commit cb3cb61 (2024-11-14 tags: release-2024-11-14_03-07-base) 'rs/nns/governance/canister/governance_test.did' by import-candid
2
2
  type AccountIdentifier = record {
3
3
  hash : blob;
4
4
  };
@@ -580,6 +580,7 @@ type Neuron = record {
580
580
  transfer : opt NeuronStakeTransfer;
581
581
  known_neuron_data : opt KnownNeuronData;
582
582
  spawn_at_timestamp_seconds : opt nat64;
583
+ voting_power_refreshed_timestamp_seconds : opt nat64;
583
584
  };
584
585
 
585
586
  type NeuronBasketConstructionParameters = record {
@@ -631,6 +632,7 @@ type NeuronInfo = record {
631
632
  known_neuron_data : opt KnownNeuronData;
632
633
  voting_power : nat64;
633
634
  age_seconds : nat64;
635
+ voting_power_refreshed_timestamp_seconds : opt nat64;
634
636
  };
635
637
 
636
638
  type NeuronStakeTransfer = record {
@@ -812,6 +814,7 @@ type ProposalData = record {
812
814
  wait_for_quiet_state : opt WaitForQuietState;
813
815
  executed_timestamp_seconds : nat64;
814
816
  original_total_community_fund_maturity_e8s_equivalent : opt nat64;
817
+ total_potential_voting_power : opt nat64;
815
818
  };
816
819
 
817
820
  type ProposalInfo = record {
@@ -832,6 +835,7 @@ type ProposalInfo = record {
832
835
  proposal : opt Proposal;
833
836
  proposer : opt NeuronId;
834
837
  executed_timestamp_seconds : nat64;
838
+ total_potential_voting_power : opt nat64;
835
839
  };
836
840
 
837
841
  type RegisterVote = record {