@farcaster/create-mini-app 0.0.5 → 0.0.7

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