@ssv-labs/ssv-sdk 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.mjs CHANGED
@@ -1,168 +1,7 @@
1
- import { d as decodeOperatorPublicKey, M as MapCache, S as Symbol$1, e as eq, U as Uint8Array$1, g as getAllKeys, a as getTag, i as isBuffer, b as Stack, c as isTypedArray$1, f as isArray$1, h as isObjectLike$1, s as stringifyBigints, j as isUndefined$1, t as tryCatch$1, k as configArgsSchema, l as getClusterSnapshot$1, m as isKeySharesItem, n as createClusterId, o as createEmptyCluster, r as roundOperatorFee, p as bigintMax, q as ensureNoKeysharesErrors, u as ensureValidatorsUniqueness, v as validateConsistentOperatorPublicKeys, w as validateConsistentOperatorIds, x as sortNumbers, K as KeysharesValidationError, y as KeysharesValidationErrors } from "./config-DlwfpwZd.mjs";
2
- import { defineChain as defineChain$1, decodeEventLog, encodeAbiParameters, parseAbiParameters, isAddressEqual, zeroAddress } from "viem";
1
+ import { p as process$1, d as decodeOperatorPublicKey, M as MapCache, S as Symbol$1, e as eq, U as Uint8Array$1, g as getAllKeys, a as getTag, i as isBuffer, b as Stack, c as isTypedArray$1, f as isArray$1, h as isObjectLike$1, s as stringifyBigints, j as isUndefined$1, t as tryCatch$1, k as configArgsSchema, l as chainIds, m as contracts, n as graph_endpoints, r as rest_endpoints, o as getClusterSnapshot$1, q as isKeySharesItem, u as registerValidatorsByClusterSizeLimits, v as createClusterId, w as createEmptyCluster, x as roundOperatorFee, y as globals, z as bigintMax, A as ensureNoKeysharesErrors, B as ensureValidatorsUniqueness, C as validateConsistentOperatorPublicKeys, D as validateConsistentOperatorIds, E as sortNumbers, K as KeysharesValidationError, F as KeysharesValidationErrors } from "./globals-DsbufPrE.mjs";
2
+ import { H, G as G2, I } from "./globals-DsbufPrE.mjs";
3
+ import { decodeEventLog, encodeAbiParameters, parseAbiParameters, isAddressEqual, zeroAddress } from "viem";
3
4
  import { SSVKeys, KeyShares, KeySharesItem } from "ssv-keys";
