@dfinity/sns 3.7.0 → 3.7.1

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.
@@ -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),
@@ -45,7 +46,26 @@ export const idlFactory = ({ IDL }) => {
45
46
  'description' : IDL.Opt(IDL.Text),
46
47
  'function_type' : IDL.Opt(FunctionType),
47
48
  });
49
+ const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
50
+ const Account = IDL.Record({
51
+ 'owner' : IDL.Opt(IDL.Principal),
52
+ 'subaccount' : IDL.Opt(Subaccount),
53
+ });
54
+ const TreasuryMetrics = IDL.Record({
55
+ 'name' : IDL.Opt(IDL.Text),
56
+ 'original_amount_e8s' : IDL.Opt(IDL.Nat64),
57
+ 'amount_e8s' : IDL.Opt(IDL.Nat64),
58
+ 'account' : IDL.Opt(Account),
59
+ 'ledger_canister_id' : IDL.Opt(IDL.Principal),
60
+ 'treasury' : IDL.Int32,
61
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
62
+ });
63
+ const VotingPowerMetrics = IDL.Record({
64
+ 'governance_total_potential_voting_power' : IDL.Opt(IDL.Nat64),
65
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
66
+ });
48
67
  const GovernanceCachedMetrics = IDL.Record({
68
+ 'treasury_metrics' : IDL.Vec(TreasuryMetrics),
49
69
  'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
50
70
  IDL.Tuple(IDL.Nat64, IDL.Float64)
51
71
  ),
@@ -58,6 +78,7 @@ export const idlFactory = ({ IDL }) => {
58
78
  'dissolved_neurons_count' : IDL.Nat64,
59
79
  'total_staked_e8s' : IDL.Nat64,
60
80
  'total_supply_governance_tokens' : IDL.Nat64,
81
+ 'voting_power_metrics' : IDL.Opt(VotingPowerMetrics),
61
82
  'not_dissolving_neurons_count' : IDL.Nat64,
62
83
  'dissolved_neurons_e8s' : IDL.Nat64,
63
84
  'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
@@ -185,11 +206,6 @@ export const idlFactory = ({ IDL }) => {
185
206
  'error_message' : IDL.Text,
186
207
  'error_type' : IDL.Int32,
187
208
  });
188
- const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
189
- const Account = IDL.Record({
190
- 'owner' : IDL.Opt(IDL.Principal),
191
- 'subaccount' : IDL.Opt(Subaccount),
192
- });
193
209
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
194
210
  const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) });
