@dfinity/sns 3.4.0 → 3.5.0-next-2025-04-15

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 (33) hide show
  1. package/README.md +126 -97
  2. package/dist/candid/sns_governance.certified.idl.js +45 -0
  3. package/dist/candid/sns_governance.d.ts +23 -9
  4. package/dist/candid/sns_governance.did +29 -12
  5. package/dist/candid/sns_governance.idl.js +45 -0
  6. package/dist/candid/sns_governance_test.certified.idl.js +45 -0
  7. package/dist/candid/sns_governance_test.d.ts +23 -9
  8. package/dist/candid/sns_governance_test.did +29 -12
  9. package/dist/candid/sns_governance_test.idl.js +45 -0
  10. package/dist/candid/sns_root.did +1 -1
  11. package/dist/candid/sns_swap.did +1 -1
  12. package/dist/cjs/index.cjs.js +1 -1
  13. package/dist/cjs/index.cjs.js.map +3 -3
  14. package/dist/esm/chunk-HIRPCVPC.js +2 -0
  15. package/dist/esm/chunk-HIRPCVPC.js.map +7 -0
  16. package/dist/esm/{chunk-Q55ZUKOX.js → chunk-TJDVNGQZ.js} +2 -2
  17. package/dist/esm/chunk-TJDVNGQZ.js.map +7 -0
  18. package/dist/esm/{chunk-CMVA2R27.js → chunk-V7RSNTZY.js} +2 -2
  19. package/dist/esm/governance.canister.js +1 -1
  20. package/dist/esm/index.js +1 -1
  21. package/dist/esm/index.js.map +3 -3
  22. package/dist/esm/sns.js +1 -1
  23. package/dist/esm/sns.wrapper.js +1 -1
  24. package/dist/types/converters/governance.converters.d.ts +3 -2
  25. package/dist/types/governance.canister.d.ts +7 -2
  26. package/dist/types/index.d.ts +1 -1
  27. package/dist/types/sns.wrapper.d.ts +2 -1
  28. package/dist/types/types/governance.params.d.ts +15 -2
  29. package/package.json +7 -7
  30. package/dist/esm/chunk-IVTJXPAO.js +0 -2
  31. package/dist/esm/chunk-IVTJXPAO.js.map +0 -7
  32. package/dist/esm/chunk-Q55ZUKOX.js.map +0 -7
  33. /package/dist/esm/{chunk-CMVA2R27.js.map → chunk-V7RSNTZY.js.map} +0 -0
@@ -115,6 +115,7 @@ export type Command =
115
115
  | { ClaimOrRefresh: ClaimOrRefresh }
116
116
  | { Configure: Configure }
117
117
  | { RegisterVote: RegisterVote }
118
+ | { SetFollowing: SetFollowing }
118
119
  | { MakeProposal: Proposal }
119
120
  | { StakeMaturity: StakeMaturity }
120
121
  | { RemoveNeuronPermissions: RemoveNeuronPermissions }
@@ -129,6 +130,7 @@ export type Command_1 =
129
130
  | { ClaimOrRefresh: ClaimOrRefreshResponse }
130
131
  | { Configure: {} }
131
132
  | { RegisterVote: {} }
133
+ | { SetFollowing: {} }
132
134
  | { MakeProposal: GetProposal }
133
135
  | { RemoveNeuronPermission: {} }
134
136
  | { StakeMaturity: StakeMaturityResponse }
@@ -141,6 +143,7 @@ export type Command_2 =
141
143
  | { DisburseMaturity: DisburseMaturity }
142
144
  | { Configure: Configure }
143
145
  | { RegisterVote: RegisterVote }
146
+ | { SetFollowing: SetFollowing }
144
147
  | { SyncCommand: {} }
145
148
  | { MakeProposal: Proposal }
146
149
  | { FinalizeDisburseMaturity: FinalizeDisburseMaturity }
@@ -206,9 +209,17 @@ export interface Follow {
206
209
  function_id: bigint;
207
210
  followees: Array<NeuronId>;
208
211
  }
212
+ export interface Followee {
213
+ alias: [] | [string];
214
+ neuron_id: [] | [NeuronId];
215
+ }
209
216
  export interface Followees {
210
217
  followees: Array<NeuronId>;
211
218
  }
