@dfinity/sns 6.0.1 → 7.0.0

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 (53) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +54 -19
  3. package/dist/index.js +1 -6
  4. package/dist/index.js.map +4 -4
  5. package/dist/index.mjs +1 -6
  6. package/dist/index.mjs.map +4 -4
  7. package/package.json +3 -8
  8. package/dist/candid/sns_governance.certified.idl.d.ts +0 -2
  9. package/dist/candid/sns_governance.certified.idl.js +0 -1432
  10. package/dist/candid/sns_governance.d.ts +0 -933
  11. package/dist/candid/sns_governance.did +0 -1069
  12. package/dist/candid/sns_governance.idl.d.ts +0 -2
  13. package/dist/candid/sns_governance.idl.js +0 -1440
  14. package/dist/candid/sns_governance_test.certified.idl.d.ts +0 -2
  15. package/dist/candid/sns_governance_test.certified.idl.js +0 -1460
  16. package/dist/candid/sns_governance_test.d.ts +0 -962
  17. package/dist/candid/sns_governance_test.did +0 -1094
  18. package/dist/candid/sns_governance_test.idl.d.ts +0 -2
  19. package/dist/candid/sns_governance_test.idl.js +0 -1468
  20. package/dist/candid/sns_root.certified.idl.d.ts +0 -2
  21. package/dist/candid/sns_root.certified.idl.js +0 -251
  22. package/dist/candid/sns_root.d.ts +0 -212
  23. package/dist/candid/sns_root.did +0 -231
  24. package/dist/candid/sns_root.idl.d.ts +0 -2
  25. package/dist/candid/sns_root.idl.js +0 -251
  26. package/dist/candid/sns_swap.certified.idl.d.ts +0 -2
  27. package/dist/candid/sns_swap.certified.idl.js +0 -499
  28. package/dist/candid/sns_swap.d.ts +0 -438
  29. package/dist/candid/sns_swap.did +0 -505
  30. package/dist/candid/sns_swap.idl.d.ts +0 -2
  31. package/dist/candid/sns_swap.idl.js +0 -507
  32. package/dist/constants/governance.constants.d.ts +0 -8
  33. package/dist/converters/governance.converters.d.ts +0 -22
  34. package/dist/converters/swap.converters.d.ts +0 -3
  35. package/dist/enums/governance.enums.d.ts +0 -35
  36. package/dist/enums/swap.enums.d.ts +0 -22
  37. package/dist/errors/common.errors.d.ts +0 -4
  38. package/dist/errors/governance.errors.d.ts +0 -2
  39. package/dist/errors/swap.errors.d.ts +0 -16
  40. package/dist/governance.canister.d.ts +0 -138
  41. package/dist/governance_test.canister.d.ts +0 -16
  42. package/dist/root.canister.d.ts +0 -19
  43. package/dist/sns.d.ts +0 -21
  44. package/dist/sns.wrapper.d.ts +0 -160
  45. package/dist/swap.canister.d.ts +0 -47
  46. package/dist/types/actions.d.ts +0 -191
  47. package/dist/types/canister.options.d.ts +0 -5
  48. package/dist/types/common.d.ts +0 -2
  49. package/dist/types/governance.params.d.ts +0 -151
  50. package/dist/types/governance_test.params.d.ts +0 -7
  51. package/dist/types/swap.params.d.ts +0 -8
  52. package/dist/utils/error.utils.d.ts +0 -12
  53. package/dist/utils/governance.utils.d.ts +0 -14
