@ssv-labs/ssv-sdk 0.0.4 → 0.0.5

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/main.js CHANGED
@@ -1,170 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const config$2 = require("./config-DPI30L0i.js");
3
+ const globals = require("./globals-fh7gkHKO.js");
4
4
  const viem = require("viem");
5
5
  const ssvKeys$2 = require("ssv-keys");
6
- function getDefaultExportFromCjs$1(x) {
7
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
8
- }
9
- var browser$e = { exports: {} };
10
- var process = browser$e.exports = {};
11
- var cachedSetTimeout;
12
- var cachedClearTimeout;
13
- function defaultSetTimout() {
14
- throw new Error("setTimeout has not been defined");
15
- }
16
- function defaultClearTimeout() {
17
- throw new Error("clearTimeout has not been defined");
18
- }
19
- (function() {
20
- try {
21
- if (typeof setTimeout === "function") {
22
- cachedSetTimeout = setTimeout;
23
- } else {
24
- cachedSetTimeout = defaultSetTimout;
25
- }
26
- } catch (e) {
27
- cachedSetTimeout = defaultSetTimout;
28
- }
29
- try {
30
- if (typeof clearTimeout === "function") {
31
- cachedClearTimeout = clearTimeout;
32
- } else {
33
- cachedClearTimeout = defaultClearTimeout;
34
- }
35
- } catch (e) {
36
- cachedClearTimeout = defaultClearTimeout;
37
- }
38
- })();
39
- function runTimeout(fun) {
40
- if (cachedSetTimeout === setTimeout) {
41
- return setTimeout(fun, 0);
42
- }
43
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
44
- cachedSetTimeout = setTimeout;
45
- return setTimeout(fun, 0);
46
- }
47
- try {
48
- return cachedSetTimeout(fun, 0);
49
- } catch (e) {
50
- try {
51
- return cachedSetTimeout.call(null, fun, 0);
52
- } catch (e2) {
53
- return cachedSetTimeout.call(this, fun, 0);
54
- }
55
- }
56
- }
57
- function runClearTimeout(marker) {
58
- if (cachedClearTimeout === clearTimeout) {
59
- return clearTimeout(marker);
60
- }
61
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
62
- cachedClearTimeout = clearTimeout;
63
- return clearTimeout(marker);
64
- }
65
- try {
66
- return cachedClearTimeout(marker);
67
- } catch (e) {
68
- try {
69
- return cachedClearTimeout.call(null, marker);
70
- } catch (e2) {
71
- return cachedClearTimeout.call(this, marker);
72
- }
73
- }
74
- }
75
- var queue = [];
76
- var draining = false;
77
- var currentQueue;
78
- var queueIndex = -1;
79
- function cleanUpNextTick() {
80
- if (!draining || !currentQueue) {
81
- return;
82
- }
83
- draining = false;
84
- if (currentQueue.length) {
85
- queue = currentQueue.concat(queue);
86
- } else {
87
- queueIndex = -1;
88
- }
89
- if (queue.length) {
90
- drainQueue();
91
- }
92
- }
93
- function drainQueue() {
94
- if (draining) {
95
- return;
96
- }
97
- var timeout = runTimeout(cleanUpNextTick);
98
- draining = true;
99
- var len = queue.length;
100
- while (len) {
101
- currentQueue = queue;
102
- queue = [];
103
- while (++queueIndex < len) {
104
- if (currentQueue) {
105
- currentQueue[queueIndex].run();
106
- }
107
- }
108
- queueIndex = -1;
109
- len = queue.length;
110
- }
111
- currentQueue = null;
112
- draining = false;
113
- runClearTimeout(timeout);
114
- }
115
- process.nextTick = function(fun) {
116
- var args = new Array(arguments.length - 1);
117
- if (arguments.length > 1) {
118
- for (var i = 1; i < arguments.length; i++) {
119
- args[i - 1] = arguments[i];
120
- }
121
- }
122
- queue.push(new Item(fun, args));
123
- if (queue.length === 1 && !draining) {
124
- runTimeout(drainQueue);
125
- }
126
- };
127
- function Item(fun, array) {
128
- this.fun = fun;
129
- this.array = array;
130
- }
131
- Item.prototype.run = function() {
132
- this.fun.apply(null, this.array);
133
- };
134
- process.title = "browser";
135
- process.browser = true;
136
- process.env = {};
137
- process.argv = [];
138
- process.version = "";
139
- process.versions = {};
140
- function noop$2() {
141
- }
142
- process.on = noop$2;
143
- process.addListener = noop$2;
144
- process.once = noop$2;
145
- process.off = noop$2;
146
- process.removeListener = noop$2;
147
- process.removeAllListeners = noop$2;
148
- process.emit = noop$2;
149
- process.prependListener = noop$2;
150
- process.prependOnceListener = noop$2;
151
- process.listeners = function(name2) {
152
- return [];
153
- };
154
- process.binding = function(name2) {
155
- throw new Error("process.binding is not supported");
156
- };
157
- process.cwd = function() {
158
- return "/";
159
- };
160
- process.chdir = function(dir) {
161
- throw new Error("process.chdir is not supported");
162
- };
163
- process.umask = function() {
164
- return 0;
165
- };
166
- var browserExports$1 = browser$e.exports;
167
- const process$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(browserExports$1);
168
6
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
169
7
  function getDefaultExportFromCjs(x) {
170
8
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -2052,7 +1890,7 @@ var posix = {
2052
1890
  path3 = arguments[i];
2053
1891
  else {
2054
1892
  if (cwd === void 0)
2055
- cwd = process$1.cwd();
1893
+ cwd = globals.process$1.cwd();
2056
1894
  path3 = cwd;
2057
1895
  }
2058
1896
  assertPath(path3);
@@ -2494,7 +2332,7 @@ function randomBytes$2(size, cb) {
2494
2332
  }
2495
2333
  }
2496
2334
  if (typeof cb === "function") {
2497
- return process$1.nextTick(function() {
2335
+ return globals.process$1.nextTick(function() {
2498
2336
  cb(null, bytes);
2499
2337
  });
2500
2338
  }
@@ -4150,10 +3988,10 @@ var isBufferBrowser = function isBuffer(arg) {
4150
3988
  return str;
4151
3989
  };
4152
3990
  exports2.deprecate = function(fn, msg) {
4153
- if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) {
3991
+ if (typeof globals.process$1 !== "undefined" && globals.process$1.noDeprecation === true) {
4154
3992
  return fn;
4155
3993
  }
4156
- if (typeof process$1 === "undefined") {
3994
+ if (typeof globals.process$1 === "undefined") {
4157
3995
  return function() {
4158
3996
  return exports2.deprecate(fn, msg).apply(this, arguments);
4159
3997
  };
@@ -4161,9 +3999,9 @@ var isBufferBrowser = function isBuffer(arg) {
4161
3999
  var warned = false;
4162
4000
  function deprecated() {
4163
4001
  if (!warned) {
4164
- if (process$1.throwDeprecation) {
4002
+ if (globals.process$1.throwDeprecation) {
4165
4003
  throw new Error(msg);
4166
- } else if (process$1.traceDeprecation) {
4004
+ } else if (globals.process$1.traceDeprecation) {
4167
4005
  console.trace(msg);
4168
4006
  } else {
4169
4007
  console.error(msg);
@@ -4176,8 +4014,8 @@ var isBufferBrowser = function isBuffer(arg) {
4176
4014
  };
4177
4015
  var debugs = {};
4178
4016
  var debugEnvRegex = /^$/;
4179
- if (process$1.env.NODE_DEBUG) {
4180
- var debugEnv = process$1.env.NODE_DEBUG;
4017
+ if (globals.process$1.env.NODE_DEBUG) {
4018
+ var debugEnv = globals.process$1.env.NODE_DEBUG;
4181
4019
  debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
4182
4020
  debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
4183
4021
  }
@@ -4185,7 +4023,7 @@ var isBufferBrowser = function isBuffer(arg) {
4185
4023
  set = set.toUpperCase();
4186
4024
  if (!debugs[set]) {
4187
4025
  if (debugEnvRegex.test(set)) {
4188
- var pid = process$1.pid;
4026
+ var pid = globals.process$1.pid;
4189
4027
  debugs[set] = function() {
4190
4028
  var msg = exports2.format.apply(exports2, arguments);
4191
4029
  console.error("%s %d: %s", set, pid, msg);
@@ -4637,10 +4475,10 @@ var isBufferBrowser = function isBuffer(arg) {
4637
4475
  };
4638
4476
  original.apply(this, args).then(
4639
4477
  function(ret) {
4640
- process$1.nextTick(cb.bind(null, null, ret));
4478
+ globals.process$1.nextTick(cb.bind(null, null, ret));
4641
4479
  },
4642
4480
  function(rej) {
4643
- process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb));
4481
+ globals.process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb));
4644
4482
  }
4645
4483
  );
4646
4484
  }
@@ -4901,10 +4739,10 @@ function destroy$1(err, cb) {
4901
4739
  cb(err);
4902
4740
  } else if (err) {
4903
4741
  if (!this._writableState) {
4904
- process$1.nextTick(emitErrorNT$1, this, err);
4742
+ globals.process$1.nextTick(emitErrorNT$1, this, err);
4905
4743
  } else if (!this._writableState.errorEmitted) {
4906
4744
  this._writableState.errorEmitted = true;
4907
- process$1.nextTick(emitErrorNT$1, this, err);
4745
+ globals.process$1.nextTick(emitErrorNT$1, this, err);
4908
4746
  }
4909
4747
  }
4910
4748
  return this;
@@ -4918,18 +4756,18 @@ function destroy$1(err, cb) {
4918
4756
  this._destroy(err || null, function(err2) {
4919
4757
  if (!cb && err2) {
4920
4758
  if (!_this._writableState) {
4921
- process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4759
+ globals.process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4922
4760
  } else if (!_this._writableState.errorEmitted) {
4923
4761
  _this._writableState.errorEmitted = true;
4924
- process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4762
+ globals.process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4925
4763
  } else {
4926
- process$1.nextTick(emitCloseNT, _this);
4764
+ globals.process$1.nextTick(emitCloseNT, _this);
4927
4765
  }
4928
4766
  } else if (cb) {
4929
- process$1.nextTick(emitCloseNT, _this);
4767
+ globals.process$1.nextTick(emitCloseNT, _this);
4930
4768
  cb(err2);
4931
4769
  } else {
4932
- process$1.nextTick(emitCloseNT, _this);
4770
+ globals.process$1.nextTick(emitCloseNT, _this);
4933
4771
  }
4934
4772
  });
4935
4773
  return this;
@@ -5252,7 +5090,7 @@ function require_stream_writable$1() {
5252
5090
  function writeAfterEnd(stream, cb) {
5253
5091
  var er = new ERR_STREAM_WRITE_AFTER_END();
5254
5092
  errorOrDestroy2(stream, er);
5255
- process$1.nextTick(cb, er);
5093
+ globals.process$1.nextTick(cb, er);
5256
5094
  }
5257
5095
  function validChunk(stream, state2, chunk, cb) {
5258
5096
  var er;
@@ -5263,7 +5101,7 @@ function require_stream_writable$1() {
5263
5101
  }
5264
5102
  if (er) {
5265
5103
  errorOrDestroy2(stream, er);
5266
- process$1.nextTick(cb, er);
5104
+ globals.process$1.nextTick(cb, er);
5267
5105
  return false;
5268
5106
  }
5269
5107
  return true;
@@ -5375,8 +5213,8 @@ function require_stream_writable$1() {
5375
5213
  function onwriteError(stream, state2, sync2, er, cb) {
5376
5214
  --state2.pendingcb;
5377
5215
  if (sync2) {
5378
- process$1.nextTick(cb, er);
5379
- process$1.nextTick(finishMaybe, stream, state2);
5216
+ globals.process$1.nextTick(cb, er);
5217
+ globals.process$1.nextTick(finishMaybe, stream, state2);
5380
5218
  stream._writableState.errorEmitted = true;
5381
5219
  errorOrDestroy2(stream, er);
5382
5220
  } else {
@@ -5405,7 +5243,7 @@ function require_stream_writable$1() {
5405
5243
  clearBuffer(stream, state2);
5406
5244
  }
5407
5245
  if (sync2) {
5408
- process$1.nextTick(afterWrite, stream, state2, finished, cb);
5246
+ globals.process$1.nextTick(afterWrite, stream, state2, finished, cb);
5409
5247
  } else {
5410
5248
  afterWrite(stream, state2, finished, cb);
5411
5249
  }
@@ -5518,7 +5356,7 @@ function require_stream_writable$1() {
5518
5356
  if (typeof stream._final === "function" && !state2.destroyed) {
5519
5357
  state2.pendingcb++;
5520
5358
  state2.finalCalled = true;
5521
- process$1.nextTick(callFinal, stream, state2);
5359
+ globals.process$1.nextTick(callFinal, stream, state2);
5522
5360
  } else {
5523
5361
  state2.prefinished = true;
5524
5362
  stream.emit("prefinish");
@@ -5546,7 +5384,7 @@ function require_stream_writable$1() {
5546
5384
  state2.ending = true;
5547
5385
  finishMaybe(stream, state2);
5548
5386
  if (cb) {
5549
- if (state2.finished) process$1.nextTick(cb);
5387
+ if (state2.finished) globals.process$1.nextTick(cb);
5550
5388
  else stream.once("finish", cb);
5551
5389
  }
5552
5390
  state2.ended = true;
@@ -5652,7 +5490,7 @@ function require_stream_duplex$1() {
5652
5490
  });
5653
5491
  function onend() {
5654
5492
  if (this._writableState.ended) return;
5655
- process$1.nextTick(onEndNT, this);
5493
+ globals.process$1.nextTick(onEndNT, this);
5656
5494
  }
5657
5495
  function onEndNT(self2) {
5658
5496
  self2.end();
@@ -6048,7 +5886,7 @@ function requireAsync_iterator() {
6048
5886
  }
6049
5887
  }
6050
5888
  function onReadable(iter) {
6051
- process$1.nextTick(readAndResolve, iter);
5889
+ globals.process$1.nextTick(readAndResolve, iter);
6052
5890
  }
6053
5891
  function wrapForNext(lastPromise, iter) {
6054
5892
  return function(resolve2, reject) {
@@ -6078,7 +5916,7 @@ function requireAsync_iterator() {
6078
5916
  }
6079
5917
  if (this[kStream].destroyed) {
6080
5918
  return new Promise(function(resolve2, reject) {
6081
- process$1.nextTick(function() {
5919
+ globals.process$1.nextTick(function() {
6082
5920
  if (_this[kError]) {
6083
5921
  reject(_this[kError]);
6084
5922
  } else {
@@ -6508,7 +6346,7 @@ function require_stream_readable$1() {
6508
6346
  if (!state2.emittedReadable) {
6509
6347
  debug("emitReadable", state2.flowing);
6510
6348
  state2.emittedReadable = true;
6511
- process$1.nextTick(emitReadable_, stream);
6349
+ globals.process$1.nextTick(emitReadable_, stream);
6512
6350
  }
6513
6351
  }
6514
6352
  function emitReadable_(stream) {
@@ -6524,7 +6362,7 @@ function require_stream_readable$1() {
6524
6362
  function maybeReadMore(stream, state2) {
6525
6363
  if (!state2.readingMore) {
6526
6364
  state2.readingMore = true;
6527
- process$1.nextTick(maybeReadMore_, stream, state2);
6365
+ globals.process$1.nextTick(maybeReadMore_, stream, state2);
6528
6366
  }
6529
6367
  }
6530
6368
  function maybeReadMore_(stream, state2) {
@@ -6556,9 +6394,9 @@ function require_stream_readable$1() {
6556
6394
  }
6557
6395
  state2.pipesCount += 1;
6558
6396
  debug("pipe count=%d opts=%j", state2.pipesCount, pipeOpts);
6559
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr;
6397
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== globals.process$1.stdout && dest !== globals.process$1.stderr;
6560
6398
  var endFn = doEnd ? onend : unpipe;
6561
- if (state2.endEmitted) process$1.nextTick(endFn);
6399
+ if (state2.endEmitted) globals.process$1.nextTick(endFn);
6562
6400
  else src.once("end", endFn);
6563
6401
  dest.on("unpipe", onunpipe);
6564
6402
  function onunpipe(readable, unpipeInfo) {
@@ -6692,7 +6530,7 @@ function require_stream_readable$1() {
6692
6530
  if (state2.length) {
6693
6531
  emitReadable(this);
6694
6532
  } else if (!state2.reading) {
6695
- process$1.nextTick(nReadingNextTick, this);
6533
+ globals.process$1.nextTick(nReadingNextTick, this);
6696
6534
  }
6697
6535
  }
6698
6536
  }
@@ -6702,14 +6540,14 @@ function require_stream_readable$1() {
6702
6540
  Readable.prototype.removeListener = function(ev, fn) {
6703
6541
  var res = Stream2.prototype.removeListener.call(this, ev, fn);
6704
6542
  if (ev === "readable") {
6705
- process$1.nextTick(updateReadableListening, this);
6543
+ globals.process$1.nextTick(updateReadableListening, this);
6706
6544
  }
6707
6545
  return res;
6708
6546
  };
6709
6547
  Readable.prototype.removeAllListeners = function(ev) {
6710
6548
  var res = Stream2.prototype.removeAllListeners.apply(this, arguments);
6711
6549
  if (ev === "readable" || ev === void 0) {
6712
- process$1.nextTick(updateReadableListening, this);
6550
+ globals.process$1.nextTick(updateReadableListening, this);
6713
6551
  }
6714
6552
  return res;
6715
6553
  };
@@ -6739,7 +6577,7 @@ function require_stream_readable$1() {
6739
6577
  function resume(stream, state2) {
6740
6578
  if (!state2.resumeScheduled) {
6741
6579
  state2.resumeScheduled = true;
6742
- process$1.nextTick(resume_, stream, state2);
6580
+ globals.process$1.nextTick(resume_, stream, state2);
6743
6581
  }
6744
6582
  }
6745
6583
  function resume_(stream, state2) {
@@ -6880,7 +6718,7 @@ function require_stream_readable$1() {
6880
6718
  debug("endReadable", state2.endEmitted);
6881
6719
  if (!state2.endEmitted) {
6882
6720
  state2.ended = true;
6883
- process$1.nextTick(endReadableNT, state2, stream);
6721
+ globals.process$1.nextTick(endReadableNT, state2, stream);
6884
6722
  }
6885
6723
  }
6886
6724
  function endReadableNT(state2, stream) {
@@ -8952,7 +8790,7 @@ var defaultEncoding$2;
8952
8790
  if (commonjsGlobal.process && commonjsGlobal.process.browser) {
8953
8791
  defaultEncoding$2 = "utf-8";
8954
8792
  } else if (commonjsGlobal.process && commonjsGlobal.process.version) {
8955
- var pVersionMajor = parseInt(process$1.version.split(".")[0].slice(1), 10);
8793
+ var pVersionMajor = parseInt(globals.process$1.version.split(".")[0].slice(1), 10);
8956
8794
  defaultEncoding$2 = pVersionMajor >= 6 ? "utf-8" : "binary";
8957
8795
  } else {
8958
8796
  defaultEncoding$2 = "utf-8";
@@ -14649,10 +14487,10 @@ function requireBrowser$2() {
14649
14487
  }
14650
14488
  var readableBrowser = { exports: {} };
14651
14489
  var processNextickArgs = { exports: {} };
14652
- if (typeof process$1 === "undefined" || !process$1.version || process$1.version.indexOf("v0.") === 0 || process$1.version.indexOf("v1.") === 0 && process$1.version.indexOf("v1.8.") !== 0) {
14490
+ if (typeof globals.process$1 === "undefined" || !globals.process$1.version || globals.process$1.version.indexOf("v0.") === 0 || globals.process$1.version.indexOf("v1.") === 0 && globals.process$1.version.indexOf("v1.8.") !== 0) {
14653
14491
  processNextickArgs.exports = { nextTick };
14654
14492
  } else {
14655
- processNextickArgs.exports = process$1;
14493
+ processNextickArgs.exports = globals.process$1;
14656
14494
  }
14657
14495
  function nextTick(fn, arg1, arg2, arg3) {
14658
14496
  if (typeof fn !== "function") {
@@ -14663,17 +14501,17 @@ function nextTick(fn, arg1, arg2, arg3) {
14663
14501
  switch (len) {
14664
14502
  case 0:
14665
14503
  case 1:
14666
- return process$1.nextTick(fn);
14504
+ return globals.process$1.nextTick(fn);
14667
14505
  case 2:
14668
- return process$1.nextTick(function afterTickOne() {
14506
+ return globals.process$1.nextTick(function afterTickOne() {
14669
14507
  fn.call(null, arg1);
14670
14508
  });
14671
14509
  case 3:
14672
- return process$1.nextTick(function afterTickTwo() {
14510
+ return globals.process$1.nextTick(function afterTickTwo() {
14673
14511
  fn.call(null, arg1, arg2);
14674
14512
  });
14675
14513
  case 4:
14676
- return process$1.nextTick(function afterTickThree() {
14514
+ return globals.process$1.nextTick(function afterTickThree() {
14677
14515
  fn.call(null, arg1, arg2, arg3);
14678
14516
  });
14679
14517
  default:
@@ -14682,7 +14520,7 @@ function nextTick(fn, arg1, arg2, arg3) {
14682
14520
  while (i < args.length) {
14683
14521
  args[i++] = arguments[i];
14684
14522
  }
14685
- return process$1.nextTick(function afterTick() {
14523
+ return globals.process$1.nextTick(function afterTick() {
14686
14524
  fn.apply(null, args);
14687
14525
  });
14688
14526
  }
@@ -14970,7 +14808,7 @@ function require_stream_writable() {
14970
14808
  onCorkedFinish(_this, state2);
14971
14809
  };
14972
14810
  }
14973
- var asyncWrite = !process$1.browser && ["v0.10", "v0.9."].indexOf(process$1.version.slice(0, 5)) > -1 ? setImmediate : pna2.nextTick;
14811
+ var asyncWrite = !globals.process$1.browser && ["v0.10", "v0.9."].indexOf(globals.process$1.version.slice(0, 5)) > -1 ? setImmediate : pna2.nextTick;
14974
14812
  var Duplex2;
14975
14813
  Writable.WritableState = WritableState;
14976
14814
  var util2 = Object.create(util$2);
@@ -15813,7 +15651,7 @@ function require_stream_readable() {
15813
15651
  }
15814
15652
  state2.pipesCount += 1;
15815
15653
  debug("pipe count=%d opts=%j", state2.pipesCount, pipeOpts);
15816
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr;
15654
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== globals.process$1.stdout && dest !== globals.process$1.stderr;
15817
15655
  var endFn = doEnd ? onend : unpipe;
15818
15656
  if (state2.endEmitted) pna2.nextTick(endFn);
15819
15657
  else src.once("end", endFn);
@@ -26593,7 +26431,7 @@ function assertSize(size, offset, length) {
26593
26431
  throw new RangeError("buffer too small");
26594
26432
  }
26595
26433
  }
26596
- if (crypto$1 && crypto$1.getRandomValues || !process$1.browser) {
26434
+ if (crypto$1 && crypto$1.getRandomValues || !globals.process$1.browser) {
26597
26435
  browser$1.randomFill = randomFill;
26598
26436
  browser$1.randomFillSync = randomFillSync;
26599
26437
  } else {
@@ -26619,12 +26457,12 @@ function randomFill(buf, offset, size, cb) {
26619
26457
  return actualFill(buf, offset, size, cb);
26620
26458
  }
26621
26459
  function actualFill(buf, offset, size, cb) {
26622
- if (process$1.browser) {
26460
+ if (globals.process$1.browser) {
26623
26461
  var ourBuf = buf.buffer;
26624
26462
  var uint = new Uint8Array(ourBuf, offset, size);
26625
26463
  crypto$1.getRandomValues(uint);
26626
26464
  if (cb) {
26627
- process$1.nextTick(function() {
26465
+ globals.process$1.nextTick(function() {
26628
26466
  cb(null, buf);
26629
26467
  });
26630
26468
  return;
@@ -26878,8 +26716,8 @@ function _dotenvKey(options2) {
26878
26716
  if (options2 && options2.DOTENV_KEY && options2.DOTENV_KEY.length > 0) {
26879
26717
  return options2.DOTENV_KEY;
26880
26718
  }
26881
- if (process$1.env.DOTENV_KEY && process$1.env.DOTENV_KEY.length > 0) {
26882
- return process$1.env.DOTENV_KEY;
26719
+ if (globals.process$1.env.DOTENV_KEY && globals.process$1.env.DOTENV_KEY.length > 0) {
26720
+ return globals.process$1.env.DOTENV_KEY;
26883
26721
  }
26884
26722
  return "";
26885
26723
  }
@@ -26929,7 +26767,7 @@ function _vaultPath(options2) {
26929
26767
  possibleVaultPath = options2.path.endsWith(".vault") ? options2.path : `${options2.path}.vault`;
26930
26768
  }
26931
26769
  } else {
26932
- possibleVaultPath = path.resolve(process$1.cwd(), ".env.vault");
26770
+ possibleVaultPath = path.resolve(globals.process$1.cwd(), ".env.vault");
26933
26771
  }
26934
26772
  if (fs.existsSync(possibleVaultPath)) {
26935
26773
  return possibleVaultPath;
@@ -26942,7 +26780,7 @@ function _resolveHome(envPath) {
26942
26780
  function _configVault(options2) {
26943
26781
  _log("Loading env from encrypted .env.vault");
26944
26782
  const parsed = DotenvModule._parseVault(options2);
26945
- let processEnv = process$1.env;
26783
+ let processEnv = globals.process$1.env;
26946
26784
  if (options2 && options2.processEnv != null) {
26947
26785
  processEnv = options2.processEnv;
26948
26786
  }
@@ -26950,7 +26788,7 @@ function _configVault(options2) {
26950
26788
  return { parsed };
26951
26789
  }
26952
26790
  function configDotenv(options2) {
26953
- const dotenvPath = path.resolve(process$1.cwd(), ".env");
26791
+ const dotenvPath = path.resolve(globals.process$1.cwd(), ".env");
26954
26792
  let encoding = "utf8";
26955
26793
  const debug = Boolean(options2 && options2.debug);
26956
26794
  if (options2 && options2.encoding) {
@@ -26984,7 +26822,7 @@ function configDotenv(options2) {
26984
26822
  lastError = e;
26985
26823
  }
26986
26824
  }
26987
- let processEnv = process$1.env;
26825
+ let processEnv = globals.process$1.env;
26988
26826
  if (options2 && options2.processEnv != null) {
26989
26827
  processEnv = options2.processEnv;
26990
26828
  }
@@ -27077,20 +26915,20 @@ main$2.exports.populate = DotenvModule.populate;
27077
26915
  main$2.exports = DotenvModule;
27078
26916
  var mainExports = main$2.exports;
27079
26917
  const options = {};
27080
- if (process$1.env.DOTENV_CONFIG_ENCODING != null) {
27081
- options.encoding = process$1.env.DOTENV_CONFIG_ENCODING;
26918
+ if (globals.process$1.env.DOTENV_CONFIG_ENCODING != null) {
26919
+ options.encoding = globals.process$1.env.DOTENV_CONFIG_ENCODING;
27082
26920
  }
27083
- if (process$1.env.DOTENV_CONFIG_PATH != null) {
27084
- options.path = process$1.env.DOTENV_CONFIG_PATH;
26921
+ if (globals.process$1.env.DOTENV_CONFIG_PATH != null) {
26922
+ options.path = globals.process$1.env.DOTENV_CONFIG_PATH;
27085
26923
  }
27086
- if (process$1.env.DOTENV_CONFIG_DEBUG != null) {
27087
- options.debug = process$1.env.DOTENV_CONFIG_DEBUG;
26924
+ if (globals.process$1.env.DOTENV_CONFIG_DEBUG != null) {
26925
+ options.debug = globals.process$1.env.DOTENV_CONFIG_DEBUG;
27088
26926
  }
27089
- if (process$1.env.DOTENV_CONFIG_OVERRIDE != null) {
27090
- options.override = process$1.env.DOTENV_CONFIG_OVERRIDE;
26927
+ if (globals.process$1.env.DOTENV_CONFIG_OVERRIDE != null) {
26928
+ options.override = globals.process$1.env.DOTENV_CONFIG_OVERRIDE;
27091
26929
  }
27092
- if (process$1.env.DOTENV_CONFIG_DOTENV_KEY != null) {
27093
- options.DOTENV_KEY = process$1.env.DOTENV_CONFIG_DOTENV_KEY;
26930
+ if (globals.process$1.env.DOTENV_CONFIG_DOTENV_KEY != null) {
26931
+ options.DOTENV_KEY = globals.process$1.env.DOTENV_CONFIG_DOTENV_KEY;
27094
26932
  }
27095
26933
  var envOptions = options;
27096
26934
  const re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
@@ -27108,7 +26946,7 @@ var cliOptions = function optionMatcher(args) {
27108
26946
  Object.assign(
27109
26947
  {},
27110
26948
  envOptions,
27111
- cliOptions(process$1.argv)
26949
+ cliOptions(globals.process$1.argv)
27112
26950
  )
27113
26951
  );
27114
26952
  })();
@@ -27133,14 +26971,14 @@ const getOperator = (client, args) => client.request(GetOperatorDocument, args).
27133
26971
  if (!res.operator) return null;
27134
26972
  return {
27135
26973
  ...res.operator,
27136
- publicKey: config$2.decodeOperatorPublicKey(res.operator.publicKey),
26974
+ publicKey: globals.decodeOperatorPublicKey(res.operator.publicKey),
27137
26975
  whitelisted: res.operator.whitelisted.map((v) => v.id)
27138
26976
  };
27139
26977
  });
27140
26978
  const getOperators = (client, args) => client.request(GetOperatorsDocument, args).then(
27141
26979
  (res) => res.operators.map((o) => ({
27142
26980
  ...o,
27143
- publicKey: config$2.decodeOperatorPublicKey(o.publicKey),
26981
+ publicKey: globals.decodeOperatorPublicKey(o.publicKey),
27144
26982
  whitelisted: o.whitelisted.map((v) => v.id)
27145
26983
  }))
27146
26984
  );
@@ -27158,124 +26996,6 @@ const getQueries = (client) => ({
27158
26996
  getValidator: getValidator.bind(null, client),
27159
26997
  getClusterBalance: getClusterBalance$1.bind(null, client)
27160
26998
  });
27161
- function defineChain(chain) {
27162
- return {
27163
- formatters: void 0,
27164
- fees: void 0,
27165
- serializers: void 0,
27166
- ...chain
27167
- };
27168
- }
27169
- const holesky = /* @__PURE__ */ defineChain({
27170
- id: 17e3,
27171
- name: "Holesky",
27172
- nativeCurrency: { name: "Holesky Ether", symbol: "ETH", decimals: 18 },
27173
- rpcUrls: {
27174
- default: {
27175
- http: ["https://ethereum-holesky-rpc.publicnode.com"]
27176
- }
27177
- },
27178
- blockExplorers: {
27179
- default: {
27180
- name: "Etherscan",
27181
- url: "https://holesky.etherscan.io",
27182
- apiUrl: "https://api-holesky.etherscan.io/api"
27183
- }
27184
- },
27185
- contracts: {
27186
- multicall3: {
27187
- address: "0xca11bde05977b3631167028862be2a173976ca11",
27188
- blockCreated: 77
27189
- },
27190
- ensRegistry: {
27191
- address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
27192
- blockCreated: 801613
27193
- },
27194
- ensUniversalResolver: {
27195
- address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",
27196
- blockCreated: 973484
27197
- }
27198
- },
27199
- testnet: true
27200
- });
27201
- const mainnet = /* @__PURE__ */ defineChain({
27202
- id: 1,
27203
- name: "Ethereum",
27204
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
27205
- rpcUrls: {
27206
- default: {
27207
- http: ["https://cloudflare-eth.com"]
27208
- }
27209
- },
27210
- blockExplorers: {
27211
- default: {
27212
- name: "Etherscan",
27213
- url: "https://etherscan.io",
27214
- apiUrl: "https://api.etherscan.io/api"
27215
- }
27216
- },
27217
- contracts: {
27218
- ensRegistry: {
27219
- address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
27220
- },
27221
- ensUniversalResolver: {
27222
- address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
27223
- blockCreated: 19258213
27224
- },
27225
- multicall3: {
27226
- address: "0xca11bde05977b3631167028862be2a173976ca11",
27227
- blockCreated: 14353601
27228
- }
27229
- }
27230
- });
27231
- const hoodi = viem.defineChain({
27232
- id: 560048,
27233
- name: "Hoodi",
27234
- rpcUrls: {
27235
- default: {
27236
- http: ["https://rpc.hoodi.ethpandaops.io"]
27237
- }
27238
- },
27239
- nativeCurrency: {
27240
- name: "Hoodi Ether",
27241
- symbol: "ETH",
27242
- decimals: 18
27243
- },
27244
- testnet: true
27245
- });
27246
- const chains = {
27247
- mainnet,
27248
- holesky,
27249
- hoodi
27250
- };
27251
- const chainIds = Object.values(chains).map((chain) => chain.id);
27252
- const graph_endpoints = {
27253
- [mainnet.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-ethereum/version/latest",
27254
- [holesky.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-holesky/version/latest",
27255
- [hoodi.id]: "https://graph-node-hoodi.stage.ops.ssvlabsinternal.com/subgraphs/name/ssv-bapps-hoodi/graphql"
27256
- };
27257
- const rest_endpoints = {
27258
- [mainnet.id]: "https://api.ssv.network/api/v4/mainnet",
27259
- [holesky.id]: "https://api.ssv.network/api/v4/holesky",
27260
- [hoodi.id]: "https://api.stage.ops.ssvlabsinternal.com/api/v4/hoodi"
27261
- };
27262
- const contracts = {
27263
- [mainnet.id]: {
27264
- setter: "0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1",
27265
- getter: "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4",
27266
- token: "0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54"
27267
- },
27268
- [holesky.id]: {
27269
- setter: "0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA",
27270
- getter: "0x352A18AEe90cdcd825d1E37d9939dCA86C00e281",
27271
- token: "0xad45A78180961079BFaeEe349704F411dfF947C6"
27272
- },
27273
- [hoodi.id]: {
27274
- setter: "0x58410Bef803ECd7E63B23664C586A6DB72DAf59c",
27275
- getter: "0x5AdDb3f1529C5ec70D77400499eE4bbF328368fe",
27276
- token: "0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e"
27277
- }
27278
- };
27279
26999
  const MainnetV4GetterABI = [
27280
27000
  {
27281
27001
  inputs: [],
@@ -31952,7 +31672,7 @@ function setCacheHas(value) {
31952
31672
  }
31953
31673
  function SetCache(values) {
31954
31674
  var index = -1, length = values == null ? 0 : values.length;
31955
- this.__data__ = new config$2.MapCache();
31675
+ this.__data__ = new globals.MapCache();
31956
31676
  while (++index < length) {
31957
31677
  this.add(values[index]);
31958
31678
  }
@@ -32032,7 +31752,7 @@ function setToArray(set) {
32032
31752
  var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
32033
31753
  var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
32034
31754
  var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
32035
- var symbolProto = config$2.Symbol ? config$2.Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
31755
+ var symbolProto = globals.Symbol ? globals.Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
32036
31756
  function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
32037
31757
  switch (tag) {
32038
31758
  case dataViewTag:
@@ -32042,14 +31762,14 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
32042
31762
  object = object.buffer;
32043
31763
  other = other.buffer;
32044
31764
  case arrayBufferTag:
32045
- if (object.byteLength != other.byteLength || !equalFunc(new config$2.Uint8Array(object), new config$2.Uint8Array(other))) {
31765
+ if (object.byteLength != other.byteLength || !equalFunc(new globals.Uint8Array(object), new globals.Uint8Array(other))) {
32046
31766
  return false;
32047
31767
  }
32048
31768
  return true;
32049
31769
  case boolTag:
32050
31770
  case dateTag:
32051
31771
  case numberTag:
32052
- return config$2.eq(+object, +other);
31772
+ return globals.eq(+object, +other);
32053
31773
  case errorTag:
32054
31774
  return object.name == other.name && object.message == other.message;
32055
31775
  case regexpTag:
@@ -32083,7 +31803,7 @@ var COMPARE_PARTIAL_FLAG$1 = 1;
32083
31803
  var objectProto$1 = Object.prototype;
32084
31804
  var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
32085
31805
  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
32086
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = config$2.getAllKeys(object), objLength = objProps.length, othProps = config$2.getAllKeys(other), othLength = othProps.length;
31806
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = globals.getAllKeys(object), objLength = objProps.length, othProps = globals.getAllKeys(other), othLength = othProps.length;
32087
31807
  if (objLength != othLength && !isPartial) {
32088
31808
  return false;
32089
31809
  }
@@ -32130,40 +31850,40 @@ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[o
32130
31850
  var objectProto = Object.prototype;
32131
31851
  var hasOwnProperty = objectProto.hasOwnProperty;
32132
31852
  function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
32133
- var objIsArr = config$2.isArray(object), othIsArr = config$2.isArray(other), objTag = objIsArr ? arrayTag : config$2.getTag(object), othTag = othIsArr ? arrayTag : config$2.getTag(other);
31853
+ var objIsArr = globals.isArray(object), othIsArr = globals.isArray(other), objTag = objIsArr ? arrayTag : globals.getTag(object), othTag = othIsArr ? arrayTag : globals.getTag(other);
32134
31854
  objTag = objTag == argsTag ? objectTag : objTag;
32135
31855
  othTag = othTag == argsTag ? objectTag : othTag;
32136
31856
  var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
32137
- if (isSameTag && config$2.isBuffer(object)) {
32138
- if (!config$2.isBuffer(other)) {
31857
+ if (isSameTag && globals.isBuffer(object)) {
31858
+ if (!globals.isBuffer(other)) {
32139
31859
  return false;
32140
31860
  }
32141
31861
  objIsArr = true;
32142
31862
  objIsObj = false;
32143
31863
  }
32144
31864
  if (isSameTag && !objIsObj) {
32145
- stack || (stack = new config$2.Stack());
32146
- return objIsArr || config$2.isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
31865
+ stack || (stack = new globals.Stack());
31866
+ return objIsArr || globals.isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
32147
31867
  }
32148
31868
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
32149
31869
  var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
32150
31870
  if (objIsWrapped || othIsWrapped) {
32151
31871
  var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
32152
- stack || (stack = new config$2.Stack());
31872
+ stack || (stack = new globals.Stack());
32153
31873
  return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
32154
31874
  }
32155
31875
  }
32156
31876
  if (!isSameTag) {
32157
31877
  return false;
32158
31878
  }
32159
- stack || (stack = new config$2.Stack());
31879
+ stack || (stack = new globals.Stack());
32160
31880
  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
32161
31881
  }
32162
31882
  function baseIsEqual(value, other, bitmask, customizer, stack) {
32163
31883
  if (value === other) {
32164
31884
  return true;
32165
31885
  }
32166
- if (value == null || other == null || !config$2.isObjectLike(value) && !config$2.isObjectLike(other)) {
31886
+ if (value == null || other == null || !globals.isObjectLike(value) && !globals.isObjectLike(other)) {
32167
31887
  return value !== value && other !== other;
32168
31888
  }
32169
31889
  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
@@ -32175,10 +31895,10 @@ const paramsToArray = ({
32175
31895
  params,
32176
31896
  abiFunction
32177
31897
  }) => {
32178
- return config$2.stringifyBigints(
31898
+ return globals.stringifyBigints(
32179
31899
  abiFunction.inputs.reduce(
32180
31900
  (acc, param) => {
32181
- if (param.name && !config$2.isUndefined(params[param.name])) {
31901
+ if (param.name && !globals.isUndefined(params[param.name])) {
32182
31902
  return [...acc, params[param.name]];
32183
31903
  } else {
32184
31904
  console.error(`Missing argument for ${param}`);
@@ -32289,7 +32009,7 @@ const createWriter = ({
32289
32009
  acc.push(event);
32290
32010
  } catch {
32291
32011
  for (const eventAbi of ABIS) {
32292
- config$2.tryCatch(() => {
32012
+ globals.tryCatch(() => {
32293
32013
  const event = viem.decodeEventLog({
32294
32014
  abi: eventAbi,
32295
32015
  data: log.data,
@@ -33590,7 +33310,7 @@ function getObjectTag(object) {
33590
33310
  return tag;
33591
33311
  }
33592
33312
  const isProduction = globalThis.process && // eslint-disable-next-line no-undef
33593
- process$1.env.NODE_ENV === "production";
33313
+ globals.process$1.env.NODE_ENV === "production";
33594
33314
  const instanceOf = (
33595
33315
  /* c8 ignore next 6 */
33596
33316
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
@@ -35881,23 +35601,28 @@ const createContractInteractions = ({
35881
35601
  };
35882
35602
  };
35883
35603
  const createConfig = (props) => {
35884
- const parsed = config$2.configArgsSchema.parse(props);
35885
- const { walletClient, publicClient } = parsed;
35886
- if (!walletClient.chain || !publicClient.chain || !chainIds.includes(walletClient.chain?.id) || !chainIds.includes(publicClient.chain?.id))
35887
- throw new Error(`Chain must be one of ${chainIds.join(", ")}`);
35888
- const chainId = walletClient.chain.id;
35604
+ const parsed = globals.configArgsSchema.parse(props);
35605
+ if (!parsed.walletClient.chain || !parsed.publicClient.chain || !globals.chainIds.includes(parsed.walletClient.chain?.id) || !globals.chainIds.includes(parsed.publicClient.chain?.id))
35606
+ throw new Error(`Chain must be one of ${globals.chainIds.join(", ")}`);
35607
+ const chainId = parsed.walletClient.chain.id;
35608
+ const chainContracts = globals.contracts[chainId];
35609
+ const addresses = {
35610
+ setter: parsed._?.contractAddresses?.setter || chainContracts.setter,
35611
+ getter: parsed._?.contractAddresses?.getter || chainContracts.getter,
35612
+ token: parsed._?.contractAddresses?.token || chainContracts.token
35613
+ };
35889
35614
  const contract = createContractInteractions({
35890
- walletClient,
35891
- publicClient,
35892
- addresses: contracts[chainId]
35615
+ walletClient: parsed.walletClient,
35616
+ publicClient: parsed.publicClient,
35617
+ addresses
35893
35618
  });
35894
- const graphEndpoint = graph_endpoints[chainId];
35895
- const restEndpoint = rest_endpoints[chainId];
35619
+ const graphEndpoint = parsed._?.graphUrl || globals.graph_endpoints[chainId];
35620
+ const restEndpoint = parsed._?.restUrl || globals.rest_endpoints[chainId];
35896
35621
  const graphQLClient = new GraphQLClient(graphEndpoint);
35897
35622
  return {
35898
- publicClient,
35899
- walletClient,
35900
- chain: walletClient.chain,
35623
+ publicClient: parsed.publicClient,
35624
+ walletClient: parsed.walletClient,
35625
+ chain: parsed.walletClient.chain,
35901
35626
  graphEndpoint,
35902
35627
  restEndpoint,
35903
35628
  api: {
@@ -35905,49 +35630,17 @@ const createConfig = (props) => {
35905
35630
  ...createSSVAPI(restEndpoint)
35906
35631
  },
35907
35632
  graphQLClient,
35908
- contractAddresses: contracts[chainId],
35633
+ contractAddresses: addresses,
35909
35634
  contract
35910
35635
  };
35911
35636
  };
35912
- const globals = {
35913
- MAX_WEI_AMOUNT: 115792089237316195423570985008687907853269984665640564039457584007913129639935n,
35914
- CLUSTER_SIZES: {
35915
- QUAD_CLUSTER: 4,
35916
- SEPT_CLUSTER: 7,
35917
- DECA_CLUSTER: 10,
35918
- TRISKAIDEKA_CLUSTER: 13
35919
- },
35920
- FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE: {
35921
- QUAD_CLUSTER: 80,
35922
- SEPT_CLUSTER: 40,
35923
- DECA_CLUSTER: 30,
35924
- TRISKAIDEKA_CLUSTER: 20
35925
- },
35926
- BLOCKS_PER_DAY: 7160n,
35927
- OPERATORS_PER_PAGE: 50,
35928
- BLOCKS_PER_YEAR: 2613400n,
35929
- DEFAULT_CLUSTER_PERIOD: 730,
35930
- NUMBERS_OF_WEEKS_IN_YEAR: 52.1429,
35931
- MAX_VALIDATORS_COUNT_MULTI_FLOW: 50,
35932
- CLUSTER_VALIDITY_PERIOD_MINIMUM: 30,
35933
- OPERATOR_VALIDATORS_LIMIT_PRESERVE: 5,
35934
- MINIMUM_OPERATOR_FEE_PER_BLOCK: 1000000000n,
35935
- MIN_VALIDATORS_COUNT_PER_BULK_REGISTRATION: 1,
35936
- DEFAULT_ADDRESS_WHITELIST: "0x0000000000000000000000000000000000000000"
35937
- };
35938
- const registerValidatorsByClusterSizeLimits = {
35939
- [globals.CLUSTER_SIZES.QUAD_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.QUAD_CLUSTER,
35940
- [globals.CLUSTER_SIZES.SEPT_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.SEPT_CLUSTER,
35941
- [globals.CLUSTER_SIZES.DECA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.DECA_CLUSTER,
35942
- [globals.CLUSTER_SIZES.TRISKAIDEKA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.TRISKAIDEKA_CLUSTER
35943
- };
35944
35637
  const deposit = async (config2, { args: { id, amount }, ...writeOptions }, options2 = {}) => {
35945
35638
  const cluster = await config2.api.getCluster({ id });
35946
35639
  console.log("cluster:", cluster);
35947
35640
  if (!cluster) {
35948
35641
  throw new Error("Cluster not found");
35949
35642
  }
35950
- const snapshot = config$2.getClusterSnapshot(cluster);
35643
+ const snapshot = globals.getClusterSnapshot(cluster);
35951
35644
  if (options2?.approve) {
35952
35645
  const allowance = await config2.contract.token.read.allowance({
35953
35646
  owner: config2.walletClient.account.address,
@@ -35966,7 +35659,7 @@ const deposit = async (config2, { args: { id, amount }, ...writeOptions }, optio
35966
35659
  args: {
35967
35660
  amount,
35968
35661
  cluster: snapshot,
35969
- clusterOwner: process$1.env.OWNER_ADDRESS,
35662
+ clusterOwner: globals.process$1.env.OWNER_ADDRESS,
35970
35663
  operatorIds: cluster.operatorIds.map(BigInt)
35971
35664
  },
35972
35665
  ...writeOptions
@@ -35997,7 +35690,7 @@ const liquidateCluster = async (config2, { args: { id }, ...writeOptions }) => {
35997
35690
  }
35998
35691
  return config2.contract.ssv.write.liquidate({
35999
35692
  args: {
36000
- cluster: config$2.getClusterSnapshot(cluster),
35693
+ cluster: globals.getClusterSnapshot(cluster),
36001
35694
  clusterOwner: config2.walletClient.account.address,
36002
35695
  operatorIds: cluster.operatorIds.map(BigInt)
36003
35696
  },
@@ -36011,7 +35704,7 @@ const reactivateCluster = async (config2, { args: { id, amount }, ...writeOption
36011
35704
  }
36012
35705
  return config2.contract.ssv.write.reactivate({
36013
35706
  args: {
36014
- cluster: config$2.getClusterSnapshot(cluster),
35707
+ cluster: globals.getClusterSnapshot(cluster),
36015
35708
  amount,
36016
35709
  operatorIds: cluster.operatorIds.map(BigInt)
36017
35710
  },
@@ -36020,24 +35713,24 @@ const reactivateCluster = async (config2, { args: { id, amount }, ...writeOption
36020
35713
  };
36021
35714
  const registerValidators = async (config2, { args: { keyshares, depositAmount = 0n }, ...writeOptions }) => {
36022
35715
  const shares = keyshares.map((share) => {
36023
- return config$2.isKeySharesItem(share) ? share.payload : share;
35716
+ return globals.isKeySharesItem(share) ? share.payload : share;
36024
35717
  });
36025
35718
  const operatorIds = shares[0].operatorIds;
36026
35719
  const clusterSize = operatorIds.length;
36027
- const limit = registerValidatorsByClusterSizeLimits[clusterSize];
35720
+ const limit = globals.registerValidatorsByClusterSizeLimits[clusterSize];
36028
35721
  if (!limit) {
36029
35722
  throw new Error(
36030
- `Invalid number of operators in keyshares: ${clusterSize}, should be one of: ${Object.keys(registerValidatorsByClusterSizeLimits).join(", ")}`
35723
+ `Invalid number of operators in keyshares: ${clusterSize}, should be one of: ${Object.keys(globals.registerValidatorsByClusterSizeLimits).join(", ")}`
36031
35724
  );
36032
35725
  }
36033
35726
  if (shares.length > limit) {
36034
35727
  throw new Error(`You can't register more than ${limit} validators in a single transaction`);
36035
35728
  }
36036
- const clusterId = config$2.createClusterId(config2.walletClient.account.address, operatorIds);
35729
+ const clusterId = globals.createClusterId(config2.walletClient.account.address, operatorIds);
36037
35730
  const cluster = await config2.api.getCluster({
36038
35731
  id: clusterId
36039
35732
  });
36040
- const snapshot = cluster ? config$2.getClusterSnapshot(cluster) : config$2.createEmptyCluster();
35733
+ const snapshot = cluster ? globals.getClusterSnapshot(cluster) : globals.createEmptyCluster();
36041
35734
  if (shares.length === 1) {
36042
35735
  return config2.contract.ssv.write.registerValidator(
36043
35736
  {
@@ -36072,7 +35765,7 @@ const validateSharesPostRegistration = async (config2, args) => {
36072
35765
  owner: config2.walletClient.account.address,
36073
35766
  block: Number(receipt.blockNumber) - 1
36074
35767
  });
36075
- if (config$2.isUndefined(ownerNonce)) {
35768
+ if (globals.isUndefined(ownerNonce)) {
36076
35769
  throw new Error("Could not fetch owner nonce");
36077
35770
  }
36078
35771
  const validatorAddedEvents = await config2.publicClient.getContractEvents({
@@ -36121,7 +35814,7 @@ const removeValidators = async (config2, { args: { id, publicKeys }, ...writeOpt
36121
35814
  if (publicKeys.length === 1) {
36122
35815
  return config2.contract.ssv.write.removeValidator({
36123
35816
  args: {
36124
- cluster: config$2.getClusterSnapshot(cluster),
35817
+ cluster: globals.getClusterSnapshot(cluster),
36125
35818
  publicKey: publicKeys[0],
36126
35819
  operatorIds: cluster.operatorIds.map(BigInt)
36127
35820
  },
@@ -36130,7 +35823,7 @@ const removeValidators = async (config2, { args: { id, publicKeys }, ...writeOpt
36130
35823
  }
36131
35824
  return config2.contract.ssv.write.bulkRemoveValidator({
36132
35825
  args: {
36133
- cluster: config$2.getClusterSnapshot(cluster),
35826
+ cluster: globals.getClusterSnapshot(cluster),
36134
35827
  publicKeys,
36135
35828
  operatorIds: cluster.operatorIds.map(BigInt)
36136
35829
  },
@@ -36153,7 +35846,7 @@ const withdraw$1 = async (config2, { args: { id, amount }, ...writeOptions }) =>
36153
35846
  return config2.contract.ssv.write.withdraw({
36154
35847
  args: {
36155
35848
  amount,
36156
- cluster: config$2.getClusterSnapshot(cluster),
35849
+ cluster: globals.getClusterSnapshot(cluster),
36157
35850
  operatorIds: cluster.operatorIds.map(BigInt)
36158
35851
  },
36159
35852
  ...writeOptions
@@ -36198,7 +35891,7 @@ const registerOperator = async (config2, { args: { isPrivate, yearlyFee, publicK
36198
35891
  return config2.contract.ssv.write.registerOperator({
36199
35892
  args: {
36200
35893
  publicKey: viem.encodeAbiParameters(viem.parseAbiParameters("string"), [publicKey]),
36201
- fee: config$2.roundOperatorFee(yearlyFee / globals.BLOCKS_PER_YEAR),
35894
+ fee: globals.roundOperatorFee(yearlyFee / globals.globals.BLOCKS_PER_YEAR),
36202
35895
  setPrivate: isPrivate
36203
35896
  },
36204
35897
  ...writeOptions
@@ -36255,7 +35948,7 @@ const getClusterBalance = async (config2, { operatorIds }) => {
36255
35948
  const query = await config2.api.getClusterBalance({
36256
35949
  daoAddress: config2.contractAddresses.setter,
36257
35950
  operatorIds: operatorIds.map(String),
36258
- clusterId: config$2.createClusterId(config2.walletClient.account.address, operatorIds)
35951
+ clusterId: globals.createClusterId(config2.walletClient.account.address, operatorIds)
36259
35952
  });
36260
35953
  if (!query.cluster || !query.daovalues || !query._meta) {
36261
35954
  throw new Error("Could not fetch cluster balance");
@@ -36271,9 +35964,9 @@ const getClusterBalance = async (config2, { operatorIds }) => {
36271
35964
  const calculatedClusterBalance = BigInt(query.cluster.balance) - (cumulativeNetworkFee + cumulativeOperatorFee) * BigInt(query.cluster.validatorCount) || 1n;
36272
35965
  const burnRate = (operatorsFee + BigInt(query.daovalues.networkFee)) * BigInt(query.cluster.validatorCount) || 1n;
36273
35966
  const mLc = BigInt(query.daovalues.minimumLiquidationCollateral);
36274
- const LC = config$2.bigintMax(mLc, burnRate * BigInt(query.daovalues.liquidationThreshold));
35967
+ const LC = globals.bigintMax(mLc, burnRate * BigInt(query.daovalues.liquidationThreshold));
36275
35968
  const runwaySSV = calculatedClusterBalance - LC;
36276
- const operationalRunway = runwaySSV / burnRate / globals.BLOCKS_PER_DAY;
35969
+ const operationalRunway = runwaySSV / burnRate / globals.globals.BLOCKS_PER_DAY;
36277
35970
  return {
36278
35971
  balance: calculatedClusterBalance,
36279
35972
  operationalRunway
@@ -36338,9 +36031,9 @@ const validateKeysharesJSON = async ({
36338
36031
  keyshares
36339
36032
  }) => {
36340
36033
  const shares = (await ssvKeys$2.KeyShares.fromJson(keyshares)).list();
36341
- config$2.ensureNoKeysharesErrors(shares);
36342
- config$2.ensureValidatorsUniqueness(shares);
36343
- config$2.validateConsistentOperatorPublicKeys(shares, operators);
36034
+ globals.ensureNoKeysharesErrors(shares);
36035
+ globals.ensureValidatorsUniqueness(shares);
36036
+ globals.validateConsistentOperatorPublicKeys(shares, operators);
36344
36037
  await Promise.all(
36345
36038
  shares.map(
36346
36039
  (share) => share.validateSingleShares(share.payload.sharesData, {
@@ -36350,10 +36043,10 @@ const validateKeysharesJSON = async ({
36350
36043
  })
36351
36044
  )
36352
36045
  );
36353
- const shareOperatorIds = config$2.validateConsistentOperatorIds(shares);
36354
- const operatorIds = config$2.sortNumbers(operators.map((operator) => Number(operator.id)));
36355
- if (!isEqual(config$2.sortNumbers(shareOperatorIds), config$2.sortNumbers(operatorIds))) {
36356
- throw new config$2.KeysharesValidationError(config$2.KeysharesValidationErrors.ClusterMismatch);
36046
+ const shareOperatorIds = globals.validateConsistentOperatorIds(shares);
36047
+ const operatorIds = globals.sortNumbers(operators.map((operator) => Number(operator.id)));
36048
+ if (!isEqual(globals.sortNumbers(shareOperatorIds), globals.sortNumbers(operatorIds))) {
36049
+ throw new globals.KeysharesValidationError(globals.KeysharesValidationErrors.ClusterMismatch);
36357
36050
  }
36358
36051
  return shares;
36359
36052
  };
@@ -36430,10 +36123,16 @@ class SSVSDK {
36430
36123
  this.utils = createUtils(this.config);
36431
36124
  }
36432
36125
  }
36126
+ exports.chainIds = globals.chainIds;
36127
+ exports.chains = globals.chains;
36128
+ exports.contracts = globals.contracts;
36129
+ exports.globals = globals.globals;
36130
+ exports.graph_endpoints = globals.graph_endpoints;
36131
+ exports.hoodi = globals.hoodi;
36132
+ exports.networks = globals.networks;
36133
+ exports.registerValidatorsByClusterSizeLimits = globals.registerValidatorsByClusterSizeLimits;
36134
+ exports.rest_endpoints = globals.rest_endpoints;
36433
36135
  exports.SSVSDK = SSVSDK;
36434
- exports.chainIds = chainIds;
36435
- exports.chains = chains;
36436
- exports.contracts = contracts;
36437
36136
  exports.createClusterManager = createClusterManager;
36438
36137
  exports.createConfig = createConfig;
36439
36138
  exports.createContractInteractions = createContractInteractions;
@@ -36453,9 +36152,4 @@ exports.getOwnerNonce = getOwnerNonce;
36453
36152
  exports.getQueries = getQueries;
36454
36153
  exports.getValidator = getValidator;
36455
36154
  exports.getValidators = getValidators;
36456
- exports.globals = globals;
36457
- exports.graph_endpoints = graph_endpoints;
36458
- exports.hoodi = hoodi;
36459
36155
  exports.isConfig = isConfig;
36460
- exports.registerValidatorsByClusterSizeLimits = registerValidatorsByClusterSizeLimits;
36461
- exports.rest_endpoints = rest_endpoints;