@obolnetwork/obol-sdk 2.7.0 → 2.8.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 (56) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/abi/OVMFactory.js +620 -0
  3. package/dist/cjs/src/abi/splitV2FactoryAbi.js +420 -0
  4. package/dist/cjs/src/ajv.js +33 -6
  5. package/dist/cjs/src/bytecodes.js +10 -1
  6. package/dist/cjs/src/constants.js +71 -15
  7. package/dist/cjs/src/index.js +21 -9
  8. package/dist/cjs/src/schema.js +70 -1
  9. package/dist/cjs/src/splits/splitHelpers.js +188 -14
  10. package/dist/cjs/src/splits/splits.js +283 -0
  11. package/dist/cjs/src/types.js +0 -1
  12. package/dist/cjs/test/client/ajv.spec.js +269 -0
  13. package/dist/cjs/test/client/methods.spec.js +418 -0
  14. package/dist/cjs/test/fixtures.js +13 -1
  15. package/dist/cjs/test/splits/splits.spec.js +239 -0
  16. package/dist/esm/package.json +1 -1
  17. package/dist/esm/src/abi/OVMFactory.js +617 -0
  18. package/dist/esm/src/abi/splitV2FactoryAbi.js +417 -0
  19. package/dist/esm/src/ajv.js +33 -6
  20. package/dist/esm/src/bytecodes.js +9 -0
  21. package/dist/esm/src/constants.js +70 -15
  22. package/dist/esm/src/index.js +20 -9
  23. package/dist/esm/src/schema.js +70 -1
  24. package/dist/esm/src/splits/splitHelpers.js +182 -13
  25. package/dist/esm/src/splits/splits.js +279 -0
  26. package/dist/esm/src/types.js +0 -1
  27. package/dist/esm/test/client/ajv.spec.js +267 -0
  28. package/dist/esm/test/client/methods.spec.js +393 -0
  29. package/dist/esm/test/fixtures.js +12 -0
  30. package/dist/esm/test/splits/splits.spec.js +237 -0
  31. package/dist/types/src/abi/OVMFactory.d.ts +662 -0
  32. package/dist/types/src/abi/splitV2FactoryAbi.d.ts +60 -0
  33. package/dist/types/src/bytecodes.d.ts +9 -0
  34. package/dist/types/src/constants.d.ts +10 -21
  35. package/dist/types/src/exits/verificationHelpers.d.ts +1 -0
  36. package/dist/types/src/index.d.ts +7 -0
  37. package/dist/types/src/schema.d.ts +145 -0
  38. package/dist/types/src/splits/splitHelpers.d.ts +39 -2
  39. package/dist/types/src/splits/splits.d.ts +51 -0
  40. package/dist/types/src/types.d.ts +87 -2
  41. package/dist/types/src/verification/common.d.ts +1 -0
  42. package/dist/types/test/client/ajv.spec.d.ts +1 -0
  43. package/dist/types/test/client/methods.spec.d.ts +1 -0
  44. package/dist/types/test/fixtures.d.ts +10 -0
  45. package/dist/types/test/splits/splits.spec.d.ts +1 -0
  46. package/package.json +1 -1
  47. package/src/abi/OVMFactory.ts +617 -0
  48. package/src/abi/splitV2FactoryAbi.ts +417 -0
  49. package/src/ajv.ts +55 -13
  50. package/src/bytecodes.ts +19 -0
  51. package/src/constants.ts +84 -16
  52. package/src/index.ts +36 -15
  53. package/src/schema.ts +79 -0
  54. package/src/splits/splitHelpers.ts +373 -18
  55. package/src/splits/splits.ts +406 -0
  56. package/src/types.ts +100 -3
