@ssv-labs/ssv-sdk 0.0.3 → 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() {
141
- }
142
- process.on = noop;
143
- process.addListener = noop;
144
- process.once = noop;
145
- process.off = noop;
146
- process.removeListener = noop;
147
- process.removeAllListeners = noop;
148
- process.emit = noop;
149
- process.prependListener = noop;
150
- process.prependOnceListener = noop;
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;
@@ -945,7 +783,7 @@ var dist = {};
945
783
  }
946
784
  return -1;
947
785
  }
948
- Buffer3.prototype.includes = function includes(val, byteOffset, encoding) {
786
+ Buffer3.prototype.includes = function includes2(val, byteOffset, encoding) {
949
787
  return this.indexOf(val, byteOffset, encoding) !== -1;
950
788
  };
951
789
  Buffer3.prototype.indexOf = function indexOf3(val, byteOffset, encoding) {
@@ -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
  }
@@ -2557,7 +2395,7 @@ function EventEmitter() {
2557
2395
  EventEmitter.init.call(this);
2558
2396
  }
2559
2397
  events.exports = EventEmitter;
2560
- events.exports.once = once;
2398
+ events.exports.once = once$2;
2561
2399
  EventEmitter.EventEmitter = EventEmitter;
2562
2400
  EventEmitter.prototype._events = void 0;
2563
2401
  EventEmitter.prototype._eventsCount = 0;
@@ -2851,7 +2689,7 @@ function unwrapListeners(arr) {
2851
2689
  }
2852
2690
  return ret;
2853
2691
  }
