@dfinity/sns 3.6.0 → 3.7.0-beta-2025-06-28

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 (49) hide show
  1. package/README.md +82 -82
  2. package/dist/candid/sns_governance.certified.idl.js +61 -10
  3. package/dist/candid/sns_governance.d.ts +28 -0
  4. package/dist/candid/sns_governance.did +55 -1
  5. package/dist/candid/sns_governance.idl.js +65 -10
  6. package/dist/candid/sns_governance_test.certified.idl.js +61 -10
  7. package/dist/candid/sns_governance_test.d.ts +28 -0
  8. package/dist/candid/sns_governance_test.did +55 -1
  9. package/dist/candid/sns_governance_test.idl.js +65 -10
  10. package/dist/candid/sns_root.certified.idl.js +0 -2
  11. package/dist/candid/sns_root.d.ts +0 -2
  12. package/dist/candid/sns_root.did +1 -3
  13. package/dist/candid/sns_root.idl.js +0 -2
  14. package/dist/candid/sns_swap.did +1 -1
  15. package/dist/cjs/index.cjs.js +1 -1
  16. package/dist/cjs/index.cjs.js.map +4 -4
  17. package/dist/esm/chunk-56ABQWOI.js +2 -0
  18. package/dist/esm/chunk-56ABQWOI.js.map +7 -0
  19. package/dist/esm/chunk-C4535TGA.js +7 -0
  20. package/dist/esm/chunk-C4535TGA.js.map +7 -0
  21. package/dist/esm/{chunk-7RSE53BN.js → chunk-IMCH2CXJ.js} +2 -2
  22. package/dist/esm/chunk-IMCH2CXJ.js.map +7 -0
  23. package/dist/esm/chunk-KCQOYKOJ.js +2 -0
  24. package/dist/esm/chunk-KCQOYKOJ.js.map +7 -0
  25. package/dist/esm/chunk-RABWAJNE.js +2 -0
  26. package/dist/esm/chunk-RABWAJNE.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/sns.wrapper.js +1 -1
  33. package/dist/esm/swap.canister.js +1 -1
  34. package/dist/types/governance.canister.d.ts +1 -2
  35. package/dist/types/sns.d.ts +1 -1
  36. package/dist/types/sns.wrapper.d.ts +2 -2
  37. package/dist/types/swap.canister.d.ts +1 -2
  38. package/dist/types/types/actions.d.ts +7 -1
  39. package/dist/types/types/governance.params.d.ts +1 -2
  40. package/package.json +7 -7
  41. package/dist/esm/chunk-7RSE53BN.js.map +0 -7
  42. package/dist/esm/chunk-HIRPCVPC.js +0 -2
  43. package/dist/esm/chunk-HIRPCVPC.js.map +0 -7
  44. package/dist/esm/chunk-PUAIJI6X.js +0 -2
  45. package/dist/esm/chunk-PUAIJI6X.js.map +0 -7
  46. package/dist/esm/chunk-TJDVNGQZ.js +0 -7
  47. package/dist/esm/chunk-TJDVNGQZ.js.map +0 -7
  48. package/dist/esm/chunk-V7RSNTZY.js +0 -2
  49. package/dist/esm/chunk-V7RSNTZY.js.map +0 -7
@@ -1,5 +1,6 @@
1
1
  /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */
