@obolnetwork/obol-sdk 2.10.1 → 2.11.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/README.md +1 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/abi/BatchDeposit.js +120 -0
- package/dist/cjs/src/abi/Multicall3.js +253 -0
- package/dist/cjs/src/bytecodes.js +4 -4
- package/dist/cjs/src/constants.js +14 -7
- package/dist/cjs/src/eoa/eoa.js +48 -0
- package/dist/cjs/src/eoa/eoaHelpers.js +45 -1
- package/dist/cjs/src/index.js +2 -2
- package/dist/cjs/src/schema.js +83 -1
- package/dist/cjs/src/splits/splitHelpers.js +64 -19
- package/dist/cjs/src/splits/splits.js +54 -11
- package/dist/cjs/test/eoa/eoa.spec.js +75 -0
- package/dist/cjs/test/splits/splits.spec.js +84 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/abi/BatchDeposit.js +117 -0
- package/dist/esm/src/abi/Multicall3.js +250 -0
- package/dist/esm/src/bytecodes.js +3 -3
- package/dist/esm/src/constants.js +15 -8
- package/dist/esm/src/eoa/eoa.js +50 -2
- package/dist/esm/src/eoa/eoaHelpers.js +43 -0
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/schema.js +82 -0
- package/dist/esm/src/splits/splitHelpers.js +61 -17
- package/dist/esm/src/splits/splits.js +56 -13
- package/dist/esm/test/eoa/eoa.spec.js +76 -1
- package/dist/esm/test/splits/splits.spec.js +85 -1
- package/dist/types/src/abi/BatchDeposit.d.ts +49 -0
- package/dist/types/src/abi/Multicall3.d.ts +37 -0
- package/dist/types/src/bytecodes.d.ts +3 -3
- package/dist/types/src/eoa/eoa.d.ts +34 -1
- package/dist/types/src/eoa/eoaHelpers.d.ts +15 -0
- package/dist/types/src/schema.d.ts +76 -0
- package/dist/types/src/splits/splitHelpers.d.ts +22 -1
- package/dist/types/src/splits/splits.d.ts +33 -1
- package/dist/types/src/types.d.ts +40 -1
- package/package.json +1 -1
- package/src/abi/BatchDeposit.ts +117 -0
- package/src/abi/Multicall3.ts +250 -0
- package/src/bytecodes.ts +3 -3
- package/src/constants.ts +17 -10
- package/src/eoa/eoa.ts +60 -2
- package/src/eoa/eoaHelpers.ts +68 -0
- package/src/index.ts +4 -4
- package/src/schema.ts +84 -0
- package/src/splits/splitHelpers.ts +99 -19
- package/src/splits/splits.ts +65 -15
- package/src/types.ts +43 -1
- package/dist/cjs/src/abi/Multicall.js +0 -148
- package/dist/esm/src/abi/Multicall.js +0 -145
- package/dist/types/src/abi/Multicall.d.ts +0 -35
- package/src/abi/Multicall.ts +0 -145
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ If you're integrating this SDK with a **backend** (e.g., in Node.js), and you st
|
|
|
19
19
|
|
|
20
20
|
## ⚡️ Integration with Safe Wallet
|
|
21
21
|
|
|
22
|
-
When integrating the Obol SDK with a **Safe Wallet**, you can either pass an RPC URL OR provide the `RPC_MAINNET` or `RPC_HOLESKY` or `RPC_GNOSIS` or `RPC_SEPOLIA` environment variable, pointing to the correct network's RPC URL. This is required to interact with Safe kit.
|
|
22
|
+
When integrating the Obol SDK with a **Safe Wallet**, you can either pass an RPC URL OR provide the `RPC_MAINNET` or `RPC_HOLESKY` or `RPC_GNOSIS` or `RPC_SEPOLIA` or `RPC_HOODI` environment variable, pointing to the correct network's RPC URL. This is required to interact with Safe kit.
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
## Contributing
|
package/dist/cjs/package.json
CHANGED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BatchDepositContract = void 0;
|
|
4
|
+
exports.BatchDepositContract = {
|
|
5
|
+
abi: [
|
|
6
|
+
{
|
|
7
|
+
inputs: [],
|
|
8
|
+
name: 'DepositValueGreaterThan2048ETH',
|
|
9
|
+
type: 'error',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
inputs: [],
|
|
13
|
+
name: 'DepositValueLessThan1ETH',
|
|
14
|
+
type: 'error',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
inputs: [],
|
|
18
|
+
name: 'DepositValueMustBeMultipleOfGwei',
|
|
19
|
+
type: 'error',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
inputs: [],
|
|
23
|
+
name: 'InvalidPubKeyLength',
|
|
24
|
+
type: 'error',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
inputs: [],
|
|
28
|
+
name: 'InvalidSignatureLength',
|
|
29
|
+
type: 'error',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
inputs: [],
|
|
33
|
+
name: 'InvalidWithdrawalCredLength',
|
|
34
|
+
type: 'error',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
inputs: [],
|
|
38
|
+
name: 'MsgValueNotEqualToTotalDepositAmount',
|
|
39
|
+
type: 'error',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
inputs: [],
|
|
43
|
+
name: 'NoDepositsProvided',
|
|
44
|
+
type: 'error',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
anonymous: false,
|
|
48
|
+
inputs: [
|
|
49
|
+
{
|
|
50
|
+
indexed: true,
|
|
51
|
+
internalType: 'bytes',
|
|
52
|
+
name: 'pubKey',
|
|
53
|
+
type: 'bytes',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
indexed: true,
|
|
57
|
+
internalType: 'bytes',
|
|
58
|
+
name: 'withdrawalCredentials',
|
|
59
|
+
type: 'bytes',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
indexed: false,
|
|
63
|
+
internalType: 'uint256',
|
|
64
|
+
name: 'amount',
|
|
65
|
+
type: 'uint256',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
name: 'ValidatorDeposit',
|
|
69
|
+
type: 'event',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
inputs: [
|
|
73
|
+
{
|
|
74
|
+
components: [
|
|
75
|
+
{
|
|
76
|
+
internalType: 'bytes',
|
|
77
|
+
name: 'pubKey',
|
|
78
|
+
type: 'bytes',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
internalType: 'bytes',
|
|
82
|
+
name: 'withdrawalCredentials',
|
|
83
|
+
type: 'bytes',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
internalType: 'bytes',
|
|
87
|
+
name: 'signature',
|
|
88
|
+
type: 'bytes',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
internalType: 'uint256',
|
|
92
|
+
name: 'amount',
|
|
93
|
+
type: 'uint256',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
internalType: 'struct IBatchDeposit.Deposit[]',
|
|
97
|
+
name: '_deposits',
|
|
98
|
+
type: 'tuple[]',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
name: 'batchDeposit',
|
|
102
|
+
outputs: [],
|
|
103
|
+
stateMutability: 'payable',
|
|
104
|
+
type: 'function',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
inputs: [],
|
|
108
|
+
name: 'depositContract',
|
|
109
|
+
outputs: [
|
|
110
|
+
{
|
|
111
|
+
internalType: 'contract IDepositContract',
|
|
112
|
+
name: '',
|
|
113
|
+
type: 'address',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
stateMutability: 'view',
|
|
117
|
+
type: 'function',
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiCall3Contract = void 0;
|
|
4
|
+
exports.MultiCall3Contract = {
|
|
5
|
+
abi: [
|
|
6
|
+
{
|
|
7
|
+
inputs: [
|
|
8
|
+
{
|
|
9
|
+
components: [
|
|
10
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
11
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
12
|
+
],
|
|
13
|
+
internalType: 'struct Multicall3.Call[]',
|
|
14
|
+
name: 'calls',
|
|
15
|
+
type: 'tuple[]',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
name: 'aggregate',
|
|
19
|
+
outputs: [
|
|
20
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
21
|
+
{ internalType: 'bytes[]', name: 'returnData', type: 'bytes[]' },
|
|
22
|
+
],
|
|
23
|
+
stateMutability: 'payable',
|
|
24
|
+
type: 'function',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
inputs: [
|
|
28
|
+
{
|
|
29
|
+
components: [
|
|
30
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
31
|
+
{ internalType: 'bool', name: 'allowFailure', type: 'bool' },
|
|
32
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
33
|
+
],
|
|
34
|
+
internalType: 'struct Multicall3.Call3[]',
|
|
35
|
+
name: 'calls',
|
|
36
|
+
type: 'tuple[]',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
name: 'aggregate3',
|
|
40
|
+
outputs: [
|
|
41
|
+
{
|
|
42
|
+
components: [
|
|
43
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
44
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
45
|
+
],
|
|
46
|
+
internalType: 'struct Multicall3.Result[]',
|
|
47
|
+
name: 'returnData',
|
|
48
|
+
type: 'tuple[]',
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
stateMutability: 'payable',
|
|
52
|
+
type: 'function',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
inputs: [
|
|
56
|
+
{
|
|
57
|
+
components: [
|
|
58
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
59
|
+
{ internalType: 'bool', name: 'allowFailure', type: 'bool' },
|
|
60
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
61
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
62
|
+
],
|
|
63
|
+
internalType: 'struct Multicall3.Call3Value[]',
|
|
64
|
+
name: 'calls',
|
|
65
|
+
type: 'tuple[]',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
name: 'aggregate3Value',
|
|
69
|
+
outputs: [
|
|
70
|
+
{
|
|
71
|
+
components: [
|
|
72
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
73
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
74
|
+
],
|
|
75
|
+
internalType: 'struct Multicall3.Result[]',
|
|
76
|
+
name: 'returnData',
|
|
77
|
+
type: 'tuple[]',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
stateMutability: 'payable',
|
|
81
|
+
type: 'function',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
inputs: [
|
|
85
|
+
{
|
|
86
|
+
components: [
|
|
87
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
88
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
89
|
+
],
|
|
90
|
+
internalType: 'struct Multicall3.Call[]',
|
|
91
|
+
name: 'calls',
|
|
92
|
+
type: 'tuple[]',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
name: 'blockAndAggregate',
|
|
96
|
+
outputs: [
|
|
97
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
98
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
99
|
+
{
|
|
100
|
+
components: [
|
|
101
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
102
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
103
|
+
],
|
|
104
|
+
internalType: 'struct Multicall3.Result[]',
|
|
105
|
+
name: 'returnData',
|
|
106
|
+
type: 'tuple[]',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
stateMutability: 'payable',
|
|
110
|
+
type: 'function',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
inputs: [],
|
|
114
|
+
name: 'getBasefee',
|
|
115
|
+
outputs: [{ internalType: 'uint256', name: 'basefee', type: 'uint256' }],
|
|
116
|
+
stateMutability: 'view',
|
|
117
|
+
type: 'function',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
inputs: [
|
|
121
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
122
|
+
],
|
|
123
|
+
name: 'getBlockHash',
|
|
124
|
+
outputs: [
|
|
125
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
126
|
+
],
|
|
127
|
+
stateMutability: 'view',
|
|
128
|
+
type: 'function',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
inputs: [],
|
|
132
|
+
name: 'getBlockNumber',
|
|
133
|
+
outputs: [
|
|
134
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
135
|
+
],
|
|
136
|
+
stateMutability: 'view',
|
|
137
|
+
type: 'function',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
inputs: [],
|
|
141
|
+
name: 'getChainId',
|
|
142
|
+
outputs: [{ internalType: 'uint256', name: 'chainid', type: 'uint256' }],
|
|
143
|
+
stateMutability: 'view',
|
|
144
|
+
type: 'function',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
inputs: [],
|
|
148
|
+
name: 'getCurrentBlockCoinbase',
|
|
149
|
+
outputs: [{ internalType: 'address', name: 'coinbase', type: 'address' }],
|
|
150
|
+
stateMutability: 'view',
|
|
151
|
+
type: 'function',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
inputs: [],
|
|
155
|
+
name: 'getCurrentBlockDifficulty',
|
|
156
|
+
outputs: [
|
|
157
|
+
{ internalType: 'uint256', name: 'difficulty', type: 'uint256' },
|
|
158
|
+
],
|
|
159
|
+
stateMutability: 'view',
|
|
160
|
+
type: 'function',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
inputs: [],
|
|
164
|
+
name: 'getCurrentBlockGasLimit',
|
|
165
|
+
outputs: [{ internalType: 'uint256', name: 'gaslimit', type: 'uint256' }],
|
|
166
|
+
stateMutability: 'view',
|
|
167
|
+
type: 'function',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
inputs: [],
|
|
171
|
+
name: 'getCurrentBlockTimestamp',
|
|
172
|
+
outputs: [
|
|
173
|
+
{ internalType: 'uint256', name: 'timestamp', type: 'uint256' },
|
|
174
|
+
],
|
|
175
|
+
stateMutability: 'view',
|
|
176
|
+
type: 'function',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
inputs: [{ internalType: 'address', name: 'addr', type: 'address' }],
|
|
180
|
+
name: 'getEthBalance',
|
|
181
|
+
outputs: [{ internalType: 'uint256', name: 'balance', type: 'uint256' }],
|
|
182
|
+
stateMutability: 'view',
|
|
183
|
+
type: 'function',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
inputs: [],
|
|
187
|
+
name: 'getLastBlockHash',
|
|
188
|
+
outputs: [
|
|
189
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
190
|
+
],
|
|
191
|
+
stateMutability: 'view',
|
|
192
|
+
type: 'function',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
inputs: [
|
|
196
|
+
{ internalType: 'bool', name: 'requireSuccess', type: 'bool' },
|
|
197
|
+
{
|
|
198
|
+
components: [
|
|
199
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
200
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
201
|
+
],
|
|
202
|
+
internalType: 'struct Multicall3.Call[]',
|
|
203
|
+
name: 'calls',
|
|
204
|
+
type: 'tuple[]',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
name: 'tryAggregate',
|
|
208
|
+
outputs: [
|
|
209
|
+
{
|
|
210
|
+
components: [
|
|
211
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
212
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
213
|
+
],
|
|
214
|
+
internalType: 'struct Multicall3.Result[]',
|
|
215
|
+
name: 'returnData',
|
|
216
|
+
type: 'tuple[]',
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
stateMutability: 'payable',
|
|
220
|
+
type: 'function',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
inputs: [
|
|
224
|
+
{ internalType: 'bool', name: 'requireSuccess', type: 'bool' },
|
|
225
|
+
{
|
|
226
|
+
components: [
|
|
227
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
|
228
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
|
229
|
+
],
|
|
230
|
+
internalType: 'struct Multicall3.Call[]',
|
|
231
|
+
name: 'calls',
|
|
232
|
+
type: 'tuple[]',
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
name: 'tryBlockAndAggregate',
|
|
236
|
+
outputs: [
|
|
237
|
+
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
|
|
238
|
+
{ internalType: 'bytes32', name: 'blockHash', type: 'bytes32' },
|
|
239
|
+
{
|
|
240
|
+
components: [
|
|
241
|
+
{ internalType: 'bool', name: 'success', type: 'bool' },
|
|
242
|
+
{ internalType: 'bytes', name: 'returnData', type: 'bytes' },
|
|
243
|
+
],
|
|
244
|
+
internalType: 'struct Multicall3.Result[]',
|
|
245
|
+
name: 'returnData',
|
|
246
|
+
type: 'tuple[]',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
stateMutability: 'payable',
|
|
250
|
+
type: 'function',
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
};
|