@obolnetwork/obol-sdk 2.0.1 → 2.1.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 (49) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/package.json +1 -1
  3. package/dist/cjs/src/abi/Multicall.js +148 -0
  4. package/dist/cjs/src/abi/OWR.js +304 -0
  5. package/dist/cjs/src/abi/SplitMain.js +929 -0
  6. package/dist/cjs/src/ajv.js +17 -2
  7. package/dist/cjs/src/bytecodes.js +9 -0
  8. package/dist/cjs/src/constants.js +48 -1
  9. package/dist/cjs/src/index.js +166 -0
  10. package/dist/cjs/src/schema.js +52 -5
  11. package/dist/cjs/src/splitHelpers.js +187 -0
  12. package/dist/cjs/src/utils.js +22 -1
  13. package/dist/cjs/test/fixtures.js +1 -1
  14. package/dist/cjs/test/methods.test.js +215 -11
  15. package/dist/esm/package.json +1 -1
  16. package/dist/esm/src/abi/Multicall.js +145 -0
  17. package/dist/esm/src/abi/OWR.js +301 -0
  18. package/dist/esm/src/abi/SplitMain.js +926 -0
  19. package/dist/esm/src/ajv.js +17 -2
  20. package/dist/esm/src/bytecodes.js +6 -0
  21. package/dist/esm/src/constants.js +47 -0
  22. package/dist/esm/src/index.js +168 -2
  23. package/dist/esm/src/schema.js +51 -4
  24. package/dist/esm/src/splitHelpers.js +177 -0
  25. package/dist/esm/src/utils.js +19 -0
  26. package/dist/esm/test/fixtures.js +1 -1
  27. package/dist/esm/test/methods.test.js +193 -12
  28. package/dist/types/src/abi/Multicall.d.ts +35 -0
  29. package/dist/types/src/abi/OWR.d.ts +96 -0
  30. package/dist/types/src/abi/SplitMain.d.ts +1159 -0
  31. package/dist/types/src/bytecodes.d.ts +6 -0
  32. package/dist/types/src/constants.d.ts +25 -0
  33. package/dist/types/src/index.d.ts +41 -1
  34. package/dist/types/src/schema.d.ts +85 -4
  35. package/dist/types/src/splitHelpers.d.ts +66 -0
  36. package/dist/types/src/types.d.ts +50 -2
  37. package/dist/types/src/utils.d.ts +3 -0
  38. package/package.json +1 -1
  39. package/src/abi/Multicall.ts +145 -0
  40. package/src/abi/OWR.ts +302 -0
  41. package/src/abi/SplitMain.ts +927 -0
  42. package/src/ajv.ts +33 -2
  43. package/src/bytecodes.ts +12 -0
  44. package/src/constants.ts +59 -0
  45. package/src/index.ts +267 -2
  46. package/src/schema.ts +67 -4
  47. package/src/splitHelpers.ts +360 -0
  48. package/src/types.ts +63 -2
  49. package/src/utils.ts +21 -0