2
2
  export const idlFactory = ({ IDL }) => {
3
+ const PreciseValue = IDL.Rec();
3
4
  const Timers = IDL.Record({
4
5
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
5
6
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -247,6 +248,27 @@ export const idlFactory = ({ IDL }) => {
247
248
  const SetTopicsForCustomProposals = IDL.Record({
248
249
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
249
250
  });
251
+ const ChunkedCanisterWasm = IDL.Record({
252
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
253
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
254
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
255
+ });
256
+ PreciseValue.fill(
257
+ IDL.Variant({
258
+ 'Int' : IDL.Int64,
259
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
260
+ 'Nat' : IDL.Nat64,
261
+ 'Blob' : IDL.Vec(IDL.Nat8),
262
+ 'Bool' : IDL.Bool,
263
+ 'Text' : IDL.Text,
264
+ 'Array' : IDL.Vec(PreciseValue),
265
+ })
266
+ );
267
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
268
+ const RegisterExtension = IDL.Record({
269
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
270
+ 'extension_init' : IDL.Opt(ExtensionInit),
271
+ });
250
272
  const RegisterDappCanisters = IDL.Record({
251
273
  'canister_ids' : IDL.Vec(IDL.Principal),
252
274
  });
@@ -257,11 +279,6 @@ export const idlFactory = ({ IDL }) => {
257
279
  'memo' : IDL.Opt(IDL.Nat64),
258
280
  'amount_e8s' : IDL.Nat64,
259
281
  });
260
- const ChunkedCanisterWasm = IDL.Record({
261
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
262
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
263
- 'store_canister_id' : IDL.Opt(IDL.Principal),
264
- });
265
282
  const UpgradeSnsControlledCanister = IDL.Record({
266
283
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
267
284
  'mode' : IDL.Opt(IDL.Int32),
@@ -305,6 +322,7 @@ export const idlFactory = ({ IDL }) => {
305
322
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
306
323
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
307
324
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
325
+ 'RegisterExtension' : RegisterExtension,
308
326
  'UpgradeSnsToNextVersion' : IDL.Record({}),
309
327
  'RegisterDappCanisters' : RegisterDappCanisters,
310
328
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -552,6 +570,20 @@ export const idlFactory = ({ IDL }) => {
552
570
  'name' : IDL.Opt(IDL.Text),
553
571
  'description' : IDL.Opt(IDL.Text),
554
572
  });
573
+ const GetMetricsRequest = IDL.Record({
574
+ 'time_window_seconds' : IDL.Opt(IDL.Nat64),
575
+ });
576
+ const Metrics = IDL.Record({
577
+ 'last_ledger_block_timestamp' : IDL.Opt(IDL.Nat64),
578
+ 'num_recently_submitted_proposals' : IDL.Opt(IDL.Nat64),
579
+ });
580
+ const GetMetricsResult = IDL.Variant({
581
+ 'Ok' : Metrics,
582
+ 'Err' : GovernanceError,
583
+ });
584
+ const GetMetricsResponse = IDL.Record({
585
+ 'get_metrics_result' : IDL.Opt(GetMetricsResult),
586
+ });
555
587
  const GetModeResponse = IDL.Record({ 'mode' : IDL.Opt(IDL.Int32) });
556
588
  const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });
557
589
  const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });
@@ -730,6 +762,7 @@ export const idlFactory = ({ IDL }) => {
730
762
  [],
731
763
  ),
732
764
  'get_metadata' : IDL.Func([IDL.Record({})], [GetMetadataResponse], []),
765
+ 'get_metrics' : IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),
733
766
  'get_mode' : IDL.Func([IDL.Record({})], [GetModeResponse], []),
734
767
  'get_nervous_system_parameters' : IDL.Func(
735
768
  [IDL.Null],
@@ -773,6 +806,7 @@ export const idlFactory = ({ IDL }) => {
773
806
  });
774
807
  };