219
+ export interface FolloweesForTopic {
220
+ topic: [] | [Topic];
221
+ followees: Array<Followee>;
222
+ }
212
223
  export type FunctionType =
213
224
  | { NativeNervousSystemFunction: {} }
214
225
  | { GenericNervousSystemFunction: GenericNervousSystemFunction };
@@ -339,11 +350,13 @@ export interface ListProposals {
339
350
  before_proposal: [] | [ProposalId];
340
351
  limit: number;
341
352
  exclude_type: BigUint64Array | bigint[];
353
+ include_topics: [] | [Array<TopicSelector>];
342
354
  include_status: Int32Array | number[];
343
355
  }
344
356
  export interface ListProposalsResponse {
345
357
  include_ballots_by_caller: [] | [boolean];
346
358
  proposals: Array<ProposalData>;
359
+ include_topic_filtering: [] | [boolean];
347
360
  }
348
361
  export type ListTopicsRequest = {};
349
362
  export interface ListTopicsResponse {
@@ -446,6 +459,9 @@ export interface Neuron {
446
459
  maturity_e8s_equivalent: bigint;
447
460
  cached_neuron_stake_e8s: bigint;
448
461
  created_timestamp_seconds: bigint;
462
+ topic_followees:
463
+ | []
464
+ | [{ topic_id_to_followees: Array<[number, FolloweesForTopic]> }];
449
465
  source_nns_neuron_id: [] | [bigint];
450
466
  auto_stake_maturity: [] | [boolean];
451
467
  aging_since_timestamp_seconds: bigint;
@@ -466,15 +482,6 @@ export interface NeuronInFlightCommand {
466
482
  command: [] | [Command_2];
467
483
  timestamp: bigint;
468
484
  }
469
- export interface NeuronParameters {
470
- controller: [] | [Principal];
471
- dissolve_delay_seconds: [] | [bigint];
472
- source_nns_neuron_id: [] | [bigint];
473
- stake_e8s: [] | [bigint];
474
- followees: Array<NeuronId>;
475
- hotkey: [] | [Principal];
476
- neuron_id: [] | [NeuronId];
477
- }
478
485
  export interface NeuronPermission {
479
486
  principal: [] | [Principal];
480
487
  permission_type: Int32Array | number[];
@@ -528,6 +535,7 @@ export interface Proposal {
528
535
  export interface ProposalData {
529
536
  id: [] | [ProposalId];
530
537
  payload_text_rendering: [] | [string];
538
+ topic: [] | [Topic];
531
539
  action: bigint;
532
540
  failure_reason: [] | [GovernanceError];
533
541
  action_auxiliary: [] | [ActionAuxiliary];
@@ -583,6 +591,9 @@ export interface RewardEvent {
583
591
  export interface SetDissolveTimestamp {
584
592
  dissolve_timestamp_seconds: bigint;
585
593
  }
594
+ export interface SetFollowing {
595
+ topic_following: Array<FolloweesForTopic>;
596
+ }
586
597
  export interface SetMode {
587
598
  mode: number;
588
599
  }
@@ -658,6 +669,9 @@ export interface TopicInfo {
658
669
  description: [] | [string];
659
670
  custom_functions: [] | [Array<NervousSystemFunction>];
660
671
  }
672
+ export interface TopicSelector {
673
+ topic: [] | [Topic];
674
+ }
661
675
  export interface TransferSnsTreasuryFunds {
662
676
  from_treasury: number;
663
677
  to_principal: [] | [Principal];
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 9769228872 (2025-02-13 tags: release-2025-03-06_03-10-disable-best-effort-messaging) 'rs/sns/governance/canister/governance_test.did' by import-candid
1
+ // Generated from IC repo commit 579b8ba3a3 (2025-04-11 tags: release-2025-04-11_13-20-base) '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;
@@ -107,6 +107,7 @@ type ClaimedSwapNeurons = record {
107
107
  type Command = variant {
108
108
  Split : Split;
109
109
  Follow : Follow;
110
+ SetFollowing : SetFollowing;
110
111
  DisburseMaturity : DisburseMaturity;
111
112
  ClaimOrRefresh : ClaimOrRefresh;
112
113
  Configure : Configure;
@@ -123,6 +124,7 @@ type Command_1 = variant {
123
124
  Error : GovernanceError;
124
125
  Split : SplitResponse;
125
126
  Follow : record {};
127
+ SetFollowing : record {};
126
128
  DisburseMaturity : DisburseMaturityResponse;
127
129
  ClaimOrRefresh : ClaimOrRefreshResponse;
128
130
  Configure : record {};
@@ -138,6 +140,7 @@ type Command_1 = variant {
138
140
  type Command_2 = variant {
139
141
  Split : Split;
140
142
  Follow : Follow;
143
+ SetFollowing : SetFollowing;
141
144
  DisburseMaturity : DisburseMaturity;
142
145
  Configure : Configure;
143
146
  RegisterVote : RegisterVote;
@@ -223,6 +226,10 @@ type Follow = record {
223
226
  followees : vec NeuronId;
224
227
  };
225
228
 
229
+ type SetFollowing = record {
230
+ topic_following : vec FolloweesForTopic;
231
+ };
232
+
226
233
  type Followees = record {
227
234
  followees : vec NeuronId;
228
235
  };
@@ -237,7 +244,7 @@ type GenericNervousSystemFunction = record {
237
244
  target_canister_id : opt principal;
238
245
  validator_method_name : opt text;
239
246
  target_method_name : opt text;
240
- topic: opt Topic;
247
+ topic : opt Topic;
241
248
  };
242
249
 
243
250
  type GetMaturityModulationResponse = record {
@@ -374,10 +381,16 @@ type ListProposals = record {
374
381
  limit : nat32;
375
382
  exclude_type : vec nat64;
376
383
  include_status : vec int32;
384
+ include_topics : opt vec TopicSelector;
385
+ };
386
+
387
+ type TopicSelector = record {
388
+ topic : opt Topic;
377
389
  };
378
390
 
379
391
  type ListProposalsResponse = record {
380
392
  include_ballots_by_caller : opt bool;
393
+ include_topic_filtering : opt bool;
381
394
  proposals : vec ProposalData;
382
395
  };
383
396
 
@@ -506,6 +519,11 @@ type NervousSystemParameters = record {
506
519
  automatically_advance_target_version : opt bool;
507
520
  };
508
521
 
522
+ type FolloweesForTopic = record {
523
+ followees : vec Followee;
524
+ topic : opt Topic;
525
+ };
526
+
509
527
  type Neuron = record {
510
528
  id : opt NeuronId;
511
529
  staked_maturity_e8s_equivalent : opt nat64;
@@ -521,6 +539,9 @@ type Neuron = record {
521
539
  vesting_period_seconds : opt nat64;
522
540
  disburse_maturity_in_progress : vec DisburseMaturityInProgress;
523
541
  followees : vec record { nat64; Followees };
542
+ topic_followees : opt record {
543
+ topic_id_to_followees : vec record { int32; FolloweesForTopic };
544
+ };
524
545
  neuron_fees_e8s : nat64;
525
546
  };
526
547
 
@@ -528,6 +549,11 @@ type NeuronId = record {
528
549
  id : blob;
529
550
  };
530
551
 
552
+ type Followee = record {
553
+ neuron_id : opt NeuronId;
554
+ alias : opt text;
555
+ };
556
+
531
557
  type NeuronIds = record {
532
558
  neuron_ids : vec NeuronId;
533
559
  };
@@ -537,16 +563,6 @@ type NeuronInFlightCommand = record {
537
563
  timestamp : nat64;
538
564
  };
539
565
 
540
- type NeuronParameters = record {
541
- controller : opt principal;
542
- dissolve_delay_seconds : opt nat64;
543
- source_nns_neuron_id : opt nat64;
544
- stake_e8s : opt nat64;
545
- followees : vec NeuronId;
546
- hotkey : opt principal;
547
- neuron_id : opt NeuronId;
548
- };
549
-
550
566
  type NeuronPermission = record {
551
567
  "principal" : opt principal;
552
568
  permission_type : vec int32;
@@ -626,6 +642,7 @@ type ProposalData = record {
626
642
  minimum_yes_proportion_of_exercised : opt Percentage;
627
643
  is_eligible_for_rewards : bool;
628
644
  executed_timestamp_seconds : nat64;
645
+ topic : opt Topic;
629
646
  };
630
647
 
631
648
  type ProposalId = record {
@@ -330,6 +330,7 @@ export const idlFactory = ({ IDL }) => {
330
330
  const ProposalData = IDL.Record({
331
331
  'id' : IDL.Opt(ProposalId),
332
332
  'payload_text_rendering' : IDL.Opt(IDL.Text),
333
+ 'topic' : IDL.Opt(Topic),
333
334
  'action' : IDL.Nat64,
334
335
  'failure_reason' : IDL.Opt(GovernanceError),
335
336
  'action_auxiliary' : IDL.Opt(ActionAuxiliary),
@@ -381,6 +382,17 @@ export const idlFactory = ({ IDL }) => {
381
382
  'vote' : IDL.Int32,
382
383
  'proposal' : IDL.Opt(ProposalId),
383
384
  });
385
+ const Followee = IDL.Record({
386
+ 'alias' : IDL.Opt(IDL.Text),
387
+ 'neuron_id' : IDL.Opt(NeuronId),
388
+ });
389
+ const FolloweesForTopic = IDL.Record({
390
+ 'topic' : IDL.Opt(Topic),
391
+ 'followees' : IDL.Vec(Followee),
392
+ });
393
+ const SetFollowing = IDL.Record({
394
+ 'topic_following' : IDL.Vec(FolloweesForTopic),
395
+ });
384
396
  const FinalizeDisburseMaturity = IDL.Record({
385
397
  'amount_to_be_disbursed_e8s' : IDL.Nat64,
386
398
  'to_account' : IDL.Opt(Account),
@@ -414,6 +426,7 @@ export const idlFactory = ({ IDL }) => {
414
426
  'DisburseMaturity' : DisburseMaturity,
415
427
  'Configure' : Configure,
416
428
  'RegisterVote' : RegisterVote,
429
+ 'SetFollowing' : SetFollowing,
417
430
  'SyncCommand' : IDL.Record({}),
418
431
  'MakeProposal' : Proposal,
419
432
  'FinalizeDisburseMaturity' : FinalizeDisburseMaturity,
@@ -448,6 +461,13 @@ export const idlFactory = ({ IDL }) => {
448
461
  'maturity_e8s_equivalent' : IDL.Nat64,
449
462
  'cached_neuron_stake_e8s' : IDL.Nat64,
450
463
  'created_timestamp_seconds' : IDL.Nat64,
464
+ 'topic_followees' : IDL.Opt(
465
+ IDL.Record({
466
+ 'topic_id_to_followees' : IDL.Vec(
467
+ IDL.Tuple(IDL.Int32, FolloweesForTopic)
468
+ ),
469
+ })
470
+ ),
451
471
  'source_nns_neuron_id' : IDL.Opt(IDL.Nat64),
452
472
  'auto_stake_maturity' : IDL.Opt(IDL.Bool),
453
473
  'aging_since_timestamp_seconds' : IDL.Nat64,
@@ -618,16 +638,19 @@ export const idlFactory = ({ IDL }) => {
618
638
  'start_page_at' : IDL.Opt(NeuronId),
619
639
  });
620
640
  const ListNeuronsResponse = IDL.Record({ 'neurons' : IDL.Vec(Neuron) });
641
+ const TopicSelector = IDL.Record({ 'topic' : IDL.Opt(Topic) });
621
642
  const ListProposals = IDL.Record({
622
643
  'include_reward_status' : IDL.Vec(IDL.Int32),
623
644
  'before_proposal' : IDL.Opt(ProposalId),
624
645
  'limit' : IDL.Nat32,
625
646
  'exclude_type' : IDL.Vec(IDL.Nat64),
647
+ 'include_topics' : IDL.Opt(IDL.Vec(TopicSelector)),
626
648
  'include_status' : IDL.Vec(IDL.Int32),
627
649
  });
628
650
  const ListProposalsResponse = IDL.Record({
629
651
  'include_ballots_by_caller' : IDL.Opt(IDL.Bool),
630
652
  'proposals' : IDL.Vec(ProposalData),
653
+ 'include_topic_filtering' : IDL.Opt(IDL.Bool),
631
654
  });
632
655
  const ListTopicsRequest = IDL.Record({});
633
656
  const TopicInfo = IDL.Record({
@@ -652,6 +675,7 @@ export const idlFactory = ({ IDL }) => {
652
675
  'ClaimOrRefresh' : ClaimOrRefresh,
653
676
  'Configure' : Configure,
654
677
  'RegisterVote' : RegisterVote,
678
+ 'SetFollowing' : SetFollowing,
655
679
  'MakeProposal' : Proposal,
656
680
  'StakeMaturity' : StakeMaturity,
657
681
  'RemoveNeuronPermissions' : RemoveNeuronPermissions,
@@ -688,6 +712,7 @@ export const idlFactory = ({ IDL }) => {
688
712
  'ClaimOrRefresh' : ClaimOrRefreshResponse,
689
713
  'Configure' : IDL.Record({}),
690
714
  'RegisterVote' : IDL.Record({}),
715
+ 'SetFollowing' : IDL.Record({}),
691
716
  'MakeProposal' : GetProposal,
692
717
  'RemoveNeuronPermission' : IDL.Record({}),
693
718
  'StakeMaturity' : StakeMaturityResponse,
@@ -1118,6 +1143,7 @@ export const init = ({ IDL }) => {
1118
1143
  const ProposalData = IDL.Record({
1119
1144
  'id' : IDL.Opt(ProposalId),
1120
1145
  'payload_text_rendering' : IDL.Opt(IDL.Text),
1146
+ 'topic' : IDL.Opt(Topic),
1121
1147
  'action' : IDL.Nat64,
1122
1148
  'failure_reason' : IDL.Opt(GovernanceError),
1123
1149
  'action_auxiliary' : IDL.Opt(ActionAuxiliary),
@@ -1169,6 +1195,17 @@ export const init = ({ IDL }) => {
1169
1195
  'vote' : IDL.Int32,
1170
1196
  'proposal' : IDL.Opt(ProposalId),
1171
1197
  });
1198
+ const Followee = IDL.Record({
1199
+ 'alias' : IDL.Opt(IDL.Text),
1200
+ 'neuron_id' : IDL.Opt(NeuronId),
1201
+ });
1202
+ const FolloweesForTopic = IDL.Record({
1203
+ 'topic' : IDL.Opt(Topic),
1204
+ 'followees' : IDL.Vec(Followee),
1205
+ });
1206
+ const SetFollowing = IDL.Record({
1207
+ 'topic_following' : IDL.Vec(FolloweesForTopic),
1208
+ });
1172
1209
  const FinalizeDisburseMaturity = IDL.Record({
1173
1210
  'amount_to_be_disbursed_e8s' : IDL.Nat64,
1174
1211
  'to_account' : IDL.Opt(Account),
@@ -1202,6 +1239,7 @@ export const init = ({ IDL }) => {
1202
1239
  'DisburseMaturity' : DisburseMaturity,
1203
1240
  'Configure' : Configure,
1204
1241
  'RegisterVote' : RegisterVote,
1242
+ 'SetFollowing' : SetFollowing,
1205
1243
  'SyncCommand' : IDL.Record({}),
1206
1244
  'MakeProposal' : Proposal,
1207
1245
  'FinalizeDisburseMaturity' : FinalizeDisburseMaturity,
@@ -1236,6 +1274,13 @@ export const init = ({ IDL }) => {
1236
1274
  'maturity_e8s_equivalent' : IDL.Nat64,
1237
1275
  'cached_neuron_stake_e8s' : IDL.Nat64,
1238
1276
  'created_timestamp_seconds' : IDL.Nat64,
1277
+ 'topic_followees' : IDL.Opt(
1278
+ IDL.Record({
1279
+ 'topic_id_to_followees' : IDL.Vec(
1280
+ IDL.Tuple(IDL.Int32, FolloweesForTopic)
1281
+ ),
1282
+ })
1283
+ ),
1239
1284
  'source_nns_neuron_id' : IDL.Opt(IDL.Nat64),
1240
1285
  'auto_stake_maturity' : IDL.Opt(IDL.Bool),
1241
1286
  'aging_since_timestamp_seconds' : IDL.Nat64,
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 9769228872 (2025-02-13 tags: release-2025-03-06_03-10-disable-best-effort-messaging) 'rs/sns/root/canister/root.did' by import-candid
1
+ // Generated from IC repo commit 579b8ba3a3 (2025-04-11 tags: release-2025-04-11_13-20-base) '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 9769228872 (2025-02-13 tags: release-2025-03-06_03-10-disable-best-effort-messaging) 'rs/sns/swap/canister/swap.did' by import-candid
1
+ // Generated from IC repo commit 579b8ba3a3 (2025-04-11 tags: release-2025-04-11_13-20-base) '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;