@dfinity/sns 4.0.3 → 4.0.4-next-2025-10-04

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.
@@ -444,6 +444,9 @@ export interface MergeMaturityResponse {
444
444
  new_stake_e8s: bigint;
445
445
  }
446
446
  export interface Metrics {
447
+ /**
448
+ * The metrics below are cached (albeit this is an implementation detail).
449
+ */
447
450
  treasury_metrics: [] | [Array<TreasuryMetrics>];
448
451
  voting_power_metrics: [] | [VotingPowerMetrics];
449
452
  last_ledger_block_timestamp: [] | [bigint];
@@ -563,6 +566,22 @@ export interface PendingVersion {
563
566
  export interface Percentage {
564
567
  basis_points: [] | [bigint];
565
568
  }
569
+ /**
570
+ * This type is equivalant to `ICRC3Value`, but we give it another name since it is used here not
571
+ * in the context of the ICRC-3 ledger standard. The justification is the same: The candid format
572
+ * supports sharing information even when the client and the server involved do not have the same
573
+ * schema (see the Upgrading and subtyping section of the candid spec). While this mechanism allows
574
+ * to evolve services and clients independently without breaking them, it also means that a client
575
+ * may not receive all the information that the server is sending, e.g. in case the client schema
576
+ * lacks some fields that the server schema has.
577
+ *
578
+ * This loss of information is not an option for SNS voters deciding if an extension with particular
579
+ * init args should be installed or if an extension function with particular arguments should be
580
+ * called. The client must receive the same exact data the server sent in order to verify it.
581
+ *
582
+ * Verification of a priorly installed extension is done by hashing the extension's init arg data
583
+ * and checking that the result is consistent with what has been certified by the SNS.
584
+ */
566
585
  export type PreciseValue =
567
586
  | { Int: bigint }
568
587
  | { Map: Array<[string, PreciseValue]> }
@@ -737,12 +756,30 @@ export interface TransferSnsTreasuryFunds {
737
756
  amount_e8s: bigint;
738
757
  }
739
758
  export interface TreasuryMetrics {
759
+ /**
760
+ * A human-readable identified for this treasury, e.g., "ICP".
761
+ */
740
762
  name: [] | [string];
763
+ /**
764
+ * The amount of tokens in this treasury at the end of swap finalization.
765
+ */
741
766
  original_amount_e8s: [] | [bigint];
767
+ /**
768
+ * The regularly updated amount of tokens in this treasury.
769
+ */
742
770
  amount_e8s: [] | [bigint];
743
771
  account: [] | [Account];
772
+ /**
773
+ * The source of truth for the treasury balance is this ledger canister / account.
774
+ */
744
775
  ledger_canister_id: [] | [Principal];
776
+ /**
777
+ * Same as, e.g., `TransferSnsTreasuryFunds.from_treasury`.
778
+ */
745
779
  treasury: number;
780
+ /**
781
+ * When the metrics were last updated.
782
+ */
746
783
  timestamp_seconds: [] | [bigint];
747
784
  }
748
785
  export interface UpgradeExtension {
@@ -831,6 +868,9 @@ export interface Versions {
831
868
  }
832
869
  export interface VotingPowerMetrics {
833
870
  governance_total_potential_voting_power: [] | [bigint];
871
+ /**
872
+ * When the metrics were last updated.
873
+ */
834
874
  timestamp_seconds: [] | [bigint];
835
875
  }
836
876
  export interface VotingRewardsParameters {
@@ -1,4 +1,5 @@
1
1
  // Generated from IC repo commit 206b61a (2025-09-25 tags: release-2025-09-25_09-52-base) 'rs/sns/governance/canister/governance.did' by import-candid
2
+
2
3
  type Account = record {
3
4
  owner : opt principal;
4
5
  subaccount : opt Subaccount;
@@ -455,6 +455,9 @@ export interface MergeMaturityResponse {
455
455
  new_stake_e8s: bigint;
456
456
  }
457
457
  export interface Metrics {
458
+ /**
459
+ * The metrics below are cached (albeit this is an implementation detail).
460
+ */
458
461
  treasury_metrics: [] | [Array<TreasuryMetrics>];
459
462
  voting_power_metrics: [] | [VotingPowerMetrics];
460
463
  last_ledger_block_timestamp: [] | [bigint];
@@ -578,6 +581,22 @@ export interface PendingVersion {
578
581
  export interface Percentage {
579
582
  basis_points: [] | [bigint];
580
583
  }
584
+ /**
585
+ * This type is equivalant to `ICRC3Value`, but we give it another name since it is used here not
586
+ * in the context of the ICRC-3 ledger standard. The justification is the same: The candid format
587
+ * supports sharing information even when the client and the server involved do not have the same
588
+ * schema (see the Upgrading and subtyping section of the candid spec). While this mechanism allows
589
+ * to evolve services and clients independently without breaking them, it also means that a client
590
+ * may not receive all the information that the server is sending, e.g. in case the client schema
591
+ * lacks some fields that the server schema has.
592
+ *
593
+ * This loss of information is not an option for SNS voters deciding if an extension with particular
594
+ * init args should be installed or if an extension function with particular arguments should be
595
+ * called. The client must receive the same exact data the server sent in order to verify it.
596
+ *
597
+ * Verification of a priorly installed extension is done by hashing the extension's init arg data
598
+ * and checking that the result is consistent with what has been certified by the SNS.
599
+ */
581
600
  export type PreciseValue =
582
601
  | { Int: bigint }
583
602
  | { Map: Array<[string, PreciseValue]> }
@@ -752,12 +771,30 @@ export interface TransferSnsTreasuryFunds {
752
771
  amount_e8s: bigint;
753
772
  }
754
773
  export interface TreasuryMetrics {
774
+ /**
775
+ * A human-readable identified for this treasury, e.g., "ICP".
776
+ */
755
777
  name: [] | [string];
778
+ /**
779
+ * The amount of tokens in this treasury at the end of swap finalization.
780
+ */
756
781
  original_amount_e8s: [] | [bigint];
782
+ /**
783
+ * The regularly updated amount of tokens in this treasury.
784
+ */
757
785
  amount_e8s: [] | [bigint];
758
786
  account: [] | [Account];
787
+ /**
788
+ * The source of truth for the treasury balance is this ledger canister / account.
789
+ */
759
790
  ledger_canister_id: [] | [Principal];
791
+ /**
792
+ * Same as, e.g., `TransferSnsTreasuryFunds.from_treasury`.
793
+ */
760
794
  treasury: number;
795
+ /**
796
+ * When the metrics were last updated.
797
+ */
761
798
  timestamp_seconds: [] | [bigint];
762
799
  }
763
800
  export interface UpgradeExtension {
@@ -846,6 +883,9 @@ export interface Versions {
846
883
  }
847
884
  export interface VotingPowerMetrics {
848
885
  governance_total_potential_voting_power: [] | [bigint];
886
+ /**
887
+ * When the metrics were last updated.
888
+ */
849
889
  timestamp_seconds: [] | [bigint];
850
890
  }
851
891
  export interface VotingRewardsParameters {
@@ -1,4 +1,5 @@
1
1
  // Generated from IC repo commit 206b61a (2025-09-25 tags: release-2025-09-25_09-52-base) 'rs/sns/governance/canister/governance_test.did' by import-candid
2
+
2
3
  type Account = record {
3
4
  owner : opt principal;
4
5
  subaccount : opt Subaccount;
@@ -1,4 +1,5 @@
1
1
  // Generated from IC repo commit 206b61a (2025-09-25 tags: release-2025-09-25_09-52-base) 'rs/sns/root/canister/root.did' by import-candid
2
+
2
3
  type CanisterCallError = record {
3
4
  code : opt int32;
4
5
  description : text;
@@ -1,4 +1,5 @@
1
1
  // Generated from IC repo commit 206b61a (2025-09-25 tags: release-2025-09-25_09-52-base) 'rs/sns/swap/canister/swap.did' by import-candid
2
+
2
3
  type BuyerState = record {
3
4
  icp : opt TransferableAmount;
4
5
  has_created_neuron_recipes : opt bool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfinity/sns",
3
- "version": "4.0.3",
3
+ "version": "4.0.4-next-2025-10-04",
4
4
  "description": "A library for interfacing with a Service Nervous System (SNS) project.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/cjs/index.cjs.js",
@@ -36,13 +36,13 @@
36
36
  "sns"
37
37
  ],
38
38
  "peerDependencies": {
39
- "@dfinity/agent": "^3",
40
- "@dfinity/candid": "^3",
41
- "@dfinity/ledger-icrc": "^4",
42
- "@dfinity/principal": "^3",
43
- "@dfinity/utils": "^3"
39
+ "@dfinity/agent": "*",
40
+ "@dfinity/candid": "*",
41
+ "@dfinity/ledger-icrc": "*",
42
+ "@dfinity/principal": "*",
43
+ "@dfinity/utils": "*"
44
44
  },
45
45
  "dependencies": {
46
46
  "@noble/hashes": "^1.8.0"
47
47
  }
48
- }
48
+ }