@dfinity/sns 3.2.9 → 3.3.0-next-2025-02-21

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 (43) hide show
  1. package/README.md +37 -26
  2. package/dist/candid/sns_governance.certified.idl.js +41 -0
  3. package/dist/candid/sns_governance.d.ts +30 -0
  4. package/dist/candid/sns_governance.did +36 -1
  5. package/dist/candid/sns_governance.idl.js +45 -0
  6. package/dist/candid/sns_governance_test.certified.idl.js +41 -0
  7. package/dist/candid/sns_governance_test.d.ts +30 -0
  8. package/dist/candid/sns_governance_test.did +37 -1
  9. package/dist/candid/sns_governance_test.idl.js +45 -0
  10. package/dist/candid/sns_root.certified.idl.js +9 -0
  11. package/dist/candid/sns_root.d.ts +12 -1
  12. package/dist/candid/sns_root.did +11 -1
  13. package/dist/candid/sns_root.idl.js +9 -0
  14. package/dist/candid/sns_swap.certified.idl.js +7 -0
  15. package/dist/candid/sns_swap.d.ts +7 -0
  16. package/dist/candid/sns_swap.did +9 -1
  17. package/dist/candid/sns_swap.idl.js +7 -0
  18. package/dist/cjs/index.cjs.js +1 -1
  19. package/dist/cjs/index.cjs.js.map +3 -3
  20. package/dist/esm/chunk-7RSE53BN.js +2 -0
  21. package/dist/esm/chunk-7RSE53BN.js.map +7 -0
  22. package/dist/esm/chunk-PUAIJI6X.js +2 -0
  23. package/dist/esm/chunk-PUAIJI6X.js.map +7 -0
  24. package/dist/esm/{chunk-K4OVK5J7.js → chunk-XBBCPB3E.js} +2 -2
  25. package/dist/esm/chunk-ZISK2527.js +2 -0
  26. package/dist/esm/chunk-ZISK2527.js.map +7 -0
  27. package/dist/esm/governance.canister.js +1 -1
  28. package/dist/esm/index.js +1 -1
  29. package/dist/esm/index.js.map +3 -3
  30. package/dist/esm/root.canister.js +1 -1
  31. package/dist/esm/sns.js +1 -1
  32. package/dist/esm/swap.canister.js +1 -1
  33. package/dist/types/governance.canister.d.ts +7 -2
  34. package/dist/types/types/actions.d.ts +2 -1
  35. package/dist/types/types/governance.params.d.ts +2 -0
  36. package/package.json +7 -7
  37. package/dist/esm/chunk-BKBI2NNR.js +0 -2
  38. package/dist/esm/chunk-BKBI2NNR.js.map +0 -7
  39. package/dist/esm/chunk-EHRWZZ5X.js +0 -2
  40. package/dist/esm/chunk-EHRWZZ5X.js.map +0 -7
  41. package/dist/esm/chunk-NXIGASUA.js +0 -2
  42. package/dist/esm/chunk-NXIGASUA.js.map +0 -7
  43. /package/dist/esm/{chunk-K4OVK5J7.js.map → chunk-XBBCPB3E.js.map} +0 -0
package/README.md CHANGED
@@ -100,13 +100,14 @@ Lookup for the canister ids of a Sns and initialize the wrapper to access its fe
100
100
 
101
101
  ### :factory: SnsGovernanceCanister
102
102
 
103
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L63)
103
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L65)
104
104
 
105
105
  #### Methods
106
106
 
107
107
  - [create](#gear-create)
108
108
  - [listNeurons](#gear-listneurons)
109
109
  - [listProposals](#gear-listproposals)
110
+ - [listTopics](#gear-listtopics)
110
111
  - [getProposal](#gear-getproposal)
111
112
  - [listNervousSystemFunctions](#gear-listnervoussystemfunctions)
112
113
  - [metadata](#gear-metadata)
@@ -142,7 +143,7 @@ Parameters:
142
143
 
143
144
  - `options`: Miscellaneous options to initialize the canister. Its ID being the only mandatory parammeter.
144
145
 
145
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L69)
146
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L71)
146
147
 
147
148
  ##### :gear: listNeurons
148
149
 
@@ -152,7 +153,7 @@ List the neurons of the Sns
152
153
  | ------------- | ----------------------------------------------------- |
153
154
  | `listNeurons` | `(params: SnsListNeuronsParams) => Promise<Neuron[]>` |
154
155
 
155
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L83)
156
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L85)
156
157
 
157
158
  ##### :gear: listProposals
158
159
 
@@ -162,7 +163,17 @@ List the proposals of the Sns
162
163
  | --------------- | -------------------------------------------------------------------- |
163
164
  | `listProposals` | `(params: SnsListProposalsParams) => Promise<ListProposalsResponse>` |
164
165
 
165
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L97)
166
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L99)
167
+
168
+ ##### :gear: listTopics
169
+
170
+ List the topics of the Sns
171
+
172
+ | Method | Type |
173
+ | ------------ | -------------------------------------------------------------- |
174
+ | `listTopics` | `(params: SnsListTopicsParams) => Promise<ListTopicsResponse>` |
175
+
176
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L114)
166
177
 