@@ -1,151 +0,0 @@
1
- import type { IcrcAccount, IcrcSubaccount, IcrcTokens } from "@dfinity/ledger-icrc";
2
- import type { QueryParams } from "@dfinity/utils";
3
- import type { Principal } from "@icp-sdk/core/principal";
4
- import type { NeuronId, ProposalId, Topic } from "../candid/sns_governance";
5
- import type { SnsNeuronPermissionType, SnsProposalDecisionStatus, SnsProposalRewardStatus, SnsVote } from "../enums/governance.enums";
6
- import type { E8s } from "./common";
7
- /**
8
- * The parameters available to list Sns neurons
9
- */
10
- export interface SnsListNeuronsParams extends QueryParams {
11
- /** Scope the query to a particular principal */
12
- principal?: Principal | undefined;
13
- /** The maximum number of neurons returned by the method `list_neurons` */
14
- limit?: number;
15
- /** Index the search to returns a list that starts after specified neuron id */
16
- beforeNeuronId?: NeuronId;
17
- }
18
- /**
19
- * The parameters available to list Sns proposals
20
- */
21
- export interface SnsListProposalsParams extends QueryParams {
22
- includeRewardStatus?: SnsProposalRewardStatus[];
23
- beforeProposal?: ProposalId;
24
- limit?: number;
25
- excludeType?: bigint[];
26
- includeStatus?: SnsProposalDecisionStatus[];
27
- includeTopics?: Array<Topic | null>;
28
- }
29
- export type SnsListTopicsParams = QueryParams;
30
- /**
31
- * The parameters to get an sns proposal
32
- */
33
- export interface SnsGetProposalParams extends QueryParams {
34
- proposalId: ProposalId;
35
- }
36
- /**
37
- * The parameters to get a Sns neuron
38
- */
39
- export interface SnsGetNeuronParams extends QueryParams {
40
- neuronId: NeuronId;
41
- }
42
- export interface SnsStakeNeuronParams extends Omit<QueryParams, "certified"> {
43
- stakeE8s: IcrcTokens;
44
- source: IcrcAccount;
45
- controller: Principal;
46
- createdAt?: bigint;
47
- fee?: bigint;
48
- }
49
- export interface SnsIncreaseStakeNeuronParams extends Omit<QueryParams, "certified"> {
50
- stakeE8s: IcrcTokens;
51
- source: IcrcAccount;
52
- neuronId: NeuronId;
53
- }
54
- export interface SnsClaimOrRefreshArgs extends Omit<QueryParams, "certified"> {
55
- subaccount: Uint8Array;
56
- memo?: bigint;
57
- controller?: Principal;
58
- }
59
- /**
60
- * General neuron management request parameter interface
61
- */
62
- interface SnsNeuronManagementParams extends Omit<QueryParams, "certified"> {
63
- neuronId: NeuronId;
64
- }
65
- /**
66
- * The parameters to add permissions to a neuron
67
- */
68
- export interface SnsNeuronPermissionsParams extends SnsNeuronManagementParams {
69
- principal: Principal;
70
- permissions: SnsNeuronPermissionType[];
71
- }
72
- /**
73
- * The parameters to split a neuron
74
- */
75
- export interface SnsSplitNeuronParams extends SnsNeuronManagementParams {
76
- amount: E8s;
77
- memo: bigint;
78
- }
79
- /**
80
- * The parameters to disburse a neuron
81
- */
82
- export interface SnsDisburseNeuronParams extends SnsNeuronManagementParams {
83
- amount?: E8s;
84
- toAccount?: IcrcAccount;
85
- }
86
- /**
87
- * The parameters to set dissolve timestamp
88
- */
89
- export interface SnsSetDissolveTimestampParams extends SnsNeuronManagementParams {
90
- dissolveTimestampSeconds: bigint;
91
- }
92
- /**
93
- * The parameters to increase dissolve delay
94
- */
95
- export interface SnsIncreaseDissolveDelayParams extends SnsNeuronManagementParams {
96
- additionalDissolveDelaySeconds: number;
97
- }
98
- /**
99
- * The parameters to follow by ns-function
100
- */
101
- export interface SnsSetTopicFollowees extends SnsNeuronManagementParams {
102
- functionId: bigint;
103
- followees: NeuronId[];
104
- }
105
- /**
106
- * The parameters to follow by topic
107
- */
108
- export interface SnsSetFollowingParams extends SnsNeuronManagementParams {
109
- topicFollowing: Array<{
110
- topic: Topic;
111
- followees: Array<{
112
- neuronId: NeuronId;
113
- alias?: string;
114
- }>;
115
- }>;
116
- }
117
- /**
118
- * The parameters to register vote
119
- */
120
- export interface SnsRegisterVoteParams extends SnsNeuronManagementParams {
121
- vote: SnsVote;
122
- proposalId: ProposalId;
123
- }
124
- /**
125
- * The parameters to claim a neuron
126
- */
127
- export interface SnsClaimNeuronParams {
128
- memo: bigint;
129
- controller: Principal;
130
- subaccount: IcrcSubaccount;
131
- }
132
- /**
133
- * The parameters to stake maturity of a neuron
134
- */
135
- export interface SnsNeuronStakeMaturityParams extends SnsNeuronManagementParams {
136
- percentageToStake?: number;
137
- }
138
- /**
139
- * The parameters to disburse maturity of a neuron
140
- */
141
- export interface SnsNeuronDisburseMaturityParams extends SnsNeuronManagementParams {
142
- toAccount?: IcrcAccount;
143
- percentageToDisburse: number;
144
- }
145
- /**
146
- * The parameters to toggle auto stake maturity of a neuron
147
- */
148
- export interface SnsNeuronAutoStakeMaturityParams extends SnsNeuronManagementParams {
149
- autoStake: boolean;
150
- }
151
- export {};
@@ -1,7 +0,0 @@
1
- import type { QueryParams } from "@dfinity/utils";
2
- import type { NeuronId } from "../candid/sns_governance";
3
- import type { E8s } from "./common";
4
- export interface SnsAddMaturityParams extends QueryParams {
5
- id: NeuronId;
6
- amountE8s: E8s;
7
- }
@@ -1,8 +0,0 @@
1
- import type { E8s } from "./common";
2
- /**
3
- * The parameters to create a sale ticket (payment flow)
4
- */
5
- export interface NewSaleTicketParams {
6
- subaccount?: Uint8Array;
7
- amount_icp_e8s: E8s;
8
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Identifies errors of method not being present in the canister.
3
- *
4
- * This is useful because SNS projects have different versions of SNS canisters.
5
- * Therefore, what works in the latest version might not work in the previous one.
6
- *
7
- * Error message example: "Call was rejected:
8
- * Request ID: 3a6ef904b35fd19721c95c3df2b0b00b8abefba7f0ad188f5c472809b772c914
9
- * Reject code: 3
10
- * Reject text: Canister 75ffu-oaaaa-aaaaa-aabbq-cai has no update method 'get_auto_finalization_status'"
11
- */
12
- export declare const isMethodNotSupportedError: (err: unknown) => boolean;
@@ -1,14 +0,0 @@
1
- import type { IcrcSubaccount } from "@dfinity/ledger-icrc";
2
- import type { Principal } from "@icp-sdk/core/principal";
3
- /**
4
- * Neuron subaccount is calculated as "sha256(0x0c . “neuron-stake” . controller . i)"
5
- *
6
- * @param params
7
- * @param {Principal} params.newController
8
- * @param {number} params.index
9
- * @returns
10
- */
11
- export declare const neuronSubaccount: ({ index, controller, }: {
12
- index: number;
13
- controller: Principal;
14
- }) => IcrcSubaccount;