@t2000/cli 0.22.22 → 0.22.23

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.
Files changed (43) hide show
  1. package/dist/{ccip-3TXHQUZ5.js → ccip-JEEJV65M.js} +3 -3
  2. package/dist/{chunk-3W7OQGNS.js → chunk-3XUF7GM3.js} +21 -42
  3. package/dist/chunk-3XUF7GM3.js.map +1 -0
  4. package/dist/chunk-77SWBATH.js +204 -0
  5. package/dist/chunk-77SWBATH.js.map +1 -0
  6. package/dist/{chunk-ML6HST4W.js → chunk-A5X4KG7U.js} +1878 -341
  7. package/dist/chunk-A5X4KG7U.js.map +1 -0
  8. package/dist/{chunk-VREOXJUB.js → chunk-EEPD7SHV.js} +15455 -14941
  9. package/dist/chunk-EEPD7SHV.js.map +1 -0
  10. package/dist/chunk-KHIL2KNW.js +4016 -0
  11. package/dist/chunk-KHIL2KNW.js.map +1 -0
  12. package/dist/{chunk-ZNF5QSAT.js → chunk-RN7Z6TWD.js} +33444 -24623
  13. package/dist/chunk-RN7Z6TWD.js.map +1 -0
  14. package/dist/{chunk-AB65Y674.js → chunk-V7PXDEKG.js} +2 -2
  15. package/dist/chunk-V7PXDEKG.js.map +1 -0
  16. package/dist/client-I4SGZLVD.js +746 -0
  17. package/dist/client-I4SGZLVD.js.map +1 -0
  18. package/dist/{client-SYS6Z5RX.js → client-R3NRAXMD.js} +5715 -2933
  19. package/dist/client-R3NRAXMD.js.map +1 -0
  20. package/dist/{dist-73ESA7QZ.js → dist-FDS4MNUV.js} +135 -4160
  21. package/dist/dist-FDS4MNUV.js.map +1 -0
  22. package/dist/{dist-IANNA5N7.js → dist-G5YKLWC5.js} +5 -5
  23. package/dist/{esm-IQVNJILX.js → esm-QBJBHFZA.js} +11 -11
  24. package/dist/esm-QBJBHFZA.js.map +1 -0
  25. package/dist/index.js +48 -36
  26. package/dist/index.js.map +1 -1
  27. package/package.json +4 -4
  28. package/dist/chunk-3W7OQGNS.js.map +0 -1
  29. package/dist/chunk-AB65Y674.js.map +0 -1
  30. package/dist/chunk-H66DC3S3.js +0 -1908
  31. package/dist/chunk-H66DC3S3.js.map +0 -1
  32. package/dist/chunk-IHPSFXUW.js +0 -5002
  33. package/dist/chunk-IHPSFXUW.js.map +0 -1
  34. package/dist/chunk-ML6HST4W.js.map +0 -1
  35. package/dist/chunk-VREOXJUB.js.map +0 -1
  36. package/dist/chunk-ZNF5QSAT.js.map +0 -1
  37. package/dist/client-4DBCJNJO.js +0 -117
  38. package/dist/client-4DBCJNJO.js.map +0 -1
  39. package/dist/client-SYS6Z5RX.js.map +0 -1
  40. package/dist/dist-73ESA7QZ.js.map +0 -1
  41. package/dist/esm-IQVNJILX.js.map +0 -1
  42. /package/dist/{ccip-3TXHQUZ5.js.map → ccip-JEEJV65M.js.map} +0 -0
  43. /package/dist/{dist-IANNA5N7.js.map → dist-G5YKLWC5.js.map} +0 -0
