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

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,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_test.did' by import-candid
1
+ // Generated from IC repo commit 9bdaa01adf (2025-06-25) 'rs/sns/governance/canister/governance_test.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;
@@ -258,6 +259,24 @@ type GetMetadataResponse = record {
258
259
  description : opt text;
259
260
  };
260
261
 
262
+ type GetMetricsRequest = record {
263
+ time_window_seconds : opt nat64;
264
+ };
265
+
266
+ type Metrics = record {
267
+ num_recently_submitted_proposals : opt nat64;
268
+ last_ledger_block_timestamp : opt nat64;
269
+ };
270
+
271
+ type GetMetricsResult = variant {
272
+ Ok : Metrics;
273
+ Err : GovernanceError;
274
+ };
275
+
276
+ type GetMetricsResponse = record {
277
+ get_metrics_result : opt GetMetricsResult;
278
+ };
279
+
261
280
  type GetModeResponse = record {
262
281
  mode : opt int32;
263
282
  };
@@ -660,6 +679,40 @@ type RegisterDappCanisters = record {
660
679
  canister_ids : vec principal;
661
680
  };
662
681
 
682
+ // This type is equivalant to `ICRC3Value`, but we give it another name since it is used here not
683
+ // in the context of the ICRC-3 ledger standard. The justification is the same: The candid format
684
+ // supports sharing information even when the client and the server involved do not have the same
685
+ // schema (see the Upgrading and subtyping section of the candid spec). While this mechanism allows
686
+ // to evolve services and clients independently without breaking them, it also means that a client
687
+ // may not receive all the information that the server is sending, e.g. in case the client schema
688
+ // lacks some fields that the server schema has.
689
+ //
690
+ // This loss of information is not an option for SNS voters deciding if an extension with particular
691
+ // init args should be installed or if an extension function with particular arguments should be
692
+ // called. The client must receive the same exact data the server sent in order to verify it.
693
+ //
694
+ // Verification of a priorly installed extension is done by hashing the extension's init arg data
695
+ // and checking that the result is consistent with what has been certified by the SNS.
696
+ type PreciseValue = variant {
697
+ Bool : bool;
698
+ Blob : blob;
699
+ Text : text;
700
+ Nat : nat64;
701
+ Int : int64;
702
+ Array : vec PreciseValue;
703
+ Map : vec record { text; PreciseValue };
704
+ };
705
+
706
+ type ExtensionInit = record {
707
+ value : opt PreciseValue;
708
+ };
709
+
710
+ type RegisterExtension = record {
711
+ chunked_canister_wasm : opt ChunkedCanisterWasm;
712
+
713
+ extension_init : opt ExtensionInit;
714
+ };
715
+
663
716
  type RegisterVote = record {
664
717
  vote : int32;
665
718
  proposal : opt ProposalId;
@@ -914,6 +967,7 @@ service : (Governance) -> {
914
967
  get_latest_reward_event : () -> (RewardEvent) query;
915
968
  get_maturity_modulation : (record {}) -> (GetMaturityModulationResponse);
916
969
  get_metadata : (record {}) -> (GetMetadataResponse) query;
970
+ get_metrics : (GetMetricsRequest) -> (GetMetricsResponse) composite_query;
917
971
  get_mode : (record {}) -> (GetModeResponse) query;
918
972
  get_nervous_system_parameters : (null) -> (NervousSystemParameters) query;
919
973
  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_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 });
@@ -755,6 +787,11 @@ export const idlFactory = ({ IDL }) => {
755
787
  [GetMetadataResponse],
756
788
  ['query'],
757
789
  ),
790
+ 'get_metrics' : IDL.Func(
791
+ [GetMetricsRequest],
792
+ [GetMetricsResponse],
793
+ ['composite_query'],
794
+ ),
758
795
  'get_mode' : IDL.Func([IDL.Record({})], [GetModeResponse], ['query']),
759
796
  'get_nervous_system_parameters' : IDL.Func(
760
797
  [IDL.Null],
@@ -813,6 +850,7 @@ export const idlFactory = ({ IDL }) => {
813
850
  });
814
851
  };
