@dfinity/nns 8.2.2 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -37
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +5 -0
- package/dist/candid/governance.d.ts +7 -0
- package/dist/candid/governance.did +57 -6
- package/dist/candid/governance.idl.js +5 -0
- package/dist/candid/governance_test.certified.idl.js +5 -0
- package/dist/candid/governance_test.d.ts +7 -0
- package/dist/candid/governance_test.did +9 -1
- package/dist/candid/governance_test.idl.js +5 -0
- package/dist/candid/sns_wasm.did +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +3 -3
- package/dist/esm/chunk-SHZMGWWU.js +19 -0
- package/dist/esm/chunk-SHZMGWWU.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 +5 -2
- package/dist/types/governance.canister.d.ts +8 -2
- package/package.json +3 -3
- package/dist/esm/chunk-UQIL2AK2.js +0 -19
- package/dist/esm/chunk-UQIL2AK2.js.map +0 -7
package/README.md
CHANGED
|
@@ -173,7 +173,7 @@ Parameters:
|
|
|
173
173
|
|
|
174
174
|
### :factory: GovernanceCanister
|
|
175
175
|
|
|
176
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
176
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L92)
|
|
177
177
|
|
|
178
178
|
#### Methods
|
|
179
179
|
|
|
@@ -217,7 +217,7 @@ Parameters:
|
|
|
217
217
|
| -------- | ------------------------------------------------------------- |
|
|
218
218
|
| `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
|
|
219
219
|
|
|
220
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
220
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L107)
|
|
221
221
|
|
|
222
222
|
##### :gear: listNeurons
|
|
223
223
|
|
|
@@ -230,11 +230,14 @@ it is fetched using a query call.
|
|
|
230
230
|
|
|
231
231
|
The backend treats `includeEmptyNeurons` as false if absent.
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
| `listNeurons` | `({ certified, neuronIds, includeEmptyNeurons, includePublicNeurons, }: { certified: boolean; neuronIds?: bigint[] or undefined; includeEmptyNeurons?: boolean or undefined; includePublicNeurons?: boolean or undefined; }) => Promise<NeuronInfo[]>` |
|
|
233
|
+
The response from the canister might be paginated. In this case, all pages will be fetched in parallel and
|
|
234
|
+
combined into a single return value.
|
|
236
235
|
|
|
237
|
-
|
|
236
|
+
| Method | Type |
|
|
237
|
+
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
238
|
+
| `listNeurons` | `({ certified, neuronIds, includeEmptyNeurons, includePublicNeurons, neuronSubaccounts, }: { certified: boolean; neuronIds?: bigint[] or undefined; includeEmptyNeurons?: boolean or undefined; includePublicNeurons?: boolean or undefined; neuronSubaccounts?: NeuronSubaccount[] or undefined; }) => Promise<...>` |
|
|
239
|
+
|
|
240
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L150)
|
|
238
241
|
|
|
239
242
|
##### :gear: listKnownNeurons
|
|
240
243
|
|
|
@@ -248,7 +251,7 @@ it is fetched using a query call.
|
|
|
248
251
|
| ------------------ | ------------------------------------------------- |
|
|
249
252
|
| `listKnownNeurons` | `(certified?: boolean) => Promise<KnownNeuron[]>` |
|
|
250
253
|
|
|
251
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
254
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L278)
|
|
252
255
|
|
|
253
256
|
##### :gear: getLastestRewardEvent
|
|
254
257
|
|
|
@@ -261,7 +264,7 @@ it's fetched using a query call.
|
|
|
261
264
|
| ----------------------- | ----------------------------------------------- |
|
|
262
265
|
| `getLastestRewardEvent` | `(certified?: boolean) => Promise<RewardEvent>` |
|
|
263
266
|
|
|
264
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
267
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L300)
|
|
265
268
|
|
|
266
269
|
##### :gear: listProposals
|
|
267
270
|
|
|
@@ -280,7 +283,7 @@ Parameters:
|
|
|
280
283
|
- `request`: the options to list the proposals (limit number of results, topics to search for, etc.)
|
|
281
284
|
- `certified`: query or update calls
|
|
282
285
|
|
|
283
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
286
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L316)
|
|
284
287
|
|
|
285
288
|
##### :gear: stakeNeuron
|
|
286
289
|
|
|
@@ -288,7 +291,7 @@ Parameters:
|
|
|
288
291
|
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
289
292
|
| `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<...>` |
|
|
290
293
|
|
|
291
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
294
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L335)
|
|
292
295
|
|
|
293
296
|
##### :gear: increaseDissolveDelay
|
|
294
297
|
|
|
@@ -298,7 +301,7 @@ Increases dissolve delay of a neuron
|
|
|
298
301
|
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
299
302
|
| `increaseDissolveDelay` | `({ neuronId, additionalDissolveDelaySeconds, }: { neuronId: bigint; additionalDissolveDelaySeconds: number; }) => Promise<void>` |
|
|
300
303
|
|
|
301
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
304
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L396)
|
|
302
305
|
|
|
303
306
|
##### :gear: setDissolveDelay
|
|
304
307
|
|
|
@@ -309,7 +312,7 @@ The new date is now + dissolveDelaySeconds.
|
|
|
309
312
|
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
310
313
|
| `setDissolveDelay` | `({ neuronId, dissolveDelaySeconds, }: { neuronId: bigint; dissolveDelaySeconds: number; }) => Promise<void>` |
|
|
311
314
|
|
|
312
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
315
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L422)
|
|
313
316
|
|
|
314
317
|
##### :gear: startDissolving
|
|
315
318
|
|
|
@@ -319,7 +322,7 @@ Start dissolving process of a neuron
|
|
|
319
322
|
| ----------------- | ------------------------------------- |
|
|
320
323
|
| `startDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
321
324
|
|
|
322
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
325
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L445)
|
|
323
326
|
|
|
324
327
|
##### :gear: stopDissolving
|
|
325
328
|
|
|
@@ -329,7 +332,7 @@ Stop dissolving process of a neuron
|
|
|
329
332
|
| ---------------- | ------------------------------------- |
|
|
330
333
|
| `stopDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
331
334
|
|
|
332
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
335
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L459)
|
|
333
336
|
|
|
334
337
|
##### :gear: joinCommunityFund
|
|
335
338
|
|
|
@@ -339,7 +342,7 @@ Neuron joins the community fund
|
|
|
339
342
|
| ------------------- | ------------------------------------- |
|
|
340
343
|
| `joinCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
341
344
|
|
|
342
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
345
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L473)
|
|
343
346
|
|
|
344
347
|
##### :gear: autoStakeMaturity
|
|
345
348
|
|
|
@@ -354,7 +357,7 @@ Parameters:
|
|
|
354
357
|
- `neuronId`: The id of the neuron for which to request a change of the auto stake feature
|
|
355
358
|
- `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
|
|
356
359
|
|
|
357
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
360
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L491)
|
|
358
361
|
|
|
359
362
|
##### :gear: leaveCommunityFund
|
|
360
363
|
|
|
@@ -364,7 +367,7 @@ Neuron leaves the community fund
|
|
|
364
367
|
| -------------------- | ------------------------------------- |
|
|
365
368
|
| `leaveCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
366
369
|
|
|
367
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
370
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L506)
|
|
368
371
|
|
|
369
372
|
##### :gear: setVisibility
|
|
370
373
|
|
|
@@ -374,7 +377,7 @@ Set visibility of a neuron
|
|
|
374
377
|
| --------------- | ------------------------------------------------------------------- |
|
|
375
378
|
| `setVisibility` | `(neuronId: bigint, visibility: NeuronVisibility) => Promise<void>` |
|
|
376
379
|
|
|
377
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
380
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L520)
|
|
378
381
|
|
|
379
382
|
##### :gear: setNodeProviderAccount
|
|
380
383
|
|
|
@@ -385,7 +388,7 @@ Where the reward is paid to.
|
|
|
385
388
|
| ------------------------ | ---------------------------------------------- |
|
|
386
389
|
| `setNodeProviderAccount` | `(accountIdentifier: string) => Promise<void>` |
|
|
387
390
|
|
|
388
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
391
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L540)
|
|
389
392
|
|
|
390
393
|
##### :gear: mergeNeurons
|
|
391
394
|
|
|
@@ -395,7 +398,7 @@ Merge two neurons
|
|
|
395
398
|
| -------------- | --------------------------------------------------------------------------------- |
|
|
396
399
|
| `mergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<void>` |
|
|
397
400
|
|
|
398
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
401
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L560)
|
|
399
402
|
|
|
400
403
|
##### :gear: simulateMergeNeurons
|
|
401
404
|
|
|
@@ -405,7 +408,7 @@ Simulate merging two neurons
|
|
|
405
408
|
| ---------------------- | --------------------------------------------------------------------------------------- |
|
|
406
409
|
| `simulateMergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<NeuronInfo>` |
|
|
407
410
|
|
|
408
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
411
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L577)
|
|
409
412
|
|
|
410
413
|
##### :gear: splitNeuron
|
|
411
414
|
|
|
@@ -415,7 +418,7 @@ Splits a neuron creating a new one
|
|
|
415
418
|
| ------------- | ----------------------------------------------------------------------------------- |
|
|
416
419
|
| `splitNeuron` | `({ neuronId, amount, }: { neuronId: bigint; amount: bigint; }) => Promise<bigint>` |
|
|
417
420
|
|
|
418
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
421
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L622)
|
|
419
422
|
|
|
420
423
|
##### :gear: getProposal
|
|
421
424
|
|
|
@@ -428,7 +431,7 @@ it is fetched using a query call.
|
|
|
428
431
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
429
432
|
| `getProposal` | `({ proposalId, certified, }: { proposalId: bigint; certified?: boolean or undefined; }) => Promise<ProposalInfo or undefined>` |
|
|
430
433
|
|
|
431
|
-
[: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#L662)
|
|
432
435
|
|
|
433
436
|
##### :gear: makeProposal
|
|
434
437
|
|
|
@@ -438,7 +441,7 @@ Create new proposal
|
|
|
438
441
|
| -------------- | ---------------------------------------------------------------- |
|
|
439
442
|
| `makeProposal` | `(request: MakeProposalRequest) => Promise<bigint or undefined>` |
|
|
440
443
|
|
|
441
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
444
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L680)
|
|
442
445
|
|
|
443
446
|
##### :gear: registerVote
|
|
444
447
|
|
|
@@ -448,7 +451,7 @@ Registers vote for a proposal from the neuron passed.
|
|
|
448
451
|
| -------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
449
452
|
| `registerVote` | `({ neuronId, vote, proposalId, }: { neuronId: bigint; vote: Vote; proposalId: bigint; }) => Promise<void>` |
|
|
450
453
|
|
|
451
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
454
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L701)
|
|
452
455
|
|
|
453
456
|
##### :gear: setFollowees
|
|
454
457
|
|
|
@@ -458,7 +461,7 @@ Edit neuron followees per topic
|
|
|
458
461
|
| -------------- | ------------------------------------------------- |
|
|
459
462
|
| `setFollowees` | `(followRequest: FollowRequest) => Promise<void>` |
|
|
460
463
|
|
|
461
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
464
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L723)
|
|
462
465
|
|
|
463
466
|
##### :gear: disburse
|
|
464
467
|
|
|
@@ -468,7 +471,7 @@ Disburse neuron on Account
|
|
|
468
471
|
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
469
472
|
| `disburse` | `({ neuronId, toAccountId, amount, }: { neuronId: bigint; toAccountId?: string or undefined; amount?: bigint or undefined; }) => Promise<void>` |
|
|
470
473
|
|
|
471
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
474
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L738)
|
|
472
475
|
|
|
473
476
|
##### :gear: refreshVotingPower
|
|
474
477
|
|
|
@@ -480,7 +483,7 @@ parameter of the neuron to the current time).
|
|
|
480
483
|
| -------------------- | --------------------------------------------------------- |
|
|
481
484
|
| `refreshVotingPower` | `({ neuronId, }: { neuronId: bigint; }) => Promise<void>` |
|
|
482
485
|
|
|
483
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
486
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L774)
|
|
484
487
|
|
|
485
488
|
##### :gear: mergeMaturity
|
|
486
489
|
|
|
@@ -490,7 +493,7 @@ Merge Maturity of a neuron
|
|
|
490
493
|
| --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
491
494
|
| `mergeMaturity` | `({ neuronId, percentageToMerge, }: { neuronId: bigint; percentageToMerge: number; }) => Promise<void>` |
|
|
492
495
|
|
|
493
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
496
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L796)
|
|
494
497
|
|
|
495
498
|
##### :gear: stakeMaturity
|
|
496
499
|
|
|
@@ -505,7 +508,7 @@ Parameters:
|
|
|
505
508
|
- `neuronId`: The id of the neuron for which to stake the maturity
|
|
506
509
|
- `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
|
|
507
510
|
|
|
508
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
511
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L825)
|
|
509
512
|
|
|
510
513
|
##### :gear: spawnNeuron
|
|
511
514
|
|
|
@@ -515,7 +518,7 @@ Merge Maturity of a neuron
|
|
|
515
518
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
516
519
|
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
|
|
517
520
|
|
|
518
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
521
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L847)
|
|
519
522
|
|
|
520
523
|
##### :gear: addHotkey
|
|
521
524
|
|
|
@@ -525,7 +528,7 @@ Add hotkey to neuron
|
|
|
525
528
|
| ----------- | ------------------------------------------------------------------------------------------ |
|
|
526
529
|
| `addHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
527
530
|
|
|
528
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
531
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L894)
|
|
529
532
|
|
|
530
533
|
##### :gear: removeHotkey
|
|
531
534
|
|
|
@@ -535,7 +538,7 @@ Remove hotkey to neuron
|
|
|
535
538
|
| -------------- | ------------------------------------------------------------------------------------------ |
|
|
536
539
|
| `removeHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
537
540
|
|
|
538
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
541
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L914)
|
|
539
542
|
|
|
540
543
|
##### :gear: claimOrRefreshNeuronFromAccount
|
|
541
544
|
|
|
@@ -545,7 +548,7 @@ Gets the NeuronID of a newly created neuron.
|
|
|
545
548
|
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
546
549
|
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal or undefined; }) => Promise<bigint or undefined>` |
|
|
547
550
|
|
|
548
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
551
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L932)
|
|
549
552
|
|
|
550
553
|
##### :gear: claimOrRefreshNeuron
|
|
551
554
|
|
|
@@ -556,7 +559,7 @@ Uses query call only.
|
|
|
556
559
|
| ---------------------- | ------------------------------------------------------------------------ |
|
|
557
560
|
| `claimOrRefreshNeuron` | `(request: ClaimOrRefreshNeuronRequest) => Promise<bigint or undefined>` |
|
|
558
561
|
|
|
559
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
562
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L963)
|
|
560
563
|
|
|
561
564
|
##### :gear: getNeuron
|
|
562
565
|
|
|
@@ -566,7 +569,7 @@ Return the data of the neuron provided as id.
|
|
|
566
569
|
| ----------- | ----------------------------------------------------------------------------------------------------------- |
|
|
567
570
|
| `getNeuron` | `({ certified, neuronId, }: { certified: boolean; neuronId: bigint; }) => Promise<NeuronInfo or undefined>` |
|
|
568
571
|
|
|
569
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
572
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L988)
|
|
570
573
|
|
|
571
574
|
##### :gear: getNetworkEconomicsParameters
|
|
572
575
|
|
|
@@ -576,7 +579,7 @@ Return the [Network Economics](https://github.com/dfinity/ic/blob/d90e934eb440c7
|
|
|
576
579
|
| ------------------------------- | ------------------------------------------------------------------------ |
|
|
577
580
|
| `getNetworkEconomicsParameters` | `({ certified, }: { certified: boolean; }) => Promise<NetworkEconomics>` |
|
|
578
581
|
|
|
579
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
582
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L1009)
|
|
580
583
|
|
|
581
584
|
### :factory: SnsWasmCanister
|
|
582
585
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 14c8f44 (2025-02-07 tags: release-2025-02-06_12-26-revert-hashes-in-blocks) '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;
|
|
@@ -745,15 +745,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
745
745
|
const ListKnownNeuronsResponse = IDL.Record({
|
|
746
746
|
'known_neurons' : IDL.Vec(KnownNeuron),
|
|
747
747
|
});
|
|
748
|
+
const NeuronSubaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
748
749
|
const ListNeurons = IDL.Record({
|
|
750
|
+
'page_size' : IDL.Opt(IDL.Nat64),
|
|
749
751
|
'include_public_neurons_in_full_neurons' : IDL.Opt(IDL.Bool),
|
|
750
752
|
'neuron_ids' : IDL.Vec(IDL.Nat64),
|
|
753
|
+
'page_number' : IDL.Opt(IDL.Nat64),
|
|
751
754
|
'include_empty_neurons_readable_by_caller' : IDL.Opt(IDL.Bool),
|
|
755
|
+
'neuron_subaccounts' : IDL.Opt(IDL.Vec(NeuronSubaccount)),
|
|
752
756
|
'include_neurons_readable_by_caller' : IDL.Bool,
|
|
753
757
|
});
|
|
754
758
|
const ListNeuronsResponse = IDL.Record({
|
|
755
759
|
'neuron_infos' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInfo)),
|
|
756
760
|
'full_neurons' : IDL.Vec(Neuron),
|
|
761
|
+
'total_pages_available' : IDL.Opt(IDL.Nat64),
|
|
757
762
|
});
|
|
758
763
|
const DateRangeFilter = IDL.Record({
|
|
759
764
|
'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
@@ -352,14 +352,18 @@ export interface ListKnownNeuronsResponse {
|
|
|
352
352
|
known_neurons: Array<KnownNeuron>;
|
|
353
353
|
}
|
|
354
354
|
export interface ListNeurons {
|
|
355
|
+
page_size: [] | [bigint];
|
|
355
356
|
include_public_neurons_in_full_neurons: [] | [boolean];
|
|
356
357
|
neuron_ids: BigUint64Array | bigint[];
|
|
358
|
+
page_number: [] | [bigint];
|
|
357
359
|
include_empty_neurons_readable_by_caller: [] | [boolean];
|
|
360
|
+
neuron_subaccounts: [] | [Array<NeuronSubaccount>];
|
|
358
361
|
include_neurons_readable_by_caller: boolean;
|
|
359
362
|
}
|
|
360
363
|
export interface ListNeuronsResponse {
|
|
361
364
|
neuron_infos: Array<[bigint, NeuronInfo]>;
|
|
362
365
|
full_neurons: Array<Neuron>;
|
|
366
|
+
total_pages_available: [] | [bigint];
|
|
363
367
|
}
|
|
364
368
|
export interface ListNodeProviderRewardsRequest {
|
|
365
369
|
date_filter: [] | [DateRangeFilter];
|
|
@@ -551,6 +555,9 @@ export interface NeuronStakeTransfer {
|
|
|
551
555
|
transfer_timestamp: bigint;
|
|
552
556
|
block_height: bigint;
|
|
553
557
|
}
|
|
558
|
+
export interface NeuronSubaccount {
|
|
559
|
+
subaccount: Uint8Array | number[];
|
|
560
|
+
}
|
|
554
561
|
export interface NeuronSubsetMetrics {
|
|
555
562
|
total_maturity_e8s_equivalent: [] | [bigint];
|
|
556
563
|
maturity_e8s_equivalent_buckets: Array<[bigint, bigint]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 14c8f44 (2025-02-07 tags: release-2025-02-06_12-26-revert-hashes-in-blocks) 'rs/nns/governance/canister/governance.did' by import-candid
|
|
2
2
|
type AccountIdentifier = record {
|
|
3
3
|
hash : blob;
|
|
4
4
|
};
|
|
@@ -435,16 +435,43 @@ type ListKnownNeuronsResponse = record {
|
|
|
435
435
|
known_neurons : vec KnownNeuron;
|
|
436
436
|
};
|
|
437
437
|
|
|
438
|
+
// Parameters of the list_neurons method.
|
|
438
439
|
type ListNeurons = record {
|
|
439
|
-
|
|
440
|
+
// These fields select neurons to be in the result set.
|
|
440
441
|
neuron_ids : vec nat64;
|
|
441
|
-
include_empty_neurons_readable_by_caller : opt bool;
|
|
442
442
|
include_neurons_readable_by_caller : bool;
|
|
443
|
+
|
|
444
|
+
// Only has an effect when include_neurons_readable_by_caller.
|
|
445
|
+
include_empty_neurons_readable_by_caller : opt bool;
|
|
446
|
+
|
|
447
|
+
// When a public neuron is a member of the result set, include it in the
|
|
448
|
+
// full_neurons field (of ListNeuronsResponse). This does not affect which
|
|
449
|
+
// neurons are part of the result set.
|
|
450
|
+
include_public_neurons_in_full_neurons : opt bool;
|
|
451
|
+
|
|
452
|
+
page_number: opt nat64;
|
|
453
|
+
page_size: opt nat64;
|
|
454
|
+
neuron_subaccounts: opt vec NeuronSubaccount;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
type NeuronSubaccount = record {
|
|
458
|
+
subaccount : blob;
|
|
443
459
|
};
|
|
444
460
|
|
|
461
|
+
// Output of the list_neurons method.
|
|
445
462
|
type ListNeuronsResponse = record {
|
|
463
|
+
// Per the NeuronInfo type, this is a redacted view of the neurons in the
|
|
464
|
+
// result set consisting of information that require no special privileges to
|
|
465
|
+
// view.
|
|
446
466
|
neuron_infos : vec record { nat64; NeuronInfo };
|
|
467
|
+
|
|
468
|
+
// If the caller has the necessary special privileges (or the neuron is
|
|
469
|
+
// public, and the request sets include_public_neurons_in_full_neurons to
|
|
470
|
+
// true), then all the information about the neurons in the result set is made
|
|
471
|
+
// available here.
|
|
447
472
|
full_neurons : vec Neuron;
|
|
473
|
+
|
|
474
|
+
total_pages_available: opt nat64;
|
|
448
475
|
};
|
|
449
476
|
|
|
450
477
|
type ListNodeProviderRewardsRequest = record {
|
|
@@ -491,6 +518,8 @@ type MakingSnsProposal = record {
|
|
|
491
518
|
proposer_id : opt NeuronId;
|
|
492
519
|
};
|
|
493
520
|
|
|
521
|
+
// Not to be confused with ManageNeuronRequest. (Yes, this is very structurally
|
|
522
|
+
// similar to that, but not actually exactly equivalent.)
|
|
494
523
|
type ManageNeuron = record {
|
|
495
524
|
id : opt NeuronId;
|
|
496
525
|
command : opt Command;
|
|
@@ -516,13 +545,22 @@ type ManageNeuronCommandRequest = variant {
|
|
|
516
545
|
// KEEP THIS IN SYNC WITH COMMAND!
|
|
517
546
|
};
|
|
518
547
|
|
|
548
|
+
// Parameters of the manage_neuron method.
|
|
519
549
|
type ManageNeuronRequest = record {
|
|
520
|
-
|
|
521
|
-
command : opt ManageNeuronCommandRequest;
|
|
550
|
+
// Which neuron to operate on.
|
|
522
551
|
neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
|
|
552
|
+
|
|
553
|
+
// What operation to perform on the neuron.
|
|
554
|
+
command : opt ManageNeuronCommandRequest;
|
|
555
|
+
|
|
556
|
+
// Deprecated. Use neuron_id_or_subaccount instead.
|
|
557
|
+
id : opt NeuronId;
|
|
523
558
|
};
|
|
524
559
|
|
|
560
|
+
// Output of the manage_neuron method.
|
|
525
561
|
type ManageNeuronResponse = record {
|
|
562
|
+
// Corresponds to the command field in ManageNeuronRequest, which determines
|
|
563
|
+
// what operation was performed.
|
|
526
564
|
command : opt Command_1;
|
|
527
565
|
};
|
|
528
566
|
|
|
@@ -728,14 +766,26 @@ type NeuronInFlightCommand = record {
|
|
|
728
766
|
timestamp : nat64;
|
|
729
767
|
};
|
|
730
768
|
|
|
731
|
-
//
|
|
769
|
+
// A limit view of Neuron that allows some aspects of all neurons to be read by
|
|
770
|
+
// anyone (i.e. without having to be the neuron's controller nor one of its
|
|
771
|
+
// hotkeys).
|
|
772
|
+
//
|
|
773
|
+
// As such, the meaning of each field in this type is generally the same as the
|
|
774
|
+
// one of the same (or at least similar) name in Neuron.
|
|
732
775
|
type NeuronInfo = record {
|
|
733
776
|
dissolve_delay_seconds : nat64;
|
|
734
777
|
recent_ballots : vec BallotInfo;
|
|
735
778
|
neuron_type : opt int32;
|
|
736
779
|
created_timestamp_seconds : nat64;
|
|
737
780
|
state : int32;
|
|
781
|
+
|
|
782
|
+
// The amount of ICP (and staked maturity) locked in this neuron.
|
|
783
|
+
//
|
|
784
|
+
// This is the foundation of the neuron's voting power.
|
|
785
|
+
//
|
|
786
|
+
// cached_neuron_stake_e8s - neuron_fees_e8s + staked_maturity_e8s_equivalent
|
|
738
787
|
stake_e8s : nat64;
|
|
788
|
+
|
|
739
789
|
joined_community_fund_timestamp_seconds : opt nat64;
|
|
740
790
|
retrieved_at_timestamp_seconds : nat64;
|
|
741
791
|
visibility : opt int32;
|
|
@@ -750,6 +800,7 @@ type NeuronInfo = record {
|
|
|
750
800
|
// Now that this is set to deciding_voting_power, this actually does get
|
|
751
801
|
// zeroed out.
|
|
752
802
|
voting_power : nat64;
|
|
803
|
+
|
|
753
804
|
voting_power_refreshed_timestamp_seconds : opt nat64;
|
|
754
805
|
deciding_voting_power : opt nat64;
|
|
755
806
|
potential_voting_power : opt nat64;
|
|
@@ -745,15 +745,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
745
745
|
const ListKnownNeuronsResponse = IDL.Record({
|
|
746
746
|
'known_neurons' : IDL.Vec(KnownNeuron),
|
|
747
747
|
});
|
|
748
|
+
const NeuronSubaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
748
749
|
const ListNeurons = IDL.Record({
|
|
750
|
+
'page_size' : IDL.Opt(IDL.Nat64),
|
|
749
751
|
'include_public_neurons_in_full_neurons' : IDL.Opt(IDL.Bool),
|
|
750
752
|
'neuron_ids' : IDL.Vec(IDL.Nat64),
|
|
753
|
+
'page_number' : IDL.Opt(IDL.Nat64),
|
|
751
754
|
'include_empty_neurons_readable_by_caller' : IDL.Opt(IDL.Bool),
|
|
755
|
+
'neuron_subaccounts' : IDL.Opt(IDL.Vec(NeuronSubaccount)),
|
|
752
756
|
'include_neurons_readable_by_caller' : IDL.Bool,
|
|
753
757
|
});
|
|
754
758
|
const ListNeuronsResponse = IDL.Record({
|
|
755
759
|
'neuron_infos' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInfo)),
|
|
756
760
|
'full_neurons' : IDL.Vec(Neuron),
|
|
761
|
+
'total_pages_available' : IDL.Opt(IDL.Nat64),
|
|
757
762
|
});
|
|
758
763
|
const DateRangeFilter = IDL.Record({
|
|
759
764
|
'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
@@ -745,15 +745,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
745
745
|
const ListKnownNeuronsResponse = IDL.Record({
|
|
746
746
|
'known_neurons' : IDL.Vec(KnownNeuron),
|
|
747
747
|
});
|
|
748
|
+
const NeuronSubaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
748
749
|
const ListNeurons = IDL.Record({
|
|
750
|
+
'page_size' : IDL.Opt(IDL.Nat64),
|
|
749
751
|
'include_public_neurons_in_full_neurons' : IDL.Opt(IDL.Bool),
|
|
750
752
|
'neuron_ids' : IDL.Vec(IDL.Nat64),
|
|
753
|
+
'page_number' : IDL.Opt(IDL.Nat64),
|
|
751
754
|
'include_empty_neurons_readable_by_caller' : IDL.Opt(IDL.Bool),
|
|
755
|
+
'neuron_subaccounts' : IDL.Opt(IDL.Vec(NeuronSubaccount)),
|
|
752
756
|
'include_neurons_readable_by_caller' : IDL.Bool,
|
|
753
757
|
});
|
|
754
758
|
const ListNeuronsResponse = IDL.Record({
|
|
755
759
|
'neuron_infos' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInfo)),
|
|
756
760
|
'full_neurons' : IDL.Vec(Neuron),
|
|
761
|
+
'total_pages_available' : IDL.Opt(IDL.Nat64),
|
|
757
762
|
});
|
|
758
763
|
const DateRangeFilter = IDL.Record({
|
|
759
764
|
'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
@@ -352,14 +352,18 @@ export interface ListKnownNeuronsResponse {
|
|
|
352
352
|
known_neurons: Array<KnownNeuron>;
|
|
353
353
|
}
|
|
354
354
|
export interface ListNeurons {
|
|
355
|
+
page_size: [] | [bigint];
|
|
355
356
|
include_public_neurons_in_full_neurons: [] | [boolean];
|
|
356
357
|
neuron_ids: BigUint64Array | bigint[];
|
|
358
|
+
page_number: [] | [bigint];
|
|
357
359
|
include_empty_neurons_readable_by_caller: [] | [boolean];
|
|
360
|
+
neuron_subaccounts: [] | [Array<NeuronSubaccount>];
|
|
358
361
|
include_neurons_readable_by_caller: boolean;
|
|
359
362
|
}
|
|
360
363
|
export interface ListNeuronsResponse {
|
|
361
364
|
neuron_infos: Array<[bigint, NeuronInfo]>;
|
|
362
365
|
full_neurons: Array<Neuron>;
|
|
366
|
+
total_pages_available: [] | [bigint];
|
|
363
367
|
}
|
|
364
368
|
export interface ListNodeProviderRewardsRequest {
|
|
365
369
|
date_filter: [] | [DateRangeFilter];
|
|
@@ -551,6 +555,9 @@ export interface NeuronStakeTransfer {
|
|
|
551
555
|
transfer_timestamp: bigint;
|
|
552
556
|
block_height: bigint;
|
|
553
557
|
}
|
|
558
|
+
export interface NeuronSubaccount {
|
|
559
|
+
subaccount: Uint8Array | number[];
|
|
560
|
+
}
|
|
554
561
|
export interface NeuronSubsetMetrics {
|
|
555
562
|
total_maturity_e8s_equivalent: [] | [bigint];
|
|
556
563
|
maturity_e8s_equivalent_buckets: Array<[bigint, bigint]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 14c8f44 (2025-02-07 tags: release-2025-02-06_12-26-revert-hashes-in-blocks) 'rs/nns/governance/canister/governance_test.did' by import-candid
|
|
2
2
|
type AccountIdentifier = record {
|
|
3
3
|
hash : blob;
|
|
4
4
|
};
|
|
@@ -439,11 +439,19 @@ type ListNeurons = record {
|
|
|
439
439
|
neuron_ids : vec nat64;
|
|
440
440
|
include_empty_neurons_readable_by_caller : opt bool;
|
|
441
441
|
include_neurons_readable_by_caller : bool;
|
|
442
|
+
page_number: opt nat64;
|
|
443
|
+
page_size: opt nat64;
|
|
444
|
+
neuron_subaccounts: opt vec NeuronSubaccount;
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
type NeuronSubaccount = record {
|
|
448
|
+
subaccount : blob;
|
|
442
449
|
};
|
|
443
450
|
|
|
444
451
|
type ListNeuronsResponse = record {
|
|
445
452
|
neuron_infos : vec record { nat64; NeuronInfo };
|
|
446
453
|
full_neurons : vec Neuron;
|
|
454
|
+
total_pages_available: opt nat64;
|
|
447
455
|
};
|
|
448
456
|
|
|
449
457
|
type ListNodeProviderRewardsRequest = record {
|
|
@@ -745,15 +745,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
745
745
|
const ListKnownNeuronsResponse = IDL.Record({
|
|
746
746
|
'known_neurons' : IDL.Vec(KnownNeuron),
|
|
747
747
|
});
|
|
748
|
+
const NeuronSubaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
|
|
748
749
|
const ListNeurons = IDL.Record({
|
|
750
|
+
'page_size' : IDL.Opt(IDL.Nat64),
|
|
749
751
|
'include_public_neurons_in_full_neurons' : IDL.Opt(IDL.Bool),
|
|
750
752
|
'neuron_ids' : IDL.Vec(IDL.Nat64),
|
|
753
|
+
'page_number' : IDL.Opt(IDL.Nat64),
|
|
751
754
|
'include_empty_neurons_readable_by_caller' : IDL.Opt(IDL.Bool),
|
|
755
|
+
'neuron_subaccounts' : IDL.Opt(IDL.Vec(NeuronSubaccount)),
|
|
752
756
|
'include_neurons_readable_by_caller' : IDL.Bool,
|
|
753
757
|
});
|
|
754
758
|
const ListNeuronsResponse = IDL.Record({
|
|
755
759
|
'neuron_infos' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInfo)),
|
|
756
760
|
'full_neurons' : IDL.Vec(Neuron),
|
|
761
|
+
'total_pages_available' : IDL.Opt(IDL.Nat64),
|
|
757
762
|
});
|
|
758
763
|
const DateRangeFilter = IDL.Record({
|
|
759
764
|
'start_timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
package/dist/candid/sns_wasm.did
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit 14c8f44 (2025-02-07 tags: release-2025-02-06_12-26-revert-hashes-in-blocks) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
|
|
2
2
|
type AddWasmRequest = record {
|
|
3
3
|
hash : blob;
|
|
4
4
|
wasm : opt SnsWasm;
|