package/src/abi/OWR.ts ADDED
@@ -0,0 +1,302 @@
1
+ export const OWRFactoryContract = {
2
+ abi: [
3
+ {
4
+ inputs: [
5
+ {
6
+ internalType: 'string',
7
+ name: '_ensName',
8
+ type: 'string',
9
+ },
10
+ {
11
+ internalType: 'address',
12
+ name: '_ensReverseRegistrar',
13
+ type: 'address',
14
+ },
15
+ {
16
+ internalType: 'address',
17
+ name: '_ensOwner',
18
+ type: 'address',
19
+ },
20
+ ],
21
+ stateMutability: 'nonpayable',
22
+ type: 'constructor',
23
+ },
24
+ {
25
+ inputs: [],
26
+ name: 'Invalid__Recipients',
27
+ type: 'error',
28
+ },
29
+ {
30
+ inputs: [
31
+ {
32
+ internalType: 'uint256',
33
+ name: 'threshold',
34
+ type: 'uint256',
35
+ },
36
+ ],
37
+ name: 'Invalid__ThresholdTooLarge',
38
+ type: 'error',
39
+ },
40
+ {
41
+ inputs: [],
42
+ name: 'Invalid__ZeroThreshold',
43
+ type: 'error',
44
+ },
45
+ {
46
+ anonymous: false,
47
+ inputs: [
48
+ {
49
+ indexed: true,
50
+ internalType: 'address',
51
+ name: 'owr',
52
+ type: 'address',
53
+ },
54
+ {
55
+ indexed: false,
56
+ internalType: 'address',
57
+ name: 'recoveryAddress',
58
+ type: 'address',
59
+ },
60
+ {
61
+ indexed: false,
62
+ internalType: 'address',
63
+ name: 'principalRecipient',
64
+ type: 'address',
65
+ },
66
+ {
67
+ indexed: false,
68
+ internalType: 'address',
69
+ name: 'rewardRecipient',
70
+ type: 'address',
71
+ },
72
+ {
73
+ indexed: false,
74
+ internalType: 'uint256',
75
+ name: 'threshold',
76
+ type: 'uint256',
77
+ },
78
+ ],
79
+ name: 'CreateOWRecipient',
80
+ type: 'event',
81
+ },
82
+ {
83
+ inputs: [
84
+ {
85
+ internalType: 'address',
86
+ name: 'recoveryAddress',
87
+ type: 'address',
88
+ },
89
+ {
90
+ internalType: 'address',
91
+ name: 'principalRecipient',
92
+ type: 'address',
93
+ },
94
+ {
95
+ internalType: 'address',
96
+ name: 'rewardRecipient',
97
+ type: 'address',
98
+ },
99
+ {
100
+ internalType: 'uint256',
101
+ name: 'amountOfPrincipalStake',
102
+ type: 'uint256',
103
+ },
104
+ ],
105
+ name: 'createOWRecipient',
106
+ outputs: [
107
+ {
108
+ internalType: 'contract OptimisticWithdrawalRecipient',
109
+ name: 'owr',
110
+ type: 'address',
111
+ },
112
+ ],
113
+ stateMutability: 'nonpayable',
114
+ type: 'function',
115
+ },
116
+ {
117
+ inputs: [],
118
+ name: 'owrImpl',
119
+ outputs: [
120
+ {
121
+ internalType: 'contract OptimisticWithdrawalRecipient',
122
+ name: '',
123
+ type: 'address',
124
+ },
125
+ ],
126
+ stateMutability: 'view',
127
+ type: 'function',
128
+ },
129
+ ],
130
+ };
131
+
132
+ export const OWRContract = {
133
+ abi: [
134
+ { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
135
+ { inputs: [], name: 'InvalidDistribution_TooLarge', type: 'error' },
136
+ {
137
+ inputs: [],
138
+ name: 'InvalidTokenRecovery_InvalidRecipient',
139
+ type: 'error',
140
+ },
141
+ {
142
+ anonymous: false,
143
+ inputs: [
144
+ {
145
+ indexed: false,
146
+ internalType: 'uint256',
147
+ name: 'principalPayout',
148
+ type: 'uint256',
149
+ },
150
+ {
151
+ indexed: false,
152
+ internalType: 'uint256',
153
+ name: 'rewardPayout',
154
+ type: 'uint256',
155
+ },
156
+ {
157
+ indexed: false,
158
+ internalType: 'uint256',
159
+ name: 'pullFlowFlag',
160
+ type: 'uint256',
161
+ },
162
+ ],
163
+ name: 'DistributeFunds',
164
+ type: 'event',
165
+ },
166
+ {
167
+ anonymous: false,
168
+ inputs: [
169
+ {
170
+ indexed: false,
171
+ internalType: 'uint256',
172
+ name: 'amount',
173
+ type: 'uint256',
174
+ },
175
+ ],
176
+ name: 'ReceiveETH',
177
+ type: 'event',
178
+ },
179
+ {
180
+ anonymous: false,
181
+ inputs: [
182
+ {
183
+ indexed: false,
184
+ internalType: 'address',
185
+ name: 'recoveryAddressToken',
186
+ type: 'address',
187
+ },
188
+ {
189
+ indexed: false,
190
+ internalType: 'address',
191
+ name: 'recipient',
192
+ type: 'address',
193
+ },
194
+ {
195
+ indexed: false,
196
+ internalType: 'uint256',
197
+ name: 'amount',
198
+ type: 'uint256',
199
+ },
200
+ ],
201
+ name: 'RecoverNonOWRecipientFunds',
202
+ type: 'event',
203
+ },
204
+ {
205
+ anonymous: false,
206
+ inputs: [
207
+ {
208
+ indexed: false,
209
+ internalType: 'address',
210
+ name: 'account',
211
+ type: 'address',
212
+ },
213
+ {
214
+ indexed: false,
215
+ internalType: 'uint256',
216
+ name: 'amount',
217
+ type: 'uint256',
218
+ },
219
+ ],
220
+ name: 'Withdrawal',
221
+ type: 'event',
222
+ },
223
+ {
224
+ inputs: [],
225
+ name: 'claimedPrincipalFunds',
226
+ outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],
227
+ stateMutability: 'view',
228
+ type: 'function',
229
+ },
230
+ {
231
+ inputs: [],
232
+ name: 'distributeFunds',
233
+ outputs: [],
234
+ stateMutability: 'payable',
235
+ type: 'function',
236
+ },
237
+ {
238
+ inputs: [],
239
+ name: 'distributeFundsPull',
240
+ outputs: [],
241
+ stateMutability: 'payable',
242
+ type: 'function',
243
+ },
244
+ {
245
+ inputs: [],
246
+ name: 'fundsPendingWithdrawal',
247
+ outputs: [{ internalType: 'uint128', name: '', type: 'uint128' }],
248
+ stateMutability: 'view',
249
+ type: 'function',
250
+ },
251
+ {
252
+ inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
253
+ name: 'getPullBalance',
254
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
255
+ stateMutability: 'view',
256
+ type: 'function',
257
+ },
258
+ {
259
+ inputs: [],
260
+ name: 'getTranches',
261
+ outputs: [
262
+ {
263
+ internalType: 'address',
264
+ name: 'principalRecipient',
265
+ type: 'address',
266
+ },
267
+ { internalType: 'address', name: 'rewardRecipient', type: 'address' },
268
+ {
269
+ internalType: 'uint256',
270
+ name: 'amountOfPrincipalStake',
271
+ type: 'uint256',
272
+ },
273
+ ],
274
+ stateMutability: 'pure',
275
+ type: 'function',
276
+ },
277
+ {
278
+ inputs: [
279
+ { internalType: 'address', name: 'nonOWRToken', type: 'address' },
280
+ { internalType: 'address', name: 'recipient', type: 'address' },
281
+ ],
282
+ name: 'recoverFunds',
283
+ outputs: [],
284
+ stateMutability: 'payable',
285
+ type: 'function',
286
+ },
287
+ {
288
+ inputs: [],
289
+ name: 'recoveryAddress',
290
+ outputs: [{ internalType: 'address', name: '', type: 'address' }],
291
+ stateMutability: 'pure',
292
+ type: 'function',
293
+ },
294
+ {
295
+ inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
296
+ name: 'withdraw',
297
+ outputs: [],
298
+ stateMutability: 'nonpayable',
299
+ type: 'function',
300
+ },
301
+ ],
302
+ };