167
178
  ##### :gear: getProposal
168
179
 
@@ -172,7 +183,7 @@ Get the proposal of the Sns
172
183
  | ------------- | --------------------------------------------------------- |
173
184
  | `getProposal` | `(params: SnsGetProposalParams) => Promise<ProposalData>` |
174
185
 
175
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L111)
186
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L125)
176
187
 
177
188
  ##### :gear: listNervousSystemFunctions
178
189
 
@@ -183,7 +194,7 @@ Neurons can follow other neurons in specific Nervous System Functions.
183
194
  | ---------------------------- | ---------------------------------------------------------------------- |
184
195
  | `listNervousSystemFunctions` | `(params: QueryParams) => Promise<ListNervousSystemFunctionsResponse>` |
185
196
 
186
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L130)
197
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L144)
187
198
 
188
199
  ##### :gear: metadata
189
200
 
@@ -193,7 +204,7 @@ Get the Sns metadata (title, description, etc.)
193
204
  | ---------- | ------------------------------------------------------- |
194
205
  | `metadata` | `(params: QueryParams) => Promise<GetMetadataResponse>` |
195
206
 
196
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L138)
207
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L152)
197
208
 
198
209
  ##### :gear: nervousSystemParameters
199
210
 
@@ -203,7 +214,7 @@ Get the Sns nervous system parameters (default followees, max dissolve delay, ma
203
214
  | ------------------------- | ----------------------------------------------------------- |
204
215
  | `nervousSystemParameters` | `(params: QueryParams) => Promise<NervousSystemParameters>` |
205
216
 
206
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L144)
217
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L158)
207
218
 
208
219
  ##### :gear: getNeuron
209
220
 
@@ -213,7 +224,7 @@ Get the neuron of the Sns
213
224
  | ----------- | ------------------------------------------------- |
214
225
  | `getNeuron` | `(params: SnsGetNeuronParams) => Promise<Neuron>` |
215
226
 
216
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L152)
227
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L166)
217
228
 
218
229
  ##### :gear: queryNeuron
219
230
 
@@ -223,7 +234,7 @@ Same as `getNeuron` but returns undefined instead of raising error when not foun
223
234
  | ------------- | -------------------------------------------------------------- |
224
235
  | `queryNeuron` | `(params: SnsGetNeuronParams) => Promise<Neuron or undefined>` |
225
236
 
226
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L170)
237
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L184)
227
238
 
228
239
  ##### :gear: manageNeuron
229
240
 
@@ -233,7 +244,7 @@ Manage neuron. For advanced users.
233
244
  | -------------- | ---------------------------------------------------------- |
234
245
  | `manageNeuron` | `(request: ManageNeuron) => Promise<ManageNeuronResponse>` |
235
246
 
236
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L190)
247
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L204)
237
248
 
238
249
  ##### :gear: addNeuronPermissions
239
250
 
@@ -243,7 +254,7 @@ Add permissions to a neuron for a specific principal
243
254
  | ---------------------- | ------------------------------------------------------- |
244
255
  | `addNeuronPermissions` | `(params: SnsNeuronPermissionsParams) => Promise<void>` |
245
256
 
246
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L203)
257
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L217)
247
258
 
248
259
  ##### :gear: removeNeuronPermissions
249
260
 
@@ -253,7 +264,7 @@ Remove permissions to a neuron for a specific principal
253
264
  | ------------------------- | ------------------------------------------------------- |
254
265
  | `removeNeuronPermissions` | `(params: SnsNeuronPermissionsParams) => Promise<void>` |
255
266
 
256
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L213)
267
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L227)
257
268
 
258
269
  ##### :gear: splitNeuron
259
270
 
@@ -263,7 +274,7 @@ Split neuron
263
274
  | ------------- | ------------------------------------------------------------------ |