775
808
  export const init = ({ IDL }) => {
809
+ const PreciseValue = IDL.Rec();
776
810
  const Timers = IDL.Record({
777
811
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
778
812
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -1020,6 +1054,27 @@ export const init = ({ IDL }) => {
1020
1054
  const SetTopicsForCustomProposals = IDL.Record({
1021
1055
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
1022
1056
  });
1057
+ const ChunkedCanisterWasm = IDL.Record({
1058
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1059
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1060
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
1061
+ });
1062
+ PreciseValue.fill(
1063
+ IDL.Variant({
1064
+ 'Int' : IDL.Int64,
1065
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
1066
+ 'Nat' : IDL.Nat64,
1067
+ 'Blob' : IDL.Vec(IDL.Nat8),
1068
+ 'Bool' : IDL.Bool,
1069
+ 'Text' : IDL.Text,
1070
+ 'Array' : IDL.Vec(PreciseValue),
1071
+ })
1072
+ );
1073
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
1074
+ const RegisterExtension = IDL.Record({
1075
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
1076
+ 'extension_init' : IDL.Opt(ExtensionInit),
1077
+ });
1023
1078
  const RegisterDappCanisters = IDL.Record({
1024
1079
  'canister_ids' : IDL.Vec(IDL.Principal),
1025
1080
  });
@@ -1030,11 +1085,6 @@ export const init = ({ IDL }) => {
1030
1085
  'memo' : IDL.Opt(IDL.Nat64),
1031
1086
  'amount_e8s' : IDL.Nat64,
1032
1087
  });
1033
- const ChunkedCanisterWasm = IDL.Record({
1034
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1035
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1036
- 'store_canister_id' : IDL.Opt(IDL.Principal),
1037
- });
1038
1088
  const UpgradeSnsControlledCanister = IDL.Record({
1039
1089
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
1040
1090
  'mode' : IDL.Opt(IDL.Int32),
@@ -1078,6 +1128,7 @@ export const init = ({ IDL }) => {
1078
1128
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
1079
1129
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
1080
1130
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
1131
+ 'RegisterExtension' : RegisterExtension,
1081
1132
  'UpgradeSnsToNextVersion' : IDL.Record({}),
1082
1133
  'RegisterDappCanisters' : RegisterDappCanisters,
1083
1134
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -14,6 +14,7 @@ export type Action =
14
14
  | { ManageDappCanisterSettings: ManageDappCanisterSettings }
15
15
  | { RemoveGenericNervousSystemFunction: bigint }
16
16
  | { SetTopicsForCustomProposals: SetTopicsForCustomProposals }
17
+ | { RegisterExtension: RegisterExtension }
17
18
  | { UpgradeSnsToNextVersion: {} }
18
19
  | { RegisterDappCanisters: RegisterDappCanisters }
19
20
  | { TransferSnsTreasuryFunds: TransferSnsTreasuryFunds }
@@ -190,6 +191,9 @@ export interface ExecuteGenericNervousSystemFunction {
190
191
  function_id: bigint;
191
192
  payload: Uint8Array | number[];
192
193
  }
194
+ export interface ExtensionInit {
195
+ value: [] | [PreciseValue];
196
+ }
193
197
  export interface FinalizeDisburseMaturity {
194
198
  amount_to_be_disbursed_e8s: bigint;
195
199
  to_account: [] | [Account];
@@ -228,6 +232,13 @@ export interface GetMetadataResponse {
228
232
  name: [] | [string];
229
233
  description: [] | [string];
230
234
  }
235
+ export interface GetMetricsRequest {
236
+ time_window_seconds: [] | [bigint];
237
+ }
238
+ export interface GetMetricsResponse {
239
+ get_metrics_result: [] | [GetMetricsResult];
240
+ }
241
+ export type GetMetricsResult = { Ok: Metrics } | { Err: GovernanceError };
231
242
  export interface GetModeResponse {
232
243
  mode: [] | [number];
233
244
  }
@@ -396,6 +407,10 @@ export interface MergeMaturityResponse {
396
407
  merged_maturity_e8s: bigint;
397
408
  new_stake_e8s: bigint;
398
409
  }
410
+ export interface Metrics {
411
+ last_ledger_block_timestamp: [] | [bigint];
412
+ num_recently_submitted_proposals: [] | [bigint];
413
+ }
399
414
  export interface MintSnsTokens {
400
415
  to_principal: [] | [Principal];
401
416
  to_subaccount: [] | [Subaccount];
@@ -508,6 +523,14 @@ export interface PendingVersion {
508
523
  export interface Percentage {
509
524
  basis_points: [] | [bigint];
510
525
  }
526
+ export type PreciseValue =
527
+ | { Int: bigint }
528
+ | { Map: Array<[string, PreciseValue]> }
529
+ | { Nat: bigint }
530
+ | { Blob: Uint8Array | number[] }
531
+ | { Bool: boolean }
532
+ | { Text: string }
533
+ | { Array: Array<PreciseValue> };
511
534
  export interface Principals {
512
535
  principals: Array<Principal>;
513
536
  }
@@ -554,6 +577,10 @@ export interface QueryStats {
554
577
  export interface RegisterDappCanisters {
555
578
  canister_ids: Array<Principal>;
556
579
  }
580
+ export interface RegisterExtension {
581
+ chunked_canister_wasm: [] | [ChunkedCanisterWasm];
582
+ extension_init: [] | [ExtensionInit];
583
+ }
557
584
  export interface RegisterVote {
558
585
  vote: number;
559
586
  proposal: [] | [ProposalId];
@@ -762,6 +789,7 @@ export interface _SERVICE {
762
789
  get_latest_reward_event: ActorMethod<[], RewardEvent>;
763
790
  get_maturity_modulation: ActorMethod<[{}], GetMaturityModulationResponse>;
764
791
  get_metadata: ActorMethod<[{}], GetMetadataResponse>;
792
+ get_metrics: ActorMethod<[GetMetricsRequest], GetMetricsResponse>;
765
793
  get_mode: ActorMethod<[{}], GetModeResponse>;
766
794
  get_nervous_system_parameters: ActorMethod<[null], NervousSystemParameters>;
767
795
  get_neuron: ActorMethod<[GetNeuron], GetNeuronResponse>;
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 579b8ba (2025-04-11 tags: release-2025-04-11_13-20-base) 'rs/sns/governance/canister/governance.did' by import-candid
1
+ // Generated from IC repo commit 9bdaa01adf (2025-06-25) 'rs/sns/governance/canister/governance.did' by import-candid
2
2
  type Account = record {
3
3
  owner : opt principal;
4
4
  subaccount : opt Subaccount;
@@ -13,6 +13,7 @@ type Action = variant {
13
13
  UpgradeSnsToNextVersion : record {};
14
14
  AdvanceSnsTargetVersion : AdvanceSnsTargetVersion;
15
15
  RegisterDappCanisters : RegisterDappCanisters;
16
+ RegisterExtension : RegisterExtension;
16
17
  TransferSnsTreasuryFunds : TransferSnsTreasuryFunds;
17
18
  UpgradeSnsControlledCanister : UpgradeSnsControlledCanister;
18
19
  DeregisterDappCanisters : DeregisterDappCanisters;
@@ -249,6 +250,24 @@ type GetMetadataResponse = record {
249
250
  description : opt text;
250
251
  };
251
252
 
253
+ type GetMetricsRequest = record {
254
+ time_window_seconds : opt nat64;
255
+ };
256
+
257
+ type Metrics = record {
258
+ num_recently_submitted_proposals : opt nat64;
259
+ last_ledger_block_timestamp : opt nat64;
260
+ };
261
+
262
+ type GetMetricsResult = variant {
263
+ Ok : Metrics;
264
+ Err : GovernanceError;
265
+ };
266
+
267
+ type GetMetricsResponse = record {
268
+ get_metrics_result : opt GetMetricsResult;
269
+ };
270
+
252
271
  type GetModeResponse = record {
253
272
  mode : opt int32;
254
273
  };
@@ -646,6 +665,40 @@ type RegisterDappCanisters = record {
646
665
  canister_ids : vec principal;
647
666
  };
648
667
 
668
+ // This type is equivalant to `ICRC3Value`, but we give it another name since it is used here not
669
+ // in the context of the ICRC-3 ledger standard. The justification is the same: The candid format
670
+ // supports sharing information even when the client and the server involved do not have the same
671
+ // schema (see the Upgrading and subtyping section of the candid spec). While this mechanism allows
672
+ // to evolve services and clients independently without breaking them, it also means that a client
673
+ // may not receive all the information that the server is sending, e.g. in case the client schema
674
+ // lacks some fields that the server schema has.
675
+ //
676
+ // This loss of information is not an option for SNS voters deciding if an extension with particular
677
+ // init args should be installed or if an extension function with particular arguments should be
678
+ // called. The client must receive the same exact data the server sent in order to verify it.
679
+ //
680
+ // Verification of a priorly installed extension is done by hashing the extension's init arg data
681
+ // and checking that the result is consistent with what has been certified by the SNS.
682
+ type PreciseValue = variant {
683
+ Bool : bool;
684
+ Blob : blob;
685
+ Text : text;
686
+ Nat : nat64;
687
+ Int : int64;
688
+ Array : vec PreciseValue;
689
+ Map : vec record { text; PreciseValue };
690
+ };
691
+
692
+ type ExtensionInit = record {
693
+ value : opt PreciseValue;
694
+ };
695
+
696
+ type RegisterExtension = record {
697
+ chunked_canister_wasm : opt ChunkedCanisterWasm;
698
+
699
+ extension_init : opt ExtensionInit;
700
+ };
701
+
649
702
  type RegisterVote = record {
650
703
  vote : int32;
651
704
  proposal : opt ProposalId;
@@ -895,6 +948,7 @@ service : (Governance) -> {
895
948
  get_latest_reward_event : () -> (RewardEvent) query;
896
949
  get_maturity_modulation : (record {}) -> (GetMaturityModulationResponse);
897
950
  get_metadata : (record {}) -> (GetMetadataResponse) query;
951
+ get_metrics : (GetMetricsRequest) -> (GetMetricsResponse) composite_query;
898
952
  get_mode : (record {}) -> (GetModeResponse) query;
899
953
  get_nervous_system_parameters : (null) -> (NervousSystemParameters) query;
900
954
  get_neuron : (GetNeuron) -> (GetNeuronResponse) query;
@@ -1,5 +1,6 @@
1
1
  /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */
2
2
  export const idlFactory = ({ IDL }) => {
3
+ const PreciseValue = IDL.Rec();
3
4
  const Timers = IDL.Record({
4
5
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
5
6
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -247,6 +248,27 @@ export const idlFactory = ({ IDL }) => {
247
248
  const SetTopicsForCustomProposals = IDL.Record({
248
249
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
249
250
  });
251
+ const ChunkedCanisterWasm = IDL.Record({
252
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
253
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
254
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
255
+ });
256
+ PreciseValue.fill(
257
+ IDL.Variant({
258
+ 'Int' : IDL.Int64,
259
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
260
+ 'Nat' : IDL.Nat64,
261
+ 'Blob' : IDL.Vec(IDL.Nat8),
262
+ 'Bool' : IDL.Bool,
263
+ 'Text' : IDL.Text,
264
+ 'Array' : IDL.Vec(PreciseValue),
265
+ })
266
+ );
267
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
268
+ const RegisterExtension = IDL.Record({
269
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
270
+ 'extension_init' : IDL.Opt(ExtensionInit),
271
+ });
250
272
  const RegisterDappCanisters = IDL.Record({
251
273
  'canister_ids' : IDL.Vec(IDL.Principal),
252
274
  });
@@ -257,11 +279,6 @@ export const idlFactory = ({ IDL }) => {
257
279
  'memo' : IDL.Opt(IDL.Nat64),
258
280
  'amount_e8s' : IDL.Nat64,
259
281
  });
260
- const ChunkedCanisterWasm = IDL.Record({
261
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
262
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
263
- 'store_canister_id' : IDL.Opt(IDL.Principal),
264
- });
265
282
  const UpgradeSnsControlledCanister = IDL.Record({
266
283
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
267
284
  'mode' : IDL.Opt(IDL.Int32),
@@ -305,6 +322,7 @@ export const idlFactory = ({ IDL }) => {
305
322
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
306
323
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
307
324
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
325
+ 'RegisterExtension' : RegisterExtension,
308
326
  'UpgradeSnsToNextVersion' : IDL.Record({}),
309
327
  'RegisterDappCanisters' : RegisterDappCanisters,
310
328
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -552,6 +570,20 @@ export const idlFactory = ({ IDL }) => {
552
570
  'name' : IDL.Opt(IDL.Text),
553
571
  'description' : IDL.Opt(IDL.Text),
554
572
  });
573
+ const GetMetricsRequest = IDL.Record({
574
+ 'time_window_seconds' : IDL.Opt(IDL.Nat64),
575
+ });
576
+ const Metrics = IDL.Record({
577
+ 'last_ledger_block_timestamp' : IDL.Opt(IDL.Nat64),
578
+ 'num_recently_submitted_proposals' : IDL.Opt(IDL.Nat64),
579
+ });
580
+ const GetMetricsResult = IDL.Variant({
581
+ 'Ok' : Metrics,
582
+ 'Err' : GovernanceError,
583
+ });
584
+ const GetMetricsResponse = IDL.Record({
585
+ 'get_metrics_result' : IDL.Opt(GetMetricsResult),
586
+ });
555
587
  const GetModeResponse = IDL.Record({ 'mode' : IDL.Opt(IDL.Int32) });
556
588
  const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });
557
589
  const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });
@@ -734,6 +766,11 @@ export const idlFactory = ({ IDL }) => {
734
766
  [GetMetadataResponse],
735
767
  ['query'],
736
768
  ),
769
+ 'get_metrics' : IDL.Func(
770
+ [GetMetricsRequest],
771
+ [GetMetricsResponse],
772
+ ['composite_query'],
773
+ ),
737
774
  'get_mode' : IDL.Func([IDL.Record({})], [GetModeResponse], ['query']),
738
775
  'get_nervous_system_parameters' : IDL.Func(
739
776
  [IDL.Null],
@@ -785,6 +822,7 @@ export const idlFactory = ({ IDL }) => {
785
822
  });
786
823
  };
787
824
  export const init = ({ IDL }) => {
825
+ const PreciseValue = IDL.Rec();
788
826
  const Timers = IDL.Record({
789
827
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
790
828
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -1032,6 +1070,27 @@ export const init = ({ IDL }) => {
1032
1070
  const SetTopicsForCustomProposals = IDL.Record({
1033
1071
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
1034
1072
  });
1073
+ const ChunkedCanisterWasm = IDL.Record({
1074
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1075
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1076
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
1077
+ });
1078
+ PreciseValue.fill(
1079
+ IDL.Variant({
1080
+ 'Int' : IDL.Int64,
1081
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
1082
+ 'Nat' : IDL.Nat64,
1083
+ 'Blob' : IDL.Vec(IDL.Nat8),
1084
+ 'Bool' : IDL.Bool,
1085
+ 'Text' : IDL.Text,
1086
+ 'Array' : IDL.Vec(PreciseValue),
1087
+ })
1088
+ );
1089
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
1090
+ const RegisterExtension = IDL.Record({
1091
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
1092
+ 'extension_init' : IDL.Opt(ExtensionInit),
1093
+ });
1035
1094
  const RegisterDappCanisters = IDL.Record({
1036
1095
  'canister_ids' : IDL.Vec(IDL.Principal),
1037
1096
  });
@@ -1042,11 +1101,6 @@ export const init = ({ IDL }) => {
1042
1101
  'memo' : IDL.Opt(IDL.Nat64),
1043
1102
  'amount_e8s' : IDL.Nat64,
1044
1103
  });
1045
- const ChunkedCanisterWasm = IDL.Record({
1046
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1047
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1048
- 'store_canister_id' : IDL.Opt(IDL.Principal),
1049
- });
1050
1104
  const UpgradeSnsControlledCanister = IDL.Record({
1051
1105
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
1052
1106
  'mode' : IDL.Opt(IDL.Int32),
@@ -1090,6 +1144,7 @@ export const init = ({ IDL }) => {
1090
1144
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
1091
1145
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
1092
1146
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
1147
+ 'RegisterExtension' : RegisterExtension,
1093
1148
  'UpgradeSnsToNextVersion' : IDL.Record({}),
1094
1149
  'RegisterDappCanisters' : RegisterDappCanisters,
1095
1150
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -1,5 +1,6 @@
1
1
  /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance_test.did */
2
2
  export const idlFactory = ({ IDL }) => {
3
+ const PreciseValue = IDL.Rec();
3
4
  const Timers = IDL.Record({
4
5
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
5
6
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -247,6 +248,27 @@ export const idlFactory = ({ IDL }) => {
247
248
  const SetTopicsForCustomProposals = IDL.Record({
248
249
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
249
250
  });
251
+ const ChunkedCanisterWasm = IDL.Record({
252
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
253
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
254
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
255
+ });
256
+ PreciseValue.fill(
257
+ IDL.Variant({
258
+ 'Int' : IDL.Int64,
259
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
260
+ 'Nat' : IDL.Nat64,
261
+ 'Blob' : IDL.Vec(IDL.Nat8),
262
+ 'Bool' : IDL.Bool,
263
+ 'Text' : IDL.Text,
264
+ 'Array' : IDL.Vec(PreciseValue),
265
+ })
266
+ );
267
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
268
+ const RegisterExtension = IDL.Record({
269
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
270
+ 'extension_init' : IDL.Opt(ExtensionInit),
271
+ });
250
272
  const RegisterDappCanisters = IDL.Record({
251
273
  'canister_ids' : IDL.Vec(IDL.Principal),
252
274
  });
@@ -257,11 +279,6 @@ export const idlFactory = ({ IDL }) => {
257
279
  'memo' : IDL.Opt(IDL.Nat64),
258
280
  'amount_e8s' : IDL.Nat64,
259
281
  });
260
- const ChunkedCanisterWasm = IDL.Record({
261
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
262
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
263
- 'store_canister_id' : IDL.Opt(IDL.Principal),
264
- });
265
282
  const UpgradeSnsControlledCanister = IDL.Record({
266
283
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
267
284
  'mode' : IDL.Opt(IDL.Int32),
@@ -305,6 +322,7 @@ export const idlFactory = ({ IDL }) => {
305
322
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
306
323
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
307
324
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
325
+ 'RegisterExtension' : RegisterExtension,
308
326
  'UpgradeSnsToNextVersion' : IDL.Record({}),
309
327
  'RegisterDappCanisters' : RegisterDappCanisters,
310
328
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -563,6 +581,20 @@ export const idlFactory = ({ IDL }) => {
563
581
  'name' : IDL.Opt(IDL.Text),
564
582
  'description' : IDL.Opt(IDL.Text),
565
583
  });
584
+ const GetMetricsRequest = IDL.Record({
585
+ 'time_window_seconds' : IDL.Opt(IDL.Nat64),
586
+ });
587
+ const Metrics = IDL.Record({
588
+ 'last_ledger_block_timestamp' : IDL.Opt(IDL.Nat64),
589
+ 'num_recently_submitted_proposals' : IDL.Opt(IDL.Nat64),
590
+ });
591
+ const GetMetricsResult = IDL.Variant({
592
+ 'Ok' : Metrics,
593
+ 'Err' : GovernanceError,
594
+ });
595
+ const GetMetricsResponse = IDL.Record({
596
+ 'get_metrics_result' : IDL.Opt(GetMetricsResult),
597
+ });
566
598
  const GetModeResponse = IDL.Record({ 'mode' : IDL.Opt(IDL.Int32) });
567
599
  const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });
568
600
  const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });
@@ -751,6 +783,7 @@ export const idlFactory = ({ IDL }) => {
751
783
  [],
752
784
  ),
753
785
  'get_metadata' : IDL.Func([IDL.Record({})], [GetMetadataResponse], []),
786
+ 'get_metrics' : IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),
754
787
  'get_mode' : IDL.Func([IDL.Record({})], [GetModeResponse], []),
755
788
  'get_nervous_system_parameters' : IDL.Func(
756
789
  [IDL.Null],
@@ -801,6 +834,7 @@ export const idlFactory = ({ IDL }) => {
801
834
  });
802
835
  };
803
836
  export const init = ({ IDL }) => {
837
+ const PreciseValue = IDL.Rec();
804
838
  const Timers = IDL.Record({
805
839
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
806
840
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -1048,6 +1082,27 @@ export const init = ({ IDL }) => {
1048
1082
  const SetTopicsForCustomProposals = IDL.Record({
1049
1083
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
1050
1084
  });
1085
+ const ChunkedCanisterWasm = IDL.Record({
1086
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1087
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1088
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
1089
+ });
1090
+ PreciseValue.fill(
1091
+ IDL.Variant({
1092
+ 'Int' : IDL.Int64,
1093
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
1094
+ 'Nat' : IDL.Nat64,
1095
+ 'Blob' : IDL.Vec(IDL.Nat8),
1096
+ 'Bool' : IDL.Bool,
1097
+ 'Text' : IDL.Text,
1098
+ 'Array' : IDL.Vec(PreciseValue),
1099
+ })
1100
+ );
1101
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
1102
+ const RegisterExtension = IDL.Record({
1103
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
1104
+ 'extension_init' : IDL.Opt(ExtensionInit),
1105
+ });
1051
1106
  const RegisterDappCanisters = IDL.Record({
1052
1107
  'canister_ids' : IDL.Vec(IDL.Principal),
1053
1108
  });
@@ -1058,11 +1113,6 @@ export const init = ({ IDL }) => {
1058
1113
  'memo' : IDL.Opt(IDL.Nat64),
1059
1114
  'amount_e8s' : IDL.Nat64,
1060
1115
  });
1061
- const ChunkedCanisterWasm = IDL.Record({
1062
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1063
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1064
- 'store_canister_id' : IDL.Opt(IDL.Principal),
1065
- });
1066
1116
  const UpgradeSnsControlledCanister = IDL.Record({
1067
1117
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
1068
1118
  'mode' : IDL.Opt(IDL.Int32),
@@ -1106,6 +1156,7 @@ export const init = ({ IDL }) => {
1106
1156
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
1107
1157
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
1108
1158
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
1159
+ 'RegisterExtension' : RegisterExtension,
1109
1160
  'UpgradeSnsToNextVersion' : IDL.Record({}),
1110
1161
  'RegisterDappCanisters' : RegisterDappCanisters,
1111
1162
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -14,6 +14,7 @@ export type Action =
14
14
  | { ManageDappCanisterSettings: ManageDappCanisterSettings }
15
15
  | { RemoveGenericNervousSystemFunction: bigint }
16
16
  | { SetTopicsForCustomProposals: SetTopicsForCustomProposals }
17
+ | { RegisterExtension: RegisterExtension }
17
18
  | { UpgradeSnsToNextVersion: {} }
18
19
  | { RegisterDappCanisters: RegisterDappCanisters }
19
20
  | { TransferSnsTreasuryFunds: TransferSnsTreasuryFunds }
@@ -201,6 +202,9 @@ export interface ExecuteGenericNervousSystemFunction {
201
202
  function_id: bigint;
202
203
  payload: Uint8Array | number[];
203
204
  }
205
+ export interface ExtensionInit {
206
+ value: [] | [PreciseValue];
207
+ }
204
208
  export interface FinalizeDisburseMaturity {
205
209
  amount_to_be_disbursed_e8s: bigint;
206
210
  to_account: [] | [Account];
@@ -239,6 +243,13 @@ export interface GetMetadataResponse {
239
243
  name: [] | [string];
240
244
  description: [] | [string];
241
245
  }
246
+ export interface GetMetricsRequest {
247
+ time_window_seconds: [] | [bigint];
248
+ }
249
+ export interface GetMetricsResponse {
250
+ get_metrics_result: [] | [GetMetricsResult];
251
+ }
252
+ export type GetMetricsResult = { Ok: Metrics } | { Err: GovernanceError };
242
253
  export interface GetModeResponse {
243
254
  mode: [] | [number];
244
255
  }
@@ -407,6 +418,10 @@ export interface MergeMaturityResponse {
407
418
  merged_maturity_e8s: bigint;
408
419
  new_stake_e8s: bigint;
409
420
  }
421
+ export interface Metrics {
422
+ last_ledger_block_timestamp: [] | [bigint];
423
+ num_recently_submitted_proposals: [] | [bigint];
424
+ }
410
425
  export interface MintSnsTokens {
411
426
  to_principal: [] | [Principal];
412
427
  to_subaccount: [] | [Subaccount];
@@ -523,6 +538,14 @@ export interface PendingVersion {
523
538
  export interface Percentage {
524
539
  basis_points: [] | [bigint];
525
540
  }
541
+ export type PreciseValue =
542
+ | { Int: bigint }
543
+ | { Map: Array<[string, PreciseValue]> }
544
+ | { Nat: bigint }
545
+ | { Blob: Uint8Array | number[] }
546
+ | { Bool: boolean }
547
+ | { Text: string }
548
+ | { Array: Array<PreciseValue> };
526
549
  export interface Principals {
527
550
  principals: Array<Principal>;
528
551
  }
@@ -569,6 +592,10 @@ export interface QueryStats {
569
592
  export interface RegisterDappCanisters {
570
593
  canister_ids: Array<Principal>;
571
594
  }
595
+ export interface RegisterExtension {
596
+ chunked_canister_wasm: [] | [ChunkedCanisterWasm];
597
+ extension_init: [] | [ExtensionInit];
598
+ }
572
599
  export interface RegisterVote {
573
600
  vote: number;
574
601
  proposal: [] | [ProposalId];
@@ -782,6 +809,7 @@ export interface _SERVICE {
782
809
  get_latest_reward_event: ActorMethod<[], RewardEvent>;
783
810
  get_maturity_modulation: ActorMethod<[{}], GetMaturityModulationResponse>;
784
811
  get_metadata: ActorMethod<[{}], GetMetadataResponse>;
812
+ get_metrics: ActorMethod<[GetMetricsRequest], GetMetricsResponse>;
785
813
  get_mode: ActorMethod<[{}], GetModeResponse>;
786
814
  get_nervous_system_parameters: ActorMethod<[null], NervousSystemParameters>;
787
815
  get_neuron: ActorMethod<[GetNeuron], GetNeuronResponse>;