@@ -1,1908 +0,0 @@
1
- import { createRequire as __createRequire } from 'module'; import { fileURLToPath as __fileURLToPath } from 'url'; import { dirname as __pathDirname } from 'path'; const require = __createRequire(import.meta.url); const __filename = __fileURLToPath(import.meta.url); const __dirname = __pathDirname(__filename);
2
- import {
3
- Hash,
4
- abytes,
5
- aexists,
6
- anumber,
7
- aoutput,
8
- clean,
9
- createHasher,
10
- equalBytes,
11
- rotlBH,
12
- rotlBL,
13
- rotlSH,
14
- rotlSL,
15
- split,
16
- swap32IfBE,
17
- toBytes,
18
- u32
19
- } from "./chunk-7LGHVVIJ.js";
20
- import {
21
- __export
22
- } from "./chunk-YPWSCLE3.js";
23
-
24
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/regex.js
25
- function execTyped(regex, string) {
26
- const match = regex.exec(string);
27
- return match?.groups;
28
- }
29
- var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
30
- var integerRegex = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
31
- var isTupleRegex = /^\(.+?\).*?$/;
32
-
33
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js
34
- var errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
35
- function isErrorSignature(signature) {
36
- return errorSignatureRegex.test(signature);
37
- }
38
- function execErrorSignature(signature) {
39
- return execTyped(errorSignatureRegex, signature);
40
- }
41
- var eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
42
- function isEventSignature(signature) {
43
- return eventSignatureRegex.test(signature);
44
- }
45
- function execEventSignature(signature) {
46
- return execTyped(eventSignatureRegex, signature);
47
- }
48
- var functionSignatureRegex = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
49
- function isFunctionSignature(signature) {
50
- return functionSignatureRegex.test(signature);
51
- }
52
- function execFunctionSignature(signature) {
53
- return execTyped(functionSignatureRegex, signature);
54
- }
55
- var structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
56
- function isStructSignature(signature) {
57
- return structSignatureRegex.test(signature);
58
- }
59
- function execStructSignature(signature) {
60
- return execTyped(structSignatureRegex, signature);
61
- }
62
- var constructorSignatureRegex = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
63
- function isConstructorSignature(signature) {
64
- return constructorSignatureRegex.test(signature);
65
- }
66
- function execConstructorSignature(signature) {
67
- return execTyped(constructorSignatureRegex, signature);
68
- }
69
- var fallbackSignatureRegex = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
70
- function isFallbackSignature(signature) {
71
- return fallbackSignatureRegex.test(signature);
72
- }
73
- function execFallbackSignature(signature) {
74
- return execTyped(fallbackSignatureRegex, signature);
75
- }
76
- var receiveSignatureRegex = /^receive\(\) external payable$/;
77
- function isReceiveSignature(signature) {
78
- return receiveSignatureRegex.test(signature);
79
- }
80
- var modifiers = /* @__PURE__ */ new Set([
81
- "memory",
82
- "indexed",
83
- "storage",
84
- "calldata"
85
- ]);
86
- var eventModifiers = /* @__PURE__ */ new Set(["indexed"]);
87
- var functionModifiers = /* @__PURE__ */ new Set([
88
- "calldata",
89
- "memory",
90
- "storage"
91
- ]);
92
-
93
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/version.js
94
- var version = "1.2.3";
95
-
96
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/errors.js
97
- var BaseError = class _BaseError extends Error {
98
- constructor(shortMessage, args = {}) {
99
- const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
100
- const docsPath = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
101
- const message = [
102
- shortMessage || "An error occurred.",
103
- "",
104
- ...args.metaMessages ? [...args.metaMessages, ""] : [],
105
- ...docsPath ? [`Docs: https://abitype.dev${docsPath}`] : [],
106
- ...details ? [`Details: ${details}`] : [],
107
- `Version: abitype@${version}`
108
- ].join("\n");
109
- super(message);
110
- Object.defineProperty(this, "details", {
111
- enumerable: true,
112
- configurable: true,
113
- writable: true,
114
- value: void 0
115
- });
116
- Object.defineProperty(this, "docsPath", {
117
- enumerable: true,
118
- configurable: true,
119
- writable: true,
120
- value: void 0
121
- });
122
- Object.defineProperty(this, "metaMessages", {
123
- enumerable: true,
124
- configurable: true,
125
- writable: true,
126
- value: void 0
127
- });
128
- Object.defineProperty(this, "shortMessage", {
129
- enumerable: true,
130
- configurable: true,
131
- writable: true,
132
- value: void 0
133
- });
134
- Object.defineProperty(this, "name", {
135
- enumerable: true,
136
- configurable: true,
137
- writable: true,
138
- value: "AbiTypeError"
139
- });
140
- if (args.cause)
141
- this.cause = args.cause;
142
- this.details = details;
143
- this.docsPath = docsPath;
144
- this.metaMessages = args.metaMessages;
145
- this.shortMessage = shortMessage;
146
- }
147
- };
148
-
149
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js
150
- var UnknownTypeError = class extends BaseError {
151
- constructor({ type }) {
152
- super("Unknown type.", {
153
- metaMessages: [
154
- `Type "${type}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`
155
- ]
156
- });
157
- Object.defineProperty(this, "name", {
158
- enumerable: true,
159
- configurable: true,
160
- writable: true,
161
- value: "UnknownTypeError"
162
- });
163
- }
164
- };
165
- var UnknownSolidityTypeError = class extends BaseError {
166
- constructor({ type }) {
167
- super("Unknown type.", {
168
- metaMessages: [`Type "${type}" is not a valid ABI type.`]
169
- });
170
- Object.defineProperty(this, "name", {
171
- enumerable: true,
172
- configurable: true,
173
- writable: true,
174
- value: "UnknownSolidityTypeError"
175
- });
176
- }
177
- };
178
-
179
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js
180
- var InvalidAbiParametersError = class extends BaseError {
181
- constructor({ params }) {
182
- super("Failed to parse ABI parameters.", {
183
- details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,
184
- docsPath: "/api/human#parseabiparameters-1"
185
- });
186
- Object.defineProperty(this, "name", {
187
- enumerable: true,
188
- configurable: true,
189
- writable: true,
190
- value: "InvalidAbiParametersError"
191
- });
192
- }
193
- };
194
- var InvalidParameterError = class extends BaseError {
195
- constructor({ param }) {
196
- super("Invalid ABI parameter.", {
197
- details: param
198
- });
199
- Object.defineProperty(this, "name", {
200
- enumerable: true,
201
- configurable: true,
202
- writable: true,
203
- value: "InvalidParameterError"
204
- });
205
- }
206
- };
207
- var SolidityProtectedKeywordError = class extends BaseError {
208
- constructor({ param, name }) {
209
- super("Invalid ABI parameter.", {
210
- details: param,
211
- metaMessages: [
212
- `"${name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`
213
- ]
214
- });
215
- Object.defineProperty(this, "name", {
216
- enumerable: true,
217
- configurable: true,
218
- writable: true,
219
- value: "SolidityProtectedKeywordError"
220
- });
221
- }
222
- };
223
- var InvalidModifierError = class extends BaseError {
224
- constructor({ param, type, modifier }) {
225
- super("Invalid ABI parameter.", {
226
- details: param,
227
- metaMessages: [
228
- `Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`
229
- ]
230
- });
231
- Object.defineProperty(this, "name", {
232
- enumerable: true,
233
- configurable: true,
234
- writable: true,
235
- value: "InvalidModifierError"
236
- });
237
- }
238
- };
239
- var InvalidFunctionModifierError = class extends BaseError {
240
- constructor({ param, type, modifier }) {
241
- super("Invalid ABI parameter.", {
242
- details: param,
243
- metaMessages: [
244
- `Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`,
245
- `Data location can only be specified for array, struct, or mapping types, but "${modifier}" was given.`
246
- ]
247
- });
248
- Object.defineProperty(this, "name", {
249
- enumerable: true,
250
- configurable: true,
251
- writable: true,
252
- value: "InvalidFunctionModifierError"
253
- });
254
- }
255
- };
256
- var InvalidAbiTypeParameterError = class extends BaseError {
257
- constructor({ abiParameter }) {
258
- super("Invalid ABI parameter.", {
259
- details: JSON.stringify(abiParameter, null, 2),
260
- metaMessages: ["ABI parameter type is invalid."]
261
- });
262
- Object.defineProperty(this, "name", {
263
- enumerable: true,
264
- configurable: true,
265
- writable: true,
266
- value: "InvalidAbiTypeParameterError"
267
- });
268
- }
269
- };
270
-
271
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/signature.js
272
- var InvalidSignatureError = class extends BaseError {
273
- constructor({ signature, type }) {
274
- super(`Invalid ${type} signature.`, {
275
- details: signature
276
- });
277
- Object.defineProperty(this, "name", {
278
- enumerable: true,
279
- configurable: true,
280
- writable: true,
281
- value: "InvalidSignatureError"
282
- });
283
- }
284
- };
285
- var UnknownSignatureError = class extends BaseError {
286
- constructor({ signature }) {
287
- super("Unknown signature.", {
288
- details: signature
289
- });
290
- Object.defineProperty(this, "name", {
291
- enumerable: true,
292
- configurable: true,
293
- writable: true,
294
- value: "UnknownSignatureError"
295
- });
296
- }
297
- };
298
- var InvalidStructSignatureError = class extends BaseError {
299
- constructor({ signature }) {
300
- super("Invalid struct signature.", {
301
- details: signature,
302
- metaMessages: ["No properties exist."]
303
- });
304
- Object.defineProperty(this, "name", {
305
- enumerable: true,
306
- configurable: true,
307
- writable: true,
308
- value: "InvalidStructSignatureError"
309
- });
310
- }
311
- };
312
-
313
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/struct.js
314
- var CircularReferenceError = class extends BaseError {
315
- constructor({ type }) {
316
- super("Circular reference detected.", {
317
- metaMessages: [`Struct "${type}" is a circular reference.`]
318
- });
319
- Object.defineProperty(this, "name", {
320
- enumerable: true,
321
- configurable: true,
322
- writable: true,
323
- value: "CircularReferenceError"
324
- });
325
- }
326
- };
327
-
328
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js
329
- var InvalidParenthesisError = class extends BaseError {
330
- constructor({ current, depth }) {
331
- super("Unbalanced parentheses.", {
332
- metaMessages: [
333
- `"${current.trim()}" has too many ${depth > 0 ? "opening" : "closing"} parentheses.`
334
- ],
335
- details: `Depth "${depth}"`
336
- });
337
- Object.defineProperty(this, "name", {
338
- enumerable: true,
339
- configurable: true,
340
- writable: true,
341
- value: "InvalidParenthesisError"
342
- });
343
- }
344
- };
345
-
346
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/cache.js
347
- function getParameterCacheKey(param, type, structs) {
348
- let structKey = "";
349
- if (structs)
350
- for (const struct of Object.entries(structs)) {
351
- if (!struct)
352
- continue;
353
- let propertyKey = "";
354
- for (const property of struct[1]) {
355
- propertyKey += `[${property.type}${property.name ? `:${property.name}` : ""}]`;
356
- }
357
- structKey += `(${struct[0]}{${propertyKey}})`;
358
- }
359
- if (type)
360
- return `${type}:${param}${structKey}`;
361
- return `${param}${structKey}`;
362
- }
363
- var parameterCache = /* @__PURE__ */ new Map([
364
- // Unnamed
365
- ["address", { type: "address" }],
366
- ["bool", { type: "bool" }],
367
- ["bytes", { type: "bytes" }],
368
- ["bytes32", { type: "bytes32" }],
369
- ["int", { type: "int256" }],
370
- ["int256", { type: "int256" }],
371
- ["string", { type: "string" }],
372
- ["uint", { type: "uint256" }],
373
- ["uint8", { type: "uint8" }],
374
- ["uint16", { type: "uint16" }],
375
- ["uint24", { type: "uint24" }],
376
- ["uint32", { type: "uint32" }],
377
- ["uint64", { type: "uint64" }],
378
- ["uint96", { type: "uint96" }],
379
- ["uint112", { type: "uint112" }],
380
- ["uint160", { type: "uint160" }],
381
- ["uint192", { type: "uint192" }],
382
- ["uint256", { type: "uint256" }],
383
- // Named
384
- ["address owner", { type: "address", name: "owner" }],
385
- ["address to", { type: "address", name: "to" }],
386
- ["bool approved", { type: "bool", name: "approved" }],
387
- ["bytes _data", { type: "bytes", name: "_data" }],
388
- ["bytes data", { type: "bytes", name: "data" }],
389
- ["bytes signature", { type: "bytes", name: "signature" }],
390
- ["bytes32 hash", { type: "bytes32", name: "hash" }],
391
- ["bytes32 r", { type: "bytes32", name: "r" }],
392
- ["bytes32 root", { type: "bytes32", name: "root" }],
393
- ["bytes32 s", { type: "bytes32", name: "s" }],
394
- ["string name", { type: "string", name: "name" }],
395
- ["string symbol", { type: "string", name: "symbol" }],
396
- ["string tokenURI", { type: "string", name: "tokenURI" }],
397
- ["uint tokenId", { type: "uint256", name: "tokenId" }],
398
- ["uint8 v", { type: "uint8", name: "v" }],
399
- ["uint256 balance", { type: "uint256", name: "balance" }],
400
- ["uint256 tokenId", { type: "uint256", name: "tokenId" }],
401
- ["uint256 value", { type: "uint256", name: "value" }],
402
- // Indexed
403
- [
404
- "event:address indexed from",
405
- { type: "address", name: "from", indexed: true }
406
- ],
407
- ["event:address indexed to", { type: "address", name: "to", indexed: true }],
408
- [
409
- "event:uint indexed tokenId",
410
- { type: "uint256", name: "tokenId", indexed: true }
411
- ],
412
- [
413
- "event:uint256 indexed tokenId",
414
- { type: "uint256", name: "tokenId", indexed: true }
415
- ]
416
- ]);
417
-
418
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/utils.js
419
- function parseSignature(signature, structs = {}) {
420
- if (isFunctionSignature(signature))
421
- return parseFunctionSignature(signature, structs);
422
- if (isEventSignature(signature))
423
- return parseEventSignature(signature, structs);
424
- if (isErrorSignature(signature))
425
- return parseErrorSignature(signature, structs);
426
- if (isConstructorSignature(signature))
427
- return parseConstructorSignature(signature, structs);
428
- if (isFallbackSignature(signature))
429
- return parseFallbackSignature(signature);
430
- if (isReceiveSignature(signature))
431
- return {
432
- type: "receive",
433
- stateMutability: "payable"
434
- };
435
- throw new UnknownSignatureError({ signature });
436
- }
437
- function parseFunctionSignature(signature, structs = {}) {
438
- const match = execFunctionSignature(signature);
439
- if (!match)
440
- throw new InvalidSignatureError({ signature, type: "function" });
441
- const inputParams = splitParameters(match.parameters);
442
- const inputs = [];
443
- const inputLength = inputParams.length;
444
- for (let i = 0; i < inputLength; i++) {
445
- inputs.push(parseAbiParameter(inputParams[i], {
446
- modifiers: functionModifiers,
447
- structs,
448
- type: "function"
449
- }));
450
- }
451
- const outputs = [];
452
- if (match.returns) {
453
- const outputParams = splitParameters(match.returns);
454
- const outputLength = outputParams.length;
455
- for (let i = 0; i < outputLength; i++) {
456
- outputs.push(parseAbiParameter(outputParams[i], {
457
- modifiers: functionModifiers,
458
- structs,
459
- type: "function"
460
- }));
461
- }
462
- }
463
- return {
464
- name: match.name,
465
- type: "function",
466
- stateMutability: match.stateMutability ?? "nonpayable",
467
- inputs,
468
- outputs
469
- };
470
- }
471
- function parseEventSignature(signature, structs = {}) {
472
- const match = execEventSignature(signature);
473
- if (!match)
474
- throw new InvalidSignatureError({ signature, type: "event" });
475
- const params = splitParameters(match.parameters);
476
- const abiParameters = [];
477
- const length = params.length;
478
- for (let i = 0; i < length; i++)
479
- abiParameters.push(parseAbiParameter(params[i], {
480
- modifiers: eventModifiers,
481
- structs,
482
- type: "event"
483
- }));
484
- return { name: match.name, type: "event", inputs: abiParameters };
485
- }
486
- function parseErrorSignature(signature, structs = {}) {
487
- const match = execErrorSignature(signature);
488
- if (!match)
489
- throw new InvalidSignatureError({ signature, type: "error" });
490
- const params = splitParameters(match.parameters);
491
- const abiParameters = [];
492
- const length = params.length;
493
- for (let i = 0; i < length; i++)
494
- abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
495
- return { name: match.name, type: "error", inputs: abiParameters };
496
- }
497
- function parseConstructorSignature(signature, structs = {}) {
498
- const match = execConstructorSignature(signature);
499
- if (!match)
500
- throw new InvalidSignatureError({ signature, type: "constructor" });
501
- const params = splitParameters(match.parameters);
502
- const abiParameters = [];
503
- const length = params.length;
504
- for (let i = 0; i < length; i++)
505
- abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
506
- return {
507
- type: "constructor",
508
- stateMutability: match.stateMutability ?? "nonpayable",
509
- inputs: abiParameters
510
- };
511
- }
512
- function parseFallbackSignature(signature) {
513
- const match = execFallbackSignature(signature);
514
- if (!match)
515
- throw new InvalidSignatureError({ signature, type: "fallback" });
516
- return {
517
- type: "fallback",
518
- stateMutability: match.stateMutability ?? "nonpayable"
519
- };
520
- }
521
- var abiParameterWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
522
- var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
523
- var dynamicIntegerRegex = /^u?int$/;
524
- function parseAbiParameter(param, options) {
525
- const parameterCacheKey = getParameterCacheKey(param, options?.type, options?.structs);
526
- if (parameterCache.has(parameterCacheKey))
527
- return parameterCache.get(parameterCacheKey);
528
- const isTuple = isTupleRegex.test(param);
529
- const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);
530
- if (!match)
531
- throw new InvalidParameterError({ param });
532
- if (match.name && isSolidityKeyword(match.name))
533
- throw new SolidityProtectedKeywordError({ param, name: match.name });
534
- const name = match.name ? { name: match.name } : {};
535
- const indexed = match.modifier === "indexed" ? { indexed: true } : {};
536
- const structs = options?.structs ?? {};
537
- let type;
538
- let components = {};
539
- if (isTuple) {
540
- type = "tuple";
541
- const params = splitParameters(match.type);
542
- const components_ = [];
543
- const length = params.length;
544
- for (let i = 0; i < length; i++) {
545
- components_.push(parseAbiParameter(params[i], { structs }));
546
- }
547
- components = { components: components_ };
548
- } else if (match.type in structs) {
549
- type = "tuple";
550
- components = { components: structs[match.type] };
551
- } else if (dynamicIntegerRegex.test(match.type)) {
552
- type = `${match.type}256`;
553
- } else if (match.type === "address payable") {
554
- type = "address";
555
- } else {
556
- type = match.type;
557
- if (!(options?.type === "struct") && !isSolidityType(type))
558
- throw new UnknownSolidityTypeError({ type });
559
- }
560
- if (match.modifier) {
561
- if (!options?.modifiers?.has?.(match.modifier))
562
- throw new InvalidModifierError({
563
- param,
564
- type: options?.type,
565
- modifier: match.modifier
566
- });
567
- if (functionModifiers.has(match.modifier) && !isValidDataLocation(type, !!match.array))
568
- throw new InvalidFunctionModifierError({
569
- param,
570
- type: options?.type,
571
- modifier: match.modifier
572
- });
573
- }
574
- const abiParameter = {
575
- type: `${type}${match.array ?? ""}`,
576
- ...name,
577
- ...indexed,
578
- ...components
579
- };
580
- parameterCache.set(parameterCacheKey, abiParameter);
581
- return abiParameter;
582
- }
583
- function splitParameters(params, result = [], current = "", depth = 0) {
584
- const length = params.trim().length;
585
- for (let i = 0; i < length; i++) {
586
- const char = params[i];
587
- const tail = params.slice(i + 1);
588
- switch (char) {
589
- case ",":
590
- return depth === 0 ? splitParameters(tail, [...result, current.trim()]) : splitParameters(tail, result, `${current}${char}`, depth);
591
- case "(":
592
- return splitParameters(tail, result, `${current}${char}`, depth + 1);
593
- case ")":
594
- return splitParameters(tail, result, `${current}${char}`, depth - 1);
595
- default:
596
- return splitParameters(tail, result, `${current}${char}`, depth);
597
- }
598
- }
599
- if (current === "")
600
- return result;
601
- if (depth !== 0)
602
- throw new InvalidParenthesisError({ current, depth });
603
- result.push(current.trim());
604
- return result;
605
- }
606
- function isSolidityType(type) {
607
- return type === "address" || type === "bool" || type === "function" || type === "string" || bytesRegex.test(type) || integerRegex.test(type);
608
- }
609
- var protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
610
- function isSolidityKeyword(name) {
611
- return name === "address" || name === "bool" || name === "function" || name === "string" || name === "tuple" || bytesRegex.test(name) || integerRegex.test(name) || protectedKeywordsRegex.test(name);
612
- }
613
- function isValidDataLocation(type, isArray) {
614
- return isArray || type === "bytes" || type === "string" || type === "tuple";
615
- }
616
-
617
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/structs.js
618
- function parseStructs(signatures) {
619
- const shallowStructs = {};
620
- const signaturesLength = signatures.length;
621
- for (let i = 0; i < signaturesLength; i++) {
622
- const signature = signatures[i];
623
- if (!isStructSignature(signature))
624
- continue;
625
- const match = execStructSignature(signature);
626
- if (!match)
627
- throw new InvalidSignatureError({ signature, type: "struct" });
628
- const properties = match.properties.split(";");
629
- const components = [];
630
- const propertiesLength = properties.length;
631
- for (let k = 0; k < propertiesLength; k++) {
632
- const property = properties[k];
633
- const trimmed = property.trim();
634
- if (!trimmed)
635
- continue;
636
- const abiParameter = parseAbiParameter(trimmed, {
637
- type: "struct"
638
- });
639
- components.push(abiParameter);
640
- }
641
- if (!components.length)
642
- throw new InvalidStructSignatureError({ signature });
643
- shallowStructs[match.name] = components;
644
- }
645
- const resolvedStructs = {};
646
- const entries = Object.entries(shallowStructs);
647
- const entriesLength = entries.length;
648
- for (let i = 0; i < entriesLength; i++) {
649
- const [name, parameters] = entries[i];
650
- resolvedStructs[name] = resolveStructs(parameters, shallowStructs);
651
- }
652
- return resolvedStructs;
653
- }
654
- var typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
655
- function resolveStructs(abiParameters = [], structs = {}, ancestors = /* @__PURE__ */ new Set()) {
656
- const components = [];
657
- const length = abiParameters.length;
658
- for (let i = 0; i < length; i++) {
659
- const abiParameter = abiParameters[i];
660
- const isTuple = isTupleRegex.test(abiParameter.type);
661
- if (isTuple)
662
- components.push(abiParameter);
663
- else {
664
- const match = execTyped(typeWithoutTupleRegex, abiParameter.type);
665
- if (!match?.type)
666
- throw new InvalidAbiTypeParameterError({ abiParameter });
667
- const { array, type } = match;
668
- if (type in structs) {
669
- if (ancestors.has(type))
670
- throw new CircularReferenceError({ type });
671
- components.push({
672
- ...abiParameter,
673
- type: `tuple${array ?? ""}`,
674
- components: resolveStructs(structs[type], structs, /* @__PURE__ */ new Set([...ancestors, type]))
675
- });
676
- } else {
677
- if (isSolidityType(type))
678
- components.push(abiParameter);
679
- else
680
- throw new UnknownTypeError({ type });
681
- }
682
- }
683
- }
684
- return components;
685
- }
686
-
687
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/parseAbi.js
688
- function parseAbi(signatures) {
689
- const structs = parseStructs(signatures);
690
- const abi = [];
691
- const length = signatures.length;
692
- for (let i = 0; i < length; i++) {
693
- const signature = signatures[i];
694
- if (isStructSignature(signature))
695
- continue;
696
- abi.push(parseSignature(signature, structs));
697
- }
698
- return abi;
699
- }
700
-
701
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
702
- var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
703
- function formatAbiParameter(abiParameter) {
704
- let type = abiParameter.type;
705
- if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
706
- type = "(";
707
- const length = abiParameter.components.length;
708
- for (let i = 0; i < length; i++) {
709
- const component = abiParameter.components[i];
710
- type += formatAbiParameter(component);
711
- if (i < length - 1)
712
- type += ", ";
713
- }
714
- const result = execTyped(tupleRegex, abiParameter.type);
715
- type += `)${result?.array || ""}`;
716
- return formatAbiParameter({
717
- ...abiParameter,
718
- type
719
- });
720
- }
721
- if ("indexed" in abiParameter && abiParameter.indexed)
722
- type = `${type} indexed`;
723
- if (abiParameter.name)
724
- return `${type} ${abiParameter.name}`;
725
- return type;
726
- }
727
-
728
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
729
- function formatAbiParameters(abiParameters) {
730
- let params = "";
731
- const length = abiParameters.length;
732
- for (let i = 0; i < length; i++) {
733
- const abiParameter = abiParameters[i];
734
- params += formatAbiParameter(abiParameter);
735
- if (i !== length - 1)
736
- params += ", ";
737
- }
738
- return params;
739
- }
740
-
741
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
742
- function formatAbiItem(abiItem) {
743
- if (abiItem.type === "function")
744
- return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs?.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
745
- if (abiItem.type === "event")
746
- return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
747
- if (abiItem.type === "error")
748
- return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
749
- if (abiItem.type === "constructor")
750
- return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
751
- if (abiItem.type === "fallback")
752
- return `fallback() external${abiItem.stateMutability === "payable" ? " payable" : ""}`;
753
- return "receive() external payable";
754
- }
755
-
756
- // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js
757
- function parseAbiParameters(params) {
758
- const abiParameters = [];
759
- if (typeof params === "string") {
760
- const parameters = splitParameters(params);
761
- const length = parameters.length;
762
- for (let i = 0; i < length; i++) {
763
- abiParameters.push(parseAbiParameter(parameters[i], { modifiers }));
764
- }
765
- } else {
766
- const structs = parseStructs(params);
767
- const length = params.length;
768
- for (let i = 0; i < length; i++) {
769
- const signature = params[i];
770
- if (isStructSignature(signature))
771
- continue;
772
- const parameters = splitParameters(signature);
773
- const length2 = parameters.length;
774
- for (let k = 0; k < length2; k++) {
775
- abiParameters.push(parseAbiParameter(parameters[k], { modifiers, structs }));
776
- }
777
- }
778
- }
779
- if (abiParameters.length === 0)
780
- throw new InvalidAbiParametersError({ params });
781
- return abiParameters;
782
- }
783
-
784
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Hex.js
785
- var Hex_exports = {};
786
- __export(Hex_exports, {
787
- IntegerOutOfRangeError: () => IntegerOutOfRangeError,
788
- InvalidHexBooleanError: () => InvalidHexBooleanError,
789
- InvalidHexTypeError: () => InvalidHexTypeError,
790
- InvalidHexValueError: () => InvalidHexValueError,
791
- InvalidLengthError: () => InvalidLengthError,
792
- SizeExceedsPaddingSizeError: () => SizeExceedsPaddingSizeError2,
793
- SizeOverflowError: () => SizeOverflowError2,
794
- SliceOffsetOutOfBoundsError: () => SliceOffsetOutOfBoundsError2,
795
- assert: () => assert2,
796
- concat: () => concat2,
797
- from: () => from2,
798
- fromBoolean: () => fromBoolean2,
799
- fromBytes: () => fromBytes,
800
- fromNumber: () => fromNumber,
801
- fromString: () => fromString2,
802
- isEqual: () => isEqual2,
803
- padLeft: () => padLeft2,
804
- padRight: () => padRight,
805
- random: () => random2,
806
- size: () => size2,
807
- slice: () => slice2,
808
- toBigInt: () => toBigInt,
809
- toBoolean: () => toBoolean2,
810
- toBytes: () => toBytes2,
811
- toNumber: () => toNumber,
812
- toString: () => toString2,
813
- trimLeft: () => trimLeft2,
814
- trimRight: () => trimRight2,
815
- validate: () => validate2
816
- });
817
-
818
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Bytes.js
819
- var Bytes_exports = {};
820
- __export(Bytes_exports, {
821
- InvalidBytesBooleanError: () => InvalidBytesBooleanError,
822
- InvalidBytesTypeError: () => InvalidBytesTypeError,
823
- SizeExceedsPaddingSizeError: () => SizeExceedsPaddingSizeError,
824
- SizeOverflowError: () => SizeOverflowError,
825
- SliceOffsetOutOfBoundsError: () => SliceOffsetOutOfBoundsError,
826
- assert: () => assert,
827
- concat: () => concat,
828
- from: () => from,
829
- fromArray: () => fromArray,
830
- fromBoolean: () => fromBoolean,
831
- fromHex: () => fromHex,
832
- fromNumber: () => fromNumber2,
833
- fromString: () => fromString,
834
- isEqual: () => isEqual,
835
- padLeft: () => padLeft,
836
- padRight: () => padRight2,
837
- random: () => random,
838
- size: () => size,
839
- slice: () => slice,
840
- toBigInt: () => toBigInt2,
841
- toBoolean: () => toBoolean,
842
- toHex: () => toHex,
843
- toNumber: () => toNumber2,
844
- toString: () => toString,
845
- trimLeft: () => trimLeft,
846
- trimRight: () => trimRight,
847
- validate: () => validate
848
- });
849
-
850
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/version.js
851
- var version2 = "0.1.1";
852
-
853
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/internal/errors.js
854
- function getVersion() {
855
- return version2;
856
- }
857
-
858
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Errors.js
859
- var BaseError2 = class _BaseError extends Error {
860
- static setStaticOptions(options) {
861
- _BaseError.prototype.docsOrigin = options.docsOrigin;
862
- _BaseError.prototype.showVersion = options.showVersion;
863
- _BaseError.prototype.version = options.version;
864
- }
865
- constructor(shortMessage, options = {}) {
866
- const details = (() => {
867
- if (options.cause instanceof _BaseError) {
868
- if (options.cause.details)
869
- return options.cause.details;
870
- if (options.cause.shortMessage)
871
- return options.cause.shortMessage;
872
- }
873
- if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
874
- return options.cause.details;
875
- if (options.cause?.message)
876
- return options.cause.message;
877
- return options.details;
878
- })();
879
- const docsPath = (() => {
880
- if (options.cause instanceof _BaseError)
881
- return options.cause.docsPath || options.docsPath;
882
- return options.docsPath;
883
- })();
884
- const docsBaseUrl = options.docsOrigin ?? _BaseError.prototype.docsOrigin;
885
- const docs = `${docsBaseUrl}${docsPath ?? ""}`;
886
- const showVersion = Boolean(options.version ?? _BaseError.prototype.showVersion);
887
- const version3 = options.version ?? _BaseError.prototype.version;
888
- const message = [
889
- shortMessage || "An error occurred.",
890
- ...options.metaMessages ? ["", ...options.metaMessages] : [],
891
- ...details || docsPath || showVersion ? [
892
- "",
893
- details ? `Details: ${details}` : void 0,
894
- docsPath ? `See: ${docs}` : void 0,
895
- showVersion ? `Version: ${version3}` : void 0
896
- ] : []
897
- ].filter((x) => typeof x === "string").join("\n");
898
- super(message, options.cause ? { cause: options.cause } : void 0);
899
- Object.defineProperty(this, "details", {
900
- enumerable: true,
901
- configurable: true,
902
- writable: true,
903
- value: void 0
904
- });
905
- Object.defineProperty(this, "docs", {
906
- enumerable: true,
907
- configurable: true,
908
- writable: true,
909
- value: void 0
910
- });
911
- Object.defineProperty(this, "docsOrigin", {
912
- enumerable: true,
913
- configurable: true,
914
- writable: true,
915
- value: void 0
916
- });
917
- Object.defineProperty(this, "docsPath", {
918
- enumerable: true,
919
- configurable: true,
920
- writable: true,
921
- value: void 0
922
- });
923
- Object.defineProperty(this, "shortMessage", {
924
- enumerable: true,
925
- configurable: true,
926
- writable: true,
927
- value: void 0
928
- });
929
- Object.defineProperty(this, "showVersion", {
930
- enumerable: true,
931
- configurable: true,
932
- writable: true,
933
- value: void 0
934
- });
935
- Object.defineProperty(this, "version", {
936
- enumerable: true,
937
- configurable: true,
938
- writable: true,
939
- value: void 0
940
- });
941
- Object.defineProperty(this, "cause", {
942
- enumerable: true,
943
- configurable: true,
944
- writable: true,
945
- value: void 0
946
- });
947
- Object.defineProperty(this, "name", {
948
- enumerable: true,
949
- configurable: true,
950
- writable: true,
951
- value: "BaseError"
952
- });
953
- this.cause = options.cause;
954
- this.details = details;
955
- this.docs = docs;
956
- this.docsOrigin = docsBaseUrl;
957
- this.docsPath = docsPath;
958
- this.shortMessage = shortMessage;
959
- this.showVersion = showVersion;
960
- this.version = version3;
961
- }
962
- walk(fn) {
963
- return walk(this, fn);
964
- }
965
- };
966
- Object.defineProperty(BaseError2, "defaultStaticOptions", {
967
- enumerable: true,
968
- configurable: true,
969
- writable: true,
970
- value: {
971
- docsOrigin: "https://oxlib.sh",
972
- showVersion: false,
973
- version: `ox@${getVersion()}`
974
- }
975
- });
976
- (() => {
977
- BaseError2.setStaticOptions(BaseError2.defaultStaticOptions);
978
- })();
979
- function walk(err, fn) {
980
- if (fn?.(err))
981
- return err;
982
- if (err && typeof err === "object" && "cause" in err && err.cause)
983
- return walk(err.cause, fn);
984
- return fn ? null : err;
985
- }
986
-
987
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/internal/bytes.js
988
- function assertSize(bytes, size_) {
989
- if (size(bytes) > size_)
990
- throw new SizeOverflowError({
991
- givenSize: size(bytes),
992
- maxSize: size_
993
- });
994
- }
995
- function assertStartOffset(value, start) {
996
- if (typeof start === "number" && start > 0 && start > size(value) - 1)
997
- throw new SliceOffsetOutOfBoundsError({
998
- offset: start,
999
- position: "start",
1000
- size: size(value)
1001
- });
1002
- }
1003
- function assertEndOffset(value, start, end) {
1004
- if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
1005
- throw new SliceOffsetOutOfBoundsError({
1006
- offset: end,
1007
- position: "end",
1008
- size: size(value)
1009
- });
1010
- }
1011
- }
1012
- var charCodeMap = {
1013
- zero: 48,
1014
- nine: 57,
1015
- A: 65,
1016
- F: 70,
1017
- a: 97,
1018
- f: 102
1019
- };
1020
- function charCodeToBase16(char) {
1021
- if (char >= charCodeMap.zero && char <= charCodeMap.nine)
1022
- return char - charCodeMap.zero;
1023
- if (char >= charCodeMap.A && char <= charCodeMap.F)
1024
- return char - (charCodeMap.A - 10);
1025
- if (char >= charCodeMap.a && char <= charCodeMap.f)
1026
- return char - (charCodeMap.a - 10);
1027
- return void 0;
1028
- }
1029
- function pad(bytes, options = {}) {
1030
- const { dir, size: size3 = 32 } = options;
1031
- if (size3 === 0)
1032
- return bytes;
1033
- if (bytes.length > size3)
1034
- throw new SizeExceedsPaddingSizeError({
1035
- size: bytes.length,
1036
- targetSize: size3,
1037
- type: "Bytes"
1038
- });
1039
- const paddedBytes = new Uint8Array(size3);
1040
- for (let i = 0; i < size3; i++) {
1041
- const padEnd = dir === "right";
1042
- paddedBytes[padEnd ? i : size3 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
1043
- }
1044
- return paddedBytes;
1045
- }
1046
- function trim(value, options = {}) {
1047
- const { dir = "left" } = options;
1048
- let data = value;
1049
- let sliceLength = 0;
1050
- for (let i = 0; i < data.length - 1; i++) {
1051
- if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
1052
- sliceLength++;
1053
- else
1054
- break;
1055
- }
1056
- data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
1057
- return data;
1058
- }
1059
-
1060
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/internal/hex.js
1061
- function assertSize2(hex, size_) {
1062
- if (size2(hex) > size_)
1063
- throw new SizeOverflowError2({
1064
- givenSize: size2(hex),
1065
- maxSize: size_
1066
- });
1067
- }
1068
- function assertStartOffset2(value, start) {
1069
- if (typeof start === "number" && start > 0 && start > size2(value) - 1)
1070
- throw new SliceOffsetOutOfBoundsError2({
1071
- offset: start,
1072
- position: "start",
1073
- size: size2(value)
1074
- });
1075
- }
1076
- function assertEndOffset2(value, start, end) {
1077
- if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
1078
- throw new SliceOffsetOutOfBoundsError2({
1079
- offset: end,
1080
- position: "end",
1081
- size: size2(value)
1082
- });
1083
- }
1084
- }
1085
- function pad2(hex_, options = {}) {
1086
- const { dir, size: size3 = 32 } = options;
1087
- if (size3 === 0)
1088
- return hex_;
1089
- const hex = hex_.replace("0x", "");
1090
- if (hex.length > size3 * 2)
1091
- throw new SizeExceedsPaddingSizeError2({
1092
- size: Math.ceil(hex.length / 2),
1093
- targetSize: size3,
1094
- type: "Hex"
1095
- });
1096
- return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
1097
- }
1098
- function trim2(value, options = {}) {
1099
- const { dir = "left" } = options;
1100
- let data = value.replace("0x", "");
1101
- let sliceLength = 0;
1102
- for (let i = 0; i < data.length - 1; i++) {
1103
- if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
1104
- sliceLength++;
1105
- else
1106
- break;
1107
- }
1108
- data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
1109
- if (data === "0")
1110
- return "0x";
1111
- if (dir === "right" && data.length % 2 === 1)
1112
- return `0x${data}0`;
1113
- return `0x${data}`;
1114
- }
1115
-
1116
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Json.js
1117
- var Json_exports = {};
1118
- __export(Json_exports, {
1119
- canonicalize: () => canonicalize,
1120
- parse: () => parse,
1121
- stringify: () => stringify
1122
- });
1123
- var bigIntSuffix = "#__bigint";
1124
- function canonicalize(value) {
1125
- if (value === null || typeof value === "boolean" || typeof value === "string")
1126
- return JSON.stringify(value);
1127
- if (typeof value === "number") {
1128
- if (!Number.isFinite(value))
1129
- throw new TypeError("Cannot canonicalize non-finite number");
1130
- return Object.is(value, -0) ? "0" : JSON.stringify(value);
1131
- }
1132
- if (typeof value === "bigint")
1133
- throw new TypeError("Cannot canonicalize bigint");
1134
- if (Array.isArray(value))
1135
- return `[${value.map((item) => canonicalize(item)).join(",")}]`;
1136
- if (typeof value === "object") {
1137
- const entries = Object.keys(value).sort().reduce((acc, key) => {
1138
- const v = value[key];
1139
- if (v !== void 0)
1140
- acc.push(`${JSON.stringify(key)}:${canonicalize(v)}`);
1141
- return acc;
1142
- }, []);
1143
- return `{${entries.join(",")}}`;
1144
- }
1145
- return void 0;
1146
- }
1147
- function parse(string, reviver) {
1148
- return JSON.parse(string, (key, value_) => {
1149
- const value = value_;
1150
- if (typeof value === "string" && value.endsWith(bigIntSuffix))
1151
- return BigInt(value.slice(0, -bigIntSuffix.length));
1152
- return typeof reviver === "function" ? reviver(key, value) : value;
1153
- });
1154
- }
1155
- function stringify(value, replacer, space) {
1156
- return JSON.stringify(value, (key, value2) => {
1157
- if (typeof replacer === "function")
1158
- return replacer(key, value2);
1159
- if (typeof value2 === "bigint")
1160
- return value2.toString() + bigIntSuffix;
1161
- return value2;
1162
- }, space);
1163
- }
1164
-
1165
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Bytes.js
1166
- var decoder = /* @__PURE__ */ new TextDecoder();
1167
- var encoder = /* @__PURE__ */ new TextEncoder();
1168
- function assert(value) {
1169
- if (value instanceof Uint8Array)
1170
- return;
1171
- if (!value)
1172
- throw new InvalidBytesTypeError(value);
1173
- if (typeof value !== "object")
1174
- throw new InvalidBytesTypeError(value);
1175
- if (!("BYTES_PER_ELEMENT" in value))
1176
- throw new InvalidBytesTypeError(value);
1177
- if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
1178
- throw new InvalidBytesTypeError(value);
1179
- }
1180
- function concat(...values) {
1181
- let length = 0;
1182
- for (const arr of values) {
1183
- length += arr.length;
1184
- }
1185
- const result = new Uint8Array(length);
1186
- for (let i = 0, index = 0; i < values.length; i++) {
1187
- const arr = values[i];
1188
- result.set(arr, index);
1189
- index += arr.length;
1190
- }
1191
- return result;
1192
- }
1193
- function from(value) {
1194
- if (value instanceof Uint8Array)
1195
- return value;
1196
- if (typeof value === "string")
1197
- return fromHex(value);
1198
- return fromArray(value);
1199
- }
1200
- function fromArray(value) {
1201
- return value instanceof Uint8Array ? value : new Uint8Array(value);
1202
- }
1203
- function fromBoolean(value, options = {}) {
1204
- const { size: size3 } = options;
1205
- const bytes = new Uint8Array(1);
1206
- bytes[0] = Number(value);
1207
- if (typeof size3 === "number") {
1208
- assertSize(bytes, size3);
1209
- return padLeft(bytes, size3);
1210
- }
1211
- return bytes;
1212
- }
1213
- function fromHex(value, options = {}) {
1214
- const { size: size3 } = options;
1215
- let hex = value;
1216
- if (size3) {
1217
- assertSize2(value, size3);
1218
- hex = padRight(value, size3);
1219
- }
1220
- let hexString = hex.slice(2);
1221
- if (hexString.length % 2)
1222
- hexString = `0${hexString}`;
1223
- const length = hexString.length / 2;
1224
- const bytes = new Uint8Array(length);
1225
- for (let index = 0, j = 0; index < length; index++) {
1226
- const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
1227
- const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
1228
- if (nibbleLeft === void 0 || nibbleRight === void 0) {
1229
- throw new BaseError2(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
1230
- }
1231
- bytes[index] = nibbleLeft << 4 | nibbleRight;
1232
- }
1233
- return bytes;
1234
- }
1235
- function fromNumber2(value, options) {
1236
- const hex = fromNumber(value, options);
1237
- return fromHex(hex);
1238
- }
1239
- function fromString(value, options = {}) {
1240
- const { size: size3 } = options;
1241
- const bytes = encoder.encode(value);
1242
- if (typeof size3 === "number") {
1243
- assertSize(bytes, size3);
1244
- return padRight2(bytes, size3);
1245
- }
1246
- return bytes;
1247
- }
1248
- function isEqual(bytesA, bytesB) {
1249
- return equalBytes(bytesA, bytesB);
1250
- }
1251
- function padLeft(value, size3) {
1252
- return pad(value, { dir: "left", size: size3 });
1253
- }
1254
- function padRight2(value, size3) {
1255
- return pad(value, { dir: "right", size: size3 });
1256
- }
1257
- function random(length) {
1258
- return crypto.getRandomValues(new Uint8Array(length));
1259
- }
1260
- function size(value) {
1261
- return value.length;
1262
- }
1263
- function slice(value, start, end, options = {}) {
1264
- const { strict } = options;
1265
- assertStartOffset(value, start);
1266
- const value_ = value.slice(start, end);
1267
- if (strict)
1268
- assertEndOffset(value_, start, end);
1269
- return value_;
1270
- }
1271
- function toBigInt2(bytes, options = {}) {
1272
- const { size: size3 } = options;
1273
- if (typeof size3 !== "undefined")
1274
- assertSize(bytes, size3);
1275
- const hex = fromBytes(bytes, options);
1276
- return toBigInt(hex, options);
1277
- }
1278
- function toBoolean(bytes, options = {}) {
1279
- const { size: size3 } = options;
1280
- let bytes_ = bytes;
1281
- if (typeof size3 !== "undefined") {
1282
- assertSize(bytes_, size3);
1283
- bytes_ = trimLeft(bytes_);
1284
- }
1285
- if (bytes_.length > 1 || bytes_[0] > 1)
1286
- throw new InvalidBytesBooleanError(bytes_);
1287
- return Boolean(bytes_[0]);
1288
- }
1289
- function toHex(value, options = {}) {
1290
- return fromBytes(value, options);
1291
- }
1292
- function toNumber2(bytes, options = {}) {
1293
- const { size: size3 } = options;
1294
- if (typeof size3 !== "undefined")
1295
- assertSize(bytes, size3);
1296
- const hex = fromBytes(bytes, options);
1297
- return toNumber(hex, options);
1298
- }
1299
- function toString(bytes, options = {}) {
1300
- const { size: size3 } = options;
1301
- let bytes_ = bytes;
1302
- if (typeof size3 !== "undefined") {
1303
- assertSize(bytes_, size3);
1304
- bytes_ = trimRight(bytes_);
1305
- }
1306
- return decoder.decode(bytes_);
1307
- }
1308
- function trimLeft(value) {
1309
- return trim(value, { dir: "left" });
1310
- }
1311
- function trimRight(value) {
1312
- return trim(value, { dir: "right" });
1313
- }
1314
- function validate(value) {
1315
- try {
1316
- assert(value);
1317
- return true;
1318
- } catch {
1319
- return false;
1320
- }
1321
- }
1322
- var InvalidBytesBooleanError = class extends BaseError2 {
1323
- constructor(bytes) {
1324
- super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
1325
- metaMessages: [
1326
- "The bytes array must contain a single byte of either a `0` or `1` value."
1327
- ]
1328
- });
1329
- Object.defineProperty(this, "name", {
1330
- enumerable: true,
1331
- configurable: true,
1332
- writable: true,
1333
- value: "Bytes.InvalidBytesBooleanError"
1334
- });
1335
- }
1336
- };
1337
- var InvalidBytesTypeError = class extends BaseError2 {
1338
- constructor(value) {
1339
- super(`Value \`${typeof value === "object" ? stringify(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
1340
- metaMessages: ["Bytes values must be of type `Bytes`."]
1341
- });
1342
- Object.defineProperty(this, "name", {
1343
- enumerable: true,
1344
- configurable: true,
1345
- writable: true,
1346
- value: "Bytes.InvalidBytesTypeError"
1347
- });
1348
- }
1349
- };
1350
- var SizeOverflowError = class extends BaseError2 {
1351
- constructor({ givenSize, maxSize }) {
1352
- super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
1353
- Object.defineProperty(this, "name", {
1354
- enumerable: true,
1355
- configurable: true,
1356
- writable: true,
1357
- value: "Bytes.SizeOverflowError"
1358
- });
1359
- }
1360
- };
1361
- var SliceOffsetOutOfBoundsError = class extends BaseError2 {
1362
- constructor({ offset, position, size: size3 }) {
1363
- super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size3}\`).`);
1364
- Object.defineProperty(this, "name", {
1365
- enumerable: true,
1366
- configurable: true,
1367
- writable: true,
1368
- value: "Bytes.SliceOffsetOutOfBoundsError"
1369
- });
1370
- }
1371
- };
1372
- var SizeExceedsPaddingSizeError = class extends BaseError2 {
1373
- constructor({ size: size3, targetSize, type }) {
1374
- super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
1375
- Object.defineProperty(this, "name", {
1376
- enumerable: true,
1377
- configurable: true,
1378
- writable: true,
1379
- value: "Bytes.SizeExceedsPaddingSizeError"
1380
- });
1381
- }
1382
- };
1383
-
1384
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Hex.js
1385
- var encoder2 = /* @__PURE__ */ new TextEncoder();
1386
- var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
1387
- function assert2(value, options = {}) {
1388
- const { strict = false } = options;
1389
- if (!value)
1390
- throw new InvalidHexTypeError(value);
1391
- if (typeof value !== "string")
1392
- throw new InvalidHexTypeError(value);
1393
- if (strict) {
1394
- if (!/^0x[0-9a-fA-F]*$/.test(value))
1395
- throw new InvalidHexValueError(value);
1396
- }
1397
- if (!value.startsWith("0x"))
1398
- throw new InvalidHexValueError(value);
1399
- }
1400
- function concat2(...values) {
1401
- return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
1402
- }
1403
- function from2(value) {
1404
- if (value instanceof Uint8Array)
1405
- return fromBytes(value);
1406
- if (Array.isArray(value))
1407
- return fromBytes(new Uint8Array(value));
1408
- return value;
1409
- }
1410
- function fromBoolean2(value, options = {}) {
1411
- const hex = `0x${Number(value)}`;
1412
- if (typeof options.size === "number") {
1413
- assertSize2(hex, options.size);
1414
- return padLeft2(hex, options.size);
1415
- }
1416
- return hex;
1417
- }
1418
- function fromBytes(value, options = {}) {
1419
- let string = "";
1420
- for (let i = 0; i < value.length; i++)
1421
- string += hexes[value[i]];
1422
- const hex = `0x${string}`;
1423
- if (typeof options.size === "number") {
1424
- assertSize2(hex, options.size);
1425
- return padRight(hex, options.size);
1426
- }
1427
- return hex;
1428
- }
1429
- function fromNumber(value, options = {}) {
1430
- const { signed, size: size3 } = options;
1431
- const value_ = BigInt(value);
1432
- let maxValue;
1433
- if (size3) {
1434
- if (signed)
1435
- maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
1436
- else
1437
- maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
1438
- } else if (typeof value === "number") {
1439
- maxValue = BigInt(Number.MAX_SAFE_INTEGER);
1440
- }
1441
- const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
1442
- if (maxValue && value_ > maxValue || value_ < minValue) {
1443
- const suffix = typeof value === "bigint" ? "n" : "";
1444
- throw new IntegerOutOfRangeError({
1445
- max: maxValue ? `${maxValue}${suffix}` : void 0,
1446
- min: `${minValue}${suffix}`,
1447
- signed,
1448
- size: size3,
1449
- value: `${value}${suffix}`
1450
- });
1451
- }
1452
- const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size3 * 8, BigInt(value_)) : value_).toString(16);
1453
- const hex = `0x${stringValue}`;
1454
- if (size3)
1455
- return padLeft2(hex, size3);
1456
- return hex;
1457
- }
1458
- function fromString2(value, options = {}) {
1459
- return fromBytes(encoder2.encode(value), options);
1460
- }
1461
- function isEqual2(hexA, hexB) {
1462
- return equalBytes(fromHex(hexA), fromHex(hexB));
1463
- }
1464
- function padLeft2(value, size3) {
1465
- return pad2(value, { dir: "left", size: size3 });
1466
- }
1467
- function padRight(value, size3) {
1468
- return pad2(value, { dir: "right", size: size3 });
1469
- }
1470
- function random2(length) {
1471
- return fromBytes(random(length));
1472
- }
1473
- function slice2(value, start, end, options = {}) {
1474
- const { strict } = options;
1475
- assertStartOffset2(value, start);
1476
- const value_ = `0x${value.replace("0x", "").slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
1477
- if (strict)
1478
- assertEndOffset2(value_, start, end);
1479
- return value_;
1480
- }
1481
- function size2(value) {
1482
- return Math.ceil((value.length - 2) / 2);
1483
- }
1484
- function trimLeft2(value) {
1485
- return trim2(value, { dir: "left" });
1486
- }
1487
- function trimRight2(value) {
1488
- return trim2(value, { dir: "right" });
1489
- }
1490
- function toBigInt(hex, options = {}) {
1491
- const { signed } = options;
1492
- if (options.size)
1493
- assertSize2(hex, options.size);
1494
- const value = BigInt(hex);
1495
- if (!signed)
1496
- return value;
1497
- const size3 = (hex.length - 2) / 2;
1498
- const max_unsigned = (1n << BigInt(size3) * 8n) - 1n;
1499
- const max_signed = max_unsigned >> 1n;
1500
- if (value <= max_signed)
1501
- return value;
1502
- return value - max_unsigned - 1n;
1503
- }
1504
- function toBoolean2(hex, options = {}) {
1505
- if (options.size)
1506
- assertSize2(hex, options.size);
1507
- const hex_ = trimLeft2(hex);
1508
- if (hex_ === "0x")
1509
- return false;
1510
- if (hex_ === "0x1")
1511
- return true;
1512
- throw new InvalidHexBooleanError(hex);
1513
- }
1514
- function toBytes2(hex, options = {}) {
1515
- return fromHex(hex, options);
1516
- }
1517
- function toNumber(hex, options = {}) {
1518
- const { signed, size: size3 } = options;
1519
- if (!signed && !size3)
1520
- return Number(hex);
1521
- return Number(toBigInt(hex, options));
1522
- }
1523
- function toString2(hex, options = {}) {
1524
- const { size: size3 } = options;
1525
- let bytes = fromHex(hex);
1526
- if (size3) {
1527
- assertSize(bytes, size3);
1528
- bytes = trimRight(bytes);
1529
- }
1530
- return new TextDecoder().decode(bytes);
1531
- }
1532
- function validate2(value, options = {}) {
1533
- const { strict = false } = options;
1534
- try {
1535
- assert2(value, { strict });
1536
- return true;
1537
- } catch {
1538
- return false;
1539
- }
1540
- }
1541
- var IntegerOutOfRangeError = class extends BaseError2 {
1542
- constructor({ max, min, signed, size: size3, value }) {
1543
- super(`Number \`${value}\` is not in safe${size3 ? ` ${size3 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
1544
- Object.defineProperty(this, "name", {
1545
- enumerable: true,
1546
- configurable: true,
1547
- writable: true,
1548
- value: "Hex.IntegerOutOfRangeError"
1549
- });
1550
- }
1551
- };
1552
- var InvalidHexBooleanError = class extends BaseError2 {
1553
- constructor(hex) {
1554
- super(`Hex value \`"${hex}"\` is not a valid boolean.`, {
1555
- metaMessages: [
1556
- 'The hex value must be `"0x0"` (false) or `"0x1"` (true).'
1557
- ]
1558
- });
1559
- Object.defineProperty(this, "name", {
1560
- enumerable: true,
1561
- configurable: true,
1562
- writable: true,
1563
- value: "Hex.InvalidHexBooleanError"
1564
- });
1565
- }
1566
- };
1567
- var InvalidHexTypeError = class extends BaseError2 {
1568
- constructor(value) {
1569
- super(`Value \`${typeof value === "object" ? stringify(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
1570
- metaMessages: ['Hex types must be represented as `"0x${string}"`.']
1571
- });
1572
- Object.defineProperty(this, "name", {
1573
- enumerable: true,
1574
- configurable: true,
1575
- writable: true,
1576
- value: "Hex.InvalidHexTypeError"
1577
- });
1578
- }
1579
- };
1580
- var InvalidHexValueError = class extends BaseError2 {
1581
- constructor(value) {
1582
- super(`Value \`${value}\` is an invalid hex value.`, {
1583
- metaMessages: [
1584
- 'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
1585
- ]
1586
- });
1587
- Object.defineProperty(this, "name", {
1588
- enumerable: true,
1589
- configurable: true,
1590
- writable: true,
1591
- value: "Hex.InvalidHexValueError"
1592
- });
1593
- }
1594
- };
1595
- var InvalidLengthError = class extends BaseError2 {
1596
- constructor(value) {
1597
- super(`Hex value \`"${value}"\` is an odd length (${value.length - 2} nibbles).`, {
1598
- metaMessages: ["It must be an even length."]
1599
- });
1600
- Object.defineProperty(this, "name", {
1601
- enumerable: true,
1602
- configurable: true,
1603
- writable: true,
1604
- value: "Hex.InvalidLengthError"
1605
- });
1606
- }
1607
- };
1608
- var SizeOverflowError2 = class extends BaseError2 {
1609
- constructor({ givenSize, maxSize }) {
1610
- super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
1611
- Object.defineProperty(this, "name", {
1612
- enumerable: true,
1613
- configurable: true,
1614
- writable: true,
1615
- value: "Hex.SizeOverflowError"
1616
- });
1617
- }
1618
- };
1619
- var SliceOffsetOutOfBoundsError2 = class extends BaseError2 {
1620
- constructor({ offset, position, size: size3 }) {
1621
- super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size3}\`).`);
1622
- Object.defineProperty(this, "name", {
1623
- enumerable: true,
1624
- configurable: true,
1625
- writable: true,
1626
- value: "Hex.SliceOffsetOutOfBoundsError"
1627
- });
1628
- }
1629
- };
1630
- var SizeExceedsPaddingSizeError2 = class extends BaseError2 {
1631
- constructor({ size: size3, targetSize, type }) {
1632
- super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
1633
- Object.defineProperty(this, "name", {
1634
- enumerable: true,
1635
- configurable: true,
1636
- writable: true,
1637
- value: "Hex.SizeExceedsPaddingSizeError"
1638
- });
1639
- }
1640
- };
1641
-
1642
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Withdrawal.js
1643
- function toRpc(withdrawal) {
1644
- return {
1645
- address: withdrawal.address,
1646
- amount: fromNumber(withdrawal.amount),
1647
- index: fromNumber(withdrawal.index),
1648
- validatorIndex: fromNumber(withdrawal.validatorIndex)
1649
- };
1650
- }
1651
-
1652
- // ../../node_modules/.pnpm/ox@0.14.5_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/BlockOverrides.js
1653
- function toRpc2(blockOverrides) {
1654
- return {
1655
- ...typeof blockOverrides.baseFeePerGas === "bigint" && {
1656
- baseFeePerGas: fromNumber(blockOverrides.baseFeePerGas)
1657
- },
1658
- ...typeof blockOverrides.blobBaseFee === "bigint" && {
1659
- blobBaseFee: fromNumber(blockOverrides.blobBaseFee)
1660
- },
1661
- ...typeof blockOverrides.feeRecipient === "string" && {
1662
- feeRecipient: blockOverrides.feeRecipient
1663
- },
1664
- ...typeof blockOverrides.gasLimit === "bigint" && {
1665
- gasLimit: fromNumber(blockOverrides.gasLimit)
1666
- },
1667
- ...typeof blockOverrides.number === "bigint" && {
1668
- number: fromNumber(blockOverrides.number)
1669
- },
1670
- ...typeof blockOverrides.prevRandao === "bigint" && {
1671
- prevRandao: fromNumber(blockOverrides.prevRandao)
1672
- },
1673
- ...typeof blockOverrides.time === "bigint" && {
1674
- time: fromNumber(blockOverrides.time)
1675
- },
1676
- ...blockOverrides.withdrawals && {
1677
- withdrawals: blockOverrides.withdrawals.map(toRpc)
1678
- }
1679
- };
1680
- }
1681
-
1682
- // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js
1683
- var _0n = BigInt(0);
1684
- var _1n = BigInt(1);
1685
- var _2n = BigInt(2);
1686
- var _7n = BigInt(7);
1687
- var _256n = BigInt(256);
1688
- var _0x71n = BigInt(113);
1689
- var SHA3_PI = [];
1690
- var SHA3_ROTL = [];
1691
- var _SHA3_IOTA = [];
1692
- for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
1693
- [x, y] = [y, (2 * x + 3 * y) % 5];
1694
- SHA3_PI.push(2 * (5 * y + x));
1695
- SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
1696
- let t = _0n;
1697
- for (let j = 0; j < 7; j++) {
1698
- R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
1699
- if (R & _2n)
1700
- t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
1701
- }
1702
- _SHA3_IOTA.push(t);
1703
- }
1704
- var IOTAS = split(_SHA3_IOTA, true);
1705
- var SHA3_IOTA_H = IOTAS[0];
1706
- var SHA3_IOTA_L = IOTAS[1];
1707
- var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
1708
- var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
1709
- function keccakP(s, rounds = 24) {
1710
- const B = new Uint32Array(5 * 2);
1711
- for (let round = 24 - rounds; round < 24; round++) {
1712
- for (let x = 0; x < 10; x++)
1713
- B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
1714
- for (let x = 0; x < 10; x += 2) {
1715
- const idx1 = (x + 8) % 10;
1716
- const idx0 = (x + 2) % 10;
1717
- const B0 = B[idx0];
1718
- const B1 = B[idx0 + 1];
1719
- const Th = rotlH(B0, B1, 1) ^ B[idx1];
1720
- const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
1721
- for (let y = 0; y < 50; y += 10) {
1722
- s[x + y] ^= Th;
1723
- s[x + y + 1] ^= Tl;
1724
- }
1725
- }
1726
- let curH = s[2];
1727
- let curL = s[3];
1728
- for (let t = 0; t < 24; t++) {
1729
- const shift = SHA3_ROTL[t];
1730
- const Th = rotlH(curH, curL, shift);
1731
- const Tl = rotlL(curH, curL, shift);
1732
- const PI = SHA3_PI[t];
1733
- curH = s[PI];
1734
- curL = s[PI + 1];
1735
- s[PI] = Th;
1736
- s[PI + 1] = Tl;
1737
- }
1738
- for (let y = 0; y < 50; y += 10) {
1739
- for (let x = 0; x < 10; x++)
1740
- B[x] = s[y + x];
1741
- for (let x = 0; x < 10; x++)
1742
- s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
1743
- }
1744
- s[0] ^= SHA3_IOTA_H[round];
1745
- s[1] ^= SHA3_IOTA_L[round];
1746
- }
1747
- clean(B);
1748
- }
1749
- var Keccak = class _Keccak extends Hash {
1750
- // NOTE: we accept arguments in bytes instead of bits here.
1751
- constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
1752
- super();
1753
- this.pos = 0;
1754
- this.posOut = 0;
1755
- this.finished = false;
1756
- this.destroyed = false;
1757
- this.enableXOF = false;
1758
- this.blockLen = blockLen;
1759
- this.suffix = suffix;
1760
- this.outputLen = outputLen;
1761
- this.enableXOF = enableXOF;
1762
- this.rounds = rounds;
1763
- anumber(outputLen);
1764
- if (!(0 < blockLen && blockLen < 200))
1765
- throw new Error("only keccak-f1600 function is supported");
1766
- this.state = new Uint8Array(200);
1767
- this.state32 = u32(this.state);
1768
- }
1769
- clone() {
1770
- return this._cloneInto();
1771
- }
1772
- keccak() {
1773
- swap32IfBE(this.state32);
1774
- keccakP(this.state32, this.rounds);
1775
- swap32IfBE(this.state32);
1776
- this.posOut = 0;
1777
- this.pos = 0;
1778
- }
1779
- update(data) {
1780
- aexists(this);
1781
- data = toBytes(data);
1782
- abytes(data);
1783
- const { blockLen, state } = this;
1784
- const len = data.length;
1785
- for (let pos = 0; pos < len; ) {
1786
- const take = Math.min(blockLen - this.pos, len - pos);
1787
- for (let i = 0; i < take; i++)
1788
- state[this.pos++] ^= data[pos++];
1789
- if (this.pos === blockLen)
1790
- this.keccak();
1791
- }
1792
- return this;
1793
- }
1794
- finish() {
1795
- if (this.finished)
1796
- return;
1797
- this.finished = true;
1798
- const { state, suffix, pos, blockLen } = this;
1799
- state[pos] ^= suffix;
1800
- if ((suffix & 128) !== 0 && pos === blockLen - 1)
1801
- this.keccak();
1802
- state[blockLen - 1] ^= 128;
1803
- this.keccak();
1804
- }
1805
- writeInto(out) {
1806
- aexists(this, false);
1807
- abytes(out);
1808
- this.finish();
1809
- const bufferOut = this.state;
1810
- const { blockLen } = this;
1811
- for (let pos = 0, len = out.length; pos < len; ) {
1812
- if (this.posOut >= blockLen)
1813
- this.keccak();
1814
- const take = Math.min(blockLen - this.posOut, len - pos);
1815
- out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
1816
- this.posOut += take;
1817
- pos += take;
1818
- }
1819
- return out;
1820
- }
1821
- xofInto(out) {
1822
- if (!this.enableXOF)
1823
- throw new Error("XOF is not possible for this instance");
1824
- return this.writeInto(out);
1825
- }
1826
- xof(bytes) {
1827
- anumber(bytes);
1828
- return this.xofInto(new Uint8Array(bytes));
1829
- }
1830
- digestInto(out) {
1831
- aoutput(out, this);
1832
- if (this.finished)
1833
- throw new Error("digest() was already called");
1834
- this.writeInto(out);
1835
- this.destroy();
1836
- return out;
1837
- }
1838
- digest() {
1839
- return this.digestInto(new Uint8Array(this.outputLen));
1840
- }
1841
- destroy() {
1842
- this.destroyed = true;
1843
- clean(this.state);
1844
- }
1845
- _cloneInto(to) {
1846
- const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
1847
- to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
1848
- to.state32.set(this.state32);
1849
- to.pos = this.pos;
1850
- to.posOut = this.posOut;
1851
- to.finished = this.finished;
1852
- to.rounds = rounds;
1853
- to.suffix = suffix;
1854
- to.outputLen = outputLen;
1855
- to.enableXOF = enableXOF;
1856
- to.destroyed = this.destroyed;
1857
- return to;
1858
- }
1859
- };
1860
- var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
1861
- var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
1862
-
1863
- export {
1864
- formatAbiParameters,
1865
- formatAbiItem,
1866
- parseAbi,
1867
- parseAbiParameters,
1868
- BaseError2 as BaseError,
1869
- keccak_256,
1870
- stringify,
1871
- Json_exports,
1872
- assert2 as assert,
1873
- concat2 as concat,
1874
- from2 as from,
1875
- fromBoolean2 as fromBoolean,
1876
- fromBytes,
1877
- fromNumber,
1878
- fromString2 as fromString,
1879
- padLeft2 as padLeft,
1880
- padRight,
1881
- random2 as random,
1882
- slice2 as slice,
1883
- size2 as size,
1884
- trimLeft2 as trimLeft,
1885
- toBigInt,
1886
- toNumber,
1887
- toString2 as toString,
1888
- validate2 as validate,
1889
- IntegerOutOfRangeError,
1890
- InvalidLengthError,
1891
- Hex_exports,
1892
- concat as concat2,
1893
- from as from2,
1894
- fromHex,
1895
- fromString as fromString2,
1896
- isEqual,
1897
- size as size2,
1898
- slice as slice2,
1899
- toBigInt2,
1900
- toBoolean,
1901
- toNumber2,
1902
- toString as toString2,
1903
- trimLeft as trimLeft2,
1904
- validate as validate2,
1905
- Bytes_exports,
1906
- toRpc2 as toRpc
1907
- };
1908
- //# sourceMappingURL=chunk-H66DC3S3.js.map