264
275
  | `splitNeuron` | `(params: SnsSplitNeuronParams) => Promise<NeuronId or undefined>` |
265
276
 
266
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L223)
277
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L237)
267
278
 
268
279
  ##### :gear: disburse
269
280
 
@@ -273,7 +284,7 @@ Disburse neuron on Account
273
284
  | ---------- | ---------------------------------------------------- |
274
285
  | `disburse` | `(params: SnsDisburseNeuronParams) => Promise<void>` |
275
286
 
276
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L254)
287
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L268)
277
288
 
278
289
  ##### :gear: startDissolving
279
290
 
@@ -283,7 +294,7 @@ Start dissolving process of a neuron
283
294
  | ----------------- | --------------------------------------- |
284
295
  | `startDissolving` | `(neuronId: NeuronId) => Promise<void>` |
285
296
 
286
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L262)
297
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L276)
287
298
 
288
299
  ##### :gear: stopDissolving
289
300
 
@@ -293,7 +304,7 @@ Stop dissolving process of a neuron
293
304
  | ---------------- | --------------------------------------- |
294
305
  | `stopDissolving` | `(neuronId: NeuronId) => Promise<void>` |
295
306
 
296
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L270)
307
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L284)
297
308
 
298
309
  ##### :gear: stakeMaturity
299
310
 
@@ -308,7 +319,7 @@ Parameters:
308
319
  - `neuronId`: The id of the neuron for which to stake the maturity
309
320
  - `percentageToStake`: Optional. Percentage of the current maturity to stake. If not provided, all of the neuron's current maturity will be staked.
310
321
 
311
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L282)
322
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L296)
312
323
 
313
324
  ##### :gear: disburseMaturity
314
325
 
@@ -324,7 +335,7 @@ Parameters:
324
335
  - `neuronId`: The id of the neuron for which to disburse the maturity
325
336
  - `percentageToDisburse`: What percentage of the available maturity to disburse.
326
337
 
327
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L303)
338
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L317)
328
339
 
329
340
  ##### :gear: autoStakeMaturity
330
341
 
@@ -339,7 +350,7 @@ Parameters:
339
350
  - `neuronId`: The id of the neuron for which to request a change of the auto stake feature
340
351
  - `autoStake`: `true` to enable the auto-stake maturity for this neuron, `false` to turn it off
341
352
 
342
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L319)
353
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L333)
343
354
 
344
355
  ##### :gear: setDissolveTimestamp
345
356
 
@@ -349,7 +360,7 @@ Increase dissolve delay of a neuron
349
360
  | ---------------------- | ---------------------------------------------------------- |
350
361
  | `setDissolveTimestamp` | `(params: SnsSetDissolveTimestampParams) => Promise<void>` |
351
362
 
352
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L329)
363
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L343)
353
364
 
354
365
  ##### :gear: increaseDissolveDelay
355
366
 
@@ -359,7 +370,7 @@ Increase dissolve delay of a neuron
359
370
  | ----------------------- | ----------------------------------------------------------- |
360
371
  | `increaseDissolveDelay` | `(params: SnsIncreaseDissolveDelayParams) => Promise<void>` |
361
372
 
362
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L339)
373
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L353)
363
374
 
364
375
  ##### :gear: setTopicFollowees
365
376
 
@@ -369,7 +380,7 @@ Sets followees of a neuron for a specific Nervous System Function (topic)
369
380
  | ------------------- | ------------------------------------------------- |
370
381
  | `setTopicFollowees` | `(params: SnsSetTopicFollowees) => Promise<void>` |
371
382
 
372
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L349)
383
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L363)
373
384
 
374
385
  ##### :gear: registerVote
375
386
 
@@ -379,7 +390,7 @@ Registers vote for a proposal from the neuron passed.
379
390
  | -------------- | -------------------------------------------------- |
380
391
  | `registerVote` | `(params: SnsRegisterVoteParams) => Promise<void>` |
381
392
 
382
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L357)
393
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L371)
383
394
 
384
395
  ##### :gear: refreshNeuron
385
396
 
@@ -389,7 +400,7 @@ Refresh neuron
389
400
  | --------------- | --------------------------------------- |
390
401
  | `refreshNeuron` | `(neuronId: NeuronId) => Promise<void>` |
391
402
 
392
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L365)
403
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L379)
393
404
 
394
405
  ##### :gear: claimNeuron
395
406
 
