@ssv-labs/ssv-sdk 0.0.4 → 0.0.7
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/config/chains.d.ts +1 -0
- package/dist/contract-interactions/types.d.ts +3 -1
- package/dist/{config-DlwfpwZd.mjs → globals-BHuFvs8-.mjs} +423 -73
- package/dist/{config-DPI30L0i.js → globals-DCoa7oI7.js} +393 -43
- package/dist/libs/cluster/index.d.ts +7 -1
- package/dist/libs/cluster/methods/index.d.ts +1 -1
- package/dist/libs/cluster/methods/register-validators.d.ts +3 -2
- package/dist/libs/operator/index.d.ts +35 -0
- package/dist/main.js +515 -920
- package/dist/main.mjs +445 -849
- package/dist/utils/zod/config.d.ts +14 -7
- package/dist/utils.js +38 -38
- package/dist/utils.mjs +30 -30
- package/package.json +6 -6
package/dist/config/chains.d.ts
CHANGED
|
@@ -165,6 +165,7 @@ export declare const chains: {
|
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
167
|
export declare const chainIds: (1 | 560048 | 17000)[];
|
|
168
|
+
export declare const networks: ("Hoodi" | "Ethereum" | "Holesky")[];
|
|
168
169
|
export type SupportedChainsIDs = (typeof chainIds)[number];
|
|
169
170
|
export declare const graph_endpoints: Record<SupportedChainsIDs, string>;
|
|
170
171
|
export declare const rest_endpoints: Record<SupportedChainsIDs, string>;
|
|
@@ -4,7 +4,7 @@ import { TokenABI } from '../abi/token';
|
|
|
4
4
|
import { AbiInputsToParams } from '../types/contract-interactions';
|
|
5
5
|
import { Prettify } from '../types/utils';
|
|
6
6
|
import { Abi, Address, ExtractAbiFunctions } from 'abitype';
|
|
7
|
-
import { ContractFunctionArgs, ContractFunctionName, DecodeEventLogReturnType, Hash, PublicClient, ReadContractReturnType, SimulateContractParameters, SimulateContractReturnType, WaitForTransactionReceiptReturnType, WalletClient } from 'viem';
|
|
7
|
+
import { ContractFunctionArgs, ContractFunctionName, DecodeEventLogReturnType, Hash, Hex, PublicClient, ReadContractReturnType, SimulateContractParameters, SimulateContractReturnType, WaitForTransactionReceiptReturnType, WalletClient } from 'viem';
|
|
8
8
|
export type SupportedAbis = typeof TokenABI | typeof MainnetV4GetterABI | typeof MainnetV4SetterABI;
|
|
9
9
|
export type TokenEvents = DecodeEventLogReturnType<typeof TokenABI>;
|
|
10
10
|
export type MainnetEvents = DecodeEventLogReturnType<typeof MainnetV4SetterABI>;
|
|
@@ -67,6 +67,7 @@ export type WriterFunctions<ContractName extends ContractNames, Fns extends Cont
|
|
|
67
67
|
simulate: (props?: Prettify<(K['stateMutability'] extends 'payable' ? {
|
|
68
68
|
value?: bigint;
|
|
69
69
|
} : object) & WriteOptions<K>>) => SimulateContractReturnType<SupportedAbis, K['name']>;
|
|
70
|
+
getTransactionData: () => Hex;
|
|
70
71
|
} : {
|
|
71
72
|
(props: Prettify<((K['stateMutability'] extends 'payable' ? {
|
|
72
73
|
value?: bigint;
|
|
@@ -78,6 +79,7 @@ export type WriterFunctions<ContractName extends ContractNames, Fns extends Cont
|
|
|
78
79
|
} : object) & (K['inputs'] extends readonly [] ? object : {
|
|
79
80
|
args: Prettify<AbiInputsToParams<K['inputs']>>;
|
|
80
81
|
})) & WriteOptions<K>>) => SimulateContractReturnType<SupportedAbis, K['name']>;
|
|
82
|
+
getTransactionData: (props: K['inputs'] extends readonly [] ? object : Prettify<AbiInputsToParams<K['inputs']>>) => Hex;
|
|
81
83
|
};
|
|
82
84
|
};
|
|
83
85
|
export type ReaderFunctions<ContractName extends keyof Contracts, Fns extends Contracts[ContractName]['readFunctions'] = Contracts[ContractName]['readFunctions']> = {
|
|
@@ -1,4 +1,166 @@
|
|
|
1
|
-
import { formatUnits, decodeAbiParameters, parseUnits, isAddress } from "viem";
|
|
1
|
+
import { formatUnits, decodeAbiParameters, defineChain as defineChain$1, parseUnits, isAddress } from "viem";
|
|
2
|
+
function getDefaultExportFromCjs(x) {
|
|
3
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
+
}
|
|
5
|
+
var browser = { exports: {} };
|
|
6
|
+
var process = browser.exports = {};
|
|
7
|
+
var cachedSetTimeout;
|
|
8
|
+
var cachedClearTimeout;
|
|
9
|
+
function defaultSetTimout() {
|
|
10
|
+
throw new Error("setTimeout has not been defined");
|
|
11
|
+
}
|
|
12
|
+
function defaultClearTimeout() {
|
|
13
|
+
throw new Error("clearTimeout has not been defined");
|
|
14
|
+
}
|
|
15
|
+
(function() {
|
|
16
|
+
try {
|
|
17
|
+
if (typeof setTimeout === "function") {
|
|
18
|
+
cachedSetTimeout = setTimeout;
|
|
19
|
+
} else {
|
|
20
|
+
cachedSetTimeout = defaultSetTimout;
|
|
21
|
+
}
|
|
22
|
+
} catch (e) {
|
|
23
|
+
cachedSetTimeout = defaultSetTimout;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
if (typeof clearTimeout === "function") {
|
|
27
|
+
cachedClearTimeout = clearTimeout;
|
|
28
|
+
} else {
|
|
29
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
33
|
+
}
|
|
34
|
+
})();
|
|
35
|
+
function runTimeout(fun) {
|
|
36
|
+
if (cachedSetTimeout === setTimeout) {
|
|
37
|
+
return setTimeout(fun, 0);
|
|
38
|
+
}
|
|
39
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
40
|
+
cachedSetTimeout = setTimeout;
|
|
41
|
+
return setTimeout(fun, 0);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
return cachedSetTimeout(fun, 0);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
try {
|
|
47
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
48
|
+
} catch (e2) {
|
|
49
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function runClearTimeout(marker) {
|
|
54
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
55
|
+
return clearTimeout(marker);
|
|
56
|
+
}
|
|
57
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
58
|
+
cachedClearTimeout = clearTimeout;
|
|
59
|
+
return clearTimeout(marker);
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
return cachedClearTimeout(marker);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
try {
|
|
65
|
+
return cachedClearTimeout.call(null, marker);
|
|
66
|
+
} catch (e2) {
|
|
67
|
+
return cachedClearTimeout.call(this, marker);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
var queue = [];
|
|
72
|
+
var draining = false;
|
|
73
|
+
var currentQueue;
|
|
74
|
+
var queueIndex = -1;
|
|
75
|
+
function cleanUpNextTick() {
|
|
76
|
+
if (!draining || !currentQueue) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
draining = false;
|
|
80
|
+
if (currentQueue.length) {
|
|
81
|
+
queue = currentQueue.concat(queue);
|
|
82
|
+
} else {
|
|
83
|
+
queueIndex = -1;
|
|
84
|
+
}
|
|
85
|
+
if (queue.length) {
|
|
86
|
+
drainQueue();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function drainQueue() {
|
|
90
|
+
if (draining) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
94
|
+
draining = true;
|
|
95
|
+
var len = queue.length;
|
|
96
|
+
while (len) {
|
|
97
|
+
currentQueue = queue;
|
|
98
|
+
queue = [];
|
|
99
|
+
while (++queueIndex < len) {
|
|
100
|
+
if (currentQueue) {
|
|
101
|
+
currentQueue[queueIndex].run();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
queueIndex = -1;
|
|
105
|
+
len = queue.length;
|
|
106
|
+
}
|
|
107
|
+
currentQueue = null;
|
|
108
|
+
draining = false;
|
|
109
|
+
runClearTimeout(timeout);
|
|
110
|
+
}
|
|
111
|
+
process.nextTick = function(fun) {
|
|
112
|
+
var args = new Array(arguments.length - 1);
|
|
113
|
+
if (arguments.length > 1) {
|
|
114
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
115
|
+
args[i - 1] = arguments[i];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
queue.push(new Item(fun, args));
|
|
119
|
+
if (queue.length === 1 && !draining) {
|
|
120
|
+
runTimeout(drainQueue);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
function Item(fun, array) {
|
|
124
|
+
this.fun = fun;
|
|
125
|
+
this.array = array;
|
|
126
|
+
}
|
|
127
|
+
Item.prototype.run = function() {
|
|
128
|
+
this.fun.apply(null, this.array);
|
|
129
|
+
};
|
|
130
|
+
process.title = "browser";
|
|
131
|
+
process.browser = true;
|
|
132
|
+
process.env = {};
|
|
133
|
+
process.argv = [];
|
|
134
|
+
process.version = "";
|
|
135
|
+
process.versions = {};
|
|
136
|
+
function noop() {
|
|
137
|
+
}
|
|
138
|
+
process.on = noop;
|
|
139
|
+
process.addListener = noop;
|
|
140
|
+
process.once = noop;
|
|
141
|
+
process.off = noop;
|
|
142
|
+
process.removeListener = noop;
|
|
143
|
+
process.removeAllListeners = noop;
|
|
144
|
+
process.emit = noop;
|
|
145
|
+
process.prependListener = noop;
|
|
146
|
+
process.prependOnceListener = noop;
|
|
147
|
+
process.listeners = function(name) {
|
|
148
|
+
return [];
|
|
149
|
+
};
|
|
150
|
+
process.binding = function(name) {
|
|
151
|
+
throw new Error("process.binding is not supported");
|
|
152
|
+
};
|
|
153
|
+
process.cwd = function() {
|
|
154
|
+
return "/";
|
|
155
|
+
};
|
|
156
|
+
process.chdir = function(dir) {
|
|
157
|
+
throw new Error("process.chdir is not supported");
|
|
158
|
+
};
|
|
159
|
+
process.umask = function() {
|
|
160
|
+
return 0;
|
|
161
|
+
};
|
|
162
|
+
var browserExports = browser.exports;
|
|
163
|
+
const process$1 = /* @__PURE__ */ getDefaultExportFromCjs(browserExports);
|
|
2
164
|
const numberFormatter = new Intl.NumberFormat("en-US", {
|
|
3
165
|
useGrouping: true,
|
|
4
166
|
maximumFractionDigits: 2
|
|
@@ -44,6 +206,125 @@ const getOperatorIds = (operators) => {
|
|
|
44
206
|
const decodeOperatorPublicKey = (publicKey) => {
|
|
45
207
|
return decodeAbiParameters([{ type: "string" }], publicKey)[0];
|
|
46
208
|
};
|
|
209
|
+
function defineChain(chain) {
|
|
210
|
+
return {
|
|
211
|
+
formatters: void 0,
|
|
212
|
+
fees: void 0,
|
|
213
|
+
serializers: void 0,
|
|
214
|
+
...chain
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const holesky = /* @__PURE__ */ defineChain({
|
|
218
|
+
id: 17e3,
|
|
219
|
+
name: "Holesky",
|
|
220
|
+
nativeCurrency: { name: "Holesky Ether", symbol: "ETH", decimals: 18 },
|
|
221
|
+
rpcUrls: {
|
|
222
|
+
default: {
|
|
223
|
+
http: ["https://ethereum-holesky-rpc.publicnode.com"]
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
blockExplorers: {
|
|
227
|
+
default: {
|
|
228
|
+
name: "Etherscan",
|
|
229
|
+
url: "https://holesky.etherscan.io",
|
|
230
|
+
apiUrl: "https://api-holesky.etherscan.io/api"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
contracts: {
|
|
234
|
+
multicall3: {
|
|
235
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
236
|
+
blockCreated: 77
|
|
237
|
+
},
|
|
238
|
+
ensRegistry: {
|
|
239
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
|
|
240
|
+
blockCreated: 801613
|
|
241
|
+
},
|
|
242
|
+
ensUniversalResolver: {
|
|
243
|
+
address: "0xa6AC935D4971E3CD133b950aE053bECD16fE7f3b",
|
|
244
|
+
blockCreated: 973484
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
testnet: true
|
|
248
|
+
});
|
|
249
|
+
const mainnet = /* @__PURE__ */ defineChain({
|
|
250
|
+
id: 1,
|
|
251
|
+
name: "Ethereum",
|
|
252
|
+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
|
|
253
|
+
rpcUrls: {
|
|
254
|
+
default: {
|
|
255
|
+
http: ["https://cloudflare-eth.com"]
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
blockExplorers: {
|
|
259
|
+
default: {
|
|
260
|
+
name: "Etherscan",
|
|
261
|
+
url: "https://etherscan.io",
|
|
262
|
+
apiUrl: "https://api.etherscan.io/api"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
contracts: {
|
|
266
|
+
ensRegistry: {
|
|
267
|
+
address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
|
|
268
|
+
},
|
|
269
|
+
ensUniversalResolver: {
|
|
270
|
+
address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
|
|
271
|
+
blockCreated: 19258213
|
|
272
|
+
},
|
|
273
|
+
multicall3: {
|
|
274
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
275
|
+
blockCreated: 14353601
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
const hoodi = defineChain$1({
|
|
280
|
+
id: 560048,
|
|
281
|
+
name: "Hoodi",
|
|
282
|
+
rpcUrls: {
|
|
283
|
+
default: {
|
|
284
|
+
http: ["https://rpc.hoodi.ethpandaops.io"]
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
nativeCurrency: {
|
|
288
|
+
name: "Hoodi Ether",
|
|
289
|
+
symbol: "ETH",
|
|
290
|
+
decimals: 18
|
|
291
|
+
},
|
|
292
|
+
testnet: true
|
|
293
|
+
});
|
|
294
|
+
const chains = {
|
|
295
|
+
mainnet,
|
|
296
|
+
holesky,
|
|
297
|
+
hoodi
|
|
298
|
+
};
|
|
299
|
+
const chainIds = Object.values(chains).map((chain) => chain.id);
|
|
300
|
+
const networks = Object.values(chains).map((chain) => chain.name);
|
|
301
|
+
const graph_endpoints = {
|
|
302
|
+
[mainnet.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-ethereum/version/latest",
|
|
303
|
+
[holesky.id]: "https://api.studio.thegraph.com/query/71118/ssv-network-holesky/version/latest",
|
|
304
|
+
[hoodi.id]: "https://graph-node-hoodi.stage.ops.ssvlabsinternal.com/subgraphs/name/ssv-bapps-hoodi"
|
|
305
|
+
};
|
|
306
|
+
const rest_endpoints = {
|
|
307
|
+
[mainnet.id]: "https://api.ssv.network/api/v4/mainnet",
|
|
308
|
+
[holesky.id]: "https://api.ssv.network/api/v4/holesky",
|
|
309
|
+
[hoodi.id]: "https://api.ssv.network/api/v4/hoodi"
|
|
310
|
+
};
|
|
311
|
+
const contracts = {
|
|
312
|
+
[mainnet.id]: {
|
|
313
|
+
setter: "0xDD9BC35aE942eF0cFa76930954a156B3fF30a4E1",
|
|
314
|
+
getter: "0xafE830B6Ee262ba11cce5F32fDCd760FFE6a66e4",
|
|
315
|
+
token: "0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54"
|
|
316
|
+
},
|
|
317
|
+
[holesky.id]: {
|
|
318
|
+
setter: "0x38A4794cCEd47d3baf7370CcC43B560D3a1beEFA",
|
|
319
|
+
getter: "0x352A18AEe90cdcd825d1E37d9939dCA86C00e281",
|
|
320
|
+
token: "0xad45A78180961079BFaeEe349704F411dfF947C6"
|
|
321
|
+
},
|
|
322
|
+
[hoodi.id]: {
|
|
323
|
+
setter: "0x58410Bef803ECd7E63B23664C586A6DB72DAf59c",
|
|
324
|
+
getter: "0x5AdDb3f1529C5ec70D77400499eE4bbF328368fe",
|
|
325
|
+
token: "0x9F5d4Ec84fC4785788aB44F9de973cF34F7A038e"
|
|
326
|
+
}
|
|
327
|
+
};
|
|
47
328
|
const global = globalThis || void 0 || self;
|
|
48
329
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
49
330
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
@@ -680,12 +961,6 @@ Stack.prototype["delete"] = stackDelete;
|
|
|
680
961
|
Stack.prototype.get = stackGet;
|
|
681
962
|
Stack.prototype.has = stackHas;
|
|
682
963
|
Stack.prototype.set = stackSet;
|
|
683
|
-
function baseAssign(object, source) {
|
|
684
|
-
return object && copyObject(source, keys(source), object);
|
|
685
|
-
}
|
|
686
|
-
function baseAssignIn(object, source) {
|
|
687
|
-
return object && copyObject(source, keysIn(source), object);
|
|
688
|
-
}
|
|
689
964
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
690
965
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
691
966
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
@@ -713,31 +988,16 @@ function stubArray() {
|
|
|
713
988
|
}
|
|
714
989
|
var objectProto$1 = Object.prototype;
|
|
715
990
|
var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
|
|
716
|
-
var nativeGetSymbols
|
|
717
|
-
var getSymbols = !nativeGetSymbols
|
|
991
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
992
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
718
993
|
if (object == null) {
|
|
719
994
|
return [];
|
|
720
995
|
}
|
|
721
996
|
object = Object(object);
|
|
722
|
-
return arrayFilter(nativeGetSymbols
|
|
997
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
723
998
|
return propertyIsEnumerable.call(object, symbol);
|
|
724
999
|
});
|
|
725
1000
|
};
|
|
726
|
-
function copySymbols(source, object) {
|
|
727
|
-
return copyObject(source, getSymbols(source), object);
|
|
728
|
-
}
|
|
729
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
730
|
-
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
|
731
|
-
var result = [];
|
|
732
|
-
while (object) {
|
|
733
|
-
arrayPush(result, getSymbols(object));
|
|
734
|
-
object = getPrototype(object);
|
|
735
|
-
}
|
|
736
|
-
return result;
|
|
737
|
-
};
|
|
738
|
-
function copySymbolsIn(source, object) {
|
|
739
|
-
return copyObject(source, getSymbolsIn(source), object);
|
|
740
|
-
}
|
|
741
1001
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
742
1002
|
var result = keysFunc(object);
|
|
743
1003
|
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
@@ -745,9 +1005,6 @@ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
|
745
1005
|
function getAllKeys(object) {
|
|
746
1006
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
747
1007
|
}
|
|
748
|
-
function getAllKeysIn(object) {
|
|
749
|
-
return baseGetAllKeys(object, keysIn, getSymbolsIn);
|
|
750
|
-
}
|
|
751
1008
|
var DataView = getNative(root, "DataView");
|
|
752
1009
|
var Promise$1 = getNative(root, "Promise");
|
|
753
1010
|
var Set$1 = getNative(root, "Set");
|
|
@@ -792,7 +1049,7 @@ function cloneArrayBuffer(arrayBuffer) {
|
|
|
792
1049
|
return result;
|
|
793
1050
|
}
|
|
794
1051
|
function cloneDataView(dataView, isDeep) {
|
|
795
|
-
var buffer =
|
|
1052
|
+
var buffer = cloneArrayBuffer(dataView.buffer);
|
|
796
1053
|
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
797
1054
|
}
|
|
798
1055
|
var reFlags = /\w*$/;
|
|
@@ -820,7 +1077,7 @@ function initCloneByTag(object, tag, isDeep) {
|
|
|
820
1077
|
case dateTag$1:
|
|
821
1078
|
return new Ctor(+object);
|
|
822
1079
|
case dataViewTag$1:
|
|
823
|
-
return cloneDataView(object
|
|
1080
|
+
return cloneDataView(object);
|
|
824
1081
|
case float32Tag$1:
|
|
825
1082
|
case float64Tag$1:
|
|
826
1083
|
case int8Tag$1:
|
|
@@ -859,14 +1116,14 @@ function baseIsSet(value) {
|
|
|
859
1116
|
}
|
|
860
1117
|
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
861
1118
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
862
|
-
var CLONE_DEEP_FLAG$1 = 1
|
|
1119
|
+
var CLONE_DEEP_FLAG$1 = 1;
|
|
863
1120
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
864
1121
|
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
865
1122
|
var cloneableTags = {};
|
|
866
1123
|
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
867
1124
|
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
868
1125
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
869
|
-
var result, isDeep = bitmask & CLONE_DEEP_FLAG$1
|
|
1126
|
+
var result, isDeep = bitmask & CLONE_DEEP_FLAG$1;
|
|
870
1127
|
if (customizer) {
|
|
871
1128
|
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
872
1129
|
}
|
|
@@ -879,19 +1136,13 @@ function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
|
879
1136
|
var isArr = isArray(value);
|
|
880
1137
|
if (isArr) {
|
|
881
1138
|
result = initCloneArray(value);
|
|
882
|
-
if (!isDeep) {
|
|
883
|
-
return copyArray(value, result);
|
|
884
|
-
}
|
|
885
1139
|
} else {
|
|
886
1140
|
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
887
1141
|
if (isBuffer(value)) {
|
|
888
1142
|
return cloneBuffer(value, isDeep);
|
|
889
1143
|
}
|
|
890
1144
|
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
891
|
-
result =
|
|
892
|
-
if (!isDeep) {
|
|
893
|
-
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
|
|
894
|
-
}
|
|
1145
|
+
result = isFunc ? {} : initCloneObject(value);
|
|
895
1146
|
} else {
|
|
896
1147
|
if (!cloneableTags[tag]) {
|
|
897
1148
|
return object ? value : {};
|
|
@@ -914,7 +1165,7 @@ function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
|
914
1165
|
result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
915
1166
|
});
|
|
916
1167
|
}
|
|
917
|
-
var keysFunc =
|
|
1168
|
+
var keysFunc = getAllKeys;
|
|
918
1169
|
var props = isArr ? void 0 : keysFunc(value);
|
|
919
1170
|
arrayEach(props || value, function(subValue, key2) {
|
|
920
1171
|
if (props) {
|
|
@@ -1651,11 +1902,11 @@ const isDirty = (x) => x.status === "dirty";
|
|
|
1651
1902
|
const isValid = (x) => x.status === "valid";
|
|
1652
1903
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
1653
1904
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1654
|
-
if (typeof state === "function" ? receiver !== state ||
|
|
1905
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1655
1906
|
return state.get(receiver);
|
|
1656
1907
|
}
|
|
1657
1908
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1658
|
-
if (typeof state === "function" ? receiver !== state ||
|
|
1909
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1659
1910
|
return state.set(receiver, value), value;
|
|
1660
1911
|
}
|
|
1661
1912
|
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
@@ -5107,32 +5358,131 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
5107
5358
|
ZodError
|
|
5108
5359
|
});
|
|
5109
5360
|
const configArgsSchema = z.object({
|
|
5110
|
-
|
|
5111
|
-
|
|
5361
|
+
publicClient: z.custom().superRefine((val, ctx) => {
|
|
5362
|
+
const client = val;
|
|
5363
|
+
if (!client) {
|
|
5364
|
+
ctx.addIssue({
|
|
5365
|
+
code: z.ZodIssueCode.custom,
|
|
5366
|
+
message: "Public client must be provided"
|
|
5367
|
+
});
|
|
5368
|
+
return false;
|
|
5369
|
+
}
|
|
5370
|
+
if (client.chain === void 0) {
|
|
5371
|
+
ctx.addIssue({
|
|
5372
|
+
code: z.ZodIssueCode.custom,
|
|
5373
|
+
message: "Public client must have a chain property"
|
|
5374
|
+
});
|
|
5375
|
+
return false;
|
|
5376
|
+
}
|
|
5377
|
+
if (!chainIds.includes(client.chain?.id)) {
|
|
5378
|
+
ctx.addIssue({
|
|
5379
|
+
code: z.ZodIssueCode.custom,
|
|
5380
|
+
message: `Public client chain must be one of [${networks.join(", ")}]`
|
|
5381
|
+
});
|
|
5382
|
+
return false;
|
|
5383
|
+
}
|
|
5384
|
+
return true;
|
|
5385
|
+
}),
|
|
5386
|
+
walletClient: z.custom().superRefine((val, ctx) => {
|
|
5387
|
+
const client = val;
|
|
5388
|
+
if (!client) {
|
|
5389
|
+
ctx.addIssue({
|
|
5390
|
+
code: z.ZodIssueCode.custom,
|
|
5391
|
+
message: "Wallet client must be provided"
|
|
5392
|
+
});
|
|
5393
|
+
return false;
|
|
5394
|
+
}
|
|
5395
|
+
if (client.chain === void 0) {
|
|
5396
|
+
ctx.addIssue({
|
|
5397
|
+
code: z.ZodIssueCode.custom,
|
|
5398
|
+
message: "Wallet client must have a chain property"
|
|
5399
|
+
});
|
|
5400
|
+
return false;
|
|
5401
|
+
}
|
|
5402
|
+
if (!chainIds.includes(client.chain?.id)) {
|
|
5403
|
+
ctx.addIssue({
|
|
5404
|
+
code: z.ZodIssueCode.custom,
|
|
5405
|
+
message: `Wallet client chain must be one of [${networks.join(", ")}]`
|
|
5406
|
+
});
|
|
5407
|
+
return false;
|
|
5408
|
+
}
|
|
5409
|
+
return true;
|
|
5410
|
+
}),
|
|
5411
|
+
_: z.object({
|
|
5412
|
+
graphUrl: z.string().url().optional(),
|
|
5413
|
+
restUrl: z.string().url().optional(),
|
|
5414
|
+
contractAddresses: z.object({
|
|
5415
|
+
setter: z.string().optional(),
|
|
5416
|
+
getter: z.string().optional(),
|
|
5417
|
+
token: z.string().optional()
|
|
5418
|
+
}).optional()
|
|
5419
|
+
}).optional()
|
|
5112
5420
|
});
|
|
5421
|
+
const globals = {
|
|
5422
|
+
MAX_WEI_AMOUNT: 115792089237316195423570985008687907853269984665640564039457584007913129639935n,
|
|
5423
|
+
CLUSTER_SIZES: {
|
|
5424
|
+
QUAD_CLUSTER: 4,
|
|
5425
|
+
SEPT_CLUSTER: 7,
|
|
5426
|
+
DECA_CLUSTER: 10,
|
|
5427
|
+
TRISKAIDEKA_CLUSTER: 13
|
|
5428
|
+
},
|
|
5429
|
+
FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE: {
|
|
5430
|
+
QUAD_CLUSTER: 80,
|
|
5431
|
+
SEPT_CLUSTER: 40,
|
|
5432
|
+
DECA_CLUSTER: 30,
|
|
5433
|
+
TRISKAIDEKA_CLUSTER: 20
|
|
5434
|
+
},
|
|
5435
|
+
BLOCKS_PER_DAY: 7160n,
|
|
5436
|
+
OPERATORS_PER_PAGE: 50,
|
|
5437
|
+
BLOCKS_PER_YEAR: 2613400n,
|
|
5438
|
+
DEFAULT_CLUSTER_PERIOD: 730,
|
|
5439
|
+
NUMBERS_OF_WEEKS_IN_YEAR: 52.1429,
|
|
5440
|
+
MAX_VALIDATORS_COUNT_MULTI_FLOW: 50,
|
|
5441
|
+
CLUSTER_VALIDITY_PERIOD_MINIMUM: 30,
|
|
5442
|
+
OPERATOR_VALIDATORS_LIMIT_PRESERVE: 5,
|
|
5443
|
+
MINIMUM_OPERATOR_FEE_PER_BLOCK: 1000000000n,
|
|
5444
|
+
MIN_VALIDATORS_COUNT_PER_BULK_REGISTRATION: 1,
|
|
5445
|
+
DEFAULT_ADDRESS_WHITELIST: "0x0000000000000000000000000000000000000000"
|
|
5446
|
+
};
|
|
5447
|
+
const registerValidatorsByClusterSizeLimits = {
|
|
5448
|
+
[globals.CLUSTER_SIZES.QUAD_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.QUAD_CLUSTER,
|
|
5449
|
+
[globals.CLUSTER_SIZES.SEPT_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.SEPT_CLUSTER,
|
|
5450
|
+
[globals.CLUSTER_SIZES.DECA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.DECA_CLUSTER,
|
|
5451
|
+
[globals.CLUSTER_SIZES.TRISKAIDEKA_CLUSTER]: globals.FIXED_VALIDATORS_COUNT_PER_CLUSTER_SIZE.TRISKAIDEKA_CLUSTER
|
|
5452
|
+
};
|
|
5113
5453
|
export {
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5454
|
+
formatSSV as $,
|
|
5455
|
+
ensureNoKeysharesErrors as A,
|
|
5456
|
+
ensureValidatorsUniqueness as B,
|
|
5457
|
+
validateConsistentOperatorPublicKeys as C,
|
|
5458
|
+
validateConsistentOperatorIds as D,
|
|
5459
|
+
sortNumbers as E,
|
|
5460
|
+
KeysharesValidationErrors as F,
|
|
5461
|
+
hoodi as G,
|
|
5462
|
+
chains as H,
|
|
5463
|
+
networks as I,
|
|
5464
|
+
bigintMin as J,
|
|
5124
5465
|
KeysharesValidationError as K,
|
|
5125
|
-
|
|
5466
|
+
bigintRound as L,
|
|
5126
5467
|
MapCache as M,
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5468
|
+
bigintFloor as N,
|
|
5469
|
+
bigintAbs as O,
|
|
5470
|
+
isBigIntChanged as P,
|
|
5471
|
+
bigintifyNumbers as Q,
|
|
5472
|
+
isClusterId as R,
|
|
5132
5473
|
Symbol$1 as S,
|
|
5474
|
+
add0x as T,
|
|
5133
5475
|
Uint8Array as U,
|
|
5476
|
+
KeysharesValidationErrorsMessages as V,
|
|
5477
|
+
numberFormatter as W,
|
|
5478
|
+
percentageFormatter as X,
|
|
5479
|
+
bigintFormatter as Y,
|
|
5480
|
+
ethFormatter as Z,
|
|
5134
5481
|
_percentageFormatter as _,
|
|
5135
5482
|
getTag as a,
|
|
5483
|
+
formatBigintInput as a0,
|
|
5484
|
+
ms as a1,
|
|
5485
|
+
getOperatorIds as a2,
|
|
5136
5486
|
Stack as b,
|
|
5137
5487
|
isTypedArray as c,
|
|
5138
5488
|
decodeOperatorPublicKey as d,
|
|
@@ -5143,19 +5493,19 @@ export {
|
|
|
5143
5493
|
isBuffer as i,
|
|
5144
5494
|
isUndefined as j,
|
|
5145
5495
|
configArgsSchema as k,
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5496
|
+
chainIds as l,
|
|
5497
|
+
contracts as m,
|
|
5498
|
+
graph_endpoints as n,
|
|
5499
|
+
getClusterSnapshot as o,
|
|
5500
|
+
process$1 as p,
|
|
5501
|
+
isKeySharesItem as q,
|
|
5502
|
+
rest_endpoints as r,
|
|
5153
5503
|
stringifyBigints as s,
|
|
5154
5504
|
tryCatch as t,
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5505
|
+
registerValidatorsByClusterSizeLimits as u,
|
|
5506
|
+
createClusterId as v,
|
|
5507
|
+
createEmptyCluster as w,
|
|
5508
|
+
roundOperatorFee as x,
|
|
5509
|
+
globals as y,
|
|
5510
|
+
bigintMax as z
|
|
5161
5511
|
};
|