@obolnetwork/obol-sdk 2.11.4 → 2.11.5-rc.0
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/dist/cjs/src/index.js +17457 -382
- package/dist/cjs/src/index.js.map +1 -0
- package/dist/esm/src/index.js +17424 -361
- package/dist/esm/src/index.js.map +1 -0
- package/dist/types/src/constants.d.ts +1 -2
- package/dist/types/src/eoa/eoaHelpers.d.ts +1 -1
- package/dist/types/src/exits/verificationHelpers.d.ts +0 -2
- package/dist/types/src/incentives/incentiveHelpers.d.ts +1 -1
- package/dist/types/src/splits/splitHelpers.d.ts +3 -3
- package/dist/types/src/utils.d.ts +2 -2
- package/dist/types/src/verification/common.d.ts +0 -2
- package/dist/types/src/verification/signature-validator.d.ts +4 -4
- package/dist/types/src/verification/v1.10.0.d.ts +1 -1
- package/dist/types/src/verification/v1.6.0.d.ts +1 -1
- package/dist/types/src/verification/v1.7.0.d.ts +1 -1
- package/dist/types/src/verification/v1.8.0.d.ts +1 -1
- package/dist/types/test/client/methods.spec.d.ts +17 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/tsup.config.d.ts +2 -0
- package/package.json +79 -54
- package/dist/cjs/package.json +0 -139
- package/dist/cjs/src/abi/BatchDeposit.js +0 -120
- package/dist/cjs/src/abi/MerkleDistributorWithDeadline.js +0 -73
- package/dist/cjs/src/abi/Multicall3.js +0 -253
- package/dist/cjs/src/abi/OVM.js +0 -627
- package/dist/cjs/src/abi/OWR.js +0 -304
- package/dist/cjs/src/abi/SplitMain.js +0 -929
- package/dist/cjs/src/abi/splitV2FactoryAbi.js +0 -420
- package/dist/cjs/src/ajv.js +0 -136
- package/dist/cjs/src/base.js +0 -42
- package/dist/cjs/src/bytecodes.js +0 -19
- package/dist/cjs/src/constants.js +0 -272
- package/dist/cjs/src/eoa/eoa.js +0 -132
- package/dist/cjs/src/eoa/eoaHelpers.js +0 -82
- package/dist/cjs/src/errors.js +0 -11
- package/dist/cjs/src/exits/ethUtils.js +0 -57
- package/dist/cjs/src/exits/exit.js +0 -502
- package/dist/cjs/src/exits/verificationHelpers.js +0 -86
- package/dist/cjs/src/incentives/incentiveHelpers.js +0 -39
- package/dist/cjs/src/incentives/incentives.js +0 -119
- package/dist/cjs/src/schema.js +0 -352
- package/dist/cjs/src/services.js +0 -33
- package/dist/cjs/src/splits/splitHelpers.js +0 -571
- package/dist/cjs/src/splits/splits.js +0 -366
- package/dist/cjs/src/types.js +0 -29
- package/dist/cjs/src/utils.js +0 -77
- package/dist/cjs/src/verification/common.js +0 -355
- package/dist/cjs/src/verification/signature-validator.js +0 -73
- package/dist/cjs/src/verification/sszTypes.js +0 -69
- package/dist/cjs/src/verification/termsAndConditions.js +0 -40
- package/dist/cjs/src/verification/v1.10.0.js +0 -146
- package/dist/cjs/src/verification/v1.6.0.js +0 -149
- package/dist/cjs/src/verification/v1.7.0.js +0 -173
- package/dist/cjs/src/verification/v1.8.0.js +0 -196
- package/dist/cjs/test/client/ajv.spec.js +0 -320
- package/dist/cjs/test/client/methods.spec.js +0 -418
- package/dist/cjs/test/eoa/eoa.spec.js +0 -176
- package/dist/cjs/test/exit/ethUtils.spec.js +0 -83
- package/dist/cjs/test/exit/exit.spec.js +0 -399
- package/dist/cjs/test/exit/verificationHelpers.spec.js +0 -68
- package/dist/cjs/test/fixtures.js +0 -896
- package/dist/cjs/test/incentives/incentives.spec.js +0 -202
- package/dist/cjs/test/splits/splits.spec.js +0 -402
- package/dist/esm/package.json +0 -139
- package/dist/esm/src/abi/BatchDeposit.js +0 -117
- package/dist/esm/src/abi/MerkleDistributorWithDeadline.js +0 -70
- package/dist/esm/src/abi/Multicall3.js +0 -250
- package/dist/esm/src/abi/OVM.js +0 -624
- package/dist/esm/src/abi/OWR.js +0 -301
- package/dist/esm/src/abi/SplitMain.js +0 -926
- package/dist/esm/src/abi/splitV2FactoryAbi.js +0 -417
- package/dist/esm/src/ajv.js +0 -129
- package/dist/esm/src/base.js +0 -38
- package/dist/esm/src/bytecodes.js +0 -16
- package/dist/esm/src/constants.js +0 -238
- package/dist/esm/src/eoa/eoa.js +0 -128
- package/dist/esm/src/eoa/eoaHelpers.js +0 -77
- package/dist/esm/src/errors.js +0 -7
- package/dist/esm/src/exits/ethUtils.js +0 -52
- package/dist/esm/src/exits/exit.js +0 -475
- package/dist/esm/src/exits/verificationHelpers.js +0 -81
- package/dist/esm/src/incentives/incentiveHelpers.js +0 -34
- package/dist/esm/src/incentives/incentives.js +0 -115
- package/dist/esm/src/schema.js +0 -349
- package/dist/esm/src/services.js +0 -29
- package/dist/esm/src/splits/splitHelpers.js +0 -554
- package/dist/esm/src/splits/splits.js +0 -362
- package/dist/esm/src/types.js +0 -26
- package/dist/esm/src/utils.js +0 -68
- package/dist/esm/src/verification/common.js +0 -319
- package/dist/esm/src/verification/signature-validator.js +0 -64
- package/dist/esm/src/verification/sszTypes.js +0 -64
- package/dist/esm/src/verification/termsAndConditions.js +0 -33
- package/dist/esm/src/verification/v1.10.0.js +0 -140
- package/dist/esm/src/verification/v1.6.0.js +0 -142
- package/dist/esm/src/verification/v1.7.0.js +0 -166
- package/dist/esm/src/verification/v1.8.0.js +0 -189
- package/dist/esm/test/client/ajv.spec.js +0 -318
- package/dist/esm/test/client/methods.spec.js +0 -393
- package/dist/esm/test/eoa/eoa.spec.js +0 -174
- package/dist/esm/test/exit/ethUtils.spec.js +0 -81
- package/dist/esm/test/exit/exit.spec.js +0 -374
- package/dist/esm/test/exit/verificationHelpers.spec.js +0 -66
- package/dist/esm/test/fixtures.js +0 -893
- package/dist/esm/test/incentives/incentives.spec.js +0 -177
- package/dist/esm/test/splits/splits.spec.js +0 -400
- package/src/abi/BatchDeposit.ts +0 -117
- package/src/abi/MerkleDistributorWithDeadline.ts +0 -70
- package/src/abi/Multicall3.ts +0 -250
- package/src/abi/OVM.ts +0 -624
- package/src/abi/OWR.ts +0 -302
- package/src/abi/SplitMain.ts +0 -927
- package/src/abi/splitV2FactoryAbi.ts +0 -417
- package/src/ajv.ts +0 -191
- package/src/base.ts +0 -54
- package/src/bytecodes.ts +0 -32
- package/src/constants.ts +0 -309
- package/src/eoa/eoa.ts +0 -153
- package/src/eoa/eoaHelpers.ts +0 -112
- package/src/errors.ts +0 -8
- package/src/exits/ethUtils.ts +0 -49
- package/src/exits/exit.ts +0 -661
- package/src/exits/verificationHelpers.ts +0 -110
- package/src/incentives/incentiveHelpers.ts +0 -55
- package/src/incentives/incentives.ts +0 -153
- package/src/index.ts +0 -614
- package/src/schema.ts +0 -376
- package/src/services.ts +0 -24
- package/src/splits/splitHelpers.ts +0 -1032
- package/src/splits/splits.ts +0 -504
- package/src/types.ts +0 -687
- package/src/utils.ts +0 -88
- package/src/verification/common.ts +0 -532
- package/src/verification/signature-validator.ts +0 -103
- package/src/verification/sszTypes.ts +0 -88
- package/src/verification/termsAndConditions.ts +0 -32
- package/src/verification/v1.10.0.ts +0 -245
- package/src/verification/v1.6.0.ts +0 -256
- package/src/verification/v1.7.0.ts +0 -309
- package/src/verification/v1.8.0.ts +0 -340
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
export const splitV2FactoryAbi = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [
|
|
4
|
-
{
|
|
5
|
-
internalType: 'address',
|
|
6
|
-
name: '_splitsWarehouse',
|
|
7
|
-
type: 'address',
|
|
8
|
-
},
|
|
9
|
-
],
|
|
10
|
-
stateMutability: 'nonpayable',
|
|
11
|
-
type: 'constructor',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
anonymous: false,
|
|
15
|
-
inputs: [
|
|
16
|
-
{
|
|
17
|
-
indexed: true,
|
|
18
|
-
internalType: 'address',
|
|
19
|
-
name: 'split',
|
|
20
|
-
type: 'address',
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
components: [
|
|
24
|
-
{
|
|
25
|
-
internalType: 'address[]',
|
|
26
|
-
name: 'recipients',
|
|
27
|
-
type: 'address[]',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
internalType: 'uint256[]',
|
|
31
|
-
name: 'allocations',
|
|
32
|
-
type: 'uint256[]',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
internalType: 'uint256',
|
|
36
|
-
name: 'totalAllocation',
|
|
37
|
-
type: 'uint256',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
internalType: 'uint16',
|
|
41
|
-
name: 'distributionIncentive',
|
|
42
|
-
type: 'uint16',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
indexed: false,
|
|
46
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
47
|
-
name: 'splitParams',
|
|
48
|
-
type: 'tuple',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
indexed: false,
|
|
52
|
-
internalType: 'address',
|
|
53
|
-
name: 'owner',
|
|
54
|
-
type: 'address',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
indexed: false,
|
|
58
|
-
internalType: 'address',
|
|
59
|
-
name: 'creator',
|
|
60
|
-
type: 'address',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
indexed: false,
|
|
64
|
-
internalType: 'bytes32',
|
|
65
|
-
name: 'salt',
|
|
66
|
-
type: 'bytes32',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
name: 'SplitCreated',
|
|
70
|
-
type: 'event',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
anonymous: false,
|
|
74
|
-
inputs: [
|
|
75
|
-
{
|
|
76
|
-
indexed: true,
|
|
77
|
-
internalType: 'address',
|
|
78
|
-
name: 'split',
|
|
79
|
-
type: 'address',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
components: [
|
|
83
|
-
{
|
|
84
|
-
internalType: 'address[]',
|
|
85
|
-
name: 'recipients',
|
|
86
|
-
type: 'address[]',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
internalType: 'uint256[]',
|
|
90
|
-
name: 'allocations',
|
|
91
|
-
type: 'uint256[]',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
internalType: 'uint256',
|
|
95
|
-
name: 'totalAllocation',
|
|
96
|
-
type: 'uint256',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
internalType: 'uint16',
|
|
100
|
-
name: 'distributionIncentive',
|
|
101
|
-
type: 'uint16',
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
indexed: false,
|
|
105
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
106
|
-
name: 'splitParams',
|
|
107
|
-
type: 'tuple',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
indexed: false,
|
|
111
|
-
internalType: 'address',
|
|
112
|
-
name: 'owner',
|
|
113
|
-
type: 'address',
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
indexed: false,
|
|
117
|
-
internalType: 'address',
|
|
118
|
-
name: 'creator',
|
|
119
|
-
type: 'address',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
name: 'SplitCreated',
|
|
123
|
-
type: 'event',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
inputs: [],
|
|
127
|
-
name: 'SPLIT_WALLET_IMPLEMENTATION',
|
|
128
|
-
outputs: [
|
|
129
|
-
{
|
|
130
|
-
internalType: 'address',
|
|
131
|
-
name: '',
|
|
132
|
-
type: 'address',
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
stateMutability: 'view',
|
|
136
|
-
type: 'function',
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
inputs: [
|
|
140
|
-
{
|
|
141
|
-
components: [
|
|
142
|
-
{
|
|
143
|
-
internalType: 'address[]',
|
|
144
|
-
name: 'recipients',
|
|
145
|
-
type: 'address[]',
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
internalType: 'uint256[]',
|
|
149
|
-
name: 'allocations',
|
|
150
|
-
type: 'uint256[]',
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
internalType: 'uint256',
|
|
154
|
-
name: 'totalAllocation',
|
|
155
|
-
type: 'uint256',
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
internalType: 'uint16',
|
|
159
|
-
name: 'distributionIncentive',
|
|
160
|
-
type: 'uint16',
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
164
|
-
name: '_splitParams',
|
|
165
|
-
type: 'tuple',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
internalType: 'address',
|
|
169
|
-
name: '_owner',
|
|
170
|
-
type: 'address',
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
internalType: 'address',
|
|
174
|
-
name: '_creator',
|
|
175
|
-
type: 'address',
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
name: 'createSplit',
|
|
179
|
-
outputs: [
|
|
180
|
-
{
|
|
181
|
-
internalType: 'address',
|
|
182
|
-
name: 'split',
|
|
183
|
-
type: 'address',
|
|
184
|
-
},
|
|
185
|
-
],
|
|
186
|
-
stateMutability: 'nonpayable',
|
|
187
|
-
type: 'function',
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
inputs: [
|
|
191
|
-
{
|
|
192
|
-
components: [
|
|
193
|
-
{
|
|
194
|
-
internalType: 'address[]',
|
|
195
|
-
name: 'recipients',
|
|
196
|
-
type: 'address[]',
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
internalType: 'uint256[]',
|
|
200
|
-
name: 'allocations',
|
|
201
|
-
type: 'uint256[]',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
internalType: 'uint256',
|
|
205
|
-
name: 'totalAllocation',
|
|
206
|
-
type: 'uint256',
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
internalType: 'uint16',
|
|
210
|
-
name: 'distributionIncentive',
|
|
211
|
-
type: 'uint16',
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
215
|
-
name: '_splitParams',
|
|
216
|
-
type: 'tuple',
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
internalType: 'address',
|
|
220
|
-
name: '_owner',
|
|
221
|
-
type: 'address',
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
internalType: 'address',
|
|
225
|
-
name: '_creator',
|
|
226
|
-
type: 'address',
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
internalType: 'bytes32',
|
|
230
|
-
name: '_salt',
|
|
231
|
-
type: 'bytes32',
|
|
232
|
-
},
|
|
233
|
-
],
|
|
234
|
-
name: 'createSplitDeterministic',
|
|
235
|
-
outputs: [
|
|
236
|
-
{
|
|
237
|
-
internalType: 'address',
|
|
238
|
-
name: 'split',
|
|
239
|
-
type: 'address',
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
|
-
stateMutability: 'nonpayable',
|
|
243
|
-
type: 'function',
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
inputs: [
|
|
247
|
-
{
|
|
248
|
-
components: [
|
|
249
|
-
{
|
|
250
|
-
internalType: 'address[]',
|
|
251
|
-
name: 'recipients',
|
|
252
|
-
type: 'address[]',
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
internalType: 'uint256[]',
|
|
256
|
-
name: 'allocations',
|
|
257
|
-
type: 'uint256[]',
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
internalType: 'uint256',
|
|
261
|
-
name: 'totalAllocation',
|
|
262
|
-
type: 'uint256',
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
internalType: 'uint16',
|
|
266
|
-
name: 'distributionIncentive',
|
|
267
|
-
type: 'uint16',
|
|
268
|
-
},
|
|
269
|
-
],
|
|
270
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
271
|
-
name: '_splitParams',
|
|
272
|
-
type: 'tuple',
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
internalType: 'address',
|
|
276
|
-
name: '_owner',
|
|
277
|
-
type: 'address',
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
internalType: 'bytes32',
|
|
281
|
-
name: '_salt',
|
|
282
|
-
type: 'bytes32',
|
|
283
|
-
},
|
|
284
|
-
],
|
|
285
|
-
name: 'isDeployed',
|
|
286
|
-
outputs: [
|
|
287
|
-
{
|
|
288
|
-
internalType: 'address',
|
|
289
|
-
name: 'split',
|
|
290
|
-
type: 'address',
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
internalType: 'bool',
|
|
294
|
-
name: 'exists',
|
|
295
|
-
type: 'bool',
|
|
296
|
-
},
|
|
297
|
-
],
|
|
298
|
-
stateMutability: 'view',
|
|
299
|
-
type: 'function',
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
inputs: [
|
|
303
|
-
{
|
|
304
|
-
internalType: 'bytes32',
|
|
305
|
-
name: '_hash',
|
|
306
|
-
type: 'bytes32',
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
name: 'nonces',
|
|
310
|
-
outputs: [
|
|
311
|
-
{
|
|
312
|
-
internalType: 'uint256',
|
|
313
|
-
name: '',
|
|
314
|
-
type: 'uint256',
|
|
315
|
-
},
|
|
316
|
-
],
|
|
317
|
-
stateMutability: 'view',
|
|
318
|
-
type: 'function',
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
inputs: [
|
|
322
|
-
{
|
|
323
|
-
components: [
|
|
324
|
-
{
|
|
325
|
-
internalType: 'address[]',
|
|
326
|
-
name: 'recipients',
|
|
327
|
-
type: 'address[]',
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
internalType: 'uint256[]',
|
|
331
|
-
name: 'allocations',
|
|
332
|
-
type: 'uint256[]',
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
internalType: 'uint256',
|
|
336
|
-
name: 'totalAllocation',
|
|
337
|
-
type: 'uint256',
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
internalType: 'uint16',
|
|
341
|
-
name: 'distributionIncentive',
|
|
342
|
-
type: 'uint16',
|
|
343
|
-
},
|
|
344
|
-
],
|
|
345
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
346
|
-
name: '_splitParams',
|
|
347
|
-
type: 'tuple',
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
internalType: 'address',
|
|
351
|
-
name: '_owner',
|
|
352
|
-
type: 'address',
|
|
353
|
-
},
|
|
354
|
-
],
|
|
355
|
-
name: 'predictDeterministicAddress',
|
|
356
|
-
outputs: [
|
|
357
|
-
{
|
|
358
|
-
internalType: 'address',
|
|
359
|
-
name: '',
|
|
360
|
-
type: 'address',
|
|
361
|
-
},
|
|
362
|
-
],
|
|
363
|
-
stateMutability: 'view',
|
|
364
|
-
type: 'function',
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
inputs: [
|
|
368
|
-
{
|
|
369
|
-
components: [
|
|
370
|
-
{
|
|
371
|
-
internalType: 'address[]',
|
|
372
|
-
name: 'recipients',
|
|
373
|
-
type: 'address[]',
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
internalType: 'uint256[]',
|
|
377
|
-
name: 'allocations',
|
|
378
|
-
type: 'uint256[]',
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
internalType: 'uint256',
|
|
382
|
-
name: 'totalAllocation',
|
|
383
|
-
type: 'uint256',
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
internalType: 'uint16',
|
|
387
|
-
name: 'distributionIncentive',
|
|
388
|
-
type: 'uint16',
|
|
389
|
-
},
|
|
390
|
-
],
|
|
391
|
-
internalType: 'struct SplitV2Lib.Split',
|
|
392
|
-
name: '_splitParams',
|
|
393
|
-
type: 'tuple',
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
internalType: 'address',
|
|
397
|
-
name: '_owner',
|
|
398
|
-
type: 'address',
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
internalType: 'bytes32',
|
|
402
|
-
name: '_salt',
|
|
403
|
-
type: 'bytes32',
|
|
404
|
-
},
|
|
405
|
-
],
|
|
406
|
-
name: 'predictDeterministicAddress',
|
|
407
|
-
outputs: [
|
|
408
|
-
{
|
|
409
|
-
internalType: 'address',
|
|
410
|
-
name: '',
|
|
411
|
-
type: 'address',
|
|
412
|
-
},
|
|
413
|
-
],
|
|
414
|
-
stateMutability: 'view',
|
|
415
|
-
type: 'function',
|
|
416
|
-
},
|
|
417
|
-
];
|
package/dist/esm/src/ajv.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import addFormats from 'ajv-formats';
|
|
2
|
-
import addKeywords from 'ajv-keywords';
|
|
3
|
-
import { parseUnits } from 'ethers';
|
|
4
|
-
import Ajv from 'ajv';
|
|
5
|
-
import { DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT, DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT, } from './constants';
|
|
6
|
-
export const VALID_DEPOSIT_AMOUNTS = [
|
|
7
|
-
parseUnits('1', 'gwei').toString(),
|
|
8
|
-
parseUnits('32', 'gwei').toString(),
|
|
9
|
-
parseUnits('8', 'gwei').toString(),
|
|
10
|
-
parseUnits('256', 'gwei').toString(),
|
|
11
|
-
];
|
|
12
|
-
export const VALID_NON_COMPOUNDING_AMOUNTS = [
|
|
13
|
-
parseUnits('1', 'gwei').toString(),
|
|
14
|
-
parseUnits('32', 'gwei').toString(),
|
|
15
|
-
];
|
|
16
|
-
const calculateTotalPercentage = (recipients) => {
|
|
17
|
-
return recipients.reduce((acc, curr) => acc + curr.percentAllocation, 0);
|
|
18
|
-
};
|
|
19
|
-
const validateTotalPercentage = (totalPercentage) => {
|
|
20
|
-
return totalPercentage === 100;
|
|
21
|
-
};
|
|
22
|
-
const validateTotalPercentageWithRAF = (totalPercentage, rafPercentage) => {
|
|
23
|
-
return totalPercentage + rafPercentage === 100;
|
|
24
|
-
};
|
|
25
|
-
const validateRewardsSplitRecipients = (_, data) => {
|
|
26
|
-
var _a;
|
|
27
|
-
const obolRAFSplit = (_a = data === null || data === void 0 ? void 0 : data.ObolRAFSplit) !== null && _a !== void 0 ? _a : DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT;
|
|
28
|
-
const splitPercentage = calculateTotalPercentage(data.splitRecipients);
|
|
29
|
-
return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);
|
|
30
|
-
};
|
|
31
|
-
const validateTotalSplitRecipients = (_, data) => {
|
|
32
|
-
var _a;
|
|
33
|
-
const obolRAFSplit = (_a = data.ObolRAFSplit) !== null && _a !== void 0 ? _a : DEFAULT_RETROACTIVE_FUNDING_TOTAL_SPLIT;
|
|
34
|
-
const splitPercentage = calculateTotalPercentage(data.splitRecipients);
|
|
35
|
-
return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);
|
|
36
|
-
};
|
|
37
|
-
const validateUniqueAddresses = (_, operators) => {
|
|
38
|
-
if (!operators) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
if (operators.length < 4) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
if (operators.every(op => op.address === '')) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (operators.some(op => op.address.length !== 42)) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
const addresses = operators.map(op => op.address);
|
|
51
|
-
const uniqueAddresses = new Set(addresses);
|
|
52
|
-
const isUnique = uniqueAddresses.size === addresses.length;
|
|
53
|
-
return isUnique;
|
|
54
|
-
};
|
|
55
|
-
const validateOVMRewardsSplitRecipients = (_, data) => {
|
|
56
|
-
const obolRAFSplit = DEFAULT_RETROACTIVE_FUNDING_REWARDS_ONLY_SPLIT;
|
|
57
|
-
const splitPercentage = calculateTotalPercentage(data.rewardSplitRecipients);
|
|
58
|
-
return validateTotalPercentageWithRAF(splitPercentage, obolRAFSplit);
|
|
59
|
-
};
|
|
60
|
-
const validateOVMTotalSplitRecipients = (_, data) => {
|
|
61
|
-
const splitPercentage = calculateTotalPercentage(data.principalSplitRecipients);
|
|
62
|
-
return validateTotalPercentage(splitPercentage);
|
|
63
|
-
};
|
|
64
|
-
const validateOVMRequestWithdrawalPayload = (_, data) => {
|
|
65
|
-
if (!data.pubKeys || !data.amounts) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
if (data.pubKeys.length !== data.amounts.length) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
// // Validate that all amounts are at least 1,000,000 gwei
|
|
72
|
-
// const minAmount = BigInt(1000000);
|
|
73
|
-
// for (const amountStr of data.amounts) {
|
|
74
|
-
// const minAmount = BigInt(1000000);
|
|
75
|
-
// const amount = BigInt(amountStr);
|
|
76
|
-
// if (amount < minAmount) {
|
|
77
|
-
// return false;
|
|
78
|
-
// }
|
|
79
|
-
// }
|
|
80
|
-
return true;
|
|
81
|
-
};
|
|
82
|
-
const ajv = new Ajv({
|
|
83
|
-
allErrors: true,
|
|
84
|
-
useDefaults: true,
|
|
85
|
-
strict: false,
|
|
86
|
-
$data: true,
|
|
87
|
-
});
|
|
88
|
-
addFormats(ajv);
|
|
89
|
-
addKeywords(ajv, ['patternRequired']);
|
|
90
|
-
ajv.addKeyword({
|
|
91
|
-
keyword: 'validateRewardsSplitRecipients',
|
|
92
|
-
validate: validateRewardsSplitRecipients,
|
|
93
|
-
schemaType: 'boolean',
|
|
94
|
-
});
|
|
95
|
-
ajv.addKeyword({
|
|
96
|
-
keyword: 'validateTotalSplitRecipients',
|
|
97
|
-
validate: validateTotalSplitRecipients,
|
|
98
|
-
schemaType: 'boolean',
|
|
99
|
-
});
|
|
100
|
-
ajv.addKeyword({
|
|
101
|
-
keyword: 'validateUniqueAddresses',
|
|
102
|
-
validate: validateUniqueAddresses,
|
|
103
|
-
schemaType: 'boolean',
|
|
104
|
-
});
|
|
105
|
-
ajv.addKeyword({
|
|
106
|
-
keyword: 'validateOVMRewardsSplitRecipients',
|
|
107
|
-
validate: validateOVMRewardsSplitRecipients,
|
|
108
|
-
schemaType: 'boolean',
|
|
109
|
-
});
|
|
110
|
-
ajv.addKeyword({
|
|
111
|
-
keyword: 'validateOVMTotalSplitRecipients',
|
|
112
|
-
validate: validateOVMTotalSplitRecipients,
|
|
113
|
-
schemaType: 'boolean',
|
|
114
|
-
});
|
|
115
|
-
ajv.addKeyword({
|
|
116
|
-
keyword: 'validateOVMRequestWithdrawalPayload',
|
|
117
|
-
validate: validateOVMRequestWithdrawalPayload,
|
|
118
|
-
schemaType: 'boolean',
|
|
119
|
-
});
|
|
120
|
-
export function validatePayload(data, schema) {
|
|
121
|
-
var _a;
|
|
122
|
-
const validate = ajv.compile(schema);
|
|
123
|
-
const valid = validate(data);
|
|
124
|
-
if (!valid) {
|
|
125
|
-
const errors = (_a = validate.errors) === null || _a === void 0 ? void 0 : _a.map(e => `${e.instancePath} ${e.message}`).join(', ');
|
|
126
|
-
throw new Error(`Validation failed: ${errors}`);
|
|
127
|
-
}
|
|
128
|
-
return data;
|
|
129
|
-
}
|
package/dist/esm/src/base.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
// src/resources/base.ts
|
|
11
|
-
import { DEFAULT_BASE_URL, DEFAULT_CHAIN_ID, SDK_VERSION, } from './constants.js';
|
|
12
|
-
import { FORK_MAPPING } from './types.js';
|
|
13
|
-
export class Base {
|
|
14
|
-
constructor({ baseUrl = DEFAULT_BASE_URL, chainId = DEFAULT_CHAIN_ID, }) {
|
|
15
|
-
this.baseUrl = baseUrl;
|
|
16
|
-
this.chainId = chainId;
|
|
17
|
-
this.fork_version = FORK_MAPPING[this.chainId];
|
|
18
|
-
}
|
|
19
|
-
request(endpoint, options) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const url = `${this.baseUrl}${endpoint}`;
|
|
22
|
-
const config = Object.assign(Object.assign({}, options), { headers: Object.assign({ 'Content-Type': 'application/json', 'User-Agent': `Obol-SDK/${SDK_VERSION}` }, options === null || options === void 0 ? void 0 : options.headers) });
|
|
23
|
-
try {
|
|
24
|
-
const response = yield fetch(url, config);
|
|
25
|
-
if (response.ok) {
|
|
26
|
-
return yield response.json();
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
const errorResponse = yield response.json();
|
|
30
|
-
throw errorResponse;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
throw e;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|