4
- function getDefaultExportFromCjs$1(x) {
5
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
6
- }
7
- var browser$e = { exports: {} };
8
- var process = browser$e.exports = {};
9
- var cachedSetTimeout;
10
- var cachedClearTimeout;
11
- function defaultSetTimout() {
12
- throw new Error("setTimeout has not been defined");
13
- }
14
- function defaultClearTimeout() {
15
- throw new Error("clearTimeout has not been defined");
16
- }
17
- (function() {
18
- try {
19
- if (typeof setTimeout === "function") {
20
- cachedSetTimeout = setTimeout;
21
- } else {
22
- cachedSetTimeout = defaultSetTimout;
23
- }
24
- } catch (e) {
25
- cachedSetTimeout = defaultSetTimout;
26
- }
27
- try {
28
- if (typeof clearTimeout === "function") {
29
- cachedClearTimeout = clearTimeout;
30
- } else {
31
- cachedClearTimeout = defaultClearTimeout;
32
- }
33
- } catch (e) {
34
- cachedClearTimeout = defaultClearTimeout;
35
- }
36
- })();
37
- function runTimeout(fun) {
38
- if (cachedSetTimeout === setTimeout) {
39
- return setTimeout(fun, 0);
40
- }
41
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
42
- cachedSetTimeout = setTimeout;
43
- return setTimeout(fun, 0);
44
- }
45
- try {
46
- return cachedSetTimeout(fun, 0);
47
- } catch (e) {
48
- try {
49
- return cachedSetTimeout.call(null, fun, 0);
50
- } catch (e2) {
51
- return cachedSetTimeout.call(this, fun, 0);
52
- }
53
- }
54
- }
55
- function runClearTimeout(marker) {
56
- if (cachedClearTimeout === clearTimeout) {
57
- return clearTimeout(marker);
58
- }
59
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
60
- cachedClearTimeout = clearTimeout;
61
- return clearTimeout(marker);
62
- }
63
- try {
64
- return cachedClearTimeout(marker);
65
- } catch (e) {
66
- try {
67
- return cachedClearTimeout.call(null, marker);
68
- } catch (e2) {
69
- return cachedClearTimeout.call(this, marker);
70
- }
71
- }
72
- }
73
- var queue = [];
74
- var draining = false;
75
- var currentQueue;
76
- var queueIndex = -1;
77
- function cleanUpNextTick() {
78
- if (!draining || !currentQueue) {
79
- return;
80
- }
81
- draining = false;
82
- if (currentQueue.length) {
83
- queue = currentQueue.concat(queue);
84
- } else {
85
- queueIndex = -1;
86
- }
87
- if (queue.length) {
88
- drainQueue();
89
- }
90
- }
91
- function drainQueue() {
92
- if (draining) {
93
- return;
94
- }
95
- var timeout = runTimeout(cleanUpNextTick);
96
- draining = true;
97
- var len = queue.length;
98
- while (len) {
99
- currentQueue = queue;
100
- queue = [];
101
- while (++queueIndex < len) {
102
- if (currentQueue) {
103
- currentQueue[queueIndex].run();
104
- }
105
- }
106
- queueIndex = -1;
107
- len = queue.length;
108
- }
109
- currentQueue = null;
110
- draining = false;
111
- runClearTimeout(timeout);
112
- }
113
- process.nextTick = function(fun) {
114
- var args = new Array(arguments.length - 1);
115
- if (arguments.length > 1) {
116
- for (var i = 1; i < arguments.length; i++) {
117
- args[i - 1] = arguments[i];
118
- }
119
- }
120
- queue.push(new Item(fun, args));
121
- if (queue.length === 1 && !draining) {
122
- runTimeout(drainQueue);
123
- }
124
- };
125
- function Item(fun, array) {
126
- this.fun = fun;
127
- this.array = array;
128
- }
129
- Item.prototype.run = function() {
130
- this.fun.apply(null, this.array);
131
- };
132
- process.title = "browser";
133
- process.browser = true;
134
- process.env = {};
135
- process.argv = [];
136
- process.version = "";
137
- process.versions = {};
138
- function noop$2() {
139
- }
140
- process.on = noop$2;
141
- process.addListener = noop$2;
142
- process.once = noop$2;
143
- process.off = noop$2;
144
- process.removeListener = noop$2;
145
- process.removeAllListeners = noop$2;
146
- process.emit = noop$2;
147
- process.prependListener = noop$2;
148
- process.prependOnceListener = noop$2;
149
- process.listeners = function(name2) {
150
- return [];
151
- };
152
- process.binding = function(name2) {
153
- throw new Error("process.binding is not supported");
154
- };
155
- process.cwd = function() {
156
- return "/";
157
- };
158
- process.chdir = function(dir) {
159
- throw new Error("process.chdir is not supported");
160
- };
161
- process.umask = function() {
162
- return 0;
163
- };
164
- var browserExports$1 = browser$e.exports;
165
- const process$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(browserExports$1);
166
5
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
167
6
  function getDefaultExportFromCjs(x) {
168
7
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -7840,13 +7679,13 @@ Sha.prototype._update = function(M) {
7840
7679
  this._e = e + this._e | 0;
7841
7680
  };
7842
7681
  Sha.prototype._hash = function() {
7843
- var H = Buffer$v.allocUnsafe(20);
7844
- H.writeInt32BE(this._a | 0, 0);
7845
- H.writeInt32BE(this._b | 0, 4);
7846
- H.writeInt32BE(this._c | 0, 8);
7847
- H.writeInt32BE(this._d | 0, 12);
7848
- H.writeInt32BE(this._e | 0, 16);
7849
- return H;
7682
+ var H2 = Buffer$v.allocUnsafe(20);
7683
+ H2.writeInt32BE(this._a | 0, 0);
7684
+ H2.writeInt32BE(this._b | 0, 4);
7685
+ H2.writeInt32BE(this._c | 0, 8);
7686
+ H2.writeInt32BE(this._d | 0, 12);
7687
+ H2.writeInt32BE(this._e | 0, 16);
7688
+ return H2;
7850
7689
  };
7851
7690
  var sha$4 = Sha;
7852
7691
  var inherits$m = inherits_browserExports;
@@ -7912,13 +7751,13 @@ Sha1.prototype._update = function(M) {
7912
7751
  this._e = e + this._e | 0;
7913
7752
  };
7914
7753
  Sha1.prototype._hash = function() {
7915
- var H = Buffer$u.allocUnsafe(20);
7916
- H.writeInt32BE(this._a | 0, 0);
7917
- H.writeInt32BE(this._b | 0, 4);
7918
- H.writeInt32BE(this._c | 0, 8);
7919
- H.writeInt32BE(this._d | 0, 12);
7920
- H.writeInt32BE(this._e | 0, 16);
7921
- return H;
7754
+ var H2 = Buffer$u.allocUnsafe(20);
7755
+ H2.writeInt32BE(this._a | 0, 0);
7756
+ H2.writeInt32BE(this._b | 0, 4);
7757
+ H2.writeInt32BE(this._c | 0, 8);
7758
+ H2.writeInt32BE(this._d | 0, 12);
7759
+ H2.writeInt32BE(this._e | 0, 16);
7760
+ return H2;
7922
7761
  };
7923
7762
  var sha1 = Sha1;
7924
7763
  var inherits$l = inherits_browserExports;
@@ -8060,16 +7899,16 @@ Sha256$1.prototype._update = function(M) {
8060
7899
  this._h = h + this._h | 0;
8061
7900
  };
8062
7901
  Sha256$1.prototype._hash = function() {
8063
- var H = Buffer$t.allocUnsafe(32);
8064
- H.writeInt32BE(this._a, 0);
8065
- H.writeInt32BE(this._b, 4);
8066
- H.writeInt32BE(this._c, 8);
8067
- H.writeInt32BE(this._d, 12);
8068
- H.writeInt32BE(this._e, 16);
8069
- H.writeInt32BE(this._f, 20);
8070
- H.writeInt32BE(this._g, 24);
8071
- H.writeInt32BE(this._h, 28);
8072
- return H;
7902
+ var H2 = Buffer$t.allocUnsafe(32);
7903
+ H2.writeInt32BE(this._a, 0);
7904
+ H2.writeInt32BE(this._b, 4);
7905
+ H2.writeInt32BE(this._c, 8);
7906
+ H2.writeInt32BE(this._d, 12);
7907
+ H2.writeInt32BE(this._e, 16);
7908
+ H2.writeInt32BE(this._f, 20);
7909
+ H2.writeInt32BE(this._g, 24);
7910
+ H2.writeInt32BE(this._h, 28);
7911
+ return H2;
8073
7912
  };
8074
7913
  var sha256$1 = Sha256$1;
8075
7914
  var inherits$k = inherits_browserExports;
@@ -8095,15 +7934,15 @@ Sha224.prototype.init = function() {
8095
7934
  return this;
8096
7935
  };
8097
7936
  Sha224.prototype._hash = function() {
8098
- var H = Buffer$s.allocUnsafe(28);
8099
- H.writeInt32BE(this._a, 0);
8100
- H.writeInt32BE(this._b, 4);
8101
- H.writeInt32BE(this._c, 8);
8102
- H.writeInt32BE(this._d, 12);
8103
- H.writeInt32BE(this._e, 16);
8104
- H.writeInt32BE(this._f, 20);
8105
- H.writeInt32BE(this._g, 24);
8106
- return H;
7937
+ var H2 = Buffer$s.allocUnsafe(28);
7938
+ H2.writeInt32BE(this._a, 0);
7939
+ H2.writeInt32BE(this._b, 4);
7940
+ H2.writeInt32BE(this._c, 8);
7941
+ H2.writeInt32BE(this._d, 12);
7942
+ H2.writeInt32BE(this._e, 16);
7943
+ H2.writeInt32BE(this._f, 20);
7944
+ H2.writeInt32BE(this._g, 24);
7945
+ return H2;
8107
7946
  };
8108
7947
  var sha224$1 = Sha224;
8109
7948
  var inherits$j = inherits_browserExports;
@@ -8426,10 +8265,10 @@ Sha512.prototype._update = function(M) {
8426
8265
  this._hh = this._hh + hh + getCarry(this._hl, hl2) | 0;
8427
8266
  };
8428
8267
  Sha512.prototype._hash = function() {
8429
- var H = Buffer$r.allocUnsafe(64);
8268
+ var H2 = Buffer$r.allocUnsafe(64);
8430
8269
  function writeInt64BE(h, l, offset) {
8431
- H.writeInt32BE(h, offset);
8432
- H.writeInt32BE(l, offset + 4);
8270
+ H2.writeInt32BE(h, offset);
8271
+ H2.writeInt32BE(l, offset + 4);
8433
8272
  }
8434
8273
  writeInt64BE(this._ah, this._al, 0);
8435
8274
  writeInt64BE(this._bh, this._bl, 8);
@@ -8439,7 +8278,7 @@ Sha512.prototype._hash = function() {
8439
8278
  writeInt64BE(this._fh, this._fl, 40);
8440
8279
  writeInt64BE(this._gh, this._gl, 48);
8441
8280
  writeInt64BE(this._hh, this._hl, 56);
8442
- return H;
8281
+ return H2;
8443
8282
  };
8444
8283
  var sha512$1 = Sha512;
8445
8284
  var inherits$i = inherits_browserExports;
@@ -8473,10 +8312,10 @@ Sha384.prototype.init = function() {
8473
8312
  return this;
8474
8313
  };
8475
8314
  Sha384.prototype._hash = function() {
8476
- var H = Buffer$q.allocUnsafe(48);
8315
+ var H2 = Buffer$q.allocUnsafe(48);
8477
8316
  function writeInt64BE(h, l, offset) {
8478
- H.writeInt32BE(h, offset);
8479
- H.writeInt32BE(l, offset + 4);
8317
+ H2.writeInt32BE(h, offset);
8318
+ H2.writeInt32BE(l, offset + 4);
8480
8319
  }
8481
8320
  writeInt64BE(this._ah, this._al, 0);
8482
8321
  writeInt64BE(this._bh, this._bl, 8);
@@ -8484,7 +8323,7 @@ Sha384.prototype._hash = function() {
8484
8323
  writeInt64BE(this._dh, this._dl, 24);
8485
8324
  writeInt64BE(this._eh, this._el, 32);
8486
8325
  writeInt64BE(this._fh, this._fl, 40);
8487
- return H;
8326
+ return H2;
8488
8327
  };
8489
8328
  var sha384$1 = Sha384;
8490
8329
  var exports$1 = sha_js.exports = function SHA(algorithm) {
@@ -19311,8 +19150,8 @@ BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
19311
19150
  assert$d(p.precomputed);
19312
19151
  var doubles = p._getDoubles();
19313
19152
  var naf = getNAF(k, 1, this._bitLength);
19314
- var I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1);
19315
- I /= 3;
19153
+ var I2 = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1);
19154
+ I2 /= 3;
19316
19155
  var repr = [];
19317
19156
  var j;
19318
19157
  var nafW;
@@ -19324,7 +19163,7 @@ BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
19324
19163
  }
19325
19164
  var a = this.jpoint(null, null, null);
19326
19165
  var b = this.jpoint(null, null, null);
19327
- for (var i = I; i > 0; i--) {
19166
+ for (var i = I2; i > 0; i--) {
19328
19167
  for (j = 0; j < repr.length; j++) {
19329
19168
  nafW = repr[j];
19330
19169
  if (nafW === i)
@@ -25950,13 +25789,13 @@ function requireSign() {
25950
25789
  var g2 = priv2.params.g;
25951
25790
  var r2 = new BN2(0);
25952
25791
  var k;
25953
- var H = bits2int(hash3, q).mod(q);
25792
+ var H2 = bits2int(hash3, q).mod(q);
25954
25793
  var s2 = false;
25955
25794
  var kv = getKey(x, q, hash3, algo);
25956
25795
  while (s2 === false) {
25957
25796
  k = makeKey(q, kv, algo);
25958
25797
  r2 = makeR(g2, k, p, q);
25959
- s2 = k.invm(q).imul(H.add(x.mul(r2))).mod(q);
25798
+ s2 = k.invm(q).imul(H2.add(x.mul(r2))).mod(q);
25960
25799
  if (s2.cmpn(0) === 0) {
25961
25800
  s2 = false;
25962
25801
  r2 = new BN2(0);
@@ -27156,124 +26995,6 @@ const getQueries = (client) => ({
27156
26995
  getValidator: getValidator.bind(null, client),
27157
26996
  getClusterBalance: getClusterBalance$1.bind(null, client)
27158
26997
  });
27159
- function defineChain(chain) {
27160
- return {
27161
- formatters: void 0,
27162
- fees: void 0,
27163
- serializers: void 0,
27164
- ...chain
27165
- };
27166
- }
27167
- const holesky = /* @__PURE__ */ defineChain({
27168
- id: 17e3,
27169
- name: "Holesky",
27170
- nativeCurrency: { name: "Holesky Ether", symbol: "ETH", decimals: 18 },
27171
- rpcUrls: {
27172
- default: {
27173
- http: ["https://ethereum-holesky-rpc.publicnode.com"]
27174
- }
27175
- },
27176
- blockExplorers: {
27177
- default: {
27178
- name: "Etherscan",
27179
- url: "https://holesky.etherscan.io",
27180
- apiUrl: "https://api-holesky.etherscan.io/api"
27181
- }
27182
- },
27183
- contracts: {
27184
- multicall3: {
27185
- address: "0xca11bde05977b3631167028862be2a173976ca11",
27186
- blockCreated: 77
27187
- },
27188
- ensRegistry: {
27189
- address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
27190
- blockCreated: 801613
27191
- },
27192
- ensUniversalResolver: {
27193
- address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",
27194
- blockCreated: 973484
27195
- }
27196
- },
27197
- testnet: true
27198
- });
27199
- const mainnet = /* @__PURE__ */ defineChain({
27200
- id: 1,
27201
- name: "Ethereum",
27202
- nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
27203
- rpcUrls: {
27204
- default: {
27205
- http: ["https://cloudflare-eth.com"]
27206
- }
27207
- },
27208
- blockExplorers: {
27209
- default: {
27210
- name: "Etherscan",
27211
- url: "https://etherscan.io",
27212
- apiUrl: "https://api.etherscan.io/api"
27213
- }
27214
- },
27215
- contracts: {
27216
- ensRegistry: {
27217
- address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
27218
- },
27219
- ensUniversalResolver: {
27220
- address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
27221
- blockCreated: 19258213
27222
- },
27223
- multicall3: {
27224
- address: "0xca11bde05977b3631167028862be2a173976ca11",
27225
- blockCreated: 14353601
27226
- }
27227
- }
27228
- });
27229
- const hoodi = defineChain$1({
27230
- id: 560048,
27231
- name: "Hoodi",
27232
- rpcUrls: {
27233
- default: {
27234
- http: ["https://rpc.hoodi.ethpandaops.io"]
27235
- }
27236
- },
27237
- nativeCurrency: {
27238
- name: "Hoodi Ether",
27239
- symbol: "ETH",
27240
- decimals: 18
27241
- },
27242
- testnet: true
27243
- });
27244
- const chains = {
27245
- mainnet,
27246
- holesky,
27247
- hoodi
27248
- };
27249
- const chainIds = Object.values(chains).map((chain) => chain.id);
27250
- const graph_endpoints = {
27251
- [mainnet.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-ethereum/version/latest",
27252
- [holesky.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-holesky/version/latest",
27253
- [hoodi.id]: "https://graph-node-hoodi.stage.ops.ssvlabsinternal.com/subgraphs/name/ssv-bapps-hoodi/graphql"
27254
- };
27255
- const rest_endpoints = {
27256
- [mainnet.id]: "https://api.ssv.network/api/v4/mainnet",
27257
- [holesky.id]: "https://api.ssv.network/api/v4/holesky",
27258
- [hoodi.id]: "https://api.stage.ops.ssvlabsinternal.com/api/v4/hoodi"
27259
- };
27260
- const contracts = {
27261
- [mainnet.id]: {
27262
- setter: "0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1",
27263
- getter: "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4",
27264
- token: "0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54"
27265
- },
27266
- [holesky.id]: {
27267
- setter: "0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA",
27268
- getter: "0x352A18AEe90cdcd825d1E37d9939dCA86C00e281",
27269
- token: "0xad45A78180961079BFaeEe349704F411dfF947C6"
27270
- },
27271
- [hoodi.id]: {
27272
- setter: "0x58410Bef803ECd7E63B23664C586A6DB72DAf59c",
27273
- getter: "0x5AdDb3f1529C5ec70D77400499eE4bbF328368fe",
27274
- token: "0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e"
27275
- }
27276
- };
27277
26998
  const MainnetV4GetterABI = [
27278
26999
  {
27279
27000
  inputs: [],
@@ -35880,22 +35601,27 @@ const createContractInteractions = ({
35880
35601
  };
35881
35602
  const createConfig = (props) => {
35882
35603
  const parsed = configArgsSchema.parse(props);
35883
- const { walletClient, publicClient } = parsed;
35884
- if (!walletClient.chain || !publicClient.chain || !chainIds.includes(walletClient.chain?.id) || !chainIds.includes(publicClient.chain?.id))
35604
+ if (!parsed.walletClient.chain || !parsed.publicClient.chain || !chainIds.includes(parsed.walletClient.chain?.id) || !chainIds.includes(parsed.publicClient.chain?.id))
35885
35605
  throw new Error(`Chain must be one of ${chainIds.join(", ")}`);
35886
- const chainId = walletClient.chain.id;
35606
+ const chainId = parsed.walletClient.chain.id;
35607
+ const chainContracts = contracts[chainId];
35608
+ const addresses = {
35609
+ setter: parsed._?.contractAddresses?.setter || chainContracts.setter,
35610
+ getter: parsed._?.contractAddresses?.getter || chainContracts.getter,
35611
+ token: parsed._?.contractAddresses?.token || chainContracts.token
35612
+ };
35887
35613
  const contract = createContractInteractions({
35888
- walletClient,
35889
- publicClient,
35890
- addresses: contracts[chainId]
35614
+ walletClient: parsed.walletClient,
35615
+ publicClient: parsed.publicClient,
35616
+ addresses
35891
35617
  });
35892
- const graphEndpoint = graph_endpoints[chainId];
35893
- const restEndpoint = rest_endpoints[chainId];
35618
+ const graphEndpoint = parsed._?.graphUrl || graph_endpoints[chainId];
35619
+ const restEndpoint = parsed._?.restUrl || rest_endpoints[chainId];
35894
35620
  const graphQLClient = new GraphQLClient(graphEndpoint);
35895
35621
  return {
35896
- publicClient,
35897
- walletClient,
35898
- chain: walletClient.chain,
35622
+ publicClient: parsed.publicClient,
35623
+ walletClient: parsed.walletClient,
35624
+ chain: parsed.walletClient.chain,
35899
35625
  graphEndpoint,
35900
35626
  restEndpoint,
35901
35627
  api: {
@@ -35903,42 +35629,10 @@ const createConfig = (props) => {
35903
35629
  ...createSSVAPI(restEndpoint)
35904
35630
  },
35905
35631
  graphQLClient,
35906
- contractAddresses: contracts[chainId],
35632
+ contractAddresses: addresses,
35907
35633
  contract
35908
35634
  };
35909
35635
  };
35910
- const globals = {
35911
- MAX_WEI_AMOUNT: 115792089237316195423570985008687907853269984665640564039457584007913129639935n,
35912
- CLUSTER_SIZES: {
35913
- QUAD_CLUSTER: 4,
35914
- SEPT_CLUSTER: 7,
35915
- DECA_CLUSTER: 10,
35916
- TRISKAIDEKA_CLUSTER: 13
35917
- },
35918
- FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE: {
35919
- QUAD_CLUSTER: 80,
35920
- SEPT_CLUSTER: 40,
35921
- DECA_CLUSTER: 30,
35922
- TRISKAIDEKA_CLUSTER: 20
35923
- },
35924
- BLOCKS_PER_DAY: 7160n,
35925
- OPERATORS_PER_PAGE: 50,
35926
- BLOCKS_PER_YEAR: 2613400n,
35927
- DEFAULT_CLUSTER_PERIOD: 730,
35928
- NUMBERS_OF_WEEKS_IN_YEAR: 52.1429,
35929
- MAX_VALIDATORS_COUNT_MULTI_FLOW: 50,
35930
- CLUSTER_VALIDITY_PERIOD_MINIMUM: 30,
35931
- OPERATOR_VALIDATORS_LIMIT_PRESERVE: 5,
35932
- MINIMUM_OPERATOR_FEE_PER_BLOCK: 1000000000n,
35933
- MIN_VALIDATORS_COUNT_PER_BULK_REGISTRATION: 1,
35934
- DEFAULT_ADDRESS_WHITELIST: "0x0000000000000000000000000000000000000000"
35935
- };
35936
- const registerValidatorsByClusterSizeLimits = {
35937
- [globals.CLUSTER_SIZES.QUAD_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.QUAD_CLUSTER,
35938
- [globals.CLUSTER_SIZES.SEPT_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.SEPT_CLUSTER,
35939
- [globals.CLUSTER_SIZES.DECA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.DECA_CLUSTER,
35940
- [globals.CLUSTER_SIZES.TRISKAIDEKA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.TRISKAIDEKA_CLUSTER
35941
- };
35942
35636
  const deposit = async (config2, { args: { id, amount }, ...writeOptions }, options2 = {}) => {
35943
35637
  const cluster = await config2.api.getCluster({ id });
35944
35638
  console.log("cluster:", cluster);
@@ -36431,7 +36125,7 @@ class SSVSDK {
36431
36125
  export {
36432
36126
  SSVSDK,
36433
36127
  chainIds,
36434
- chains,
36128
+ H as chains,
36435
36129
  contracts,
36436
36130
  createClusterManager,
36437
36131
  createConfig,
@@ -36454,8 +36148,9 @@ export {
36454
36148
  getValidators,
36455
36149
  globals,
36456
36150
  graph_endpoints,
36457
- hoodi,
36151
+ G2 as hoodi,
36458
36152
  isConfig,
36153
+ I as networks,
36459
36154
  registerValidatorsByClusterSizeLimits,
36460
36155
  rest_endpoints
36461
36156
  };
@@ -1,9 +1,16 @@
1
- import { PublicClient, WalletClient } from 'viem';
1
+ import { Address, PublicClient, WalletClient } from 'viem';
2
2
  import { z } from 'zod';
3
- type ZodConfigArgs = {
4
- walletClient: z.ZodType<WalletClient>;
5
- publicClient: z.ZodType<PublicClient>;
3
+ export declare const configArgsSchema: z.ZodType<ConfigArgs, z.ZodTypeDef, ConfigArgs>;
4
+ export type ConfigArgs = {
5
+ walletClient: WalletClient;
6
+ publicClient: PublicClient;
7
+ _?: {
8
+ graphUrl?: string;
9
+ restUrl?: string;
10
+ contractAddresses?: {
11
+ setter?: Address;
12
+ getter?: Address;
13
+ token?: Address;
14
+ };
15
+ };
6
16
  };
7
- export declare const configArgsSchema: z.ZodObject<ZodConfigArgs>;
8
- export type ConfigArgs = z.infer<z.ZodObject<ZodConfigArgs>>;
9
- export {};
package/dist/utils.js CHANGED
@@ -1,43 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const config = require("./config-DPI30L0i.js");
4
- const waitForTransaction = async (config2, fn) => {
3
+ const globals = require("./globals-fh7gkHKO.js");
4
+ const waitForTransaction = async (config, fn) => {
5
5
  const hash = await fn;
6
- return config2.publicClient.waitForTransactionReceipt({ hash });
6
+ return config.publicClient.waitForTransactionReceipt({ hash });
7
7
  };
8
- exports.KeysharesValidationError = config.KeysharesValidationError;
9
- exports.KeysharesValidationErrors = config.KeysharesValidationErrors;
10
- exports.KeysharesValidationErrorsMessages = config.KeysharesValidationErrorsMessages;
11
- exports._percentageFormatter = config._percentageFormatter;
12
- exports.add0x = config.add0x;
13
- exports.bigintAbs = config.bigintAbs;
14
- exports.bigintFloor = config.bigintFloor;
15
- exports.bigintFormatter = config.bigintFormatter;
16
- exports.bigintMax = config.bigintMax;
17
- exports.bigintMin = config.bigintMin;
18
- exports.bigintRound = config.bigintRound;
19
- exports.bigintifyNumbers = config.bigintifyNumbers;
20
- exports.configArgsSchema = config.configArgsSchema;
21
- exports.createClusterId = config.createClusterId;
22
- exports.createEmptyCluster = config.createEmptyCluster;
23
- exports.decodeOperatorPublicKey = config.decodeOperatorPublicKey;
24
- exports.ensureNoKeysharesErrors = config.ensureNoKeysharesErrors;
25
- exports.ensureValidatorsUniqueness = config.ensureValidatorsUniqueness;
26
- exports.ethFormatter = config.ethFormatter;
27
- exports.formatBigintInput = config.formatBigintInput;
28
- exports.formatSSV = config.formatSSV;
29
- exports.getClusterSnapshot = config.getClusterSnapshot;
30
- exports.getOperatorIds = config.getOperatorIds;
31
- exports.isBigIntChanged = config.isBigIntChanged;
32
- exports.isClusterId = config.isClusterId;
33
- exports.isKeySharesItem = config.isKeySharesItem;
34
- exports.ms = config.ms;
35
- exports.numberFormatter = config.numberFormatter;
36
- exports.percentageFormatter = config.percentageFormatter;
37
- exports.roundOperatorFee = config.roundOperatorFee;
38
- exports.sortNumbers = config.sortNumbers;
39
- exports.stringifyBigints = config.stringifyBigints;
40
- exports.tryCatch = config.tryCatch;
41
- exports.validateConsistentOperatorIds = config.validateConsistentOperatorIds;
42
- exports.validateConsistentOperatorPublicKeys = config.validateConsistentOperatorPublicKeys;
8
+ exports.KeysharesValidationError = globals.KeysharesValidationError;
9
+ exports.KeysharesValidationErrors = globals.KeysharesValidationErrors;
10
+ exports.KeysharesValidationErrorsMessages = globals.KeysharesValidationErrorsMessages;
11
+ exports._percentageFormatter = globals._percentageFormatter;
12
+ exports.add0x = globals.add0x;
13
+ exports.bigintAbs = globals.bigintAbs;
14
+ exports.bigintFloor = globals.bigintFloor;
15
+ exports.bigintFormatter = globals.bigintFormatter;
16
+ exports.bigintMax = globals.bigintMax;
17
+ exports.bigintMin = globals.bigintMin;
18
+ exports.bigintRound = globals.bigintRound;
19
+ exports.bigintifyNumbers = globals.bigintifyNumbers;
20
+ exports.configArgsSchema = globals.configArgsSchema;
21
+ exports.createClusterId = globals.createClusterId;
22
+ exports.createEmptyCluster = globals.createEmptyCluster;
23
+ exports.decodeOperatorPublicKey = globals.decodeOperatorPublicKey;
24
+ exports.ensureNoKeysharesErrors = globals.ensureNoKeysharesErrors;
25
+ exports.ensureValidatorsUniqueness = globals.ensureValidatorsUniqueness;
26
+ exports.ethFormatter = globals.ethFormatter;
27
+ exports.formatBigintInput = globals.formatBigintInput;
28
+ exports.formatSSV = globals.formatSSV;
29
+ exports.getClusterSnapshot = globals.getClusterSnapshot;
30
+ exports.getOperatorIds = globals.getOperatorIds;
31
+ exports.isBigIntChanged = globals.isBigIntChanged;
32
+ exports.isClusterId = globals.isClusterId;
33
+ exports.isKeySharesItem = globals.isKeySharesItem;
34
+ exports.ms = globals.ms;
35
+ exports.numberFormatter = globals.numberFormatter;
36
+ exports.percentageFormatter = globals.percentageFormatter;
37
+ exports.roundOperatorFee = globals.roundOperatorFee;
38
+ exports.sortNumbers = globals.sortNumbers;
39
+ exports.stringifyBigints = globals.stringifyBigints;
40
+ exports.tryCatch = globals.tryCatch;
41
+ exports.validateConsistentOperatorIds = globals.validateConsistentOperatorIds;
42
+ exports.validateConsistentOperatorPublicKeys = globals.validateConsistentOperatorPublicKeys;
43
43
  exports.waitForTransaction = waitForTransaction;