@ssv-labs/ssv-sdk 0.0.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.
Files changed (64) hide show
  1. package/LICENSE +674 -0
  2. package/README.html +102 -0
  3. package/README.md +136 -0
  4. package/README.pdf +0 -0
  5. package/dist/abi/holesky/v4/getter.d.ts +824 -0
  6. package/dist/abi/holesky/v4/setter.d.ts +1662 -0
  7. package/dist/abi/mainnet/v4/getter.d.ts +824 -0
  8. package/dist/abi/mainnet/v4/setter.d.ts +1677 -0
  9. package/dist/abi/token.d.ts +292 -0
  10. package/dist/api/ssv-api/index.d.ts +16 -0
  11. package/dist/api/subgraph/index.d.ts +101 -0
  12. package/dist/config/chains.d.ts +94 -0
  13. package/dist/config/create.d.ts +45 -0
  14. package/dist/config/globals.d.ts +33 -0
  15. package/dist/config/index.d.ts +3 -0
  16. package/dist/config-DPI30L0i.js +5159 -0
  17. package/dist/config-DlwfpwZd.mjs +5161 -0
  18. package/dist/contract-interactions/create.d.ts +3 -0
  19. package/dist/contract-interactions/index.d.ts +1 -0
  20. package/dist/contract-interactions/types.d.ts +93 -0
  21. package/dist/graphql/graphql.d.ts +3249 -0
  22. package/dist/libs/api/index.d.ts +81 -0
  23. package/dist/libs/cluster/index.d.ts +5636 -0
  24. package/dist/libs/cluster/methods/deposit.d.ts +286 -0
  25. package/dist/libs/cluster/methods/exit-validators.d.ts +283 -0
  26. package/dist/libs/cluster/methods/index.d.ts +8 -0
  27. package/dist/libs/cluster/methods/liquidate-cluster.d.ts +281 -0
  28. package/dist/libs/cluster/methods/reactivate-cluster.d.ts +282 -0
  29. package/dist/libs/cluster/methods/register-validators.d.ts +3652 -0
  30. package/dist/libs/cluster/methods/remove-validators.d.ts +283 -0
  31. package/dist/libs/cluster/methods/set-fee-recipient.d.ts +282 -0
  32. package/dist/libs/cluster/methods/withdraw.d.ts +282 -0
  33. package/dist/libs/operator/index.d.ts +4005 -0
  34. package/dist/libs/operator/methods.d.ts +844 -0
  35. package/dist/libs/utils/index.d.ts +32 -0
  36. package/dist/libs/utils/methods/get-cluster-balance.d.ts +9 -0
  37. package/dist/libs/utils/methods/index.d.ts +4 -0
  38. package/dist/libs/utils/methods/keyshares.d.ts +21 -0
  39. package/dist/libs/utils/methods/keystores.d.ts +13 -0
  40. package/dist/libs/utils/methods/methods.d.ts +2 -0
  41. package/dist/main.d.ts +8 -0
  42. package/dist/main.js +36437 -0
  43. package/dist/main.mjs +36437 -0
  44. package/dist/mock/api.d.ts +3 -0
  45. package/dist/mock/config.d.ts +6 -0
  46. package/dist/mock/index.d.ts +8 -0
  47. package/dist/sdk.d.ts +14 -0
  48. package/dist/types/contract-interactions.d.ts +21 -0
  49. package/dist/types/methods.d.ts +3 -0
  50. package/dist/types/operator.d.ts +9 -0
  51. package/dist/types/utils.d.ts +3 -0
  52. package/dist/utils/bigint.d.ts +29 -0
  53. package/dist/utils/cluster.d.ts +8 -0
  54. package/dist/utils/contract.d.ts +3 -0
  55. package/dist/utils/index.d.ts +9 -0
  56. package/dist/utils/keyshares.d.ts +21 -0
  57. package/dist/utils/number.d.ts +21 -0
  58. package/dist/utils/operator.d.ts +5 -0
  59. package/dist/utils/try-catch.d.ts +1 -0
  60. package/dist/utils/url-join.d.ts +1 -0
  61. package/dist/utils/zod/config.d.ts +9 -0
  62. package/dist/utils.js +43 -0
  63. package/dist/utils.mjs +43 -0
  64. package/package.json +136 -0
