tenjin-cli 0.1.0-alpha.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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +52 -0
  3. package/README.md +124 -0
  4. package/dist/_esm-ZH2J4QEH.js +3737 -0
  5. package/dist/_esm-ZH2J4QEH.js.map +1 -0
  6. package/dist/ccip-FXWZDDF5.js +17 -0
  7. package/dist/ccip-FXWZDDF5.js.map +1 -0
  8. package/dist/chunk-376LHMK2.js +100 -0
  9. package/dist/chunk-376LHMK2.js.map +1 -0
  10. package/dist/chunk-3IMLRUZE.js +44 -0
  11. package/dist/chunk-3IMLRUZE.js.map +1 -0
  12. package/dist/chunk-CPUZRZ2A.js +410 -0
  13. package/dist/chunk-CPUZRZ2A.js.map +1 -0
  14. package/dist/chunk-F5DZJLU3.js +2058 -0
  15. package/dist/chunk-F5DZJLU3.js.map +1 -0
  16. package/dist/chunk-FIYZLITH.js +14577 -0
  17. package/dist/chunk-FIYZLITH.js.map +1 -0
  18. package/dist/chunk-LTTRND4A.js +135 -0
  19. package/dist/chunk-LTTRND4A.js.map +1 -0
  20. package/dist/chunk-PAAL45FJ.js +7307 -0
  21. package/dist/chunk-PAAL45FJ.js.map +1 -0
  22. package/dist/chunk-QHIEYBLV.js +320 -0
  23. package/dist/chunk-QHIEYBLV.js.map +1 -0
  24. package/dist/chunk-SXQQ2ZSR.js +887 -0
  25. package/dist/chunk-SXQQ2ZSR.js.map +1 -0
  26. package/dist/chunk-TX5T3LKJ.js +2249 -0
  27. package/dist/chunk-TX5T3LKJ.js.map +1 -0
  28. package/dist/chunk-WOHCAMDQ.js +4474 -0
  29. package/dist/chunk-WOHCAMDQ.js.map +1 -0
  30. package/dist/chunk-ZPZFPVDN.js +67 -0
  31. package/dist/chunk-ZPZFPVDN.js.map +1 -0
  32. package/dist/cli-LMHGCZ5S.js +3763 -0
  33. package/dist/cli-LMHGCZ5S.js.map +1 -0
  34. package/dist/config-XVXZ3V2Q.js +206 -0
  35. package/dist/config-XVXZ3V2Q.js.map +1 -0
  36. package/dist/doctor-MVLZRVPU.js +338 -0
  37. package/dist/doctor-MVLZRVPU.js.map +1 -0
  38. package/dist/index.js +26 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/mine.wasm-GQECMSGN.js +11 -0
  41. package/dist/mine.wasm-GQECMSGN.js.map +1 -0
  42. package/dist/secp256k1-35YNNB6F.js +18 -0
  43. package/dist/secp256k1-35YNNB6F.js.map +1 -0
  44. package/dist/usdc-OQUOFF6R.js +18 -0
  45. package/dist/usdc-OQUOFF6R.js.map +1 -0
  46. package/dist/wallet-NRKWLKHX.js +153 -0
  47. package/dist/wallet-NRKWLKHX.js.map +1 -0
  48. package/dist/wallet-QUWK2PA4.js +22 -0
  49. package/dist/wallet-QUWK2PA4.js.map +1 -0
  50. package/package.json +63 -0
