@obolnetwork/obol-sdk 2.11.4 → 2.11.5-rc.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 (144) hide show
  1. package/README.md +33 -0
  2. package/dist/browser/src/index.js +18280 -0
  3. package/dist/browser/src/index.js.map +1 -0
  4. package/dist/cjs/src/index.js +17470 -382
  5. package/dist/cjs/src/index.js.map +1 -0
  6. package/dist/esm/src/index.js +17437 -361
  7. package/dist/esm/src/index.js.map +1 -0
  8. package/dist/types/src/constants.d.ts +1 -2
  9. package/dist/types/src/eoa/eoaHelpers.d.ts +1 -1
  10. package/dist/types/src/exits/verificationHelpers.d.ts +0 -2
  11. package/dist/types/src/incentives/incentiveHelpers.d.ts +1 -1
  12. package/dist/types/src/splits/splitHelpers.d.ts +3 -3
  13. package/dist/types/src/utils.d.ts +2 -2
  14. package/dist/types/src/verification/common.d.ts +0 -2
  15. package/dist/types/src/verification/signature-validator.d.ts +4 -4
  16. package/dist/types/src/verification/v1.10.0.d.ts +1 -1
  17. package/dist/types/src/verification/v1.6.0.d.ts +1 -1
  18. package/dist/types/src/verification/v1.7.0.d.ts +1 -1
  19. package/dist/types/src/verification/v1.8.0.d.ts +1 -1
  20. package/dist/types/test/client/methods.spec.d.ts +17 -0
  21. package/dist/types/tsconfig.types.tsbuildinfo +1 -0
  22. package/dist/types/tsup.config.d.ts +2 -0
  23. package/package.json +96 -58
  24. package/dist/cjs/package.json +0 -139
  25. package/dist/cjs/src/abi/BatchDeposit.js +0 -120
  26. package/dist/cjs/src/abi/MerkleDistributorWithDeadline.js +0 -73
  27. package/dist/cjs/src/abi/Multicall3.js +0 -253
  28. package/dist/cjs/src/abi/OVM.js +0 -627
  29. package/dist/cjs/src/abi/OWR.js +0 -304
  30. package/dist/cjs/src/abi/SplitMain.js +0 -929
  31. package/dist/cjs/src/abi/splitV2FactoryAbi.js +0 -420
  32. package/dist/cjs/src/ajv.js +0 -136
  33. package/dist/cjs/src/base.js +0 -42
  34. package/dist/cjs/src/bytecodes.js +0 -19
  35. package/dist/cjs/src/constants.js +0 -272
  36. package/dist/cjs/src/eoa/eoa.js +0 -132
  37. package/dist/cjs/src/eoa/eoaHelpers.js +0 -82
  38. package/dist/cjs/src/errors.js +0 -11
  39. package/dist/cjs/src/exits/ethUtils.js +0 -57
  40. package/dist/cjs/src/exits/exit.js +0 -502
  41. package/dist/cjs/src/exits/verificationHelpers.js +0 -86
  42. package/dist/cjs/src/incentives/incentiveHelpers.js +0 -39
  43. package/dist/cjs/src/incentives/incentives.js +0 -119
  44. package/dist/cjs/src/schema.js +0 -352
  45. package/dist/cjs/src/services.js +0 -33
  46. package/dist/cjs/src/splits/splitHelpers.js +0 -571
  47. package/dist/cjs/src/splits/splits.js +0 -366
  48. package/dist/cjs/src/types.js +0 -29
  49. package/dist/cjs/src/utils.js +0 -77
  50. package/dist/cjs/src/verification/common.js +0 -355
  51. package/dist/cjs/src/verification/signature-validator.js +0 -73
  52. package/dist/cjs/src/verification/sszTypes.js +0 -69
  53. package/dist/cjs/src/verification/termsAndConditions.js +0 -40
  54. package/dist/cjs/src/verification/v1.10.0.js +0 -146
  55. package/dist/cjs/src/verification/v1.6.0.js +0 -149
  56. package/dist/cjs/src/verification/v1.7.0.js +0 -173
  57. package/dist/cjs/src/verification/v1.8.0.js +0 -196
  58. package/dist/cjs/test/client/ajv.spec.js +0 -320
  59. package/dist/cjs/test/client/methods.spec.js +0 -418
  60. package/dist/cjs/test/eoa/eoa.spec.js +0 -176
  61. package/dist/cjs/test/exit/ethUtils.spec.js +0 -83
  62. package/dist/cjs/test/exit/exit.spec.js +0 -399
  63. package/dist/cjs/test/exit/verificationHelpers.spec.js +0 -68
  64. package/dist/cjs/test/fixtures.js +0 -896
  65. package/dist/cjs/test/incentives/incentives.spec.js +0 -202
  66. package/dist/cjs/test/splits/splits.spec.js +0 -402
  67. package/dist/esm/package.json +0 -139
  68. package/dist/esm/src/abi/BatchDeposit.js +0 -117
  69. package/dist/esm/src/abi/MerkleDistributorWithDeadline.js +0 -70
  70. package/dist/esm/src/abi/Multicall3.js +0 -250
  71. package/dist/esm/src/abi/OVM.js +0 -624
  72. package/dist/esm/src/abi/OWR.js +0 -301
  73. package/dist/esm/src/abi/SplitMain.js +0 -926
  74. package/dist/esm/src/abi/splitV2FactoryAbi.js +0 -417
  75. package/dist/esm/src/ajv.js +0 -129
  76. package/dist/esm/src/base.js +0 -38
  77. package/dist/esm/src/bytecodes.js +0 -16
  78. package/dist/esm/src/constants.js +0 -238
  79. package/dist/esm/src/eoa/eoa.js +0 -128
  80. package/dist/esm/src/eoa/eoaHelpers.js +0 -77
  81. package/dist/esm/src/errors.js +0 -7
  82. package/dist/esm/src/exits/ethUtils.js +0 -52
  83. package/dist/esm/src/exits/exit.js +0 -475
  84. package/dist/esm/src/exits/verificationHelpers.js +0 -81
  85. package/dist/esm/src/incentives/incentiveHelpers.js +0 -34
  86. package/dist/esm/src/incentives/incentives.js +0 -115
  87. package/dist/esm/src/schema.js +0 -349
  88. package/dist/esm/src/services.js +0 -29
  89. package/dist/esm/src/splits/splitHelpers.js +0 -554
  90. package/dist/esm/src/splits/splits.js +0 -362
  91. package/dist/esm/src/types.js +0 -26
  92. package/dist/esm/src/utils.js +0 -68
  93. package/dist/esm/src/verification/common.js +0 -319
  94. package/dist/esm/src/verification/signature-validator.js +0 -64
  95. package/dist/esm/src/verification/sszTypes.js +0 -64
  96. package/dist/esm/src/verification/termsAndConditions.js +0 -33
  97. package/dist/esm/src/verification/v1.10.0.js +0 -140
  98. package/dist/esm/src/verification/v1.6.0.js +0 -142
  99. package/dist/esm/src/verification/v1.7.0.js +0 -166
  100. package/dist/esm/src/verification/v1.8.0.js +0 -189
  101. package/dist/esm/test/client/ajv.spec.js +0 -318
  102. package/dist/esm/test/client/methods.spec.js +0 -393
  103. package/dist/esm/test/eoa/eoa.spec.js +0 -174
  104. package/dist/esm/test/exit/ethUtils.spec.js +0 -81
  105. package/dist/esm/test/exit/exit.spec.js +0 -374
  106. package/dist/esm/test/exit/verificationHelpers.spec.js +0 -66
  107. package/dist/esm/test/fixtures.js +0 -893
  108. package/dist/esm/test/incentives/incentives.spec.js +0 -177
  109. package/dist/esm/test/splits/splits.spec.js +0 -400
  110. package/dist/types/src/verification/termsAndConditions.d.ts +0 -1
  111. package/src/abi/BatchDeposit.ts +0 -117
  112. package/src/abi/MerkleDistributorWithDeadline.ts +0 -70
  113. package/src/abi/Multicall3.ts +0 -250
  114. package/src/abi/OVM.ts +0 -624
  115. package/src/abi/OWR.ts +0 -302
  116. package/src/abi/SplitMain.ts +0 -927
  117. package/src/abi/splitV2FactoryAbi.ts +0 -417
  118. package/src/ajv.ts +0 -191
  119. package/src/base.ts +0 -54
  120. package/src/bytecodes.ts +0 -32
  121. package/src/constants.ts +0 -309
  122. package/src/eoa/eoa.ts +0 -153
  123. package/src/eoa/eoaHelpers.ts +0 -112
  124. package/src/errors.ts +0 -8
  125. package/src/exits/ethUtils.ts +0 -49
  126. package/src/exits/exit.ts +0 -661
  127. package/src/exits/verificationHelpers.ts +0 -110
  128. package/src/incentives/incentiveHelpers.ts +0 -55
  129. package/src/incentives/incentives.ts +0 -153
  130. package/src/index.ts +0 -614
  131. package/src/schema.ts +0 -376
  132. package/src/services.ts +0 -24
  133. package/src/splits/splitHelpers.ts +0 -1032
  134. package/src/splits/splits.ts +0 -504
  135. package/src/types.ts +0 -687
  136. package/src/utils.ts +0 -88
  137. package/src/verification/common.ts +0 -532
  138. package/src/verification/signature-validator.ts +0 -103
  139. package/src/verification/sszTypes.ts +0 -88
  140. package/src/verification/termsAndConditions.ts +0 -32
  141. package/src/verification/v1.10.0.ts +0 -245
  142. package/src/verification/v1.6.0.ts +0 -256
  143. package/src/verification/v1.7.0.ts +0 -309
  144. package/src/verification/v1.8.0.ts +0 -340
