@obolnetwork/obol-sdk 2.2.0 → 2.2.2

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 CHANGED
@@ -17,6 +17,11 @@ If you're integrating this SDK with a **backend** (e.g., in Node.js), and you st
17
17
  - The private key is securely stored (e.g., in an `.env` file).
18
18
  - Never commit or push your `.env` file containing the private key to version control.
19
19
 
20
+ ## ⚡️ Integration with Safe Wallet
21
+
22
+ When integrating the Obol SDK with a **Safe Wallet**, you will need to 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.
23
+
24
+
20
25
  ## Contributing
21
26
 
22
27
  Please review the following guidelines:
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A package for creating Distributed Validators using the Obol API.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/obolnetwork/obol-sdk/issues"
@@ -69,7 +69,7 @@ const isContractAvailable = (contractAddress, provider, bytecode) => __awaiter(v
69
69
  exports.isContractAvailable = isContractAvailable;
70
70
  const getProvider = (chainId) => {
71
71
  const rpcUrl = constants_1.PROVIDER_MAP[chainId];
72
- if (!rpcUrl) {
72
+ if (!rpcUrl || rpcUrl === 'undefined') {
73
73
  throw new Error(`No provider configured for ${types_1.FORK_NAMES[chainId]}`);
74
74
  }
75
75
  return new ethers_1.ethers.JsonRpcProvider(rpcUrl);
@@ -162,14 +162,14 @@ const verifyDefinitionSignatures = (clusterDefinition, definitionType) => __awai
162
162
  if (definitionType === constants_js_1.DefinitionFlow.Solo) {
163
163
  return true;
164
164
  }
165
- return clusterDefinition.operators.every((operator) => __awaiter(void 0, void 0, void 0, function* () {
165
+ for (const operator of clusterDefinition.operators) {
166
166
  const isPUTConfigHashSignerValid = yield validatePUTConfigHashSigner(operator.address, operator.config_signature, clusterDefinition.config_hash, types_js_1.FORK_MAPPING[clusterDefinition.fork_version]);
167
167
  const isENRSignerValid = yield validateEnrSigner(operator.address, operator.enr_signature, operator.enr, types_js_1.FORK_MAPPING[clusterDefinition.fork_version]);
168
168
  if (!isPUTConfigHashSignerValid || !isENRSignerValid) {
169
169
  return false;
170
170
  }
171
- return true;
172
- }));
171
+ }
172
+ return true;
173
173
  }
174
174
  });
175
175
  // cluster-lock data verification
@@ -43,6 +43,7 @@ const node_1 = require("msw/node");
43
43
  const termsAndConditions_1 = require("../src/verification/termsAndConditions");
44
44
  const utils = __importStar(require("../src/utils"));
45
45
  const splitsHelpers = __importStar(require("../src/splitHelpers"));
46
+ jest.setTimeout(20000);
46
47
  /* eslint no-new: 0 */