@@ -0,0 +1,4474 @@
1
+ import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
2
+ import {
3
+ AbiConstructorNotFoundError,
4
+ AbiConstructorParamsNotFoundError,
5
+ AbiDecodingDataSizeTooSmallError,
6
+ AbiDecodingZeroDataError,
7
+ AbiErrorInputsNotFoundError,
8
+ AbiErrorNotFoundError,
9
+ AbiErrorSignatureNotFoundError,
10
+ AbiFunctionNotFoundError,
11
+ AbiFunctionOutputsNotFoundError,
12
+ AbiFunctionSignatureNotFoundError,
13
+ AbiItemAmbiguityError,
14
+ BaseError,
15
+ ChainDoesNotSupportContract,
16
+ ClientChainNotConfiguredError,
17
+ ExecutionRevertedError,
18
+ FeeCapTooHighError,
19
+ FeeCapTooLowError,
20
+ InsufficientFundsError,
21
+ IntrinsicGasTooHighError,
22
+ IntrinsicGasTooLowError,
23
+ InvalidAbiDecodingTypeError,
24
+ InvalidAddressError,
25
+ InvalidArrayError,
26
+ InvalidBytesBooleanError,
27
+ InvalidBytesLengthError,
28
+ NonceMaxValueError,
29
+ NonceTooHighError,
30
+ NonceTooLowError,
31
+ TipAboveFeeCapError,
32
+ TransactionTypeNotSupportedError,
33
+ UnknownNodeError,
34
+ assertSize,
35
+ bytesToHex,
36
+ checksumAddress,
37
+ concat,
38
+ concatHex,
39
+ createCursor,
40
+ encodeAbiParameters,
41
+ formatAbiItem,
42
+ formatEther,
43
+ formatGwei,
44
+ getArrayComponents,
45
+ hexToBigInt,
46
+ hexToBytes,
47
+ hexToNumber,
48
+ isAddress,
49
+ isHex,
50
+ keccak256,
51
+ maxUint256,
52
+ numberToHex,
53
+ parseAccount,
54
+ prettyPrint,
55
+ size,
56
+ slice,
57
+ sliceBytes,
58
+ stringify,
59
+ toBytes,
60
+ trim
61
+ } from "./chunk-F5DZJLU3.js";
62
+
63
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/version.js
64
+ var version = "1.2.3";
65
+
66
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/errors.js
67
+ var BaseError2 = class _BaseError extends Error {
68
+ constructor(shortMessage, args = {}) {
69
+ const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
70
+ const docsPath6 = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
71
+ const message = [
72
+ shortMessage || "An error occurred.",
73
+ "",
74
+ ...args.metaMessages ? [...args.metaMessages, ""] : [],
75
+ ...docsPath6 ? [`Docs: https://abitype.dev${docsPath6}`] : [],
76
+ ...details ? [`Details: ${details}`] : [],
77
+ `Version: abitype@${version}`
78
+ ].join("\n");
79
+ super(message);
80
+ Object.defineProperty(this, "details", {
81
+ enumerable: true,
82
+ configurable: true,
83
+ writable: true,
84
+ value: void 0
85
+ });
86
+ Object.defineProperty(this, "docsPath", {
87
+ enumerable: true,
88
+ configurable: true,
89
+ writable: true,
90
+ value: void 0
91
+ });
92
+ Object.defineProperty(this, "metaMessages", {
93
+ enumerable: true,
94
+ configurable: true,
95
+ writable: true,
96
+ value: void 0
97
+ });
98
+ Object.defineProperty(this, "shortMessage", {
99
+ enumerable: true,
100
+ configurable: true,
101
+ writable: true,
102
+ value: void 0
103
+ });
104
+ Object.defineProperty(this, "name", {
105
+ enumerable: true,
106
+ configurable: true,
107
+ writable: true,
108
+ value: "AbiTypeError"
109
+ });
110
+ if (args.cause)
111
+ this.cause = args.cause;
112
+ this.details = details;
113
+ this.docsPath = docsPath6;
114
+ this.metaMessages = args.metaMessages;
115
+ this.shortMessage = shortMessage;
116
+ }
117
+ };
118
+
119
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/regex.js
120
+ function execTyped(regex, string) {
121
+ const match = regex.exec(string);
122
+ return match?.groups;
123
+ }
124
+ var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
125
+ 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)?$/;
126
+ var isTupleRegex = /^\(.+?\).*?$/;
127
+
128
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
129
+ var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
130
+ function formatAbiParameter(abiParameter) {
131
+ let type = abiParameter.type;
132
+ if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
133
+ type = "(";
134
+ const length = abiParameter.components.length;
135
+ for (let i = 0; i < length; i++) {
136
+ const component = abiParameter.components[i];
137
+ type += formatAbiParameter(component);
138
+ if (i < length - 1)
139
+ type += ", ";
140
+ }
141
+ const result = execTyped(tupleRegex, abiParameter.type);
142
+ type += `)${result?.array || ""}`;
143
+ return formatAbiParameter({
144
+ ...abiParameter,
145
+ type
146
+ });
147
+ }
148
+ if ("indexed" in abiParameter && abiParameter.indexed)
149
+ type = `${type} indexed`;
150
+ if (abiParameter.name)
151
+ return `${type} ${abiParameter.name}`;
152
+ return type;
153
+ }
154
+
155
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
156
+ function formatAbiParameters(abiParameters) {
157
+ let params = "";
158
+ const length = abiParameters.length;
159
+ for (let i = 0; i < length; i++) {
160
+ const abiParameter = abiParameters[i];
161
+ params += formatAbiParameter(abiParameter);
162
+ if (i !== length - 1)
163
+ params += ", ";
164
+ }
165
+ return params;
166
+ }
167
+
168
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
169
+ function formatAbiItem2(abiItem) {
170
+ if (abiItem.type === "function")
171
+ return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs?.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
172
+ if (abiItem.type === "event")
173
+ return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
174
+ if (abiItem.type === "error")
175
+ return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
176
+ if (abiItem.type === "constructor")
177
+ return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
178
+ if (abiItem.type === "fallback")
179
+ return `fallback() external${abiItem.stateMutability === "payable" ? " payable" : ""}`;
180
+ return "receive() external payable";
181
+ }
182
+
183
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js
184
+ var errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
185
+ function isErrorSignature(signature) {
186
+ return errorSignatureRegex.test(signature);
187
+ }
188
+ function execErrorSignature(signature) {
189
+ return execTyped(errorSignatureRegex, signature);
190
+ }
191
+ var eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
192
+ function isEventSignature(signature) {
193
+ return eventSignatureRegex.test(signature);
194
+ }
195
+ function execEventSignature(signature) {
196
+ return execTyped(eventSignatureRegex, signature);
197
+ }
198
+ 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>.*?)\))?$/;
199
+ function isFunctionSignature(signature) {
200
+ return functionSignatureRegex.test(signature);
201
+ }
202
+ function execFunctionSignature(signature) {
203
+ return execTyped(functionSignatureRegex, signature);
204
+ }
205
+ var structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
206
+ function isStructSignature(signature) {
207
+ return structSignatureRegex.test(signature);
208
+ }
209
+ function execStructSignature(signature) {
210
+ return execTyped(structSignatureRegex, signature);
211
+ }
212
+ var constructorSignatureRegex = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
213
+ function isConstructorSignature(signature) {
214
+ return constructorSignatureRegex.test(signature);
215
+ }
216
+ function execConstructorSignature(signature) {
217
+ return execTyped(constructorSignatureRegex, signature);
218
+ }
219
+ var fallbackSignatureRegex = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
220
+ function isFallbackSignature(signature) {
221
+ return fallbackSignatureRegex.test(signature);
222
+ }
223
+ function execFallbackSignature(signature) {
224
+ return execTyped(fallbackSignatureRegex, signature);
225
+ }
226
+ var receiveSignatureRegex = /^receive\(\) external payable$/;
227
+ function isReceiveSignature(signature) {
228
+ return receiveSignatureRegex.test(signature);
229
+ }
230
+ var modifiers = /* @__PURE__ */ new Set([
231
+ "memory",
232
+ "indexed",
233
+ "storage",
234
+ "calldata"
235
+ ]);
236
+ var eventModifiers = /* @__PURE__ */ new Set(["indexed"]);
237
+ var functionModifiers = /* @__PURE__ */ new Set([
238
+ "calldata",
239
+ "memory",
240
+ "storage"
241
+ ]);
242
+
243
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js
244
+ var InvalidAbiItemError = class extends BaseError2 {
245
+ constructor({ signature }) {
246
+ super("Failed to parse ABI item.", {
247
+ details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,
248
+ docsPath: "/api/human#parseabiitem-1"
249
+ });
250
+ Object.defineProperty(this, "name", {
251
+ enumerable: true,
252
+ configurable: true,
253
+ writable: true,
254
+ value: "InvalidAbiItemError"
255
+ });
256
+ }
257
+ };
258
+ var UnknownTypeError = class extends BaseError2 {
259
+ constructor({ type }) {
260
+ super("Unknown type.", {
261
+ metaMessages: [
262
+ `Type "${type}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`
263
+ ]
264
+ });
265
+ Object.defineProperty(this, "name", {
266
+ enumerable: true,
267
+ configurable: true,
268
+ writable: true,
269
+ value: "UnknownTypeError"
270
+ });
271
+ }
272
+ };
273
+ var UnknownSolidityTypeError = class extends BaseError2 {
274
+ constructor({ type }) {
275
+ super("Unknown type.", {
276
+ metaMessages: [`Type "${type}" is not a valid ABI type.`]
277
+ });
278
+ Object.defineProperty(this, "name", {
279
+ enumerable: true,
280
+ configurable: true,
281
+ writable: true,
282
+ value: "UnknownSolidityTypeError"
283
+ });
284
+ }
285
+ };
286
+
287
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js
288
+ var InvalidAbiParametersError = class extends BaseError2 {
289
+ constructor({ params }) {
290
+ super("Failed to parse ABI parameters.", {
291
+ details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,
292
+ docsPath: "/api/human#parseabiparameters-1"
293
+ });
294
+ Object.defineProperty(this, "name", {
295
+ enumerable: true,
296
+ configurable: true,
297
+ writable: true,
298
+ value: "InvalidAbiParametersError"
299
+ });
300
+ }
301
+ };
302
+ var InvalidParameterError = class extends BaseError2 {
303
+ constructor({ param }) {
304
+ super("Invalid ABI parameter.", {
305
+ details: param
306
+ });
307
+ Object.defineProperty(this, "name", {
308
+ enumerable: true,
309
+ configurable: true,
310
+ writable: true,
311
+ value: "InvalidParameterError"
312
+ });
313
+ }
314
+ };
315
+ var SolidityProtectedKeywordError = class extends BaseError2 {
316
+ constructor({ param, name }) {
317
+ super("Invalid ABI parameter.", {
318
+ details: param,
319
+ metaMessages: [
320
+ `"${name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`
321
+ ]
322
+ });
323
+ Object.defineProperty(this, "name", {
324
+ enumerable: true,
325
+ configurable: true,
326
+ writable: true,
327
+ value: "SolidityProtectedKeywordError"
328
+ });
329
+ }
330
+ };
331
+ var InvalidModifierError = class extends BaseError2 {
332
+ constructor({ param, type, modifier }) {
333
+ super("Invalid ABI parameter.", {
334
+ details: param,
335
+ metaMessages: [
336
+ `Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`
337
+ ]
338
+ });
339
+ Object.defineProperty(this, "name", {
340
+ enumerable: true,
341
+ configurable: true,
342
+ writable: true,
343
+ value: "InvalidModifierError"
344
+ });
345
+ }
346
+ };
347
+ var InvalidFunctionModifierError = class extends BaseError2 {
348
+ constructor({ param, type, modifier }) {
349
+ super("Invalid ABI parameter.", {
350
+ details: param,
351
+ metaMessages: [
352
+ `Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`,
353
+ `Data location can only be specified for array, struct, or mapping types, but "${modifier}" was given.`
354
+ ]
355
+ });
356
+ Object.defineProperty(this, "name", {
357
+ enumerable: true,
358
+ configurable: true,
359
+ writable: true,
360
+ value: "InvalidFunctionModifierError"
361
+ });
362
+ }
363
+ };
364
+ var InvalidAbiTypeParameterError = class extends BaseError2 {
365
+ constructor({ abiParameter }) {
366
+ super("Invalid ABI parameter.", {
367
+ details: JSON.stringify(abiParameter, null, 2),
368
+ metaMessages: ["ABI parameter type is invalid."]
369
+ });
370
+ Object.defineProperty(this, "name", {
371
+ enumerable: true,
372
+ configurable: true,
373
+ writable: true,
374
+ value: "InvalidAbiTypeParameterError"
375
+ });
376
+ }
377
+ };
378
+
379
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/errors/signature.js
380
+ var InvalidSignatureError = class extends BaseError2 {
381
+ constructor({ signature, type }) {
382
+ super(`Invalid ${type} signature.`, {
383
+ details: signature
384
+ });
385
+ Object.defineProperty(this, "name", {
386
+ enumerable: true,
387
+ configurable: true,
388
+ writable: true,
389
+ value: "InvalidSignatureError"
390
+ });
391
+ }
392
+ };
393
+ var UnknownSignatureError = class extends BaseError2 {
394
+ constructor({ signature }) {
395
+ super("Unknown signature.", {
396
+ details: signature
397
+ });
398
+ Object.defineProperty(this, "name", {
399
+ enumerable: true,
400
+ configurable: true,
401
+ writable: true,
402
+ value: "UnknownSignatureError"
403
+ });
404
+ }
405
+ };
406
+ var InvalidStructSignatureError = class extends BaseError2 {
407
+ constructor({ signature }) {
408
+ super("Invalid struct signature.", {
409
+ details: signature,
410
+ metaMessages: ["No properties exist."]
411
+ });
412
+ Object.defineProperty(this, "name", {
413
+ enumerable: true,
414
+ configurable: true,
415
+ writable: true,
416
+ value: "InvalidStructSignatureError"
417
+ });
418
+ }
419
+ };
420
+
421
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/errors/struct.js
422
+ var CircularReferenceError = class extends BaseError2 {
423
+ constructor({ type }) {
424
+ super("Circular reference detected.", {
425
+ metaMessages: [`Struct "${type}" is a circular reference.`]
426
+ });
427
+ Object.defineProperty(this, "name", {
428
+ enumerable: true,
429
+ configurable: true,
430
+ writable: true,
431
+ value: "CircularReferenceError"
432
+ });
433
+ }
434
+ };
435
+
436
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js
437
+ var InvalidParenthesisError = class extends BaseError2 {
438
+ constructor({ current, depth }) {
439
+ super("Unbalanced parentheses.", {
440
+ metaMessages: [
441
+ `"${current.trim()}" has too many ${depth > 0 ? "opening" : "closing"} parentheses.`
442
+ ],
443
+ details: `Depth "${depth}"`
444
+ });
445
+ Object.defineProperty(this, "name", {
446
+ enumerable: true,
447
+ configurable: true,
448
+ writable: true,
449
+ value: "InvalidParenthesisError"
450
+ });
451
+ }
452
+ };
453
+
454
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/runtime/cache.js
455
+ function getParameterCacheKey(param, type, structs) {
456
+ let structKey = "";
457
+ if (structs)
458
+ for (const struct of Object.entries(structs)) {
459
+ if (!struct)
460
+ continue;
461
+ let propertyKey = "";
462
+ for (const property of struct[1]) {
463
+ propertyKey += `[${property.type}${property.name ? `:${property.name}` : ""}]`;
464
+ }
465
+ structKey += `(${struct[0]}{${propertyKey}})`;
466
+ }
467
+ if (type)
468
+ return `${type}:${param}${structKey}`;
469
+ return `${param}${structKey}`;
470
+ }
471
+ var parameterCache = /* @__PURE__ */ new Map([
472
+ // Unnamed
473
+ ["address", { type: "address" }],
474
+ ["bool", { type: "bool" }],
475
+ ["bytes", { type: "bytes" }],
476
+ ["bytes32", { type: "bytes32" }],
477
+ ["int", { type: "int256" }],
478
+ ["int256", { type: "int256" }],
479
+ ["string", { type: "string" }],
480
+ ["uint", { type: "uint256" }],
481
+ ["uint8", { type: "uint8" }],
482
+ ["uint16", { type: "uint16" }],
483
+ ["uint24", { type: "uint24" }],
484
+ ["uint32", { type: "uint32" }],
485
+ ["uint64", { type: "uint64" }],
486
+ ["uint96", { type: "uint96" }],
487
+ ["uint112", { type: "uint112" }],
488
+ ["uint160", { type: "uint160" }],
489
+ ["uint192", { type: "uint192" }],
490
+ ["uint256", { type: "uint256" }],
491
+ // Named
492
+ ["address owner", { type: "address", name: "owner" }],
493
+ ["address to", { type: "address", name: "to" }],
494
+ ["bool approved", { type: "bool", name: "approved" }],
495
+ ["bytes _data", { type: "bytes", name: "_data" }],
496
+ ["bytes data", { type: "bytes", name: "data" }],
497
+ ["bytes signature", { type: "bytes", name: "signature" }],
498
+ ["bytes32 hash", { type: "bytes32", name: "hash" }],
499
+ ["bytes32 r", { type: "bytes32", name: "r" }],
500
+ ["bytes32 root", { type: "bytes32", name: "root" }],
501
+ ["bytes32 s", { type: "bytes32", name: "s" }],
502
+ ["string name", { type: "string", name: "name" }],
503
+ ["string symbol", { type: "string", name: "symbol" }],
504
+ ["string tokenURI", { type: "string", name: "tokenURI" }],
505
+ ["uint tokenId", { type: "uint256", name: "tokenId" }],
506
+ ["uint8 v", { type: "uint8", name: "v" }],
507
+ ["uint256 balance", { type: "uint256", name: "balance" }],
508
+ ["uint256 tokenId", { type: "uint256", name: "tokenId" }],
509
+ ["uint256 value", { type: "uint256", name: "value" }],
510
+ // Indexed
511
+ [
512
+ "event:address indexed from",
513
+ { type: "address", name: "from", indexed: true }
514
+ ],
515
+ ["event:address indexed to", { type: "address", name: "to", indexed: true }],
516
+ [
517
+ "event:uint indexed tokenId",
518
+ { type: "uint256", name: "tokenId", indexed: true }
519
+ ],
520
+ [
521
+ "event:uint256 indexed tokenId",
522
+ { type: "uint256", name: "tokenId", indexed: true }
523
+ ]
524
+ ]);
525
+
526
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/runtime/utils.js
527
+ function parseSignature(signature, structs = {}) {
528
+ if (isFunctionSignature(signature))
529
+ return parseFunctionSignature(signature, structs);
530
+ if (isEventSignature(signature))
531
+ return parseEventSignature(signature, structs);
532
+ if (isErrorSignature(signature))
533
+ return parseErrorSignature(signature, structs);
534
+ if (isConstructorSignature(signature))
535
+ return parseConstructorSignature(signature, structs);
536
+ if (isFallbackSignature(signature))
537
+ return parseFallbackSignature(signature);
538
+ if (isReceiveSignature(signature))
539
+ return {
540
+ type: "receive",
541
+ stateMutability: "payable"
542
+ };
543
+ throw new UnknownSignatureError({ signature });
544
+ }
545
+ function parseFunctionSignature(signature, structs = {}) {
546
+ const match = execFunctionSignature(signature);
547
+ if (!match)
548
+ throw new InvalidSignatureError({ signature, type: "function" });
549
+ const inputParams = splitParameters(match.parameters);
550
+ const inputs = [];
551
+ const inputLength = inputParams.length;
552
+ for (let i = 0; i < inputLength; i++) {
553
+ inputs.push(parseAbiParameter(inputParams[i], {
554
+ modifiers: functionModifiers,
555
+ structs,
556
+ type: "function"
557
+ }));
558
+ }
559
+ const outputs = [];
560
+ if (match.returns) {
561
+ const outputParams = splitParameters(match.returns);
562
+ const outputLength = outputParams.length;
563
+ for (let i = 0; i < outputLength; i++) {
564
+ outputs.push(parseAbiParameter(outputParams[i], {
565
+ modifiers: functionModifiers,
566
+ structs,
567
+ type: "function"
568
+ }));
569
+ }
570
+ }
571
+ return {
572
+ name: match.name,
573
+ type: "function",
574
+ stateMutability: match.stateMutability ?? "nonpayable",
575
+ inputs,
576
+ outputs
577
+ };
578
+ }
579
+ function parseEventSignature(signature, structs = {}) {
580
+ const match = execEventSignature(signature);
581
+ if (!match)
582
+ throw new InvalidSignatureError({ signature, type: "event" });
583
+ const params = splitParameters(match.parameters);
584
+ const abiParameters = [];
585
+ const length = params.length;
586
+ for (let i = 0; i < length; i++)
587
+ abiParameters.push(parseAbiParameter(params[i], {
588
+ modifiers: eventModifiers,
589
+ structs,
590
+ type: "event"
591
+ }));
592
+ return { name: match.name, type: "event", inputs: abiParameters };
593
+ }
594
+ function parseErrorSignature(signature, structs = {}) {
595
+ const match = execErrorSignature(signature);
596
+ if (!match)
597
+ throw new InvalidSignatureError({ signature, type: "error" });
598
+ const params = splitParameters(match.parameters);
599
+ const abiParameters = [];
600
+ const length = params.length;
601
+ for (let i = 0; i < length; i++)
602
+ abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
603
+ return { name: match.name, type: "error", inputs: abiParameters };
604
+ }
605
+ function parseConstructorSignature(signature, structs = {}) {
606
+ const match = execConstructorSignature(signature);
607
+ if (!match)
608
+ throw new InvalidSignatureError({ signature, type: "constructor" });
609
+ const params = splitParameters(match.parameters);
610
+ const abiParameters = [];
611
+ const length = params.length;
612
+ for (let i = 0; i < length; i++)
613
+ abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
614
+ return {
615
+ type: "constructor",
616
+ stateMutability: match.stateMutability ?? "nonpayable",
617
+ inputs: abiParameters
618
+ };
619
+ }
620
+ function parseFallbackSignature(signature) {
621
+ const match = execFallbackSignature(signature);
622
+ if (!match)
623
+ throw new InvalidSignatureError({ signature, type: "fallback" });
624
+ return {
625
+ type: "fallback",
626
+ stateMutability: match.stateMutability ?? "nonpayable"
627
+ };
628
+ }
629
+ 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$_]*))?$/;
630
+ var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
631
+ var dynamicIntegerRegex = /^u?int$/;
632
+ function parseAbiParameter(param, options) {
633
+ const parameterCacheKey = getParameterCacheKey(param, options?.type, options?.structs);
634
+ if (parameterCache.has(parameterCacheKey))
635
+ return parameterCache.get(parameterCacheKey);
636
+ const isTuple = isTupleRegex.test(param);
637
+ const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);
638
+ if (!match)
639
+ throw new InvalidParameterError({ param });
640
+ if (match.name && isSolidityKeyword(match.name))
641
+ throw new SolidityProtectedKeywordError({ param, name: match.name });
642
+ const name = match.name ? { name: match.name } : {};
643
+ const indexed = match.modifier === "indexed" ? { indexed: true } : {};
644
+ const structs = options?.structs ?? {};
645
+ let type;
646
+ let components = {};
647
+ if (isTuple) {
648
+ type = "tuple";
649
+ const params = splitParameters(match.type);
650
+ const components_ = [];
651
+ const length = params.length;
652
+ for (let i = 0; i < length; i++) {
653
+ components_.push(parseAbiParameter(params[i], { structs }));
654
+ }
655
+ components = { components: components_ };
656
+ } else if (match.type in structs) {
657
+ type = "tuple";
658
+ components = { components: structs[match.type] };
659
+ } else if (dynamicIntegerRegex.test(match.type)) {
660
+ type = `${match.type}256`;
661
+ } else if (match.type === "address payable") {
662
+ type = "address";
663
+ } else {
664
+ type = match.type;
665
+ if (!(options?.type === "struct") && !isSolidityType(type))
666
+ throw new UnknownSolidityTypeError({ type });
667
+ }
668
+ if (match.modifier) {
669
+ if (!options?.modifiers?.has?.(match.modifier))
670
+ throw new InvalidModifierError({
671
+ param,
672
+ type: options?.type,
673
+ modifier: match.modifier
674
+ });
675
+ if (functionModifiers.has(match.modifier) && !isValidDataLocation(type, !!match.array))
676
+ throw new InvalidFunctionModifierError({
677
+ param,
678
+ type: options?.type,
679
+ modifier: match.modifier
680
+ });
681
+ }
682
+ const abiParameter = {
683
+ type: `${type}${match.array ?? ""}`,
684
+ ...name,
685
+ ...indexed,
686
+ ...components
687
+ };
688
+ parameterCache.set(parameterCacheKey, abiParameter);
689
+ return abiParameter;
690
+ }
691
+ function splitParameters(params, result = [], current = "", depth = 0) {
692
+ const length = params.trim().length;
693
+ for (let i = 0; i < length; i++) {
694
+ const char = params[i];
695
+ const tail = params.slice(i + 1);
696
+ switch (char) {
697
+ case ",":
698
+ return depth === 0 ? splitParameters(tail, [...result, current.trim()]) : splitParameters(tail, result, `${current}${char}`, depth);
699
+ case "(":
700
+ return splitParameters(tail, result, `${current}${char}`, depth + 1);
701
+ case ")":
702
+ return splitParameters(tail, result, `${current}${char}`, depth - 1);
703
+ default:
704
+ return splitParameters(tail, result, `${current}${char}`, depth);
705
+ }
706
+ }
707
+ if (current === "")
708
+ return result;
709
+ if (depth !== 0)
710
+ throw new InvalidParenthesisError({ current, depth });
711
+ result.push(current.trim());
712
+ return result;
713
+ }
714
+ function isSolidityType(type) {
715
+ return type === "address" || type === "bool" || type === "function" || type === "string" || bytesRegex.test(type) || integerRegex.test(type);
716
+ }
717
+ 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)$/;
718
+ function isSolidityKeyword(name) {
719
+ return name === "address" || name === "bool" || name === "function" || name === "string" || name === "tuple" || bytesRegex.test(name) || integerRegex.test(name) || protectedKeywordsRegex.test(name);
720
+ }
721
+ function isValidDataLocation(type, isArray) {
722
+ return isArray || type === "bytes" || type === "string" || type === "tuple";
723
+ }
724
+
725
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/runtime/structs.js
726
+ function parseStructs(signatures) {
727
+ const shallowStructs = {};
728
+ const signaturesLength = signatures.length;
729
+ for (let i = 0; i < signaturesLength; i++) {
730
+ const signature = signatures[i];
731
+ if (!isStructSignature(signature))
732
+ continue;
733
+ const match = execStructSignature(signature);
734
+ if (!match)
735
+ throw new InvalidSignatureError({ signature, type: "struct" });
736
+ const properties = match.properties.split(";");
737
+ const components = [];
738
+ const propertiesLength = properties.length;
739
+ for (let k = 0; k < propertiesLength; k++) {
740
+ const property = properties[k];
741
+ const trimmed = property.trim();
742
+ if (!trimmed)
743
+ continue;
744
+ const abiParameter = parseAbiParameter(trimmed, {
745
+ type: "struct"
746
+ });
747
+ components.push(abiParameter);
748
+ }
749
+ if (!components.length)
750
+ throw new InvalidStructSignatureError({ signature });
751
+ shallowStructs[match.name] = components;
752
+ }
753
+ const resolvedStructs = {};
754
+ const entries = Object.entries(shallowStructs);
755
+ const entriesLength = entries.length;
756
+ for (let i = 0; i < entriesLength; i++) {
757
+ const [name, parameters] = entries[i];
758
+ resolvedStructs[name] = resolveStructs(parameters, shallowStructs);
759
+ }
760
+ return resolvedStructs;
761
+ }
762
+ var typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
763
+ function resolveStructs(abiParameters = [], structs = {}, ancestors = /* @__PURE__ */ new Set()) {
764
+ const components = [];
765
+ const length = abiParameters.length;
766
+ for (let i = 0; i < length; i++) {
767
+ const abiParameter = abiParameters[i];
768
+ const isTuple = isTupleRegex.test(abiParameter.type);
769
+ if (isTuple)
770
+ components.push(abiParameter);
771
+ else {
772
+ const match = execTyped(typeWithoutTupleRegex, abiParameter.type);
773
+ if (!match?.type)
774
+ throw new InvalidAbiTypeParameterError({ abiParameter });
775
+ const { array, type } = match;
776
+ if (type in structs) {
777
+ if (ancestors.has(type))
778
+ throw new CircularReferenceError({ type });
779
+ components.push({
780
+ ...abiParameter,
781
+ type: `tuple${array ?? ""}`,
782
+ components: resolveStructs(structs[type], structs, /* @__PURE__ */ new Set([...ancestors, type]))
783
+ });
784
+ } else {
785
+ if (isSolidityType(type))
786
+ components.push(abiParameter);
787
+ else
788
+ throw new UnknownTypeError({ type });
789
+ }
790
+ }
791
+ }
792
+ return components;
793
+ }
794
+
795
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/parseAbi.js
796
+ function parseAbi(signatures) {
797
+ const structs = parseStructs(signatures);
798
+ const abi = [];
799
+ const length = signatures.length;
800
+ for (let i = 0; i < length; i++) {
801
+ const signature = signatures[i];
802
+ if (isStructSignature(signature))
803
+ continue;
804
+ abi.push(parseSignature(signature, structs));
805
+ }
806
+ return abi;
807
+ }
808
+
809
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/parseAbiItem.js
810
+ function parseAbiItem(signature) {
811
+ let abiItem;
812
+ if (typeof signature === "string")
813
+ abiItem = parseSignature(signature);
814
+ else {
815
+ const structs = parseStructs(signature);
816
+ const length = signature.length;
817
+ for (let i = 0; i < length; i++) {
818
+ const signature_ = signature[i];
819
+ if (isStructSignature(signature_))
820
+ continue;
821
+ abiItem = parseSignature(signature_, structs);
822
+ break;
823
+ }
824
+ }
825
+ if (!abiItem)
826
+ throw new InvalidAbiItemError({ signature });
827
+ return abiItem;
828
+ }
829
+
830
+ // node_modules/.pnpm/abitype@1.2.3_typescript@6.0.3_zod@4.4.3/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js
831
+ function parseAbiParameters(params) {
832
+ const abiParameters = [];
833
+ if (typeof params === "string") {
834
+ const parameters = splitParameters(params);
835
+ const length = parameters.length;
836
+ for (let i = 0; i < length; i++) {
837
+ abiParameters.push(parseAbiParameter(parameters[i], { modifiers }));
838
+ }
839
+ } else {
840
+ const structs = parseStructs(params);
841
+ const length = params.length;
842
+ for (let i = 0; i < length; i++) {
843
+ const signature = params[i];
844
+ if (isStructSignature(signature))
845
+ continue;
846
+ const parameters = splitParameters(signature);
847
+ const length2 = parameters.length;
848
+ for (let k = 0; k < length2; k++) {
849
+ abiParameters.push(parseAbiParameter(parameters[k], { modifiers, structs }));
850
+ }
851
+ }
852
+ }
853
+ if (abiParameters.length === 0)
854
+ throw new InvalidAbiParametersError({ params });
855
+ return abiParameters;
856
+ }
857
+
858
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/version.js
859
+ var version2 = "0.1.1";
860
+
861
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/errors.js
862
+ function getVersion() {
863
+ return version2;
864
+ }
865
+
866
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Errors.js
867
+ var BaseError3 = class _BaseError extends Error {
868
+ static setStaticOptions(options) {
869
+ _BaseError.prototype.docsOrigin = options.docsOrigin;
870
+ _BaseError.prototype.showVersion = options.showVersion;
871
+ _BaseError.prototype.version = options.version;
872
+ }
873
+ constructor(shortMessage, options = {}) {
874
+ const details = (() => {
875
+ if (options.cause instanceof _BaseError) {
876
+ if (options.cause.details)
877
+ return options.cause.details;
878
+ if (options.cause.shortMessage)
879
+ return options.cause.shortMessage;
880
+ }
881
+ if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
882
+ return options.cause.details;
883
+ if (options.cause?.message)
884
+ return options.cause.message;
885
+ return options.details;
886
+ })();
887
+ const docsPath6 = (() => {
888
+ if (options.cause instanceof _BaseError)
889
+ return options.cause.docsPath || options.docsPath;
890
+ return options.docsPath;
891
+ })();
892
+ const docsBaseUrl = options.docsOrigin ?? _BaseError.prototype.docsOrigin;
893
+ const docs = `${docsBaseUrl}${docsPath6 ?? ""}`;
894
+ const showVersion = Boolean(options.version ?? _BaseError.prototype.showVersion);
895
+ const version3 = options.version ?? _BaseError.prototype.version;
896
+ const message = [
897
+ shortMessage || "An error occurred.",
898
+ ...options.metaMessages ? ["", ...options.metaMessages] : [],
899
+ ...details || docsPath6 || showVersion ? [
900
+ "",
901
+ details ? `Details: ${details}` : void 0,
902
+ docsPath6 ? `See: ${docs}` : void 0,
903
+ showVersion ? `Version: ${version3}` : void 0
904
+ ] : []
905
+ ].filter((x) => typeof x === "string").join("\n");
906
+ super(message, options.cause ? { cause: options.cause } : void 0);
907
+ Object.defineProperty(this, "details", {
908
+ enumerable: true,
909
+ configurable: true,
910
+ writable: true,
911
+ value: void 0
912
+ });
913
+ Object.defineProperty(this, "docs", {
914
+ enumerable: true,
915
+ configurable: true,
916
+ writable: true,
917
+ value: void 0
918
+ });
919
+ Object.defineProperty(this, "docsOrigin", {
920
+ enumerable: true,
921
+ configurable: true,
922
+ writable: true,
923
+ value: void 0
924
+ });
925
+ Object.defineProperty(this, "docsPath", {
926
+ enumerable: true,
927
+ configurable: true,
928
+ writable: true,
929
+ value: void 0
930
+ });
931
+ Object.defineProperty(this, "shortMessage", {
932
+ enumerable: true,
933
+ configurable: true,
934
+ writable: true,
935
+ value: void 0
936
+ });
937
+ Object.defineProperty(this, "showVersion", {
938
+ enumerable: true,
939
+ configurable: true,
940
+ writable: true,
941
+ value: void 0
942
+ });
943
+ Object.defineProperty(this, "version", {
944
+ enumerable: true,
945
+ configurable: true,
946
+ writable: true,
947
+ value: void 0
948
+ });
949
+ Object.defineProperty(this, "cause", {
950
+ enumerable: true,
951
+ configurable: true,
952
+ writable: true,
953
+ value: void 0
954
+ });
955
+ Object.defineProperty(this, "name", {
956
+ enumerable: true,
957
+ configurable: true,
958
+ writable: true,
959
+ value: "BaseError"
960
+ });
961
+ this.cause = options.cause;
962
+ this.details = details;
963
+ this.docs = docs;
964
+ this.docsOrigin = docsBaseUrl;
965
+ this.docsPath = docsPath6;
966
+ this.shortMessage = shortMessage;
967
+ this.showVersion = showVersion;
968
+ this.version = version3;
969
+ }
970
+ walk(fn) {
971
+ return walk(this, fn);
972
+ }
973
+ };
974
+ Object.defineProperty(BaseError3, "defaultStaticOptions", {
975
+ enumerable: true,
976
+ configurable: true,
977
+ writable: true,
978
+ value: {
979
+ docsOrigin: "https://oxlib.sh",
980
+ showVersion: false,
981
+ version: `ox@${getVersion()}`
982
+ }
983
+ });
984
+ (() => {
985
+ BaseError3.setStaticOptions(BaseError3.defaultStaticOptions);
986
+ })();
987
+ function walk(err, fn) {
988
+ if (fn?.(err))
989
+ return err;
990
+ if (err && typeof err === "object" && "cause" in err && err.cause)
991
+ return walk(err.cause, fn);
992
+ return fn ? null : err;
993
+ }
994
+
995
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/bytes.js
996
+ function assertSize2(bytes, size_) {
997
+ if (size2(bytes) > size_)
998
+ throw new SizeOverflowError({
999
+ givenSize: size2(bytes),
1000
+ maxSize: size_
1001
+ });
1002
+ }
1003
+ function assertStartOffset(value, start) {
1004
+ if (typeof start === "number" && start > 0 && start > size2(value) - 1)
1005
+ throw new SliceOffsetOutOfBoundsError({
1006
+ offset: start,
1007
+ position: "start",
1008
+ size: size2(value)
1009
+ });
1010
+ }
1011
+ function assertEndOffset(value, start, end) {
1012
+ if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
1013
+ throw new SliceOffsetOutOfBoundsError({
1014
+ offset: end,
1015
+ position: "end",
1016
+ size: size2(value)
1017
+ });
1018
+ }
1019
+ }
1020
+ var charCodeMap = {
1021
+ zero: 48,
1022
+ nine: 57,
1023
+ A: 65,
1024
+ F: 70,
1025
+ a: 97,
1026
+ f: 102
1027
+ };
1028
+ function charCodeToBase16(char) {
1029
+ if (char >= charCodeMap.zero && char <= charCodeMap.nine)
1030
+ return char - charCodeMap.zero;
1031
+ if (char >= charCodeMap.A && char <= charCodeMap.F)
1032
+ return char - (charCodeMap.A - 10);
1033
+ if (char >= charCodeMap.a && char <= charCodeMap.f)
1034
+ return char - (charCodeMap.a - 10);
1035
+ return void 0;
1036
+ }
1037
+ function pad(bytes, options = {}) {
1038
+ const { dir, size: size4 = 32 } = options;
1039
+ if (size4 === 0)
1040
+ return bytes;
1041
+ if (bytes.length > size4)
1042
+ throw new SizeExceedsPaddingSizeError({
1043
+ size: bytes.length,
1044
+ targetSize: size4,
1045
+ type: "Bytes"
1046
+ });
1047
+ const paddedBytes = new Uint8Array(size4);
1048
+ for (let i = 0; i < size4; i++) {
1049
+ const padEnd = dir === "right";
1050
+ paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
1051
+ }
1052
+ return paddedBytes;
1053
+ }
1054
+ function trim2(value, options = {}) {
1055
+ const { dir = "left" } = options;
1056
+ let data = value;
1057
+ let sliceLength = 0;
1058
+ for (let i = 0; i < data.length - 1; i++) {
1059
+ if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
1060
+ sliceLength++;
1061
+ else
1062
+ break;
1063
+ }
1064
+ data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
1065
+ return data;
1066
+ }
1067
+
1068
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/hex.js
1069
+ function assertSize3(hex, size_) {
1070
+ if (size3(hex) > size_)
1071
+ throw new SizeOverflowError2({
1072
+ givenSize: size3(hex),
1073
+ maxSize: size_
1074
+ });
1075
+ }
1076
+ function assertStartOffset2(value, start) {
1077
+ if (typeof start === "number" && start > 0 && start > size3(value) - 1)
1078
+ throw new SliceOffsetOutOfBoundsError2({
1079
+ offset: start,
1080
+ position: "start",
1081
+ size: size3(value)
1082
+ });
1083
+ }
1084
+ function assertEndOffset2(value, start, end) {
1085
+ if (typeof start === "number" && typeof end === "number" && size3(value) !== end - start) {
1086
+ throw new SliceOffsetOutOfBoundsError2({
1087
+ offset: end,
1088
+ position: "end",
1089
+ size: size3(value)
1090
+ });
1091
+ }
1092
+ }
1093
+ function pad2(hex_, options = {}) {
1094
+ const { dir, size: size4 = 32 } = options;
1095
+ if (size4 === 0)
1096
+ return hex_;
1097
+ const hex = hex_.replace("0x", "");
1098
+ if (hex.length > size4 * 2)
1099
+ throw new SizeExceedsPaddingSizeError2({
1100
+ size: Math.ceil(hex.length / 2),
1101
+ targetSize: size4,
1102
+ type: "Hex"
1103
+ });
1104
+ return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
1105
+ }
1106
+ function trim3(value, options = {}) {
1107
+ const { dir = "left" } = options;
1108
+ let data = value.replace("0x", "");
1109
+ let sliceLength = 0;
1110
+ for (let i = 0; i < data.length - 1; i++) {
1111
+ if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
1112
+ sliceLength++;
1113
+ else
1114
+ break;
1115
+ }
1116
+ data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
1117
+ if (data === "0")
1118
+ return "0x";
1119
+ if (dir === "right" && data.length % 2 === 1)
1120
+ return `0x${data}0`;
1121
+ return `0x${data}`;
1122
+ }
1123
+
1124
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Json.js
1125
+ var bigIntSuffix = "#__bigint";
1126
+ function stringify2(value, replacer, space) {
1127
+ return JSON.stringify(value, (key, value2) => {
1128
+ if (typeof replacer === "function")
1129
+ return replacer(key, value2);
1130
+ if (typeof value2 === "bigint")
1131
+ return value2.toString() + bigIntSuffix;
1132
+ return value2;
1133
+ }, space);
1134
+ }
1135
+
1136
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Bytes.js
1137
+ var decoder = /* @__PURE__ */ new TextDecoder();
1138
+ var encoder = /* @__PURE__ */ new TextEncoder();
1139
+ function assert(value) {
1140
+ if (value instanceof Uint8Array)
1141
+ return;
1142
+ if (!value)
1143
+ throw new InvalidBytesTypeError(value);
1144
+ if (typeof value !== "object")
1145
+ throw new InvalidBytesTypeError(value);
1146
+ if (!("BYTES_PER_ELEMENT" in value))
1147
+ throw new InvalidBytesTypeError(value);
1148
+ if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
1149
+ throw new InvalidBytesTypeError(value);
1150
+ }
1151
+ function from(value) {
1152
+ if (value instanceof Uint8Array)
1153
+ return value;
1154
+ if (typeof value === "string")
1155
+ return fromHex(value);
1156
+ return fromArray(value);
1157
+ }
1158
+ function fromArray(value) {
1159
+ return value instanceof Uint8Array ? value : new Uint8Array(value);
1160
+ }
1161
+ function fromHex(value, options = {}) {
1162
+ const { size: size4 } = options;
1163
+ let hex = value;
1164
+ if (size4) {
1165
+ assertSize3(value, size4);
1166
+ hex = padRight(value, size4);
1167
+ }
1168
+ let hexString = hex.slice(2);
1169
+ if (hexString.length % 2)
1170
+ hexString = `0${hexString}`;
1171
+ const length = hexString.length / 2;
1172
+ const bytes = new Uint8Array(length);
1173
+ for (let index = 0, j = 0; index < length; index++) {
1174
+ const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
1175
+ const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
1176
+ if (nibbleLeft === void 0 || nibbleRight === void 0) {
1177
+ throw new BaseError3(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
1178
+ }
1179
+ bytes[index] = nibbleLeft << 4 | nibbleRight;
1180
+ }
1181
+ return bytes;
1182
+ }
1183
+ function fromString(value, options = {}) {
1184
+ const { size: size4 } = options;
1185
+ const bytes = encoder.encode(value);
1186
+ if (typeof size4 === "number") {
1187
+ assertSize2(bytes, size4);
1188
+ return padRight2(bytes, size4);
1189
+ }
1190
+ return bytes;
1191
+ }
1192
+ function padRight2(value, size4) {
1193
+ return pad(value, { dir: "right", size: size4 });
1194
+ }
1195
+ function size2(value) {
1196
+ return value.length;
1197
+ }
1198
+ function slice2(value, start, end, options = {}) {
1199
+ const { strict } = options;
1200
+ assertStartOffset(value, start);
1201
+ const value_ = value.slice(start, end);
1202
+ if (strict)
1203
+ assertEndOffset(value_, start, end);
1204
+ return value_;
1205
+ }
1206
+ function toBigInt2(bytes, options = {}) {
1207
+ const { size: size4 } = options;
1208
+ if (typeof size4 !== "undefined")
1209
+ assertSize2(bytes, size4);
1210
+ const hex = fromBytes(bytes, options);
1211
+ return toBigInt(hex, options);
1212
+ }
1213
+ function toBoolean(bytes, options = {}) {
1214
+ const { size: size4 } = options;
1215
+ let bytes_ = bytes;
1216
+ if (typeof size4 !== "undefined") {
1217
+ assertSize2(bytes_, size4);
1218
+ bytes_ = trimLeft(bytes_);
1219
+ }
1220
+ if (bytes_.length > 1 || bytes_[0] > 1)
1221
+ throw new InvalidBytesBooleanError2(bytes_);
1222
+ return Boolean(bytes_[0]);
1223
+ }
1224
+ function toNumber2(bytes, options = {}) {
1225
+ const { size: size4 } = options;
1226
+ if (typeof size4 !== "undefined")
1227
+ assertSize2(bytes, size4);
1228
+ const hex = fromBytes(bytes, options);
1229
+ return toNumber(hex, options);
1230
+ }
1231
+ function toString(bytes, options = {}) {
1232
+ const { size: size4 } = options;
1233
+ let bytes_ = bytes;
1234
+ if (typeof size4 !== "undefined") {
1235
+ assertSize2(bytes_, size4);
1236
+ bytes_ = trimRight(bytes_);
1237
+ }
1238
+ return decoder.decode(bytes_);
1239
+ }
1240
+ function trimLeft(value) {
1241
+ return trim2(value, { dir: "left" });
1242
+ }
1243
+ function trimRight(value) {
1244
+ return trim2(value, { dir: "right" });
1245
+ }
1246
+ function validate(value) {
1247
+ try {
1248
+ assert(value);
1249
+ return true;
1250
+ } catch {
1251
+ return false;
1252
+ }
1253
+ }
1254
+ var InvalidBytesBooleanError2 = class extends BaseError3 {
1255
+ constructor(bytes) {
1256
+ super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
1257
+ metaMessages: [
1258
+ "The bytes array must contain a single byte of either a `0` or `1` value."
1259
+ ]
1260
+ });
1261
+ Object.defineProperty(this, "name", {
1262
+ enumerable: true,
1263
+ configurable: true,
1264
+ writable: true,
1265
+ value: "Bytes.InvalidBytesBooleanError"
1266
+ });
1267
+ }
1268
+ };
1269
+ var InvalidBytesTypeError = class extends BaseError3 {
1270
+ constructor(value) {
1271
+ super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
1272
+ metaMessages: ["Bytes values must be of type `Bytes`."]
1273
+ });
1274
+ Object.defineProperty(this, "name", {
1275
+ enumerable: true,
1276
+ configurable: true,
1277
+ writable: true,
1278
+ value: "Bytes.InvalidBytesTypeError"
1279
+ });
1280
+ }
1281
+ };
1282
+ var SizeOverflowError = class extends BaseError3 {
1283
+ constructor({ givenSize, maxSize }) {
1284
+ super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
1285
+ Object.defineProperty(this, "name", {
1286
+ enumerable: true,
1287
+ configurable: true,
1288
+ writable: true,
1289
+ value: "Bytes.SizeOverflowError"
1290
+ });
1291
+ }
1292
+ };
1293
+ var SliceOffsetOutOfBoundsError = class extends BaseError3 {
1294
+ constructor({ offset, position, size: size4 }) {
1295
+ super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
1296
+ Object.defineProperty(this, "name", {
1297
+ enumerable: true,
1298
+ configurable: true,
1299
+ writable: true,
1300
+ value: "Bytes.SliceOffsetOutOfBoundsError"
1301
+ });
1302
+ }
1303
+ };
1304
+ var SizeExceedsPaddingSizeError = class extends BaseError3 {
1305
+ constructor({ size: size4, targetSize, type }) {
1306
+ super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
1307
+ Object.defineProperty(this, "name", {
1308
+ enumerable: true,
1309
+ configurable: true,
1310
+ writable: true,
1311
+ value: "Bytes.SizeExceedsPaddingSizeError"
1312
+ });
1313
+ }
1314
+ };
1315
+
1316
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Hex.js
1317
+ var encoder2 = /* @__PURE__ */ new TextEncoder();
1318
+ var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
1319
+ function assert2(value, options = {}) {
1320
+ const { strict = false } = options;
1321
+ if (!value)
1322
+ throw new InvalidHexTypeError(value);
1323
+ if (typeof value !== "string")
1324
+ throw new InvalidHexTypeError(value);
1325
+ if (strict) {
1326
+ if (!/^0x[0-9a-fA-F]*$/.test(value))
1327
+ throw new InvalidHexValueError(value);
1328
+ }
1329
+ if (!value.startsWith("0x"))
1330
+ throw new InvalidHexValueError(value);
1331
+ }
1332
+ function concat2(...values) {
1333
+ return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
1334
+ }
1335
+ function from2(value) {
1336
+ if (value instanceof Uint8Array)
1337
+ return fromBytes(value);
1338
+ if (Array.isArray(value))
1339
+ return fromBytes(new Uint8Array(value));
1340
+ return value;
1341
+ }
1342
+ function fromBoolean(value, options = {}) {
1343
+ const hex = `0x${Number(value)}`;
1344
+ if (typeof options.size === "number") {
1345
+ assertSize3(hex, options.size);
1346
+ return padLeft(hex, options.size);
1347
+ }
1348
+ return hex;
1349
+ }
1350
+ function fromBytes(value, options = {}) {
1351
+ let string = "";
1352
+ for (let i = 0; i < value.length; i++)
1353
+ string += hexes[value[i]];
1354
+ const hex = `0x${string}`;
1355
+ if (typeof options.size === "number") {
1356
+ assertSize3(hex, options.size);
1357
+ return padRight(hex, options.size);
1358
+ }
1359
+ return hex;
1360
+ }
1361
+ function fromNumber(value, options = {}) {
1362
+ const { signed, size: size4 } = options;
1363
+ const value_ = BigInt(value);
1364
+ let maxValue;
1365
+ if (size4) {
1366
+ if (signed)
1367
+ maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
1368
+ else
1369
+ maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
1370
+ } else if (typeof value === "number") {
1371
+ maxValue = BigInt(Number.MAX_SAFE_INTEGER);
1372
+ }
1373
+ const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
1374
+ if (maxValue && value_ > maxValue || value_ < minValue) {
1375
+ const suffix = typeof value === "bigint" ? "n" : "";
1376
+ throw new IntegerOutOfRangeError({
1377
+ max: maxValue ? `${maxValue}${suffix}` : void 0,
1378
+ min: `${minValue}${suffix}`,
1379
+ signed,
1380
+ size: size4,
1381
+ value: `${value}${suffix}`
1382
+ });
1383
+ }
1384
+ const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size4 * 8, BigInt(value_)) : value_).toString(16);
1385
+ const hex = `0x${stringValue}`;
1386
+ if (size4)
1387
+ return padLeft(hex, size4);
1388
+ return hex;
1389
+ }
1390
+ function fromString2(value, options = {}) {
1391
+ return fromBytes(encoder2.encode(value), options);
1392
+ }
1393
+ function padLeft(value, size4) {
1394
+ return pad2(value, { dir: "left", size: size4 });
1395
+ }
1396
+ function padRight(value, size4) {
1397
+ return pad2(value, { dir: "right", size: size4 });
1398
+ }
1399
+ function slice3(value, start, end, options = {}) {
1400
+ const { strict } = options;
1401
+ assertStartOffset2(value, start);
1402
+ const value_ = `0x${value.replace("0x", "").slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
1403
+ if (strict)
1404
+ assertEndOffset2(value_, start, end);
1405
+ return value_;
1406
+ }
1407
+ function size3(value) {
1408
+ return Math.ceil((value.length - 2) / 2);
1409
+ }
1410
+ function trimLeft2(value) {
1411
+ return trim3(value, { dir: "left" });
1412
+ }
1413
+ function toBigInt(hex, options = {}) {
1414
+ const { signed } = options;
1415
+ if (options.size)
1416
+ assertSize3(hex, options.size);
1417
+ const value = BigInt(hex);
1418
+ if (!signed)
1419
+ return value;
1420
+ const size4 = (hex.length - 2) / 2;
1421
+ const max_unsigned = (1n << BigInt(size4) * 8n) - 1n;
1422
+ const max_signed = max_unsigned >> 1n;
1423
+ if (value <= max_signed)
1424
+ return value;
1425
+ return value - max_unsigned - 1n;
1426
+ }
1427
+ function toNumber(hex, options = {}) {
1428
+ const { signed, size: size4 } = options;
1429
+ if (!signed && !size4)
1430
+ return Number(hex);
1431
+ return Number(toBigInt(hex, options));
1432
+ }
1433
+ function validate2(value, options = {}) {
1434
+ const { strict = false } = options;
1435
+ try {
1436
+ assert2(value, { strict });
1437
+ return true;
1438
+ } catch {
1439
+ return false;
1440
+ }
1441
+ }
1442
+ var IntegerOutOfRangeError = class extends BaseError3 {
1443
+ constructor({ max, min, signed, size: size4, value }) {
1444
+ super(`Number \`${value}\` is not in safe${size4 ? ` ${size4 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
1445
+ Object.defineProperty(this, "name", {
1446
+ enumerable: true,
1447
+ configurable: true,
1448
+ writable: true,
1449
+ value: "Hex.IntegerOutOfRangeError"
1450
+ });
1451
+ }
1452
+ };
1453
+ var InvalidHexTypeError = class extends BaseError3 {
1454
+ constructor(value) {
1455
+ super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
1456
+ metaMessages: ['Hex types must be represented as `"0x${string}"`.']
1457
+ });
1458
+ Object.defineProperty(this, "name", {
1459
+ enumerable: true,
1460
+ configurable: true,
1461
+ writable: true,
1462
+ value: "Hex.InvalidHexTypeError"
1463
+ });
1464
+ }
1465
+ };
1466
+ var InvalidHexValueError = class extends BaseError3 {
1467
+ constructor(value) {
1468
+ super(`Value \`${value}\` is an invalid hex value.`, {
1469
+ metaMessages: [
1470
+ 'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
1471
+ ]
1472
+ });
1473
+ Object.defineProperty(this, "name", {
1474
+ enumerable: true,
1475
+ configurable: true,
1476
+ writable: true,
1477
+ value: "Hex.InvalidHexValueError"
1478
+ });
1479
+ }
1480
+ };
1481
+ var SizeOverflowError2 = class extends BaseError3 {
1482
+ constructor({ givenSize, maxSize }) {
1483
+ super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
1484
+ Object.defineProperty(this, "name", {
1485
+ enumerable: true,
1486
+ configurable: true,
1487
+ writable: true,
1488
+ value: "Hex.SizeOverflowError"
1489
+ });
1490
+ }
1491
+ };
1492
+ var SliceOffsetOutOfBoundsError2 = class extends BaseError3 {
1493
+ constructor({ offset, position, size: size4 }) {
1494
+ super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
1495
+ Object.defineProperty(this, "name", {
1496
+ enumerable: true,
1497
+ configurable: true,
1498
+ writable: true,
1499
+ value: "Hex.SliceOffsetOutOfBoundsError"
1500
+ });
1501
+ }
1502
+ };
1503
+ var SizeExceedsPaddingSizeError2 = class extends BaseError3 {
1504
+ constructor({ size: size4, targetSize, type }) {
1505
+ super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
1506
+ Object.defineProperty(this, "name", {
1507
+ enumerable: true,
1508
+ configurable: true,
1509
+ writable: true,
1510
+ value: "Hex.SizeExceedsPaddingSizeError"
1511
+ });
1512
+ }
1513
+ };
1514
+
1515
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Withdrawal.js
1516
+ function toRpc(withdrawal) {
1517
+ return {
1518
+ address: withdrawal.address,
1519
+ amount: fromNumber(withdrawal.amount),
1520
+ index: fromNumber(withdrawal.index),
1521
+ validatorIndex: fromNumber(withdrawal.validatorIndex)
1522
+ };
1523
+ }
1524
+
1525
+ // node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/BlockOverrides.js
1526
+ function toRpc2(blockOverrides) {
1527
+ return {
1528
+ ...typeof blockOverrides.baseFeePerGas === "bigint" && {
1529
+ baseFeePerGas: fromNumber(blockOverrides.baseFeePerGas)
1530
+ },
1531
+ ...typeof blockOverrides.blobBaseFee === "bigint" && {
1532
+ blobBaseFee: fromNumber(blockOverrides.blobBaseFee)
1533
+ },
1534
+ ...typeof blockOverrides.feeRecipient === "string" && {
1535
+ feeRecipient: blockOverrides.feeRecipient
1536
+ },
1537
+ ...typeof blockOverrides.gasLimit === "bigint" && {
1538
+ gasLimit: fromNumber(blockOverrides.gasLimit)
1539
+ },
1540
+ ...typeof blockOverrides.number === "bigint" && {
1541
+ number: fromNumber(blockOverrides.number)
1542
+ },
1543
+ ...typeof blockOverrides.prevRandao === "bigint" && {
1544
+ prevRandao: fromNumber(blockOverrides.prevRandao)
1545
+ },
1546
+ ...typeof blockOverrides.time === "bigint" && {
1547
+ time: fromNumber(blockOverrides.time)
1548
+ },
1549
+ ...blockOverrides.withdrawals && {
1550
+ withdrawals: blockOverrides.withdrawals.map(toRpc)
1551
+ }
1552
+ };
1553
+ }
1554
+
1555
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/abis.js
1556
+ var multicall3Abi = [
1557
+ {
1558
+ inputs: [
1559
+ {
1560
+ components: [
1561
+ {
1562
+ name: "target",
1563
+ type: "address"
1564
+ },
1565
+ {
1566
+ name: "allowFailure",
1567
+ type: "bool"
1568
+ },
1569
+ {
1570
+ name: "callData",
1571
+ type: "bytes"
1572
+ }
1573
+ ],
1574
+ name: "calls",
1575
+ type: "tuple[]"
1576
+ }
1577
+ ],
1578
+ name: "aggregate3",
1579
+ outputs: [
1580
+ {
1581
+ components: [
1582
+ {
1583
+ name: "success",
1584
+ type: "bool"
1585
+ },
1586
+ {
1587
+ name: "returnData",
1588
+ type: "bytes"
1589
+ }
1590
+ ],
1591
+ name: "returnData",
1592
+ type: "tuple[]"
1593
+ }
1594
+ ],
1595
+ stateMutability: "view",
1596
+ type: "function"
1597
+ },
1598
+ {
1599
+ inputs: [
1600
+ {
1601
+ name: "addr",
1602
+ type: "address"
1603
+ }
1604
+ ],
1605
+ name: "getEthBalance",
1606
+ outputs: [
1607
+ {
1608
+ name: "balance",
1609
+ type: "uint256"
1610
+ }
1611
+ ],
1612
+ stateMutability: "view",
1613
+ type: "function"
1614
+ },
1615
+ {
1616
+ inputs: [],
1617
+ name: "getCurrentBlockTimestamp",
1618
+ outputs: [
1619
+ {
1620
+ internalType: "uint256",
1621
+ name: "timestamp",
1622
+ type: "uint256"
1623
+ }
1624
+ ],
1625
+ stateMutability: "view",
1626
+ type: "function"
1627
+ }
1628
+ ];
1629
+ var batchGatewayAbi = [
1630
+ {
1631
+ name: "query",
1632
+ type: "function",
1633
+ stateMutability: "view",
1634
+ inputs: [
1635
+ {
1636
+ type: "tuple[]",
1637
+ name: "queries",
1638
+ components: [
1639
+ {
1640
+ type: "address",
1641
+ name: "sender"
1642
+ },
1643
+ {
1644
+ type: "string[]",
1645
+ name: "urls"
1646
+ },
1647
+ {
1648
+ type: "bytes",
1649
+ name: "data"
1650
+ }
1651
+ ]
1652
+ }
1653
+ ],
1654
+ outputs: [
1655
+ {
1656
+ type: "bool[]",
1657
+ name: "failures"
1658
+ },
1659
+ {
1660
+ type: "bytes[]",
1661
+ name: "responses"
1662
+ }
1663
+ ]
1664
+ },
1665
+ {
1666
+ name: "HttpError",
1667
+ type: "error",
1668
+ inputs: [
1669
+ {
1670
+ type: "uint16",
1671
+ name: "status"
1672
+ },
1673
+ {
1674
+ type: "string",
1675
+ name: "message"
1676
+ }
1677
+ ]
1678
+ }
1679
+ ];
1680
+ var universalResolverErrors = [
1681
+ {
1682
+ inputs: [
1683
+ {
1684
+ name: "dns",
1685
+ type: "bytes"
1686
+ }
1687
+ ],
1688
+ name: "DNSDecodingFailed",
1689
+ type: "error"
1690
+ },
1691
+ {
1692
+ inputs: [
1693
+ {
1694
+ name: "ens",
1695
+ type: "string"
1696
+ }
1697
+ ],
1698
+ name: "DNSEncodingFailed",
1699
+ type: "error"
1700
+ },
1701
+ {
1702
+ inputs: [],
1703
+ name: "EmptyAddress",
1704
+ type: "error"
1705
+ },
1706
+ {
1707
+ inputs: [
1708
+ {
1709
+ name: "status",
1710
+ type: "uint16"
1711
+ },
1712
+ {
1713
+ name: "message",
1714
+ type: "string"
1715
+ }
1716
+ ],
1717
+ name: "HttpError",
1718
+ type: "error"
1719
+ },
1720
+ {
1721
+ inputs: [],
1722
+ name: "InvalidBatchGatewayResponse",
1723
+ type: "error"
1724
+ },
1725
+ {
1726
+ inputs: [
1727
+ {
1728
+ name: "errorData",
1729
+ type: "bytes"
1730
+ }
1731
+ ],
1732
+ name: "ResolverError",
1733
+ type: "error"
1734
+ },
1735
+ {
1736
+ inputs: [
1737
+ {
1738
+ name: "name",
1739
+ type: "bytes"
1740
+ },
1741
+ {
1742
+ name: "resolver",
1743
+ type: "address"
1744
+ }
1745
+ ],
1746
+ name: "ResolverNotContract",
1747
+ type: "error"
1748
+ },
1749
+ {
1750
+ inputs: [
1751
+ {
1752
+ name: "name",
1753
+ type: "bytes"
1754
+ }
1755
+ ],
1756
+ name: "ResolverNotFound",
1757
+ type: "error"
1758
+ },
1759
+ {
1760
+ inputs: [
1761
+ {
1762
+ name: "primary",
1763
+ type: "string"
1764
+ },
1765
+ {
1766
+ name: "primaryAddress",
1767
+ type: "bytes"
1768
+ }
1769
+ ],
1770
+ name: "ReverseAddressMismatch",
1771
+ type: "error"
1772
+ },
1773
+ {
1774
+ inputs: [
1775
+ {
1776
+ internalType: "bytes4",
1777
+ name: "selector",
1778
+ type: "bytes4"
1779
+ }
1780
+ ],
1781
+ name: "UnsupportedResolverProfile",
1782
+ type: "error"
1783
+ }
1784
+ ];
1785
+ var universalResolverResolveAbi = [
1786
+ ...universalResolverErrors,
1787
+ {
1788
+ name: "resolveWithGateways",
1789
+ type: "function",
1790
+ stateMutability: "view",
1791
+ inputs: [
1792
+ { name: "name", type: "bytes" },
1793
+ { name: "data", type: "bytes" },
1794
+ { name: "gateways", type: "string[]" }
1795
+ ],
1796
+ outputs: [
1797
+ { name: "", type: "bytes" },
1798
+ { name: "address", type: "address" }
1799
+ ]
1800
+ }
1801
+ ];
1802
+ var universalResolverReverseAbi = [
1803
+ ...universalResolverErrors,
1804
+ {
1805
+ name: "reverseWithGateways",
1806
+ type: "function",
1807
+ stateMutability: "view",
1808
+ inputs: [
1809
+ { type: "bytes", name: "reverseName" },
1810
+ { type: "uint256", name: "coinType" },
1811
+ { type: "string[]", name: "gateways" }
1812
+ ],
1813
+ outputs: [
1814
+ { type: "string", name: "resolvedName" },
1815
+ { type: "address", name: "resolver" },
1816
+ { type: "address", name: "reverseResolver" }
1817
+ ]
1818
+ }
1819
+ ];
1820
+ var textResolverAbi = [
1821
+ {
1822
+ name: "text",
1823
+ type: "function",
1824
+ stateMutability: "view",
1825
+ inputs: [
1826
+ { name: "name", type: "bytes32" },
1827
+ { name: "key", type: "string" }
1828
+ ],
1829
+ outputs: [{ name: "", type: "string" }]
1830
+ }
1831
+ ];
1832
+ var addressResolverAbi = [
1833
+ {
1834
+ name: "addr",
1835
+ type: "function",
1836
+ stateMutability: "view",
1837
+ inputs: [{ name: "name", type: "bytes32" }],
1838
+ outputs: [{ name: "", type: "address" }]
1839
+ },
1840
+ {
1841
+ name: "addr",
1842
+ type: "function",
1843
+ stateMutability: "view",
1844
+ inputs: [
1845
+ { name: "name", type: "bytes32" },
1846
+ { name: "coinType", type: "uint256" }
1847
+ ],
1848
+ outputs: [{ name: "", type: "bytes" }]
1849
+ }
1850
+ ];
1851
+ var erc1271Abi = [
1852
+ {
1853
+ name: "isValidSignature",
1854
+ type: "function",
1855
+ stateMutability: "view",
1856
+ inputs: [
1857
+ { name: "hash", type: "bytes32" },
1858
+ { name: "signature", type: "bytes" }
1859
+ ],
1860
+ outputs: [{ name: "", type: "bytes4" }]
1861
+ }
1862
+ ];
1863
+ var erc6492SignatureValidatorAbi = [
1864
+ {
1865
+ inputs: [
1866
+ {
1867
+ name: "_signer",
1868
+ type: "address"
1869
+ },
1870
+ {
1871
+ name: "_hash",
1872
+ type: "bytes32"
1873
+ },
1874
+ {
1875
+ name: "_signature",
1876
+ type: "bytes"
1877
+ }
1878
+ ],
1879
+ stateMutability: "nonpayable",
1880
+ type: "constructor"
1881
+ },
1882
+ {
1883
+ inputs: [
1884
+ {
1885
+ name: "_signer",
1886
+ type: "address"
1887
+ },
1888
+ {
1889
+ name: "_hash",
1890
+ type: "bytes32"
1891
+ },
1892
+ {
1893
+ name: "_signature",
1894
+ type: "bytes"
1895
+ }
1896
+ ],
1897
+ outputs: [
1898
+ {
1899
+ type: "bool"
1900
+ }
1901
+ ],
1902
+ stateMutability: "nonpayable",
1903
+ type: "function",
1904
+ name: "isValidSig"
1905
+ }
1906
+ ];
1907
+ var erc20Abi = [
1908
+ {
1909
+ type: "event",
1910
+ name: "Approval",
1911
+ inputs: [
1912
+ {
1913
+ indexed: true,
1914
+ name: "owner",
1915
+ type: "address"
1916
+ },
1917
+ {
1918
+ indexed: true,
1919
+ name: "spender",
1920
+ type: "address"
1921
+ },
1922
+ {
1923
+ indexed: false,
1924
+ name: "value",
1925
+ type: "uint256"
1926
+ }
1927
+ ]
1928
+ },
1929
+ {
1930
+ type: "event",
1931
+ name: "Transfer",
1932
+ inputs: [
1933
+ {
1934
+ indexed: true,
1935
+ name: "from",
1936
+ type: "address"
1937
+ },
1938
+ {
1939
+ indexed: true,
1940
+ name: "to",
1941
+ type: "address"
1942
+ },
1943
+ {
1944
+ indexed: false,
1945
+ name: "value",
1946
+ type: "uint256"
1947
+ }
1948
+ ]
1949
+ },
1950
+ {
1951
+ type: "function",
1952
+ name: "allowance",
1953
+ stateMutability: "view",
1954
+ inputs: [
1955
+ {
1956
+ name: "owner",
1957
+ type: "address"
1958
+ },
1959
+ {
1960
+ name: "spender",
1961
+ type: "address"
1962
+ }
1963
+ ],
1964
+ outputs: [
1965
+ {
1966
+ type: "uint256"
1967
+ }
1968
+ ]
1969
+ },
1970
+ {
1971
+ type: "function",
1972
+ name: "approve",
1973
+ stateMutability: "nonpayable",
1974
+ inputs: [
1975
+ {
1976
+ name: "spender",
1977
+ type: "address"
1978
+ },
1979
+ {
1980
+ name: "amount",
1981
+ type: "uint256"
1982
+ }
1983
+ ],
1984
+ outputs: [
1985
+ {
1986
+ type: "bool"
1987
+ }
1988
+ ]
1989
+ },
1990
+ {
1991
+ type: "function",
1992
+ name: "balanceOf",
1993
+ stateMutability: "view",
1994
+ inputs: [
1995
+ {
1996
+ name: "account",
1997
+ type: "address"
1998
+ }
1999
+ ],
2000
+ outputs: [
2001
+ {
2002
+ type: "uint256"
2003
+ }
2004
+ ]
2005
+ },
2006
+ {
2007
+ type: "function",
2008
+ name: "decimals",
2009
+ stateMutability: "view",
2010
+ inputs: [],
2011
+ outputs: [
2012
+ {
2013
+ type: "uint8"
2014
+ }
2015
+ ]
2016
+ },
2017
+ {
2018
+ type: "function",
2019
+ name: "name",
2020
+ stateMutability: "view",
2021
+ inputs: [],
2022
+ outputs: [
2023
+ {
2024
+ type: "string"
2025
+ }
2026
+ ]
2027
+ },
2028
+ {
2029
+ type: "function",
2030
+ name: "symbol",
2031
+ stateMutability: "view",
2032
+ inputs: [],
2033
+ outputs: [
2034
+ {
2035
+ type: "string"
2036
+ }
2037
+ ]
2038
+ },
2039
+ {
2040
+ type: "function",
2041
+ name: "totalSupply",
2042
+ stateMutability: "view",
2043
+ inputs: [],
2044
+ outputs: [
2045
+ {
2046
+ type: "uint256"
2047
+ }
2048
+ ]
2049
+ },
2050
+ {
2051
+ type: "function",
2052
+ name: "transfer",
2053
+ stateMutability: "nonpayable",
2054
+ inputs: [
2055
+ {
2056
+ name: "recipient",
2057
+ type: "address"
2058
+ },
2059
+ {
2060
+ name: "amount",
2061
+ type: "uint256"
2062
+ }
2063
+ ],
2064
+ outputs: [
2065
+ {
2066
+ type: "bool"
2067
+ }
2068
+ ]
2069
+ },
2070
+ {
2071
+ type: "function",
2072
+ name: "transferFrom",
2073
+ stateMutability: "nonpayable",
2074
+ inputs: [
2075
+ {
2076
+ name: "sender",
2077
+ type: "address"
2078
+ },
2079
+ {
2080
+ name: "recipient",
2081
+ type: "address"
2082
+ },
2083
+ {
2084
+ name: "amount",
2085
+ type: "uint256"
2086
+ }
2087
+ ],
2088
+ outputs: [
2089
+ {
2090
+ type: "bool"
2091
+ }
2092
+ ]
2093
+ }
2094
+ ];
2095
+
2096
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/contract.js
2097
+ var aggregate3Signature = "0x82ad56cb";
2098
+
2099
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/contracts.js
2100
+ var deploylessCallViaBytecodeBytecode = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";
2101
+ var deploylessCallViaFactoryBytecode = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
2102
+ var erc6492SignatureValidatorByteCode = "0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
2103
+ var multicall3Bytecode = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";
2104
+
2105
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/solidity.js
2106
+ var panicReasons = {
2107
+ 1: "An `assert` condition failed.",
2108
+ 17: "Arithmetic operation resulted in underflow or overflow.",
2109
+ 18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
2110
+ 33: "Attempted to convert to an invalid type.",
2111
+ 34: "Attempted to access a storage byte array that is incorrectly encoded.",
2112
+ 49: "Performed `.pop()` on an empty array",
2113
+ 50: "Array index is out of bounds.",
2114
+ 65: "Allocated too much memory or created an array which is too large.",
2115
+ 81: "Attempted to call a zero-initialized variable of internal function type."
2116
+ };
2117
+ var solidityError = {
2118
+ inputs: [
2119
+ {
2120
+ name: "message",
2121
+ type: "string"
2122
+ }
2123
+ ],
2124
+ name: "Error",
2125
+ type: "error"
2126
+ };
2127
+ var solidityPanic = {
2128
+ inputs: [
2129
+ {
2130
+ name: "reason",
2131
+ type: "uint256"
2132
+ }
2133
+ ],
2134
+ name: "Panic",
2135
+ type: "error"
2136
+ };
2137
+
2138
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/hashSignature.js
2139
+ var hash = (value) => keccak256(toBytes(value));
2140
+ function hashSignature(sig) {
2141
+ return hash(sig);
2142
+ }
2143
+
2144
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/normalizeSignature.js
2145
+ function normalizeSignature(signature) {
2146
+ let active = true;
2147
+ let current = "";
2148
+ let level = 0;
2149
+ let result = "";
2150
+ let valid = false;
2151
+ for (let i = 0; i < signature.length; i++) {
2152
+ const char = signature[i];
2153
+ if (["(", ")", ","].includes(char))
2154
+ active = true;
2155
+ if (char === "(")
2156
+ level++;
2157
+ if (char === ")")
2158
+ level--;
2159
+ if (!active)
2160
+ continue;
2161
+ if (level === 0) {
2162
+ if (char === " " && ["event", "function", ""].includes(result))
2163
+ result = "";
2164
+ else {
2165
+ result += char;
2166
+ if (char === ")") {
2167
+ valid = true;
2168
+ break;
2169
+ }
2170
+ }
2171
+ continue;
2172
+ }
2173
+ if (char === " ") {
2174
+ if (signature[i - 1] !== "," && current !== "," && current !== ",(") {
2175
+ current = "";
2176
+ active = false;
2177
+ }
2178
+ continue;
2179
+ }
2180
+ result += char;
2181
+ current += char;
2182
+ }
2183
+ if (!valid)
2184
+ throw new BaseError("Unable to normalize signature.");
2185
+ return result;
2186
+ }
2187
+
2188
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/toSignature.js
2189
+ var toSignature = (def) => {
2190
+ const def_ = (() => {
2191
+ if (typeof def === "string")
2192
+ return def;
2193
+ return formatAbiItem2(def);
2194
+ })();
2195
+ return normalizeSignature(def_);
2196
+ };
2197
+
2198
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/toSignatureHash.js
2199
+ function toSignatureHash(fn) {
2200
+ return hashSignature(toSignature(fn));
2201
+ }
2202
+
2203
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
2204
+ var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
2205
+
2206
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/fromBytes.js
2207
+ function bytesToBigInt(bytes, opts = {}) {
2208
+ if (typeof opts.size !== "undefined")
2209
+ assertSize(bytes, { size: opts.size });
2210
+ const hex = bytesToHex(bytes, opts);
2211
+ return hexToBigInt(hex, opts);
2212
+ }
2213
+ function bytesToBool(bytes_, opts = {}) {
2214
+ let bytes = bytes_;
2215
+ if (typeof opts.size !== "undefined") {
2216
+ assertSize(bytes, { size: opts.size });
2217
+ bytes = trim(bytes);
2218
+ }
2219
+ if (bytes.length > 1 || bytes[0] > 1)
2220
+ throw new InvalidBytesBooleanError(bytes);
2221
+ return Boolean(bytes[0]);
2222
+ }
2223
+ function bytesToNumber(bytes, opts = {}) {
2224
+ if (typeof opts.size !== "undefined")
2225
+ assertSize(bytes, { size: opts.size });
2226
+ const hex = bytesToHex(bytes, opts);
2227
+ return hexToNumber(hex, opts);
2228
+ }
2229
+ function bytesToString(bytes_, opts = {}) {
2230
+ let bytes = bytes_;
2231
+ if (typeof opts.size !== "undefined") {
2232
+ assertSize(bytes, { size: opts.size });
2233
+ bytes = trim(bytes, { dir: "right" });
2234
+ }
2235
+ return new TextDecoder().decode(bytes);
2236
+ }
2237
+
2238
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
2239
+ function decodeAbiParameters(params, data) {
2240
+ const bytes = typeof data === "string" ? hexToBytes(data) : data;
2241
+ const cursor = createCursor(bytes);
2242
+ if (size(bytes) === 0 && params.length > 0)
2243
+ throw new AbiDecodingZeroDataError();
2244
+ if (size(data) && size(data) < 32)
2245
+ throw new AbiDecodingDataSizeTooSmallError({
2246
+ data: typeof data === "string" ? data : bytesToHex(data),
2247
+ params,
2248
+ size: size(data)
2249
+ });
2250
+ let consumed = 0;
2251
+ const values = [];
2252
+ for (let i = 0; i < params.length; ++i) {
2253
+ const param = params[i];
2254
+ if (consumed < bytes.length)
2255
+ cursor.setPosition(consumed);
2256
+ const [data2, consumed_] = decodeParameter(cursor, param, {
2257
+ staticPosition: 0
2258
+ });
2259
+ consumed += consumed_;
2260
+ values.push(data2);
2261
+ }
2262
+ return values;
2263
+ }
2264
+ function decodeParameter(cursor, param, { staticPosition }) {
2265
+ const arrayComponents = getArrayComponents(param.type);
2266
+ if (arrayComponents) {
2267
+ const [length, type] = arrayComponents;
2268
+ return decodeArray(cursor, { ...param, type }, { length, staticPosition });
2269
+ }
2270
+ if (param.type === "tuple")
2271
+ return decodeTuple(cursor, param, { staticPosition });
2272
+ if (param.type === "address")
2273
+ return decodeAddress(cursor);
2274
+ if (param.type === "bool")
2275
+ return decodeBool(cursor);
2276
+ if (param.type.startsWith("bytes"))
2277
+ return decodeBytes(cursor, param, { staticPosition });
2278
+ if (param.type.startsWith("uint") || param.type.startsWith("int"))
2279
+ return decodeNumber(cursor, param);
2280
+ if (param.type === "string")
2281
+ return decodeString(cursor, { staticPosition });
2282
+ throw new InvalidAbiDecodingTypeError(param.type, {
2283
+ docsPath: "/docs/contract/decodeAbiParameters"
2284
+ });
2285
+ }
2286
+ var sizeOfLength = 32;
2287
+ var sizeOfOffset = 32;
2288
+ function decodeAddress(cursor) {
2289
+ const value = cursor.readBytes(32);
2290
+ return [checksumAddress(bytesToHex(sliceBytes(value, -20))), 32];
2291
+ }
2292
+ function decodeArray(cursor, param, { length, staticPosition }) {
2293
+ if (length === null) {
2294
+ const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));
2295
+ const start = staticPosition + offset;
2296
+ const startOfData = start + sizeOfLength;
2297
+ cursor.setPosition(start);
2298
+ const length2 = bytesToNumber(cursor.readBytes(sizeOfLength));
2299
+ const dynamicChild = hasDynamicChild(param);
2300
+ let consumed2 = 0;
2301
+ const value2 = [];
2302
+ for (let i = 0; i < length2; ++i) {
2303
+ cursor.setPosition(startOfData + (dynamicChild ? i * 32 : consumed2));
2304
+ const [data, consumed_] = decodeParameter(cursor, param, {
2305
+ staticPosition: startOfData
2306
+ });
2307
+ consumed2 += consumed_;
2308
+ value2.push(data);
2309
+ if (consumed_ === 0) {
2310
+ cursor.assertReadLimit();
2311
+ cursor._touch();
2312
+ }
2313
+ }
2314
+ cursor.setPosition(staticPosition + 32);
2315
+ return [value2, 32];
2316
+ }
2317
+ if (hasDynamicChild(param)) {
2318
+ const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));
2319
+ const start = staticPosition + offset;
2320
+ const value2 = [];
2321
+ for (let i = 0; i < length; ++i) {
2322
+ cursor.setPosition(start + i * 32);
2323
+ const [data] = decodeParameter(cursor, param, {
2324
+ staticPosition: start
2325
+ });
2326
+ value2.push(data);
2327
+ }
2328
+ cursor.setPosition(staticPosition + 32);
2329
+ return [value2, 32];
2330
+ }
2331
+ let consumed = 0;
2332
+ const value = [];
2333
+ for (let i = 0; i < length; ++i) {
2334
+ const [data, consumed_] = decodeParameter(cursor, param, {
2335
+ staticPosition: staticPosition + consumed
2336
+ });
2337
+ consumed += consumed_;
2338
+ value.push(data);
2339
+ if (consumed_ === 0) {
2340
+ cursor.assertReadLimit();
2341
+ cursor._touch();
2342
+ }
2343
+ }
2344
+ return [value, consumed];
2345
+ }
2346
+ function decodeBool(cursor) {
2347
+ return [bytesToBool(cursor.readBytes(32), { size: 32 }), 32];
2348
+ }
2349
+ function decodeBytes(cursor, param, { staticPosition }) {
2350
+ const [_, size4] = param.type.split("bytes");
2351
+ if (!size4) {
2352
+ const offset = bytesToNumber(cursor.readBytes(32));
2353
+ cursor.setPosition(staticPosition + offset);
2354
+ const length = bytesToNumber(cursor.readBytes(32));
2355
+ if (length === 0) {
2356
+ cursor.setPosition(staticPosition + 32);
2357
+ return ["0x", 32];
2358
+ }
2359
+ const data = cursor.readBytes(length);
2360
+ cursor.setPosition(staticPosition + 32);
2361
+ return [bytesToHex(data), 32];
2362
+ }
2363
+ const value = bytesToHex(cursor.readBytes(Number.parseInt(size4, 10), 32));
2364
+ return [value, 32];
2365
+ }
2366
+ function decodeNumber(cursor, param) {
2367
+ const signed = param.type.startsWith("int");
2368
+ const size4 = Number.parseInt(param.type.split("int")[1] || "256", 10);
2369
+ const value = cursor.readBytes(32);
2370
+ return [
2371
+ size4 > 48 ? bytesToBigInt(value, { signed }) : bytesToNumber(value, { signed }),
2372
+ 32
2373
+ ];
2374
+ }
2375
+ function decodeTuple(cursor, param, { staticPosition }) {
2376
+ const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);
2377
+ const value = hasUnnamedChild ? [] : {};
2378
+ let consumed = 0;
2379
+ if (hasDynamicChild(param)) {
2380
+ const offset = bytesToNumber(cursor.readBytes(sizeOfOffset));
2381
+ const start = staticPosition + offset;
2382
+ for (let i = 0; i < param.components.length; ++i) {
2383
+ const component = param.components[i];
2384
+ cursor.setPosition(start + consumed);
2385
+ const [data, consumed_] = decodeParameter(cursor, component, {
2386
+ staticPosition: start
2387
+ });
2388
+ consumed += consumed_;
2389
+ value[hasUnnamedChild ? i : component?.name] = data;
2390
+ }
2391
+ cursor.setPosition(staticPosition + 32);
2392
+ return [value, 32];
2393
+ }
2394
+ for (let i = 0; i < param.components.length; ++i) {
2395
+ const component = param.components[i];
2396
+ const [data, consumed_] = decodeParameter(cursor, component, {
2397
+ staticPosition
2398
+ });
2399
+ value[hasUnnamedChild ? i : component?.name] = data;
2400
+ consumed += consumed_;
2401
+ }
2402
+ return [value, consumed];
2403
+ }
2404
+ function decodeString(cursor, { staticPosition }) {
2405
+ const offset = bytesToNumber(cursor.readBytes(32));
2406
+ const start = staticPosition + offset;
2407
+ cursor.setPosition(start);
2408
+ const length = bytesToNumber(cursor.readBytes(32));
2409
+ if (length === 0) {
2410
+ cursor.setPosition(staticPosition + 32);
2411
+ return ["", 32];
2412
+ }
2413
+ const data = cursor.readBytes(length, 32);
2414
+ const value = bytesToString(trim(data));
2415
+ cursor.setPosition(staticPosition + 32);
2416
+ return [value, 32];
2417
+ }
2418
+ function hasDynamicChild(param) {
2419
+ const { type } = param;
2420
+ if (type === "string")
2421
+ return true;
2422
+ if (type === "bytes")
2423
+ return true;
2424
+ if (type.endsWith("[]"))
2425
+ return true;
2426
+ if (type === "tuple")
2427
+ return param.components?.some(hasDynamicChild);
2428
+ const arrayComponents = getArrayComponents(param.type);
2429
+ if (arrayComponents && hasDynamicChild({ ...param, type: arrayComponents[1] }))
2430
+ return true;
2431
+ return false;
2432
+ }
2433
+
2434
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/decodeErrorResult.js
2435
+ function decodeErrorResult(parameters) {
2436
+ const { abi, data, cause } = parameters;
2437
+ const signature = slice(data, 0, 4);
2438
+ if (signature === "0x")
2439
+ throw new AbiDecodingZeroDataError({ cause });
2440
+ const abi_ = [...abi || [], solidityError, solidityPanic];
2441
+ const abiItem = abi_.find((x) => x.type === "error" && signature === toFunctionSelector(formatAbiItem(x)));
2442
+ if (!abiItem)
2443
+ throw new AbiErrorSignatureNotFoundError(signature, {
2444
+ docsPath: "/docs/contract/decodeErrorResult",
2445
+ cause
2446
+ });
2447
+ return {
2448
+ abiItem,
2449
+ args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ? decodeAbiParameters(abiItem.inputs, slice(data, 4)) : void 0,
2450
+ errorName: abiItem.name
2451
+ };
2452
+ }
2453
+
2454
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js
2455
+ function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false }) {
2456
+ if (!("name" in abiItem))
2457
+ return;
2458
+ if (!("inputs" in abiItem))
2459
+ return;
2460
+ if (!abiItem.inputs)
2461
+ return;
2462
+ return `${includeFunctionName ? abiItem.name : ""}(${abiItem.inputs.map((input, i) => `${includeName && input.name ? `${input.name}: ` : ""}${typeof args[i] === "object" ? stringify(args[i]) : args[i]}`).join(", ")})`;
2463
+ }
2464
+
2465
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/toEventSelector.js
2466
+ var toEventSelector = toSignatureHash;
2467
+
2468
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/getAbiItem.js
2469
+ function getAbiItem(parameters) {
2470
+ const { abi, args = [], name } = parameters;
2471
+ const isSelector = isHex(name, { strict: false });
2472
+ const abiItems = abi.filter((abiItem) => {
2473
+ if (isSelector) {
2474
+ if (abiItem.type === "function")
2475
+ return toFunctionSelector(abiItem) === name;
2476
+ if (abiItem.type === "event")
2477
+ return toEventSelector(abiItem) === name;
2478
+ return false;
2479
+ }
2480
+ return "name" in abiItem && abiItem.name === name;
2481
+ });
2482
+ if (abiItems.length === 0)
2483
+ return void 0;
2484
+ if (abiItems.length === 1)
2485
+ return abiItems[0];
2486
+ let matchedAbiItem;
2487
+ for (const abiItem of abiItems) {
2488
+ if (!("inputs" in abiItem))
2489
+ continue;
2490
+ if (!args || args.length === 0) {
2491
+ if (!abiItem.inputs || abiItem.inputs.length === 0)
2492
+ return abiItem;
2493
+ continue;
2494
+ }
2495
+ if (!abiItem.inputs)
2496
+ continue;
2497
+ if (abiItem.inputs.length === 0)
2498
+ continue;
2499
+ if (abiItem.inputs.length !== args.length)
2500
+ continue;
2501
+ const matched = args.every((arg, index) => {
2502
+ const abiParameter = "inputs" in abiItem && abiItem.inputs[index];
2503
+ if (!abiParameter)
2504
+ return false;
2505
+ return isArgOfType(arg, abiParameter);
2506
+ });
2507
+ if (matched) {
2508
+ if (matchedAbiItem && "inputs" in matchedAbiItem && matchedAbiItem.inputs) {
2509
+ const ambiguousTypes = getAmbiguousTypes(abiItem.inputs, matchedAbiItem.inputs, args);
2510
+ if (ambiguousTypes)
2511
+ throw new AbiItemAmbiguityError({
2512
+ abiItem,
2513
+ type: ambiguousTypes[0]
2514
+ }, {
2515
+ abiItem: matchedAbiItem,
2516
+ type: ambiguousTypes[1]
2517
+ });
2518
+ }
2519
+ matchedAbiItem = abiItem;
2520
+ }
2521
+ }
2522
+ if (matchedAbiItem)
2523
+ return matchedAbiItem;
2524
+ return abiItems[0];
2525
+ }
2526
+ function isArgOfType(arg, abiParameter) {
2527
+ const argType = typeof arg;
2528
+ const abiParameterType = abiParameter.type;
2529
+ switch (abiParameterType) {
2530
+ case "address":
2531
+ return isAddress(arg, { strict: false });
2532
+ case "bool":
2533
+ return argType === "boolean";
2534
+ case "function":
2535
+ return argType === "string";
2536
+ case "string":
2537
+ return argType === "string";
2538
+ default: {
2539
+ if (abiParameterType === "tuple" && "components" in abiParameter)
2540
+ return Object.values(abiParameter.components).every((component, index) => {
2541
+ return argType === "object" && isArgOfType(Object.values(arg)[index], component);
2542
+ });
2543
+ if (/^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)?$/.test(abiParameterType))
2544
+ return argType === "number" || argType === "bigint";
2545
+ if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))
2546
+ return argType === "string" || arg instanceof Uint8Array;
2547
+ if (/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(abiParameterType)) {
2548
+ return Array.isArray(arg) && arg.every((x) => isArgOfType(x, {
2549
+ ...abiParameter,
2550
+ // Pop off `[]` or `[M]` from end of type
2551
+ type: abiParameterType.replace(/(\[[0-9]{0,}\])$/, "")
2552
+ }));
2553
+ }
2554
+ return false;
2555
+ }
2556
+ }
2557
+ }
2558
+ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
2559
+ for (const parameterIndex in sourceParameters) {
2560
+ const sourceParameter = sourceParameters[parameterIndex];
2561
+ const targetParameter = targetParameters[parameterIndex];
2562
+ if (sourceParameter.type === "tuple" && targetParameter.type === "tuple" && "components" in sourceParameter && "components" in targetParameter)
2563
+ return getAmbiguousTypes(sourceParameter.components, targetParameter.components, args[parameterIndex]);
2564
+ const types = [sourceParameter.type, targetParameter.type];
2565
+ const ambiguous = (() => {
2566
+ if (types.includes("address") && types.includes("bytes20"))
2567
+ return true;
2568
+ if (types.includes("address") && types.includes("string"))
2569
+ return isAddress(args[parameterIndex], { strict: false });
2570
+ if (types.includes("address") && types.includes("bytes"))
2571
+ return isAddress(args[parameterIndex], { strict: false });
2572
+ return false;
2573
+ })();
2574
+ if (ambiguous)
2575
+ return types;
2576
+ }
2577
+ return;
2578
+ }
2579
+
2580
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/stateOverride.js
2581
+ var AccountStateConflictError = class extends BaseError {
2582
+ constructor({ address }) {
2583
+ super(`State for account "${address}" is set multiple times.`, {
2584
+ name: "AccountStateConflictError"
2585
+ });
2586
+ }
2587
+ };
2588
+ var StateAssignmentConflictError = class extends BaseError {
2589
+ constructor() {
2590
+ super("state and stateDiff are set on the same account.", {
2591
+ name: "StateAssignmentConflictError"
2592
+ });
2593
+ }
2594
+ };
2595
+ function prettyStateMapping(stateMapping) {
2596
+ return stateMapping.reduce((pretty, { slot, value }) => {
2597
+ return `${pretty} ${slot}: ${value}
2598
+ `;
2599
+ }, "");
2600
+ }
2601
+ function prettyStateOverride(stateOverride) {
2602
+ return stateOverride.reduce((pretty, { address, ...state }) => {
2603
+ let val = `${pretty} ${address}:
2604
+ `;
2605
+ if (state.nonce)
2606
+ val += ` nonce: ${state.nonce}
2607
+ `;
2608
+ if (state.balance)
2609
+ val += ` balance: ${state.balance}
2610
+ `;
2611
+ if (state.code)
2612
+ val += ` code: ${state.code}
2613
+ `;
2614
+ if (state.state) {
2615
+ val += " state:\n";
2616
+ val += prettyStateMapping(state.state);
2617
+ }
2618
+ if (state.stateDiff) {
2619
+ val += " stateDiff:\n";
2620
+ val += prettyStateMapping(state.stateDiff);
2621
+ }
2622
+ return val;
2623
+ }, " State Override:\n").slice(0, -1);
2624
+ }
2625
+
2626
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/utils.js
2627
+ var getContractAddress = (address) => address;
2628
+ function getAbortError(signal) {
2629
+ if (signal?.reason)
2630
+ return signal.reason;
2631
+ if (typeof DOMException === "function")
2632
+ return new DOMException("This operation was aborted", "AbortError");
2633
+ const error = new Error("This operation was aborted");
2634
+ error.name = "AbortError";
2635
+ return error;
2636
+ }
2637
+ function isAbortError(error) {
2638
+ return typeof error === "object" && error !== null && "name" in error && error.name === "AbortError";
2639
+ }
2640
+ var getUrl = (url) => {
2641
+ try {
2642
+ const parsed = new URL(url);
2643
+ if (!parsed.username && !parsed.password)
2644
+ return url;
2645
+ parsed.username = "";
2646
+ parsed.password = "";
2647
+ return parsed.toString();
2648
+ } catch {
2649
+ return url;
2650
+ }
2651
+ };
2652
+
2653
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/contract.js
2654
+ var CallExecutionError = class extends BaseError {
2655
+ constructor(cause, { account: account_, docsPath: docsPath6, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
2656
+ const account = account_ ? parseAccount(account_) : void 0;
2657
+ let prettyArgs = prettyPrint({
2658
+ from: account?.address,
2659
+ to,
2660
+ value: typeof value !== "undefined" && `${formatEther(value)} ${chain?.nativeCurrency?.symbol || "ETH"}`,
2661
+ data,
2662
+ gas,
2663
+ gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
2664
+ maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
2665
+ maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
2666
+ nonce
2667
+ });
2668
+ if (stateOverride) {
2669
+ prettyArgs += `
2670
+ ${prettyStateOverride(stateOverride)}`;
2671
+ }
2672
+ super(cause.shortMessage, {
2673
+ cause,
2674
+ docsPath: docsPath6,
2675
+ metaMessages: [
2676
+ ...cause.metaMessages ? [...cause.metaMessages, " "] : [],
2677
+ "Raw Call Arguments:",
2678
+ prettyArgs
2679
+ ].filter(Boolean),
2680
+ name: "CallExecutionError"
2681
+ });
2682
+ Object.defineProperty(this, "cause", {
2683
+ enumerable: true,
2684
+ configurable: true,
2685
+ writable: true,
2686
+ value: void 0
2687
+ });
2688
+ this.cause = cause;
2689
+ }
2690
+ };
2691
+ var ContractFunctionExecutionError = class extends BaseError {
2692
+ constructor(cause, { abi, args, contractAddress, docsPath: docsPath6, functionName, sender }) {
2693
+ const abiItem = getAbiItem({ abi, args, name: functionName });
2694
+ const formattedArgs = abiItem ? formatAbiItemWithArgs({
2695
+ abiItem,
2696
+ args,
2697
+ includeFunctionName: false,
2698
+ includeName: false
2699
+ }) : void 0;
2700
+ const functionWithParams = abiItem ? formatAbiItem(abiItem, { includeName: true }) : void 0;
2701
+ const prettyArgs = prettyPrint({
2702
+ address: contractAddress && getContractAddress(contractAddress),
2703
+ function: functionWithParams,
2704
+ args: formattedArgs && formattedArgs !== "()" && `${[...Array(functionName?.length ?? 0).keys()].map(() => " ").join("")}${formattedArgs}`,
2705
+ sender
2706
+ });
2707
+ super(cause.shortMessage || `An unknown error occurred while executing the contract function "${functionName}".`, {
2708
+ cause,
2709
+ docsPath: docsPath6,
2710
+ metaMessages: [
2711
+ ...cause.metaMessages ? [...cause.metaMessages, " "] : [],
2712
+ prettyArgs && "Contract Call:",
2713
+ prettyArgs
2714
+ ].filter(Boolean),
2715
+ name: "ContractFunctionExecutionError"
2716
+ });
2717
+ Object.defineProperty(this, "abi", {
2718
+ enumerable: true,
2719
+ configurable: true,
2720
+ writable: true,
2721
+ value: void 0
2722
+ });
2723
+ Object.defineProperty(this, "args", {
2724
+ enumerable: true,
2725
+ configurable: true,
2726
+ writable: true,
2727
+ value: void 0
2728
+ });
2729
+ Object.defineProperty(this, "cause", {
2730
+ enumerable: true,
2731
+ configurable: true,
2732
+ writable: true,
2733
+ value: void 0
2734
+ });
2735
+ Object.defineProperty(this, "contractAddress", {
2736
+ enumerable: true,
2737
+ configurable: true,
2738
+ writable: true,
2739
+ value: void 0
2740
+ });
2741
+ Object.defineProperty(this, "formattedArgs", {
2742
+ enumerable: true,
2743
+ configurable: true,
2744
+ writable: true,
2745
+ value: void 0
2746
+ });
2747
+ Object.defineProperty(this, "functionName", {
2748
+ enumerable: true,
2749
+ configurable: true,
2750
+ writable: true,
2751
+ value: void 0
2752
+ });
2753
+ Object.defineProperty(this, "sender", {
2754
+ enumerable: true,
2755
+ configurable: true,
2756
+ writable: true,
2757
+ value: void 0
2758
+ });
2759
+ this.abi = abi;
2760
+ this.args = args;
2761
+ this.cause = cause;
2762
+ this.contractAddress = contractAddress;
2763
+ this.functionName = functionName;
2764
+ this.sender = sender;
2765
+ }
2766
+ };
2767
+ var ContractFunctionRevertedError = class extends BaseError {
2768
+ constructor({ abi, data, functionName, message, cause: error }) {
2769
+ let cause;
2770
+ let decodedData;
2771
+ let metaMessages;
2772
+ let reason;
2773
+ if (data && data !== "0x") {
2774
+ try {
2775
+ decodedData = decodeErrorResult({ abi, data, cause: error });
2776
+ const { abiItem, errorName, args: errorArgs } = decodedData;
2777
+ if (errorName === "Error") {
2778
+ reason = errorArgs[0];
2779
+ } else if (errorName === "Panic") {
2780
+ const [firstArg] = errorArgs;
2781
+ reason = panicReasons[firstArg];
2782
+ } else {
2783
+ const errorWithParams = abiItem ? formatAbiItem(abiItem, { includeName: true }) : void 0;
2784
+ const formattedArgs = abiItem && errorArgs ? formatAbiItemWithArgs({
2785
+ abiItem,
2786
+ args: errorArgs,
2787
+ includeFunctionName: false,
2788
+ includeName: false
2789
+ }) : void 0;
2790
+ metaMessages = [
2791
+ errorWithParams ? `Error: ${errorWithParams}` : "",
2792
+ formattedArgs && formattedArgs !== "()" ? ` ${[...Array(errorName?.length ?? 0).keys()].map(() => " ").join("")}${formattedArgs}` : ""
2793
+ ];
2794
+ }
2795
+ } catch (err) {
2796
+ cause = err;
2797
+ }
2798
+ } else if (message)
2799
+ reason = message;
2800
+ let signature;
2801
+ if (cause instanceof AbiErrorSignatureNotFoundError) {
2802
+ signature = cause.signature;
2803
+ metaMessages = [
2804
+ `Unable to decode signature "${signature}" as it was not found on the provided ABI.`,
2805
+ "Make sure you are using the correct ABI and that the error exists on it.",
2806
+ `You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
2807
+ ];
2808
+ }
2809
+ super(reason && reason !== "execution reverted" || signature ? [
2810
+ `The contract function "${functionName}" reverted with the following ${signature ? "signature" : "reason"}:`,
2811
+ reason || signature
2812
+ ].join("\n") : `The contract function "${functionName}" reverted.`, {
2813
+ cause: cause ?? error,
2814
+ metaMessages,
2815
+ name: "ContractFunctionRevertedError"
2816
+ });
2817
+ Object.defineProperty(this, "data", {
2818
+ enumerable: true,
2819
+ configurable: true,
2820
+ writable: true,
2821
+ value: void 0
2822
+ });
2823
+ Object.defineProperty(this, "raw", {
2824
+ enumerable: true,
2825
+ configurable: true,
2826
+ writable: true,
2827
+ value: void 0
2828
+ });
2829
+ Object.defineProperty(this, "reason", {
2830
+ enumerable: true,
2831
+ configurable: true,
2832
+ writable: true,
2833
+ value: void 0
2834
+ });
2835
+ Object.defineProperty(this, "signature", {
2836
+ enumerable: true,
2837
+ configurable: true,
2838
+ writable: true,
2839
+ value: void 0
2840
+ });
2841
+ this.data = decodedData;
2842
+ this.raw = data;
2843
+ this.reason = reason;
2844
+ this.signature = signature;
2845
+ }
2846
+ };
2847
+ var ContractFunctionZeroDataError = class extends BaseError {
2848
+ constructor({ functionName, cause }) {
2849
+ super(`The contract function "${functionName}" returned no data ("0x").`, {
2850
+ metaMessages: [
2851
+ "This could be due to any of the following:",
2852
+ ` - The contract does not have the function "${functionName}",`,
2853
+ " - The parameters passed to the contract function may be invalid, or",
2854
+ " - The address is not a contract."
2855
+ ],
2856
+ name: "ContractFunctionZeroDataError",
2857
+ cause
2858
+ });
2859
+ }
2860
+ };
2861
+ var CounterfactualDeploymentFailedError = class extends BaseError {
2862
+ constructor({ factory }) {
2863
+ super(`Deployment for counterfactual contract call failed${factory ? ` for factory "${factory}".` : ""}`, {
2864
+ metaMessages: [
2865
+ "Please ensure:",
2866
+ "- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).",
2867
+ "- The `factoryData` is a valid encoded function call for contract deployment function on the factory."
2868
+ ],
2869
+ name: "CounterfactualDeploymentFailedError"
2870
+ });
2871
+ }
2872
+ };
2873
+ var RawContractError = class extends BaseError {
2874
+ constructor({ data, message }) {
2875
+ super(message || "", { name: "RawContractError" });
2876
+ Object.defineProperty(this, "code", {
2877
+ enumerable: true,
2878
+ configurable: true,
2879
+ writable: true,
2880
+ value: 3
2881
+ });
2882
+ Object.defineProperty(this, "data", {
2883
+ enumerable: true,
2884
+ configurable: true,
2885
+ writable: true,
2886
+ value: void 0
2887
+ });
2888
+ this.data = data;
2889
+ }
2890
+ };
2891
+
2892
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js
2893
+ var docsPath = "/docs/contract/decodeFunctionResult";
2894
+ function decodeFunctionResult(parameters) {
2895
+ const { abi, args, functionName, data } = parameters;
2896
+ let abiItem = abi[0];
2897
+ if (functionName) {
2898
+ const item = getAbiItem({ abi, args, name: functionName });
2899
+ if (!item)
2900
+ throw new AbiFunctionNotFoundError(functionName, { docsPath });
2901
+ abiItem = item;
2902
+ }
2903
+ if (abiItem.type !== "function")
2904
+ throw new AbiFunctionNotFoundError(void 0, { docsPath });
2905
+ if (!abiItem.outputs)
2906
+ throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });
2907
+ const values = decodeAbiParameters(abiItem.outputs, data);
2908
+ if (values && values.length > 1)
2909
+ return values;
2910
+ if (values && values.length === 1)
2911
+ return values[0];
2912
+ return void 0;
2913
+ }
2914
+
2915
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeDeployData.js
2916
+ var docsPath2 = "/docs/contract/encodeDeployData";
2917
+ function encodeDeployData(parameters) {
2918
+ const { abi, args, bytecode } = parameters;
2919
+ if (!args || args.length === 0)
2920
+ return bytecode;
2921
+ const description = abi.find((x) => "type" in x && x.type === "constructor");
2922
+ if (!description)
2923
+ throw new AbiConstructorNotFoundError({ docsPath: docsPath2 });
2924
+ if (!("inputs" in description))
2925
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
2926
+ if (!description.inputs || description.inputs.length === 0)
2927
+ throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
2928
+ const data = encodeAbiParameters(description.inputs, args);
2929
+ return concatHex([bytecode, data]);
2930
+ }
2931
+
2932
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
2933
+ var docsPath3 = "/docs/contract/encodeFunctionData";
2934
+ function prepareEncodeFunctionData(parameters) {
2935
+ const { abi, args, functionName } = parameters;
2936
+ let abiItem = abi[0];
2937
+ if (functionName) {
2938
+ const item = getAbiItem({
2939
+ abi,
2940
+ args,
2941
+ name: functionName
2942
+ });
2943
+ if (!item)
2944
+ throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath3 });
2945
+ abiItem = item;
2946
+ }
2947
+ if (abiItem.type !== "function")
2948
+ throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath3 });
2949
+ return {
2950
+ abi: [abiItem],
2951
+ functionName: toFunctionSelector(formatAbiItem(abiItem))
2952
+ };
2953
+ }
2954
+
2955
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
2956
+ function encodeFunctionData(parameters) {
2957
+ const { args } = parameters;
2958
+ const { abi, functionName } = (() => {
2959
+ if (parameters.abi.length === 1 && parameters.functionName?.startsWith("0x"))
2960
+ return parameters;
2961
+ return prepareEncodeFunctionData(parameters);
2962
+ })();
2963
+ const abiItem = abi[0];
2964
+ const signature = functionName;
2965
+ const data = "inputs" in abiItem && abiItem.inputs ? encodeAbiParameters(abiItem.inputs, args ?? []) : void 0;
2966
+ return concatHex([signature, data ?? "0x"]);
2967
+ }
2968
+
2969
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/address/isAddressEqual.js
2970
+ function isAddressEqual(a, b) {
2971
+ if (!isAddress(a, { strict: false }))
2972
+ throw new InvalidAddressError({ address: a });
2973
+ if (!isAddress(b, { strict: false }))
2974
+ throw new InvalidAddressError({ address: b });
2975
+ return a.toLowerCase() === b.toLowerCase();
2976
+ }
2977
+
2978
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/block/formatBlockParameter.js
2979
+ function formatBlockParameter(parameters) {
2980
+ const { blockHash, blockNumber, blockTag, requireCanonical } = parameters;
2981
+ if (requireCanonical !== void 0 && !blockHash)
2982
+ throw new BaseError("`requireCanonical` can only be provided when `blockHash` is set.");
2983
+ if (blockHash)
2984
+ return requireCanonical ? { blockHash, requireCanonical } : { blockHash };
2985
+ if (typeof blockNumber === "bigint")
2986
+ return numberToHex(blockNumber);
2987
+ return blockTag ?? "latest";
2988
+ }
2989
+
2990
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/chain/getChainContractAddress.js
2991
+ function getChainContractAddress({ blockNumber, chain, contract: name }) {
2992
+ const contract = chain?.contracts?.[name];
2993
+ if (!contract)
2994
+ throw new ChainDoesNotSupportContract({
2995
+ chain,
2996
+ contract: { name }
2997
+ });
2998
+ if (blockNumber && contract.blockCreated && contract.blockCreated > blockNumber)
2999
+ throw new ChainDoesNotSupportContract({
3000
+ blockNumber,
3001
+ chain,
3002
+ contract: {
3003
+ name,
3004
+ blockCreated: contract.blockCreated
3005
+ }
3006
+ });
3007
+ return contract.address;
3008
+ }
3009
+
3010
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/request.js
3011
+ var HttpRequestError = class extends BaseError {
3012
+ constructor({ body, cause, details, headers, status, url }) {
3013
+ super("HTTP request failed.", {
3014
+ cause,
3015
+ details,
3016
+ metaMessages: [
3017
+ status && `Status: ${status}`,
3018
+ `URL: ${getUrl(url)}`,
3019
+ body && `Request body: ${stringify(body)}`
3020
+ ].filter(Boolean),
3021
+ name: "HttpRequestError"
3022
+ });
3023
+ Object.defineProperty(this, "body", {
3024
+ enumerable: true,
3025
+ configurable: true,
3026
+ writable: true,
3027
+ value: void 0
3028
+ });
3029
+ Object.defineProperty(this, "headers", {
3030
+ enumerable: true,
3031
+ configurable: true,
3032
+ writable: true,
3033
+ value: void 0
3034
+ });
3035
+ Object.defineProperty(this, "status", {
3036
+ enumerable: true,
3037
+ configurable: true,
3038
+ writable: true,
3039
+ value: void 0
3040
+ });
3041
+ Object.defineProperty(this, "url", {
3042
+ enumerable: true,
3043
+ configurable: true,
3044
+ writable: true,
3045
+ value: void 0
3046
+ });
3047
+ this.body = body;
3048
+ this.headers = headers;
3049
+ this.status = status;
3050
+ this.url = url;
3051
+ }
3052
+ };
3053
+ var ResponseBodyTooLargeError = class extends BaseError {
3054
+ constructor({ maxSize, size: size4 }) {
3055
+ super("HTTP response body exceeded the size limit.", {
3056
+ metaMessages: [`Max: ${maxSize} bytes`, `Received: ${size4} bytes`],
3057
+ name: "ResponseBodyTooLargeError"
3058
+ });
3059
+ Object.defineProperty(this, "maxSize", {
3060
+ enumerable: true,
3061
+ configurable: true,
3062
+ writable: true,
3063
+ value: void 0
3064
+ });
3065
+ Object.defineProperty(this, "size", {
3066
+ enumerable: true,
3067
+ configurable: true,
3068
+ writable: true,
3069
+ value: void 0
3070
+ });
3071
+ this.maxSize = maxSize;
3072
+ this.size = size4;
3073
+ }
3074
+ };
3075
+ var RpcRequestError = class extends BaseError {
3076
+ constructor({ body, error, url }) {
3077
+ super("RPC Request failed.", {
3078
+ cause: error,
3079
+ details: error.message,
3080
+ metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],
3081
+ name: "RpcRequestError"
3082
+ });
3083
+ Object.defineProperty(this, "code", {
3084
+ enumerable: true,
3085
+ configurable: true,
3086
+ writable: true,
3087
+ value: void 0
3088
+ });
3089
+ Object.defineProperty(this, "data", {
3090
+ enumerable: true,
3091
+ configurable: true,
3092
+ writable: true,
3093
+ value: void 0
3094
+ });
3095
+ Object.defineProperty(this, "url", {
3096
+ enumerable: true,
3097
+ configurable: true,
3098
+ writable: true,
3099
+ value: void 0
3100
+ });
3101
+ this.code = error.code;
3102
+ this.data = error.data;
3103
+ this.url = url;
3104
+ }
3105
+ };
3106
+ var TimeoutError = class extends BaseError {
3107
+ constructor({ body, url }) {
3108
+ super("The request took too long to respond.", {
3109
+ details: "The request timed out.",
3110
+ metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],
3111
+ name: "TimeoutError"
3112
+ });
3113
+ Object.defineProperty(this, "url", {
3114
+ enumerable: true,
3115
+ configurable: true,
3116
+ writable: true,
3117
+ value: void 0
3118
+ });
3119
+ this.url = url;
3120
+ }
3121
+ };
3122
+
3123
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/rpc.js
3124
+ var unknownErrorCode = -1;
3125
+ var RpcError = class extends BaseError {
3126
+ constructor(cause, { code, docsPath: docsPath6, metaMessages, name, shortMessage }) {
3127
+ super(shortMessage, {
3128
+ cause,
3129
+ docsPath: docsPath6,
3130
+ metaMessages: metaMessages || cause?.metaMessages,
3131
+ name: name || "RpcError"
3132
+ });
3133
+ Object.defineProperty(this, "code", {
3134
+ enumerable: true,
3135
+ configurable: true,
3136
+ writable: true,
3137
+ value: void 0
3138
+ });
3139
+ this.name = name || cause.name;
3140
+ this.code = cause instanceof RpcRequestError ? cause.code : code ?? unknownErrorCode;
3141
+ }
3142
+ };
3143
+ var ProviderRpcError = class extends RpcError {
3144
+ constructor(cause, options) {
3145
+ super(cause, options);
3146
+ Object.defineProperty(this, "data", {
3147
+ enumerable: true,
3148
+ configurable: true,
3149
+ writable: true,
3150
+ value: void 0
3151
+ });
3152
+ this.data = options.data;
3153
+ }
3154
+ };
3155
+ var ParseRpcError = class _ParseRpcError extends RpcError {
3156
+ constructor(cause) {
3157
+ super(cause, {
3158
+ code: _ParseRpcError.code,
3159
+ name: "ParseRpcError",
3160
+ shortMessage: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
3161
+ });
3162
+ }
3163
+ };
3164
+ Object.defineProperty(ParseRpcError, "code", {
3165
+ enumerable: true,
3166
+ configurable: true,
3167
+ writable: true,
3168
+ value: -32700
3169
+ });
3170
+ var InvalidRequestRpcError = class _InvalidRequestRpcError extends RpcError {
3171
+ constructor(cause) {
3172
+ super(cause, {
3173
+ code: _InvalidRequestRpcError.code,
3174
+ name: "InvalidRequestRpcError",
3175
+ shortMessage: "JSON is not a valid request object."
3176
+ });
3177
+ }
3178
+ };
3179
+ Object.defineProperty(InvalidRequestRpcError, "code", {
3180
+ enumerable: true,
3181
+ configurable: true,
3182
+ writable: true,
3183
+ value: -32600
3184
+ });
3185
+ var MethodNotFoundRpcError = class _MethodNotFoundRpcError extends RpcError {
3186
+ constructor(cause, { method } = {}) {
3187
+ super(cause, {
3188
+ code: _MethodNotFoundRpcError.code,
3189
+ name: "MethodNotFoundRpcError",
3190
+ shortMessage: `The method${method ? ` "${method}"` : ""} does not exist / is not available.`
3191
+ });
3192
+ }
3193
+ };
3194
+ Object.defineProperty(MethodNotFoundRpcError, "code", {
3195
+ enumerable: true,
3196
+ configurable: true,
3197
+ writable: true,
3198
+ value: -32601
3199
+ });
3200
+ var InvalidParamsRpcError = class _InvalidParamsRpcError extends RpcError {
3201
+ constructor(cause) {
3202
+ super(cause, {
3203
+ code: _InvalidParamsRpcError.code,
3204
+ name: "InvalidParamsRpcError",
3205
+ shortMessage: [
3206
+ "Invalid parameters were provided to the RPC method.",
3207
+ "Double check you have provided the correct parameters."
3208
+ ].join("\n")
3209
+ });
3210
+ }
3211
+ };
3212
+ Object.defineProperty(InvalidParamsRpcError, "code", {
3213
+ enumerable: true,
3214
+ configurable: true,
3215
+ writable: true,
3216
+ value: -32602
3217
+ });
3218
+ var InternalRpcError = class _InternalRpcError extends RpcError {
3219
+ constructor(cause) {
3220
+ super(cause, {
3221
+ code: _InternalRpcError.code,
3222
+ name: "InternalRpcError",
3223
+ shortMessage: "An internal error was received."
3224
+ });
3225
+ }
3226
+ };
3227
+ Object.defineProperty(InternalRpcError, "code", {
3228
+ enumerable: true,
3229
+ configurable: true,
3230
+ writable: true,
3231
+ value: -32603
3232
+ });
3233
+ var InvalidInputRpcError = class _InvalidInputRpcError extends RpcError {
3234
+ constructor(cause) {
3235
+ super(cause, {
3236
+ code: _InvalidInputRpcError.code,
3237
+ name: "InvalidInputRpcError",
3238
+ shortMessage: [
3239
+ "Missing or invalid parameters.",
3240
+ "Double check you have provided the correct parameters."
3241
+ ].join("\n")
3242
+ });
3243
+ }
3244
+ };
3245
+ Object.defineProperty(InvalidInputRpcError, "code", {
3246
+ enumerable: true,
3247
+ configurable: true,
3248
+ writable: true,
3249
+ value: -32e3
3250
+ });
3251
+ var ResourceNotFoundRpcError = class _ResourceNotFoundRpcError extends RpcError {
3252
+ constructor(cause) {
3253
+ super(cause, {
3254
+ code: _ResourceNotFoundRpcError.code,
3255
+ name: "ResourceNotFoundRpcError",
3256
+ shortMessage: "Requested resource not found."
3257
+ });
3258
+ Object.defineProperty(this, "name", {
3259
+ enumerable: true,
3260
+ configurable: true,
3261
+ writable: true,
3262
+ value: "ResourceNotFoundRpcError"
3263
+ });
3264
+ }
3265
+ };
3266
+ Object.defineProperty(ResourceNotFoundRpcError, "code", {
3267
+ enumerable: true,
3268
+ configurable: true,
3269
+ writable: true,
3270
+ value: -32001
3271
+ });
3272
+ var ResourceUnavailableRpcError = class _ResourceUnavailableRpcError extends RpcError {
3273
+ constructor(cause) {
3274
+ super(cause, {
3275
+ code: _ResourceUnavailableRpcError.code,
3276
+ name: "ResourceUnavailableRpcError",
3277
+ shortMessage: "Requested resource not available."
3278
+ });
3279
+ }
3280
+ };
3281
+ Object.defineProperty(ResourceUnavailableRpcError, "code", {
3282
+ enumerable: true,
3283
+ configurable: true,
3284
+ writable: true,
3285
+ value: -32002
3286
+ });
3287
+ var TransactionRejectedRpcError = class _TransactionRejectedRpcError extends RpcError {
3288
+ constructor(cause) {
3289
+ super(cause, {
3290
+ code: _TransactionRejectedRpcError.code,
3291
+ name: "TransactionRejectedRpcError",
3292
+ shortMessage: "Transaction creation failed."
3293
+ });
3294
+ }
3295
+ };
3296
+ Object.defineProperty(TransactionRejectedRpcError, "code", {
3297
+ enumerable: true,
3298
+ configurable: true,
3299
+ writable: true,
3300
+ value: -32003
3301
+ });
3302
+ var MethodNotSupportedRpcError = class _MethodNotSupportedRpcError extends RpcError {
3303
+ constructor(cause, { method } = {}) {
3304
+ super(cause, {
3305
+ code: _MethodNotSupportedRpcError.code,
3306
+ name: "MethodNotSupportedRpcError",
3307
+ shortMessage: `Method${method ? ` "${method}"` : ""} is not supported.`
3308
+ });
3309
+ }
3310
+ };
3311
+ Object.defineProperty(MethodNotSupportedRpcError, "code", {
3312
+ enumerable: true,
3313
+ configurable: true,
3314
+ writable: true,
3315
+ value: -32004
3316
+ });
3317
+ var LimitExceededRpcError = class _LimitExceededRpcError extends RpcError {
3318
+ constructor(cause) {
3319
+ super(cause, {
3320
+ code: _LimitExceededRpcError.code,
3321
+ name: "LimitExceededRpcError",
3322
+ shortMessage: "Request exceeds defined limit."
3323
+ });
3324
+ }
3325
+ };
3326
+ Object.defineProperty(LimitExceededRpcError, "code", {
3327
+ enumerable: true,
3328
+ configurable: true,
3329
+ writable: true,
3330
+ value: -32005
3331
+ });
3332
+ var JsonRpcVersionUnsupportedError = class _JsonRpcVersionUnsupportedError extends RpcError {
3333
+ constructor(cause) {
3334
+ super(cause, {
3335
+ code: _JsonRpcVersionUnsupportedError.code,
3336
+ name: "JsonRpcVersionUnsupportedError",
3337
+ shortMessage: "Version of JSON-RPC protocol is not supported."
3338
+ });
3339
+ }
3340
+ };
3341
+ Object.defineProperty(JsonRpcVersionUnsupportedError, "code", {
3342
+ enumerable: true,
3343
+ configurable: true,
3344
+ writable: true,
3345
+ value: -32006
3346
+ });
3347
+ var UserRejectedRequestError = class _UserRejectedRequestError extends ProviderRpcError {
3348
+ constructor(cause) {
3349
+ super(cause, {
3350
+ code: _UserRejectedRequestError.code,
3351
+ name: "UserRejectedRequestError",
3352
+ shortMessage: "User rejected the request."
3353
+ });
3354
+ }
3355
+ };
3356
+ Object.defineProperty(UserRejectedRequestError, "code", {
3357
+ enumerable: true,
3358
+ configurable: true,
3359
+ writable: true,
3360
+ value: 4001
3361
+ });
3362
+ var UnauthorizedProviderError = class _UnauthorizedProviderError extends ProviderRpcError {
3363
+ constructor(cause) {
3364
+ super(cause, {
3365
+ code: _UnauthorizedProviderError.code,
3366
+ name: "UnauthorizedProviderError",
3367
+ shortMessage: "The requested method and/or account has not been authorized by the user."
3368
+ });
3369
+ }
3370
+ };
3371
+ Object.defineProperty(UnauthorizedProviderError, "code", {
3372
+ enumerable: true,
3373
+ configurable: true,
3374
+ writable: true,
3375
+ value: 4100
3376
+ });
3377
+ var UnsupportedProviderMethodError = class _UnsupportedProviderMethodError extends ProviderRpcError {
3378
+ constructor(cause, { method } = {}) {
3379
+ super(cause, {
3380
+ code: _UnsupportedProviderMethodError.code,
3381
+ name: "UnsupportedProviderMethodError",
3382
+ shortMessage: `The Provider does not support the requested method${method ? ` " ${method}"` : ""}.`
3383
+ });
3384
+ }
3385
+ };
3386
+ Object.defineProperty(UnsupportedProviderMethodError, "code", {
3387
+ enumerable: true,
3388
+ configurable: true,
3389
+ writable: true,
3390
+ value: 4200
3391
+ });
3392
+ var ProviderDisconnectedError = class _ProviderDisconnectedError extends ProviderRpcError {
3393
+ constructor(cause) {
3394
+ super(cause, {
3395
+ code: _ProviderDisconnectedError.code,
3396
+ name: "ProviderDisconnectedError",
3397
+ shortMessage: "The Provider is disconnected from all chains."
3398
+ });
3399
+ }
3400
+ };
3401
+ Object.defineProperty(ProviderDisconnectedError, "code", {
3402
+ enumerable: true,
3403
+ configurable: true,
3404
+ writable: true,
3405
+ value: 4900
3406
+ });
3407
+ var ChainDisconnectedError = class _ChainDisconnectedError extends ProviderRpcError {
3408
+ constructor(cause) {
3409
+ super(cause, {
3410
+ code: _ChainDisconnectedError.code,
3411
+ name: "ChainDisconnectedError",
3412
+ shortMessage: "The Provider is not connected to the requested chain."
3413
+ });
3414
+ }
3415
+ };
3416
+ Object.defineProperty(ChainDisconnectedError, "code", {
3417
+ enumerable: true,
3418
+ configurable: true,
3419
+ writable: true,
3420
+ value: 4901
3421
+ });
3422
+ var SwitchChainError = class _SwitchChainError extends ProviderRpcError {
3423
+ constructor(cause) {
3424
+ super(cause, {
3425
+ code: _SwitchChainError.code,
3426
+ name: "SwitchChainError",
3427
+ shortMessage: "An error occurred when attempting to switch chain."
3428
+ });
3429
+ }
3430
+ };
3431
+ Object.defineProperty(SwitchChainError, "code", {
3432
+ enumerable: true,
3433
+ configurable: true,
3434
+ writable: true,
3435
+ value: 4902
3436
+ });
3437
+ var UnsupportedNonOptionalCapabilityError = class _UnsupportedNonOptionalCapabilityError extends ProviderRpcError {
3438
+ constructor(cause) {
3439
+ super(cause, {
3440
+ code: _UnsupportedNonOptionalCapabilityError.code,
3441
+ name: "UnsupportedNonOptionalCapabilityError",
3442
+ shortMessage: "This Wallet does not support a capability that was not marked as optional."
3443
+ });
3444
+ }
3445
+ };
3446
+ Object.defineProperty(UnsupportedNonOptionalCapabilityError, "code", {
3447
+ enumerable: true,
3448
+ configurable: true,
3449
+ writable: true,
3450
+ value: 5700
3451
+ });
3452
+ var UnsupportedChainIdError = class _UnsupportedChainIdError extends ProviderRpcError {
3453
+ constructor(cause) {
3454
+ super(cause, {
3455
+ code: _UnsupportedChainIdError.code,
3456
+ name: "UnsupportedChainIdError",
3457
+ shortMessage: "This Wallet does not support the requested chain ID."
3458
+ });
3459
+ }
3460
+ };
3461
+ Object.defineProperty(UnsupportedChainIdError, "code", {
3462
+ enumerable: true,
3463
+ configurable: true,
3464
+ writable: true,
3465
+ value: 5710
3466
+ });
3467
+ var DuplicateIdError = class _DuplicateIdError extends ProviderRpcError {
3468
+ constructor(cause) {
3469
+ super(cause, {
3470
+ code: _DuplicateIdError.code,
3471
+ name: "DuplicateIdError",
3472
+ shortMessage: "There is already a bundle submitted with this ID."
3473
+ });
3474
+ }
3475
+ };
3476
+ Object.defineProperty(DuplicateIdError, "code", {
3477
+ enumerable: true,
3478
+ configurable: true,
3479
+ writable: true,
3480
+ value: 5720
3481
+ });
3482
+ var UnknownBundleIdError = class _UnknownBundleIdError extends ProviderRpcError {
3483
+ constructor(cause) {
3484
+ super(cause, {
3485
+ code: _UnknownBundleIdError.code,
3486
+ name: "UnknownBundleIdError",
3487
+ shortMessage: "This bundle id is unknown / has not been submitted"
3488
+ });
3489
+ }
3490
+ };
3491
+ Object.defineProperty(UnknownBundleIdError, "code", {
3492
+ enumerable: true,
3493
+ configurable: true,
3494
+ writable: true,
3495
+ value: 5730
3496
+ });
3497
+ var BundleTooLargeError = class _BundleTooLargeError extends ProviderRpcError {
3498
+ constructor(cause) {
3499
+ super(cause, {
3500
+ code: _BundleTooLargeError.code,
3501
+ name: "BundleTooLargeError",
3502
+ shortMessage: "The call bundle is too large for the Wallet to process."
3503
+ });
3504
+ }
3505
+ };
3506
+ Object.defineProperty(BundleTooLargeError, "code", {
3507
+ enumerable: true,
3508
+ configurable: true,
3509
+ writable: true,
3510
+ value: 5740
3511
+ });
3512
+ var AtomicReadyWalletRejectedUpgradeError = class _AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError {
3513
+ constructor(cause) {
3514
+ super(cause, {
3515
+ code: _AtomicReadyWalletRejectedUpgradeError.code,
3516
+ name: "AtomicReadyWalletRejectedUpgradeError",
3517
+ shortMessage: "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."
3518
+ });
3519
+ }
3520
+ };
3521
+ Object.defineProperty(AtomicReadyWalletRejectedUpgradeError, "code", {
3522
+ enumerable: true,
3523
+ configurable: true,
3524
+ writable: true,
3525
+ value: 5750
3526
+ });
3527
+ var AtomicityNotSupportedError = class _AtomicityNotSupportedError extends ProviderRpcError {
3528
+ constructor(cause) {
3529
+ super(cause, {
3530
+ code: _AtomicityNotSupportedError.code,
3531
+ name: "AtomicityNotSupportedError",
3532
+ shortMessage: "The wallet does not support atomic execution but the request requires it."
3533
+ });
3534
+ }
3535
+ };
3536
+ Object.defineProperty(AtomicityNotSupportedError, "code", {
3537
+ enumerable: true,
3538
+ configurable: true,
3539
+ writable: true,
3540
+ value: 5760
3541
+ });
3542
+ var WalletConnectSessionSettlementError = class _WalletConnectSessionSettlementError extends ProviderRpcError {
3543
+ constructor(cause) {
3544
+ super(cause, {
3545
+ code: _WalletConnectSessionSettlementError.code,
3546
+ name: "WalletConnectSessionSettlementError",
3547
+ shortMessage: "WalletConnect session settlement failed."
3548
+ });
3549
+ }
3550
+ };
3551
+ Object.defineProperty(WalletConnectSessionSettlementError, "code", {
3552
+ enumerable: true,
3553
+ configurable: true,
3554
+ writable: true,
3555
+ value: 7e3
3556
+ });
3557
+ var UnknownRpcError = class extends RpcError {
3558
+ constructor(cause) {
3559
+ super(cause, {
3560
+ name: "UnknownRpcError",
3561
+ shortMessage: "An unknown RPC error occurred."
3562
+ });
3563
+ }
3564
+ };
3565
+
3566
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getNodeError.js
3567
+ function getNodeError(err, args) {
3568
+ const message = (err.details || "").toLowerCase();
3569
+ const executionRevertedError = err instanceof BaseError ? err.walk((e) => e?.code === ExecutionRevertedError.code) : err;
3570
+ if (executionRevertedError instanceof BaseError)
3571
+ return new ExecutionRevertedError({
3572
+ cause: err,
3573
+ message: executionRevertedError.details
3574
+ });
3575
+ if (ExecutionRevertedError.nodeMessage.test(message))
3576
+ return new ExecutionRevertedError({
3577
+ cause: err,
3578
+ message: err.details
3579
+ });
3580
+ if (FeeCapTooHighError.nodeMessage.test(message))
3581
+ return new FeeCapTooHighError({
3582
+ cause: err,
3583
+ maxFeePerGas: args?.maxFeePerGas
3584
+ });
3585
+ if (FeeCapTooLowError.nodeMessage.test(message))
3586
+ return new FeeCapTooLowError({
3587
+ cause: err,
3588
+ maxFeePerGas: args?.maxFeePerGas
3589
+ });
3590
+ if (NonceTooHighError.nodeMessage.test(message))
3591
+ return new NonceTooHighError({ cause: err, nonce: args?.nonce });
3592
+ if (NonceTooLowError.nodeMessage.test(message))
3593
+ return new NonceTooLowError({ cause: err, nonce: args?.nonce });
3594
+ if (NonceMaxValueError.nodeMessage.test(message))
3595
+ return new NonceMaxValueError({ cause: err, nonce: args?.nonce });
3596
+ if (InsufficientFundsError.nodeMessage.test(message))
3597
+ return new InsufficientFundsError({ cause: err });
3598
+ if (IntrinsicGasTooHighError.nodeMessage.test(message))
3599
+ return new IntrinsicGasTooHighError({ cause: err, gas: args?.gas });
3600
+ if (IntrinsicGasTooLowError.nodeMessage.test(message))
3601
+ return new IntrinsicGasTooLowError({ cause: err, gas: args?.gas });
3602
+ if (TransactionTypeNotSupportedError.nodeMessage.test(message))
3603
+ return new TransactionTypeNotSupportedError({ cause: err });
3604
+ if (TipAboveFeeCapError.nodeMessage.test(message))
3605
+ return new TipAboveFeeCapError({
3606
+ cause: err,
3607
+ maxFeePerGas: args?.maxFeePerGas,
3608
+ maxPriorityFeePerGas: args?.maxPriorityFeePerGas
3609
+ });
3610
+ return new UnknownNodeError({
3611
+ cause: err
3612
+ });
3613
+ }
3614
+
3615
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/errors/getCallError.js
3616
+ function getCallError(err, { docsPath: docsPath6, ...args }) {
3617
+ const cause = (() => {
3618
+ const cause2 = getNodeError(err, args);
3619
+ if (cause2 instanceof UnknownNodeError)
3620
+ return err;
3621
+ return cause2;
3622
+ })();
3623
+ return new CallExecutionError(cause, {
3624
+ docsPath: docsPath6,
3625
+ ...args
3626
+ });
3627
+ }
3628
+
3629
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/formatters/extract.js
3630
+ function extract(value_, { format }) {
3631
+ if (!format)
3632
+ return {};
3633
+ const value = {};
3634
+ function extract_(formatted2) {
3635
+ const keys = Object.keys(formatted2);
3636
+ for (const key of keys) {
3637
+ if (key in value_)
3638
+ value[key] = value_[key];
3639
+ if (formatted2[key] && typeof formatted2[key] === "object" && !Array.isArray(formatted2[key]))
3640
+ extract_(formatted2[key]);
3641
+ }
3642
+ }
3643
+ const formatted = format(value_ || {});
3644
+ extract_(formatted);
3645
+ return value;
3646
+ }
3647
+
3648
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/formatters/formatter.js
3649
+ function defineFormatter(type, format) {
3650
+ return ({ exclude, format: overrides }) => {
3651
+ return {
3652
+ exclude,
3653
+ format: (args, action) => {
3654
+ const formatted = format(args, action);
3655
+ if (exclude) {
3656
+ for (const key of exclude) {
3657
+ delete formatted[key];
3658
+ }
3659
+ }
3660
+ return {
3661
+ ...formatted,
3662
+ ...overrides(args, action)
3663
+ };
3664
+ },
3665
+ type
3666
+ };
3667
+ };
3668
+ }
3669
+
3670
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/formatters/transactionRequest.js
3671
+ var rpcTransactionType = {
3672
+ legacy: "0x0",
3673
+ eip2930: "0x1",
3674
+ eip1559: "0x2",
3675
+ eip4844: "0x3",
3676
+ eip7702: "0x4"
3677
+ };
3678
+ function formatTransactionRequest(request, _) {
3679
+ const rpcRequest = {};
3680
+ if (typeof request.authorizationList !== "undefined")
3681
+ rpcRequest.authorizationList = formatAuthorizationList(request.authorizationList);
3682
+ if (typeof request.accessList !== "undefined")
3683
+ rpcRequest.accessList = request.accessList;
3684
+ if (typeof request.blobVersionedHashes !== "undefined")
3685
+ rpcRequest.blobVersionedHashes = request.blobVersionedHashes;
3686
+ if (typeof request.blobs !== "undefined") {
3687
+ if (typeof request.blobs[0] !== "string")
3688
+ rpcRequest.blobs = request.blobs.map((x) => bytesToHex(x));
3689
+ else
3690
+ rpcRequest.blobs = request.blobs;
3691
+ }
3692
+ if (typeof request.data !== "undefined")
3693
+ rpcRequest.data = request.data;
3694
+ if (request.account)
3695
+ rpcRequest.from = request.account.address;
3696
+ if (typeof request.from !== "undefined")
3697
+ rpcRequest.from = request.from;
3698
+ if (typeof request.gas !== "undefined")
3699
+ rpcRequest.gas = numberToHex(request.gas);
3700
+ if (typeof request.gasPrice !== "undefined")
3701
+ rpcRequest.gasPrice = numberToHex(request.gasPrice);
3702
+ if (typeof request.maxFeePerBlobGas !== "undefined")
3703
+ rpcRequest.maxFeePerBlobGas = numberToHex(request.maxFeePerBlobGas);
3704
+ if (typeof request.maxFeePerGas !== "undefined")
3705
+ rpcRequest.maxFeePerGas = numberToHex(request.maxFeePerGas);
3706
+ if (typeof request.maxPriorityFeePerGas !== "undefined")
3707
+ rpcRequest.maxPriorityFeePerGas = numberToHex(request.maxPriorityFeePerGas);
3708
+ if (typeof request.nonce !== "undefined")
3709
+ rpcRequest.nonce = numberToHex(request.nonce);
3710
+ if (typeof request.to !== "undefined")
3711
+ rpcRequest.to = request.to;
3712
+ if (typeof request.type !== "undefined")
3713
+ rpcRequest.type = rpcTransactionType[request.type];
3714
+ if (typeof request.value !== "undefined")
3715
+ rpcRequest.value = numberToHex(request.value);
3716
+ return rpcRequest;
3717
+ }
3718
+ function formatAuthorizationList(authorizationList) {
3719
+ return authorizationList.map((authorization) => ({
3720
+ address: authorization.address,
3721
+ r: authorization.r ? numberToHex(BigInt(authorization.r)) : authorization.r,
3722
+ s: authorization.s ? numberToHex(BigInt(authorization.s)) : authorization.s,
3723
+ chainId: numberToHex(authorization.chainId),
3724
+ nonce: numberToHex(authorization.nonce),
3725
+ ...typeof authorization.yParity !== "undefined" ? { yParity: numberToHex(authorization.yParity) } : {},
3726
+ ...typeof authorization.v !== "undefined" && typeof authorization.yParity === "undefined" ? { v: numberToHex(authorization.v) } : {}
3727
+ }));
3728
+ }
3729
+
3730
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/withResolvers.js
3731
+ function withResolvers() {
3732
+ let resolve = () => void 0;
3733
+ let reject = () => void 0;
3734
+ const promise = new Promise((resolve_, reject_) => {
3735
+ resolve = resolve_;
3736
+ reject = reject_;
3737
+ });
3738
+ return { promise, resolve, reject };
3739
+ }
3740
+
3741
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/promise/createBatchScheduler.js
3742
+ var schedulerCache = /* @__PURE__ */ new Map();
3743
+ function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
3744
+ const exec = async () => {
3745
+ const scheduler = getScheduler();
3746
+ flush();
3747
+ const args = scheduler.map(({ args: args2 }) => args2);
3748
+ if (args.length === 0)
3749
+ return;
3750
+ fn(args).then((data) => {
3751
+ if (sort && Array.isArray(data))
3752
+ data.sort(sort);
3753
+ for (let i = 0; i < scheduler.length; i++) {
3754
+ const { resolve } = scheduler[i];
3755
+ resolve?.([data[i], data]);
3756
+ }
3757
+ }).catch((err) => {
3758
+ for (let i = 0; i < scheduler.length; i++) {
3759
+ const { reject } = scheduler[i];
3760
+ reject?.(err);
3761
+ }
3762
+ });
3763
+ };
3764
+ const flush = () => schedulerCache.delete(id);
3765
+ const getBatchedArgs = () => getScheduler().map(({ args }) => args);
3766
+ const getScheduler = () => schedulerCache.get(id) || [];
3767
+ const setScheduler = (item) => schedulerCache.set(id, [...getScheduler(), item]);
3768
+ return {
3769
+ flush,
3770
+ async schedule(args) {
3771
+ const { promise, resolve, reject } = withResolvers();
3772
+ const split = shouldSplitBatch?.([...getBatchedArgs(), args]);
3773
+ if (split)
3774
+ exec();
3775
+ const hasActiveScheduler = getScheduler().length > 0;
3776
+ if (hasActiveScheduler) {
3777
+ setScheduler({ args, resolve, reject });
3778
+ return promise;
3779
+ }
3780
+ setScheduler({ args, resolve, reject });
3781
+ setTimeout(exec, wait);
3782
+ return promise;
3783
+ }
3784
+ };
3785
+ }
3786
+
3787
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/stateOverride.js
3788
+ function serializeStateMapping(stateMapping) {
3789
+ if (!stateMapping || stateMapping.length === 0)
3790
+ return void 0;
3791
+ return stateMapping.reduce((acc, { slot, value }) => {
3792
+ if (slot.length !== 66)
3793
+ throw new InvalidBytesLengthError({
3794
+ size: slot.length,
3795
+ targetSize: 66,
3796
+ type: "hex"
3797
+ });
3798
+ if (value.length !== 66)
3799
+ throw new InvalidBytesLengthError({
3800
+ size: value.length,
3801
+ targetSize: 66,
3802
+ type: "hex"
3803
+ });
3804
+ acc[slot] = value;
3805
+ return acc;
3806
+ }, {});
3807
+ }
3808
+ function serializeAccountStateOverride(parameters) {
3809
+ const { balance, nonce, state, stateDiff, code } = parameters;
3810
+ const rpcAccountStateOverride = {};
3811
+ if (code !== void 0)
3812
+ rpcAccountStateOverride.code = code;
3813
+ if (balance !== void 0)
3814
+ rpcAccountStateOverride.balance = numberToHex(balance);
3815
+ if (nonce !== void 0)
3816
+ rpcAccountStateOverride.nonce = numberToHex(nonce);
3817
+ if (state !== void 0)
3818
+ rpcAccountStateOverride.state = serializeStateMapping(state);
3819
+ if (stateDiff !== void 0) {
3820
+ if (rpcAccountStateOverride.state)
3821
+ throw new StateAssignmentConflictError();
3822
+ rpcAccountStateOverride.stateDiff = serializeStateMapping(stateDiff);
3823
+ }
3824
+ return rpcAccountStateOverride;
3825
+ }
3826
+ function serializeStateOverride(parameters) {
3827
+ if (!parameters)
3828
+ return void 0;
3829
+ const rpcStateOverride = {};
3830
+ for (const { address, ...accountState } of parameters) {
3831
+ if (!isAddress(address, { strict: false }))
3832
+ throw new InvalidAddressError({ address });
3833
+ if (rpcStateOverride[address])
3834
+ throw new AccountStateConflictError({ address });
3835
+ rpcStateOverride[address] = serializeAccountStateOverride(accountState);
3836
+ }
3837
+ return rpcStateOverride;
3838
+ }
3839
+
3840
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/transaction/assertRequest.js
3841
+ function assertRequest(args) {
3842
+ const { account: account_, maxFeePerGas, maxPriorityFeePerGas, to } = args;
3843
+ const account = account_ ? parseAccount(account_) : void 0;
3844
+ if (account && !isAddress(account.address))
3845
+ throw new InvalidAddressError({ address: account.address });
3846
+ if (to && !isAddress(to))
3847
+ throw new InvalidAddressError({ address: to });
3848
+ if (maxFeePerGas && maxFeePerGas > maxUint256)
3849
+ throw new FeeCapTooHighError({ maxFeePerGas });
3850
+ if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
3851
+ throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
3852
+ }
3853
+
3854
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/actions/public/call.js
3855
+ async function call(client, args) {
3856
+ const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockHash, blockNumber, blockTag = client.experimental_blockTag ?? "latest", requireCanonical, accessList, blobs, blockOverrides, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, requestOptions, to, value, stateOverride, ...rest } = args;
3857
+ const account = account_ ? parseAccount(account_) : void 0;
3858
+ if (code && (factory || factoryData))
3859
+ throw new BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
3860
+ if (code && to)
3861
+ throw new BaseError("Cannot provide both `code` & `to` as parameters.");
3862
+ const deploylessCallViaBytecode = code && data_;
3863
+ const deploylessCallViaFactory = factory && factoryData && to && data_;
3864
+ const deploylessCall = deploylessCallViaBytecode || deploylessCallViaFactory;
3865
+ const data = (() => {
3866
+ if (deploylessCallViaBytecode)
3867
+ return toDeploylessCallViaBytecodeData({
3868
+ code,
3869
+ data: data_
3870
+ });
3871
+ if (deploylessCallViaFactory)
3872
+ return toDeploylessCallViaFactoryData({
3873
+ data: data_,
3874
+ factory,
3875
+ factoryData,
3876
+ to
3877
+ });
3878
+ return data_;
3879
+ })();
3880
+ try {
3881
+ assertRequest(args);
3882
+ const block = formatBlockParameter({
3883
+ blockHash,
3884
+ blockNumber,
3885
+ blockTag,
3886
+ requireCanonical
3887
+ });
3888
+ const rpcBlockOverrides = blockOverrides ? toRpc2(blockOverrides) : void 0;
3889
+ const rpcStateOverride = serializeStateOverride(stateOverride);
3890
+ const chainFormat = client.chain?.formatters?.transactionRequest?.format;
3891
+ const format = chainFormat || formatTransactionRequest;
3892
+ const request = format({
3893
+ // Pick out extra data that might exist on the chain's transaction request type.
3894
+ ...extract(rest, { format: chainFormat }),
3895
+ accessList,
3896
+ account,
3897
+ authorizationList,
3898
+ blobs,
3899
+ data,
3900
+ gas,
3901
+ gasPrice,
3902
+ maxFeePerBlobGas,
3903
+ maxFeePerGas,
3904
+ maxPriorityFeePerGas,
3905
+ nonce,
3906
+ to: deploylessCall ? void 0 : to,
3907
+ value
3908
+ }, "call");
3909
+ if (batch && shouldPerformMulticall({ request }) && !rpcBlockOverrides && blockHash === void 0) {
3910
+ try {
3911
+ const { deployless = false } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
3912
+ const multicallAddress = getMulticallAddress(client, {
3913
+ blockNumber,
3914
+ deployless
3915
+ });
3916
+ if (!multicallAddress || !hasStateOverrideForAddress(rpcStateOverride, multicallAddress))
3917
+ return await scheduleMulticall(client, {
3918
+ ...request,
3919
+ blockHash,
3920
+ blockNumber,
3921
+ blockTag,
3922
+ multicallAddress,
3923
+ requestOptions,
3924
+ requireCanonical,
3925
+ rpcStateOverride
3926
+ });
3927
+ } catch (err) {
3928
+ if (!(err instanceof ClientChainNotConfiguredError) && !(err instanceof ChainDoesNotSupportContract))
3929
+ throw err;
3930
+ }
3931
+ }
3932
+ const params = (() => {
3933
+ const base = [
3934
+ request,
3935
+ block
3936
+ ];
3937
+ if (rpcStateOverride && rpcBlockOverrides)
3938
+ return [...base, rpcStateOverride, rpcBlockOverrides];
3939
+ if (rpcStateOverride)
3940
+ return [...base, rpcStateOverride];
3941
+ if (rpcBlockOverrides)
3942
+ return [...base, {}, rpcBlockOverrides];
3943
+ return base;
3944
+ })();
3945
+ const response = await client.request({
3946
+ method: "eth_call",
3947
+ params
3948
+ }, requestOptions);
3949
+ if (response === "0x")
3950
+ return { data: void 0 };
3951
+ return { data: response };
3952
+ } catch (err) {
3953
+ if (requestOptions?.signal?.aborted)
3954
+ throw getAbortError(requestOptions.signal);
3955
+ if (isAbortError(err))
3956
+ throw err;
3957
+ const data2 = getRevertErrorData(err);
3958
+ const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-FXWZDDF5.js");
3959
+ if (client.ccipRead !== false && data2?.slice(0, 10) === offchainLookupSignature2 && to)
3960
+ return {
3961
+ data: await offchainLookup2(client, { data: data2, requestOptions, to })
3962
+ };
3963
+ if (deploylessCall && data2?.slice(0, 10) === "0x101bb98d")
3964
+ throw new CounterfactualDeploymentFailedError({ factory });
3965
+ throw getCallError(err, {
3966
+ ...args,
3967
+ account,
3968
+ chain: client.chain
3969
+ });
3970
+ }
3971
+ }
3972
+ function shouldPerformMulticall({ request }) {
3973
+ const { data, to, ...request_ } = request;
3974
+ if (!data)
3975
+ return false;
3976
+ if (data.startsWith(aggregate3Signature))
3977
+ return false;
3978
+ if (!to)
3979
+ return false;
3980
+ if (Object.values(request_).filter((x) => typeof x !== "undefined").length > 0)
3981
+ return false;
3982
+ return true;
3983
+ }
3984
+ var requestOptionsId = 0;
3985
+ var requestOptionsIds = /* @__PURE__ */ new WeakMap();
3986
+ function getRequestOptionsId(requestOptions) {
3987
+ if (!requestOptions)
3988
+ return "default";
3989
+ const id = requestOptionsIds.get(requestOptions);
3990
+ if (id !== void 0)
3991
+ return id;
3992
+ const nextId = requestOptionsId++;
3993
+ requestOptionsIds.set(requestOptions, nextId);
3994
+ return nextId;
3995
+ }
3996
+ async function scheduleMulticall(client, args) {
3997
+ const { batchSize = 1024, deployless = false, wait = 0 } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
3998
+ const { blockHash, blockNumber, blockTag = client.experimental_blockTag ?? "latest", requireCanonical, data, multicallAddress: multicallAddress_, requestOptions, rpcStateOverride, to } = args;
3999
+ const multicallAddress = multicallAddress_ !== void 0 ? multicallAddress_ : getMulticallAddress(client, {
4000
+ blockNumber,
4001
+ deployless
4002
+ });
4003
+ const block = formatBlockParameter({
4004
+ blockHash,
4005
+ blockNumber,
4006
+ blockTag,
4007
+ requireCanonical
4008
+ });
4009
+ const blockId = typeof block === "string" ? block : JSON.stringify(block);
4010
+ const stateOverrideKey = rpcStateOverride ? `.${JSON.stringify(rpcStateOverride)}` : "";
4011
+ const { schedule } = createBatchScheduler({
4012
+ id: `${client.uid}.${blockId}.${getRequestOptionsId(requestOptions)}${stateOverrideKey}`,
4013
+ wait,
4014
+ shouldSplitBatch(args2) {
4015
+ const size4 = args2.reduce((size5, { data: data2 }) => size5 + (data2.length - 2), 0);
4016
+ return size4 > batchSize * 2;
4017
+ },
4018
+ fn: async (requests) => {
4019
+ const calls = requests.map((request) => ({
4020
+ allowFailure: true,
4021
+ callData: request.data,
4022
+ target: request.to
4023
+ }));
4024
+ const calldata = encodeFunctionData({
4025
+ abi: multicall3Abi,
4026
+ args: [calls],
4027
+ functionName: "aggregate3"
4028
+ });
4029
+ const multicallRequest = {
4030
+ ...multicallAddress === null ? {
4031
+ data: toDeploylessCallViaBytecodeData({
4032
+ code: multicall3Bytecode,
4033
+ data: calldata
4034
+ })
4035
+ } : { to: multicallAddress, data: calldata }
4036
+ };
4037
+ const data2 = await client.request({
4038
+ method: "eth_call",
4039
+ params: rpcStateOverride ? [multicallRequest, block, rpcStateOverride] : [multicallRequest, block]
4040
+ }, requestOptions);
4041
+ return decodeFunctionResult({
4042
+ abi: multicall3Abi,
4043
+ args: [calls],
4044
+ functionName: "aggregate3",
4045
+ data: data2 || "0x"
4046
+ });
4047
+ }
4048
+ });
4049
+ const [{ returnData, success }] = await schedule({ data, to });
4050
+ if (!success)
4051
+ throw new RawContractError({ data: returnData });
4052
+ if (returnData === "0x")
4053
+ return { data: void 0 };
4054
+ return { data: returnData };
4055
+ }
4056
+ function getMulticallAddress(client, parameters) {
4057
+ const { blockNumber, deployless } = parameters;
4058
+ if (deployless)
4059
+ return null;
4060
+ if (client.chain)
4061
+ return getChainContractAddress({
4062
+ blockNumber,
4063
+ chain: client.chain,
4064
+ contract: "multicall3"
4065
+ });
4066
+ throw new ClientChainNotConfiguredError();
4067
+ }
4068
+ function hasStateOverrideForAddress(rpcStateOverride, address) {
4069
+ if (!rpcStateOverride)
4070
+ return false;
4071
+ return Object.keys(rpcStateOverride).some((stateOverrideAddress) => isAddressEqual(stateOverrideAddress, address));
4072
+ }
4073
+ function toDeploylessCallViaBytecodeData(parameters) {
4074
+ const { code, data } = parameters;
4075
+ return encodeDeployData({
4076
+ abi: parseAbi(["constructor(bytes, bytes)"]),
4077
+ bytecode: deploylessCallViaBytecodeBytecode,
4078
+ args: [code, data]
4079
+ });
4080
+ }
4081
+ function toDeploylessCallViaFactoryData(parameters) {
4082
+ const { data, factory, factoryData, to } = parameters;
4083
+ return encodeDeployData({
4084
+ abi: parseAbi(["constructor(address, bytes, address, bytes)"]),
4085
+ bytecode: deploylessCallViaFactoryBytecode,
4086
+ args: [to, data, factory, factoryData]
4087
+ });
4088
+ }
4089
+ function getRevertErrorData(err) {
4090
+ if (!(err instanceof BaseError))
4091
+ return void 0;
4092
+ const error = err.walk();
4093
+ return typeof error?.data === "object" ? error.data?.data : error.data;
4094
+ }
4095
+
4096
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/ccip.js
4097
+ var OffchainLookupError = class extends BaseError {
4098
+ constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
4099
+ super(cause.shortMessage || "An error occurred while fetching for an offchain result.", {
4100
+ cause,
4101
+ metaMessages: [
4102
+ ...cause.metaMessages || [],
4103
+ cause.metaMessages?.length ? "" : [],
4104
+ "Offchain Gateway Call:",
4105
+ urls && [
4106
+ " Gateway URL(s):",
4107
+ ...urls.map((url) => ` ${getUrl(url)}`)
4108
+ ],
4109
+ ` Sender: ${sender}`,
4110
+ ` Data: ${data}`,
4111
+ ` Callback selector: ${callbackSelector}`,
4112
+ ` Extra data: ${extraData}`
4113
+ ].flat(),
4114
+ name: "OffchainLookupError"
4115
+ });
4116
+ }
4117
+ };
4118
+ var OffchainLookupResponseMalformedError = class extends BaseError {
4119
+ constructor({ result, url }) {
4120
+ super("Offchain gateway response is malformed. Response data must be a hex value.", {
4121
+ metaMessages: [
4122
+ `Gateway URL: ${getUrl(url)}`,
4123
+ `Response: ${stringify(result)}`
4124
+ ],
4125
+ name: "OffchainLookupResponseMalformedError"
4126
+ });
4127
+ }
4128
+ };
4129
+ var OffchainLookupSenderMismatchError = class extends BaseError {
4130
+ constructor({ sender, to }) {
4131
+ super("Reverted sender address does not match target contract address (`to`).", {
4132
+ metaMessages: [
4133
+ `Contract address: ${to}`,
4134
+ `OffchainLookup sender address: ${sender}`
4135
+ ],
4136
+ name: "OffchainLookupSenderMismatchError"
4137
+ });
4138
+ }
4139
+ };
4140
+
4141
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/decodeFunctionData.js
4142
+ function decodeFunctionData(parameters) {
4143
+ const { abi, data } = parameters;
4144
+ const signature = slice(data, 0, 4);
4145
+ const description = abi.find((x) => x.type === "function" && signature === toFunctionSelector(formatAbiItem(x)));
4146
+ if (!description)
4147
+ throw new AbiFunctionSignatureNotFoundError(signature, {
4148
+ docsPath: "/docs/contract/decodeFunctionData"
4149
+ });
4150
+ return {
4151
+ functionName: description.name,
4152
+ args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs, slice(data, 4)) : void 0
4153
+ };
4154
+ }
4155
+
4156
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeErrorResult.js
4157
+ var docsPath4 = "/docs/contract/encodeErrorResult";
4158
+ function encodeErrorResult(parameters) {
4159
+ const { abi, errorName, args } = parameters;
4160
+ let abiItem = abi[0];
4161
+ if (errorName) {
4162
+ const item = getAbiItem({ abi, args, name: errorName });
4163
+ if (!item)
4164
+ throw new AbiErrorNotFoundError(errorName, { docsPath: docsPath4 });
4165
+ abiItem = item;
4166
+ }
4167
+ if (abiItem.type !== "error")
4168
+ throw new AbiErrorNotFoundError(void 0, { docsPath: docsPath4 });
4169
+ const definition = formatAbiItem(abiItem);
4170
+ const signature = toFunctionSelector(definition);
4171
+ let data = "0x";
4172
+ if (args && args.length > 0) {
4173
+ if (!abiItem.inputs)
4174
+ throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath: docsPath4 });
4175
+ data = encodeAbiParameters(abiItem.inputs, args);
4176
+ }
4177
+ return concatHex([signature, data]);
4178
+ }
4179
+
4180
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js
4181
+ var docsPath5 = "/docs/contract/encodeFunctionResult";
4182
+ function encodeFunctionResult(parameters) {
4183
+ const { abi, functionName, result } = parameters;
4184
+ let abiItem = abi[0];
4185
+ if (functionName) {
4186
+ const item = getAbiItem({ abi, name: functionName });
4187
+ if (!item)
4188
+ throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath5 });
4189
+ abiItem = item;
4190
+ }
4191
+ if (abiItem.type !== "function")
4192
+ throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath5 });
4193
+ if (!abiItem.outputs)
4194
+ throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath5 });
4195
+ const values = (() => {
4196
+ if (abiItem.outputs.length === 0)
4197
+ return [];
4198
+ if (abiItem.outputs.length === 1)
4199
+ return [result];
4200
+ if (Array.isArray(result))
4201
+ return result;
4202
+ throw new InvalidArrayError(result);
4203
+ })();
4204
+ return encodeAbiParameters(abiItem.outputs, values);
4205
+ }
4206
+
4207
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js
4208
+ var localBatchGatewayUrl = "x-batch-gateway:true";
4209
+ async function localBatchGatewayRequest(parameters) {
4210
+ const { data, ccipRequest: ccipRequest2 } = parameters;
4211
+ const { args: [queries] } = decodeFunctionData({ abi: batchGatewayAbi, data });
4212
+ const failures = [];
4213
+ const responses = [];
4214
+ await Promise.all(queries.map(async (query, i) => {
4215
+ try {
4216
+ responses[i] = query.urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({ data: query.data, ccipRequest: ccipRequest2 }) : await ccipRequest2(query);
4217
+ failures[i] = false;
4218
+ } catch (err) {
4219
+ failures[i] = true;
4220
+ responses[i] = encodeError(err);
4221
+ }
4222
+ }));
4223
+ return encodeFunctionResult({
4224
+ abi: batchGatewayAbi,
4225
+ functionName: "query",
4226
+ result: [failures, responses]
4227
+ });
4228
+ }
4229
+ function encodeError(error) {
4230
+ if (error.name === "HttpRequestError" && error.status)
4231
+ return encodeErrorResult({
4232
+ abi: batchGatewayAbi,
4233
+ errorName: "HttpError",
4234
+ args: [error.status, error.shortMessage]
4235
+ });
4236
+ return encodeErrorResult({
4237
+ abi: [solidityError],
4238
+ errorName: "Error",
4239
+ args: ["shortMessage" in error ? error.shortMessage : error.message]
4240
+ });
4241
+ }
4242
+
4243
+ // node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/ccip.js
4244
+ var offchainLookupSignature = "0x556f1830";
4245
+ var offchainLookupAbiItem = {
4246
+ name: "OffchainLookup",
4247
+ type: "error",
4248
+ inputs: [
4249
+ {
4250
+ name: "sender",
4251
+ type: "address"
4252
+ },
4253
+ {
4254
+ name: "urls",
4255
+ type: "string[]"
4256
+ },
4257
+ {
4258
+ name: "callData",
4259
+ type: "bytes"
4260
+ },
4261
+ {
4262
+ name: "callbackFunction",
4263
+ type: "bytes4"
4264
+ },
4265
+ {
4266
+ name: "extraData",
4267
+ type: "bytes"
4268
+ }
4269
+ ]
4270
+ };
4271
+ async function offchainLookup(client, { blockNumber, blockTag, data, requestOptions, to }) {
4272
+ const { args } = decodeErrorResult({
4273
+ data,
4274
+ abi: [offchainLookupAbiItem]
4275
+ });
4276
+ const [sender, urls, callData, callbackSelector, extraData] = args;
4277
+ const { ccipRead } = client;
4278
+ const ccipRequest_ = ccipRead && typeof ccipRead?.request === "function" ? ccipRead.request : ccipRequest;
4279
+ try {
4280
+ if (!isAddressEqual(to, sender))
4281
+ throw new OffchainLookupSenderMismatchError({ sender, to });
4282
+ const result = urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({
4283
+ data: callData,
4284
+ ccipRequest: (parameters) => ccipRequest_({ ...parameters, requestOptions })
4285
+ }) : await ccipRequest_({ data: callData, requestOptions, sender, urls });
4286
+ const { data: data_ } = await call(client, {
4287
+ blockNumber,
4288
+ blockTag,
4289
+ data: concat([
4290
+ callbackSelector,
4291
+ encodeAbiParameters([{ type: "bytes" }, { type: "bytes" }], [result, extraData])
4292
+ ]),
4293
+ requestOptions,
4294
+ to
4295
+ });
4296
+ return data_;
4297
+ } catch (err) {
4298
+ if (requestOptions?.signal?.aborted)
4299
+ throw getAbortError(requestOptions.signal);
4300
+ if (isAbortError(err))
4301
+ throw err;
4302
+ throw new OffchainLookupError({
4303
+ callbackSelector,
4304
+ cause: err,
4305
+ data,
4306
+ extraData,
4307
+ sender,
4308
+ urls
4309
+ });
4310
+ }
4311
+ }
4312
+ async function ccipRequest({ data, requestOptions, sender, urls }) {
4313
+ let error = new Error("An unknown error occurred.");
4314
+ for (let i = 0; i < urls.length; i++) {
4315
+ if (requestOptions?.signal?.aborted)
4316
+ throw getAbortError(requestOptions.signal);
4317
+ const url = urls[i];
4318
+ const method = url.includes("{data}") ? "GET" : "POST";
4319
+ const body = method === "POST" ? { data, sender } : void 0;
4320
+ const headers = method === "POST" ? { "Content-Type": "application/json" } : {};
4321
+ try {
4322
+ const response = await fetch(url.replace("{sender}", sender.toLowerCase()).replace("{data}", data), {
4323
+ body: JSON.stringify(body),
4324
+ headers,
4325
+ method,
4326
+ ...requestOptions?.signal ? { signal: requestOptions.signal } : {}
4327
+ });
4328
+ let result;
4329
+ if (response.headers.get("Content-Type")?.startsWith("application/json")) {
4330
+ result = (await response.json()).data;
4331
+ } else {
4332
+ result = await response.text();
4333
+ }
4334
+ if (!response.ok) {
4335
+ error = new HttpRequestError({
4336
+ body,
4337
+ details: result?.error ? stringify(result.error) : response.statusText,
4338
+ headers: response.headers,
4339
+ status: response.status,
4340
+ url
4341
+ });
4342
+ continue;
4343
+ }
4344
+ if (!isHex(result)) {
4345
+ error = new OffchainLookupResponseMalformedError({
4346
+ result,
4347
+ url
4348
+ });
4349
+ continue;
4350
+ }
4351
+ return result;
4352
+ } catch (err) {
4353
+ if (requestOptions?.signal?.aborted)
4354
+ throw getAbortError(requestOptions.signal);
4355
+ if (isAbortError(err))
4356
+ throw err;
4357
+ error = new HttpRequestError({
4358
+ body,
4359
+ details: err.message,
4360
+ url
4361
+ });
4362
+ }
4363
+ }
4364
+ throw error;
4365
+ }
4366
+
4367
+ export {
4368
+ formatBlockParameter,
4369
+ formatAbiParameters,
4370
+ formatAbiItem2 as formatAbiItem,
4371
+ parseAbiItem,
4372
+ parseAbiParameters,
4373
+ toEventSelector,
4374
+ getAbiItem,
4375
+ encodeFunctionData,
4376
+ decodeAbiParameters,
4377
+ getAbortError,
4378
+ isAbortError,
4379
+ CallExecutionError,
4380
+ ContractFunctionExecutionError,
4381
+ ContractFunctionRevertedError,
4382
+ ContractFunctionZeroDataError,
4383
+ RawContractError,
4384
+ HttpRequestError,
4385
+ ResponseBodyTooLargeError,
4386
+ RpcRequestError,
4387
+ TimeoutError,
4388
+ ParseRpcError,
4389
+ InvalidRequestRpcError,
4390
+ MethodNotFoundRpcError,
4391
+ InvalidParamsRpcError,
4392
+ InternalRpcError,
4393
+ InvalidInputRpcError,
4394
+ ResourceNotFoundRpcError,
4395
+ ResourceUnavailableRpcError,
4396
+ TransactionRejectedRpcError,
4397
+ MethodNotSupportedRpcError,
4398
+ LimitExceededRpcError,
4399
+ JsonRpcVersionUnsupportedError,
4400
+ UserRejectedRequestError,
4401
+ UnauthorizedProviderError,
4402
+ UnsupportedProviderMethodError,
4403
+ ProviderDisconnectedError,
4404
+ ChainDisconnectedError,
4405
+ SwitchChainError,
4406
+ UnsupportedNonOptionalCapabilityError,
4407
+ UnsupportedChainIdError,
4408
+ DuplicateIdError,
4409
+ UnknownBundleIdError,
4410
+ BundleTooLargeError,
4411
+ AtomicReadyWalletRejectedUpgradeError,
4412
+ AtomicityNotSupportedError,
4413
+ WalletConnectSessionSettlementError,
4414
+ UnknownRpcError,
4415
+ getNodeError,
4416
+ extract,
4417
+ defineFormatter,
4418
+ formatTransactionRequest,
4419
+ serializeStateOverride,
4420
+ assertRequest,
4421
+ isAddressEqual,
4422
+ decodeFunctionResult,
4423
+ BaseError3 as BaseError,
4424
+ stringify2 as stringify,
4425
+ from,
4426
+ fromHex,
4427
+ fromString,
4428
+ size2 as size,
4429
+ slice2 as slice,
4430
+ toBigInt2 as toBigInt,
4431
+ toBoolean,
4432
+ toNumber2 as toNumber,
4433
+ toString,
4434
+ trimLeft,
4435
+ validate,
4436
+ concat2 as concat,
4437
+ from2,
4438
+ fromBoolean,
4439
+ fromBytes,
4440
+ fromNumber,
4441
+ fromString2,
4442
+ padLeft,
4443
+ padRight,
4444
+ slice3 as slice2,
4445
+ size3 as size2,
4446
+ trimLeft2,
4447
+ toNumber as toNumber2,
4448
+ validate2,
4449
+ IntegerOutOfRangeError,
4450
+ toRpc2 as toRpc,
4451
+ multicall3Abi,
4452
+ universalResolverResolveAbi,
4453
+ universalResolverReverseAbi,
4454
+ textResolverAbi,
4455
+ addressResolverAbi,
4456
+ erc1271Abi,
4457
+ erc6492SignatureValidatorAbi,
4458
+ erc20Abi,
4459
+ deploylessCallViaBytecodeBytecode,
4460
+ erc6492SignatureValidatorByteCode,
4461
+ multicall3Bytecode,
4462
+ encodeDeployData,
4463
+ getChainContractAddress,
4464
+ getCallError,
4465
+ withResolvers,
4466
+ createBatchScheduler,
4467
+ localBatchGatewayUrl,
4468
+ offchainLookupSignature,
4469
+ offchainLookupAbiItem,
4470
+ offchainLookup,
4471
+ ccipRequest,
4472
+ call
4473
+ };
4474
+ //# sourceMappingURL=chunk-WOHCAMDQ.js.map