2854
- function once(emitter, name2) {
2692
+ function once$2(emitter, name2) {
2855
2693
  return new Promise(function(resolve2, reject) {
2856
2694
  function errorListener(err) {
2857
2695
  emitter.removeListener(name2, resolver);
@@ -2893,14 +2731,7 @@ function eventTargetAgnosticAddListener(emitter, name2, listener, flags) {
2893
2731
  }
2894
2732
  }
2895
2733
  var eventsExports = events.exports;
2896
- var streamBrowser$1;
2897
- var hasRequiredStreamBrowser;
2898
- function requireStreamBrowser() {
2899
- if (hasRequiredStreamBrowser) return streamBrowser$1;
2900
- hasRequiredStreamBrowser = 1;
2901
- streamBrowser$1 = eventsExports.EventEmitter;
2902
- return streamBrowser$1;
2903
- }
2734
+ var streamBrowser$1 = eventsExports.EventEmitter;
2904
2735
  var util$3 = {};
2905
2736
  var types$1 = {};
2906
2737
  var shams$1 = function hasSymbols2() {
@@ -3055,10 +2886,10 @@ var implementation$1 = function bind2(that) {
3055
2886
  };
3056
2887
  var implementation = implementation$1;
3057
2888
  var functionBind = Function.prototype.bind || implementation;
3058
- var call = Function.prototype.call;
2889
+ var call$1 = Function.prototype.call;
3059
2890
  var $hasOwn = Object.prototype.hasOwnProperty;
3060
2891
  var bind$1 = functionBind;
3061
- var hasown = bind$1.call(call, $hasOwn);
2892
+ var hasown = bind$1.call(call$1, $hasOwn);
3062
2893
  var undefined$1;
3063
2894
  var $Error = esErrors;
3064
2895
  var $EvalError = _eval;
@@ -4157,10 +3988,10 @@ var isBufferBrowser = function isBuffer(arg) {
4157
3988
  return str;
4158
3989
  };
4159
3990
  exports2.deprecate = function(fn, msg) {
4160
- if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) {
3991
+ if (typeof globals.process$1 !== "undefined" && globals.process$1.noDeprecation === true) {
4161
3992
  return fn;
4162
3993
  }
4163
- if (typeof process$1 === "undefined") {
3994
+ if (typeof globals.process$1 === "undefined") {
4164
3995
  return function() {
4165
3996
  return exports2.deprecate(fn, msg).apply(this, arguments);
4166
3997
  };
@@ -4168,9 +3999,9 @@ var isBufferBrowser = function isBuffer(arg) {
4168
3999
  var warned = false;
4169
4000
  function deprecated() {
4170
4001
  if (!warned) {
4171
- if (process$1.throwDeprecation) {
4002
+ if (globals.process$1.throwDeprecation) {
4172
4003
  throw new Error(msg);
4173
- } else if (process$1.traceDeprecation) {
4004
+ } else if (globals.process$1.traceDeprecation) {
4174
4005
  console.trace(msg);
4175
4006
  } else {
4176
4007
  console.error(msg);
@@ -4183,8 +4014,8 @@ var isBufferBrowser = function isBuffer(arg) {
4183
4014
  };
4184
4015
  var debugs = {};
4185
4016
  var debugEnvRegex = /^$/;
4186
- if (process$1.env.NODE_DEBUG) {
4187
- var debugEnv = process$1.env.NODE_DEBUG;
4017
+ if (globals.process$1.env.NODE_DEBUG) {
4018
+ var debugEnv = globals.process$1.env.NODE_DEBUG;
4188
4019
  debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
4189
4020
  debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
4190
4021
  }
@@ -4192,7 +4023,7 @@ var isBufferBrowser = function isBuffer(arg) {
4192
4023
  set = set.toUpperCase();
4193
4024
  if (!debugs[set]) {
4194
4025
  if (debugEnvRegex.test(set)) {
4195
- var pid = process$1.pid;
4026
+ var pid = globals.process$1.pid;
4196
4027
  debugs[set] = function() {
4197
4028
  var msg = exports2.format.apply(exports2, arguments);
4198
4029
  console.error("%s %d: %s", set, pid, msg);
@@ -4644,10 +4475,10 @@ var isBufferBrowser = function isBuffer(arg) {
4644
4475
  };
4645
4476
  original.apply(this, args).then(
4646
4477
  function(ret) {
4647
- process$1.nextTick(cb.bind(null, null, ret));
4478
+ globals.process$1.nextTick(cb.bind(null, null, ret));
4648
4479
  },
4649
4480
  function(rej) {
4650
- process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb));
4481
+ globals.process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb));
4651
4482
  }
4652
4483
  );
4653
4484
  }
@@ -4899,229 +4730,209 @@ function requireBuffer_list() {
4899
4730
  }();
4900
4731
  return buffer_list;
4901
4732
  }
4902
- var destroy_1$1;
4903
- var hasRequiredDestroy;
4904
- function requireDestroy() {
4905
- if (hasRequiredDestroy) return destroy_1$1;
4906
- hasRequiredDestroy = 1;
4907
- function destroy2(err, cb) {
4908
- var _this = this;
4909
- var readableDestroyed = this._readableState && this._readableState.destroyed;
4910
- var writableDestroyed = this._writableState && this._writableState.destroyed;
4911
- if (readableDestroyed || writableDestroyed) {
4912
- if (cb) {
4913
- cb(err);
4914
- } else if (err) {
4915
- if (!this._writableState) {
4916
- process$1.nextTick(emitErrorNT2, this, err);
4917
- } else if (!this._writableState.errorEmitted) {
4918
- this._writableState.errorEmitted = true;
4919
- process$1.nextTick(emitErrorNT2, this, err);
4920
- }
4733
+ function destroy$1(err, cb) {
4734
+ var _this = this;
4735
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
4736
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
4737
+ if (readableDestroyed || writableDestroyed) {
4738
+ if (cb) {
4739
+ cb(err);
4740
+ } else if (err) {
4741
+ if (!this._writableState) {
4742
+ globals.process$1.nextTick(emitErrorNT$1, this, err);
4743
+ } else if (!this._writableState.errorEmitted) {
4744
+ this._writableState.errorEmitted = true;
4745
+ globals.process$1.nextTick(emitErrorNT$1, this, err);
4921
4746
  }
4922
- return this;
4923
4747
  }
4924
- if (this._readableState) {
4925
- this._readableState.destroyed = true;
4926
- }
4927
- if (this._writableState) {
4928
- this._writableState.destroyed = true;
4929
- }
4930
- this._destroy(err || null, function(err2) {
4931
- if (!cb && err2) {
4932
- if (!_this._writableState) {
4933
- process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4934
- } else if (!_this._writableState.errorEmitted) {
4935
- _this._writableState.errorEmitted = true;
4936
- process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4937
- } else {
4938
- process$1.nextTick(emitCloseNT, _this);
4939
- }
4940
- } else if (cb) {
4941
- process$1.nextTick(emitCloseNT, _this);
4942
- cb(err2);
4943
- } else {
4944
- process$1.nextTick(emitCloseNT, _this);
4945
- }
4946
- });
4947
4748
  return this;
4948
4749
  }
4949
- function emitErrorAndCloseNT(self2, err) {
4950
- emitErrorNT2(self2, err);
4951
- emitCloseNT(self2);
4952
- }
4953
- function emitCloseNT(self2) {
4954
- if (self2._writableState && !self2._writableState.emitClose) return;
4955
- if (self2._readableState && !self2._readableState.emitClose) return;
4956
- self2.emit("close");
4957
- }
4958
- function undestroy2() {
4959
- if (this._readableState) {
4960
- this._readableState.destroyed = false;
4961
- this._readableState.reading = false;
4962
- this._readableState.ended = false;
4963
- this._readableState.endEmitted = false;
4964
- }
4965
- if (this._writableState) {
4966
- this._writableState.destroyed = false;
4967
- this._writableState.ended = false;
4968
- this._writableState.ending = false;
4969
- this._writableState.finalCalled = false;
4970
- this._writableState.prefinished = false;
4971
- this._writableState.finished = false;
4972
- this._writableState.errorEmitted = false;
4973
- }
4974
- }
4975
- function emitErrorNT2(self2, err) {
4976
- self2.emit("error", err);
4977
- }
4978
- function errorOrDestroy(stream, err) {
4979
- var rState = stream._readableState;
4980
- var wState = stream._writableState;
4981
- if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
4982
- else stream.emit("error", err);
4983
- }
4984
- destroy_1$1 = {
4985
- destroy: destroy2,
4986
- undestroy: undestroy2,
4987
- errorOrDestroy
4988
- };
4989
- return destroy_1$1;
4990
- }
4991
- var errorsBrowser = {};
4992
- var hasRequiredErrorsBrowser;
4993
- function requireErrorsBrowser() {
4994
- if (hasRequiredErrorsBrowser) return errorsBrowser;
4995
- hasRequiredErrorsBrowser = 1;
4996
- function _inheritsLoose(subClass, superClass) {
4997
- subClass.prototype = Object.create(superClass.prototype);
4998
- subClass.prototype.constructor = subClass;
4999
- subClass.__proto__ = superClass;
5000
- }
5001
- var codes = {};
5002
- function createErrorType(code, message, Base2) {
5003
- if (!Base2) {
5004
- Base2 = Error;
5005
- }
5006
- function getMessage(arg1, arg2, arg3) {
5007
- if (typeof message === "string") {
5008
- return message;
5009
- } else {
5010
- return message(arg1, arg2, arg3);
5011
- }
5012
- }
5013
- var NodeError = /* @__PURE__ */ function(_Base) {
5014
- _inheritsLoose(NodeError2, _Base);
5015
- function NodeError2(arg1, arg2, arg3) {
5016
- return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
5017
- }
5018
- return NodeError2;
5019
- }(Base2);
5020
- NodeError.prototype.name = Base2.name;
5021
- NodeError.prototype.code = code;
5022
- codes[code] = NodeError;
4750
+ if (this._readableState) {
4751
+ this._readableState.destroyed = true;
5023
4752
  }
5024
- function oneOf(expected, thing) {
5025
- if (Array.isArray(expected)) {
5026
- var len = expected.length;
5027
- expected = expected.map(function(i) {
5028
- return String(i);
5029
- });
5030
- if (len > 2) {
5031
- return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
5032
- } else if (len === 2) {
5033
- return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
4753
+ if (this._writableState) {
4754
+ this._writableState.destroyed = true;
4755
+ }
4756
+ this._destroy(err || null, function(err2) {
4757
+ if (!cb && err2) {
4758
+ if (!_this._writableState) {
4759
+ globals.process$1.nextTick(emitErrorAndCloseNT, _this, err2);
4760
+ } else if (!_this._writableState.errorEmitted) {
4761
+ _this._writableState.errorEmitted = true;
4762
+ globals.process$1.nextTick(emitErrorAndCloseNT, _this, err2);
5034
4763
  } else {
5035
- return "of ".concat(thing, " ").concat(expected[0]);
4764
+ globals.process$1.nextTick(emitCloseNT, _this);
5036
4765
  }
4766
+ } else if (cb) {
4767
+ globals.process$1.nextTick(emitCloseNT, _this);
4768
+ cb(err2);
5037
4769
  } else {
5038
- return "of ".concat(thing, " ").concat(String(expected));
4770
+ globals.process$1.nextTick(emitCloseNT, _this);
5039
4771
  }
4772
+ });
4773
+ return this;
4774
+ }
4775
+ function emitErrorAndCloseNT(self2, err) {
4776
+ emitErrorNT$1(self2, err);
4777
+ emitCloseNT(self2);
4778
+ }
4779
+ function emitCloseNT(self2) {
4780
+ if (self2._writableState && !self2._writableState.emitClose) return;
4781
+ if (self2._readableState && !self2._readableState.emitClose) return;
4782
+ self2.emit("close");
4783
+ }
4784
+ function undestroy$1() {
4785
+ if (this._readableState) {
4786
+ this._readableState.destroyed = false;
4787
+ this._readableState.reading = false;
4788
+ this._readableState.ended = false;
4789
+ this._readableState.endEmitted = false;
5040
4790
  }
5041
- function startsWith(str, search, pos) {
5042
- return str.substr(0, search.length) === search;
5043
- }
5044
- function endsWith(str, search, this_len) {
5045
- if (this_len === void 0 || this_len > str.length) {
5046
- this_len = str.length;
5047
- }
5048
- return str.substring(this_len - search.length, this_len) === search;
4791
+ if (this._writableState) {
4792
+ this._writableState.destroyed = false;
4793
+ this._writableState.ended = false;
4794
+ this._writableState.ending = false;
4795
+ this._writableState.finalCalled = false;
4796
+ this._writableState.prefinished = false;
4797
+ this._writableState.finished = false;
4798
+ this._writableState.errorEmitted = false;
5049
4799
  }
5050
- function includes(str, search, start) {
5051
- if (typeof start !== "number") {
5052
- start = 0;
5053
- }
5054
- if (start + search.length > str.length) {
5055
- return false;
4800
+ }
4801
+ function emitErrorNT$1(self2, err) {
4802
+ self2.emit("error", err);
4803
+ }
4804
+ function errorOrDestroy(stream, err) {
4805
+ var rState = stream._readableState;
4806
+ var wState = stream._writableState;
4807
+ if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
4808
+ else stream.emit("error", err);
4809
+ }
4810
+ var destroy_1$1 = {
4811
+ destroy: destroy$1,
4812
+ undestroy: undestroy$1,
4813
+ errorOrDestroy
4814
+ };
4815
+ var errorsBrowser = {};
4816
+ function _inheritsLoose(subClass, superClass) {
4817
+ subClass.prototype = Object.create(superClass.prototype);
4818
+ subClass.prototype.constructor = subClass;
4819
+ subClass.__proto__ = superClass;
4820
+ }
4821
+ var codes = {};
4822
+ function createErrorType(code, message, Base2) {
4823
+ if (!Base2) {
4824
+ Base2 = Error;
4825
+ }
4826
+ function getMessage(arg1, arg2, arg3) {
4827
+ if (typeof message === "string") {
4828
+ return message;
5056
4829
  } else {
5057
- return str.indexOf(search, start) !== -1;
4830
+ return message(arg1, arg2, arg3);
5058
4831
  }
5059
4832
  }
5060
- createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
5061
- return 'The value "' + value + '" is invalid for option "' + name2 + '"';
5062
- }, TypeError);
5063
- createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) {
5064
- var determiner;
5065
- if (typeof expected === "string" && startsWith(expected, "not ")) {
5066
- determiner = "must not be";
5067
- expected = expected.replace(/^not /, "");
5068
- } else {
5069
- determiner = "must be";
4833
+ var NodeError = /* @__PURE__ */ function(_Base) {
4834
+ _inheritsLoose(NodeError2, _Base);
4835
+ function NodeError2(arg1, arg2, arg3) {
4836
+ return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
5070
4837
  }
5071
- var msg;
5072
- if (endsWith(name2, " argument")) {
5073
- msg = "The ".concat(name2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
4838
+ return NodeError2;
4839
+ }(Base2);
4840
+ NodeError.prototype.name = Base2.name;
4841
+ NodeError.prototype.code = code;
4842
+ codes[code] = NodeError;
4843
+ }
4844
+ function oneOf(expected, thing) {
4845
+ if (Array.isArray(expected)) {
4846
+ var len = expected.length;
4847
+ expected = expected.map(function(i) {
4848
+ return String(i);
4849
+ });
4850
+ if (len > 2) {
4851
+ return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
4852
+ } else if (len === 2) {
4853
+ return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
5074
4854
  } else {
5075
- var type2 = includes(name2, ".") ? "property" : "argument";
5076
- msg = 'The "'.concat(name2, '" ').concat(type2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
4855
+ return "of ".concat(thing, " ").concat(expected[0]);
5077
4856
  }
5078
- msg += ". Received type ".concat(typeof actual);
5079
- return msg;
5080
- }, TypeError);
5081
- createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
5082
- createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) {
5083
- return "The " + name2 + " method is not implemented";
5084
- });
5085
- createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
5086
- createErrorType("ERR_STREAM_DESTROYED", function(name2) {
5087
- return "Cannot call " + name2 + " after a stream was destroyed";
5088
- });
5089
- createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
5090
- createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
5091
- createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
5092
- createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
5093
- createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
5094
- return "Unknown encoding: " + arg;
5095
- }, TypeError);
5096
- createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
5097
- errorsBrowser.codes = codes;
5098
- return errorsBrowser;
5099
- }
5100
- var state;
5101
- var hasRequiredState;
5102
- function requireState() {
5103
- if (hasRequiredState) return state;
5104
- hasRequiredState = 1;
5105
- var ERR_INVALID_OPT_VALUE = requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;
5106
- function highWaterMarkFrom(options2, isDuplex, duplexKey) {
5107
- return options2.highWaterMark != null ? options2.highWaterMark : isDuplex ? options2[duplexKey] : null;
5108
- }
5109
- function getHighWaterMark(state2, options2, duplexKey, isDuplex) {
5110
- var hwm = highWaterMarkFrom(options2, isDuplex, duplexKey);
5111
- if (hwm != null) {
5112
- if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
5113
- var name2 = isDuplex ? duplexKey : "highWaterMark";
5114
- throw new ERR_INVALID_OPT_VALUE(name2, hwm);
5115
- }
5116
- return Math.floor(hwm);
5117
- }
5118
- return state2.objectMode ? 16 : 16 * 1024;
5119
- }
5120
- state = {
5121
- getHighWaterMark
5122
- };
5123
- return state;
4857
+ } else {
4858
+ return "of ".concat(thing, " ").concat(String(expected));
4859
+ }
5124
4860
  }
4861
+ function startsWith(str, search, pos) {
4862
+ return str.substr(0, search.length) === search;
4863
+ }
4864
+ function endsWith(str, search, this_len) {
4865
+ if (this_len === void 0 || this_len > str.length) {
4866
+ this_len = str.length;
4867
+ }
4868
+ return str.substring(this_len - search.length, this_len) === search;
4869
+ }
4870
+ function includes(str, search, start) {
4871
+ if (typeof start !== "number") {
4872
+ start = 0;
4873
+ }
4874
+ if (start + search.length > str.length) {
4875
+ return false;
4876
+ } else {
4877
+ return str.indexOf(search, start) !== -1;
4878
+ }
4879
+ }
4880
+ createErrorType("ERR_INVALID_OPT_VALUE", function(name2, value) {
4881
+ return 'The value "' + value + '" is invalid for option "' + name2 + '"';
4882
+ }, TypeError);
4883
+ createErrorType("ERR_INVALID_ARG_TYPE", function(name2, expected, actual) {
4884
+ var determiner;
4885
+ if (typeof expected === "string" && startsWith(expected, "not ")) {
4886
+ determiner = "must not be";
4887
+ expected = expected.replace(/^not /, "");
4888
+ } else {
4889
+ determiner = "must be";
4890
+ }
4891
+ var msg;
4892
+ if (endsWith(name2, " argument")) {
4893
+ msg = "The ".concat(name2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
4894
+ } else {
4895
+ var type2 = includes(name2, ".") ? "property" : "argument";
4896
+ msg = 'The "'.concat(name2, '" ').concat(type2, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
4897
+ }
4898
+ msg += ". Received type ".concat(typeof actual);
4899
+ return msg;
4900
+ }, TypeError);
4901
+ createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
4902
+ createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name2) {
4903
+ return "The " + name2 + " method is not implemented";
4904
+ });
4905
+ createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
4906
+ createErrorType("ERR_STREAM_DESTROYED", function(name2) {
4907
+ return "Cannot call " + name2 + " after a stream was destroyed";
4908
+ });
4909
+ createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
4910
+ createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
4911
+ createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
4912
+ createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
4913
+ createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
4914
+ return "Unknown encoding: " + arg;
4915
+ }, TypeError);
4916
+ createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
4917
+ errorsBrowser.codes = codes;
4918
+ var ERR_INVALID_OPT_VALUE = errorsBrowser.codes.ERR_INVALID_OPT_VALUE;
4919
+ function highWaterMarkFrom(options2, isDuplex, duplexKey) {
4920
+ return options2.highWaterMark != null ? options2.highWaterMark : isDuplex ? options2[duplexKey] : null;
4921
+ }
4922
+ function getHighWaterMark(state2, options2, duplexKey, isDuplex) {
4923
+ var hwm = highWaterMarkFrom(options2, isDuplex, duplexKey);
4924
+ if (hwm != null) {
4925
+ if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
4926
+ var name2 = isDuplex ? duplexKey : "highWaterMark";
4927
+ throw new ERR_INVALID_OPT_VALUE(name2, hwm);
4928
+ }
4929
+ return Math.floor(hwm);
4930
+ }
4931
+ return state2.objectMode ? 16 : 16 * 1024;
4932
+ }
4933
+ var state = {
4934
+ getHighWaterMark
4935
+ };
5125
4936
  var browser$b = deprecate;
5126
4937
  function deprecate(fn, msg) {
5127
4938
  if (config$1("noDeprecation")) {
@@ -5172,7 +4983,7 @@ function require_stream_writable$1() {
5172
4983
  var internalUtil = {
5173
4984
  deprecate: browser$b
5174
4985
  };
5175
- var Stream2 = requireStreamBrowser();
4986
+ var Stream2 = streamBrowser$1;
5176
4987
  var Buffer2 = dist.Buffer;
5177
4988
  var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
5178
4989
  };
@@ -5182,10 +4993,10 @@ function require_stream_writable$1() {
5182
4993
  function _isUint8Array(obj) {
5183
4994
  return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
5184
4995
  }
5185
- var destroyImpl = requireDestroy();
5186
- var _require = requireState(), getHighWaterMark = _require.getHighWaterMark;
5187
- var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
5188
- var errorOrDestroy = destroyImpl.errorOrDestroy;
4996
+ var destroyImpl = destroy_1$1;
4997
+ var _require = state, getHighWaterMark2 = _require.getHighWaterMark;
4998
+ var _require$codes2 = errorsBrowser.codes, ERR_INVALID_ARG_TYPE = _require$codes2.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED2 = _require$codes2.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK2 = _require$codes2.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes2.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED2 = _require$codes2.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes2.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes2.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes2.ERR_UNKNOWN_ENCODING;
4999
+ var errorOrDestroy2 = destroyImpl.errorOrDestroy;
5189
5000
  inherits_browserExports(Writable, Stream2);
5190
5001
  function nop() {
5191
5002
  }
@@ -5195,7 +5006,7 @@ function require_stream_writable$1() {
5195
5006
  if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex2;
5196
5007
  this.objectMode = !!options2.objectMode;
5197
5008
  if (isDuplex) this.objectMode = this.objectMode || !!options2.writableObjectMode;
5198
- this.highWaterMark = getHighWaterMark(this, options2, "writableHighWaterMark", isDuplex);
5009
+ this.highWaterMark = getHighWaterMark2(this, options2, "writableHighWaterMark", isDuplex);
5199
5010
  this.finalCalled = false;
5200
5011
  this.needDrain = false;
5201
5012
  this.ending = false;
@@ -5274,12 +5085,12 @@ function require_stream_writable$1() {
5274
5085
  Stream2.call(this);
5275
5086
  }
5276
5087
  Writable.prototype.pipe = function() {
5277
- errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
5088
+ errorOrDestroy2(this, new ERR_STREAM_CANNOT_PIPE());
5278
5089
  };
5279
5090
  function writeAfterEnd(stream, cb) {
5280
5091
  var er = new ERR_STREAM_WRITE_AFTER_END();
5281
- errorOrDestroy(stream, er);
5282
- process$1.nextTick(cb, er);
5092
+ errorOrDestroy2(stream, er);
5093
+ globals.process$1.nextTick(cb, er);
5283
5094
  }
5284
5095
  function validChunk(stream, state2, chunk, cb) {
5285
5096
  var er;
@@ -5289,8 +5100,8 @@ function require_stream_writable$1() {
5289
5100
  er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
5290
5101
  }
5291
5102
  if (er) {
5292
- errorOrDestroy(stream, er);
5293
- process$1.nextTick(cb, er);
5103
+ errorOrDestroy2(stream, er);
5104
+ globals.process$1.nextTick(cb, er);
5294
5105
  return false;
5295
5106
  }
5296
5107
  return true;
@@ -5394,7 +5205,7 @@ function require_stream_writable$1() {
5394
5205
  state2.writecb = cb;
5395
5206
  state2.writing = true;
5396
5207
  state2.sync = true;
5397
- if (state2.destroyed) state2.onwrite(new ERR_STREAM_DESTROYED("write"));
5208
+ if (state2.destroyed) state2.onwrite(new ERR_STREAM_DESTROYED2("write"));
5398
5209
  else if (writev) stream._writev(chunk, state2.onwrite);
5399
5210
  else stream._write(chunk, encoding, state2.onwrite);
5400
5211
  state2.sync = false;
@@ -5402,14 +5213,14 @@ function require_stream_writable$1() {
5402
5213
  function onwriteError(stream, state2, sync2, er, cb) {
5403
5214
  --state2.pendingcb;
5404
5215
  if (sync2) {
5405
- process$1.nextTick(cb, er);
5406
- process$1.nextTick(finishMaybe, stream, state2);
5216
+ globals.process$1.nextTick(cb, er);
5217
+ globals.process$1.nextTick(finishMaybe, stream, state2);
5407
5218
  stream._writableState.errorEmitted = true;
5408
- errorOrDestroy(stream, er);
5219
+ errorOrDestroy2(stream, er);
5409
5220
  } else {
5410
5221
  cb(er);
5411
5222
  stream._writableState.errorEmitted = true;
5412
- errorOrDestroy(stream, er);
5223
+ errorOrDestroy2(stream, er);
5413
5224
  finishMaybe(stream, state2);
5414
5225
  }
5415
5226
  }
@@ -5423,7 +5234,7 @@ function require_stream_writable$1() {
5423
5234
  var state2 = stream._writableState;
5424
5235
  var sync2 = state2.sync;
5425
5236
  var cb = state2.writecb;
5426
- if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
5237
+ if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK2();
5427
5238
  onwriteStateUpdate(state2);
5428
5239
  if (er) onwriteError(stream, state2, sync2, er, cb);
5429
5240
  else {
@@ -5432,7 +5243,7 @@ function require_stream_writable$1() {
5432
5243
  clearBuffer(stream, state2);
5433
5244
  }
5434
5245
  if (sync2) {
5435
- process$1.nextTick(afterWrite, stream, state2, finished, cb);
5246
+ globals.process$1.nextTick(afterWrite, stream, state2, finished, cb);
5436
5247
  } else {
5437
5248
  afterWrite(stream, state2, finished, cb);
5438
5249
  }
@@ -5496,7 +5307,7 @@ function require_stream_writable$1() {
5496
5307
  state2.bufferProcessing = false;
5497
5308
  }
5498
5309
  Writable.prototype._write = function(chunk, encoding, cb) {
5499
- cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
5310
+ cb(new ERR_METHOD_NOT_IMPLEMENTED2("_write()"));
5500
5311
  };
5501
5312
  Writable.prototype._writev = null;
5502
5313
  Writable.prototype.end = function(chunk, encoding, cb) {
@@ -5533,7 +5344,7 @@ function require_stream_writable$1() {
5533
5344
  stream._final(function(err) {
5534
5345
  state2.pendingcb--;
5535
5346
  if (err) {
5536
- errorOrDestroy(stream, err);
5347
+ errorOrDestroy2(stream, err);
5537
5348
  }
5538
5349
  state2.prefinished = true;
5539
5350
  stream.emit("prefinish");
@@ -5545,7 +5356,7 @@ function require_stream_writable$1() {
5545
5356
  if (typeof stream._final === "function" && !state2.destroyed) {
5546
5357
  state2.pendingcb++;
5547
5358
  state2.finalCalled = true;
5548
- process$1.nextTick(callFinal, stream, state2);
5359
+ globals.process$1.nextTick(callFinal, stream, state2);
5549
5360
  } else {
5550
5361
  state2.prefinished = true;
5551
5362
  stream.emit("prefinish");
@@ -5573,7 +5384,7 @@ function require_stream_writable$1() {
5573
5384
  state2.ending = true;
5574
5385
  finishMaybe(stream, state2);
5575
5386
  if (cb) {
5576
- if (state2.finished) process$1.nextTick(cb);
5387
+ if (state2.finished) globals.process$1.nextTick(cb);
5577
5388
  else stream.once("finish", cb);
5578
5389
  }
5579
5390
  state2.ended = true;
@@ -5679,7 +5490,7 @@ function require_stream_duplex$1() {
5679
5490
  });
5680
5491
  function onend() {
5681
5492
  if (this._writableState.ended) return;
5682
- process$1.nextTick(onEndNT, this);
5493
+ globals.process$1.nextTick(onEndNT, this);
5683
5494
  }
5684
5495
  function onEndNT(self2) {
5685
5496
  self2.end();
@@ -5937,95 +5748,88 @@ function simpleWrite(buf) {
5937
5748
  function simpleEnd(buf) {
5938
5749
  return buf && buf.length ? this.write(buf) : "";
5939
5750
  }
5940
- var endOfStream;
5941
- var hasRequiredEndOfStream;
5942
- function requireEndOfStream() {
5943
- if (hasRequiredEndOfStream) return endOfStream;
5944
- hasRequiredEndOfStream = 1;
5945
- var ERR_STREAM_PREMATURE_CLOSE = requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;
5946
- function once3(callback) {
5947
- var called = false;
5948
- return function() {
5949
- if (called) return;
5950
- called = true;
5951
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5952
- args[_key] = arguments[_key];
5953
- }
5954
- callback.apply(this, args);
5955
- };
5956
- }
5957
- function noop2() {
5958
- }
5959
- function isRequest(stream) {
5960
- return stream.setHeader && typeof stream.abort === "function";
5961
- }
5962
- function eos(stream, opts, callback) {
5963
- if (typeof opts === "function") return eos(stream, null, opts);
5964
- if (!opts) opts = {};
5965
- callback = once3(callback || noop2);
5966
- var readable = opts.readable || opts.readable !== false && stream.readable;
5967
- var writable = opts.writable || opts.writable !== false && stream.writable;
5968
- var onlegacyfinish = function onlegacyfinish2() {
5969
- if (!stream.writable) onfinish();
5970
- };
5971
- var writableEnded = stream._writableState && stream._writableState.finished;
5972
- var onfinish = function onfinish2() {
5973
- writable = false;
5974
- writableEnded = true;
5975
- if (!readable) callback.call(stream);
5976
- };
5977
- var readableEnded = stream._readableState && stream._readableState.endEmitted;
5978
- var onend = function onend2() {
5979
- readable = false;
5980
- readableEnded = true;
5981
- if (!writable) callback.call(stream);
5982
- };
5983
- var onerror = function onerror2(err) {
5984
- callback.call(stream, err);
5985
- };
5986
- var onclose = function onclose2() {
5987
- var err;
5988
- if (readable && !readableEnded) {
5989
- if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
5990
- return callback.call(stream, err);
5991
- }
5992
- if (writable && !writableEnded) {
5993
- if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
5994
- return callback.call(stream, err);
5995
- }
5996
- };
5997
- var onrequest = function onrequest2() {
5998
- stream.req.on("finish", onfinish);
5999
- };
6000
- if (isRequest(stream)) {
6001
- stream.on("complete", onfinish);
6002
- stream.on("abort", onclose);
6003
- if (stream.req) onrequest();
6004
- else stream.on("request", onrequest);
6005
- } else if (writable && !stream._writableState) {
6006
- stream.on("end", onlegacyfinish);
6007
- stream.on("close", onlegacyfinish);
6008
- }
6009
- stream.on("end", onend);
6010
- stream.on("finish", onfinish);
6011
- if (opts.error !== false) stream.on("error", onerror);
6012
- stream.on("close", onclose);
6013
- return function() {
6014
- stream.removeListener("complete", onfinish);
6015
- stream.removeListener("abort", onclose);
6016
- stream.removeListener("request", onrequest);
6017
- if (stream.req) stream.req.removeListener("finish", onfinish);
6018
- stream.removeListener("end", onlegacyfinish);
6019
- stream.removeListener("close", onlegacyfinish);
6020
- stream.removeListener("finish", onfinish);
6021
- stream.removeListener("end", onend);
6022
- stream.removeListener("error", onerror);
6023
- stream.removeListener("close", onclose);
6024
- };
6025
- }
6026
- endOfStream = eos;
6027
- return endOfStream;
5751
+ var ERR_STREAM_PREMATURE_CLOSE = errorsBrowser.codes.ERR_STREAM_PREMATURE_CLOSE;
5752
+ function once$1(callback) {
5753
+ var called = false;
5754
+ return function() {
5755
+ if (called) return;
5756
+ called = true;
5757
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5758
+ args[_key] = arguments[_key];
5759
+ }
5760
+ callback.apply(this, args);
5761
+ };
5762
+ }
5763
+ function noop$1() {
5764
+ }
5765
+ function isRequest$1(stream) {
5766
+ return stream.setHeader && typeof stream.abort === "function";
5767
+ }
5768
+ function eos$1(stream, opts, callback) {
5769
+ if (typeof opts === "function") return eos$1(stream, null, opts);
5770
+ if (!opts) opts = {};
5771
+ callback = once$1(callback || noop$1);
5772
+ var readable = opts.readable || opts.readable !== false && stream.readable;
5773
+ var writable = opts.writable || opts.writable !== false && stream.writable;
5774
+ var onlegacyfinish = function onlegacyfinish2() {
5775
+ if (!stream.writable) onfinish();
5776
+ };
5777
+ var writableEnded = stream._writableState && stream._writableState.finished;
5778
+ var onfinish = function onfinish2() {
5779
+ writable = false;
5780
+ writableEnded = true;
5781
+ if (!readable) callback.call(stream);
5782
+ };
5783
+ var readableEnded = stream._readableState && stream._readableState.endEmitted;
5784
+ var onend = function onend2() {
5785
+ readable = false;
5786
+ readableEnded = true;
5787
+ if (!writable) callback.call(stream);
5788
+ };
5789
+ var onerror = function onerror2(err) {
5790
+ callback.call(stream, err);
5791
+ };
5792
+ var onclose = function onclose2() {
5793
+ var err;
5794
+ if (readable && !readableEnded) {
5795
+ if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
5796
+ return callback.call(stream, err);
5797
+ }
5798
+ if (writable && !writableEnded) {
5799
+ if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
5800
+ return callback.call(stream, err);
5801
+ }
5802
+ };
5803
+ var onrequest = function onrequest2() {
5804
+ stream.req.on("finish", onfinish);
5805
+ };
5806
+ if (isRequest$1(stream)) {
5807
+ stream.on("complete", onfinish);
5808
+ stream.on("abort", onclose);
5809
+ if (stream.req) onrequest();
5810
+ else stream.on("request", onrequest);
5811
+ } else if (writable && !stream._writableState) {
5812
+ stream.on("end", onlegacyfinish);
5813
+ stream.on("close", onlegacyfinish);
5814
+ }
5815
+ stream.on("end", onend);
5816
+ stream.on("finish", onfinish);
5817
+ if (opts.error !== false) stream.on("error", onerror);
5818
+ stream.on("close", onclose);
5819
+ return function() {
5820
+ stream.removeListener("complete", onfinish);
5821
+ stream.removeListener("abort", onclose);
5822
+ stream.removeListener("request", onrequest);
5823
+ if (stream.req) stream.req.removeListener("finish", onfinish);
5824
+ stream.removeListener("end", onlegacyfinish);
5825
+ stream.removeListener("close", onlegacyfinish);
5826
+ stream.removeListener("finish", onfinish);
5827
+ stream.removeListener("end", onend);
5828
+ stream.removeListener("error", onerror);
5829
+ stream.removeListener("close", onclose);
5830
+ };
6028
5831
  }
5832
+ var endOfStream = eos$1;
6029
5833
  var async_iterator;
6030
5834
  var hasRequiredAsync_iterator;
6031
5835
  function requireAsync_iterator() {
@@ -6055,7 +5859,7 @@ function requireAsync_iterator() {
6055
5859
  }
6056
5860
  return (hint === "string" ? String : Number)(input);
6057
5861
  }
6058
- var finished = requireEndOfStream();
5862
+ var finished = endOfStream;
6059
5863
  var kLastResolve = Symbol("lastResolve");
6060
5864
  var kLastReject = Symbol("lastReject");
6061
5865
  var kError = Symbol("error");
@@ -6082,7 +5886,7 @@ function requireAsync_iterator() {
6082
5886
  }
6083
5887
  }
6084
5888
  function onReadable(iter) {
6085
- process$1.nextTick(readAndResolve, iter);
5889
+ globals.process$1.nextTick(readAndResolve, iter);
6086
5890
  }
6087
5891
  function wrapForNext(lastPromise, iter) {
6088
5892
  return function(resolve2, reject) {
@@ -6112,7 +5916,7 @@ function requireAsync_iterator() {
6112
5916
  }
6113
5917
  if (this[kStream].destroyed) {
6114
5918
  return new Promise(function(resolve2, reject) {
6115
- process$1.nextTick(function() {
5919
+ globals.process$1.nextTick(function() {
6116
5920
  if (_this[kError]) {
6117
5921
  reject(_this[kError]);
6118
5922
  } else {
@@ -6231,7 +6035,7 @@ function require_stream_readable$1() {
6231
6035
  var EElistenerCount = function EElistenerCount2(emitter, type2) {
6232
6036
  return emitter.listeners(type2).length;
6233
6037
  };
6234
- var Stream2 = requireStreamBrowser();
6038
+ var Stream2 = streamBrowser$1;
6235
6039
  var Buffer2 = dist.Buffer;
6236
6040
  var OurUint8Array = (typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
6237
6041
  };
@@ -6250,14 +6054,14 @@ function require_stream_readable$1() {
6250
6054
  };
6251
6055
  }
6252
6056
  var BufferList2 = requireBuffer_list();
6253
- var destroyImpl = requireDestroy();
6254
- var _require = requireState(), getHighWaterMark = _require.getHighWaterMark;
6255
- var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
6057
+ var destroyImpl = destroy_1$1;
6058
+ var _require = state, getHighWaterMark2 = _require.getHighWaterMark;
6059
+ var _require$codes2 = errorsBrowser.codes, ERR_INVALID_ARG_TYPE = _require$codes2.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes2.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED2 = _require$codes2.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes2.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
6256
6060
  var StringDecoder2;
6257
6061
  var createReadableStreamAsyncIterator;
6258
6062
  var from;
6259
6063
  inherits_browserExports(Readable, Stream2);
6260
- var errorOrDestroy = destroyImpl.errorOrDestroy;
6064
+ var errorOrDestroy2 = destroyImpl.errorOrDestroy;
6261
6065
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
6262
6066
  function prependListener2(emitter, event, fn) {
6263
6067
  if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
@@ -6271,7 +6075,7 @@ function require_stream_readable$1() {
6271
6075
  if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex2;
6272
6076
  this.objectMode = !!options2.objectMode;
6273
6077
  if (isDuplex) this.objectMode = this.objectMode || !!options2.readableObjectMode;
6274
- this.highWaterMark = getHighWaterMark(this, options2, "readableHighWaterMark", isDuplex);
6078
+ this.highWaterMark = getHighWaterMark2(this, options2, "readableHighWaterMark", isDuplex);
6275
6079
  this.buffer = new BufferList2();
6276
6080
  this.length = 0;
6277
6081
  this.pipes = null;
@@ -6365,16 +6169,16 @@ function require_stream_readable$1() {
6365
6169
  var er;
6366
6170
  if (!skipChunkCheck) er = chunkInvalid(state2, chunk);
6367
6171
  if (er) {
6368
- errorOrDestroy(stream, er);
6172
+ errorOrDestroy2(stream, er);
6369
6173
  } else if (state2.objectMode || chunk && chunk.length > 0) {
6370
6174
  if (typeof chunk !== "string" && !state2.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
6371
6175
  chunk = _uint8ArrayToBuffer(chunk);
6372
6176
  }
6373
6177
  if (addToFront) {
6374
- if (state2.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
6178
+ if (state2.endEmitted) errorOrDestroy2(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
6375
6179
  else addChunk(stream, state2, chunk, true);
6376
6180
  } else if (state2.ended) {
6377
- errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
6181
+ errorOrDestroy2(stream, new ERR_STREAM_PUSH_AFTER_EOF());
6378
6182
  } else if (state2.destroyed) {
6379
6183
  return false;
6380
6184
  } else {
@@ -6542,7 +6346,7 @@ function require_stream_readable$1() {
6542
6346
  if (!state2.emittedReadable) {
6543
6347
  debug("emitReadable", state2.flowing);
6544
6348
  state2.emittedReadable = true;
6545
- process$1.nextTick(emitReadable_, stream);
6349
+ globals.process$1.nextTick(emitReadable_, stream);
6546
6350
  }
6547
6351
  }
6548
6352
  function emitReadable_(stream) {
@@ -6558,7 +6362,7 @@ function require_stream_readable$1() {
6558
6362
  function maybeReadMore(stream, state2) {
6559
6363
  if (!state2.readingMore) {
6560
6364
  state2.readingMore = true;
6561
- process$1.nextTick(maybeReadMore_, stream, state2);
6365
+ globals.process$1.nextTick(maybeReadMore_, stream, state2);
6562
6366
  }
6563
6367
  }
6564
6368
  function maybeReadMore_(stream, state2) {
@@ -6572,7 +6376,7 @@ function require_stream_readable$1() {
6572
6376
  state2.readingMore = false;
6573
6377
  }
6574
6378
  Readable.prototype._read = function(n) {
6575
- errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
6379
+ errorOrDestroy2(this, new ERR_METHOD_NOT_IMPLEMENTED2("_read()"));
6576
6380
  };
6577
6381
  Readable.prototype.pipe = function(dest, pipeOpts) {
6578
6382
  var src = this;
@@ -6590,9 +6394,9 @@ function require_stream_readable$1() {
6590
6394
  }
6591
6395
  state2.pipesCount += 1;
6592
6396
  debug("pipe count=%d opts=%j", state2.pipesCount, pipeOpts);
6593
- 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;
6594
6398
  var endFn = doEnd ? onend : unpipe;
6595
- if (state2.endEmitted) process$1.nextTick(endFn);
6399
+ if (state2.endEmitted) globals.process$1.nextTick(endFn);
6596
6400
  else src.once("end", endFn);
6597
6401
  dest.on("unpipe", onunpipe);
6598
6402
  function onunpipe(readable, unpipeInfo) {
@@ -6641,7 +6445,7 @@ function require_stream_readable$1() {
6641
6445
  debug("onerror", er);
6642
6446
  unpipe();
6643
6447
  dest.removeListener("error", onerror);
6644
- if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
6448
+ if (EElistenerCount(dest, "error") === 0) errorOrDestroy2(dest, er);
6645
6449
  }
6646
6450
  prependListener2(dest, "error", onerror);
6647
6451
  function onclose() {
@@ -6726,7 +6530,7 @@ function require_stream_readable$1() {
6726
6530
  if (state2.length) {
6727
6531
  emitReadable(this);
6728
6532
  } else if (!state2.reading) {
6729
- process$1.nextTick(nReadingNextTick, this);
6533
+ globals.process$1.nextTick(nReadingNextTick, this);
6730
6534
  }
6731
6535
  }
6732
6536
  }
@@ -6736,14 +6540,14 @@ function require_stream_readable$1() {
6736
6540
  Readable.prototype.removeListener = function(ev, fn) {
6737
6541
  var res = Stream2.prototype.removeListener.call(this, ev, fn);
6738
6542
  if (ev === "readable") {
6739
- process$1.nextTick(updateReadableListening, this);
6543
+ globals.process$1.nextTick(updateReadableListening, this);
6740
6544
  }
6741
6545
  return res;
6742
6546
  };
6743
6547
  Readable.prototype.removeAllListeners = function(ev) {
6744
6548
  var res = Stream2.prototype.removeAllListeners.apply(this, arguments);
6745
6549
  if (ev === "readable" || ev === void 0) {
6746
- process$1.nextTick(updateReadableListening, this);
6550
+ globals.process$1.nextTick(updateReadableListening, this);
6747
6551
  }
6748
6552
  return res;
6749
6553
  };
@@ -6773,7 +6577,7 @@ function require_stream_readable$1() {
6773
6577
  function resume(stream, state2) {
6774
6578
  if (!state2.resumeScheduled) {
6775
6579
  state2.resumeScheduled = true;
6776
- process$1.nextTick(resume_, stream, state2);
6580
+ globals.process$1.nextTick(resume_, stream, state2);
6777
6581
  }
6778
6582
  }
6779
6583
  function resume_(stream, state2) {
@@ -6914,7 +6718,7 @@ function require_stream_readable$1() {
6914
6718
  debug("endReadable", state2.endEmitted);
6915
6719
  if (!state2.endEmitted) {
6916
6720
  state2.ended = true;
6917
- process$1.nextTick(endReadableNT, state2, stream);
6721
+ globals.process$1.nextTick(endReadableNT, state2, stream);
6918
6722
  }
6919
6723
  }
6920
6724
  function endReadableNT(state2, stream) {
@@ -6947,213 +6751,192 @@ function require_stream_readable$1() {
6947
6751
  }
6948
6752
  return _stream_readable$1;
6949
6753
  }
6950
- var _stream_transform$1;
6951
- var hasRequired_stream_transform;
6952
- function require_stream_transform() {
6953
- if (hasRequired_stream_transform) return _stream_transform$1;
6954
- hasRequired_stream_transform = 1;
6955
- _stream_transform$1 = Transform2;
6956
- var _require$codes = requireErrorsBrowser().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
6957
- var Duplex2 = require_stream_duplex$1();
6958
- inherits_browserExports(Transform2, Duplex2);
6959
- function afterTransform2(er, data) {
6960
- var ts = this._transformState;
6961
- ts.transforming = false;
6962
- var cb = ts.writecb;
6963
- if (cb === null) {
6964
- return this.emit("error", new ERR_MULTIPLE_CALLBACK());
6965
- }
6966
- ts.writechunk = null;
6967
- ts.writecb = null;
6968
- if (data != null)
6969
- this.push(data);
6970
- cb(er);
6971
- var rs = this._readableState;
6972
- rs.reading = false;
6973
- if (rs.needReadable || rs.length < rs.highWaterMark) {
6974
- this._read(rs.highWaterMark);
6975
- }
6976
- }
6977
- function Transform2(options2) {
6978
- if (!(this instanceof Transform2)) return new Transform2(options2);
6979
- Duplex2.call(this, options2);
6980
- this._transformState = {
6981
- afterTransform: afterTransform2.bind(this),
6982
- needTransform: false,
6983
- transforming: false,
6984
- writecb: null,
6985
- writechunk: null,
6986
- writeencoding: null
6987
- };
6988
- this._readableState.needReadable = true;
6989
- this._readableState.sync = false;
6990
- if (options2) {
6991
- if (typeof options2.transform === "function") this._transform = options2.transform;
6992
- if (typeof options2.flush === "function") this._flush = options2.flush;
6993
- }
6994
- this.on("prefinish", prefinish2);
6754
+ var _stream_transform$1 = Transform$9;
6755
+ var _require$codes$1 = errorsBrowser.codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes$1.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes$1.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes$1.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes$1.ERR_TRANSFORM_WITH_LENGTH_0;
6756
+ var Duplex$1 = require_stream_duplex$1();
6757
+ inherits_browserExports(Transform$9, Duplex$1);
6758
+ function afterTransform$1(er, data) {
6759
+ var ts = this._transformState;
6760
+ ts.transforming = false;
6761
+ var cb = ts.writecb;
6762
+ if (cb === null) {
6763
+ return this.emit("error", new ERR_MULTIPLE_CALLBACK());
6995
6764
  }
6996
- function prefinish2() {
6997
- var _this = this;
6998
- if (typeof this._flush === "function" && !this._readableState.destroyed) {
6999
- this._flush(function(er, data) {
7000
- done2(_this, er, data);
7001
- });
7002
- } else {
7003
- done2(this, null, null);
7004
- }
6765
+ ts.writechunk = null;
6766
+ ts.writecb = null;
6767
+ if (data != null)
6768
+ this.push(data);
6769
+ cb(er);
6770
+ var rs = this._readableState;
6771
+ rs.reading = false;
6772
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
6773
+ this._read(rs.highWaterMark);
7005
6774
  }
7006
- Transform2.prototype.push = function(chunk, encoding) {
7007
- this._transformState.needTransform = false;
7008
- return Duplex2.prototype.push.call(this, chunk, encoding);
7009
- };
7010
- Transform2.prototype._transform = function(chunk, encoding, cb) {
7011
- cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
7012
- };
7013
- Transform2.prototype._write = function(chunk, encoding, cb) {
7014
- var ts = this._transformState;
7015
- ts.writecb = cb;
7016
- ts.writechunk = chunk;
7017
- ts.writeencoding = encoding;
7018
- if (!ts.transforming) {
7019
- var rs = this._readableState;
7020
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
7021
- }
7022
- };
7023
- Transform2.prototype._read = function(n) {
7024
- var ts = this._transformState;
7025
- if (ts.writechunk !== null && !ts.transforming) {
7026
- ts.transforming = true;
7027
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
7028
- } else {
7029
- ts.needTransform = true;
7030
- }
6775
+ }
6776
+ function Transform$9(options2) {
6777
+ if (!(this instanceof Transform$9)) return new Transform$9(options2);
6778
+ Duplex$1.call(this, options2);
6779
+ this._transformState = {
6780
+ afterTransform: afterTransform$1.bind(this),
6781
+ needTransform: false,
6782
+ transforming: false,
6783
+ writecb: null,
6784
+ writechunk: null,
6785
+ writeencoding: null
7031
6786
  };
7032
- Transform2.prototype._destroy = function(err, cb) {
7033
- Duplex2.prototype._destroy.call(this, err, function(err2) {
7034
- cb(err2);
6787
+ this._readableState.needReadable = true;
6788
+ this._readableState.sync = false;
6789
+ if (options2) {
6790
+ if (typeof options2.transform === "function") this._transform = options2.transform;
6791
+ if (typeof options2.flush === "function") this._flush = options2.flush;
6792
+ }
6793
+ this.on("prefinish", prefinish$1);
6794
+ }
6795
+ function prefinish$1() {
6796
+ var _this = this;
6797
+ if (typeof this._flush === "function" && !this._readableState.destroyed) {
6798
+ this._flush(function(er, data) {
6799
+ done$1(_this, er, data);
7035
6800
  });
7036
- };
7037
- function done2(stream, er, data) {
7038
- if (er) return stream.emit("error", er);
7039
- if (data != null)
7040
- stream.push(data);
7041
- if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
7042
- if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
7043
- return stream.push(null);
7044
- }
7045
- return _stream_transform$1;
7046
- }
7047
- var _stream_passthrough$1;
7048
- var hasRequired_stream_passthrough;
7049
- function require_stream_passthrough() {
7050
- if (hasRequired_stream_passthrough) return _stream_passthrough$1;
7051
- hasRequired_stream_passthrough = 1;
7052
- _stream_passthrough$1 = PassThrough2;
7053
- var Transform2 = require_stream_transform();
7054
- inherits_browserExports(PassThrough2, Transform2);
7055
- function PassThrough2(options2) {
7056
- if (!(this instanceof PassThrough2)) return new PassThrough2(options2);
7057
- Transform2.call(this, options2);
7058
- }
7059
- PassThrough2.prototype._transform = function(chunk, encoding, cb) {
7060
- cb(null, chunk);
7061
- };
7062
- return _stream_passthrough$1;
7063
- }
7064
- var pipeline_1;
7065
- var hasRequiredPipeline;
7066
- function requirePipeline() {
7067
- if (hasRequiredPipeline) return pipeline_1;
7068
- hasRequiredPipeline = 1;
7069
- var eos;
7070
- function once3(callback) {
7071
- var called = false;
7072
- return function() {
7073
- if (called) return;
7074
- called = true;
7075
- callback.apply(void 0, arguments);
7076
- };
6801
+ } else {
6802
+ done$1(this, null, null);
7077
6803
  }
7078
- var _require$codes = requireErrorsBrowser().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
7079
- function noop2(err) {
7080
- if (err) throw err;
6804
+ }
6805
+ Transform$9.prototype.push = function(chunk, encoding) {
6806
+ this._transformState.needTransform = false;
6807
+ return Duplex$1.prototype.push.call(this, chunk, encoding);
6808
+ };
6809
+ Transform$9.prototype._transform = function(chunk, encoding, cb) {
6810
+ cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
6811
+ };
6812
+ Transform$9.prototype._write = function(chunk, encoding, cb) {
6813
+ var ts = this._transformState;
6814
+ ts.writecb = cb;
6815
+ ts.writechunk = chunk;
6816
+ ts.writeencoding = encoding;
6817
+ if (!ts.transforming) {
6818
+ var rs = this._readableState;
6819
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
7081
6820
  }
7082
- function isRequest(stream) {
7083
- return stream.setHeader && typeof stream.abort === "function";
6821
+ };
6822
+ Transform$9.prototype._read = function(n) {
6823
+ var ts = this._transformState;
6824
+ if (ts.writechunk !== null && !ts.transforming) {
6825
+ ts.transforming = true;
6826
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
6827
+ } else {
6828
+ ts.needTransform = true;
7084
6829
  }
7085
- function destroyer(stream, reading, writing, callback) {
7086
- callback = once3(callback);
7087
- var closed = false;
7088
- stream.on("close", function() {
7089
- closed = true;
7090
- });
7091
- if (eos === void 0) eos = requireEndOfStream();
7092
- eos(stream, {
7093
- readable: reading,
7094
- writable: writing
7095
- }, function(err) {
7096
- if (err) return callback(err);
7097
- closed = true;
7098
- callback();
7099
- });
7100
- var destroyed = false;
7101
- return function(err) {
7102
- if (closed) return;
7103
- if (destroyed) return;
7104
- destroyed = true;
7105
- if (isRequest(stream)) return stream.abort();
7106
- if (typeof stream.destroy === "function") return stream.destroy();
7107
- callback(err || new ERR_STREAM_DESTROYED("pipe"));
7108
- };
7109
- }
7110
- function call2(fn) {
7111
- fn();
7112
- }
7113
- function pipe(from, to) {
7114
- return from.pipe(to);
7115
- }
7116
- function popCallback(streams) {
7117
- if (!streams.length) return noop2;
7118
- if (typeof streams[streams.length - 1] !== "function") return noop2;
7119
- return streams.pop();
7120
- }
7121
- function pipeline() {
7122
- for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
7123
- streams[_key] = arguments[_key];
7124
- }
7125
- var callback = popCallback(streams);
7126
- if (Array.isArray(streams[0])) streams = streams[0];
7127
- if (streams.length < 2) {
7128
- throw new ERR_MISSING_ARGS("streams");
7129
- }
7130
- var error2;
7131
- var destroys = streams.map(function(stream, i) {
7132
- var reading = i < streams.length - 1;
7133
- var writing = i > 0;
7134
- return destroyer(stream, reading, writing, function(err) {
7135
- if (!error2) error2 = err;
7136
- if (err) destroys.forEach(call2);
7137
- if (reading) return;
7138
- destroys.forEach(call2);
7139
- callback(error2);
7140
- });
6830
+ };
6831
+ Transform$9.prototype._destroy = function(err, cb) {
6832
+ Duplex$1.prototype._destroy.call(this, err, function(err2) {
6833
+ cb(err2);
6834
+ });
6835
+ };
6836
+ function done$1(stream, er, data) {
6837
+ if (er) return stream.emit("error", er);
6838
+ if (data != null)
6839
+ stream.push(data);
6840
+ if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
6841
+ if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
6842
+ return stream.push(null);
6843
+ }
6844
+ var _stream_passthrough$1 = PassThrough$1;
6845
+ var Transform$8 = _stream_transform$1;
6846
+ inherits_browserExports(PassThrough$1, Transform$8);
6847
+ function PassThrough$1(options2) {
6848
+ if (!(this instanceof PassThrough$1)) return new PassThrough$1(options2);
6849
+ Transform$8.call(this, options2);
6850
+ }
6851
+ PassThrough$1.prototype._transform = function(chunk, encoding, cb) {
6852
+ cb(null, chunk);
6853
+ };
6854
+ var eos;
6855
+ function once(callback) {
6856
+ var called = false;
6857
+ return function() {
6858
+ if (called) return;
6859
+ called = true;
6860
+ callback.apply(void 0, arguments);
6861
+ };
6862
+ }
6863
+ var _require$codes = errorsBrowser.codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
6864
+ function noop(err) {
6865
+ if (err) throw err;
6866
+ }
6867
+ function isRequest(stream) {
6868
+ return stream.setHeader && typeof stream.abort === "function";
6869
+ }
6870
+ function destroyer(stream, reading, writing, callback) {
6871
+ callback = once(callback);
6872
+ var closed = false;
6873
+ stream.on("close", function() {
6874
+ closed = true;
6875
+ });
6876
+ if (eos === void 0) eos = endOfStream;
6877
+ eos(stream, {
6878
+ readable: reading,
6879
+ writable: writing
6880
+ }, function(err) {
6881
+ if (err) return callback(err);
6882
+ closed = true;
6883
+ callback();
6884
+ });
6885
+ var destroyed = false;
6886
+ return function(err) {
6887
+ if (closed) return;
6888
+ if (destroyed) return;
6889
+ destroyed = true;
6890
+ if (isRequest(stream)) return stream.abort();
6891
+ if (typeof stream.destroy === "function") return stream.destroy();
6892
+ callback(err || new ERR_STREAM_DESTROYED("pipe"));
6893
+ };
6894
+ }
6895
+ function call(fn) {
6896
+ fn();
6897
+ }
6898
+ function pipe(from, to) {
6899
+ return from.pipe(to);
6900
+ }
6901
+ function popCallback(streams) {
6902
+ if (!streams.length) return noop;
6903
+ if (typeof streams[streams.length - 1] !== "function") return noop;
6904
+ return streams.pop();
6905
+ }
6906
+ function pipeline() {
6907
+ for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
6908
+ streams[_key] = arguments[_key];
6909
+ }
6910
+ var callback = popCallback(streams);
6911
+ if (Array.isArray(streams[0])) streams = streams[0];
6912
+ if (streams.length < 2) {
6913
+ throw new ERR_MISSING_ARGS("streams");
6914
+ }
6915
+ var error2;
6916
+ var destroys = streams.map(function(stream, i) {
6917
+ var reading = i < streams.length - 1;
6918
+ var writing = i > 0;
6919
+ return destroyer(stream, reading, writing, function(err) {
6920
+ if (!error2) error2 = err;
6921
+ if (err) destroys.forEach(call);
6922
+ if (reading) return;
6923
+ destroys.forEach(call);
6924
+ callback(error2);
7141
6925
  });
7142
- return streams.reduce(pipe);
7143
- }
7144
- pipeline_1 = pipeline;
7145
- return pipeline_1;
6926
+ });
6927
+ return streams.reduce(pipe);
7146
6928
  }
6929
+ var pipeline_1 = pipeline;
7147
6930
  (function(module2, exports2) {
7148
6931
  exports2 = module2.exports = require_stream_readable$1();
7149
6932
  exports2.Stream = exports2;
7150
6933
  exports2.Readable = exports2;
7151
6934
  exports2.Writable = require_stream_writable$1();
7152
6935
  exports2.Duplex = require_stream_duplex$1();
7153
- exports2.Transform = require_stream_transform();
7154
- exports2.PassThrough = require_stream_passthrough();
7155
- exports2.finished = requireEndOfStream();
7156
- exports2.pipeline = requirePipeline();
6936
+ exports2.Transform = _stream_transform$1;
6937
+ exports2.PassThrough = _stream_passthrough$1;
6938
+ exports2.finished = endOfStream;
6939
+ exports2.pipeline = pipeline_1;
7157
6940
  })(readableBrowser$1, readableBrowser$1.exports);
7158
6941
  var readableBrowserExports$1 = readableBrowser$1.exports;
7159
6942
  var Buffer$z = safeBufferExports$1.Buffer;
@@ -8564,10 +8347,10 @@ inherits$h(Stream, EE);
8564
8347
  Stream.Readable = require_stream_readable$1();
8565
8348
  Stream.Writable = require_stream_writable$1();
8566
8349
  Stream.Duplex = require_stream_duplex$1();
8567
- Stream.Transform = require_stream_transform();
8568
- Stream.PassThrough = require_stream_passthrough();
8569
- Stream.finished = requireEndOfStream();
8570
- Stream.pipeline = requirePipeline();
8350
+ Stream.Transform = _stream_transform$1;
8351
+ Stream.PassThrough = _stream_passthrough$1;
8352
+ Stream.finished = endOfStream;
8353
+ Stream.pipeline = pipeline_1;
8571
8354
  Stream.Stream = Stream;
8572
8355
  function Stream() {
8573
8356
  EE.call(this);
@@ -9007,7 +8790,7 @@ var defaultEncoding$2;
9007
8790
  if (commonjsGlobal.process && commonjsGlobal.process.browser) {
9008
8791
  defaultEncoding$2 = "utf-8";
9009
8792
  } else if (commonjsGlobal.process && commonjsGlobal.process.version) {
9010
- var pVersionMajor = parseInt(process$1.version.split(".")[0].slice(1), 10);
8793
+ var pVersionMajor = parseInt(globals.process$1.version.split(".")[0].slice(1), 10);
9011
8794
  defaultEncoding$2 = pVersionMajor >= 6 ? "utf-8" : "binary";
9012
8795
  } else {
9013
8796
  defaultEncoding$2 = "utf-8";
@@ -14704,10 +14487,10 @@ function requireBrowser$2() {
14704
14487
  }
14705
14488
  var readableBrowser = { exports: {} };
14706
14489
  var processNextickArgs = { exports: {} };
14707
- 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) {
14708
14491
  processNextickArgs.exports = { nextTick };
14709
14492
  } else {
14710
- processNextickArgs.exports = process$1;
14493
+ processNextickArgs.exports = globals.process$1;
14711
14494
  }
14712
14495
  function nextTick(fn, arg1, arg2, arg3) {
14713
14496
  if (typeof fn !== "function") {
@@ -14718,17 +14501,17 @@ function nextTick(fn, arg1, arg2, arg3) {
14718
14501
  switch (len) {
14719
14502
  case 0:
14720
14503
  case 1:
14721
- return process$1.nextTick(fn);
14504
+ return globals.process$1.nextTick(fn);
14722
14505
  case 2:
14723
- return process$1.nextTick(function afterTickOne() {
14506
+ return globals.process$1.nextTick(function afterTickOne() {
14724
14507
  fn.call(null, arg1);
14725
14508
  });
14726
14509
  case 3:
14727
- return process$1.nextTick(function afterTickTwo() {
14510
+ return globals.process$1.nextTick(function afterTickTwo() {
14728
14511
  fn.call(null, arg1, arg2);
14729
14512
  });
14730
14513
  case 4:
14731
- return process$1.nextTick(function afterTickThree() {
14514
+ return globals.process$1.nextTick(function afterTickThree() {
14732
14515
  fn.call(null, arg1, arg2, arg3);
14733
14516
  });
14734
14517
  default:
@@ -14737,7 +14520,7 @@ function nextTick(fn, arg1, arg2, arg3) {
14737
14520
  while (i < args.length) {
14738
14521
  args[i++] = arguments[i];
14739
14522
  }
14740
- return process$1.nextTick(function afterTick() {
14523
+ return globals.process$1.nextTick(function afterTick() {
14741
14524
  fn.apply(null, args);
14742
14525
  });
14743
14526
  }
@@ -15025,7 +14808,7 @@ function require_stream_writable() {
15025
14808
  onCorkedFinish(_this, state2);
15026
14809
  };
15027
14810
  }
15028
- 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;
15029
14812
  var Duplex2;
15030
14813
  Writable.WritableState = WritableState;
15031
14814
  var util2 = Object.create(util$2);
@@ -15868,7 +15651,7 @@ function require_stream_readable() {
15868
15651
  }
15869
15652
  state2.pipesCount += 1;
15870
15653
  debug("pipe count=%d opts=%j", state2.pipesCount, pipeOpts);
15871
- 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;
15872
15655
  var endFn = doEnd ? onend : unpipe;
15873
15656
  if (state2.endEmitted) pna2.nextTick(endFn);
15874
15657
  else src.once("end", endFn);
@@ -26648,7 +26431,7 @@ function assertSize(size, offset, length) {
26648
26431
  throw new RangeError("buffer too small");
26649
26432
  }
26650
26433
  }
26651
- if (crypto$1 && crypto$1.getRandomValues || !process$1.browser) {
26434
+ if (crypto$1 && crypto$1.getRandomValues || !globals.process$1.browser) {
26652
26435
  browser$1.randomFill = randomFill;
26653
26436
  browser$1.randomFillSync = randomFillSync;
26654
26437
  } else {
@@ -26674,12 +26457,12 @@ function randomFill(buf, offset, size, cb) {
26674
26457
  return actualFill(buf, offset, size, cb);
26675
26458
  }
26676
26459
  function actualFill(buf, offset, size, cb) {
26677
- if (process$1.browser) {
26460
+ if (globals.process$1.browser) {
26678
26461
  var ourBuf = buf.buffer;
26679
26462
  var uint = new Uint8Array(ourBuf, offset, size);
26680
26463
  crypto$1.getRandomValues(uint);
26681
26464
  if (cb) {
26682
- process$1.nextTick(function() {
26465
+ globals.process$1.nextTick(function() {
26683
26466
  cb(null, buf);
26684
26467
  });
26685
26468
  return;
@@ -26933,8 +26716,8 @@ function _dotenvKey(options2) {
26933
26716
  if (options2 && options2.DOTENV_KEY && options2.DOTENV_KEY.length > 0) {
26934
26717
  return options2.DOTENV_KEY;
26935
26718
  }
26936
- if (process$1.env.DOTENV_KEY && process$1.env.DOTENV_KEY.length > 0) {
26937
- 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;
26938
26721
  }
26939
26722
  return "";
26940
26723
  }
@@ -26984,7 +26767,7 @@ function _vaultPath(options2) {
26984
26767
  possibleVaultPath = options2.path.endsWith(".vault") ? options2.path : `${options2.path}.vault`;
26985
26768
  }
26986
26769
  } else {
26987
- possibleVaultPath = path.resolve(process$1.cwd(), ".env.vault");
26770
+ possibleVaultPath = path.resolve(globals.process$1.cwd(), ".env.vault");
26988
26771
  }
26989
26772
  if (fs.existsSync(possibleVaultPath)) {
26990
26773
  return possibleVaultPath;
@@ -26997,7 +26780,7 @@ function _resolveHome(envPath) {
26997
26780
  function _configVault(options2) {
26998
26781
  _log("Loading env from encrypted .env.vault");
26999
26782
  const parsed = DotenvModule._parseVault(options2);
27000
- let processEnv = process$1.env;
26783
+ let processEnv = globals.process$1.env;
27001
26784
  if (options2 && options2.processEnv != null) {
27002
26785
  processEnv = options2.processEnv;
27003
26786
  }
@@ -27005,7 +26788,7 @@ function _configVault(options2) {
27005
26788
  return { parsed };
27006
26789
  }
27007
26790
  function configDotenv(options2) {
27008
- const dotenvPath = path.resolve(process$1.cwd(), ".env");
26791
+ const dotenvPath = path.resolve(globals.process$1.cwd(), ".env");
27009
26792
  let encoding = "utf8";
27010
26793
  const debug = Boolean(options2 && options2.debug);
27011
26794
  if (options2 && options2.encoding) {
@@ -27039,7 +26822,7 @@ function configDotenv(options2) {
27039
26822
  lastError = e;
27040
26823
  }
27041
26824
  }
27042
- let processEnv = process$1.env;
26825
+ let processEnv = globals.process$1.env;
27043
26826
  if (options2 && options2.processEnv != null) {
27044
26827
  processEnv = options2.processEnv;
27045
26828
  }
@@ -27132,20 +26915,20 @@ main$2.exports.populate = DotenvModule.populate;
27132
26915
  main$2.exports = DotenvModule;
27133
26916
  var mainExports = main$2.exports;
27134
26917
  const options = {};
27135
- if (process$1.env.DOTENV_CONFIG_ENCODING != null) {
27136
- 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;
27137
26920
  }
27138
- if (process$1.env.DOTENV_CONFIG_PATH != null) {
27139
- 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;
27140
26923
  }
27141
- if (process$1.env.DOTENV_CONFIG_DEBUG != null) {
27142
- 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;
27143
26926
  }
27144
- if (process$1.env.DOTENV_CONFIG_OVERRIDE != null) {
27145
- 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;
27146
26929
  }
27147
- if (process$1.env.DOTENV_CONFIG_DOTENV_KEY != null) {
27148
- 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;
27149
26932
  }
27150
26933
  var envOptions = options;
27151
26934
  const re = /^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;
@@ -27163,7 +26946,7 @@ var cliOptions = function optionMatcher(args) {
27163
26946
  Object.assign(
27164
26947
  {},
27165
26948
  envOptions,
27166
- cliOptions(process$1.argv)
26949
+ cliOptions(globals.process$1.argv)
27167
26950
  )
27168
26951
  );
27169
26952
  })();
@@ -27179,7 +26962,7 @@ const GetValidatorDocument = { "kind": "Document", "definitions": [{ "kind": "Op
27179
26962
  const GetClusterBalanceDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetClusterBalance" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "clusterId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "daoAddress" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ID" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "operatorIds" } }, "type": { "kind": "NonNullType", "type": { "kind": "ListType", "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "_meta" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "block" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "number" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "daovalues" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "daoAddress" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "networkFee" } }, { "kind": "Field", "name": { "kind": "Name", "value": "networkFeeIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "networkFeeIndexBlockNumber" } }, { "kind": "Field", "name": { "kind": "Name", "value": "liquidationThreshold" } }, { "kind": "Field", "name": { "kind": "Name", "value": "minimumLiquidationCollateral" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "operators" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "where" }, "value": { "kind": "ObjectValue", "fields": [{ "kind": "ObjectField", "name": { "kind": "Name", "value": "id_in" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "operatorIds" } } }] } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "fee" } }, { "kind": "Field", "name": { "kind": "Name", "value": "feeIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "feeIndexBlockNumber" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "cluster" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "clusterId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "validatorCount" } }, { "kind": "Field", "name": { "kind": "Name", "value": "networkFeeIndex" } }, { "kind": "Field", "name": { "kind": "Name", "value": "index" } }, { "kind": "Field", "name": { "kind": "Name", "value": "balance" } }] } }] } }] };
27180
26963
  const getOwnerNonce = (client, args) => {
27181
26964
  const document2 = typeof args.block === "number" ? GetOwnerNonceByBlockDocument : GetOwnerNonceDocument;
27182
- return client.request(document2, args).then((r2) => r2.account?.nonce);
26965
+ return client.request(document2, args).then((r2) => r2.account?.nonce || "0").catch(() => "0");
27183
26966
  };
27184
26967
  const getClusterSnapshot = (client, args) => client.request(GetClusterSnapshotDocument, args).then((res) => res.cluster);
27185
26968
  const getCluster = (client, args) => client.request(GetClusterDocument, args).then((res) => res.cluster);
@@ -27188,14 +26971,14 @@ const getOperator = (client, args) => client.request(GetOperatorDocument, args).
27188
26971
  if (!res.operator) return null;
27189
26972
  return {
27190
26973
  ...res.operator,
27191
- publicKey: config$2.decodeOperatorPublicKey(res.operator.publicKey),
26974
+ publicKey: globals.decodeOperatorPublicKey(res.operator.publicKey),
27192
26975
  whitelisted: res.operator.whitelisted.map((v) => v.id)
27193
26976
  };
27194
26977
  });
27195
26978
  const getOperators = (client, args) => client.request(GetOperatorsDocument, args).then(
27196
26979
  (res) => res.operators.map((o) => ({
27197
26980
  ...o,
27198
- publicKey: config$2.decodeOperatorPublicKey(o.publicKey),
26981
+ publicKey: globals.decodeOperatorPublicKey(o.publicKey),
27199
26982
  whitelisted: o.whitelisted.map((v) => v.id)
27200
26983
  }))
27201
26984
  );
@@ -27213,101 +26996,6 @@ const getQueries = (client) => ({
27213
26996
  getValidator: getValidator.bind(null, client),
27214
26997
  getClusterBalance: getClusterBalance$1.bind(null, client)
27215
26998
  });
27216
- function defineChain(chain) {
27217
- return {
27218
- formatters: void 0,
27219
- fees: void 0,
27220
- serializers: void 0,
27221
- ...chain
27222
- };
27223
- }
27224
- const holesky = /* @__PURE__ */ defineChain({
27225
- id: 17e3,
27226
- name: "Holesky",
27227
- nativeCurrency: { name: "Holesky Ether", symbol: "ETH", decimals: 18 },
27228
- rpcUrls: {
27229
- default: {
27230
- http: ["https://ethereum-holesky-rpc.publicnode.com"]
27231
- }
27232
- },
27233
- blockExplorers: {
27234
- default: {
27235
- name: "Etherscan",
27236
- url: "https://holesky.etherscan.io",
27237
- apiUrl: "https://api-holesky.etherscan.io/api"
27238
- }
27239
- },
27240
- contracts: {
27241
- multicall3: {
27242
- address: "0xca11bde05977b3631167028862be2a173976ca11",
27243
- blockCreated: 77
27244
- },
27245
- ensRegistry: {
27246
- address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
27247
- blockCreated: 801613
27248
- },
27249
- ensUniversalResolver: {
27250
- address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",
27251
- blockCreated: 973484
27252
- }
27253
- },
27254
- testnet: true
27255
- });
27256
- const mainnet = /* @__PURE__ */ defineChain({
27257
- id: 1,
27258
- name: "Ethereum",
27259
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
27260
- rpcUrls: {
27261
- default: {
27262
- http: ["https://cloudflare-eth.com"]
27263
- }
27264
- },
27265
- blockExplorers: {
27266
- default: {
27267
- name: "Etherscan",
27268
- url: "https://etherscan.io",
27269
- apiUrl: "https://api.etherscan.io/api"
27270
- }
27271
- },
27272
- contracts: {
27273
- ensRegistry: {
27274
- address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
27275
- },
27276
- ensUniversalResolver: {
27277
- address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
27278
- blockCreated: 19258213
27279
- },
27280
- multicall3: {
27281
- address: "0xca11bde05977b3631167028862be2a173976ca11",
27282
- blockCreated: 14353601
27283
- }
27284
- }
27285
- });
27286
- const chains = {
27287
- mainnet,
27288
- holesky
27289
- };
27290
- const chainIds = Object.values(chains).map((chain) => chain.id);
27291
- const graph_endpoints = {
27292
- [mainnet.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-ethereum/version/latest",
27293
- [holesky.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-holesky/version/latest"
27294
- };
27295
- const rest_endpoints = {
27296
- [mainnet.id]: "https://api.ssv.network/api/v4/mainnet",
27297
- [holesky.id]: "https://api.ssv.network/api/v4/holesky"
27298
- };
27299
- const contracts = {
27300
- [mainnet.id]: {
27301
- setter: "0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1",
27302
- getter: "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4",
27303
- token: "0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54"
27304
- },
27305
- [holesky.id]: {
27306
- setter: "0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA",
27307
- getter: "0x352A18AEe90cdcd825d1E37d9939dCA86C00e281",
27308
- token: "0xad45A78180961079BFaeEe349704F411dfF947C6"
27309
- }
27310
- };
27311
26999
  const MainnetV4GetterABI = [
27312
27000
  {
27313
27001
  inputs: [],
@@ -31984,7 +31672,7 @@ function setCacheHas(value) {
31984
31672
  }
31985
31673
  function SetCache(values) {
31986
31674
  var index = -1, length = values == null ? 0 : values.length;
31987
- this.__data__ = new config$2.MapCache();
31675
+ this.__data__ = new globals.MapCache();
31988
31676
  while (++index < length) {
31989
31677
  this.add(values[index]);
31990
31678
  }
@@ -32064,7 +31752,7 @@ function setToArray(set) {
32064
31752
  var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
32065
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]";
32066
31754
  var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
32067
- 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;
32068
31756
  function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
32069
31757
  switch (tag) {
32070
31758
  case dataViewTag:
@@ -32074,14 +31762,14 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
32074
31762
  object = object.buffer;
32075
31763
  other = other.buffer;
32076
31764
  case arrayBufferTag:
32077
- 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))) {
32078
31766
  return false;
32079
31767
  }
32080
31768
  return true;
32081
31769
  case boolTag:
32082
31770
  case dateTag:
32083
31771
  case numberTag:
32084
- return config$2.eq(+object, +other);
31772
+ return globals.eq(+object, +other);
32085
31773
  case errorTag:
32086
31774
  return object.name == other.name && object.message == other.message;
32087
31775
  case regexpTag:
@@ -32115,7 +31803,7 @@ var COMPARE_PARTIAL_FLAG$1 = 1;
32115
31803
  var objectProto$1 = Object.prototype;
32116
31804
  var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
32117
31805
  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
32118
- 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;
32119
31807
  if (objLength != othLength && !isPartial) {
32120
31808
  return false;
32121
31809
  }
@@ -32162,40 +31850,40 @@ var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[o
32162
31850
  var objectProto = Object.prototype;
32163
31851
  var hasOwnProperty = objectProto.hasOwnProperty;
32164
31852
  function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
32165
- 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);
32166
31854
  objTag = objTag == argsTag ? objectTag : objTag;
32167
31855
  othTag = othTag == argsTag ? objectTag : othTag;
32168
31856
  var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
32169
- if (isSameTag && config$2.isBuffer(object)) {
32170
- if (!config$2.isBuffer(other)) {
31857
+ if (isSameTag && globals.isBuffer(object)) {
31858
+ if (!globals.isBuffer(other)) {
32171
31859
  return false;
32172
31860
  }
32173
31861
  objIsArr = true;
32174
31862
  objIsObj = false;
32175
31863
  }
32176
31864
  if (isSameTag && !objIsObj) {
32177
- stack || (stack = new config$2.Stack());
32178
- 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);
32179
31867
  }
32180
31868
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
32181
31869
  var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
32182
31870
  if (objIsWrapped || othIsWrapped) {
32183
31871
  var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
32184
- stack || (stack = new config$2.Stack());
31872
+ stack || (stack = new globals.Stack());
32185
31873
  return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
32186
31874
  }
32187
31875
  }
32188
31876
  if (!isSameTag) {
32189
31877
  return false;
32190
31878
  }
32191
- stack || (stack = new config$2.Stack());
31879
+ stack || (stack = new globals.Stack());
32192
31880
  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
32193
31881
  }
32194
31882
  function baseIsEqual(value, other, bitmask, customizer, stack) {
32195
31883
  if (value === other) {
32196
31884
  return true;
32197
31885
  }
32198
- 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)) {
32199
31887
  return value !== value && other !== other;
32200
31888
  }
32201
31889
  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
@@ -32207,10 +31895,10 @@ const paramsToArray = ({
32207
31895
  params,
32208
31896
  abiFunction
32209
31897
  }) => {
32210
- return config$2.stringifyBigints(
31898
+ return globals.stringifyBigints(
32211
31899
  abiFunction.inputs.reduce(
32212
31900
  (acc, param) => {
32213
- if (param.name && !config$2.isUndefined(params[param.name])) {
31901
+ if (param.name && !globals.isUndefined(params[param.name])) {
32214
31902
  return [...acc, params[param.name]];
32215
31903
  } else {
32216
31904
  console.error(`Missing argument for ${param}`);
@@ -32321,7 +32009,7 @@ const createWriter = ({
32321
32009
  acc.push(event);
32322
32010
  } catch {
32323
32011
  for (const eventAbi of ABIS) {
32324
- config$2.tryCatch(() => {
32012
+ globals.tryCatch(() => {
32325
32013
  const event = viem.decodeEventLog({
32326
32014
  abi: eventAbi,
32327
32015
  data: log.data,
@@ -33622,7 +33310,7 @@ function getObjectTag(object) {
33622
33310
  return tag;
33623
33311
  }
33624
33312
  const isProduction = globalThis.process && // eslint-disable-next-line no-undef
33625
- process$1.env.NODE_ENV === "production";
33313
+ globals.process$1.env.NODE_ENV === "production";
33626
33314
  const instanceOf = (
33627
33315
  /* c8 ignore next 6 */
33628
33316
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
@@ -35913,23 +35601,28 @@ const createContractInteractions = ({
35913
35601
  };
35914
35602
  };
35915
35603
  const createConfig = (props) => {
35916
- const parsed = config$2.configArgsSchema.parse(props);
35917
- const { walletClient, publicClient } = parsed;
35918
- if (!walletClient.chain || !publicClient.chain || !chainIds.includes(walletClient.chain?.id) || !chainIds.includes(publicClient.chain?.id))
35919
- throw new Error(`Chain must be one of ${chainIds.join(", ")}`);
35920
- 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
+ };
35921
35614
  const contract = createContractInteractions({
35922
- walletClient,
35923
- publicClient,
35924
- addresses: contracts[chainId]
35615
+ walletClient: parsed.walletClient,
35616
+ publicClient: parsed.publicClient,
35617
+ addresses
35925
35618
  });
35926
- const graphEndpoint = graph_endpoints[chainId];
35927
- const restEndpoint = rest_endpoints[chainId];
35619
+ const graphEndpoint = parsed._?.graphUrl || globals.graph_endpoints[chainId];
35620
+ const restEndpoint = parsed._?.restUrl || globals.rest_endpoints[chainId];
35928
35621
  const graphQLClient = new GraphQLClient(graphEndpoint);
35929
35622
  return {
35930
- publicClient,
35931
- walletClient,
35932
- chain: walletClient.chain,
35623
+ publicClient: parsed.publicClient,
35624
+ walletClient: parsed.walletClient,
35625
+ chain: parsed.walletClient.chain,
35933
35626
  graphEndpoint,
35934
35627
  restEndpoint,
35935
35628
  api: {
@@ -35937,49 +35630,17 @@ const createConfig = (props) => {
35937
35630
  ...createSSVAPI(restEndpoint)
35938
35631
  },
35939
35632
  graphQLClient,
35940
- contractAddresses: contracts[chainId],
35633
+ contractAddresses: addresses,
35941
35634
  contract
35942
35635
  };
35943
35636
  };
35944
- const globals = {
35945
- MAX_WEI_AMOUNT: 115792089237316195423570985008687907853269984665640564039457584007913129639935n,
35946
- CLUSTER_SIZES: {
35947
- QUAD_CLUSTER: 4,
35948
- SEPT_CLUSTER: 7,
35949
- DECA_CLUSTER: 10,
35950
- TRISKAIDEKA_CLUSTER: 13
35951
- },
35952
- FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE: {
35953
- QUAD_CLUSTER: 80,
35954
- SEPT_CLUSTER: 40,
35955
- DECA_CLUSTER: 30,
35956
- TRISKAIDEKA_CLUSTER: 20
35957
- },
35958
- BLOCKS_PER_DAY: 7160n,
35959
- OPERATORS_PER_PAGE: 50,
35960
- BLOCKS_PER_YEAR: 2613400n,
35961
- DEFAULT_CLUSTER_PERIOD: 730,
35962
- NUMBERS_OF_WEEKS_IN_YEAR: 52.1429,
35963
- MAX_VALIDATORS_COUNT_MULTI_FLOW: 50,
35964
- CLUSTER_VALIDITY_PERIOD_MINIMUM: 30,
35965
- OPERATOR_VALIDATORS_LIMIT_PRESERVE: 5,
35966
- MINIMUM_OPERATOR_FEE_PER_BLOCK: 1000000000n,
35967
- MIN_VALIDATORS_COUNT_PER_BULK_REGISTRATION: 1,
35968
- DEFAULT_ADDRESS_WHITELIST: "0x0000000000000000000000000000000000000000"
35969
- };
35970
- const registerValidatorsByClusterSizeLimits = {
35971
- [globals.CLUSTER_SIZES.QUAD_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.QUAD_CLUSTER,
35972
- [globals.CLUSTER_SIZES.SEPT_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.SEPT_CLUSTER,
35973
- [globals.CLUSTER_SIZES.DECA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.DECA_CLUSTER,
35974
- [globals.CLUSTER_SIZES.TRISKAIDEKA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.TRISKAIDEKA_CLUSTER
35975
- };
35976
35637
  const deposit = async (config2, { args: { id, amount }, ...writeOptions }, options2 = {}) => {
35977
35638
  const cluster = await config2.api.getCluster({ id });
35978
35639
  console.log("cluster:", cluster);
35979
35640
  if (!cluster) {
35980
35641
  throw new Error("Cluster not found");
35981
35642
  }
35982
- const snapshot = config$2.getClusterSnapshot(cluster);
35643
+ const snapshot = globals.getClusterSnapshot(cluster);
35983
35644
  if (options2?.approve) {
35984
35645
  const allowance = await config2.contract.token.read.allowance({
35985
35646
  owner: config2.walletClient.account.address,
@@ -35998,7 +35659,7 @@ const deposit = async (config2, { args: { id, amount }, ...writeOptions }, optio
35998
35659
  args: {
35999
35660
  amount,
36000
35661
  cluster: snapshot,
36001
- clusterOwner: process$1.env.OWNER_ADDRESS,
35662
+ clusterOwner: globals.process$1.env.OWNER_ADDRESS,
36002
35663
  operatorIds: cluster.operatorIds.map(BigInt)
36003
35664
  },
36004
35665
  ...writeOptions
@@ -36029,7 +35690,7 @@ const liquidateCluster = async (config2, { args: { id }, ...writeOptions }) => {
36029
35690
  }
36030
35691
  return config2.contract.ssv.write.liquidate({
36031
35692
  args: {
36032
- cluster: config$2.getClusterSnapshot(cluster),
35693
+ cluster: globals.getClusterSnapshot(cluster),
36033
35694
  clusterOwner: config2.walletClient.account.address,
36034
35695
  operatorIds: cluster.operatorIds.map(BigInt)
36035
35696
  },
@@ -36043,7 +35704,7 @@ const reactivateCluster = async (config2, { args: { id, amount }, ...writeOption
36043
35704
  }
36044
35705
  return config2.contract.ssv.write.reactivate({
36045
35706
  args: {
36046
- cluster: config$2.getClusterSnapshot(cluster),
35707
+ cluster: globals.getClusterSnapshot(cluster),
36047
35708
  amount,
36048
35709
  operatorIds: cluster.operatorIds.map(BigInt)
36049
35710
  },
@@ -36052,24 +35713,24 @@ const reactivateCluster = async (config2, { args: { id, amount }, ...writeOption
36052
35713
  };
36053
35714
  const registerValidators = async (config2, { args: { keyshares, depositAmount = 0n }, ...writeOptions }) => {
36054
35715
  const shares = keyshares.map((share) => {
36055
- return config$2.isKeySharesItem(share) ? share.payload : share;
35716
+ return globals.isKeySharesItem(share) ? share.payload : share;
36056
35717
  });
36057
35718
  const operatorIds = shares[0].operatorIds;
36058
35719
  const clusterSize = operatorIds.length;
36059
- const limit = registerValidatorsByClusterSizeLimits[clusterSize];
35720
+ const limit = globals.registerValidatorsByClusterSizeLimits[clusterSize];
36060
35721
  if (!limit) {
36061
35722
  throw new Error(
36062
- `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(", ")}`
36063
35724
  );
36064
35725
  }
36065
35726
  if (shares.length > limit) {
36066
35727
  throw new Error(`You can't register more than ${limit} validators in a single transaction`);
36067
35728
  }
36068
- const clusterId = config$2.createClusterId(config2.walletClient.account.address, operatorIds);
35729
+ const clusterId = globals.createClusterId(config2.walletClient.account.address, operatorIds);
36069
35730
  const cluster = await config2.api.getCluster({
36070
35731
  id: clusterId
36071
35732
  });
36072
- const snapshot = cluster ? config$2.getClusterSnapshot(cluster) : config$2.createEmptyCluster();
35733
+ const snapshot = cluster ? globals.getClusterSnapshot(cluster) : globals.createEmptyCluster();
36073
35734
  if (shares.length === 1) {
36074
35735
  return config2.contract.ssv.write.registerValidator(
36075
35736
  {
@@ -36104,7 +35765,7 @@ const validateSharesPostRegistration = async (config2, args) => {
36104
35765
  owner: config2.walletClient.account.address,
36105
35766
  block: Number(receipt.blockNumber) - 1
36106
35767
  });
36107
- if (config$2.isUndefined(ownerNonce)) {
35768
+ if (globals.isUndefined(ownerNonce)) {
36108
35769
  throw new Error("Could not fetch owner nonce");
36109
35770
  }
36110
35771
  const validatorAddedEvents = await config2.publicClient.getContractEvents({
@@ -36153,7 +35814,7 @@ const removeValidators = async (config2, { args: { id, publicKeys }, ...writeOpt
36153
35814
  if (publicKeys.length === 1) {
36154
35815
  return config2.contract.ssv.write.removeValidator({
36155
35816
  args: {
36156
- cluster: config$2.getClusterSnapshot(cluster),
35817
+ cluster: globals.getClusterSnapshot(cluster),
36157
35818
  publicKey: publicKeys[0],
36158
35819
  operatorIds: cluster.operatorIds.map(BigInt)
36159
35820
  },
@@ -36162,7 +35823,7 @@ const removeValidators = async (config2, { args: { id, publicKeys }, ...writeOpt
36162
35823
  }
36163
35824
  return config2.contract.ssv.write.bulkRemoveValidator({
36164
35825
  args: {
36165
- cluster: config$2.getClusterSnapshot(cluster),
35826
+ cluster: globals.getClusterSnapshot(cluster),
36166
35827
  publicKeys,
36167
35828
  operatorIds: cluster.operatorIds.map(BigInt)
36168
35829
  },
@@ -36185,7 +35846,7 @@ const withdraw$1 = async (config2, { args: { id, amount }, ...writeOptions }) =>
36185
35846
  return config2.contract.ssv.write.withdraw({
36186
35847
  args: {
36187
35848
  amount,
36188
- cluster: config$2.getClusterSnapshot(cluster),
35849
+ cluster: globals.getClusterSnapshot(cluster),
36189
35850
  operatorIds: cluster.operatorIds.map(BigInt)
36190
35851
  },
36191
35852
  ...writeOptions
@@ -36230,7 +35891,7 @@ const registerOperator = async (config2, { args: { isPrivate, yearlyFee, publicK
36230
35891
  return config2.contract.ssv.write.registerOperator({
36231
35892
  args: {
36232
35893
  publicKey: viem.encodeAbiParameters(viem.parseAbiParameters("string"), [publicKey]),
36233
- fee: config$2.roundOperatorFee(yearlyFee / globals.BLOCKS_PER_YEAR),
35894
+ fee: globals.roundOperatorFee(yearlyFee / globals.globals.BLOCKS_PER_YEAR),
36234
35895
  setPrivate: isPrivate
36235
35896
  },
36236
35897
  ...writeOptions
@@ -36287,7 +35948,7 @@ const getClusterBalance = async (config2, { operatorIds }) => {
36287
35948
  const query = await config2.api.getClusterBalance({
36288
35949
  daoAddress: config2.contractAddresses.setter,
36289
35950
  operatorIds: operatorIds.map(String),
36290
- clusterId: config$2.createClusterId(config2.walletClient.account.address, operatorIds)
35951
+ clusterId: globals.createClusterId(config2.walletClient.account.address, operatorIds)
36291
35952
  });
36292
35953
  if (!query.cluster || !query.daovalues || !query._meta) {
36293
35954
  throw new Error("Could not fetch cluster balance");
@@ -36303,9 +35964,9 @@ const getClusterBalance = async (config2, { operatorIds }) => {
36303
35964
  const calculatedClusterBalance = BigInt(query.cluster.balance) - (cumulativeNetworkFee + cumulativeOperatorFee) * BigInt(query.cluster.validatorCount) || 1n;
36304
35965
  const burnRate = (operatorsFee + BigInt(query.daovalues.networkFee)) * BigInt(query.cluster.validatorCount) || 1n;
36305
35966
  const mLc = BigInt(query.daovalues.minimumLiquidationCollateral);
36306
- const LC = config$2.bigintMax(mLc, burnRate * BigInt(query.daovalues.liquidationThreshold));
35967
+ const LC = globals.bigintMax(mLc, burnRate * BigInt(query.daovalues.liquidationThreshold));
36307
35968
  const runwaySSV = calculatedClusterBalance - LC;
36308
- const operationalRunway = runwaySSV / burnRate / globals.BLOCKS_PER_DAY;
35969
+ const operationalRunway = runwaySSV / burnRate / globals.globals.BLOCKS_PER_DAY;
36309
35970
  return {
36310
35971
  balance: calculatedClusterBalance,
36311
35972
  operationalRunway
@@ -36370,9 +36031,9 @@ const validateKeysharesJSON = async ({
36370
36031
  keyshares
36371
36032
  }) => {
36372
36033
  const shares = (await ssvKeys$2.KeyShares.fromJson(keyshares)).list();
36373
- config$2.ensureNoKeysharesErrors(shares);
36374
- config$2.ensureValidatorsUniqueness(shares);
36375
- config$2.validateConsistentOperatorPublicKeys(shares, operators);
36034
+ globals.ensureNoKeysharesErrors(shares);
36035
+ globals.ensureValidatorsUniqueness(shares);
36036
+ globals.validateConsistentOperatorPublicKeys(shares, operators);
36376
36037
  await Promise.all(
36377
36038
  shares.map(
36378
36039
  (share) => share.validateSingleShares(share.payload.sharesData, {
@@ -36382,10 +36043,10 @@ const validateKeysharesJSON = async ({
36382
36043
  })
36383
36044
  )
36384
36045
  );
36385
- const shareOperatorIds = config$2.validateConsistentOperatorIds(shares);
36386
- const operatorIds = config$2.sortNumbers(operators.map((operator) => Number(operator.id)));
36387
- if (!isEqual(config$2.sortNumbers(shareOperatorIds), config$2.sortNumbers(operatorIds))) {
36388
- 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);
36389
36050
  }
36390
36051
  return shares;
36391
36052
  };
@@ -36462,10 +36123,16 @@ class SSVSDK {
36462
36123
  this.utils = createUtils(this.config);
36463
36124
  }
36464
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;
36465
36135
  exports.SSVSDK = SSVSDK;
36466
- exports.chainIds = chainIds;
36467
- exports.chains = chains;
36468
- exports.contracts = contracts;
36469
36136
  exports.createClusterManager = createClusterManager;
36470
36137
  exports.createConfig = createConfig;
36471
36138
  exports.createContractInteractions = createContractInteractions;
@@ -36485,8 +36152,4 @@ exports.getOwnerNonce = getOwnerNonce;
36485
36152
  exports.getQueries = getQueries;
36486
36153
  exports.getValidator = getValidator;
36487
36154
  exports.getValidators = getValidators;
36488
- exports.globals = globals;
36489
- exports.graph_endpoints = graph_endpoints;
36490
36155
  exports.isConfig = isConfig;
36491
- exports.registerValidatorsByClusterSizeLimits = registerValidatorsByClusterSizeLimits;
36492
- exports.rest_endpoints = rest_endpoints;