@zoralabs/protocol-deployments 0.7.5 → 0.7.6
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$colon$js.log +25 -23
- package/CHANGELOG.md +8 -0
- package/dist/{_esm-7WTTA2BK.js → _esm-IDF567EZ.js} +214 -188
- package/dist/_esm-IDF567EZ.js.map +1 -0
- package/dist/{ccip-Y2GC34UW.js → ccip-TMLJ3HRN.js} +3 -2
- package/dist/chunk-BYTNVMX7.js +408 -0
- package/dist/chunk-BYTNVMX7.js.map +1 -0
- package/dist/{chunk-TP53IMLY.js → chunk-G6JVDOS5.js} +1187 -633
- package/dist/chunk-G6JVDOS5.js.map +1 -0
- package/dist/generated/wagmi.d.ts +48 -16
- package/dist/generated/wagmi.d.ts.map +1 -1
- package/dist/index.cjs +198 -193
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/{secp256k1-VMQNAPXV.js → secp256k1-XP7IUONI.js} +438 -736
- package/dist/secp256k1-XP7IUONI.js.map +1 -0
- package/package.json +2 -2
- package/src/generated/wagmi.ts +6 -2
- package/dist/_esm-7WTTA2BK.js.map +0 -1
- package/dist/chunk-TP53IMLY.js.map +0 -1
- package/dist/secp256k1-VMQNAPXV.js.map +0 -1
- /package/dist/{ccip-Y2GC34UW.js.map → ccip-TMLJ3HRN.js.map} +0 -0
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Hash,
|
|
3
|
+
abytes,
|
|
4
|
+
aexists,
|
|
5
|
+
anumber,
|
|
6
|
+
aoutput,
|
|
7
|
+
clean,
|
|
8
|
+
createHasher,
|
|
9
|
+
rotlBH,
|
|
10
|
+
rotlBL,
|
|
11
|
+
rotlSH,
|
|
12
|
+
rotlSL,
|
|
13
|
+
split,
|
|
14
|
+
swap32IfBE,
|
|
15
|
+
toBytes,
|
|
16
|
+
u32
|
|
17
|
+
} from "./chunk-BYTNVMX7.js";
|
|
3
18
|
|
|
4
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
19
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/version.js
|
|
20
|
+
var version = "1.2.3";
|
|
21
|
+
|
|
22
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/errors.js
|
|
5
23
|
var BaseError = class _BaseError extends Error {
|
|
6
24
|
constructor(shortMessage, args = {}) {
|
|
7
25
|
const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
|
|
8
|
-
const
|
|
26
|
+
const docsPath6 = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
|
|
9
27
|
const message = [
|
|
10
28
|
shortMessage || "An error occurred.",
|
|
11
29
|
"",
|
|
12
30
|
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
13
|
-
...
|
|
31
|
+
...docsPath6 ? [`Docs: https://abitype.dev${docsPath6}`] : [],
|
|
14
32
|
...details ? [`Details: ${details}`] : [],
|
|
15
33
|
`Version: abitype@${version}`
|
|
16
34
|
].join("\n");
|
|
@@ -48,13 +66,13 @@ var BaseError = class _BaseError extends Error {
|
|
|
48
66
|
if (args.cause)
|
|
49
67
|
this.cause = args.cause;
|
|
50
68
|
this.details = details;
|
|
51
|
-
this.docsPath =
|
|
69
|
+
this.docsPath = docsPath6;
|
|
52
70
|
this.metaMessages = args.metaMessages;
|
|
53
71
|
this.shortMessage = shortMessage;
|
|
54
72
|
}
|
|
55
73
|
};
|
|
56
74
|
|
|
57
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
75
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/regex.js
|
|
58
76
|
function execTyped(regex, string) {
|
|
59
77
|
const match = regex.exec(string);
|
|
60
78
|
return match?.groups;
|
|
@@ -63,7 +81,7 @@ var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
|
|
|
63
81
|
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)?$/;
|
|
64
82
|
var isTupleRegex = /^\(.+?\).*?$/;
|
|
65
83
|
|
|
66
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
84
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiParameter.js
|
|
67
85
|
var tupleRegex = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
68
86
|
function formatAbiParameter(abiParameter) {
|
|
69
87
|
let type = abiParameter.type;
|
|
@@ -77,7 +95,7 @@ function formatAbiParameter(abiParameter) {
|
|
|
77
95
|
type += ", ";
|
|
78
96
|
}
|
|
79
97
|
const result = execTyped(tupleRegex, abiParameter.type);
|
|
80
|
-
type += `)${result?.array
|
|
98
|
+
type += `)${result?.array || ""}`;
|
|
81
99
|
return formatAbiParameter({
|
|
82
100
|
...abiParameter,
|
|
83
101
|
type
|
|
@@ -90,7 +108,7 @@ function formatAbiParameter(abiParameter) {
|
|
|
90
108
|
return type;
|
|
91
109
|
}
|
|
92
110
|
|
|
93
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
111
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiParameters.js
|
|
94
112
|
function formatAbiParameters(abiParameters) {
|
|
95
113
|
let params = "";
|
|
96
114
|
const length = abiParameters.length;
|
|
@@ -103,7 +121,7 @@ function formatAbiParameters(abiParameters) {
|
|
|
103
121
|
return params;
|
|
104
122
|
}
|
|
105
123
|
|
|
106
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
124
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/formatAbiItem.js
|
|
107
125
|
function formatAbiItem(abiItem) {
|
|
108
126
|
if (abiItem.type === "function")
|
|
109
127
|
return `function ${abiItem.name}(${formatAbiParameters(abiItem.inputs)})${abiItem.stateMutability && abiItem.stateMutability !== "nonpayable" ? ` ${abiItem.stateMutability}` : ""}${abiItem.outputs?.length ? ` returns (${formatAbiParameters(abiItem.outputs)})` : ""}`;
|
|
@@ -118,7 +136,7 @@ function formatAbiItem(abiItem) {
|
|
|
118
136
|
return "receive() external payable";
|
|
119
137
|
}
|
|
120
138
|
|
|
121
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
139
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js
|
|
122
140
|
var errorSignatureRegex = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
123
141
|
function isErrorSignature(signature) {
|
|
124
142
|
return errorSignatureRegex.test(signature);
|
|
@@ -158,6 +176,9 @@ var fallbackSignatureRegex = /^fallback\(\) external(?:\s(?<stateMutability>paya
|
|
|
158
176
|
function isFallbackSignature(signature) {
|
|
159
177
|
return fallbackSignatureRegex.test(signature);
|
|
160
178
|
}
|
|
179
|
+
function execFallbackSignature(signature) {
|
|
180
|
+
return execTyped(fallbackSignatureRegex, signature);
|
|
181
|
+
}
|
|
161
182
|
var receiveSignatureRegex = /^receive\(\) external payable$/;
|
|
162
183
|
function isReceiveSignature(signature) {
|
|
163
184
|
return receiveSignatureRegex.test(signature);
|
|
@@ -169,7 +190,7 @@ var functionModifiers = /* @__PURE__ */ new Set([
|
|
|
169
190
|
"storage"
|
|
170
191
|
]);
|
|
171
192
|
|
|
172
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
193
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js
|
|
173
194
|
var UnknownTypeError = class extends BaseError {
|
|
174
195
|
constructor({ type }) {
|
|
175
196
|
super("Unknown type.", {
|
|
@@ -199,7 +220,7 @@ var UnknownSolidityTypeError = class extends BaseError {
|
|
|
199
220
|
}
|
|
200
221
|
};
|
|
201
222
|
|
|
202
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
223
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js
|
|
203
224
|
var InvalidParameterError = class extends BaseError {
|
|
204
225
|
constructor({ param }) {
|
|
205
226
|
super("Invalid ABI parameter.", {
|
|
@@ -277,7 +298,7 @@ var InvalidAbiTypeParameterError = class extends BaseError {
|
|
|
277
298
|
}
|
|
278
299
|
};
|
|
279
300
|
|
|
280
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
301
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/signature.js
|
|
281
302
|
var InvalidSignatureError = class extends BaseError {
|
|
282
303
|
constructor({ signature, type }) {
|
|
283
304
|
super(`Invalid ${type} signature.`, {
|
|
@@ -319,7 +340,7 @@ var InvalidStructSignatureError = class extends BaseError {
|
|
|
319
340
|
}
|
|
320
341
|
};
|
|
321
342
|
|
|
322
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
343
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/struct.js
|
|
323
344
|
var CircularReferenceError = class extends BaseError {
|
|
324
345
|
constructor({ type }) {
|
|
325
346
|
super("Circular reference detected.", {
|
|
@@ -334,7 +355,7 @@ var CircularReferenceError = class extends BaseError {
|
|
|
334
355
|
}
|
|
335
356
|
};
|
|
336
357
|
|
|
337
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
358
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js
|
|
338
359
|
var InvalidParenthesisError = class extends BaseError {
|
|
339
360
|
constructor({ current, depth }) {
|
|
340
361
|
super("Unbalanced parentheses.", {
|
|
@@ -352,7 +373,7 @@ var InvalidParenthesisError = class extends BaseError {
|
|
|
352
373
|
}
|
|
353
374
|
};
|
|
354
375
|
|
|
355
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
376
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/cache.js
|
|
356
377
|
function getParameterCacheKey(param, type, structs) {
|
|
357
378
|
let structKey = "";
|
|
358
379
|
if (structs)
|
|
@@ -367,7 +388,7 @@ function getParameterCacheKey(param, type, structs) {
|
|
|
367
388
|
}
|
|
368
389
|
if (type)
|
|
369
390
|
return `${type}:${param}${structKey}`;
|
|
370
|
-
return param
|
|
391
|
+
return `${param}${structKey}`;
|
|
371
392
|
}
|
|
372
393
|
var parameterCache = /* @__PURE__ */ new Map([
|
|
373
394
|
// Unnamed
|
|
@@ -424,88 +445,18 @@ var parameterCache = /* @__PURE__ */ new Map([
|
|
|
424
445
|
]
|
|
425
446
|
]);
|
|
426
447
|
|
|
427
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
448
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/utils.js
|
|
428
449
|
function parseSignature(signature, structs = {}) {
|
|
429
|
-
if (isFunctionSignature(signature))
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
inputs.push(parseAbiParameter(inputParams[i], {
|
|
438
|
-
modifiers: functionModifiers,
|
|
439
|
-
structs,
|
|
440
|
-
type: "function"
|
|
441
|
-
}));
|
|
442
|
-
}
|
|
443
|
-
const outputs = [];
|
|
444
|
-
if (match.returns) {
|
|
445
|
-
const outputParams = splitParameters(match.returns);
|
|
446
|
-
const outputLength = outputParams.length;
|
|
447
|
-
for (let i = 0; i < outputLength; i++) {
|
|
448
|
-
outputs.push(parseAbiParameter(outputParams[i], {
|
|
449
|
-
modifiers: functionModifiers,
|
|
450
|
-
structs,
|
|
451
|
-
type: "function"
|
|
452
|
-
}));
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
return {
|
|
456
|
-
name: match.name,
|
|
457
|
-
type: "function",
|
|
458
|
-
stateMutability: match.stateMutability ?? "nonpayable",
|
|
459
|
-
inputs,
|
|
460
|
-
outputs
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
if (isEventSignature(signature)) {
|
|
464
|
-
const match = execEventSignature(signature);
|
|
465
|
-
if (!match)
|
|
466
|
-
throw new InvalidSignatureError({ signature, type: "event" });
|
|
467
|
-
const params = splitParameters(match.parameters);
|
|
468
|
-
const abiParameters = [];
|
|
469
|
-
const length = params.length;
|
|
470
|
-
for (let i = 0; i < length; i++) {
|
|
471
|
-
abiParameters.push(parseAbiParameter(params[i], {
|
|
472
|
-
modifiers: eventModifiers,
|
|
473
|
-
structs,
|
|
474
|
-
type: "event"
|
|
475
|
-
}));
|
|
476
|
-
}
|
|
477
|
-
return { name: match.name, type: "event", inputs: abiParameters };
|
|
478
|
-
}
|
|
479
|
-
if (isErrorSignature(signature)) {
|
|
480
|
-
const match = execErrorSignature(signature);
|
|
481
|
-
if (!match)
|
|
482
|
-
throw new InvalidSignatureError({ signature, type: "error" });
|
|
483
|
-
const params = splitParameters(match.parameters);
|
|
484
|
-
const abiParameters = [];
|
|
485
|
-
const length = params.length;
|
|
486
|
-
for (let i = 0; i < length; i++) {
|
|
487
|
-
abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
|
|
488
|
-
}
|
|
489
|
-
return { name: match.name, type: "error", inputs: abiParameters };
|
|
490
|
-
}
|
|
491
|
-
if (isConstructorSignature(signature)) {
|
|
492
|
-
const match = execConstructorSignature(signature);
|
|
493
|
-
if (!match)
|
|
494
|
-
throw new InvalidSignatureError({ signature, type: "constructor" });
|
|
495
|
-
const params = splitParameters(match.parameters);
|
|
496
|
-
const abiParameters = [];
|
|
497
|
-
const length = params.length;
|
|
498
|
-
for (let i = 0; i < length; i++) {
|
|
499
|
-
abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
|
|
500
|
-
}
|
|
501
|
-
return {
|
|
502
|
-
type: "constructor",
|
|
503
|
-
stateMutability: match.stateMutability ?? "nonpayable",
|
|
504
|
-
inputs: abiParameters
|
|
505
|
-
};
|
|
506
|
-
}
|
|
450
|
+
if (isFunctionSignature(signature))
|
|
451
|
+
return parseFunctionSignature(signature, structs);
|
|
452
|
+
if (isEventSignature(signature))
|
|
453
|
+
return parseEventSignature(signature, structs);
|
|
454
|
+
if (isErrorSignature(signature))
|
|
455
|
+
return parseErrorSignature(signature, structs);
|
|
456
|
+
if (isConstructorSignature(signature))
|
|
457
|
+
return parseConstructorSignature(signature, structs);
|
|
507
458
|
if (isFallbackSignature(signature))
|
|
508
|
-
return
|
|
459
|
+
return parseFallbackSignature(signature);
|
|
509
460
|
if (isReceiveSignature(signature))
|
|
510
461
|
return {
|
|
511
462
|
type: "receive",
|
|
@@ -513,7 +464,91 @@ function parseSignature(signature, structs = {}) {
|
|
|
513
464
|
};
|
|
514
465
|
throw new UnknownSignatureError({ signature });
|
|
515
466
|
}
|
|
516
|
-
|
|
467
|
+
function parseFunctionSignature(signature, structs = {}) {
|
|
468
|
+
const match = execFunctionSignature(signature);
|
|
469
|
+
if (!match)
|
|
470
|
+
throw new InvalidSignatureError({ signature, type: "function" });
|
|
471
|
+
const inputParams = splitParameters(match.parameters);
|
|
472
|
+
const inputs = [];
|
|
473
|
+
const inputLength = inputParams.length;
|
|
474
|
+
for (let i = 0; i < inputLength; i++) {
|
|
475
|
+
inputs.push(parseAbiParameter(inputParams[i], {
|
|
476
|
+
modifiers: functionModifiers,
|
|
477
|
+
structs,
|
|
478
|
+
type: "function"
|
|
479
|
+
}));
|
|
480
|
+
}
|
|
481
|
+
const outputs = [];
|
|
482
|
+
if (match.returns) {
|
|
483
|
+
const outputParams = splitParameters(match.returns);
|
|
484
|
+
const outputLength = outputParams.length;
|
|
485
|
+
for (let i = 0; i < outputLength; i++) {
|
|
486
|
+
outputs.push(parseAbiParameter(outputParams[i], {
|
|
487
|
+
modifiers: functionModifiers,
|
|
488
|
+
structs,
|
|
489
|
+
type: "function"
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
return {
|
|
494
|
+
name: match.name,
|
|
495
|
+
type: "function",
|
|
496
|
+
stateMutability: match.stateMutability ?? "nonpayable",
|
|
497
|
+
inputs,
|
|
498
|
+
outputs
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
function parseEventSignature(signature, structs = {}) {
|
|
502
|
+
const match = execEventSignature(signature);
|
|
503
|
+
if (!match)
|
|
504
|
+
throw new InvalidSignatureError({ signature, type: "event" });
|
|
505
|
+
const params = splitParameters(match.parameters);
|
|
506
|
+
const abiParameters = [];
|
|
507
|
+
const length = params.length;
|
|
508
|
+
for (let i = 0; i < length; i++)
|
|
509
|
+
abiParameters.push(parseAbiParameter(params[i], {
|
|
510
|
+
modifiers: eventModifiers,
|
|
511
|
+
structs,
|
|
512
|
+
type: "event"
|
|
513
|
+
}));
|
|
514
|
+
return { name: match.name, type: "event", inputs: abiParameters };
|
|
515
|
+
}
|
|
516
|
+
function parseErrorSignature(signature, structs = {}) {
|
|
517
|
+
const match = execErrorSignature(signature);
|
|
518
|
+
if (!match)
|
|
519
|
+
throw new InvalidSignatureError({ signature, type: "error" });
|
|
520
|
+
const params = splitParameters(match.parameters);
|
|
521
|
+
const abiParameters = [];
|
|
522
|
+
const length = params.length;
|
|
523
|
+
for (let i = 0; i < length; i++)
|
|
524
|
+
abiParameters.push(parseAbiParameter(params[i], { structs, type: "error" }));
|
|
525
|
+
return { name: match.name, type: "error", inputs: abiParameters };
|
|
526
|
+
}
|
|
527
|
+
function parseConstructorSignature(signature, structs = {}) {
|
|
528
|
+
const match = execConstructorSignature(signature);
|
|
529
|
+
if (!match)
|
|
530
|
+
throw new InvalidSignatureError({ signature, type: "constructor" });
|
|
531
|
+
const params = splitParameters(match.parameters);
|
|
532
|
+
const abiParameters = [];
|
|
533
|
+
const length = params.length;
|
|
534
|
+
for (let i = 0; i < length; i++)
|
|
535
|
+
abiParameters.push(parseAbiParameter(params[i], { structs, type: "constructor" }));
|
|
536
|
+
return {
|
|
537
|
+
type: "constructor",
|
|
538
|
+
stateMutability: match.stateMutability ?? "nonpayable",
|
|
539
|
+
inputs: abiParameters
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
function parseFallbackSignature(signature) {
|
|
543
|
+
const match = execFallbackSignature(signature);
|
|
544
|
+
if (!match)
|
|
545
|
+
throw new InvalidSignatureError({ signature, type: "fallback" });
|
|
546
|
+
return {
|
|
547
|
+
type: "fallback",
|
|
548
|
+
stateMutability: match.stateMutability ?? "nonpayable"
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
var abiParameterWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
|
|
517
552
|
var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;
|
|
518
553
|
var dynamicIntegerRegex = /^u?int$/;
|
|
519
554
|
function parseAbiParameter(param, options) {
|
|
@@ -545,6 +580,8 @@ function parseAbiParameter(param, options) {
|
|
|
545
580
|
components = { components: structs[match.type] };
|
|
546
581
|
} else if (dynamicIntegerRegex.test(match.type)) {
|
|
547
582
|
type = `${match.type}256`;
|
|
583
|
+
} else if (match.type === "address payable") {
|
|
584
|
+
type = "address";
|
|
548
585
|
} else {
|
|
549
586
|
type = match.type;
|
|
550
587
|
if (!(options?.type === "struct") && !isSolidityType(type))
|
|
@@ -607,7 +644,7 @@ function isValidDataLocation(type, isArray) {
|
|
|
607
644
|
return isArray || type === "bytes" || type === "string" || type === "tuple";
|
|
608
645
|
}
|
|
609
646
|
|
|
610
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
647
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/runtime/structs.js
|
|
611
648
|
function parseStructs(signatures) {
|
|
612
649
|
const shallowStructs = {};
|
|
613
650
|
const signaturesLength = signatures.length;
|
|
@@ -645,7 +682,7 @@ function parseStructs(signatures) {
|
|
|
645
682
|
return resolvedStructs;
|
|
646
683
|
}
|
|
647
684
|
var typeWithoutTupleRegex = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
648
|
-
function resolveStructs(abiParameters, structs, ancestors = /* @__PURE__ */ new Set()) {
|
|
685
|
+
function resolveStructs(abiParameters = [], structs = {}, ancestors = /* @__PURE__ */ new Set()) {
|
|
649
686
|
const components = [];
|
|
650
687
|
const length = abiParameters.length;
|
|
651
688
|
for (let i = 0; i < length; i++) {
|
|
@@ -664,7 +701,7 @@ function resolveStructs(abiParameters, structs, ancestors = /* @__PURE__ */ new
|
|
|
664
701
|
components.push({
|
|
665
702
|
...abiParameter,
|
|
666
703
|
type: `tuple${array ?? ""}`,
|
|
667
|
-
components: resolveStructs(structs[type]
|
|
704
|
+
components: resolveStructs(structs[type], structs, /* @__PURE__ */ new Set([...ancestors, type]))
|
|
668
705
|
});
|
|
669
706
|
} else {
|
|
670
707
|
if (isSolidityType(type))
|
|
@@ -677,7 +714,7 @@ function resolveStructs(abiParameters, structs, ancestors = /* @__PURE__ */ new
|
|
|
677
714
|
return components;
|
|
678
715
|
}
|
|
679
716
|
|
|
680
|
-
// ../../node_modules/.pnpm/abitype@1.
|
|
717
|
+
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/dist/esm/human-readable/parseAbi.js
|
|
681
718
|
function parseAbi(signatures) {
|
|
682
719
|
const structs = parseStructs(signatures);
|
|
683
720
|
const abi = [];
|
|
@@ -691,14 +728,262 @@ function parseAbi(signatures) {
|
|
|
691
728
|
return abi;
|
|
692
729
|
}
|
|
693
730
|
|
|
694
|
-
// ../../node_modules/.pnpm/
|
|
731
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/version.js
|
|
732
|
+
var version2 = "0.1.1";
|
|
733
|
+
|
|
734
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/internal/errors.js
|
|
735
|
+
function getVersion() {
|
|
736
|
+
return version2;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Errors.js
|
|
740
|
+
var BaseError2 = class _BaseError extends Error {
|
|
741
|
+
static setStaticOptions(options) {
|
|
742
|
+
_BaseError.prototype.docsOrigin = options.docsOrigin;
|
|
743
|
+
_BaseError.prototype.showVersion = options.showVersion;
|
|
744
|
+
_BaseError.prototype.version = options.version;
|
|
745
|
+
}
|
|
746
|
+
constructor(shortMessage, options = {}) {
|
|
747
|
+
const details = (() => {
|
|
748
|
+
if (options.cause instanceof _BaseError) {
|
|
749
|
+
if (options.cause.details)
|
|
750
|
+
return options.cause.details;
|
|
751
|
+
if (options.cause.shortMessage)
|
|
752
|
+
return options.cause.shortMessage;
|
|
753
|
+
}
|
|
754
|
+
if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
|
|
755
|
+
return options.cause.details;
|
|
756
|
+
if (options.cause?.message)
|
|
757
|
+
return options.cause.message;
|
|
758
|
+
return options.details;
|
|
759
|
+
})();
|
|
760
|
+
const docsPath6 = (() => {
|
|
761
|
+
if (options.cause instanceof _BaseError)
|
|
762
|
+
return options.cause.docsPath || options.docsPath;
|
|
763
|
+
return options.docsPath;
|
|
764
|
+
})();
|
|
765
|
+
const docsBaseUrl = options.docsOrigin ?? _BaseError.prototype.docsOrigin;
|
|
766
|
+
const docs = `${docsBaseUrl}${docsPath6 ?? ""}`;
|
|
767
|
+
const showVersion = Boolean(options.version ?? _BaseError.prototype.showVersion);
|
|
768
|
+
const version4 = options.version ?? _BaseError.prototype.version;
|
|
769
|
+
const message = [
|
|
770
|
+
shortMessage || "An error occurred.",
|
|
771
|
+
...options.metaMessages ? ["", ...options.metaMessages] : [],
|
|
772
|
+
...details || docsPath6 || showVersion ? [
|
|
773
|
+
"",
|
|
774
|
+
details ? `Details: ${details}` : void 0,
|
|
775
|
+
docsPath6 ? `See: ${docs}` : void 0,
|
|
776
|
+
showVersion ? `Version: ${version4}` : void 0
|
|
777
|
+
] : []
|
|
778
|
+
].filter((x) => typeof x === "string").join("\n");
|
|
779
|
+
super(message, options.cause ? { cause: options.cause } : void 0);
|
|
780
|
+
Object.defineProperty(this, "details", {
|
|
781
|
+
enumerable: true,
|
|
782
|
+
configurable: true,
|
|
783
|
+
writable: true,
|
|
784
|
+
value: void 0
|
|
785
|
+
});
|
|
786
|
+
Object.defineProperty(this, "docs", {
|
|
787
|
+
enumerable: true,
|
|
788
|
+
configurable: true,
|
|
789
|
+
writable: true,
|
|
790
|
+
value: void 0
|
|
791
|
+
});
|
|
792
|
+
Object.defineProperty(this, "docsOrigin", {
|
|
793
|
+
enumerable: true,
|
|
794
|
+
configurable: true,
|
|
795
|
+
writable: true,
|
|
796
|
+
value: void 0
|
|
797
|
+
});
|
|
798
|
+
Object.defineProperty(this, "docsPath", {
|
|
799
|
+
enumerable: true,
|
|
800
|
+
configurable: true,
|
|
801
|
+
writable: true,
|
|
802
|
+
value: void 0
|
|
803
|
+
});
|
|
804
|
+
Object.defineProperty(this, "shortMessage", {
|
|
805
|
+
enumerable: true,
|
|
806
|
+
configurable: true,
|
|
807
|
+
writable: true,
|
|
808
|
+
value: void 0
|
|
809
|
+
});
|
|
810
|
+
Object.defineProperty(this, "showVersion", {
|
|
811
|
+
enumerable: true,
|
|
812
|
+
configurable: true,
|
|
813
|
+
writable: true,
|
|
814
|
+
value: void 0
|
|
815
|
+
});
|
|
816
|
+
Object.defineProperty(this, "version", {
|
|
817
|
+
enumerable: true,
|
|
818
|
+
configurable: true,
|
|
819
|
+
writable: true,
|
|
820
|
+
value: void 0
|
|
821
|
+
});
|
|
822
|
+
Object.defineProperty(this, "cause", {
|
|
823
|
+
enumerable: true,
|
|
824
|
+
configurable: true,
|
|
825
|
+
writable: true,
|
|
826
|
+
value: void 0
|
|
827
|
+
});
|
|
828
|
+
Object.defineProperty(this, "name", {
|
|
829
|
+
enumerable: true,
|
|
830
|
+
configurable: true,
|
|
831
|
+
writable: true,
|
|
832
|
+
value: "BaseError"
|
|
833
|
+
});
|
|
834
|
+
this.cause = options.cause;
|
|
835
|
+
this.details = details;
|
|
836
|
+
this.docs = docs;
|
|
837
|
+
this.docsOrigin = docsBaseUrl;
|
|
838
|
+
this.docsPath = docsPath6;
|
|
839
|
+
this.shortMessage = shortMessage;
|
|
840
|
+
this.showVersion = showVersion;
|
|
841
|
+
this.version = version4;
|
|
842
|
+
}
|
|
843
|
+
walk(fn) {
|
|
844
|
+
return walk(this, fn);
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
Object.defineProperty(BaseError2, "defaultStaticOptions", {
|
|
848
|
+
enumerable: true,
|
|
849
|
+
configurable: true,
|
|
850
|
+
writable: true,
|
|
851
|
+
value: {
|
|
852
|
+
docsOrigin: "https://oxlib.sh",
|
|
853
|
+
showVersion: false,
|
|
854
|
+
version: `ox@${getVersion()}`
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
(() => {
|
|
858
|
+
BaseError2.setStaticOptions(BaseError2.defaultStaticOptions);
|
|
859
|
+
})();
|
|
860
|
+
function walk(err, fn) {
|
|
861
|
+
if (fn?.(err))
|
|
862
|
+
return err;
|
|
863
|
+
if (err && typeof err === "object" && "cause" in err && err.cause)
|
|
864
|
+
return walk(err.cause, fn);
|
|
865
|
+
return fn ? null : err;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/internal/hex.js
|
|
869
|
+
function pad(hex_, options = {}) {
|
|
870
|
+
const { dir, size: size3 = 32 } = options;
|
|
871
|
+
if (size3 === 0)
|
|
872
|
+
return hex_;
|
|
873
|
+
const hex = hex_.replace("0x", "");
|
|
874
|
+
if (hex.length > size3 * 2)
|
|
875
|
+
throw new SizeExceedsPaddingSizeError({
|
|
876
|
+
size: Math.ceil(hex.length / 2),
|
|
877
|
+
targetSize: size3,
|
|
878
|
+
type: "Hex"
|
|
879
|
+
});
|
|
880
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Hex.js
|
|
884
|
+
function fromNumber(value, options = {}) {
|
|
885
|
+
const { signed, size: size3 } = options;
|
|
886
|
+
const value_ = BigInt(value);
|
|
887
|
+
let maxValue;
|
|
888
|
+
if (size3) {
|
|
889
|
+
if (signed)
|
|
890
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
891
|
+
else
|
|
892
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
893
|
+
} else if (typeof value === "number") {
|
|
894
|
+
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
895
|
+
}
|
|
896
|
+
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
897
|
+
if (maxValue && value_ > maxValue || value_ < minValue) {
|
|
898
|
+
const suffix = typeof value === "bigint" ? "n" : "";
|
|
899
|
+
throw new IntegerOutOfRangeError({
|
|
900
|
+
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
901
|
+
min: `${minValue}${suffix}`,
|
|
902
|
+
signed,
|
|
903
|
+
size: size3,
|
|
904
|
+
value: `${value}${suffix}`
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size3 * 8, BigInt(value_)) : value_).toString(16);
|
|
908
|
+
const hex = `0x${stringValue}`;
|
|
909
|
+
if (size3)
|
|
910
|
+
return padLeft(hex, size3);
|
|
911
|
+
return hex;
|
|
912
|
+
}
|
|
913
|
+
function padLeft(value, size3) {
|
|
914
|
+
return pad(value, { dir: "left", size: size3 });
|
|
915
|
+
}
|
|
916
|
+
var IntegerOutOfRangeError = class extends BaseError2 {
|
|
917
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
918
|
+
super(`Number \`${value}\` is not in safe${size3 ? ` ${size3 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
|
|
919
|
+
Object.defineProperty(this, "name", {
|
|
920
|
+
enumerable: true,
|
|
921
|
+
configurable: true,
|
|
922
|
+
writable: true,
|
|
923
|
+
value: "Hex.IntegerOutOfRangeError"
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
var SizeExceedsPaddingSizeError = class extends BaseError2 {
|
|
928
|
+
constructor({ size: size3, targetSize, type }) {
|
|
929
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
930
|
+
Object.defineProperty(this, "name", {
|
|
931
|
+
enumerable: true,
|
|
932
|
+
configurable: true,
|
|
933
|
+
writable: true,
|
|
934
|
+
value: "Hex.SizeExceedsPaddingSizeError"
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/Withdrawal.js
|
|
940
|
+
function toRpc(withdrawal) {
|
|
941
|
+
return {
|
|
942
|
+
address: withdrawal.address,
|
|
943
|
+
amount: fromNumber(withdrawal.amount),
|
|
944
|
+
index: fromNumber(withdrawal.index),
|
|
945
|
+
validatorIndex: fromNumber(withdrawal.validatorIndex)
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3_zod@4.3.6/node_modules/ox/_esm/core/BlockOverrides.js
|
|
950
|
+
function toRpc2(blockOverrides) {
|
|
951
|
+
return {
|
|
952
|
+
...typeof blockOverrides.baseFeePerGas === "bigint" && {
|
|
953
|
+
baseFeePerGas: fromNumber(blockOverrides.baseFeePerGas)
|
|
954
|
+
},
|
|
955
|
+
...typeof blockOverrides.blobBaseFee === "bigint" && {
|
|
956
|
+
blobBaseFee: fromNumber(blockOverrides.blobBaseFee)
|
|
957
|
+
},
|
|
958
|
+
...typeof blockOverrides.feeRecipient === "string" && {
|
|
959
|
+
feeRecipient: blockOverrides.feeRecipient
|
|
960
|
+
},
|
|
961
|
+
...typeof blockOverrides.gasLimit === "bigint" && {
|
|
962
|
+
gasLimit: fromNumber(blockOverrides.gasLimit)
|
|
963
|
+
},
|
|
964
|
+
...typeof blockOverrides.number === "bigint" && {
|
|
965
|
+
number: fromNumber(blockOverrides.number)
|
|
966
|
+
},
|
|
967
|
+
...typeof blockOverrides.prevRandao === "bigint" && {
|
|
968
|
+
prevRandao: fromNumber(blockOverrides.prevRandao)
|
|
969
|
+
},
|
|
970
|
+
...typeof blockOverrides.time === "bigint" && {
|
|
971
|
+
time: fromNumber(blockOverrides.time)
|
|
972
|
+
},
|
|
973
|
+
...blockOverrides.withdrawals && {
|
|
974
|
+
withdrawals: blockOverrides.withdrawals.map(toRpc)
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/accounts/utils/parseAccount.js
|
|
695
980
|
function parseAccount(account) {
|
|
696
981
|
if (typeof account === "string")
|
|
697
982
|
return { address: account, type: "json-rpc" };
|
|
698
983
|
return account;
|
|
699
984
|
}
|
|
700
985
|
|
|
701
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
986
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/constants/abis.js
|
|
702
987
|
var multicall3Abi = [
|
|
703
988
|
{
|
|
704
989
|
inputs: [
|
|
@@ -740,28 +1025,138 @@ var multicall3Abi = [
|
|
|
740
1025
|
],
|
|
741
1026
|
stateMutability: "view",
|
|
742
1027
|
type: "function"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
inputs: [
|
|
1031
|
+
{
|
|
1032
|
+
name: "addr",
|
|
1033
|
+
type: "address"
|
|
1034
|
+
}
|
|
1035
|
+
],
|
|
1036
|
+
name: "getEthBalance",
|
|
1037
|
+
outputs: [
|
|
1038
|
+
{
|
|
1039
|
+
name: "balance",
|
|
1040
|
+
type: "uint256"
|
|
1041
|
+
}
|
|
1042
|
+
],
|
|
1043
|
+
stateMutability: "view",
|
|
1044
|
+
type: "function"
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
inputs: [],
|
|
1048
|
+
name: "getCurrentBlockTimestamp",
|
|
1049
|
+
outputs: [
|
|
1050
|
+
{
|
|
1051
|
+
internalType: "uint256",
|
|
1052
|
+
name: "timestamp",
|
|
1053
|
+
type: "uint256"
|
|
1054
|
+
}
|
|
1055
|
+
],
|
|
1056
|
+
stateMutability: "view",
|
|
1057
|
+
type: "function"
|
|
1058
|
+
}
|
|
1059
|
+
];
|
|
1060
|
+
var batchGatewayAbi = [
|
|
1061
|
+
{
|
|
1062
|
+
name: "query",
|
|
1063
|
+
type: "function",
|
|
1064
|
+
stateMutability: "view",
|
|
1065
|
+
inputs: [
|
|
1066
|
+
{
|
|
1067
|
+
type: "tuple[]",
|
|
1068
|
+
name: "queries",
|
|
1069
|
+
components: [
|
|
1070
|
+
{
|
|
1071
|
+
type: "address",
|
|
1072
|
+
name: "sender"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
type: "string[]",
|
|
1076
|
+
name: "urls"
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
type: "bytes",
|
|
1080
|
+
name: "data"
|
|
1081
|
+
}
|
|
1082
|
+
]
|
|
1083
|
+
}
|
|
1084
|
+
],
|
|
1085
|
+
outputs: [
|
|
1086
|
+
{
|
|
1087
|
+
type: "bool[]",
|
|
1088
|
+
name: "failures"
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
type: "bytes[]",
|
|
1092
|
+
name: "responses"
|
|
1093
|
+
}
|
|
1094
|
+
]
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
name: "HttpError",
|
|
1098
|
+
type: "error",
|
|
1099
|
+
inputs: [
|
|
1100
|
+
{
|
|
1101
|
+
type: "uint16",
|
|
1102
|
+
name: "status"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
type: "string",
|
|
1106
|
+
name: "message"
|
|
1107
|
+
}
|
|
1108
|
+
]
|
|
743
1109
|
}
|
|
744
1110
|
];
|
|
745
1111
|
var universalResolverErrors = [
|
|
746
1112
|
{
|
|
747
|
-
inputs: [
|
|
748
|
-
|
|
1113
|
+
inputs: [
|
|
1114
|
+
{
|
|
1115
|
+
name: "dns",
|
|
1116
|
+
type: "bytes"
|
|
1117
|
+
}
|
|
1118
|
+
],
|
|
1119
|
+
name: "DNSDecodingFailed",
|
|
1120
|
+
type: "error"
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
inputs: [
|
|
1124
|
+
{
|
|
1125
|
+
name: "ens",
|
|
1126
|
+
type: "string"
|
|
1127
|
+
}
|
|
1128
|
+
],
|
|
1129
|
+
name: "DNSEncodingFailed",
|
|
749
1130
|
type: "error"
|
|
750
1131
|
},
|
|
751
1132
|
{
|
|
752
1133
|
inputs: [],
|
|
753
|
-
name: "
|
|
1134
|
+
name: "EmptyAddress",
|
|
1135
|
+
type: "error"
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
inputs: [
|
|
1139
|
+
{
|
|
1140
|
+
name: "status",
|
|
1141
|
+
type: "uint16"
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
name: "message",
|
|
1145
|
+
type: "string"
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
name: "HttpError",
|
|
754
1149
|
type: "error"
|
|
755
1150
|
},
|
|
756
1151
|
{
|
|
757
1152
|
inputs: [],
|
|
758
|
-
name: "
|
|
1153
|
+
name: "InvalidBatchGatewayResponse",
|
|
759
1154
|
type: "error"
|
|
760
1155
|
},
|
|
761
1156
|
{
|
|
762
1157
|
inputs: [
|
|
763
1158
|
{
|
|
764
|
-
name: "
|
|
1159
|
+
name: "errorData",
|
|
765
1160
|
type: "bytes"
|
|
766
1161
|
}
|
|
767
1162
|
],
|
|
@@ -771,41 +1166,57 @@ var universalResolverErrors = [
|
|
|
771
1166
|
{
|
|
772
1167
|
inputs: [
|
|
773
1168
|
{
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
name: "message",
|
|
781
|
-
type: "string"
|
|
782
|
-
}
|
|
783
|
-
],
|
|
784
|
-
name: "errors",
|
|
785
|
-
type: "tuple[]"
|
|
1169
|
+
name: "name",
|
|
1170
|
+
type: "bytes"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
name: "resolver",
|
|
1174
|
+
type: "address"
|
|
786
1175
|
}
|
|
787
1176
|
],
|
|
788
|
-
name: "
|
|
1177
|
+
name: "ResolverNotContract",
|
|
789
1178
|
type: "error"
|
|
790
|
-
}
|
|
791
|
-
];
|
|
792
|
-
var universalResolverResolveAbi = [
|
|
793
|
-
...universalResolverErrors,
|
|
1179
|
+
},
|
|
794
1180
|
{
|
|
795
|
-
name: "resolve",
|
|
796
|
-
type: "function",
|
|
797
|
-
stateMutability: "view",
|
|
798
1181
|
inputs: [
|
|
799
|
-
{
|
|
800
|
-
|
|
1182
|
+
{
|
|
1183
|
+
name: "name",
|
|
1184
|
+
type: "bytes"
|
|
1185
|
+
}
|
|
801
1186
|
],
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
{ name: "address", type: "address" }
|
|
805
|
-
]
|
|
1187
|
+
name: "ResolverNotFound",
|
|
1188
|
+
type: "error"
|
|
806
1189
|
},
|
|
807
1190
|
{
|
|
808
|
-
|
|
1191
|
+
inputs: [
|
|
1192
|
+
{
|
|
1193
|
+
name: "primary",
|
|
1194
|
+
type: "string"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
name: "primaryAddress",
|
|
1198
|
+
type: "bytes"
|
|
1199
|
+
}
|
|
1200
|
+
],
|
|
1201
|
+
name: "ReverseAddressMismatch",
|
|
1202
|
+
type: "error"
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
inputs: [
|
|
1206
|
+
{
|
|
1207
|
+
internalType: "bytes4",
|
|
1208
|
+
name: "selector",
|
|
1209
|
+
type: "bytes4"
|
|
1210
|
+
}
|
|
1211
|
+
],
|
|
1212
|
+
name: "UnsupportedResolverProfile",
|
|
1213
|
+
type: "error"
|
|
1214
|
+
}
|
|
1215
|
+
];
|
|
1216
|
+
var universalResolverResolveAbi = [
|
|
1217
|
+
...universalResolverErrors,
|
|
1218
|
+
{
|
|
1219
|
+
name: "resolveWithGateways",
|
|
809
1220
|
type: "function",
|
|
810
1221
|
stateMutability: "view",
|
|
811
1222
|
inputs: [
|
|
@@ -822,50 +1233,39 @@ var universalResolverResolveAbi = [
|
|
|
822
1233
|
var universalResolverReverseAbi = [
|
|
823
1234
|
...universalResolverErrors,
|
|
824
1235
|
{
|
|
825
|
-
name: "
|
|
826
|
-
type: "function",
|
|
827
|
-
stateMutability: "view",
|
|
828
|
-
inputs: [{ type: "bytes", name: "reverseName" }],
|
|
829
|
-
outputs: [
|
|
830
|
-
{ type: "string", name: "resolvedName" },
|
|
831
|
-
{ type: "address", name: "resolvedAddress" },
|
|
832
|
-
{ type: "address", name: "reverseResolver" },
|
|
833
|
-
{ type: "address", name: "resolver" }
|
|
834
|
-
]
|
|
835
|
-
},
|
|
836
|
-
{
|
|
837
|
-
name: "reverse",
|
|
1236
|
+
name: "reverseWithGateways",
|
|
838
1237
|
type: "function",
|
|
839
1238
|
stateMutability: "view",
|
|
840
1239
|
inputs: [
|
|
841
1240
|
{ type: "bytes", name: "reverseName" },
|
|
1241
|
+
{ type: "uint256", name: "coinType" },
|
|
842
1242
|
{ type: "string[]", name: "gateways" }
|
|
843
1243
|
],
|
|
844
1244
|
outputs: [
|
|
845
1245
|
{ type: "string", name: "resolvedName" },
|
|
846
|
-
{ type: "address", name: "
|
|
847
|
-
{ type: "address", name: "reverseResolver" }
|
|
848
|
-
{ type: "address", name: "resolver" }
|
|
1246
|
+
{ type: "address", name: "resolver" },
|
|
1247
|
+
{ type: "address", name: "reverseResolver" }
|
|
849
1248
|
]
|
|
850
1249
|
}
|
|
851
1250
|
];
|
|
852
1251
|
|
|
853
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1252
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/constants/contract.js
|
|
854
1253
|
var aggregate3Signature = "0x82ad56cb";
|
|
855
1254
|
|
|
856
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1255
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/constants/contracts.js
|
|
857
1256
|
var deploylessCallViaBytecodeBytecode = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";
|
|
858
1257
|
var deploylessCallViaFactoryBytecode = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
1258
|
+
var multicall3Bytecode = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";
|
|
859
1259
|
|
|
860
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
861
|
-
var
|
|
1260
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/version.js
|
|
1261
|
+
var version3 = "2.53.1";
|
|
862
1262
|
|
|
863
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1263
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/base.js
|
|
864
1264
|
var errorConfig = {
|
|
865
|
-
getDocsUrl: ({ docsBaseUrl, docsPath:
|
|
866
|
-
version: `viem@${
|
|
1265
|
+
getDocsUrl: ({ docsBaseUrl, docsPath: docsPath6 = "", docsSlug }) => docsPath6 ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath6}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
|
|
1266
|
+
version: `viem@${version3}`
|
|
867
1267
|
};
|
|
868
|
-
var
|
|
1268
|
+
var BaseError3 = class _BaseError extends Error {
|
|
869
1269
|
constructor(shortMessage, args = {}) {
|
|
870
1270
|
const details = (() => {
|
|
871
1271
|
if (args.cause instanceof _BaseError)
|
|
@@ -874,12 +1274,12 @@ var BaseError2 = class _BaseError extends Error {
|
|
|
874
1274
|
return args.cause.message;
|
|
875
1275
|
return args.details;
|
|
876
1276
|
})();
|
|
877
|
-
const
|
|
1277
|
+
const docsPath6 = (() => {
|
|
878
1278
|
if (args.cause instanceof _BaseError)
|
|
879
1279
|
return args.cause.docsPath || args.docsPath;
|
|
880
1280
|
return args.docsPath;
|
|
881
1281
|
})();
|
|
882
|
-
const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath:
|
|
1282
|
+
const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath: docsPath6 });
|
|
883
1283
|
const message = [
|
|
884
1284
|
shortMessage || "An error occurred.",
|
|
885
1285
|
"",
|
|
@@ -926,26 +1326,26 @@ var BaseError2 = class _BaseError extends Error {
|
|
|
926
1326
|
value: "BaseError"
|
|
927
1327
|
});
|
|
928
1328
|
this.details = details;
|
|
929
|
-
this.docsPath =
|
|
1329
|
+
this.docsPath = docsPath6;
|
|
930
1330
|
this.metaMessages = args.metaMessages;
|
|
931
1331
|
this.name = args.name ?? this.name;
|
|
932
1332
|
this.shortMessage = shortMessage;
|
|
933
|
-
this.version =
|
|
1333
|
+
this.version = version3;
|
|
934
1334
|
}
|
|
935
1335
|
walk(fn) {
|
|
936
|
-
return
|
|
1336
|
+
return walk2(this, fn);
|
|
937
1337
|
}
|
|
938
1338
|
};
|
|
939
|
-
function
|
|
1339
|
+
function walk2(err, fn) {
|
|
940
1340
|
if (fn?.(err))
|
|
941
1341
|
return err;
|
|
942
1342
|
if (err && typeof err === "object" && "cause" in err && err.cause !== void 0)
|
|
943
|
-
return
|
|
1343
|
+
return walk2(err.cause, fn);
|
|
944
1344
|
return fn ? null : err;
|
|
945
1345
|
}
|
|
946
1346
|
|
|
947
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
948
|
-
var ChainDoesNotSupportContract = class extends
|
|
1347
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/chain.js
|
|
1348
|
+
var ChainDoesNotSupportContract = class extends BaseError3 {
|
|
949
1349
|
constructor({ blockNumber, chain, contract }) {
|
|
950
1350
|
super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
|
|
951
1351
|
metaMessages: [
|
|
@@ -960,7 +1360,7 @@ var ChainDoesNotSupportContract = class extends BaseError2 {
|
|
|
960
1360
|
});
|
|
961
1361
|
}
|
|
962
1362
|
};
|
|
963
|
-
var ClientChainNotConfiguredError = class extends
|
|
1363
|
+
var ClientChainNotConfiguredError = class extends BaseError3 {
|
|
964
1364
|
constructor() {
|
|
965
1365
|
super("No chain was provided to the Client.", {
|
|
966
1366
|
name: "ClientChainNotConfiguredError"
|
|
@@ -968,7 +1368,7 @@ var ClientChainNotConfiguredError = class extends BaseError2 {
|
|
|
968
1368
|
}
|
|
969
1369
|
};
|
|
970
1370
|
|
|
971
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1371
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/constants/solidity.js
|
|
972
1372
|
var solidityError = {
|
|
973
1373
|
inputs: [
|
|
974
1374
|
{
|
|
@@ -990,7 +1390,7 @@ var solidityPanic = {
|
|
|
990
1390
|
type: "error"
|
|
991
1391
|
};
|
|
992
1392
|
|
|
993
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1393
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
994
1394
|
function formatAbiItem2(abiItem, { includeName = false } = {}) {
|
|
995
1395
|
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
996
1396
|
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
@@ -1008,7 +1408,7 @@ function formatAbiParam(param, { includeName }) {
|
|
|
1008
1408
|
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
1009
1409
|
}
|
|
1010
1410
|
|
|
1011
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1411
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/data/isHex.js
|
|
1012
1412
|
function isHex(value, { strict = true } = {}) {
|
|
1013
1413
|
if (!value)
|
|
1014
1414
|
return false;
|
|
@@ -1017,42 +1417,42 @@ function isHex(value, { strict = true } = {}) {
|
|
|
1017
1417
|
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
1018
1418
|
}
|
|
1019
1419
|
|
|
1020
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1021
|
-
function
|
|
1420
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/data/size.js
|
|
1421
|
+
function size2(value) {
|
|
1022
1422
|
if (isHex(value, { strict: false }))
|
|
1023
1423
|
return Math.ceil((value.length - 2) / 2);
|
|
1024
1424
|
return value.length;
|
|
1025
1425
|
}
|
|
1026
1426
|
|
|
1027
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1028
|
-
var AbiConstructorNotFoundError = class extends
|
|
1029
|
-
constructor({ docsPath:
|
|
1427
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/abi.js
|
|
1428
|
+
var AbiConstructorNotFoundError = class extends BaseError3 {
|
|
1429
|
+
constructor({ docsPath: docsPath6 }) {
|
|
1030
1430
|
super([
|
|
1031
1431
|
"A constructor was not found on the ABI.",
|
|
1032
1432
|
"Make sure you are using the correct ABI and that the constructor exists on it."
|
|
1033
1433
|
].join("\n"), {
|
|
1034
|
-
docsPath:
|
|
1434
|
+
docsPath: docsPath6,
|
|
1035
1435
|
name: "AbiConstructorNotFoundError"
|
|
1036
1436
|
});
|
|
1037
1437
|
}
|
|
1038
1438
|
};
|
|
1039
|
-
var AbiConstructorParamsNotFoundError = class extends
|
|
1040
|
-
constructor({ docsPath:
|
|
1439
|
+
var AbiConstructorParamsNotFoundError = class extends BaseError3 {
|
|
1440
|
+
constructor({ docsPath: docsPath6 }) {
|
|
1041
1441
|
super([
|
|
1042
1442
|
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
1043
1443
|
"Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
|
|
1044
1444
|
].join("\n"), {
|
|
1045
|
-
docsPath:
|
|
1445
|
+
docsPath: docsPath6,
|
|
1046
1446
|
name: "AbiConstructorParamsNotFoundError"
|
|
1047
1447
|
});
|
|
1048
1448
|
}
|
|
1049
1449
|
};
|
|
1050
|
-
var AbiDecodingDataSizeTooSmallError = class extends
|
|
1051
|
-
constructor({ data, params, size:
|
|
1052
|
-
super([`Data size of ${
|
|
1450
|
+
var AbiDecodingDataSizeTooSmallError = class extends BaseError3 {
|
|
1451
|
+
constructor({ data, params, size: size3 }) {
|
|
1452
|
+
super([`Data size of ${size3} bytes is too small for given parameters.`].join("\n"), {
|
|
1053
1453
|
metaMessages: [
|
|
1054
1454
|
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
1055
|
-
`Data: ${data} (${
|
|
1455
|
+
`Data: ${data} (${size3} bytes)`
|
|
1056
1456
|
],
|
|
1057
1457
|
name: "AbiDecodingDataSizeTooSmallError"
|
|
1058
1458
|
});
|
|
@@ -1076,17 +1476,18 @@ var AbiDecodingDataSizeTooSmallError = class extends BaseError2 {
|
|
|
1076
1476
|
});
|
|
1077
1477
|
this.data = data;
|
|
1078
1478
|
this.params = params;
|
|
1079
|
-
this.size =
|
|
1479
|
+
this.size = size3;
|
|
1080
1480
|
}
|
|
1081
1481
|
};
|
|
1082
|
-
var AbiDecodingZeroDataError = class extends
|
|
1083
|
-
constructor() {
|
|
1482
|
+
var AbiDecodingZeroDataError = class extends BaseError3 {
|
|
1483
|
+
constructor({ cause } = {}) {
|
|
1084
1484
|
super('Cannot decode zero data ("0x") with ABI parameters.', {
|
|
1085
|
-
name: "AbiDecodingZeroDataError"
|
|
1485
|
+
name: "AbiDecodingZeroDataError",
|
|
1486
|
+
cause
|
|
1086
1487
|
});
|
|
1087
1488
|
}
|
|
1088
1489
|
};
|
|
1089
|
-
var AbiEncodingArrayLengthMismatchError = class extends
|
|
1490
|
+
var AbiEncodingArrayLengthMismatchError = class extends BaseError3 {
|
|
1090
1491
|
constructor({ expectedLength, givenLength, type }) {
|
|
1091
1492
|
super([
|
|
1092
1493
|
`ABI encoding array length mismatch for type ${type}.`,
|
|
@@ -1095,12 +1496,12 @@ var AbiEncodingArrayLengthMismatchError = class extends BaseError2 {
|
|
|
1095
1496
|
].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
1096
1497
|
}
|
|
1097
1498
|
};
|
|
1098
|
-
var AbiEncodingBytesSizeMismatchError = class extends
|
|
1499
|
+
var AbiEncodingBytesSizeMismatchError = class extends BaseError3 {
|
|
1099
1500
|
constructor({ expectedSize, value }) {
|
|
1100
|
-
super(`Size of bytes "${value}" (bytes${
|
|
1501
|
+
super(`Size of bytes "${value}" (bytes${size2(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
1101
1502
|
}
|
|
1102
1503
|
};
|
|
1103
|
-
var AbiEncodingLengthMismatchError = class extends
|
|
1504
|
+
var AbiEncodingLengthMismatchError = class extends BaseError3 {
|
|
1104
1505
|
constructor({ expectedLength, givenLength }) {
|
|
1105
1506
|
super([
|
|
1106
1507
|
"ABI encoding params/values length mismatch.",
|
|
@@ -1109,15 +1510,39 @@ var AbiEncodingLengthMismatchError = class extends BaseError2 {
|
|
|
1109
1510
|
].join("\n"), { name: "AbiEncodingLengthMismatchError" });
|
|
1110
1511
|
}
|
|
1111
1512
|
};
|
|
1112
|
-
var
|
|
1113
|
-
constructor(
|
|
1513
|
+
var AbiErrorInputsNotFoundError = class extends BaseError3 {
|
|
1514
|
+
constructor(errorName, { docsPath: docsPath6 }) {
|
|
1515
|
+
super([
|
|
1516
|
+
`Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
|
|
1517
|
+
"Cannot encode error result without knowing what the parameter types are.",
|
|
1518
|
+
"Make sure you are using the correct ABI and that the inputs exist on it."
|
|
1519
|
+
].join("\n"), {
|
|
1520
|
+
docsPath: docsPath6,
|
|
1521
|
+
name: "AbiErrorInputsNotFoundError"
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1524
|
+
};
|
|
1525
|
+
var AbiErrorNotFoundError = class extends BaseError3 {
|
|
1526
|
+
constructor(errorName, { docsPath: docsPath6 } = {}) {
|
|
1527
|
+
super([
|
|
1528
|
+
`Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
|
|
1529
|
+
"Make sure you are using the correct ABI and that the error exists on it."
|
|
1530
|
+
].join("\n"), {
|
|
1531
|
+
docsPath: docsPath6,
|
|
1532
|
+
name: "AbiErrorNotFoundError"
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
var AbiErrorSignatureNotFoundError = class extends BaseError3 {
|
|
1537
|
+
constructor(signature, { docsPath: docsPath6, cause }) {
|
|
1114
1538
|
super([
|
|
1115
1539
|
`Encoded error signature "${signature}" not found on ABI.`,
|
|
1116
1540
|
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
1117
|
-
`You can look up the decoded signature here: https://
|
|
1541
|
+
`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
1118
1542
|
].join("\n"), {
|
|
1119
|
-
docsPath:
|
|
1120
|
-
name: "AbiErrorSignatureNotFoundError"
|
|
1543
|
+
docsPath: docsPath6,
|
|
1544
|
+
name: "AbiErrorSignatureNotFoundError",
|
|
1545
|
+
cause
|
|
1121
1546
|
});
|
|
1122
1547
|
Object.defineProperty(this, "signature", {
|
|
1123
1548
|
enumerable: true,
|
|
@@ -1128,30 +1553,42 @@ var AbiErrorSignatureNotFoundError = class extends BaseError2 {
|
|
|
1128
1553
|
this.signature = signature;
|
|
1129
1554
|
}
|
|
1130
1555
|
};
|
|
1131
|
-
var AbiFunctionNotFoundError = class extends
|
|
1132
|
-
constructor(functionName, { docsPath:
|
|
1556
|
+
var AbiFunctionNotFoundError = class extends BaseError3 {
|
|
1557
|
+
constructor(functionName, { docsPath: docsPath6 } = {}) {
|
|
1133
1558
|
super([
|
|
1134
1559
|
`Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
|
|
1135
1560
|
"Make sure you are using the correct ABI and that the function exists on it."
|
|
1136
1561
|
].join("\n"), {
|
|
1137
|
-
docsPath:
|
|
1562
|
+
docsPath: docsPath6,
|
|
1138
1563
|
name: "AbiFunctionNotFoundError"
|
|
1139
1564
|
});
|
|
1140
1565
|
}
|
|
1141
1566
|
};
|
|
1142
|
-
var AbiFunctionOutputsNotFoundError = class extends
|
|
1143
|
-
constructor(functionName, { docsPath:
|
|
1567
|
+
var AbiFunctionOutputsNotFoundError = class extends BaseError3 {
|
|
1568
|
+
constructor(functionName, { docsPath: docsPath6 }) {
|
|
1144
1569
|
super([
|
|
1145
1570
|
`Function "${functionName}" does not contain any \`outputs\` on ABI.`,
|
|
1146
1571
|
"Cannot decode function result without knowing what the parameter types are.",
|
|
1147
1572
|
"Make sure you are using the correct ABI and that the function exists on it."
|
|
1148
1573
|
].join("\n"), {
|
|
1149
|
-
docsPath:
|
|
1574
|
+
docsPath: docsPath6,
|
|
1150
1575
|
name: "AbiFunctionOutputsNotFoundError"
|
|
1151
1576
|
});
|
|
1152
1577
|
}
|
|
1153
1578
|
};
|
|
1154
|
-
var
|
|
1579
|
+
var AbiFunctionSignatureNotFoundError = class extends BaseError3 {
|
|
1580
|
+
constructor(signature, { docsPath: docsPath6 }) {
|
|
1581
|
+
super([
|
|
1582
|
+
`Encoded function signature "${signature}" not found on ABI.`,
|
|
1583
|
+
"Make sure you are using the correct ABI and that the function exists on it.",
|
|
1584
|
+
`You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
1585
|
+
].join("\n"), {
|
|
1586
|
+
docsPath: docsPath6,
|
|
1587
|
+
name: "AbiFunctionSignatureNotFoundError"
|
|
1588
|
+
});
|
|
1589
|
+
}
|
|
1590
|
+
};
|
|
1591
|
+
var AbiItemAmbiguityError = class extends BaseError3 {
|
|
1155
1592
|
constructor(x, y) {
|
|
1156
1593
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
1157
1594
|
metaMessages: [
|
|
@@ -1165,30 +1602,30 @@ var AbiItemAmbiguityError = class extends BaseError2 {
|
|
|
1165
1602
|
});
|
|
1166
1603
|
}
|
|
1167
1604
|
};
|
|
1168
|
-
var InvalidAbiEncodingTypeError = class extends
|
|
1169
|
-
constructor(type, { docsPath:
|
|
1605
|
+
var InvalidAbiEncodingTypeError = class extends BaseError3 {
|
|
1606
|
+
constructor(type, { docsPath: docsPath6 }) {
|
|
1170
1607
|
super([
|
|
1171
1608
|
`Type "${type}" is not a valid encoding type.`,
|
|
1172
1609
|
"Please provide a valid ABI type."
|
|
1173
|
-
].join("\n"), { docsPath:
|
|
1610
|
+
].join("\n"), { docsPath: docsPath6, name: "InvalidAbiEncodingType" });
|
|
1174
1611
|
}
|
|
1175
1612
|
};
|
|
1176
|
-
var InvalidAbiDecodingTypeError = class extends
|
|
1177
|
-
constructor(type, { docsPath:
|
|
1613
|
+
var InvalidAbiDecodingTypeError = class extends BaseError3 {
|
|
1614
|
+
constructor(type, { docsPath: docsPath6 }) {
|
|
1178
1615
|
super([
|
|
1179
1616
|
`Type "${type}" is not a valid decoding type.`,
|
|
1180
1617
|
"Please provide a valid ABI type."
|
|
1181
|
-
].join("\n"), { docsPath:
|
|
1618
|
+
].join("\n"), { docsPath: docsPath6, name: "InvalidAbiDecodingType" });
|
|
1182
1619
|
}
|
|
1183
1620
|
};
|
|
1184
|
-
var InvalidArrayError = class extends
|
|
1621
|
+
var InvalidArrayError = class extends BaseError3 {
|
|
1185
1622
|
constructor(value) {
|
|
1186
1623
|
super([`Value "${value}" is not a valid array.`].join("\n"), {
|
|
1187
1624
|
name: "InvalidArrayError"
|
|
1188
1625
|
});
|
|
1189
1626
|
}
|
|
1190
1627
|
};
|
|
1191
|
-
var InvalidDefinitionTypeError = class extends
|
|
1628
|
+
var InvalidDefinitionTypeError = class extends BaseError3 {
|
|
1192
1629
|
constructor(type) {
|
|
1193
1630
|
super([
|
|
1194
1631
|
`"${type}" is not a valid definition type.`,
|
|
@@ -1197,24 +1634,24 @@ var InvalidDefinitionTypeError = class extends BaseError2 {
|
|
|
1197
1634
|
}
|
|
1198
1635
|
};
|
|
1199
1636
|
|
|
1200
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1201
|
-
var
|
|
1202
|
-
constructor({ offset, position, size:
|
|
1203
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${
|
|
1637
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/data.js
|
|
1638
|
+
var SliceOffsetOutOfBoundsError2 = class extends BaseError3 {
|
|
1639
|
+
constructor({ offset, position, size: size3 }) {
|
|
1640
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size3}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
1204
1641
|
}
|
|
1205
1642
|
};
|
|
1206
|
-
var
|
|
1207
|
-
constructor({ size:
|
|
1208
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${
|
|
1643
|
+
var SizeExceedsPaddingSizeError2 = class extends BaseError3 {
|
|
1644
|
+
constructor({ size: size3, targetSize, type }) {
|
|
1645
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size3}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
1209
1646
|
}
|
|
1210
1647
|
};
|
|
1211
|
-
var InvalidBytesLengthError = class extends
|
|
1212
|
-
constructor({ size:
|
|
1213
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${
|
|
1648
|
+
var InvalidBytesLengthError = class extends BaseError3 {
|
|
1649
|
+
constructor({ size: size3, targetSize, type }) {
|
|
1650
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size3} ${type} long.`, { name: "InvalidBytesLengthError" });
|
|
1214
1651
|
}
|
|
1215
1652
|
};
|
|
1216
1653
|
|
|
1217
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1654
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/data/slice.js
|
|
1218
1655
|
function slice(value, start, end, { strict } = {}) {
|
|
1219
1656
|
if (isHex(value, { strict: false }))
|
|
1220
1657
|
return sliceHex(value, start, end, {
|
|
@@ -1224,94 +1661,94 @@ function slice(value, start, end, { strict } = {}) {
|
|
|
1224
1661
|
strict
|
|
1225
1662
|
});
|
|
1226
1663
|
}
|
|
1227
|
-
function
|
|
1228
|
-
if (typeof start === "number" && start > 0 && start >
|
|
1229
|
-
throw new
|
|
1664
|
+
function assertStartOffset2(value, start) {
|
|
1665
|
+
if (typeof start === "number" && start > 0 && start > size2(value) - 1)
|
|
1666
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
1230
1667
|
offset: start,
|
|
1231
1668
|
position: "start",
|
|
1232
|
-
size:
|
|
1669
|
+
size: size2(value)
|
|
1233
1670
|
});
|
|
1234
1671
|
}
|
|
1235
|
-
function
|
|
1236
|
-
if (typeof start === "number" && typeof end === "number" &&
|
|
1237
|
-
throw new
|
|
1672
|
+
function assertEndOffset2(value, start, end) {
|
|
1673
|
+
if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
|
|
1674
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
1238
1675
|
offset: end,
|
|
1239
1676
|
position: "end",
|
|
1240
|
-
size:
|
|
1677
|
+
size: size2(value)
|
|
1241
1678
|
});
|
|
1242
1679
|
}
|
|
1243
1680
|
}
|
|
1244
1681
|
function sliceBytes(value_, start, end, { strict } = {}) {
|
|
1245
|
-
|
|
1682
|
+
assertStartOffset2(value_, start);
|
|
1246
1683
|
const value = value_.slice(start, end);
|
|
1247
1684
|
if (strict)
|
|
1248
|
-
|
|
1685
|
+
assertEndOffset2(value, start, end);
|
|
1249
1686
|
return value;
|
|
1250
1687
|
}
|
|
1251
1688
|
function sliceHex(value_, start, end, { strict } = {}) {
|
|
1252
|
-
|
|
1689
|
+
assertStartOffset2(value_, start);
|
|
1253
1690
|
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
1254
1691
|
if (strict)
|
|
1255
|
-
|
|
1692
|
+
assertEndOffset2(value, start, end);
|
|
1256
1693
|
return value;
|
|
1257
1694
|
}
|
|
1258
1695
|
|
|
1259
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1260
|
-
function
|
|
1696
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/data/pad.js
|
|
1697
|
+
function pad2(hexOrBytes, { dir, size: size3 = 32 } = {}) {
|
|
1261
1698
|
if (typeof hexOrBytes === "string")
|
|
1262
|
-
return padHex(hexOrBytes, { dir, size:
|
|
1263
|
-
return padBytes(hexOrBytes, { dir, size:
|
|
1699
|
+
return padHex(hexOrBytes, { dir, size: size3 });
|
|
1700
|
+
return padBytes(hexOrBytes, { dir, size: size3 });
|
|
1264
1701
|
}
|
|
1265
|
-
function padHex(hex_, { dir, size:
|
|
1266
|
-
if (
|
|
1702
|
+
function padHex(hex_, { dir, size: size3 = 32 } = {}) {
|
|
1703
|
+
if (size3 === null)
|
|
1267
1704
|
return hex_;
|
|
1268
1705
|
const hex = hex_.replace("0x", "");
|
|
1269
|
-
if (hex.length >
|
|
1270
|
-
throw new
|
|
1706
|
+
if (hex.length > size3 * 2)
|
|
1707
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
1271
1708
|
size: Math.ceil(hex.length / 2),
|
|
1272
|
-
targetSize:
|
|
1709
|
+
targetSize: size3,
|
|
1273
1710
|
type: "hex"
|
|
1274
1711
|
});
|
|
1275
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](
|
|
1712
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
1276
1713
|
}
|
|
1277
|
-
function padBytes(bytes, { dir, size:
|
|
1278
|
-
if (
|
|
1714
|
+
function padBytes(bytes, { dir, size: size3 = 32 } = {}) {
|
|
1715
|
+
if (size3 === null)
|
|
1279
1716
|
return bytes;
|
|
1280
|
-
if (bytes.length >
|
|
1281
|
-
throw new
|
|
1717
|
+
if (bytes.length > size3)
|
|
1718
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
1282
1719
|
size: bytes.length,
|
|
1283
|
-
targetSize:
|
|
1720
|
+
targetSize: size3,
|
|
1284
1721
|
type: "bytes"
|
|
1285
1722
|
});
|
|
1286
|
-
const paddedBytes = new Uint8Array(
|
|
1287
|
-
for (let i = 0; i <
|
|
1723
|
+
const paddedBytes = new Uint8Array(size3);
|
|
1724
|
+
for (let i = 0; i < size3; i++) {
|
|
1288
1725
|
const padEnd = dir === "right";
|
|
1289
|
-
paddedBytes[padEnd ? i :
|
|
1726
|
+
paddedBytes[padEnd ? i : size3 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
1290
1727
|
}
|
|
1291
1728
|
return paddedBytes;
|
|
1292
1729
|
}
|
|
1293
1730
|
|
|
1294
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1295
|
-
var
|
|
1296
|
-
constructor({ max, min, signed, size:
|
|
1297
|
-
super(`Number "${value}" is not in safe ${
|
|
1731
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/encoding.js
|
|
1732
|
+
var IntegerOutOfRangeError2 = class extends BaseError3 {
|
|
1733
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
1734
|
+
super(`Number "${value}" is not in safe ${size3 ? `${size3 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
1298
1735
|
}
|
|
1299
1736
|
};
|
|
1300
|
-
var InvalidBytesBooleanError = class extends
|
|
1737
|
+
var InvalidBytesBooleanError = class extends BaseError3 {
|
|
1301
1738
|
constructor(bytes) {
|
|
1302
1739
|
super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
1303
1740
|
name: "InvalidBytesBooleanError"
|
|
1304
1741
|
});
|
|
1305
1742
|
}
|
|
1306
1743
|
};
|
|
1307
|
-
var
|
|
1744
|
+
var SizeOverflowError2 = class extends BaseError3 {
|
|
1308
1745
|
constructor({ givenSize, maxSize }) {
|
|
1309
1746
|
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
1310
1747
|
}
|
|
1311
1748
|
};
|
|
1312
1749
|
|
|
1313
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1314
|
-
function
|
|
1750
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/data/trim.js
|
|
1751
|
+
function trim2(hexOrBytes, { dir = "left" } = {}) {
|
|
1315
1752
|
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
1316
1753
|
let sliceLength = 0;
|
|
1317
1754
|
for (let i = 0; i < data.length - 1; i++) {
|
|
@@ -1329,32 +1766,42 @@ function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
|
1329
1766
|
return data;
|
|
1330
1767
|
}
|
|
1331
1768
|
|
|
1332
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1333
|
-
function
|
|
1334
|
-
if (
|
|
1335
|
-
throw new
|
|
1336
|
-
givenSize:
|
|
1337
|
-
maxSize:
|
|
1769
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
1770
|
+
function assertSize2(hexOrBytes, { size: size3 }) {
|
|
1771
|
+
if (size2(hexOrBytes) > size3)
|
|
1772
|
+
throw new SizeOverflowError2({
|
|
1773
|
+
givenSize: size2(hexOrBytes),
|
|
1774
|
+
maxSize: size3
|
|
1338
1775
|
});
|
|
1339
1776
|
}
|
|
1340
1777
|
function hexToBigInt(hex, opts = {}) {
|
|
1341
1778
|
const { signed } = opts;
|
|
1342
1779
|
if (opts.size)
|
|
1343
|
-
|
|
1780
|
+
assertSize2(hex, { size: opts.size });
|
|
1344
1781
|
const value = BigInt(hex);
|
|
1345
1782
|
if (!signed)
|
|
1346
1783
|
return value;
|
|
1347
|
-
const
|
|
1348
|
-
const max = (1n << BigInt(
|
|
1784
|
+
const size3 = (hex.length - 2) / 2;
|
|
1785
|
+
const max = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
1349
1786
|
if (value <= max)
|
|
1350
1787
|
return value;
|
|
1351
|
-
return value - BigInt(`0x${"f".padStart(
|
|
1788
|
+
return value - BigInt(`0x${"f".padStart(size3 * 2, "f")}`) - 1n;
|
|
1352
1789
|
}
|
|
1353
1790
|
function hexToNumber(hex, opts = {}) {
|
|
1354
|
-
|
|
1791
|
+
const value = hexToBigInt(hex, opts);
|
|
1792
|
+
const number = Number(value);
|
|
1793
|
+
if (!Number.isSafeInteger(number))
|
|
1794
|
+
throw new IntegerOutOfRangeError2({
|
|
1795
|
+
max: `${Number.MAX_SAFE_INTEGER}`,
|
|
1796
|
+
min: `${Number.MIN_SAFE_INTEGER}`,
|
|
1797
|
+
signed: opts.signed,
|
|
1798
|
+
size: opts.size,
|
|
1799
|
+
value: `${value}n`
|
|
1800
|
+
});
|
|
1801
|
+
return number;
|
|
1355
1802
|
}
|
|
1356
1803
|
|
|
1357
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1804
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
1358
1805
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
1359
1806
|
function toHex(value, opts = {}) {
|
|
1360
1807
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -1369,8 +1816,8 @@ function toHex(value, opts = {}) {
|
|
|
1369
1816
|
function boolToHex(value, opts = {}) {
|
|
1370
1817
|
const hex = `0x${Number(value)}`;
|
|
1371
1818
|
if (typeof opts.size === "number") {
|
|
1372
|
-
|
|
1373
|
-
return
|
|
1819
|
+
assertSize2(hex, { size: opts.size });
|
|
1820
|
+
return pad2(hex, { size: opts.size });
|
|
1374
1821
|
}
|
|
1375
1822
|
return hex;
|
|
1376
1823
|
}
|
|
@@ -1381,37 +1828,37 @@ function bytesToHex(value, opts = {}) {
|
|
|
1381
1828
|
}
|
|
1382
1829
|
const hex = `0x${string}`;
|
|
1383
1830
|
if (typeof opts.size === "number") {
|
|
1384
|
-
|
|
1385
|
-
return
|
|
1831
|
+
assertSize2(hex, { size: opts.size });
|
|
1832
|
+
return pad2(hex, { dir: "right", size: opts.size });
|
|
1386
1833
|
}
|
|
1387
1834
|
return hex;
|
|
1388
1835
|
}
|
|
1389
1836
|
function numberToHex(value_, opts = {}) {
|
|
1390
|
-
const { signed, size:
|
|
1837
|
+
const { signed, size: size3 } = opts;
|
|
1391
1838
|
const value = BigInt(value_);
|
|
1392
1839
|
let maxValue;
|
|
1393
|
-
if (
|
|
1840
|
+
if (size3) {
|
|
1394
1841
|
if (signed)
|
|
1395
|
-
maxValue = (1n << BigInt(
|
|
1842
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
1396
1843
|
else
|
|
1397
|
-
maxValue = 2n ** (BigInt(
|
|
1844
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
1398
1845
|
} else if (typeof value_ === "number") {
|
|
1399
1846
|
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
1400
1847
|
}
|
|
1401
1848
|
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
1402
1849
|
if (maxValue && value > maxValue || value < minValue) {
|
|
1403
1850
|
const suffix = typeof value_ === "bigint" ? "n" : "";
|
|
1404
|
-
throw new
|
|
1851
|
+
throw new IntegerOutOfRangeError2({
|
|
1405
1852
|
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
1406
1853
|
min: `${minValue}${suffix}`,
|
|
1407
1854
|
signed,
|
|
1408
|
-
size:
|
|
1855
|
+
size: size3,
|
|
1409
1856
|
value: `${value_}${suffix}`
|
|
1410
1857
|
});
|
|
1411
1858
|
}
|
|
1412
|
-
const hex = `0x${(signed && value < 0 ? (1n << BigInt(
|
|
1413
|
-
if (
|
|
1414
|
-
return
|
|
1859
|
+
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size3 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
1860
|
+
if (size3)
|
|
1861
|
+
return pad2(hex, { size: size3 });
|
|
1415
1862
|
return hex;
|
|
1416
1863
|
}
|
|
1417
1864
|
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
@@ -1420,9 +1867,9 @@ function stringToHex(value_, opts = {}) {
|
|
|
1420
1867
|
return bytesToHex(value, opts);
|
|
1421
1868
|
}
|
|
1422
1869
|
|
|
1423
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1870
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
1424
1871
|
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
1425
|
-
function
|
|
1872
|
+
function toBytes2(value, opts = {}) {
|
|
1426
1873
|
if (typeof value === "number" || typeof value === "bigint")
|
|
1427
1874
|
return numberToBytes(value, opts);
|
|
1428
1875
|
if (typeof value === "boolean")
|
|
@@ -1435,8 +1882,8 @@ function boolToBytes(value, opts = {}) {
|
|
|
1435
1882
|
const bytes = new Uint8Array(1);
|
|
1436
1883
|
bytes[0] = Number(value);
|
|
1437
1884
|
if (typeof opts.size === "number") {
|
|
1438
|
-
|
|
1439
|
-
return
|
|
1885
|
+
assertSize2(bytes, { size: opts.size });
|
|
1886
|
+
return pad2(bytes, { size: opts.size });
|
|
1440
1887
|
}
|
|
1441
1888
|
return bytes;
|
|
1442
1889
|
}
|
|
@@ -1460,8 +1907,8 @@ function charCodeToBase16(char) {
|
|
|
1460
1907
|
function hexToBytes(hex_, opts = {}) {
|
|
1461
1908
|
let hex = hex_;
|
|
1462
1909
|
if (opts.size) {
|
|
1463
|
-
|
|
1464
|
-
hex =
|
|
1910
|
+
assertSize2(hex, { size: opts.size });
|
|
1911
|
+
hex = pad2(hex, { dir: "right", size: opts.size });
|
|
1465
1912
|
}
|
|
1466
1913
|
let hexString = hex.slice(2);
|
|
1467
1914
|
if (hexString.length % 2)
|
|
@@ -1472,7 +1919,7 @@ function hexToBytes(hex_, opts = {}) {
|
|
|
1472
1919
|
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1473
1920
|
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1474
1921
|
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
1475
|
-
throw new
|
|
1922
|
+
throw new BaseError3(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
1476
1923
|
}
|
|
1477
1924
|
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
1478
1925
|
}
|
|
@@ -1485,115 +1932,22 @@ function numberToBytes(value, opts) {
|
|
|
1485
1932
|
function stringToBytes(value, opts = {}) {
|
|
1486
1933
|
const bytes = encoder2.encode(value);
|
|
1487
1934
|
if (typeof opts.size === "number") {
|
|
1488
|
-
|
|
1489
|
-
return
|
|
1935
|
+
assertSize2(bytes, { size: opts.size });
|
|
1936
|
+
return pad2(bytes, { dir: "right", size: opts.size });
|
|
1490
1937
|
}
|
|
1491
1938
|
return bytes;
|
|
1492
1939
|
}
|
|
1493
1940
|
|
|
1494
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
}
|
|
1502
|
-
function abytes(b, ...lengths) {
|
|
1503
|
-
if (!isBytes(b))
|
|
1504
|
-
throw new Error("Uint8Array expected");
|
|
1505
|
-
if (lengths.length > 0 && !lengths.includes(b.length))
|
|
1506
|
-
throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length);
|
|
1507
|
-
}
|
|
1508
|
-
function aexists(instance, checkFinished = true) {
|
|
1509
|
-
if (instance.destroyed)
|
|
1510
|
-
throw new Error("Hash instance has been destroyed");
|
|
1511
|
-
if (checkFinished && instance.finished)
|
|
1512
|
-
throw new Error("Hash#digest() has already been called");
|
|
1513
|
-
}
|
|
1514
|
-
function aoutput(out, instance) {
|
|
1515
|
-
abytes(out);
|
|
1516
|
-
const min = instance.outputLen;
|
|
1517
|
-
if (out.length < min) {
|
|
1518
|
-
throw new Error("digestInto() expects output buffer of length at least " + min);
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.6.1/node_modules/@noble/hashes/esm/_u64.js
|
|
1523
|
-
var U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
|
|
1524
|
-
var _32n = /* @__PURE__ */ BigInt(32);
|
|
1525
|
-
function fromBig(n, le = false) {
|
|
1526
|
-
if (le)
|
|
1527
|
-
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
1528
|
-
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
1529
|
-
}
|
|
1530
|
-
function split(lst, le = false) {
|
|
1531
|
-
let Ah = new Uint32Array(lst.length);
|
|
1532
|
-
let Al = new Uint32Array(lst.length);
|
|
1533
|
-
for (let i = 0; i < lst.length; i++) {
|
|
1534
|
-
const { h, l } = fromBig(lst[i], le);
|
|
1535
|
-
[Ah[i], Al[i]] = [h, l];
|
|
1536
|
-
}
|
|
1537
|
-
return [Ah, Al];
|
|
1538
|
-
}
|
|
1539
|
-
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
1540
|
-
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
1541
|
-
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
1542
|
-
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
1543
|
-
|
|
1544
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.6.1/node_modules/@noble/hashes/esm/utils.js
|
|
1545
|
-
var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
|
1546
|
-
var isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
|
|
1547
|
-
var byteSwap = (word) => word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
|
1548
|
-
function byteSwap32(arr) {
|
|
1549
|
-
for (let i = 0; i < arr.length; i++) {
|
|
1550
|
-
arr[i] = byteSwap(arr[i]);
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
function utf8ToBytes(str) {
|
|
1554
|
-
if (typeof str !== "string")
|
|
1555
|
-
throw new Error("utf8ToBytes expected string, got " + typeof str);
|
|
1556
|
-
return new Uint8Array(new TextEncoder().encode(str));
|
|
1557
|
-
}
|
|
1558
|
-
function toBytes2(data) {
|
|
1559
|
-
if (typeof data === "string")
|
|
1560
|
-
data = utf8ToBytes(data);
|
|
1561
|
-
abytes(data);
|
|
1562
|
-
return data;
|
|
1563
|
-
}
|
|
1564
|
-
var Hash = class {
|
|
1565
|
-
// Safe version that clones internal state
|
|
1566
|
-
clone() {
|
|
1567
|
-
return this._cloneInto();
|
|
1568
|
-
}
|
|
1569
|
-
};
|
|
1570
|
-
function wrapConstructor(hashCons) {
|
|
1571
|
-
const hashC = (msg) => hashCons().update(toBytes2(msg)).digest();
|
|
1572
|
-
const tmp = hashCons();
|
|
1573
|
-
hashC.outputLen = tmp.outputLen;
|
|
1574
|
-
hashC.blockLen = tmp.blockLen;
|
|
1575
|
-
hashC.create = () => hashCons();
|
|
1576
|
-
return hashC;
|
|
1577
|
-
}
|
|
1578
|
-
function wrapXOFConstructorWithOpts(hashCons) {
|
|
1579
|
-
const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest();
|
|
1580
|
-
const tmp = hashCons({});
|
|
1581
|
-
hashC.outputLen = tmp.outputLen;
|
|
1582
|
-
hashC.blockLen = tmp.blockLen;
|
|
1583
|
-
hashC.create = (opts) => hashCons(opts);
|
|
1584
|
-
return hashC;
|
|
1585
|
-
}
|
|
1586
|
-
|
|
1587
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.6.1/node_modules/@noble/hashes/esm/sha3.js
|
|
1941
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js
|
|
1942
|
+
var _0n = BigInt(0);
|
|
1943
|
+
var _1n = BigInt(1);
|
|
1944
|
+
var _2n = BigInt(2);
|
|
1945
|
+
var _7n = BigInt(7);
|
|
1946
|
+
var _256n = BigInt(256);
|
|
1947
|
+
var _0x71n = BigInt(113);
|
|
1588
1948
|
var SHA3_PI = [];
|
|
1589
1949
|
var SHA3_ROTL = [];
|
|
1590
1950
|
var _SHA3_IOTA = [];
|
|
1591
|
-
var _0n = /* @__PURE__ */ BigInt(0);
|
|
1592
|
-
var _1n = /* @__PURE__ */ BigInt(1);
|
|
1593
|
-
var _2n = /* @__PURE__ */ BigInt(2);
|
|
1594
|
-
var _7n = /* @__PURE__ */ BigInt(7);
|
|
1595
|
-
var _256n = /* @__PURE__ */ BigInt(256);
|
|
1596
|
-
var _0x71n = /* @__PURE__ */ BigInt(113);
|
|
1597
1951
|
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
1598
1952
|
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
1599
1953
|
SHA3_PI.push(2 * (5 * y + x));
|
|
@@ -1606,7 +1960,9 @@ for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
|
1606
1960
|
}
|
|
1607
1961
|
_SHA3_IOTA.push(t);
|
|
1608
1962
|
}
|
|
1609
|
-
var
|
|
1963
|
+
var IOTAS = split(_SHA3_IOTA, true);
|
|
1964
|
+
var SHA3_IOTA_H = IOTAS[0];
|
|
1965
|
+
var SHA3_IOTA_L = IOTAS[1];
|
|
1610
1966
|
var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
|
|
1611
1967
|
var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
|
|
1612
1968
|
function keccakP(s, rounds = 24) {
|
|
@@ -1647,40 +2003,43 @@ function keccakP(s, rounds = 24) {
|
|
|
1647
2003
|
s[0] ^= SHA3_IOTA_H[round];
|
|
1648
2004
|
s[1] ^= SHA3_IOTA_L[round];
|
|
1649
2005
|
}
|
|
1650
|
-
B
|
|
2006
|
+
clean(B);
|
|
1651
2007
|
}
|
|
1652
2008
|
var Keccak = class _Keccak extends Hash {
|
|
1653
2009
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1654
2010
|
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
1655
2011
|
super();
|
|
2012
|
+
this.pos = 0;
|
|
2013
|
+
this.posOut = 0;
|
|
2014
|
+
this.finished = false;
|
|
2015
|
+
this.destroyed = false;
|
|
2016
|
+
this.enableXOF = false;
|
|
1656
2017
|
this.blockLen = blockLen;
|
|
1657
2018
|
this.suffix = suffix;
|
|
1658
2019
|
this.outputLen = outputLen;
|
|
1659
2020
|
this.enableXOF = enableXOF;
|
|
1660
2021
|
this.rounds = rounds;
|
|
1661
|
-
this.pos = 0;
|
|
1662
|
-
this.posOut = 0;
|
|
1663
|
-
this.finished = false;
|
|
1664
|
-
this.destroyed = false;
|
|
1665
2022
|
anumber(outputLen);
|
|
1666
|
-
if (0
|
|
1667
|
-
throw new Error("
|
|
2023
|
+
if (!(0 < blockLen && blockLen < 200))
|
|
2024
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
1668
2025
|
this.state = new Uint8Array(200);
|
|
1669
2026
|
this.state32 = u32(this.state);
|
|
1670
2027
|
}
|
|
2028
|
+
clone() {
|
|
2029
|
+
return this._cloneInto();
|
|
2030
|
+
}
|
|
1671
2031
|
keccak() {
|
|
1672
|
-
|
|
1673
|
-
byteSwap32(this.state32);
|
|
2032
|
+
swap32IfBE(this.state32);
|
|
1674
2033
|
keccakP(this.state32, this.rounds);
|
|
1675
|
-
|
|
1676
|
-
byteSwap32(this.state32);
|
|
2034
|
+
swap32IfBE(this.state32);
|
|
1677
2035
|
this.posOut = 0;
|
|
1678
2036
|
this.pos = 0;
|
|
1679
2037
|
}
|
|
1680
2038
|
update(data) {
|
|
1681
2039
|
aexists(this);
|
|
2040
|
+
data = toBytes(data);
|
|
2041
|
+
abytes(data);
|
|
1682
2042
|
const { blockLen, state } = this;
|
|
1683
|
-
data = toBytes2(data);
|
|
1684
2043
|
const len = data.length;
|
|
1685
2044
|
for (let pos = 0; pos < len; ) {
|
|
1686
2045
|
const take = Math.min(blockLen - this.pos, len - pos);
|
|
@@ -1740,7 +2099,7 @@ var Keccak = class _Keccak extends Hash {
|
|
|
1740
2099
|
}
|
|
1741
2100
|
destroy() {
|
|
1742
2101
|
this.destroyed = true;
|
|
1743
|
-
this.state
|
|
2102
|
+
clean(this.state);
|
|
1744
2103
|
}
|
|
1745
2104
|
_cloneInto(to) {
|
|
1746
2105
|
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
@@ -1757,35 +2116,25 @@ var Keccak = class _Keccak extends Hash {
|
|
|
1757
2116
|
return to;
|
|
1758
2117
|
}
|
|
1759
2118
|
};
|
|
1760
|
-
var gen = (suffix, blockLen, outputLen) =>
|
|
1761
|
-
var
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
var sha3_512 = /* @__PURE__ */ gen(6, 72, 512 / 8);
|
|
1765
|
-
var keccak_224 = /* @__PURE__ */ gen(1, 144, 224 / 8);
|
|
1766
|
-
var keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8);
|
|
1767
|
-
var keccak_384 = /* @__PURE__ */ gen(1, 104, 384 / 8);
|
|
1768
|
-
var keccak_512 = /* @__PURE__ */ gen(1, 72, 512 / 8);
|
|
1769
|
-
var genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
|
1770
|
-
var shake128 = /* @__PURE__ */ genShake(31, 168, 128 / 8);
|
|
1771
|
-
var shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
|
|
1772
|
-
|
|
1773
|
-
// ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
2119
|
+
var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
|
|
2120
|
+
var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
2121
|
+
|
|
2122
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
1774
2123
|
function keccak256(value, to_) {
|
|
1775
2124
|
const to = to_ || "hex";
|
|
1776
|
-
const bytes = keccak_256(isHex(value, { strict: false }) ?
|
|
2125
|
+
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes2(value) : value);
|
|
1777
2126
|
if (to === "bytes")
|
|
1778
2127
|
return bytes;
|
|
1779
2128
|
return toHex(bytes);
|
|
1780
2129
|
}
|
|
1781
2130
|
|
|
1782
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1783
|
-
var hash = (value) => keccak256(
|
|
2131
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
2132
|
+
var hash = (value) => keccak256(toBytes2(value));
|
|
1784
2133
|
function hashSignature(sig) {
|
|
1785
2134
|
return hash(sig);
|
|
1786
2135
|
}
|
|
1787
2136
|
|
|
1788
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2137
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
1789
2138
|
function normalizeSignature(signature) {
|
|
1790
2139
|
let active = true;
|
|
1791
2140
|
let current = "";
|
|
@@ -1825,11 +2174,11 @@ function normalizeSignature(signature) {
|
|
|
1825
2174
|
current += char;
|
|
1826
2175
|
}
|
|
1827
2176
|
if (!valid)
|
|
1828
|
-
throw new
|
|
2177
|
+
throw new BaseError3("Unable to normalize signature.");
|
|
1829
2178
|
return result;
|
|
1830
2179
|
}
|
|
1831
2180
|
|
|
1832
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2181
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/toSignature.js
|
|
1833
2182
|
var toSignature = (def) => {
|
|
1834
2183
|
const def_ = (() => {
|
|
1835
2184
|
if (typeof def === "string")
|
|
@@ -1839,16 +2188,16 @@ var toSignature = (def) => {
|
|
|
1839
2188
|
return normalizeSignature(def_);
|
|
1840
2189
|
};
|
|
1841
2190
|
|
|
1842
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2191
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
1843
2192
|
function toSignatureHash(fn) {
|
|
1844
2193
|
return hashSignature(toSignature(fn));
|
|
1845
2194
|
}
|
|
1846
2195
|
|
|
1847
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2196
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
1848
2197
|
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
1849
2198
|
|
|
1850
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1851
|
-
var InvalidAddressError = class extends
|
|
2199
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/address.js
|
|
2200
|
+
var InvalidAddressError = class extends BaseError3 {
|
|
1852
2201
|
constructor({ address }) {
|
|
1853
2202
|
super(`Address "${address}" is invalid.`, {
|
|
1854
2203
|
metaMessages: [
|
|
@@ -1860,9 +2209,9 @@ var InvalidAddressError = class extends BaseError2 {
|
|
|
1860
2209
|
}
|
|
1861
2210
|
};
|
|
1862
2211
|
|
|
1863
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2212
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/lru.js
|
|
1864
2213
|
var LruMap = class extends Map {
|
|
1865
|
-
constructor(
|
|
2214
|
+
constructor(size3) {
|
|
1866
2215
|
super();
|
|
1867
2216
|
Object.defineProperty(this, "maxSize", {
|
|
1868
2217
|
enumerable: true,
|
|
@@ -1870,28 +2219,30 @@ var LruMap = class extends Map {
|
|
|
1870
2219
|
writable: true,
|
|
1871
2220
|
value: void 0
|
|
1872
2221
|
});
|
|
1873
|
-
this.maxSize =
|
|
2222
|
+
this.maxSize = size3;
|
|
1874
2223
|
}
|
|
1875
2224
|
get(key) {
|
|
1876
2225
|
const value = super.get(key);
|
|
1877
|
-
if (super.has(key)
|
|
1878
|
-
|
|
2226
|
+
if (super.has(key)) {
|
|
2227
|
+
super.delete(key);
|
|
1879
2228
|
super.set(key, value);
|
|
1880
2229
|
}
|
|
1881
2230
|
return value;
|
|
1882
2231
|
}
|
|
1883
2232
|
set(key, value) {
|
|
2233
|
+
if (super.has(key))
|
|
2234
|
+
super.delete(key);
|
|
1884
2235
|
super.set(key, value);
|
|
1885
2236
|
if (this.maxSize && this.size > this.maxSize) {
|
|
1886
|
-
const firstKey =
|
|
1887
|
-
if (firstKey)
|
|
1888
|
-
|
|
2237
|
+
const firstKey = super.keys().next().value;
|
|
2238
|
+
if (firstKey !== void 0)
|
|
2239
|
+
super.delete(firstKey);
|
|
1889
2240
|
}
|
|
1890
2241
|
return this;
|
|
1891
2242
|
}
|
|
1892
2243
|
};
|
|
1893
2244
|
|
|
1894
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2245
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/address/isAddress.js
|
|
1895
2246
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
1896
2247
|
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1897
2248
|
function isAddress(address, options) {
|
|
@@ -1912,7 +2263,7 @@ function isAddress(address, options) {
|
|
|
1912
2263
|
return result;
|
|
1913
2264
|
}
|
|
1914
2265
|
|
|
1915
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2266
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/address/getAddress.js
|
|
1916
2267
|
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1917
2268
|
function checksumAddress(address_, chainId) {
|
|
1918
2269
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
@@ -1933,26 +2284,26 @@ function checksumAddress(address_, chainId) {
|
|
|
1933
2284
|
return result;
|
|
1934
2285
|
}
|
|
1935
2286
|
|
|
1936
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1937
|
-
var NegativeOffsetError = class extends
|
|
2287
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/cursor.js
|
|
2288
|
+
var NegativeOffsetError = class extends BaseError3 {
|
|
1938
2289
|
constructor({ offset }) {
|
|
1939
2290
|
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
1940
2291
|
name: "NegativeOffsetError"
|
|
1941
2292
|
});
|
|
1942
2293
|
}
|
|
1943
2294
|
};
|
|
1944
|
-
var PositionOutOfBoundsError = class extends
|
|
2295
|
+
var PositionOutOfBoundsError = class extends BaseError3 {
|
|
1945
2296
|
constructor({ length, position }) {
|
|
1946
2297
|
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`, { name: "PositionOutOfBoundsError" });
|
|
1947
2298
|
}
|
|
1948
2299
|
};
|
|
1949
|
-
var RecursiveReadLimitExceededError = class extends
|
|
2300
|
+
var RecursiveReadLimitExceededError = class extends BaseError3 {
|
|
1950
2301
|
constructor({ count, limit }) {
|
|
1951
2302
|
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
1952
2303
|
}
|
|
1953
2304
|
};
|
|
1954
2305
|
|
|
1955
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2306
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/cursor.js
|
|
1956
2307
|
var staticCursor = {
|
|
1957
2308
|
bytes: new Uint8Array(),
|
|
1958
2309
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
@@ -2059,11 +2410,11 @@ var staticCursor = {
|
|
|
2059
2410
|
this.position++;
|
|
2060
2411
|
return value;
|
|
2061
2412
|
},
|
|
2062
|
-
readBytes(length,
|
|
2413
|
+
readBytes(length, size3) {
|
|
2063
2414
|
this.assertReadLimit();
|
|
2064
2415
|
this._touch();
|
|
2065
2416
|
const value = this.inspectBytes(length);
|
|
2066
|
-
this.position +=
|
|
2417
|
+
this.position += size3 ?? length;
|
|
2067
2418
|
return value;
|
|
2068
2419
|
},
|
|
2069
2420
|
readUint8() {
|
|
@@ -2115,24 +2466,24 @@ var staticCursor = {
|
|
|
2115
2466
|
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
2116
2467
|
const cursor = Object.create(staticCursor);
|
|
2117
2468
|
cursor.bytes = bytes;
|
|
2118
|
-
cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
2469
|
+
cursor.dataView = new DataView(bytes.buffer ?? bytes, bytes.byteOffset, bytes.byteLength);
|
|
2119
2470
|
cursor.positionReadCount = /* @__PURE__ */ new Map();
|
|
2120
2471
|
cursor.recursiveReadLimit = recursiveReadLimit;
|
|
2121
2472
|
return cursor;
|
|
2122
2473
|
}
|
|
2123
2474
|
|
|
2124
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2475
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
2125
2476
|
function bytesToBigInt(bytes, opts = {}) {
|
|
2126
2477
|
if (typeof opts.size !== "undefined")
|
|
2127
|
-
|
|
2478
|
+
assertSize2(bytes, { size: opts.size });
|
|
2128
2479
|
const hex = bytesToHex(bytes, opts);
|
|
2129
2480
|
return hexToBigInt(hex, opts);
|
|
2130
2481
|
}
|
|
2131
2482
|
function bytesToBool(bytes_, opts = {}) {
|
|
2132
2483
|
let bytes = bytes_;
|
|
2133
2484
|
if (typeof opts.size !== "undefined") {
|
|
2134
|
-
|
|
2135
|
-
bytes =
|
|
2485
|
+
assertSize2(bytes, { size: opts.size });
|
|
2486
|
+
bytes = trim2(bytes);
|
|
2136
2487
|
}
|
|
2137
2488
|
if (bytes.length > 1 || bytes[0] > 1)
|
|
2138
2489
|
throw new InvalidBytesBooleanError(bytes);
|
|
@@ -2140,20 +2491,20 @@ function bytesToBool(bytes_, opts = {}) {
|
|
|
2140
2491
|
}
|
|
2141
2492
|
function bytesToNumber(bytes, opts = {}) {
|
|
2142
2493
|
if (typeof opts.size !== "undefined")
|
|
2143
|
-
|
|
2494
|
+
assertSize2(bytes, { size: opts.size });
|
|
2144
2495
|
const hex = bytesToHex(bytes, opts);
|
|
2145
2496
|
return hexToNumber(hex, opts);
|
|
2146
2497
|
}
|
|
2147
2498
|
function bytesToString(bytes_, opts = {}) {
|
|
2148
2499
|
let bytes = bytes_;
|
|
2149
2500
|
if (typeof opts.size !== "undefined") {
|
|
2150
|
-
|
|
2151
|
-
bytes =
|
|
2501
|
+
assertSize2(bytes, { size: opts.size });
|
|
2502
|
+
bytes = trim2(bytes, { dir: "right" });
|
|
2152
2503
|
}
|
|
2153
2504
|
return new TextDecoder().decode(bytes);
|
|
2154
2505
|
}
|
|
2155
2506
|
|
|
2156
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2507
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/data/concat.js
|
|
2157
2508
|
function concat(values) {
|
|
2158
2509
|
if (typeof values[0] === "string")
|
|
2159
2510
|
return concatHex(values);
|
|
@@ -2176,10 +2527,10 @@ function concatHex(values) {
|
|
|
2176
2527
|
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
2177
2528
|
}
|
|
2178
2529
|
|
|
2179
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2530
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/regex.js
|
|
2180
2531
|
var integerRegex2 = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
|
2181
2532
|
|
|
2182
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2533
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
2183
2534
|
function encodeAbiParameters(params, values) {
|
|
2184
2535
|
if (params.length !== values.length)
|
|
2185
2536
|
throw new AbiEncodingLengthMismatchError({
|
|
@@ -2221,10 +2572,10 @@ function prepareParam({ param, value }) {
|
|
|
2221
2572
|
}
|
|
2222
2573
|
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
|
2223
2574
|
const signed = param.type.startsWith("int");
|
|
2224
|
-
const [, ,
|
|
2575
|
+
const [, , size3 = "256"] = integerRegex2.exec(param.type) ?? [];
|
|
2225
2576
|
return encodeNumber(value, {
|
|
2226
2577
|
signed,
|
|
2227
|
-
size: Number(
|
|
2578
|
+
size: Number(size3)
|
|
2228
2579
|
});
|
|
2229
2580
|
}
|
|
2230
2581
|
if (param.type.startsWith("bytes")) {
|
|
@@ -2244,7 +2595,7 @@ function encodeParams(preparedParams) {
|
|
|
2244
2595
|
if (dynamic)
|
|
2245
2596
|
staticSize += 32;
|
|
2246
2597
|
else
|
|
2247
|
-
staticSize +=
|
|
2598
|
+
staticSize += size2(encoded);
|
|
2248
2599
|
}
|
|
2249
2600
|
const staticParams = [];
|
|
2250
2601
|
const dynamicParams = [];
|
|
@@ -2254,7 +2605,7 @@ function encodeParams(preparedParams) {
|
|
|
2254
2605
|
if (dynamic) {
|
|
2255
2606
|
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
2256
2607
|
dynamicParams.push(encoded);
|
|
2257
|
-
dynamicSize +=
|
|
2608
|
+
dynamicSize += size2(encoded);
|
|
2258
2609
|
} else {
|
|
2259
2610
|
staticParams.push(encoded);
|
|
2260
2611
|
}
|
|
@@ -2303,7 +2654,7 @@ function encodeArray(value, { length, param }) {
|
|
|
2303
2654
|
}
|
|
2304
2655
|
function encodeBytes(value, { param }) {
|
|
2305
2656
|
const [, paramSize] = param.type.split("bytes");
|
|
2306
|
-
const bytesSize =
|
|
2657
|
+
const bytesSize = size2(value);
|
|
2307
2658
|
if (!paramSize) {
|
|
2308
2659
|
let value_ = value;
|
|
2309
2660
|
if (bytesSize % 32 !== 0)
|
|
@@ -2316,28 +2667,28 @@ function encodeBytes(value, { param }) {
|
|
|
2316
2667
|
encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_])
|
|
2317
2668
|
};
|
|
2318
2669
|
}
|
|
2319
|
-
if (bytesSize !== Number.parseInt(paramSize))
|
|
2670
|
+
if (bytesSize !== Number.parseInt(paramSize, 10))
|
|
2320
2671
|
throw new AbiEncodingBytesSizeMismatchError({
|
|
2321
|
-
expectedSize: Number.parseInt(paramSize),
|
|
2672
|
+
expectedSize: Number.parseInt(paramSize, 10),
|
|
2322
2673
|
value
|
|
2323
2674
|
});
|
|
2324
2675
|
return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
|
|
2325
2676
|
}
|
|
2326
2677
|
function encodeBool(value) {
|
|
2327
2678
|
if (typeof value !== "boolean")
|
|
2328
|
-
throw new
|
|
2679
|
+
throw new BaseError3(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
2329
2680
|
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
2330
2681
|
}
|
|
2331
|
-
function encodeNumber(value, { signed, size:
|
|
2332
|
-
if (typeof
|
|
2333
|
-
const max = 2n ** (BigInt(
|
|
2682
|
+
function encodeNumber(value, { signed, size: size3 = 256 }) {
|
|
2683
|
+
if (typeof size3 === "number") {
|
|
2684
|
+
const max = 2n ** (BigInt(size3) - (signed ? 1n : 0n)) - 1n;
|
|
2334
2685
|
const min = signed ? -max - 1n : 0n;
|
|
2335
2686
|
if (value > max || value < min)
|
|
2336
|
-
throw new
|
|
2687
|
+
throw new IntegerOutOfRangeError2({
|
|
2337
2688
|
max: max.toString(),
|
|
2338
2689
|
min: min.toString(),
|
|
2339
2690
|
signed,
|
|
2340
|
-
size:
|
|
2691
|
+
size: size3 / 8,
|
|
2341
2692
|
value: value.toString()
|
|
2342
2693
|
});
|
|
2343
2694
|
}
|
|
@@ -2351,7 +2702,7 @@ function encodeNumber(value, { signed, size: size2 = 256 }) {
|
|
|
2351
2702
|
}
|
|
2352
2703
|
function encodeString(value) {
|
|
2353
2704
|
const hexValue = stringToHex(value);
|
|
2354
|
-
const partsLength = Math.ceil(
|
|
2705
|
+
const partsLength = Math.ceil(size2(hexValue) / 32);
|
|
2355
2706
|
const parts = [];
|
|
2356
2707
|
for (let i = 0; i < partsLength; i++) {
|
|
2357
2708
|
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
@@ -2361,7 +2712,7 @@ function encodeString(value) {
|
|
|
2361
2712
|
return {
|
|
2362
2713
|
dynamic: true,
|
|
2363
2714
|
encoded: concat([
|
|
2364
|
-
padHex(numberToHex(
|
|
2715
|
+
padHex(numberToHex(size2(hexValue), { size: 32 })),
|
|
2365
2716
|
...parts
|
|
2366
2717
|
])
|
|
2367
2718
|
};
|
|
@@ -2393,17 +2744,17 @@ function getArrayComponents(type) {
|
|
|
2393
2744
|
) : void 0;
|
|
2394
2745
|
}
|
|
2395
2746
|
|
|
2396
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2747
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
2397
2748
|
function decodeAbiParameters(params, data) {
|
|
2398
2749
|
const bytes = typeof data === "string" ? hexToBytes(data) : data;
|
|
2399
2750
|
const cursor = createCursor(bytes);
|
|
2400
|
-
if (
|
|
2751
|
+
if (size2(bytes) === 0 && params.length > 0)
|
|
2401
2752
|
throw new AbiDecodingZeroDataError();
|
|
2402
|
-
if (
|
|
2753
|
+
if (size2(data) && size2(data) < 32)
|
|
2403
2754
|
throw new AbiDecodingDataSizeTooSmallError({
|
|
2404
2755
|
data: typeof data === "string" ? data : bytesToHex(data),
|
|
2405
2756
|
params,
|
|
2406
|
-
size:
|
|
2757
|
+
size: size2(data)
|
|
2407
2758
|
});
|
|
2408
2759
|
let consumed = 0;
|
|
2409
2760
|
const values = [];
|
|
@@ -2496,8 +2847,8 @@ function decodeBool(cursor) {
|
|
|
2496
2847
|
return [bytesToBool(cursor.readBytes(32), { size: 32 }), 32];
|
|
2497
2848
|
}
|
|
2498
2849
|
function decodeBytes(cursor, param, { staticPosition }) {
|
|
2499
|
-
const [_,
|
|
2500
|
-
if (!
|
|
2850
|
+
const [_, size3] = param.type.split("bytes");
|
|
2851
|
+
if (!size3) {
|
|
2501
2852
|
const offset = bytesToNumber(cursor.readBytes(32));
|
|
2502
2853
|
cursor.setPosition(staticPosition + offset);
|
|
2503
2854
|
const length = bytesToNumber(cursor.readBytes(32));
|
|
@@ -2509,15 +2860,15 @@ function decodeBytes(cursor, param, { staticPosition }) {
|
|
|
2509
2860
|
cursor.setPosition(staticPosition + 32);
|
|
2510
2861
|
return [bytesToHex(data), 32];
|
|
2511
2862
|
}
|
|
2512
|
-
const value = bytesToHex(cursor.readBytes(Number.parseInt(
|
|
2863
|
+
const value = bytesToHex(cursor.readBytes(Number.parseInt(size3, 10), 32));
|
|
2513
2864
|
return [value, 32];
|
|
2514
2865
|
}
|
|
2515
2866
|
function decodeNumber(cursor, param) {
|
|
2516
2867
|
const signed = param.type.startsWith("int");
|
|
2517
|
-
const
|
|
2868
|
+
const size3 = Number.parseInt(param.type.split("int")[1] || "256", 10);
|
|
2518
2869
|
const value = cursor.readBytes(32);
|
|
2519
2870
|
return [
|
|
2520
|
-
|
|
2871
|
+
size3 > 48 ? bytesToBigInt(value, { signed }) : bytesToNumber(value, { signed }),
|
|
2521
2872
|
32
|
|
2522
2873
|
];
|
|
2523
2874
|
}
|
|
@@ -2560,7 +2911,7 @@ function decodeString(cursor, { staticPosition }) {
|
|
|
2560
2911
|
return ["", 32];
|
|
2561
2912
|
}
|
|
2562
2913
|
const data = cursor.readBytes(length, 32);
|
|
2563
|
-
const value = bytesToString(
|
|
2914
|
+
const value = bytesToString(trim2(data));
|
|
2564
2915
|
cursor.setPosition(staticPosition + 32);
|
|
2565
2916
|
return [value, 32];
|
|
2566
2917
|
}
|
|
@@ -2580,17 +2931,18 @@ function hasDynamicChild(param) {
|
|
|
2580
2931
|
return false;
|
|
2581
2932
|
}
|
|
2582
2933
|
|
|
2583
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2934
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
2584
2935
|
function decodeErrorResult(parameters) {
|
|
2585
|
-
const { abi, data } = parameters;
|
|
2936
|
+
const { abi, data, cause } = parameters;
|
|
2586
2937
|
const signature = slice(data, 0, 4);
|
|
2587
2938
|
if (signature === "0x")
|
|
2588
|
-
throw new AbiDecodingZeroDataError();
|
|
2939
|
+
throw new AbiDecodingZeroDataError({ cause });
|
|
2589
2940
|
const abi_ = [...abi || [], solidityError, solidityPanic];
|
|
2590
2941
|
const abiItem = abi_.find((x) => x.type === "error" && signature === toFunctionSelector(formatAbiItem2(x)));
|
|
2591
2942
|
if (!abiItem)
|
|
2592
2943
|
throw new AbiErrorSignatureNotFoundError(signature, {
|
|
2593
|
-
docsPath: "/docs/contract/decodeErrorResult"
|
|
2944
|
+
docsPath: "/docs/contract/decodeErrorResult",
|
|
2945
|
+
cause
|
|
2594
2946
|
});
|
|
2595
2947
|
return {
|
|
2596
2948
|
abiItem,
|
|
@@ -2599,16 +2951,16 @@ function decodeErrorResult(parameters) {
|
|
|
2599
2951
|
};
|
|
2600
2952
|
}
|
|
2601
2953
|
|
|
2602
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2954
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/stringify.js
|
|
2603
2955
|
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
2604
2956
|
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
2605
2957
|
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
2606
2958
|
}, space);
|
|
2607
2959
|
|
|
2608
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2960
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
2609
2961
|
var toEventSelector = toSignatureHash;
|
|
2610
2962
|
|
|
2611
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2963
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
2612
2964
|
function getAbiItem(parameters) {
|
|
2613
2965
|
const { abi, args = [], name } = parameters;
|
|
2614
2966
|
const isSelector = isHex(name, { strict: false });
|
|
@@ -2626,7 +2978,7 @@ function getAbiItem(parameters) {
|
|
|
2626
2978
|
return void 0;
|
|
2627
2979
|
if (abiItems.length === 1)
|
|
2628
2980
|
return abiItems[0];
|
|
2629
|
-
let matchedAbiItem
|
|
2981
|
+
let matchedAbiItem;
|
|
2630
2982
|
for (const abiItem of abiItems) {
|
|
2631
2983
|
if (!("inputs" in abiItem))
|
|
2632
2984
|
continue;
|
|
@@ -2681,7 +3033,7 @@ function isArgOfType(arg, abiParameter) {
|
|
|
2681
3033
|
default: {
|
|
2682
3034
|
if (abiParameterType === "tuple" && "components" in abiParameter)
|
|
2683
3035
|
return Object.values(abiParameter.components).every((component, index) => {
|
|
2684
|
-
return isArgOfType(Object.values(arg)[index], component);
|
|
3036
|
+
return argType === "object" && isArgOfType(Object.values(arg)[index], component);
|
|
2685
3037
|
});
|
|
2686
3038
|
if (/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(abiParameterType))
|
|
2687
3039
|
return argType === "number" || argType === "bigint";
|
|
@@ -2720,7 +3072,7 @@ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
|
|
|
2720
3072
|
return;
|
|
2721
3073
|
}
|
|
2722
3074
|
|
|
2723
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3075
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/constants/unit.js
|
|
2724
3076
|
var etherUnits = {
|
|
2725
3077
|
gwei: 9,
|
|
2726
3078
|
wei: 18
|
|
@@ -2730,7 +3082,7 @@ var gweiUnits = {
|
|
|
2730
3082
|
wei: 9
|
|
2731
3083
|
};
|
|
2732
3084
|
|
|
2733
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3085
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
2734
3086
|
function formatUnits(value, decimals) {
|
|
2735
3087
|
let display = value.toString();
|
|
2736
3088
|
const negative = display.startsWith("-");
|
|
@@ -2745,25 +3097,25 @@ function formatUnits(value, decimals) {
|
|
|
2745
3097
|
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
2746
3098
|
}
|
|
2747
3099
|
|
|
2748
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3100
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
2749
3101
|
function formatEther(wei, unit = "wei") {
|
|
2750
3102
|
return formatUnits(wei, etherUnits[unit]);
|
|
2751
3103
|
}
|
|
2752
3104
|
|
|
2753
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3105
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
2754
3106
|
function formatGwei(wei, unit = "wei") {
|
|
2755
3107
|
return formatUnits(wei, gweiUnits[unit]);
|
|
2756
3108
|
}
|
|
2757
3109
|
|
|
2758
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2759
|
-
var AccountStateConflictError = class extends
|
|
3110
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/stateOverride.js
|
|
3111
|
+
var AccountStateConflictError = class extends BaseError3 {
|
|
2760
3112
|
constructor({ address }) {
|
|
2761
3113
|
super(`State for account "${address}" is set multiple times.`, {
|
|
2762
3114
|
name: "AccountStateConflictError"
|
|
2763
3115
|
});
|
|
2764
3116
|
}
|
|
2765
3117
|
};
|
|
2766
|
-
var StateAssignmentConflictError = class extends
|
|
3118
|
+
var StateAssignmentConflictError = class extends BaseError3 {
|
|
2767
3119
|
constructor() {
|
|
2768
3120
|
super("state and stateDiff are set on the same account.", {
|
|
2769
3121
|
name: "StateAssignmentConflictError"
|
|
@@ -2801,7 +3153,7 @@ function prettyStateOverride(stateOverride) {
|
|
|
2801
3153
|
}, " State Override:\n").slice(0, -1);
|
|
2802
3154
|
}
|
|
2803
3155
|
|
|
2804
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3156
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/transaction.js
|
|
2805
3157
|
function prettyPrint(args) {
|
|
2806
3158
|
const entries = Object.entries(args).map(([key, value]) => {
|
|
2807
3159
|
if (value === void 0 || value === false)
|
|
@@ -2811,21 +3163,36 @@ function prettyPrint(args) {
|
|
|
2811
3163
|
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
2812
3164
|
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
2813
3165
|
}
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
3166
|
+
|
|
3167
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/utils.js
|
|
3168
|
+
function getAbortError(signal) {
|
|
3169
|
+
if (signal?.reason)
|
|
3170
|
+
return signal.reason;
|
|
3171
|
+
if (typeof DOMException === "function")
|
|
3172
|
+
return new DOMException("This operation was aborted", "AbortError");
|
|
3173
|
+
const error = new Error("This operation was aborted");
|
|
3174
|
+
error.name = "AbortError";
|
|
3175
|
+
return error;
|
|
3176
|
+
}
|
|
3177
|
+
function isAbortError(error) {
|
|
3178
|
+
return typeof error === "object" && error !== null && "name" in error && error.name === "AbortError";
|
|
3179
|
+
}
|
|
3180
|
+
var getUrl = (url) => {
|
|
3181
|
+
try {
|
|
3182
|
+
const parsed = new URL(url);
|
|
3183
|
+
if (!parsed.username && !parsed.password)
|
|
3184
|
+
return url;
|
|
3185
|
+
parsed.username = "";
|
|
3186
|
+
parsed.password = "";
|
|
3187
|
+
return parsed.toString();
|
|
3188
|
+
} catch {
|
|
3189
|
+
return url;
|
|
2820
3190
|
}
|
|
2821
3191
|
};
|
|
2822
3192
|
|
|
2823
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2824
|
-
var
|
|
2825
|
-
|
|
2826
|
-
// ../../node_modules/.pnpm/viem@2.22.12_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/errors/contract.js
|
|
2827
|
-
var CallExecutionError = class extends BaseError2 {
|
|
2828
|
-
constructor(cause, { account: account_, docsPath: docsPath4, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
|
|
3193
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/contract.js
|
|
3194
|
+
var CallExecutionError = class extends BaseError3 {
|
|
3195
|
+
constructor(cause, { account: account_, docsPath: docsPath6, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
|
|
2829
3196
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
2830
3197
|
let prettyArgs = prettyPrint({
|
|
2831
3198
|
from: account?.address,
|
|
@@ -2844,7 +3211,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
2844
3211
|
}
|
|
2845
3212
|
super(cause.shortMessage, {
|
|
2846
3213
|
cause,
|
|
2847
|
-
docsPath:
|
|
3214
|
+
docsPath: docsPath6,
|
|
2848
3215
|
metaMessages: [
|
|
2849
3216
|
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
2850
3217
|
"Raw Call Arguments:",
|
|
@@ -2861,7 +3228,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
2861
3228
|
this.cause = cause;
|
|
2862
3229
|
}
|
|
2863
3230
|
};
|
|
2864
|
-
var CounterfactualDeploymentFailedError = class extends
|
|
3231
|
+
var CounterfactualDeploymentFailedError = class extends BaseError3 {
|
|
2865
3232
|
constructor({ factory }) {
|
|
2866
3233
|
super(`Deployment for counterfactual contract call failed${factory ? ` for factory "${factory}".` : ""}`, {
|
|
2867
3234
|
metaMessages: [
|
|
@@ -2873,7 +3240,7 @@ var CounterfactualDeploymentFailedError = class extends BaseError2 {
|
|
|
2873
3240
|
});
|
|
2874
3241
|
}
|
|
2875
3242
|
};
|
|
2876
|
-
var RawContractError = class extends
|
|
3243
|
+
var RawContractError = class extends BaseError3 {
|
|
2877
3244
|
constructor({ data, message }) {
|
|
2878
3245
|
super(message || "", { name: "RawContractError" });
|
|
2879
3246
|
Object.defineProperty(this, "code", {
|
|
@@ -2892,7 +3259,7 @@ var RawContractError = class extends BaseError2 {
|
|
|
2892
3259
|
}
|
|
2893
3260
|
};
|
|
2894
3261
|
|
|
2895
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3262
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js
|
|
2896
3263
|
var docsPath = "/docs/contract/decodeFunctionResult";
|
|
2897
3264
|
function decodeFunctionResult(parameters) {
|
|
2898
3265
|
const { abi, args, functionName, data } = parameters;
|
|
@@ -2915,7 +3282,7 @@ function decodeFunctionResult(parameters) {
|
|
|
2915
3282
|
return void 0;
|
|
2916
3283
|
}
|
|
2917
3284
|
|
|
2918
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3285
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/encodeDeployData.js
|
|
2919
3286
|
var docsPath2 = "/docs/contract/encodeDeployData";
|
|
2920
3287
|
function encodeDeployData(parameters) {
|
|
2921
3288
|
const { abi, args, bytecode } = parameters;
|
|
@@ -2932,7 +3299,7 @@ function encodeDeployData(parameters) {
|
|
|
2932
3299
|
return concatHex([bytecode, data]);
|
|
2933
3300
|
}
|
|
2934
3301
|
|
|
2935
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3302
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
|
|
2936
3303
|
var docsPath3 = "/docs/contract/encodeFunctionData";
|
|
2937
3304
|
function prepareEncodeFunctionData(parameters) {
|
|
2938
3305
|
const { abi, args, functionName } = parameters;
|
|
@@ -2955,7 +3322,7 @@ function prepareEncodeFunctionData(parameters) {
|
|
|
2955
3322
|
};
|
|
2956
3323
|
}
|
|
2957
3324
|
|
|
2958
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3325
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
|
|
2959
3326
|
function encodeFunctionData(parameters) {
|
|
2960
3327
|
const { args } = parameters;
|
|
2961
3328
|
const { abi, functionName } = (() => {
|
|
@@ -2969,7 +3336,28 @@ function encodeFunctionData(parameters) {
|
|
|
2969
3336
|
return concatHex([signature, data ?? "0x"]);
|
|
2970
3337
|
}
|
|
2971
3338
|
|
|
2972
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3339
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/address/isAddressEqual.js
|
|
3340
|
+
function isAddressEqual(a, b) {
|
|
3341
|
+
if (!isAddress(a, { strict: false }))
|
|
3342
|
+
throw new InvalidAddressError({ address: a });
|
|
3343
|
+
if (!isAddress(b, { strict: false }))
|
|
3344
|
+
throw new InvalidAddressError({ address: b });
|
|
3345
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/block/formatBlockParameter.js
|
|
3349
|
+
function formatBlockParameter(parameters) {
|
|
3350
|
+
const { blockHash, blockNumber, blockTag, requireCanonical } = parameters;
|
|
3351
|
+
if (requireCanonical !== void 0 && !blockHash)
|
|
3352
|
+
throw new BaseError3("`requireCanonical` can only be provided when `blockHash` is set.");
|
|
3353
|
+
if (blockHash)
|
|
3354
|
+
return requireCanonical ? { blockHash, requireCanonical } : { blockHash };
|
|
3355
|
+
if (typeof blockNumber === "bigint")
|
|
3356
|
+
return numberToHex(blockNumber);
|
|
3357
|
+
return blockTag ?? "latest";
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3360
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/chain/getChainContractAddress.js
|
|
2973
3361
|
function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
2974
3362
|
const contract = chain?.contracts?.[name];
|
|
2975
3363
|
if (!contract)
|
|
@@ -2989,8 +3377,8 @@ function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
|
2989
3377
|
return contract.address;
|
|
2990
3378
|
}
|
|
2991
3379
|
|
|
2992
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2993
|
-
var ExecutionRevertedError = class extends
|
|
3380
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/node.js
|
|
3381
|
+
var ExecutionRevertedError = class extends BaseError3 {
|
|
2994
3382
|
constructor({ cause, message } = {}) {
|
|
2995
3383
|
const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
|
2996
3384
|
super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
|
|
@@ -3009,9 +3397,9 @@ Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
|
|
|
3009
3397
|
enumerable: true,
|
|
3010
3398
|
configurable: true,
|
|
3011
3399
|
writable: true,
|
|
3012
|
-
value: /execution reverted/
|
|
3400
|
+
value: /execution reverted|gas required exceeds allowance/
|
|
3013
3401
|
});
|
|
3014
|
-
var FeeCapTooHighError = class extends
|
|
3402
|
+
var FeeCapTooHighError = class extends BaseError3 {
|
|
3015
3403
|
constructor({ cause, maxFeePerGas } = {}) {
|
|
3016
3404
|
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
3017
3405
|
cause,
|
|
@@ -3025,7 +3413,7 @@ Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
|
|
|
3025
3413
|
writable: true,
|
|
3026
3414
|
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
3027
3415
|
});
|
|
3028
|
-
var FeeCapTooLowError = class extends
|
|
3416
|
+
var FeeCapTooLowError = class extends BaseError3 {
|
|
3029
3417
|
constructor({ cause, maxFeePerGas } = {}) {
|
|
3030
3418
|
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
3031
3419
|
cause,
|
|
@@ -3039,7 +3427,7 @@ Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
|
|
|
3039
3427
|
writable: true,
|
|
3040
3428
|
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
3041
3429
|
});
|
|
3042
|
-
var NonceTooHighError = class extends
|
|
3430
|
+
var NonceTooHighError = class extends BaseError3 {
|
|
3043
3431
|
constructor({ cause, nonce } = {}) {
|
|
3044
3432
|
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause, name: "NonceTooHighError" });
|
|
3045
3433
|
}
|
|
@@ -3050,7 +3438,7 @@ Object.defineProperty(NonceTooHighError, "nodeMessage", {
|
|
|
3050
3438
|
writable: true,
|
|
3051
3439
|
value: /nonce too high/
|
|
3052
3440
|
});
|
|
3053
|
-
var NonceTooLowError = class extends
|
|
3441
|
+
var NonceTooLowError = class extends BaseError3 {
|
|
3054
3442
|
constructor({ cause, nonce } = {}) {
|
|
3055
3443
|
super([
|
|
3056
3444
|
`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
|
|
@@ -3064,7 +3452,7 @@ Object.defineProperty(NonceTooLowError, "nodeMessage", {
|
|
|
3064
3452
|
writable: true,
|
|
3065
3453
|
value: /nonce too low|transaction already imported|already known/
|
|
3066
3454
|
});
|
|
3067
|
-
var NonceMaxValueError = class extends
|
|
3455
|
+
var NonceMaxValueError = class extends BaseError3 {
|
|
3068
3456
|
constructor({ cause, nonce } = {}) {
|
|
3069
3457
|
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause, name: "NonceMaxValueError" });
|
|
3070
3458
|
}
|
|
@@ -3075,7 +3463,7 @@ Object.defineProperty(NonceMaxValueError, "nodeMessage", {
|
|
|
3075
3463
|
writable: true,
|
|
3076
3464
|
value: /nonce has max value/
|
|
3077
3465
|
});
|
|
3078
|
-
var InsufficientFundsError = class extends
|
|
3466
|
+
var InsufficientFundsError = class extends BaseError3 {
|
|
3079
3467
|
constructor({ cause } = {}) {
|
|
3080
3468
|
super([
|
|
3081
3469
|
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
@@ -3101,7 +3489,7 @@ Object.defineProperty(InsufficientFundsError, "nodeMessage", {
|
|
|
3101
3489
|
writable: true,
|
|
3102
3490
|
value: /insufficient funds|exceeds transaction sender account balance/
|
|
3103
3491
|
});
|
|
3104
|
-
var IntrinsicGasTooHighError = class extends
|
|
3492
|
+
var IntrinsicGasTooHighError = class extends BaseError3 {
|
|
3105
3493
|
constructor({ cause, gas } = {}) {
|
|
3106
3494
|
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
|
3107
3495
|
cause,
|
|
@@ -3115,7 +3503,7 @@ Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
|
|
|
3115
3503
|
writable: true,
|
|
3116
3504
|
value: /intrinsic gas too high|gas limit reached/
|
|
3117
3505
|
});
|
|
3118
|
-
var IntrinsicGasTooLowError = class extends
|
|
3506
|
+
var IntrinsicGasTooLowError = class extends BaseError3 {
|
|
3119
3507
|
constructor({ cause, gas } = {}) {
|
|
3120
3508
|
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
|
|
3121
3509
|
cause,
|
|
@@ -3129,7 +3517,7 @@ Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
|
3129
3517
|
writable: true,
|
|
3130
3518
|
value: /intrinsic gas too low/
|
|
3131
3519
|
});
|
|
3132
|
-
var TransactionTypeNotSupportedError = class extends
|
|
3520
|
+
var TransactionTypeNotSupportedError = class extends BaseError3 {
|
|
3133
3521
|
constructor({ cause }) {
|
|
3134
3522
|
super("The transaction type is not supported for this chain.", {
|
|
3135
3523
|
cause,
|
|
@@ -3143,7 +3531,7 @@ Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
|
|
3143
3531
|
writable: true,
|
|
3144
3532
|
value: /transaction type not valid/
|
|
3145
3533
|
});
|
|
3146
|
-
var TipAboveFeeCapError = class extends
|
|
3534
|
+
var TipAboveFeeCapError = class extends BaseError3 {
|
|
3147
3535
|
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
3148
3536
|
super([
|
|
3149
3537
|
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
@@ -3159,7 +3547,7 @@ Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
|
|
3159
3547
|
writable: true,
|
|
3160
3548
|
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
3161
3549
|
});
|
|
3162
|
-
var UnknownNodeError = class extends
|
|
3550
|
+
var UnknownNodeError = class extends BaseError3 {
|
|
3163
3551
|
constructor({ cause }) {
|
|
3164
3552
|
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
|
3165
3553
|
cause,
|
|
@@ -3168,8 +3556,8 @@ var UnknownNodeError = class extends BaseError2 {
|
|
|
3168
3556
|
}
|
|
3169
3557
|
};
|
|
3170
3558
|
|
|
3171
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3172
|
-
var HttpRequestError = class extends
|
|
3559
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/request.js
|
|
3560
|
+
var HttpRequestError = class extends BaseError3 {
|
|
3173
3561
|
constructor({ body, cause, details, headers, status, url }) {
|
|
3174
3562
|
super("HTTP request failed.", {
|
|
3175
3563
|
cause,
|
|
@@ -3212,11 +3600,11 @@ var HttpRequestError = class extends BaseError2 {
|
|
|
3212
3600
|
}
|
|
3213
3601
|
};
|
|
3214
3602
|
|
|
3215
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3603
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
3216
3604
|
function getNodeError(err, args) {
|
|
3217
3605
|
const message = (err.details || "").toLowerCase();
|
|
3218
|
-
const executionRevertedError = err instanceof
|
|
3219
|
-
if (executionRevertedError instanceof
|
|
3606
|
+
const executionRevertedError = err instanceof BaseError3 ? err.walk((e) => e?.code === ExecutionRevertedError.code) : err;
|
|
3607
|
+
if (executionRevertedError instanceof BaseError3)
|
|
3220
3608
|
return new ExecutionRevertedError({
|
|
3221
3609
|
cause: err,
|
|
3222
3610
|
message: executionRevertedError.details
|
|
@@ -3261,8 +3649,8 @@ function getNodeError(err, args) {
|
|
|
3261
3649
|
});
|
|
3262
3650
|
}
|
|
3263
3651
|
|
|
3264
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3265
|
-
function getCallError(err, { docsPath:
|
|
3652
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/errors/getCallError.js
|
|
3653
|
+
function getCallError(err, { docsPath: docsPath6, ...args }) {
|
|
3266
3654
|
const cause = (() => {
|
|
3267
3655
|
const cause2 = getNodeError(err, args);
|
|
3268
3656
|
if (cause2 instanceof UnknownNodeError)
|
|
@@ -3270,12 +3658,12 @@ function getCallError(err, { docsPath: docsPath4, ...args }) {
|
|
|
3270
3658
|
return cause2;
|
|
3271
3659
|
})();
|
|
3272
3660
|
return new CallExecutionError(cause, {
|
|
3273
|
-
docsPath:
|
|
3661
|
+
docsPath: docsPath6,
|
|
3274
3662
|
...args
|
|
3275
3663
|
});
|
|
3276
3664
|
}
|
|
3277
3665
|
|
|
3278
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3666
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/formatters/extract.js
|
|
3279
3667
|
function extract(value_, { format }) {
|
|
3280
3668
|
if (!format)
|
|
3281
3669
|
return {};
|
|
@@ -3294,7 +3682,7 @@ function extract(value_, { format }) {
|
|
|
3294
3682
|
return value;
|
|
3295
3683
|
}
|
|
3296
3684
|
|
|
3297
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3685
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
3298
3686
|
var rpcTransactionType = {
|
|
3299
3687
|
legacy: "0x0",
|
|
3300
3688
|
eip2930: "0x1",
|
|
@@ -3302,7 +3690,7 @@ var rpcTransactionType = {
|
|
|
3302
3690
|
eip4844: "0x3",
|
|
3303
3691
|
eip7702: "0x4"
|
|
3304
3692
|
};
|
|
3305
|
-
function formatTransactionRequest(request) {
|
|
3693
|
+
function formatTransactionRequest(request, _) {
|
|
3306
3694
|
const rpcRequest = {};
|
|
3307
3695
|
if (typeof request.authorizationList !== "undefined")
|
|
3308
3696
|
rpcRequest.authorizationList = formatAuthorizationList(request.authorizationList);
|
|
@@ -3318,6 +3706,8 @@ function formatTransactionRequest(request) {
|
|
|
3318
3706
|
}
|
|
3319
3707
|
if (typeof request.data !== "undefined")
|
|
3320
3708
|
rpcRequest.data = request.data;
|
|
3709
|
+
if (request.account)
|
|
3710
|
+
rpcRequest.from = request.account.address;
|
|
3321
3711
|
if (typeof request.from !== "undefined")
|
|
3322
3712
|
rpcRequest.from = request.from;
|
|
3323
3713
|
if (typeof request.gas !== "undefined")
|
|
@@ -3342,9 +3732,9 @@ function formatTransactionRequest(request) {
|
|
|
3342
3732
|
}
|
|
3343
3733
|
function formatAuthorizationList(authorizationList) {
|
|
3344
3734
|
return authorizationList.map((authorization) => ({
|
|
3345
|
-
address: authorization.
|
|
3346
|
-
r: authorization.r,
|
|
3347
|
-
s: authorization.s,
|
|
3735
|
+
address: authorization.address,
|
|
3736
|
+
r: authorization.r ? numberToHex(BigInt(authorization.r)) : authorization.r,
|
|
3737
|
+
s: authorization.s ? numberToHex(BigInt(authorization.s)) : authorization.s,
|
|
3348
3738
|
chainId: numberToHex(authorization.chainId),
|
|
3349
3739
|
nonce: numberToHex(authorization.nonce),
|
|
3350
3740
|
...typeof authorization.yParity !== "undefined" ? { yParity: numberToHex(authorization.yParity) } : {},
|
|
@@ -3352,7 +3742,7 @@ function formatAuthorizationList(authorizationList) {
|
|
|
3352
3742
|
}));
|
|
3353
3743
|
}
|
|
3354
3744
|
|
|
3355
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3745
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/promise/withResolvers.js
|
|
3356
3746
|
function withResolvers() {
|
|
3357
3747
|
let resolve = () => void 0;
|
|
3358
3748
|
let reject = () => void 0;
|
|
@@ -3363,7 +3753,7 @@ function withResolvers() {
|
|
|
3363
3753
|
return { promise, resolve, reject };
|
|
3364
3754
|
}
|
|
3365
3755
|
|
|
3366
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3756
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/promise/createBatchScheduler.js
|
|
3367
3757
|
var schedulerCache = /* @__PURE__ */ new Map();
|
|
3368
3758
|
function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
3369
3759
|
const exec = async () => {
|
|
@@ -3409,7 +3799,7 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
|
3409
3799
|
};
|
|
3410
3800
|
}
|
|
3411
3801
|
|
|
3412
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3802
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/stateOverride.js
|
|
3413
3803
|
function serializeStateMapping(stateMapping) {
|
|
3414
3804
|
if (!stateMapping || stateMapping.length === 0)
|
|
3415
3805
|
return void 0;
|
|
@@ -3462,7 +3852,7 @@ function serializeStateOverride(parameters) {
|
|
|
3462
3852
|
return rpcStateOverride;
|
|
3463
3853
|
}
|
|
3464
3854
|
|
|
3465
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3855
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/constants/number.js
|
|
3466
3856
|
var maxInt8 = 2n ** (8n - 1n) - 1n;
|
|
3467
3857
|
var maxInt16 = 2n ** (16n - 1n) - 1n;
|
|
3468
3858
|
var maxInt24 = 2n ** (24n - 1n) - 1n;
|
|
@@ -3560,30 +3950,28 @@ var maxUint240 = 2n ** 240n - 1n;
|
|
|
3560
3950
|
var maxUint248 = 2n ** 248n - 1n;
|
|
3561
3951
|
var maxUint256 = 2n ** 256n - 1n;
|
|
3562
3952
|
|
|
3563
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3953
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/transaction/assertRequest.js
|
|
3564
3954
|
function assertRequest(args) {
|
|
3565
|
-
const { account: account_,
|
|
3955
|
+
const { account: account_, maxFeePerGas, maxPriorityFeePerGas, to } = args;
|
|
3566
3956
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
3567
3957
|
if (account && !isAddress(account.address))
|
|
3568
3958
|
throw new InvalidAddressError({ address: account.address });
|
|
3569
3959
|
if (to && !isAddress(to))
|
|
3570
3960
|
throw new InvalidAddressError({ address: to });
|
|
3571
|
-
if (typeof gasPrice !== "undefined" && (typeof maxFeePerGas !== "undefined" || typeof maxPriorityFeePerGas !== "undefined"))
|
|
3572
|
-
throw new FeeConflictError();
|
|
3573
3961
|
if (maxFeePerGas && maxFeePerGas > maxUint256)
|
|
3574
3962
|
throw new FeeCapTooHighError({ maxFeePerGas });
|
|
3575
3963
|
if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
|
|
3576
3964
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
|
3577
3965
|
}
|
|
3578
3966
|
|
|
3579
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3967
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/actions/public/call.js
|
|
3580
3968
|
async function call(client, args) {
|
|
3581
|
-
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;
|
|
3969
|
+
const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockHash, blockNumber, blockTag = client.experimental_blockTag ?? "latest", requireCanonical, accessList, blobs, blockOverrides, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, requestOptions, to, value, stateOverride, ...rest } = args;
|
|
3582
3970
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
3583
3971
|
if (code && (factory || factoryData))
|
|
3584
|
-
throw new
|
|
3972
|
+
throw new BaseError3("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
3585
3973
|
if (code && to)
|
|
3586
|
-
throw new
|
|
3974
|
+
throw new BaseError3("Cannot provide both `code` & `to` as parameters.");
|
|
3587
3975
|
const deploylessCallViaBytecode = code && data_;
|
|
3588
3976
|
const deploylessCallViaFactory = factory && factoryData && to && data_;
|
|
3589
3977
|
const deploylessCall = deploylessCallViaBytecode || deploylessCallViaFactory;
|
|
@@ -3604,16 +3992,22 @@ async function call(client, args) {
|
|
|
3604
3992
|
})();
|
|
3605
3993
|
try {
|
|
3606
3994
|
assertRequest(args);
|
|
3607
|
-
const
|
|
3608
|
-
|
|
3995
|
+
const block = formatBlockParameter({
|
|
3996
|
+
blockHash,
|
|
3997
|
+
blockNumber,
|
|
3998
|
+
blockTag,
|
|
3999
|
+
requireCanonical
|
|
4000
|
+
});
|
|
4001
|
+
const rpcBlockOverrides = blockOverrides ? toRpc2(blockOverrides) : void 0;
|
|
3609
4002
|
const rpcStateOverride = serializeStateOverride(stateOverride);
|
|
3610
4003
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format;
|
|
3611
4004
|
const format = chainFormat || formatTransactionRequest;
|
|
3612
4005
|
const request = format({
|
|
3613
4006
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
3614
4007
|
...extract(rest, { format: chainFormat }),
|
|
3615
|
-
from: account?.address,
|
|
3616
4008
|
accessList,
|
|
4009
|
+
account,
|
|
4010
|
+
authorizationList,
|
|
3617
4011
|
blobs,
|
|
3618
4012
|
data,
|
|
3619
4013
|
gas,
|
|
@@ -3624,35 +4018,61 @@ async function call(client, args) {
|
|
|
3624
4018
|
nonce,
|
|
3625
4019
|
to: deploylessCall ? void 0 : to,
|
|
3626
4020
|
value
|
|
3627
|
-
});
|
|
3628
|
-
if (batch && shouldPerformMulticall({ request }) && !
|
|
4021
|
+
}, "call");
|
|
4022
|
+
if (batch && shouldPerformMulticall({ request }) && !rpcBlockOverrides && blockHash === void 0) {
|
|
3629
4023
|
try {
|
|
3630
|
-
|
|
3631
|
-
|
|
4024
|
+
const { deployless = false } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
|
|
4025
|
+
const multicallAddress = getMulticallAddress(client, {
|
|
3632
4026
|
blockNumber,
|
|
3633
|
-
|
|
4027
|
+
deployless
|
|
3634
4028
|
});
|
|
4029
|
+
if (!multicallAddress || !hasStateOverrideForAddress(rpcStateOverride, multicallAddress))
|
|
4030
|
+
return await scheduleMulticall(client, {
|
|
4031
|
+
...request,
|
|
4032
|
+
blockHash,
|
|
4033
|
+
blockNumber,
|
|
4034
|
+
blockTag,
|
|
4035
|
+
multicallAddress,
|
|
4036
|
+
requestOptions,
|
|
4037
|
+
requireCanonical,
|
|
4038
|
+
rpcStateOverride
|
|
4039
|
+
});
|
|
3635
4040
|
} catch (err) {
|
|
3636
4041
|
if (!(err instanceof ClientChainNotConfiguredError) && !(err instanceof ChainDoesNotSupportContract))
|
|
3637
4042
|
throw err;
|
|
3638
4043
|
}
|
|
3639
4044
|
}
|
|
4045
|
+
const params = (() => {
|
|
4046
|
+
const base = [
|
|
4047
|
+
request,
|
|
4048
|
+
block
|
|
4049
|
+
];
|
|
4050
|
+
if (rpcStateOverride && rpcBlockOverrides)
|
|
4051
|
+
return [...base, rpcStateOverride, rpcBlockOverrides];
|
|
4052
|
+
if (rpcStateOverride)
|
|
4053
|
+
return [...base, rpcStateOverride];
|
|
4054
|
+
if (rpcBlockOverrides)
|
|
4055
|
+
return [...base, {}, rpcBlockOverrides];
|
|
4056
|
+
return base;
|
|
4057
|
+
})();
|
|
3640
4058
|
const response = await client.request({
|
|
3641
4059
|
method: "eth_call",
|
|
3642
|
-
params
|
|
3643
|
-
|
|
3644
|
-
block,
|
|
3645
|
-
rpcStateOverride
|
|
3646
|
-
] : [request, block]
|
|
3647
|
-
});
|
|
4060
|
+
params
|
|
4061
|
+
}, requestOptions);
|
|
3648
4062
|
if (response === "0x")
|
|
3649
4063
|
return { data: void 0 };
|
|
3650
4064
|
return { data: response };
|
|
3651
4065
|
} catch (err) {
|
|
4066
|
+
if (requestOptions?.signal?.aborted)
|
|
4067
|
+
throw getAbortError(requestOptions.signal);
|
|
4068
|
+
if (isAbortError(err))
|
|
4069
|
+
throw err;
|
|
3652
4070
|
const data2 = getRevertErrorData(err);
|
|
3653
|
-
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-
|
|
4071
|
+
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-TMLJ3HRN.js");
|
|
3654
4072
|
if (client.ccipRead !== false && data2?.slice(0, 10) === offchainLookupSignature2 && to)
|
|
3655
|
-
return {
|
|
4073
|
+
return {
|
|
4074
|
+
data: await offchainLookup2(client, { data: data2, requestOptions, to })
|
|
4075
|
+
};
|
|
3656
4076
|
if (deploylessCall && data2?.slice(0, 10) === "0x101bb98d")
|
|
3657
4077
|
throw new CounterfactualDeploymentFailedError({ factory });
|
|
3658
4078
|
throw getCallError(err, {
|
|
@@ -3674,27 +4094,39 @@ function shouldPerformMulticall({ request }) {
|
|
|
3674
4094
|
return false;
|
|
3675
4095
|
return true;
|
|
3676
4096
|
}
|
|
4097
|
+
var requestOptionsId = 0;
|
|
4098
|
+
var requestOptionsIds = /* @__PURE__ */ new WeakMap();
|
|
4099
|
+
function getRequestOptionsId(requestOptions) {
|
|
4100
|
+
if (!requestOptions)
|
|
4101
|
+
return "default";
|
|
4102
|
+
const id = requestOptionsIds.get(requestOptions);
|
|
4103
|
+
if (id !== void 0)
|
|
4104
|
+
return id;
|
|
4105
|
+
const nextId = requestOptionsId++;
|
|
4106
|
+
requestOptionsIds.set(requestOptions, nextId);
|
|
4107
|
+
return nextId;
|
|
4108
|
+
}
|
|
3677
4109
|
async function scheduleMulticall(client, args) {
|
|
3678
|
-
const { batchSize = 1024, wait = 0 } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
|
|
3679
|
-
const { blockNumber, blockTag = "latest", data, multicallAddress: multicallAddress_, to } = args;
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
}
|
|
3690
|
-
const
|
|
3691
|
-
const
|
|
4110
|
+
const { batchSize = 1024, deployless = false, wait = 0 } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
|
|
4111
|
+
const { blockHash, blockNumber, blockTag = client.experimental_blockTag ?? "latest", requireCanonical, data, multicallAddress: multicallAddress_, requestOptions, rpcStateOverride, to } = args;
|
|
4112
|
+
const multicallAddress = multicallAddress_ !== void 0 ? multicallAddress_ : getMulticallAddress(client, {
|
|
4113
|
+
blockNumber,
|
|
4114
|
+
deployless
|
|
4115
|
+
});
|
|
4116
|
+
const block = formatBlockParameter({
|
|
4117
|
+
blockHash,
|
|
4118
|
+
blockNumber,
|
|
4119
|
+
blockTag,
|
|
4120
|
+
requireCanonical
|
|
4121
|
+
});
|
|
4122
|
+
const blockId = typeof block === "string" ? block : JSON.stringify(block);
|
|
4123
|
+
const stateOverrideKey = rpcStateOverride ? `.${JSON.stringify(rpcStateOverride)}` : "";
|
|
3692
4124
|
const { schedule } = createBatchScheduler({
|
|
3693
|
-
id: `${client.uid}.${
|
|
4125
|
+
id: `${client.uid}.${blockId}.${getRequestOptionsId(requestOptions)}${stateOverrideKey}`,
|
|
3694
4126
|
wait,
|
|
3695
4127
|
shouldSplitBatch(args2) {
|
|
3696
|
-
const
|
|
3697
|
-
return
|
|
4128
|
+
const size3 = args2.reduce((size4, { data: data2 }) => size4 + (data2.length - 2), 0);
|
|
4129
|
+
return size3 > batchSize * 2;
|
|
3698
4130
|
},
|
|
3699
4131
|
fn: async (requests) => {
|
|
3700
4132
|
const calls = requests.map((request) => ({
|
|
@@ -3707,16 +4139,18 @@ async function scheduleMulticall(client, args) {
|
|
|
3707
4139
|
args: [calls],
|
|
3708
4140
|
functionName: "aggregate3"
|
|
3709
4141
|
});
|
|
4142
|
+
const multicallRequest = {
|
|
4143
|
+
...multicallAddress === null ? {
|
|
4144
|
+
data: toDeploylessCallViaBytecodeData({
|
|
4145
|
+
code: multicall3Bytecode,
|
|
4146
|
+
data: calldata
|
|
4147
|
+
})
|
|
4148
|
+
} : { to: multicallAddress, data: calldata }
|
|
4149
|
+
};
|
|
3710
4150
|
const data2 = await client.request({
|
|
3711
4151
|
method: "eth_call",
|
|
3712
|
-
params: [
|
|
3713
|
-
|
|
3714
|
-
data: calldata,
|
|
3715
|
-
to: multicallAddress
|
|
3716
|
-
},
|
|
3717
|
-
block
|
|
3718
|
-
]
|
|
3719
|
-
});
|
|
4152
|
+
params: rpcStateOverride ? [multicallRequest, block, rpcStateOverride] : [multicallRequest, block]
|
|
4153
|
+
}, requestOptions);
|
|
3720
4154
|
return decodeFunctionResult({
|
|
3721
4155
|
abi: multicall3Abi,
|
|
3722
4156
|
args: [calls],
|
|
@@ -3732,6 +4166,23 @@ async function scheduleMulticall(client, args) {
|
|
|
3732
4166
|
return { data: void 0 };
|
|
3733
4167
|
return { data: returnData };
|
|
3734
4168
|
}
|
|
4169
|
+
function getMulticallAddress(client, parameters) {
|
|
4170
|
+
const { blockNumber, deployless } = parameters;
|
|
4171
|
+
if (deployless)
|
|
4172
|
+
return null;
|
|
4173
|
+
if (client.chain)
|
|
4174
|
+
return getChainContractAddress({
|
|
4175
|
+
blockNumber,
|
|
4176
|
+
chain: client.chain,
|
|
4177
|
+
contract: "multicall3"
|
|
4178
|
+
});
|
|
4179
|
+
throw new ClientChainNotConfiguredError();
|
|
4180
|
+
}
|
|
4181
|
+
function hasStateOverrideForAddress(rpcStateOverride, address) {
|
|
4182
|
+
if (!rpcStateOverride)
|
|
4183
|
+
return false;
|
|
4184
|
+
return Object.keys(rpcStateOverride).some((stateOverrideAddress) => isAddressEqual(stateOverrideAddress, address));
|
|
4185
|
+
}
|
|
3735
4186
|
function toDeploylessCallViaBytecodeData(parameters) {
|
|
3736
4187
|
const { code, data } = parameters;
|
|
3737
4188
|
return encodeDeployData({
|
|
@@ -3749,14 +4200,14 @@ function toDeploylessCallViaFactoryData(parameters) {
|
|
|
3749
4200
|
});
|
|
3750
4201
|
}
|
|
3751
4202
|
function getRevertErrorData(err) {
|
|
3752
|
-
if (!(err instanceof
|
|
4203
|
+
if (!(err instanceof BaseError3))
|
|
3753
4204
|
return void 0;
|
|
3754
4205
|
const error = err.walk();
|
|
3755
4206
|
return typeof error?.data === "object" ? error.data?.data : error.data;
|
|
3756
4207
|
}
|
|
3757
4208
|
|
|
3758
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3759
|
-
var OffchainLookupError = class extends
|
|
4209
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/errors/ccip.js
|
|
4210
|
+
var OffchainLookupError = class extends BaseError3 {
|
|
3760
4211
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
|
|
3761
4212
|
super(cause.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
3762
4213
|
cause,
|
|
@@ -3777,7 +4228,7 @@ var OffchainLookupError = class extends BaseError2 {
|
|
|
3777
4228
|
});
|
|
3778
4229
|
}
|
|
3779
4230
|
};
|
|
3780
|
-
var OffchainLookupResponseMalformedError = class extends
|
|
4231
|
+
var OffchainLookupResponseMalformedError = class extends BaseError3 {
|
|
3781
4232
|
constructor({ result, url }) {
|
|
3782
4233
|
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
3783
4234
|
metaMessages: [
|
|
@@ -3788,7 +4239,7 @@ var OffchainLookupResponseMalformedError = class extends BaseError2 {
|
|
|
3788
4239
|
});
|
|
3789
4240
|
}
|
|
3790
4241
|
};
|
|
3791
|
-
var OffchainLookupSenderMismatchError = class extends
|
|
4242
|
+
var OffchainLookupSenderMismatchError = class extends BaseError3 {
|
|
3792
4243
|
constructor({ sender, to }) {
|
|
3793
4244
|
super("Reverted sender address does not match target contract address (`to`).", {
|
|
3794
4245
|
metaMessages: [
|
|
@@ -3800,16 +4251,109 @@ var OffchainLookupSenderMismatchError = class extends BaseError2 {
|
|
|
3800
4251
|
}
|
|
3801
4252
|
};
|
|
3802
4253
|
|
|
3803
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3804
|
-
function
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
4254
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/decodeFunctionData.js
|
|
4255
|
+
function decodeFunctionData(parameters) {
|
|
4256
|
+
const { abi, data } = parameters;
|
|
4257
|
+
const signature = slice(data, 0, 4);
|
|
4258
|
+
const description = abi.find((x) => x.type === "function" && signature === toFunctionSelector(formatAbiItem2(x)));
|
|
4259
|
+
if (!description)
|
|
4260
|
+
throw new AbiFunctionSignatureNotFoundError(signature, {
|
|
4261
|
+
docsPath: "/docs/contract/decodeFunctionData"
|
|
4262
|
+
});
|
|
4263
|
+
return {
|
|
4264
|
+
functionName: description.name,
|
|
4265
|
+
args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs, slice(data, 4)) : void 0
|
|
4266
|
+
};
|
|
4267
|
+
}
|
|
4268
|
+
|
|
4269
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/encodeErrorResult.js
|
|
4270
|
+
var docsPath4 = "/docs/contract/encodeErrorResult";
|
|
4271
|
+
function encodeErrorResult(parameters) {
|
|
4272
|
+
const { abi, errorName, args } = parameters;
|
|
4273
|
+
let abiItem = abi[0];
|
|
4274
|
+
if (errorName) {
|
|
4275
|
+
const item = getAbiItem({ abi, args, name: errorName });
|
|
4276
|
+
if (!item)
|
|
4277
|
+
throw new AbiErrorNotFoundError(errorName, { docsPath: docsPath4 });
|
|
4278
|
+
abiItem = item;
|
|
4279
|
+
}
|
|
4280
|
+
if (abiItem.type !== "error")
|
|
4281
|
+
throw new AbiErrorNotFoundError(void 0, { docsPath: docsPath4 });
|
|
4282
|
+
const definition = formatAbiItem2(abiItem);
|
|
4283
|
+
const signature = toFunctionSelector(definition);
|
|
4284
|
+
let data = "0x";
|
|
4285
|
+
if (args && args.length > 0) {
|
|
4286
|
+
if (!abiItem.inputs)
|
|
4287
|
+
throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath: docsPath4 });
|
|
4288
|
+
data = encodeAbiParameters(abiItem.inputs, args);
|
|
4289
|
+
}
|
|
4290
|
+
return concatHex([signature, data]);
|
|
3810
4291
|
}
|
|
3811
4292
|
|
|
3812
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4293
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js
|
|
4294
|
+
var docsPath5 = "/docs/contract/encodeFunctionResult";
|
|
4295
|
+
function encodeFunctionResult(parameters) {
|
|
4296
|
+
const { abi, functionName, result } = parameters;
|
|
4297
|
+
let abiItem = abi[0];
|
|
4298
|
+
if (functionName) {
|
|
4299
|
+
const item = getAbiItem({ abi, name: functionName });
|
|
4300
|
+
if (!item)
|
|
4301
|
+
throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath5 });
|
|
4302
|
+
abiItem = item;
|
|
4303
|
+
}
|
|
4304
|
+
if (abiItem.type !== "function")
|
|
4305
|
+
throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath5 });
|
|
4306
|
+
if (!abiItem.outputs)
|
|
4307
|
+
throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath5 });
|
|
4308
|
+
const values = (() => {
|
|
4309
|
+
if (abiItem.outputs.length === 0)
|
|
4310
|
+
return [];
|
|
4311
|
+
if (abiItem.outputs.length === 1)
|
|
4312
|
+
return [result];
|
|
4313
|
+
if (Array.isArray(result))
|
|
4314
|
+
return result;
|
|
4315
|
+
throw new InvalidArrayError(result);
|
|
4316
|
+
})();
|
|
4317
|
+
return encodeAbiParameters(abiItem.outputs, values);
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js
|
|
4321
|
+
var localBatchGatewayUrl = "x-batch-gateway:true";
|
|
4322
|
+
async function localBatchGatewayRequest(parameters) {
|
|
4323
|
+
const { data, ccipRequest: ccipRequest2 } = parameters;
|
|
4324
|
+
const { args: [queries] } = decodeFunctionData({ abi: batchGatewayAbi, data });
|
|
4325
|
+
const failures = [];
|
|
4326
|
+
const responses = [];
|
|
4327
|
+
await Promise.all(queries.map(async (query, i) => {
|
|
4328
|
+
try {
|
|
4329
|
+
responses[i] = query.urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({ data: query.data, ccipRequest: ccipRequest2 }) : await ccipRequest2(query);
|
|
4330
|
+
failures[i] = false;
|
|
4331
|
+
} catch (err) {
|
|
4332
|
+
failures[i] = true;
|
|
4333
|
+
responses[i] = encodeError(err);
|
|
4334
|
+
}
|
|
4335
|
+
}));
|
|
4336
|
+
return encodeFunctionResult({
|
|
4337
|
+
abi: batchGatewayAbi,
|
|
4338
|
+
functionName: "query",
|
|
4339
|
+
result: [failures, responses]
|
|
4340
|
+
});
|
|
4341
|
+
}
|
|
4342
|
+
function encodeError(error) {
|
|
4343
|
+
if (error.name === "HttpRequestError" && error.status)
|
|
4344
|
+
return encodeErrorResult({
|
|
4345
|
+
abi: batchGatewayAbi,
|
|
4346
|
+
errorName: "HttpError",
|
|
4347
|
+
args: [error.status, error.shortMessage]
|
|
4348
|
+
});
|
|
4349
|
+
return encodeErrorResult({
|
|
4350
|
+
abi: [solidityError],
|
|
4351
|
+
errorName: "Error",
|
|
4352
|
+
args: ["shortMessage" in error ? error.shortMessage : error.message]
|
|
4353
|
+
});
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
// ../../node_modules/.pnpm/viem@2.53.1_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/ccip.js
|
|
3813
4357
|
var offchainLookupSignature = "0x556f1830";
|
|
3814
4358
|
var offchainLookupAbiItem = {
|
|
3815
4359
|
name: "OffchainLookup",
|
|
@@ -3837,7 +4381,7 @@ var offchainLookupAbiItem = {
|
|
|
3837
4381
|
}
|
|
3838
4382
|
]
|
|
3839
4383
|
};
|
|
3840
|
-
async function offchainLookup(client, { blockNumber, blockTag, data, to }) {
|
|
4384
|
+
async function offchainLookup(client, { blockNumber, blockTag, data, requestOptions, to }) {
|
|
3841
4385
|
const { args } = decodeErrorResult({
|
|
3842
4386
|
data,
|
|
3843
4387
|
abi: [offchainLookupAbiItem]
|
|
@@ -3848,7 +4392,10 @@ async function offchainLookup(client, { blockNumber, blockTag, data, to }) {
|
|
|
3848
4392
|
try {
|
|
3849
4393
|
if (!isAddressEqual(to, sender))
|
|
3850
4394
|
throw new OffchainLookupSenderMismatchError({ sender, to });
|
|
3851
|
-
const result = await
|
|
4395
|
+
const result = urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({
|
|
4396
|
+
data: callData,
|
|
4397
|
+
ccipRequest: (parameters) => ccipRequest_({ ...parameters, requestOptions })
|
|
4398
|
+
}) : await ccipRequest_({ data: callData, requestOptions, sender, urls });
|
|
3852
4399
|
const { data: data_ } = await call(client, {
|
|
3853
4400
|
blockNumber,
|
|
3854
4401
|
blockTag,
|
|
@@ -3856,10 +4403,15 @@ async function offchainLookup(client, { blockNumber, blockTag, data, to }) {
|
|
|
3856
4403
|
callbackSelector,
|
|
3857
4404
|
encodeAbiParameters([{ type: "bytes" }, { type: "bytes" }], [result, extraData])
|
|
3858
4405
|
]),
|
|
4406
|
+
requestOptions,
|
|
3859
4407
|
to
|
|
3860
4408
|
});
|
|
3861
4409
|
return data_;
|
|
3862
4410
|
} catch (err) {
|
|
4411
|
+
if (requestOptions?.signal?.aborted)
|
|
4412
|
+
throw getAbortError(requestOptions.signal);
|
|
4413
|
+
if (isAbortError(err))
|
|
4414
|
+
throw err;
|
|
3863
4415
|
throw new OffchainLookupError({
|
|
3864
4416
|
callbackSelector,
|
|
3865
4417
|
cause: err,
|
|
@@ -3870,18 +4422,21 @@ async function offchainLookup(client, { blockNumber, blockTag, data, to }) {
|
|
|
3870
4422
|
});
|
|
3871
4423
|
}
|
|
3872
4424
|
}
|
|
3873
|
-
async function ccipRequest({ data, sender, urls }) {
|
|
4425
|
+
async function ccipRequest({ data, requestOptions, sender, urls }) {
|
|
3874
4426
|
let error = new Error("An unknown error occurred.");
|
|
3875
4427
|
for (let i = 0; i < urls.length; i++) {
|
|
4428
|
+
if (requestOptions?.signal?.aborted)
|
|
4429
|
+
throw getAbortError(requestOptions.signal);
|
|
3876
4430
|
const url = urls[i];
|
|
3877
4431
|
const method = url.includes("{data}") ? "GET" : "POST";
|
|
3878
4432
|
const body = method === "POST" ? { data, sender } : void 0;
|
|
3879
4433
|
const headers = method === "POST" ? { "Content-Type": "application/json" } : {};
|
|
3880
4434
|
try {
|
|
3881
|
-
const response = await fetch(url.replace("{sender}", sender).replace("{data}", data), {
|
|
4435
|
+
const response = await fetch(url.replace("{sender}", sender.toLowerCase()).replace("{data}", data), {
|
|
3882
4436
|
body: JSON.stringify(body),
|
|
3883
4437
|
headers,
|
|
3884
|
-
method
|
|
4438
|
+
method,
|
|
4439
|
+
...requestOptions?.signal ? { signal: requestOptions.signal } : {}
|
|
3885
4440
|
});
|
|
3886
4441
|
let result;
|
|
3887
4442
|
if (response.headers.get("Content-Type")?.startsWith("application/json")) {
|
|
@@ -3908,6 +4463,10 @@ async function ccipRequest({ data, sender, urls }) {
|
|
|
3908
4463
|
}
|
|
3909
4464
|
return result;
|
|
3910
4465
|
} catch (err) {
|
|
4466
|
+
if (requestOptions?.signal?.aborted)
|
|
4467
|
+
throw getAbortError(requestOptions.signal);
|
|
4468
|
+
if (isAbortError(err))
|
|
4469
|
+
throw err;
|
|
3911
4470
|
error = new HttpRequestError({
|
|
3912
4471
|
body,
|
|
3913
4472
|
details: err.message,
|
|
@@ -3919,7 +4478,7 @@ async function ccipRequest({ data, sender, urls }) {
|
|
|
3919
4478
|
}
|
|
3920
4479
|
|
|
3921
4480
|
export {
|
|
3922
|
-
|
|
4481
|
+
BaseError3 as BaseError,
|
|
3923
4482
|
toHex,
|
|
3924
4483
|
keccak256,
|
|
3925
4484
|
encodeAbiParameters,
|
|
@@ -3931,9 +4490,4 @@ export {
|
|
|
3931
4490
|
offchainLookup,
|
|
3932
4491
|
ccipRequest
|
|
3933
4492
|
};
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
@noble/hashes/esm/utils.js:
|
|
3937
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
3938
|
-
*/
|
|
3939
|
-
//# sourceMappingURL=chunk-TP53IMLY.js.map
|
|
4493
|
+
//# sourceMappingURL=chunk-G6JVDOS5.js.map
|