@dfinity/nns 4.0.2 → 5.0.0-next-2024-05-10
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 +32 -32
- package/dist/candid/genesis_token.d.ts +3 -0
- package/dist/candid/genesis_token.did +1 -1
- package/dist/candid/governance.certified.idl.js +64 -0
- package/dist/candid/governance.d.ts +38 -0
- package/dist/candid/governance.did +42 -12
- package/dist/candid/governance.idl.js +68 -0
- package/dist/candid/governance_test.certified.idl.js +64 -0
- package/dist/candid/governance_test.d.ts +38 -0
- package/dist/candid/governance_test.did +42 -12
- package/dist/candid/governance_test.idl.js +68 -0
- package/dist/candid/sns_wasm.certified.idl.js +16 -0
- package/dist/candid/sns_wasm.d.ts +22 -0
- package/dist/candid/sns_wasm.did +24 -12
- package/dist/candid/sns_wasm.idl.js +16 -0
- package/dist/cjs/index.cjs.js +1 -2
- package/dist/cjs/index.cjs.js.map +4 -4
- package/dist/esm/chunk-AN6DZS5M.js +19 -0
- package/dist/esm/chunk-AN6DZS5M.js.map +7 -0
- package/dist/esm/chunk-IDYCQLH5.js +2 -0
- package/dist/esm/chunk-IDYCQLH5.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 +4 -4
- package/dist/esm/sns_wasm.canister.js +1 -1
- package/dist/types/canisters/governance/request.converters.d.ts +7 -7
- package/dist/types/canisters/governance/response.converters.d.ts +1 -6
- package/dist/types/enums/governance.enums.d.ts +6 -1
- package/dist/types/errors/governance.errors.d.ts +0 -2
- package/dist/types/governance.canister.d.ts +16 -28
- package/dist/types/sns_wasm.canister.d.ts +1 -1
- package/dist/types/types/governance_converters.d.ts +15 -0
- package/package.json +7 -8
- package/dist/esm/chunk-4ZPVMCGL.js +0 -2
- package/dist/esm/chunk-4ZPVMCGL.js.map +0 -7
- package/dist/esm/chunk-LZ5FA3UO.js +0 -20
- package/dist/esm/chunk-LZ5FA3UO.js.map +0 -7
- package/dist/types/canisters/governance/request.proto.converters.d.ts +0 -16
- package/dist/types/canisters/governance/response.proto.converters.d.ts +0 -1
- package/dist/types/utils/proto.utils.d.ts +0 -25
package/README.md
CHANGED
|
@@ -155,7 +155,7 @@ Parameters:
|
|
|
155
155
|
|
|
156
156
|
### :factory: GovernanceCanister
|
|
157
157
|
|
|
158
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
158
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L91)
|
|
159
159
|
|
|
160
160
|
#### Methods
|
|
161
161
|
|
|
@@ -197,7 +197,7 @@ Parameters:
|
|
|
197
197
|
| -------- | ------------------------------------------------------------- |
|
|
198
198
|
| `create` | `(options?: GovernanceCanisterOptions) => GovernanceCanister` |
|
|
199
199
|
|
|
200
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
200
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L104)
|
|
201
201
|
|
|
202
202
|
##### :gear: listNeurons
|
|
203
203
|
|
|
@@ -212,7 +212,7 @@ it is fetched using a query call.
|
|
|
212
212
|
| ------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
213
213
|
| `listNeurons` | `({ certified, neuronIds, }: { certified: boolean; neuronIds?: bigint[] or undefined; }) => Promise<NeuronInfo[]>` |
|
|
214
214
|
|
|
215
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
215
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L130)
|
|
216
216
|
|
|
217
217
|
##### :gear: listKnownNeurons
|
|
218
218
|
|
|
@@ -226,7 +226,7 @@ it is fetched using a query call.
|
|
|
226
226
|
| ------------------ | ------------------------------------------------- |
|
|
227
227
|
| `listKnownNeurons` | `(certified?: boolean) => Promise<KnownNeuron[]>` |
|
|
228
228
|
|
|
229
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
229
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L153)
|
|
230
230
|
|
|
231
231
|
##### :gear: getLastestRewardEvent
|
|
232
232
|
|
|
@@ -239,7 +239,7 @@ it's fetched using a query call.
|
|
|
239
239
|
| ----------------------- | ----------------------------------------------- |
|
|
240
240
|
| `getLastestRewardEvent` | `(certified?: boolean) => Promise<RewardEvent>` |
|
|
241
241
|
|
|
242
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
242
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L175)
|
|
243
243
|
|
|
244
244
|
##### :gear: listProposals
|
|
245
245
|
|
|
@@ -258,7 +258,7 @@ Parameters:
|
|
|
258
258
|
- `request`: the options to list the proposals (limit number of results, topics to search for, etc.)
|
|
259
259
|
- `certified`: query or update calls
|
|
260
260
|
|
|
261
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
261
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L191)
|
|
262
262
|
|
|
263
263
|
##### :gear: stakeNeuron
|
|
264
264
|
|
|
@@ -266,7 +266,7 @@ Parameters:
|
|
|
266
266
|
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
267
267
|
| `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<...>` |
|
|
268
268
|
|
|
269
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
269
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L210)
|
|
270
270
|
|
|
271
271
|
##### :gear: stakeNeuronIcrc1
|
|
272
272
|
|
|
@@ -274,7 +274,7 @@ Parameters:
|
|
|
274
274
|
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
275
275
|
| `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<...>` |
|
|
276
276
|
|
|
277
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
277
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L276)
|
|
278
278
|
|
|
279
279
|
##### :gear: increaseDissolveDelay
|
|
280
280
|
|
|
@@ -284,7 +284,7 @@ Increases dissolve delay of a neuron
|
|
|
284
284
|
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
285
285
|
| `increaseDissolveDelay` | `({ neuronId, additionalDissolveDelaySeconds, }: { neuronId: bigint; additionalDissolveDelaySeconds: number; }) => Promise<void>` |
|
|
286
286
|
|
|
287
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
287
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L341)
|
|
288
288
|
|
|
289
289
|
##### :gear: setDissolveDelay
|
|
290
290
|
|
|
@@ -295,7 +295,7 @@ The new date is now + dissolveDelaySeconds.
|
|
|
295
295
|
| ------------------ | ------------------------------------------------------------------------------------------------------------- |
|
|
296
296
|
| `setDissolveDelay` | `({ neuronId, dissolveDelaySeconds, }: { neuronId: bigint; dissolveDelaySeconds: number; }) => Promise<void>` |
|
|
297
297
|
|
|
298
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
298
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L367)
|
|
299
299
|
|
|
300
300
|
##### :gear: startDissolving
|
|
301
301
|
|
|
@@ -305,7 +305,7 @@ Start dissolving process of a neuron
|
|
|
305
305
|
| ----------------- | ------------------------------------- |
|
|
306
306
|
| `startDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
307
307
|
|
|
308
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
308
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L390)
|
|
309
309
|
|
|
310
310
|
##### :gear: stopDissolving
|
|
311
311
|
|
|
@@ -315,7 +315,7 @@ Stop dissolving process of a neuron
|
|
|
315
315
|
| ---------------- | ------------------------------------- |
|
|
316
316
|
| `stopDissolving` | `(neuronId: bigint) => Promise<void>` |
|
|
317
317
|
|
|
318
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
318
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L404)
|
|
319
319
|
|
|
320
320
|
##### :gear: joinCommunityFund
|
|
321
321
|
|
|
@@ -325,7 +325,7 @@ Neuron joins the community fund
|
|
|
325
325
|
| ------------------- | ------------------------------------- |
|
|
326
326
|
| `joinCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
327
327
|
|
|
328
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
328
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L418)
|
|
329
329
|
|
|
330
330
|
##### :gear: autoStakeMaturity
|
|
331
331
|
|
|
@@ -340,7 +340,7 @@ Parameters:
|
|
|
340
340
|
- `neuronId`: The id of the neuron for which to request a change of the auto stake feature
|
|
341
341
|
- `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
|
|
342
342
|
|
|
343
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
343
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L436)
|
|
344
344
|
|
|
345
345
|
##### :gear: leaveCommunityFund
|
|
346
346
|
|
|
@@ -350,7 +350,7 @@ Neuron leaves the community fund
|
|
|
350
350
|
| -------------------- | ------------------------------------- |
|
|
351
351
|
| `leaveCommunityFund` | `(neuronId: bigint) => Promise<void>` |
|
|
352
352
|
|
|
353
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
353
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L451)
|
|
354
354
|
|
|
355
355
|
##### :gear: setNodeProviderAccount
|
|
356
356
|
|
|
@@ -361,7 +361,7 @@ Where the reward is paid to.
|
|
|
361
361
|
| ------------------------ | ---------------------------------------------- |
|
|
362
362
|
| `setNodeProviderAccount` | `(accountIdentifier: string) => Promise<void>` |
|
|
363
363
|
|
|
364
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
364
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L468)
|
|
365
365
|
|
|
366
366
|
##### :gear: mergeNeurons
|
|
367
367
|
|
|
@@ -371,7 +371,7 @@ Merge two neurons
|
|
|
371
371
|
| -------------- | --------------------------------------------------------------------------------- |
|
|
372
372
|
| `mergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<void>` |
|
|
373
373
|
|
|
374
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
374
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L488)
|
|
375
375
|
|
|
376
376
|
##### :gear: simulateMergeNeurons
|
|
377
377
|
|
|
@@ -381,7 +381,7 @@ Simulate merging two neurons
|
|
|
381
381
|
| ---------------------- | --------------------------------------------------------------------------------------- |
|
|
382
382
|
| `simulateMergeNeurons` | `(request: { sourceNeuronId: bigint; targetNeuronId: bigint; }) => Promise<NeuronInfo>` |
|
|
383
383
|
|
|
384
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
384
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L505)
|
|
385
385
|
|
|
386
386
|
##### :gear: splitNeuron
|
|
387
387
|
|
|
@@ -391,7 +391,7 @@ Splits a neuron creating a new one
|
|
|
391
391
|
| ------------- | ----------------------------------------------------------------------------------- |
|
|
392
392
|
| `splitNeuron` | `({ neuronId, amount, }: { neuronId: bigint; amount: bigint; }) => Promise<bigint>` |
|
|
393
393
|
|
|
394
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
394
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L550)
|
|
395
395
|
|
|
396
396
|
##### :gear: getProposal
|
|
397
397
|
|
|
@@ -404,7 +404,7 @@ it is fetched using a query call.
|
|
|
404
404
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
405
405
|
| `getProposal` | `({ proposalId, certified, }: { proposalId: bigint; certified?: boolean or undefined; }) => Promise<ProposalInfo or undefined>` |
|
|
406
406
|
|
|
407
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
407
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L590)
|
|
408
408
|
|
|
409
409
|
##### :gear: makeProposal
|
|
410
410
|
|
|
@@ -414,7 +414,7 @@ Create new proposal
|
|
|
414
414
|
| -------------- | ---------------------------------------------------------------- |
|
|
415
415
|
| `makeProposal` | `(request: MakeProposalRequest) => Promise<bigint or undefined>` |
|
|
416
416
|
|
|
417
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
417
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L608)
|
|
418
418
|
|
|
419
419
|
##### :gear: registerVote
|
|
420
420
|
|
|
@@ -424,7 +424,7 @@ Registers vote for a proposal from the neuron passed.
|
|
|
424
424
|
| -------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
425
425
|
| `registerVote` | `({ neuronId, vote, proposalId, }: { neuronId: bigint; vote: Vote; proposalId: bigint; }) => Promise<void>` |
|
|
426
426
|
|
|
427
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
427
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L629)
|
|
428
428
|
|
|
429
429
|
##### :gear: setFollowees
|
|
430
430
|
|
|
@@ -434,7 +434,7 @@ Edit neuron followees per topic
|
|
|
434
434
|
| -------------- | ------------------------------------------------- |
|
|
435
435
|
| `setFollowees` | `(followRequest: FollowRequest) => Promise<void>` |
|
|
436
436
|
|
|
437
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
437
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L651)
|
|
438
438
|
|
|
439
439
|
##### :gear: disburse
|
|
440
440
|
|
|
@@ -444,7 +444,7 @@ Disburse neuron on Account
|
|
|
444
444
|
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
445
445
|
| `disburse` | `({ neuronId, toAccountId, amount, }: { neuronId: bigint; toAccountId?: string or undefined; amount?: bigint or undefined; }) => Promise<void>` |
|
|
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#L666)
|
|
448
448
|
|
|
449
449
|
##### :gear: mergeMaturity
|
|
450
450
|
|
|
@@ -454,7 +454,7 @@ Merge Maturity of a neuron
|
|
|
454
454
|
| --------------- | ------------------------------------------------------------------------------------------------------- |
|
|
455
455
|
| `mergeMaturity` | `({ neuronId, percentageToMerge, }: { neuronId: bigint; percentageToMerge: number; }) => Promise<void>` |
|
|
456
456
|
|
|
457
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
457
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L702)
|
|
458
458
|
|
|
459
459
|
##### :gear: stakeMaturity
|
|
460
460
|
|
|
@@ -469,7 +469,7 @@ Parameters:
|
|
|
469
469
|
- `neuronId`: The id of the neuron for which to stake the maturity
|
|
470
470
|
- `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
|
|
471
471
|
|
|
472
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
472
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L731)
|
|
473
473
|
|
|
474
474
|
##### :gear: spawnNeuron
|
|
475
475
|
|
|
@@ -479,7 +479,7 @@ Merge Maturity of a neuron
|
|
|
479
479
|
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
480
480
|
| `spawnNeuron` | `({ neuronId, percentageToSpawn, newController, nonce, }: { neuronId: bigint; percentageToSpawn?: number or undefined; newController?: Principal or undefined; nonce?: bigint or undefined; }) => Promise<bigint>` |
|
|
481
481
|
|
|
482
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
482
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L753)
|
|
483
483
|
|
|
484
484
|
##### :gear: addHotkey
|
|
485
485
|
|
|
@@ -489,7 +489,7 @@ Add hotkey to neuron
|
|
|
489
489
|
| ----------- | ------------------------------------------------------------------------------------------ |
|
|
490
490
|
| `addHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
491
491
|
|
|
492
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
492
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L800)
|
|
493
493
|
|
|
494
494
|
##### :gear: removeHotkey
|
|
495
495
|
|
|
@@ -499,7 +499,7 @@ Remove hotkey to neuron
|
|
|
499
499
|
| -------------- | ------------------------------------------------------------------------------------------ |
|
|
500
500
|
| `removeHotkey` | `({ neuronId, principal, }: { neuronId: bigint; principal: Principal; }) => Promise<void>` |
|
|
501
501
|
|
|
502
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
502
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L820)
|
|
503
503
|
|
|
504
504
|
##### :gear: claimOrRefreshNeuronFromAccount
|
|
505
505
|
|
|
@@ -509,7 +509,7 @@ Gets the NeuronID of a newly created neuron.
|
|
|
509
509
|
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
510
510
|
| `claimOrRefreshNeuronFromAccount` | `({ memo, controller, }: { memo: bigint; controller?: Principal or undefined; }) => Promise<bigint or undefined>` |
|
|
511
511
|
|
|
512
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
512
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L838)
|
|
513
513
|
|
|
514
514
|
##### :gear: claimOrRefreshNeuron
|
|
515
515
|
|
|
@@ -520,7 +520,7 @@ Uses query call only.
|
|
|
520
520
|
| ---------------------- | ------------------------------------------------------------------------ |
|
|
521
521
|
| `claimOrRefreshNeuron` | `(request: ClaimOrRefreshNeuronRequest) => Promise<bigint or undefined>` |
|
|
522
522
|
|
|
523
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
523
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L869)
|
|
524
524
|
|
|
525
525
|
##### :gear: getNeuron
|
|
526
526
|
|
|
@@ -530,7 +530,7 @@ Return the data of the neuron provided as id.
|
|
|
530
530
|
| ----------- | ----------------------------------------------------------------------------------------------------------- |
|
|
531
531
|
| `getNeuron` | `({ certified, neuronId, }: { certified: boolean; neuronId: bigint; }) => Promise<NeuronInfo or undefined>` |
|
|
532
532
|
|
|
533
|
-
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#
|
|
533
|
+
[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/nns/src/governance.canister.ts#L920)
|
|
534
534
|
|
|
535
535
|
### :factory: SnsWasmCanister
|
|
536
536
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ActorMethod } from "@dfinity/agent";
|
|
2
|
+
import type { IDL } from "@dfinity/candid";
|
|
2
3
|
import type { Principal } from "@dfinity/principal";
|
|
3
4
|
|
|
4
5
|
export interface AccountState {
|
|
@@ -33,3 +34,5 @@ export interface _SERVICE {
|
|
|
33
34
|
len: ActorMethod<[], number>;
|
|
34
35
|
total: ActorMethod<[], number>;
|
|
35
36
|
}
|
|
37
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
38
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated from IC repo commit
|
|
1
|
+
// Generated from IC repo commit f58424c (2024-04-24 tags: release-2024-05-01_23-01-storage-layer) '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;
|
|
@@ -246,6 +246,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
246
246
|
'use_registry_derived_rewards' : IDL.Opt(IDL.Bool),
|
|
247
247
|
'rewards' : IDL.Vec(RewardNodeProvider),
|
|
248
248
|
});
|
|
249
|
+
const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
|
|
250
|
+
const NeuronsFundMatchedFundingCurveCoefficients = IDL.Record({
|
|
251
|
+
'contribution_threshold_xdr' : IDL.Opt(Decimal),
|
|
252
|
+
'one_third_participation_milestone_xdr' : IDL.Opt(Decimal),
|
|
253
|
+
'full_participation_milestone_xdr' : IDL.Opt(Decimal),
|
|
254
|
+
});
|
|
255
|
+
const NeuronsFundEconomics = IDL.Record({
|
|
256
|
+
'maximum_icp_xdr_rate' : IDL.Opt(Percentage),
|
|
257
|
+
'neurons_fund_matched_funding_curve_coefficients' : IDL.Opt(
|
|
258
|
+
NeuronsFundMatchedFundingCurveCoefficients
|
|
259
|
+
),
|
|
260
|
+
'max_theoretical_neurons_fund_participation_amount_xdr' : IDL.Opt(Decimal),
|
|
261
|
+
'minimum_icp_xdr_rate' : IDL.Opt(Percentage),
|
|
262
|
+
});
|
|
249
263
|
const NetworkEconomics = IDL.Record({
|
|
250
264
|
'neuron_minimum_stake_e8s' : IDL.Nat64,
|
|
251
265
|
'max_proposals_to_keep_per_topic' : IDL.Nat32,
|
|
@@ -255,6 +269,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
255
269
|
'neuron_spawn_dissolve_delay_seconds' : IDL.Nat64,
|
|
256
270
|
'minimum_icp_xdr_rate' : IDL.Nat64,
|
|
257
271
|
'maximum_node_provider_rewards_e8s' : IDL.Nat64,
|
|
272
|
+
'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics),
|
|
258
273
|
});
|
|
259
274
|
const ApproveGenesisKyc = IDL.Record({
|
|
260
275
|
'principals' : IDL.Vec(IDL.Principal),
|
|
@@ -354,6 +369,16 @@ export const idlFactory = ({ IDL }) => {
|
|
|
354
369
|
'timestamp_seconds' : IDL.Nat64,
|
|
355
370
|
'seed_neuron_count' : IDL.Nat64,
|
|
356
371
|
});
|
|
372
|
+
const RestoreAgingNeuronGroup = IDL.Record({
|
|
373
|
+
'count' : IDL.Opt(IDL.Nat64),
|
|
374
|
+
'previous_total_stake_e8s' : IDL.Opt(IDL.Nat64),
|
|
375
|
+
'current_total_stake_e8s' : IDL.Opt(IDL.Nat64),
|
|
376
|
+
'group_type' : IDL.Int32,
|
|
377
|
+
});
|
|
378
|
+
const RestoreAgingSummary = IDL.Record({
|
|
379
|
+
'groups' : IDL.Vec(RestoreAgingNeuronGroup),
|
|
380
|
+
'timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
381
|
+
});
|
|
357
382
|
const RewardEvent = IDL.Record({
|
|
358
383
|
'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64),
|
|
359
384
|
'day_after_genesis' : IDL.Nat64,
|
|
@@ -493,6 +518,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
493
518
|
IDL.Nat64
|
|
494
519
|
),
|
|
495
520
|
});
|
|
521
|
+
const XdrConversionRate = IDL.Record({
|
|
522
|
+
'xdr_permyriad_per_icp' : IDL.Opt(IDL.Nat64),
|
|
523
|
+
'timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
524
|
+
});
|
|
496
525
|
const Command_2 = IDL.Variant({
|
|
497
526
|
'Spawn' : NeuronId,
|
|
498
527
|
'Split' : Split,
|
|
@@ -554,6 +583,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
554
583
|
'node_providers' : IDL.Vec(NodeProvider),
|
|
555
584
|
'cached_daily_maturity_modulation_basis_points' : IDL.Opt(IDL.Int32),
|
|
556
585
|
'economics' : IDL.Opt(NetworkEconomics),
|
|
586
|
+
'restore_aging_summary' : IDL.Opt(RestoreAgingSummary),
|
|
557
587
|
'spawning_neurons' : IDL.Opt(IDL.Bool),
|
|
558
588
|
'latest_reward_event' : IDL.Opt(RewardEvent),
|
|
559
589
|
'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
|
|
@@ -561,6 +591,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
561
591
|
'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)),
|
|
562
592
|
'migrations' : IDL.Opt(Migrations),
|
|
563
593
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
594
|
+
'xdr_conversion_rate' : IDL.Opt(XdrConversionRate),
|
|
564
595
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
|
|
565
596
|
'neurons' : IDL.Vec(IDL.Tuple(IDL.Nat64, Neuron)),
|
|
566
597
|
'genesis_timestamp_seconds' : IDL.Nat64,
|
|
@@ -671,6 +702,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
671
702
|
'source_neuron_info' : IDL.Opt(NeuronInfo),
|
|
672
703
|
});
|
|
673
704
|
const MakeProposalResponse = IDL.Record({
|
|
705
|
+
'message' : IDL.Opt(IDL.Text),
|
|
674
706
|
'proposal_id' : IDL.Opt(NeuronId),
|
|
675
707
|
});
|
|
676
708
|
const StakeMaturityResponse = IDL.Record({
|
|
@@ -782,6 +814,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
782
814
|
'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], []),
|
|
783
815
|
'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []),
|
|
784
816
|
'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []),
|
|
817
|
+
'get_restore_aging_summary' : IDL.Func([], [RestoreAgingSummary], []),
|
|
785
818
|
'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []),
|
|
786
819
|
'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),
|
|
787
820
|
'list_node_providers' : IDL.Func([], [ListNodeProvidersResponse], []),
|
|
@@ -1057,6 +1090,20 @@ export const init = ({ IDL }) => {
|
|
|
1057
1090
|
'use_registry_derived_rewards' : IDL.Opt(IDL.Bool),
|
|
1058
1091
|
'rewards' : IDL.Vec(RewardNodeProvider),
|
|
1059
1092
|
});
|
|
1093
|
+
const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
|
|
1094
|
+
const NeuronsFundMatchedFundingCurveCoefficients = IDL.Record({
|
|
1095
|
+
'contribution_threshold_xdr' : IDL.Opt(Decimal),
|
|
1096
|
+
'one_third_participation_milestone_xdr' : IDL.Opt(Decimal),
|
|
1097
|
+
'full_participation_milestone_xdr' : IDL.Opt(Decimal),
|
|
1098
|
+
});
|
|
1099
|
+
const NeuronsFundEconomics = IDL.Record({
|
|
1100
|
+
'maximum_icp_xdr_rate' : IDL.Opt(Percentage),
|
|
1101
|
+
'neurons_fund_matched_funding_curve_coefficients' : IDL.Opt(
|
|
1102
|
+
NeuronsFundMatchedFundingCurveCoefficients
|
|
1103
|
+
),
|
|
1104
|
+
'max_theoretical_neurons_fund_participation_amount_xdr' : IDL.Opt(Decimal),
|
|
1105
|
+
'minimum_icp_xdr_rate' : IDL.Opt(Percentage),
|
|
1106
|
+
});
|
|
1060
1107
|
const NetworkEconomics = IDL.Record({
|
|
1061
1108
|
'neuron_minimum_stake_e8s' : IDL.Nat64,
|
|
1062
1109
|
'max_proposals_to_keep_per_topic' : IDL.Nat32,
|
|
@@ -1066,6 +1113,7 @@ export const init = ({ IDL }) => {
|
|
|
1066
1113
|
'neuron_spawn_dissolve_delay_seconds' : IDL.Nat64,
|
|
1067
1114
|
'minimum_icp_xdr_rate' : IDL.Nat64,
|
|
1068
1115
|
'maximum_node_provider_rewards_e8s' : IDL.Nat64,
|
|
1116
|
+
'neurons_fund_economics' : IDL.Opt(NeuronsFundEconomics),
|
|
1069
1117
|
});
|
|
1070
1118
|
const ApproveGenesisKyc = IDL.Record({
|
|
1071
1119
|
'principals' : IDL.Vec(IDL.Principal),
|
|
@@ -1165,6 +1213,16 @@ export const init = ({ IDL }) => {
|
|
|
1165
1213
|
'timestamp_seconds' : IDL.Nat64,
|
|
1166
1214
|
'seed_neuron_count' : IDL.Nat64,
|
|
1167
1215
|
});
|
|
1216
|
+
const RestoreAgingNeuronGroup = IDL.Record({
|
|
1217
|
+
'count' : IDL.Opt(IDL.Nat64),
|
|
1218
|
+
'previous_total_stake_e8s' : IDL.Opt(IDL.Nat64),
|
|
1219
|
+
'current_total_stake_e8s' : IDL.Opt(IDL.Nat64),
|
|
1220
|
+
'group_type' : IDL.Int32,
|
|
1221
|
+
});
|
|
1222
|
+
const RestoreAgingSummary = IDL.Record({
|
|
1223
|
+
'groups' : IDL.Vec(RestoreAgingNeuronGroup),
|
|
1224
|
+
'timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
1225
|
+
});
|
|
1168
1226
|
const RewardEvent = IDL.Record({
|
|
1169
1227
|
'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64),
|
|
1170
1228
|
'day_after_genesis' : IDL.Nat64,
|
|
@@ -1304,6 +1362,10 @@ export const init = ({ IDL }) => {
|
|
|
1304
1362
|
IDL.Nat64
|
|
1305
1363
|
),
|
|
1306
1364
|
});
|
|
1365
|
+
const XdrConversionRate = IDL.Record({
|
|
1366
|
+
'xdr_permyriad_per_icp' : IDL.Opt(IDL.Nat64),
|
|
1367
|
+
'timestamp_seconds' : IDL.Opt(IDL.Nat64),
|
|
1368
|
+
});
|
|
1307
1369
|
const Command_2 = IDL.Variant({
|
|
1308
1370
|
'Spawn' : NeuronId,
|
|
1309
1371
|
'Split' : Split,
|
|
@@ -1365,6 +1427,7 @@ export const init = ({ IDL }) => {
|
|
|
1365
1427
|
'node_providers' : IDL.Vec(NodeProvider),
|
|
1366
1428
|
'cached_daily_maturity_modulation_basis_points' : IDL.Opt(IDL.Int32),
|
|
1367
1429
|
'economics' : IDL.Opt(NetworkEconomics),
|
|
1430
|
+
'restore_aging_summary' : IDL.Opt(RestoreAgingSummary),
|
|
1368
1431
|
'spawning_neurons' : IDL.Opt(IDL.Bool),
|
|
1369
1432
|
'latest_reward_event' : IDL.Opt(RewardEvent),
|
|
1370
1433
|
'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
|
|
@@ -1372,6 +1435,7 @@ export const init = ({ IDL }) => {
|
|
|
1372
1435
|
'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)),
|
|
1373
1436
|
'migrations' : IDL.Opt(Migrations),
|
|
1374
1437
|
'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
|
|
1438
|
+
'xdr_conversion_rate' : IDL.Opt(XdrConversionRate),
|
|
1375
1439
|
'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
|
|
1376
1440
|
'neurons' : IDL.Vec(IDL.Tuple(IDL.Nat64, Neuron)),
|
|
1377
1441
|
'genesis_timestamp_seconds' : IDL.Nat64,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ActorMethod } from "@dfinity/agent";
|
|
2
|
+
import type { IDL } from "@dfinity/candid";
|
|
2
3
|
import type { Principal } from "@dfinity/principal";
|
|
3
4
|
|
|
4
5
|
export interface AccountIdentifier {
|
|
@@ -149,6 +150,9 @@ export interface CreateServiceNervousSystem {
|
|
|
149
150
|
swap_parameters: [] | [SwapParameters];
|
|
150
151
|
initial_token_distribution: [] | [InitialTokenDistribution];
|
|
151
152
|
}
|
|
153
|
+
export interface Decimal {
|
|
154
|
+
human_readable: [] | [string];
|
|
155
|
+
}
|
|
152
156
|
export interface DerivedProposalInformation {
|
|
153
157
|
swap_background_information: [] | [SwapBackgroundInformation];
|
|
154
158
|
}
|
|
@@ -214,6 +218,7 @@ export interface Governance {
|
|
|
214
218
|
node_providers: Array<NodeProvider>;
|
|
215
219
|
cached_daily_maturity_modulation_basis_points: [] | [number];
|
|
216
220
|
economics: [] | [NetworkEconomics];
|
|
221
|
+
restore_aging_summary: [] | [RestoreAgingSummary];
|
|
217
222
|
spawning_neurons: [] | [boolean];
|
|
218
223
|
latest_reward_event: [] | [RewardEvent];
|
|
219
224
|
to_claim_transfers: Array<NeuronStakeTransfer>;
|
|
@@ -221,6 +226,7 @@ export interface Governance {
|
|
|
221
226
|
topic_followee_index: Array<[number, FollowersMap]>;
|
|
222
227
|
migrations: [] | [Migrations];
|
|
223
228
|
proposals: Array<[bigint, ProposalData]>;
|
|
229
|
+
xdr_conversion_rate: [] | [XdrConversionRate];
|
|
224
230
|
in_flight_commands: Array<[bigint, NeuronInFlightCommand]>;
|
|
225
231
|
neurons: Array<[bigint, Neuron]>;
|
|
226
232
|
genesis_timestamp_seconds: bigint;
|
|
@@ -337,6 +343,7 @@ export interface ListProposalInfoResponse {
|
|
|
337
343
|
proposal_info: Array<ProposalInfo>;
|
|
338
344
|
}
|
|
339
345
|
export interface MakeProposalResponse {
|
|
346
|
+
message: [] | [string];
|
|
340
347
|
proposal_id: [] | [NeuronId];
|
|
341
348
|
}
|
|
342
349
|
export interface MakingSnsProposal {
|
|
@@ -393,6 +400,7 @@ export interface NetworkEconomics {
|
|
|
393
400
|
neuron_spawn_dissolve_delay_seconds: bigint;
|
|
394
401
|
minimum_icp_xdr_rate: bigint;
|
|
395
402
|
maximum_node_provider_rewards_e8s: bigint;
|
|
403
|
+
neurons_fund_economics: [] | [NeuronsFundEconomics];
|
|
396
404
|
}
|
|
397
405
|
export interface Neuron {
|
|
398
406
|
id: [] | [NeuronId];
|
|
@@ -474,6 +482,19 @@ export interface NeuronsFundData {
|
|
|
474
482
|
initial_neurons_fund_participation: [] | [NeuronsFundParticipation];
|
|
475
483
|
neurons_fund_refunds: [] | [NeuronsFundSnapshot];
|
|
476
484
|
}
|
|
485
|
+
export interface NeuronsFundEconomics {
|
|
486
|
+
maximum_icp_xdr_rate: [] | [Percentage];
|
|
487
|
+
neurons_fund_matched_funding_curve_coefficients:
|
|
488
|
+
| []
|
|
489
|
+
| [NeuronsFundMatchedFundingCurveCoefficients];
|
|
490
|
+
max_theoretical_neurons_fund_participation_amount_xdr: [] | [Decimal];
|
|
491
|
+
minimum_icp_xdr_rate: [] | [Percentage];
|
|
492
|
+
}
|
|
493
|
+
export interface NeuronsFundMatchedFundingCurveCoefficients {
|
|
494
|
+
contribution_threshold_xdr: [] | [Decimal];
|
|
495
|
+
one_third_participation_milestone_xdr: [] | [Decimal];
|
|
496
|
+
full_participation_milestone_xdr: [] | [Decimal];
|
|
497
|
+
}
|
|
477
498
|
export interface NeuronsFundNeuron {
|
|
478
499
|
hotkey_principal: [] | [string];
|
|
479
500
|
is_capped: [] | [boolean];
|
|
@@ -598,6 +619,16 @@ export interface RegisterVote {
|
|
|
598
619
|
export interface RemoveHotKey {
|
|
599
620
|
hot_key_to_remove: [] | [Principal];
|
|
600
621
|
}
|
|
622
|
+
export interface RestoreAgingNeuronGroup {
|
|
623
|
+
count: [] | [bigint];
|
|
624
|
+
previous_total_stake_e8s: [] | [bigint];
|
|
625
|
+
current_total_stake_e8s: [] | [bigint];
|
|
626
|
+
group_type: number;
|
|
627
|
+
}
|
|
628
|
+
export interface RestoreAgingSummary {
|
|
629
|
+
groups: Array<RestoreAgingNeuronGroup>;
|
|
630
|
+
timestamp_seconds: [] | [bigint];
|
|
631
|
+
}
|
|
601
632
|
export type Result = { Ok: null } | { Err: GovernanceError };
|
|
602
633
|
export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId };
|
|
603
634
|
export type Result_10 = { Ok: Ok_1 } | { Err: GovernanceError };
|
|
@@ -741,6 +772,10 @@ export interface VotingRewardParameters {
|
|
|
741
772
|
export interface WaitForQuietState {
|
|
742
773
|
current_deadline_timestamp_seconds: bigint;
|
|
743
774
|
}
|
|
775
|
+
export interface XdrConversionRate {
|
|
776
|
+
xdr_permyriad_per_icp: [] | [bigint];
|
|
777
|
+
timestamp_seconds: [] | [bigint];
|
|
778
|
+
}
|
|
744
779
|
export interface _SERVICE {
|
|
745
780
|
claim_gtc_neurons: ActorMethod<[Principal, Array<NeuronId>], Result>;
|
|
746
781
|
claim_or_refresh_neuron_from_account: ActorMethod<
|
|
@@ -774,6 +809,7 @@ export interface _SERVICE {
|
|
|
774
809
|
get_node_provider_by_caller: ActorMethod<[null], Result_7>;
|
|
775
810
|
get_pending_proposals: ActorMethod<[], Array<ProposalInfo>>;
|
|
776
811
|
get_proposal_info: ActorMethod<[bigint], [] | [ProposalInfo]>;
|
|
812
|
+
get_restore_aging_summary: ActorMethod<[], RestoreAgingSummary>;
|
|
777
813
|
list_known_neurons: ActorMethod<[], ListKnownNeuronsResponse>;
|
|
778
814
|
list_neurons: ActorMethod<[ListNeurons], ListNeuronsResponse>;
|
|
779
815
|
list_node_providers: ActorMethod<[], ListNodeProvidersResponse>;
|
|
@@ -791,3 +827,5 @@ export interface _SERVICE {
|
|
|
791
827
|
transfer_gtc_neuron: ActorMethod<[NeuronId, NeuronId], Result>;
|
|
792
828
|
update_node_provider: ActorMethod<[UpdateNodeProvider], Result>;
|
|
793
829
|
}
|
|
830
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
831
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|