@boostxyz/cli 5.1.0 → 6.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ccip-BKtQCYbq.cjs → ccip-BgOzBLIc.cjs} +1 -1
- package/dist/{ccip-CS9Qngig.js → ccip-DDb_n-DK.js} +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.js +1 -1
- package/dist/commands/deploy.cjs +7 -7
- package/dist/commands/deploy.d.ts +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +277 -247
- package/dist/commands/seed.cjs +1 -1
- package/dist/commands/seed.d.ts +48 -21
- package/dist/commands/seed.d.ts.map +1 -1
- package/dist/commands/seed.js +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{seed-BtP-9KaP.cjs → seed-DU3dxNJK.cjs} +19 -19
- package/dist/{seed-DyYeHsUg.js → seed-TiV1kcAC.js} +873 -871
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ta from "node:fs/promises";
|
|
2
2
|
import na from "node:path";
|
|
3
|
-
import { Deployable as ra, SignatureType as st, FilterType as Nr, PrimitiveType as Fr, StrategyType as Pn,
|
|
4
|
-
import { a4 as
|
|
3
|
+
import { Deployable as ra, SignatureType as st, FilterType as Nr, PrimitiveType as Fr, StrategyType as Pn, ValueType as sa, BOOST_REGISTRY_ADDRESSES as aa, BoostRegistry as ia, BOOST_CORE_ADDRESSES as oa, BoostCore as ca, Roles as En, allowListFromAddress as ua } from "@boostxyz/sdk";
|
|
4
|
+
import { a4 as da, a5 as la, a6 as fa, u as ha, a7 as pa, a8 as ma, a9 as tn, aa as ya, ab as ba, ac as ga, a3 as va } from "./utils-ClgLOuAN.js";
|
|
5
5
|
function An(t, e) {
|
|
6
6
|
if (t === e)
|
|
7
7
|
return !0;
|
|
@@ -36,16 +36,16 @@ function An(t, e) {
|
|
|
36
36
|
}
|
|
37
37
|
return t !== t && e !== e;
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class wa extends da {
|
|
40
40
|
constructor({ value: e }) {
|
|
41
41
|
super(`Number \`${e}\` is not a valid decimal number.`, {
|
|
42
42
|
name: "InvalidDecimalNumberError"
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function xa(t, e) {
|
|
47
47
|
if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))
|
|
48
|
-
throw new
|
|
48
|
+
throw new wa({ value: t });
|
|
49
49
|
let [n, r = "0"] = t.split(".");
|
|
50
50
|
const s = n.startsWith("-");
|
|
51
51
|
if (s && (n = n.slice(1)), r = r.replace(/(0+)$/, ""), e === 0)
|
|
@@ -62,10 +62,10 @@ function wa(t, e) {
|
|
|
62
62
|
return BigInt(`${s ? "-" : ""}${n}${r}`);
|
|
63
63
|
}
|
|
64
64
|
function zr(t, e = "wei") {
|
|
65
|
-
return
|
|
65
|
+
return xa(t, la[e]);
|
|
66
66
|
}
|
|
67
67
|
const gr = "0x0000000000000000000000000000000000000000";
|
|
68
|
-
var
|
|
68
|
+
var k;
|
|
69
69
|
(function(t) {
|
|
70
70
|
t.assertEqual = (s) => s;
|
|
71
71
|
function e(s) {
|
|
@@ -100,7 +100,7 @@ var $;
|
|
|
100
100
|
return s.map((i) => typeof i == "string" ? `'${i}'` : i).join(a);
|
|
101
101
|
}
|
|
102
102
|
t.joinValues = r, t.jsonStringifyReplacer = (s, a) => typeof a == "bigint" ? a.toString() : a;
|
|
103
|
-
})(
|
|
103
|
+
})(k || (k = {}));
|
|
104
104
|
var Cn;
|
|
105
105
|
(function(t) {
|
|
106
106
|
t.mergeShapes = (e, n) => ({
|
|
@@ -109,7 +109,7 @@ var Cn;
|
|
|
109
109
|
// second overwrites first
|
|
110
110
|
});
|
|
111
111
|
})(Cn || (Cn = {}));
|
|
112
|
-
const g =
|
|
112
|
+
const g = k.arrayToEnum([
|
|
113
113
|
"string",
|
|
114
114
|
"nan",
|
|
115
115
|
"number",
|
|
@@ -151,7 +151,7 @@ const g = $.arrayToEnum([
|
|
|
151
151
|
default:
|
|
152
152
|
return g.unknown;
|
|
153
153
|
}
|
|
154
|
-
}, h =
|
|
154
|
+
}, h = k.arrayToEnum([
|
|
155
155
|
"invalid_type",
|
|
156
156
|
"invalid_literal",
|
|
157
157
|
"custom",
|
|
@@ -168,7 +168,7 @@ const g = $.arrayToEnum([
|
|
|
168
168
|
"invalid_intersection_types",
|
|
169
169
|
"not_multiple_of",
|
|
170
170
|
"not_finite"
|
|
171
|
-
]),
|
|
171
|
+
]), _a = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
172
172
|
class W extends Error {
|
|
173
173
|
get errors() {
|
|
174
174
|
return this.issues;
|
|
@@ -213,7 +213,7 @@ class W extends Error {
|
|
|
213
213
|
return this.message;
|
|
214
214
|
}
|
|
215
215
|
get message() {
|
|
216
|
-
return JSON.stringify(this.issues,
|
|
216
|
+
return JSON.stringify(this.issues, k.jsonStringifyReplacer, 2);
|
|
217
217
|
}
|
|
218
218
|
get isEmpty() {
|
|
219
219
|
return this.issues.length === 0;
|
|
@@ -236,19 +236,19 @@ const Ve = (t, e) => {
|
|
|
236
236
|
t.received === g.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
237
237
|
break;
|
|
238
238
|
case h.invalid_literal:
|
|
239
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
239
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, k.jsonStringifyReplacer)}`;
|
|
240
240
|
break;
|
|
241
241
|
case h.unrecognized_keys:
|
|
242
|
-
n = `Unrecognized key(s) in object: ${
|
|
242
|
+
n = `Unrecognized key(s) in object: ${k.joinValues(t.keys, ", ")}`;
|
|
243
243
|
break;
|
|
244
244
|
case h.invalid_union:
|
|
245
245
|
n = "Invalid input";
|
|
246
246
|
break;
|
|
247
247
|
case h.invalid_union_discriminator:
|
|
248
|
-
n = `Invalid discriminator value. Expected ${
|
|
248
|
+
n = `Invalid discriminator value. Expected ${k.joinValues(t.options)}`;
|
|
249
249
|
break;
|
|
250
250
|
case h.invalid_enum_value:
|
|
251
|
-
n = `Invalid enum value. Expected ${
|
|
251
|
+
n = `Invalid enum value. Expected ${k.joinValues(t.options)}, received '${t.received}'`;
|
|
252
252
|
break;
|
|
253
253
|
case h.invalid_arguments:
|
|
254
254
|
n = "Invalid function arguments";
|
|
@@ -260,7 +260,7 @@ const Ve = (t, e) => {
|
|
|
260
260
|
n = "Invalid date";
|
|
261
261
|
break;
|
|
262
262
|
case h.invalid_string:
|
|
263
|
-
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` :
|
|
263
|
+
typeof t.validation == "object" ? "includes" in t.validation ? (n = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (n = `${n} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? n = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? n = `Invalid input: must end with "${t.validation.endsWith}"` : k.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
264
264
|
break;
|
|
265
265
|
case h.too_small:
|
|
266
266
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "more than"} ${t.minimum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at least" : "over"} ${t.minimum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${t.minimum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly equal to " : t.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(t.minimum))}` : n = "Invalid input";
|
|
@@ -281,16 +281,16 @@ const Ve = (t, e) => {
|
|
|
281
281
|
n = "Number must be finite";
|
|
282
282
|
break;
|
|
283
283
|
default:
|
|
284
|
-
n = e.defaultError,
|
|
284
|
+
n = e.defaultError, k.assertNever(t);
|
|
285
285
|
}
|
|
286
286
|
return { message: n };
|
|
287
287
|
};
|
|
288
|
-
let
|
|
289
|
-
function
|
|
290
|
-
|
|
288
|
+
let Zr = Ve;
|
|
289
|
+
function Pa(t) {
|
|
290
|
+
Zr = t;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
return
|
|
292
|
+
function Lt() {
|
|
293
|
+
return Zr;
|
|
294
294
|
}
|
|
295
295
|
const Vt = (t) => {
|
|
296
296
|
const { data: e, path: n, errorMaps: r, issueData: s } = t, a = [...n, ...s.path || []], i = {
|
|
@@ -312,9 +312,9 @@ const Vt = (t) => {
|
|
|
312
312
|
path: a,
|
|
313
313
|
message: o
|
|
314
314
|
};
|
|
315
|
-
},
|
|
315
|
+
}, Ea = [];
|
|
316
316
|
function b(t, e) {
|
|
317
|
-
const n =
|
|
317
|
+
const n = Lt(), r = Vt({
|
|
318
318
|
issueData: e,
|
|
319
319
|
data: t.data,
|
|
320
320
|
path: t.path,
|
|
@@ -374,12 +374,12 @@ class z {
|
|
|
374
374
|
}
|
|
375
375
|
const _ = Object.freeze({
|
|
376
376
|
status: "aborted"
|
|
377
|
-
}), Fe = (t) => ({ status: "dirty", value: t }),
|
|
377
|
+
}), Fe = (t) => ({ status: "dirty", value: t }), D = (t) => ({ status: "valid", value: t }), Tn = (t) => t.status === "aborted", $n = (t) => t.status === "dirty", Ie = (t) => t.status === "valid", at = (t) => typeof Promise < "u" && t instanceof Promise;
|
|
378
378
|
function Ut(t, e, n, r) {
|
|
379
379
|
if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
380
380
|
return e.get(t);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Dr(t, e, n, r, s) {
|
|
383
383
|
if (typeof e == "function" ? t !== e || !s : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
384
384
|
return e.set(t, n), n;
|
|
385
385
|
}
|
|
@@ -423,7 +423,7 @@ function E(t) {
|
|
|
423
423
|
return i.code === "invalid_enum_value" ? { message: d ?? o.defaultError } : typeof o.data > "u" ? { message: (u = d ?? r) !== null && u !== void 0 ? u : o.defaultError } : i.code !== "invalid_type" ? { message: o.defaultError } : { message: (c = d ?? n) !== null && c !== void 0 ? c : o.defaultError };
|
|
424
424
|
}, description: s };
|
|
425
425
|
}
|
|
426
|
-
class
|
|
426
|
+
class T {
|
|
427
427
|
get description() {
|
|
428
428
|
return this._def.description;
|
|
429
429
|
}
|
|
@@ -643,26 +643,26 @@ class k {
|
|
|
643
643
|
return this.safeParse(null).success;
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
|
-
const
|
|
646
|
+
const Aa = /^c[^\s-]{8,}$/i, Ca = /^[0-9a-z]+$/, Ta = /^[0-9A-HJKMNP-TV-Z]{26}$/i, $a = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ka = /^[a-z0-9_-]{21}$/i, Ia = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Sa = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Ra = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ma = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
647
647
|
let pn;
|
|
648
|
-
const Oa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
|
|
648
|
+
const Oa = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ja = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ba = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Na = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Fa = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, za = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Lr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Za = new RegExp(`^${Lr}$`);
|
|
649
649
|
function Vr(t) {
|
|
650
650
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
651
651
|
return t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function Da(t) {
|
|
654
654
|
return new RegExp(`^${Vr(t)}$`);
|
|
655
655
|
}
|
|
656
656
|
function Ur(t) {
|
|
657
|
-
let e = `${
|
|
657
|
+
let e = `${Lr}T${Vr(t)}`;
|
|
658
658
|
const n = [];
|
|
659
659
|
return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
return !!((e === "v4" || !e) && Oa.test(t) || (e === "v6" || !e) &&
|
|
661
|
+
function La(t, e) {
|
|
662
|
+
return !!((e === "v4" || !e) && Oa.test(t) || (e === "v6" || !e) && Ba.test(t));
|
|
663
663
|
}
|
|
664
|
-
function
|
|
665
|
-
if (
|
|
664
|
+
function Va(t, e) {
|
|
665
|
+
if (!Ia.test(t))
|
|
666
666
|
return !1;
|
|
667
667
|
try {
|
|
668
668
|
const [n] = t.split("."), r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), s = JSON.parse(atob(r));
|
|
@@ -671,10 +671,10 @@ function Da(t, e) {
|
|
|
671
671
|
return !1;
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
function
|
|
675
|
-
return !!((e === "v4" || !e) &&
|
|
674
|
+
function Ua(t, e) {
|
|
675
|
+
return !!((e === "v4" || !e) && ja.test(t) || (e === "v6" || !e) && Na.test(t));
|
|
676
676
|
}
|
|
677
|
-
class ee extends
|
|
677
|
+
class ee extends T {
|
|
678
678
|
_parse(e) {
|
|
679
679
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
|
|
680
680
|
const a = this._getOrReturnCtx(e);
|
|
@@ -723,43 +723,43 @@ class ee extends k {
|
|
|
723
723
|
message: a.message
|
|
724
724
|
}), r.dirty());
|
|
725
725
|
} else if (a.kind === "email")
|
|
726
|
-
|
|
726
|
+
Ra.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
727
727
|
validation: "email",
|
|
728
728
|
code: h.invalid_string,
|
|
729
729
|
message: a.message
|
|
730
730
|
}), r.dirty());
|
|
731
731
|
else if (a.kind === "emoji")
|
|
732
|
-
pn || (pn = new RegExp(
|
|
732
|
+
pn || (pn = new RegExp(Ma, "u")), pn.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
733
733
|
validation: "emoji",
|
|
734
734
|
code: h.invalid_string,
|
|
735
735
|
message: a.message
|
|
736
736
|
}), r.dirty());
|
|
737
737
|
else if (a.kind === "uuid")
|
|
738
|
-
|
|
738
|
+
$a.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
739
739
|
validation: "uuid",
|
|
740
740
|
code: h.invalid_string,
|
|
741
741
|
message: a.message
|
|
742
742
|
}), r.dirty());
|
|
743
743
|
else if (a.kind === "nanoid")
|
|
744
|
-
|
|
744
|
+
ka.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
745
745
|
validation: "nanoid",
|
|
746
746
|
code: h.invalid_string,
|
|
747
747
|
message: a.message
|
|
748
748
|
}), r.dirty());
|
|
749
749
|
else if (a.kind === "cuid")
|
|
750
|
-
|
|
750
|
+
Aa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
751
751
|
validation: "cuid",
|
|
752
752
|
code: h.invalid_string,
|
|
753
753
|
message: a.message
|
|
754
754
|
}), r.dirty());
|
|
755
755
|
else if (a.kind === "cuid2")
|
|
756
|
-
|
|
756
|
+
Ca.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
757
757
|
validation: "cuid2",
|
|
758
758
|
code: h.invalid_string,
|
|
759
759
|
message: a.message
|
|
760
760
|
}), r.dirty());
|
|
761
761
|
else if (a.kind === "ulid")
|
|
762
|
-
|
|
762
|
+
Ta.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
763
763
|
validation: "ulid",
|
|
764
764
|
code: h.invalid_string,
|
|
765
765
|
message: a.message
|
|
@@ -794,39 +794,39 @@ class ee extends k {
|
|
|
794
794
|
code: h.invalid_string,
|
|
795
795
|
validation: "datetime",
|
|
796
796
|
message: a.message
|
|
797
|
-
}), r.dirty()) : a.kind === "date" ?
|
|
797
|
+
}), r.dirty()) : a.kind === "date" ? Za.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
798
798
|
code: h.invalid_string,
|
|
799
799
|
validation: "date",
|
|
800
800
|
message: a.message
|
|
801
|
-
}), r.dirty()) : a.kind === "time" ?
|
|
801
|
+
}), r.dirty()) : a.kind === "time" ? Da(a).test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
802
802
|
code: h.invalid_string,
|
|
803
803
|
validation: "time",
|
|
804
804
|
message: a.message
|
|
805
|
-
}), r.dirty()) : a.kind === "duration" ?
|
|
805
|
+
}), r.dirty()) : a.kind === "duration" ? Sa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
806
806
|
validation: "duration",
|
|
807
807
|
code: h.invalid_string,
|
|
808
808
|
message: a.message
|
|
809
|
-
}), r.dirty()) : a.kind === "ip" ?
|
|
809
|
+
}), r.dirty()) : a.kind === "ip" ? La(e.data, a.version) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
810
810
|
validation: "ip",
|
|
811
811
|
code: h.invalid_string,
|
|
812
812
|
message: a.message
|
|
813
|
-
}), r.dirty()) : a.kind === "jwt" ?
|
|
813
|
+
}), r.dirty()) : a.kind === "jwt" ? Va(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
814
814
|
validation: "jwt",
|
|
815
815
|
code: h.invalid_string,
|
|
816
816
|
message: a.message
|
|
817
|
-
}), r.dirty()) : a.kind === "cidr" ?
|
|
817
|
+
}), r.dirty()) : a.kind === "cidr" ? Ua(e.data, a.version) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
818
818
|
validation: "cidr",
|
|
819
819
|
code: h.invalid_string,
|
|
820
820
|
message: a.message
|
|
821
|
-
}), r.dirty()) : a.kind === "base64" ?
|
|
821
|
+
}), r.dirty()) : a.kind === "base64" ? Fa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
822
822
|
validation: "base64",
|
|
823
823
|
code: h.invalid_string,
|
|
824
824
|
message: a.message
|
|
825
|
-
}), r.dirty()) : a.kind === "base64url" ?
|
|
825
|
+
}), r.dirty()) : a.kind === "base64url" ? za.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
826
826
|
validation: "base64url",
|
|
827
827
|
code: h.invalid_string,
|
|
828
828
|
message: a.message
|
|
829
|
-
}), r.dirty()) :
|
|
829
|
+
}), r.dirty()) : k.assertNever(a);
|
|
830
830
|
return { status: r.value, value: e.data };
|
|
831
831
|
}
|
|
832
832
|
_regex(e, n, r) {
|
|
@@ -1061,11 +1061,11 @@ ee.create = (t) => {
|
|
|
1061
1061
|
...E(t)
|
|
1062
1062
|
});
|
|
1063
1063
|
};
|
|
1064
|
-
function
|
|
1064
|
+
function Ga(t, e) {
|
|
1065
1065
|
const n = (t.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = n > r ? n : r, a = parseInt(t.toFixed(s).replace(".", "")), i = parseInt(e.toFixed(s).replace(".", ""));
|
|
1066
1066
|
return a % i / Math.pow(10, s);
|
|
1067
1067
|
}
|
|
1068
|
-
class ve extends
|
|
1068
|
+
class ve extends T {
|
|
1069
1069
|
constructor() {
|
|
1070
1070
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1071
1071
|
}
|
|
@@ -1081,7 +1081,7 @@ class ve extends k {
|
|
|
1081
1081
|
let r;
|
|
1082
1082
|
const s = new z();
|
|
1083
1083
|
for (const a of this._def.checks)
|
|
1084
|
-
a.kind === "int" ?
|
|
1084
|
+
a.kind === "int" ? k.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1085
1085
|
code: h.invalid_type,
|
|
1086
1086
|
expected: "integer",
|
|
1087
1087
|
received: "float",
|
|
@@ -1100,14 +1100,14 @@ class ve extends k {
|
|
|
1100
1100
|
inclusive: a.inclusive,
|
|
1101
1101
|
exact: !1,
|
|
1102
1102
|
message: a.message
|
|
1103
|
-
}), s.dirty()) : a.kind === "multipleOf" ?
|
|
1103
|
+
}), s.dirty()) : a.kind === "multipleOf" ? Ga(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1104
1104
|
code: h.not_multiple_of,
|
|
1105
1105
|
multipleOf: a.value,
|
|
1106
1106
|
message: a.message
|
|
1107
1107
|
}), s.dirty()) : a.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1108
1108
|
code: h.not_finite,
|
|
1109
1109
|
message: a.message
|
|
1110
|
-
}), s.dirty()) :
|
|
1110
|
+
}), s.dirty()) : k.assertNever(a);
|
|
1111
1111
|
return { status: s.value, value: e.data };
|
|
1112
1112
|
}
|
|
1113
1113
|
gte(e, n) {
|
|
@@ -1219,7 +1219,7 @@ class ve extends k {
|
|
|
1219
1219
|
return e;
|
|
1220
1220
|
}
|
|
1221
1221
|
get isInt() {
|
|
1222
|
-
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" &&
|
|
1222
|
+
return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && k.isInteger(e.value));
|
|
1223
1223
|
}
|
|
1224
1224
|
get isFinite() {
|
|
1225
1225
|
let e = null, n = null;
|
|
@@ -1237,7 +1237,7 @@ ve.create = (t) => new ve({
|
|
|
1237
1237
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1238
1238
|
...E(t)
|
|
1239
1239
|
});
|
|
1240
|
-
class we extends
|
|
1240
|
+
class we extends T {
|
|
1241
1241
|
constructor() {
|
|
1242
1242
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1243
1243
|
}
|
|
@@ -1269,7 +1269,7 @@ class we extends k {
|
|
|
1269
1269
|
code: h.not_multiple_of,
|
|
1270
1270
|
multipleOf: a.value,
|
|
1271
1271
|
message: a.message
|
|
1272
|
-
}), s.dirty()) :
|
|
1272
|
+
}), s.dirty()) : k.assertNever(a);
|
|
1273
1273
|
return { status: s.value, value: e.data };
|
|
1274
1274
|
}
|
|
1275
1275
|
_getInvalidInput(e) {
|
|
@@ -1373,7 +1373,7 @@ we.create = (t) => {
|
|
|
1373
1373
|
...E(t)
|
|
1374
1374
|
});
|
|
1375
1375
|
};
|
|
1376
|
-
class it extends
|
|
1376
|
+
class it extends T {
|
|
1377
1377
|
_parse(e) {
|
|
1378
1378
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
1379
1379
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1383,7 +1383,7 @@ class it extends k {
|
|
|
1383
1383
|
received: r.parsedType
|
|
1384
1384
|
}), _;
|
|
1385
1385
|
}
|
|
1386
|
-
return
|
|
1386
|
+
return D(e.data);
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
1389
|
it.create = (t) => new it({
|
|
@@ -1391,7 +1391,7 @@ it.create = (t) => new it({
|
|
|
1391
1391
|
coerce: (t == null ? void 0 : t.coerce) || !1,
|
|
1392
1392
|
...E(t)
|
|
1393
1393
|
});
|
|
1394
|
-
class Se extends
|
|
1394
|
+
class Se extends T {
|
|
1395
1395
|
_parse(e) {
|
|
1396
1396
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
|
|
1397
1397
|
const a = this._getOrReturnCtx(e);
|
|
@@ -1424,7 +1424,7 @@ class Se extends k {
|
|
|
1424
1424
|
exact: !1,
|
|
1425
1425
|
maximum: a.value,
|
|
1426
1426
|
type: "date"
|
|
1427
|
-
}), r.dirty()) :
|
|
1427
|
+
}), r.dirty()) : k.assertNever(a);
|
|
1428
1428
|
return {
|
|
1429
1429
|
status: r.value,
|
|
1430
1430
|
value: new Date(e.data.getTime())
|
|
@@ -1469,7 +1469,7 @@ Se.create = (t) => new Se({
|
|
|
1469
1469
|
typeName: x.ZodDate,
|
|
1470
1470
|
...E(t)
|
|
1471
1471
|
});
|
|
1472
|
-
class Gt extends
|
|
1472
|
+
class Gt extends T {
|
|
1473
1473
|
_parse(e) {
|
|
1474
1474
|
if (this._getType(e) !== g.symbol) {
|
|
1475
1475
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1479,14 +1479,14 @@ class Gt extends k {
|
|
|
1479
1479
|
received: r.parsedType
|
|
1480
1480
|
}), _;
|
|
1481
1481
|
}
|
|
1482
|
-
return
|
|
1482
|
+
return D(e.data);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
Gt.create = (t) => new Gt({
|
|
1486
1486
|
typeName: x.ZodSymbol,
|
|
1487
1487
|
...E(t)
|
|
1488
1488
|
});
|
|
1489
|
-
class ot extends
|
|
1489
|
+
class ot extends T {
|
|
1490
1490
|
_parse(e) {
|
|
1491
1491
|
if (this._getType(e) !== g.undefined) {
|
|
1492
1492
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1496,14 +1496,14 @@ class ot extends k {
|
|
|
1496
1496
|
received: r.parsedType
|
|
1497
1497
|
}), _;
|
|
1498
1498
|
}
|
|
1499
|
-
return
|
|
1499
|
+
return D(e.data);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
ot.create = (t) => new ot({
|
|
1503
1503
|
typeName: x.ZodUndefined,
|
|
1504
1504
|
...E(t)
|
|
1505
1505
|
});
|
|
1506
|
-
class ct extends
|
|
1506
|
+
class ct extends T {
|
|
1507
1507
|
_parse(e) {
|
|
1508
1508
|
if (this._getType(e) !== g.null) {
|
|
1509
1509
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1513,38 +1513,38 @@ class ct extends k {
|
|
|
1513
1513
|
received: r.parsedType
|
|
1514
1514
|
}), _;
|
|
1515
1515
|
}
|
|
1516
|
-
return
|
|
1516
|
+
return D(e.data);
|
|
1517
1517
|
}
|
|
1518
1518
|
}
|
|
1519
1519
|
ct.create = (t) => new ct({
|
|
1520
1520
|
typeName: x.ZodNull,
|
|
1521
1521
|
...E(t)
|
|
1522
1522
|
});
|
|
1523
|
-
class Ue extends
|
|
1523
|
+
class Ue extends T {
|
|
1524
1524
|
constructor() {
|
|
1525
1525
|
super(...arguments), this._any = !0;
|
|
1526
1526
|
}
|
|
1527
1527
|
_parse(e) {
|
|
1528
|
-
return
|
|
1528
|
+
return D(e.data);
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
1531
1531
|
Ue.create = (t) => new Ue({
|
|
1532
1532
|
typeName: x.ZodAny,
|
|
1533
1533
|
...E(t)
|
|
1534
1534
|
});
|
|
1535
|
-
class
|
|
1535
|
+
class ke extends T {
|
|
1536
1536
|
constructor() {
|
|
1537
1537
|
super(...arguments), this._unknown = !0;
|
|
1538
1538
|
}
|
|
1539
1539
|
_parse(e) {
|
|
1540
|
-
return
|
|
1540
|
+
return D(e.data);
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
|
-
|
|
1543
|
+
ke.create = (t) => new ke({
|
|
1544
1544
|
typeName: x.ZodUnknown,
|
|
1545
1545
|
...E(t)
|
|
1546
1546
|
});
|
|
1547
|
-
class me extends
|
|
1547
|
+
class me extends T {
|
|
1548
1548
|
_parse(e) {
|
|
1549
1549
|
const n = this._getOrReturnCtx(e);
|
|
1550
1550
|
return b(n, {
|
|
@@ -1558,7 +1558,7 @@ me.create = (t) => new me({
|
|
|
1558
1558
|
typeName: x.ZodNever,
|
|
1559
1559
|
...E(t)
|
|
1560
1560
|
});
|
|
1561
|
-
class
|
|
1561
|
+
class qt extends T {
|
|
1562
1562
|
_parse(e) {
|
|
1563
1563
|
if (this._getType(e) !== g.undefined) {
|
|
1564
1564
|
const r = this._getOrReturnCtx(e);
|
|
@@ -1568,14 +1568,14 @@ class Ht extends k {
|
|
|
1568
1568
|
received: r.parsedType
|
|
1569
1569
|
}), _;
|
|
1570
1570
|
}
|
|
1571
|
-
return
|
|
1571
|
+
return D(e.data);
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
|
-
|
|
1574
|
+
qt.create = (t) => new qt({
|
|
1575
1575
|
typeName: x.ZodVoid,
|
|
1576
1576
|
...E(t)
|
|
1577
1577
|
});
|
|
1578
|
-
class te extends
|
|
1578
|
+
class te extends T {
|
|
1579
1579
|
_parse(e) {
|
|
1580
1580
|
const { ctx: n, status: r } = this._processInputParams(e), s = this._def;
|
|
1581
1581
|
if (n.parsedType !== g.array)
|
|
@@ -1664,14 +1664,14 @@ function Ne(t) {
|
|
|
1664
1664
|
type: Ne(t.element)
|
|
1665
1665
|
}) : t instanceof ae ? ae.create(Ne(t.unwrap())) : t instanceof _e ? _e.create(Ne(t.unwrap())) : t instanceof oe ? oe.create(t.items.map((e) => Ne(e))) : t;
|
|
1666
1666
|
}
|
|
1667
|
-
class j extends
|
|
1667
|
+
class j extends T {
|
|
1668
1668
|
constructor() {
|
|
1669
1669
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1670
1670
|
}
|
|
1671
1671
|
_getCached() {
|
|
1672
1672
|
if (this._cached !== null)
|
|
1673
1673
|
return this._cached;
|
|
1674
|
-
const e = this._def.shape(), n =
|
|
1674
|
+
const e = this._def.shape(), n = k.objectKeys(e);
|
|
1675
1675
|
return this._cached = { shape: e, keys: n };
|
|
1676
1676
|
}
|
|
1677
1677
|
_parse(e) {
|
|
@@ -1878,7 +1878,7 @@ class j extends k {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
pick(e) {
|
|
1880
1880
|
const n = {};
|
|
1881
|
-
return
|
|
1881
|
+
return k.objectKeys(e).forEach((r) => {
|
|
1882
1882
|
e[r] && this.shape[r] && (n[r] = this.shape[r]);
|
|
1883
1883
|
}), new j({
|
|
1884
1884
|
...this._def,
|
|
@@ -1887,7 +1887,7 @@ class j extends k {
|
|
|
1887
1887
|
}
|
|
1888
1888
|
omit(e) {
|
|
1889
1889
|
const n = {};
|
|
1890
|
-
return
|
|
1890
|
+
return k.objectKeys(this.shape).forEach((r) => {
|
|
1891
1891
|
e[r] || (n[r] = this.shape[r]);
|
|
1892
1892
|
}), new j({
|
|
1893
1893
|
...this._def,
|
|
@@ -1902,7 +1902,7 @@ class j extends k {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
partial(e) {
|
|
1904
1904
|
const n = {};
|
|
1905
|
-
return
|
|
1905
|
+
return k.objectKeys(this.shape).forEach((r) => {
|
|
1906
1906
|
const s = this.shape[r];
|
|
1907
1907
|
e && !e[r] ? n[r] = s : n[r] = s.optional();
|
|
1908
1908
|
}), new j({
|
|
@@ -1912,7 +1912,7 @@ class j extends k {
|
|
|
1912
1912
|
}
|
|
1913
1913
|
required(e) {
|
|
1914
1914
|
const n = {};
|
|
1915
|
-
return
|
|
1915
|
+
return k.objectKeys(this.shape).forEach((r) => {
|
|
1916
1916
|
if (e && !e[r])
|
|
1917
1917
|
n[r] = this.shape[r];
|
|
1918
1918
|
else {
|
|
@@ -1927,7 +1927,7 @@ class j extends k {
|
|
|
1927
1927
|
});
|
|
1928
1928
|
}
|
|
1929
1929
|
keyof() {
|
|
1930
|
-
return Gr(
|
|
1930
|
+
return Gr(k.objectKeys(this.shape));
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
1933
|
j.create = (t, e) => new j({
|
|
@@ -1951,7 +1951,7 @@ j.lazycreate = (t, e) => new j({
|
|
|
1951
1951
|
typeName: x.ZodObject,
|
|
1952
1952
|
...E(e)
|
|
1953
1953
|
});
|
|
1954
|
-
class ut extends
|
|
1954
|
+
class ut extends T {
|
|
1955
1955
|
_parse(e) {
|
|
1956
1956
|
const { ctx: n } = this._processInputParams(e), r = this._def.options;
|
|
1957
1957
|
function s(a) {
|
|
@@ -2024,8 +2024,8 @@ ut.create = (t, e) => new ut({
|
|
|
2024
2024
|
typeName: x.ZodUnion,
|
|
2025
2025
|
...E(e)
|
|
2026
2026
|
});
|
|
2027
|
-
const fe = (t) => t instanceof ft ? fe(t.schema) : t instanceof ne ? fe(t.innerType()) : t instanceof ht ? [t.value] : t instanceof xe ? t.options : t instanceof pt ?
|
|
2028
|
-
class nn extends
|
|
2027
|
+
const fe = (t) => t instanceof ft ? fe(t.schema) : t instanceof ne ? fe(t.innerType()) : t instanceof ht ? [t.value] : t instanceof xe ? t.options : t instanceof pt ? k.objectValues(t.enum) : t instanceof mt ? fe(t._def.innerType) : t instanceof ot ? [void 0] : t instanceof ct ? [null] : t instanceof ae ? [void 0, ...fe(t.unwrap())] : t instanceof _e ? [null, ...fe(t.unwrap())] : t instanceof Wn || t instanceof bt ? fe(t.unwrap()) : t instanceof yt ? fe(t._def.innerType) : [];
|
|
2028
|
+
class nn extends T {
|
|
2029
2029
|
_parse(e) {
|
|
2030
2030
|
const { ctx: n } = this._processInputParams(e);
|
|
2031
2031
|
if (n.parsedType !== g.object)
|
|
@@ -2087,14 +2087,14 @@ class nn extends k {
|
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
|
-
function
|
|
2090
|
+
function kn(t, e) {
|
|
2091
2091
|
const n = he(t), r = he(e);
|
|
2092
2092
|
if (t === e)
|
|
2093
2093
|
return { valid: !0, data: t };
|
|
2094
2094
|
if (n === g.object && r === g.object) {
|
|
2095
|
-
const s =
|
|
2095
|
+
const s = k.objectKeys(e), a = k.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2096
2096
|
for (const o of a) {
|
|
2097
|
-
const u =
|
|
2097
|
+
const u = kn(t[o], e[o]);
|
|
2098
2098
|
if (!u.valid)
|
|
2099
2099
|
return { valid: !1 };
|
|
2100
2100
|
i[o] = u.data;
|
|
@@ -2105,7 +2105,7 @@ function $n(t, e) {
|
|
|
2105
2105
|
return { valid: !1 };
|
|
2106
2106
|
const s = [];
|
|
2107
2107
|
for (let a = 0; a < t.length; a++) {
|
|
2108
|
-
const i = t[a], o = e[a], u =
|
|
2108
|
+
const i = t[a], o = e[a], u = kn(i, o);
|
|
2109
2109
|
if (!u.valid)
|
|
2110
2110
|
return { valid: !1 };
|
|
2111
2111
|
s.push(u.data);
|
|
@@ -2113,13 +2113,13 @@ function $n(t, e) {
|
|
|
2113
2113
|
return { valid: !0, data: s };
|
|
2114
2114
|
} else return n === g.date && r === g.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
|
|
2115
2115
|
}
|
|
2116
|
-
class dt extends
|
|
2116
|
+
class dt extends T {
|
|
2117
2117
|
_parse(e) {
|
|
2118
2118
|
const { status: n, ctx: r } = this._processInputParams(e), s = (a, i) => {
|
|
2119
|
-
if (
|
|
2119
|
+
if (Tn(a) || Tn(i))
|
|
2120
2120
|
return _;
|
|
2121
|
-
const o =
|
|
2122
|
-
return o.valid ? ((
|
|
2121
|
+
const o = kn(a.value, i.value);
|
|
2122
|
+
return o.valid ? (($n(a) || $n(i)) && n.dirty(), { status: n.value, value: o.data }) : (b(r, {
|
|
2123
2123
|
code: h.invalid_intersection_types
|
|
2124
2124
|
}), _);
|
|
2125
2125
|
};
|
|
@@ -2151,7 +2151,7 @@ dt.create = (t, e, n) => new dt({
|
|
|
2151
2151
|
typeName: x.ZodIntersection,
|
|
2152
2152
|
...E(n)
|
|
2153
2153
|
});
|
|
2154
|
-
class oe extends
|
|
2154
|
+
class oe extends T {
|
|
2155
2155
|
_parse(e) {
|
|
2156
2156
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2157
2157
|
if (r.parsedType !== g.array)
|
|
@@ -2201,7 +2201,7 @@ oe.create = (t, e) => {
|
|
|
2201
2201
|
...E(e)
|
|
2202
2202
|
});
|
|
2203
2203
|
};
|
|
2204
|
-
class lt extends
|
|
2204
|
+
class lt extends T {
|
|
2205
2205
|
get keySchema() {
|
|
2206
2206
|
return this._def.keyType;
|
|
2207
2207
|
}
|
|
@@ -2229,7 +2229,7 @@ class lt extends k {
|
|
|
2229
2229
|
return this._def.valueType;
|
|
2230
2230
|
}
|
|
2231
2231
|
static create(e, n, r) {
|
|
2232
|
-
return n instanceof
|
|
2232
|
+
return n instanceof T ? new lt({
|
|
2233
2233
|
keyType: e,
|
|
2234
2234
|
valueType: n,
|
|
2235
2235
|
typeName: x.ZodRecord,
|
|
@@ -2242,7 +2242,7 @@ class lt extends k {
|
|
|
2242
2242
|
});
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
|
-
class Wt extends
|
|
2245
|
+
class Wt extends T {
|
|
2246
2246
|
get keySchema() {
|
|
2247
2247
|
return this._def.keyType;
|
|
2248
2248
|
}
|
|
@@ -2290,7 +2290,7 @@ Wt.create = (t, e, n) => new Wt({
|
|
|
2290
2290
|
typeName: x.ZodMap,
|
|
2291
2291
|
...E(n)
|
|
2292
2292
|
});
|
|
2293
|
-
class Re extends
|
|
2293
|
+
class Re extends T {
|
|
2294
2294
|
_parse(e) {
|
|
2295
2295
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2296
2296
|
if (r.parsedType !== g.set)
|
|
@@ -2354,7 +2354,7 @@ Re.create = (t, e) => new Re({
|
|
|
2354
2354
|
typeName: x.ZodSet,
|
|
2355
2355
|
...E(e)
|
|
2356
2356
|
});
|
|
2357
|
-
class
|
|
2357
|
+
class Ze extends T {
|
|
2358
2358
|
constructor() {
|
|
2359
2359
|
super(...arguments), this.validate = this.implement;
|
|
2360
2360
|
}
|
|
@@ -2373,7 +2373,7 @@ class Le extends k {
|
|
|
2373
2373
|
errorMaps: [
|
|
2374
2374
|
n.common.contextualErrorMap,
|
|
2375
2375
|
n.schemaErrorMap,
|
|
2376
|
-
|
|
2376
|
+
Lt(),
|
|
2377
2377
|
Ve
|
|
2378
2378
|
].filter((c) => !!c),
|
|
2379
2379
|
issueData: {
|
|
@@ -2389,7 +2389,7 @@ class Le extends k {
|
|
|
2389
2389
|
errorMaps: [
|
|
2390
2390
|
n.common.contextualErrorMap,
|
|
2391
2391
|
n.schemaErrorMap,
|
|
2392
|
-
|
|
2392
|
+
Lt(),
|
|
2393
2393
|
Ve
|
|
2394
2394
|
].filter((c) => !!c),
|
|
2395
2395
|
issueData: {
|
|
@@ -2401,7 +2401,7 @@ class Le extends k {
|
|
|
2401
2401
|
const a = { errorMap: n.common.contextualErrorMap }, i = n.data;
|
|
2402
2402
|
if (this._def.returns instanceof Ge) {
|
|
2403
2403
|
const o = this;
|
|
2404
|
-
return
|
|
2404
|
+
return D(async function(...u) {
|
|
2405
2405
|
const c = new W([]), d = await o._def.args.parseAsync(u, a).catch((m) => {
|
|
2406
2406
|
throw c.addIssue(r(u, m)), c;
|
|
2407
2407
|
}), l = await Reflect.apply(i, this, d);
|
|
@@ -2411,7 +2411,7 @@ class Le extends k {
|
|
|
2411
2411
|
});
|
|
2412
2412
|
} else {
|
|
2413
2413
|
const o = this;
|
|
2414
|
-
return
|
|
2414
|
+
return D(function(...u) {
|
|
2415
2415
|
const c = o._def.args.safeParse(u, a);
|
|
2416
2416
|
if (!c.success)
|
|
2417
2417
|
throw new W([r(u, c.error)]);
|
|
@@ -2429,13 +2429,13 @@ class Le extends k {
|
|
|
2429
2429
|
return this._def.returns;
|
|
2430
2430
|
}
|
|
2431
2431
|
args(...e) {
|
|
2432
|
-
return new
|
|
2432
|
+
return new Ze({
|
|
2433
2433
|
...this._def,
|
|
2434
|
-
args: oe.create(e).rest(
|
|
2434
|
+
args: oe.create(e).rest(ke.create())
|
|
2435
2435
|
});
|
|
2436
2436
|
}
|
|
2437
2437
|
returns(e) {
|
|
2438
|
-
return new
|
|
2438
|
+
return new Ze({
|
|
2439
2439
|
...this._def,
|
|
2440
2440
|
returns: e
|
|
2441
2441
|
});
|
|
@@ -2447,15 +2447,15 @@ class Le extends k {
|
|
|
2447
2447
|
return this.parse(e);
|
|
2448
2448
|
}
|
|
2449
2449
|
static create(e, n, r) {
|
|
2450
|
-
return new
|
|
2451
|
-
args: e || oe.create([]).rest(
|
|
2452
|
-
returns: n ||
|
|
2450
|
+
return new Ze({
|
|
2451
|
+
args: e || oe.create([]).rest(ke.create()),
|
|
2452
|
+
returns: n || ke.create(),
|
|
2453
2453
|
typeName: x.ZodFunction,
|
|
2454
2454
|
...E(r)
|
|
2455
2455
|
});
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
2458
|
-
class ft extends
|
|
2458
|
+
class ft extends T {
|
|
2459
2459
|
get schema() {
|
|
2460
2460
|
return this._def.getter();
|
|
2461
2461
|
}
|
|
@@ -2469,7 +2469,7 @@ ft.create = (t, e) => new ft({
|
|
|
2469
2469
|
typeName: x.ZodLazy,
|
|
2470
2470
|
...E(e)
|
|
2471
2471
|
});
|
|
2472
|
-
class ht extends
|
|
2472
|
+
class ht extends T {
|
|
2473
2473
|
_parse(e) {
|
|
2474
2474
|
if (e.data !== this._def.value) {
|
|
2475
2475
|
const n = this._getOrReturnCtx(e);
|
|
@@ -2497,7 +2497,7 @@ function Gr(t, e) {
|
|
|
2497
2497
|
...E(e)
|
|
2498
2498
|
});
|
|
2499
2499
|
}
|
|
2500
|
-
class xe extends
|
|
2500
|
+
class xe extends T {
|
|
2501
2501
|
constructor() {
|
|
2502
2502
|
super(...arguments), tt.set(this, void 0);
|
|
2503
2503
|
}
|
|
@@ -2505,12 +2505,12 @@ class xe extends k {
|
|
|
2505
2505
|
if (typeof e.data != "string") {
|
|
2506
2506
|
const n = this._getOrReturnCtx(e), r = this._def.values;
|
|
2507
2507
|
return b(n, {
|
|
2508
|
-
expected:
|
|
2508
|
+
expected: k.joinValues(r),
|
|
2509
2509
|
received: n.parsedType,
|
|
2510
2510
|
code: h.invalid_type
|
|
2511
2511
|
}), _;
|
|
2512
2512
|
}
|
|
2513
|
-
if (Ut(this, tt) ||
|
|
2513
|
+
if (Ut(this, tt) || Dr(this, tt, new Set(this._def.values)), !Ut(this, tt).has(e.data)) {
|
|
2514
2514
|
const n = this._getOrReturnCtx(e), r = this._def.values;
|
|
2515
2515
|
return b(n, {
|
|
2516
2516
|
received: n.data,
|
|
@@ -2518,7 +2518,7 @@ class xe extends k {
|
|
|
2518
2518
|
options: r
|
|
2519
2519
|
}), _;
|
|
2520
2520
|
}
|
|
2521
|
-
return
|
|
2521
|
+
return D(e.data);
|
|
2522
2522
|
}
|
|
2523
2523
|
get options() {
|
|
2524
2524
|
return this._def.values;
|
|
@@ -2556,29 +2556,29 @@ class xe extends k {
|
|
|
2556
2556
|
}
|
|
2557
2557
|
tt = /* @__PURE__ */ new WeakMap();
|
|
2558
2558
|
xe.create = Gr;
|
|
2559
|
-
class pt extends
|
|
2559
|
+
class pt extends T {
|
|
2560
2560
|
constructor() {
|
|
2561
2561
|
super(...arguments), nt.set(this, void 0);
|
|
2562
2562
|
}
|
|
2563
2563
|
_parse(e) {
|
|
2564
|
-
const n =
|
|
2564
|
+
const n = k.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
2565
2565
|
if (r.parsedType !== g.string && r.parsedType !== g.number) {
|
|
2566
|
-
const s =
|
|
2566
|
+
const s = k.objectValues(n);
|
|
2567
2567
|
return b(r, {
|
|
2568
|
-
expected:
|
|
2568
|
+
expected: k.joinValues(s),
|
|
2569
2569
|
received: r.parsedType,
|
|
2570
2570
|
code: h.invalid_type
|
|
2571
2571
|
}), _;
|
|
2572
2572
|
}
|
|
2573
|
-
if (Ut(this, nt) ||
|
|
2574
|
-
const s =
|
|
2573
|
+
if (Ut(this, nt) || Dr(this, nt, new Set(k.getValidEnumValues(this._def.values))), !Ut(this, nt).has(e.data)) {
|
|
2574
|
+
const s = k.objectValues(n);
|
|
2575
2575
|
return b(r, {
|
|
2576
2576
|
received: r.data,
|
|
2577
2577
|
code: h.invalid_enum_value,
|
|
2578
2578
|
options: s
|
|
2579
2579
|
}), _;
|
|
2580
2580
|
}
|
|
2581
|
-
return
|
|
2581
|
+
return D(e.data);
|
|
2582
2582
|
}
|
|
2583
2583
|
get enum() {
|
|
2584
2584
|
return this._def.values;
|
|
@@ -2590,7 +2590,7 @@ pt.create = (t, e) => new pt({
|
|
|
2590
2590
|
typeName: x.ZodNativeEnum,
|
|
2591
2591
|
...E(e)
|
|
2592
2592
|
});
|
|
2593
|
-
class Ge extends
|
|
2593
|
+
class Ge extends T {
|
|
2594
2594
|
unwrap() {
|
|
2595
2595
|
return this._def.type;
|
|
2596
2596
|
}
|
|
@@ -2603,7 +2603,7 @@ class Ge extends k {
|
|
|
2603
2603
|
received: n.parsedType
|
|
2604
2604
|
}), _;
|
|
2605
2605
|
const r = n.parsedType === g.promise ? n.data : Promise.resolve(n.data);
|
|
2606
|
-
return
|
|
2606
|
+
return D(r.then((s) => this._def.type.parseAsync(s, {
|
|
2607
2607
|
path: n.path,
|
|
2608
2608
|
errorMap: n.common.contextualErrorMap
|
|
2609
2609
|
})));
|
|
@@ -2614,7 +2614,7 @@ Ge.create = (t, e) => new Ge({
|
|
|
2614
2614
|
typeName: x.ZodPromise,
|
|
2615
2615
|
...E(e)
|
|
2616
2616
|
});
|
|
2617
|
-
class ne extends
|
|
2617
|
+
class ne extends T {
|
|
2618
2618
|
innerType() {
|
|
2619
2619
|
return this._def.schema;
|
|
2620
2620
|
}
|
|
@@ -2688,7 +2688,7 @@ class ne extends k {
|
|
|
2688
2688
|
return { status: n.value, value: o };
|
|
2689
2689
|
} else
|
|
2690
2690
|
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((i) => Ie(i) ? Promise.resolve(s.transform(i.value, a)).then((o) => ({ status: n.value, value: o })) : i);
|
|
2691
|
-
|
|
2691
|
+
k.assertNever(s);
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
2694
|
ne.create = (t, e, n) => new ne({
|
|
@@ -2703,9 +2703,9 @@ ne.createWithPreprocess = (t, e, n) => new ne({
|
|
|
2703
2703
|
typeName: x.ZodEffects,
|
|
2704
2704
|
...E(n)
|
|
2705
2705
|
});
|
|
2706
|
-
class ae extends
|
|
2706
|
+
class ae extends T {
|
|
2707
2707
|
_parse(e) {
|
|
2708
|
-
return this._getType(e) === g.undefined ?
|
|
2708
|
+
return this._getType(e) === g.undefined ? D(void 0) : this._def.innerType._parse(e);
|
|
2709
2709
|
}
|
|
2710
2710
|
unwrap() {
|
|
2711
2711
|
return this._def.innerType;
|
|
@@ -2716,9 +2716,9 @@ ae.create = (t, e) => new ae({
|
|
|
2716
2716
|
typeName: x.ZodOptional,
|
|
2717
2717
|
...E(e)
|
|
2718
2718
|
});
|
|
2719
|
-
class _e extends
|
|
2719
|
+
class _e extends T {
|
|
2720
2720
|
_parse(e) {
|
|
2721
|
-
return this._getType(e) === g.null ?
|
|
2721
|
+
return this._getType(e) === g.null ? D(null) : this._def.innerType._parse(e);
|
|
2722
2722
|
}
|
|
2723
2723
|
unwrap() {
|
|
2724
2724
|
return this._def.innerType;
|
|
@@ -2729,7 +2729,7 @@ _e.create = (t, e) => new _e({
|
|
|
2729
2729
|
typeName: x.ZodNullable,
|
|
2730
2730
|
...E(e)
|
|
2731
2731
|
});
|
|
2732
|
-
class mt extends
|
|
2732
|
+
class mt extends T {
|
|
2733
2733
|
_parse(e) {
|
|
2734
2734
|
const { ctx: n } = this._processInputParams(e);
|
|
2735
2735
|
let r = n.data;
|
|
@@ -2749,7 +2749,7 @@ mt.create = (t, e) => new mt({
|
|
|
2749
2749
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2750
2750
|
...E(e)
|
|
2751
2751
|
});
|
|
2752
|
-
class yt extends
|
|
2752
|
+
class yt extends T {
|
|
2753
2753
|
_parse(e) {
|
|
2754
2754
|
const { ctx: n } = this._processInputParams(e), r = {
|
|
2755
2755
|
...n,
|
|
@@ -2792,7 +2792,7 @@ yt.create = (t, e) => new yt({
|
|
|
2792
2792
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
2793
2793
|
...E(e)
|
|
2794
2794
|
});
|
|
2795
|
-
class
|
|
2795
|
+
class Ht extends T {
|
|
2796
2796
|
_parse(e) {
|
|
2797
2797
|
if (this._getType(e) !== g.nan) {
|
|
2798
2798
|
const r = this._getOrReturnCtx(e);
|
|
@@ -2805,12 +2805,12 @@ class qt extends k {
|
|
|
2805
2805
|
return { status: "valid", value: e.data };
|
|
2806
2806
|
}
|
|
2807
2807
|
}
|
|
2808
|
-
|
|
2808
|
+
Ht.create = (t) => new Ht({
|
|
2809
2809
|
typeName: x.ZodNaN,
|
|
2810
2810
|
...E(t)
|
|
2811
2811
|
});
|
|
2812
|
-
const
|
|
2813
|
-
class Wn extends
|
|
2812
|
+
const qa = Symbol("zod_brand");
|
|
2813
|
+
class Wn extends T {
|
|
2814
2814
|
_parse(e) {
|
|
2815
2815
|
const { ctx: n } = this._processInputParams(e), r = n.data;
|
|
2816
2816
|
return this._def.type._parse({
|
|
@@ -2823,7 +2823,7 @@ class Wn extends k {
|
|
|
2823
2823
|
return this._def.type;
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
|
-
class Bt extends
|
|
2826
|
+
class Bt extends T {
|
|
2827
2827
|
_parse(e) {
|
|
2828
2828
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2829
2829
|
if (r.common.async)
|
|
@@ -2863,7 +2863,7 @@ class Bt extends k {
|
|
|
2863
2863
|
});
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
|
-
class bt extends
|
|
2866
|
+
class bt extends T {
|
|
2867
2867
|
_parse(e) {
|
|
2868
2868
|
const n = this._def.innerType._parse(e), r = (s) => (Ie(s) && (s.value = Object.freeze(s.value)), s);
|
|
2869
2869
|
return at(n) ? n.then((s) => r(s)) : r(n);
|
|
@@ -2877,7 +2877,7 @@ bt.create = (t, e) => new bt({
|
|
|
2877
2877
|
typeName: x.ZodReadonly,
|
|
2878
2878
|
...E(e)
|
|
2879
2879
|
});
|
|
2880
|
-
function
|
|
2880
|
+
function qr(t, e = {}, n) {
|
|
2881
2881
|
return t ? Ue.create().superRefine((r, s) => {
|
|
2882
2882
|
var a, i;
|
|
2883
2883
|
if (!t(r)) {
|
|
@@ -2886,16 +2886,16 @@ function Hr(t, e = {}, n) {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
}) : Ue.create();
|
|
2888
2888
|
}
|
|
2889
|
-
const
|
|
2889
|
+
const Wa = {
|
|
2890
2890
|
object: j.lazycreate
|
|
2891
2891
|
};
|
|
2892
2892
|
var x;
|
|
2893
2893
|
(function(t) {
|
|
2894
2894
|
t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
|
|
2895
2895
|
})(x || (x = {}));
|
|
2896
|
-
const
|
|
2896
|
+
const Ha = (t, e = {
|
|
2897
2897
|
message: `Input not instance of ${t.name}`
|
|
2898
|
-
}) =>
|
|
2898
|
+
}) => qr((n) => n instanceof t, e), Wr = ee.create, Hr = ve.create, Ka = Ht.create, Ja = we.create, Kr = it.create, Ya = Se.create, Xa = Gt.create, Qa = ot.create, ei = ct.create, ti = Ue.create, ni = ke.create, ri = me.create, si = qt.create, ai = te.create, ii = j.create, oi = j.strictCreate, ci = ut.create, ui = nn.create, di = dt.create, li = oe.create, fi = lt.create, hi = Wt.create, pi = Re.create, mi = Ze.create, yi = ft.create, bi = ht.create, gi = xe.create, vi = pt.create, wi = Ge.create, wr = ne.create, xi = ae.create, _i = _e.create, Pi = ne.createWithPreprocess, Ei = Bt.create, Ai = () => Wr().optional(), Ci = () => Hr().optional(), Ti = () => Kr().optional(), $i = {
|
|
2899
2899
|
string: (t) => ee.create({ ...t, coerce: !0 }),
|
|
2900
2900
|
number: (t) => ve.create({ ...t, coerce: !0 }),
|
|
2901
2901
|
boolean: (t) => it.create({
|
|
@@ -2904,32 +2904,32 @@ const Wa = (t, e = {
|
|
|
2904
2904
|
}),
|
|
2905
2905
|
bigint: (t) => we.create({ ...t, coerce: !0 }),
|
|
2906
2906
|
date: (t) => Se.create({ ...t, coerce: !0 })
|
|
2907
|
-
},
|
|
2907
|
+
}, ki = _;
|
|
2908
2908
|
var p = /* @__PURE__ */ Object.freeze({
|
|
2909
2909
|
__proto__: null,
|
|
2910
2910
|
defaultErrorMap: Ve,
|
|
2911
|
-
setErrorMap:
|
|
2912
|
-
getErrorMap:
|
|
2911
|
+
setErrorMap: Pa,
|
|
2912
|
+
getErrorMap: Lt,
|
|
2913
2913
|
makeIssue: Vt,
|
|
2914
|
-
EMPTY_PATH:
|
|
2914
|
+
EMPTY_PATH: Ea,
|
|
2915
2915
|
addIssueToContext: b,
|
|
2916
2916
|
ParseStatus: z,
|
|
2917
2917
|
INVALID: _,
|
|
2918
2918
|
DIRTY: Fe,
|
|
2919
|
-
OK:
|
|
2920
|
-
isAborted:
|
|
2921
|
-
isDirty:
|
|
2919
|
+
OK: D,
|
|
2920
|
+
isAborted: Tn,
|
|
2921
|
+
isDirty: $n,
|
|
2922
2922
|
isValid: Ie,
|
|
2923
2923
|
isAsync: at,
|
|
2924
2924
|
get util() {
|
|
2925
|
-
return
|
|
2925
|
+
return k;
|
|
2926
2926
|
},
|
|
2927
2927
|
get objectUtil() {
|
|
2928
2928
|
return Cn;
|
|
2929
2929
|
},
|
|
2930
2930
|
ZodParsedType: g,
|
|
2931
2931
|
getParsedType: he,
|
|
2932
|
-
ZodType:
|
|
2932
|
+
ZodType: T,
|
|
2933
2933
|
datetimeRegex: Ur,
|
|
2934
2934
|
ZodString: ee,
|
|
2935
2935
|
ZodNumber: ve,
|
|
@@ -2940,9 +2940,9 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2940
2940
|
ZodUndefined: ot,
|
|
2941
2941
|
ZodNull: ct,
|
|
2942
2942
|
ZodAny: Ue,
|
|
2943
|
-
ZodUnknown:
|
|
2943
|
+
ZodUnknown: ke,
|
|
2944
2944
|
ZodNever: me,
|
|
2945
|
-
ZodVoid:
|
|
2945
|
+
ZodVoid: qt,
|
|
2946
2946
|
ZodArray: te,
|
|
2947
2947
|
ZodObject: j,
|
|
2948
2948
|
ZodUnion: ut,
|
|
@@ -2952,7 +2952,7 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2952
2952
|
ZodRecord: lt,
|
|
2953
2953
|
ZodMap: Wt,
|
|
2954
2954
|
ZodSet: Re,
|
|
2955
|
-
ZodFunction:
|
|
2955
|
+
ZodFunction: Ze,
|
|
2956
2956
|
ZodLazy: ft,
|
|
2957
2957
|
ZodLiteral: ht,
|
|
2958
2958
|
ZodEnum: xe,
|
|
@@ -2964,61 +2964,61 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2964
2964
|
ZodNullable: _e,
|
|
2965
2965
|
ZodDefault: mt,
|
|
2966
2966
|
ZodCatch: yt,
|
|
2967
|
-
ZodNaN:
|
|
2968
|
-
BRAND:
|
|
2967
|
+
ZodNaN: Ht,
|
|
2968
|
+
BRAND: qa,
|
|
2969
2969
|
ZodBranded: Wn,
|
|
2970
2970
|
ZodPipeline: Bt,
|
|
2971
2971
|
ZodReadonly: bt,
|
|
2972
|
-
custom:
|
|
2973
|
-
Schema:
|
|
2974
|
-
ZodSchema:
|
|
2975
|
-
late:
|
|
2972
|
+
custom: qr,
|
|
2973
|
+
Schema: T,
|
|
2974
|
+
ZodSchema: T,
|
|
2975
|
+
late: Wa,
|
|
2976
2976
|
get ZodFirstPartyTypeKind() {
|
|
2977
2977
|
return x;
|
|
2978
2978
|
},
|
|
2979
|
-
coerce:
|
|
2980
|
-
any:
|
|
2981
|
-
array:
|
|
2982
|
-
bigint:
|
|
2979
|
+
coerce: $i,
|
|
2980
|
+
any: ti,
|
|
2981
|
+
array: ai,
|
|
2982
|
+
bigint: Ja,
|
|
2983
2983
|
boolean: Kr,
|
|
2984
|
-
date:
|
|
2985
|
-
discriminatedUnion:
|
|
2984
|
+
date: Ya,
|
|
2985
|
+
discriminatedUnion: ui,
|
|
2986
2986
|
effect: wr,
|
|
2987
|
-
enum:
|
|
2988
|
-
function:
|
|
2989
|
-
instanceof:
|
|
2990
|
-
intersection:
|
|
2991
|
-
lazy:
|
|
2992
|
-
literal:
|
|
2993
|
-
map:
|
|
2994
|
-
nan:
|
|
2995
|
-
nativeEnum:
|
|
2996
|
-
never:
|
|
2997
|
-
null:
|
|
2998
|
-
nullable:
|
|
2999
|
-
number:
|
|
3000
|
-
object:
|
|
3001
|
-
oboolean:
|
|
3002
|
-
onumber:
|
|
3003
|
-
optional:
|
|
3004
|
-
ostring:
|
|
3005
|
-
pipeline:
|
|
3006
|
-
preprocess:
|
|
3007
|
-
promise:
|
|
3008
|
-
record:
|
|
3009
|
-
set:
|
|
3010
|
-
strictObject:
|
|
2987
|
+
enum: gi,
|
|
2988
|
+
function: mi,
|
|
2989
|
+
instanceof: Ha,
|
|
2990
|
+
intersection: di,
|
|
2991
|
+
lazy: yi,
|
|
2992
|
+
literal: bi,
|
|
2993
|
+
map: hi,
|
|
2994
|
+
nan: Ka,
|
|
2995
|
+
nativeEnum: vi,
|
|
2996
|
+
never: ri,
|
|
2997
|
+
null: ei,
|
|
2998
|
+
nullable: _i,
|
|
2999
|
+
number: Hr,
|
|
3000
|
+
object: ii,
|
|
3001
|
+
oboolean: Ti,
|
|
3002
|
+
onumber: Ci,
|
|
3003
|
+
optional: xi,
|
|
3004
|
+
ostring: Ai,
|
|
3005
|
+
pipeline: Ei,
|
|
3006
|
+
preprocess: Pi,
|
|
3007
|
+
promise: wi,
|
|
3008
|
+
record: fi,
|
|
3009
|
+
set: pi,
|
|
3010
|
+
strictObject: oi,
|
|
3011
3011
|
string: Wr,
|
|
3012
|
-
symbol:
|
|
3012
|
+
symbol: Xa,
|
|
3013
3013
|
transformer: wr,
|
|
3014
|
-
tuple:
|
|
3015
|
-
undefined:
|
|
3016
|
-
union:
|
|
3017
|
-
unknown:
|
|
3018
|
-
void:
|
|
3019
|
-
NEVER:
|
|
3014
|
+
tuple: li,
|
|
3015
|
+
undefined: Qa,
|
|
3016
|
+
union: ci,
|
|
3017
|
+
unknown: ni,
|
|
3018
|
+
void: si,
|
|
3019
|
+
NEVER: ki,
|
|
3020
3020
|
ZodIssueCode: h,
|
|
3021
|
-
quotelessJson:
|
|
3021
|
+
quotelessJson: _a,
|
|
3022
3022
|
ZodError: W
|
|
3023
3023
|
});
|
|
3024
3024
|
const Jr = "2.22.1";
|
|
@@ -3084,14 +3084,14 @@ class Xr extends y {
|
|
|
3084
3084
|
super(`Number "${a}" is not in safe ${s ? `${s * 8}-bit ${r ? "signed" : "unsigned"} ` : ""}integer range ${e ? `(${n} to ${e})` : `(above ${n})`}`, { name: "IntegerOutOfRangeError" });
|
|
3085
3085
|
}
|
|
3086
3086
|
}
|
|
3087
|
-
class
|
|
3087
|
+
class Ii extends y {
|
|
3088
3088
|
constructor(e) {
|
|
3089
3089
|
super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
3090
3090
|
name: "InvalidBytesBooleanError"
|
|
3091
3091
|
});
|
|
3092
3092
|
}
|
|
3093
3093
|
}
|
|
3094
|
-
class
|
|
3094
|
+
class Si extends y {
|
|
3095
3095
|
constructor({ givenSize: e, maxSize: n }) {
|
|
3096
3096
|
super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`, { name: "SizeOverflowError" });
|
|
3097
3097
|
}
|
|
@@ -3112,7 +3112,7 @@ class xr extends y {
|
|
|
3112
3112
|
}
|
|
3113
3113
|
}
|
|
3114
3114
|
function Je(t, { dir: e, size: n = 32 } = {}) {
|
|
3115
|
-
return typeof t == "string" ? ge(t, { dir: e, size: n }) :
|
|
3115
|
+
return typeof t == "string" ? ge(t, { dir: e, size: n }) : Ri(t, { dir: e, size: n });
|
|
3116
3116
|
}
|
|
3117
3117
|
function ge(t, { dir: e, size: n = 32 } = {}) {
|
|
3118
3118
|
if (n === null)
|
|
@@ -3126,7 +3126,7 @@ function ge(t, { dir: e, size: n = 32 } = {}) {
|
|
|
3126
3126
|
});
|
|
3127
3127
|
return `0x${r[e === "right" ? "padEnd" : "padStart"](n * 2, "0")}`;
|
|
3128
3128
|
}
|
|
3129
|
-
function
|
|
3129
|
+
function Ri(t, { dir: e, size: n = 32 } = {}) {
|
|
3130
3130
|
if (n === null)
|
|
3131
3131
|
return t;
|
|
3132
3132
|
if (t.length > n)
|
|
@@ -3148,15 +3148,15 @@ function Pe(t, { strict: e = !0 } = {}) {
|
|
|
3148
3148
|
function N(t) {
|
|
3149
3149
|
return Pe(t, { strict: !1 }) ? Math.ceil((t.length - 2) / 2) : t.length;
|
|
3150
3150
|
}
|
|
3151
|
-
function
|
|
3151
|
+
function Hn(t, { dir: e = "left" } = {}) {
|
|
3152
3152
|
let n = typeof t == "string" ? t.replace("0x", "") : t, r = 0;
|
|
3153
3153
|
for (let s = 0; s < n.length - 1 && n[e === "left" ? s : n.length - s - 1].toString() === "0"; s++)
|
|
3154
3154
|
r++;
|
|
3155
3155
|
return n = e === "left" ? n.slice(r) : n.slice(0, n.length - r), typeof t == "string" ? (n.length === 1 && e === "right" && (n = `${n}0`), `0x${n.length % 2 === 1 ? `0${n}` : n}`) : n;
|
|
3156
3156
|
}
|
|
3157
|
-
const
|
|
3157
|
+
const Mi = /* @__PURE__ */ new TextEncoder();
|
|
3158
3158
|
function Kn(t, e = {}) {
|
|
3159
|
-
return typeof t == "number" || typeof t == "bigint" ?
|
|
3159
|
+
return typeof t == "number" || typeof t == "bigint" ? ji(t, e) : typeof t == "boolean" ? Oi(t, e) : Pe(t) ? ye(t, e) : ts(t, e);
|
|
3160
3160
|
}
|
|
3161
3161
|
function Oi(t, e = {}) {
|
|
3162
3162
|
const n = new Uint8Array(1);
|
|
@@ -3192,17 +3192,17 @@ function ye(t, e = {}) {
|
|
|
3192
3192
|
}
|
|
3193
3193
|
return a;
|
|
3194
3194
|
}
|
|
3195
|
-
function
|
|
3196
|
-
const n =
|
|
3195
|
+
function ji(t, e) {
|
|
3196
|
+
const n = M(t, e);
|
|
3197
3197
|
return ye(n);
|
|
3198
3198
|
}
|
|
3199
3199
|
function ts(t, e = {}) {
|
|
3200
|
-
const n =
|
|
3200
|
+
const n = Mi.encode(t);
|
|
3201
3201
|
return typeof e.size == "number" ? (ce(n, { size: e.size }), Je(n, { dir: "right", size: e.size })) : n;
|
|
3202
3202
|
}
|
|
3203
3203
|
function ce(t, { size: e }) {
|
|
3204
3204
|
if (N(t) > e)
|
|
3205
|
-
throw new
|
|
3205
|
+
throw new Si({
|
|
3206
3206
|
givenSize: N(t),
|
|
3207
3207
|
maxSize: e
|
|
3208
3208
|
});
|
|
@@ -3216,12 +3216,12 @@ function gt(t, e = {}) {
|
|
|
3216
3216
|
const s = (t.length - 2) / 2, a = (1n << BigInt(s) * 8n - 1n) - 1n;
|
|
3217
3217
|
return r <= a ? r : r - BigInt(`0x${"f".padStart(s * 2, "f")}`) - 1n;
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3219
|
+
function qe(t, e = {}) {
|
|
3220
3220
|
return Number(gt(t, e));
|
|
3221
3221
|
}
|
|
3222
|
-
const
|
|
3222
|
+
const Bi = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
3223
3223
|
function Sn(t, e = {}) {
|
|
3224
|
-
return typeof t == "number" || typeof t == "bigint" ?
|
|
3224
|
+
return typeof t == "number" || typeof t == "bigint" ? M(t, e) : typeof t == "string" ? Jn(t, e) : typeof t == "boolean" ? ns(t, e) : G(t, e);
|
|
3225
3225
|
}
|
|
3226
3226
|
function ns(t, e = {}) {
|
|
3227
3227
|
const n = `0x${Number(t)}`;
|
|
@@ -3230,11 +3230,11 @@ function ns(t, e = {}) {
|
|
|
3230
3230
|
function G(t, e = {}) {
|
|
3231
3231
|
let n = "";
|
|
3232
3232
|
for (let s = 0; s < t.length; s++)
|
|
3233
|
-
n +=
|
|
3233
|
+
n += Bi[t[s]];
|
|
3234
3234
|
const r = `0x${n}`;
|
|
3235
3235
|
return typeof e.size == "number" ? (ce(r, { size: e.size }), Je(r, { dir: "right", size: e.size })) : r;
|
|
3236
3236
|
}
|
|
3237
|
-
function
|
|
3237
|
+
function M(t, e = {}) {
|
|
3238
3238
|
const { signed: n, size: r } = e, s = BigInt(t);
|
|
3239
3239
|
let a;
|
|
3240
3240
|
r ? n ? a = (1n << BigInt(r) * 8n - 1n) - 1n : a = 2n ** (BigInt(r) * 8n) - 1n : typeof t == "number" && (a = BigInt(Number.MAX_SAFE_INTEGER));
|
|
@@ -3252,23 +3252,23 @@ function O(t, e = {}) {
|
|
|
3252
3252
|
const o = `0x${(n && s < 0 ? (1n << BigInt(r * 8)) + BigInt(s) : s).toString(16)}`;
|
|
3253
3253
|
return r ? Je(o, { size: r }) : o;
|
|
3254
3254
|
}
|
|
3255
|
-
const
|
|
3255
|
+
const Ni = /* @__PURE__ */ new TextEncoder();
|
|
3256
3256
|
function Jn(t, e = {}) {
|
|
3257
|
-
const n =
|
|
3257
|
+
const n = Ni.encode(t);
|
|
3258
3258
|
return G(n, e);
|
|
3259
3259
|
}
|
|
3260
3260
|
function We(t, { includeName: e = !1 } = {}) {
|
|
3261
3261
|
if (t.type !== "function" && t.type !== "event" && t.type !== "error")
|
|
3262
|
-
throw new
|
|
3262
|
+
throw new Ki(t.type);
|
|
3263
3263
|
return `${t.name}(${Yn(t.inputs, { includeName: e })})`;
|
|
3264
3264
|
}
|
|
3265
3265
|
function Yn(t, { includeName: e = !1 } = {}) {
|
|
3266
|
-
return t ? t.map((n) =>
|
|
3266
|
+
return t ? t.map((n) => Fi(n, { includeName: e })).join(e ? ", " : ",") : "";
|
|
3267
3267
|
}
|
|
3268
|
-
function
|
|
3268
|
+
function Fi(t, { includeName: e }) {
|
|
3269
3269
|
return t.type.startsWith("tuple") ? `(${Yn(t.components, { includeName: e })})${t.type.slice(5)}` : t.type + (e && t.name ? ` ${t.name}` : "");
|
|
3270
3270
|
}
|
|
3271
|
-
class
|
|
3271
|
+
class zi extends y {
|
|
3272
3272
|
constructor({ docsPath: e }) {
|
|
3273
3273
|
super([
|
|
3274
3274
|
"A constructor was not found on the ABI.",
|
|
@@ -3292,7 +3292,7 @@ class Pr extends y {
|
|
|
3292
3292
|
});
|
|
3293
3293
|
}
|
|
3294
3294
|
}
|
|
3295
|
-
class
|
|
3295
|
+
class Zi extends y {
|
|
3296
3296
|
constructor({ data: e, params: n, size: r }) {
|
|
3297
3297
|
super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
3298
3298
|
`), {
|
|
@@ -3326,7 +3326,7 @@ class Xn extends y {
|
|
|
3326
3326
|
});
|
|
3327
3327
|
}
|
|
3328
3328
|
}
|
|
3329
|
-
class
|
|
3329
|
+
class Di extends y {
|
|
3330
3330
|
constructor({ expectedLength: e, givenLength: n, type: r }) {
|
|
3331
3331
|
super([
|
|
3332
3332
|
`ABI encoding array length mismatch for type ${r}.`,
|
|
@@ -3336,12 +3336,12 @@ class Li extends y {
|
|
|
3336
3336
|
`), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
3337
3337
|
}
|
|
3338
3338
|
}
|
|
3339
|
-
class
|
|
3339
|
+
class Li extends y {
|
|
3340
3340
|
constructor({ expectedSize: e, value: n }) {
|
|
3341
3341
|
super(`Size of bytes "${n}" (bytes${N(n)}) does not match expected size (bytes${e}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
3342
3342
|
}
|
|
3343
3343
|
}
|
|
3344
|
-
class
|
|
3344
|
+
class Vi extends y {
|
|
3345
3345
|
constructor({ expectedLength: e, givenLength: n }) {
|
|
3346
3346
|
super([
|
|
3347
3347
|
"ABI encoding params/values length mismatch.",
|
|
@@ -3381,7 +3381,7 @@ class Kt extends y {
|
|
|
3381
3381
|
});
|
|
3382
3382
|
}
|
|
3383
3383
|
}
|
|
3384
|
-
class
|
|
3384
|
+
class Ui extends y {
|
|
3385
3385
|
constructor(e, { docsPath: n }) {
|
|
3386
3386
|
super([
|
|
3387
3387
|
`Function "${e}" does not contain any \`outputs\` on ABI.`,
|
|
@@ -3394,7 +3394,7 @@ class Vi extends y {
|
|
|
3394
3394
|
});
|
|
3395
3395
|
}
|
|
3396
3396
|
}
|
|
3397
|
-
class
|
|
3397
|
+
class Gi extends y {
|
|
3398
3398
|
constructor(e, n) {
|
|
3399
3399
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
3400
3400
|
metaMessages: [
|
|
@@ -3408,7 +3408,7 @@ class Ui extends y {
|
|
|
3408
3408
|
});
|
|
3409
3409
|
}
|
|
3410
3410
|
}
|
|
3411
|
-
class
|
|
3411
|
+
class qi extends y {
|
|
3412
3412
|
constructor(e, { docsPath: n }) {
|
|
3413
3413
|
super([
|
|
3414
3414
|
`Type "${e}" is not a valid encoding type.`,
|
|
@@ -3417,7 +3417,7 @@ class Gi extends y {
|
|
|
3417
3417
|
`), { docsPath: n, name: "InvalidAbiEncodingType" });
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
3420
|
-
class
|
|
3420
|
+
class Wi extends y {
|
|
3421
3421
|
constructor(e, { docsPath: n }) {
|
|
3422
3422
|
super([
|
|
3423
3423
|
`Type "${e}" is not a valid decoding type.`,
|
|
@@ -3426,7 +3426,7 @@ class Hi extends y {
|
|
|
3426
3426
|
`), { docsPath: n, name: "InvalidAbiDecodingType" });
|
|
3427
3427
|
}
|
|
3428
3428
|
}
|
|
3429
|
-
class
|
|
3429
|
+
class Hi extends y {
|
|
3430
3430
|
constructor(e) {
|
|
3431
3431
|
super([`Value "${e}" is not a valid array.`].join(`
|
|
3432
3432
|
`), {
|
|
@@ -3434,7 +3434,7 @@ class Wi extends y {
|
|
|
3434
3434
|
});
|
|
3435
3435
|
}
|
|
3436
3436
|
}
|
|
3437
|
-
class
|
|
3437
|
+
class Ki extends y {
|
|
3438
3438
|
constructor(e) {
|
|
3439
3439
|
super([
|
|
3440
3440
|
`"${e}" is not a valid definition type.`,
|
|
@@ -3443,10 +3443,10 @@ class qi extends y {
|
|
|
3443
3443
|
`), { name: "InvalidDefinitionTypeError" });
|
|
3444
3444
|
}
|
|
3445
3445
|
}
|
|
3446
|
-
function
|
|
3447
|
-
return typeof t[0] == "string" ? rn(t) :
|
|
3446
|
+
function He(t) {
|
|
3447
|
+
return typeof t[0] == "string" ? rn(t) : Ji(t);
|
|
3448
3448
|
}
|
|
3449
|
-
function
|
|
3449
|
+
function Ji(t) {
|
|
3450
3450
|
let e = 0;
|
|
3451
3451
|
for (const s of t)
|
|
3452
3452
|
e += s.length;
|
|
@@ -3492,7 +3492,7 @@ class sn extends Map {
|
|
|
3492
3492
|
}
|
|
3493
3493
|
}
|
|
3494
3494
|
function Nt(t, e) {
|
|
3495
|
-
const n = e || "hex", r =
|
|
3495
|
+
const n = e || "hex", r = fa(Pe(t, { strict: !1 }) ? Kn(t) : t);
|
|
3496
3496
|
return n === "bytes" ? r : Sn(r);
|
|
3497
3497
|
}
|
|
3498
3498
|
const mn = /* @__PURE__ */ new sn(8192);
|
|
@@ -3505,21 +3505,21 @@ function an(t, e) {
|
|
|
3505
3505
|
const a = `0x${s.join("")}`;
|
|
3506
3506
|
return mn.set(`${t}.${e}`, a), a;
|
|
3507
3507
|
}
|
|
3508
|
-
function
|
|
3508
|
+
function Yi(t, e) {
|
|
3509
3509
|
if (!Ee(t, { strict: !1 }))
|
|
3510
3510
|
throw new vt({ address: t });
|
|
3511
3511
|
return an(t, e);
|
|
3512
3512
|
}
|
|
3513
|
-
const
|
|
3513
|
+
const Xi = /^0x[a-fA-F0-9]{40}$/, yn = /* @__PURE__ */ new sn(8192);
|
|
3514
3514
|
function Ee(t, e) {
|
|
3515
3515
|
const { strict: n = !0 } = e ?? {}, r = `${t}.${n}`;
|
|
3516
3516
|
if (yn.has(r))
|
|
3517
3517
|
return yn.get(r);
|
|
3518
|
-
const s =
|
|
3518
|
+
const s = Xi.test(t) ? t.toLowerCase() === t ? !0 : n ? an(t) === t : !0 : !1;
|
|
3519
3519
|
return yn.set(r, s), s;
|
|
3520
3520
|
}
|
|
3521
3521
|
function Jt(t, e, n, { strict: r } = {}) {
|
|
3522
|
-
return Pe(t, { strict: !1 }) ?
|
|
3522
|
+
return Pe(t, { strict: !1 }) ? Qi(t, e, n, {
|
|
3523
3523
|
strict: r
|
|
3524
3524
|
}) : is(t, e, n, {
|
|
3525
3525
|
strict: r
|
|
@@ -3546,25 +3546,25 @@ function is(t, e, n, { strict: r } = {}) {
|
|
|
3546
3546
|
const s = t.slice(e, n);
|
|
3547
3547
|
return r && as(s, e, n), s;
|
|
3548
3548
|
}
|
|
3549
|
-
function
|
|
3549
|
+
function Qi(t, e, n, { strict: r } = {}) {
|
|
3550
3550
|
ss(t, e);
|
|
3551
3551
|
const s = `0x${t.replace("0x", "").slice((e ?? 0) * 2, (n ?? t.length) * 2)}`;
|
|
3552
3552
|
return r && as(s, e, n), s;
|
|
3553
3553
|
}
|
|
3554
|
-
const
|
|
3554
|
+
const eo = /^(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)?$/;
|
|
3555
3555
|
function os(t, e) {
|
|
3556
3556
|
if (t.length !== e.length)
|
|
3557
|
-
throw new
|
|
3557
|
+
throw new Vi({
|
|
3558
3558
|
expectedLength: t.length,
|
|
3559
3559
|
givenLength: e.length
|
|
3560
3560
|
});
|
|
3561
|
-
const n =
|
|
3561
|
+
const n = to({
|
|
3562
3562
|
params: t,
|
|
3563
3563
|
values: e
|
|
3564
3564
|
}), r = er(n);
|
|
3565
3565
|
return r.length === 0 ? "0x" : r;
|
|
3566
3566
|
}
|
|
3567
|
-
function
|
|
3567
|
+
function to({ params: t, values: e }) {
|
|
3568
3568
|
const n = [];
|
|
3569
3569
|
for (let r = 0; r < t.length; r++)
|
|
3570
3570
|
n.push(Qn({ param: t[r], value: e[r] }));
|
|
@@ -3574,28 +3574,28 @@ function Qn({ param: t, value: e }) {
|
|
|
3574
3574
|
const n = tr(t.type);
|
|
3575
3575
|
if (n) {
|
|
3576
3576
|
const [r, s] = n;
|
|
3577
|
-
return
|
|
3577
|
+
return ro(e, { length: r, param: { ...t, type: s } });
|
|
3578
3578
|
}
|
|
3579
3579
|
if (t.type === "tuple")
|
|
3580
|
-
return
|
|
3580
|
+
return co(e, {
|
|
3581
3581
|
param: t
|
|
3582
3582
|
});
|
|
3583
3583
|
if (t.type === "address")
|
|
3584
|
-
return
|
|
3584
|
+
return no(e);
|
|
3585
3585
|
if (t.type === "bool")
|
|
3586
|
-
return
|
|
3586
|
+
return ao(e);
|
|
3587
3587
|
if (t.type.startsWith("uint") || t.type.startsWith("int")) {
|
|
3588
|
-
const r = t.type.startsWith("int"), [, , s = "256"] =
|
|
3589
|
-
return
|
|
3588
|
+
const r = t.type.startsWith("int"), [, , s = "256"] = eo.exec(t.type) ?? [];
|
|
3589
|
+
return io(e, {
|
|
3590
3590
|
signed: r,
|
|
3591
3591
|
size: Number(s)
|
|
3592
3592
|
});
|
|
3593
3593
|
}
|
|
3594
3594
|
if (t.type.startsWith("bytes"))
|
|
3595
|
-
return
|
|
3595
|
+
return so(e, { param: t });
|
|
3596
3596
|
if (t.type === "string")
|
|
3597
|
-
return
|
|
3598
|
-
throw new
|
|
3597
|
+
return oo(e);
|
|
3598
|
+
throw new qi(t.type, {
|
|
3599
3599
|
docsPath: "/docs/contract/encodeAbiParameters"
|
|
3600
3600
|
});
|
|
3601
3601
|
}
|
|
@@ -3609,21 +3609,21 @@ function er(t) {
|
|
|
3609
3609
|
let s = 0;
|
|
3610
3610
|
for (let a = 0; a < t.length; a++) {
|
|
3611
3611
|
const { dynamic: i, encoded: o } = t[a];
|
|
3612
|
-
i ? (n.push(
|
|
3612
|
+
i ? (n.push(M(e + s, { size: 32 })), r.push(o), s += N(o)) : n.push(o);
|
|
3613
3613
|
}
|
|
3614
|
-
return
|
|
3614
|
+
return He([...n, ...r]);
|
|
3615
3615
|
}
|
|
3616
|
-
function
|
|
3616
|
+
function no(t) {
|
|
3617
3617
|
if (!Ee(t))
|
|
3618
3618
|
throw new vt({ address: t });
|
|
3619
3619
|
return { dynamic: !1, encoded: ge(t.toLowerCase()) };
|
|
3620
3620
|
}
|
|
3621
|
-
function
|
|
3621
|
+
function ro(t, { length: e, param: n }) {
|
|
3622
3622
|
const r = e === null;
|
|
3623
3623
|
if (!Array.isArray(t))
|
|
3624
|
-
throw new
|
|
3624
|
+
throw new Hi(t);
|
|
3625
3625
|
if (!r && t.length !== e)
|
|
3626
|
-
throw new
|
|
3626
|
+
throw new Di({
|
|
3627
3627
|
expectedLength: e,
|
|
3628
3628
|
givenLength: t.length,
|
|
3629
3629
|
type: `${n.type}[${e}]`
|
|
@@ -3637,10 +3637,10 @@ function no(t, { length: e, param: n }) {
|
|
|
3637
3637
|
if (r || s) {
|
|
3638
3638
|
const i = er(a);
|
|
3639
3639
|
if (r) {
|
|
3640
|
-
const o =
|
|
3640
|
+
const o = M(a.length, { size: 32 });
|
|
3641
3641
|
return {
|
|
3642
3642
|
dynamic: !0,
|
|
3643
|
-
encoded: a.length > 0 ?
|
|
3643
|
+
encoded: a.length > 0 ? He([o, i]) : o
|
|
3644
3644
|
};
|
|
3645
3645
|
}
|
|
3646
3646
|
if (s)
|
|
@@ -3648,10 +3648,10 @@ function no(t, { length: e, param: n }) {
|
|
|
3648
3648
|
}
|
|
3649
3649
|
return {
|
|
3650
3650
|
dynamic: !1,
|
|
3651
|
-
encoded:
|
|
3651
|
+
encoded: He(a.map(({ encoded: i }) => i))
|
|
3652
3652
|
};
|
|
3653
3653
|
}
|
|
3654
|
-
function
|
|
3654
|
+
function so(t, { param: e }) {
|
|
3655
3655
|
const [, n] = e.type.split("bytes"), r = N(t);
|
|
3656
3656
|
if (!n) {
|
|
3657
3657
|
let s = t;
|
|
@@ -3660,22 +3660,22 @@ function ro(t, { param: e }) {
|
|
|
3660
3660
|
size: Math.ceil((t.length - 2) / 2 / 32) * 32
|
|
3661
3661
|
})), {
|
|
3662
3662
|
dynamic: !0,
|
|
3663
|
-
encoded:
|
|
3663
|
+
encoded: He([ge(M(r, { size: 32 })), s])
|
|
3664
3664
|
};
|
|
3665
3665
|
}
|
|
3666
3666
|
if (r !== Number.parseInt(n))
|
|
3667
|
-
throw new
|
|
3667
|
+
throw new Li({
|
|
3668
3668
|
expectedSize: Number.parseInt(n),
|
|
3669
3669
|
value: t
|
|
3670
3670
|
});
|
|
3671
3671
|
return { dynamic: !1, encoded: ge(t, { dir: "right" }) };
|
|
3672
3672
|
}
|
|
3673
|
-
function
|
|
3673
|
+
function ao(t) {
|
|
3674
3674
|
if (typeof t != "boolean")
|
|
3675
3675
|
throw new y(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);
|
|
3676
3676
|
return { dynamic: !1, encoded: ge(ns(t)) };
|
|
3677
3677
|
}
|
|
3678
|
-
function
|
|
3678
|
+
function io(t, { signed: e, size: n = 256 }) {
|
|
3679
3679
|
if (typeof n == "number") {
|
|
3680
3680
|
const r = 2n ** (BigInt(n) - (e ? 1n : 0n)) - 1n, s = e ? -r - 1n : 0n;
|
|
3681
3681
|
if (t > r || t < s)
|
|
@@ -3689,13 +3689,13 @@ function ao(t, { signed: e, size: n = 256 }) {
|
|
|
3689
3689
|
}
|
|
3690
3690
|
return {
|
|
3691
3691
|
dynamic: !1,
|
|
3692
|
-
encoded:
|
|
3692
|
+
encoded: M(t, {
|
|
3693
3693
|
size: 32,
|
|
3694
3694
|
signed: e
|
|
3695
3695
|
})
|
|
3696
3696
|
};
|
|
3697
3697
|
}
|
|
3698
|
-
function
|
|
3698
|
+
function oo(t) {
|
|
3699
3699
|
const e = Jn(t), n = Math.ceil(N(e) / 32), r = [];
|
|
3700
3700
|
for (let s = 0; s < n; s++)
|
|
3701
3701
|
r.push(ge(Jt(e, s * 32, (s + 1) * 32), {
|
|
@@ -3703,13 +3703,13 @@ function io(t) {
|
|
|
3703
3703
|
}));
|
|
3704
3704
|
return {
|
|
3705
3705
|
dynamic: !0,
|
|
3706
|
-
encoded:
|
|
3707
|
-
ge(
|
|
3706
|
+
encoded: He([
|
|
3707
|
+
ge(M(N(e), { size: 32 })),
|
|
3708
3708
|
...r
|
|
3709
3709
|
])
|
|
3710
3710
|
};
|
|
3711
3711
|
}
|
|
3712
|
-
function
|
|
3712
|
+
function co(t, { param: e }) {
|
|
3713
3713
|
let n = !1;
|
|
3714
3714
|
const r = [];
|
|
3715
3715
|
for (let s = 0; s < e.components.length; s++) {
|
|
@@ -3721,7 +3721,7 @@ function oo(t, { param: e }) {
|
|
|
3721
3721
|
}
|
|
3722
3722
|
return {
|
|
3723
3723
|
dynamic: n,
|
|
3724
|
-
encoded: n ? er(r) :
|
|
3724
|
+
encoded: n ? er(r) : He(r.map(({ encoded: s }) => s))
|
|
3725
3725
|
};
|
|
3726
3726
|
}
|
|
3727
3727
|
function tr(t) {
|
|
@@ -3738,7 +3738,7 @@ function cs(t) {
|
|
|
3738
3738
|
return r;
|
|
3739
3739
|
const s = e.find((i) => "type" in i && i.type === "constructor");
|
|
3740
3740
|
if (!s)
|
|
3741
|
-
throw new
|
|
3741
|
+
throw new zi({ docsPath: bn });
|
|
3742
3742
|
if (!("inputs" in s))
|
|
3743
3743
|
throw new Pr({ docsPath: bn });
|
|
3744
3744
|
if (!s.inputs || s.inputs.length === 0)
|
|
@@ -3771,18 +3771,18 @@ class gn extends y {
|
|
|
3771
3771
|
});
|
|
3772
3772
|
}
|
|
3773
3773
|
}
|
|
3774
|
-
function
|
|
3774
|
+
function uo(t) {
|
|
3775
3775
|
const e = Nt(`0x${t.substring(4)}`).substring(26);
|
|
3776
3776
|
return an(`0x${e}`);
|
|
3777
3777
|
}
|
|
3778
|
-
async function
|
|
3778
|
+
async function lo({ hash: t, signature: e }) {
|
|
3779
3779
|
const n = Pe(t) ? t : Sn(t), { secp256k1: r } = await import("./utils-ClgLOuAN.js").then((i) => i.al);
|
|
3780
3780
|
return `0x${(() => {
|
|
3781
3781
|
if (typeof e == "object" && "r" in e && "s" in e) {
|
|
3782
3782
|
const { r: c, s: d, v: l, yParity: f } = e, m = Number(f ?? l), v = Er(m);
|
|
3783
3783
|
return new r.Signature(gt(c), gt(d)).addRecoveryBit(v);
|
|
3784
3784
|
}
|
|
3785
|
-
const i = Pe(e) ? e : Sn(e), o =
|
|
3785
|
+
const i = Pe(e) ? e : Sn(e), o = qe(`0x${i.slice(130)}`), u = Er(o);
|
|
3786
3786
|
return r.Signature.fromCompact(i.substring(2, 130)).addRecoveryBit(u);
|
|
3787
3787
|
})().recoverPublicKey(n.substring(2)).toHex(!1)}`;
|
|
3788
3788
|
}
|
|
@@ -3795,8 +3795,8 @@ function Er(t) {
|
|
|
3795
3795
|
return 1;
|
|
3796
3796
|
throw new Error("Invalid yParityOrV value");
|
|
3797
3797
|
}
|
|
3798
|
-
async function
|
|
3799
|
-
return
|
|
3798
|
+
async function fo({ hash: t, signature: e }) {
|
|
3799
|
+
return uo(await lo({ hash: t, signature: e }));
|
|
3800
3800
|
}
|
|
3801
3801
|
class Ar extends y {
|
|
3802
3802
|
constructor({ offset: e }) {
|
|
@@ -3805,17 +3805,17 @@ class Ar extends y {
|
|
|
3805
3805
|
});
|
|
3806
3806
|
}
|
|
3807
3807
|
}
|
|
3808
|
-
class
|
|
3808
|
+
class ho extends y {
|
|
3809
3809
|
constructor({ length: e, position: n }) {
|
|
3810
3810
|
super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`, { name: "PositionOutOfBoundsError" });
|
|
3811
3811
|
}
|
|
3812
3812
|
}
|
|
3813
|
-
class
|
|
3813
|
+
class po extends y {
|
|
3814
3814
|
constructor({ count: e, limit: n }) {
|
|
3815
3815
|
super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
3816
3816
|
}
|
|
3817
3817
|
}
|
|
3818
|
-
const
|
|
3818
|
+
const mo = {
|
|
3819
3819
|
bytes: new Uint8Array(),
|
|
3820
3820
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
3821
3821
|
position: 0,
|
|
@@ -3824,14 +3824,14 @@ const po = {
|
|
|
3824
3824
|
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
3825
3825
|
assertReadLimit() {
|
|
3826
3826
|
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
3827
|
-
throw new
|
|
3827
|
+
throw new po({
|
|
3828
3828
|
count: this.recursiveReadCount + 1,
|
|
3829
3829
|
limit: this.recursiveReadLimit
|
|
3830
3830
|
});
|
|
3831
3831
|
},
|
|
3832
3832
|
assertPosition(t) {
|
|
3833
3833
|
if (t < 0 || t > this.bytes.length - 1)
|
|
3834
|
-
throw new
|
|
3834
|
+
throw new ho({
|
|
3835
3835
|
length: this.bytes.length,
|
|
3836
3836
|
position: t
|
|
3837
3837
|
});
|
|
@@ -3938,17 +3938,17 @@ const po = {
|
|
|
3938
3938
|
}
|
|
3939
3939
|
};
|
|
3940
3940
|
function nr(t, { recursiveReadLimit: e = 8192 } = {}) {
|
|
3941
|
-
const n = Object.create(
|
|
3941
|
+
const n = Object.create(mo);
|
|
3942
3942
|
return n.bytes = t, n.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength), n.positionReadCount = /* @__PURE__ */ new Map(), n.recursiveReadLimit = e, n;
|
|
3943
3943
|
}
|
|
3944
|
-
function
|
|
3944
|
+
function yo(t, e = "hex") {
|
|
3945
3945
|
const n = ds(t), r = nr(new Uint8Array(n.length));
|
|
3946
3946
|
return n.encode(r), e === "hex" ? G(r.bytes) : r.bytes;
|
|
3947
3947
|
}
|
|
3948
3948
|
function ds(t) {
|
|
3949
|
-
return Array.isArray(t) ?
|
|
3949
|
+
return Array.isArray(t) ? bo(t.map((e) => ds(e))) : go(t);
|
|
3950
3950
|
}
|
|
3951
|
-
function
|
|
3951
|
+
function bo(t) {
|
|
3952
3952
|
const e = t.reduce((s, a) => s + a.length, 0), n = ls(e);
|
|
3953
3953
|
return {
|
|
3954
3954
|
length: e <= 55 ? 1 + e : 1 + n + e,
|
|
@@ -3959,7 +3959,7 @@ function yo(t) {
|
|
|
3959
3959
|
}
|
|
3960
3960
|
};
|
|
3961
3961
|
}
|
|
3962
|
-
function
|
|
3962
|
+
function go(t) {
|
|
3963
3963
|
const e = typeof t == "string" ? ye(t) : t, n = ls(e.length);
|
|
3964
3964
|
return {
|
|
3965
3965
|
length: e.length === 1 && e[0] < 128 ? 1 : e.length <= 55 ? 1 + e.length : 1 + n + e.length,
|
|
@@ -3979,21 +3979,21 @@ function ls(t) {
|
|
|
3979
3979
|
return 4;
|
|
3980
3980
|
throw new y("Length is too large.");
|
|
3981
3981
|
}
|
|
3982
|
-
function
|
|
3982
|
+
function vo(t) {
|
|
3983
3983
|
const { chainId: e, contractAddress: n, nonce: r, to: s } = t, a = Nt(rn([
|
|
3984
3984
|
"0x05",
|
|
3985
|
-
|
|
3986
|
-
e ?
|
|
3985
|
+
yo([
|
|
3986
|
+
e ? M(e) : "0x",
|
|
3987
3987
|
n,
|
|
3988
|
-
r ?
|
|
3988
|
+
r ? M(r) : "0x"
|
|
3989
3989
|
])
|
|
3990
3990
|
]));
|
|
3991
3991
|
return s === "bytes" ? ye(a) : a;
|
|
3992
3992
|
}
|
|
3993
3993
|
async function fs(t) {
|
|
3994
3994
|
const { authorization: e, signature: n } = t;
|
|
3995
|
-
return
|
|
3996
|
-
hash:
|
|
3995
|
+
return fo({
|
|
3996
|
+
hash: vo(e),
|
|
3997
3997
|
signature: n ?? e
|
|
3998
3998
|
});
|
|
3999
3999
|
}
|
|
@@ -4012,7 +4012,7 @@ class Rn extends y {
|
|
|
4012
4012
|
});
|
|
4013
4013
|
}
|
|
4014
4014
|
}
|
|
4015
|
-
class
|
|
4015
|
+
class wo extends y {
|
|
4016
4016
|
constructor({ chain: e, currentChainId: n }) {
|
|
4017
4017
|
super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`, {
|
|
4018
4018
|
metaMessages: [
|
|
@@ -4023,7 +4023,7 @@ class vo extends y {
|
|
|
4023
4023
|
});
|
|
4024
4024
|
}
|
|
4025
4025
|
}
|
|
4026
|
-
class
|
|
4026
|
+
class xo extends y {
|
|
4027
4027
|
constructor() {
|
|
4028
4028
|
super([
|
|
4029
4029
|
"No chain was provided to the request.",
|
|
@@ -4041,16 +4041,16 @@ class hs extends y {
|
|
|
4041
4041
|
});
|
|
4042
4042
|
}
|
|
4043
4043
|
}
|
|
4044
|
-
function
|
|
4044
|
+
function _o({ chain: t, currentChainId: e }) {
|
|
4045
4045
|
if (!t)
|
|
4046
|
-
throw new
|
|
4046
|
+
throw new xo();
|
|
4047
4047
|
if (e !== t.id)
|
|
4048
|
-
throw new
|
|
4048
|
+
throw new wo({ chain: t, currentChainId: e });
|
|
4049
4049
|
}
|
|
4050
|
-
const
|
|
4050
|
+
const Po = {
|
|
4051
4051
|
gwei: 9,
|
|
4052
4052
|
wei: 18
|
|
4053
|
-
},
|
|
4053
|
+
}, Eo = {
|
|
4054
4054
|
ether: -9,
|
|
4055
4055
|
wei: 9
|
|
4056
4056
|
};
|
|
@@ -4065,7 +4065,7 @@ function ps(t, e) {
|
|
|
4065
4065
|
return a = a.replace(/(0+)$/, ""), `${r ? "-" : ""}${s || "0"}${a ? `.${a}` : ""}`;
|
|
4066
4066
|
}
|
|
4067
4067
|
function U(t, e = "wei") {
|
|
4068
|
-
return ps(t,
|
|
4068
|
+
return ps(t, Eo[e]);
|
|
4069
4069
|
}
|
|
4070
4070
|
class ze extends y {
|
|
4071
4071
|
constructor({ cause: e, message: n } = {}) {
|
|
@@ -4103,7 +4103,7 @@ Object.defineProperty(Yt, "nodeMessage", {
|
|
|
4103
4103
|
writable: !0,
|
|
4104
4104
|
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
4105
4105
|
});
|
|
4106
|
-
class
|
|
4106
|
+
class Mn extends y {
|
|
4107
4107
|
constructor({ cause: e, maxFeePerGas: n } = {}) {
|
|
4108
4108
|
super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${U(n)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
4109
4109
|
cause: e,
|
|
@@ -4111,18 +4111,18 @@ class On extends y {
|
|
|
4111
4111
|
});
|
|
4112
4112
|
}
|
|
4113
4113
|
}
|
|
4114
|
-
Object.defineProperty(
|
|
4114
|
+
Object.defineProperty(Mn, "nodeMessage", {
|
|
4115
4115
|
enumerable: !0,
|
|
4116
4116
|
configurable: !0,
|
|
4117
4117
|
writable: !0,
|
|
4118
4118
|
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
4119
4119
|
});
|
|
4120
|
-
class
|
|
4120
|
+
class On extends y {
|
|
4121
4121
|
constructor({ cause: e, nonce: n } = {}) {
|
|
4122
4122
|
super(`Nonce provided for the transaction ${n ? `(${n}) ` : ""}is higher than the next one expected.`, { cause: e, name: "NonceTooHighError" });
|
|
4123
4123
|
}
|
|
4124
4124
|
}
|
|
4125
|
-
Object.defineProperty(
|
|
4125
|
+
Object.defineProperty(On, "nodeMessage", {
|
|
4126
4126
|
enumerable: !0,
|
|
4127
4127
|
configurable: !0,
|
|
4128
4128
|
writable: !0,
|
|
@@ -4209,7 +4209,7 @@ Object.defineProperty(zn, "nodeMessage", {
|
|
|
4209
4209
|
writable: !0,
|
|
4210
4210
|
value: /intrinsic gas too low/
|
|
4211
4211
|
});
|
|
4212
|
-
class
|
|
4212
|
+
class Zn extends y {
|
|
4213
4213
|
constructor({ cause: e }) {
|
|
4214
4214
|
super("The transaction type is not supported for this chain.", {
|
|
4215
4215
|
cause: e,
|
|
@@ -4217,7 +4217,7 @@ class Ln extends y {
|
|
|
4217
4217
|
});
|
|
4218
4218
|
}
|
|
4219
4219
|
}
|
|
4220
|
-
Object.defineProperty(
|
|
4220
|
+
Object.defineProperty(Zn, "nodeMessage", {
|
|
4221
4221
|
enumerable: !0,
|
|
4222
4222
|
configurable: !0,
|
|
4223
4223
|
writable: !0,
|
|
@@ -4249,14 +4249,14 @@ class on extends y {
|
|
|
4249
4249
|
}
|
|
4250
4250
|
}
|
|
4251
4251
|
function rr(t, e = "wei") {
|
|
4252
|
-
return ps(t,
|
|
4252
|
+
return ps(t, Po[e]);
|
|
4253
4253
|
}
|
|
4254
4254
|
function Ft(t) {
|
|
4255
4255
|
const e = Object.entries(t).map(([r, s]) => s === void 0 || s === !1 ? null : [r, s]).filter(Boolean), n = e.reduce((r, [s]) => Math.max(r, s.length), 0);
|
|
4256
4256
|
return e.map(([r, s]) => ` ${`${r}:`.padEnd(n + 1)} ${s}`).join(`
|
|
4257
4257
|
`);
|
|
4258
4258
|
}
|
|
4259
|
-
class
|
|
4259
|
+
class Ao extends y {
|
|
4260
4260
|
constructor() {
|
|
4261
4261
|
super([
|
|
4262
4262
|
"Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
|
|
@@ -4265,7 +4265,7 @@ class Eo extends y {
|
|
|
4265
4265
|
`), { name: "FeeConflictError" });
|
|
4266
4266
|
}
|
|
4267
4267
|
}
|
|
4268
|
-
class
|
|
4268
|
+
class Co extends y {
|
|
4269
4269
|
constructor({ transaction: e }) {
|
|
4270
4270
|
super("Cannot infer a transaction type from provided transaction.", {
|
|
4271
4271
|
metaMessages: [
|
|
@@ -4286,7 +4286,7 @@ class Ao extends y {
|
|
|
4286
4286
|
});
|
|
4287
4287
|
}
|
|
4288
4288
|
}
|
|
4289
|
-
class
|
|
4289
|
+
class To extends y {
|
|
4290
4290
|
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to: l, value: f }) {
|
|
4291
4291
|
var v;
|
|
4292
4292
|
const m = Ft({
|
|
@@ -4318,7 +4318,7 @@ class Co extends y {
|
|
|
4318
4318
|
}), this.cause = e;
|
|
4319
4319
|
}
|
|
4320
4320
|
}
|
|
4321
|
-
const cn = (t, e, n) => JSON.stringify(t, (r, s) => typeof s == "bigint" ? s.toString() : s, n),
|
|
4321
|
+
const cn = (t, e, n) => JSON.stringify(t, (r, s) => typeof s == "bigint" ? s.toString() : s, n), $o = (t) => t, ms = (t) => t;
|
|
4322
4322
|
class ys extends y {
|
|
4323
4323
|
constructor({ body: e, cause: n, details: r, headers: s, status: a, url: i }) {
|
|
4324
4324
|
super("HTTP request failed.", {
|
|
@@ -4373,8 +4373,8 @@ class bs extends y {
|
|
|
4373
4373
|
}), this.code = n.code, this.data = n.data;
|
|
4374
4374
|
}
|
|
4375
4375
|
}
|
|
4376
|
-
const
|
|
4377
|
-
class
|
|
4376
|
+
const ko = -1;
|
|
4377
|
+
class q extends y {
|
|
4378
4378
|
constructor(e, { code: n, docsPath: r, metaMessages: s, name: a, shortMessage: i }) {
|
|
4379
4379
|
super(i, {
|
|
4380
4380
|
cause: e,
|
|
@@ -4386,10 +4386,10 @@ class H extends y {
|
|
|
4386
4386
|
configurable: !0,
|
|
4387
4387
|
writable: !0,
|
|
4388
4388
|
value: void 0
|
|
4389
|
-
}), this.name = a || e.name, this.code = e instanceof bs ? e.code : n ??
|
|
4389
|
+
}), this.name = a || e.name, this.code = e instanceof bs ? e.code : n ?? ko;
|
|
4390
4390
|
}
|
|
4391
4391
|
}
|
|
4392
|
-
class Ye extends
|
|
4392
|
+
class Ye extends q {
|
|
4393
4393
|
constructor(e, n) {
|
|
4394
4394
|
super(e, n), Object.defineProperty(this, "data", {
|
|
4395
4395
|
enumerable: !0,
|
|
@@ -4399,7 +4399,7 @@ class Ye extends H {
|
|
|
4399
4399
|
}), this.data = n.data;
|
|
4400
4400
|
}
|
|
4401
4401
|
}
|
|
4402
|
-
class wt extends
|
|
4402
|
+
class wt extends q {
|
|
4403
4403
|
constructor(e) {
|
|
4404
4404
|
super(e, {
|
|
4405
4405
|
code: wt.code,
|
|
@@ -4414,7 +4414,7 @@ Object.defineProperty(wt, "code", {
|
|
|
4414
4414
|
writable: !0,
|
|
4415
4415
|
value: -32700
|
|
4416
4416
|
});
|
|
4417
|
-
class xt extends
|
|
4417
|
+
class xt extends q {
|
|
4418
4418
|
constructor(e) {
|
|
4419
4419
|
super(e, {
|
|
4420
4420
|
code: xt.code,
|
|
@@ -4429,7 +4429,7 @@ Object.defineProperty(xt, "code", {
|
|
|
4429
4429
|
writable: !0,
|
|
4430
4430
|
value: -32600
|
|
4431
4431
|
});
|
|
4432
|
-
class _t extends
|
|
4432
|
+
class _t extends q {
|
|
4433
4433
|
constructor(e, { method: n } = {}) {
|
|
4434
4434
|
super(e, {
|
|
4435
4435
|
code: _t.code,
|
|
@@ -4444,7 +4444,7 @@ Object.defineProperty(_t, "code", {
|
|
|
4444
4444
|
writable: !0,
|
|
4445
4445
|
value: -32601
|
|
4446
4446
|
});
|
|
4447
|
-
class Pt extends
|
|
4447
|
+
class Pt extends q {
|
|
4448
4448
|
constructor(e) {
|
|
4449
4449
|
super(e, {
|
|
4450
4450
|
code: Pt.code,
|
|
@@ -4463,22 +4463,22 @@ Object.defineProperty(Pt, "code", {
|
|
|
4463
4463
|
writable: !0,
|
|
4464
4464
|
value: -32602
|
|
4465
4465
|
});
|
|
4466
|
-
class
|
|
4466
|
+
class Me extends q {
|
|
4467
4467
|
constructor(e) {
|
|
4468
4468
|
super(e, {
|
|
4469
|
-
code:
|
|
4469
|
+
code: Me.code,
|
|
4470
4470
|
name: "InternalRpcError",
|
|
4471
4471
|
shortMessage: "An internal error was received."
|
|
4472
4472
|
});
|
|
4473
4473
|
}
|
|
4474
4474
|
}
|
|
4475
|
-
Object.defineProperty(
|
|
4475
|
+
Object.defineProperty(Me, "code", {
|
|
4476
4476
|
enumerable: !0,
|
|
4477
4477
|
configurable: !0,
|
|
4478
4478
|
writable: !0,
|
|
4479
4479
|
value: -32603
|
|
4480
4480
|
});
|
|
4481
|
-
class Et extends
|
|
4481
|
+
class Et extends q {
|
|
4482
4482
|
constructor(e) {
|
|
4483
4483
|
super(e, {
|
|
4484
4484
|
code: Et.code,
|
|
@@ -4497,7 +4497,7 @@ Object.defineProperty(Et, "code", {
|
|
|
4497
4497
|
writable: !0,
|
|
4498
4498
|
value: -32e3
|
|
4499
4499
|
});
|
|
4500
|
-
class At extends
|
|
4500
|
+
class At extends q {
|
|
4501
4501
|
constructor(e) {
|
|
4502
4502
|
super(e, {
|
|
4503
4503
|
code: At.code,
|
|
@@ -4517,7 +4517,7 @@ Object.defineProperty(At, "code", {
|
|
|
4517
4517
|
writable: !0,
|
|
4518
4518
|
value: -32001
|
|
4519
4519
|
});
|
|
4520
|
-
class Ct extends
|
|
4520
|
+
class Ct extends q {
|
|
4521
4521
|
constructor(e) {
|
|
4522
4522
|
super(e, {
|
|
4523
4523
|
code: Ct.code,
|
|
@@ -4532,37 +4532,37 @@ Object.defineProperty(Ct, "code", {
|
|
|
4532
4532
|
writable: !0,
|
|
4533
4533
|
value: -32002
|
|
4534
4534
|
});
|
|
4535
|
-
class
|
|
4535
|
+
class Tt extends q {
|
|
4536
4536
|
constructor(e) {
|
|
4537
4537
|
super(e, {
|
|
4538
|
-
code:
|
|
4538
|
+
code: Tt.code,
|
|
4539
4539
|
name: "TransactionRejectedRpcError",
|
|
4540
4540
|
shortMessage: "Transaction creation failed."
|
|
4541
4541
|
});
|
|
4542
4542
|
}
|
|
4543
4543
|
}
|
|
4544
|
-
Object.defineProperty(
|
|
4544
|
+
Object.defineProperty(Tt, "code", {
|
|
4545
4545
|
enumerable: !0,
|
|
4546
4546
|
configurable: !0,
|
|
4547
4547
|
writable: !0,
|
|
4548
4548
|
value: -32003
|
|
4549
4549
|
});
|
|
4550
|
-
class
|
|
4550
|
+
class $t extends q {
|
|
4551
4551
|
constructor(e, { method: n } = {}) {
|
|
4552
4552
|
super(e, {
|
|
4553
|
-
code:
|
|
4553
|
+
code: $t.code,
|
|
4554
4554
|
name: "MethodNotSupportedRpcError",
|
|
4555
4555
|
shortMessage: `Method${n ? ` "${n}"` : ""} is not implemented.`
|
|
4556
4556
|
});
|
|
4557
4557
|
}
|
|
4558
4558
|
}
|
|
4559
|
-
Object.defineProperty(
|
|
4559
|
+
Object.defineProperty($t, "code", {
|
|
4560
4560
|
enumerable: !0,
|
|
4561
4561
|
configurable: !0,
|
|
4562
4562
|
writable: !0,
|
|
4563
4563
|
value: -32004
|
|
4564
4564
|
});
|
|
4565
|
-
class Ke extends
|
|
4565
|
+
class Ke extends q {
|
|
4566
4566
|
constructor(e) {
|
|
4567
4567
|
super(e, {
|
|
4568
4568
|
code: Ke.code,
|
|
@@ -4577,31 +4577,31 @@ Object.defineProperty(Ke, "code", {
|
|
|
4577
4577
|
writable: !0,
|
|
4578
4578
|
value: -32005
|
|
4579
4579
|
});
|
|
4580
|
-
class
|
|
4580
|
+
class kt extends q {
|
|
4581
4581
|
constructor(e) {
|
|
4582
4582
|
super(e, {
|
|
4583
|
-
code:
|
|
4583
|
+
code: kt.code,
|
|
4584
4584
|
name: "JsonRpcVersionUnsupportedError",
|
|
4585
4585
|
shortMessage: "Version of JSON-RPC protocol is not supported."
|
|
4586
4586
|
});
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
4589
|
-
Object.defineProperty(
|
|
4589
|
+
Object.defineProperty(kt, "code", {
|
|
4590
4590
|
enumerable: !0,
|
|
4591
4591
|
configurable: !0,
|
|
4592
4592
|
writable: !0,
|
|
4593
4593
|
value: -32006
|
|
4594
4594
|
});
|
|
4595
|
-
class
|
|
4595
|
+
class De extends Ye {
|
|
4596
4596
|
constructor(e) {
|
|
4597
4597
|
super(e, {
|
|
4598
|
-
code:
|
|
4598
|
+
code: De.code,
|
|
4599
4599
|
name: "UserRejectedRequestError",
|
|
4600
4600
|
shortMessage: "User rejected the request."
|
|
4601
4601
|
});
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
|
-
Object.defineProperty(
|
|
4604
|
+
Object.defineProperty(De, "code", {
|
|
4605
4605
|
enumerable: !0,
|
|
4606
4606
|
configurable: !0,
|
|
4607
4607
|
writable: !0,
|
|
@@ -4652,37 +4652,37 @@ Object.defineProperty(Rt, "code", {
|
|
|
4652
4652
|
writable: !0,
|
|
4653
4653
|
value: 4900
|
|
4654
4654
|
});
|
|
4655
|
-
class
|
|
4655
|
+
class Mt extends Ye {
|
|
4656
4656
|
constructor(e) {
|
|
4657
4657
|
super(e, {
|
|
4658
|
-
code:
|
|
4658
|
+
code: Mt.code,
|
|
4659
4659
|
name: "ChainDisconnectedError",
|
|
4660
4660
|
shortMessage: "The Provider is not connected to the requested chain."
|
|
4661
4661
|
});
|
|
4662
4662
|
}
|
|
4663
4663
|
}
|
|
4664
|
-
Object.defineProperty(
|
|
4664
|
+
Object.defineProperty(Mt, "code", {
|
|
4665
4665
|
enumerable: !0,
|
|
4666
4666
|
configurable: !0,
|
|
4667
4667
|
writable: !0,
|
|
4668
4668
|
value: 4901
|
|
4669
4669
|
});
|
|
4670
|
-
class
|
|
4670
|
+
class Ot extends Ye {
|
|
4671
4671
|
constructor(e) {
|
|
4672
4672
|
super(e, {
|
|
4673
|
-
code:
|
|
4673
|
+
code: Ot.code,
|
|
4674
4674
|
name: "SwitchChainError",
|
|
4675
4675
|
shortMessage: "An error occurred when attempting to switch chain."
|
|
4676
4676
|
});
|
|
4677
4677
|
}
|
|
4678
4678
|
}
|
|
4679
|
-
Object.defineProperty(
|
|
4679
|
+
Object.defineProperty(Ot, "code", {
|
|
4680
4680
|
enumerable: !0,
|
|
4681
4681
|
configurable: !0,
|
|
4682
4682
|
writable: !0,
|
|
4683
4683
|
value: 4902
|
|
4684
4684
|
});
|
|
4685
|
-
class
|
|
4685
|
+
class Io extends q {
|
|
4686
4686
|
constructor(e) {
|
|
4687
4687
|
super(e, {
|
|
4688
4688
|
name: "UnknownRpcError",
|
|
@@ -4701,10 +4701,10 @@ function sr(t, e) {
|
|
|
4701
4701
|
}) : Yt.nodeMessage.test(n) ? new Yt({
|
|
4702
4702
|
cause: t,
|
|
4703
4703
|
maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
|
|
4704
|
-
}) :
|
|
4704
|
+
}) : Mn.nodeMessage.test(n) ? new Mn({
|
|
4705
4705
|
cause: t,
|
|
4706
4706
|
maxFeePerGas: e == null ? void 0 : e.maxFeePerGas
|
|
4707
|
-
}) :
|
|
4707
|
+
}) : On.nodeMessage.test(n) ? new On({ cause: t, nonce: e == null ? void 0 : e.nonce }) : jn.nodeMessage.test(n) ? new jn({ cause: t, nonce: e == null ? void 0 : e.nonce }) : Bn.nodeMessage.test(n) ? new Bn({ cause: t, nonce: e == null ? void 0 : e.nonce }) : Nn.nodeMessage.test(n) ? new Nn({ cause: t }) : Fn.nodeMessage.test(n) ? new Fn({ cause: t, gas: e == null ? void 0 : e.gas }) : zn.nodeMessage.test(n) ? new zn({ cause: t, gas: e == null ? void 0 : e.gas }) : Zn.nodeMessage.test(n) ? new Zn({ cause: t }) : Xt.nodeMessage.test(n) ? new Xt({
|
|
4708
4708
|
cause: t,
|
|
4709
4709
|
maxFeePerGas: e == null ? void 0 : e.maxFeePerGas,
|
|
4710
4710
|
maxPriorityFeePerGas: e == null ? void 0 : e.maxPriorityFeePerGas
|
|
@@ -4712,12 +4712,12 @@ function sr(t, e) {
|
|
|
4712
4712
|
cause: t
|
|
4713
4713
|
});
|
|
4714
4714
|
}
|
|
4715
|
-
function
|
|
4715
|
+
function So(t, { docsPath: e, ...n }) {
|
|
4716
4716
|
const r = (() => {
|
|
4717
4717
|
const s = sr(t, n);
|
|
4718
4718
|
return s instanceof on ? t : s;
|
|
4719
4719
|
})();
|
|
4720
|
-
return new
|
|
4720
|
+
return new To(r, {
|
|
4721
4721
|
docsPath: e,
|
|
4722
4722
|
...n
|
|
4723
4723
|
});
|
|
@@ -4734,7 +4734,7 @@ function ar(t, { format: e }) {
|
|
|
4734
4734
|
const s = e(t || {});
|
|
4735
4735
|
return r(s), n;
|
|
4736
4736
|
}
|
|
4737
|
-
const
|
|
4737
|
+
const Ro = {
|
|
4738
4738
|
legacy: "0x0",
|
|
4739
4739
|
eip2930: "0x1",
|
|
4740
4740
|
eip1559: "0x2",
|
|
@@ -4743,20 +4743,20 @@ const So = {
|
|
|
4743
4743
|
};
|
|
4744
4744
|
function ir(t) {
|
|
4745
4745
|
const e = {};
|
|
4746
|
-
return typeof t.authorizationList < "u" && (e.authorizationList =
|
|
4746
|
+
return typeof t.authorizationList < "u" && (e.authorizationList = Mo(t.authorizationList)), typeof t.accessList < "u" && (e.accessList = t.accessList), typeof t.blobVersionedHashes < "u" && (e.blobVersionedHashes = t.blobVersionedHashes), typeof t.blobs < "u" && (typeof t.blobs[0] != "string" ? e.blobs = t.blobs.map((n) => G(n)) : e.blobs = t.blobs), typeof t.data < "u" && (e.data = t.data), typeof t.from < "u" && (e.from = t.from), typeof t.gas < "u" && (e.gas = M(t.gas)), typeof t.gasPrice < "u" && (e.gasPrice = M(t.gasPrice)), typeof t.maxFeePerBlobGas < "u" && (e.maxFeePerBlobGas = M(t.maxFeePerBlobGas)), typeof t.maxFeePerGas < "u" && (e.maxFeePerGas = M(t.maxFeePerGas)), typeof t.maxPriorityFeePerGas < "u" && (e.maxPriorityFeePerGas = M(t.maxPriorityFeePerGas)), typeof t.nonce < "u" && (e.nonce = M(t.nonce)), typeof t.to < "u" && (e.to = t.to), typeof t.type < "u" && (e.type = Ro[t.type]), typeof t.value < "u" && (e.value = M(t.value)), e;
|
|
4747
4747
|
}
|
|
4748
|
-
function
|
|
4748
|
+
function Mo(t) {
|
|
4749
4749
|
return t.map((e) => ({
|
|
4750
4750
|
address: e.contractAddress,
|
|
4751
4751
|
r: e.r,
|
|
4752
4752
|
s: e.s,
|
|
4753
|
-
chainId:
|
|
4754
|
-
nonce:
|
|
4755
|
-
...typeof e.yParity < "u" ? { yParity:
|
|
4756
|
-
...typeof e.v < "u" && typeof e.yParity > "u" ? { v:
|
|
4753
|
+
chainId: M(e.chainId),
|
|
4754
|
+
nonce: M(e.nonce),
|
|
4755
|
+
...typeof e.yParity < "u" ? { yParity: M(e.yParity) } : {},
|
|
4756
|
+
...typeof e.v < "u" && typeof e.yParity > "u" ? { v: M(e.v) } : {}
|
|
4757
4757
|
}));
|
|
4758
4758
|
}
|
|
4759
|
-
function
|
|
4759
|
+
function Z(t, e, n) {
|
|
4760
4760
|
const r = t[e.name];
|
|
4761
4761
|
if (typeof r == "function")
|
|
4762
4762
|
return r;
|
|
@@ -4771,7 +4771,7 @@ function un(t) {
|
|
|
4771
4771
|
if (a && !Ee(a))
|
|
4772
4772
|
throw new vt({ address: a });
|
|
4773
4773
|
if (typeof n < "u" && (typeof r < "u" || typeof s < "u"))
|
|
4774
|
-
throw new
|
|
4774
|
+
throw new Ao();
|
|
4775
4775
|
if (r && r > Oo)
|
|
4776
4776
|
throw new Yt({ maxFeePerGas: r });
|
|
4777
4777
|
if (s && r && s > r)
|
|
@@ -4781,9 +4781,9 @@ async function gs(t) {
|
|
|
4781
4781
|
const e = await t.request({
|
|
4782
4782
|
method: "eth_chainId"
|
|
4783
4783
|
}, { dedupe: !0 });
|
|
4784
|
-
return
|
|
4784
|
+
return qe(e);
|
|
4785
4785
|
}
|
|
4786
|
-
class
|
|
4786
|
+
class jo extends y {
|
|
4787
4787
|
constructor() {
|
|
4788
4788
|
super("`baseFeeMultiplier` must be greater than 1.", {
|
|
4789
4789
|
name: "BaseFeeScalarError"
|
|
@@ -4797,44 +4797,44 @@ class or extends y {
|
|
|
4797
4797
|
});
|
|
4798
4798
|
}
|
|
4799
4799
|
}
|
|
4800
|
-
class
|
|
4800
|
+
class Bo extends y {
|
|
4801
4801
|
constructor({ maxPriorityFeePerGas: e }) {
|
|
4802
4802
|
super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${U(e)} gwei).`, { name: "MaxFeePerGasTooLowError" });
|
|
4803
4803
|
}
|
|
4804
4804
|
}
|
|
4805
|
-
class
|
|
4805
|
+
class No extends y {
|
|
4806
4806
|
constructor({ blockHash: e, blockNumber: n }) {
|
|
4807
4807
|
let r = "Block";
|
|
4808
4808
|
e && (r = `Block at hash "${e}"`), n && (r = `Block at number "${n}"`), super(`${r} could not be found.`, { name: "BlockNotFoundError" });
|
|
4809
4809
|
}
|
|
4810
4810
|
}
|
|
4811
|
-
const
|
|
4811
|
+
const Fo = {
|
|
4812
4812
|
"0x0": "legacy",
|
|
4813
4813
|
"0x1": "eip2930",
|
|
4814
4814
|
"0x2": "eip1559",
|
|
4815
4815
|
"0x3": "eip4844",
|
|
4816
4816
|
"0x4": "eip7702"
|
|
4817
4817
|
};
|
|
4818
|
-
function
|
|
4818
|
+
function zo(t) {
|
|
4819
4819
|
const e = {
|
|
4820
4820
|
...t,
|
|
4821
4821
|
blockHash: t.blockHash ? t.blockHash : null,
|
|
4822
4822
|
blockNumber: t.blockNumber ? BigInt(t.blockNumber) : null,
|
|
4823
|
-
chainId: t.chainId ?
|
|
4823
|
+
chainId: t.chainId ? qe(t.chainId) : void 0,
|
|
4824
4824
|
gas: t.gas ? BigInt(t.gas) : void 0,
|
|
4825
4825
|
gasPrice: t.gasPrice ? BigInt(t.gasPrice) : void 0,
|
|
4826
4826
|
maxFeePerBlobGas: t.maxFeePerBlobGas ? BigInt(t.maxFeePerBlobGas) : void 0,
|
|
4827
4827
|
maxFeePerGas: t.maxFeePerGas ? BigInt(t.maxFeePerGas) : void 0,
|
|
4828
4828
|
maxPriorityFeePerGas: t.maxPriorityFeePerGas ? BigInt(t.maxPriorityFeePerGas) : void 0,
|
|
4829
|
-
nonce: t.nonce ?
|
|
4829
|
+
nonce: t.nonce ? qe(t.nonce) : void 0,
|
|
4830
4830
|
to: t.to ? t.to : null,
|
|
4831
4831
|
transactionIndex: t.transactionIndex ? Number(t.transactionIndex) : null,
|
|
4832
|
-
type: t.type ?
|
|
4832
|
+
type: t.type ? Fo[t.type] : void 0,
|
|
4833
4833
|
typeHex: t.type ? t.type : void 0,
|
|
4834
4834
|
value: t.value ? BigInt(t.value) : void 0,
|
|
4835
4835
|
v: t.v ? BigInt(t.v) : void 0
|
|
4836
4836
|
};
|
|
4837
|
-
return t.authorizationList && (e.authorizationList =
|
|
4837
|
+
return t.authorizationList && (e.authorizationList = Zo(t.authorizationList)), e.yParity = (() => {
|
|
4838
4838
|
if (t.yParity)
|
|
4839
4839
|
return Number(t.yParity);
|
|
4840
4840
|
if (typeof e.v == "bigint") {
|
|
@@ -4847,7 +4847,7 @@ function Fo(t) {
|
|
|
4847
4847
|
}
|
|
4848
4848
|
})(), e.type === "legacy" && (delete e.accessList, delete e.maxFeePerBlobGas, delete e.maxFeePerGas, delete e.maxPriorityFeePerGas, delete e.yParity), e.type === "eip2930" && (delete e.maxFeePerBlobGas, delete e.maxFeePerGas, delete e.maxPriorityFeePerGas), e.type === "eip1559" && delete e.maxFeePerBlobGas, e;
|
|
4849
4849
|
}
|
|
4850
|
-
function
|
|
4850
|
+
function Zo(t) {
|
|
4851
4851
|
return t.map((e) => ({
|
|
4852
4852
|
contractAddress: e.address,
|
|
4853
4853
|
chainId: Number(e.chainId),
|
|
@@ -4857,8 +4857,8 @@ function zo(t) {
|
|
|
4857
4857
|
yParity: Number(e.yParity)
|
|
4858
4858
|
}));
|
|
4859
4859
|
}
|
|
4860
|
-
function
|
|
4861
|
-
const e = (t.transactions ?? []).map((n) => typeof n == "string" ? n :
|
|
4860
|
+
function Do(t) {
|
|
4861
|
+
const e = (t.transactions ?? []).map((n) => typeof n == "string" ? n : zo(n));
|
|
4862
4862
|
return {
|
|
4863
4863
|
...t,
|
|
4864
4864
|
baseFeePerGas: t.baseFeePerGas ? BigInt(t.baseFeePerGas) : null,
|
|
@@ -4879,7 +4879,7 @@ function Lo(t) {
|
|
|
4879
4879
|
}
|
|
4880
4880
|
async function Qt(t, { blockHash: e, blockNumber: n, blockTag: r, includeTransactions: s } = {}) {
|
|
4881
4881
|
var d, l, f;
|
|
4882
|
-
const a = r ?? "latest", i = s ?? !1, o = n !== void 0 ?
|
|
4882
|
+
const a = r ?? "latest", i = s ?? !1, o = n !== void 0 ? M(n) : void 0;
|
|
4883
4883
|
let u = null;
|
|
4884
4884
|
if (e ? u = await t.request({
|
|
4885
4885
|
method: "eth_getBlockByHash",
|
|
@@ -4888,8 +4888,8 @@ async function Qt(t, { blockHash: e, blockNumber: n, blockTag: r, includeTransac
|
|
|
4888
4888
|
method: "eth_getBlockByNumber",
|
|
4889
4889
|
params: [o || a, i]
|
|
4890
4890
|
}, { dedupe: !!o }), !u)
|
|
4891
|
-
throw new
|
|
4892
|
-
return (((f = (l = (d = t.chain) == null ? void 0 : d.formatters) == null ? void 0 : l.block) == null ? void 0 : f.format) ||
|
|
4891
|
+
throw new No({ blockHash: e, blockNumber: n });
|
|
4892
|
+
return (((f = (l = (d = t.chain) == null ? void 0 : d.formatters) == null ? void 0 : l.block) == null ? void 0 : f.format) || Do)(u);
|
|
4893
4893
|
}
|
|
4894
4894
|
async function vs(t) {
|
|
4895
4895
|
const e = await t.request({
|
|
@@ -4897,13 +4897,13 @@ async function vs(t) {
|
|
|
4897
4897
|
});
|
|
4898
4898
|
return BigInt(e);
|
|
4899
4899
|
}
|
|
4900
|
-
async function
|
|
4900
|
+
async function Lo(t, e) {
|
|
4901
4901
|
var a, i;
|
|
4902
4902
|
const { block: n, chain: r = t.chain, request: s } = e || {};
|
|
4903
4903
|
try {
|
|
4904
4904
|
const o = ((a = r == null ? void 0 : r.fees) == null ? void 0 : a.maxPriorityFeePerGas) ?? ((i = r == null ? void 0 : r.fees) == null ? void 0 : i.defaultPriorityFee);
|
|
4905
4905
|
if (typeof o == "function") {
|
|
4906
|
-
const c = n || await
|
|
4906
|
+
const c = n || await Z(t, Qt, "getBlock")({}), d = await o({
|
|
4907
4907
|
block: c,
|
|
4908
4908
|
client: t,
|
|
4909
4909
|
request: s
|
|
@@ -4920,8 +4920,8 @@ async function Zo(t, e) {
|
|
|
4920
4920
|
return gt(u);
|
|
4921
4921
|
} catch {
|
|
4922
4922
|
const [o, u] = await Promise.all([
|
|
4923
|
-
n ? Promise.resolve(n) :
|
|
4924
|
-
|
|
4923
|
+
n ? Promise.resolve(n) : Z(t, Qt, "getBlock")({}),
|
|
4924
|
+
Z(t, vs, "getGasPrice")({})
|
|
4925
4925
|
]);
|
|
4926
4926
|
if (typeof o.baseFeePerGas != "bigint")
|
|
4927
4927
|
throw new or();
|
|
@@ -4932,16 +4932,16 @@ async function Zo(t, e) {
|
|
|
4932
4932
|
async function Cr(t, e) {
|
|
4933
4933
|
var f, m;
|
|
4934
4934
|
const { block: n, chain: r = t.chain, request: s, type: a = "eip1559" } = e || {}, i = await (async () => {
|
|
4935
|
-
var v,
|
|
4935
|
+
var v, $;
|
|
4936
4936
|
return typeof ((v = r == null ? void 0 : r.fees) == null ? void 0 : v.baseFeeMultiplier) == "function" ? r.fees.baseFeeMultiplier({
|
|
4937
4937
|
block: n,
|
|
4938
4938
|
client: t,
|
|
4939
4939
|
request: s
|
|
4940
|
-
}) : ((
|
|
4940
|
+
}) : (($ = r == null ? void 0 : r.fees) == null ? void 0 : $.baseFeeMultiplier) ?? 1.2;
|
|
4941
4941
|
})();
|
|
4942
4942
|
if (i < 1)
|
|
4943
|
-
throw new
|
|
4944
|
-
const u = 10 ** (((f = i.toString().split(".")[1]) == null ? void 0 : f.length) ?? 0), c = (v) => v * BigInt(Math.ceil(i * u)) / BigInt(u), d = n || await
|
|
4943
|
+
throw new jo();
|
|
4944
|
+
const u = 10 ** (((f = i.toString().split(".")[1]) == null ? void 0 : f.length) ?? 0), c = (v) => v * BigInt(Math.ceil(i * u)) / BigInt(u), d = n || await Z(t, Qt, "getBlock")({});
|
|
4945
4945
|
if (typeof ((m = r == null ? void 0 : r.fees) == null ? void 0 : m.estimateFeesPerGas) == "function") {
|
|
4946
4946
|
const v = await r.fees.estimateFeesPerGas({
|
|
4947
4947
|
block: n,
|
|
@@ -4956,21 +4956,21 @@ async function Cr(t, e) {
|
|
|
4956
4956
|
if (a === "eip1559") {
|
|
4957
4957
|
if (typeof d.baseFeePerGas != "bigint")
|
|
4958
4958
|
throw new or();
|
|
4959
|
-
const v = typeof (s == null ? void 0 : s.maxPriorityFeePerGas) == "bigint" ? s.maxPriorityFeePerGas : await
|
|
4959
|
+
const v = typeof (s == null ? void 0 : s.maxPriorityFeePerGas) == "bigint" ? s.maxPriorityFeePerGas : await Lo(t, {
|
|
4960
4960
|
block: d,
|
|
4961
4961
|
chain: r,
|
|
4962
4962
|
request: s
|
|
4963
|
-
}),
|
|
4963
|
+
}), $ = c(d.baseFeePerGas);
|
|
4964
4964
|
return {
|
|
4965
|
-
maxFeePerGas: (s == null ? void 0 : s.maxFeePerGas) ??
|
|
4965
|
+
maxFeePerGas: (s == null ? void 0 : s.maxFeePerGas) ?? $ + v,
|
|
4966
4966
|
maxPriorityFeePerGas: v
|
|
4967
4967
|
};
|
|
4968
4968
|
}
|
|
4969
4969
|
return {
|
|
4970
|
-
gasPrice: (s == null ? void 0 : s.gasPrice) ?? c(await
|
|
4970
|
+
gasPrice: (s == null ? void 0 : s.gasPrice) ?? c(await Z(t, vs, "getGasPrice")({}))
|
|
4971
4971
|
};
|
|
4972
4972
|
}
|
|
4973
|
-
class
|
|
4973
|
+
class Vo extends y {
|
|
4974
4974
|
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to: l, value: f }) {
|
|
4975
4975
|
var v;
|
|
4976
4976
|
const m = Ft({
|
|
@@ -5001,35 +5001,35 @@ class Do extends y {
|
|
|
5001
5001
|
}), this.cause = e;
|
|
5002
5002
|
}
|
|
5003
5003
|
}
|
|
5004
|
-
function
|
|
5004
|
+
function Uo(t, { docsPath: e, ...n }) {
|
|
5005
5005
|
const r = (() => {
|
|
5006
5006
|
const s = sr(t, n);
|
|
5007
5007
|
return s instanceof on ? t : s;
|
|
5008
5008
|
})();
|
|
5009
|
-
return new
|
|
5009
|
+
return new Vo(r, {
|
|
5010
5010
|
docsPath: e,
|
|
5011
5011
|
...n
|
|
5012
5012
|
});
|
|
5013
5013
|
}
|
|
5014
|
-
class
|
|
5014
|
+
class Go extends y {
|
|
5015
5015
|
constructor({ address: e }) {
|
|
5016
5016
|
super(`State for account "${e}" is set multiple times.`, {
|
|
5017
5017
|
name: "AccountStateConflictError"
|
|
5018
5018
|
});
|
|
5019
5019
|
}
|
|
5020
5020
|
}
|
|
5021
|
-
class
|
|
5021
|
+
class qo extends y {
|
|
5022
5022
|
constructor() {
|
|
5023
5023
|
super("state and stateDiff are set on the same account.", {
|
|
5024
5024
|
name: "StateAssignmentConflictError"
|
|
5025
5025
|
});
|
|
5026
5026
|
}
|
|
5027
5027
|
}
|
|
5028
|
-
function
|
|
5028
|
+
function Tr(t) {
|
|
5029
5029
|
return t.reduce((e, { slot: n, value: r }) => `${e} ${n}: ${r}
|
|
5030
5030
|
`, "");
|
|
5031
5031
|
}
|
|
5032
|
-
function
|
|
5032
|
+
function Wo(t) {
|
|
5033
5033
|
return t.reduce((e, { address: n, ...r }) => {
|
|
5034
5034
|
let s = `${e} ${n}:
|
|
5035
5035
|
`;
|
|
@@ -5037,12 +5037,12 @@ function Ho(t) {
|
|
|
5037
5037
|
`), r.balance && (s += ` balance: ${r.balance}
|
|
5038
5038
|
`), r.code && (s += ` code: ${r.code}
|
|
5039
5039
|
`), r.state && (s += ` state:
|
|
5040
|
-
`, s +=
|
|
5041
|
-
`, s +=
|
|
5040
|
+
`, s += Tr(r.state)), r.stateDiff && (s += ` stateDiff:
|
|
5041
|
+
`, s += Tr(r.stateDiff)), s;
|
|
5042
5042
|
}, ` State Override:
|
|
5043
5043
|
`).slice(0, -1);
|
|
5044
5044
|
}
|
|
5045
|
-
function
|
|
5045
|
+
function $r(t) {
|
|
5046
5046
|
if (!(!t || t.length === 0))
|
|
5047
5047
|
return t.reduce((e, { slot: n, value: r }) => {
|
|
5048
5048
|
if (n.length !== 66)
|
|
@@ -5060,12 +5060,12 @@ function Tr(t) {
|
|
|
5060
5060
|
return e[n] = r, e;
|
|
5061
5061
|
}, {});
|
|
5062
5062
|
}
|
|
5063
|
-
function
|
|
5063
|
+
function Ho(t) {
|
|
5064
5064
|
const { balance: e, nonce: n, state: r, stateDiff: s, code: a } = t, i = {};
|
|
5065
|
-
if (a !== void 0 && (i.code = a), e !== void 0 && (i.balance =
|
|
5065
|
+
if (a !== void 0 && (i.code = a), e !== void 0 && (i.balance = M(e)), n !== void 0 && (i.nonce = M(n)), r !== void 0 && (i.state = $r(r)), s !== void 0) {
|
|
5066
5066
|
if (i.state)
|
|
5067
|
-
throw new
|
|
5068
|
-
i.stateDiff =
|
|
5067
|
+
throw new qo();
|
|
5068
|
+
i.stateDiff = $r(s);
|
|
5069
5069
|
}
|
|
5070
5070
|
return i;
|
|
5071
5071
|
}
|
|
@@ -5077,37 +5077,37 @@ function ws(t) {
|
|
|
5077
5077
|
if (!Ee(n, { strict: !1 }))
|
|
5078
5078
|
throw new vt({ address: n });
|
|
5079
5079
|
if (e[n])
|
|
5080
|
-
throw new
|
|
5081
|
-
e[n] =
|
|
5080
|
+
throw new Go({ address: n });
|
|
5081
|
+
e[n] = Ho(r);
|
|
5082
5082
|
}
|
|
5083
5083
|
return e;
|
|
5084
5084
|
}
|
|
5085
|
-
async function
|
|
5086
|
-
const s = n ?
|
|
5085
|
+
async function Ko(t, { address: e, blockNumber: n, blockTag: r = "latest" }) {
|
|
5086
|
+
const s = n ? M(n) : void 0, a = await t.request({
|
|
5087
5087
|
method: "eth_getBalance",
|
|
5088
5088
|
params: [e, s || r]
|
|
5089
5089
|
});
|
|
5090
5090
|
return BigInt(a);
|
|
5091
5091
|
}
|
|
5092
|
-
async function
|
|
5092
|
+
async function Jo(t, e) {
|
|
5093
5093
|
var s, a, i;
|
|
5094
5094
|
const { account: n = t.account } = e, r = n ? ue(n) : void 0;
|
|
5095
5095
|
try {
|
|
5096
5096
|
let de = function(V) {
|
|
5097
|
-
const { block: X, request: J, rpcStateOverride:
|
|
5097
|
+
const { block: X, request: J, rpcStateOverride: Te } = V;
|
|
5098
5098
|
return t.request({
|
|
5099
5099
|
method: "eth_estimateGas",
|
|
5100
|
-
params:
|
|
5100
|
+
params: Te ? [J, X ?? "latest", Te] : X ? [J, X] : [J]
|
|
5101
5101
|
});
|
|
5102
5102
|
};
|
|
5103
|
-
const { accessList: o, authorizationList: u, blobs: c, blobVersionedHashes: d, blockNumber: l, blockTag: f, data: m, gas: v, gasPrice:
|
|
5103
|
+
const { accessList: o, authorizationList: u, blobs: c, blobVersionedHashes: d, blockNumber: l, blockTag: f, data: m, gas: v, gasPrice: $, maxFeePerBlobGas: P, maxFeePerGas: S, maxPriorityFeePerGas: R, nonce: A, value: O, stateOverride: H, ...F } = await Cs(t, {
|
|
5104
5104
|
...e,
|
|
5105
5105
|
parameters: (
|
|
5106
5106
|
// Some RPC Providers do not compute versioned hashes from blobs. We will need
|
|
5107
5107
|
// to compute them.
|
|
5108
5108
|
(r == null ? void 0 : r.type) === "local" ? void 0 : ["blobVersionedHashes"]
|
|
5109
5109
|
)
|
|
5110
|
-
}), re = (l ?
|
|
5110
|
+
}), re = (l ? M(l) : void 0) || f, C = ws(H), B = await (async () => {
|
|
5111
5111
|
if (F.to)
|
|
5112
5112
|
return F.to;
|
|
5113
5113
|
if (u && u.length > 0)
|
|
@@ -5128,47 +5128,47 @@ async function Ko(t, e) {
|
|
|
5128
5128
|
blobVersionedHashes: d,
|
|
5129
5129
|
data: m,
|
|
5130
5130
|
gas: v,
|
|
5131
|
-
gasPrice:
|
|
5131
|
+
gasPrice: $,
|
|
5132
5132
|
maxFeePerBlobGas: P,
|
|
5133
5133
|
maxFeePerGas: S,
|
|
5134
5134
|
maxPriorityFeePerGas: R,
|
|
5135
5135
|
nonce: A,
|
|
5136
5136
|
to: B,
|
|
5137
|
-
value:
|
|
5137
|
+
value: O
|
|
5138
5138
|
});
|
|
5139
5139
|
let se = BigInt(await de({ block: re, request: K, rpcStateOverride: C }));
|
|
5140
5140
|
if (u) {
|
|
5141
|
-
const V = await
|
|
5142
|
-
const { contractAddress:
|
|
5141
|
+
const V = await Ko(t, { address: K.from }), X = await Promise.all(u.map(async (J) => {
|
|
5142
|
+
const { contractAddress: Te } = J, Be = await de({
|
|
5143
5143
|
block: re,
|
|
5144
5144
|
request: {
|
|
5145
5145
|
authorizationList: void 0,
|
|
5146
5146
|
data: m,
|
|
5147
5147
|
from: r == null ? void 0 : r.address,
|
|
5148
|
-
to:
|
|
5149
|
-
value:
|
|
5148
|
+
to: Te,
|
|
5149
|
+
value: M(V)
|
|
5150
5150
|
},
|
|
5151
5151
|
rpcStateOverride: C
|
|
5152
5152
|
}).catch(() => 100000n);
|
|
5153
5153
|
return 2n * BigInt(Be);
|
|
5154
5154
|
}));
|
|
5155
|
-
se += X.reduce((J,
|
|
5155
|
+
se += X.reduce((J, Te) => J + Te, 0n);
|
|
5156
5156
|
}
|
|
5157
5157
|
return se;
|
|
5158
5158
|
} catch (o) {
|
|
5159
|
-
throw
|
|
5159
|
+
throw Uo(o, {
|
|
5160
5160
|
...e,
|
|
5161
5161
|
account: r,
|
|
5162
5162
|
chain: t.chain
|
|
5163
5163
|
});
|
|
5164
5164
|
}
|
|
5165
5165
|
}
|
|
5166
|
-
async function
|
|
5166
|
+
async function Yo(t, { address: e, blockTag: n = "latest", blockNumber: r }) {
|
|
5167
5167
|
const s = await t.request({
|
|
5168
5168
|
method: "eth_getTransactionCount",
|
|
5169
|
-
params: [e, r ?
|
|
5169
|
+
params: [e, r ? M(r) : n]
|
|
5170
5170
|
}, { dedupe: !!r });
|
|
5171
|
-
return
|
|
5171
|
+
return qe(s);
|
|
5172
5172
|
}
|
|
5173
5173
|
function xs(t) {
|
|
5174
5174
|
const { kzg: e } = t, n = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), r = typeof t.blobs[0] == "string" ? t.blobs.map((a) => ye(a)) : t.blobs, s = [];
|
|
@@ -5184,27 +5184,27 @@ function _s(t) {
|
|
|
5184
5184
|
}
|
|
5185
5185
|
return n === "bytes" ? a : a.map((i) => G(i));
|
|
5186
5186
|
}
|
|
5187
|
-
function
|
|
5188
|
-
return
|
|
5187
|
+
function Xo(t, e) {
|
|
5188
|
+
return ha(Pe(t, { strict: !1 }) ? Kn(t) : t);
|
|
5189
5189
|
}
|
|
5190
|
-
function
|
|
5191
|
-
const { commitment: e, version: n = 1 } = t, r = t.to ?? (typeof e == "string" ? "hex" : "bytes"), s =
|
|
5190
|
+
function Qo(t) {
|
|
5191
|
+
const { commitment: e, version: n = 1 } = t, r = t.to ?? (typeof e == "string" ? "hex" : "bytes"), s = Xo(e);
|
|
5192
5192
|
return s.set([n], 0), r === "bytes" ? s : G(s);
|
|
5193
5193
|
}
|
|
5194
|
-
function
|
|
5194
|
+
function ec(t) {
|
|
5195
5195
|
const { commitments: e, version: n } = t, r = t.to ?? (typeof e[0] == "string" ? "hex" : "bytes"), s = [];
|
|
5196
5196
|
for (const a of e)
|
|
5197
|
-
s.push(
|
|
5197
|
+
s.push(Qo({
|
|
5198
5198
|
commitment: a,
|
|
5199
5199
|
to: r,
|
|
5200
5200
|
version: n
|
|
5201
5201
|
}));
|
|
5202
5202
|
return s;
|
|
5203
5203
|
}
|
|
5204
|
-
const
|
|
5204
|
+
const kr = 6, Ps = 32, cr = 4096, Es = Ps * cr, Ir = Es * kr - // terminator byte (0x80).
|
|
5205
5205
|
1 - // zero byte (0x00) appended to each field element.
|
|
5206
|
-
1 * cr *
|
|
5207
|
-
class
|
|
5206
|
+
1 * cr * kr;
|
|
5207
|
+
class tc extends y {
|
|
5208
5208
|
constructor({ maxSize: e, size: n }) {
|
|
5209
5209
|
super("Blob size is too large.", {
|
|
5210
5210
|
metaMessages: [`Max: ${e} bytes`, `Given: ${n} bytes`],
|
|
@@ -5212,17 +5212,17 @@ class ec extends y {
|
|
|
5212
5212
|
});
|
|
5213
5213
|
}
|
|
5214
5214
|
}
|
|
5215
|
-
class
|
|
5215
|
+
class nc extends y {
|
|
5216
5216
|
constructor() {
|
|
5217
5217
|
super("Blob data must not be empty.", { name: "EmptyBlobError" });
|
|
5218
5218
|
}
|
|
5219
5219
|
}
|
|
5220
|
-
function
|
|
5220
|
+
function rc(t) {
|
|
5221
5221
|
const e = t.to ?? (typeof t.data == "string" ? "hex" : "bytes"), n = typeof t.data == "string" ? ye(t.data) : t.data, r = N(n);
|
|
5222
5222
|
if (!r)
|
|
5223
|
-
throw new
|
|
5223
|
+
throw new nc();
|
|
5224
5224
|
if (r > Ir)
|
|
5225
|
-
throw new
|
|
5225
|
+
throw new tc({
|
|
5226
5226
|
maxSize: Ir,
|
|
5227
5227
|
size: r
|
|
5228
5228
|
});
|
|
@@ -5243,8 +5243,8 @@ function nc(t) {
|
|
|
5243
5243
|
}
|
|
5244
5244
|
return e === "bytes" ? s.map((o) => o.bytes) : s.map((o) => G(o.bytes));
|
|
5245
5245
|
}
|
|
5246
|
-
function
|
|
5247
|
-
const { data: e, kzg: n, to: r } = t, s = t.blobs ??
|
|
5246
|
+
function sc(t) {
|
|
5247
|
+
const { data: e, kzg: n, to: r } = t, s = t.blobs ?? rc({ data: e, to: r }), a = t.commitments ?? xs({ blobs: s, kzg: n, to: r }), i = t.proofs ?? _s({ blobs: s, commitments: a, kzg: n, to: r }), o = [];
|
|
5248
5248
|
for (let u = 0; u < s.length; u++)
|
|
5249
5249
|
o.push({
|
|
5250
5250
|
blob: s[u],
|
|
@@ -5253,7 +5253,7 @@ function rc(t) {
|
|
|
5253
5253
|
});
|
|
5254
5254
|
return o;
|
|
5255
5255
|
}
|
|
5256
|
-
function
|
|
5256
|
+
function ac(t) {
|
|
5257
5257
|
if (t.type)
|
|
5258
5258
|
return t.type;
|
|
5259
5259
|
if (typeof t.authorizationList < "u")
|
|
@@ -5264,7 +5264,7 @@ function sc(t) {
|
|
|
5264
5264
|
return "eip1559";
|
|
5265
5265
|
if (typeof t.gasPrice < "u")
|
|
5266
5266
|
return typeof t.accessList < "u" ? "eip2930" : "legacy";
|
|
5267
|
-
throw new
|
|
5267
|
+
throw new Co({ transaction: t });
|
|
5268
5268
|
}
|
|
5269
5269
|
const As = [
|
|
5270
5270
|
"blobVersionedHashes",
|
|
@@ -5278,23 +5278,23 @@ async function Cs(t, e) {
|
|
|
5278
5278
|
const { account: n = t.account, blobs: r, chain: s, gas: a, kzg: i, nonce: o, nonceManager: u, parameters: c = As, type: d } = e, l = n && ue(n), f = { ...e, ...l ? { from: l == null ? void 0 : l.address } : {} };
|
|
5279
5279
|
let m;
|
|
5280
5280
|
async function v() {
|
|
5281
|
-
return m || (m = await
|
|
5281
|
+
return m || (m = await Z(t, Qt, "getBlock")({ blockTag: "latest" }), m);
|
|
5282
5282
|
}
|
|
5283
|
-
let
|
|
5283
|
+
let $;
|
|
5284
5284
|
async function P() {
|
|
5285
|
-
return
|
|
5285
|
+
return $ || (s ? s.id : typeof e.chainId < "u" ? e.chainId : ($ = await Z(t, gs, "getChainId")({}), $));
|
|
5286
5286
|
}
|
|
5287
5287
|
if ((c.includes("blobVersionedHashes") || c.includes("sidecars")) && r && i) {
|
|
5288
5288
|
const S = xs({ blobs: r, kzg: i });
|
|
5289
5289
|
if (c.includes("blobVersionedHashes")) {
|
|
5290
|
-
const R =
|
|
5290
|
+
const R = ec({
|
|
5291
5291
|
commitments: S,
|
|
5292
5292
|
to: "hex"
|
|
5293
5293
|
});
|
|
5294
5294
|
f.blobVersionedHashes = R;
|
|
5295
5295
|
}
|
|
5296
5296
|
if (c.includes("sidecars")) {
|
|
5297
|
-
const R = _s({ blobs: r, commitments: S, kzg: i }), A =
|
|
5297
|
+
const R = _s({ blobs: r, commitments: S, kzg: i }), A = sc({
|
|
5298
5298
|
blobs: r,
|
|
5299
5299
|
commitments: S,
|
|
5300
5300
|
proofs: R,
|
|
@@ -5312,13 +5312,13 @@ async function Cs(t, e) {
|
|
|
5312
5312
|
client: t
|
|
5313
5313
|
});
|
|
5314
5314
|
} else
|
|
5315
|
-
f.nonce = await
|
|
5315
|
+
f.nonce = await Z(t, Yo, "getTransactionCount")({
|
|
5316
5316
|
address: l.address,
|
|
5317
5317
|
blockTag: "pending"
|
|
5318
5318
|
});
|
|
5319
5319
|
if ((c.includes("fees") || c.includes("type")) && typeof d > "u")
|
|
5320
5320
|
try {
|
|
5321
|
-
f.type =
|
|
5321
|
+
f.type = ac(f);
|
|
5322
5322
|
} catch {
|
|
5323
5323
|
const S = await v();
|
|
5324
5324
|
f.type = typeof (S == null ? void 0 : S.baseFeePerGas) == "bigint" ? "eip1559" : "legacy";
|
|
@@ -5332,7 +5332,7 @@ async function Cs(t, e) {
|
|
|
5332
5332
|
request: f
|
|
5333
5333
|
});
|
|
5334
5334
|
if (typeof e.maxPriorityFeePerGas > "u" && e.maxFeePerGas && e.maxFeePerGas < A)
|
|
5335
|
-
throw new
|
|
5335
|
+
throw new Bo({
|
|
5336
5336
|
maxPriorityFeePerGas: A
|
|
5337
5337
|
});
|
|
5338
5338
|
f.maxPriorityFeePerGas = A, f.maxFeePerGas = R;
|
|
@@ -5348,21 +5348,21 @@ async function Cs(t, e) {
|
|
|
5348
5348
|
});
|
|
5349
5349
|
f.gasPrice = R;
|
|
5350
5350
|
}
|
|
5351
|
-
return c.includes("gas") && typeof a > "u" && (f.gas = await
|
|
5351
|
+
return c.includes("gas") && typeof a > "u" && (f.gas = await Z(t, Jo, "estimateGas")({
|
|
5352
5352
|
...f,
|
|
5353
5353
|
account: l && { address: l.address, type: "json-rpc" }
|
|
5354
5354
|
})), un(f), delete f.parameters, f;
|
|
5355
5355
|
}
|
|
5356
|
-
async function
|
|
5356
|
+
async function ic(t, { serializedTransaction: e }) {
|
|
5357
5357
|
return t.request({
|
|
5358
5358
|
method: "eth_sendRawTransaction",
|
|
5359
5359
|
params: [e]
|
|
5360
5360
|
}, { retryCount: 0 });
|
|
5361
5361
|
}
|
|
5362
5362
|
const vn = new sn(128);
|
|
5363
|
-
async function
|
|
5364
|
-
var S, R, A,
|
|
5365
|
-
const { account: n = t.account, chain: r = t.chain, accessList: s, authorizationList: a, blobs: i, data: o, gas: u, gasPrice: c, maxFeePerBlobGas: d, maxFeePerGas: l, maxPriorityFeePerGas: f, nonce: m, value: v,
|
|
5363
|
+
async function oc(t, e) {
|
|
5364
|
+
var S, R, A, O;
|
|
5365
|
+
const { account: n = t.account, chain: r = t.chain, accessList: s, authorizationList: a, blobs: i, data: o, gas: u, gasPrice: c, maxFeePerBlobGas: d, maxFeePerGas: l, maxPriorityFeePerGas: f, nonce: m, value: v, ...$ } = e;
|
|
5366
5366
|
if (typeof n > "u")
|
|
5367
5367
|
throw new us({
|
|
5368
5368
|
docsPath: "/docs/actions/wallet/sendTransaction"
|
|
@@ -5370,7 +5370,7 @@ async function ic(t, e) {
|
|
|
5370
5370
|
const P = n ? ue(n) : null;
|
|
5371
5371
|
try {
|
|
5372
5372
|
un(e);
|
|
5373
|
-
const
|
|
5373
|
+
const H = await (async () => {
|
|
5374
5374
|
if (e.to)
|
|
5375
5375
|
return e.to;
|
|
5376
5376
|
if (a && a.length > 0)
|
|
@@ -5382,13 +5382,13 @@ async function ic(t, e) {
|
|
|
5382
5382
|
})();
|
|
5383
5383
|
if ((P == null ? void 0 : P.type) === "json-rpc" || P === null) {
|
|
5384
5384
|
let F;
|
|
5385
|
-
r !== null && (F = await
|
|
5385
|
+
r !== null && (F = await Z(t, gs, "getChainId")({}), _o({
|
|
5386
5386
|
currentChainId: F,
|
|
5387
5387
|
chain: r
|
|
5388
5388
|
}));
|
|
5389
5389
|
const Y = (A = (R = (S = t.chain) == null ? void 0 : S.formatters) == null ? void 0 : R.transactionRequest) == null ? void 0 : A.format, C = (Y || ir)({
|
|
5390
5390
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
5391
|
-
...ar(
|
|
5391
|
+
...ar($, { format: Y }),
|
|
5392
5392
|
accessList: s,
|
|
5393
5393
|
authorizationList: a,
|
|
5394
5394
|
blobs: i,
|
|
@@ -5401,7 +5401,7 @@ async function ic(t, e) {
|
|
|
5401
5401
|
maxFeePerGas: l,
|
|
5402
5402
|
maxPriorityFeePerGas: f,
|
|
5403
5403
|
nonce: m,
|
|
5404
|
-
to:
|
|
5404
|
+
to: H,
|
|
5405
5405
|
value: v
|
|
5406
5406
|
}), B = vn.get(t.uid), Ce = B ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
5407
5407
|
try {
|
|
@@ -5425,7 +5425,7 @@ async function ic(t, e) {
|
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
5427
5427
|
if ((P == null ? void 0 : P.type) === "local") {
|
|
5428
|
-
const F = await
|
|
5428
|
+
const F = await Z(t, Cs, "prepareTransactionRequest")({
|
|
5429
5429
|
account: P,
|
|
5430
5430
|
accessList: s,
|
|
5431
5431
|
authorizationList: a,
|
|
@@ -5441,12 +5441,12 @@ async function ic(t, e) {
|
|
|
5441
5441
|
nonceManager: P.nonceManager,
|
|
5442
5442
|
parameters: [...As, "sidecars"],
|
|
5443
5443
|
value: v,
|
|
5444
|
-
|
|
5445
|
-
to:
|
|
5446
|
-
}), Y = (
|
|
5444
|
+
...$,
|
|
5445
|
+
to: H
|
|
5446
|
+
}), Y = (O = r == null ? void 0 : r.serializers) == null ? void 0 : O.transaction, re = await P.signTransaction(F, {
|
|
5447
5447
|
serializer: Y
|
|
5448
5448
|
});
|
|
5449
|
-
return await
|
|
5449
|
+
return await Z(t, ic, "sendRawTransaction")({
|
|
5450
5450
|
serializedTransaction: re
|
|
5451
5451
|
});
|
|
5452
5452
|
}
|
|
@@ -5460,8 +5460,8 @@ async function ic(t, e) {
|
|
|
5460
5460
|
docsPath: "/docs/actions/wallet/sendTransaction",
|
|
5461
5461
|
type: P == null ? void 0 : P.type
|
|
5462
5462
|
});
|
|
5463
|
-
} catch (
|
|
5464
|
-
throw
|
|
5463
|
+
} catch (H) {
|
|
5464
|
+
throw H instanceof gn ? H : So(H, {
|
|
5465
5465
|
...e,
|
|
5466
5466
|
account: P,
|
|
5467
5467
|
chain: e.chain || void 0
|
|
@@ -5511,32 +5511,32 @@ const Sr = [
|
|
|
5511
5511
|
type: "function"
|
|
5512
5512
|
}
|
|
5513
5513
|
];
|
|
5514
|
-
function
|
|
5514
|
+
function cc(t, e = {}) {
|
|
5515
5515
|
typeof e.size < "u" && ce(t, { size: e.size });
|
|
5516
5516
|
const n = G(t, e);
|
|
5517
5517
|
return gt(n, e);
|
|
5518
5518
|
}
|
|
5519
|
-
function
|
|
5519
|
+
function uc(t, e = {}) {
|
|
5520
5520
|
let n = t;
|
|
5521
|
-
if (typeof e.size < "u" && (ce(n, { size: e.size }), n =
|
|
5522
|
-
throw new
|
|
5521
|
+
if (typeof e.size < "u" && (ce(n, { size: e.size }), n = Hn(n)), n.length > 1 || n[0] > 1)
|
|
5522
|
+
throw new Ii(n);
|
|
5523
5523
|
return !!n[0];
|
|
5524
5524
|
}
|
|
5525
5525
|
function pe(t, e = {}) {
|
|
5526
5526
|
typeof e.size < "u" && ce(t, { size: e.size });
|
|
5527
5527
|
const n = G(t, e);
|
|
5528
|
-
return
|
|
5528
|
+
return qe(n, e);
|
|
5529
5529
|
}
|
|
5530
|
-
function
|
|
5530
|
+
function dc(t, e = {}) {
|
|
5531
5531
|
let n = t;
|
|
5532
|
-
return typeof e.size < "u" && (ce(n, { size: e.size }), n =
|
|
5532
|
+
return typeof e.size < "u" && (ce(n, { size: e.size }), n = Hn(n, { dir: "right" })), new TextDecoder().decode(n);
|
|
5533
5533
|
}
|
|
5534
|
-
function
|
|
5534
|
+
function Ts(t, e) {
|
|
5535
5535
|
const n = typeof e == "string" ? ye(e) : e, r = nr(n);
|
|
5536
5536
|
if (N(n) === 0 && t.length > 0)
|
|
5537
5537
|
throw new Xn();
|
|
5538
5538
|
if (N(e) && N(e) < 32)
|
|
5539
|
-
throw new
|
|
5539
|
+
throw new Zi({
|
|
5540
5540
|
data: typeof e == "string" ? e : G(e),
|
|
5541
5541
|
params: t,
|
|
5542
5542
|
size: N(e)
|
|
@@ -5546,61 +5546,61 @@ function ks(t, e) {
|
|
|
5546
5546
|
for (let i = 0; i < t.length; ++i) {
|
|
5547
5547
|
const o = t[i];
|
|
5548
5548
|
r.setPosition(s);
|
|
5549
|
-
const [u, c] =
|
|
5549
|
+
const [u, c] = Le(r, o, {
|
|
5550
5550
|
staticPosition: 0
|
|
5551
5551
|
});
|
|
5552
5552
|
s += c, a.push(u);
|
|
5553
5553
|
}
|
|
5554
5554
|
return a;
|
|
5555
5555
|
}
|
|
5556
|
-
function
|
|
5556
|
+
function Le(t, e, { staticPosition: n }) {
|
|
5557
5557
|
const r = tr(e.type);
|
|
5558
5558
|
if (r) {
|
|
5559
5559
|
const [s, a] = r;
|
|
5560
|
-
return
|
|
5560
|
+
return fc(t, { ...e, type: a }, { length: s, staticPosition: n });
|
|
5561
5561
|
}
|
|
5562
5562
|
if (e.type === "tuple")
|
|
5563
|
-
return
|
|
5563
|
+
return yc(t, e, { staticPosition: n });
|
|
5564
5564
|
if (e.type === "address")
|
|
5565
|
-
return
|
|
5565
|
+
return lc(t);
|
|
5566
5566
|
if (e.type === "bool")
|
|
5567
|
-
return
|
|
5567
|
+
return hc(t);
|
|
5568
5568
|
if (e.type.startsWith("bytes"))
|
|
5569
|
-
return
|
|
5569
|
+
return pc(t, e, { staticPosition: n });
|
|
5570
5570
|
if (e.type.startsWith("uint") || e.type.startsWith("int"))
|
|
5571
|
-
return
|
|
5571
|
+
return mc(t, e);
|
|
5572
5572
|
if (e.type === "string")
|
|
5573
|
-
return
|
|
5574
|
-
throw new
|
|
5573
|
+
return bc(t, { staticPosition: n });
|
|
5574
|
+
throw new Wi(e.type, {
|
|
5575
5575
|
docsPath: "/docs/contract/decodeAbiParameters"
|
|
5576
5576
|
});
|
|
5577
5577
|
}
|
|
5578
|
-
const Rr = 32,
|
|
5579
|
-
function
|
|
5578
|
+
const Rr = 32, Dn = 32;
|
|
5579
|
+
function lc(t) {
|
|
5580
5580
|
const e = t.readBytes(32);
|
|
5581
5581
|
return [an(G(is(e, -20))), 32];
|
|
5582
5582
|
}
|
|
5583
|
-
function
|
|
5583
|
+
function fc(t, e, { length: n, staticPosition: r }) {
|
|
5584
5584
|
if (!n) {
|
|
5585
|
-
const i = pe(t.readBytes(
|
|
5585
|
+
const i = pe(t.readBytes(Dn)), o = r + i, u = o + Rr;
|
|
5586
5586
|
t.setPosition(o);
|
|
5587
5587
|
const c = pe(t.readBytes(Rr)), d = jt(e);
|
|
5588
5588
|
let l = 0;
|
|
5589
5589
|
const f = [];
|
|
5590
5590
|
for (let m = 0; m < c; ++m) {
|
|
5591
5591
|
t.setPosition(u + (d ? m * 32 : l));
|
|
5592
|
-
const [v,
|
|
5592
|
+
const [v, $] = Le(t, e, {
|
|
5593
5593
|
staticPosition: u
|
|
5594
5594
|
});
|
|
5595
|
-
l +=
|
|
5595
|
+
l += $, f.push(v);
|
|
5596
5596
|
}
|
|
5597
5597
|
return t.setPosition(r + 32), [f, 32];
|
|
5598
5598
|
}
|
|
5599
5599
|
if (jt(e)) {
|
|
5600
|
-
const i = pe(t.readBytes(
|
|
5600
|
+
const i = pe(t.readBytes(Dn)), o = r + i, u = [];
|
|
5601
5601
|
for (let c = 0; c < n; ++c) {
|
|
5602
5602
|
t.setPosition(o + c * 32);
|
|
5603
|
-
const [d] =
|
|
5603
|
+
const [d] = Le(t, e, {
|
|
5604
5604
|
staticPosition: o
|
|
5605
5605
|
});
|
|
5606
5606
|
u.push(d);
|
|
@@ -5610,17 +5610,17 @@ function lc(t, e, { length: n, staticPosition: r }) {
|
|
|
5610
5610
|
let s = 0;
|
|
5611
5611
|
const a = [];
|
|
5612
5612
|
for (let i = 0; i < n; ++i) {
|
|
5613
|
-
const [o, u] =
|
|
5613
|
+
const [o, u] = Le(t, e, {
|
|
5614
5614
|
staticPosition: r + s
|
|
5615
5615
|
});
|
|
5616
5616
|
s += u, a.push(o);
|
|
5617
5617
|
}
|
|
5618
5618
|
return [a, s];
|
|
5619
5619
|
}
|
|
5620
|
-
function
|
|
5621
|
-
return [
|
|
5620
|
+
function hc(t) {
|
|
5621
|
+
return [uc(t.readBytes(32), { size: 32 }), 32];
|
|
5622
5622
|
}
|
|
5623
|
-
function
|
|
5623
|
+
function pc(t, e, { staticPosition: n }) {
|
|
5624
5624
|
const [r, s] = e.type.split("bytes");
|
|
5625
5625
|
if (!s) {
|
|
5626
5626
|
const i = pe(t.readBytes(32));
|
|
@@ -5633,22 +5633,22 @@ function hc(t, e, { staticPosition: n }) {
|
|
|
5633
5633
|
}
|
|
5634
5634
|
return [G(t.readBytes(Number.parseInt(s), 32)), 32];
|
|
5635
5635
|
}
|
|
5636
|
-
function
|
|
5636
|
+
function mc(t, e) {
|
|
5637
5637
|
const n = e.type.startsWith("int"), r = Number.parseInt(e.type.split("int")[1] || "256"), s = t.readBytes(32);
|
|
5638
5638
|
return [
|
|
5639
|
-
r > 48 ?
|
|
5639
|
+
r > 48 ? cc(s, { signed: n }) : pe(s, { signed: n }),
|
|
5640
5640
|
32
|
|
5641
5641
|
];
|
|
5642
5642
|
}
|
|
5643
|
-
function
|
|
5643
|
+
function yc(t, e, { staticPosition: n }) {
|
|
5644
5644
|
const r = e.components.length === 0 || e.components.some(({ name: i }) => !i), s = r ? [] : {};
|
|
5645
5645
|
let a = 0;
|
|
5646
5646
|
if (jt(e)) {
|
|
5647
|
-
const i = pe(t.readBytes(
|
|
5647
|
+
const i = pe(t.readBytes(Dn)), o = n + i;
|
|
5648
5648
|
for (let u = 0; u < e.components.length; ++u) {
|
|
5649
5649
|
const c = e.components[u];
|
|
5650
5650
|
t.setPosition(o + a);
|
|
5651
|
-
const [d, l] =
|
|
5651
|
+
const [d, l] = Le(t, c, {
|
|
5652
5652
|
staticPosition: o
|
|
5653
5653
|
});
|
|
5654
5654
|
a += l, s[r ? u : c == null ? void 0 : c.name] = d;
|
|
@@ -5656,20 +5656,20 @@ function mc(t, e, { staticPosition: n }) {
|
|
|
5656
5656
|
return t.setPosition(n + 32), [s, 32];
|
|
5657
5657
|
}
|
|
5658
5658
|
for (let i = 0; i < e.components.length; ++i) {
|
|
5659
|
-
const o = e.components[i], [u, c] =
|
|
5659
|
+
const o = e.components[i], [u, c] = Le(t, o, {
|
|
5660
5660
|
staticPosition: n
|
|
5661
5661
|
});
|
|
5662
5662
|
s[r ? i : o == null ? void 0 : o.name] = u, a += c;
|
|
5663
5663
|
}
|
|
5664
5664
|
return [s, a];
|
|
5665
5665
|
}
|
|
5666
|
-
function
|
|
5666
|
+
function bc(t, { staticPosition: e }) {
|
|
5667
5667
|
const n = pe(t.readBytes(32)), r = e + n;
|
|
5668
5668
|
t.setPosition(r);
|
|
5669
5669
|
const s = pe(t.readBytes(32));
|
|
5670
5670
|
if (s === 0)
|
|
5671
5671
|
return t.setPosition(e + 32), ["", 32];
|
|
5672
|
-
const a = t.readBytes(s, 32), i =
|
|
5672
|
+
const a = t.readBytes(s, 32), i = dc(Hn(a));
|
|
5673
5673
|
return t.setPosition(e + 32), [i, 32];
|
|
5674
5674
|
}
|
|
5675
5675
|
function jt(t) {
|
|
@@ -5682,21 +5682,21 @@ function jt(t) {
|
|
|
5682
5682
|
const n = tr(t.type);
|
|
5683
5683
|
return !!(n && jt({ ...t, type: n[1] }));
|
|
5684
5684
|
}
|
|
5685
|
-
const
|
|
5686
|
-
function
|
|
5687
|
-
return
|
|
5685
|
+
const gc = (t) => Nt(Kn(t));
|
|
5686
|
+
function vc(t) {
|
|
5687
|
+
return gc(t);
|
|
5688
5688
|
}
|
|
5689
|
-
const
|
|
5690
|
-
class
|
|
5689
|
+
const wc = "1.0.7";
|
|
5690
|
+
class L extends Error {
|
|
5691
5691
|
constructor(e, n = {}) {
|
|
5692
5692
|
var i;
|
|
5693
|
-
const r = n.cause instanceof
|
|
5693
|
+
const r = n.cause instanceof L ? n.cause.details : (i = n.cause) != null && i.message ? n.cause.message : n.details, s = n.cause instanceof L && n.cause.docsPath || n.docsPath, a = [
|
|
5694
5694
|
e || "An error occurred.",
|
|
5695
5695
|
"",
|
|
5696
5696
|
...n.metaMessages ? [...n.metaMessages, ""] : [],
|
|
5697
5697
|
...s ? [`Docs: https://abitype.dev${s}`] : [],
|
|
5698
5698
|
...r ? [`Details: ${r}`] : [],
|
|
5699
|
-
`Version: abitype@${
|
|
5699
|
+
`Version: abitype@${wc}`
|
|
5700
5700
|
].join(`
|
|
5701
5701
|
`);
|
|
5702
5702
|
super(a), Object.defineProperty(this, "details", {
|
|
@@ -5731,18 +5731,18 @@ function Ae(t, e) {
|
|
|
5731
5731
|
const n = t.exec(e);
|
|
5732
5732
|
return n == null ? void 0 : n.groups;
|
|
5733
5733
|
}
|
|
5734
|
-
const
|
|
5735
|
-
function
|
|
5734
|
+
const $s = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/, ks = /^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)?$/, Is = /^\(.+?\).*?$/, Mr = /^tuple(?<array>(\[(\d*)\])*)$/;
|
|
5735
|
+
function Ln(t) {
|
|
5736
5736
|
let e = t.type;
|
|
5737
|
-
if (
|
|
5737
|
+
if (Mr.test(t.type) && "components" in t) {
|
|
5738
5738
|
e = "(";
|
|
5739
5739
|
const n = t.components.length;
|
|
5740
5740
|
for (let s = 0; s < n; s++) {
|
|
5741
5741
|
const a = t.components[s];
|
|
5742
|
-
e +=
|
|
5742
|
+
e += Ln(a), s < n - 1 && (e += ", ");
|
|
5743
5743
|
}
|
|
5744
|
-
const r = Ae(
|
|
5745
|
-
return e += `)${(r == null ? void 0 : r.array) ?? ""}`,
|
|
5744
|
+
const r = Ae(Mr, t.type);
|
|
5745
|
+
return e += `)${(r == null ? void 0 : r.array) ?? ""}`, Ln({
|
|
5746
5746
|
...t,
|
|
5747
5747
|
type: e
|
|
5748
5748
|
});
|
|
@@ -5754,63 +5754,63 @@ function Qe(t) {
|
|
|
5754
5754
|
const n = t.length;
|
|
5755
5755
|
for (let r = 0; r < n; r++) {
|
|
5756
5756
|
const s = t[r];
|
|
5757
|
-
e +=
|
|
5757
|
+
e += Ln(s), r !== n - 1 && (e += ", ");
|
|
5758
5758
|
}
|
|
5759
5759
|
return e;
|
|
5760
5760
|
}
|
|
5761
|
-
function
|
|
5761
|
+
function xc(t) {
|
|
5762
5762
|
var e;
|
|
5763
5763
|
return t.type === "function" ? `function ${t.name}(${Qe(t.inputs)})${t.stateMutability && t.stateMutability !== "nonpayable" ? ` ${t.stateMutability}` : ""}${(e = t.outputs) != null && e.length ? ` returns (${Qe(t.outputs)})` : ""}` : t.type === "event" ? `event ${t.name}(${Qe(t.inputs)})` : t.type === "error" ? `error ${t.name}(${Qe(t.inputs)})` : t.type === "constructor" ? `constructor(${Qe(t.inputs)})${t.stateMutability === "payable" ? " payable" : ""}` : t.type === "fallback" ? `fallback() external${t.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
|
|
5764
5764
|
}
|
|
5765
5765
|
const Ss = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
5766
|
-
function
|
|
5766
|
+
function _c(t) {
|
|
5767
5767
|
return Ss.test(t);
|
|
5768
5768
|
}
|
|
5769
|
-
function
|
|
5769
|
+
function Pc(t) {
|
|
5770
5770
|
return Ae(Ss, t);
|
|
5771
5771
|
}
|
|
5772
5772
|
const Rs = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;
|
|
5773
|
-
function Pc(t) {
|
|
5774
|
-
return Rs.test(t);
|
|
5775
|
-
}
|
|
5776
5773
|
function Ec(t) {
|
|
5777
|
-
return
|
|
5774
|
+
return Rs.test(t);
|
|
5778
5775
|
}
|
|
5779
|
-
const Os = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
5780
5776
|
function Ac(t) {
|
|
5781
|
-
return
|
|
5777
|
+
return Ae(Rs, t);
|
|
5782
5778
|
}
|
|
5779
|
+
const Ms = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;
|
|
5783
5780
|
function Cc(t) {
|
|
5784
|
-
return Ae(Os, t);
|
|
5785
|
-
}
|
|
5786
|
-
const Ms = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
5787
|
-
function js(t) {
|
|
5788
5781
|
return Ms.test(t);
|
|
5789
5782
|
}
|
|
5790
|
-
function
|
|
5783
|
+
function Tc(t) {
|
|
5791
5784
|
return Ae(Ms, t);
|
|
5792
5785
|
}
|
|
5786
|
+
const Os = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;
|
|
5787
|
+
function js(t) {
|
|
5788
|
+
return Os.test(t);
|
|
5789
|
+
}
|
|
5790
|
+
function $c(t) {
|
|
5791
|
+
return Ae(Os, t);
|
|
5792
|
+
}
|
|
5793
5793
|
const Bs = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;
|
|
5794
|
-
function
|
|
5794
|
+
function kc(t) {
|
|
5795
5795
|
return Bs.test(t);
|
|
5796
5796
|
}
|
|
5797
|
-
function
|
|
5797
|
+
function Ic(t) {
|
|
5798
5798
|
return Ae(Bs, t);
|
|
5799
5799
|
}
|
|
5800
|
-
const
|
|
5801
|
-
function
|
|
5802
|
-
return
|
|
5800
|
+
const Sc = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;
|
|
5801
|
+
function Rc(t) {
|
|
5802
|
+
return Sc.test(t);
|
|
5803
5803
|
}
|
|
5804
|
-
const
|
|
5804
|
+
const Mc = /^receive\(\) external payable$/;
|
|
5805
5805
|
function Oc(t) {
|
|
5806
|
-
return
|
|
5806
|
+
return Mc.test(t);
|
|
5807
5807
|
}
|
|
5808
|
-
const
|
|
5808
|
+
const jc = /* @__PURE__ */ new Set(["indexed"]), Vn = /* @__PURE__ */ new Set([
|
|
5809
5809
|
"calldata",
|
|
5810
5810
|
"memory",
|
|
5811
5811
|
"storage"
|
|
5812
5812
|
]);
|
|
5813
|
-
class
|
|
5813
|
+
class Bc extends L {
|
|
5814
5814
|
constructor({ type: e }) {
|
|
5815
5815
|
super("Unknown type.", {
|
|
5816
5816
|
metaMessages: [
|
|
@@ -5824,7 +5824,7 @@ class jc extends D {
|
|
|
5824
5824
|
});
|
|
5825
5825
|
}
|
|
5826
5826
|
}
|
|
5827
|
-
class
|
|
5827
|
+
class Nc extends L {
|
|
5828
5828
|
constructor({ type: e }) {
|
|
5829
5829
|
super("Unknown type.", {
|
|
5830
5830
|
metaMessages: [`Type "${e}" is not a valid ABI type.`]
|
|
@@ -5836,7 +5836,7 @@ class Bc extends D {
|
|
|
5836
5836
|
});
|
|
5837
5837
|
}
|
|
5838
5838
|
}
|
|
5839
|
-
class
|
|
5839
|
+
class Fc extends L {
|
|
5840
5840
|
constructor({ param: e }) {
|
|
5841
5841
|
super("Invalid ABI parameter.", {
|
|
5842
5842
|
details: e
|
|
@@ -5848,7 +5848,7 @@ class Nc extends D {
|
|
|
5848
5848
|
});
|
|
5849
5849
|
}
|
|
5850
5850
|
}
|
|
5851
|
-
class
|
|
5851
|
+
class zc extends L {
|
|
5852
5852
|
constructor({ param: e, name: n }) {
|
|
5853
5853
|
super("Invalid ABI parameter.", {
|
|
5854
5854
|
details: e,
|
|
@@ -5863,7 +5863,7 @@ class Fc extends D {
|
|
|
5863
5863
|
});
|
|
5864
5864
|
}
|
|
5865
5865
|
}
|
|
5866
|
-
class
|
|
5866
|
+
class Zc extends L {
|
|
5867
5867
|
constructor({ param: e, type: n, modifier: r }) {
|
|
5868
5868
|
super("Invalid ABI parameter.", {
|
|
5869
5869
|
details: e,
|
|
@@ -5878,7 +5878,7 @@ class zc extends D {
|
|
|
5878
5878
|
});
|
|
5879
5879
|
}
|
|
5880
5880
|
}
|
|
5881
|
-
class
|
|
5881
|
+
class Dc extends L {
|
|
5882
5882
|
constructor({ param: e, type: n, modifier: r }) {
|
|
5883
5883
|
super("Invalid ABI parameter.", {
|
|
5884
5884
|
details: e,
|
|
@@ -5894,7 +5894,7 @@ class Lc extends D {
|
|
|
5894
5894
|
});
|
|
5895
5895
|
}
|
|
5896
5896
|
}
|
|
5897
|
-
class
|
|
5897
|
+
class Lc extends L {
|
|
5898
5898
|
constructor({ abiParameter: e }) {
|
|
5899
5899
|
super("Invalid ABI parameter.", {
|
|
5900
5900
|
details: JSON.stringify(e, null, 2),
|
|
@@ -5907,7 +5907,7 @@ class Zc extends D {
|
|
|
5907
5907
|
});
|
|
5908
5908
|
}
|
|
5909
5909
|
}
|
|
5910
|
-
class rt extends
|
|
5910
|
+
class rt extends L {
|
|
5911
5911
|
constructor({ signature: e, type: n }) {
|
|
5912
5912
|
super(`Invalid ${n} signature.`, {
|
|
5913
5913
|
details: e
|
|
@@ -5919,7 +5919,7 @@ class rt extends D {
|
|
|
5919
5919
|
});
|
|
5920
5920
|
}
|
|
5921
5921
|
}
|
|
5922
|
-
class
|
|
5922
|
+
class Vc extends L {
|
|
5923
5923
|
constructor({ signature: e }) {
|
|
5924
5924
|
super("Unknown signature.", {
|
|
5925
5925
|
details: e
|
|
@@ -5931,7 +5931,7 @@ class Dc extends D {
|
|
|
5931
5931
|
});
|
|
5932
5932
|
}
|
|
5933
5933
|
}
|
|
5934
|
-
class
|
|
5934
|
+
class Uc extends L {
|
|
5935
5935
|
constructor({ signature: e }) {
|
|
5936
5936
|
super("Invalid struct signature.", {
|
|
5937
5937
|
details: e,
|
|
@@ -5944,7 +5944,7 @@ class Vc extends D {
|
|
|
5944
5944
|
});
|
|
5945
5945
|
}
|
|
5946
5946
|
}
|
|
5947
|
-
class
|
|
5947
|
+
class Gc extends L {
|
|
5948
5948
|
constructor({ type: e }) {
|
|
5949
5949
|
super("Circular reference detected.", {
|
|
5950
5950
|
metaMessages: [`Struct "${e}" is a circular reference.`]
|
|
@@ -5956,7 +5956,7 @@ class Uc extends D {
|
|
|
5956
5956
|
});
|
|
5957
5957
|
}
|
|
5958
5958
|
}
|
|
5959
|
-
class
|
|
5959
|
+
class qc extends L {
|
|
5960
5960
|
constructor({ current: e, depth: n }) {
|
|
5961
5961
|
super("Unbalanced parentheses.", {
|
|
5962
5962
|
metaMessages: [
|
|
@@ -5971,7 +5971,7 @@ class Gc extends D {
|
|
|
5971
5971
|
});
|
|
5972
5972
|
}
|
|
5973
5973
|
}
|
|
5974
|
-
function
|
|
5974
|
+
function Wc(t, e, n) {
|
|
5975
5975
|
let r = "";
|
|
5976
5976
|
if (n)
|
|
5977
5977
|
for (const s of Object.entries(n)) {
|
|
@@ -6038,14 +6038,14 @@ const wn = /* @__PURE__ */ new Map([
|
|
|
6038
6038
|
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
6039
6039
|
]
|
|
6040
6040
|
]);
|
|
6041
|
-
function
|
|
6042
|
-
if (
|
|
6043
|
-
const n =
|
|
6041
|
+
function Hc(t, e = {}) {
|
|
6042
|
+
if (Cc(t)) {
|
|
6043
|
+
const n = Tc(t);
|
|
6044
6044
|
if (!n)
|
|
6045
6045
|
throw new rt({ signature: t, type: "function" });
|
|
6046
6046
|
const r = Q(n.parameters), s = [], a = r.length;
|
|
6047
6047
|
for (let o = 0; o < a; o++)
|
|
6048
|
-
s.push(
|
|
6048
|
+
s.push($e(r[o], {
|
|
6049
6049
|
modifiers: Vn,
|
|
6050
6050
|
structs: e,
|
|
6051
6051
|
type: "function"
|
|
@@ -6054,7 +6054,7 @@ function Wc(t, e = {}) {
|
|
|
6054
6054
|
if (n.returns) {
|
|
6055
6055
|
const o = Q(n.returns), u = o.length;
|
|
6056
6056
|
for (let c = 0; c < u; c++)
|
|
6057
|
-
i.push(
|
|
6057
|
+
i.push($e(o[c], {
|
|
6058
6058
|
modifiers: Vn,
|
|
6059
6059
|
structs: e,
|
|
6060
6060
|
type: "function"
|
|
@@ -6068,84 +6068,84 @@ function Wc(t, e = {}) {
|
|
|
6068
6068
|
outputs: i
|
|
6069
6069
|
};
|
|
6070
6070
|
}
|
|
6071
|
-
if (
|
|
6072
|
-
const n =
|
|
6071
|
+
if (Ec(t)) {
|
|
6072
|
+
const n = Ac(t);
|
|
6073
6073
|
if (!n)
|
|
6074
6074
|
throw new rt({ signature: t, type: "event" });
|
|
6075
6075
|
const r = Q(n.parameters), s = [], a = r.length;
|
|
6076
6076
|
for (let i = 0; i < a; i++)
|
|
6077
|
-
s.push(
|
|
6078
|
-
modifiers:
|
|
6077
|
+
s.push($e(r[i], {
|
|
6078
|
+
modifiers: jc,
|
|
6079
6079
|
structs: e,
|
|
6080
6080
|
type: "event"
|
|
6081
6081
|
}));
|
|
6082
6082
|
return { name: n.name, type: "event", inputs: s };
|
|
6083
6083
|
}
|
|
6084
|
-
if (
|
|
6085
|
-
const n =
|
|
6084
|
+
if (_c(t)) {
|
|
6085
|
+
const n = Pc(t);
|
|
6086
6086
|
if (!n)
|
|
6087
6087
|
throw new rt({ signature: t, type: "error" });
|
|
6088
6088
|
const r = Q(n.parameters), s = [], a = r.length;
|
|
6089
6089
|
for (let i = 0; i < a; i++)
|
|
6090
|
-
s.push(
|
|
6090
|
+
s.push($e(r[i], { structs: e, type: "error" }));
|
|
6091
6091
|
return { name: n.name, type: "error", inputs: s };
|
|
6092
6092
|
}
|
|
6093
|
-
if (
|
|
6094
|
-
const n =
|
|
6093
|
+
if (kc(t)) {
|
|
6094
|
+
const n = Ic(t);
|
|
6095
6095
|
if (!n)
|
|
6096
6096
|
throw new rt({ signature: t, type: "constructor" });
|
|
6097
6097
|
const r = Q(n.parameters), s = [], a = r.length;
|
|
6098
6098
|
for (let i = 0; i < a; i++)
|
|
6099
|
-
s.push(
|
|
6099
|
+
s.push($e(r[i], { structs: e, type: "constructor" }));
|
|
6100
6100
|
return {
|
|
6101
6101
|
type: "constructor",
|
|
6102
6102
|
stateMutability: n.stateMutability ?? "nonpayable",
|
|
6103
6103
|
inputs: s
|
|
6104
6104
|
};
|
|
6105
6105
|
}
|
|
6106
|
-
if (
|
|
6106
|
+
if (Rc(t))
|
|
6107
6107
|
return { type: "fallback" };
|
|
6108
6108
|
if (Oc(t))
|
|
6109
6109
|
return {
|
|
6110
6110
|
type: "receive",
|
|
6111
6111
|
stateMutability: "payable"
|
|
6112
6112
|
};
|
|
6113
|
-
throw new
|
|
6113
|
+
throw new Vc({ signature: t });
|
|
6114
6114
|
}
|
|
6115
|
-
const
|
|
6116
|
-
function
|
|
6115
|
+
const Kc = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, Jc = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/, Yc = /^u?int$/;
|
|
6116
|
+
function $e(t, e) {
|
|
6117
6117
|
var l, f;
|
|
6118
|
-
const n =
|
|
6118
|
+
const n = Wc(t, e == null ? void 0 : e.type, e == null ? void 0 : e.structs);
|
|
6119
6119
|
if (wn.has(n))
|
|
6120
6120
|
return wn.get(n);
|
|
6121
|
-
const r = Is.test(t), s = Ae(r ?
|
|
6121
|
+
const r = Is.test(t), s = Ae(r ? Jc : Kc, t);
|
|
6122
6122
|
if (!s)
|
|
6123
|
-
throw new
|
|
6124
|
-
if (s.name &&
|
|
6125
|
-
throw new
|
|
6123
|
+
throw new Fc({ param: t });
|
|
6124
|
+
if (s.name && Qc(s.name))
|
|
6125
|
+
throw new zc({ param: t, name: s.name });
|
|
6126
6126
|
const a = s.name ? { name: s.name } : {}, i = s.modifier === "indexed" ? { indexed: !0 } : {}, o = (e == null ? void 0 : e.structs) ?? {};
|
|
6127
6127
|
let u, c = {};
|
|
6128
6128
|
if (r) {
|
|
6129
6129
|
u = "tuple";
|
|
6130
|
-
const m = Q(s.type), v = [],
|
|
6131
|
-
for (let P = 0; P <
|
|
6132
|
-
v.push(
|
|
6130
|
+
const m = Q(s.type), v = [], $ = m.length;
|
|
6131
|
+
for (let P = 0; P < $; P++)
|
|
6132
|
+
v.push($e(m[P], { structs: o }));
|
|
6133
6133
|
c = { components: v };
|
|
6134
6134
|
} else if (s.type in o)
|
|
6135
6135
|
u = "tuple", c = { components: o[s.type] };
|
|
6136
|
-
else if (
|
|
6136
|
+
else if (Yc.test(s.type))
|
|
6137
6137
|
u = `${s.type}256`;
|
|
6138
6138
|
else if (u = s.type, (e == null ? void 0 : e.type) !== "struct" && !Ns(u))
|
|
6139
|
-
throw new
|
|
6139
|
+
throw new Nc({ type: u });
|
|
6140
6140
|
if (s.modifier) {
|
|
6141
6141
|
if (!((f = (l = e == null ? void 0 : e.modifiers) == null ? void 0 : l.has) != null && f.call(l, s.modifier)))
|
|
6142
|
-
throw new
|
|
6142
|
+
throw new Zc({
|
|
6143
6143
|
param: t,
|
|
6144
6144
|
type: e == null ? void 0 : e.type,
|
|
6145
6145
|
modifier: s.modifier
|
|
6146
6146
|
});
|
|
6147
|
-
if (Vn.has(s.modifier) && !
|
|
6148
|
-
throw new
|
|
6147
|
+
if (Vn.has(s.modifier) && !eu(u, !!s.array))
|
|
6148
|
+
throw new Dc({
|
|
6149
6149
|
param: t,
|
|
6150
6150
|
type: e == null ? void 0 : e.type,
|
|
6151
6151
|
modifier: s.modifier
|
|
@@ -6177,26 +6177,26 @@ function Q(t, e = [], n = "", r = 0) {
|
|
|
6177
6177
|
if (n === "")
|
|
6178
6178
|
return e;
|
|
6179
6179
|
if (r !== 0)
|
|
6180
|
-
throw new
|
|
6180
|
+
throw new qc({ current: n, depth: r });
|
|
6181
6181
|
return e.push(n.trim()), e;
|
|
6182
6182
|
}
|
|
6183
6183
|
function Ns(t) {
|
|
6184
|
-
return t === "address" || t === "bool" || t === "function" || t === "string" ||
|
|
6184
|
+
return t === "address" || t === "bool" || t === "function" || t === "string" || $s.test(t) || ks.test(t);
|
|
6185
6185
|
}
|
|
6186
|
-
const
|
|
6187
|
-
function
|
|
6188
|
-
return t === "address" || t === "bool" || t === "function" || t === "string" || t === "tuple" ||
|
|
6186
|
+
const Xc = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;
|
|
6187
|
+
function Qc(t) {
|
|
6188
|
+
return t === "address" || t === "bool" || t === "function" || t === "string" || t === "tuple" || $s.test(t) || ks.test(t) || Xc.test(t);
|
|
6189
6189
|
}
|
|
6190
|
-
function
|
|
6190
|
+
function eu(t, e) {
|
|
6191
6191
|
return e || t === "bytes" || t === "string" || t === "tuple";
|
|
6192
6192
|
}
|
|
6193
|
-
function
|
|
6193
|
+
function tu(t) {
|
|
6194
6194
|
const e = {}, n = t.length;
|
|
6195
6195
|
for (let i = 0; i < n; i++) {
|
|
6196
6196
|
const o = t[i];
|
|
6197
6197
|
if (!js(o))
|
|
6198
6198
|
continue;
|
|
6199
|
-
const u =
|
|
6199
|
+
const u = $c(o);
|
|
6200
6200
|
if (!u)
|
|
6201
6201
|
throw new rt({ signature: o, type: "struct" });
|
|
6202
6202
|
const c = u.properties.split(";"), d = [], l = c.length;
|
|
@@ -6204,13 +6204,13 @@ function eu(t) {
|
|
|
6204
6204
|
const v = c[f].trim();
|
|
6205
6205
|
if (!v)
|
|
6206
6206
|
continue;
|
|
6207
|
-
const
|
|
6207
|
+
const $ = $e(v, {
|
|
6208
6208
|
type: "struct"
|
|
6209
6209
|
});
|
|
6210
|
-
d.push(
|
|
6210
|
+
d.push($);
|
|
6211
6211
|
}
|
|
6212
6212
|
if (!d.length)
|
|
6213
|
-
throw new
|
|
6213
|
+
throw new Uc({ signature: o });
|
|
6214
6214
|
e[u.name] = d;
|
|
6215
6215
|
}
|
|
6216
6216
|
const r = {}, s = Object.entries(e), a = s.length;
|
|
@@ -6220,7 +6220,7 @@ function eu(t) {
|
|
|
6220
6220
|
}
|
|
6221
6221
|
return r;
|
|
6222
6222
|
}
|
|
6223
|
-
const
|
|
6223
|
+
const nu = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;
|
|
6224
6224
|
function Fs(t, e, n = /* @__PURE__ */ new Set()) {
|
|
6225
6225
|
const r = [], s = t.length;
|
|
6226
6226
|
for (let a = 0; a < s; a++) {
|
|
@@ -6228,13 +6228,13 @@ function Fs(t, e, n = /* @__PURE__ */ new Set()) {
|
|
|
6228
6228
|
if (Is.test(i.type))
|
|
6229
6229
|
r.push(i);
|
|
6230
6230
|
else {
|
|
6231
|
-
const u = Ae(
|
|
6231
|
+
const u = Ae(nu, i.type);
|
|
6232
6232
|
if (!(u != null && u.type))
|
|
6233
|
-
throw new
|
|
6233
|
+
throw new Lc({ abiParameter: i });
|
|
6234
6234
|
const { array: c, type: d } = u;
|
|
6235
6235
|
if (d in e) {
|
|
6236
6236
|
if (n.has(d))
|
|
6237
|
-
throw new
|
|
6237
|
+
throw new Gc({ type: d });
|
|
6238
6238
|
r.push({
|
|
6239
6239
|
...i,
|
|
6240
6240
|
type: `tuple${c ?? ""}`,
|
|
@@ -6243,20 +6243,20 @@ function Fs(t, e, n = /* @__PURE__ */ new Set()) {
|
|
|
6243
6243
|
} else if (Ns(d))
|
|
6244
6244
|
r.push(i);
|
|
6245
6245
|
else
|
|
6246
|
-
throw new
|
|
6246
|
+
throw new Bc({ type: d });
|
|
6247
6247
|
}
|
|
6248
6248
|
}
|
|
6249
6249
|
return r;
|
|
6250
6250
|
}
|
|
6251
6251
|
function zs(t) {
|
|
6252
|
-
const e =
|
|
6252
|
+
const e = tu(t), n = [], r = t.length;
|
|
6253
6253
|
for (let s = 0; s < r; s++) {
|
|
6254
6254
|
const a = t[s];
|
|
6255
|
-
js(a) || n.push(
|
|
6255
|
+
js(a) || n.push(Hc(a, e));
|
|
6256
6256
|
}
|
|
6257
6257
|
return n;
|
|
6258
6258
|
}
|
|
6259
|
-
function
|
|
6259
|
+
function ru(t) {
|
|
6260
6260
|
let e = !0, n = "", r = 0, s = "", a = !1;
|
|
6261
6261
|
for (let i = 0; i < t.length; i++) {
|
|
6262
6262
|
const o = t[i];
|
|
@@ -6281,16 +6281,16 @@ function nu(t) {
|
|
|
6281
6281
|
throw new y("Unable to normalize signature.");
|
|
6282
6282
|
return s;
|
|
6283
6283
|
}
|
|
6284
|
-
const
|
|
6285
|
-
const e = typeof t == "string" ? t :
|
|
6286
|
-
return
|
|
6284
|
+
const su = (t) => {
|
|
6285
|
+
const e = typeof t == "string" ? t : xc(t);
|
|
6286
|
+
return ru(e);
|
|
6287
6287
|
};
|
|
6288
|
-
function
|
|
6289
|
-
return
|
|
6288
|
+
function Zs(t) {
|
|
6289
|
+
return vc(su(t));
|
|
6290
6290
|
}
|
|
6291
|
-
const
|
|
6291
|
+
const au = Zs, ur = (t) => Jt(Zs(t), 0, 4);
|
|
6292
6292
|
function dr(t) {
|
|
6293
|
-
const { abi: e, args: n = [], name: r } = t, s = Pe(r, { strict: !1 }), a = e.filter((o) => s ? o.type === "function" ? ur(o) === r : o.type === "event" ?
|
|
6293
|
+
const { abi: e, args: n = [], name: r } = t, s = Pe(r, { strict: !1 }), a = e.filter((o) => s ? o.type === "function" ? ur(o) === r : o.type === "event" ? au(o) === r : !1 : "name" in o && o.name === r);
|
|
6294
6294
|
if (a.length === 0)
|
|
6295
6295
|
return;
|
|
6296
6296
|
if (a.length === 1)
|
|
@@ -6311,9 +6311,9 @@ function dr(t) {
|
|
|
6311
6311
|
return l ? Un(c, l) : !1;
|
|
6312
6312
|
})) {
|
|
6313
6313
|
if (i && "inputs" in i && i.inputs) {
|
|
6314
|
-
const c =
|
|
6314
|
+
const c = Ds(o.inputs, i.inputs, n);
|
|
6315
6315
|
if (c)
|
|
6316
|
-
throw new
|
|
6316
|
+
throw new Gi({
|
|
6317
6317
|
abiItem: o,
|
|
6318
6318
|
type: c[0]
|
|
6319
6319
|
}, {
|
|
@@ -6345,11 +6345,11 @@ function Un(t, e) {
|
|
|
6345
6345
|
})) : !1;
|
|
6346
6346
|
}
|
|
6347
6347
|
}
|
|
6348
|
-
function
|
|
6348
|
+
function Ds(t, e, n) {
|
|
6349
6349
|
for (const r in t) {
|
|
6350
6350
|
const s = t[r], a = e[r];
|
|
6351
6351
|
if (s.type === "tuple" && a.type === "tuple" && "components" in s && "components" in a)
|
|
6352
|
-
return
|
|
6352
|
+
return Ds(s.components, a.components, n[r]);
|
|
6353
6353
|
const i = [s.type, a.type];
|
|
6354
6354
|
if (i.includes("address") && i.includes("bytes20") ? !0 : i.includes("address") && i.includes("string") ? Ee(n[r], { strict: !1 }) : i.includes("address") && i.includes("bytes") ? Ee(n[r], { strict: !1 }) : !1)
|
|
6355
6355
|
return i;
|
|
@@ -6368,15 +6368,15 @@ function lr(t) {
|
|
|
6368
6368
|
if (a.type !== "function")
|
|
6369
6369
|
throw new Kt(void 0, { docsPath: xn });
|
|
6370
6370
|
if (!a.outputs)
|
|
6371
|
-
throw new
|
|
6372
|
-
const i =
|
|
6371
|
+
throw new Ui(a.name, { docsPath: xn });
|
|
6372
|
+
const i = Ts(a.outputs, s);
|
|
6373
6373
|
if (i && i.length > 1)
|
|
6374
6374
|
return i;
|
|
6375
6375
|
if (i && i.length === 1)
|
|
6376
6376
|
return i[0];
|
|
6377
6377
|
}
|
|
6378
|
-
const
|
|
6379
|
-
function
|
|
6378
|
+
const Or = "/docs/contract/encodeFunctionData";
|
|
6379
|
+
function iu(t) {
|
|
6380
6380
|
const { abi: e, args: n, functionName: r } = t;
|
|
6381
6381
|
let s = e[0];
|
|
6382
6382
|
if (r) {
|
|
@@ -6386,11 +6386,11 @@ function au(t) {
|
|
|
6386
6386
|
name: r
|
|
6387
6387
|
});
|
|
6388
6388
|
if (!a)
|
|
6389
|
-
throw new Kt(r, { docsPath:
|
|
6389
|
+
throw new Kt(r, { docsPath: Or });
|
|
6390
6390
|
s = a;
|
|
6391
6391
|
}
|
|
6392
6392
|
if (s.type !== "function")
|
|
6393
|
-
throw new Kt(void 0, { docsPath:
|
|
6393
|
+
throw new Kt(void 0, { docsPath: Or });
|
|
6394
6394
|
return {
|
|
6395
6395
|
abi: [s],
|
|
6396
6396
|
functionName: ur(We(s))
|
|
@@ -6399,11 +6399,11 @@ function au(t) {
|
|
|
6399
6399
|
function dn(t) {
|
|
6400
6400
|
const { args: e } = t, { abi: n, functionName: r } = (() => {
|
|
6401
6401
|
var o;
|
|
6402
|
-
return t.abi.length === 1 && ((o = t.functionName) != null && o.startsWith("0x")) ? t :
|
|
6402
|
+
return t.abi.length === 1 && ((o = t.functionName) != null && o.startsWith("0x")) ? t : iu(t);
|
|
6403
6403
|
})(), s = n[0], a = r, i = "inputs" in s && s.inputs ? os(s.inputs, e ?? []) : void 0;
|
|
6404
6404
|
return rn([a, i ?? "0x"]);
|
|
6405
6405
|
}
|
|
6406
|
-
function
|
|
6406
|
+
function ou({ blockNumber: t, chain: e, contract: n }) {
|
|
6407
6407
|
var s;
|
|
6408
6408
|
const r = (s = e == null ? void 0 : e.contracts) == null ? void 0 : s[n];
|
|
6409
6409
|
if (!r)
|
|
@@ -6422,7 +6422,7 @@ function iu({ blockNumber: t, chain: e, contract: n }) {
|
|
|
6422
6422
|
});
|
|
6423
6423
|
return r.address;
|
|
6424
6424
|
}
|
|
6425
|
-
const
|
|
6425
|
+
const cu = {
|
|
6426
6426
|
1: "An `assert` condition failed.",
|
|
6427
6427
|
17: "Arithmetic operation resulted in underflow or overflow.",
|
|
6428
6428
|
18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
|
|
@@ -6432,7 +6432,7 @@ const ou = {
|
|
|
6432
6432
|
50: "Array index is out of bounds.",
|
|
6433
6433
|
65: "Allocated too much memory or created an array which is too large.",
|
|
6434
6434
|
81: "Attempted to call a zero-initialized variable of internal function type."
|
|
6435
|
-
},
|
|
6435
|
+
}, uu = {
|
|
6436
6436
|
inputs: [
|
|
6437
6437
|
{
|
|
6438
6438
|
name: "message",
|
|
@@ -6441,7 +6441,7 @@ const ou = {
|
|
|
6441
6441
|
],
|
|
6442
6442
|
name: "Error",
|
|
6443
6443
|
type: "error"
|
|
6444
|
-
},
|
|
6444
|
+
}, du = {
|
|
6445
6445
|
inputs: [
|
|
6446
6446
|
{
|
|
6447
6447
|
name: "reason",
|
|
@@ -6451,30 +6451,30 @@ const ou = {
|
|
|
6451
6451
|
name: "Panic",
|
|
6452
6452
|
type: "error"
|
|
6453
6453
|
};
|
|
6454
|
-
function
|
|
6454
|
+
function lu(t) {
|
|
6455
6455
|
const { abi: e, data: n } = t, r = Jt(n, 0, 4);
|
|
6456
6456
|
if (r === "0x")
|
|
6457
6457
|
throw new Xn();
|
|
6458
|
-
const a = [...e || [],
|
|
6458
|
+
const a = [...e || [], uu, du].find((i) => i.type === "error" && r === ur(We(i)));
|
|
6459
6459
|
if (!a)
|
|
6460
6460
|
throw new rs(r, {
|
|
6461
6461
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
6462
6462
|
});
|
|
6463
6463
|
return {
|
|
6464
6464
|
abiItem: a,
|
|
6465
|
-
args: "inputs" in a && a.inputs && a.inputs.length > 0 ?
|
|
6465
|
+
args: "inputs" in a && a.inputs && a.inputs.length > 0 ? Ts(a.inputs, Jt(n, 4)) : void 0,
|
|
6466
6466
|
errorName: a.name
|
|
6467
6467
|
};
|
|
6468
6468
|
}
|
|
6469
|
-
function
|
|
6469
|
+
function Ls({ abiItem: t, args: e, includeFunctionName: n = !0, includeName: r = !1 }) {
|
|
6470
6470
|
if ("name" in t && "inputs" in t && t.inputs)
|
|
6471
6471
|
return `${n ? t.name : ""}(${t.inputs.map((s, a) => `${r && s.name ? `${s.name}: ` : ""}${typeof e[a] == "object" ? cn(e[a]) : e[a]}`).join(", ")})`;
|
|
6472
6472
|
}
|
|
6473
|
-
class
|
|
6473
|
+
class fu extends y {
|
|
6474
6474
|
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to: l, value: f, stateOverride: m }) {
|
|
6475
6475
|
var P;
|
|
6476
6476
|
const v = n ? ue(n) : void 0;
|
|
6477
|
-
let
|
|
6477
|
+
let $ = Ft({
|
|
6478
6478
|
from: v == null ? void 0 : v.address,
|
|
6479
6479
|
to: l,
|
|
6480
6480
|
value: typeof f < "u" && `${rr(f)} ${((P = s == null ? void 0 : s.nativeCurrency) == null ? void 0 : P.symbol) || "ETH"}`,
|
|
@@ -6485,14 +6485,14 @@ class lu extends y {
|
|
|
6485
6485
|
maxPriorityFeePerGas: typeof c < "u" && `${U(c)} gwei`,
|
|
6486
6486
|
nonce: d
|
|
6487
6487
|
});
|
|
6488
|
-
m && (
|
|
6489
|
-
${
|
|
6488
|
+
m && ($ += `
|
|
6489
|
+
${Wo(m)}`), super(e.shortMessage, {
|
|
6490
6490
|
cause: e,
|
|
6491
6491
|
docsPath: r,
|
|
6492
6492
|
metaMessages: [
|
|
6493
6493
|
...e.metaMessages ? [...e.metaMessages, " "] : [],
|
|
6494
6494
|
"Raw Call Arguments:",
|
|
6495
|
-
|
|
6495
|
+
$
|
|
6496
6496
|
].filter(Boolean),
|
|
6497
6497
|
name: "CallExecutionError"
|
|
6498
6498
|
}), Object.defineProperty(this, "cause", {
|
|
@@ -6503,15 +6503,15 @@ ${Ho(m)}`), super(e.shortMessage, {
|
|
|
6503
6503
|
}), this.cause = e;
|
|
6504
6504
|
}
|
|
6505
6505
|
}
|
|
6506
|
-
class
|
|
6506
|
+
class hu extends y {
|
|
6507
6507
|
constructor(e, { abi: n, args: r, contractAddress: s, docsPath: a, functionName: i, sender: o }) {
|
|
6508
|
-
const u = dr({ abi: n, args: r, name: i }), c = u ?
|
|
6508
|
+
const u = dr({ abi: n, args: r, name: i }), c = u ? Ls({
|
|
6509
6509
|
abiItem: u,
|
|
6510
6510
|
args: r,
|
|
6511
6511
|
includeFunctionName: !1,
|
|
6512
6512
|
includeName: !1
|
|
6513
6513
|
}) : void 0, d = u ? We(u, { includeName: !0 }) : void 0, l = Ft({
|
|
6514
|
-
address: s &&
|
|
6514
|
+
address: s && $o(s),
|
|
6515
6515
|
function: d,
|
|
6516
6516
|
args: c && c !== "()" && `${[...Array((i == null ? void 0 : i.length) ?? 0).keys()].map(() => " ").join("")}${c}`,
|
|
6517
6517
|
sender: o
|
|
@@ -6563,20 +6563,20 @@ class fu extends y {
|
|
|
6563
6563
|
}), this.abi = n, this.args = r, this.cause = e, this.contractAddress = s, this.functionName = i, this.sender = o;
|
|
6564
6564
|
}
|
|
6565
6565
|
}
|
|
6566
|
-
class
|
|
6566
|
+
class pu extends y {
|
|
6567
6567
|
constructor({ abi: e, data: n, functionName: r, message: s }) {
|
|
6568
6568
|
let a, i, o, u;
|
|
6569
6569
|
if (n && n !== "0x")
|
|
6570
6570
|
try {
|
|
6571
|
-
i =
|
|
6571
|
+
i = lu({ abi: e, data: n });
|
|
6572
6572
|
const { abiItem: d, errorName: l, args: f } = i;
|
|
6573
6573
|
if (l === "Error")
|
|
6574
6574
|
u = f[0];
|
|
6575
6575
|
else if (l === "Panic") {
|
|
6576
6576
|
const [m] = f;
|
|
6577
|
-
u =
|
|
6577
|
+
u = cu[m];
|
|
6578
6578
|
} else {
|
|
6579
|
-
const m = d ? We(d, { includeName: !0 }) : void 0, v = d && f ?
|
|
6579
|
+
const m = d ? We(d, { includeName: !0 }) : void 0, v = d && f ? Ls({
|
|
6580
6580
|
abiItem: d,
|
|
6581
6581
|
args: f,
|
|
6582
6582
|
includeFunctionName: !1,
|
|
@@ -6622,7 +6622,7 @@ class hu extends y {
|
|
|
6622
6622
|
}), this.data = i, this.reason = u, this.signature = c;
|
|
6623
6623
|
}
|
|
6624
6624
|
}
|
|
6625
|
-
class
|
|
6625
|
+
class mu extends y {
|
|
6626
6626
|
constructor({ functionName: e }) {
|
|
6627
6627
|
super(`The contract function "${e}" returned no data ("0x").`, {
|
|
6628
6628
|
metaMessages: [
|
|
@@ -6635,7 +6635,7 @@ class pu extends y {
|
|
|
6635
6635
|
});
|
|
6636
6636
|
}
|
|
6637
6637
|
}
|
|
6638
|
-
class
|
|
6638
|
+
class yu extends y {
|
|
6639
6639
|
constructor({ factory: e }) {
|
|
6640
6640
|
super(`Deployment for counterfactual contract call failed${e ? ` for factory "${e}".` : ""}`, {
|
|
6641
6641
|
metaMessages: [
|
|
@@ -6662,15 +6662,15 @@ class Vs extends y {
|
|
|
6662
6662
|
}), this.data = e;
|
|
6663
6663
|
}
|
|
6664
6664
|
}
|
|
6665
|
-
const
|
|
6665
|
+
const bu = 3;
|
|
6666
6666
|
function fr(t, { abi: e, address: n, args: r, docsPath: s, functionName: a, sender: i }) {
|
|
6667
|
-
const o = t instanceof Vs ? t : t instanceof y ? t.walk((v) => "data" in v) || t.walk() : {}, { code: u, data: c, details: d, message: l, shortMessage: f } = o, m = t instanceof Xn ? new
|
|
6667
|
+
const o = t instanceof Vs ? t : t instanceof y ? t.walk((v) => "data" in v) || t.walk() : {}, { code: u, data: c, details: d, message: l, shortMessage: f } = o, m = t instanceof Xn ? new mu({ functionName: a }) : [bu, Me.code].includes(u) && (c || d || l || f) ? new pu({
|
|
6668
6668
|
abi: e,
|
|
6669
6669
|
data: typeof c == "object" ? c.data : c,
|
|
6670
6670
|
functionName: a,
|
|
6671
6671
|
message: o instanceof bs ? d : f ?? l
|
|
6672
6672
|
}) : t;
|
|
6673
|
-
return new
|
|
6673
|
+
return new hu(m, {
|
|
6674
6674
|
abi: e,
|
|
6675
6675
|
args: r,
|
|
6676
6676
|
contractAddress: n,
|
|
@@ -6679,18 +6679,18 @@ function fr(t, { abi: e, address: n, args: r, docsPath: s, functionName: a, send
|
|
|
6679
6679
|
sender: i
|
|
6680
6680
|
});
|
|
6681
6681
|
}
|
|
6682
|
-
const
|
|
6683
|
-
function
|
|
6682
|
+
const gu = "0x82ad56cb", vu = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe", wu = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
6683
|
+
function xu(t, { docsPath: e, ...n }) {
|
|
6684
6684
|
const r = (() => {
|
|
6685
6685
|
const s = sr(t, n);
|
|
6686
6686
|
return s instanceof on ? t : s;
|
|
6687
6687
|
})();
|
|
6688
|
-
return new
|
|
6688
|
+
return new fu(r, {
|
|
6689
6689
|
docsPath: e,
|
|
6690
6690
|
...n
|
|
6691
6691
|
});
|
|
6692
6692
|
}
|
|
6693
|
-
function
|
|
6693
|
+
function _u() {
|
|
6694
6694
|
let t = () => {
|
|
6695
6695
|
}, e = () => {
|
|
6696
6696
|
};
|
|
@@ -6699,7 +6699,7 @@ function xu() {
|
|
|
6699
6699
|
}), resolve: t, reject: e };
|
|
6700
6700
|
}
|
|
6701
6701
|
const _n = /* @__PURE__ */ new Map();
|
|
6702
|
-
function
|
|
6702
|
+
function Pu({ fn: t, id: e, shouldSplitBatch: n, wait: r = 0, sort: s }) {
|
|
6703
6703
|
const a = async () => {
|
|
6704
6704
|
const d = u();
|
|
6705
6705
|
i();
|
|
@@ -6720,22 +6720,22 @@ function _u({ fn: t, id: e, shouldSplitBatch: n, wait: r = 0, sort: s }) {
|
|
|
6720
6720
|
return {
|
|
6721
6721
|
flush: i,
|
|
6722
6722
|
async schedule(d) {
|
|
6723
|
-
const { promise: l, resolve: f, reject: m } =
|
|
6723
|
+
const { promise: l, resolve: f, reject: m } = _u();
|
|
6724
6724
|
return (n == null ? void 0 : n([...o(), d])) && a(), u().length > 0 ? (c({ args: d, resolve: f, reject: m }), l) : (c({ args: d, resolve: f, reject: m }), setTimeout(a, r), l);
|
|
6725
6725
|
}
|
|
6726
6726
|
};
|
|
6727
6727
|
}
|
|
6728
6728
|
async function Us(t, e) {
|
|
6729
6729
|
var Ce, je, K, de;
|
|
6730
|
-
const { account: n = t.account, batch: r = !!((Ce = t.batch) != null && Ce.multicall), blockNumber: s, blockTag: a = "latest", accessList: i, blobs: o, code: u, data: c, factory: d, factoryData: l, gas: f, gasPrice: m, maxFeePerBlobGas: v, maxFeePerGas:
|
|
6730
|
+
const { account: n = t.account, batch: r = !!((Ce = t.batch) != null && Ce.multicall), blockNumber: s, blockTag: a = "latest", accessList: i, blobs: o, code: u, data: c, factory: d, factoryData: l, gas: f, gasPrice: m, maxFeePerBlobGas: v, maxFeePerGas: $, maxPriorityFeePerGas: P, nonce: S, to: R, value: A, stateOverride: O, ...H } = e, F = n ? ue(n) : void 0;
|
|
6731
6731
|
if (u && (d || l))
|
|
6732
6732
|
throw new y("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
6733
6733
|
if (u && R)
|
|
6734
6734
|
throw new y("Cannot provide both `code` & `to` as parameters.");
|
|
6735
|
-
const Y = u && c, re = d && l && R && c, C = Y || re, B = Y ?
|
|
6735
|
+
const Y = u && c, re = d && l && R && c, C = Y || re, B = Y ? Cu({
|
|
6736
6736
|
code: u,
|
|
6737
6737
|
data: c
|
|
6738
|
-
}) : re ?
|
|
6738
|
+
}) : re ? Tu({
|
|
6739
6739
|
data: c,
|
|
6740
6740
|
factory: d,
|
|
6741
6741
|
factoryData: l,
|
|
@@ -6743,9 +6743,9 @@ async function Us(t, e) {
|
|
|
6743
6743
|
}) : c;
|
|
6744
6744
|
try {
|
|
6745
6745
|
un(e);
|
|
6746
|
-
const V = (s ?
|
|
6746
|
+
const V = (s ? M(s) : void 0) || a, X = ws(O), J = (de = (K = (je = t.chain) == null ? void 0 : je.formatters) == null ? void 0 : K.transactionRequest) == null ? void 0 : de.format, Be = (J || ir)({
|
|
6747
6747
|
// Pick out extra data that might exist on the chain's transaction request type.
|
|
6748
|
-
...ar(
|
|
6748
|
+
...ar(H, { format: J }),
|
|
6749
6749
|
from: F == null ? void 0 : F.address,
|
|
6750
6750
|
accessList: i,
|
|
6751
6751
|
blobs: o,
|
|
@@ -6753,15 +6753,15 @@ async function Us(t, e) {
|
|
|
6753
6753
|
gas: f,
|
|
6754
6754
|
gasPrice: m,
|
|
6755
6755
|
maxFeePerBlobGas: v,
|
|
6756
|
-
maxFeePerGas:
|
|
6756
|
+
maxFeePerGas: $,
|
|
6757
6757
|
maxPriorityFeePerGas: P,
|
|
6758
6758
|
nonce: S,
|
|
6759
6759
|
to: C ? void 0 : R,
|
|
6760
6760
|
value: A
|
|
6761
6761
|
});
|
|
6762
|
-
if (r &&
|
|
6762
|
+
if (r && Eu({ request: Be }) && !X)
|
|
6763
6763
|
try {
|
|
6764
|
-
return await
|
|
6764
|
+
return await Au(t, {
|
|
6765
6765
|
...Be,
|
|
6766
6766
|
blockNumber: s,
|
|
6767
6767
|
blockTag: a
|
|
@@ -6780,44 +6780,44 @@ async function Us(t, e) {
|
|
|
6780
6780
|
});
|
|
6781
6781
|
return br === "0x" ? { data: void 0 } : { data: br };
|
|
6782
6782
|
} catch (se) {
|
|
6783
|
-
const V =
|
|
6783
|
+
const V = $u(se), { offchainLookup: X, offchainLookupSignature: J } = await import("./ccip-DDb_n-DK.js");
|
|
6784
6784
|
if (t.ccipRead !== !1 && (V == null ? void 0 : V.slice(0, 10)) === J && R)
|
|
6785
6785
|
return { data: await X(t, { data: V, to: R }) };
|
|
6786
|
-
throw C && (V == null ? void 0 : V.slice(0, 10)) === "0x101bb98d" ? new
|
|
6786
|
+
throw C && (V == null ? void 0 : V.slice(0, 10)) === "0x101bb98d" ? new yu({ factory: d }) : xu(se, {
|
|
6787
6787
|
...e,
|
|
6788
6788
|
account: F,
|
|
6789
6789
|
chain: t.chain
|
|
6790
6790
|
});
|
|
6791
6791
|
}
|
|
6792
6792
|
}
|
|
6793
|
-
function
|
|
6793
|
+
function Eu({ request: t }) {
|
|
6794
6794
|
const { data: e, to: n, ...r } = t;
|
|
6795
|
-
return !(!e || e.startsWith(
|
|
6795
|
+
return !(!e || e.startsWith(gu) || !n || Object.values(r).filter((s) => typeof s < "u").length > 0);
|
|
6796
6796
|
}
|
|
6797
|
-
async function
|
|
6798
|
-
var
|
|
6799
|
-
const { batchSize: n = 1024, wait: r = 0 } = typeof ((
|
|
6797
|
+
async function Au(t, e) {
|
|
6798
|
+
var $;
|
|
6799
|
+
const { batchSize: n = 1024, wait: r = 0 } = typeof (($ = t.batch) == null ? void 0 : $.multicall) == "object" ? t.batch.multicall : {}, { blockNumber: s, blockTag: a = "latest", data: i, multicallAddress: o, to: u } = e;
|
|
6800
6800
|
let c = o;
|
|
6801
6801
|
if (!c) {
|
|
6802
6802
|
if (!t.chain)
|
|
6803
6803
|
throw new hs();
|
|
6804
|
-
c =
|
|
6804
|
+
c = ou({
|
|
6805
6805
|
blockNumber: s,
|
|
6806
6806
|
chain: t.chain,
|
|
6807
6807
|
contract: "multicall3"
|
|
6808
6808
|
});
|
|
6809
6809
|
}
|
|
6810
|
-
const l = (s ?
|
|
6810
|
+
const l = (s ? M(s) : void 0) || a, { schedule: f } = Pu({
|
|
6811
6811
|
id: `${t.uid}.${l}`,
|
|
6812
6812
|
wait: r,
|
|
6813
6813
|
shouldSplitBatch(P) {
|
|
6814
6814
|
return P.reduce((R, { data: A }) => R + (A.length - 2), 0) > n * 2;
|
|
6815
6815
|
},
|
|
6816
6816
|
fn: async (P) => {
|
|
6817
|
-
const S = P.map((
|
|
6817
|
+
const S = P.map((O) => ({
|
|
6818
6818
|
allowFailure: !0,
|
|
6819
|
-
callData:
|
|
6820
|
-
target:
|
|
6819
|
+
callData: O.data,
|
|
6820
|
+
target: O.to
|
|
6821
6821
|
})), R = dn({
|
|
6822
6822
|
abi: Sr,
|
|
6823
6823
|
args: [S],
|
|
@@ -6844,37 +6844,37 @@ async function Eu(t, e) {
|
|
|
6844
6844
|
throw new Vs({ data: m });
|
|
6845
6845
|
return m === "0x" ? { data: void 0 } : { data: m };
|
|
6846
6846
|
}
|
|
6847
|
-
function
|
|
6847
|
+
function Cu(t) {
|
|
6848
6848
|
const { code: e, data: n } = t;
|
|
6849
6849
|
return cs({
|
|
6850
6850
|
abi: zs(["constructor(bytes, bytes)"]),
|
|
6851
|
-
bytecode:
|
|
6851
|
+
bytecode: vu,
|
|
6852
6852
|
args: [e, n]
|
|
6853
6853
|
});
|
|
6854
6854
|
}
|
|
6855
|
-
function
|
|
6855
|
+
function Tu(t) {
|
|
6856
6856
|
const { data: e, factory: n, factoryData: r, to: s } = t;
|
|
6857
6857
|
return cs({
|
|
6858
6858
|
abi: zs(["constructor(address, bytes, address, bytes)"]),
|
|
6859
|
-
bytecode:
|
|
6859
|
+
bytecode: wu,
|
|
6860
6860
|
args: [s, e, n, r]
|
|
6861
6861
|
});
|
|
6862
6862
|
}
|
|
6863
|
-
function
|
|
6863
|
+
function $u(t) {
|
|
6864
6864
|
var n;
|
|
6865
6865
|
if (!(t instanceof y))
|
|
6866
6866
|
return;
|
|
6867
6867
|
const e = t.walk();
|
|
6868
6868
|
return typeof (e == null ? void 0 : e.data) == "object" ? (n = e.data) == null ? void 0 : n.data : e.data;
|
|
6869
6869
|
}
|
|
6870
|
-
async function
|
|
6870
|
+
async function ku(t, e) {
|
|
6871
6871
|
const { abi: n, address: r, args: s, functionName: a, ...i } = e, o = dn({
|
|
6872
6872
|
abi: n,
|
|
6873
6873
|
args: s,
|
|
6874
6874
|
functionName: a
|
|
6875
6875
|
});
|
|
6876
6876
|
try {
|
|
6877
|
-
const { data: u } = await
|
|
6877
|
+
const { data: u } = await Z(t, Us, "call")({
|
|
6878
6878
|
...i,
|
|
6879
6879
|
data: o,
|
|
6880
6880
|
to: r
|
|
@@ -6895,11 +6895,11 @@ async function Tu(t, e) {
|
|
|
6895
6895
|
});
|
|
6896
6896
|
}
|
|
6897
6897
|
}
|
|
6898
|
-
async function
|
|
6898
|
+
async function Iu(t) {
|
|
6899
6899
|
return new Promise((e) => setTimeout(e, t));
|
|
6900
6900
|
}
|
|
6901
6901
|
const zt = /* @__PURE__ */ new sn(8192);
|
|
6902
|
-
function
|
|
6902
|
+
function Su(t, { enabled: e = !0, id: n }) {
|
|
6903
6903
|
if (!e || !n)
|
|
6904
6904
|
return t();
|
|
6905
6905
|
if (zt.get(n))
|
|
@@ -6907,12 +6907,12 @@ function Iu(t, { enabled: e = !0, id: n }) {
|
|
|
6907
6907
|
const r = t().finally(() => zt.delete(n));
|
|
6908
6908
|
return zt.set(n, r), r;
|
|
6909
6909
|
}
|
|
6910
|
-
function
|
|
6910
|
+
function Ru(t, { delay: e = 100, retryCount: n = 2, shouldRetry: r = () => !0 } = {}) {
|
|
6911
6911
|
return new Promise((s, a) => {
|
|
6912
6912
|
const i = async ({ count: o = 0 } = {}) => {
|
|
6913
6913
|
const u = async ({ error: c }) => {
|
|
6914
6914
|
const d = typeof e == "function" ? e({ count: o, error: c }) : e;
|
|
6915
|
-
d && await
|
|
6915
|
+
d && await Iu(d), i({ count: o + 1 });
|
|
6916
6916
|
};
|
|
6917
6917
|
try {
|
|
6918
6918
|
const c = await t();
|
|
@@ -6926,13 +6926,13 @@ function Su(t, { delay: e = 100, retryCount: n = 2, shouldRetry: r = () => !0 }
|
|
|
6926
6926
|
i();
|
|
6927
6927
|
});
|
|
6928
6928
|
}
|
|
6929
|
-
function
|
|
6929
|
+
function Mu(t, e = {}) {
|
|
6930
6930
|
return async (n, r = {}) => {
|
|
6931
6931
|
const { dedupe: s = !1, retryDelay: a = 150, retryCount: i = 3, uid: o } = {
|
|
6932
6932
|
...e,
|
|
6933
6933
|
...r
|
|
6934
6934
|
}, u = s ? Nt(Jn(`${o}.${cn(n)}`)) : void 0;
|
|
6935
|
-
return
|
|
6935
|
+
return Su(() => Ru(async () => {
|
|
6936
6936
|
try {
|
|
6937
6937
|
return await t(n);
|
|
6938
6938
|
} catch (c) {
|
|
@@ -6946,40 +6946,40 @@ function Ru(t, e = {}) {
|
|
|
6946
6946
|
throw new _t(d, { method: n.method });
|
|
6947
6947
|
case Pt.code:
|
|
6948
6948
|
throw new Pt(d);
|
|
6949
|
-
case
|
|
6950
|
-
throw new
|
|
6949
|
+
case Me.code:
|
|
6950
|
+
throw new Me(d);
|
|
6951
6951
|
case Et.code:
|
|
6952
6952
|
throw new Et(d);
|
|
6953
6953
|
case At.code:
|
|
6954
6954
|
throw new At(d);
|
|
6955
6955
|
case Ct.code:
|
|
6956
6956
|
throw new Ct(d);
|
|
6957
|
-
case kt.code:
|
|
6958
|
-
throw new kt(d);
|
|
6959
6957
|
case Tt.code:
|
|
6960
|
-
throw new Tt(d
|
|
6958
|
+
throw new Tt(d);
|
|
6959
|
+
case $t.code:
|
|
6960
|
+
throw new $t(d, {
|
|
6961
6961
|
method: n.method
|
|
6962
6962
|
});
|
|
6963
6963
|
case Ke.code:
|
|
6964
6964
|
throw new Ke(d);
|
|
6965
|
-
case
|
|
6966
|
-
throw new
|
|
6967
|
-
case
|
|
6968
|
-
throw new
|
|
6965
|
+
case kt.code:
|
|
6966
|
+
throw new kt(d);
|
|
6967
|
+
case De.code:
|
|
6968
|
+
throw new De(d);
|
|
6969
6969
|
case It.code:
|
|
6970
6970
|
throw new It(d);
|
|
6971
6971
|
case St.code:
|
|
6972
6972
|
throw new St(d);
|
|
6973
6973
|
case Rt.code:
|
|
6974
6974
|
throw new Rt(d);
|
|
6975
|
-
case Ot.code:
|
|
6976
|
-
throw new Ot(d);
|
|
6977
6975
|
case Mt.code:
|
|
6978
6976
|
throw new Mt(d);
|
|
6977
|
+
case Ot.code:
|
|
6978
|
+
throw new Ot(d);
|
|
6979
6979
|
case 5e3:
|
|
6980
|
-
throw new
|
|
6980
|
+
throw new De(d);
|
|
6981
6981
|
default:
|
|
6982
|
-
throw c instanceof y ? c : new
|
|
6982
|
+
throw c instanceof y ? c : new Io(d);
|
|
6983
6983
|
}
|
|
6984
6984
|
}
|
|
6985
6985
|
}, {
|
|
@@ -6998,12 +6998,12 @@ function Ru(t, e = {}) {
|
|
|
6998
6998
|
};
|
|
6999
6999
|
}
|
|
7000
7000
|
function Ou(t) {
|
|
7001
|
-
return "code" in t && typeof t.code == "number" ? t.code === -1 || t.code === Ke.code || t.code ===
|
|
7001
|
+
return "code" in t && typeof t.code == "number" ? t.code === -1 || t.code === Ke.code || t.code === Me.code : t instanceof ys && t.status ? t.status === 403 || t.status === 408 || t.status === 413 || t.status === 429 || t.status === 500 || t.status === 502 || t.status === 503 || t.status === 504 : !0;
|
|
7002
7002
|
}
|
|
7003
|
-
async function
|
|
7003
|
+
async function ju(t, e) {
|
|
7004
7004
|
const { abi: n, address: r, args: s, dataSuffix: a, functionName: i, ...o } = e, u = o.account ? ue(o.account) : t.account, c = dn({ abi: n, args: s, functionName: i });
|
|
7005
7005
|
try {
|
|
7006
|
-
const { data: d } = await
|
|
7006
|
+
const { data: d } = await Z(t, Us, "call")({
|
|
7007
7007
|
batch: !1,
|
|
7008
7008
|
data: `${c}${a ? a.replace("0x", "") : ""}`,
|
|
7009
7009
|
to: r,
|
|
@@ -7038,7 +7038,7 @@ async function Mu(t, e) {
|
|
|
7038
7038
|
});
|
|
7039
7039
|
}
|
|
7040
7040
|
}
|
|
7041
|
-
async function
|
|
7041
|
+
async function Bu(t, e) {
|
|
7042
7042
|
const { abi: n, account: r = t.account, address: s, args: a, dataSuffix: i, functionName: o, ...u } = e;
|
|
7043
7043
|
if (typeof r > "u")
|
|
7044
7044
|
throw new us({
|
|
@@ -7050,7 +7050,7 @@ async function ju(t, e) {
|
|
|
7050
7050
|
functionName: o
|
|
7051
7051
|
});
|
|
7052
7052
|
try {
|
|
7053
|
-
return await
|
|
7053
|
+
return await Z(t, oc, "sendTransaction")({
|
|
7054
7054
|
data: `${d}${i ? i.replace("0x", "") : ""}`,
|
|
7055
7055
|
to: s,
|
|
7056
7056
|
account: c,
|
|
@@ -7068,16 +7068,16 @@ async function ju(t, e) {
|
|
|
7068
7068
|
}
|
|
7069
7069
|
}
|
|
7070
7070
|
const Gn = 256;
|
|
7071
|
-
let
|
|
7071
|
+
let Zt = Gn, Dt;
|
|
7072
7072
|
function Gs(t = 11) {
|
|
7073
|
-
if (!
|
|
7074
|
-
|
|
7073
|
+
if (!Dt || Zt + t > Gn * 2) {
|
|
7074
|
+
Dt = "", Zt = 0;
|
|
7075
7075
|
for (let e = 0; e < Gn; e++)
|
|
7076
|
-
|
|
7076
|
+
Dt += (256 + Math.random() * 256 | 0).toString(16).substring(1);
|
|
7077
7077
|
}
|
|
7078
|
-
return
|
|
7078
|
+
return Dt.substring(Zt, Zt++ + t);
|
|
7079
7079
|
}
|
|
7080
|
-
function
|
|
7080
|
+
function Nu(t) {
|
|
7081
7081
|
const { batch: e, cacheTime: n = t.pollingInterval ?? 4e3, ccipRead: r, key: s = "base", name: a = "Base Client", pollingInterval: i = 4e3, type: o = "base" } = t, u = t.chain, c = t.account ? ue(t.account) : void 0, { config: d, request: l, value: f } = t.transport({
|
|
7082
7082
|
chain: u,
|
|
7083
7083
|
pollingInterval: i
|
|
@@ -7095,18 +7095,18 @@ function Bu(t) {
|
|
|
7095
7095
|
type: o,
|
|
7096
7096
|
uid: Gs()
|
|
7097
7097
|
};
|
|
7098
|
-
function
|
|
7098
|
+
function $(P) {
|
|
7099
7099
|
return (S) => {
|
|
7100
7100
|
const R = S(P);
|
|
7101
|
-
for (const
|
|
7102
|
-
delete R[
|
|
7101
|
+
for (const O in v)
|
|
7102
|
+
delete R[O];
|
|
7103
7103
|
const A = { ...P, ...R };
|
|
7104
|
-
return Object.assign(A, { extend:
|
|
7104
|
+
return Object.assign(A, { extend: $(A) });
|
|
7105
7105
|
};
|
|
7106
7106
|
}
|
|
7107
|
-
return Object.assign(v, { extend:
|
|
7107
|
+
return Object.assign(v, { extend: $(v) });
|
|
7108
7108
|
}
|
|
7109
|
-
function
|
|
7109
|
+
function Fu({ key: t, name: e, request: n, retryCount: r = 3, retryDelay: s = 150, timeout: a, type: i }, o) {
|
|
7110
7110
|
const u = Gs();
|
|
7111
7111
|
return {
|
|
7112
7112
|
config: {
|
|
@@ -7118,13 +7118,13 @@ function Nu({ key: t, name: e, request: n, retryCount: r = 3, retryDelay: s = 15
|
|
|
7118
7118
|
timeout: a,
|
|
7119
7119
|
type: i
|
|
7120
7120
|
},
|
|
7121
|
-
request:
|
|
7121
|
+
request: Mu(n, { retryCount: r, retryDelay: s, uid: u }),
|
|
7122
7122
|
value: o
|
|
7123
7123
|
};
|
|
7124
7124
|
}
|
|
7125
|
-
function
|
|
7125
|
+
function zu(t, e = {}) {
|
|
7126
7126
|
const { key: n = "custom", name: r = "Custom Provider", retryDelay: s } = e;
|
|
7127
|
-
return ({ retryCount: a }) =>
|
|
7127
|
+
return ({ retryCount: a }) => Fu({
|
|
7128
7128
|
key: n,
|
|
7129
7129
|
name: r,
|
|
7130
7130
|
request: t.request.bind(t),
|
|
@@ -7200,18 +7200,18 @@ function pr(t, e, n) {
|
|
|
7200
7200
|
const s = t[n];
|
|
7201
7201
|
return typeof s == "function" ? s : (a) => e(t, a);
|
|
7202
7202
|
}
|
|
7203
|
-
const
|
|
7204
|
-
var
|
|
7203
|
+
const Zu = "2.13.8", Du = () => `@wagmi/core@${Zu}`;
|
|
7204
|
+
var qs = function(t, e, n, r) {
|
|
7205
7205
|
if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
7206
7206
|
if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
7207
7207
|
return n === "m" ? r : n === "a" ? r.call(t) : r ? r.value : e.get(t);
|
|
7208
7208
|
}, en, Ws;
|
|
7209
|
-
class
|
|
7209
|
+
class Oe extends Error {
|
|
7210
7210
|
get docsBaseUrl() {
|
|
7211
7211
|
return "https://wagmi.sh/core";
|
|
7212
7212
|
}
|
|
7213
7213
|
get version() {
|
|
7214
|
-
return
|
|
7214
|
+
return Du();
|
|
7215
7215
|
}
|
|
7216
7216
|
constructor(e, n = {}) {
|
|
7217
7217
|
var r;
|
|
@@ -7241,7 +7241,7 @@ class Me extends Error {
|
|
|
7241
7241
|
writable: !0,
|
|
7242
7242
|
value: "WagmiCoreError"
|
|
7243
7243
|
});
|
|
7244
|
-
const s = n.cause instanceof
|
|
7244
|
+
const s = n.cause instanceof Oe ? n.cause.details : (r = n.cause) != null && r.message ? n.cause.message : n.details, a = n.cause instanceof Oe && n.cause.docsPath || n.docsPath;
|
|
7245
7245
|
this.message = [
|
|
7246
7246
|
e || "An error occurred.",
|
|
7247
7247
|
"",
|
|
@@ -7255,13 +7255,13 @@ class Me extends Error {
|
|
|
7255
7255
|
`), n.cause && (this.cause = n.cause), this.details = s, this.docsPath = a, this.metaMessages = n.metaMessages, this.shortMessage = e;
|
|
7256
7256
|
}
|
|
7257
7257
|
walk(e) {
|
|
7258
|
-
return
|
|
7258
|
+
return qs(this, en, "m", Ws).call(this, this, e);
|
|
7259
7259
|
}
|
|
7260
7260
|
}
|
|
7261
7261
|
en = /* @__PURE__ */ new WeakSet(), Ws = function t(e, n) {
|
|
7262
|
-
return n != null && n(e) ? e : e.cause ?
|
|
7262
|
+
return n != null && n(e) ? e : e.cause ? qs(this, en, "m", t).call(this, e.cause, n) : e;
|
|
7263
7263
|
};
|
|
7264
|
-
class
|
|
7264
|
+
class Lu extends Oe {
|
|
7265
7265
|
constructor() {
|
|
7266
7266
|
super("Connector not connected."), Object.defineProperty(this, "name", {
|
|
7267
7267
|
enumerable: !0,
|
|
@@ -7271,7 +7271,7 @@ class Zu extends Me {
|
|
|
7271
7271
|
});
|
|
7272
7272
|
}
|
|
7273
7273
|
}
|
|
7274
|
-
class
|
|
7274
|
+
class Vu extends Oe {
|
|
7275
7275
|
constructor({ address: e, connector: n }) {
|
|
7276
7276
|
super(`Account "${e}" not found for connector "${n.name}".`), Object.defineProperty(this, "name", {
|
|
7277
7277
|
enumerable: !0,
|
|
@@ -7281,7 +7281,7 @@ class Du extends Me {
|
|
|
7281
7281
|
});
|
|
7282
7282
|
}
|
|
7283
7283
|
}
|
|
7284
|
-
class
|
|
7284
|
+
class Uu extends Oe {
|
|
7285
7285
|
constructor({ connectionChainId: e, connectorChainId: n }) {
|
|
7286
7286
|
super(`The current chain of the connector (id: ${n}) does not match the connection's chain (id: ${e}).`, {
|
|
7287
7287
|
metaMessages: [
|
|
@@ -7296,7 +7296,7 @@ class Vu extends Me {
|
|
|
7296
7296
|
});
|
|
7297
7297
|
}
|
|
7298
7298
|
}
|
|
7299
|
-
class
|
|
7299
|
+
class Gu extends Oe {
|
|
7300
7300
|
constructor({ connector: e }) {
|
|
7301
7301
|
super(`Connector "${e.name}" unavailable while reconnecting.`, {
|
|
7302
7302
|
details: [
|
|
@@ -7312,12 +7312,12 @@ class Uu extends Me {
|
|
|
7312
7312
|
});
|
|
7313
7313
|
}
|
|
7314
7314
|
}
|
|
7315
|
-
async function
|
|
7315
|
+
async function Hs(t, e = {}) {
|
|
7316
7316
|
let n;
|
|
7317
7317
|
if (e.connector) {
|
|
7318
7318
|
const { connector: c } = e;
|
|
7319
7319
|
if (t.state.status === "reconnecting" && !c.getAccounts && !c.getChainId)
|
|
7320
|
-
throw new
|
|
7320
|
+
throw new Gu({ connector: c });
|
|
7321
7321
|
const [d, l] = await Promise.all([
|
|
7322
7322
|
c.getAccounts(),
|
|
7323
7323
|
c.getChainId()
|
|
@@ -7330,10 +7330,10 @@ async function qs(t, e = {}) {
|
|
|
7330
7330
|
} else
|
|
7331
7331
|
n = t.state.connections.get(t.state.current);
|
|
7332
7332
|
if (!n)
|
|
7333
|
-
throw new
|
|
7333
|
+
throw new Lu();
|
|
7334
7334
|
const r = e.chainId ?? n.chainId, s = await n.connector.getChainId();
|
|
7335
7335
|
if (s !== n.chainId)
|
|
7336
|
-
throw new
|
|
7336
|
+
throw new Uu({
|
|
7337
7337
|
connectionChainId: n.chainId,
|
|
7338
7338
|
connectorChainId: s
|
|
7339
7339
|
});
|
|
@@ -7341,27 +7341,27 @@ async function qs(t, e = {}) {
|
|
|
7341
7341
|
if (a.getClient)
|
|
7342
7342
|
return a.getClient({ chainId: r });
|
|
7343
7343
|
const i = ue(e.account ?? n.accounts[0]);
|
|
7344
|
-
if (i.address =
|
|
7345
|
-
throw new
|
|
7344
|
+
if (i.address = Yi(i.address), e.account && !n.accounts.some((c) => c.toLowerCase() === i.address.toLowerCase()))
|
|
7345
|
+
throw new Vu({
|
|
7346
7346
|
address: i.address,
|
|
7347
7347
|
connector: a
|
|
7348
7348
|
});
|
|
7349
7349
|
const o = t.chains.find((c) => c.id === r), u = await n.connector.getProvider({ chainId: r });
|
|
7350
|
-
return
|
|
7350
|
+
return Nu({
|
|
7351
7351
|
account: i,
|
|
7352
7352
|
chain: o,
|
|
7353
7353
|
name: "Connector Client",
|
|
7354
|
-
transport: (c) =>
|
|
7354
|
+
transport: (c) => zu(u)({ ...c, retryCount: 0 })
|
|
7355
7355
|
});
|
|
7356
7356
|
}
|
|
7357
|
-
async function
|
|
7357
|
+
async function qn(t, e) {
|
|
7358
7358
|
const { abi: n, chainId: r, connector: s, ...a } = e;
|
|
7359
7359
|
let i;
|
|
7360
|
-
e.account ? i = e.account : i = (await
|
|
7360
|
+
e.account ? i = e.account : i = (await Hs(t, {
|
|
7361
7361
|
chainId: r,
|
|
7362
7362
|
connector: s
|
|
7363
7363
|
})).account;
|
|
7364
|
-
const o = t.getClient({ chainId: r }), u = pr(o,
|
|
7364
|
+
const o = t.getClient({ chainId: r }), u = pr(o, ju, "simulateContract"), { result: c, request: d } = await u({ ...a, abi: n, account: i });
|
|
7365
7365
|
return {
|
|
7366
7366
|
chainId: o.chain.id,
|
|
7367
7367
|
result: c,
|
|
@@ -7372,13 +7372,13 @@ function mr(t) {
|
|
|
7372
7372
|
return t.address !== void 0 && typeof t.address == "object" ? (e, n) => {
|
|
7373
7373
|
var r;
|
|
7374
7374
|
const s = hr(e), a = ln(e), i = (n == null ? void 0 : n.chainId) ?? a.chainId ?? s;
|
|
7375
|
-
return
|
|
7375
|
+
return qn(e, {
|
|
7376
7376
|
...n,
|
|
7377
7377
|
...t.functionName ? { functionName: t.functionName } : {},
|
|
7378
7378
|
address: (r = t.address) == null ? void 0 : r[i],
|
|
7379
7379
|
abi: t.abi
|
|
7380
7380
|
});
|
|
7381
|
-
} : (e, n) =>
|
|
7381
|
+
} : (e, n) => qn(e, {
|
|
7382
7382
|
...n,
|
|
7383
7383
|
...t.address ? { address: t.address } : {},
|
|
7384
7384
|
...t.functionName ? { functionName: t.functionName } : {},
|
|
@@ -7387,7 +7387,7 @@ function mr(t) {
|
|
|
7387
7387
|
}
|
|
7388
7388
|
function jr(t, e) {
|
|
7389
7389
|
const { chainId: n, ...r } = e, s = t.getClient({ chainId: n });
|
|
7390
|
-
return pr(s,
|
|
7390
|
+
return pr(s, ku, "readContract")(r);
|
|
7391
7391
|
}
|
|
7392
7392
|
function Ks(t) {
|
|
7393
7393
|
return t.address !== void 0 && typeof t.address == "object" ? (e, n) => {
|
|
@@ -7409,20 +7409,20 @@ function Ks(t) {
|
|
|
7409
7409
|
async function Br(t, e) {
|
|
7410
7410
|
const { account: n, chainId: r, connector: s, __mode: a, ...i } = e;
|
|
7411
7411
|
let o;
|
|
7412
|
-
typeof n == "object" && n.type === "local" ? o = t.getClient({ chainId: r }) : o = await
|
|
7412
|
+
typeof n == "object" && n.type === "local" ? o = t.getClient({ chainId: r }) : o = await Hs(t, { account: n, chainId: r, connector: s });
|
|
7413
7413
|
const { connector: u } = ln(t);
|
|
7414
7414
|
let c;
|
|
7415
7415
|
if (a === "prepared" || u != null && u.supportsSimulation)
|
|
7416
7416
|
c = i;
|
|
7417
7417
|
else {
|
|
7418
|
-
const { request: d } = await
|
|
7418
|
+
const { request: d } = await qn(t, {
|
|
7419
7419
|
...i,
|
|
7420
7420
|
account: n,
|
|
7421
7421
|
chainId: r
|
|
7422
7422
|
});
|
|
7423
7423
|
c = d;
|
|
7424
7424
|
}
|
|
7425
|
-
return await pr(o,
|
|
7425
|
+
return await pr(o, Bu, "writeContract")({
|
|
7426
7426
|
...c,
|
|
7427
7427
|
...n ? { account: n } : {},
|
|
7428
7428
|
chain: r ? { id: r } : null
|
|
@@ -7452,6 +7452,7 @@ const be = [
|
|
|
7452
7452
|
{ type: "error", inputs: [], name: "InsufficientAllowance" },
|
|
7453
7453
|
{ type: "error", inputs: [], name: "InsufficientBalance" },
|
|
7454
7454
|
{ type: "error", inputs: [], name: "InvalidPermit" },
|
|
7455
|
+
{ type: "error", inputs: [], name: "Permit2AllowanceIsFixedAtInfinity" },
|
|
7455
7456
|
{ type: "error", inputs: [], name: "PermitExpired" },
|
|
7456
7457
|
{ type: "error", inputs: [], name: "TotalSupplyOverflow" },
|
|
7457
7458
|
{
|
|
@@ -7619,34 +7620,34 @@ const be = [
|
|
|
7619
7620
|
outputs: [{ name: "", internalType: "bool", type: "bool" }],
|
|
7620
7621
|
stateMutability: "nonpayable"
|
|
7621
7622
|
}
|
|
7622
|
-
],
|
|
7623
|
+
], qu = /* @__PURE__ */ Ks({
|
|
7623
7624
|
abi: be,
|
|
7624
7625
|
functionName: "allowance"
|
|
7625
|
-
}),
|
|
7626
|
+
}), Wu = /* @__PURE__ */ Ks({
|
|
7626
7627
|
abi: be,
|
|
7627
7628
|
functionName: "balanceOf"
|
|
7628
|
-
}),
|
|
7629
|
+
}), Hu = /* @__PURE__ */ yr({
|
|
7629
7630
|
abi: be,
|
|
7630
7631
|
functionName: "approve"
|
|
7631
|
-
}),
|
|
7632
|
+
}), Ku = /* @__PURE__ */ yr({
|
|
7632
7633
|
abi: be,
|
|
7633
7634
|
functionName: "mint"
|
|
7634
|
-
}),
|
|
7635
|
+
}), Ju = /* @__PURE__ */ yr({
|
|
7635
7636
|
abi: be,
|
|
7636
7637
|
functionName: "mintPayable"
|
|
7637
|
-
}),
|
|
7638
|
+
}), Yu = /* @__PURE__ */ mr({
|
|
7638
7639
|
abi: be,
|
|
7639
7640
|
functionName: "approve"
|
|
7640
|
-
}),
|
|
7641
|
+
}), Xu = /* @__PURE__ */ mr({
|
|
7641
7642
|
abi: be,
|
|
7642
7643
|
functionName: "mint"
|
|
7643
|
-
}),
|
|
7644
|
+
}), Qu = /* @__PURE__ */ mr({
|
|
7644
7645
|
abi: be,
|
|
7645
7646
|
functionName: "mintPayable"
|
|
7646
|
-
}),
|
|
7647
|
+
}), ed = "0x6080604052348015600e575f80fd5b50610b398061001c5f395ff3fe6080604052600436106100d9575f3560e01c806340c10f191161007c57806395d89b411161005757806395d89b4114610323578063a9059cbb14610368578063d505accf14610387578063dd62ed3e146103a6575f80fd5b806340c10f19146102a257806370a08231146102c15780637ecebe00146102f2575f80fd5b806318160ddd116100b757806318160ddd1461017857806323b872dd1461019e578063313ce567146101bd5780633644e515146101d8575f80fd5b806306fdde03146100dd578063095ea7b31461013457806317d304b014610163575b5f80fd5b3480156100e8575f80fd5b5060408051808201909152600a81527f4d6f636b2045524332300000000000000000000000000000000000000000000060208201525b60405161012b9190610930565b60405180910390f35b34801561013f575f80fd5b5061015361014e3660046109ab565b6103c5565b604051901515815260200161012b565b6101766101713660046109ab565b610452565b005b348015610183575f80fd5b506805345cdf77eb68f44c545b60405190815260200161012b565b3480156101a9575f80fd5b506101536101b83660046109d3565b6104d8565b3480156101c8575f80fd5b506040516012815260200161012b565b3480156101e3575f80fd5b50604080518082018252600a81527f4d6f636b2045524332300000000000000000000000000000000000000000000060209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527fa5c9260bf133e670eeaf4d41f5c4289fc23bb146bf11ba8fa70a2ea91ba1a330918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69181019190915246606082015230608082015260a09020610190565b3480156102ad575f80fd5b506101766102bc3660046109ab565b6104ca565b3480156102cc575f80fd5b506101906102db366004610a0d565b6387a211a2600c9081525f91909152602090205490565b3480156102fd575f80fd5b5061019061030c366004610a0d565b6338377508600c9081525f91909152602090205490565b34801561032e575f80fd5b5060408051808201909152600481527f4d4f434b00000000000000000000000000000000000000000000000000000000602082015261011e565b348015610373575f80fd5b506101536103823660046109ab565b6105a7565b348015610392575f80fd5b506101766103a1366004610a2d565b61061e565b3480156103b1575f80fd5b506101906103c0366004610a9a565b610834565b5f73ffffffffffffffffffffffffffffffffffffffff83166e22d473030f116ddee9f6b43ac78ba3188219151761040357633f68539a5f526004601cfd5b82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa35060015b92915050565b61045d606482610acb565b3410156104ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e65792100000000604482015260640160405180910390fd5b6104d482826108b4565b5050565b5f8360601b6e22d473030f116ddee9f6b43ac78ba3331461052d5733602052637f5e9f208117600c526034600c20805480191561052a5780851115610524576313be252b5f526004601cfd5b84810382555b50505b6387a211a28117600c526020600c208054808511156105535763f4d678b85f526004601cfd5b84810382555050835f526020600c208381540181555082602052600c5160601c8160601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505060019392505050565b5f6387a211a2600c52335f526020600c208054808411156105cf5763f4d678b85f526004601cfd5b83810382555050825f526020600c208281540181555081602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff86166e22d473030f116ddee9f6b43ac78ba3188519151761065b57633f68539a5f526004601cfd5b60408051808201909152600a81527f4d6f636b204552433230000000000000000000000000000000000000000000006020909101527fa5c9260bf133e670eeaf4d41f5c4289fc23bb146bf11ba8fa70a2ea91ba1a3307fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6428610156106e757631a15a3cc5f526004601cfd5b6040518960601b60601c99508860601b60601c985065383775081901600e52895f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f835284602084015283604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528b60208401528a60408401528960608401528060808401528860a084015260c08320604e526042602c205f528760ff16602052866040528560605260208060805f60015afa8c3d51146107cf5763ddafbaef5f526004601cfd5b019055777f5e9f20000000000000000000000000000000000000000089176040526034602c20889055888a7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608501a360405250505f60605250505050505050565b5f7fffffffffffffffffffffffffffffffffffdd2b8cfcf0ee922116094bc538745d73ffffffffffffffffffffffffffffffffffffffff83160161089957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61044c565b50602052637f5e9f20600c9081525f91909152603490205490565b6805345cdf77eb68f44c54818101818110156108d75763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c5550506387a211a2600c52815f526020600c208181540181555080602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146109a6575f80fd5b919050565b5f80604083850312156109bc575f80fd5b6109c583610983565b946020939093013593505050565b5f805f606084860312156109e5575f80fd5b6109ee84610983565b92506109fc60208501610983565b929592945050506040919091013590565b5f60208284031215610a1d575f80fd5b610a2682610983565b9392505050565b5f805f805f805f60e0888a031215610a43575f80fd5b610a4c88610983565b9650610a5a60208901610983565b95506040880135945060608801359350608088013560ff81168114610a7d575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215610aab575f80fd5b610ab483610983565b9150610ac260208401610983565b90509250929050565b5f82610afe577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220f5df3612b8f8d82660db05f290d8446fb4142408d492fd3d2eb82b366b3cf76964736f6c634300081a0033";
|
|
7647
7648
|
class Js extends ra {
|
|
7648
7649
|
async balanceOf(e, n) {
|
|
7649
|
-
return await
|
|
7650
|
+
return await Wu(this._config, {
|
|
7650
7651
|
address: this.assertValidAddress(),
|
|
7651
7652
|
args: [e],
|
|
7652
7653
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -7654,7 +7655,7 @@ class Js extends ra {
|
|
|
7654
7655
|
});
|
|
7655
7656
|
}
|
|
7656
7657
|
async allowance(e, n, r) {
|
|
7657
|
-
return await
|
|
7658
|
+
return await qu(this._config, {
|
|
7658
7659
|
address: this.assertValidAddress(),
|
|
7659
7660
|
args: [e, n],
|
|
7660
7661
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -7665,27 +7666,27 @@ class Js extends ra {
|
|
|
7665
7666
|
return await this.awaitResult(this.approveRaw(e, n, r));
|
|
7666
7667
|
}
|
|
7667
7668
|
async approveRaw(e, n, r) {
|
|
7668
|
-
const { request: s, result: a } = await
|
|
7669
|
+
const { request: s, result: a } = await Yu(this._config, {
|
|
7669
7670
|
address: this.assertValidAddress(),
|
|
7670
7671
|
args: [e, n],
|
|
7671
7672
|
...this.optionallyAttachAccount(),
|
|
7672
7673
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
7673
7674
|
...r
|
|
7674
7675
|
});
|
|
7675
|
-
return { hash: await
|
|
7676
|
+
return { hash: await Hu(this._config, s), result: a };
|
|
7676
7677
|
}
|
|
7677
7678
|
async mint(e, n, r) {
|
|
7678
7679
|
return await this.awaitResult(this.mintRaw(e, n, r));
|
|
7679
7680
|
}
|
|
7680
7681
|
async mintRaw(e, n, r) {
|
|
7681
|
-
const { request: s, result: a } = await
|
|
7682
|
+
const { request: s, result: a } = await Xu(this._config, {
|
|
7682
7683
|
address: this.assertValidAddress(),
|
|
7683
7684
|
args: [e, n],
|
|
7684
7685
|
...this.optionallyAttachAccount(),
|
|
7685
7686
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
7686
7687
|
...r
|
|
7687
7688
|
});
|
|
7688
|
-
return { hash: await
|
|
7689
|
+
return { hash: await Ku(this._config, s), result: a };
|
|
7689
7690
|
}
|
|
7690
7691
|
async mintPayable(e, n, r) {
|
|
7691
7692
|
return await this.awaitResult(
|
|
@@ -7694,7 +7695,7 @@ class Js extends ra {
|
|
|
7694
7695
|
);
|
|
7695
7696
|
}
|
|
7696
7697
|
async mintPayableRaw(e, n, r) {
|
|
7697
|
-
const { request: s, result: a } = await
|
|
7698
|
+
const { request: s, result: a } = await Qu(
|
|
7698
7699
|
this._config,
|
|
7699
7700
|
{
|
|
7700
7701
|
address: this.assertValidAddress(),
|
|
@@ -7704,18 +7705,18 @@ class Js extends ra {
|
|
|
7704
7705
|
...r
|
|
7705
7706
|
}
|
|
7706
7707
|
);
|
|
7707
|
-
return { hash: await
|
|
7708
|
+
return { hash: await Ju(this._config, s), result: a };
|
|
7708
7709
|
}
|
|
7709
7710
|
buildParameters(e = {}, n) {
|
|
7710
7711
|
const [, r] = this.validateDeploymentConfig(e, n);
|
|
7711
7712
|
return {
|
|
7712
7713
|
abi: be,
|
|
7713
|
-
bytecode:
|
|
7714
|
+
bytecode: ed,
|
|
7714
7715
|
...this.optionallyAttachAccount(r.account)
|
|
7715
7716
|
};
|
|
7716
7717
|
}
|
|
7717
7718
|
}
|
|
7718
|
-
const
|
|
7719
|
+
const td = [
|
|
7719
7720
|
{
|
|
7720
7721
|
account: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
7721
7722
|
key: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
|
|
@@ -7758,52 +7759,52 @@ const ed = [
|
|
|
7758
7759
|
}
|
|
7759
7760
|
].map((t) => ({
|
|
7760
7761
|
...t,
|
|
7761
|
-
privateKey:
|
|
7762
|
-
})),
|
|
7763
|
-
const r = n.privateKey, s = n.mnemonic ??
|
|
7762
|
+
privateKey: pa(t.key)
|
|
7763
|
+
})), nd = "test test test test test test test test test test test junk", $d = async function(e, n) {
|
|
7764
|
+
const r = n.privateKey, s = n.mnemonic ?? nd, a = n.chain || "anvil", [{ config: i, account: o }, u] = va({
|
|
7764
7765
|
chain: a,
|
|
7765
7766
|
rpcUrl: n.rpcUrl,
|
|
7766
7767
|
privateKey: r,
|
|
7767
7768
|
mnemonic: s
|
|
7768
7769
|
}), c = u.id;
|
|
7769
7770
|
if (e.at(0) === "generate")
|
|
7770
|
-
return
|
|
7771
|
+
return Pd({ account: o == null ? void 0 : o.address, chainId: c });
|
|
7771
7772
|
if (e.at(0) === "erc20") {
|
|
7772
7773
|
let A = new Js({ config: i, account: o }, {});
|
|
7773
7774
|
return await A.deploy(), {
|
|
7774
7775
|
erc20: A.assertValidAddress()
|
|
7775
7776
|
};
|
|
7776
7777
|
}
|
|
7777
|
-
const d =
|
|
7778
|
+
const d = aa[c];
|
|
7778
7779
|
if (!d)
|
|
7779
7780
|
throw new Error(
|
|
7780
7781
|
`Unable to select a deployed BoostRegistry with chain ID ${c}`
|
|
7781
7782
|
);
|
|
7782
|
-
const l = new
|
|
7783
|
+
const l = new ia({
|
|
7783
7784
|
config: i,
|
|
7784
7785
|
account: o,
|
|
7785
7786
|
address: d
|
|
7786
|
-
}), f =
|
|
7787
|
+
}), f = oa[c];
|
|
7787
7788
|
if (!f)
|
|
7788
7789
|
throw new Error(
|
|
7789
7790
|
`Unable to select a deployed BoostCore with chain ID ${c}`
|
|
7790
7791
|
);
|
|
7791
|
-
const m = new
|
|
7792
|
+
const m = new ca({
|
|
7792
7793
|
config: i,
|
|
7793
7794
|
account: o,
|
|
7794
7795
|
address: f
|
|
7795
7796
|
});
|
|
7796
7797
|
if (!e.length) throw new Error("No seed provided");
|
|
7797
|
-
const v = await Promise.all(e.map(
|
|
7798
|
-
let
|
|
7798
|
+
const v = await Promise.all(e.map(rd));
|
|
7799
|
+
let $, P;
|
|
7799
7800
|
const S = [];
|
|
7800
7801
|
let R;
|
|
7801
7802
|
for (const A of v) {
|
|
7802
|
-
let
|
|
7803
|
+
let O;
|
|
7803
7804
|
if (typeof A.budget == "string" && tn(A.budget))
|
|
7804
|
-
|
|
7805
|
-
else if (An(P, A.budget) &&
|
|
7806
|
-
|
|
7805
|
+
O = m.ManagedBudget(A.budget);
|
|
7806
|
+
else if (An(P, A.budget) && $)
|
|
7807
|
+
O = $;
|
|
7807
7808
|
else {
|
|
7808
7809
|
let C = A.budget;
|
|
7809
7810
|
switch (C.type) {
|
|
@@ -7813,7 +7814,7 @@ const ed = [
|
|
|
7813
7814
|
authorized: [...A.budget.authorized, f],
|
|
7814
7815
|
roles: [...A.budget.roles, En.MANAGER]
|
|
7815
7816
|
};
|
|
7816
|
-
|
|
7817
|
+
O = await l.initialize(
|
|
7817
7818
|
crypto.randomUUID(),
|
|
7818
7819
|
m.ManagedBudget(B)
|
|
7819
7820
|
);
|
|
@@ -7825,15 +7826,15 @@ const ed = [
|
|
|
7825
7826
|
authorized: [...A.budget.authorized, f],
|
|
7826
7827
|
roles: [...A.budget.roles, En.MANAGER]
|
|
7827
7828
|
};
|
|
7828
|
-
|
|
7829
|
+
O = await l.initialize(
|
|
7829
7830
|
crypto.randomUUID(),
|
|
7830
7831
|
m.ManagedBudgetWithFeesV2(B)
|
|
7831
7832
|
);
|
|
7832
7833
|
}
|
|
7833
7834
|
}
|
|
7834
|
-
|
|
7835
|
+
$ = O, P = A.budget, R = O.assertValidAddress();
|
|
7835
7836
|
}
|
|
7836
|
-
const
|
|
7837
|
+
const H = A.incentives.map(async (C) => {
|
|
7837
7838
|
let B = 0n;
|
|
7838
7839
|
switch (C.type) {
|
|
7839
7840
|
case "AllowListIncentive":
|
|
@@ -7841,35 +7842,35 @@ const ed = [
|
|
|
7841
7842
|
case "PointsIncentive":
|
|
7842
7843
|
return m.PointsIncentive(C);
|
|
7843
7844
|
case "ERC20Incentive":
|
|
7844
|
-
return C.strategy === Pn.RAFFLE && (B += C.reward), C.strategy === Pn.POOL && (B += C.reward * C.limit), C.shouldMintAndAllocate && await et(
|
|
7845
|
+
return C.strategy === Pn.RAFFLE && (B += C.reward), C.strategy === Pn.POOL && (B += C.reward * C.limit), C.shouldMintAndAllocate && await et(O, B, C.asset, {
|
|
7845
7846
|
config: i,
|
|
7846
7847
|
account: o
|
|
7847
7848
|
}), m.ERC20Incentive(C);
|
|
7848
|
-
case "
|
|
7849
|
-
return B += C.limit, C.shouldMintAndAllocate && await et(
|
|
7849
|
+
case "ERC20VariableCriteriaIncentiveV2":
|
|
7850
|
+
return B += C.limit, C.shouldMintAndAllocate && await et(O, B, C.asset, {
|
|
7850
7851
|
config: i,
|
|
7851
7852
|
account: o
|
|
7852
|
-
}), m.
|
|
7853
|
-
case "
|
|
7854
|
-
return B += C.limit, C.shouldMintAndAllocate && await et(
|
|
7853
|
+
}), m.ERC20VariableCriteriaIncentiveV2(C);
|
|
7854
|
+
case "ERC20PeggedVariableCriteriaIncentiveV2":
|
|
7855
|
+
return B += C.limit, C.shouldMintAndAllocate && await et(O, B, C.asset, {
|
|
7855
7856
|
config: i,
|
|
7856
7857
|
account: o
|
|
7857
|
-
}), m.
|
|
7858
|
+
}), m.ERC20PeggedVariableCriteriaIncentiveV2(C);
|
|
7858
7859
|
case "ERC20VariableIncentive":
|
|
7859
|
-
return B += C.limit, C.shouldMintAndAllocate && await et(
|
|
7860
|
+
return B += C.limit, C.shouldMintAndAllocate && await et(O, B, C.asset, {
|
|
7860
7861
|
config: i,
|
|
7861
7862
|
account: o
|
|
7862
7863
|
}), m.ERC20VariableIncentive(C);
|
|
7863
7864
|
case "CGDAIncentive":
|
|
7864
|
-
return B += C.totalBudget, C.shouldMintAndAllocate && await et(
|
|
7865
|
+
return B += C.totalBudget, C.shouldMintAndAllocate && await et(O, B, C.asset, {
|
|
7865
7866
|
config: i,
|
|
7866
7867
|
account: o
|
|
7867
7868
|
}), m.CGDAIncentive(C);
|
|
7868
7869
|
}
|
|
7869
|
-
}), F = await Promise.all(
|
|
7870
|
+
}), F = await Promise.all(H), Y = {
|
|
7870
7871
|
protocolFee: A.protocolFee,
|
|
7871
7872
|
maxParticipants: A.maxParticipants,
|
|
7872
|
-
budget:
|
|
7873
|
+
budget: O,
|
|
7873
7874
|
action: m.EventAction(A.action),
|
|
7874
7875
|
allowList: await ea(A, { core: m }),
|
|
7875
7876
|
incentives: F
|
|
@@ -7886,19 +7887,19 @@ const ed = [
|
|
|
7886
7887
|
async function et(t, e, n, r) {
|
|
7887
7888
|
if (n && e) {
|
|
7888
7889
|
let s = new Js(r, n);
|
|
7889
|
-
await
|
|
7890
|
+
await _d(r, s, t, zr(e.toString()));
|
|
7890
7891
|
}
|
|
7891
7892
|
}
|
|
7892
|
-
async function
|
|
7893
|
+
async function rd(t) {
|
|
7893
7894
|
const e = await ta.readFile(na.normalize(t), {
|
|
7894
7895
|
encoding: "utf8"
|
|
7895
7896
|
});
|
|
7896
7897
|
return Qs.parse(JSON.parse(e));
|
|
7897
7898
|
}
|
|
7898
|
-
const
|
|
7899
|
+
const sd = p.custom(ma, "invalid Hex payload"), I = p.string().transform((t, e) => (/^0x[a-fA-F0-9]{40}$/.test(t) || e.addIssue({
|
|
7899
7900
|
code: p.ZodIssueCode.custom,
|
|
7900
7901
|
message: `Invalid Address ${t}`
|
|
7901
|
-
}), t)).pipe(p.custom(tn, "invalid eth address")), Ys = p.coerce.number().min(1).max(2).transform(BigInt).pipe(p.custom()),
|
|
7902
|
+
}), t)).pipe(p.custom(tn, "invalid eth address")), Ys = p.coerce.number().min(1).max(2).transform(BigInt).pipe(p.custom()), ad = p.object({
|
|
7902
7903
|
type: p.literal("ManagedBudgetWithFeesV2"),
|
|
7903
7904
|
owner: I,
|
|
7904
7905
|
authorized: p.array(I),
|
|
@@ -7907,7 +7908,7 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
7907
7908
|
}).refine(
|
|
7908
7909
|
(t) => t.authorized.length === t.roles.length,
|
|
7909
7910
|
"length mismatch authorized and roles"
|
|
7910
|
-
),
|
|
7911
|
+
), id = p.object({
|
|
7911
7912
|
type: p.literal("ManagedBudget"),
|
|
7912
7913
|
owner: I,
|
|
7913
7914
|
authorized: p.array(I),
|
|
@@ -7920,54 +7921,54 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
7920
7921
|
message: "signature must start with `event` or function`"
|
|
7921
7922
|
}).transform((t) => {
|
|
7922
7923
|
if (t.startsWith("function"))
|
|
7923
|
-
return
|
|
7924
|
-
if (t.startsWith("event")) return
|
|
7924
|
+
return ya(ba(t));
|
|
7925
|
+
if (t.startsWith("event")) return ga(t);
|
|
7925
7926
|
throw new Error("unreachable");
|
|
7926
7927
|
})
|
|
7927
|
-
),
|
|
7928
|
+
), od = p.object({
|
|
7928
7929
|
signatureType: p.nativeEnum(st),
|
|
7929
7930
|
signature: fn,
|
|
7930
7931
|
fieldIndex: p.number().nonnegative(),
|
|
7931
7932
|
targetContract: I,
|
|
7932
7933
|
chainid: p.number().nonnegative()
|
|
7933
|
-
}),
|
|
7934
|
+
}), cd = p.object({
|
|
7934
7935
|
filterType: p.nativeEnum(Nr),
|
|
7935
7936
|
fieldType: p.nativeEnum(Fr),
|
|
7936
7937
|
fieldIndex: p.number().nonnegative(),
|
|
7937
|
-
filterData:
|
|
7938
|
-
}),
|
|
7938
|
+
filterData: sd
|
|
7939
|
+
}), ud = p.object({
|
|
7939
7940
|
signature: fn,
|
|
7940
7941
|
signatureType: p.nativeEnum(st),
|
|
7941
7942
|
actionType: p.number().optional(),
|
|
7942
7943
|
targetContract: I,
|
|
7943
7944
|
chainid: p.number().nonnegative(),
|
|
7944
|
-
actionParameter:
|
|
7945
|
-
}), ud = p.object({
|
|
7946
|
-
type: p.literal("EventAction"),
|
|
7947
|
-
actionClaimant: id,
|
|
7948
|
-
actionSteps: p.array(cd).max(4)
|
|
7945
|
+
actionParameter: cd
|
|
7949
7946
|
}), dd = p.object({
|
|
7947
|
+
type: p.literal("EventAction"),
|
|
7948
|
+
actionClaimant: od,
|
|
7949
|
+
actionSteps: p.array(ud).max(4)
|
|
7950
|
+
}), ld = p.object({
|
|
7950
7951
|
type: p.literal("LimitedSignerValidator"),
|
|
7951
7952
|
signers: p.array(I),
|
|
7952
7953
|
validatorCaller: I,
|
|
7953
7954
|
maxClaimCount: p.coerce.number()
|
|
7954
|
-
}),
|
|
7955
|
+
}), fd = p.object({
|
|
7955
7956
|
type: p.literal("SignerValidator"),
|
|
7956
7957
|
signers: p.array(I),
|
|
7957
7958
|
validatorCaller: I
|
|
7958
|
-
}),
|
|
7959
|
+
}), hd = p.object({
|
|
7959
7960
|
type: p.literal("SimpleDenyList"),
|
|
7960
7961
|
owner: I,
|
|
7961
7962
|
denied: p.array(I)
|
|
7962
|
-
}),
|
|
7963
|
+
}), pd = p.object({
|
|
7963
7964
|
type: p.literal("SimpleAllowList"),
|
|
7964
7965
|
owner: I,
|
|
7965
7966
|
allowed: p.array(I)
|
|
7966
|
-
}),
|
|
7967
|
+
}), md = p.object({
|
|
7967
7968
|
type: p.literal("AllowListIncentive"),
|
|
7968
7969
|
allowList: I,
|
|
7969
7970
|
limit: p.coerce.bigint()
|
|
7970
|
-
}),
|
|
7971
|
+
}), yd = p.object({
|
|
7971
7972
|
type: p.literal("ERC20Incentive"),
|
|
7972
7973
|
asset: I,
|
|
7973
7974
|
shouldMintAndAllocate: p.boolean().optional().default(!1),
|
|
@@ -7975,7 +7976,7 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
7975
7976
|
reward: p.coerce.bigint(),
|
|
7976
7977
|
limit: p.coerce.bigint(),
|
|
7977
7978
|
manager: I.optional()
|
|
7978
|
-
}),
|
|
7979
|
+
}), bd = p.object({
|
|
7979
7980
|
type: p.literal("ERC20VariableIncentive"),
|
|
7980
7981
|
asset: I,
|
|
7981
7982
|
shouldMintAndAllocate: p.boolean().optional().default(!1),
|
|
@@ -7986,17 +7987,18 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
7986
7987
|
criteriaType: p.nativeEnum(st),
|
|
7987
7988
|
signature: fn,
|
|
7988
7989
|
fieldIndex: p.number().nonnegative(),
|
|
7989
|
-
targetContract: I
|
|
7990
|
-
|
|
7991
|
-
|
|
7990
|
+
targetContract: I,
|
|
7991
|
+
valueType: p.nativeEnum(sa)
|
|
7992
|
+
}), gd = p.object({
|
|
7993
|
+
type: p.literal("ERC20VariableCriteriaIncentiveV2"),
|
|
7992
7994
|
asset: I,
|
|
7993
7995
|
shouldMintAndAllocate: p.boolean().optional().default(!1),
|
|
7994
7996
|
reward: p.coerce.bigint(),
|
|
7995
7997
|
limit: p.coerce.bigint(),
|
|
7996
7998
|
manager: I.optional(),
|
|
7997
7999
|
criteria: Xs
|
|
7998
|
-
}),
|
|
7999
|
-
type: p.literal("
|
|
8000
|
+
}), vd = p.object({
|
|
8001
|
+
type: p.literal("ERC20PeggedVariableCriteriaIncentiveV2"),
|
|
8000
8002
|
asset: I,
|
|
8001
8003
|
shouldMintAndAllocate: p.boolean().optional().default(!1),
|
|
8002
8004
|
maxReward: p.coerce.bigint(),
|
|
@@ -8005,7 +8007,7 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
8005
8007
|
limit: p.coerce.bigint(),
|
|
8006
8008
|
manager: I.optional(),
|
|
8007
8009
|
criteria: Xs
|
|
8008
|
-
}),
|
|
8010
|
+
}), wd = p.object({
|
|
8009
8011
|
type: p.literal("CGDAIncentive"),
|
|
8010
8012
|
asset: I,
|
|
8011
8013
|
shouldMintAndAllocate: p.boolean().optional().default(!1),
|
|
@@ -8014,7 +8016,7 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
8014
8016
|
rewardBoost: p.coerce.bigint(),
|
|
8015
8017
|
totalBudget: p.coerce.bigint(),
|
|
8016
8018
|
manager: I
|
|
8017
|
-
}),
|
|
8019
|
+
}), xd = p.object({
|
|
8018
8020
|
type: p.literal("PointsIncentive"),
|
|
8019
8021
|
venue: I,
|
|
8020
8022
|
selector: fn,
|
|
@@ -8025,28 +8027,28 @@ const rd = p.custom(pa, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
8025
8027
|
maxParticipants: p.coerce.bigint(),
|
|
8026
8028
|
budget: p.union([
|
|
8027
8029
|
I,
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
+
id,
|
|
8031
|
+
ad
|
|
8030
8032
|
]),
|
|
8031
|
-
action: p.union([I,
|
|
8032
|
-
validator: p.union([I,
|
|
8033
|
-
allowList: p.union([I,
|
|
8033
|
+
action: p.union([I, dd]),
|
|
8034
|
+
validator: p.union([I, fd, ld]).optional(),
|
|
8035
|
+
allowList: p.union([I, hd, pd]).optional(),
|
|
8034
8036
|
incentives: p.array(
|
|
8035
8037
|
p.union([
|
|
8036
|
-
pd,
|
|
8037
8038
|
md,
|
|
8038
|
-
bd,
|
|
8039
|
-
gd,
|
|
8040
8039
|
yd,
|
|
8040
|
+
gd,
|
|
8041
8041
|
vd,
|
|
8042
|
-
|
|
8042
|
+
bd,
|
|
8043
|
+
wd,
|
|
8044
|
+
xd
|
|
8043
8045
|
])
|
|
8044
8046
|
)
|
|
8045
8047
|
});
|
|
8046
8048
|
async function ea({ allowList: t }, { core: e }) {
|
|
8047
8049
|
if (!t) return e.OpenAllowList();
|
|
8048
8050
|
if (typeof t == "string" && tn(t))
|
|
8049
|
-
return await
|
|
8051
|
+
return await ua(
|
|
8050
8052
|
//@ts-expect-error i do what i want
|
|
8051
8053
|
{ config: e._config, account: e._account },
|
|
8052
8054
|
t
|
|
@@ -8060,16 +8062,16 @@ async function ea({ allowList: t }, { core: e }) {
|
|
|
8060
8062
|
throw new Error("unusupported AllowList: " + t);
|
|
8061
8063
|
}
|
|
8062
8064
|
}
|
|
8063
|
-
async function
|
|
8064
|
-
return await e.mint(t.account.address, r), await e.approve(n.assertValidAddress(), r), await n.allocate({
|
|
8065
|
+
async function _d(t, e, n, r = zr("110")) {
|
|
8066
|
+
return await e.mint(t.account.address, r), await e.approve(n.assertValidAddress(), r), "allocate" in n && await n.allocate({
|
|
8065
8067
|
amount: r,
|
|
8066
8068
|
asset: e.assertValidAddress(),
|
|
8067
8069
|
target: t.account.address
|
|
8068
8070
|
}), { budget: n, erc20: e };
|
|
8069
8071
|
}
|
|
8070
|
-
function
|
|
8072
|
+
function Pd({
|
|
8071
8073
|
asset: t = "0xf3B2d0E4f2d8F453DBCc278b10e88b20d7f19f8D",
|
|
8072
|
-
account: e =
|
|
8074
|
+
account: e = td[0].account,
|
|
8073
8075
|
chainId: n
|
|
8074
8076
|
}) {
|
|
8075
8077
|
return {
|
|
@@ -8130,7 +8132,7 @@ function _d({
|
|
|
8130
8132
|
]
|
|
8131
8133
|
};
|
|
8132
8134
|
}
|
|
8133
|
-
async function
|
|
8135
|
+
async function kd(t, e) {
|
|
8134
8136
|
const n = Qs.parse(t);
|
|
8135
8137
|
let r;
|
|
8136
8138
|
if (typeof n.budget == "string" && tn(n.budget))
|
|
@@ -8145,10 +8147,10 @@ async function Td(t, e) {
|
|
|
8145
8147
|
return e.PointsIncentive(i);
|
|
8146
8148
|
case "ERC20Incentive":
|
|
8147
8149
|
return e.ERC20Incentive(i);
|
|
8148
|
-
case "
|
|
8149
|
-
return e.
|
|
8150
|
-
case "
|
|
8151
|
-
return e.
|
|
8150
|
+
case "ERC20VariableCriteriaIncentiveV2":
|
|
8151
|
+
return e.ERC20VariableCriteriaIncentiveV2(i);
|
|
8152
|
+
case "ERC20PeggedVariableCriteriaIncentiveV2":
|
|
8153
|
+
return e.ERC20PeggedVariableCriteriaIncentiveV2(i);
|
|
8152
8154
|
case "ERC20VariableIncentive":
|
|
8153
8155
|
return e.ERC20VariableIncentive(i);
|
|
8154
8156
|
case "CGDAIncentive":
|
|
@@ -8177,37 +8179,37 @@ async function Td(t, e) {
|
|
|
8177
8179
|
return a;
|
|
8178
8180
|
}
|
|
8179
8181
|
export {
|
|
8180
|
-
|
|
8182
|
+
od as A,
|
|
8181
8183
|
y as B,
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
+
wd as C,
|
|
8185
|
+
dd as E,
|
|
8184
8186
|
ys as H,
|
|
8185
8187
|
vt as I,
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8188
|
+
ld as L,
|
|
8189
|
+
ad as M,
|
|
8190
|
+
xd as P,
|
|
8191
|
+
fd as S,
|
|
8190
8192
|
cn as a,
|
|
8191
|
-
|
|
8193
|
+
He as b,
|
|
8192
8194
|
Us as c,
|
|
8193
|
-
|
|
8195
|
+
lu as d,
|
|
8194
8196
|
os as e,
|
|
8195
8197
|
Pe as f,
|
|
8196
8198
|
ms as g,
|
|
8197
|
-
|
|
8199
|
+
id as h,
|
|
8198
8200
|
Ee as i,
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8201
|
+
cd as j,
|
|
8202
|
+
ud as k,
|
|
8203
|
+
hd as l,
|
|
8204
|
+
pd as m,
|
|
8205
|
+
md as n,
|
|
8206
|
+
yd as o,
|
|
8207
|
+
bd as p,
|
|
8206
8208
|
Xs as q,
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8209
|
+
gd as r,
|
|
8210
|
+
$d as s,
|
|
8211
|
+
vd as t,
|
|
8210
8212
|
Qs as u,
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
+
Pd as v,
|
|
8214
|
+
kd as w
|
|
8213
8215
|
};
|