package/src/types.ts DELETED
@@ -1,687 +0,0 @@
1
- import {
2
- type Wallet,
3
- type ethers,
4
- type JsonRpcApiProvider,
5
- type JsonRpcProvider,
6
- type JsonRpcSigner,
7
- type Provider,
8
- } from 'ethers';
9
-
10
- /**
11
- * Permitted ChainID's
12
- */
13
- export enum FORK_MAPPING {
14
- /** Mainnet. */
15
- '0x00000000' = 1,
16
-
17
- /** Goerli/Prater. */
18
- '0x00001020' = 5,
19
-
20
- /** Gnosis Chain. */
21
- '0x00000064' = 100,
22
-
23
- /** Holesky. */
24
- '0x01017000' = 17000,
25
-
26
- /** Sepolia. */
27
- '0x90000069' = 11155111,
28
-
29
- /** Hoodi Chain. */
30
- '0x10000910' = 560048,
31
- }
32
-
33
- export const FORK_NAMES: Record<number, string> = {
34
- [FORK_MAPPING['0x00000000']]: 'mainnet',
35
- [FORK_MAPPING['0x00001020']]: 'goerli',
36
- [FORK_MAPPING['0x00000064']]: 'gnosis',
37
- [FORK_MAPPING['0x01017000']]: 'holesky',
38
- [FORK_MAPPING['0x90000069']]: 'sepolia',
39
- [FORK_MAPPING['0x10000910']]: 'hoodi',
40
- } as const;
41
-
42
- /**
43
- * Node operator data
44
- */
45
- export type ClusterOperator = {
46
- /** The operator address. */
47
- address: string;
48
-
49
- /** The operator ethereum node record. */
50
- enr?: string;
51
-
52
- /** The cluster fork_version. */
53
- fork_version?: string;
54
-
55
- /** The cluster version. */
56
- version?: string;
57
-
58
- /** The operator enr signature. */
59
- enr_signature?: string;
60
-
61
- /** The operator configuration signature. */
62
- config_signature?: string;
63
- };
64
-
65
- /**
66
- * A partial view of `ClusterOperator` with `enr` and `version` as required properties.
67
- */
68
- export type OperatorPayload = Partial<ClusterOperator> &
69
- Required<Pick<ClusterOperator, 'enr' | 'version'>>;
70
-
71
- /**
72
- * Cluster creator data
73
- */
74
- export type ClusterCreator = {
75
- /** The creator address. */
76
- address: string;
77
- /** The cluster configuration signature. */
78
- config_signature?: string;
79
- };
80
-
81
- /**
82
- * Validator withdrawal configuration
83
- */
84
- export type ClusterValidator = {
85
- /** Address to receive MEV rewards (if enabled), block proposal and priority fees. */
86
- fee_recipient_address: string;
87
-
88
- /** Address to receive skimming rewards and validator principal at exit. */
89
- withdrawal_address: string;
90
- };
91
-
92
- /**
93
- * Cluster configuration
94
- */
95
- export type ClusterPayload = {
96
- /** The cluster name. */
97
- name: string;
98
-
99
- /** The cluster nodes operators addresses. */
100
- operators: ClusterOperator[];
101
-
102
- /** The cluster validators information. */
103
- validators: ClusterValidator[];
104
-
105
- /** The cluster partial deposits in gwei or 32000000000. */
106
- deposit_amounts?: string[] | null;
107
-
108
- /** A withdrawal mechanism with 0x02 withdrawal credentials. */
109
- compounding?: boolean;
110
-
111
- /** The target gas limit where default is 36M. */
112
- target_gas_limit?: number;
113
-
114
- /** The consensus protocol e.g qbft. */
115
- consensus_protocol?: string;
116
- };
117
-
118
- /**
119
- * Cluster definition data needed for dkg
120
- */
121
- export interface ClusterDefinition extends ClusterPayload {
122
- /** The creator of the cluster. */
123
- creator: ClusterCreator;
124
-
125
- /** The cluster configuration version. */
126
- version: string;
127
-
128
- /** The cluster dkg algorithm. */
129
- dkg_algorithm: string;
130
-
131
- /** The cluster fork version. */
132
- fork_version: string;
133
-
134
- /** The cluster uuid. */
135
- uuid: string;
136
-
137
- /** The cluster creation timestamp. */
138
- timestamp: string;
139
-
140
- /** The cluster configuration hash. */
141
- config_hash: string;
142
-
143
- /** The distributed validator threshold. */
144
- threshold: number;
145
-
146
- /** The number of distributed validators in the cluster. */
147
- num_validators: number;
148
-
149
- /** The hash of the cluster definition. */
150
- definition_hash?: string;
151
-
152
- /** The consensus protocol e.g qbft. */
153
- consensus_protocol?: string;
154
-
155
- /** The target gas limit where default is 36M. */
156
- target_gas_limit?: number;
157
-
158
- /** A withdrawal mechanism with 0x02 withdrawal credentials. */
159
- compounding?: boolean;
160
- }
161
-
162
- /**
163
- * Split Recipient Keys
164
- */
165
- export type SplitRecipient = {
166
- /** The split recipient address. */
167
- account: string;
168
-
169
- /** The recipient split. */
170
- percentAllocation: number;
171
- };
172
-
173
- /**
174
- * Split Proxy Params
175
- */
176
- export type TotalSplitPayload = {
177
- /** The split recipients addresses and splits. */
178
- splitRecipients: SplitRecipient[];
179
-
180
- /** Split percentageNumber allocated for obol retroactive funding, minimum is 1%. */
181
- ObolRAFSplit?: number;
182
-
183
- /** The percentageNumber of accrued rewards that is paid to the caller of the distribution function to compensate them for the gas costs of doing so. Cannot be greater than 10%. For example, 5 represents 5%. */
184
- distributorFee?: number;
185
-
186
- /** Address that can mutate the split, should be ZeroAddress for immutable split. */
187
- controllerAddress?: string;
188
- };
189
-
190
- /**
191
- * OWR and Split Proxy Params
192
- */
193
- export interface RewardsSplitPayload extends TotalSplitPayload {
194
- /** Address that will reclaim validator principal after exit. */
195
- principalRecipient: string;
196
-
197
- /** Amount needed to deploy all validators expected for the OWR/Splitter configuration. */
198
- etherAmount: number;
199
-
200
- /** Address that can control where the owr erc-20 tokens can be pushed, if set to zero it goes to splitter or principal address. */
201
- recoveryAddress?: string;
202
- }
203
-
204
- /**
205
- * OVM and SplitV2 Base Params
206
- */
207
- export type OVMBaseSplitPayload = {
208
- /** The split recipients addresses and splits. */
209
- rewardSplitRecipients: SplitV2Recipient[];
210
-
211
- /** Owner address for the OVM contract. */
212
- OVMOwnerAddress: string;
213
-
214
- /** Owner address for the splitter contracts. */
215
- splitOwnerAddress?: string;
216
-
217
- /** Principal threshold in ETH for OVM contract. */
218
- principalThreshold?: number;
219
-
220
- /** Distributor fee percentage (0-10). */
221
- distributorFeePercent?: number;
222
- };
223
-
224
- /**
225
- * OVM and SplitV2 Params for rewards-only split
226
- */
227
- export type OVMRewardsSplitPayload = OVMBaseSplitPayload & {
228
- /** Principal recipient address (single address for rewards-only split). */
229
- principalRecipient: string;
230
- };
231
-
232
- /**
233
- * OVM and SplitV2 Params for total split scenario
234
- */
235
- export type OVMTotalSplitPayload = OVMBaseSplitPayload & {
236
- /** Principal recipients addresses and splits (array for total split scenario). */
237
- principalSplitRecipients: SplitV2Recipient[];
238
- };
239
-
240
- /**
241
- * Union type for both OVM split scenarios
242
- */
243
- export type OVMSplitPayload = OVMRewardsSplitPayload | OVMTotalSplitPayload;
244
-
245
- /**
246
- * SplitV2 Recipient structure
247
- */
248
- export type SplitV2Recipient = {
249
- /** Recipient address. */
250
- address: string;
251
-
252
- /** Percentage allocation (0-100 with up to 4 decimals). */
253
- percentAllocation: number;
254
- };
255
-
256
- /**
257
- * OWR Tranches
258
- */
259
- export type OWRTranches = {
260
- /** Address that will reclaim validator principal after exit. */
261
- principalRecipient: ETH_ADDRESS;
262
-
263
- /** Address that will reclaim validator rewards during operation. */
264
- rewardRecipient: ETH_ADDRESS;
265
-
266
- /** Amount of principal staked. */
267
- amountOfPrincipalStake: number;
268
- };
269
-
270
- /**
271
- * Unsigned DV Builder Registration Message
272
- */
273
- export type BuilderRegistrationMessage = {
274
- /** The DV fee recipient. */
275
- fee_recipient: string;
276
-
277
- /** Default is 30000000. */
278
- gas_limit: number;
279
-
280
- /** Timestamp when generating cluster lock file. */
281
- timestamp: number;
282
-
283
- /** The public key of the DV. */
284
- pubkey: string;
285
- };
286
-
287
- /**
288
- * Pre-generated Signed Validator Builder Registration
289
- */
290
- export type BuilderRegistration = {
291
- /** Builder registration message. */
292
- message: BuilderRegistrationMessage;
293
-
294
- /** BLS signature of the builder registration message. */
295
- signature: string;
296
- };
297
-
298
- /**
299
- * Required deposit data for validator activation
300
- */
301
- export type DepositData = {
302
- /** The public key of the distributed validator. */
303
- pubkey: string;
304
-
305
- /** The 0x01 withdrawal address of the DV. */
306
- withdrawal_credentials: string;
307
-
308
- /** 32 ethers. */
309
- amount: string;
310
-
311
- /** A checksum for DepositData fields . */
312
- deposit_data_root: string;
313
-
314
- /** BLS signature of the deposit message. */
315
- signature: string;
316
- };
317
-
318
- /**
319
- * Required deposit data for validator activation
320
- */
321
- export type DistributedValidator = {
322
- /** The public key of the distributed validator. */
323
- distributed_public_key: string;
324
-
325
- /** The public key of the node distributed validator share. */
326
- public_shares: string[];
327
-
328
- /** The deposit data for activating the DV. */
329
- deposit_data?: Partial<DepositData>;
330
-
331
- /** The deposit data with partial amounts or full amount for activating the DV. */
332
- partial_deposit_data?: Array<Partial<DepositData>>;
333
-
334
- /** pre-generated signed validator builder registration to be sent to builder network. */
335
- builder_registration?: BuilderRegistration;
336
- };
337
-
338
- /**
339
- * Cluster Details after DKG is complete
340
- */
341
- export type ClusterLock = {
342
- /** The cluster definition. */
343
- cluster_definition: ClusterDefinition;
344
-
345
- /** The cluster distributed validators. */
346
- distributed_validators: DistributedValidator[];
347
-
348
- /** The cluster bls signature aggregate. */
349
- signature_aggregate: string;
350
-
351
- /** The hash of the cluster lock. */
352
- lock_hash: string;
353
-
354
- /** Node Signature for the lock hash by the node secp256k1 key. */
355
- node_signatures?: string[];
356
- };
357
-
358
- /**
359
- * Claimable Obol Incentives
360
- */
361
- export type ClaimableIncentives = {
362
- /** Operator Address. */
363
- operator_address: string;
364
-
365
- /** The amount the recipient is entitled to. */
366
- amount: string;
367
-
368
- /** The recipient's index in the Merkle tree. */
369
- index: number;
370
-
371
- /** The Merkle proof (an array of hashes) generated for the recipient. */
372
- merkle_proof: string[];
373
-
374
- /** The MerkleDistributor contract address. */
375
- contract_address: string;
376
- };
377
-
378
- /**
379
- * String expected to be Ethereum Address
380
- */
381
- export type ETH_ADDRESS = string;
382
-
383
- /**
384
- * Provider Types
385
- */
386
- export type ProviderType =
387
- | Provider
388
- | JsonRpcProvider
389
- | JsonRpcApiProvider
390
- | ethers.BrowserProvider;
391
-
392
- /**
393
- * Safe Wallet Provider Types
394
- */
395
- export type SafeRpcUrl = string;
396
-
397
- /**
398
- * Signer Types
399
- */
400
- export type SignerType = JsonRpcSigner | Wallet;
401
-
402
- /**
403
- * claimIncentives Response
404
- */
405
- export type ClaimIncentivesResponse = { txHash: string | null };
406
-
407
- /**
408
- * Represents the structure of an Ethereum operator for exit validation, primarily their ENR.
409
- */
410
- export interface ExitOperator {
411
- /** The operator's Ethereum Node Record (ENR). */
412
- enr: string;
413
- }
414
-
415
- /**
416
- * Represents the core definition of a cluster relevant for exit validation.
417
- */
418
- export interface ExitClusterDefinition {
419
- /** The cluster nodes operators with their ENRs. */
420
- operators: ExitOperator[];
421
-
422
- /** The cluster fork version. */
423
- fork_version: string;
424
-
425
- /** The distributed validator threshold. */
426
- threshold: number;
427
- }
428
-
429
- /**
430
- * Represents a distributed validator's information relevant for exit validation.
431
- */
432
- export interface ExitDistributedValidator {
433
- /** The public key of the distributed validator. */
434
- distributed_public_key: string;
435
-
436
- /** The public key shares of the distributed validator. */
437
- public_shares: string[];
438
- }
439
-
440
- /**
441
- * Combined cluster information needed for exit validation in the SDK.
442
- */
443
- export interface ExitClusterConfig {
444
- /** The cluster definition with operators, fork version and threshold. */
445
- definition: ExitClusterDefinition;
446
-
447
- /** The cluster distributed validators. */
448
- distributed_validators: ExitDistributedValidator[];
449
- }
450
-
451
- /**
452
- * Represents the message part of a signed exit for exit validation.
453
- */
454
- export interface ExitValidationMessage {
455
- /** The epoch at which the validator wishes to exit. */
456
- epoch: string;
457
-
458
- /** The index of the validator in the beacon chain. */
459
- validator_index: string;
460
- }
461
-
462
- /**
463
- * Represents a signed exit message for exit validation.
464
- */
465
- export interface SignedExitValidationMessage {
466
- /** The exit message containing epoch and validator index. */
467
- message: ExitValidationMessage;
468
-
469
- /** BLS signature of the exit message. */
470
- signature: string;
471
- }
472
-
473
- /**
474
- * Represents a single partial exit blob for exit validation.
475
- */
476
- export interface ExitValidationBlob {
477
- /** The public key of the validator to exit. */
478
- public_key: string;
479
-
480
- /** The signed exit message for the validator. */
481
- signed_exit_message: SignedExitValidationMessage;
482
- }
483
-
484
- /**
485
- * Represents the overall exit payload structure for exit validation.
486
- */
487
- export interface ExitValidationPayload {
488
- /** Array of partial exits for validators. */
489
- partial_exits: ExitValidationBlob[];
490
-
491
- /** Operator's share index (1-based). */
492
- share_idx: number;
493
-
494
- /** Signature of the ExitValidationPayload by the operator. */
495
- signature: string;
496
- }
497
-
498
- /**
499
- * Represents the data structure for an already existing exit blob for exit validation.
500
- */
501
- export interface ExistingExitValidationBlobData {
502
- /**
503
- * The BLS public key of the validator in hex format
504
- */
505
- public_key: string;
506
- /**
507
- * The epoch number when the exit is scheduled to occur
508
- */
509
- epoch: string;
510
- /**
511
- * The unique index of the validator in the beacon chain
512
- */
513
- validator_index: string;
514
- /**
515
- * Array of distributed validator shares exit data, where each share contains
516
- * the partial exit signature from each operator in the cluster
517
- */
518
- shares_exit_data: Array<Record<string, { partial_exit_signature: string }>>;
519
- }
520
-
521
- // ExitBlob is an exit message alongside its BLS12-381 hex-encoded signature.
522
- export interface FullExitBlob {
523
- /**
524
- * The signed voluntary exit message containing the exit details and signature
525
- */
526
- signed_exit_message: {
527
- /**
528
- * The voluntary exit message details
529
- */
530
- message: {
531
- /**
532
- * The epoch number when the validator exit will be processed
533
- */
534
- epoch: string;
535
- /**
536
- * The unique index of the validator requesting to exit
537
- */
538
- validator_index: string;
539
- };
540
- /**
541
- * The BLS12-381 hex-encoded signature of the exit message
542
- */
543
- signature: string;
544
- };
545
-
546
- /** The public key of the validator to exit. */
547
- public_key: string;
548
- }
549
-
550
- /**
551
- * Generic HTTP request function type.
552
- * Args:
553
- * url: string - The URL to request.
554
- * config?: Record<string, any> - Optional request configuration (e.g., method, headers, body for POST).
555
- * Returns:
556
- * Promise<any> - The response data.
557
- */
558
- export type HttpRequestFunc = (
559
- url: string,
560
- config?: Record<string, any>,
561
- ) => Promise<any>;
562
-
563
- /**
564
- * OVM Arguments for contract creation
565
- */
566
- export type OVMArgs = {
567
- /** Owner address for the OVM contract. */
568
- OVMOwnerAddress: string;
569
-
570
- /** Principal recipient address. */
571
- principalRecipient: string;
572
-
573
- /** Rewards recipient of the cluster. */
574
- rewardRecipient: string;
575
-
576
- /** Principal threshold in ETH for OVM contract. */
577
- principalThreshold: number;
578
- };
579
-
580
- export type ChainConfig = {
581
- SPLITMAIN_CONTRACT: {
582
- address: string;
583
- bytecode: string;
584
- };
585
- MULTICALL3_CONTRACT: {
586
- address: string;
587
- bytecode: string;
588
- };
589
- OWR_FACTORY_CONTRACT: {
590
- address: string;
591
- bytecode: string;
592
- };
593
- RETROACTIVE_FUNDING_CONTRACT: {
594
- address: string;
595
- bytecode: string;
596
- };
597
- OVM_FACTORY_CONTRACT?: {
598
- address: string;
599
- bytecode: string;
600
- };
601
- WAREHOUSE_CONTRACT?: {
602
- address: string;
603
- bytecode: string;
604
- };
605
- SPLIT_V2_FACTORY_CONTRACT?: {
606
- address: string;
607
- bytecode: string;
608
- };
609
- EOA_WITHDRAWAL_CONTRACT?: {
610
- address: string;
611
- };
612
- BATCH_DEPOSIT_CONTRACT?: {
613
- address: string;
614
- };
615
- };
616
-
617
- /**
618
- * Payload for requesting withdrawal from OVM contract
619
- */
620
- export type OVMRequestWithdrawalPayload = {
621
- /** request withdrawal fees in wei */
622
- withdrawalFees: string;
623
-
624
- /** OVM contract address */
625
- ovmAddress: string;
626
-
627
- /** Array of validator public keys in bytes format */
628
- pubKeys: string[];
629
-
630
- /** Array of withdrawal amounts in gwei (uint64) as strings */
631
- amounts: string[];
632
- };
633
-
634
- /**
635
- * Payload for requesting withdrawal from EOA contract
636
- */
637
- export type EOAWithdrawalPayload = {
638
- /** Validator public key in hex format */
639
- pubkey: string;
640
-
641
- /** Withdrawal amount in ETH */
642
- allocation: number;
643
-
644
- /** Required fee in wei */
645
- requiredFee: string;
646
- };
647
-
648
- /**
649
- * Payload for depositing to OVM contract with multicall3
650
- */
651
- export type OVMDepositPayload = {
652
- /** OVM contract address */
653
- ovmAddress: string;
654
-
655
- /** Array of deposit objects */
656
- deposits: Array<{
657
- /** Validator public key in hex format (48 bytes) */
658
- pubkey: string;
659
- /** Withdrawal credentials in hex format */
660
- withdrawal_credentials: string;
661
- /** Deposit signature in hex format */
662
- signature: string;
663
- /** Deposit data root in hex format (32 bytes) */
664
- deposit_data_root: string;
665
- /** Deposit amount in wei as string */
666
- amount: string;
667
- }>;
668
- };
669
-
670
- /**
671
- * Payload for depositing to batch deposit contract
672
- */
673
- export type EOADepositPayload = {
674
- /** Array of deposit objects */
675
- deposits: Array<{
676
- /** Validator public key in hex format (48 bytes) */
677
- pubkey: string;
678
- /** Withdrawal credentials in hex format */
679
- withdrawal_credentials: string;
680
- /** Deposit signature in hex format */
681
- signature: string;
682
- /** Deposit data root in hex format (32 bytes) */
683
- deposit_data_root: string;
684
- /** Deposit amount in wei as string */
685
- amount: string;
686
- }>;
687
- };