@@ -399,7 +410,7 @@ Claim neuron
399
410
  | ------------- | -------------------------------------------------------------------------------- |
400
411
  | `claimNeuron` | `({ memo, controller, subaccount, }: SnsClaimNeuronParams) => Promise<NeuronId>` |
401
412
 
402
- [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L375)
413
+ [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/sns/src/governance.canister.ts#L389)
403
414
 
404
415
  ### :factory: SnsRootCanister
405
416
 
@@ -19,7 +19,17 @@ export const idlFactory = ({ IDL }) => {
19
19
  'response_timestamp_seconds' : IDL.Opt(IDL.Nat64),
20
20
  'requested_timestamp_seconds' : IDL.Opt(IDL.Nat64),
21
21
  });
22
+ const Topic = IDL.Variant({
23
+ 'DappCanisterManagement' : IDL.Null,
24
+ 'DaoCommunitySettings' : IDL.Null,
25
+ 'ApplicationBusinessLogic' : IDL.Null,
26
+ 'CriticalDappOperations' : IDL.Null,
27
+ 'TreasuryAssetManagement' : IDL.Null,
28
+ 'Governance' : IDL.Null,
29
+ 'SnsFrameworkManagement' : IDL.Null,
30
+ });
22
31
  const GenericNervousSystemFunction = IDL.Record({
32
+ 'topic' : IDL.Opt(Topic),
23
33
  'validator_canister_id' : IDL.Opt(IDL.Principal),
24
34
  'target_canister_id' : IDL.Opt(IDL.Principal),
25
35
  'validator_method_name' : IDL.Opt(IDL.Text),
@@ -541,11 +551,18 @@ export const idlFactory = ({ IDL }) => {
541
551
  'memory_allocation' : IDL.Nat,
542
552
  'compute_allocation' : IDL.Nat,
543
553
  });
554
+ const QueryStats = IDL.Record({
555
+ 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),
556
+ 'num_instructions_total' : IDL.Opt(IDL.Nat),
557
+ 'num_calls_total' : IDL.Opt(IDL.Nat),
558
+ 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),
559
+ });
544
560
  const CanisterStatusResultV2 = IDL.Record({
545
561
  'status' : CanisterStatusType,
546
562
  'memory_size' : IDL.Nat,
547
563
  'cycles' : IDL.Nat,
548
564
  'settings' : DefiniteCanisterSettingsArgs,
565
+ 'query_stats' : IDL.Opt(QueryStats),
549
566
  'idle_cycles_burned_per_day' : IDL.Nat,
550
567
  'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
551
568
  });
@@ -597,6 +614,19 @@ export const idlFactory = ({ IDL }) => {
597
614
  'include_ballots_by_caller' : IDL.Opt(IDL.Bool),
598
615
  'proposals' : IDL.Vec(ProposalData),
599
616
  });
617
+ const ListTopicsRequest = IDL.Record({});
618
+ const TopicInfo = IDL.Record({
619
+ 'native_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
620
+ 'topic' : IDL.Opt(Topic),
621
+ 'is_critical' : IDL.Opt(IDL.Bool),
622
+ 'name' : IDL.Opt(IDL.Text),
623
+ 'description' : IDL.Opt(IDL.Text),
624
+ 'custom_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
625
+ });
626
+ const ListTopicsResponse = IDL.Record({
627
+ 'uncategorized_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
628
+ 'topics' : IDL.Opt(IDL.Vec(TopicInfo)),
629
+ });
600
630
  const StakeMaturity = IDL.Record({
601
631
  'percentage_to_stake' : IDL.Opt(IDL.Nat32),
602
632
  });
@@ -707,6 +737,7 @@ export const idlFactory = ({ IDL }) => {
707
737
  ),
708
738
  'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),
709
739
  'list_proposals' : IDL.Func([ListProposals], [ListProposalsResponse], []),
740
+ 'list_topics' : IDL.Func([ListTopicsRequest], [ListTopicsResponse], []),
710
741
  'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),
711
742
  'reset_timers' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),
712
743
  'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),
@@ -732,7 +763,17 @@ export const init = ({ IDL }) => {
732
763
  'response_timestamp_seconds' : IDL.Opt(IDL.Nat64),
733
764
  'requested_timestamp_seconds' : IDL.Opt(IDL.Nat64),
734
765
  });
