@zoralabs/protocol-deployments 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +43 -34
- package/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/dist/{_esm-ZN7ZVJVO.js → _esm-PPK7XFKN.js} +278 -382
- package/dist/_esm-PPK7XFKN.js.map +1 -0
- package/dist/{ccip-IGMHQQR7.js → ccip-6BNOCQCH.js} +3 -3
- package/dist/{chunk-2FDPSBOH.js → chunk-5JV63AHR.js} +58 -47
- package/dist/chunk-5JV63AHR.js.map +1 -0
- package/dist/{chunk-KIPP2F4J.js → chunk-6M375I5V.js} +956 -216
- package/dist/chunk-6M375I5V.js.map +1 -0
- package/dist/generated/wagmi.d.ts +24 -24
- package/dist/index.cjs +104 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{secp256k1-R7PEGLZR.js → secp256k1-5CEPNAX3.js} +109 -87
- package/dist/secp256k1-5CEPNAX3.js.map +1 -0
- package/dist/typedData.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/generated/wagmi.ts +24 -24
- package/src/index.ts +1 -1
- package/tsconfig.build.json +1 -1
- package/tsconfig.json +1 -1
- package/dist/_esm-ZN7ZVJVO.js.map +0 -1
- package/dist/chunk-2FDPSBOH.js.map +0 -1
- package/dist/chunk-KIPP2F4J.js.map +0 -1
- package/dist/secp256k1-R7PEGLZR.js.map +0 -1
- /package/dist/{ccip-IGMHQQR7.js.map → ccip-6BNOCQCH.js.map} +0 -0
|
@@ -1,23 +1,707 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Hash,
|
|
3
|
+
byteSwap32,
|
|
3
4
|
bytes,
|
|
4
5
|
exists,
|
|
6
|
+
isLE,
|
|
5
7
|
number,
|
|
6
8
|
output,
|
|
7
9
|
toBytes,
|
|
8
10
|
u32,
|
|
9
11
|
wrapConstructor,
|
|
10
12
|
wrapXOFConstructorWithOpts
|
|
11
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5JV63AHR.js";
|
|
12
14
|
|
|
13
|
-
// ../../node_modules/
|
|
15
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/version.js
|
|
16
|
+
var version = "1.0.5";
|
|
17
|
+
|
|
18
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/errors.js
|
|
19
|
+
var BaseError = class _BaseError extends Error {
|
|
20
|
+
constructor(shortMessage, args = {}) {
|
|
21
|
+
const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
|
|
22
|
+
const docsPath4 = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
|
|
23
|
+
const message = [
|
|
24
|
+
shortMessage || "An error occurred.",
|
|
25
|
+
"",
|
|
26
|
+
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
27
|
+
...docsPath4 ? [`Docs: https://abitype.dev${docsPath4}`] : [],
|
|
28
|
+
...details ? [`Details: ${details}`] : [],
|
|
29
|
+
`Version: abitype@${version}`
|
|
30
|
+
].join("\n");
|
|
31
|
+
super(message);
|
|
32
|
+
Object.defineProperty(this, "details", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
writable: true,
|
|
36
|
+
value: void 0
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(this, "docsPath", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
configurable: true,
|
|
41
|
+
writable: true,
|
|
42
|
+
value: void 0
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(this, "metaMessages", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
configurable: true,
|
|
47
|
+
writable: true,
|
|
48
|
+
value: void 0
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(this, "shortMessage", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: void 0
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(this, "name", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
writable: true,
|
|
60
|
+
value: "AbiTypeError"
|
|
61
|
+
});
|
|
62
|
+
if (args.cause)
|
|
63
|
+
this.cause = args.cause;
|
|
64
|
+
this.details = details;
|
|
65
|
+
this.docsPath = docsPath4;
|
|
66
|
+
this.metaMessages = args.metaMessages;
|
|
67
|
+
this.shortMessage = shortMessage;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/regex.js
|
|
72
|
+
function execTyped(regex, string) {
|
|
73
|
+
const match = regex.exec(string);
|
|
74
|
+
return match?.groups;
|
|
75
|
+
}
|
|
76
|
+
var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
|
|
77
|
+
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)?$/;
|
|
78
|
+
var isTupleRegex = /^\(.+?\).*?$/;
|
|
79
|
+
|
|
80
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
|
|
81
|
+
var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
82
|
+
function formatAbiParameter(abiParameter) {
|
|
83
|
+
let type = abiParameter.type;
|
|
84
|
+
if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
|
|
85
|
+
type = "(";
|
|
86
|
+
const length = abiParameter.components.length;
|
|
87
|
+
for (let i = 0; i < length; i++) {
|
|
88
|
+
const component = abiParameter.components[i];
|
|
89
|
+
type += formatAbiParameter(component);
|
|
90
|
+
if (i < length - 1)
|
|
91
|
+
type += ", ";
|
|
92
|
+
}
|
|
93
|
+
const result = execTyped(tupleRegex, abiParameter.type);
|
|
94
|
+
type += `)${result?.array ?? ""}`;
|
|
95
|
+
return formatAbiParameter({
|
|
96
|
+
...abiParameter,
|
|
97
|
+
type
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if ("indexed" in abiParameter && abiParameter.indexed)
|
|
101
|
+
type = `${type} indexed`;
|
|
102
|
+
if (abiParameter.name)
|
|
103
|
+
return `${type} ${abiParameter.name}`;
|
|
104
|
+
return type;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
|
|
108
|
+
function formatAbiParameters(abiParameters) {
|
|
109
|
+
let params = "";
|
|
110
|
+
const length = abiParameters.length;
|
|
111
|
+
for (let i = 0; i < length; i++) {
|
|
112
|
+
const abiParameter = abiParameters[i];
|
|
113
|
+
params += formatAbiParameter(abiParameter);
|
|
114
|
+
if (i !== length - 1)
|
|
115
|
+
params += ", ";
|
|
116
|
+
}
|
|
117
|
+
return params;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
|
|
121
|
+
function formatAbiItem(abiItem) {
|
|
122
|
+
if (abiItem.type === "function")
|
|
123
|
+
return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
|
|
124
|
+
if (abiItem.type === "event")
|
|
125
|
+
return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
126
|
+
if (abiItem.type === "error")
|
|
127
|
+
return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
128
|
+
if (abiItem.type === "constructor")
|
|
129
|
+
return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
|
|
130
|
+
if (abiItem.type === "fallback")
|
|
131
|
+
return "fallback()";
|
|
132
|
+
return "receive() external payable";
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js
|
|
136
|
+
var errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
137
|
+
function isErrorSignature(signature) {
|
|
138
|
+
return errorSignatureRegex.test(signature);
|
|
139
|
+
}
|
|
140
|
+
function execErrorSignature(signature) {
|
|
141
|
+
return execTyped(errorSignatureRegex, signature);
|
|
142
|
+
}
|
|
143
|
+
var eventSignatureRegex = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
144
|
+
function isEventSignature(signature) {
|
|
145
|
+
return eventSignatureRegex.test(signature);
|
|
146
|
+
}
|
|
147
|
+
function execEventSignature(signature) {
|
|
148
|
+
return execTyped(eventSignatureRegex, signature);
|
|
149
|
+
}
|
|
150
|
+
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>.*?)\))?$/;
|
|
151
|
+
function isFunctionSignature(signature) {
|
|
152
|
+
return functionSignatureRegex.test(signature);
|
|
153
|
+
}
|
|
154
|
+
function execFunctionSignature(signature) {
|
|
155
|
+
return execTyped(functionSignatureRegex, signature);
|
|
156
|
+
}
|
|
157
|
+
var structSignatureRegex = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
158
|
+
function isStructSignature(signature) {
|
|
159
|
+
return structSignatureRegex.test(signature);
|
|
160
|
+
}
|
|
161
|
+
function execStructSignature(signature) {
|
|
162
|
+
return execTyped(structSignatureRegex, signature);
|
|
163
|
+
}
|
|
164
|
+
var constructorSignatureRegex = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
165
|
+
function isConstructorSignature(signature) {
|
|
166
|
+
return constructorSignatureRegex.test(signature);
|
|
167
|
+
}
|
|
168
|
+
function execConstructorSignature(signature) {
|
|
169
|
+
return execTyped(constructorSignatureRegex, signature);
|
|
170
|
+
}
|
|
171
|
+
var fallbackSignatureRegex = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
172
|
+
function isFallbackSignature(signature) {
|
|
173
|
+
return fallbackSignatureRegex.test(signature);
|
|
174
|
+
}
|
|
175
|
+
var receiveSignatureRegex = /^receive\(\) external payable$/;
|
|
176
|
+
function isReceiveSignature(signature) {
|
|
177
|
+
return receiveSignatureRegex.test(signature);
|
|
178
|
+
}
|
|
179
|
+
var eventModifiers = /* @__PURE__ */ new Set(["indexed"]);
|
|
180
|
+
var functionModifiers = /* @__PURE__ */ new Set([
|
|
181
|
+
"calldata",
|
|
182
|
+
"memory",
|
|
183
|
+
"storage"
|
|
184
|
+
]);
|
|
185
|
+
|
|
186
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js
|
|
187
|
+
var UnknownTypeError = class extends BaseError {
|
|
188
|
+
constructor({ type }) {
|
|
189
|
+
super("Unknown type.", {
|
|
190
|
+
metaMessages: [
|
|
191
|
+
`Type "${type}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(this, "name", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
configurable: true,
|
|
197
|
+
writable: true,
|
|
198
|
+
value: "UnknownTypeError"
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
var UnknownSolidityTypeError = class extends BaseError {
|
|
203
|
+
constructor({ type }) {
|
|
204
|
+
super("Unknown type.", {
|
|
205
|
+
metaMessages: [`Type "${type}" is not a valid ABI type.`]
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(this, "name", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
configurable: true,
|
|
210
|
+
writable: true,
|
|
211
|
+
value: "UnknownSolidityTypeError"
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js
|
|
217
|
+
var InvalidParameterError = class extends BaseError {
|
|
218
|
+
constructor({ param }) {
|
|
219
|
+
super("Invalid ABI parameter.", {
|
|
220
|
+
details: param
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(this, "name", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
configurable: true,
|
|
225
|
+
writable: true,
|
|
226
|
+
value: "InvalidParameterError"
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var SolidityProtectedKeywordError = class extends BaseError {
|
|
231
|
+
constructor({ param, name }) {
|
|
232
|
+
super("Invalid ABI parameter.", {
|
|
233
|
+
details: param,
|
|
234
|
+
metaMessages: [
|
|
235
|
+
`"${name}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
Object.defineProperty(this, "name", {
|
|
239
|
+
enumerable: true,
|
|
240
|
+
configurable: true,
|
|
241
|
+
writable: true,
|
|
242
|
+
value: "SolidityProtectedKeywordError"
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var InvalidModifierError = class extends BaseError {
|
|
247
|
+
constructor({ param, type, modifier }) {
|
|
248
|
+
super("Invalid ABI parameter.", {
|
|
249
|
+
details: param,
|
|
250
|
+
metaMessages: [
|
|
251
|
+
`Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`
|
|
252
|
+
]
|
|
253
|
+
});
|
|
254
|
+
Object.defineProperty(this, "name", {
|
|
255
|
+
enumerable: true,
|
|
256
|
+
configurable: true,
|
|
257
|
+
writable: true,
|
|
258
|
+
value: "InvalidModifierError"
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
var InvalidFunctionModifierError = class extends BaseError {
|
|
263
|
+
constructor({ param, type, modifier }) {
|
|
264
|
+
super("Invalid ABI parameter.", {
|
|
265
|
+
details: param,
|
|
266
|
+
metaMessages: [
|
|
267
|
+
`Modifier "${modifier}" not allowed${type ? ` in "${type}" type` : ""}.`,
|
|
268
|
+
`Data location can only be specified for array, struct, or mapping types, but "${modifier}" was given.`
|
|
269
|
+
]
|
|
270
|
+
});
|
|
271
|
+
Object.defineProperty(this, "name", {
|
|
272
|
+
enumerable: true,
|
|
273
|
+
configurable: true,
|
|
274
|
+
writable: true,
|
|
275
|
+
value: "InvalidFunctionModifierError"
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var InvalidAbiTypeParameterError = class extends BaseError {
|
|
280
|
+
constructor({ abiParameter }) {
|
|
281
|
+
super("Invalid ABI parameter.", {
|
|
282
|
+
details: JSON.stringify(abiParameter, null, 2),
|
|
283
|
+
metaMessages: ["ABI parameter type is invalid."]
|
|
284
|
+
});
|
|
285
|
+
Object.defineProperty(this, "name", {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
configurable: true,
|
|
288
|
+
writable: true,
|
|
289
|
+
value: "InvalidAbiTypeParameterError"
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/errors/signature.js
|
|
295
|
+
var InvalidSignatureError = class extends BaseError {
|
|
296
|
+
constructor({ signature, type }) {
|
|
297
|
+
super(`Invalid ${type} signature.`, {
|
|
298
|
+
details: signature
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(this, "name", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
configurable: true,
|
|
303
|
+
writable: true,
|
|
304
|
+
value: "InvalidSignatureError"
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
var UnknownSignatureError = class extends BaseError {
|
|
309
|
+
constructor({ signature }) {
|
|
310
|
+
super("Unknown signature.", {
|
|
311
|
+
details: signature
|
|
312
|
+
});
|
|
313
|
+
Object.defineProperty(this, "name", {
|
|
314
|
+
enumerable: true,
|
|
315
|
+
configurable: true,
|
|
316
|
+
writable: true,
|
|
317
|
+
value: "UnknownSignatureError"
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
var InvalidStructSignatureError = class extends BaseError {
|
|
322
|
+
constructor({ signature }) {
|
|
323
|
+
super("Invalid struct signature.", {
|
|
324
|
+
details: signature,
|
|
325
|
+
metaMessages: ["No properties exist."]
|
|
326
|
+
});
|
|
327
|
+
Object.defineProperty(this, "name", {
|
|
328
|
+
enumerable: true,
|
|
329
|
+
configurable: true,
|
|
330
|
+
writable: true,
|
|
331
|
+
value: "InvalidStructSignatureError"
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/errors/struct.js
|
|
337
|
+
var CircularReferenceError = class extends BaseError {
|
|
338
|
+
constructor({ type }) {
|
|
339
|
+
super("Circular reference detected.", {
|
|
340
|
+
metaMessages: [`Struct "${type}" is a circular reference.`]
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(this, "name", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
configurable: true,
|
|
345
|
+
writable: true,
|
|
346
|
+
value: "CircularReferenceError"
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js
|
|
352
|
+
var InvalidParenthesisError = class extends BaseError {
|
|
353
|
+
constructor({ current, depth }) {
|
|
354
|
+
super("Unbalanced parentheses.", {
|
|
355
|
+
metaMessages: [
|
|
356
|
+
`"${current.trim()}" has too many ${depth > 0 ? "opening" : "closing"} parentheses.`
|
|
357
|
+
],
|
|
358
|
+
details: `Depth "${depth}"`
|
|
359
|
+
});
|
|
360
|
+
Object.defineProperty(this, "name", {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
configurable: true,
|
|
363
|
+
writable: true,
|
|
364
|
+
value: "InvalidParenthesisError"
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/runtime/cache.js
|
|
370
|
+
function getParameterCacheKey(param, type) {
|
|
371
|
+
if (type)
|
|
372
|
+
return `${type}:${param}`;
|
|
373
|
+
return param;
|
|
374
|
+
}
|
|
375
|
+
var parameterCache = /* @__PURE__ */ new Map([
|
|
376
|
+
// Unnamed
|
|
377
|
+
["address", { type: "address" }],
|
|
378
|
+
["bool", { type: "bool" }],
|
|
379
|
+
["bytes", { type: "bytes" }],
|
|
380
|
+
["bytes32", { type: "bytes32" }],
|
|
381
|
+
["int", { type: "int256" }],
|
|
382
|
+
["int256", { type: "int256" }],
|
|
383
|
+
["string", { type: "string" }],
|
|
384
|
+
["uint", { type: "uint256" }],
|
|
385
|
+
["uint8", { type: "uint8" }],
|
|
386
|
+
["uint16", { type: "uint16" }],
|
|
387
|
+
["uint24", { type: "uint24" }],
|
|
388
|
+
["uint32", { type: "uint32" }],
|
|
389
|
+
["uint64", { type: "uint64" }],
|
|
390
|
+
["uint96", { type: "uint96" }],
|
|
391
|
+
["uint112", { type: "uint112" }],
|
|
392
|
+
["uint160", { type: "uint160" }],
|
|
393
|
+
["uint192", { type: "uint192" }],
|
|
394
|
+
["uint256", { type: "uint256" }],
|
|
395
|
+
// Named
|
|
396
|
+
["address owner", { type: "address", name: "owner" }],
|
|
397
|
+
["address to", { type: "address", name: "to" }],
|
|
398
|
+
["bool approved", { type: "bool", name: "approved" }],
|
|
399
|
+
["bytes _data", { type: "bytes", name: "_data" }],
|
|
400
|
+
["bytes data", { type: "bytes", name: "data" }],
|
|
401
|
+
["bytes signature", { type: "bytes", name: "signature" }],
|
|
402
|
+
["bytes32 hash", { type: "bytes32", name: "hash" }],
|
|
403
|
+
["bytes32 r", { type: "bytes32", name: "r" }],
|
|
404
|
+
["bytes32 root", { type: "bytes32", name: "root" }],
|
|
405
|
+
["bytes32 s", { type: "bytes32", name: "s" }],
|
|
406
|
+
["string name", { type: "string", name: "name" }],
|
|
407
|
+
["string symbol", { type: "string", name: "symbol" }],
|
|
408
|
+
["string tokenURI", { type: "string", name: "tokenURI" }],
|
|
409
|
+
["uint tokenId", { type: "uint256", name: "tokenId" }],
|
|
410
|
+
["uint8 v", { type: "uint8", name: "v" }],
|
|
411
|
+
["uint256 balance", { type: "uint256", name: "balance" }],
|
|
412
|
+
["uint256 tokenId", { type: "uint256", name: "tokenId" }],
|
|
413
|
+
["uint256 value", { type: "uint256", name: "value" }],
|
|
414
|
+
// Indexed
|
|
415
|
+
[
|
|
416
|
+
"event:address indexed from",
|
|
417
|
+
{ type: "address", name: "from", indexed: true }
|
|
418
|
+
],
|
|
419
|
+
["event:address indexed to", { type: "address", name: "to", indexed: true }],
|
|
420
|
+
[
|
|
421
|
+
"event:uint indexed tokenId",
|
|
422
|
+
{ type: "uint256", name: "tokenId", indexed: true }
|
|
423
|
+
],
|
|
424
|
+
[
|
|
425
|
+
"event:uint256 indexed tokenId",
|
|
426
|
+
{ type: "uint256", name: "tokenId", indexed: true }
|
|
427
|
+
]
|
|
428
|
+
]);
|
|
429
|
+
|
|
430
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/runtime/utils.js
|
|
431
|
+
function parseSignature(signature, structs = {}) {
|
|
432
|
+
if (isFunctionSignature(signature)) {
|
|
433
|
+
const match = execFunctionSignature(signature);
|
|
434
|
+
if (!match)
|
|
435
|
+
throw new InvalidSignatureError({ signature, type: "function" });
|
|
436
|
+
const inputParams = splitParameters(match.parameters);
|
|
437
|
+
const inputs = [];
|
|
438
|
+
const inputLength = inputParams.length;
|
|
439
|
+
for (let i = 0; i < inputLength; i++) {
|
|
440
|
+
inputs.push(parseAbiParameter(inputParams[i], {
|
|
441
|
+
modifiers: functionModifiers,
|
|
442
|
+
structs,
|
|
443
|
+
type: "function"
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
const outputs = [];
|
|
447
|
+
if (match.returns) {
|
|
448
|
+
const outputParams = splitParameters(match.returns);
|
|
449
|
+
const outputLength = outputParams.length;
|
|
450
|
+
for (let i = 0; i < outputLength; i++) {
|
|
451
|
+
outputs.push(parseAbiParameter(outputParams[i], {
|
|
452
|
+
modifiers: functionModifiers,
|
|
453
|
+
structs,
|
|
454
|
+
type: "function"
|
|
455
|
+
}));
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return {
|
|
459
|
+
name: match.name,
|
|
460
|
+
type: "function",
|
|
461
|
+
stateMutability: match.stateMutability ?? "nonpayable",
|
|
462
|
+
inputs,
|
|
463
|
+
outputs
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
if (isEventSignature(signature)) {
|
|
467
|
+
const match = execEventSignature(signature);
|
|
468
|
+
if (!match)
|
|
469
|
+
throw new InvalidSignatureError({ signature, type: "event" });
|
|
470
|
+
const params = splitParameters(match.parameters);
|
|
471
|
+
const abiParameters = [];
|
|
472
|
+
const length = params.length;
|
|
473
|
+
for (let i = 0; i < length; i++) {
|
|
474
|
+
abiParameters.push(parseAbiParameter(params[i], {
|
|
475
|
+
modifiers: eventModifiers,
|
|
476
|
+
structs,
|
|
477
|
+
type: "event"
|
|
478
|
+
}));
|
|
479
|
+
}
|
|
480
|
+
return { name: match.name, type: "event", inputs: abiParameters };
|
|
481
|
+
}
|
|
482
|
+
if (isErrorSignature(signature)) {
|
|
483
|
+
const match = execErrorSignature(signature);
|
|
484
|
+
if (!match)
|
|
485
|
+
throw new InvalidSignatureError({ signature, type: "error" });
|
|
486
|
+
const params = splitParameters(match.parameters);
|
|
487
|
+
const abiParameters = [];
|
|
488
|
+
const length = params.length;
|
|
489
|
+
for (let i = 0; i < length; i++) {
|
|
490
|
+
abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
|
|
491
|
+
}
|
|
492
|
+
return { name: match.name, type: "error", inputs: abiParameters };
|
|
493
|
+
}
|
|
494
|
+
if (isConstructorSignature(signature)) {
|
|
495
|
+
const match = execConstructorSignature(signature);
|
|
496
|
+
if (!match)
|
|
497
|
+
throw new InvalidSignatureError({ signature, type: "constructor" });
|
|
498
|
+
const params = splitParameters(match.parameters);
|
|
499
|
+
const abiParameters = [];
|
|
500
|
+
const length = params.length;
|
|
501
|
+
for (let i = 0; i < length; i++) {
|
|
502
|
+
abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
|
|
503
|
+
}
|
|
504
|
+
return {
|
|
505
|
+
type: "constructor",
|
|
506
|
+
stateMutability: match.stateMutability ?? "nonpayable",
|
|
507
|
+
inputs: abiParameters
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
if (isFallbackSignature(signature))
|
|
511
|
+
return { type: "fallback" };
|
|
512
|
+
if (isReceiveSignature(signature))
|
|
513
|
+
return {
|
|
514
|
+
type: "receive",
|
|
515
|
+
stateMutability: "payable"
|
|
516
|
+
};
|
|
517
|
+
throw new UnknownSignatureError({ signature });
|
|
518
|
+
}
|
|
519
|
+
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$_]*))?$/;
|
|
520
|
+
var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
|
|
521
|
+
var dynamicIntegerRegex = /^u?int$/;
|
|
522
|
+
function parseAbiParameter(param, options) {
|
|
523
|
+
const parameterCacheKey = getParameterCacheKey(param, options?.type);
|
|
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?.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?.type === "struct") && !isSolidityType(type))
|
|
554
|
+
throw new UnknownSolidityTypeError({ type });
|
|
555
|
+
}
|
|
556
|
+
if (match.modifier) {
|
|
557
|
+
if (!options?.modifiers?.has?.(match.modifier))
|
|
558
|
+
throw new InvalidModifierError({
|
|
559
|
+
param,
|
|
560
|
+
type: options?.type,
|
|
561
|
+
modifier: match.modifier
|
|
562
|
+
});
|
|
563
|
+
if (functionModifiers.has(match.modifier) && !isValidDataLocation(type, !!match.array))
|
|
564
|
+
throw new InvalidFunctionModifierError({
|
|
565
|
+
param,
|
|
566
|
+
type: options?.type,
|
|
567
|
+
modifier: match.modifier
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
const abiParameter = {
|
|
571
|
+
type: `${type}${match.array ?? ""}`,
|
|
572
|
+
...name,
|
|
573
|
+
...indexed,
|
|
574
|
+
...components
|
|
575
|
+
};
|
|
576
|
+
parameterCache.set(parameterCacheKey, abiParameter);
|
|
577
|
+
return abiParameter;
|
|
578
|
+
}
|
|
579
|
+
function splitParameters(params, result = [], current = "", depth = 0) {
|
|
580
|
+
const length = params.trim().length;
|
|
581
|
+
for (let i = 0; i < length; i++) {
|
|
582
|
+
const char = params[i];
|
|
583
|
+
const tail = params.slice(i + 1);
|
|
584
|
+
switch (char) {
|
|
585
|
+
case ",":
|
|
586
|
+
return depth === 0 ? splitParameters(tail, [...result, current.trim()]) : splitParameters(tail, result, `${current}${char}`, depth);
|
|
587
|
+
case "(":
|
|
588
|
+
return splitParameters(tail, result, `${current}${char}`, depth + 1);
|
|
589
|
+
case ")":
|
|
590
|
+
return splitParameters(tail, result, `${current}${char}`, depth - 1);
|
|
591
|
+
default:
|
|
592
|
+
return splitParameters(tail, result, `${current}${char}`, depth);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
if (current === "")
|
|
596
|
+
return result;
|
|
597
|
+
if (depth !== 0)
|
|
598
|
+
throw new InvalidParenthesisError({ current, depth });
|
|
599
|
+
result.push(current.trim());
|
|
600
|
+
return result;
|
|
601
|
+
}
|
|
602
|
+
function isSolidityType(type) {
|
|
603
|
+
return type === "address" || type === "bool" || type === "function" || type === "string" || bytesRegex.test(type) || integerRegex.test(type);
|
|
604
|
+
}
|
|
605
|
+
var protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
606
|
+
function isSolidityKeyword(name) {
|
|
607
|
+
return name === "address" || name === "bool" || name === "function" || name === "string" || name === "tuple" || bytesRegex.test(name) || integerRegex.test(name) || protectedKeywordsRegex.test(name);
|
|
608
|
+
}
|
|
609
|
+
function isValidDataLocation(type, isArray) {
|
|
610
|
+
return isArray || type === "bytes" || type === "string" || type === "tuple";
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/node_modules/abitype/dist/esm/human-readable/runtime/structs.js
|
|
614
|
+
function parseStructs(signatures) {
|
|
615
|
+
const shallowStructs = {};
|
|
616
|
+
const signaturesLength = signatures.length;
|
|
617
|
+
for (let i = 0; i < signaturesLength; i++) {
|
|
618
|
+
const signature = signatures[i];
|
|
619
|
+
if (!isStructSignature(signature))
|
|
620
|
+
continue;
|
|
621
|
+
const match = execStructSignature(signature);
|
|
622
|
+
if (!match)
|
|
623
|
+
throw new InvalidSignatureError({ signature, type: "struct" });
|
|
624
|
+
const properties = match.properties.split(";");
|
|
625
|
+
const components = [];
|
|
626
|
+
const propertiesLength = properties.length;
|
|
627
|
+
for (let k = 0; k < propertiesLength; k++) {
|
|
628
|
+
const property = properties[k];
|
|
629
|
+
const trimmed = property.trim();
|
|
630
|
+
if (!trimmed)
|
|
631
|
+
continue;
|
|
632
|
+
const abiParameter = parseAbiParameter(trimmed, {
|
|
633
|
+
type: "struct"
|
|
634
|
+
});
|
|
635
|
+
components.push(abiParameter);
|
|
636
|
+
}
|
|
637
|
+
if (!components.length)
|
|
638
|
+
throw new InvalidStructSignatureError({ signature });
|
|
639
|
+
shallowStructs[match.name] = components;
|
|
640
|
+
}
|
|
641
|
+
const resolvedStructs = {};
|
|
642
|
+
const entries = Object.entries(shallowStructs);
|
|
643
|
+
const entriesLength = entries.length;
|
|
644
|
+
for (let i = 0; i < entriesLength; i++) {
|
|
645
|
+
const [name, parameters] = entries[i];
|
|
646
|
+
resolvedStructs[name] = resolveStructs(parameters, shallowStructs);
|
|
647
|
+
}
|
|
648
|
+
return resolvedStructs;
|
|
649
|
+
}
|
|
650
|
+
var typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
651
|
+
function resolveStructs(abiParameters, structs, ancestors = /* @__PURE__ */ new Set()) {
|
|
652
|
+
const components = [];
|
|
653
|
+
const length = abiParameters.length;
|
|
654
|
+
for (let i = 0; i < length; i++) {
|
|
655
|
+
const abiParameter = abiParameters[i];
|
|
656
|
+
const isTuple = isTupleRegex.test(abiParameter.type);
|
|
657
|
+
if (isTuple)
|
|
658
|
+
components.push(abiParameter);
|
|
659
|
+
else {
|
|
660
|
+
const match = execTyped(typeWithoutTupleRegex, abiParameter.type);
|
|
661
|
+
if (!match?.type)
|
|
662
|
+
throw new InvalidAbiTypeParameterError({ abiParameter });
|
|
663
|
+
const { array, type } = match;
|
|
664
|
+
if (type in structs) {
|
|
665
|
+
if (ancestors.has(type))
|
|
666
|
+
throw new CircularReferenceError({ type });
|
|
667
|
+
components.push({
|
|
668
|
+
...abiParameter,
|
|
669
|
+
type: `tuple${array ?? ""}`,
|
|
670
|
+
components: resolveStructs(structs[type] ?? [], structs, /* @__PURE__ */ new Set([...ancestors, type]))
|
|
671
|
+
});
|
|
672
|
+
} else {
|
|
673
|
+
if (isSolidityType(type))
|
|
674
|
+
components.push(abiParameter);
|
|
675
|
+
else
|
|
676
|
+
throw new UnknownTypeError({ type });
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return components;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// ../../node_modules/.pnpm/abitype@1.0.5_typescript@5.5.3_zod@3.23.8/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.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/accounts/utils/parseAccount.js
|
|
14
698
|
function parseAccount(account) {
|
|
15
699
|
if (typeof account === "string")
|
|
16
700
|
return { address: account, type: "json-rpc" };
|
|
17
701
|
return account;
|
|
18
702
|
}
|
|
19
703
|
|
|
20
|
-
// ../../node_modules/viem/_esm/constants/abis.js
|
|
704
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/abis.js
|
|
21
705
|
var multicall3Abi = [
|
|
22
706
|
{
|
|
23
707
|
inputs: [
|
|
@@ -169,18 +853,22 @@ var universalResolverReverseAbi = [
|
|
|
169
853
|
}
|
|
170
854
|
];
|
|
171
855
|
|
|
172
|
-
// ../../node_modules/viem/_esm/constants/contract.js
|
|
856
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/contract.js
|
|
173
857
|
var aggregate3Signature = "0x82ad56cb";
|
|
174
858
|
|
|
175
|
-
// ../../node_modules/viem/_esm/
|
|
176
|
-
var
|
|
859
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/contracts.js
|
|
860
|
+
var deploylessCallViaBytecodeBytecode = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";
|
|
861
|
+
var deploylessCallViaFactoryBytecode = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
862
|
+
|
|
863
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/version.js
|
|
864
|
+
var version2 = "2.17.9";
|
|
177
865
|
|
|
178
|
-
// ../../node_modules/viem/_esm/errors/utils.js
|
|
866
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/utils.js
|
|
179
867
|
var getUrl = (url) => url;
|
|
180
|
-
var getVersion = () => `viem@${
|
|
868
|
+
var getVersion = () => `viem@${version2}`;
|
|
181
869
|
|
|
182
|
-
// ../../node_modules/viem/_esm/errors/base.js
|
|
183
|
-
var
|
|
870
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/base.js
|
|
871
|
+
var BaseError2 = class _BaseError extends Error {
|
|
184
872
|
constructor(shortMessage, args = {}) {
|
|
185
873
|
super();
|
|
186
874
|
Object.defineProperty(this, "details", {
|
|
@@ -220,13 +908,13 @@ var BaseError = class _BaseError extends Error {
|
|
|
220
908
|
value: getVersion()
|
|
221
909
|
});
|
|
222
910
|
const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
|
|
223
|
-
const
|
|
911
|
+
const docsPath4 = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
|
|
224
912
|
this.message = [
|
|
225
913
|
shortMessage || "An error occurred.",
|
|
226
914
|
"",
|
|
227
915
|
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
228
|
-
...
|
|
229
|
-
`Docs: https://viem.sh${
|
|
916
|
+
...docsPath4 ? [
|
|
917
|
+
`Docs: ${args.docsBaseUrl ?? "https://viem.sh"}${docsPath4}${args.docsSlug ? `#${args.docsSlug}` : ""}`
|
|
230
918
|
] : [],
|
|
231
919
|
...details ? [`Details: ${details}`] : [],
|
|
232
920
|
`Version: ${this.version}`
|
|
@@ -234,7 +922,7 @@ var BaseError = class _BaseError extends Error {
|
|
|
234
922
|
if (args.cause)
|
|
235
923
|
this.cause = args.cause;
|
|
236
924
|
this.details = details;
|
|
237
|
-
this.docsPath =
|
|
925
|
+
this.docsPath = docsPath4;
|
|
238
926
|
this.metaMessages = args.metaMessages;
|
|
239
927
|
this.shortMessage = shortMessage;
|
|
240
928
|
}
|
|
@@ -250,8 +938,8 @@ function walk(err, fn) {
|
|
|
250
938
|
return fn ? null : err;
|
|
251
939
|
}
|
|
252
940
|
|
|
253
|
-
// ../../node_modules/viem/_esm/errors/chain.js
|
|
254
|
-
var ChainDoesNotSupportContract = class extends
|
|
941
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/chain.js
|
|
942
|
+
var ChainDoesNotSupportContract = class extends BaseError2 {
|
|
255
943
|
constructor({ blockNumber, chain, contract }) {
|
|
256
944
|
super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
|
|
257
945
|
metaMessages: [
|
|
@@ -271,7 +959,7 @@ var ChainDoesNotSupportContract = class extends BaseError {
|
|
|
271
959
|
});
|
|
272
960
|
}
|
|
273
961
|
};
|
|
274
|
-
var ClientChainNotConfiguredError = class extends
|
|
962
|
+
var ClientChainNotConfiguredError = class extends BaseError2 {
|
|
275
963
|
constructor() {
|
|
276
964
|
super("No chain was provided to the Client.");
|
|
277
965
|
Object.defineProperty(this, "name", {
|
|
@@ -283,7 +971,7 @@ var ClientChainNotConfiguredError = class extends BaseError {
|
|
|
283
971
|
}
|
|
284
972
|
};
|
|
285
973
|
|
|
286
|
-
// ../../node_modules/viem/_esm/constants/solidity.js
|
|
974
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/solidity.js
|
|
287
975
|
var solidityError = {
|
|
288
976
|
inputs: [
|
|
289
977
|
{
|
|
@@ -305,8 +993,8 @@ var solidityPanic = {
|
|
|
305
993
|
type: "error"
|
|
306
994
|
};
|
|
307
995
|
|
|
308
|
-
// ../../node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
309
|
-
function
|
|
996
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
997
|
+
function formatAbiItem2(abiItem, { includeName = false } = {}) {
|
|
310
998
|
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
311
999
|
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
312
1000
|
return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
|
|
@@ -323,7 +1011,7 @@ function formatAbiParam(param, { includeName }) {
|
|
|
323
1011
|
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
324
1012
|
}
|
|
325
1013
|
|
|
326
|
-
// ../../node_modules/viem/_esm/utils/data/isHex.js
|
|
1014
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/isHex.js
|
|
327
1015
|
function isHex(value, { strict = true } = {}) {
|
|
328
1016
|
if (!value)
|
|
329
1017
|
return false;
|
|
@@ -332,15 +1020,47 @@ function isHex(value, { strict = true } = {}) {
|
|
|
332
1020
|
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
333
1021
|
}
|
|
334
1022
|
|
|
335
|
-
// ../../node_modules/viem/_esm/utils/data/size.js
|
|
1023
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/size.js
|
|
336
1024
|
function size(value) {
|
|
337
1025
|
if (isHex(value, { strict: false }))
|
|
338
1026
|
return Math.ceil((value.length - 2) / 2);
|
|
339
1027
|
return value.length;
|
|
340
1028
|
}
|
|
341
1029
|
|
|
342
|
-
// ../../node_modules/viem/_esm/errors/abi.js
|
|
343
|
-
var
|
|
1030
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/abi.js
|
|
1031
|
+
var AbiConstructorNotFoundError = class extends BaseError2 {
|
|
1032
|
+
constructor({ docsPath: docsPath4 }) {
|
|
1033
|
+
super([
|
|
1034
|
+
"A constructor was not found on the ABI.",
|
|
1035
|
+
"Make sure you are using the correct ABI and that the constructor exists on it."
|
|
1036
|
+
].join("\n"), {
|
|
1037
|
+
docsPath: docsPath4
|
|
1038
|
+
});
|
|
1039
|
+
Object.defineProperty(this, "name", {
|
|
1040
|
+
enumerable: true,
|
|
1041
|
+
configurable: true,
|
|
1042
|
+
writable: true,
|
|
1043
|
+
value: "AbiConstructorNotFoundError"
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
var AbiConstructorParamsNotFoundError = class extends BaseError2 {
|
|
1048
|
+
constructor({ docsPath: docsPath4 }) {
|
|
1049
|
+
super([
|
|
1050
|
+
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
1051
|
+
"Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
|
|
1052
|
+
].join("\n"), {
|
|
1053
|
+
docsPath: docsPath4
|
|
1054
|
+
});
|
|
1055
|
+
Object.defineProperty(this, "name", {
|
|
1056
|
+
enumerable: true,
|
|
1057
|
+
configurable: true,
|
|
1058
|
+
writable: true,
|
|
1059
|
+
value: "AbiConstructorParamsNotFoundError"
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
var AbiDecodingDataSizeTooSmallError = class extends BaseError2 {
|
|
344
1064
|
constructor({ data, params, size: size2 }) {
|
|
345
1065
|
super([`Data size of ${size2} bytes is too small for given parameters.`].join("\n"), {
|
|
346
1066
|
metaMessages: [
|
|
@@ -377,7 +1097,7 @@ var AbiDecodingDataSizeTooSmallError = class extends BaseError {
|
|
|
377
1097
|
this.size = size2;
|
|
378
1098
|
}
|
|
379
1099
|
};
|
|
380
|
-
var AbiDecodingZeroDataError = class extends
|
|
1100
|
+
var AbiDecodingZeroDataError = class extends BaseError2 {
|
|
381
1101
|
constructor() {
|
|
382
1102
|
super('Cannot decode zero data ("0x") with ABI parameters.');
|
|
383
1103
|
Object.defineProperty(this, "name", {
|
|
@@ -388,7 +1108,7 @@ var AbiDecodingZeroDataError = class extends BaseError {
|
|
|
388
1108
|
});
|
|
389
1109
|
}
|
|
390
1110
|
};
|
|
391
|
-
var AbiEncodingArrayLengthMismatchError = class extends
|
|
1111
|
+
var AbiEncodingArrayLengthMismatchError = class extends BaseError2 {
|
|
392
1112
|
constructor({ expectedLength, givenLength, type }) {
|
|
393
1113
|
super([
|
|
394
1114
|
`ABI encoding array length mismatch for type ${type}.`,
|
|
@@ -403,7 +1123,7 @@ var AbiEncodingArrayLengthMismatchError = class extends BaseError {
|
|
|
403
1123
|
});
|
|
404
1124
|
}
|
|
405
1125
|
};
|
|
406
|
-
var AbiEncodingBytesSizeMismatchError = class extends
|
|
1126
|
+
var AbiEncodingBytesSizeMismatchError = class extends BaseError2 {
|
|
407
1127
|
constructor({ expectedSize, value }) {
|
|
408
1128
|
super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`);
|
|
409
1129
|
Object.defineProperty(this, "name", {
|
|
@@ -414,7 +1134,7 @@ var AbiEncodingBytesSizeMismatchError = class extends BaseError {
|
|
|
414
1134
|
});
|
|
415
1135
|
}
|
|
416
1136
|
};
|
|
417
|
-
var AbiEncodingLengthMismatchError = class extends
|
|
1137
|
+
var AbiEncodingLengthMismatchError = class extends BaseError2 {
|
|
418
1138
|
constructor({ expectedLength, givenLength }) {
|
|
419
1139
|
super([
|
|
420
1140
|
"ABI encoding params/values length mismatch.",
|
|
@@ -429,14 +1149,14 @@ var AbiEncodingLengthMismatchError = class extends BaseError {
|
|
|
429
1149
|
});
|
|
430
1150
|
}
|
|
431
1151
|
};
|
|
432
|
-
var AbiErrorSignatureNotFoundError = class extends
|
|
433
|
-
constructor(signature, { docsPath:
|
|
1152
|
+
var AbiErrorSignatureNotFoundError = class extends BaseError2 {
|
|
1153
|
+
constructor(signature, { docsPath: docsPath4 }) {
|
|
434
1154
|
super([
|
|
435
1155
|
`Encoded error signature "${signature}" not found on ABI.`,
|
|
436
1156
|
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
437
1157
|
`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`
|
|
438
1158
|
].join("\n"), {
|
|
439
|
-
docsPath:
|
|
1159
|
+
docsPath: docsPath4
|
|
440
1160
|
});
|
|
441
1161
|
Object.defineProperty(this, "name", {
|
|
442
1162
|
enumerable: true,
|
|
@@ -453,13 +1173,13 @@ var AbiErrorSignatureNotFoundError = class extends BaseError {
|
|
|
453
1173
|
this.signature = signature;
|
|
454
1174
|
}
|
|
455
1175
|
};
|
|
456
|
-
var AbiFunctionNotFoundError = class extends
|
|
457
|
-
constructor(functionName, { docsPath:
|
|
1176
|
+
var AbiFunctionNotFoundError = class extends BaseError2 {
|
|
1177
|
+
constructor(functionName, { docsPath: docsPath4 } = {}) {
|
|
458
1178
|
super([
|
|
459
1179
|
`Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
|
|
460
1180
|
"Make sure you are using the correct ABI and that the function exists on it."
|
|
461
1181
|
].join("\n"), {
|
|
462
|
-
docsPath:
|
|
1182
|
+
docsPath: docsPath4
|
|
463
1183
|
});
|
|
464
1184
|
Object.defineProperty(this, "name", {
|
|
465
1185
|
enumerable: true,
|
|
@@ -469,14 +1189,14 @@ var AbiFunctionNotFoundError = class extends BaseError {
|
|
|
469
1189
|
});
|
|
470
1190
|
}
|
|
471
1191
|
};
|
|
472
|
-
var AbiFunctionOutputsNotFoundError = class extends
|
|
473
|
-
constructor(functionName, { docsPath:
|
|
1192
|
+
var AbiFunctionOutputsNotFoundError = class extends BaseError2 {
|
|
1193
|
+
constructor(functionName, { docsPath: docsPath4 }) {
|
|
474
1194
|
super([
|
|
475
1195
|
`Function "${functionName}" does not contain any \`outputs\` on ABI.`,
|
|
476
1196
|
"Cannot decode function result without knowing what the parameter types are.",
|
|
477
1197
|
"Make sure you are using the correct ABI and that the function exists on it."
|
|
478
1198
|
].join("\n"), {
|
|
479
|
-
docsPath:
|
|
1199
|
+
docsPath: docsPath4
|
|
480
1200
|
});
|
|
481
1201
|
Object.defineProperty(this, "name", {
|
|
482
1202
|
enumerable: true,
|
|
@@ -486,12 +1206,12 @@ var AbiFunctionOutputsNotFoundError = class extends BaseError {
|
|
|
486
1206
|
});
|
|
487
1207
|
}
|
|
488
1208
|
};
|
|
489
|
-
var AbiItemAmbiguityError = class extends
|
|
1209
|
+
var AbiItemAmbiguityError = class extends BaseError2 {
|
|
490
1210
|
constructor(x, y) {
|
|
491
1211
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
492
1212
|
metaMessages: [
|
|
493
|
-
`\`${x.type}\` in \`${
|
|
494
|
-
`\`${y.type}\` in \`${
|
|
1213
|
+
`\`${x.type}\` in \`${formatAbiItem2(x.abiItem)}\`, and`,
|
|
1214
|
+
`\`${y.type}\` in \`${formatAbiItem2(y.abiItem)}\``,
|
|
495
1215
|
"",
|
|
496
1216
|
"These types encode differently and cannot be distinguished at runtime.",
|
|
497
1217
|
"Remove one of the ambiguous items in the ABI."
|
|
@@ -505,12 +1225,12 @@ var AbiItemAmbiguityError = class extends BaseError {
|
|
|
505
1225
|
});
|
|
506
1226
|
}
|
|
507
1227
|
};
|
|
508
|
-
var InvalidAbiEncodingTypeError = class extends
|
|
509
|
-
constructor(type, { docsPath:
|
|
1228
|
+
var InvalidAbiEncodingTypeError = class extends BaseError2 {
|
|
1229
|
+
constructor(type, { docsPath: docsPath4 }) {
|
|
510
1230
|
super([
|
|
511
1231
|
`Type "${type}" is not a valid encoding type.`,
|
|
512
1232
|
"Please provide a valid ABI type."
|
|
513
|
-
].join("\n"), { docsPath:
|
|
1233
|
+
].join("\n"), { docsPath: docsPath4 });
|
|
514
1234
|
Object.defineProperty(this, "name", {
|
|
515
1235
|
enumerable: true,
|
|
516
1236
|
configurable: true,
|
|
@@ -519,12 +1239,12 @@ var InvalidAbiEncodingTypeError = class extends BaseError {
|
|
|
519
1239
|
});
|
|
520
1240
|
}
|
|
521
1241
|
};
|
|
522
|
-
var InvalidAbiDecodingTypeError = class extends
|
|
523
|
-
constructor(type, { docsPath:
|
|
1242
|
+
var InvalidAbiDecodingTypeError = class extends BaseError2 {
|
|
1243
|
+
constructor(type, { docsPath: docsPath4 }) {
|
|
524
1244
|
super([
|
|
525
1245
|
`Type "${type}" is not a valid decoding type.`,
|
|
526
1246
|
"Please provide a valid ABI type."
|
|
527
|
-
].join("\n"), { docsPath:
|
|
1247
|
+
].join("\n"), { docsPath: docsPath4 });
|
|
528
1248
|
Object.defineProperty(this, "name", {
|
|
529
1249
|
enumerable: true,
|
|
530
1250
|
configurable: true,
|
|
@@ -533,7 +1253,7 @@ var InvalidAbiDecodingTypeError = class extends BaseError {
|
|
|
533
1253
|
});
|
|
534
1254
|
}
|
|
535
1255
|
};
|
|
536
|
-
var InvalidArrayError = class extends
|
|
1256
|
+
var InvalidArrayError = class extends BaseError2 {
|
|
537
1257
|
constructor(value) {
|
|
538
1258
|
super([`Value "${value}" is not a valid array.`].join("\n"));
|
|
539
1259
|
Object.defineProperty(this, "name", {
|
|
@@ -544,7 +1264,7 @@ var InvalidArrayError = class extends BaseError {
|
|
|
544
1264
|
});
|
|
545
1265
|
}
|
|
546
1266
|
};
|
|
547
|
-
var InvalidDefinitionTypeError = class extends
|
|
1267
|
+
var InvalidDefinitionTypeError = class extends BaseError2 {
|
|
548
1268
|
constructor(type) {
|
|
549
1269
|
super([
|
|
550
1270
|
`"${type}" is not a valid definition type.`,
|
|
@@ -559,8 +1279,8 @@ var InvalidDefinitionTypeError = class extends BaseError {
|
|
|
559
1279
|
}
|
|
560
1280
|
};
|
|
561
1281
|
|
|
562
|
-
// ../../node_modules/viem/_esm/errors/data.js
|
|
563
|
-
var SliceOffsetOutOfBoundsError = class extends
|
|
1282
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/data.js
|
|
1283
|
+
var SliceOffsetOutOfBoundsError = class extends BaseError2 {
|
|
564
1284
|
constructor({ offset, position, size: size2 }) {
|
|
565
1285
|
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`);
|
|
566
1286
|
Object.defineProperty(this, "name", {
|
|
@@ -571,7 +1291,7 @@ var SliceOffsetOutOfBoundsError = class extends BaseError {
|
|
|
571
1291
|
});
|
|
572
1292
|
}
|
|
573
1293
|
};
|
|
574
|
-
var SizeExceedsPaddingSizeError = class extends
|
|
1294
|
+
var SizeExceedsPaddingSizeError = class extends BaseError2 {
|
|
575
1295
|
constructor({ size: size2, targetSize, type }) {
|
|
576
1296
|
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`);
|
|
577
1297
|
Object.defineProperty(this, "name", {
|
|
@@ -582,7 +1302,7 @@ var SizeExceedsPaddingSizeError = class extends BaseError {
|
|
|
582
1302
|
});
|
|
583
1303
|
}
|
|
584
1304
|
};
|
|
585
|
-
var InvalidBytesLengthError = class extends
|
|
1305
|
+
var InvalidBytesLengthError = class extends BaseError2 {
|
|
586
1306
|
constructor({ size: size2, targetSize, type }) {
|
|
587
1307
|
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size2} ${type} long.`);
|
|
588
1308
|
Object.defineProperty(this, "name", {
|
|
@@ -594,7 +1314,7 @@ var InvalidBytesLengthError = class extends BaseError {
|
|
|
594
1314
|
}
|
|
595
1315
|
};
|
|
596
1316
|
|
|
597
|
-
// ../../node_modules/viem/_esm/utils/data/slice.js
|
|
1317
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/slice.js
|
|
598
1318
|
function slice(value, start, end, { strict } = {}) {
|
|
599
1319
|
if (isHex(value, { strict: false }))
|
|
600
1320
|
return sliceHex(value, start, end, {
|
|
@@ -636,7 +1356,7 @@ function sliceHex(value_, start, end, { strict } = {}) {
|
|
|
636
1356
|
return value;
|
|
637
1357
|
}
|
|
638
1358
|
|
|
639
|
-
// ../../node_modules/viem/_esm/utils/data/pad.js
|
|
1359
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/pad.js
|
|
640
1360
|
function pad(hexOrBytes, { dir, size: size2 = 32 } = {}) {
|
|
641
1361
|
if (typeof hexOrBytes === "string")
|
|
642
1362
|
return padHex(hexOrBytes, { dir, size: size2 });
|
|
@@ -671,8 +1391,8 @@ function padBytes(bytes2, { dir, size: size2 = 32 } = {}) {
|
|
|
671
1391
|
return paddedBytes;
|
|
672
1392
|
}
|
|
673
1393
|
|
|
674
|
-
// ../../node_modules/viem/_esm/errors/encoding.js
|
|
675
|
-
var IntegerOutOfRangeError = class extends
|
|
1394
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/encoding.js
|
|
1395
|
+
var IntegerOutOfRangeError = class extends BaseError2 {
|
|
676
1396
|
constructor({ max, min, signed, size: size2, value }) {
|
|
677
1397
|
super(`Number "${value}" is not in safe ${size2 ? `${size2 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`);
|
|
678
1398
|
Object.defineProperty(this, "name", {
|
|
@@ -683,7 +1403,7 @@ var IntegerOutOfRangeError = class extends BaseError {
|
|
|
683
1403
|
});
|
|
684
1404
|
}
|
|
685
1405
|
};
|
|
686
|
-
var InvalidBytesBooleanError = class extends
|
|
1406
|
+
var InvalidBytesBooleanError = class extends BaseError2 {
|
|
687
1407
|
constructor(bytes2) {
|
|
688
1408
|
super(`Bytes value "${bytes2}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`);
|
|
689
1409
|
Object.defineProperty(this, "name", {
|
|
@@ -694,7 +1414,7 @@ var InvalidBytesBooleanError = class extends BaseError {
|
|
|
694
1414
|
});
|
|
695
1415
|
}
|
|
696
1416
|
};
|
|
697
|
-
var SizeOverflowError = class extends
|
|
1417
|
+
var SizeOverflowError = class extends BaseError2 {
|
|
698
1418
|
constructor({ givenSize, maxSize }) {
|
|
699
1419
|
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`);
|
|
700
1420
|
Object.defineProperty(this, "name", {
|
|
@@ -706,7 +1426,7 @@ var SizeOverflowError = class extends BaseError {
|
|
|
706
1426
|
}
|
|
707
1427
|
};
|
|
708
1428
|
|
|
709
|
-
// ../../node_modules/viem/_esm/utils/data/trim.js
|
|
1429
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/trim.js
|
|
710
1430
|
function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
711
1431
|
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
712
1432
|
let sliceLength = 0;
|
|
@@ -725,7 +1445,7 @@ function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
|
725
1445
|
return data;
|
|
726
1446
|
}
|
|
727
1447
|
|
|
728
|
-
// ../../node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
1448
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
729
1449
|
function assertSize(hexOrBytes, { size: size2 }) {
|
|
730
1450
|
if (size(hexOrBytes) > size2)
|
|
731
1451
|
throw new SizeOverflowError({
|
|
@@ -750,7 +1470,7 @@ function hexToNumber(hex, opts = {}) {
|
|
|
750
1470
|
return Number(hexToBigInt(hex, opts));
|
|
751
1471
|
}
|
|
752
1472
|
|
|
753
|
-
// ../../node_modules/viem/_esm/utils/encoding/toHex.js
|
|
1473
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
754
1474
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
755
1475
|
function toHex(value, opts = {}) {
|
|
756
1476
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -816,7 +1536,7 @@ function stringToHex(value_, opts = {}) {
|
|
|
816
1536
|
return bytesToHex(value, opts);
|
|
817
1537
|
}
|
|
818
1538
|
|
|
819
|
-
// ../../node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
1539
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
820
1540
|
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
821
1541
|
function toBytes2(value, opts = {}) {
|
|
822
1542
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -868,7 +1588,7 @@ function hexToBytes(hex_, opts = {}) {
|
|
|
868
1588
|
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
869
1589
|
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
870
1590
|
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
871
|
-
throw new
|
|
1591
|
+
throw new BaseError2(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
872
1592
|
}
|
|
873
1593
|
bytes2[index] = nibbleLeft * 16 + nibbleRight;
|
|
874
1594
|
}
|
|
@@ -887,7 +1607,7 @@ function stringToBytes(value, opts = {}) {
|
|
|
887
1607
|
return bytes2;
|
|
888
1608
|
}
|
|
889
1609
|
|
|
890
|
-
// ../../node_modules/@noble/hashes/esm/_u64.js
|
|
1610
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/_u64.js
|
|
891
1611
|
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
892
1612
|
var _32n = /* @__PURE__ */ BigInt(32);
|
|
893
1613
|
function fromBig(n, le = false) {
|
|
@@ -909,8 +1629,10 @@ var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
|
909
1629
|
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
910
1630
|
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
911
1631
|
|
|
912
|
-
// ../../node_modules/@noble/hashes/esm/sha3.js
|
|
913
|
-
var
|
|
1632
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.4.0/node_modules/@noble/hashes/esm/sha3.js
|
|
1633
|
+
var SHA3_PI = [];
|
|
1634
|
+
var SHA3_ROTL = [];
|
|
1635
|
+
var _SHA3_IOTA = [];
|
|
914
1636
|
var _0n = /* @__PURE__ */ BigInt(0);
|
|
915
1637
|
var _1n = /* @__PURE__ */ BigInt(1);
|
|
916
1638
|
var _2n = /* @__PURE__ */ BigInt(2);
|
|
@@ -992,7 +1714,11 @@ var Keccak = class _Keccak extends Hash {
|
|
|
992
1714
|
this.state32 = u32(this.state);
|
|
993
1715
|
}
|
|
994
1716
|
keccak() {
|
|
1717
|
+
if (!isLE)
|
|
1718
|
+
byteSwap32(this.state32);
|
|
995
1719
|
keccakP(this.state32, this.rounds);
|
|
1720
|
+
if (!isLE)
|
|
1721
|
+
byteSwap32(this.state32);
|
|
996
1722
|
this.posOut = 0;
|
|
997
1723
|
this.pos = 0;
|
|
998
1724
|
}
|
|
@@ -1089,7 +1815,7 @@ var genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts
|
|
|
1089
1815
|
var shake128 = /* @__PURE__ */ genShake(31, 168, 128 / 8);
|
|
1090
1816
|
var shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
|
|
1091
1817
|
|
|
1092
|
-
// ../../node_modules/viem/_esm/utils/hash/keccak256.js
|
|
1818
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
1093
1819
|
function keccak256(value, to_) {
|
|
1094
1820
|
const to = to_ || "hex";
|
|
1095
1821
|
const bytes2 = keccak_256(isHex(value, { strict: false }) ? toBytes2(value) : value);
|
|
@@ -1098,74 +1824,13 @@ function keccak256(value, to_) {
|
|
|
1098
1824
|
return toHex(bytes2);
|
|
1099
1825
|
}
|
|
1100
1826
|
|
|
1101
|
-
// ../../node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
1827
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
1102
1828
|
var hash = (value) => keccak256(toBytes2(value));
|
|
1103
1829
|
function hashSignature(sig) {
|
|
1104
1830
|
return hash(sig);
|
|
1105
1831
|
}
|
|
1106
1832
|
|
|
1107
|
-
// ../../node_modules/
|
|
1108
|
-
function execTyped(regex, string) {
|
|
1109
|
-
const match = regex.exec(string);
|
|
1110
|
-
return match?.groups;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
// ../../node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
|
|
1114
|
-
var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
1115
|
-
function formatAbiParameter(abiParameter) {
|
|
1116
|
-
let type = abiParameter.type;
|
|
1117
|
-
if (tupleRegex.test(abiParameter.type) && "components" in abiParameter) {
|
|
1118
|
-
type = "(";
|
|
1119
|
-
const length = abiParameter.components.length;
|
|
1120
|
-
for (let i = 0; i < length; i++) {
|
|
1121
|
-
const component = abiParameter.components[i];
|
|
1122
|
-
type += formatAbiParameter(component);
|
|
1123
|
-
if (i < length - 1)
|
|
1124
|
-
type += ", ";
|
|
1125
|
-
}
|
|
1126
|
-
const result = execTyped(tupleRegex, abiParameter.type);
|
|
1127
|
-
type += `)${result?.array ?? ""}`;
|
|
1128
|
-
return formatAbiParameter({
|
|
1129
|
-
...abiParameter,
|
|
1130
|
-
type
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
if ("indexed" in abiParameter && abiParameter.indexed)
|
|
1134
|
-
type = `${type} indexed`;
|
|
1135
|
-
if (abiParameter.name)
|
|
1136
|
-
return `${type} ${abiParameter.name}`;
|
|
1137
|
-
return type;
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
// ../../node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
|
|
1141
|
-
function formatAbiParameters(abiParameters) {
|
|
1142
|
-
let params = "";
|
|
1143
|
-
const length = abiParameters.length;
|
|
1144
|
-
for (let i = 0; i < length; i++) {
|
|
1145
|
-
const abiParameter = abiParameters[i];
|
|
1146
|
-
params += formatAbiParameter(abiParameter);
|
|
1147
|
-
if (i !== length - 1)
|
|
1148
|
-
params += ", ";
|
|
1149
|
-
}
|
|
1150
|
-
return params;
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
// ../../node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
|
|
1154
|
-
function formatAbiItem2(abiItem) {
|
|
1155
|
-
if (abiItem.type === "function")
|
|
1156
|
-
return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
|
|
1157
|
-
else if (abiItem.type === "event")
|
|
1158
|
-
return `event ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
1159
|
-
else if (abiItem.type === "error")
|
|
1160
|
-
return `error ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})`;
|
|
1161
|
-
else if (abiItem.type === "constructor")
|
|
1162
|
-
return `constructor(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability === "payable" ? " payable" : ""}`;
|
|
1163
|
-
else if (abiItem.type === "fallback")
|
|
1164
|
-
return "fallback()";
|
|
1165
|
-
return "receive() external payable";
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
// ../../node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
1833
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
1169
1834
|
function normalizeSignature(signature) {
|
|
1170
1835
|
let active = true;
|
|
1171
1836
|
let current = "";
|
|
@@ -1205,30 +1870,30 @@ function normalizeSignature(signature) {
|
|
|
1205
1870
|
current += char;
|
|
1206
1871
|
}
|
|
1207
1872
|
if (!valid)
|
|
1208
|
-
throw new
|
|
1873
|
+
throw new BaseError2("Unable to normalize signature.");
|
|
1209
1874
|
return result;
|
|
1210
1875
|
}
|
|
1211
1876
|
|
|
1212
|
-
// ../../node_modules/viem/_esm/utils/hash/toSignature.js
|
|
1877
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toSignature.js
|
|
1213
1878
|
var toSignature = (def) => {
|
|
1214
1879
|
const def_ = (() => {
|
|
1215
1880
|
if (typeof def === "string")
|
|
1216
1881
|
return def;
|
|
1217
|
-
return
|
|
1882
|
+
return formatAbiItem(def);
|
|
1218
1883
|
})();
|
|
1219
1884
|
return normalizeSignature(def_);
|
|
1220
1885
|
};
|
|
1221
1886
|
|
|
1222
|
-
// ../../node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
1887
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
1223
1888
|
function toSignatureHash(fn) {
|
|
1224
1889
|
return hashSignature(toSignature(fn));
|
|
1225
1890
|
}
|
|
1226
1891
|
|
|
1227
|
-
// ../../node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
1892
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
1228
1893
|
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
1229
1894
|
|
|
1230
|
-
// ../../node_modules/viem/_esm/errors/address.js
|
|
1231
|
-
var InvalidAddressError = class extends
|
|
1895
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/address.js
|
|
1896
|
+
var InvalidAddressError = class extends BaseError2 {
|
|
1232
1897
|
constructor({ address }) {
|
|
1233
1898
|
super(`Address "${address}" is invalid.`, {
|
|
1234
1899
|
metaMessages: [
|
|
@@ -1245,7 +1910,7 @@ var InvalidAddressError = class extends BaseError {
|
|
|
1245
1910
|
}
|
|
1246
1911
|
};
|
|
1247
1912
|
|
|
1248
|
-
// ../../node_modules/viem/_esm/utils/lru.js
|
|
1913
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/lru.js
|
|
1249
1914
|
var LruMap = class extends Map {
|
|
1250
1915
|
constructor(size2) {
|
|
1251
1916
|
super();
|
|
@@ -1265,7 +1930,7 @@ var LruMap = class extends Map {
|
|
|
1265
1930
|
}
|
|
1266
1931
|
};
|
|
1267
1932
|
|
|
1268
|
-
// ../../node_modules/viem/_esm/utils/address/isAddress.js
|
|
1933
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/address/isAddress.js
|
|
1269
1934
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
1270
1935
|
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1271
1936
|
function isAddress(address, options) {
|
|
@@ -1286,7 +1951,7 @@ function isAddress(address, options) {
|
|
|
1286
1951
|
return result;
|
|
1287
1952
|
}
|
|
1288
1953
|
|
|
1289
|
-
// ../../node_modules/viem/_esm/utils/address/getAddress.js
|
|
1954
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/address/getAddress.js
|
|
1290
1955
|
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1291
1956
|
function checksumAddress(address_, chainId) {
|
|
1292
1957
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
@@ -1307,8 +1972,8 @@ function checksumAddress(address_, chainId) {
|
|
|
1307
1972
|
return result;
|
|
1308
1973
|
}
|
|
1309
1974
|
|
|
1310
|
-
// ../../node_modules/viem/_esm/errors/cursor.js
|
|
1311
|
-
var NegativeOffsetError = class extends
|
|
1975
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/cursor.js
|
|
1976
|
+
var NegativeOffsetError = class extends BaseError2 {
|
|
1312
1977
|
constructor({ offset }) {
|
|
1313
1978
|
super(`Offset \`${offset}\` cannot be negative.`);
|
|
1314
1979
|
Object.defineProperty(this, "name", {
|
|
@@ -1319,7 +1984,7 @@ var NegativeOffsetError = class extends BaseError {
|
|
|
1319
1984
|
});
|
|
1320
1985
|
}
|
|
1321
1986
|
};
|
|
1322
|
-
var PositionOutOfBoundsError = class extends
|
|
1987
|
+
var PositionOutOfBoundsError = class extends BaseError2 {
|
|
1323
1988
|
constructor({ length, position }) {
|
|
1324
1989
|
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`);
|
|
1325
1990
|
Object.defineProperty(this, "name", {
|
|
@@ -1330,7 +1995,7 @@ var PositionOutOfBoundsError = class extends BaseError {
|
|
|
1330
1995
|
});
|
|
1331
1996
|
}
|
|
1332
1997
|
};
|
|
1333
|
-
var RecursiveReadLimitExceededError = class extends
|
|
1998
|
+
var RecursiveReadLimitExceededError = class extends BaseError2 {
|
|
1334
1999
|
constructor({ count, limit }) {
|
|
1335
2000
|
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`);
|
|
1336
2001
|
Object.defineProperty(this, "name", {
|
|
@@ -1342,7 +2007,7 @@ var RecursiveReadLimitExceededError = class extends BaseError {
|
|
|
1342
2007
|
}
|
|
1343
2008
|
};
|
|
1344
2009
|
|
|
1345
|
-
// ../../node_modules/viem/_esm/utils/cursor.js
|
|
2010
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/cursor.js
|
|
1346
2011
|
var staticCursor = {
|
|
1347
2012
|
bytes: new Uint8Array(),
|
|
1348
2013
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
@@ -1511,7 +2176,7 @@ function createCursor(bytes2, { recursiveReadLimit = 8192 } = {}) {
|
|
|
1511
2176
|
return cursor;
|
|
1512
2177
|
}
|
|
1513
2178
|
|
|
1514
|
-
// ../../node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
2179
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
1515
2180
|
function bytesToBigInt(bytes2, opts = {}) {
|
|
1516
2181
|
if (typeof opts.size !== "undefined")
|
|
1517
2182
|
assertSize(bytes2, { size: opts.size });
|
|
@@ -1543,7 +2208,7 @@ function bytesToString(bytes_, opts = {}) {
|
|
|
1543
2208
|
return new TextDecoder().decode(bytes2);
|
|
1544
2209
|
}
|
|
1545
2210
|
|
|
1546
|
-
// ../../node_modules/viem/_esm/utils/data/concat.js
|
|
2211
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/concat.js
|
|
1547
2212
|
function concat(values) {
|
|
1548
2213
|
if (typeof values[0] === "string")
|
|
1549
2214
|
return concatHex(values);
|
|
@@ -1566,7 +2231,7 @@ function concatHex(values) {
|
|
|
1566
2231
|
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
1567
2232
|
}
|
|
1568
2233
|
|
|
1569
|
-
// ../../node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
2234
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
1570
2235
|
function encodeAbiParameters(params, values) {
|
|
1571
2236
|
if (params.length !== values.length)
|
|
1572
2237
|
throw new AbiEncodingLengthMismatchError({
|
|
@@ -1708,7 +2373,7 @@ function encodeBytes(value, { param }) {
|
|
|
1708
2373
|
}
|
|
1709
2374
|
function encodeBool(value) {
|
|
1710
2375
|
if (typeof value !== "boolean")
|
|
1711
|
-
throw new
|
|
2376
|
+
throw new BaseError2(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
1712
2377
|
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
1713
2378
|
}
|
|
1714
2379
|
function encodeNumber(value, { signed }) {
|
|
@@ -1764,7 +2429,7 @@ function getArrayComponents(type) {
|
|
|
1764
2429
|
) : void 0;
|
|
1765
2430
|
}
|
|
1766
2431
|
|
|
1767
|
-
// ../../node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
2432
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
1768
2433
|
function decodeAbiParameters(params, data) {
|
|
1769
2434
|
const bytes2 = typeof data === "string" ? hexToBytes(data) : data;
|
|
1770
2435
|
const cursor = createCursor(bytes2);
|
|
@@ -1951,14 +2616,14 @@ function hasDynamicChild(param) {
|
|
|
1951
2616
|
return false;
|
|
1952
2617
|
}
|
|
1953
2618
|
|
|
1954
|
-
// ../../node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
2619
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
1955
2620
|
function decodeErrorResult(parameters) {
|
|
1956
2621
|
const { abi, data } = parameters;
|
|
1957
2622
|
const signature = slice(data, 0, 4);
|
|
1958
2623
|
if (signature === "0x")
|
|
1959
2624
|
throw new AbiDecodingZeroDataError();
|
|
1960
2625
|
const abi_ = [...abi || [], solidityError, solidityPanic];
|
|
1961
|
-
const abiItem = abi_.find((x) => x.type === "error" && signature === toFunctionSelector(
|
|
2626
|
+
const abiItem = abi_.find((x) => x.type === "error" && signature === toFunctionSelector(formatAbiItem2(x)));
|
|
1962
2627
|
if (!abiItem)
|
|
1963
2628
|
throw new AbiErrorSignatureNotFoundError(signature, {
|
|
1964
2629
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
@@ -1970,16 +2635,16 @@ function decodeErrorResult(parameters) {
|
|
|
1970
2635
|
};
|
|
1971
2636
|
}
|
|
1972
2637
|
|
|
1973
|
-
// ../../node_modules/viem/_esm/utils/stringify.js
|
|
2638
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/stringify.js
|
|
1974
2639
|
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
1975
2640
|
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
1976
2641
|
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
1977
2642
|
}, space);
|
|
1978
2643
|
|
|
1979
|
-
// ../../node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
2644
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
1980
2645
|
var toEventSelector = toSignatureHash;
|
|
1981
2646
|
|
|
1982
|
-
// ../../node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
2647
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
1983
2648
|
function getAbiItem(parameters) {
|
|
1984
2649
|
const { abi, args = [], name } = parameters;
|
|
1985
2650
|
const isSelector = isHex(name, { strict: false });
|
|
@@ -2091,7 +2756,7 @@ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
|
|
|
2091
2756
|
return;
|
|
2092
2757
|
}
|
|
2093
2758
|
|
|
2094
|
-
// ../../node_modules/viem/_esm/constants/unit.js
|
|
2759
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/unit.js
|
|
2095
2760
|
var etherUnits = {
|
|
2096
2761
|
gwei: 9,
|
|
2097
2762
|
wei: 18
|
|
@@ -2101,7 +2766,7 @@ var gweiUnits = {
|
|
|
2101
2766
|
wei: 9
|
|
2102
2767
|
};
|
|
2103
2768
|
|
|
2104
|
-
// ../../node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
2769
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
2105
2770
|
function formatUnits(value, decimals) {
|
|
2106
2771
|
let display = value.toString();
|
|
2107
2772
|
const negative = display.startsWith("-");
|
|
@@ -2116,18 +2781,18 @@ function formatUnits(value, decimals) {
|
|
|
2116
2781
|
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
2117
2782
|
}
|
|
2118
2783
|
|
|
2119
|
-
// ../../node_modules/viem/_esm/utils/unit/formatEther.js
|
|
2784
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
2120
2785
|
function formatEther(wei, unit = "wei") {
|
|
2121
2786
|
return formatUnits(wei, etherUnits[unit]);
|
|
2122
2787
|
}
|
|
2123
2788
|
|
|
2124
|
-
// ../../node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
2789
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
2125
2790
|
function formatGwei(wei, unit = "wei") {
|
|
2126
2791
|
return formatUnits(wei, gweiUnits[unit]);
|
|
2127
2792
|
}
|
|
2128
2793
|
|
|
2129
|
-
// ../../node_modules/viem/_esm/errors/stateOverride.js
|
|
2130
|
-
var AccountStateConflictError = class extends
|
|
2794
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/stateOverride.js
|
|
2795
|
+
var AccountStateConflictError = class extends BaseError2 {
|
|
2131
2796
|
constructor({ address }) {
|
|
2132
2797
|
super(`State for account "${address}" is set multiple times.`);
|
|
2133
2798
|
Object.defineProperty(this, "name", {
|
|
@@ -2138,7 +2803,7 @@ var AccountStateConflictError = class extends BaseError {
|
|
|
2138
2803
|
});
|
|
2139
2804
|
}
|
|
2140
2805
|
};
|
|
2141
|
-
var StateAssignmentConflictError = class extends
|
|
2806
|
+
var StateAssignmentConflictError = class extends BaseError2 {
|
|
2142
2807
|
constructor() {
|
|
2143
2808
|
super("state and stateDiff are set on the same account.");
|
|
2144
2809
|
Object.defineProperty(this, "name", {
|
|
@@ -2180,7 +2845,7 @@ function prettyStateOverride(stateOverride) {
|
|
|
2180
2845
|
}, " State Override:\n").slice(0, -1);
|
|
2181
2846
|
}
|
|
2182
2847
|
|
|
2183
|
-
// ../../node_modules/viem/_esm/errors/transaction.js
|
|
2848
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/transaction.js
|
|
2184
2849
|
function prettyPrint(args) {
|
|
2185
2850
|
const entries = Object.entries(args).map(([key, value]) => {
|
|
2186
2851
|
if (value === void 0 || value === false)
|
|
@@ -2190,7 +2855,7 @@ function prettyPrint(args) {
|
|
|
2190
2855
|
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
2191
2856
|
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
2192
2857
|
}
|
|
2193
|
-
var FeeConflictError = class extends
|
|
2858
|
+
var FeeConflictError = class extends BaseError2 {
|
|
2194
2859
|
constructor() {
|
|
2195
2860
|
super([
|
|
2196
2861
|
"Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
|
|
@@ -2205,9 +2870,9 @@ var FeeConflictError = class extends BaseError {
|
|
|
2205
2870
|
}
|
|
2206
2871
|
};
|
|
2207
2872
|
|
|
2208
|
-
// ../../node_modules/viem/_esm/errors/contract.js
|
|
2209
|
-
var CallExecutionError = class extends
|
|
2210
|
-
constructor(cause, { account: account_, docsPath:
|
|
2873
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/contract.js
|
|
2874
|
+
var CallExecutionError = class extends BaseError2 {
|
|
2875
|
+
constructor(cause, { account: account_, docsPath: docsPath4, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
|
|
2211
2876
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
2212
2877
|
let prettyArgs = prettyPrint({
|
|
2213
2878
|
from: account?.address,
|
|
@@ -2226,7 +2891,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
2226
2891
|
}
|
|
2227
2892
|
super(cause.shortMessage, {
|
|
2228
2893
|
cause,
|
|
2229
|
-
docsPath:
|
|
2894
|
+
docsPath: docsPath4,
|
|
2230
2895
|
metaMessages: [
|
|
2231
2896
|
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
2232
2897
|
"Raw Call Arguments:",
|
|
@@ -2248,7 +2913,24 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
2248
2913
|
this.cause = cause;
|
|
2249
2914
|
}
|
|
2250
2915
|
};
|
|
2251
|
-
var
|
|
2916
|
+
var CounterfactualDeploymentFailedError = class extends BaseError2 {
|
|
2917
|
+
constructor({ factory }) {
|
|
2918
|
+
super(`Deployment for counterfactual contract call failed${factory ? ` for factory "${factory}".` : ""}`, {
|
|
2919
|
+
metaMessages: [
|
|
2920
|
+
"Please ensure:",
|
|
2921
|
+
"- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).",
|
|
2922
|
+
"- The `factoryData` is a valid encoded function call for contract deployment function on the factory."
|
|
2923
|
+
]
|
|
2924
|
+
});
|
|
2925
|
+
Object.defineProperty(this, "name", {
|
|
2926
|
+
enumerable: true,
|
|
2927
|
+
configurable: true,
|
|
2928
|
+
writable: true,
|
|
2929
|
+
value: "CounterfactualDeploymentFailedError"
|
|
2930
|
+
});
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
var RawContractError = class extends BaseError2 {
|
|
2252
2934
|
constructor({ data, message }) {
|
|
2253
2935
|
super(message || "");
|
|
2254
2936
|
Object.defineProperty(this, "code", {
|
|
@@ -2273,7 +2955,7 @@ var RawContractError = class extends BaseError {
|
|
|
2273
2955
|
}
|
|
2274
2956
|
};
|
|
2275
2957
|
|
|
2276
|
-
// ../../node_modules/viem/_esm/utils/abi/decodeFunctionResult.js
|
|
2958
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js
|
|
2277
2959
|
var docsPath = "/docs/contract/decodeFunctionResult";
|
|
2278
2960
|
function decodeFunctionResult(parameters) {
|
|
2279
2961
|
const { abi, args, functionName, data } = parameters;
|
|
@@ -2296,8 +2978,25 @@ function decodeFunctionResult(parameters) {
|
|
|
2296
2978
|
return void 0;
|
|
2297
2979
|
}
|
|
2298
2980
|
|
|
2299
|
-
// ../../node_modules/viem/_esm/utils/abi/
|
|
2300
|
-
var docsPath2 = "/docs/contract/
|
|
2981
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeDeployData.js
|
|
2982
|
+
var docsPath2 = "/docs/contract/encodeDeployData";
|
|
2983
|
+
function encodeDeployData(parameters) {
|
|
2984
|
+
const { abi, args, bytecode } = parameters;
|
|
2985
|
+
if (!args || args.length === 0)
|
|
2986
|
+
return bytecode;
|
|
2987
|
+
const description = abi.find((x) => "type" in x && x.type === "constructor");
|
|
2988
|
+
if (!description)
|
|
2989
|
+
throw new AbiConstructorNotFoundError({ docsPath: docsPath2 });
|
|
2990
|
+
if (!("inputs" in description))
|
|
2991
|
+
throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
|
|
2992
|
+
if (!description.inputs || description.inputs.length === 0)
|
|
2993
|
+
throw new AbiConstructorParamsNotFoundError({ docsPath: docsPath2 });
|
|
2994
|
+
const data = encodeAbiParameters(description.inputs, args);
|
|
2995
|
+
return concatHex([bytecode, data]);
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
|
|
2999
|
+
var docsPath3 = "/docs/contract/encodeFunctionData";
|
|
2301
3000
|
function prepareEncodeFunctionData(parameters) {
|
|
2302
3001
|
const { abi, args, functionName } = parameters;
|
|
2303
3002
|
let abiItem = abi[0];
|
|
@@ -2308,18 +3007,18 @@ function prepareEncodeFunctionData(parameters) {
|
|
|
2308
3007
|
name: functionName
|
|
2309
3008
|
});
|
|
2310
3009
|
if (!item)
|
|
2311
|
-
throw new AbiFunctionNotFoundError(functionName, { docsPath:
|
|
3010
|
+
throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath3 });
|
|
2312
3011
|
abiItem = item;
|
|
2313
3012
|
}
|
|
2314
3013
|
if (abiItem.type !== "function")
|
|
2315
|
-
throw new AbiFunctionNotFoundError(void 0, { docsPath:
|
|
3014
|
+
throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath3 });
|
|
2316
3015
|
return {
|
|
2317
3016
|
abi: [abiItem],
|
|
2318
|
-
functionName: toFunctionSelector(
|
|
3017
|
+
functionName: toFunctionSelector(formatAbiItem2(abiItem))
|
|
2319
3018
|
};
|
|
2320
3019
|
}
|
|
2321
3020
|
|
|
2322
|
-
// ../../node_modules/viem/_esm/utils/abi/encodeFunctionData.js
|
|
3021
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
|
|
2323
3022
|
function encodeFunctionData(parameters) {
|
|
2324
3023
|
const { args } = parameters;
|
|
2325
3024
|
const { abi, functionName } = (() => {
|
|
@@ -2333,7 +3032,7 @@ function encodeFunctionData(parameters) {
|
|
|
2333
3032
|
return concatHex([signature, data ?? "0x"]);
|
|
2334
3033
|
}
|
|
2335
3034
|
|
|
2336
|
-
// ../../node_modules/viem/_esm/utils/chain/getChainContractAddress.js
|
|
3035
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/chain/getChainContractAddress.js
|
|
2337
3036
|
function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
2338
3037
|
const contract = chain?.contracts?.[name];
|
|
2339
3038
|
if (!contract)
|
|
@@ -2353,8 +3052,8 @@ function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
|
2353
3052
|
return contract.address;
|
|
2354
3053
|
}
|
|
2355
3054
|
|
|
2356
|
-
// ../../node_modules/viem/_esm/errors/node.js
|
|
2357
|
-
var ExecutionRevertedError = class extends
|
|
3055
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/node.js
|
|
3056
|
+
var ExecutionRevertedError = class extends BaseError2 {
|
|
2358
3057
|
constructor({ cause, message } = {}) {
|
|
2359
3058
|
const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
|
2360
3059
|
super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
|
|
@@ -2380,7 +3079,7 @@ Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
|
|
|
2380
3079
|
writable: true,
|
|
2381
3080
|
value: /execution reverted/
|
|
2382
3081
|
});
|
|
2383
|
-
var FeeCapTooHighError = class extends
|
|
3082
|
+
var FeeCapTooHighError = class extends BaseError2 {
|
|
2384
3083
|
constructor({ cause, maxFeePerGas } = {}) {
|
|
2385
3084
|
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
2386
3085
|
cause
|
|
@@ -2399,7 +3098,7 @@ Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
|
|
|
2399
3098
|
writable: true,
|
|
2400
3099
|
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
2401
3100
|
});
|
|
2402
|
-
var FeeCapTooLowError = class extends
|
|
3101
|
+
var FeeCapTooLowError = class extends BaseError2 {
|
|
2403
3102
|
constructor({ cause, maxFeePerGas } = {}) {
|
|
2404
3103
|
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
2405
3104
|
cause
|
|
@@ -2418,7 +3117,7 @@ Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
|
|
|
2418
3117
|
writable: true,
|
|
2419
3118
|
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
2420
3119
|
});
|
|
2421
|
-
var NonceTooHighError = class extends
|
|
3120
|
+
var NonceTooHighError = class extends BaseError2 {
|
|
2422
3121
|
constructor({ cause, nonce } = {}) {
|
|
2423
3122
|
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause });
|
|
2424
3123
|
Object.defineProperty(this, "name", {
|
|
@@ -2435,7 +3134,7 @@ Object.defineProperty(NonceTooHighError, "nodeMessage", {
|
|
|
2435
3134
|
writable: true,
|
|
2436
3135
|
value: /nonce too high/
|
|
2437
3136
|
});
|
|
2438
|
-
var NonceTooLowError = class extends
|
|
3137
|
+
var NonceTooLowError = class extends BaseError2 {
|
|
2439
3138
|
constructor({ cause, nonce } = {}) {
|
|
2440
3139
|
super([
|
|
2441
3140
|
`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
|
|
@@ -2455,7 +3154,7 @@ Object.defineProperty(NonceTooLowError, "nodeMessage", {
|
|
|
2455
3154
|
writable: true,
|
|
2456
3155
|
value: /nonce too low|transaction already imported|already known/
|
|
2457
3156
|
});
|
|
2458
|
-
var NonceMaxValueError = class extends
|
|
3157
|
+
var NonceMaxValueError = class extends BaseError2 {
|
|
2459
3158
|
constructor({ cause, nonce } = {}) {
|
|
2460
3159
|
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause });
|
|
2461
3160
|
Object.defineProperty(this, "name", {
|
|
@@ -2472,7 +3171,7 @@ Object.defineProperty(NonceMaxValueError, "nodeMessage", {
|
|
|
2472
3171
|
writable: true,
|
|
2473
3172
|
value: /nonce has max value/
|
|
2474
3173
|
});
|
|
2475
|
-
var InsufficientFundsError = class extends
|
|
3174
|
+
var InsufficientFundsError = class extends BaseError2 {
|
|
2476
3175
|
constructor({ cause } = {}) {
|
|
2477
3176
|
super([
|
|
2478
3177
|
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
@@ -2503,7 +3202,7 @@ Object.defineProperty(InsufficientFundsError, "nodeMessage", {
|
|
|
2503
3202
|
writable: true,
|
|
2504
3203
|
value: /insufficient funds/
|
|
2505
3204
|
});
|
|
2506
|
-
var IntrinsicGasTooHighError = class extends
|
|
3205
|
+
var IntrinsicGasTooHighError = class extends BaseError2 {
|
|
2507
3206
|
constructor({ cause, gas } = {}) {
|
|
2508
3207
|
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
|
2509
3208
|
cause
|
|
@@ -2522,7 +3221,7 @@ Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
|
|
|
2522
3221
|
writable: true,
|
|
2523
3222
|
value: /intrinsic gas too high|gas limit reached/
|
|
2524
3223
|
});
|
|
2525
|
-
var IntrinsicGasTooLowError = class extends
|
|
3224
|
+
var IntrinsicGasTooLowError = class extends BaseError2 {
|
|
2526
3225
|
constructor({ cause, gas } = {}) {
|
|
2527
3226
|
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
|
|
2528
3227
|
cause
|
|
@@ -2541,7 +3240,7 @@ Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
|
2541
3240
|
writable: true,
|
|
2542
3241
|
value: /intrinsic gas too low/
|
|
2543
3242
|
});
|
|
2544
|
-
var TransactionTypeNotSupportedError = class extends
|
|
3243
|
+
var TransactionTypeNotSupportedError = class extends BaseError2 {
|
|
2545
3244
|
constructor({ cause }) {
|
|
2546
3245
|
super("The transaction type is not supported for this chain.", {
|
|
2547
3246
|
cause
|
|
@@ -2560,7 +3259,7 @@ Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
|
|
2560
3259
|
writable: true,
|
|
2561
3260
|
value: /transaction type not valid/
|
|
2562
3261
|
});
|
|
2563
|
-
var TipAboveFeeCapError = class extends
|
|
3262
|
+
var TipAboveFeeCapError = class extends BaseError2 {
|
|
2564
3263
|
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
2565
3264
|
super([
|
|
2566
3265
|
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
@@ -2581,7 +3280,7 @@ Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
|
|
2581
3280
|
writable: true,
|
|
2582
3281
|
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
2583
3282
|
});
|
|
2584
|
-
var UnknownNodeError = class extends
|
|
3283
|
+
var UnknownNodeError = class extends BaseError2 {
|
|
2585
3284
|
constructor({ cause }) {
|
|
2586
3285
|
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
|
2587
3286
|
cause
|
|
@@ -2595,10 +3294,11 @@ var UnknownNodeError = class extends BaseError {
|
|
|
2595
3294
|
}
|
|
2596
3295
|
};
|
|
2597
3296
|
|
|
2598
|
-
// ../../node_modules/viem/_esm/errors/request.js
|
|
2599
|
-
var HttpRequestError = class extends
|
|
2600
|
-
constructor({ body, details, headers, status, url }) {
|
|
3297
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/request.js
|
|
3298
|
+
var HttpRequestError = class extends BaseError2 {
|
|
3299
|
+
constructor({ body, cause, details, headers, status, url }) {
|
|
2601
3300
|
super("HTTP request failed.", {
|
|
3301
|
+
cause,
|
|
2602
3302
|
details,
|
|
2603
3303
|
metaMessages: [
|
|
2604
3304
|
status && `Status: ${status}`,
|
|
@@ -2643,11 +3343,11 @@ var HttpRequestError = class extends BaseError {
|
|
|
2643
3343
|
}
|
|
2644
3344
|
};
|
|
2645
3345
|
|
|
2646
|
-
// ../../node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
3346
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
2647
3347
|
function getNodeError(err, args) {
|
|
2648
3348
|
const message = (err.details || "").toLowerCase();
|
|
2649
|
-
const executionRevertedError = err instanceof
|
|
2650
|
-
if (executionRevertedError instanceof
|
|
3349
|
+
const executionRevertedError = err instanceof BaseError2 ? err.walk((e) => e.code === ExecutionRevertedError.code) : err;
|
|
3350
|
+
if (executionRevertedError instanceof BaseError2) {
|
|
2651
3351
|
return new ExecutionRevertedError({
|
|
2652
3352
|
cause: err,
|
|
2653
3353
|
message: executionRevertedError.details
|
|
@@ -2693,8 +3393,8 @@ function getNodeError(err, args) {
|
|
|
2693
3393
|
});
|
|
2694
3394
|
}
|
|
2695
3395
|
|
|
2696
|
-
// ../../node_modules/viem/_esm/utils/errors/getCallError.js
|
|
2697
|
-
function getCallError(err, { docsPath:
|
|
3396
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/errors/getCallError.js
|
|
3397
|
+
function getCallError(err, { docsPath: docsPath4, ...args }) {
|
|
2698
3398
|
const cause = (() => {
|
|
2699
3399
|
const cause2 = getNodeError(err, args);
|
|
2700
3400
|
if (cause2 instanceof UnknownNodeError)
|
|
@@ -2702,12 +3402,12 @@ function getCallError(err, { docsPath: docsPath3, ...args }) {
|
|
|
2702
3402
|
return cause2;
|
|
2703
3403
|
})();
|
|
2704
3404
|
return new CallExecutionError(cause, {
|
|
2705
|
-
docsPath:
|
|
3405
|
+
docsPath: docsPath4,
|
|
2706
3406
|
...args
|
|
2707
3407
|
});
|
|
2708
3408
|
}
|
|
2709
3409
|
|
|
2710
|
-
// ../../node_modules/viem/_esm/utils/formatters/extract.js
|
|
3410
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/formatters/extract.js
|
|
2711
3411
|
function extract(value_, { format }) {
|
|
2712
3412
|
if (!format)
|
|
2713
3413
|
return {};
|
|
@@ -2726,7 +3426,7 @@ function extract(value_, { format }) {
|
|
|
2726
3426
|
return value;
|
|
2727
3427
|
}
|
|
2728
3428
|
|
|
2729
|
-
// ../../node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
3429
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
2730
3430
|
var rpcTransactionType = {
|
|
2731
3431
|
legacy: "0x0",
|
|
2732
3432
|
eip2930: "0x1",
|
|
@@ -2770,7 +3470,7 @@ function formatTransactionRequest(request) {
|
|
|
2770
3470
|
return rpcRequest;
|
|
2771
3471
|
}
|
|
2772
3472
|
|
|
2773
|
-
// ../../node_modules/viem/_esm/utils/promise/createBatchScheduler.js
|
|
3473
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/promise/createBatchScheduler.js
|
|
2774
3474
|
var schedulerCache = /* @__PURE__ */ new Map();
|
|
2775
3475
|
function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
2776
3476
|
const exec = async () => {
|
|
@@ -2820,7 +3520,7 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
|
2820
3520
|
};
|
|
2821
3521
|
}
|
|
2822
3522
|
|
|
2823
|
-
// ../../node_modules/viem/_esm/utils/stateOverride.js
|
|
3523
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/stateOverride.js
|
|
2824
3524
|
function serializeStateMapping(stateMapping) {
|
|
2825
3525
|
if (!stateMapping || stateMapping.length === 0)
|
|
2826
3526
|
return void 0;
|
|
@@ -2873,7 +3573,7 @@ function serializeStateOverride(parameters) {
|
|
|
2873
3573
|
return rpcStateOverride;
|
|
2874
3574
|
}
|
|
2875
3575
|
|
|
2876
|
-
// ../../node_modules/viem/_esm/utils/transaction/assertRequest.js
|
|
3576
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/transaction/assertRequest.js
|
|
2877
3577
|
function assertRequest(args) {
|
|
2878
3578
|
const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to } = args;
|
|
2879
3579
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
@@ -2889,10 +3589,32 @@ function assertRequest(args) {
|
|
|
2889
3589
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
|
2890
3590
|
}
|
|
2891
3591
|
|
|
2892
|
-
// ../../node_modules/viem/_esm/actions/public/call.js
|
|
3592
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/actions/public/call.js
|
|
2893
3593
|
async function call(client, args) {
|
|
2894
|
-
const { account: account_ = client.account, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = "latest", accessList, blobs, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride, ...rest } = args;
|
|
3594
|
+
const { account: account_ = client.account, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = "latest", accessList, blobs, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride, ...rest } = args;
|
|
2895
3595
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
3596
|
+
if (code && (factory || factoryData))
|
|
3597
|
+
throw new BaseError2("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
3598
|
+
if (code && to)
|
|
3599
|
+
throw new BaseError2("Cannot provide both `code` & `to` as parameters.");
|
|
3600
|
+
const deploylessCallViaBytecode = code && data_;
|
|
3601
|
+
const deploylessCallViaFactory = factory && factoryData && to && data_;
|
|
3602
|
+
const deploylessCall = deploylessCallViaBytecode || deploylessCallViaFactory;
|
|
3603
|
+
const data = (() => {
|
|
3604
|
+
if (deploylessCallViaBytecode)
|
|
3605
|
+
return toDeploylessCallViaBytecodeData({
|
|
3606
|
+
code,
|
|
3607
|
+
data: data_
|
|
3608
|
+
});
|
|
3609
|
+
if (deploylessCallViaFactory)
|
|
3610
|
+
return toDeploylessCallViaFactoryData({
|
|
3611
|
+
data: data_,
|
|
3612
|
+
factory,
|
|
3613
|
+
factoryData,
|
|
3614
|
+
to
|
|
3615
|
+
});
|
|
3616
|
+
return data_;
|
|
3617
|
+
})();
|
|
2896
3618
|
try {
|
|
2897
3619
|
assertRequest(args);
|
|
2898
3620
|
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
|
@@ -2913,7 +3635,7 @@ async function call(client, args) {
|
|
|
2913
3635
|
maxFeePerGas,
|
|
2914
3636
|
maxPriorityFeePerGas,
|
|
2915
3637
|
nonce,
|
|
2916
|
-
to,
|
|
3638
|
+
to: deploylessCall ? void 0 : to,
|
|
2917
3639
|
value
|
|
2918
3640
|
});
|
|
2919
3641
|
if (batch && shouldPerformMulticall({ request }) && !rpcStateOverride) {
|
|
@@ -2941,9 +3663,11 @@ async function call(client, args) {
|
|
|
2941
3663
|
return { data: response };
|
|
2942
3664
|
} catch (err) {
|
|
2943
3665
|
const data2 = getRevertErrorData(err);
|
|
2944
|
-
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-
|
|
3666
|
+
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-6BNOCQCH.js");
|
|
2945
3667
|
if (client.ccipRead !== false && data2?.slice(0, 10) === offchainLookupSignature2 && to)
|
|
2946
3668
|
return { data: await offchainLookup2(client, { data: data2, to }) };
|
|
3669
|
+
if (deploylessCall && data2?.slice(0, 10) === "0x101bb98d")
|
|
3670
|
+
throw new CounterfactualDeploymentFailedError({ factory });
|
|
2947
3671
|
throw getCallError(err, {
|
|
2948
3672
|
...args,
|
|
2949
3673
|
account,
|
|
@@ -3021,15 +3745,31 @@ async function scheduleMulticall(client, args) {
|
|
|
3021
3745
|
return { data: void 0 };
|
|
3022
3746
|
return { data: returnData };
|
|
3023
3747
|
}
|
|
3748
|
+
function toDeploylessCallViaBytecodeData(parameters) {
|
|
3749
|
+
const { code, data } = parameters;
|
|
3750
|
+
return encodeDeployData({
|
|
3751
|
+
abi: parseAbi(["constructor(bytes, bytes)"]),
|
|
3752
|
+
bytecode: deploylessCallViaBytecodeBytecode,
|
|
3753
|
+
args: [code, data]
|
|
3754
|
+
});
|
|
3755
|
+
}
|
|
3756
|
+
function toDeploylessCallViaFactoryData(parameters) {
|
|
3757
|
+
const { data, factory, factoryData, to } = parameters;
|
|
3758
|
+
return encodeDeployData({
|
|
3759
|
+
abi: parseAbi(["constructor(address, bytes, address, bytes)"]),
|
|
3760
|
+
bytecode: deploylessCallViaFactoryBytecode,
|
|
3761
|
+
args: [to, data, factory, factoryData]
|
|
3762
|
+
});
|
|
3763
|
+
}
|
|
3024
3764
|
function getRevertErrorData(err) {
|
|
3025
|
-
if (!(err instanceof
|
|
3765
|
+
if (!(err instanceof BaseError2))
|
|
3026
3766
|
return void 0;
|
|
3027
3767
|
const error = err.walk();
|
|
3028
3768
|
return typeof error?.data === "object" ? error.data?.data : error.data;
|
|
3029
3769
|
}
|
|
3030
3770
|
|
|
3031
|
-
// ../../node_modules/viem/_esm/errors/ccip.js
|
|
3032
|
-
var OffchainLookupError = class extends
|
|
3771
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js
|
|
3772
|
+
var OffchainLookupError = class extends BaseError2 {
|
|
3033
3773
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
|
|
3034
3774
|
super(cause.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
3035
3775
|
cause,
|
|
@@ -3055,7 +3795,7 @@ var OffchainLookupError = class extends BaseError {
|
|
|
3055
3795
|
});
|
|
3056
3796
|
}
|
|
3057
3797
|
};
|
|
3058
|
-
var OffchainLookupResponseMalformedError = class extends
|
|
3798
|
+
var OffchainLookupResponseMalformedError = class extends BaseError2 {
|
|
3059
3799
|
constructor({ result, url }) {
|
|
3060
3800
|
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
3061
3801
|
metaMessages: [
|
|
@@ -3071,7 +3811,7 @@ var OffchainLookupResponseMalformedError = class extends BaseError {
|
|
|
3071
3811
|
});
|
|
3072
3812
|
}
|
|
3073
3813
|
};
|
|
3074
|
-
var OffchainLookupSenderMismatchError = class extends
|
|
3814
|
+
var OffchainLookupSenderMismatchError = class extends BaseError2 {
|
|
3075
3815
|
constructor({ sender, to }) {
|
|
3076
3816
|
super("Reverted sender address does not match target contract address (`to`).", {
|
|
3077
3817
|
metaMessages: [
|
|
@@ -3088,7 +3828,7 @@ var OffchainLookupSenderMismatchError = class extends BaseError {
|
|
|
3088
3828
|
}
|
|
3089
3829
|
};
|
|
3090
3830
|
|
|
3091
|
-
// ../../node_modules/viem/_esm/utils/address/isAddressEqual.js
|
|
3831
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/address/isAddressEqual.js
|
|
3092
3832
|
function isAddressEqual(a, b) {
|
|
3093
3833
|
if (!isAddress(a, { strict: false }))
|
|
3094
3834
|
throw new InvalidAddressError({ address: a });
|
|
@@ -3097,7 +3837,7 @@ function isAddressEqual(a, b) {
|
|
|
3097
3837
|
return a.toLowerCase() === b.toLowerCase();
|
|
3098
3838
|
}
|
|
3099
3839
|
|
|
3100
|
-
// ../../node_modules/viem/_esm/utils/ccip.js
|
|
3840
|
+
// ../../node_modules/.pnpm/viem@2.17.9_bufferutil@4.0.8_typescript@5.5.3_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js
|
|
3101
3841
|
var offchainLookupSignature = "0x556f1830";
|
|
3102
3842
|
var offchainLookupAbiItem = {
|
|
3103
3843
|
name: "OffchainLookup",
|
|
@@ -3214,4 +3954,4 @@ export {
|
|
|
3214
3954
|
offchainLookup,
|
|
3215
3955
|
ccipRequest
|
|
3216
3956
|
};
|
|
3217
|
-
//# sourceMappingURL=chunk-
|
|
3957
|
+
//# sourceMappingURL=chunk-6M375I5V.js.map
|