@@ -0,0 +1,617 @@
1
+ export const OVMFactoryContract = {
2
+ abi: [
3
+ {
4
+ inputs: [
5
+ {
6
+ internalType: 'address',
7
+ name: '_consolidationSystemContract',
8
+ type: 'address',
9
+ },
10
+ {
11
+ internalType: 'address',
12
+ name: '_withdrawalSystemContract',
13
+ type: 'address',
14
+ },
15
+ {
16
+ internalType: 'address',
17
+ name: '_depositSystemContract',
18
+ type: 'address',
19
+ },
20
+ ],
21
+ stateMutability: 'nonpayable',
22
+ type: 'constructor',
23
+ },
24
+ { inputs: [], name: 'Invalid_Owner', type: 'error' },
25
+ { inputs: [], name: 'Invalid__Recipients', type: 'error' },
26
+ { inputs: [], name: 'Invalid__ThresholdTooLarge', type: 'error' },
27
+ { inputs: [], name: 'Invalid__ZeroThreshold', type: 'error' },
28
+ {
29
+ anonymous: false,
30
+ inputs: [
31
+ {
32
+ indexed: true,
33
+ internalType: 'address',
34
+ name: 'ovm',
35
+ type: 'address',
36
+ },
37
+ {
38
+ indexed: true,
39
+ internalType: 'address',
40
+ name: 'owner',
41
+ type: 'address',
42
+ },
43
+ {
44
+ indexed: false,
45
+ internalType: 'address',
46
+ name: 'principalRecipient',
47
+ type: 'address',
48
+ },
49
+ {
50
+ indexed: false,
51
+ internalType: 'address',
52
+ name: 'rewardRecipient',
53
+ type: 'address',
54
+ },
55
+ {
56
+ indexed: false,
57
+ internalType: 'uint64',
58
+ name: 'principalThreshold',
59
+ type: 'uint64',
60
+ },
61
+ ],
62
+ name: 'CreateObolValidatorManager',
63
+ type: 'event',
64
+ },
65
+ {
66
+ inputs: [],
67
+ name: 'consolidationSystemContract',
68
+ outputs: [{ internalType: 'address', name: '', type: 'address' }],
69
+ stateMutability: 'view',
70
+ type: 'function',
71
+ },
72
+ {
73
+ inputs: [
74
+ { internalType: 'address', name: 'owner', type: 'address' },
75
+ {
76
+ internalType: 'address',
77
+ name: 'principalRecipient',
78
+ type: 'address',
79
+ },
80
+ { internalType: 'address', name: 'rewardRecipient', type: 'address' },
81
+ { internalType: 'uint64', name: 'principalThreshold', type: 'uint64' },
82
+ ],
83
+ name: 'createObolValidatorManager',
84
+ outputs: [
85
+ {
86
+ internalType: 'contract ObolValidatorManager',
87
+ name: 'ovm',
88
+ type: 'address',
89
+ },
90
+ ],
91
+ stateMutability: 'nonpayable',
92
+ type: 'function',
93
+ },
94
+ {
95
+ inputs: [],
96
+ name: 'depositSystemContract',
97
+ outputs: [{ internalType: 'address', name: '', type: 'address' }],
98
+ stateMutability: 'view',
99
+ type: 'function',
100
+ },
101
+ {
102
+ inputs: [],
103
+ name: 'withdrawalSystemContract',
104
+ outputs: [{ internalType: 'address', name: '', type: 'address' }],
105
+ stateMutability: 'view',
106
+ type: 'function',
107
+ },
108
+ ],
109
+ };
110
+ export const OVMContract = {
111
+ abi: [
112
+ {
113
+ type: 'constructor',
114
+ inputs: [
115
+ {
116
+ name: '_consolidationSystemContract',
117
+ type: 'address',
118
+ internalType: 'address',
119
+ },
120
+ {
121
+ name: '_withdrawalSystemContract',
122
+ type: 'address',
123
+ internalType: 'address',
124
+ },
125
+ {
126
+ name: '_depositSystemContract',
127
+ type: 'address',
128
+ internalType: 'address',
129
+ },
130
+ { name: '_owner', type: 'address', internalType: 'address' },
131
+ {
132
+ name: '_principalRecipient',
133
+ type: 'address',
134
+ internalType: 'address',
135
+ },
136
+ { name: '_rewardRecipient', type: 'address', internalType: 'address' },
137
+ { name: '_principalThreshold', type: 'uint64', internalType: 'uint64' },
138
+ ],
139
+ stateMutability: 'nonpayable',
140
+ },
141
+ { type: 'receive', stateMutability: 'payable' },
142
+ {
143
+ type: 'function',
144
+ name: 'CONSOLIDATION_ROLE',
145
+ inputs: [],
146
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
147
+ stateMutability: 'view',
148
+ },
149
+ {
150
+ type: 'function',
151
+ name: 'RECOVER_FUNDS_ROLE',
152
+ inputs: [],
153
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
154
+ stateMutability: 'view',
155
+ },
156
+ {
157
+ type: 'function',
158
+ name: 'SET_PRINCIPAL_ROLE',
159
+ inputs: [],
160
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
161
+ stateMutability: 'view',
162
+ },
163
+ {
164
+ type: 'function',
165
+ name: 'WITHDRAWAL_ROLE',
166
+ inputs: [],
167
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
168
+ stateMutability: 'view',
169
+ },
170
+ {
171
+ type: 'function',
172
+ name: 'amountOfPrincipalStake',
173
+ inputs: [],
174
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
175
+ stateMutability: 'view',
176
+ },
177
+ {
178
+ type: 'function',
179
+ name: 'cancelOwnershipHandover',
180
+ inputs: [],
181
+ outputs: [],
182
+ stateMutability: 'payable',
183
+ },
184
+ {
185
+ type: 'function',
186
+ name: 'completeOwnershipHandover',
187
+ inputs: [
188
+ { name: 'pendingOwner', type: 'address', internalType: 'address' },
189
+ ],
190
+ outputs: [],
191
+ stateMutability: 'payable',
192
+ },
193
+ {
194
+ type: 'function',
195
+ name: 'consolidationSystemContract',
196
+ inputs: [],
197
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
198
+ stateMutability: 'view',
199
+ },
200
+ {
201
+ type: 'function',
202
+ name: 'deposit',
203
+ inputs: [
204
+ { name: 'pubkey', type: 'bytes', internalType: 'bytes' },
205
+ {
206
+ name: 'withdrawal_credentials',
207
+ type: 'bytes',
208
+ internalType: 'bytes',
209
+ },
210
+ { name: 'signature', type: 'bytes', internalType: 'bytes' },
211
+ { name: 'deposit_data_root', type: 'bytes32', internalType: 'bytes32' },
212
+ ],
213
+ outputs: [],
214
+ stateMutability: 'payable',
215
+ },
216
+ {
217
+ type: 'function',
218
+ name: 'depositSystemContract',
219
+ inputs: [],
220
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
221
+ stateMutability: 'view',
222
+ },
223
+ {
224
+ type: 'function',
225
+ name: 'distributeFunds',
226
+ inputs: [],
227
+ outputs: [],
228
+ stateMutability: 'nonpayable',
229
+ },
230
+ {
231
+ type: 'function',
232
+ name: 'distributeFundsPull',
233
+ inputs: [],
234
+ outputs: [],
235
+ stateMutability: 'nonpayable',
236
+ },
237
+ {
238
+ type: 'function',
239
+ name: 'fundsPendingWithdrawal',
240
+ inputs: [],
241
+ outputs: [{ name: '', type: 'uint128', internalType: 'uint128' }],
242
+ stateMutability: 'view',
243
+ },
244
+ {
245
+ type: 'function',
246
+ name: 'getPullBalance',
247
+ inputs: [{ name: 'account', type: 'address', internalType: 'address' }],
248
+ outputs: [{ name: '', type: 'uint256', internalType: 'uint256' }],
249
+ stateMutability: 'view',
250
+ },
251
+ {
252
+ type: 'function',
253
+ name: 'grantRoles',
254
+ inputs: [
255
+ { name: 'user', type: 'address', internalType: 'address' },
256
+ { name: 'roles', type: 'uint256', internalType: 'uint256' },
257
+ ],
258
+ outputs: [],
259
+ stateMutability: 'payable',
260
+ },
261
+ {
262
+ type: 'function',
263
+ name: 'hasAllRoles',
264
+ inputs: [
265
+ { name: 'user', type: 'address', internalType: 'address' },
266
+ { name: 'roles', type: 'uint256', internalType: 'uint256' },
267
+ ],
268
+ outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
269
+ stateMutability: 'view',
270
+ },
271
+ {
272
+ type: 'function',
273
+ name: 'hasAnyRole',
274
+ inputs: [
275
+ { name: 'user', type: 'address', internalType: 'address' },
276
+ { name: 'roles', type: 'uint256', internalType: 'uint256' },
277
+ ],
278
+ outputs: [{ name: '', type: 'bool', internalType: 'bool' }],
279
+ stateMutability: 'view',
280
+ },
281
+ {
282
+ type: 'function',
283
+ name: 'owner',
284
+ inputs: [],
285
+ outputs: [{ name: 'result', type: 'address', internalType: 'address' }],
286
+ stateMutability: 'view',
287
+ },
288
+ {
289
+ type: 'function',
290
+ name: 'ownershipHandoverExpiresAt',
291
+ inputs: [
292
+ { name: 'pendingOwner', type: 'address', internalType: 'address' },
293
+ ],
294
+ outputs: [{ name: 'result', type: 'uint256', internalType: 'uint256' }],
295
+ stateMutability: 'view',
296
+ },
297
+ {
298
+ type: 'function',
299
+ name: 'principalRecipient',
300
+ inputs: [],
301
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
302
+ stateMutability: 'view',
303
+ },
304
+ {
305
+ type: 'function',
306
+ name: 'principalThreshold',
307
+ inputs: [],
308
+ outputs: [{ name: '', type: 'uint64', internalType: 'uint64' }],
309
+ stateMutability: 'view',
310
+ },
311
+ {
312
+ type: 'function',
313
+ name: 'recoverFunds',
314
+ inputs: [
315
+ { name: 'nonOVMToken', type: 'address', internalType: 'address' },
316
+ { name: 'recipient', type: 'address', internalType: 'address' },
317
+ ],
318
+ outputs: [],
319
+ stateMutability: 'nonpayable',
320
+ },
321
+ {
322
+ type: 'function',
323
+ name: 'renounceOwnership',
324
+ inputs: [],
325
+ outputs: [],
326
+ stateMutability: 'payable',
327
+ },
328
+ {
329
+ type: 'function',
330
+ name: 'renounceRoles',
331
+ inputs: [{ name: 'roles', type: 'uint256', internalType: 'uint256' }],
332
+ outputs: [],
333
+ stateMutability: 'payable',
334
+ },
335
+ {
336
+ type: 'function',
337
+ name: 'requestConsolidation',
338
+ inputs: [
339
+ { name: 'sourcePubKeys', type: 'bytes[]', internalType: 'bytes[]' },
340
+ { name: 'targetPubKey', type: 'bytes', internalType: 'bytes' },
341
+ ],
342
+ outputs: [],
343
+ stateMutability: 'payable',
344
+ },
345
+ {
346
+ type: 'function',
347
+ name: 'requestOwnershipHandover',
348
+ inputs: [],
349
+ outputs: [],
350
+ stateMutability: 'payable',
351
+ },
352
+ {
353
+ type: 'function',
354
+ name: 'requestWithdrawal',
355
+ inputs: [
356
+ { name: 'pubKeys', type: 'bytes[]', internalType: 'bytes[]' },
357
+ { name: 'amounts', type: 'uint64[]', internalType: 'uint64[]' },
358
+ ],
359
+ outputs: [],
360
+ stateMutability: 'payable',
361
+ },
362
+ {
363
+ type: 'function',
364
+ name: 'revokeRoles',
365
+ inputs: [
366
+ { name: 'user', type: 'address', internalType: 'address' },
367
+ { name: 'roles', type: 'uint256', internalType: 'uint256' },
368
+ ],
369
+ outputs: [],
370
+ stateMutability: 'payable',
371
+ },
372
+ {
373
+ type: 'function',
374
+ name: 'rewardRecipient',
375
+ inputs: [],
376
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
377
+ stateMutability: 'view',
378
+ },
379
+ {
380
+ type: 'function',
381
+ name: 'rolesOf',
382
+ inputs: [{ name: 'user', type: 'address', internalType: 'address' }],
383
+ outputs: [{ name: 'roles', type: 'uint256', internalType: 'uint256' }],
384
+ stateMutability: 'view',
385
+ },
386
+ {
387
+ type: 'function',
388
+ name: 'setPrincipalRecipient',
389
+ inputs: [
390
+ {
391
+ name: 'newPrincipalRecipient',
392
+ type: 'address',
393
+ internalType: 'address',
394
+ },
395
+ ],
396
+ outputs: [],
397
+ stateMutability: 'nonpayable',
398
+ },
399
+ {
400
+ type: 'function',
401
+ name: 'transferOwnership',
402
+ inputs: [{ name: 'newOwner', type: 'address', internalType: 'address' }],
403
+ outputs: [],
404
+ stateMutability: 'payable',
405
+ },
406
+ {
407
+ type: 'function',
408
+ name: 'withdraw',
409
+ inputs: [{ name: 'account', type: 'address', internalType: 'address' }],
410
+ outputs: [],
411
+ stateMutability: 'nonpayable',
412
+ },
413
+ {
414
+ type: 'function',
415
+ name: 'withdrawalSystemContract',
416
+ inputs: [],
417
+ outputs: [{ name: '', type: 'address', internalType: 'address' }],
418
+ stateMutability: 'view',
419
+ },
420
+ {
421
+ type: 'event',
422
+ name: 'ConsolidationRequested',
423
+ inputs: [
424
+ {
425
+ name: 'requester',
426
+ type: 'address',
427
+ indexed: true,
428
+ internalType: 'address',
429
+ },
430
+ { name: 'source', type: 'bytes', indexed: true, internalType: 'bytes' },
431
+ { name: 'target', type: 'bytes', indexed: true, internalType: 'bytes' },
432
+ ],
433
+ anonymous: false,
434
+ },
435
+ {
436
+ type: 'event',
437
+ name: 'DistributeFunds',
438
+ inputs: [
439
+ {
440
+ name: 'principalPayout',
441
+ type: 'uint256',
442
+ indexed: false,
443
+ internalType: 'uint256',
444
+ },
445
+ {
446
+ name: 'rewardPayout',
447
+ type: 'uint256',
448
+ indexed: false,
449
+ internalType: 'uint256',
450
+ },
451
+ {
452
+ name: 'pullOrPush',
453
+ type: 'uint256',
454
+ indexed: false,
455
+ internalType: 'uint256',
456
+ },
457
+ ],
458
+ anonymous: false,
459
+ },
460
+ {
461
+ type: 'event',
462
+ name: 'NewPrincipalRecipient',
463
+ inputs: [
464
+ {
465
+ name: 'newPrincipalRecipient',
466
+ type: 'address',
467
+ indexed: true,
468
+ internalType: 'address',
469
+ },
470
+ {
471
+ name: 'oldPrincipalRecipient',
472
+ type: 'address',
473
+ indexed: true,
474
+ internalType: 'address',
475
+ },
476
+ ],
477
+ anonymous: false,
478
+ },
479
+ {
480
+ type: 'event',
481
+ name: 'OwnershipHandoverCanceled',
482
+ inputs: [
483
+ {
484
+ name: 'pendingOwner',
485
+ type: 'address',
486
+ indexed: true,
487
+ internalType: 'address',
488
+ },
489
+ ],
490
+ anonymous: false,
491
+ },
492
+ {
493
+ type: 'event',
494
+ name: 'OwnershipHandoverRequested',
495
+ inputs: [
496
+ {
497
+ name: 'pendingOwner',
498
+ type: 'address',
499
+ indexed: true,
500
+ internalType: 'address',
501
+ },
502
+ ],
503
+ anonymous: false,
504
+ },
505
+ {
506
+ type: 'event',
507
+ name: 'OwnershipTransferred',
508
+ inputs: [
509
+ {
510
+ name: 'oldOwner',
511
+ type: 'address',
512
+ indexed: true,
513
+ internalType: 'address',
514
+ },
515
+ {
516
+ name: 'newOwner',
517
+ type: 'address',
518
+ indexed: true,
519
+ internalType: 'address',
520
+ },
521
+ ],
522
+ anonymous: false,
523
+ },
524
+ {
525
+ type: 'event',
526
+ name: 'RecoverNonOVMFunds',
527
+ inputs: [
528
+ {
529
+ name: 'nonOVMToken',
530
+ type: 'address',
531
+ indexed: true,
532
+ internalType: 'address',
533
+ },
534
+ {
535
+ name: 'recipient',
536
+ type: 'address',
537
+ indexed: true,
538
+ internalType: 'address',
539
+ },
540
+ {
541
+ name: 'amount',
542
+ type: 'uint256',
543
+ indexed: false,
544
+ internalType: 'uint256',
545
+ },
546
+ ],
547
+ anonymous: false,
548
+ },
549
+ {
550
+ type: 'event',
551
+ name: 'RolesUpdated',
552
+ inputs: [
553
+ {
554
+ name: 'user',
555
+ type: 'address',
556
+ indexed: true,
557
+ internalType: 'address',
558
+ },
559
+ {
560
+ name: 'roles',
561
+ type: 'uint256',
562
+ indexed: true,
563
+ internalType: 'uint256',
564
+ },
565
+ ],
566
+ anonymous: false,
567
+ },
568
+ {
569
+ type: 'event',
570
+ name: 'Withdrawal',
571
+ inputs: [
572
+ {
573
+ name: 'account',
574
+ type: 'address',
575
+ indexed: true,
576
+ internalType: 'address',
577
+ },
578
+ {
579
+ name: 'amount',
580
+ type: 'uint256',
581
+ indexed: false,
582
+ internalType: 'uint256',
583
+ },
584
+ ],
585
+ anonymous: false,
586
+ },
587
+ {
588
+ type: 'event',
589
+ name: 'WithdrawalRequested',
590
+ inputs: [
591
+ {
592
+ name: 'requester',
593
+ type: 'address',
594
+ indexed: true,
595
+ internalType: 'address',
596
+ },
597
+ { name: 'pubKey', type: 'bytes', indexed: true, internalType: 'bytes' },
598
+ {
599
+ name: 'amount',
600
+ type: 'uint256',
601
+ indexed: false,
602
+ internalType: 'uint256',
603
+ },
604
+ ],
605
+ anonymous: false,
606
+ },
607
+ { type: 'error', name: 'InvalidConsolidation_Failed', inputs: [] },
608
+ { type: 'error', name: 'InvalidDistribution_TooLarge', inputs: [] },
609
+ { type: 'error', name: 'InvalidRequest_NotEnoughFee', inputs: [] },
610
+ { type: 'error', name: 'InvalidRequest_Params', inputs: [] },
611
+ { type: 'error', name: 'InvalidRequest_SystemGetFee', inputs: [] },
612
+ { type: 'error', name: 'InvalidWithdrawal_Failed', inputs: [] },
613
+ { type: 'error', name: 'NewOwnerIsZeroAddress', inputs: [] },
614
+ { type: 'error', name: 'NoHandoverRequest', inputs: [] },
615
+ { type: 'error', name: 'Unauthorized', inputs: [] },
616
+ ],
617
+ };