47
48
  describe('Cluster Client', () => {
48
49
  var _a, _b;
@@ -161,6 +162,9 @@ describe('Cluster Client without a signer', () => {
161
162
  baseUrl: 'https://obol-api-dev.gcp.obol.tech',
162
163
  chainId: 17000,
163
164
  });
165
+ beforeAll(() => {
166
+ jest.restoreAllMocks();
167
+ });
164
168
  test('createClusterDefinition should throw an error without signer', () => __awaiter(void 0, void 0, void 0, function* () {
165
169
  try {
166
170
  yield clientInstance.createClusterDefinition(fixtures_js_1.clusterConfigV1X8);
@@ -224,37 +228,40 @@ describe('Cluster Client without a signer', () => {
224
228
  }));
225
229
  });
226
230
  describe('createObolRewardsSplit', () => {
227
- var _a, _b;
228
- jest
229
- .spyOn(utils, 'isContractAvailable')
230
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
231
- jest
232
- .spyOn(splitsHelpers, 'predictSplitterAddress')
233
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
234
- jest.spyOn(splitsHelpers, 'handleDeployOWRAndSplitter').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
235
- return yield Promise.resolve({
236
- withdrawal_address: '0xWithdrawalAddress',
237
- fee_recipient_address: '0xFeeRecipientAddress',
231
+ let clientInstance, clientInstanceWithourSigner, mockSplitRecipients, mockPrincipalRecipient, mockEtherAmount, mockSigner;
232
+ beforeAll(() => {
233
+ var _a, _b;
234
+ jest
235
+ .spyOn(utils, 'isContractAvailable')
236
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
237
+ jest
238
+ .spyOn(splitsHelpers, 'predictSplitterAddress')
239
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
240
+ jest.spyOn(splitsHelpers, 'handleDeployOWRAndSplitter').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
241
+ return yield Promise.resolve({
242
+ withdrawal_address: '0xWithdrawalAddress',
243
+ fee_recipient_address: '0xFeeRecipientAddress',
244
+ });
245
+ }));
246
+ const mnemonic = (_b = (_a = ethers_1.ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
247
+ const privateKey = ethers_1.ethers.Wallet.fromPhrase(mnemonic).privateKey;
248
+ const provider = new ethers_1.JsonRpcProvider('https://ethereum-holesky.publicnode.com');
249
+ const wallet = new ethers_1.ethers.Wallet(privateKey, provider);
250
+ mockSigner = wallet.connect(provider);
251
+ clientInstance = new index_1.Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
252
+ clientInstanceWithourSigner = new index_1.Client({
253
+ baseUrl: 'https://obol-api-dev.gcp.obol.tech',
254
+ chainId: 17000,
238
255
  });
239
- }));
240
- const mnemonic = (_b = (_a = ethers_1.ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
241
- const privateKey = ethers_1.ethers.Wallet.fromPhrase(mnemonic).privateKey;
242
- const provider = new ethers_1.JsonRpcProvider('https://ethereum-holesky.publicnode.com');
243
- const wallet = new ethers_1.ethers.Wallet(privateKey, provider);
244
- const mockSigner = wallet.connect(provider);
245
- const clientInstance = new index_1.Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
246
- const clientInstanceWithourSigner = new index_1.Client({
247
- baseUrl: 'https://obol-api-dev.gcp.obol.tech',
248
- chainId: 17000,
256
+ mockSplitRecipients = [
257
+ {
258
+ account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
259
+ percentAllocation: 99,
260
+ },
261
+ ];
262
+ mockPrincipalRecipient = '0x86B8145c98e5BD25BA722645b15eD65f024a87EC';
263
+ mockEtherAmount = 64;
249
264
  });
250
- const mockSplitRecipients = [
251
- {
252
- account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
253
- percentAllocation: 99,
254
- },
255
- ];
256
- const mockPrincipalRecipient = '0x86B8145c98e5BD25BA722645b15eD65f024a87EC';
257
- const mockEtherAmount = 64;
258
265
  it('should throw an error if signer is not defined', () => __awaiter(void 0, void 0, void 0, function* () {
259
266
  yield expect(clientInstanceWithourSigner.createObolRewardsSplit({
260
267
  splitRecipients: mockSplitRecipients,
@@ -318,32 +325,35 @@ describe('createObolRewardsSplit', () => {
318
325
  }));
319
326
  });
320
327
  describe('createObolTotalSplit', () => {
321
- var _a, _b;
322
- jest
323
- .spyOn(utils, 'isContractAvailable')
324
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
325
- jest
326
- .spyOn(splitsHelpers, 'predictSplitterAddress')
327
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
328
- jest
329
- .spyOn(splitsHelpers, 'deploySplitterContract')
330
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xSplitterAddress'); }));
331
- const mnemonic = (_b = (_a = ethers_1.ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
332
- const privateKey = ethers_1.ethers.Wallet.fromPhrase(mnemonic).privateKey;
333
- const provider = new ethers_1.JsonRpcProvider('https://ethereum-holesky.publicnode.com');
334
- const wallet = new ethers_1.ethers.Wallet(privateKey, provider);
335
- const mockSigner = wallet.connect(provider);
336
- const clientInstance = new index_1.Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
337
- const clientInstanceWithourSigner = new index_1.Client({
338
- baseUrl: 'https://obol-api-dev.gcp.obol.tech',
339
- chainId: 17000,
328
+ let clientInstanceWithourSigner, mockSplitRecipients, mockSigner, clientInstance;
329
+ beforeAll(() => {
330
+ var _a, _b;
331
+ jest
332
+ .spyOn(utils, 'isContractAvailable')
333
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
334
+ jest
335
+ .spyOn(splitsHelpers, 'predictSplitterAddress')
336
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
337
+ jest
338
+ .spyOn(splitsHelpers, 'deploySplitterContract')
339
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xSplitterAddress'); }));
340
+ const mnemonic = (_b = (_a = ethers_1.ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
341
+ const privateKey = ethers_1.ethers.Wallet.fromPhrase(mnemonic).privateKey;
342
+ const provider = new ethers_1.JsonRpcProvider('https://ethereum-holesky.publicnode.com');
343
+ const wallet = new ethers_1.ethers.Wallet(privateKey, provider);
344
+ mockSigner = wallet.connect(provider);
345
+ clientInstance = new index_1.Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
346
+ clientInstanceWithourSigner = new index_1.Client({
347
+ baseUrl: 'https://obol-api-dev.gcp.obol.tech',
348
+ chainId: 17000,
349
+ });
350
+ mockSplitRecipients = [
351
+ {
352
+ account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
353
+ percentAllocation: 99.9,
354
+ },
355
+ ];
340
356
  });
341
- const mockSplitRecipients = [
342
- {
343
- account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
344
- percentAllocation: 99.9,
345
- },
346
- ];
347
357
  it('should throw an error if signer is not defined', () => __awaiter(void 0, void 0, void 0, function* () {
348
358
  yield expect(clientInstanceWithourSigner.createObolTotalSplit({
349
359
  splitRecipients: mockSplitRecipients,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A package for creating Distributed Validators using the Obol API.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/obolnetwork/obol-sdk/issues"
@@ -61,7 +61,7 @@ export const isContractAvailable = (contractAddress, provider, bytecode) => __aw
61
61
  });
62
62
  export const getProvider = (chainId) => {
63
63
  const rpcUrl = PROVIDER_MAP[chainId];
64
- if (!rpcUrl) {
64
+ if (!rpcUrl || rpcUrl === 'undefined') {
65
65
  throw new Error(`No provider configured for ${FORK_NAMES[chainId]}`);
66
66
  }
67
67
  return new ethers.JsonRpcProvider(rpcUrl);
@@ -131,14 +131,14 @@ const verifyDefinitionSignatures = (clusterDefinition, definitionType) => __awai
131
131
  if (definitionType === DefinitionFlow.Solo) {
132
132
  return true;
133
133
  }
134
- return clusterDefinition.operators.every((operator) => __awaiter(void 0, void 0, void 0, function* () {
134
+ for (const operator of clusterDefinition.operators) {
135
135
  const isPUTConfigHashSignerValid = yield validatePUTConfigHashSigner(operator.address, operator.config_signature, clusterDefinition.config_hash, FORK_MAPPING[clusterDefinition.fork_version]);
136
136
  const isENRSignerValid = yield validateEnrSigner(operator.address, operator.enr_signature, operator.enr, FORK_MAPPING[clusterDefinition.fork_version]);
137
137
  if (!isPUTConfigHashSignerValid || !isENRSignerValid) {
138
138
  return false;
139
139
  }
140
- return true;
141
- }));
140
+ }
141
+ return true;
142
142
  }
143
143
  });
144
144
  // cluster-lock data verification
@@ -18,6 +18,7 @@ import { setupServer } from 'msw/node';
18
18
  import { hashTermsAndConditions } from '../src/verification/termsAndConditions';
19
19
  import * as utils from '../src/utils';
20
20
  import * as splitsHelpers from '../src/splitHelpers';
21
+ jest.setTimeout(20000);
21
22
  /* eslint no-new: 0 */
22
23
  describe('Cluster Client', () => {
23
24
  var _a, _b;
@@ -136,6 +137,9 @@ describe('Cluster Client without a signer', () => {
136
137
  baseUrl: 'https://obol-api-dev.gcp.obol.tech',
137
138
  chainId: 17000,
138
139
  });
140
+ beforeAll(() => {
141
+ jest.restoreAllMocks();
142
+ });
139
143
  test('createClusterDefinition should throw an error without signer', () => __awaiter(void 0, void 0, void 0, function* () {
140
144
  try {
141
145
  yield clientInstance.createClusterDefinition(clusterConfigV1X8);
@@ -199,37 +203,40 @@ describe('Cluster Client without a signer', () => {
199
203
  }));
200
204
  });
201
205
  describe('createObolRewardsSplit', () => {
202
- var _a, _b;
203
- jest
204
- .spyOn(utils, 'isContractAvailable')
205
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
206
- jest
207
- .spyOn(splitsHelpers, 'predictSplitterAddress')
208
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
209
- jest.spyOn(splitsHelpers, 'handleDeployOWRAndSplitter').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
210
- return yield Promise.resolve({
211
- withdrawal_address: '0xWithdrawalAddress',
212
- fee_recipient_address: '0xFeeRecipientAddress',
206
+ let clientInstance, clientInstanceWithourSigner, mockSplitRecipients, mockPrincipalRecipient, mockEtherAmount, mockSigner;
207
+ beforeAll(() => {
208
+ var _a, _b;
209
+ jest
210
+ .spyOn(utils, 'isContractAvailable')
211
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
212
+ jest
213
+ .spyOn(splitsHelpers, 'predictSplitterAddress')
214
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
215
+ jest.spyOn(splitsHelpers, 'handleDeployOWRAndSplitter').mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
216
+ return yield Promise.resolve({
217
+ withdrawal_address: '0xWithdrawalAddress',
218
+ fee_recipient_address: '0xFeeRecipientAddress',
219
+ });
220
+ }));
221
+ const mnemonic = (_b = (_a = ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
222
+ const privateKey = ethers.Wallet.fromPhrase(mnemonic).privateKey;
223
+ const provider = new JsonRpcProvider('https://ethereum-holesky.publicnode.com');
224
+ const wallet = new ethers.Wallet(privateKey, provider);
225
+ mockSigner = wallet.connect(provider);
226
+ clientInstance = new Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
227
+ clientInstanceWithourSigner = new Client({
228
+ baseUrl: 'https://obol-api-dev.gcp.obol.tech',
229
+ chainId: 17000,
213
230
  });
214
- }));
215
- const mnemonic = (_b = (_a = ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
216
- const privateKey = ethers.Wallet.fromPhrase(mnemonic).privateKey;
217
- const provider = new JsonRpcProvider('https://ethereum-holesky.publicnode.com');
218
- const wallet = new ethers.Wallet(privateKey, provider);
219
- const mockSigner = wallet.connect(provider);
220
- const clientInstance = new Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
221
- const clientInstanceWithourSigner = new Client({
222
- baseUrl: 'https://obol-api-dev.gcp.obol.tech',
223
- chainId: 17000,
231
+ mockSplitRecipients = [
232
+ {
233
+ account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
234
+ percentAllocation: 99,
235
+ },
236
+ ];
237
+ mockPrincipalRecipient = '0x86B8145c98e5BD25BA722645b15eD65f024a87EC';
238
+ mockEtherAmount = 64;
224
239
  });
225
- const mockSplitRecipients = [
226
- {
227
- account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
228
- percentAllocation: 99,
229
- },
230
- ];
231
- const mockPrincipalRecipient = '0x86B8145c98e5BD25BA722645b15eD65f024a87EC';
232
- const mockEtherAmount = 64;
233
240
  it('should throw an error if signer is not defined', () => __awaiter(void 0, void 0, void 0, function* () {
234
241
  yield expect(clientInstanceWithourSigner.createObolRewardsSplit({
235
242
  splitRecipients: mockSplitRecipients,
@@ -293,32 +300,35 @@ describe('createObolRewardsSplit', () => {
293
300
  }));
294
301
  });
295
302
  describe('createObolTotalSplit', () => {
296
- var _a, _b;
297
- jest
298
- .spyOn(utils, 'isContractAvailable')
299
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
300
- jest
301
- .spyOn(splitsHelpers, 'predictSplitterAddress')
302
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
303
- jest
304
- .spyOn(splitsHelpers, 'deploySplitterContract')
305
- .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xSplitterAddress'); }));
306
- const mnemonic = (_b = (_a = ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
307
- const privateKey = ethers.Wallet.fromPhrase(mnemonic).privateKey;
308
- const provider = new JsonRpcProvider('https://ethereum-holesky.publicnode.com');
309
- const wallet = new ethers.Wallet(privateKey, provider);
310
- const mockSigner = wallet.connect(provider);
311
- const clientInstance = new Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
312
- const clientInstanceWithourSigner = new Client({
313
- baseUrl: 'https://obol-api-dev.gcp.obol.tech',
314
- chainId: 17000,
303
+ let clientInstanceWithourSigner, mockSplitRecipients, mockSigner, clientInstance;
304
+ beforeAll(() => {
305
+ var _a, _b;
306
+ jest
307
+ .spyOn(utils, 'isContractAvailable')
308
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve(true); }));
309
+ jest
310
+ .spyOn(splitsHelpers, 'predictSplitterAddress')
311
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xPredictedAddress'); }));
312
+ jest
313
+ .spyOn(splitsHelpers, 'deploySplitterContract')
314
+ .mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () { return yield Promise.resolve('0xSplitterAddress'); }));
315
+ const mnemonic = (_b = (_a = ethers.Wallet.createRandom().mnemonic) === null || _a === void 0 ? void 0 : _a.phrase) !== null && _b !== void 0 ? _b : '';
316
+ const privateKey = ethers.Wallet.fromPhrase(mnemonic).privateKey;
317
+ const provider = new JsonRpcProvider('https://ethereum-holesky.publicnode.com');
318
+ const wallet = new ethers.Wallet(privateKey, provider);
319
+ mockSigner = wallet.connect(provider);
320
+ clientInstance = new Client({ baseUrl: 'https://obol-api-dev.gcp.obol.tech', chainId: 17000 }, mockSigner);
321
+ clientInstanceWithourSigner = new Client({
322
+ baseUrl: 'https://obol-api-dev.gcp.obol.tech',
323
+ chainId: 17000,
324
+ });
325
+ mockSplitRecipients = [
326
+ {
327
+ account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
328
+ percentAllocation: 99.9,
329
+ },
330
+ ];
315
331
  });
316
- const mockSplitRecipients = [
317
- {
318
- account: '0x86B8145c98e5BD25BA722645b15eD65f024a87EC',
319
- percentAllocation: 99.9,
320
- },
321
- ];
322
332
  it('should throw an error if signer is not defined', () => __awaiter(void 0, void 0, void 0, function* () {
323
333
  yield expect(clientInstanceWithourSigner.createObolTotalSplit({
324
334
  splitRecipients: mockSplitRecipients,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A package for creating Distributed Validators using the Obol API.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/obolnetwork/obol-sdk/issues"
package/src/utils.ts CHANGED
@@ -78,7 +78,7 @@ export const isContractAvailable = async (
78
78
 
79
79
  export const getProvider = (chainId: number): ethers.Provider => {
80
80
  const rpcUrl = PROVIDER_MAP[chainId];
81
- if (!rpcUrl) {
81
+ if (!rpcUrl || rpcUrl === 'undefined') {
82
82
  throw new Error(`No provider configured for ${FORK_NAMES[chainId]}`);
83
83
  }
84
84
  return new ethers.JsonRpcProvider(rpcUrl);
@@ -216,7 +216,8 @@ const verifyDefinitionSignatures = async (
216
216
  if (definitionType === DefinitionFlow.Solo) {
217
217
  return true;
218
218
  }
219
- return clusterDefinition.operators.every(async operator => {
219
+
220
+ for (const operator of clusterDefinition.operators) {
220
221
  const isPUTConfigHashSignerValid = await validatePUTConfigHashSigner(
221
222
  operator.address,
222
223
  operator.config_signature as string,
@@ -238,8 +239,9 @@ const verifyDefinitionSignatures = async (
238
239
  if (!isPUTConfigHashSignerValid || !isENRSignerValid) {
239
240
  return false;
240
241
  }
241
- return true;
242
- });
242
+ }
243
+
244
+ return true;
243
245
  }
244
246
  };
245
247