@t2000/cli 0.22.26 → 0.23.0

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 (34) hide show
  1. package/README.md +11 -97
  2. package/dist/{ccip-JEEJV65M.js → ccip-XP27NGI7.js} +3 -3
  3. package/dist/{chunk-A5X4KG7U.js → chunk-3I6VJOM6.js} +210 -970
  4. package/dist/chunk-3I6VJOM6.js.map +1 -0
  5. package/dist/chunk-4N76GQCL.js +35382 -0
  6. package/dist/chunk-4N76GQCL.js.map +1 -0
  7. package/dist/{chunk-XOAZJ42V.js → chunk-DWOZSUBE.js} +588 -584
  8. package/dist/{chunk-XOAZJ42V.js.map → chunk-DWOZSUBE.js.map} +1 -1
  9. package/dist/chunk-EI3GHTKX.js +968 -0
  10. package/dist/chunk-EI3GHTKX.js.map +1 -0
  11. package/dist/{chunk-EEPD7SHV.js → chunk-TYYJRUQI.js} +15755 -15918
  12. package/dist/chunk-TYYJRUQI.js.map +1 -0
  13. package/dist/client-5KJQTN5X.js +84 -0
  14. package/dist/client-5KJQTN5X.js.map +1 -0
  15. package/dist/{client-R3NRAXMD.js → client-IXUBQ3HM.js} +334 -638
  16. package/dist/client-IXUBQ3HM.js.map +1 -0
  17. package/dist/{dist-NBWIWHHS.js → dist-E7HUP73Q.js} +5 -29
  18. package/dist/{dist-KJM2NT74.js → dist-W4Q4YXD7.js} +4200 -603
  19. package/dist/dist-W4Q4YXD7.js.map +1 -0
  20. package/dist/index.js +29 -1016
  21. package/dist/index.js.map +1 -1
  22. package/package.json +4 -5
  23. package/dist/chunk-3WKGZRWT.js +0 -77733
  24. package/dist/chunk-3WKGZRWT.js.map +0 -1
  25. package/dist/chunk-77SWBATH.js +0 -204
  26. package/dist/chunk-77SWBATH.js.map +0 -1
  27. package/dist/chunk-A5X4KG7U.js.map +0 -1
  28. package/dist/chunk-EEPD7SHV.js.map +0 -1
  29. package/dist/client-CK5OR2TP.js +0 -746
  30. package/dist/client-CK5OR2TP.js.map +0 -1
  31. package/dist/client-R3NRAXMD.js.map +0 -1
  32. package/dist/dist-KJM2NT74.js.map +0 -1
  33. /package/dist/{ccip-JEEJV65M.js.map → ccip-XP27NGI7.js.map} +0 -0
  34. /package/dist/{dist-NBWIWHHS.js.map → dist-E7HUP73Q.js.map} +0 -0