195
211
  const ValuationFactors = IDL.Record({
@@ -247,6 +263,27 @@ export const idlFactory = ({ IDL }) => {
247
263
  const SetTopicsForCustomProposals = IDL.Record({
248
264
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
249
265
  });
266
+ const ChunkedCanisterWasm = IDL.Record({
267
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
268
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
269
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
270
+ });
271
+ PreciseValue.fill(
272
+ IDL.Variant({
273
+ 'Int' : IDL.Int64,
274
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
275
+ 'Nat' : IDL.Nat64,
276
+ 'Blob' : IDL.Vec(IDL.Nat8),
277
+ 'Bool' : IDL.Bool,
278
+ 'Text' : IDL.Text,
279
+ 'Array' : IDL.Vec(PreciseValue),
280
+ })
281
+ );
282
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
283
+ const RegisterExtension = IDL.Record({
284
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
285
+ 'extension_init' : IDL.Opt(ExtensionInit),
286
+ });
250
287
  const RegisterDappCanisters = IDL.Record({
251
288
  'canister_ids' : IDL.Vec(IDL.Principal),
252
289
  });
@@ -257,11 +294,6 @@ export const idlFactory = ({ IDL }) => {
257
294
  'memo' : IDL.Opt(IDL.Nat64),
258
295
  'amount_e8s' : IDL.Nat64,
259
296
  });
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
297
  const UpgradeSnsControlledCanister = IDL.Record({
266
298
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
267
299
  'mode' : IDL.Opt(IDL.Int32),
@@ -305,6 +337,7 @@ export const idlFactory = ({ IDL }) => {
305
337
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
306
338
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
307
339
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
340
+ 'RegisterExtension' : RegisterExtension,
308
341
  'UpgradeSnsToNextVersion' : IDL.Record({}),
309
342
  'RegisterDappCanisters' : RegisterDappCanisters,
310
343
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -567,8 +600,12 @@ export const idlFactory = ({ IDL }) => {
567
600
  'time_window_seconds' : IDL.Opt(IDL.Nat64),
568
601
  });
569
602
  const Metrics = IDL.Record({
603
+ 'treasury_metrics' : IDL.Opt(IDL.Vec(TreasuryMetrics)),
604
+ 'voting_power_metrics' : IDL.Opt(VotingPowerMetrics),
570
605
  'last_ledger_block_timestamp' : IDL.Opt(IDL.Nat64),
606
+ 'num_recently_executed_proposals' : IDL.Opt(IDL.Nat64),
571
607
  'num_recently_submitted_proposals' : IDL.Opt(IDL.Nat64),
608
+ 'genesis_timestamp_seconds' : IDL.Opt(IDL.Nat64),
572
609
  });
573
610
  const GetMetricsResult = IDL.Variant({
574
611
  'Ok' : Metrics,
@@ -766,6 +803,11 @@ export const idlFactory = ({ IDL }) => {
766
803
  ),
767
804
  'get_metadata' : IDL.Func([IDL.Record({})], [GetMetadataResponse], []),
768
805
  'get_metrics' : IDL.Func([GetMetricsRequest], [GetMetricsResponse], []),
806
+ 'get_metrics_replicated' : IDL.Func(
807
+ [GetMetricsRequest],
808
+ [GetMetricsResponse],
809
+ [],
810
+ ),
769
811
  'get_mode' : IDL.Func([IDL.Record({})], [GetModeResponse], []),
770
812
  'get_nervous_system_parameters' : IDL.Func(
771
813
  [IDL.Null],
@@ -816,6 +858,7 @@ export const idlFactory = ({ IDL }) => {
816
858
  });
817
859
  };
818
860
  export const init = ({ IDL }) => {
861
+ const PreciseValue = IDL.Rec();
819
862
  const Timers = IDL.Record({
820
863
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
821
864
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -861,7 +904,26 @@ export const init = ({ IDL }) => {
861
904
  'description' : IDL.Opt(IDL.Text),
862
905
  'function_type' : IDL.Opt(FunctionType),
863
906
  });
907
+ const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
908
+ const Account = IDL.Record({
909
+ 'owner' : IDL.Opt(IDL.Principal),
910
+ 'subaccount' : IDL.Opt(Subaccount),
911
+ });
912
+ const TreasuryMetrics = IDL.Record({
913
+ 'name' : IDL.Opt(IDL.Text),
914
+ 'original_amount_e8s' : IDL.Opt(IDL.Nat64),
915
+ 'amount_e8s' : IDL.Opt(IDL.Nat64),
916
+ 'account' : IDL.Opt(Account),
917
+ 'ledger_canister_id' : IDL.Opt(IDL.Principal),
918
+ 'treasury' : IDL.Int32,
919
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
920
+ });
921
+ const VotingPowerMetrics = IDL.Record({
922
+ 'governance_total_potential_voting_power' : IDL.Opt(IDL.Nat64),
923
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
924
+ });
864
925
  const GovernanceCachedMetrics = IDL.Record({
926
+ 'treasury_metrics' : IDL.Vec(TreasuryMetrics),
865
927
  'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
866
928
  IDL.Tuple(IDL.Nat64, IDL.Float64)
867
929
  ),
@@ -874,6 +936,7 @@ export const init = ({ IDL }) => {
874
936
  'dissolved_neurons_count' : IDL.Nat64,
875
937
  'total_staked_e8s' : IDL.Nat64,
876
938
  'total_supply_governance_tokens' : IDL.Nat64,
939
+ 'voting_power_metrics' : IDL.Opt(VotingPowerMetrics),
877
940
  'not_dissolving_neurons_count' : IDL.Nat64,
878
941
  'dissolved_neurons_e8s' : IDL.Nat64,
879
942
  'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
@@ -1001,11 +1064,6 @@ export const init = ({ IDL }) => {
1001
1064
  'error_message' : IDL.Text,
1002
1065
  'error_type' : IDL.Int32,
1003
1066
  });
1004
- const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
1005
- const Account = IDL.Record({
1006
- 'owner' : IDL.Opt(IDL.Principal),
1007
- 'subaccount' : IDL.Opt(Subaccount),
1008
- });
1009
1067
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
1010
1068
  const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) });
1011
1069
  const ValuationFactors = IDL.Record({
@@ -1063,6 +1121,27 @@ export const init = ({ IDL }) => {
1063
1121
  const SetTopicsForCustomProposals = IDL.Record({
1064
1122
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
1065
1123
  });
1124
+ const ChunkedCanisterWasm = IDL.Record({
1125
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1126
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1127
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
1128
+ });
1129
+ PreciseValue.fill(
1130
+ IDL.Variant({
1131
+ 'Int' : IDL.Int64,
1132
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
1133
+ 'Nat' : IDL.Nat64,
1134
+ 'Blob' : IDL.Vec(IDL.Nat8),
1135
+ 'Bool' : IDL.Bool,
1136
+ 'Text' : IDL.Text,
1137
+ 'Array' : IDL.Vec(PreciseValue),
1138
+ })
1139
+ );
1140
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
1141
+ const RegisterExtension = IDL.Record({
1142
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
1143
+ 'extension_init' : IDL.Opt(ExtensionInit),
1144
+ });
1066
1145
  const RegisterDappCanisters = IDL.Record({
1067
1146
  'canister_ids' : IDL.Vec(IDL.Principal),
1068
1147
  });
@@ -1073,11 +1152,6 @@ export const init = ({ IDL }) => {
1073
1152
  'memo' : IDL.Opt(IDL.Nat64),
1074
1153
  'amount_e8s' : IDL.Nat64,
1075
1154
  });
1076
- const ChunkedCanisterWasm = IDL.Record({
1077
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1078
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1079
- 'store_canister_id' : IDL.Opt(IDL.Principal),
1080
- });
1081
1155
  const UpgradeSnsControlledCanister = IDL.Record({
1082
1156
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
1083
1157
  'mode' : IDL.Opt(IDL.Int32),
@@ -1121,6 +1195,7 @@ export const init = ({ IDL }) => {
1121
1195
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
1122
1196
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
1123
1197
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
1198
+ 'RegisterExtension' : RegisterExtension,
1124
1199
  'UpgradeSnsToNextVersion' : IDL.Record({}),
1125
1200
  'RegisterDappCanisters' : RegisterDappCanisters,
1126
1201
  '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];
@@ -317,6 +321,7 @@ export interface Governance {
317
321
  genesis_timestamp_seconds: bigint;
318
322
  }
319
323
  export interface GovernanceCachedMetrics {
324
+ treasury_metrics: Array<TreasuryMetrics>;
320
325
  not_dissolving_neurons_e8s_buckets: Array<[bigint, number]>;
321
326
  garbage_collectable_neurons_count: bigint;
322
327
  neurons_with_invalid_stake_count: bigint;
@@ -325,6 +330,7 @@ export interface GovernanceCachedMetrics {
325
330
  dissolved_neurons_count: bigint;
326
331
  total_staked_e8s: bigint;
327
332
  total_supply_governance_tokens: bigint;
333
+ voting_power_metrics: [] | [VotingPowerMetrics];
328
334
  not_dissolving_neurons_count: bigint;
329
335
  dissolved_neurons_e8s: bigint;
330
336
  neurons_with_less_than_6_months_dissolve_delay_e8s: bigint;
@@ -415,8 +421,12 @@ export interface MergeMaturityResponse {
415
421
  new_stake_e8s: bigint;
416
422
  }
417
423
  export interface Metrics {
424
+ treasury_metrics: [] | [Array<TreasuryMetrics>];
425
+ voting_power_metrics: [] | [VotingPowerMetrics];
418
426
  last_ledger_block_timestamp: [] | [bigint];
427
+ num_recently_executed_proposals: [] | [bigint];
419
428
  num_recently_submitted_proposals: [] | [bigint];
429
+ genesis_timestamp_seconds: [] | [bigint];
420
430
  }
421
431
  export interface MintSnsTokens {
422
432
  to_principal: [] | [Principal];
@@ -534,6 +544,14 @@ export interface PendingVersion {
534
544
  export interface Percentage {
535
545
  basis_points: [] | [bigint];
536
546
  }
547
+ export type PreciseValue =
548
+ | { Int: bigint }
549
+ | { Map: Array<[string, PreciseValue]> }
550
+ | { Nat: bigint }
551
+ | { Blob: Uint8Array | number[] }
552
+ | { Bool: boolean }
553
+ | { Text: string }
554
+ | { Array: Array<PreciseValue> };
537
555
  export interface Principals {
538
556
  principals: Array<Principal>;
539
557
  }
@@ -580,6 +598,10 @@ export interface QueryStats {
580
598
  export interface RegisterDappCanisters {
581
599
  canister_ids: Array<Principal>;
582
600
  }
601
+ export interface RegisterExtension {
602
+ chunked_canister_wasm: [] | [ChunkedCanisterWasm];
603
+ extension_init: [] | [ExtensionInit];
604
+ }
583
605
  export interface RegisterVote {
584
606
  vote: number;
585
607
  proposal: [] | [ProposalId];
@@ -690,6 +712,15 @@ export interface TransferSnsTreasuryFunds {
690
712
  memo: [] | [bigint];
691
713
  amount_e8s: bigint;
692
714
  }
715
+ export interface TreasuryMetrics {
716
+ name: [] | [string];
717
+ original_amount_e8s: [] | [bigint];
718
+ amount_e8s: [] | [bigint];
719
+ account: [] | [Account];
720
+ ledger_canister_id: [] | [Principal];
721
+ treasury: number;
722
+ timestamp_seconds: [] | [bigint];
723
+ }
693
724
  export interface UpgradeInProgress {
694
725
  mark_failed_at_seconds: bigint;
695
726
  checking_upgrade_lock: bigint;
@@ -769,6 +800,10 @@ export interface Version {
769
800
  export interface Versions {
770
801
  versions: Array<Version>;
771
802
  }
803
+ export interface VotingPowerMetrics {
804
+ governance_total_potential_voting_power: [] | [bigint];
805
+ timestamp_seconds: [] | [bigint];
806
+ }
772
807
  export interface VotingRewardsParameters {
773
808
  final_reward_rate_basis_points: [] | [bigint];
774
809
  initial_reward_rate_basis_points: [] | [bigint];
@@ -794,6 +829,7 @@ export interface _SERVICE {
794
829
  get_maturity_modulation: ActorMethod<[{}], GetMaturityModulationResponse>;
795
830
  get_metadata: ActorMethod<[{}], GetMetadataResponse>;
796
831
  get_metrics: ActorMethod<[GetMetricsRequest], GetMetricsResponse>;
832
+ get_metrics_replicated: ActorMethod<[GetMetricsRequest], GetMetricsResponse>;
797
833
  get_mode: ActorMethod<[{}], GetModeResponse>;
798
834
  get_nervous_system_parameters: ActorMethod<[null], NervousSystemParameters>;
799
835
  get_neuron: ActorMethod<[GetNeuron], GetNeuronResponse>;
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit b72c6253fa (2025-06-10) 'rs/sns/governance/canister/governance_test.did' by import-candid
1
+ // Generated from IC repo commit 5f36668c9b (2025-07-11) '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;
@@ -262,9 +263,43 @@ type GetMetricsRequest = record {
262
263
  time_window_seconds : opt nat64;
263
264
  };
264
265
 
266
+ type TreasuryMetrics = record {
267
+ // Same as, e.g., `TransferSnsTreasuryFunds.from_treasury`.
268
+ treasury : int32;
269
+
270
+ // A human-readable identified for this treasury, e.g., "ICP".
271
+ name : opt text;
272
+
273
+ // The source of truth for the treasury balance is this ledger canister / account.
274
+ ledger_canister_id : opt principal;
275
+ account : opt Account;
276
+
277
+ // The regularly updated amount of tokens in this treasury.
278
+ amount_e8s : opt nat64;
279
+ // The amount of tokens in this treasury at the end of swap finalization.
280
+ original_amount_e8s : opt nat64;
281
+
282
+ // When the metrics were last updated.
283
+ timestamp_seconds : opt nat64;
284
+ };
285
+
286
+ type VotingPowerMetrics = record {
287
+ governance_total_potential_voting_power : opt nat64;
288
+
289
+ // When the metrics were last updated.
290
+ timestamp_seconds : opt nat64;
291
+ };
292
+
265
293
  type Metrics = record {
266
294
  num_recently_submitted_proposals : opt nat64;
295
+ num_recently_executed_proposals: opt nat64;
296
+
267
297
  last_ledger_block_timestamp : opt nat64;
298
+
299
+ // The metrics below are cached (albeit this is an implementation detail).
300
+ treasury_metrics : opt vec TreasuryMetrics;
301
+ voting_power_metrics : opt VotingPowerMetrics;
302
+ genesis_timestamp_seconds : opt nat64;
268
303
  };
269
304
 
270
305
  type GetMetricsResult = variant {
@@ -367,6 +402,8 @@ type GovernanceCachedMetrics = record {
367
402
  dissolving_neurons_count : nat64;
368
403
  dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
369
404
  timestamp_seconds : nat64;
405
+ treasury_metrics : vec TreasuryMetrics;
406
+ voting_power_metrics : opt VotingPowerMetrics;
370
407
  };
371
408
 
372
409
  type GovernanceError = record {
@@ -678,6 +715,40 @@ type RegisterDappCanisters = record {
678
715
  canister_ids : vec principal;
679
716
  };
680
717
 
718
+ // This type is equivalant to `ICRC3Value`, but we give it another name since it is used here not
719
+ // in the context of the ICRC-3 ledger standard. The justification is the same: The candid format
720
+ // supports sharing information even when the client and the server involved do not have the same
721
+ // schema (see the Upgrading and subtyping section of the candid spec). While this mechanism allows
722
+ // to evolve services and clients independently without breaking them, it also means that a client
723
+ // may not receive all the information that the server is sending, e.g. in case the client schema
724
+ // lacks some fields that the server schema has.
725
+ //
726
+ // This loss of information is not an option for SNS voters deciding if an extension with particular
727
+ // init args should be installed or if an extension function with particular arguments should be
728
+ // called. The client must receive the same exact data the server sent in order to verify it.
729
+ //
730
+ // Verification of a priorly installed extension is done by hashing the extension's init arg data
731
+ // and checking that the result is consistent with what has been certified by the SNS.
732
+ type PreciseValue = variant {
733
+ Bool : bool;
734
+ Blob : blob;
735
+ Text : text;
736
+ Nat : nat64;
737
+ Int : int64;
738
+ Array : vec PreciseValue;
739
+ Map : vec record { text; PreciseValue };
740
+ };
741
+
742
+ type ExtensionInit = record {
743
+ value : opt PreciseValue;
744
+ };
745
+
746
+ type RegisterExtension = record {
747
+ chunked_canister_wasm : opt ChunkedCanisterWasm;
748
+
749
+ extension_init : opt ExtensionInit;
750
+ };
751
+
681
752
  type RegisterVote = record {
682
753
  vote : int32;
683
754
  proposal : opt ProposalId;
@@ -933,6 +1004,7 @@ service : (Governance) -> {
933
1004
  get_maturity_modulation : (record {}) -> (GetMaturityModulationResponse);
934
1005
  get_metadata : (record {}) -> (GetMetadataResponse) query;
935
1006
  get_metrics : (GetMetricsRequest) -> (GetMetricsResponse) composite_query;
1007
+ get_metrics_replicated : (GetMetricsRequest) -> (GetMetricsResponse);
936
1008
  get_mode : (record {}) -> (GetModeResponse) query;
937
1009
  get_nervous_system_parameters : (null) -> (NervousSystemParameters) query;
938
1010
  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),
@@ -45,7 +46,26 @@ export const idlFactory = ({ IDL }) => {
45
46
  'description' : IDL.Opt(IDL.Text),
46
47
  'function_type' : IDL.Opt(FunctionType),
47
48
  });
49
+ const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
50
+ const Account = IDL.Record({
51
+ 'owner' : IDL.Opt(IDL.Principal),
52
+ 'subaccount' : IDL.Opt(Subaccount),
53
+ });
54
+ const TreasuryMetrics = IDL.Record({
55
+ 'name' : IDL.Opt(IDL.Text),
56
+ 'original_amount_e8s' : IDL.Opt(IDL.Nat64),
57
+ 'amount_e8s' : IDL.Opt(IDL.Nat64),
58
+ 'account' : IDL.Opt(Account),
59
+ 'ledger_canister_id' : IDL.Opt(IDL.Principal),
60
+ 'treasury' : IDL.Int32,
61
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
62
+ });
63
+ const VotingPowerMetrics = IDL.Record({
64
+ 'governance_total_potential_voting_power' : IDL.Opt(IDL.Nat64),
65
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
66
+ });
48
67
  const GovernanceCachedMetrics = IDL.Record({
68
+ 'treasury_metrics' : IDL.Vec(TreasuryMetrics),
49
69
  'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
50
70
  IDL.Tuple(IDL.Nat64, IDL.Float64)
51
71
  ),
@@ -58,6 +78,7 @@ export const idlFactory = ({ IDL }) => {
58
78
  'dissolved_neurons_count' : IDL.Nat64,
59
79
  'total_staked_e8s' : IDL.Nat64,
60
80
  'total_supply_governance_tokens' : IDL.Nat64,
81
+ 'voting_power_metrics' : IDL.Opt(VotingPowerMetrics),
61
82
  'not_dissolving_neurons_count' : IDL.Nat64,
62
83
  'dissolved_neurons_e8s' : IDL.Nat64,
63
84
  'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
@@ -185,11 +206,6 @@ export const idlFactory = ({ IDL }) => {
185
206
  'error_message' : IDL.Text,
186
207
  'error_type' : IDL.Int32,
187
208
  });
188
- const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
189
- const Account = IDL.Record({
190
- 'owner' : IDL.Opt(IDL.Principal),
191
- 'subaccount' : IDL.Opt(Subaccount),
192
- });
193
209
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
194
210
  const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) });
195
211
  const ValuationFactors = IDL.Record({
@@ -247,6 +263,27 @@ export const idlFactory = ({ IDL }) => {
247
263
  const SetTopicsForCustomProposals = IDL.Record({
248
264
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
249
265
  });
266
+ const ChunkedCanisterWasm = IDL.Record({
267
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
268
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
269
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
270
+ });
271
+ PreciseValue.fill(
272
+ IDL.Variant({
273
+ 'Int' : IDL.Int64,
274
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
275
+ 'Nat' : IDL.Nat64,
276
+ 'Blob' : IDL.Vec(IDL.Nat8),
277
+ 'Bool' : IDL.Bool,
278
+ 'Text' : IDL.Text,
279
+ 'Array' : IDL.Vec(PreciseValue),
280
+ })
281
+ );
282
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
283
+ const RegisterExtension = IDL.Record({
284
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
285
+ 'extension_init' : IDL.Opt(ExtensionInit),
286
+ });
250
287
  const RegisterDappCanisters = IDL.Record({
251
288
  'canister_ids' : IDL.Vec(IDL.Principal),
252
289
  });
@@ -257,11 +294,6 @@ export const idlFactory = ({ IDL }) => {
257
294
  'memo' : IDL.Opt(IDL.Nat64),
258
295
  'amount_e8s' : IDL.Nat64,
259
296
  });
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
297
  const UpgradeSnsControlledCanister = IDL.Record({
266
298
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
267
299
  'mode' : IDL.Opt(IDL.Int32),
@@ -305,6 +337,7 @@ export const idlFactory = ({ IDL }) => {
305
337
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
306
338
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
307
339
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
340
+ 'RegisterExtension' : RegisterExtension,
308
341
  'UpgradeSnsToNextVersion' : IDL.Record({}),
309
342
  'RegisterDappCanisters' : RegisterDappCanisters,
310
343
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -567,8 +600,12 @@ export const idlFactory = ({ IDL }) => {
567
600
  'time_window_seconds' : IDL.Opt(IDL.Nat64),
568
601
  });
569
602
  const Metrics = IDL.Record({
603
+ 'treasury_metrics' : IDL.Opt(IDL.Vec(TreasuryMetrics)),
604
+ 'voting_power_metrics' : IDL.Opt(VotingPowerMetrics),
570
605
  'last_ledger_block_timestamp' : IDL.Opt(IDL.Nat64),
606
+ 'num_recently_executed_proposals' : IDL.Opt(IDL.Nat64),
571
607
  'num_recently_submitted_proposals' : IDL.Opt(IDL.Nat64),
608
+ 'genesis_timestamp_seconds' : IDL.Opt(IDL.Nat64),
572
609
  });
573
610
  const GetMetricsResult = IDL.Variant({
574
611
  'Ok' : Metrics,
@@ -774,6 +811,11 @@ export const idlFactory = ({ IDL }) => {
774
811
  [GetMetricsResponse],
775
812
  ['composite_query'],
776
813
  ),
814
+ 'get_metrics_replicated' : IDL.Func(
815
+ [GetMetricsRequest],
816
+ [GetMetricsResponse],
817
+ [],
818
+ ),
777
819
  'get_mode' : IDL.Func([IDL.Record({})], [GetModeResponse], ['query']),
778
820
  'get_nervous_system_parameters' : IDL.Func(
779
821
  [IDL.Null],
@@ -832,6 +874,7 @@ export const idlFactory = ({ IDL }) => {
832
874
  });
833
875
  };
834
876
  export const init = ({ IDL }) => {
877
+ const PreciseValue = IDL.Rec();
835
878
  const Timers = IDL.Record({
836
879
  'last_spawned_timestamp_seconds' : IDL.Opt(IDL.Nat64),
837
880
  'last_reset_timestamp_seconds' : IDL.Opt(IDL.Nat64),
@@ -877,7 +920,26 @@ export const init = ({ IDL }) => {
877
920
  'description' : IDL.Opt(IDL.Text),
878
921
  'function_type' : IDL.Opt(FunctionType),
879
922
  });
923
+ const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
924
+ const Account = IDL.Record({
925
+ 'owner' : IDL.Opt(IDL.Principal),
926
+ 'subaccount' : IDL.Opt(Subaccount),
927
+ });
928
+ const TreasuryMetrics = IDL.Record({
929
+ 'name' : IDL.Opt(IDL.Text),
930
+ 'original_amount_e8s' : IDL.Opt(IDL.Nat64),
931
+ 'amount_e8s' : IDL.Opt(IDL.Nat64),
932
+ 'account' : IDL.Opt(Account),
933
+ 'ledger_canister_id' : IDL.Opt(IDL.Principal),
934
+ 'treasury' : IDL.Int32,
935
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
936
+ });
937
+ const VotingPowerMetrics = IDL.Record({
938
+ 'governance_total_potential_voting_power' : IDL.Opt(IDL.Nat64),
939
+ 'timestamp_seconds' : IDL.Opt(IDL.Nat64),
940
+ });
880
941
  const GovernanceCachedMetrics = IDL.Record({
942
+ 'treasury_metrics' : IDL.Vec(TreasuryMetrics),
881
943
  'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
882
944
  IDL.Tuple(IDL.Nat64, IDL.Float64)
883
945
  ),
@@ -890,6 +952,7 @@ export const init = ({ IDL }) => {
890
952
  'dissolved_neurons_count' : IDL.Nat64,
891
953
  'total_staked_e8s' : IDL.Nat64,
892
954
  'total_supply_governance_tokens' : IDL.Nat64,
955
+ 'voting_power_metrics' : IDL.Opt(VotingPowerMetrics),
893
956
  'not_dissolving_neurons_count' : IDL.Nat64,
894
957
  'dissolved_neurons_e8s' : IDL.Nat64,
895
958
  'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
@@ -1017,11 +1080,6 @@ export const init = ({ IDL }) => {
1017
1080
  'error_message' : IDL.Text,
1018
1081
  'error_type' : IDL.Int32,
1019
1082
  });
1020
- const Subaccount = IDL.Record({ 'subaccount' : IDL.Vec(IDL.Nat8) });
1021
- const Account = IDL.Record({
1022
- 'owner' : IDL.Opt(IDL.Principal),
1023
- 'subaccount' : IDL.Opt(Subaccount),
1024
- });
1025
1083
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
1026
1084
  const Tokens = IDL.Record({ 'e8s' : IDL.Opt(IDL.Nat64) });
1027
1085
  const ValuationFactors = IDL.Record({
@@ -1079,6 +1137,27 @@ export const init = ({ IDL }) => {
1079
1137
  const SetTopicsForCustomProposals = IDL.Record({
1080
1138
  'custom_function_id_to_topic' : IDL.Vec(IDL.Tuple(IDL.Nat64, Topic)),
1081
1139
  });
1140
+ const ChunkedCanisterWasm = IDL.Record({
1141
+ 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1142
+ 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1143
+ 'store_canister_id' : IDL.Opt(IDL.Principal),
1144
+ });
1145
+ PreciseValue.fill(
1146
+ IDL.Variant({
1147
+ 'Int' : IDL.Int64,
1148
+ 'Map' : IDL.Vec(IDL.Tuple(IDL.Text, PreciseValue)),
1149
+ 'Nat' : IDL.Nat64,
1150
+ 'Blob' : IDL.Vec(IDL.Nat8),
1151
+ 'Bool' : IDL.Bool,
1152
+ 'Text' : IDL.Text,
1153
+ 'Array' : IDL.Vec(PreciseValue),
1154
+ })
1155
+ );
1156
+ const ExtensionInit = IDL.Record({ 'value' : IDL.Opt(PreciseValue) });
1157
+ const RegisterExtension = IDL.Record({
1158
+ 'chunked_canister_wasm' : IDL.Opt(ChunkedCanisterWasm),
1159
+ 'extension_init' : IDL.Opt(ExtensionInit),
1160
+ });
1082
1161
  const RegisterDappCanisters = IDL.Record({
1083
1162
  'canister_ids' : IDL.Vec(IDL.Principal),
1084
1163
  });
@@ -1089,11 +1168,6 @@ export const init = ({ IDL }) => {
1089
1168
  'memo' : IDL.Opt(IDL.Nat64),
1090
1169
  'amount_e8s' : IDL.Nat64,
1091
1170
  });
1092
- const ChunkedCanisterWasm = IDL.Record({
1093
- 'wasm_module_hash' : IDL.Vec(IDL.Nat8),
1094
- 'chunk_hashes_list' : IDL.Vec(IDL.Vec(IDL.Nat8)),
1095
- 'store_canister_id' : IDL.Opt(IDL.Principal),
1096
- });
1097
1171
  const UpgradeSnsControlledCanister = IDL.Record({
1098
1172
  'new_canister_wasm' : IDL.Vec(IDL.Nat8),
1099
1173
  'mode' : IDL.Opt(IDL.Int32),
@@ -1137,6 +1211,7 @@ export const init = ({ IDL }) => {
1137
1211
  'ManageDappCanisterSettings' : ManageDappCanisterSettings,
1138
1212
  'RemoveGenericNervousSystemFunction' : IDL.Nat64,
1139
1213
  'SetTopicsForCustomProposals' : SetTopicsForCustomProposals,
1214
+ 'RegisterExtension' : RegisterExtension,
1140
1215
  'UpgradeSnsToNextVersion' : IDL.Record({}),
1141
1216
  'RegisterDappCanisters' : RegisterDappCanisters,
1142
1217
  'TransferSnsTreasuryFunds' : TransferSnsTreasuryFunds,
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit b72c6253fa (2025-06-10) 'rs/sns/root/canister/root.did' by import-candid
1
+ // Generated from IC repo commit 5f36668c9b (2025-07-11) 'rs/sns/root/canister/root.did' by import-candid
2
2
  type CanisterCallError = record {
3
3
  code : opt int32;
4
4
  description : text;
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit b72c6253fa (2025-06-10) 'rs/sns/swap/canister/swap.did' by import-candid
1
+ // Generated from IC repo commit 5f36668c9b (2025-07-11) '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;