766
+ const Topic = IDL.Variant({
767
+ 'DappCanisterManagement' : IDL.Null,
768
+ 'DaoCommunitySettings' : IDL.Null,
769
+ 'ApplicationBusinessLogic' : IDL.Null,
770
+ 'CriticalDappOperations' : IDL.Null,
771
+ 'TreasuryAssetManagement' : IDL.Null,
772
+ 'Governance' : IDL.Null,
773
+ 'SnsFrameworkManagement' : IDL.Null,
774
+ });
735
775
  const GenericNervousSystemFunction = IDL.Record({
776
+ 'topic' : IDL.Opt(Topic),
736
777
  'validator_canister_id' : IDL.Opt(IDL.Principal),
737
778
  'target_canister_id' : IDL.Opt(IDL.Principal),
738
779
  'validator_method_name' : IDL.Opt(IDL.Text),
@@ -62,6 +62,7 @@ export interface CanisterStatusResultV2 {
62
62
  memory_size: bigint;
63
63
  cycles: bigint;
64
64
  settings: DefiniteCanisterSettingsArgs;
65
+ query_stats: [] | [QueryStats];
65
66
  idle_cycles_burned_per_day: bigint;
66
67
  module_hash: [] | [Uint8Array | number[]];
67
68
  }
@@ -200,6 +201,7 @@ export type FunctionType =
200
201
  | { NativeNervousSystemFunction: {} }
201
202
  | { GenericNervousSystemFunction: GenericNervousSystemFunction };
202
203
  export interface GenericNervousSystemFunction {
204
+ topic: [] | [Topic];
203
205
  validator_canister_id: [] | [Principal];
204
206
  target_canister_id: [] | [Principal];
205
207
  validator_method_name: [] | [string];
@@ -331,6 +333,11 @@ export interface ListProposalsResponse {
331
333
  include_ballots_by_caller: [] | [boolean];
332
334
  proposals: Array<ProposalData>;
333
335
  }
336
+ export type ListTopicsRequest = {};
337
+ export interface ListTopicsResponse {
338
+ uncategorized_functions: [] | [Array<NervousSystemFunction>];
339
+ topics: [] | [Array<TopicInfo>];
340
+ }
334
341
  export interface ManageDappCanisterSettings {
335
342
  freezing_threshold: [] | [bigint];
336
343
  wasm_memory_threshold: [] | [bigint];
@@ -529,6 +536,12 @@ export interface ProposalData {
529
536
  export interface ProposalId {
530
537
  id: bigint;
531
538
  }
539
+ export interface QueryStats {
540
+ response_payload_bytes_total: [] | [bigint];
541
+ num_instructions_total: [] | [bigint];
542
+ num_calls_total: [] | [bigint];
543
+ request_payload_bytes_total: [] | [bigint];
544
+ }
532
545
  export interface RegisterDappCanisters {
533
546
  canister_ids: Array<Principal>;
534
547
  }
@@ -610,6 +623,22 @@ export interface Timers {
610
623
  export interface Tokens {
611
624
  e8s: [] | [bigint];
612
625
  }
626
+ export type Topic =
627
+ | { DappCanisterManagement: null }
628
+ | { DaoCommunitySettings: null }
629
+ | { ApplicationBusinessLogic: null }
630
+ | { CriticalDappOperations: null }
631
+ | { TreasuryAssetManagement: null }
632
+ | { Governance: null }
633
+ | { SnsFrameworkManagement: null };
634
+ export interface TopicInfo {
635
+ native_functions: [] | [Array<NervousSystemFunction>];
636
+ topic: [] | [Topic];
637
+ is_critical: [] | [boolean];
638
+ name: [] | [string];
639
+ description: [] | [string];
640
+ custom_functions: [] | [Array<NervousSystemFunction>];
641
+ }
613
642
  export interface TransferSnsTreasuryFunds {
614
643
  from_treasury: number;
615
644
  to_principal: [] | [Principal];
@@ -736,6 +765,7 @@ export interface _SERVICE {
736
765
  >;
737
766
  list_neurons: ActorMethod<[ListNeurons], ListNeuronsResponse>;
738
767
  list_proposals: ActorMethod<[ListProposals], ListProposalsResponse>;
768
+ list_topics: ActorMethod<[ListTopicsRequest], ListTopicsResponse>;
739
769
  manage_neuron: ActorMethod<[ManageNeuron], ManageNeuronResponse>;
740
770
  reset_timers: ActorMethod<[{}], {}>;
741
771
  set_mode: ActorMethod<[SetMode], {}>;
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 4ba5834 (2025-01-22 tags: release-2025-01-23_03-04-hashes-in-blocks) 'rs/sns/governance/canister/governance.did' by import-candid
1
+ // Generated from IC repo commit 2f02a66 (2025-02-13 tags: release-2025-02-20_10-16-disable-best-effort-messaging) 'rs/sns/governance/canister/governance.did' by import-candid
2
2
  type Account = record {
3
3
  owner : opt principal;
4
4
  subaccount : opt Subaccount;
@@ -56,6 +56,7 @@ type CanisterStatusResultV2 = record {
56
56
  settings : DefiniteCanisterSettingsArgs;
57
57
  idle_cycles_burned_per_day : nat;
58
58
  module_hash : opt blob;
59
+ query_stats : opt QueryStats;
59
60
  };
60
61
 
61
62
  type CanisterStatusType = variant {
@@ -226,6 +227,7 @@ type GenericNervousSystemFunction = record {
226
227
  target_canister_id : opt principal;
227
228
  validator_method_name : opt text;
228
229
  target_method_name : opt text;
230
+ topic: opt Topic;
229
231
  };
230
232
 
231
233
  type GetMaturityModulationResponse = record {
@@ -611,6 +613,13 @@ type ProposalId = record {
611
613
  id : nat64;
612
614
  };
613
615
 
616
+ type QueryStats = record {
617
+ num_calls_total : opt nat;
618
+ num_instructions_total : opt nat;
619
+ request_payload_bytes_total : opt nat;
620
+ response_payload_bytes_total : opt nat;
621
+ };
622
+
614
623
  type RegisterDappCanisters = record {
615
624
  canister_ids : vec principal;
616
625
  };
@@ -832,6 +841,31 @@ type GetUpgradeJournalResponse = record {
832
841
  upgrade_journal_entry_count: opt nat64;
833
842
  };
834
843
 
844
+ type Topic = variant {
845
+ DaoCommunitySettings;
846
+ SnsFrameworkManagement;
847
+ DappCanisterManagement;
848
+ ApplicationBusinessLogic;
849
+ Governance;
850
+ TreasuryAssetManagement;
851
+ CriticalDappOperations;
852
+ };
853
+
854
+ type TopicInfo = record {
855
+ topic : opt Topic;
856
+ name : opt text;
857
+ description : opt text;
858
+ native_functions : opt vec NervousSystemFunction;
859
+ custom_functions : opt vec NervousSystemFunction;
860
+ is_critical : opt bool;
861
+ };
862
+
863
+ type ListTopicsRequest = record {};
864
+ type ListTopicsResponse = record {
865
+ topics: opt vec TopicInfo;
866
+ uncategorized_functions: opt vec NervousSystemFunction
867
+ };
868
+
835
869
  service : (Governance) -> {
836
870
  claim_swap_neurons : (ClaimSwapNeuronsRequest) -> (ClaimSwapNeuronsResponse);
837
871
  fail_stuck_upgrade_in_progress : (record {}) -> (record {});
@@ -850,6 +884,7 @@ service : (Governance) -> {
850
884
  list_nervous_system_functions : () -> (ListNervousSystemFunctionsResponse) query;
851
885
  list_neurons : (ListNeurons) -> (ListNeuronsResponse) query;
852
886
  list_proposals : (ListProposals) -> (ListProposalsResponse) query;
887
+ list_topics : (ListTopicsRequest) -> (ListTopicsResponse) query;
853
888
  manage_neuron : (ManageNeuron) -> (ManageNeuronResponse);
854
889
  set_mode : (SetMode) -> (record {});
855
890
  reset_timers : (record {}) -> (record {});
@@ -19,7 +19,17 @@ export const idlFactory = ({ IDL }) => {
19
19
  'response_timestamp_seconds' : IDL.Opt(IDL.Nat64),
20
20
  'requested_timestamp_seconds' : IDL.Opt(IDL.Nat64),
21
21
  });
22
+ const Topic = IDL.Variant({
23
+ 'DappCanisterManagement' : IDL.Null,
24
+ 'DaoCommunitySettings' : IDL.Null,
25
+ 'ApplicationBusinessLogic' : IDL.Null,
26
+ 'CriticalDappOperations' : IDL.Null,
27
+ 'TreasuryAssetManagement' : IDL.Null,
28
+ 'Governance' : IDL.Null,
29
+ 'SnsFrameworkManagement' : IDL.Null,
30
+ });
22
31
  const GenericNervousSystemFunction = IDL.Record({
32
+ 'topic' : IDL.Opt(Topic),
23
33
  'validator_canister_id' : IDL.Opt(IDL.Principal),
24
34
  'target_canister_id' : IDL.Opt(IDL.Principal),
25
35
  'validator_method_name' : IDL.Opt(IDL.Text),
@@ -541,11 +551,18 @@ export const idlFactory = ({ IDL }) => {
541
551
  'memory_allocation' : IDL.Nat,
542
552
  'compute_allocation' : IDL.Nat,
543
553
  });
554
+ const QueryStats = IDL.Record({
555
+ 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),
556
+ 'num_instructions_total' : IDL.Opt(IDL.Nat),
557
+ 'num_calls_total' : IDL.Opt(IDL.Nat),
558
+ 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),
559
+ });
544
560
  const CanisterStatusResultV2 = IDL.Record({
545
561
  'status' : CanisterStatusType,
546
562
  'memory_size' : IDL.Nat,
547
563
  'cycles' : IDL.Nat,
548
564
  'settings' : DefiniteCanisterSettingsArgs,
565
+ 'query_stats' : IDL.Opt(QueryStats),
549
566
  'idle_cycles_burned_per_day' : IDL.Nat,
550
567
  'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
551
568
  });
@@ -597,6 +614,19 @@ export const idlFactory = ({ IDL }) => {
597
614
  'include_ballots_by_caller' : IDL.Opt(IDL.Bool),
598
615
  'proposals' : IDL.Vec(ProposalData),
599
616
  });
617
+ const ListTopicsRequest = IDL.Record({});
618
+ const TopicInfo = IDL.Record({
619
+ 'native_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
620
+ 'topic' : IDL.Opt(Topic),
621
+ 'is_critical' : IDL.Opt(IDL.Bool),
622
+ 'name' : IDL.Opt(IDL.Text),
623
+ 'description' : IDL.Opt(IDL.Text),
624
+ 'custom_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
625
+ });
626
+ const ListTopicsResponse = IDL.Record({
627
+ 'uncategorized_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
628
+ 'topics' : IDL.Opt(IDL.Vec(TopicInfo)),
629
+ });
600
630
  const StakeMaturity = IDL.Record({
601
631
  'percentage_to_stake' : IDL.Opt(IDL.Nat32),
602
632
  });
@@ -715,6 +745,11 @@ export const idlFactory = ({ IDL }) => {
715
745
  [ListProposalsResponse],
716
746
  ['query'],
717
747
  ),
748
+ 'list_topics' : IDL.Func(
749
+ [ListTopicsRequest],
750
+ [ListTopicsResponse],
751
+ ['query'],
752
+ ),
718
753
  'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),
719
754
  'reset_timers' : IDL.Func([IDL.Record({})], [IDL.Record({})], []),
720
755
  'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),
@@ -740,7 +775,17 @@ export const init = ({ IDL }) => {
740
775
  'response_timestamp_seconds' : IDL.Opt(IDL.Nat64),
741
776
  'requested_timestamp_seconds' : IDL.Opt(IDL.Nat64),
742
777
  });
778
+ const Topic = IDL.Variant({
779
+ 'DappCanisterManagement' : IDL.Null,
780
+ 'DaoCommunitySettings' : IDL.Null,
781
+ 'ApplicationBusinessLogic' : IDL.Null,
782
+ 'CriticalDappOperations' : IDL.Null,
783
+ 'TreasuryAssetManagement' : IDL.Null,
784
+ 'Governance' : IDL.Null,
785
+ 'SnsFrameworkManagement' : IDL.Null,
786
+ });
743
787
  const GenericNervousSystemFunction = IDL.Record({
788
+ 'topic' : IDL.Opt(Topic),
744
789
  'validator_canister_id' : IDL.Opt(IDL.Principal),
745
790
  'target_canister_id' : IDL.Opt(IDL.Principal),
746
791
  'validator_method_name' : IDL.Opt(IDL.Text),
@@ -19,7 +19,17 @@ export const idlFactory = ({ IDL }) => {
19
19
  'response_timestamp_seconds' : IDL.Opt(IDL.Nat64),
20
20
  'requested_timestamp_seconds' : IDL.Opt(IDL.Nat64),
21
21
  });
22
+ const Topic = IDL.Variant({
23
+ 'DappCanisterManagement' : IDL.Null,
24
+ 'DaoCommunitySettings' : IDL.Null,
25
+ 'ApplicationBusinessLogic' : IDL.Null,
26
+ 'CriticalDappOperations' : IDL.Null,
27
+ 'TreasuryAssetManagement' : IDL.Null,
28
+ 'Governance' : IDL.Null,
29
+ 'SnsFrameworkManagement' : IDL.Null,
30
+ });
22
31
  const GenericNervousSystemFunction = IDL.Record({
32
+ 'topic' : IDL.Opt(Topic),
23
33
  'validator_canister_id' : IDL.Opt(IDL.Principal),
24
34
  'target_canister_id' : IDL.Opt(IDL.Principal),
25
35
  'validator_method_name' : IDL.Opt(IDL.Text),
@@ -552,11 +562,18 @@ export const idlFactory = ({ IDL }) => {
552
562
  'memory_allocation' : IDL.Nat,
553
563
  'compute_allocation' : IDL.Nat,
554
564
  });
565
+ const QueryStats = IDL.Record({
566
+ 'response_payload_bytes_total' : IDL.Opt(IDL.Nat),
567
+ 'num_instructions_total' : IDL.Opt(IDL.Nat),
568
+ 'num_calls_total' : IDL.Opt(IDL.Nat),
569
+ 'request_payload_bytes_total' : IDL.Opt(IDL.Nat),
570
+ });
555
571
  const CanisterStatusResultV2 = IDL.Record({
556
572
  'status' : CanisterStatusType,
557
573
  'memory_size' : IDL.Nat,
558
574
  'cycles' : IDL.Nat,
559
575
  'settings' : DefiniteCanisterSettingsArgs,
576
+ 'query_stats' : IDL.Opt(QueryStats),
560
577
  'idle_cycles_burned_per_day' : IDL.Nat,
561
578
  'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
562
579
  });
@@ -608,6 +625,19 @@ export const idlFactory = ({ IDL }) => {
608
625
  'include_ballots_by_caller' : IDL.Opt(IDL.Bool),
609
626
  'proposals' : IDL.Vec(ProposalData),
610
627
  });
628
+ const ListTopicsRequest = IDL.Record({});
629
+ const TopicInfo = IDL.Record({
630
+ 'native_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
631
+ 'topic' : IDL.Opt(Topic),
632
+ 'is_critical' : IDL.Opt(IDL.Bool),
633
+ 'name' : IDL.Opt(IDL.Text),
634
+ 'description' : IDL.Opt(IDL.Text),
635
+ 'custom_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
636
+ });
637
+ const ListTopicsResponse = IDL.Record({
638
+ 'uncategorized_functions' : IDL.Opt(IDL.Vec(NervousSystemFunction)),
639
+ 'topics' : IDL.Opt(IDL.Vec(TopicInfo)),
640
+ });
611
641
  const StakeMaturity = IDL.Record({
612
642
  'percentage_to_stake' : IDL.Opt(IDL.Nat32),
613
643
  });
@@ -728,6 +758,7 @@ export const idlFactory = ({ IDL }) => {
728
758
  ),
729
759
  'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),
730
760
  'list_proposals' : IDL.Func([ListProposals], [ListProposalsResponse], []),
761
+ 'list_topics' : IDL.Func([ListTopicsRequest], [ListTopicsResponse], []),
731
762
  'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),
732
763
  'mint_tokens' : IDL.Func([MintTokensRequest], [IDL.Record({})], []),
733
764
  'refresh_cached_upgrade_steps' : IDL.Func(
@@ -760,7 +791,17 @@ export const init = ({ IDL }) => {
760
791
  'response_timestamp_seconds' : IDL.Opt(IDL.Nat64),
761
792
  'requested_timestamp_seconds' : IDL.Opt(IDL.Nat64),
762
793
  });
794
+ const Topic = IDL.Variant({
795
+ 'DappCanisterManagement' : IDL.Null,
796
+ 'DaoCommunitySettings' : IDL.Null,
797
+ 'ApplicationBusinessLogic' : IDL.Null,
798
+ 'CriticalDappOperations' : IDL.Null,
799
+ 'TreasuryAssetManagement' : IDL.Null,
800
+ 'Governance' : IDL.Null,
801
+ 'SnsFrameworkManagement' : IDL.Null,
802
+ });
763
803
  const GenericNervousSystemFunction = IDL.Record({
804
+ 'topic' : IDL.Opt(Topic),
764
805
  'validator_canister_id' : IDL.Opt(IDL.Principal),
765
806
  'target_canister_id' : IDL.Opt(IDL.Principal),
766
807
  'validator_method_name' : IDL.Opt(IDL.Text),