@@ -0,0 +1,281 @@
1
+ import { ConfigReturnType } from '../../../config/create';
2
+ import { SmartFnWriteOptions } from '../../../contract-interactions/types';
3
+ type LiquidateClusterProps = SmartFnWriteOptions<{
4
+ id: string;
5
+ }>;
6
+ export declare const liquidateCluster: (config: ConfigReturnType, { args: { id }, ...writeOptions }: LiquidateClusterProps) => Promise<{
7
+ hash: `0x${string}`;
8
+ wait: () => Promise<import('viem').TransactionReceipt & {
9
+ events: ({
10
+ eventName: "AdminChanged";
11
+ args: {
12
+ previousAdmin: `0x${string}`;
13
+ newAdmin: `0x${string}`;
14
+ };
15
+ } | {
16
+ eventName: "BeaconUpgraded";
17
+ args: {
18
+ beacon: `0x${string}`;
19
+ };
20
+ } | {
21
+ eventName: "Initialized";
22
+ args: {
23
+ version: number;
24
+ };
25
+ } | {
26
+ eventName: "OwnershipTransferStarted";
27
+ args: {
28
+ previousOwner: `0x${string}`;
29
+ newOwner: `0x${string}`;
30
+ };
31
+ } | {
32
+ eventName: "OwnershipTransferred";
33
+ args: {
34
+ previousOwner: `0x${string}`;
35
+ newOwner: `0x${string}`;
36
+ };
37
+ } | {
38
+ eventName: "Upgraded";
39
+ args: {
40
+ implementation: `0x${string}`;
41
+ };
42
+ } | {
43
+ eventName: "ClusterDeposited";
44
+ args: {
45
+ owner: `0x${string}`;
46
+ operatorIds: readonly bigint[];
47
+ value: bigint;
48
+ cluster: {
49
+ validatorCount: number;
50
+ networkFeeIndex: bigint;
51
+ index: bigint;
52
+ active: boolean;
53
+ balance: bigint;
54
+ };
55
+ };
56
+ } | {
57
+ eventName: "ClusterLiquidated";
58
+ args: {
59
+ owner: `0x${string}`;
60
+ operatorIds: readonly bigint[];
61
+ cluster: {
62
+ validatorCount: number;
63
+ networkFeeIndex: bigint;
64
+ index: bigint;
65
+ active: boolean;
66
+ balance: bigint;
67
+ };
68
+ };
69
+ } | {
70
+ eventName: "ClusterReactivated";
71
+ args: {
72
+ owner: `0x${string}`;
73
+ operatorIds: readonly bigint[];
74
+ cluster: {
75
+ validatorCount: number;
76
+ networkFeeIndex: bigint;
77
+ index: bigint;
78
+ active: boolean;
79
+ balance: bigint;
80
+ };
81
+ };
82
+ } | {
83
+ eventName: "ClusterWithdrawn";
84
+ args: {
85
+ owner: `0x${string}`;
86
+ operatorIds: readonly bigint[];
87
+ value: bigint;
88
+ cluster: {
89
+ validatorCount: number;
90
+ networkFeeIndex: bigint;
91
+ index: bigint;
92
+ active: boolean;
93
+ balance: bigint;
94
+ };
95
+ };
96
+ } | {
97
+ eventName: "DeclareOperatorFeePeriodUpdated";
98
+ args: {
99
+ value: bigint;
100
+ };
101
+ } | {
102
+ eventName: "ExecuteOperatorFeePeriodUpdated";
103
+ args: {
104
+ value: bigint;
105
+ };
106
+ } | {
107
+ eventName: "FeeRecipientAddressUpdated";
108
+ args: {
109
+ owner: `0x${string}`;
110
+ recipientAddress: `0x${string}`;
111
+ };
112
+ } | {
113
+ eventName: "LiquidationThresholdPeriodUpdated";
114
+ args: {
115
+ value: bigint;
116
+ };
117
+ } | {
118
+ eventName: "MinimumLiquidationCollateralUpdated";
119
+ args: {
120
+ value: bigint;
121
+ };
122
+ } | {
123
+ eventName: "ModuleUpgraded";
124
+ args: {
125
+ moduleId: number;
126
+ moduleAddress: `0x${string}`;
127
+ };
128
+ } | {
129
+ eventName: "NetworkEarningsWithdrawn";
130
+ args: {
131
+ value: bigint;
132
+ recipient: `0x${string}`;
133
+ };
134
+ } | {
135
+ eventName: "NetworkFeeUpdated";
136
+ args: {
137
+ oldFee: bigint;
138
+ newFee: bigint;
139
+ };
140
+ } | {
141
+ eventName: "OperatorAdded";
142
+ args: {
143
+ operatorId: bigint;
144
+ owner: `0x${string}`;
145
+ publicKey: `0x${string}`;
146
+ fee: bigint;
147
+ };
148
+ } | {
149
+ eventName: "OperatorFeeDeclarationCancelled";
150
+ args: {
151
+ owner: `0x${string}`;
152
+ operatorId: bigint;
153
+ };
154
+ } | {
155
+ eventName: "OperatorFeeDeclared";
156
+ args: {
157
+ owner: `0x${string}`;
158
+ operatorId: bigint;
159
+ blockNumber: bigint;
160
+ fee: bigint;
161
+ };
162
+ } | {
163
+ eventName: "OperatorFeeExecuted";
164
+ args: {
165
+ owner: `0x${string}`;
166
+ operatorId: bigint;
167
+ blockNumber: bigint;
168
+ fee: bigint;
169
+ };
170
+ } | {
171
+ eventName: "OperatorFeeIncreaseLimitUpdated";
172
+ args: {
173
+ value: bigint;
174
+ };
175
+ } | {
176
+ eventName: "OperatorMaximumFeeUpdated";
177
+ args: {
178
+ maxFee: bigint;
179
+ };
180
+ } | {
181
+ eventName: "OperatorMultipleWhitelistRemoved";
182
+ args: {
183
+ operatorIds: readonly bigint[];
184
+ whitelistAddresses: readonly `0x${string}`[];
185
+ };
186
+ } | {
187
+ eventName: "OperatorMultipleWhitelistUpdated";
188
+ args: {
189
+ operatorIds: readonly bigint[];
190
+ whitelistAddresses: readonly `0x${string}`[];
191
+ };
192
+ } | {
193
+ eventName: "OperatorPrivacyStatusUpdated";
194
+ args: {
195
+ operatorIds: readonly bigint[];
196
+ toPrivate: boolean;
197
+ };
198
+ } | {
199
+ eventName: "OperatorRemoved";
200
+ args: {
201
+ operatorId: bigint;
202
+ };
203
+ } | {
204
+ eventName: "OperatorWhitelistUpdated";
205
+ args: {
206
+ operatorId: bigint;
207
+ whitelisted: `0x${string}`;
208
+ };
209
+ } | {
210
+ eventName: "OperatorWhitelistingContractUpdated";
211
+ args: {
212
+ operatorIds: readonly bigint[];
213
+ whitelistingContract: `0x${string}`;
214
+ };
215
+ } | {
216
+ eventName: "OperatorWithdrawn";
217
+ args: {
218
+ owner: `0x${string}`;
219
+ operatorId: bigint;
220
+ value: bigint;
221
+ };
222
+ } | {
223
+ eventName: "ValidatorAdded";
224
+ args: {
225
+ owner: `0x${string}`;
226
+ operatorIds: readonly bigint[];
227
+ publicKey: `0x${string}`;
228
+ shares: `0x${string}`;
229
+ cluster: {
230
+ validatorCount: number;
231
+ networkFeeIndex: bigint;
232
+ index: bigint;
233
+ active: boolean;
234
+ balance: bigint;
235
+ };
236
+ };
237
+ } | {
238
+ eventName: "ValidatorExited";
239
+ args: {
240
+ owner: `0x${string}`;
241
+ operatorIds: readonly bigint[];
242
+ publicKey: `0x${string}`;
243
+ };
244
+ } | {
245
+ eventName: "ValidatorRemoved";
246
+ args: {
247
+ owner: `0x${string}`;
248
+ operatorIds: readonly bigint[];
249
+ publicKey: `0x${string}`;
250
+ cluster: {
251
+ validatorCount: number;
252
+ networkFeeIndex: bigint;
253
+ index: bigint;
254
+ active: boolean;
255
+ balance: bigint;
256
+ };
257
+ };
258
+ } | {
259
+ eventName: "OwnershipTransferred";
260
+ args: {
261
+ previousOwner: `0x${string}`;
262
+ newOwner: `0x${string}`;
263
+ };
264
+ } | {
265
+ eventName: "Approval";
266
+ args: {
267
+ owner: `0x${string}`;
268
+ spender: `0x${string}`;
269
+ value: bigint;
270
+ };
271
+ } | {
272
+ eventName: "Transfer";
273
+ args: {
274
+ from: `0x${string}`;
275
+ to: `0x${string}`;
276
+ value: bigint;
277
+ };
278
+ })[];
279
+ }>;
280
+ }>;
281
+ export {};
@@ -0,0 +1,282 @@
1
+ import { ConfigReturnType } from '../../../config/create';
2
+ import { SmartFnWriteOptions } from '../../../contract-interactions/types';
3
+ type ReactivateClusterProps = SmartFnWriteOptions<{
4
+ id: string;
5
+ amount: bigint;
6
+ }>;
7
+ export declare const reactivateCluster: (config: ConfigReturnType, { args: { id, amount }, ...writeOptions }: ReactivateClusterProps) => Promise<{
8
+ hash: `0x${string}`;
9
+ wait: () => Promise<import('viem').TransactionReceipt & {
10
+ events: ({
11
+ eventName: "AdminChanged";
12
+ args: {
13
+ previousAdmin: `0x${string}`;
14
+ newAdmin: `0x${string}`;
15
+ };
16
+ } | {
17
+ eventName: "BeaconUpgraded";
18
+ args: {
19
+ beacon: `0x${string}`;
20
+ };
21
+ } | {
22
+ eventName: "Initialized";
23
+ args: {
24
+ version: number;
25
+ };
26
+ } | {
27
+ eventName: "OwnershipTransferStarted";
28
+ args: {
29
+ previousOwner: `0x${string}`;
30
+ newOwner: `0x${string}`;
31
+ };
32
+ } | {
33
+ eventName: "OwnershipTransferred";
34
+ args: {
35
+ previousOwner: `0x${string}`;
36
+ newOwner: `0x${string}`;
37
+ };
38
+ } | {
39
+ eventName: "Upgraded";
40
+ args: {
41
+ implementation: `0x${string}`;
42
+ };
43
+ } | {
44
+ eventName: "ClusterDeposited";
45
+ args: {
46
+ owner: `0x${string}`;
47
+ operatorIds: readonly bigint[];
48
+ value: bigint;
49
+ cluster: {
50
+ validatorCount: number;
51
+ networkFeeIndex: bigint;
52
+ index: bigint;
53
+ active: boolean;
54
+ balance: bigint;
55
+ };
56
+ };
57
+ } | {
58
+ eventName: "ClusterLiquidated";
59
+ args: {
60
+ owner: `0x${string}`;
61
+ operatorIds: readonly bigint[];
62
+ cluster: {
63
+ validatorCount: number;
64
+ networkFeeIndex: bigint;
65
+ index: bigint;
66
+ active: boolean;
67
+ balance: bigint;
68
+ };
69
+ };
70
+ } | {
71
+ eventName: "ClusterReactivated";
72
+ args: {
73
+ owner: `0x${string}`;
74
+ operatorIds: readonly bigint[];
75
+ cluster: {
76
+ validatorCount: number;
77
+ networkFeeIndex: bigint;
78
+ index: bigint;
79
+ active: boolean;
80
+ balance: bigint;
81
+ };
82
+ };
83
+ } | {
84
+ eventName: "ClusterWithdrawn";
85
+ args: {
86
+ owner: `0x${string}`;
87
+ operatorIds: readonly bigint[];
88
+ value: bigint;
89
+ cluster: {
90
+ validatorCount: number;
91
+ networkFeeIndex: bigint;
92
+ index: bigint;
93
+ active: boolean;
94
+ balance: bigint;
95
+ };
96
+ };
97
+ } | {
98
+ eventName: "DeclareOperatorFeePeriodUpdated";
99
+ args: {
100
+ value: bigint;
101
+ };
102
+ } | {
103
+ eventName: "ExecuteOperatorFeePeriodUpdated";
104
+ args: {
105
+ value: bigint;
106
+ };
107
+ } | {
108
+ eventName: "FeeRecipientAddressUpdated";
109
+ args: {
110
+ owner: `0x${string}`;
111
+ recipientAddress: `0x${string}`;
112
+ };
113
+ } | {
114
+ eventName: "LiquidationThresholdPeriodUpdated";
115
+ args: {
116
+ value: bigint;
117
+ };
118
+ } | {
119
+ eventName: "MinimumLiquidationCollateralUpdated";
120
+ args: {
121
+ value: bigint;
122
+ };
123
+ } | {
124
+ eventName: "ModuleUpgraded";
125
+ args: {
126
+ moduleId: number;
127
+ moduleAddress: `0x${string}`;
128
+ };
129
+ } | {
130
+ eventName: "NetworkEarningsWithdrawn";
131
+ args: {
132
+ value: bigint;
133
+ recipient: `0x${string}`;
134
+ };
135
+ } | {
136
+ eventName: "NetworkFeeUpdated";
137
+ args: {
138
+ oldFee: bigint;
139
+ newFee: bigint;
140
+ };
141
+ } | {
142
+ eventName: "OperatorAdded";
143
+ args: {
144
+ operatorId: bigint;
145
+ owner: `0x${string}`;
146
+ publicKey: `0x${string}`;
147
+ fee: bigint;
148
+ };
149
+ } | {
150
+ eventName: "OperatorFeeDeclarationCancelled";
151
+ args: {
152
+ owner: `0x${string}`;
153
+ operatorId: bigint;
154
+ };
155
+ } | {
156
+ eventName: "OperatorFeeDeclared";
157
+ args: {
158
+ owner: `0x${string}`;
159
+ operatorId: bigint;
160
+ blockNumber: bigint;
161
+ fee: bigint;
162
+ };
163
+ } | {
164
+ eventName: "OperatorFeeExecuted";
165
+ args: {
166
+ owner: `0x${string}`;
167
+ operatorId: bigint;
168
+ blockNumber: bigint;
169
+ fee: bigint;
170
+ };
171
+ } | {
172
+ eventName: "OperatorFeeIncreaseLimitUpdated";
173
+ args: {
174
+ value: bigint;
175
+ };
176
+ } | {
177
+ eventName: "OperatorMaximumFeeUpdated";
178
+ args: {
179
+ maxFee: bigint;
180
+ };
181
+ } | {
182
+ eventName: "OperatorMultipleWhitelistRemoved";
183
+ args: {
184
+ operatorIds: readonly bigint[];
185
+ whitelistAddresses: readonly `0x${string}`[];
186
+ };
187
+ } | {
188
+ eventName: "OperatorMultipleWhitelistUpdated";
189
+ args: {
190
+ operatorIds: readonly bigint[];
191
+ whitelistAddresses: readonly `0x${string}`[];
192
+ };
193
+ } | {
194
+ eventName: "OperatorPrivacyStatusUpdated";
195
+ args: {
196
+ operatorIds: readonly bigint[];
197
+ toPrivate: boolean;
198
+ };
199
+ } | {
200
+ eventName: "OperatorRemoved";
201
+ args: {
202
+ operatorId: bigint;
203
+ };
204
+ } | {
205
+ eventName: "OperatorWhitelistUpdated";
206
+ args: {
207
+ operatorId: bigint;
208
+ whitelisted: `0x${string}`;
209
+ };
210
+ } | {
211
+ eventName: "OperatorWhitelistingContractUpdated";
212
+ args: {
213
+ operatorIds: readonly bigint[];
214
+ whitelistingContract: `0x${string}`;
215
+ };
216
+ } | {
217
+ eventName: "OperatorWithdrawn";
218
+ args: {
219
+ owner: `0x${string}`;
220
+ operatorId: bigint;
221
+ value: bigint;
222
+ };
223
+ } | {
224
+ eventName: "ValidatorAdded";
225
+ args: {
226
+ owner: `0x${string}`;
227
+ operatorIds: readonly bigint[];
228
+ publicKey: `0x${string}`;
229
+ shares: `0x${string}`;
230
+ cluster: {
231
+ validatorCount: number;
232
+ networkFeeIndex: bigint;
233
+ index: bigint;
234
+ active: boolean;
235
+ balance: bigint;
236
+ };
237
+ };
238
+ } | {
239
+ eventName: "ValidatorExited";
240
+ args: {
241
+ owner: `0x${string}`;
242
+ operatorIds: readonly bigint[];
243
+ publicKey: `0x${string}`;
244
+ };
245
+ } | {
246
+ eventName: "ValidatorRemoved";
247
+ args: {
248
+ owner: `0x${string}`;
249
+ operatorIds: readonly bigint[];
250
+ publicKey: `0x${string}`;
251
+ cluster: {
252
+ validatorCount: number;
253
+ networkFeeIndex: bigint;
254
+ index: bigint;
255
+ active: boolean;
256
+ balance: bigint;
257
+ };
258
+ };
259
+ } | {
260
+ eventName: "OwnershipTransferred";
261
+ args: {
262
+ previousOwner: `0x${string}`;
263
+ newOwner: `0x${string}`;
264
+ };
265
+ } | {
266
+ eventName: "Approval";
267
+ args: {
268
+ owner: `0x${string}`;
269
+ spender: `0x${string}`;
270
+ value: bigint;
271
+ };
272
+ } | {
273
+ eventName: "Transfer";
274
+ args: {
275
+ from: `0x${string}`;
276
+ to: `0x${string}`;
277
+ value: bigint;
278
+ };
279
+ })[];
280
+ }>;
281
+ }>;
282
+ export {};