815
852
  export const init = ({ IDL }) => {
853
+ const PreciseValue = IDL.Rec();
816
854
  const Timers = IDL.Record({
817
855
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
818
856
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -1060,6 +1098,27 @@ export const init = ({ IDL }) => {
1060
1098
  const SetTopicsForCustomProposals = IDL.Record({
1061
1099
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
1062
1100
  });
1101
+ const ChunkedCanisterWasm = IDL.Record({
1102
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1103
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1104
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
1105
+ });
1106
+ PreciseValue.fill(
1107
+ IDL.Variant({
1108
+ 'Int' : IDL.Int64,
1109
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
1110
+ 'Nat' : IDL.Nat64,
1111
+ 'Blob' : IDL.Vec(IDL.Nat8),
1112
+ 'Bool' : IDL.Bool,
1113
+ 'Text' : IDL.Text,
1114
+ 'Array' : IDL.Vec(PreciseValue),
1115
+ })
1116
+ );
1117
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
1118
+ const RegisterExtension = IDL.Record({
1119
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
1120
+ 'extension_init' : IDL.Opt(ExtensionInit),
1121
+ });
1063
1122
  const RegisterDappCanisters = IDL.Record({
1064
1123
  'canister_ids' : IDL.Vec(IDL.Principal),
1065
1124
  });
@@ -1070,11 +1129,6 @@ export const init = ({ IDL }) => {
1070
1129
  'memo' : IDL.Opt(IDL.Nat64),
1071
1130
  'amount_e8s' : IDL.Nat64,
1072
1131
  });
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
1132
  const UpgradeSnsControlledCanister = IDL.Record({
1079
1133
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
1080
1134
  'mode' : IDL.Opt(IDL.Int32),
@@ -1118,6 +1172,7 @@ export const init = ({ IDL }) => {
1118
1172
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
1119
1173
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
1120
1174
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
1175
+ 'RegisterExtension' : RegisterExtension,
1121
1176
  'UpgradeSnsToNextVersion' : IDL.Record({}),
1122
1177
  'RegisterDappCanisters' : RegisterDappCanisters,
1123
1178
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -69,8 +69,6 @@ export const idlFactory = ({ IDL }) => {
69
69
  'mode' : CanisterInstallMode,
70
70
  'canister_id' : IDL.Principal,
71
71
  'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
72
- 'memory_allocation' : IDL.Opt(IDL.Nat),
73
- 'compute_allocation' : IDL.Opt(IDL.Nat),
74
72
  });
75
73
  const GetSnsCanistersSummaryRequest = IDL.Record({
76
74
  'update_canister_list' : IDL.Opt(IDL.Bool),
@@ -47,8 +47,6 @@ export interface ChangeCanisterRequest {
47
47
  mode: CanisterInstallMode;
48
48
  canister_id: Principal;
49
49
  chunked_canister_wasm: [] | [ChunkedCanisterWasm];
50
- memory_allocation: [] | [bigint];
51
- compute_allocation: [] | [bigint];
52
50
  }
53
51
  export interface ChunkedCanisterWasm {
54
52
  wasm_module_hash: Uint8Array | number[];
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 579b8ba (2025-04-11 tags: release-2025-04-11_13-20-base) 'rs/sns/root/canister/root.did' by import-candid
1
+ // Generated from IC repo commit 9bdaa01adf (2025-06-25) 'rs/sns/root/canister/root.did' by import-candid
2
2
  type CanisterCallError = record {
3
3
  code : opt int32;
4
4
  description : text;
@@ -59,8 +59,6 @@ type ChangeCanisterRequest = record {
59
59
  stop_before_installing : bool;
60
60
  mode : CanisterInstallMode;
61
61
  canister_id : principal;
62
- memory_allocation : opt nat;
63
- compute_allocation : opt nat;
64
62
  };
65
63
 
66
64
  type DefiniteCanisterSettings = record {
@@ -69,8 +69,6 @@ export const idlFactory = ({ IDL }) => {
69
69
  'mode' : CanisterInstallMode,
70
70
  'canister_id' : IDL.Principal,
71
71
  'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
72
- 'memory_allocation' : IDL.Opt(IDL.Nat),
73
- 'compute_allocation' : IDL.Opt(IDL.Nat),
74
72
  });
75
73
  const GetSnsCanistersSummaryRequest = IDL.Record({
76
74
  'update_canister_list' : IDL.Opt(IDL.Bool),
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 579b8ba (2025-04-11 tags: release-2025-04-11_13-20-base) 'rs/sns/swap/canister/swap.did' by import-candid
1
+ // Generated from IC repo commit 9bdaa01adf (2025-06-25) 'rs/sns/swap/canister/swap.did' by import-candid
2
2
  type BuyerState = record {
3
3
  icp : opt TransferableAmount;
4
4
  has_created_neuron_recipes : opt bool;