@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.
- package/LICENSE +674 -0
- package/README.html +102 -0
- package/README.md +136 -0
- package/README.pdf +0 -0
- package/dist/abi/holesky/v4/getter.d.ts +824 -0
- package/dist/abi/holesky/v4/setter.d.ts +1662 -0
- package/dist/abi/mainnet/v4/getter.d.ts +824 -0
- package/dist/abi/mainnet/v4/setter.d.ts +1677 -0
- package/dist/abi/token.d.ts +292 -0
- package/dist/api/ssv-api/index.d.ts +16 -0
- package/dist/api/subgraph/index.d.ts +101 -0
- package/dist/config/chains.d.ts +94 -0
- package/dist/config/create.d.ts +45 -0
- package/dist/config/globals.d.ts +33 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config-DPI30L0i.js +5159 -0
- package/dist/config-DlwfpwZd.mjs +5161 -0
- package/dist/contract-interactions/create.d.ts +3 -0
- package/dist/contract-interactions/index.d.ts +1 -0
- package/dist/contract-interactions/types.d.ts +93 -0
- package/dist/graphql/graphql.d.ts +3249 -0
- package/dist/libs/api/index.d.ts +81 -0
- package/dist/libs/cluster/index.d.ts +5636 -0
- package/dist/libs/cluster/methods/deposit.d.ts +286 -0
- package/dist/libs/cluster/methods/exit-validators.d.ts +283 -0
- package/dist/libs/cluster/methods/index.d.ts +8 -0
- package/dist/libs/cluster/methods/liquidate-cluster.d.ts +281 -0
- package/dist/libs/cluster/methods/reactivate-cluster.d.ts +282 -0
- package/dist/libs/cluster/methods/register-validators.d.ts +3652 -0
- package/dist/libs/cluster/methods/remove-validators.d.ts +283 -0
- package/dist/libs/cluster/methods/set-fee-recipient.d.ts +282 -0
- package/dist/libs/cluster/methods/withdraw.d.ts +282 -0
- package/dist/libs/operator/index.d.ts +4005 -0
- package/dist/libs/operator/methods.d.ts +844 -0
- package/dist/libs/utils/index.d.ts +32 -0
- package/dist/libs/utils/methods/get-cluster-balance.d.ts +9 -0
- package/dist/libs/utils/methods/index.d.ts +4 -0
- package/dist/libs/utils/methods/keyshares.d.ts +21 -0
- package/dist/libs/utils/methods/keystores.d.ts +13 -0
- package/dist/libs/utils/methods/methods.d.ts +2 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.js +36437 -0
- package/dist/main.mjs +36437 -0
- package/dist/mock/api.d.ts +3 -0
- package/dist/mock/config.d.ts +6 -0
- package/dist/mock/index.d.ts +8 -0
- package/dist/sdk.d.ts +14 -0
- package/dist/types/contract-interactions.d.ts +21 -0
- package/dist/types/methods.d.ts +3 -0
- package/dist/types/operator.d.ts +9 -0
- package/dist/types/utils.d.ts +3 -0
- package/dist/utils/bigint.d.ts +29 -0
- package/dist/utils/cluster.d.ts +8 -0
- package/dist/utils/contract.d.ts +3 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/keyshares.d.ts +21 -0
- package/dist/utils/number.d.ts +21 -0
- package/dist/utils/operator.d.ts +5 -0
- package/dist/utils/try-catch.d.ts +1 -0
- package/dist/utils/url-join.d.ts +1 -0
- package/dist/utils/zod/config.d.ts +9 -0
- package/dist/utils.js +43 -0
- package/dist/utils.mjs +43 -0
- package/package.json +136 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
export declare const TokenABI: readonly [{
|
|
2
|
+
readonly anonymous: false;
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly indexed: true;
|
|
5
|
+
readonly internalType: "address";
|
|
6
|
+
readonly name: "owner";
|
|
7
|
+
readonly type: "address";
|
|
8
|
+
}, {
|
|
9
|
+
readonly indexed: true;
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
readonly name: "spender";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly indexed: false;
|
|
15
|
+
readonly internalType: "uint256";
|
|
16
|
+
readonly name: "value";
|
|
17
|
+
readonly type: "uint256";
|
|
18
|
+
}];
|
|
19
|
+
readonly name: "Approval";
|
|
20
|
+
readonly type: "event";
|
|
21
|
+
}, {
|
|
22
|
+
readonly anonymous: false;
|
|
23
|
+
readonly inputs: readonly [{
|
|
24
|
+
readonly indexed: true;
|
|
25
|
+
readonly internalType: "address";
|
|
26
|
+
readonly name: "previousOwner";
|
|
27
|
+
readonly type: "address";
|
|
28
|
+
}, {
|
|
29
|
+
readonly indexed: true;
|
|
30
|
+
readonly internalType: "address";
|
|
31
|
+
readonly name: "newOwner";
|
|
32
|
+
readonly type: "address";
|
|
33
|
+
}];
|
|
34
|
+
readonly name: "OwnershipTransferred";
|
|
35
|
+
readonly type: "event";
|
|
36
|
+
}, {
|
|
37
|
+
readonly anonymous: false;
|
|
38
|
+
readonly inputs: readonly [{
|
|
39
|
+
readonly indexed: true;
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
readonly name: "from";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
}, {
|
|
44
|
+
readonly indexed: true;
|
|
45
|
+
readonly internalType: "address";
|
|
46
|
+
readonly name: "to";
|
|
47
|
+
readonly type: "address";
|
|
48
|
+
}, {
|
|
49
|
+
readonly indexed: false;
|
|
50
|
+
readonly internalType: "uint256";
|
|
51
|
+
readonly name: "value";
|
|
52
|
+
readonly type: "uint256";
|
|
53
|
+
}];
|
|
54
|
+
readonly name: "Transfer";
|
|
55
|
+
readonly type: "event";
|
|
56
|
+
}, {
|
|
57
|
+
readonly inputs: readonly [{
|
|
58
|
+
readonly internalType: "address";
|
|
59
|
+
readonly name: "owner";
|
|
60
|
+
readonly type: "address";
|
|
61
|
+
}, {
|
|
62
|
+
readonly internalType: "address";
|
|
63
|
+
readonly name: "spender";
|
|
64
|
+
readonly type: "address";
|
|
65
|
+
}];
|
|
66
|
+
readonly name: "allowance";
|
|
67
|
+
readonly outputs: readonly [{
|
|
68
|
+
readonly internalType: "uint256";
|
|
69
|
+
readonly name: "";
|
|
70
|
+
readonly type: "uint256";
|
|
71
|
+
}];
|
|
72
|
+
readonly stateMutability: "view";
|
|
73
|
+
readonly type: "function";
|
|
74
|
+
}, {
|
|
75
|
+
readonly inputs: readonly [{
|
|
76
|
+
readonly internalType: "address";
|
|
77
|
+
readonly name: "spender";
|
|
78
|
+
readonly type: "address";
|
|
79
|
+
}, {
|
|
80
|
+
readonly internalType: "uint256";
|
|
81
|
+
readonly name: "amount";
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
}];
|
|
84
|
+
readonly name: "approve";
|
|
85
|
+
readonly outputs: readonly [{
|
|
86
|
+
readonly internalType: "bool";
|
|
87
|
+
readonly name: "";
|
|
88
|
+
readonly type: "bool";
|
|
89
|
+
}];
|
|
90
|
+
readonly stateMutability: "nonpayable";
|
|
91
|
+
readonly type: "function";
|
|
92
|
+
}, {
|
|
93
|
+
readonly inputs: readonly [{
|
|
94
|
+
readonly internalType: "address";
|
|
95
|
+
readonly name: "account";
|
|
96
|
+
readonly type: "address";
|
|
97
|
+
}];
|
|
98
|
+
readonly name: "balanceOf";
|
|
99
|
+
readonly outputs: readonly [{
|
|
100
|
+
readonly internalType: "uint256";
|
|
101
|
+
readonly name: "";
|
|
102
|
+
readonly type: "uint256";
|
|
103
|
+
}];
|
|
104
|
+
readonly stateMutability: "view";
|
|
105
|
+
readonly type: "function";
|
|
106
|
+
}, {
|
|
107
|
+
readonly inputs: readonly [{
|
|
108
|
+
readonly internalType: "uint256";
|
|
109
|
+
readonly name: "amount";
|
|
110
|
+
readonly type: "uint256";
|
|
111
|
+
}];
|
|
112
|
+
readonly name: "burn";
|
|
113
|
+
readonly outputs: readonly [];
|
|
114
|
+
readonly stateMutability: "nonpayable";
|
|
115
|
+
readonly type: "function";
|
|
116
|
+
}, {
|
|
117
|
+
readonly inputs: readonly [{
|
|
118
|
+
readonly internalType: "address";
|
|
119
|
+
readonly name: "account";
|
|
120
|
+
readonly type: "address";
|
|
121
|
+
}, {
|
|
122
|
+
readonly internalType: "uint256";
|
|
123
|
+
readonly name: "amount";
|
|
124
|
+
readonly type: "uint256";
|
|
125
|
+
}];
|
|
126
|
+
readonly name: "burnFrom";
|
|
127
|
+
readonly outputs: readonly [];
|
|
128
|
+
readonly stateMutability: "nonpayable";
|
|
129
|
+
readonly type: "function";
|
|
130
|
+
}, {
|
|
131
|
+
readonly inputs: readonly [];
|
|
132
|
+
readonly name: "decimals";
|
|
133
|
+
readonly outputs: readonly [{
|
|
134
|
+
readonly internalType: "uint8";
|
|
135
|
+
readonly name: "";
|
|
136
|
+
readonly type: "uint8";
|
|
137
|
+
}];
|
|
138
|
+
readonly stateMutability: "view";
|
|
139
|
+
readonly type: "function";
|
|
140
|
+
}, {
|
|
141
|
+
readonly inputs: readonly [{
|
|
142
|
+
readonly internalType: "address";
|
|
143
|
+
readonly name: "spender";
|
|
144
|
+
readonly type: "address";
|
|
145
|
+
}, {
|
|
146
|
+
readonly internalType: "uint256";
|
|
147
|
+
readonly name: "subtractedValue";
|
|
148
|
+
readonly type: "uint256";
|
|
149
|
+
}];
|
|
150
|
+
readonly name: "decreaseAllowance";
|
|
151
|
+
readonly outputs: readonly [{
|
|
152
|
+
readonly internalType: "bool";
|
|
153
|
+
readonly name: "";
|
|
154
|
+
readonly type: "bool";
|
|
155
|
+
}];
|
|
156
|
+
readonly stateMutability: "nonpayable";
|
|
157
|
+
readonly type: "function";
|
|
158
|
+
}, {
|
|
159
|
+
readonly inputs: readonly [{
|
|
160
|
+
readonly internalType: "address";
|
|
161
|
+
readonly name: "spender";
|
|
162
|
+
readonly type: "address";
|
|
163
|
+
}, {
|
|
164
|
+
readonly internalType: "uint256";
|
|
165
|
+
readonly name: "addedValue";
|
|
166
|
+
readonly type: "uint256";
|
|
167
|
+
}];
|
|
168
|
+
readonly name: "increaseAllowance";
|
|
169
|
+
readonly outputs: readonly [{
|
|
170
|
+
readonly internalType: "bool";
|
|
171
|
+
readonly name: "";
|
|
172
|
+
readonly type: "bool";
|
|
173
|
+
}];
|
|
174
|
+
readonly stateMutability: "nonpayable";
|
|
175
|
+
readonly type: "function";
|
|
176
|
+
}, {
|
|
177
|
+
readonly inputs: readonly [];
|
|
178
|
+
readonly name: "initialize";
|
|
179
|
+
readonly outputs: readonly [];
|
|
180
|
+
readonly stateMutability: "nonpayable";
|
|
181
|
+
readonly type: "function";
|
|
182
|
+
}, {
|
|
183
|
+
readonly inputs: readonly [{
|
|
184
|
+
readonly internalType: "address";
|
|
185
|
+
readonly name: "to";
|
|
186
|
+
readonly type: "address";
|
|
187
|
+
}, {
|
|
188
|
+
readonly internalType: "uint256";
|
|
189
|
+
readonly name: "amount";
|
|
190
|
+
readonly type: "uint256";
|
|
191
|
+
}];
|
|
192
|
+
readonly name: "mint";
|
|
193
|
+
readonly outputs: readonly [];
|
|
194
|
+
readonly stateMutability: "nonpayable";
|
|
195
|
+
readonly type: "function";
|
|
196
|
+
}, {
|
|
197
|
+
readonly inputs: readonly [];
|
|
198
|
+
readonly name: "name";
|
|
199
|
+
readonly outputs: readonly [{
|
|
200
|
+
readonly internalType: "string";
|
|
201
|
+
readonly name: "";
|
|
202
|
+
readonly type: "string";
|
|
203
|
+
}];
|
|
204
|
+
readonly stateMutability: "view";
|
|
205
|
+
readonly type: "function";
|
|
206
|
+
}, {
|
|
207
|
+
readonly inputs: readonly [];
|
|
208
|
+
readonly name: "owner";
|
|
209
|
+
readonly outputs: readonly [{
|
|
210
|
+
readonly internalType: "address";
|
|
211
|
+
readonly name: "";
|
|
212
|
+
readonly type: "address";
|
|
213
|
+
}];
|
|
214
|
+
readonly stateMutability: "view";
|
|
215
|
+
readonly type: "function";
|
|
216
|
+
}, {
|
|
217
|
+
readonly inputs: readonly [];
|
|
218
|
+
readonly name: "renounceOwnership";
|
|
219
|
+
readonly outputs: readonly [];
|
|
220
|
+
readonly stateMutability: "nonpayable";
|
|
221
|
+
readonly type: "function";
|
|
222
|
+
}, {
|
|
223
|
+
readonly inputs: readonly [];
|
|
224
|
+
readonly name: "symbol";
|
|
225
|
+
readonly outputs: readonly [{
|
|
226
|
+
readonly internalType: "string";
|
|
227
|
+
readonly name: "";
|
|
228
|
+
readonly type: "string";
|
|
229
|
+
}];
|
|
230
|
+
readonly stateMutability: "view";
|
|
231
|
+
readonly type: "function";
|
|
232
|
+
}, {
|
|
233
|
+
readonly inputs: readonly [];
|
|
234
|
+
readonly name: "totalSupply";
|
|
235
|
+
readonly outputs: readonly [{
|
|
236
|
+
readonly internalType: "uint256";
|
|
237
|
+
readonly name: "";
|
|
238
|
+
readonly type: "uint256";
|
|
239
|
+
}];
|
|
240
|
+
readonly stateMutability: "view";
|
|
241
|
+
readonly type: "function";
|
|
242
|
+
}, {
|
|
243
|
+
readonly inputs: readonly [{
|
|
244
|
+
readonly internalType: "address";
|
|
245
|
+
readonly name: "recipient";
|
|
246
|
+
readonly type: "address";
|
|
247
|
+
}, {
|
|
248
|
+
readonly internalType: "uint256";
|
|
249
|
+
readonly name: "amount";
|
|
250
|
+
readonly type: "uint256";
|
|
251
|
+
}];
|
|
252
|
+
readonly name: "transfer";
|
|
253
|
+
readonly outputs: readonly [{
|
|
254
|
+
readonly internalType: "bool";
|
|
255
|
+
readonly name: "";
|
|
256
|
+
readonly type: "bool";
|
|
257
|
+
}];
|
|
258
|
+
readonly stateMutability: "nonpayable";
|
|
259
|
+
readonly type: "function";
|
|
260
|
+
}, {
|
|
261
|
+
readonly inputs: readonly [{
|
|
262
|
+
readonly internalType: "address";
|
|
263
|
+
readonly name: "sender";
|
|
264
|
+
readonly type: "address";
|
|
265
|
+
}, {
|
|
266
|
+
readonly internalType: "address";
|
|
267
|
+
readonly name: "recipient";
|
|
268
|
+
readonly type: "address";
|
|
269
|
+
}, {
|
|
270
|
+
readonly internalType: "uint256";
|
|
271
|
+
readonly name: "amount";
|
|
272
|
+
readonly type: "uint256";
|
|
273
|
+
}];
|
|
274
|
+
readonly name: "transferFrom";
|
|
275
|
+
readonly outputs: readonly [{
|
|
276
|
+
readonly internalType: "bool";
|
|
277
|
+
readonly name: "";
|
|
278
|
+
readonly type: "bool";
|
|
279
|
+
}];
|
|
280
|
+
readonly stateMutability: "nonpayable";
|
|
281
|
+
readonly type: "function";
|
|
282
|
+
}, {
|
|
283
|
+
readonly inputs: readonly [{
|
|
284
|
+
readonly internalType: "address";
|
|
285
|
+
readonly name: "newOwner";
|
|
286
|
+
readonly type: "address";
|
|
287
|
+
}];
|
|
288
|
+
readonly name: "transferOwnership";
|
|
289
|
+
readonly outputs: readonly [];
|
|
290
|
+
readonly stateMutability: "nonpayable";
|
|
291
|
+
readonly type: "function";
|
|
292
|
+
}];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const checkOperatorDKGEnabled: (baseApi: string, dkgAddresses: {
|
|
2
|
+
id: string;
|
|
3
|
+
address: string;
|
|
4
|
+
}[]) => Promise<{
|
|
5
|
+
id: string;
|
|
6
|
+
isHealthy: boolean;
|
|
7
|
+
}[]>;
|
|
8
|
+
export declare const getSSVAPI: (endpoint: string) => {
|
|
9
|
+
checkOperatorDKGEnabled: (dkgAddresses: {
|
|
10
|
+
id: string;
|
|
11
|
+
address: string;
|
|
12
|
+
}[]) => Promise<{
|
|
13
|
+
id: string;
|
|
14
|
+
isHealthy: boolean;
|
|
15
|
+
}[]>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { RemoveConfigArg } from '../../types/methods';
|
|
2
|
+
import { GraphQLClient } from 'graphql-request';
|
|
3
|
+
import { GetClusterBalanceQueryVariables, GetClusterQueryVariables, GetClusterSnapshotQueryVariables, GetClustersQueryVariables, GetOperatorQueryVariables, GetOperatorsQueryVariables, GetOwnerNonceByBlockQueryVariables, GetValidatorQueryVariables, GetValidatorsQueryVariables } from '../../graphql/graphql';
|
|
4
|
+
export declare const getOwnerNonce: (client: GraphQLClient, args: GetOwnerNonceByBlockQueryVariables) => Promise<string | undefined>;
|
|
5
|
+
export declare const getClusterSnapshot: (client: GraphQLClient, args: GetClusterSnapshotQueryVariables) => Promise<{
|
|
6
|
+
active: boolean;
|
|
7
|
+
validatorCount: string;
|
|
8
|
+
balance: string;
|
|
9
|
+
index: string;
|
|
10
|
+
networkFeeIndex: string;
|
|
11
|
+
} | null | undefined>;
|
|
12
|
+
export declare const getCluster: (client: GraphQLClient, args: GetClusterQueryVariables) => Promise<{
|
|
13
|
+
active: boolean;
|
|
14
|
+
validatorCount: string;
|
|
15
|
+
balance: string;
|
|
16
|
+
index: string;
|
|
17
|
+
networkFeeIndex: string;
|
|
18
|
+
operatorIds: string[];
|
|
19
|
+
} | null | undefined>;
|
|
20
|
+
export declare const getClusters: (client: GraphQLClient, args: GetClustersQueryVariables) => Promise<{
|
|
21
|
+
id: string;
|
|
22
|
+
active: boolean;
|
|
23
|
+
validatorCount: string;
|
|
24
|
+
balance: string;
|
|
25
|
+
index: string;
|
|
26
|
+
networkFeeIndex: string;
|
|
27
|
+
operatorIds: string[];
|
|
28
|
+
}[]>;
|
|
29
|
+
export declare const getOperator: (client: GraphQLClient, args: GetOperatorQueryVariables) => Promise<{
|
|
30
|
+
publicKey: string;
|
|
31
|
+
whitelisted: `0x${string}`[];
|
|
32
|
+
id: string;
|
|
33
|
+
validatorCount: string;
|
|
34
|
+
isPrivate: boolean;
|
|
35
|
+
whitelistedContract: `0x${string}`;
|
|
36
|
+
} | null>;
|
|
37
|
+
export declare const getOperators: (client: GraphQLClient, args: GetOperatorsQueryVariables) => Promise<{
|
|
38
|
+
publicKey: string;
|
|
39
|
+
whitelisted: `0x${string}`[];
|
|
40
|
+
id: string;
|
|
41
|
+
validatorCount: string;
|
|
42
|
+
isPrivate: boolean;
|
|
43
|
+
whitelistedContract: `0x${string}`;
|
|
44
|
+
}[]>;
|
|
45
|
+
export declare const getValidators: (client: GraphQLClient, args: GetValidatorsQueryVariables) => Promise<{
|
|
46
|
+
id: `0x${string}`;
|
|
47
|
+
}[]>;
|
|
48
|
+
export declare const getValidator: (client: GraphQLClient, args: GetValidatorQueryVariables) => Promise<{
|
|
49
|
+
id: `0x${string}`;
|
|
50
|
+
} | null | undefined>;
|
|
51
|
+
export declare const getClusterBalance: (client: GraphQLClient, args: GetClusterBalanceQueryVariables) => Promise<import('../../graphql/graphql').GetClusterBalanceQuery>;
|
|
52
|
+
export declare const getQueries: (client: GraphQLClient) => {
|
|
53
|
+
getOwnerNonce: RemoveConfigArg<(client: GraphQLClient, args: GetOwnerNonceByBlockQueryVariables) => Promise<string | undefined>>;
|
|
54
|
+
getClusterSnapshot: RemoveConfigArg<(client: GraphQLClient, args: GetClusterSnapshotQueryVariables) => Promise<{
|
|
55
|
+
active: boolean;
|
|
56
|
+
validatorCount: string;
|
|
57
|
+
balance: string;
|
|
58
|
+
index: string;
|
|
59
|
+
networkFeeIndex: string;
|
|
60
|
+
} | null | undefined>>;
|
|
61
|
+
getCluster: RemoveConfigArg<(client: GraphQLClient, args: GetClusterQueryVariables) => Promise<{
|
|
62
|
+
active: boolean;
|
|
63
|
+
validatorCount: string;
|
|
64
|
+
balance: string;
|
|
65
|
+
index: string;
|
|
66
|
+
networkFeeIndex: string;
|
|
67
|
+
operatorIds: string[];
|
|
68
|
+
} | null | undefined>>;
|
|
69
|
+
getClusters: RemoveConfigArg<(client: GraphQLClient, args: GetClustersQueryVariables) => Promise<{
|
|
70
|
+
id: string;
|
|
71
|
+
active: boolean;
|
|
72
|
+
validatorCount: string;
|
|
73
|
+
balance: string;
|
|
74
|
+
index: string;
|
|
75
|
+
networkFeeIndex: string;
|
|
76
|
+
operatorIds: string[];
|
|
77
|
+
}[]>>;
|
|
78
|
+
getOperator: RemoveConfigArg<(client: GraphQLClient, args: GetOperatorQueryVariables) => Promise<{
|
|
79
|
+
publicKey: string;
|
|
80
|
+
whitelisted: `0x${string}`[];
|
|
81
|
+
id: string;
|
|
82
|
+
validatorCount: string;
|
|
83
|
+
isPrivate: boolean;
|
|
84
|
+
whitelistedContract: `0x${string}`;
|
|
85
|
+
} | null>>;
|
|
86
|
+
getOperators: RemoveConfigArg<(client: GraphQLClient, args: GetOperatorsQueryVariables) => Promise<{
|
|
87
|
+
publicKey: string;
|
|
88
|
+
whitelisted: `0x${string}`[];
|
|
89
|
+
id: string;
|
|
90
|
+
validatorCount: string;
|
|
91
|
+
isPrivate: boolean;
|
|
92
|
+
whitelistedContract: `0x${string}`;
|
|
93
|
+
}[]>>;
|
|
94
|
+
getValidators: RemoveConfigArg<(client: GraphQLClient, args: GetValidatorsQueryVariables) => Promise<{
|
|
95
|
+
id: `0x${string}`;
|
|
96
|
+
}[]>>;
|
|
97
|
+
getValidator: RemoveConfigArg<(client: GraphQLClient, args: GetValidatorQueryVariables) => Promise<{
|
|
98
|
+
id: `0x${string}`;
|
|
99
|
+
} | null | undefined>>;
|
|
100
|
+
getClusterBalance: RemoveConfigArg<(client: GraphQLClient, args: GetClusterBalanceQueryVariables) => Promise<import('../../graphql/graphql').GetClusterBalanceQuery>>;
|
|
101
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Address } from 'abitype';
|
|
2
|
+
export declare const chains: {
|
|
3
|
+
readonly mainnet: {
|
|
4
|
+
blockExplorers: {
|
|
5
|
+
readonly default: {
|
|
6
|
+
readonly name: "Etherscan";
|
|
7
|
+
readonly url: "https://etherscan.io";
|
|
8
|
+
readonly apiUrl: "https://api.etherscan.io/api";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
contracts: {
|
|
12
|
+
readonly ensRegistry: {
|
|
13
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
14
|
+
};
|
|
15
|
+
readonly ensUniversalResolver: {
|
|
16
|
+
readonly address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
|
|
17
|
+
readonly blockCreated: 19258213;
|
|
18
|
+
};
|
|
19
|
+
readonly multicall3: {
|
|
20
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
21
|
+
readonly blockCreated: 14353601;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
id: 1;
|
|
25
|
+
name: "Ethereum";
|
|
26
|
+
nativeCurrency: {
|
|
27
|
+
readonly name: "Ether";
|
|
28
|
+
readonly symbol: "ETH";
|
|
29
|
+
readonly decimals: 18;
|
|
30
|
+
};
|
|
31
|
+
rpcUrls: {
|
|
32
|
+
readonly default: {
|
|
33
|
+
readonly http: readonly ["https://cloudflare-eth.com"];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
sourceId?: number | undefined;
|
|
37
|
+
testnet?: boolean | undefined;
|
|
38
|
+
custom?: Record<string, unknown> | undefined;
|
|
39
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
40
|
+
formatters?: undefined;
|
|
41
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable<bigint, number>> | undefined;
|
|
42
|
+
};
|
|
43
|
+
readonly holesky: {
|
|
44
|
+
blockExplorers: {
|
|
45
|
+
readonly default: {
|
|
46
|
+
readonly name: "Etherscan";
|
|
47
|
+
readonly url: "https://holesky.etherscan.io";
|
|
48
|
+
readonly apiUrl: "https://api-holesky.etherscan.io/api";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
contracts: {
|
|
52
|
+
readonly multicall3: {
|
|
53
|
+
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
54
|
+
readonly blockCreated: 77;
|
|
55
|
+
};
|
|
56
|
+
readonly ensRegistry: {
|
|
57
|
+
readonly address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";
|
|
58
|
+
readonly blockCreated: 801613;
|
|
59
|
+
};
|
|
60
|
+
readonly ensUniversalResolver: {
|
|
61
|
+
readonly address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b";
|
|
62
|
+
readonly blockCreated: 973484;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
id: 17000;
|
|
66
|
+
name: "Holesky";
|
|
67
|
+
nativeCurrency: {
|
|
68
|
+
readonly name: "Holesky Ether";
|
|
69
|
+
readonly symbol: "ETH";
|
|
70
|
+
readonly decimals: 18;
|
|
71
|
+
};
|
|
72
|
+
rpcUrls: {
|
|
73
|
+
readonly default: {
|
|
74
|
+
readonly http: readonly ["https://ethereum-holesky-rpc.publicnode.com"];
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
sourceId?: number | undefined;
|
|
78
|
+
testnet: true;
|
|
79
|
+
custom?: Record<string, unknown> | undefined;
|
|
80
|
+
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
81
|
+
formatters?: undefined;
|
|
82
|
+
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable<bigint, number>> | undefined;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export declare const chainIds: (1 | 17000)[];
|
|
86
|
+
export type SupportedChainsIDs = (typeof chainIds)[number];
|
|
87
|
+
export declare const graph_endpoints: Record<SupportedChainsIDs, string>;
|
|
88
|
+
export declare const rest_endpoints: Record<SupportedChainsIDs, string>;
|
|
89
|
+
export type ContractAddresses = {
|
|
90
|
+
setter: Address;
|
|
91
|
+
getter: Address;
|
|
92
|
+
token: Address;
|
|
93
|
+
};
|
|
94
|
+
export declare const contracts: Record<SupportedChainsIDs, ContractAddresses>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ContractInteractions, ReaderFunctions, WriterFunctions } from '../contract-interactions/types';
|
|
2
|
+
import { createQueries, createSSVAPI } from '../libs/api';
|
|
3
|
+
import { ConfigArgs } from '../utils/zod/config';
|
|
4
|
+
import { GraphQLClient } from 'graphql-request';
|
|
5
|
+
import { Address, Chain, PublicClient, WalletClient } from 'viem';
|
|
6
|
+
import { ContractAddresses } from './chains';
|
|
7
|
+
export type ConfigReturnType = {
|
|
8
|
+
publicClient: PublicClient;
|
|
9
|
+
walletClient: WalletClient;
|
|
10
|
+
chain: Chain;
|
|
11
|
+
api: ReturnType<typeof createQueries> & ReturnType<typeof createSSVAPI>;
|
|
12
|
+
graphQLClient: GraphQLClient;
|
|
13
|
+
contractAddresses: {
|
|
14
|
+
setter: Address;
|
|
15
|
+
getter: Address;
|
|
16
|
+
token: Address;
|
|
17
|
+
};
|
|
18
|
+
contract: {
|
|
19
|
+
ssv: {
|
|
20
|
+
write: WriterFunctions<'setter'>;
|
|
21
|
+
read: ReaderFunctions<'getter'>;
|
|
22
|
+
};
|
|
23
|
+
token: ContractInteractions<'token'>;
|
|
24
|
+
};
|
|
25
|
+
graphEndpoint: string;
|
|
26
|
+
restEndpoint: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const isConfig: (props: unknown) => props is ConfigReturnType;
|
|
29
|
+
type CreateContractInteractionsArgs = {
|
|
30
|
+
walletClient: WalletClient;
|
|
31
|
+
publicClient: PublicClient;
|
|
32
|
+
addresses: ContractAddresses;
|
|
33
|
+
};
|
|
34
|
+
export declare const createContractInteractions: ({ walletClient, publicClient, addresses, }: CreateContractInteractionsArgs) => {
|
|
35
|
+
ssv: {
|
|
36
|
+
write: WriterFunctions<"setter">;
|
|
37
|
+
read: ReaderFunctions<"getter">;
|
|
38
|
+
};
|
|
39
|
+
token: {
|
|
40
|
+
read: ReaderFunctions<"token">;
|
|
41
|
+
write: WriterFunctions<"token">;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export declare const createConfig: (props: ConfigArgs) => ConfigReturnType;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const globals: {
|
|
2
|
+
MAX_WEI_AMOUNT: bigint;
|
|
3
|
+
CLUSTER_SIZES: {
|
|
4
|
+
readonly QUAD_CLUSTER: 4;
|
|
5
|
+
readonly SEPT_CLUSTER: 7;
|
|
6
|
+
readonly DECA_CLUSTER: 10;
|
|
7
|
+
readonly TRISKAIDEKA_CLUSTER: 13;
|
|
8
|
+
};
|
|
9
|
+
FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE: {
|
|
10
|
+
QUAD_CLUSTER: number;
|
|
11
|
+
SEPT_CLUSTER: number;
|
|
12
|
+
DECA_CLUSTER: number;
|
|
13
|
+
TRISKAIDEKA_CLUSTER: number;
|
|
14
|
+
};
|
|
15
|
+
BLOCKS_PER_DAY: bigint;
|
|
16
|
+
OPERATORS_PER_PAGE: number;
|
|
17
|
+
BLOCKS_PER_YEAR: bigint;
|
|
18
|
+
DEFAULT_CLUSTER_PERIOD: number;
|
|
19
|
+
NUMBERS_OF_WEEKS_IN_YEAR: number;
|
|
20
|
+
MAX_VALIDATORS_COUNT_MULTI_FLOW: number;
|
|
21
|
+
CLUSTER_VALIDITY_PERIOD_MINIMUM: number;
|
|
22
|
+
OPERATOR_VALIDATORS_LIMIT_PRESERVE: number;
|
|
23
|
+
MINIMUM_OPERATOR_FEE_PER_BLOCK: bigint;
|
|
24
|
+
MIN_VALIDATORS_COUNT_PER_BULK_REGISTRATION: number;
|
|
25
|
+
DEFAULT_ADDRESS_WHITELIST: string;
|
|
26
|
+
};
|
|
27
|
+
export type ClusterSize = (typeof globals.CLUSTER_SIZES)[keyof typeof globals.CLUSTER_SIZES];
|
|
28
|
+
export declare const registerValidatorsByClusterSizeLimits: {
|
|
29
|
+
4: number;
|
|
30
|
+
7: number;
|
|
31
|
+
10: number;
|
|
32
|
+
13: number;
|
|
33
|
+
};
|