@@ -0,0 +1,968 @@
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
+ rotlBH,
11
+ rotlBL,
12
+ rotlSH,
13
+ rotlSL,
14
+ split,
15
+ swap32IfBE,
16
+ toBytes,
17
+ u32
18
+ } from "./chunk-7LGHVVIJ.js";
19
+
20
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/regex.js
21
+ function execTyped(regex, string) {
22
+ const match = regex.exec(string);
23
+ return match?.groups;
24
+ }
25
+ var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
26
+ 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)?$/;
27
+ var isTupleRegex = /^\(.+?\).*?$/;
28
+
29
+ // ../../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
30
+ var errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
31
+ function isErrorSignature(signature) {
32
+ return errorSignatureRegex.test(signature);
33
+ }
34
+ function execErrorSignature(signature) {
35
+ return execTyped(errorSignatureRegex, signature);
36
+ }
37
+ var eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
38
+ function isEventSignature(signature) {
39
+ return eventSignatureRegex.test(signature);
40
+ }
41
+ function execEventSignature(signature) {
42
+ return execTyped(eventSignatureRegex, signature);
43
+ }
44
+ 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>.*?)\))?$/;
45
+ function isFunctionSignature(signature) {
46
+ return functionSignatureRegex.test(signature);
47
+ }
48
+ function execFunctionSignature(signature) {
49
+ return execTyped(functionSignatureRegex, signature);
50
+ }
51
+ var structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
52
+ function isStructSignature(signature) {
53
+ return structSignatureRegex.test(signature);
54
+ }
55
+ function execStructSignature(signature) {
56
+ return execTyped(structSignatureRegex, signature);
57
+ }
58
+ var constructorSignatureRegex = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
59
+ function isConstructorSignature(signature) {
60
+ return constructorSignatureRegex.test(signature);
61
+ }
62
+ function execConstructorSignature(signature) {
63
+ return execTyped(constructorSignatureRegex, signature);
64
+ }
65
+ var fallbackSignatureRegex = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
66
+ function isFallbackSignature(signature) {
67
+ return fallbackSignatureRegex.test(signature);
68
+ }
69
+ function execFallbackSignature(signature) {
70
+ return execTyped(fallbackSignatureRegex, signature);
71
+ }
72
+ var receiveSignatureRegex = /^receive\(\) external payable$/;
73
+ function isReceiveSignature(signature) {
74
+ return receiveSignatureRegex.test(signature);
75
+ }
76
+ var modifiers = /* @__PURE__ */ new Set([
77
+ "memory",
78
+ "indexed",
79
+ "storage",
80
+ "calldata"
81
+ ]);
82
+ var eventModifiers = /* @__PURE__ */ new Set(["indexed"]);
83
+ var functionModifiers = /* @__PURE__ */ new Set([
84
+ "calldata",
85
+ "memory",
86
+ "storage"
87
+ ]);
88
+
89
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/version.js
90
+ var version = "1.2.3";
91
+
92
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/errors.js
93
+ var BaseError = class _BaseError extends Error {
94
+ constructor(shortMessage, args = {}) {
95
+ const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
96
+ const docsPath = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
97
+ const message = [
98
+ shortMessage || "An error occurred.",
99
+ "",
100
+ ...args.metaMessages ? [...args.metaMessages, ""] : [],
101
+ ...docsPath ? [`Docs: https://abitype.dev${docsPath}`] : [],
102
+ ...details ? [`Details: ${details}`] : [],
103
+ `Version: abitype@${version}`
104
+ ].join("\n");
105
+ super(message);
106
+ Object.defineProperty(this, "details", {
107
+ enumerable: true,
108
+ configurable: true,
109
+ writable: true,
110
+ value: void 0
111
+ });
112
+ Object.defineProperty(this, "docsPath", {
113
+ enumerable: true,
114
+ configurable: true,
115
+ writable: true,
116
+ value: void 0
117
+ });
118
+ Object.defineProperty(this, "metaMessages", {
119
+ enumerable: true,
120
+ configurable: true,
121
+ writable: true,
122
+ value: void 0
123
+ });
124
+ Object.defineProperty(this, "shortMessage", {
125
+ enumerable: true,
126
+ configurable: true,
127
+ writable: true,
128
+ value: void 0
129
+ });
130
+ Object.defineProperty(this, "name", {
131
+ enumerable: true,
132
+ configurable: true,
133
+ writable: true,
134
+ value: "AbiTypeError"
135
+ });
136
+ if (args.cause)
137
+ this.cause = args.cause;
138
+ this.details = details;
139
+ this.docsPath = docsPath;
140
+ this.metaMessages = args.metaMessages;
141
+ this.shortMessage = shortMessage;
142
+ }
143
+ };
144
+
145
+ // ../../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
146
+ var UnknownTypeError = class extends BaseError {
147
+ constructor({ type }) {
148
+ super("Unknown type.", {
149
+ metaMessages: [
150
+ `Type "${type}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`
151
+ ]
152
+ });
153
+ Object.defineProperty(this, "name", {
154
+ enumerable: true,
155
+ configurable: true,
156
+ writable: true,
157
+ value: "UnknownTypeError"
158
+ });
159
+ }
160
+ };
161
+ var UnknownSolidityTypeError = class extends BaseError {
162
+ constructor({ type }) {
163
+ super("Unknown type.", {
164
+ metaMessages: [`Type "${type}" is not a valid ABI type.`]
165
+ });
166
+ Object.defineProperty(this, "name", {
167
+ enumerable: true,
168
+ configurable: true,
169
+ writable: true,
170
+ value: "UnknownSolidityTypeError"
171
+ });
172
+ }
173
+ };
174
+
175
+ // ../../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
176
+ var InvalidAbiParametersError = class extends BaseError {
177
+ constructor({ params }) {
178
+ super("Failed to parse ABI parameters.", {
179
+ details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,
180
+ docsPath: "/api/human#parseabiparameters-1"
181
+ });
182
+ Object.defineProperty(this, "name", {
183
+ enumerable: true,
184
+ configurable: true,
185
+ writable: true,
186
+ value: "InvalidAbiParametersError"
187
+ });
188
+ }
189
+ };
190
+ var InvalidParameterError = class extends BaseError {
191
+ constructor({ param }) {
192
+ super("Invalid ABI parameter.", {
193
+ details: param
194
+ });
195
+ Object.defineProperty(this, "name", {
196
+ enumerable: true,
197
+ configurable: true,
198
+ writable: true,
199
+ value: "InvalidParameterError"
200
+ });
201
+ }
202
+ };
203
+ var SolidityProtectedKeywordError = class extends BaseError {
204
+ constructor({ param, name }) {
205
+ super("Invalid ABI parameter.", {
206
+ details: param,
207
+ metaMessages: [
208
+ `"${name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`
209
+ ]
210
+ });
211
+ Object.defineProperty(this, "name", {
212
+ enumerable: true,
213
+ configurable: true,
214
+ writable: true,
215
+ value: "SolidityProtectedKeywordError"
216
+ });
217
+ }
218
+ };
219
+ var InvalidModifierError = class extends BaseError {
220
+ constructor({ param, type, modifier }) {
221
+ super("Invalid ABI parameter.", {
222
+ details: param,
223
+ metaMessages: [
224
+ `Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`
225
+ ]
226
+ });
227
+ Object.defineProperty(this, "name", {
228
+ enumerable: true,
229
+ configurable: true,
230
+ writable: true,
231
+ value: "InvalidModifierError"
232
+ });
233
+ }
234
+ };
235
+ var InvalidFunctionModifierError = class extends BaseError {
236
+ constructor({ param, type, modifier }) {
237
+ super("Invalid ABI parameter.", {
238
+ details: param,
239
+ metaMessages: [
240
+ `Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`,
241
+ `Data location can only be specified for array, struct, or mapping types, but "${modifier}" was given.`
242
+ ]
243
+ });
244
+ Object.defineProperty(this, "name", {
245
+ enumerable: true,
246
+ configurable: true,
247
+ writable: true,
248
+ value: "InvalidFunctionModifierError"
249
+ });
250
+ }
251
+ };
252
+ var InvalidAbiTypeParameterError = class extends BaseError {
253
+ constructor({ abiParameter }) {
254
+ super("Invalid ABI parameter.", {
255
+ details: JSON.stringify(abiParameter, null, 2),
256
+ metaMessages: ["ABI parameter type is invalid."]
257
+ });
258
+ Object.defineProperty(this, "name", {
259
+ enumerable: true,
260
+ configurable: true,
261
+ writable: true,
262
+ value: "InvalidAbiTypeParameterError"
263
+ });
264
+ }
265
+ };
266
+
267
+ // ../../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
268
+ var InvalidSignatureError = class extends BaseError {
269
+ constructor({ signature, type }) {
270
+ super(`Invalid ${type} signature.`, {
271
+ details: signature
272
+ });
273
+ Object.defineProperty(this, "name", {
274
+ enumerable: true,
275
+ configurable: true,
276
+ writable: true,
277
+ value: "InvalidSignatureError"
278
+ });
279
+ }
280
+ };
281
+ var UnknownSignatureError = class extends BaseError {
282
+ constructor({ signature }) {
283
+ super("Unknown signature.", {
284
+ details: signature
285
+ });
286
+ Object.defineProperty(this, "name", {
287
+ enumerable: true,
288
+ configurable: true,
289
+ writable: true,
290
+ value: "UnknownSignatureError"
291
+ });
292
+ }
293
+ };
294
+ var InvalidStructSignatureError = class extends BaseError {
295
+ constructor({ signature }) {
296
+ super("Invalid struct signature.", {
297
+ details: signature,
298
+ metaMessages: ["No properties exist."]
299
+ });
300
+ Object.defineProperty(this, "name", {
301
+ enumerable: true,
302
+ configurable: true,
303
+ writable: true,
304
+ value: "InvalidStructSignatureError"
305
+ });
306
+ }
307
+ };
308
+
309
+ // ../../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
310
+ var CircularReferenceError = class extends BaseError {
311
+ constructor({ type }) {
312
+ super("Circular reference detected.", {
313
+ metaMessages: [`Struct "${type}" is a circular reference.`]
314
+ });
315
+ Object.defineProperty(this, "name", {
316
+ enumerable: true,
317
+ configurable: true,
318
+ writable: true,
319
+ value: "CircularReferenceError"
320
+ });
321
+ }
322
+ };
323
+
324
+ // ../../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
325
+ var InvalidParenthesisError = class extends BaseError {
326
+ constructor({ current, depth }) {
327
+ super("Unbalanced parentheses.", {
328
+ metaMessages: [
329
+ `"${current.trim()}" has too many ${depth > 0 ? "opening" : "closing"} parentheses.`
330
+ ],
331
+ details: `Depth "${depth}"`
332
+ });
333
+ Object.defineProperty(this, "name", {
334
+ enumerable: true,
335
+ configurable: true,
336
+ writable: true,
337
+ value: "InvalidParenthesisError"
338
+ });
339
+ }
340
+ };
341
+
342
+ // ../../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
343
+ function getParameterCacheKey(param, type, structs) {
344
+ let structKey = "";
345
+ if (structs)
346
+ for (const struct of Object.entries(structs)) {
347
+ if (!struct)
348
+ continue;
349
+ let propertyKey = "";
350
+ for (const property of struct[1]) {
351
+ propertyKey += `[${property.type}${property.name ? `:${property.name}` : ""}]`;
352
+ }
353
+ structKey += `(${struct[0]}{${propertyKey}})`;
354
+ }
355
+ if (type)
356
+ return `${type}:${param}${structKey}`;
357
+ return `${param}${structKey}`;
358
+ }
359
+ var parameterCache = /* @__PURE__ */ new Map([
360
+ // Unnamed
361
+ ["address", { type: "address" }],
362
+ ["bool", { type: "bool" }],
363
+ ["bytes", { type: "bytes" }],
364
+ ["bytes32", { type: "bytes32" }],
365
+ ["int", { type: "int256" }],
366
+ ["int256", { type: "int256" }],
367
+ ["string", { type: "string" }],
368
+ ["uint", { type: "uint256" }],
369
+ ["uint8", { type: "uint8" }],
370
+ ["uint16", { type: "uint16" }],
371
+ ["uint24", { type: "uint24" }],
372
+ ["uint32", { type: "uint32" }],
373
+ ["uint64", { type: "uint64" }],
374
+ ["uint96", { type: "uint96" }],
375
+ ["uint112", { type: "uint112" }],
376
+ ["uint160", { type: "uint160" }],
377
+ ["uint192", { type: "uint192" }],
378
+ ["uint256", { type: "uint256" }],
379
+ // Named
380
+ ["address owner", { type: "address", name: "owner" }],
381
+ ["address to", { type: "address", name: "to" }],
382
+ ["bool approved", { type: "bool", name: "approved" }],
383
+ ["bytes _data", { type: "bytes", name: "_data" }],
384
+ ["bytes data", { type: "bytes", name: "data" }],
385
+ ["bytes signature", { type: "bytes", name: "signature" }],
386
+ ["bytes32 hash", { type: "bytes32", name: "hash" }],
387
+ ["bytes32 r", { type: "bytes32", name: "r" }],
388
+ ["bytes32 root", { type: "bytes32", name: "root" }],
389
+ ["bytes32 s", { type: "bytes32", name: "s" }],
390
+ ["string name", { type: "string", name: "name" }],
391
+ ["string symbol", { type: "string", name: "symbol" }],
392
+ ["string tokenURI", { type: "string", name: "tokenURI" }],
393
+ ["uint tokenId", { type: "uint256", name: "tokenId" }],
394
+ ["uint8 v", { type: "uint8", name: "v" }],
395
+ ["uint256 balance", { type: "uint256", name: "balance" }],
396
+ ["uint256 tokenId", { type: "uint256", name: "tokenId" }],
397
+ ["uint256 value", { type: "uint256", name: "value" }],
398
+ // Indexed
399
+ [
400
+ "event:address indexed from",
401
+ { type: "address", name: "from", indexed: true }
402
+ ],
403
+ ["event:address indexed to", { type: "address", name: "to", indexed: true }],
404
+ [
405
+ "event:uint indexed tokenId",
406
+ { type: "uint256", name: "tokenId", indexed: true }
407
+ ],
408
+ [
409
+ "event:uint256 indexed tokenId",
410
+ { type: "uint256", name: "tokenId", indexed: true }
411
+ ]
412
+ ]);
413
+
414
+ // ../../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
415
+ function parseSignature(signature, structs = {}) {
416
+ if (isFunctionSignature(signature))
417
+ return parseFunctionSignature(signature, structs);
418
+ if (isEventSignature(signature))
419
+ return parseEventSignature(signature, structs);
420
+ if (isErrorSignature(signature))
421
+ return parseErrorSignature(signature, structs);
422
+ if (isConstructorSignature(signature))
423
+ return parseConstructorSignature(signature, structs);
424
+ if (isFallbackSignature(signature))
425
+ return parseFallbackSignature(signature);
426
+ if (isReceiveSignature(signature))
427
+ return {
428
+ type: "receive",
429
+ stateMutability: "payable"
430
+ };
431
+ throw new UnknownSignatureError({ signature });
432
+ }
433
+ function parseFunctionSignature(signature, structs = {}) {
434
+ const match = execFunctionSignature(signature);
435
+ if (!match)
436
+ throw new InvalidSignatureError({ signature, type: "function" });
437
+ const inputParams = splitParameters(match.parameters);
438
+ const inputs = [];
439
+ const inputLength = inputParams.length;
440
+ for (let i = 0; i < inputLength; i++) {
441
+ inputs.push(parseAbiParameter(inputParams[i], {
442
+ modifiers: functionModifiers,
443
+ structs,
444
+ type: "function"
445
+ }));
446
+ }
447
+ const outputs = [];
448
+ if (match.returns) {
449
+ const outputParams = splitParameters(match.returns);
450
+ const outputLength = outputParams.length;
451
+ for (let i = 0; i < outputLength; i++) {
452
+ outputs.push(parseAbiParameter(outputParams[i], {
453
+ modifiers: functionModifiers,
454
+ structs,
455
+ type: "function"
456
+ }));
457
+ }
458
+ }
459
+ return {
460
+ name: match.name,
461
+ type: "function",
462
+ stateMutability: match.stateMutability ?? "nonpayable",
463
+ inputs,
464
+ outputs
465
+ };
466
+ }
467
+ function parseEventSignature(signature, structs = {}) {
468
+ const match = execEventSignature(signature);
469
+ if (!match)
470
+ throw new InvalidSignatureError({ signature, type: "event" });
471
+ const params = splitParameters(match.parameters);
472
+ const abiParameters = [];
473
+ const length = params.length;
474
+ for (let i = 0; i < length; i++)
475
+ abiParameters.push(parseAbiParameter(params[i], {
476
+ modifiers: eventModifiers,
477
+ structs,
478
+ type: "event"
479
+ }));
480
+ return { name: match.name, type: "event", inputs: abiParameters };
481
+ }
482
+ function parseErrorSignature(signature, structs = {}) {
483
+ const match = execErrorSignature(signature);
484
+ if (!match)
485
+ throw new InvalidSignatureError({ signature, type: "error" });
486
+ const params = splitParameters(match.parameters);
487
+ const abiParameters = [];
488
+ const length = params.length;
489
+ for (let i = 0; i < length; i++)
490
+ abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
491
+ return { name: match.name, type: "error", inputs: abiParameters };
492
+ }
493
+ function parseConstructorSignature(signature, structs = {}) {
494
+ const match = execConstructorSignature(signature);
495
+ if (!match)
496
+ throw new InvalidSignatureError({ signature, type: "constructor" });
497
+ const params = splitParameters(match.parameters);
498
+ const abiParameters = [];
499
+ const length = params.length;
500
+ for (let i = 0; i < length; i++)
501
+ abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
502
+ return {
503
+ type: "constructor",
504
+ stateMutability: match.stateMutability ?? "nonpayable",
505
+ inputs: abiParameters
506
+ };
507
+ }
508
+ function parseFallbackSignature(signature) {
509
+ const match = execFallbackSignature(signature);
510
+ if (!match)
511
+ throw new InvalidSignatureError({ signature, type: "fallback" });
512
+ return {
513
+ type: "fallback",
514
+ stateMutability: match.stateMutability ?? "nonpayable"
515
+ };
516
+ }
517
+ 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$_]*))?$/;
518
+ var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
519
+ var dynamicIntegerRegex = /^u?int$/;
520
+ function parseAbiParameter(param, options) {
521
+ const parameterCacheKey = getParameterCacheKey(param, options?.type, options?.structs);
522
+ if (parameterCache.has(parameterCacheKey))
523
+ return parameterCache.get(parameterCacheKey);
524
+ const isTuple = isTupleRegex.test(param);
525
+ const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);
526
+ if (!match)
527
+ throw new InvalidParameterError({ param });
528
+ if (match.name && isSolidityKeyword(match.name))
529
+ throw new SolidityProtectedKeywordError({ param, name: match.name });
530
+ const name = match.name ? { name: match.name } : {};
531
+ const indexed = match.modifier === "indexed" ? { indexed: true } : {};
532
+ const structs = options?.structs ?? {};
533
+ let type;
534
+ let components = {};
535
+ if (isTuple) {
536
+ type = "tuple";
537
+ const params = splitParameters(match.type);
538
+ const components_ = [];
539
+ const length = params.length;
540
+ for (let i = 0; i < length; i++) {
541
+ components_.push(parseAbiParameter(params[i], { structs }));
542
+ }
543
+ components = { components: components_ };
544
+ } else if (match.type in structs) {
545
+ type = "tuple";
546
+ components = { components: structs[match.type] };
547
+ } else if (dynamicIntegerRegex.test(match.type)) {
548
+ type = `${match.type}256`;
549
+ } else if (match.type === "address payable") {
550
+ type = "address";
551
+ } else {
552
+ type = match.type;
553
+ if (!(options?.type === "struct") && !isSolidityType(type))
554
+ throw new UnknownSolidityTypeError({ type });
555
+ }
556
+ if (match.modifier) {
557
+ if (!options?.modifiers?.has?.(match.modifier))
558
+ throw new InvalidModifierError({
559
+ param,
560
+ type: options?.type,
561
+ modifier: match.modifier
562
+ });
563
+ if (functionModifiers.has(match.modifier) && !isValidDataLocation(type, !!match.array))
564
+ throw new InvalidFunctionModifierError({
565
+ param,
566
+ type: options?.type,
567
+ modifier: match.modifier
568
+ });
569
+ }
570
+ const abiParameter = {
571
+ type: `${type}${match.array ?? ""}`,
572
+ ...name,
573
+ ...indexed,
574
+ ...components
575
+ };
576
+ parameterCache.set(parameterCacheKey, abiParameter);
577
+ return abiParameter;
578
+ }
579
+ function splitParameters(params, result = [], current = "", depth = 0) {
580
+ const length = params.trim().length;
581
+ for (let i = 0; i < length; i++) {
582
+ const char = params[i];
583
+ const tail = params.slice(i + 1);
584
+ switch (char) {
585
+ case ",":
586
+ return depth === 0 ? splitParameters(tail, [...result, current.trim()]) : splitParameters(tail, result, `${current}${char}`, depth);
587
+ case "(":
588
+ return splitParameters(tail, result, `${current}${char}`, depth + 1);
589
+ case ")":
590
+ return splitParameters(tail, result, `${current}${char}`, depth - 1);
591
+ default:
592
+ return splitParameters(tail, result, `${current}${char}`, depth);
593
+ }
594
+ }
595
+ if (current === "")
596
+ return result;
597
+ if (depth !== 0)
598
+ throw new InvalidParenthesisError({ current, depth });
599
+ result.push(current.trim());
600
+ return result;
601
+ }
602
+ function isSolidityType(type) {
603
+ return type === "address" || type === "bool" || type === "function" || type === "string" || bytesRegex.test(type) || integerRegex.test(type);
604
+ }
605
+ 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)$/;
606
+ function isSolidityKeyword(name) {
607
+ return name === "address" || name === "bool" || name === "function" || name === "string" || name === "tuple" || bytesRegex.test(name) || integerRegex.test(name) || protectedKeywordsRegex.test(name);
608
+ }
609
+ function isValidDataLocation(type, isArray) {
610
+ return isArray || type === "bytes" || type === "string" || type === "tuple";
611
+ }
612
+
613
+ // ../../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
614
+ function parseStructs(signatures) {
615
+ const shallowStructs = {};
616
+ const signaturesLength = signatures.length;
617
+ for (let i = 0; i < signaturesLength; i++) {
618
+ const signature = signatures[i];
619
+ if (!isStructSignature(signature))
620
+ continue;
621
+ const match = execStructSignature(signature);
622
+ if (!match)
623
+ throw new InvalidSignatureError({ signature, type: "struct" });
624
+ const properties = match.properties.split(";");
625
+ const components = [];
626
+ const propertiesLength = properties.length;
627
+ for (let k = 0; k < propertiesLength; k++) {
628
+ const property = properties[k];
629
+ const trimmed = property.trim();
630
+ if (!trimmed)
631
+ continue;
632
+ const abiParameter = parseAbiParameter(trimmed, {
633
+ type: "struct"
634
+ });
635
+ components.push(abiParameter);
636
+ }
637
+ if (!components.length)
638
+ throw new InvalidStructSignatureError({ signature });
639
+ shallowStructs[match.name] = components;
640
+ }
641
+ const resolvedStructs = {};
642
+ const entries = Object.entries(shallowStructs);
643
+ const entriesLength = entries.length;
644
+ for (let i = 0; i < entriesLength; i++) {
645
+ const [name, parameters] = entries[i];
646
+ resolvedStructs[name] = resolveStructs(parameters, shallowStructs);
647
+ }
648
+ return resolvedStructs;
649
+ }
650
+ var typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
651
+ function resolveStructs(abiParameters = [], structs = {}, ancestors = /* @__PURE__ */ new Set()) {
652
+ const components = [];
653
+ const length = abiParameters.length;
654
+ for (let i = 0; i < length; i++) {
655
+ const abiParameter = abiParameters[i];
656
+ const isTuple = isTupleRegex.test(abiParameter.type);
657
+ if (isTuple)
658
+ components.push(abiParameter);
659
+ else {
660
+ const match = execTyped(typeWithoutTupleRegex, abiParameter.type);
661
+ if (!match?.type)
662
+ throw new InvalidAbiTypeParameterError({ abiParameter });
663
+ const { array, type } = match;
664
+ if (type in structs) {
665
+ if (ancestors.has(type))
666
+ throw new CircularReferenceError({ type });
667
+ components.push({
668
+ ...abiParameter,
669
+ type: `tuple${array ?? ""}`,
670
+ components: resolveStructs(structs[type], structs, /* @__PURE__ */ new Set([...ancestors, type]))
671
+ });
672
+ } else {
673
+ if (isSolidityType(type))
674
+ components.push(abiParameter);
675
+ else
676
+ throw new UnknownTypeError({ type });
677
+ }
678
+ }
679
+ }
680
+ return components;
681
+ }
682
+
683
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/parseAbi.js
684
+ function parseAbi(signatures) {
685
+ const structs = parseStructs(signatures);
686
+ const abi = [];
687
+ const length = signatures.length;
688
+ for (let i = 0; i < length; i++) {
689
+ const signature = signatures[i];
690
+ if (isStructSignature(signature))
691
+ continue;
692
+ abi.push(parseSignature(signature, structs));
693
+ }
694
+ return abi;
695
+ }
696
+
697
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
698
+ var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
699
+ function formatAbiParameter(abiParameter) {
700
+ let type = abiParameter.type;
701
+ if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
702
+ type = "(";
703
+ const length = abiParameter.components.length;
704
+ for (let i = 0; i < length; i++) {
705
+ const component = abiParameter.components[i];
706
+ type += formatAbiParameter(component);
707
+ if (i < length - 1)
708
+ type += ", ";
709
+ }
710
+ const result = execTyped(tupleRegex, abiParameter.type);
711
+ type += `)${result?.array || ""}`;
712
+ return formatAbiParameter({
713
+ ...abiParameter,
714
+ type
715
+ });
716
+ }
717
+ if ("indexed" in abiParameter && abiParameter.indexed)
718
+ type = `${type} indexed`;
719
+ if (abiParameter.name)
720
+ return `${type} ${abiParameter.name}`;
721
+ return type;
722
+ }
723
+
724
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
725
+ function formatAbiParameters(abiParameters) {
726
+ let params = "";
727
+ const length = abiParameters.length;
728
+ for (let i = 0; i < length; i++) {
729
+ const abiParameter = abiParameters[i];
730
+ params += formatAbiParameter(abiParameter);
731
+ if (i !== length - 1)
732
+ params += ", ";
733
+ }
734
+ return params;
735
+ }
736
+
737
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
738
+ function formatAbiItem(abiItem) {
739
+ if (abiItem.type === "function")
740
+ return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs?.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
741
+ if (abiItem.type === "event")
742
+ return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
743
+ if (abiItem.type === "error")
744
+ return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
745
+ if (abiItem.type === "constructor")
746
+ return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
747
+ if (abiItem.type === "fallback")
748
+ return `fallback() external${abiItem.stateMutability === "payable" ? " payable" : ""}`;
749
+ return "receive() external payable";
750
+ }
751
+
752
+ // ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js
753
+ function parseAbiParameters(params) {
754
+ const abiParameters = [];
755
+ if (typeof params === "string") {
756
+ const parameters = splitParameters(params);
757
+ const length = parameters.length;
758
+ for (let i = 0; i < length; i++) {
759
+ abiParameters.push(parseAbiParameter(parameters[i], { modifiers }));
760
+ }
761
+ } else {
762
+ const structs = parseStructs(params);
763
+ const length = params.length;
764
+ for (let i = 0; i < length; i++) {
765
+ const signature = params[i];
766
+ if (isStructSignature(signature))
767
+ continue;
768
+ const parameters = splitParameters(signature);
769
+ const length2 = parameters.length;
770
+ for (let k = 0; k < length2; k++) {
771
+ abiParameters.push(parseAbiParameter(parameters[k], { modifiers, structs }));
772
+ }
773
+ }
774
+ }
775
+ if (abiParameters.length === 0)
776
+ throw new InvalidAbiParametersError({ params });
777
+ return abiParameters;
778
+ }
779
+
780
+ // ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js
781
+ var _0n = BigInt(0);
782
+ var _1n = BigInt(1);
783
+ var _2n = BigInt(2);
784
+ var _7n = BigInt(7);
785
+ var _256n = BigInt(256);
786
+ var _0x71n = BigInt(113);
787
+ var SHA3_PI = [];
788
+ var SHA3_ROTL = [];
789
+ var _SHA3_IOTA = [];
790
+ for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
791
+ [x, y] = [y, (2 * x + 3 * y) % 5];
792
+ SHA3_PI.push(2 * (5 * y + x));
793
+ SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
794
+ let t = _0n;
795
+ for (let j = 0; j < 7; j++) {
796
+ R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
797
+ if (R & _2n)
798
+ t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
799
+ }
800
+ _SHA3_IOTA.push(t);
801
+ }
802
+ var IOTAS = split(_SHA3_IOTA, true);
803
+ var SHA3_IOTA_H = IOTAS[0];
804
+ var SHA3_IOTA_L = IOTAS[1];
805
+ var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
806
+ var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
807
+ function keccakP(s, rounds = 24) {
808
+ const B = new Uint32Array(5 * 2);
809
+ for (let round = 24 - rounds; round < 24; round++) {
810
+ for (let x = 0; x < 10; x++)
811
+ B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
812
+ for (let x = 0; x < 10; x += 2) {
813
+ const idx1 = (x + 8) % 10;
814
+ const idx0 = (x + 2) % 10;
815
+ const B0 = B[idx0];
816
+ const B1 = B[idx0 + 1];
817
+ const Th = rotlH(B0, B1, 1) ^ B[idx1];
818
+ const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
819
+ for (let y = 0; y < 50; y += 10) {
820
+ s[x + y] ^= Th;
821
+ s[x + y + 1] ^= Tl;
822
+ }
823
+ }
824
+ let curH = s[2];
825
+ let curL = s[3];
826
+ for (let t = 0; t < 24; t++) {
827
+ const shift = SHA3_ROTL[t];
828
+ const Th = rotlH(curH, curL, shift);
829
+ const Tl = rotlL(curH, curL, shift);
830
+ const PI = SHA3_PI[t];
831
+ curH = s[PI];
832
+ curL = s[PI + 1];
833
+ s[PI] = Th;
834
+ s[PI + 1] = Tl;
835
+ }
836
+ for (let y = 0; y < 50; y += 10) {
837
+ for (let x = 0; x < 10; x++)
838
+ B[x] = s[y + x];
839
+ for (let x = 0; x < 10; x++)
840
+ s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
841
+ }
842
+ s[0] ^= SHA3_IOTA_H[round];
843
+ s[1] ^= SHA3_IOTA_L[round];
844
+ }
845
+ clean(B);
846
+ }
847
+ var Keccak = class _Keccak extends Hash {
848
+ // NOTE: we accept arguments in bytes instead of bits here.
849
+ constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
850
+ super();
851
+ this.pos = 0;
852
+ this.posOut = 0;
853
+ this.finished = false;
854
+ this.destroyed = false;
855
+ this.enableXOF = false;
856
+ this.blockLen = blockLen;
857
+ this.suffix = suffix;
858
+ this.outputLen = outputLen;
859
+ this.enableXOF = enableXOF;
860
+ this.rounds = rounds;
861
+ anumber(outputLen);
862
+ if (!(0 < blockLen && blockLen < 200))
863
+ throw new Error("only keccak-f1600 function is supported");
864
+ this.state = new Uint8Array(200);
865
+ this.state32 = u32(this.state);
866
+ }
867
+ clone() {
868
+ return this._cloneInto();
869
+ }
870
+ keccak() {
871
+ swap32IfBE(this.state32);
872
+ keccakP(this.state32, this.rounds);
873
+ swap32IfBE(this.state32);
874
+ this.posOut = 0;
875
+ this.pos = 0;
876
+ }
877
+ update(data) {
878
+ aexists(this);
879
+ data = toBytes(data);
880
+ abytes(data);
881
+ const { blockLen, state } = this;
882
+ const len = data.length;
883
+ for (let pos = 0; pos < len; ) {
884
+ const take = Math.min(blockLen - this.pos, len - pos);
885
+ for (let i = 0; i < take; i++)
886
+ state[this.pos++] ^= data[pos++];
887
+ if (this.pos === blockLen)
888
+ this.keccak();
889
+ }
890
+ return this;
891
+ }
892
+ finish() {
893
+ if (this.finished)
894
+ return;
895
+ this.finished = true;
896
+ const { state, suffix, pos, blockLen } = this;
897
+ state[pos] ^= suffix;
898
+ if ((suffix & 128) !== 0 && pos === blockLen - 1)
899
+ this.keccak();
900
+ state[blockLen - 1] ^= 128;
901
+ this.keccak();
902
+ }
903
+ writeInto(out) {
904
+ aexists(this, false);
905
+ abytes(out);
906
+ this.finish();
907
+ const bufferOut = this.state;
908
+ const { blockLen } = this;
909
+ for (let pos = 0, len = out.length; pos < len; ) {
910
+ if (this.posOut >= blockLen)
911
+ this.keccak();
912
+ const take = Math.min(blockLen - this.posOut, len - pos);
913
+ out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
914
+ this.posOut += take;
915
+ pos += take;
916
+ }
917
+ return out;
918
+ }
919
+ xofInto(out) {
920
+ if (!this.enableXOF)
921
+ throw new Error("XOF is not possible for this instance");
922
+ return this.writeInto(out);
923
+ }
924
+ xof(bytes) {
925
+ anumber(bytes);
926
+ return this.xofInto(new Uint8Array(bytes));
927
+ }
928
+ digestInto(out) {
929
+ aoutput(out, this);
930
+ if (this.finished)
931
+ throw new Error("digest() was already called");
932
+ this.writeInto(out);
933
+ this.destroy();
934
+ return out;
935
+ }
936
+ digest() {
937
+ return this.digestInto(new Uint8Array(this.outputLen));
938
+ }
939
+ destroy() {
940
+ this.destroyed = true;
941
+ clean(this.state);
942
+ }
943
+ _cloneInto(to) {
944
+ const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
945
+ to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
946
+ to.state32.set(this.state32);
947
+ to.pos = this.pos;
948
+ to.posOut = this.posOut;
949
+ to.finished = this.finished;
950
+ to.rounds = rounds;
951
+ to.suffix = suffix;
952
+ to.outputLen = outputLen;
953
+ to.enableXOF = enableXOF;
954
+ to.destroyed = this.destroyed;
955
+ return to;
956
+ }
957
+ };
958
+ var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
959
+ var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
960
+
961
+ export {
962
+ formatAbiParameters,
963
+ formatAbiItem,
964
+ parseAbi,
965
+ parseAbiParameters,
966
+ keccak_256
967
+ };
968
+ //# sourceMappingURL=chunk-EI3GHTKX.js.map