@boostxyz/cli 6.0.4 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ccip-DDb_n-DK.js → ccip-B7UF-Rim.js} +1 -1
- package/dist/{ccip-BgOzBLIc.cjs → ccip-Bb0gHRe8.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/deploy.cjs +14 -14
- package/dist/commands/deploy.d.ts +1 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +1319 -682
- package/dist/commands/seed.cjs +1 -1
- package/dist/commands/seed.d.ts +51 -2
- package/dist/commands/seed.d.ts.map +1 -1
- package/dist/commands/seed.js +13 -12
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{seed-TiV1kcAC.js → seed-B5lkLMIE.js} +608 -590
- package/dist/{seed-DU3dxNJK.cjs → seed-Cd-7_peU.cjs} +25 -25
- package/package.json +2 -2
|
@@ -65,7 +65,7 @@ function zr(t, e = "wei") {
|
|
|
65
65
|
return xa(t, la[e]);
|
|
66
66
|
}
|
|
67
67
|
const gr = "0x0000000000000000000000000000000000000000";
|
|
68
|
-
var
|
|
68
|
+
var I;
|
|
69
69
|
(function(t) {
|
|
70
70
|
t.assertEqual = (s) => s;
|
|
71
71
|
function e(s) {
|
|
@@ -100,7 +100,7 @@ var k;
|
|
|
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
|
+
})(I || (I = {}));
|
|
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 = I.arrayToEnum([
|
|
113
113
|
"string",
|
|
114
114
|
"nan",
|
|
115
115
|
"number",
|
|
@@ -151,7 +151,7 @@ const g = k.arrayToEnum([
|
|
|
151
151
|
default:
|
|
152
152
|
return g.unknown;
|
|
153
153
|
}
|
|
154
|
-
},
|
|
154
|
+
}, p = I.arrayToEnum([
|
|
155
155
|
"invalid_type",
|
|
156
156
|
"invalid_literal",
|
|
157
157
|
"custom",
|
|
@@ -169,7 +169,7 @@ const g = k.arrayToEnum([
|
|
|
169
169
|
"not_multiple_of",
|
|
170
170
|
"not_finite"
|
|
171
171
|
]), _a = (t) => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
172
|
-
class
|
|
172
|
+
class H extends Error {
|
|
173
173
|
get errors() {
|
|
174
174
|
return this.issues;
|
|
175
175
|
}
|
|
@@ -206,14 +206,14 @@ class W extends Error {
|
|
|
206
206
|
return s(this), r;
|
|
207
207
|
}
|
|
208
208
|
static assert(e) {
|
|
209
|
-
if (!(e instanceof
|
|
209
|
+
if (!(e instanceof H))
|
|
210
210
|
throw new Error(`Not a ZodError: ${e}`);
|
|
211
211
|
}
|
|
212
212
|
toString() {
|
|
213
213
|
return this.message;
|
|
214
214
|
}
|
|
215
215
|
get message() {
|
|
216
|
-
return JSON.stringify(this.issues,
|
|
216
|
+
return JSON.stringify(this.issues, I.jsonStringifyReplacer, 2);
|
|
217
217
|
}
|
|
218
218
|
get isEmpty() {
|
|
219
219
|
return this.issues.length === 0;
|
|
@@ -228,60 +228,60 @@ class W extends Error {
|
|
|
228
228
|
return this.flatten();
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
H.create = (t) => new H(t);
|
|
232
232
|
const Ve = (t, e) => {
|
|
233
233
|
let n;
|
|
234
234
|
switch (t.code) {
|
|
235
|
-
case
|
|
235
|
+
case p.invalid_type:
|
|
236
236
|
t.received === g.undefined ? n = "Required" : n = `Expected ${t.expected}, received ${t.received}`;
|
|
237
237
|
break;
|
|
238
|
-
case
|
|
239
|
-
n = `Invalid literal value, expected ${JSON.stringify(t.expected,
|
|
238
|
+
case p.invalid_literal:
|
|
239
|
+
n = `Invalid literal value, expected ${JSON.stringify(t.expected, I.jsonStringifyReplacer)}`;
|
|
240
240
|
break;
|
|
241
|
-
case
|
|
242
|
-
n = `Unrecognized key(s) in object: ${
|
|
241
|
+
case p.unrecognized_keys:
|
|
242
|
+
n = `Unrecognized key(s) in object: ${I.joinValues(t.keys, ", ")}`;
|
|
243
243
|
break;
|
|
244
|
-
case
|
|
244
|
+
case p.invalid_union:
|
|
245
245
|
n = "Invalid input";
|
|
246
246
|
break;
|
|
247
|
-
case
|
|
248
|
-
n = `Invalid discriminator value. Expected ${
|
|
247
|
+
case p.invalid_union_discriminator:
|
|
248
|
+
n = `Invalid discriminator value. Expected ${I.joinValues(t.options)}`;
|
|
249
249
|
break;
|
|
250
|
-
case
|
|
251
|
-
n = `Invalid enum value. Expected ${
|
|
250
|
+
case p.invalid_enum_value:
|
|
251
|
+
n = `Invalid enum value. Expected ${I.joinValues(t.options)}, received '${t.received}'`;
|
|
252
252
|
break;
|
|
253
|
-
case
|
|
253
|
+
case p.invalid_arguments:
|
|
254
254
|
n = "Invalid function arguments";
|
|
255
255
|
break;
|
|
256
|
-
case
|
|
256
|
+
case p.invalid_return_type:
|
|
257
257
|
n = "Invalid function return type";
|
|
258
258
|
break;
|
|
259
|
-
case
|
|
259
|
+
case p.invalid_date:
|
|
260
260
|
n = "Invalid date";
|
|
261
261
|
break;
|
|
262
|
-
case
|
|
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}"` :
|
|
262
|
+
case p.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}"` : I.assertNever(t.validation) : t.validation !== "regex" ? n = `Invalid ${t.validation}` : n = "Invalid";
|
|
264
264
|
break;
|
|
265
|
-
case
|
|
265
|
+
case p.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";
|
|
267
267
|
break;
|
|
268
|
-
case
|
|
268
|
+
case p.too_big:
|
|
269
269
|
t.type === "array" ? n = `Array must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "less than"} ${t.maximum} element(s)` : t.type === "string" ? n = `String must contain ${t.exact ? "exactly" : t.inclusive ? "at most" : "under"} ${t.maximum} character(s)` : t.type === "number" ? n = `Number must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "bigint" ? n = `BigInt must be ${t.exact ? "exactly" : t.inclusive ? "less than or equal to" : "less than"} ${t.maximum}` : t.type === "date" ? n = `Date must be ${t.exact ? "exactly" : t.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(t.maximum))}` : n = "Invalid input";
|
|
270
270
|
break;
|
|
271
|
-
case
|
|
271
|
+
case p.custom:
|
|
272
272
|
n = "Invalid input";
|
|
273
273
|
break;
|
|
274
|
-
case
|
|
274
|
+
case p.invalid_intersection_types:
|
|
275
275
|
n = "Intersection results could not be merged";
|
|
276
276
|
break;
|
|
277
|
-
case
|
|
277
|
+
case p.not_multiple_of:
|
|
278
278
|
n = `Number must be a multiple of ${t.multipleOf}`;
|
|
279
279
|
break;
|
|
280
|
-
case
|
|
280
|
+
case p.not_finite:
|
|
281
281
|
n = "Number must be finite";
|
|
282
282
|
break;
|
|
283
283
|
default:
|
|
284
|
-
n = e.defaultError,
|
|
284
|
+
n = e.defaultError, I.assertNever(t);
|
|
285
285
|
}
|
|
286
286
|
return { message: n };
|
|
287
287
|
};
|
|
@@ -289,7 +289,7 @@ let Zr = Ve;
|
|
|
289
289
|
function Pa(t) {
|
|
290
290
|
Zr = t;
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Dt() {
|
|
293
293
|
return Zr;
|
|
294
294
|
}
|
|
295
295
|
const Vt = (t) => {
|
|
@@ -314,7 +314,7 @@ const Vt = (t) => {
|
|
|
314
314
|
};
|
|
315
315
|
}, Ea = [];
|
|
316
316
|
function b(t, e) {
|
|
317
|
-
const n =
|
|
317
|
+
const n = Dt(), 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 }), L = (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 Lr(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
|
}
|
|
@@ -406,7 +406,7 @@ const vr = (t, e) => {
|
|
|
406
406
|
get error() {
|
|
407
407
|
if (this._error)
|
|
408
408
|
return this._error;
|
|
409
|
-
const n = new
|
|
409
|
+
const n = new H(t.common.issues);
|
|
410
410
|
return this._error = n, this._error;
|
|
411
411
|
}
|
|
412
412
|
};
|
|
@@ -543,7 +543,7 @@ class T {
|
|
|
543
543
|
const r = (s) => typeof n == "string" || typeof n > "u" ? { message: n } : typeof n == "function" ? n(s) : n;
|
|
544
544
|
return this._refinement((s, a) => {
|
|
545
545
|
const i = e(s), o = () => a.addIssue({
|
|
546
|
-
code:
|
|
546
|
+
code: p.custom,
|
|
547
547
|
...r(s)
|
|
548
548
|
});
|
|
549
549
|
return typeof Promise < "u" && i instanceof Promise ? i.then((u) => u ? !0 : (o(), !1)) : i ? !0 : (o(), !1);
|
|
@@ -608,7 +608,7 @@ class T {
|
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
brand() {
|
|
611
|
-
return new
|
|
611
|
+
return new Hn({
|
|
612
612
|
typeName: x.ZodBranded,
|
|
613
613
|
type: this,
|
|
614
614
|
...E(this._def)
|
|
@@ -645,20 +645,20 @@ class T {
|
|
|
645
645
|
}
|
|
646
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])$/, 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}(=)?))?$/,
|
|
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}(=)?))?$/, Dr = "((\\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(`^${Dr}$`);
|
|
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 La(t) {
|
|
654
654
|
return new RegExp(`^${Vr(t)}$`);
|
|
655
655
|
}
|
|
656
656
|
function Ur(t) {
|
|
657
|
-
let e = `${
|
|
657
|
+
let e = `${Dr}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
|
|
661
|
+
function Da(t, e) {
|
|
662
662
|
return !!((e === "v4" || !e) && Oa.test(t) || (e === "v6" || !e) && Ba.test(t));
|
|
663
663
|
}
|
|
664
664
|
function Va(t, e) {
|
|
@@ -679,7 +679,7 @@ class ee extends T {
|
|
|
679
679
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
|
|
680
680
|
const a = this._getOrReturnCtx(e);
|
|
681
681
|
return b(a, {
|
|
682
|
-
code:
|
|
682
|
+
code: p.invalid_type,
|
|
683
683
|
expected: g.string,
|
|
684
684
|
received: a.parsedType
|
|
685
685
|
}), _;
|
|
@@ -689,7 +689,7 @@ class ee extends T {
|
|
|
689
689
|
for (const a of this._def.checks)
|
|
690
690
|
if (a.kind === "min")
|
|
691
691
|
e.data.length < a.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
692
|
-
code:
|
|
692
|
+
code: p.too_small,
|
|
693
693
|
minimum: a.value,
|
|
694
694
|
type: "string",
|
|
695
695
|
inclusive: !0,
|
|
@@ -698,7 +698,7 @@ class ee extends T {
|
|
|
698
698
|
}), r.dirty());
|
|
699
699
|
else if (a.kind === "max")
|
|
700
700
|
e.data.length > a.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
701
|
-
code:
|
|
701
|
+
code: p.too_big,
|
|
702
702
|
maximum: a.value,
|
|
703
703
|
type: "string",
|
|
704
704
|
inclusive: !0,
|
|
@@ -708,14 +708,14 @@ class ee extends T {
|
|
|
708
708
|
else if (a.kind === "length") {
|
|
709
709
|
const i = e.data.length > a.value, o = e.data.length < a.value;
|
|
710
710
|
(i || o) && (s = this._getOrReturnCtx(e, s), i ? b(s, {
|
|
711
|
-
code:
|
|
711
|
+
code: p.too_big,
|
|
712
712
|
maximum: a.value,
|
|
713
713
|
type: "string",
|
|
714
714
|
inclusive: !0,
|
|
715
715
|
exact: !0,
|
|
716
716
|
message: a.message
|
|
717
717
|
}) : o && b(s, {
|
|
718
|
-
code:
|
|
718
|
+
code: p.too_small,
|
|
719
719
|
minimum: a.value,
|
|
720
720
|
type: "string",
|
|
721
721
|
inclusive: !0,
|
|
@@ -725,43 +725,43 @@ class ee extends T {
|
|
|
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
|
-
code:
|
|
728
|
+
code: p.invalid_string,
|
|
729
729
|
message: a.message
|
|
730
730
|
}), r.dirty());
|
|
731
731
|
else if (a.kind === "emoji")
|
|
732
732
|
pn || (pn = new RegExp(Ma, "u")), pn.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
733
733
|
validation: "emoji",
|
|
734
|
-
code:
|
|
734
|
+
code: p.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
|
-
code:
|
|
740
|
+
code: p.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
|
-
code:
|
|
746
|
+
code: p.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
|
-
code:
|
|
752
|
+
code: p.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
|
-
code:
|
|
758
|
+
code: p.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
|
-
code:
|
|
764
|
+
code: p.invalid_string,
|
|
765
765
|
message: a.message
|
|
766
766
|
}), r.dirty());
|
|
767
767
|
else if (a.kind === "url")
|
|
@@ -770,69 +770,69 @@ class ee extends T {
|
|
|
770
770
|
} catch {
|
|
771
771
|
s = this._getOrReturnCtx(e, s), b(s, {
|
|
772
772
|
validation: "url",
|
|
773
|
-
code:
|
|
773
|
+
code: p.invalid_string,
|
|
774
774
|
message: a.message
|
|
775
775
|
}), r.dirty();
|
|
776
776
|
}
|
|
777
777
|
else a.kind === "regex" ? (a.regex.lastIndex = 0, a.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
778
778
|
validation: "regex",
|
|
779
|
-
code:
|
|
779
|
+
code: p.invalid_string,
|
|
780
780
|
message: a.message
|
|
781
781
|
}), r.dirty())) : a.kind === "trim" ? e.data = e.data.trim() : a.kind === "includes" ? e.data.includes(a.value, a.position) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
782
|
-
code:
|
|
782
|
+
code: p.invalid_string,
|
|
783
783
|
validation: { includes: a.value, position: a.position },
|
|
784
784
|
message: a.message
|
|
785
785
|
}), r.dirty()) : a.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : a.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : a.kind === "startsWith" ? e.data.startsWith(a.value) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
786
|
-
code:
|
|
786
|
+
code: p.invalid_string,
|
|
787
787
|
validation: { startsWith: a.value },
|
|
788
788
|
message: a.message
|
|
789
789
|
}), r.dirty()) : a.kind === "endsWith" ? e.data.endsWith(a.value) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
790
|
-
code:
|
|
790
|
+
code: p.invalid_string,
|
|
791
791
|
validation: { endsWith: a.value },
|
|
792
792
|
message: a.message
|
|
793
793
|
}), r.dirty()) : a.kind === "datetime" ? Ur(a).test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
794
|
-
code:
|
|
794
|
+
code: p.invalid_string,
|
|
795
795
|
validation: "datetime",
|
|
796
796
|
message: a.message
|
|
797
797
|
}), r.dirty()) : a.kind === "date" ? Za.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
798
|
-
code:
|
|
798
|
+
code: p.invalid_string,
|
|
799
799
|
validation: "date",
|
|
800
800
|
message: a.message
|
|
801
|
-
}), r.dirty()) : a.kind === "time" ?
|
|
802
|
-
code:
|
|
801
|
+
}), r.dirty()) : a.kind === "time" ? La(a).test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
802
|
+
code: p.invalid_string,
|
|
803
803
|
validation: "time",
|
|
804
804
|
message: a.message
|
|
805
805
|
}), r.dirty()) : a.kind === "duration" ? Sa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
806
806
|
validation: "duration",
|
|
807
|
-
code:
|
|
807
|
+
code: p.invalid_string,
|
|
808
808
|
message: a.message
|
|
809
|
-
}), r.dirty()) : a.kind === "ip" ?
|
|
809
|
+
}), r.dirty()) : a.kind === "ip" ? Da(e.data, a.version) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
810
810
|
validation: "ip",
|
|
811
|
-
code:
|
|
811
|
+
code: p.invalid_string,
|
|
812
812
|
message: a.message
|
|
813
813
|
}), r.dirty()) : a.kind === "jwt" ? Va(e.data, a.alg) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
814
814
|
validation: "jwt",
|
|
815
|
-
code:
|
|
815
|
+
code: p.invalid_string,
|
|
816
816
|
message: a.message
|
|
817
817
|
}), r.dirty()) : a.kind === "cidr" ? Ua(e.data, a.version) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
818
818
|
validation: "cidr",
|
|
819
|
-
code:
|
|
819
|
+
code: p.invalid_string,
|
|
820
820
|
message: a.message
|
|
821
821
|
}), r.dirty()) : a.kind === "base64" ? Fa.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
822
822
|
validation: "base64",
|
|
823
|
-
code:
|
|
823
|
+
code: p.invalid_string,
|
|
824
824
|
message: a.message
|
|
825
825
|
}), r.dirty()) : a.kind === "base64url" ? za.test(e.data) || (s = this._getOrReturnCtx(e, s), b(s, {
|
|
826
826
|
validation: "base64url",
|
|
827
|
-
code:
|
|
827
|
+
code: p.invalid_string,
|
|
828
828
|
message: a.message
|
|
829
|
-
}), r.dirty()) :
|
|
829
|
+
}), r.dirty()) : I.assertNever(a);
|
|
830
830
|
return { status: r.value, value: e.data };
|
|
831
831
|
}
|
|
832
832
|
_regex(e, n, r) {
|
|
833
833
|
return this.refinement((s) => e.test(s), {
|
|
834
834
|
validation: n,
|
|
835
|
-
code:
|
|
835
|
+
code: p.invalid_string,
|
|
836
836
|
...w.errToObj(r)
|
|
837
837
|
});
|
|
838
838
|
}
|
|
@@ -1073,7 +1073,7 @@ class ve extends T {
|
|
|
1073
1073
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== g.number) {
|
|
1074
1074
|
const a = this._getOrReturnCtx(e);
|
|
1075
1075
|
return b(a, {
|
|
1076
|
-
code:
|
|
1076
|
+
code: p.invalid_type,
|
|
1077
1077
|
expected: g.number,
|
|
1078
1078
|
received: a.parsedType
|
|
1079
1079
|
}), _;
|
|
@@ -1081,33 +1081,33 @@ class ve extends T {
|
|
|
1081
1081
|
let r;
|
|
1082
1082
|
const s = new z();
|
|
1083
1083
|
for (const a of this._def.checks)
|
|
1084
|
-
a.kind === "int" ?
|
|
1085
|
-
code:
|
|
1084
|
+
a.kind === "int" ? I.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1085
|
+
code: p.invalid_type,
|
|
1086
1086
|
expected: "integer",
|
|
1087
1087
|
received: "float",
|
|
1088
1088
|
message: a.message
|
|
1089
1089
|
}), s.dirty()) : a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1090
|
-
code:
|
|
1090
|
+
code: p.too_small,
|
|
1091
1091
|
minimum: a.value,
|
|
1092
1092
|
type: "number",
|
|
1093
1093
|
inclusive: a.inclusive,
|
|
1094
1094
|
exact: !1,
|
|
1095
1095
|
message: a.message
|
|
1096
1096
|
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1097
|
-
code:
|
|
1097
|
+
code: p.too_big,
|
|
1098
1098
|
maximum: a.value,
|
|
1099
1099
|
type: "number",
|
|
1100
1100
|
inclusive: a.inclusive,
|
|
1101
1101
|
exact: !1,
|
|
1102
1102
|
message: a.message
|
|
1103
1103
|
}), s.dirty()) : a.kind === "multipleOf" ? Ga(e.data, a.value) !== 0 && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1104
|
-
code:
|
|
1104
|
+
code: p.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
|
-
code:
|
|
1108
|
+
code: p.not_finite,
|
|
1109
1109
|
message: a.message
|
|
1110
|
-
}), s.dirty()) :
|
|
1110
|
+
}), s.dirty()) : I.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 T {
|
|
|
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" && I.isInteger(e.value));
|
|
1223
1223
|
}
|
|
1224
1224
|
get isFinite() {
|
|
1225
1225
|
let e = null, n = null;
|
|
@@ -1254,28 +1254,28 @@ class we extends T {
|
|
|
1254
1254
|
const s = new z();
|
|
1255
1255
|
for (const a of this._def.checks)
|
|
1256
1256
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1257
|
-
code:
|
|
1257
|
+
code: p.too_small,
|
|
1258
1258
|
type: "bigint",
|
|
1259
1259
|
minimum: a.value,
|
|
1260
1260
|
inclusive: a.inclusive,
|
|
1261
1261
|
message: a.message
|
|
1262
1262
|
}), s.dirty()) : a.kind === "max" ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1263
|
-
code:
|
|
1263
|
+
code: p.too_big,
|
|
1264
1264
|
type: "bigint",
|
|
1265
1265
|
maximum: a.value,
|
|
1266
1266
|
inclusive: a.inclusive,
|
|
1267
1267
|
message: a.message
|
|
1268
1268
|
}), s.dirty()) : a.kind === "multipleOf" ? e.data % a.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), b(r, {
|
|
1269
|
-
code:
|
|
1269
|
+
code: p.not_multiple_of,
|
|
1270
1270
|
multipleOf: a.value,
|
|
1271
1271
|
message: a.message
|
|
1272
|
-
}), s.dirty()) :
|
|
1272
|
+
}), s.dirty()) : I.assertNever(a);
|
|
1273
1273
|
return { status: s.value, value: e.data };
|
|
1274
1274
|
}
|
|
1275
1275
|
_getInvalidInput(e) {
|
|
1276
1276
|
const n = this._getOrReturnCtx(e);
|
|
1277
1277
|
return b(n, {
|
|
1278
|
-
code:
|
|
1278
|
+
code: p.invalid_type,
|
|
1279
1279
|
expected: g.bigint,
|
|
1280
1280
|
received: n.parsedType
|
|
1281
1281
|
}), _;
|
|
@@ -1378,12 +1378,12 @@ class it extends T {
|
|
|
1378
1378
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
1379
1379
|
const r = this._getOrReturnCtx(e);
|
|
1380
1380
|
return b(r, {
|
|
1381
|
-
code:
|
|
1381
|
+
code: p.invalid_type,
|
|
1382
1382
|
expected: g.boolean,
|
|
1383
1383
|
received: r.parsedType
|
|
1384
1384
|
}), _;
|
|
1385
1385
|
}
|
|
1386
|
-
return
|
|
1386
|
+
return L(e.data);
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
1389
|
it.create = (t) => new it({
|
|
@@ -1396,7 +1396,7 @@ class Se extends T {
|
|
|
1396
1396
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
|
|
1397
1397
|
const a = this._getOrReturnCtx(e);
|
|
1398
1398
|
return b(a, {
|
|
1399
|
-
code:
|
|
1399
|
+
code: p.invalid_type,
|
|
1400
1400
|
expected: g.date,
|
|
1401
1401
|
received: a.parsedType
|
|
1402
1402
|
}), _;
|
|
@@ -1404,27 +1404,27 @@ class Se extends T {
|
|
|
1404
1404
|
if (isNaN(e.data.getTime())) {
|
|
1405
1405
|
const a = this._getOrReturnCtx(e);
|
|
1406
1406
|
return b(a, {
|
|
1407
|
-
code:
|
|
1407
|
+
code: p.invalid_date
|
|
1408
1408
|
}), _;
|
|
1409
1409
|
}
|
|
1410
1410
|
const r = new z();
|
|
1411
1411
|
let s;
|
|
1412
1412
|
for (const a of this._def.checks)
|
|
1413
1413
|
a.kind === "min" ? e.data.getTime() < a.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
1414
|
-
code:
|
|
1414
|
+
code: p.too_small,
|
|
1415
1415
|
message: a.message,
|
|
1416
1416
|
inclusive: !0,
|
|
1417
1417
|
exact: !1,
|
|
1418
1418
|
minimum: a.value,
|
|
1419
1419
|
type: "date"
|
|
1420
1420
|
}), r.dirty()) : a.kind === "max" ? e.data.getTime() > a.value && (s = this._getOrReturnCtx(e, s), b(s, {
|
|
1421
|
-
code:
|
|
1421
|
+
code: p.too_big,
|
|
1422
1422
|
message: a.message,
|
|
1423
1423
|
inclusive: !0,
|
|
1424
1424
|
exact: !1,
|
|
1425
1425
|
maximum: a.value,
|
|
1426
1426
|
type: "date"
|
|
1427
|
-
}), r.dirty()) :
|
|
1427
|
+
}), r.dirty()) : I.assertNever(a);
|
|
1428
1428
|
return {
|
|
1429
1429
|
status: r.value,
|
|
1430
1430
|
value: new Date(e.data.getTime())
|
|
@@ -1474,12 +1474,12 @@ class Gt extends T {
|
|
|
1474
1474
|
if (this._getType(e) !== g.symbol) {
|
|
1475
1475
|
const r = this._getOrReturnCtx(e);
|
|
1476
1476
|
return b(r, {
|
|
1477
|
-
code:
|
|
1477
|
+
code: p.invalid_type,
|
|
1478
1478
|
expected: g.symbol,
|
|
1479
1479
|
received: r.parsedType
|
|
1480
1480
|
}), _;
|
|
1481
1481
|
}
|
|
1482
|
-
return
|
|
1482
|
+
return L(e.data);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
Gt.create = (t) => new Gt({
|
|
@@ -1491,12 +1491,12 @@ class ot extends T {
|
|
|
1491
1491
|
if (this._getType(e) !== g.undefined) {
|
|
1492
1492
|
const r = this._getOrReturnCtx(e);
|
|
1493
1493
|
return b(r, {
|
|
1494
|
-
code:
|
|
1494
|
+
code: p.invalid_type,
|
|
1495
1495
|
expected: g.undefined,
|
|
1496
1496
|
received: r.parsedType
|
|
1497
1497
|
}), _;
|
|
1498
1498
|
}
|
|
1499
|
-
return
|
|
1499
|
+
return L(e.data);
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
1502
|
ot.create = (t) => new ot({
|
|
@@ -1508,12 +1508,12 @@ class ct extends T {
|
|
|
1508
1508
|
if (this._getType(e) !== g.null) {
|
|
1509
1509
|
const r = this._getOrReturnCtx(e);
|
|
1510
1510
|
return b(r, {
|
|
1511
|
-
code:
|
|
1511
|
+
code: p.invalid_type,
|
|
1512
1512
|
expected: g.null,
|
|
1513
1513
|
received: r.parsedType
|
|
1514
1514
|
}), _;
|
|
1515
1515
|
}
|
|
1516
|
-
return
|
|
1516
|
+
return L(e.data);
|
|
1517
1517
|
}
|
|
1518
1518
|
}
|
|
1519
1519
|
ct.create = (t) => new ct({
|
|
@@ -1525,7 +1525,7 @@ class Ue extends T {
|
|
|
1525
1525
|
super(...arguments), this._any = !0;
|
|
1526
1526
|
}
|
|
1527
1527
|
_parse(e) {
|
|
1528
|
-
return
|
|
1528
|
+
return L(e.data);
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
1531
1531
|
Ue.create = (t) => new Ue({
|
|
@@ -1537,7 +1537,7 @@ class ke extends T {
|
|
|
1537
1537
|
super(...arguments), this._unknown = !0;
|
|
1538
1538
|
}
|
|
1539
1539
|
_parse(e) {
|
|
1540
|
-
return
|
|
1540
|
+
return L(e.data);
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
1543
|
ke.create = (t) => new ke({
|
|
@@ -1548,7 +1548,7 @@ class me extends T {
|
|
|
1548
1548
|
_parse(e) {
|
|
1549
1549
|
const n = this._getOrReturnCtx(e);
|
|
1550
1550
|
return b(n, {
|
|
1551
|
-
code:
|
|
1551
|
+
code: p.invalid_type,
|
|
1552
1552
|
expected: g.never,
|
|
1553
1553
|
received: n.parsedType
|
|
1554
1554
|
}), _;
|
|
@@ -1558,20 +1558,20 @@ me.create = (t) => new me({
|
|
|
1558
1558
|
typeName: x.ZodNever,
|
|
1559
1559
|
...E(t)
|
|
1560
1560
|
});
|
|
1561
|
-
class
|
|
1561
|
+
class Wt extends T {
|
|
1562
1562
|
_parse(e) {
|
|
1563
1563
|
if (this._getType(e) !== g.undefined) {
|
|
1564
1564
|
const r = this._getOrReturnCtx(e);
|
|
1565
1565
|
return b(r, {
|
|
1566
|
-
code:
|
|
1566
|
+
code: p.invalid_type,
|
|
1567
1567
|
expected: g.void,
|
|
1568
1568
|
received: r.parsedType
|
|
1569
1569
|
}), _;
|
|
1570
1570
|
}
|
|
1571
|
-
return
|
|
1571
|
+
return L(e.data);
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
|
-
|
|
1574
|
+
Wt.create = (t) => new Wt({
|
|
1575
1575
|
typeName: x.ZodVoid,
|
|
1576
1576
|
...E(t)
|
|
1577
1577
|
});
|
|
@@ -1580,14 +1580,14 @@ class te extends T {
|
|
|
1580
1580
|
const { ctx: n, status: r } = this._processInputParams(e), s = this._def;
|
|
1581
1581
|
if (n.parsedType !== g.array)
|
|
1582
1582
|
return b(n, {
|
|
1583
|
-
code:
|
|
1583
|
+
code: p.invalid_type,
|
|
1584
1584
|
expected: g.array,
|
|
1585
1585
|
received: n.parsedType
|
|
1586
1586
|
}), _;
|
|
1587
1587
|
if (s.exactLength !== null) {
|
|
1588
1588
|
const i = n.data.length > s.exactLength.value, o = n.data.length < s.exactLength.value;
|
|
1589
1589
|
(i || o) && (b(n, {
|
|
1590
|
-
code: i ?
|
|
1590
|
+
code: i ? p.too_big : p.too_small,
|
|
1591
1591
|
minimum: o ? s.exactLength.value : void 0,
|
|
1592
1592
|
maximum: i ? s.exactLength.value : void 0,
|
|
1593
1593
|
type: "array",
|
|
@@ -1597,14 +1597,14 @@ class te extends T {
|
|
|
1597
1597
|
}), r.dirty());
|
|
1598
1598
|
}
|
|
1599
1599
|
if (s.minLength !== null && n.data.length < s.minLength.value && (b(n, {
|
|
1600
|
-
code:
|
|
1600
|
+
code: p.too_small,
|
|
1601
1601
|
minimum: s.minLength.value,
|
|
1602
1602
|
type: "array",
|
|
1603
1603
|
inclusive: !0,
|
|
1604
1604
|
exact: !1,
|
|
1605
1605
|
message: s.minLength.message
|
|
1606
1606
|
}), r.dirty()), s.maxLength !== null && n.data.length > s.maxLength.value && (b(n, {
|
|
1607
|
-
code:
|
|
1607
|
+
code: p.too_big,
|
|
1608
1608
|
maximum: s.maxLength.value,
|
|
1609
1609
|
type: "array",
|
|
1610
1610
|
inclusive: !0,
|
|
@@ -1671,14 +1671,14 @@ class j extends T {
|
|
|
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 = I.objectKeys(e);
|
|
1675
1675
|
return this._cached = { shape: e, keys: n };
|
|
1676
1676
|
}
|
|
1677
1677
|
_parse(e) {
|
|
1678
1678
|
if (this._getType(e) !== g.object) {
|
|
1679
1679
|
const c = this._getOrReturnCtx(e);
|
|
1680
1680
|
return b(c, {
|
|
1681
|
-
code:
|
|
1681
|
+
code: p.invalid_type,
|
|
1682
1682
|
expected: g.object,
|
|
1683
1683
|
received: c.parsedType
|
|
1684
1684
|
}), _;
|
|
@@ -1689,10 +1689,10 @@ class j extends T {
|
|
|
1689
1689
|
i.includes(c) || o.push(c);
|
|
1690
1690
|
const u = [];
|
|
1691
1691
|
for (const c of i) {
|
|
1692
|
-
const d = a[c],
|
|
1692
|
+
const d = a[c], f = s.data[c];
|
|
1693
1693
|
u.push({
|
|
1694
1694
|
key: { status: "valid", value: c },
|
|
1695
|
-
value: d._parse(new ie(s,
|
|
1695
|
+
value: d._parse(new ie(s, f, s.path, c)),
|
|
1696
1696
|
alwaysSet: c in s.data
|
|
1697
1697
|
});
|
|
1698
1698
|
}
|
|
@@ -1706,18 +1706,18 @@ class j extends T {
|
|
|
1706
1706
|
});
|
|
1707
1707
|
else if (c === "strict")
|
|
1708
1708
|
o.length > 0 && (b(s, {
|
|
1709
|
-
code:
|
|
1709
|
+
code: p.unrecognized_keys,
|
|
1710
1710
|
keys: o
|
|
1711
1711
|
}), r.dirty());
|
|
1712
1712
|
else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1713
1713
|
} else {
|
|
1714
1714
|
const c = this._def.catchall;
|
|
1715
1715
|
for (const d of o) {
|
|
1716
|
-
const
|
|
1716
|
+
const f = s.data[d];
|
|
1717
1717
|
u.push({
|
|
1718
1718
|
key: { status: "valid", value: d },
|
|
1719
1719
|
value: c._parse(
|
|
1720
|
-
new ie(s,
|
|
1720
|
+
new ie(s, f, s.path, d)
|
|
1721
1721
|
//, ctx.child(key), value, getParsedType(value)
|
|
1722
1722
|
),
|
|
1723
1723
|
alwaysSet: d in s.data
|
|
@@ -1727,10 +1727,10 @@ class j extends T {
|
|
|
1727
1727
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1728
1728
|
const c = [];
|
|
1729
1729
|
for (const d of u) {
|
|
1730
|
-
const
|
|
1730
|
+
const f = await d.key, h = await d.value;
|
|
1731
1731
|
c.push({
|
|
1732
|
-
key:
|
|
1733
|
-
value:
|
|
1732
|
+
key: f,
|
|
1733
|
+
value: h,
|
|
1734
1734
|
alwaysSet: d.alwaysSet
|
|
1735
1735
|
});
|
|
1736
1736
|
}
|
|
@@ -1878,7 +1878,7 @@ class j extends T {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
pick(e) {
|
|
1880
1880
|
const n = {};
|
|
1881
|
-
return
|
|
1881
|
+
return I.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 T {
|
|
|
1887
1887
|
}
|
|
1888
1888
|
omit(e) {
|
|
1889
1889
|
const n = {};
|
|
1890
|
-
return
|
|
1890
|
+
return I.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 T {
|
|
|
1902
1902
|
}
|
|
1903
1903
|
partial(e) {
|
|
1904
1904
|
const n = {};
|
|
1905
|
-
return
|
|
1905
|
+
return I.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 T {
|
|
|
1912
1912
|
}
|
|
1913
1913
|
required(e) {
|
|
1914
1914
|
const n = {};
|
|
1915
|
-
return
|
|
1915
|
+
return I.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 T {
|
|
|
1927
1927
|
});
|
|
1928
1928
|
}
|
|
1929
1929
|
keyof() {
|
|
1930
|
-
return Gr(
|
|
1930
|
+
return Gr(I.objectKeys(this.shape));
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
1933
|
j.create = (t, e) => new j({
|
|
@@ -1961,9 +1961,9 @@ class ut extends T {
|
|
|
1961
1961
|
for (const o of a)
|
|
1962
1962
|
if (o.result.status === "dirty")
|
|
1963
1963
|
return n.common.issues.push(...o.ctx.common.issues), o.result;
|
|
1964
|
-
const i = a.map((o) => new
|
|
1964
|
+
const i = a.map((o) => new H(o.ctx.common.issues));
|
|
1965
1965
|
return b(n, {
|
|
1966
|
-
code:
|
|
1966
|
+
code: p.invalid_union,
|
|
1967
1967
|
unionErrors: i
|
|
1968
1968
|
}), _;
|
|
1969
1969
|
}
|
|
@@ -2008,9 +2008,9 @@ class ut extends T {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
if (a)
|
|
2010
2010
|
return n.common.issues.push(...a.ctx.common.issues), a.result;
|
|
2011
|
-
const o = i.map((u) => new
|
|
2011
|
+
const o = i.map((u) => new H(u));
|
|
2012
2012
|
return b(n, {
|
|
2013
|
-
code:
|
|
2013
|
+
code: p.invalid_union,
|
|
2014
2014
|
unionErrors: o
|
|
2015
2015
|
}), _;
|
|
2016
2016
|
}
|
|
@@ -2024,13 +2024,13 @@ 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 ?
|
|
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 ? I.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 Hn || t instanceof bt ? fe(t.unwrap()) : t instanceof yt ? fe(t._def.innerType) : [];
|
|
2028
2028
|
class nn extends T {
|
|
2029
2029
|
_parse(e) {
|
|
2030
2030
|
const { ctx: n } = this._processInputParams(e);
|
|
2031
2031
|
if (n.parsedType !== g.object)
|
|
2032
2032
|
return b(n, {
|
|
2033
|
-
code:
|
|
2033
|
+
code: p.invalid_type,
|
|
2034
2034
|
expected: g.object,
|
|
2035
2035
|
received: n.parsedType
|
|
2036
2036
|
}), _;
|
|
@@ -2044,7 +2044,7 @@ class nn extends T {
|
|
|
2044
2044
|
path: n.path,
|
|
2045
2045
|
parent: n
|
|
2046
2046
|
}) : (b(n, {
|
|
2047
|
-
code:
|
|
2047
|
+
code: p.invalid_union_discriminator,
|
|
2048
2048
|
options: Array.from(this.optionsMap.keys()),
|
|
2049
2049
|
path: [r]
|
|
2050
2050
|
}), _);
|
|
@@ -2092,7 +2092,7 @@ function kn(t, 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 = I.objectKeys(e), a = I.objectKeys(t).filter((o) => s.indexOf(o) !== -1), i = { ...t, ...e };
|
|
2096
2096
|
for (const o of a) {
|
|
2097
2097
|
const u = kn(t[o], e[o]);
|
|
2098
2098
|
if (!u.valid)
|
|
@@ -2120,7 +2120,7 @@ class dt extends T {
|
|
|
2120
2120
|
return _;
|
|
2121
2121
|
const o = kn(a.value, i.value);
|
|
2122
2122
|
return o.valid ? (($n(a) || $n(i)) && n.dirty(), { status: n.value, value: o.data }) : (b(r, {
|
|
2123
|
-
code:
|
|
2123
|
+
code: p.invalid_intersection_types
|
|
2124
2124
|
}), _);
|
|
2125
2125
|
};
|
|
2126
2126
|
return r.common.async ? Promise.all([
|
|
@@ -2156,20 +2156,20 @@ class oe extends T {
|
|
|
2156
2156
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2157
2157
|
if (r.parsedType !== g.array)
|
|
2158
2158
|
return b(r, {
|
|
2159
|
-
code:
|
|
2159
|
+
code: p.invalid_type,
|
|
2160
2160
|
expected: g.array,
|
|
2161
2161
|
received: r.parsedType
|
|
2162
2162
|
}), _;
|
|
2163
2163
|
if (r.data.length < this._def.items.length)
|
|
2164
2164
|
return b(r, {
|
|
2165
|
-
code:
|
|
2165
|
+
code: p.too_small,
|
|
2166
2166
|
minimum: this._def.items.length,
|
|
2167
2167
|
inclusive: !0,
|
|
2168
2168
|
exact: !1,
|
|
2169
2169
|
type: "array"
|
|
2170
2170
|
}), _;
|
|
2171
2171
|
!this._def.rest && r.data.length > this._def.items.length && (b(r, {
|
|
2172
|
-
code:
|
|
2172
|
+
code: p.too_big,
|
|
2173
2173
|
maximum: this._def.items.length,
|
|
2174
2174
|
inclusive: !0,
|
|
2175
2175
|
exact: !1,
|
|
@@ -2212,7 +2212,7 @@ class lt extends T {
|
|
|
2212
2212
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2213
2213
|
if (r.parsedType !== g.object)
|
|
2214
2214
|
return b(r, {
|
|
2215
|
-
code:
|
|
2215
|
+
code: p.invalid_type,
|
|
2216
2216
|
expected: g.object,
|
|
2217
2217
|
received: r.parsedType
|
|
2218
2218
|
}), _;
|
|
@@ -2242,7 +2242,7 @@ class lt extends T {
|
|
|
2242
2242
|
});
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
|
-
class
|
|
2245
|
+
class Ht extends T {
|
|
2246
2246
|
get keySchema() {
|
|
2247
2247
|
return this._def.keyType;
|
|
2248
2248
|
}
|
|
@@ -2253,7 +2253,7 @@ class Wt extends T {
|
|
|
2253
2253
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2254
2254
|
if (r.parsedType !== g.map)
|
|
2255
2255
|
return b(r, {
|
|
2256
|
-
code:
|
|
2256
|
+
code: p.invalid_type,
|
|
2257
2257
|
expected: g.map,
|
|
2258
2258
|
received: r.parsedType
|
|
2259
2259
|
}), _;
|
|
@@ -2284,7 +2284,7 @@ class Wt extends T {
|
|
|
2284
2284
|
}
|
|
2285
2285
|
}
|
|
2286
2286
|
}
|
|
2287
|
-
|
|
2287
|
+
Ht.create = (t, e, n) => new Ht({
|
|
2288
2288
|
valueType: e,
|
|
2289
2289
|
keyType: t,
|
|
2290
2290
|
typeName: x.ZodMap,
|
|
@@ -2295,20 +2295,20 @@ class Re extends T {
|
|
|
2295
2295
|
const { status: n, ctx: r } = this._processInputParams(e);
|
|
2296
2296
|
if (r.parsedType !== g.set)
|
|
2297
2297
|
return b(r, {
|
|
2298
|
-
code:
|
|
2298
|
+
code: p.invalid_type,
|
|
2299
2299
|
expected: g.set,
|
|
2300
2300
|
received: r.parsedType
|
|
2301
2301
|
}), _;
|
|
2302
2302
|
const s = this._def;
|
|
2303
2303
|
s.minSize !== null && r.data.size < s.minSize.value && (b(r, {
|
|
2304
|
-
code:
|
|
2304
|
+
code: p.too_small,
|
|
2305
2305
|
minimum: s.minSize.value,
|
|
2306
2306
|
type: "set",
|
|
2307
2307
|
inclusive: !0,
|
|
2308
2308
|
exact: !1,
|
|
2309
2309
|
message: s.minSize.message
|
|
2310
2310
|
}), n.dirty()), s.maxSize !== null && r.data.size > s.maxSize.value && (b(r, {
|
|
2311
|
-
code:
|
|
2311
|
+
code: p.too_big,
|
|
2312
2312
|
maximum: s.maxSize.value,
|
|
2313
2313
|
type: "set",
|
|
2314
2314
|
inclusive: !0,
|
|
@@ -2362,7 +2362,7 @@ class Ze extends T {
|
|
|
2362
2362
|
const { ctx: n } = this._processInputParams(e);
|
|
2363
2363
|
if (n.parsedType !== g.function)
|
|
2364
2364
|
return b(n, {
|
|
2365
|
-
code:
|
|
2365
|
+
code: p.invalid_type,
|
|
2366
2366
|
expected: g.function,
|
|
2367
2367
|
received: n.parsedType
|
|
2368
2368
|
}), _;
|
|
@@ -2373,11 +2373,11 @@ class Ze extends T {
|
|
|
2373
2373
|
errorMaps: [
|
|
2374
2374
|
n.common.contextualErrorMap,
|
|
2375
2375
|
n.schemaErrorMap,
|
|
2376
|
-
|
|
2376
|
+
Dt(),
|
|
2377
2377
|
Ve
|
|
2378
2378
|
].filter((c) => !!c),
|
|
2379
2379
|
issueData: {
|
|
2380
|
-
code:
|
|
2380
|
+
code: p.invalid_arguments,
|
|
2381
2381
|
argumentsError: u
|
|
2382
2382
|
}
|
|
2383
2383
|
});
|
|
@@ -2389,11 +2389,11 @@ class Ze extends T {
|
|
|
2389
2389
|
errorMaps: [
|
|
2390
2390
|
n.common.contextualErrorMap,
|
|
2391
2391
|
n.schemaErrorMap,
|
|
2392
|
-
|
|
2392
|
+
Dt(),
|
|
2393
2393
|
Ve
|
|
2394
2394
|
].filter((c) => !!c),
|
|
2395
2395
|
issueData: {
|
|
2396
|
-
code:
|
|
2396
|
+
code: p.invalid_return_type,
|
|
2397
2397
|
returnTypeError: u
|
|
2398
2398
|
}
|
|
2399
2399
|
});
|
|
@@ -2401,24 +2401,24 @@ class Ze extends T {
|
|
|
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
|
|
2405
|
-
const c = new
|
|
2404
|
+
return L(async function(...u) {
|
|
2405
|
+
const c = new H([]), d = await o._def.args.parseAsync(u, a).catch((m) => {
|
|
2406
2406
|
throw c.addIssue(r(u, m)), c;
|
|
2407
|
-
}),
|
|
2408
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2409
|
-
throw c.addIssue(s(
|
|
2407
|
+
}), f = await Reflect.apply(i, this, d);
|
|
2408
|
+
return await o._def.returns._def.type.parseAsync(f, a).catch((m) => {
|
|
2409
|
+
throw c.addIssue(s(f, m)), c;
|
|
2410
2410
|
});
|
|
2411
2411
|
});
|
|
2412
2412
|
} else {
|
|
2413
2413
|
const o = this;
|
|
2414
|
-
return
|
|
2414
|
+
return L(function(...u) {
|
|
2415
2415
|
const c = o._def.args.safeParse(u, a);
|
|
2416
2416
|
if (!c.success)
|
|
2417
|
-
throw new
|
|
2418
|
-
const d = Reflect.apply(i, this, c.data),
|
|
2419
|
-
if (!
|
|
2420
|
-
throw new
|
|
2421
|
-
return
|
|
2417
|
+
throw new H([r(u, c.error)]);
|
|
2418
|
+
const d = Reflect.apply(i, this, c.data), f = o._def.returns.safeParse(d, a);
|
|
2419
|
+
if (!f.success)
|
|
2420
|
+
throw new H([s(d, f.error)]);
|
|
2421
|
+
return f.data;
|
|
2422
2422
|
});
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
@@ -2475,7 +2475,7 @@ class ht extends T {
|
|
|
2475
2475
|
const n = this._getOrReturnCtx(e);
|
|
2476
2476
|
return b(n, {
|
|
2477
2477
|
received: n.data,
|
|
2478
|
-
code:
|
|
2478
|
+
code: p.invalid_literal,
|
|
2479
2479
|
expected: this._def.value
|
|
2480
2480
|
}), _;
|
|
2481
2481
|
}
|
|
@@ -2505,20 +2505,20 @@ class xe extends T {
|
|
|
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: I.joinValues(r),
|
|
2509
2509
|
received: n.parsedType,
|
|
2510
|
-
code:
|
|
2510
|
+
code: p.invalid_type
|
|
2511
2511
|
}), _;
|
|
2512
2512
|
}
|
|
2513
|
-
if (Ut(this, tt) ||
|
|
2513
|
+
if (Ut(this, tt) || Lr(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,
|
|
2517
|
-
code:
|
|
2517
|
+
code: p.invalid_enum_value,
|
|
2518
2518
|
options: r
|
|
2519
2519
|
}), _;
|
|
2520
2520
|
}
|
|
2521
|
-
return
|
|
2521
|
+
return L(e.data);
|
|
2522
2522
|
}
|
|
2523
2523
|
get options() {
|
|
2524
2524
|
return this._def.values;
|
|
@@ -2561,24 +2561,24 @@ class pt extends T {
|
|
|
2561
2561
|
super(...arguments), nt.set(this, void 0);
|
|
2562
2562
|
}
|
|
2563
2563
|
_parse(e) {
|
|
2564
|
-
const n =
|
|
2564
|
+
const n = I.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 = I.objectValues(n);
|
|
2567
2567
|
return b(r, {
|
|
2568
|
-
expected:
|
|
2568
|
+
expected: I.joinValues(s),
|
|
2569
2569
|
received: r.parsedType,
|
|
2570
|
-
code:
|
|
2570
|
+
code: p.invalid_type
|
|
2571
2571
|
}), _;
|
|
2572
2572
|
}
|
|
2573
|
-
if (Ut(this, nt) ||
|
|
2574
|
-
const s =
|
|
2573
|
+
if (Ut(this, nt) || Lr(this, nt, new Set(I.getValidEnumValues(this._def.values))), !Ut(this, nt).has(e.data)) {
|
|
2574
|
+
const s = I.objectValues(n);
|
|
2575
2575
|
return b(r, {
|
|
2576
2576
|
received: r.data,
|
|
2577
|
-
code:
|
|
2577
|
+
code: p.invalid_enum_value,
|
|
2578
2578
|
options: s
|
|
2579
2579
|
}), _;
|
|
2580
2580
|
}
|
|
2581
|
-
return
|
|
2581
|
+
return L(e.data);
|
|
2582
2582
|
}
|
|
2583
2583
|
get enum() {
|
|
2584
2584
|
return this._def.values;
|
|
@@ -2598,12 +2598,12 @@ class Ge extends T {
|
|
|
2598
2598
|
const { ctx: n } = this._processInputParams(e);
|
|
2599
2599
|
if (n.parsedType !== g.promise && n.common.async === !1)
|
|
2600
2600
|
return b(n, {
|
|
2601
|
-
code:
|
|
2601
|
+
code: p.invalid_type,
|
|
2602
2602
|
expected: g.promise,
|
|
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 L(r.then((s) => this._def.type.parseAsync(s, {
|
|
2607
2607
|
path: n.path,
|
|
2608
2608
|
errorMap: n.common.contextualErrorMap
|
|
2609
2609
|
})));
|
|
@@ -2688,7 +2688,7 @@ class ne extends T {
|
|
|
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
|
+
I.assertNever(s);
|
|
2692
2692
|
}
|
|
2693
2693
|
}
|
|
2694
2694
|
ne.create = (t, e, n) => new ne({
|
|
@@ -2705,7 +2705,7 @@ ne.createWithPreprocess = (t, e, n) => new ne({
|
|
|
2705
2705
|
});
|
|
2706
2706
|
class ae extends T {
|
|
2707
2707
|
_parse(e) {
|
|
2708
|
-
return this._getType(e) === g.undefined ?
|
|
2708
|
+
return this._getType(e) === g.undefined ? L(void 0) : this._def.innerType._parse(e);
|
|
2709
2709
|
}
|
|
2710
2710
|
unwrap() {
|
|
2711
2711
|
return this._def.innerType;
|
|
@@ -2718,7 +2718,7 @@ ae.create = (t, e) => new ae({
|
|
|
2718
2718
|
});
|
|
2719
2719
|
class _e extends T {
|
|
2720
2720
|
_parse(e) {
|
|
2721
|
-
return this._getType(e) === g.null ?
|
|
2721
|
+
return this._getType(e) === g.null ? L(null) : this._def.innerType._parse(e);
|
|
2722
2722
|
}
|
|
2723
2723
|
unwrap() {
|
|
2724
2724
|
return this._def.innerType;
|
|
@@ -2768,7 +2768,7 @@ class yt extends T {
|
|
|
2768
2768
|
status: "valid",
|
|
2769
2769
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
2770
2770
|
get error() {
|
|
2771
|
-
return new
|
|
2771
|
+
return new H(r.common.issues);
|
|
2772
2772
|
},
|
|
2773
2773
|
input: r.data
|
|
2774
2774
|
})
|
|
@@ -2776,7 +2776,7 @@ class yt extends T {
|
|
|
2776
2776
|
status: "valid",
|
|
2777
2777
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2778
2778
|
get error() {
|
|
2779
|
-
return new
|
|
2779
|
+
return new H(r.common.issues);
|
|
2780
2780
|
},
|
|
2781
2781
|
input: r.data
|
|
2782
2782
|
})
|
|
@@ -2792,12 +2792,12 @@ 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 qt extends T {
|
|
2796
2796
|
_parse(e) {
|
|
2797
2797
|
if (this._getType(e) !== g.nan) {
|
|
2798
2798
|
const r = this._getOrReturnCtx(e);
|
|
2799
2799
|
return b(r, {
|
|
2800
|
-
code:
|
|
2800
|
+
code: p.invalid_type,
|
|
2801
2801
|
expected: g.nan,
|
|
2802
2802
|
received: r.parsedType
|
|
2803
2803
|
}), _;
|
|
@@ -2805,12 +2805,12 @@ class Ht extends T {
|
|
|
2805
2805
|
return { status: "valid", value: e.data };
|
|
2806
2806
|
}
|
|
2807
2807
|
}
|
|
2808
|
-
|
|
2808
|
+
qt.create = (t) => new qt({
|
|
2809
2809
|
typeName: x.ZodNaN,
|
|
2810
2810
|
...E(t)
|
|
2811
2811
|
});
|
|
2812
|
-
const
|
|
2813
|
-
class
|
|
2812
|
+
const Wa = Symbol("zod_brand");
|
|
2813
|
+
class Hn extends T {
|
|
2814
2814
|
_parse(e) {
|
|
2815
2815
|
const { ctx: n } = this._processInputParams(e), r = n.data;
|
|
2816
2816
|
return this._def.type._parse({
|
|
@@ -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 Wr(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 qr(t, e = {}, n) {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
}) : Ue.create();
|
|
2888
2888
|
}
|
|
2889
|
-
const
|
|
2889
|
+
const Ha = {
|
|
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 qa = (t, e = {
|
|
2897
2897
|
message: `Input not instance of ${t.name}`
|
|
2898
|
-
}) =>
|
|
2898
|
+
}) => Wr((n) => n instanceof t, e), Hr = ee.create, qr = ve.create, Ka = qt.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 = Wt.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 = Ht.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 = () => Hr().optional(), Ci = () => qr().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({
|
|
@@ -2905,24 +2905,24 @@ const Ha = (t, e = {
|
|
|
2905
2905
|
bigint: (t) => we.create({ ...t, coerce: !0 }),
|
|
2906
2906
|
date: (t) => Se.create({ ...t, coerce: !0 })
|
|
2907
2907
|
}, ki = _;
|
|
2908
|
-
var
|
|
2908
|
+
var l = /* @__PURE__ */ Object.freeze({
|
|
2909
2909
|
__proto__: null,
|
|
2910
2910
|
defaultErrorMap: Ve,
|
|
2911
2911
|
setErrorMap: Pa,
|
|
2912
|
-
getErrorMap:
|
|
2912
|
+
getErrorMap: Dt,
|
|
2913
2913
|
makeIssue: Vt,
|
|
2914
2914
|
EMPTY_PATH: Ea,
|
|
2915
2915
|
addIssueToContext: b,
|
|
2916
2916
|
ParseStatus: z,
|
|
2917
2917
|
INVALID: _,
|
|
2918
2918
|
DIRTY: Fe,
|
|
2919
|
-
OK:
|
|
2919
|
+
OK: L,
|
|
2920
2920
|
isAborted: Tn,
|
|
2921
2921
|
isDirty: $n,
|
|
2922
2922
|
isValid: Ie,
|
|
2923
2923
|
isAsync: at,
|
|
2924
2924
|
get util() {
|
|
2925
|
-
return
|
|
2925
|
+
return I;
|
|
2926
2926
|
},
|
|
2927
2927
|
get objectUtil() {
|
|
2928
2928
|
return Cn;
|
|
@@ -2942,7 +2942,7 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2942
2942
|
ZodAny: Ue,
|
|
2943
2943
|
ZodUnknown: ke,
|
|
2944
2944
|
ZodNever: me,
|
|
2945
|
-
ZodVoid:
|
|
2945
|
+
ZodVoid: Wt,
|
|
2946
2946
|
ZodArray: te,
|
|
2947
2947
|
ZodObject: j,
|
|
2948
2948
|
ZodUnion: ut,
|
|
@@ -2950,7 +2950,7 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2950
2950
|
ZodIntersection: dt,
|
|
2951
2951
|
ZodTuple: oe,
|
|
2952
2952
|
ZodRecord: lt,
|
|
2953
|
-
ZodMap:
|
|
2953
|
+
ZodMap: Ht,
|
|
2954
2954
|
ZodSet: Re,
|
|
2955
2955
|
ZodFunction: Ze,
|
|
2956
2956
|
ZodLazy: ft,
|
|
@@ -2964,15 +2964,15 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2964
2964
|
ZodNullable: _e,
|
|
2965
2965
|
ZodDefault: mt,
|
|
2966
2966
|
ZodCatch: yt,
|
|
2967
|
-
ZodNaN:
|
|
2968
|
-
BRAND:
|
|
2969
|
-
ZodBranded:
|
|
2967
|
+
ZodNaN: qt,
|
|
2968
|
+
BRAND: Wa,
|
|
2969
|
+
ZodBranded: Hn,
|
|
2970
2970
|
ZodPipeline: Bt,
|
|
2971
2971
|
ZodReadonly: bt,
|
|
2972
|
-
custom:
|
|
2972
|
+
custom: Wr,
|
|
2973
2973
|
Schema: T,
|
|
2974
2974
|
ZodSchema: T,
|
|
2975
|
-
late:
|
|
2975
|
+
late: Ha,
|
|
2976
2976
|
get ZodFirstPartyTypeKind() {
|
|
2977
2977
|
return x;
|
|
2978
2978
|
},
|
|
@@ -2986,7 +2986,7 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2986
2986
|
effect: wr,
|
|
2987
2987
|
enum: gi,
|
|
2988
2988
|
function: mi,
|
|
2989
|
-
instanceof:
|
|
2989
|
+
instanceof: qa,
|
|
2990
2990
|
intersection: di,
|
|
2991
2991
|
lazy: yi,
|
|
2992
2992
|
literal: bi,
|
|
@@ -2996,7 +2996,7 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
2996
2996
|
never: ri,
|
|
2997
2997
|
null: ei,
|
|
2998
2998
|
nullable: _i,
|
|
2999
|
-
number:
|
|
2999
|
+
number: qr,
|
|
3000
3000
|
object: ii,
|
|
3001
3001
|
oboolean: Ti,
|
|
3002
3002
|
onumber: Ci,
|
|
@@ -3008,7 +3008,7 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
3008
3008
|
record: fi,
|
|
3009
3009
|
set: pi,
|
|
3010
3010
|
strictObject: oi,
|
|
3011
|
-
string:
|
|
3011
|
+
string: Hr,
|
|
3012
3012
|
symbol: Xa,
|
|
3013
3013
|
transformer: wr,
|
|
3014
3014
|
tuple: li,
|
|
@@ -3017,9 +3017,9 @@ var p = /* @__PURE__ */ Object.freeze({
|
|
|
3017
3017
|
unknown: ni,
|
|
3018
3018
|
void: si,
|
|
3019
3019
|
NEVER: ki,
|
|
3020
|
-
ZodIssueCode:
|
|
3020
|
+
ZodIssueCode: p,
|
|
3021
3021
|
quotelessJson: _a,
|
|
3022
|
-
ZodError:
|
|
3022
|
+
ZodError: H
|
|
3023
3023
|
});
|
|
3024
3024
|
const Jr = "2.22.1";
|
|
3025
3025
|
let Xe = {
|
|
@@ -3148,7 +3148,7 @@ 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 qn(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++;
|
|
@@ -3216,7 +3216,7 @@ 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 We(t, e = {}) {
|
|
3220
3220
|
return Number(gt(t, e));
|
|
3221
3221
|
}
|
|
3222
3222
|
const Bi = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
@@ -3257,7 +3257,7 @@ function Jn(t, e = {}) {
|
|
|
3257
3257
|
const n = Ni.encode(t);
|
|
3258
3258
|
return G(n, e);
|
|
3259
3259
|
}
|
|
3260
|
-
function
|
|
3260
|
+
function He(t, { includeName: e = !1 } = {}) {
|
|
3261
3261
|
if (t.type !== "function" && t.type !== "event" && t.type !== "error")
|
|
3262
3262
|
throw new Ki(t.type);
|
|
3263
3263
|
return `${t.name}(${Yn(t.inputs, { includeName: e })})`;
|
|
@@ -3326,7 +3326,7 @@ class Xn extends y {
|
|
|
3326
3326
|
});
|
|
3327
3327
|
}
|
|
3328
3328
|
}
|
|
3329
|
-
class
|
|
3329
|
+
class Li 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,7 +3336,7 @@ class Di extends y {
|
|
|
3336
3336
|
`), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
3337
3337
|
}
|
|
3338
3338
|
}
|
|
3339
|
-
class
|
|
3339
|
+
class Di 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
|
}
|
|
@@ -3398,8 +3398,8 @@ class Gi extends y {
|
|
|
3398
3398
|
constructor(e, n) {
|
|
3399
3399
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
3400
3400
|
metaMessages: [
|
|
3401
|
-
`\`${e.type}\` in \`${
|
|
3402
|
-
`\`${n.type}\` in \`${
|
|
3401
|
+
`\`${e.type}\` in \`${He(e.abiItem)}\`, and`,
|
|
3402
|
+
`\`${n.type}\` in \`${He(n.abiItem)}\``,
|
|
3403
3403
|
"",
|
|
3404
3404
|
"These types encode differently and cannot be distinguished at runtime.",
|
|
3405
3405
|
"Remove one of the ambiguous items in the ABI."
|
|
@@ -3408,7 +3408,7 @@ class Gi extends y {
|
|
|
3408
3408
|
});
|
|
3409
3409
|
}
|
|
3410
3410
|
}
|
|
3411
|
-
class
|
|
3411
|
+
class Wi 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 qi extends y {
|
|
|
3417
3417
|
`), { docsPath: n, name: "InvalidAbiEncodingType" });
|
|
3418
3418
|
}
|
|
3419
3419
|
}
|
|
3420
|
-
class
|
|
3420
|
+
class Hi 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 Wi extends y {
|
|
|
3426
3426
|
`), { docsPath: n, name: "InvalidAbiDecodingType" });
|
|
3427
3427
|
}
|
|
3428
3428
|
}
|
|
3429
|
-
class
|
|
3429
|
+
class qi extends y {
|
|
3430
3430
|
constructor(e) {
|
|
3431
3431
|
super([`Value "${e}" is not a valid array.`].join(`
|
|
3432
3432
|
`), {
|
|
@@ -3443,7 +3443,7 @@ class Ki extends y {
|
|
|
3443
3443
|
`), { name: "InvalidDefinitionTypeError" });
|
|
3444
3444
|
}
|
|
3445
3445
|
}
|
|
3446
|
-
function
|
|
3446
|
+
function qe(t) {
|
|
3447
3447
|
return typeof t[0] == "string" ? rn(t) : Ji(t);
|
|
3448
3448
|
}
|
|
3449
3449
|
function Ji(t) {
|
|
@@ -3595,7 +3595,7 @@ function Qn({ param: t, value: e }) {
|
|
|
3595
3595
|
return so(e, { param: t });
|
|
3596
3596
|
if (t.type === "string")
|
|
3597
3597
|
return oo(e);
|
|
3598
|
-
throw new
|
|
3598
|
+
throw new Wi(t.type, {
|
|
3599
3599
|
docsPath: "/docs/contract/encodeAbiParameters"
|
|
3600
3600
|
});
|
|
3601
3601
|
}
|
|
@@ -3611,7 +3611,7 @@ function er(t) {
|
|
|
3611
3611
|
const { dynamic: i, encoded: o } = t[a];
|
|
3612
3612
|
i ? (n.push(M(e + s, { size: 32 })), r.push(o), s += N(o)) : n.push(o);
|
|
3613
3613
|
}
|
|
3614
|
-
return
|
|
3614
|
+
return qe([...n, ...r]);
|
|
3615
3615
|
}
|
|
3616
3616
|
function no(t) {
|
|
3617
3617
|
if (!Ee(t))
|
|
@@ -3621,9 +3621,9 @@ function no(t) {
|
|
|
3621
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 qi(t);
|
|
3625
3625
|
if (!r && t.length !== e)
|
|
3626
|
-
throw new
|
|
3626
|
+
throw new Li({
|
|
3627
3627
|
expectedLength: e,
|
|
3628
3628
|
givenLength: t.length,
|
|
3629
3629
|
type: `${n.type}[${e}]`
|
|
@@ -3640,7 +3640,7 @@ function ro(t, { length: e, param: n }) {
|
|
|
3640
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 ? qe([o, i]) : o
|
|
3644
3644
|
};
|
|
3645
3645
|
}
|
|
3646
3646
|
if (s)
|
|
@@ -3648,7 +3648,7 @@ function ro(t, { length: e, param: n }) {
|
|
|
3648
3648
|
}
|
|
3649
3649
|
return {
|
|
3650
3650
|
dynamic: !1,
|
|
3651
|
-
encoded:
|
|
3651
|
+
encoded: qe(a.map(({ encoded: i }) => i))
|
|
3652
3652
|
};
|
|
3653
3653
|
}
|
|
3654
3654
|
function so(t, { param: e }) {
|
|
@@ -3660,11 +3660,11 @@ function so(t, { param: e }) {
|
|
|
3660
3660
|
size: Math.ceil((t.length - 2) / 2 / 32) * 32
|
|
3661
3661
|
})), {
|
|
3662
3662
|
dynamic: !0,
|
|
3663
|
-
encoded:
|
|
3663
|
+
encoded: qe([ge(M(r, { size: 32 })), s])
|
|
3664
3664
|
};
|
|
3665
3665
|
}
|
|
3666
3666
|
if (r !== Number.parseInt(n))
|
|
3667
|
-
throw new
|
|
3667
|
+
throw new Di({
|
|
3668
3668
|
expectedSize: Number.parseInt(n),
|
|
3669
3669
|
value: t
|
|
3670
3670
|
});
|
|
@@ -3703,7 +3703,7 @@ function oo(t) {
|
|
|
3703
3703
|
}));
|
|
3704
3704
|
return {
|
|
3705
3705
|
dynamic: !0,
|
|
3706
|
-
encoded:
|
|
3706
|
+
encoded: qe([
|
|
3707
3707
|
ge(M(N(e), { size: 32 })),
|
|
3708
3708
|
...r
|
|
3709
3709
|
])
|
|
@@ -3721,7 +3721,7 @@ function co(t, { param: e }) {
|
|
|
3721
3721
|
}
|
|
3722
3722
|
return {
|
|
3723
3723
|
dynamic: n,
|
|
3724
|
-
encoded: n ? er(r) :
|
|
3724
|
+
encoded: n ? er(r) : qe(r.map(({ encoded: s }) => s))
|
|
3725
3725
|
};
|
|
3726
3726
|
}
|
|
3727
3727
|
function tr(t) {
|
|
@@ -3779,10 +3779,10 @@ 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
|
-
const { r: c, s: d, v:
|
|
3782
|
+
const { r: c, s: d, v: f, yParity: h } = e, m = Number(h ?? f), 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 = We(`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
|
}
|
|
@@ -4287,13 +4287,13 @@ class Co extends y {
|
|
|
4287
4287
|
}
|
|
4288
4288
|
}
|
|
4289
4289
|
class To extends y {
|
|
4290
|
-
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to:
|
|
4290
|
+
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to: f, value: h }) {
|
|
4291
4291
|
var v;
|
|
4292
4292
|
const m = Ft({
|
|
4293
4293
|
chain: s && `${s == null ? void 0 : s.name} (id: ${s == null ? void 0 : s.id})`,
|
|
4294
4294
|
from: n == null ? void 0 : n.address,
|
|
4295
|
-
to:
|
|
4296
|
-
value: typeof
|
|
4295
|
+
to: f,
|
|
4296
|
+
value: typeof h < "u" && `${rr(h)} ${((v = s == null ? void 0 : s.nativeCurrency) == null ? void 0 : v.symbol) || "ETH"}`,
|
|
4297
4297
|
data: a,
|
|
4298
4298
|
gas: i,
|
|
4299
4299
|
gasPrice: typeof o < "u" && `${U(o)} gwei`,
|
|
@@ -4374,7 +4374,7 @@ class bs extends y {
|
|
|
4374
4374
|
}
|
|
4375
4375
|
}
|
|
4376
4376
|
const ko = -1;
|
|
4377
|
-
class
|
|
4377
|
+
class W extends y {
|
|
4378
4378
|
constructor(e, { code: n, docsPath: r, metaMessages: s, name: a, shortMessage: i }) {
|
|
4379
4379
|
super(i, {
|
|
4380
4380
|
cause: e,
|
|
@@ -4389,7 +4389,7 @@ class q extends y {
|
|
|
4389
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 W {
|
|
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 q {
|
|
|
4399
4399
|
}), this.data = n.data;
|
|
4400
4400
|
}
|
|
4401
4401
|
}
|
|
4402
|
-
class wt extends
|
|
4402
|
+
class wt extends W {
|
|
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 W {
|
|
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 W {
|
|
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 W {
|
|
4448
4448
|
constructor(e) {
|
|
4449
4449
|
super(e, {
|
|
4450
4450
|
code: Pt.code,
|
|
@@ -4463,7 +4463,7 @@ Object.defineProperty(Pt, "code", {
|
|
|
4463
4463
|
writable: !0,
|
|
4464
4464
|
value: -32602
|
|
4465
4465
|
});
|
|
4466
|
-
class Me extends
|
|
4466
|
+
class Me extends W {
|
|
4467
4467
|
constructor(e) {
|
|
4468
4468
|
super(e, {
|
|
4469
4469
|
code: Me.code,
|
|
@@ -4478,7 +4478,7 @@ Object.defineProperty(Me, "code", {
|
|
|
4478
4478
|
writable: !0,
|
|
4479
4479
|
value: -32603
|
|
4480
4480
|
});
|
|
4481
|
-
class Et extends
|
|
4481
|
+
class Et extends W {
|
|
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 W {
|
|
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 W {
|
|
4521
4521
|
constructor(e) {
|
|
4522
4522
|
super(e, {
|
|
4523
4523
|
code: Ct.code,
|
|
@@ -4532,7 +4532,7 @@ Object.defineProperty(Ct, "code", {
|
|
|
4532
4532
|
writable: !0,
|
|
4533
4533
|
value: -32002
|
|
4534
4534
|
});
|
|
4535
|
-
class Tt extends
|
|
4535
|
+
class Tt extends W {
|
|
4536
4536
|
constructor(e) {
|
|
4537
4537
|
super(e, {
|
|
4538
4538
|
code: Tt.code,
|
|
@@ -4547,7 +4547,7 @@ Object.defineProperty(Tt, "code", {
|
|
|
4547
4547
|
writable: !0,
|
|
4548
4548
|
value: -32003
|
|
4549
4549
|
});
|
|
4550
|
-
class $t extends
|
|
4550
|
+
class $t extends W {
|
|
4551
4551
|
constructor(e, { method: n } = {}) {
|
|
4552
4552
|
super(e, {
|
|
4553
4553
|
code: $t.code,
|
|
@@ -4562,7 +4562,7 @@ Object.defineProperty($t, "code", {
|
|
|
4562
4562
|
writable: !0,
|
|
4563
4563
|
value: -32004
|
|
4564
4564
|
});
|
|
4565
|
-
class Ke extends
|
|
4565
|
+
class Ke extends W {
|
|
4566
4566
|
constructor(e) {
|
|
4567
4567
|
super(e, {
|
|
4568
4568
|
code: Ke.code,
|
|
@@ -4577,7 +4577,7 @@ Object.defineProperty(Ke, "code", {
|
|
|
4577
4577
|
writable: !0,
|
|
4578
4578
|
value: -32005
|
|
4579
4579
|
});
|
|
4580
|
-
class kt extends
|
|
4580
|
+
class kt extends W {
|
|
4581
4581
|
constructor(e) {
|
|
4582
4582
|
super(e, {
|
|
4583
4583
|
code: kt.code,
|
|
@@ -4592,16 +4592,16 @@ Object.defineProperty(kt, "code", {
|
|
|
4592
4592
|
writable: !0,
|
|
4593
4593
|
value: -32006
|
|
4594
4594
|
});
|
|
4595
|
-
class
|
|
4595
|
+
class Le extends Ye {
|
|
4596
4596
|
constructor(e) {
|
|
4597
4597
|
super(e, {
|
|
4598
|
-
code:
|
|
4598
|
+
code: Le.code,
|
|
4599
4599
|
name: "UserRejectedRequestError",
|
|
4600
4600
|
shortMessage: "User rejected the request."
|
|
4601
4601
|
});
|
|
4602
4602
|
}
|
|
4603
4603
|
}
|
|
4604
|
-
Object.defineProperty(
|
|
4604
|
+
Object.defineProperty(Le, "code", {
|
|
4605
4605
|
enumerable: !0,
|
|
4606
4606
|
configurable: !0,
|
|
4607
4607
|
writable: !0,
|
|
@@ -4682,7 +4682,7 @@ Object.defineProperty(Ot, "code", {
|
|
|
4682
4682
|
writable: !0,
|
|
4683
4683
|
value: 4902
|
|
4684
4684
|
});
|
|
4685
|
-
class Io extends
|
|
4685
|
+
class Io extends W {
|
|
4686
4686
|
constructor(e) {
|
|
4687
4687
|
super(e, {
|
|
4688
4688
|
name: "UnknownRpcError",
|
|
@@ -4781,7 +4781,7 @@ async function gs(t) {
|
|
|
4781
4781
|
const e = await t.request({
|
|
4782
4782
|
method: "eth_chainId"
|
|
4783
4783
|
}, { dedupe: !0 });
|
|
4784
|
-
return
|
|
4784
|
+
return We(e);
|
|
4785
4785
|
}
|
|
4786
4786
|
class jo extends y {
|
|
4787
4787
|
constructor() {
|
|
@@ -4820,13 +4820,13 @@ function zo(t) {
|
|
|
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 ? We(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 ? We(t.nonce) : void 0,
|
|
4830
4830
|
to: t.to ? t.to : null,
|
|
4831
4831
|
transactionIndex: t.transactionIndex ? Number(t.transactionIndex) : null,
|
|
4832
4832
|
type: t.type ? Fo[t.type] : void 0,
|
|
@@ -4857,7 +4857,7 @@ function Zo(t) {
|
|
|
4857
4857
|
yParity: Number(e.yParity)
|
|
4858
4858
|
}));
|
|
4859
4859
|
}
|
|
4860
|
-
function
|
|
4860
|
+
function Lo(t) {
|
|
4861
4861
|
const e = (t.transactions ?? []).map((n) => typeof n == "string" ? n : zo(n));
|
|
4862
4862
|
return {
|
|
4863
4863
|
...t,
|
|
@@ -4878,7 +4878,7 @@ function Do(t) {
|
|
|
4878
4878
|
};
|
|
4879
4879
|
}
|
|
4880
4880
|
async function Qt(t, { blockHash: e, blockNumber: n, blockTag: r, includeTransactions: s } = {}) {
|
|
4881
|
-
var d,
|
|
4881
|
+
var d, f, h;
|
|
4882
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({
|
|
@@ -4889,7 +4889,7 @@ async function Qt(t, { blockHash: e, blockNumber: n, blockTag: r, includeTransac
|
|
|
4889
4889
|
params: [o || a, i]
|
|
4890
4890
|
}, { dedupe: !!o }), !u)
|
|
4891
4891
|
throw new No({ blockHash: e, blockNumber: n });
|
|
4892
|
-
return (((
|
|
4892
|
+
return (((h = (f = (d = t.chain) == null ? void 0 : d.formatters) == null ? void 0 : f.block) == null ? void 0 : h.format) || Lo)(u);
|
|
4893
4893
|
}
|
|
4894
4894
|
async function vs(t) {
|
|
4895
4895
|
const e = await t.request({
|
|
@@ -4897,7 +4897,7 @@ async function vs(t) {
|
|
|
4897
4897
|
});
|
|
4898
4898
|
return BigInt(e);
|
|
4899
4899
|
}
|
|
4900
|
-
async function
|
|
4900
|
+
async function Do(t, e) {
|
|
4901
4901
|
var a, i;
|
|
4902
4902
|
const { block: n, chain: r = t.chain, request: s } = e || {};
|
|
4903
4903
|
try {
|
|
@@ -4930,7 +4930,7 @@ async function Lo(t, e) {
|
|
|
4930
4930
|
}
|
|
4931
4931
|
}
|
|
4932
4932
|
async function Cr(t, e) {
|
|
4933
|
-
var
|
|
4933
|
+
var h, m;
|
|
4934
4934
|
const { block: n, chain: r = t.chain, request: s, type: a = "eip1559" } = e || {}, i = await (async () => {
|
|
4935
4935
|
var v, $;
|
|
4936
4936
|
return typeof ((v = r == null ? void 0 : r.fees) == null ? void 0 : v.baseFeeMultiplier) == "function" ? r.fees.baseFeeMultiplier({
|
|
@@ -4941,7 +4941,7 @@ async function Cr(t, e) {
|
|
|
4941
4941
|
})();
|
|
4942
4942
|
if (i < 1)
|
|
4943
4943
|
throw new jo();
|
|
4944
|
-
const u = 10 ** (((
|
|
4944
|
+
const u = 10 ** (((h = i.toString().split(".")[1]) == null ? void 0 : h.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,7 +4956,7 @@ 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 Do(t, {
|
|
4960
4960
|
block: d,
|
|
4961
4961
|
chain: r,
|
|
4962
4962
|
request: s
|
|
@@ -4971,12 +4971,12 @@ async function Cr(t, e) {
|
|
|
4971
4971
|
};
|
|
4972
4972
|
}
|
|
4973
4973
|
class Vo extends y {
|
|
4974
|
-
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to:
|
|
4974
|
+
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to: f, value: h }) {
|
|
4975
4975
|
var v;
|
|
4976
4976
|
const m = Ft({
|
|
4977
4977
|
from: n == null ? void 0 : n.address,
|
|
4978
|
-
to:
|
|
4979
|
-
value: typeof
|
|
4978
|
+
to: f,
|
|
4979
|
+
value: typeof h < "u" && `${rr(h)} ${((v = s == null ? void 0 : s.nativeCurrency) == null ? void 0 : v.symbol) || "ETH"}`,
|
|
4980
4980
|
data: a,
|
|
4981
4981
|
gas: i,
|
|
4982
4982
|
gasPrice: typeof o < "u" && `${U(o)} gwei`,
|
|
@@ -5018,7 +5018,7 @@ class Go extends y {
|
|
|
5018
5018
|
});
|
|
5019
5019
|
}
|
|
5020
5020
|
}
|
|
5021
|
-
class
|
|
5021
|
+
class Wo extends y {
|
|
5022
5022
|
constructor() {
|
|
5023
5023
|
super("state and stateDiff are set on the same account.", {
|
|
5024
5024
|
name: "StateAssignmentConflictError"
|
|
@@ -5029,7 +5029,7 @@ function Tr(t) {
|
|
|
5029
5029
|
return t.reduce((e, { slot: n, value: r }) => `${e} ${n}: ${r}
|
|
5030
5030
|
`, "");
|
|
5031
5031
|
}
|
|
5032
|
-
function
|
|
5032
|
+
function Ho(t) {
|
|
5033
5033
|
return t.reduce((e, { address: n, ...r }) => {
|
|
5034
5034
|
let s = `${e} ${n}:
|
|
5035
5035
|
`;
|
|
@@ -5060,11 +5060,11 @@ function $r(t) {
|
|
|
5060
5060
|
return e[n] = r, e;
|
|
5061
5061
|
}, {});
|
|
5062
5062
|
}
|
|
5063
|
-
function
|
|
5063
|
+
function qo(t) {
|
|
5064
5064
|
const { balance: e, nonce: n, state: r, stateDiff: s, code: a } = t, i = {};
|
|
5065
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
|
|
5067
|
+
throw new Wo();
|
|
5068
5068
|
i.stateDiff = $r(s);
|
|
5069
5069
|
}
|
|
5070
5070
|
return i;
|
|
@@ -5078,7 +5078,7 @@ function ws(t) {
|
|
|
5078
5078
|
throw new vt({ address: n });
|
|
5079
5079
|
if (e[n])
|
|
5080
5080
|
throw new Go({ address: n });
|
|
5081
|
-
e[n] =
|
|
5081
|
+
e[n] = qo(r);
|
|
5082
5082
|
}
|
|
5083
5083
|
return e;
|
|
5084
5084
|
}
|
|
@@ -5100,14 +5100,14 @@ async function Jo(t, e) {
|
|
|
5100
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:
|
|
5103
|
+
const { accessList: o, authorizationList: u, blobs: c, blobVersionedHashes: d, blockNumber: f, blockTag: h, data: m, gas: v, gasPrice: $, maxFeePerBlobGas: P, maxFeePerGas: S, maxPriorityFeePerGas: R, nonce: A, value: O, stateOverride: q, ...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 = (
|
|
5110
|
+
}), re = (f ? M(f) : void 0) || h, C = ws(q), B = await (async () => {
|
|
5111
5111
|
if (F.to)
|
|
5112
5112
|
return F.to;
|
|
5113
5113
|
if (u && u.length > 0)
|
|
@@ -5168,7 +5168,7 @@ async function Yo(t, { address: e, blockTag: n = "latest", blockNumber: r }) {
|
|
|
5168
5168
|
method: "eth_getTransactionCount",
|
|
5169
5169
|
params: [e, r ? M(r) : n]
|
|
5170
5170
|
}, { dedupe: !!r });
|
|
5171
|
-
return
|
|
5171
|
+
return We(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 = [];
|
|
@@ -5275,7 +5275,7 @@ const As = [
|
|
|
5275
5275
|
"type"
|
|
5276
5276
|
];
|
|
5277
5277
|
async function Cs(t, e) {
|
|
5278
|
-
const { account: n = t.account, blobs: r, chain: s, gas: a, kzg: i, nonce: o, nonceManager: u, parameters: c = As, type: d } = e,
|
|
5278
|
+
const { account: n = t.account, blobs: r, chain: s, gas: a, kzg: i, nonce: o, nonceManager: u, parameters: c = As, type: d } = e, f = n && ue(n), h = { ...e, ...f ? { from: f == null ? void 0 : f.address } : {} };
|
|
5279
5279
|
let m;
|
|
5280
5280
|
async function v() {
|
|
5281
5281
|
return m || (m = await Z(t, Qt, "getBlock")({ blockTag: "latest" }), m);
|
|
@@ -5291,7 +5291,7 @@ async function Cs(t, e) {
|
|
|
5291
5291
|
commitments: S,
|
|
5292
5292
|
to: "hex"
|
|
5293
5293
|
});
|
|
5294
|
-
|
|
5294
|
+
h.blobVersionedHashes = R;
|
|
5295
5295
|
}
|
|
5296
5296
|
if (c.includes("sidecars")) {
|
|
5297
5297
|
const R = _s({ blobs: r, commitments: S, kzg: i }), A = sc({
|
|
@@ -5300,42 +5300,42 @@ async function Cs(t, e) {
|
|
|
5300
5300
|
proofs: R,
|
|
5301
5301
|
to: "hex"
|
|
5302
5302
|
});
|
|
5303
|
-
|
|
5303
|
+
h.sidecars = A;
|
|
5304
5304
|
}
|
|
5305
5305
|
}
|
|
5306
|
-
if (c.includes("chainId") && (
|
|
5306
|
+
if (c.includes("chainId") && (h.chainId = await P()), c.includes("nonce") && typeof o > "u" && f)
|
|
5307
5307
|
if (u) {
|
|
5308
5308
|
const S = await P();
|
|
5309
|
-
|
|
5310
|
-
address:
|
|
5309
|
+
h.nonce = await u.consume({
|
|
5310
|
+
address: f.address,
|
|
5311
5311
|
chainId: S,
|
|
5312
5312
|
client: t
|
|
5313
5313
|
});
|
|
5314
5314
|
} else
|
|
5315
|
-
|
|
5316
|
-
address:
|
|
5315
|
+
h.nonce = await Z(t, Yo, "getTransactionCount")({
|
|
5316
|
+
address: f.address,
|
|
5317
5317
|
blockTag: "pending"
|
|
5318
5318
|
});
|
|
5319
5319
|
if ((c.includes("fees") || c.includes("type")) && typeof d > "u")
|
|
5320
5320
|
try {
|
|
5321
|
-
|
|
5321
|
+
h.type = ac(h);
|
|
5322
5322
|
} catch {
|
|
5323
5323
|
const S = await v();
|
|
5324
|
-
|
|
5324
|
+
h.type = typeof (S == null ? void 0 : S.baseFeePerGas) == "bigint" ? "eip1559" : "legacy";
|
|
5325
5325
|
}
|
|
5326
5326
|
if (c.includes("fees"))
|
|
5327
|
-
if (
|
|
5328
|
-
if (typeof
|
|
5327
|
+
if (h.type !== "legacy" && h.type !== "eip2930") {
|
|
5328
|
+
if (typeof h.maxFeePerGas > "u" || typeof h.maxPriorityFeePerGas > "u") {
|
|
5329
5329
|
const S = await v(), { maxFeePerGas: R, maxPriorityFeePerGas: A } = await Cr(t, {
|
|
5330
5330
|
block: S,
|
|
5331
5331
|
chain: s,
|
|
5332
|
-
request:
|
|
5332
|
+
request: h
|
|
5333
5333
|
});
|
|
5334
5334
|
if (typeof e.maxPriorityFeePerGas > "u" && e.maxFeePerGas && e.maxFeePerGas < A)
|
|
5335
5335
|
throw new Bo({
|
|
5336
5336
|
maxPriorityFeePerGas: A
|
|
5337
5337
|
});
|
|
5338
|
-
|
|
5338
|
+
h.maxPriorityFeePerGas = A, h.maxFeePerGas = R;
|
|
5339
5339
|
}
|
|
5340
5340
|
} else {
|
|
5341
5341
|
if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u")
|
|
@@ -5343,15 +5343,15 @@ async function Cs(t, e) {
|
|
|
5343
5343
|
const S = await v(), { gasPrice: R } = await Cr(t, {
|
|
5344
5344
|
block: S,
|
|
5345
5345
|
chain: s,
|
|
5346
|
-
request:
|
|
5346
|
+
request: h,
|
|
5347
5347
|
type: "legacy"
|
|
5348
5348
|
});
|
|
5349
|
-
|
|
5349
|
+
h.gasPrice = R;
|
|
5350
5350
|
}
|
|
5351
|
-
return c.includes("gas") && typeof a > "u" && (
|
|
5352
|
-
...
|
|
5353
|
-
account:
|
|
5354
|
-
})), un(
|
|
5351
|
+
return c.includes("gas") && typeof a > "u" && (h.gas = await Z(t, Jo, "estimateGas")({
|
|
5352
|
+
...h,
|
|
5353
|
+
account: f && { address: f.address, type: "json-rpc" }
|
|
5354
|
+
})), un(h), delete h.parameters, h;
|
|
5355
5355
|
}
|
|
5356
5356
|
async function ic(t, { serializedTransaction: e }) {
|
|
5357
5357
|
return t.request({
|
|
@@ -5362,7 +5362,7 @@ async function ic(t, { serializedTransaction: e }) {
|
|
|
5362
5362
|
const vn = new sn(128);
|
|
5363
5363
|
async function oc(t, e) {
|
|
5364
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:
|
|
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: f, maxPriorityFeePerGas: h, 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 oc(t, e) {
|
|
|
5370
5370
|
const P = n ? ue(n) : null;
|
|
5371
5371
|
try {
|
|
5372
5372
|
un(e);
|
|
5373
|
-
const
|
|
5373
|
+
const q = await (async () => {
|
|
5374
5374
|
if (e.to)
|
|
5375
5375
|
return e.to;
|
|
5376
5376
|
if (a && a.length > 0)
|
|
@@ -5398,10 +5398,10 @@ async function oc(t, e) {
|
|
|
5398
5398
|
gas: u,
|
|
5399
5399
|
gasPrice: c,
|
|
5400
5400
|
maxFeePerBlobGas: d,
|
|
5401
|
-
maxFeePerGas:
|
|
5402
|
-
maxPriorityFeePerGas:
|
|
5401
|
+
maxFeePerGas: f,
|
|
5402
|
+
maxPriorityFeePerGas: h,
|
|
5403
5403
|
nonce: m,
|
|
5404
|
-
to:
|
|
5404
|
+
to: q,
|
|
5405
5405
|
value: v
|
|
5406
5406
|
}), B = vn.get(t.uid), Ce = B ? "wallet_sendTransaction" : "eth_sendTransaction";
|
|
5407
5407
|
try {
|
|
@@ -5435,14 +5435,14 @@ async function oc(t, e) {
|
|
|
5435
5435
|
gas: u,
|
|
5436
5436
|
gasPrice: c,
|
|
5437
5437
|
maxFeePerBlobGas: d,
|
|
5438
|
-
maxFeePerGas:
|
|
5439
|
-
maxPriorityFeePerGas:
|
|
5438
|
+
maxFeePerGas: f,
|
|
5439
|
+
maxPriorityFeePerGas: h,
|
|
5440
5440
|
nonce: m,
|
|
5441
5441
|
nonceManager: P.nonceManager,
|
|
5442
5442
|
parameters: [...As, "sidecars"],
|
|
5443
5443
|
value: v,
|
|
5444
5444
|
...$,
|
|
5445
|
-
to:
|
|
5445
|
+
to: q
|
|
5446
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
|
});
|
|
@@ -5460,8 +5460,8 @@ async function oc(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 (q) {
|
|
5464
|
+
throw q instanceof gn ? q : So(q, {
|
|
5465
5465
|
...e,
|
|
5466
5466
|
account: P,
|
|
5467
5467
|
chain: e.chain || void 0
|
|
@@ -5518,18 +5518,18 @@ function cc(t, e = {}) {
|
|
|
5518
5518
|
}
|
|
5519
5519
|
function uc(t, e = {}) {
|
|
5520
5520
|
let n = t;
|
|
5521
|
-
if (typeof e.size < "u" && (ce(n, { size: e.size }), n =
|
|
5521
|
+
if (typeof e.size < "u" && (ce(n, { size: e.size }), n = qn(n)), n.length > 1 || n[0] > 1)
|
|
5522
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 We(n, e);
|
|
5529
5529
|
}
|
|
5530
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 = qn(n, { dir: "right" })), new TextDecoder().decode(n);
|
|
5533
5533
|
}
|
|
5534
5534
|
function Ts(t, e) {
|
|
5535
5535
|
const n = typeof e == "string" ? ye(e) : e, r = nr(n);
|
|
@@ -5546,14 +5546,14 @@ function Ts(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] = De(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 De(t, e, { staticPosition: n }) {
|
|
5557
5557
|
const r = tr(e.type);
|
|
5558
5558
|
if (r) {
|
|
5559
5559
|
const [s, a] = r;
|
|
@@ -5571,36 +5571,36 @@ function Le(t, e, { staticPosition: n }) {
|
|
|
5571
5571
|
return mc(t, e);
|
|
5572
5572
|
if (e.type === "string")
|
|
5573
5573
|
return bc(t, { staticPosition: n });
|
|
5574
|
-
throw new
|
|
5574
|
+
throw new Hi(e.type, {
|
|
5575
5575
|
docsPath: "/docs/contract/decodeAbiParameters"
|
|
5576
5576
|
});
|
|
5577
5577
|
}
|
|
5578
|
-
const Rr = 32,
|
|
5578
|
+
const Rr = 32, Ln = 32;
|
|
5579
5579
|
function lc(t) {
|
|
5580
5580
|
const e = t.readBytes(32);
|
|
5581
5581
|
return [an(G(is(e, -20))), 32];
|
|
5582
5582
|
}
|
|
5583
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(Ln)), o = r + i, u = o + Rr;
|
|
5586
5586
|
t.setPosition(o);
|
|
5587
5587
|
const c = pe(t.readBytes(Rr)), d = jt(e);
|
|
5588
|
-
let
|
|
5589
|
-
const
|
|
5588
|
+
let f = 0;
|
|
5589
|
+
const h = [];
|
|
5590
5590
|
for (let m = 0; m < c; ++m) {
|
|
5591
|
-
t.setPosition(u + (d ? m * 32 :
|
|
5592
|
-
const [v, $] =
|
|
5591
|
+
t.setPosition(u + (d ? m * 32 : f));
|
|
5592
|
+
const [v, $] = De(t, e, {
|
|
5593
5593
|
staticPosition: u
|
|
5594
5594
|
});
|
|
5595
|
-
|
|
5595
|
+
f += $, h.push(v);
|
|
5596
5596
|
}
|
|
5597
|
-
return t.setPosition(r + 32), [
|
|
5597
|
+
return t.setPosition(r + 32), [h, 32];
|
|
5598
5598
|
}
|
|
5599
5599
|
if (jt(e)) {
|
|
5600
|
-
const i = pe(t.readBytes(
|
|
5600
|
+
const i = pe(t.readBytes(Ln)), 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] = De(t, e, {
|
|
5604
5604
|
staticPosition: o
|
|
5605
5605
|
});
|
|
5606
5606
|
u.push(d);
|
|
@@ -5610,7 +5610,7 @@ function fc(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] = De(t, e, {
|
|
5614
5614
|
staticPosition: r + s
|
|
5615
5615
|
});
|
|
5616
5616
|
s += u, a.push(o);
|
|
@@ -5644,19 +5644,19 @@ 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(Ln)), 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,
|
|
5651
|
+
const [d, f] = De(t, c, {
|
|
5652
5652
|
staticPosition: o
|
|
5653
5653
|
});
|
|
5654
|
-
a +=
|
|
5654
|
+
a += f, s[r ? u : c == null ? void 0 : c.name] = d;
|
|
5655
5655
|
}
|
|
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] = De(t, o, {
|
|
5660
5660
|
staticPosition: n
|
|
5661
5661
|
});
|
|
5662
5662
|
s[r ? i : o == null ? void 0 : o.name] = u, a += c;
|
|
@@ -5669,7 +5669,7 @@ function bc(t, { staticPosition: e }) {
|
|
|
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 = dc(
|
|
5672
|
+
const a = t.readBytes(s, 32), i = dc(qn(a));
|
|
5673
5673
|
return t.setPosition(e + 32), [i, 32];
|
|
5674
5674
|
}
|
|
5675
5675
|
function jt(t) {
|
|
@@ -5687,10 +5687,10 @@ function vc(t) {
|
|
|
5687
5687
|
return gc(t);
|
|
5688
5688
|
}
|
|
5689
5689
|
const wc = "1.0.7";
|
|
5690
|
-
class
|
|
5690
|
+
class D extends Error {
|
|
5691
5691
|
constructor(e, n = {}) {
|
|
5692
5692
|
var i;
|
|
5693
|
-
const r = n.cause instanceof
|
|
5693
|
+
const r = n.cause instanceof D ? n.cause.details : (i = n.cause) != null && i.message ? n.cause.message : n.details, s = n.cause instanceof D && n.cause.docsPath || n.docsPath, a = [
|
|
5694
5694
|
e || "An error occurred.",
|
|
5695
5695
|
"",
|
|
5696
5696
|
...n.metaMessages ? [...n.metaMessages, ""] : [],
|
|
@@ -5732,17 +5732,17 @@ function Ae(t, e) {
|
|
|
5732
5732
|
return n == null ? void 0 : n.groups;
|
|
5733
5733
|
}
|
|
5734
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
|
|
5735
|
+
function Dn(t) {
|
|
5736
5736
|
let e = t.type;
|
|
5737
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 += Dn(a), s < n - 1 && (e += ", ");
|
|
5743
5743
|
}
|
|
5744
5744
|
const r = Ae(Mr, t.type);
|
|
5745
|
-
return e += `)${(r == null ? void 0 : r.array) ?? ""}`,
|
|
5745
|
+
return e += `)${(r == null ? void 0 : r.array) ?? ""}`, Dn({
|
|
5746
5746
|
...t,
|
|
5747
5747
|
type: e
|
|
5748
5748
|
});
|
|
@@ -5754,7 +5754,7 @@ 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 += Dn(s), r !== n - 1 && (e += ", ");
|
|
5758
5758
|
}
|
|
5759
5759
|
return e;
|
|
5760
5760
|
}
|
|
@@ -5810,7 +5810,7 @@ const jc = /* @__PURE__ */ new Set(["indexed"]), Vn = /* @__PURE__ */ new Set([
|
|
|
5810
5810
|
"memory",
|
|
5811
5811
|
"storage"
|
|
5812
5812
|
]);
|
|
5813
|
-
class Bc extends
|
|
5813
|
+
class Bc extends D {
|
|
5814
5814
|
constructor({ type: e }) {
|
|
5815
5815
|
super("Unknown type.", {
|
|
5816
5816
|
metaMessages: [
|
|
@@ -5824,7 +5824,7 @@ class Bc extends L {
|
|
|
5824
5824
|
});
|
|
5825
5825
|
}
|
|
5826
5826
|
}
|
|
5827
|
-
class Nc extends
|
|
5827
|
+
class Nc extends D {
|
|
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 Nc extends L {
|
|
|
5836
5836
|
});
|
|
5837
5837
|
}
|
|
5838
5838
|
}
|
|
5839
|
-
class Fc extends
|
|
5839
|
+
class Fc extends D {
|
|
5840
5840
|
constructor({ param: e }) {
|
|
5841
5841
|
super("Invalid ABI parameter.", {
|
|
5842
5842
|
details: e
|
|
@@ -5848,7 +5848,7 @@ class Fc extends L {
|
|
|
5848
5848
|
});
|
|
5849
5849
|
}
|
|
5850
5850
|
}
|
|
5851
|
-
class zc extends
|
|
5851
|
+
class zc extends D {
|
|
5852
5852
|
constructor({ param: e, name: n }) {
|
|
5853
5853
|
super("Invalid ABI parameter.", {
|
|
5854
5854
|
details: e,
|
|
@@ -5863,7 +5863,7 @@ class zc extends L {
|
|
|
5863
5863
|
});
|
|
5864
5864
|
}
|
|
5865
5865
|
}
|
|
5866
|
-
class Zc extends
|
|
5866
|
+
class Zc extends D {
|
|
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 L {
|
|
|
5878
5878
|
});
|
|
5879
5879
|
}
|
|
5880
5880
|
}
|
|
5881
|
-
class
|
|
5881
|
+
class Lc extends D {
|
|
5882
5882
|
constructor({ param: e, type: n, modifier: r }) {
|
|
5883
5883
|
super("Invalid ABI parameter.", {
|
|
5884
5884
|
details: e,
|
|
@@ -5894,7 +5894,7 @@ class Dc extends L {
|
|
|
5894
5894
|
});
|
|
5895
5895
|
}
|
|
5896
5896
|
}
|
|
5897
|
-
class
|
|
5897
|
+
class Dc extends D {
|
|
5898
5898
|
constructor({ abiParameter: e }) {
|
|
5899
5899
|
super("Invalid ABI parameter.", {
|
|
5900
5900
|
details: JSON.stringify(e, null, 2),
|
|
@@ -5907,7 +5907,7 @@ class Lc extends L {
|
|
|
5907
5907
|
});
|
|
5908
5908
|
}
|
|
5909
5909
|
}
|
|
5910
|
-
class rt extends
|
|
5910
|
+
class rt extends D {
|
|
5911
5911
|
constructor({ signature: e, type: n }) {
|
|
5912
5912
|
super(`Invalid ${n} signature.`, {
|
|
5913
5913
|
details: e
|
|
@@ -5919,7 +5919,7 @@ class rt extends L {
|
|
|
5919
5919
|
});
|
|
5920
5920
|
}
|
|
5921
5921
|
}
|
|
5922
|
-
class Vc extends
|
|
5922
|
+
class Vc extends D {
|
|
5923
5923
|
constructor({ signature: e }) {
|
|
5924
5924
|
super("Unknown signature.", {
|
|
5925
5925
|
details: e
|
|
@@ -5931,7 +5931,7 @@ class Vc extends L {
|
|
|
5931
5931
|
});
|
|
5932
5932
|
}
|
|
5933
5933
|
}
|
|
5934
|
-
class Uc extends
|
|
5934
|
+
class Uc extends D {
|
|
5935
5935
|
constructor({ signature: e }) {
|
|
5936
5936
|
super("Invalid struct signature.", {
|
|
5937
5937
|
details: e,
|
|
@@ -5944,7 +5944,7 @@ class Uc extends L {
|
|
|
5944
5944
|
});
|
|
5945
5945
|
}
|
|
5946
5946
|
}
|
|
5947
|
-
class Gc extends
|
|
5947
|
+
class Gc extends D {
|
|
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 Gc extends L {
|
|
|
5956
5956
|
});
|
|
5957
5957
|
}
|
|
5958
5958
|
}
|
|
5959
|
-
class
|
|
5959
|
+
class Wc extends D {
|
|
5960
5960
|
constructor({ current: e, depth: n }) {
|
|
5961
5961
|
super("Unbalanced parentheses.", {
|
|
5962
5962
|
metaMessages: [
|
|
@@ -5971,7 +5971,7 @@ class qc extends L {
|
|
|
5971
5971
|
});
|
|
5972
5972
|
}
|
|
5973
5973
|
}
|
|
5974
|
-
function
|
|
5974
|
+
function Hc(t, e, n) {
|
|
5975
5975
|
let r = "";
|
|
5976
5976
|
if (n)
|
|
5977
5977
|
for (const s of Object.entries(n)) {
|
|
@@ -6038,7 +6038,7 @@ const wn = /* @__PURE__ */ new Map([
|
|
|
6038
6038
|
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
6039
6039
|
]
|
|
6040
6040
|
]);
|
|
6041
|
-
function
|
|
6041
|
+
function qc(t, e = {}) {
|
|
6042
6042
|
if (Cc(t)) {
|
|
6043
6043
|
const n = Tc(t);
|
|
6044
6044
|
if (!n)
|
|
@@ -6114,8 +6114,8 @@ function Hc(t, e = {}) {
|
|
|
6114
6114
|
}
|
|
6115
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
6116
|
function $e(t, e) {
|
|
6117
|
-
var
|
|
6118
|
-
const n =
|
|
6117
|
+
var f, h;
|
|
6118
|
+
const n = Hc(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
6121
|
const r = Is.test(t), s = Ae(r ? Jc : Kc, t);
|
|
@@ -6138,14 +6138,14 @@ function $e(t, e) {
|
|
|
6138
6138
|
else if (u = s.type, (e == null ? void 0 : e.type) !== "struct" && !Ns(u))
|
|
6139
6139
|
throw new Nc({ type: u });
|
|
6140
6140
|
if (s.modifier) {
|
|
6141
|
-
if (!((
|
|
6141
|
+
if (!((h = (f = e == null ? void 0 : e.modifiers) == null ? void 0 : f.has) != null && h.call(f, s.modifier)))
|
|
6142
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
6147
|
if (Vn.has(s.modifier) && !eu(u, !!s.array))
|
|
6148
|
-
throw new
|
|
6148
|
+
throw new Lc({
|
|
6149
6149
|
param: t,
|
|
6150
6150
|
type: e == null ? void 0 : e.type,
|
|
6151
6151
|
modifier: s.modifier
|
|
@@ -6177,7 +6177,7 @@ 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 Wc({ current: n, depth: r });
|
|
6181
6181
|
return e.push(n.trim()), e;
|
|
6182
6182
|
}
|
|
6183
6183
|
function Ns(t) {
|
|
@@ -6199,9 +6199,9 @@ function tu(t) {
|
|
|
6199
6199
|
const u = $c(o);
|
|
6200
6200
|
if (!u)
|
|
6201
6201
|
throw new rt({ signature: o, type: "struct" });
|
|
6202
|
-
const c = u.properties.split(";"), d = [],
|
|
6203
|
-
for (let
|
|
6204
|
-
const v = c[
|
|
6202
|
+
const c = u.properties.split(";"), d = [], f = c.length;
|
|
6203
|
+
for (let h = 0; h < f; h++) {
|
|
6204
|
+
const v = c[h].trim();
|
|
6205
6205
|
if (!v)
|
|
6206
6206
|
continue;
|
|
6207
6207
|
const $ = $e(v, {
|
|
@@ -6230,7 +6230,7 @@ function Fs(t, e, n = /* @__PURE__ */ new Set()) {
|
|
|
6230
6230
|
else {
|
|
6231
6231
|
const u = Ae(nu, i.type);
|
|
6232
6232
|
if (!(u != null && u.type))
|
|
6233
|
-
throw new
|
|
6233
|
+
throw new Dc({ abiParameter: i });
|
|
6234
6234
|
const { array: c, type: d } = u;
|
|
6235
6235
|
if (d in e) {
|
|
6236
6236
|
if (n.has(d))
|
|
@@ -6252,7 +6252,7 @@ function zs(t) {
|
|
|
6252
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(qc(a, e));
|
|
6256
6256
|
}
|
|
6257
6257
|
return n;
|
|
6258
6258
|
}
|
|
@@ -6307,11 +6307,11 @@ function dr(t) {
|
|
|
6307
6307
|
if (!o.inputs || o.inputs.length === 0 || o.inputs.length !== n.length)
|
|
6308
6308
|
continue;
|
|
6309
6309
|
if (n.every((c, d) => {
|
|
6310
|
-
const
|
|
6311
|
-
return
|
|
6310
|
+
const f = "inputs" in o && o.inputs[d];
|
|
6311
|
+
return f ? Un(c, f) : !1;
|
|
6312
6312
|
})) {
|
|
6313
6313
|
if (i && "inputs" in i && i.inputs) {
|
|
6314
|
-
const c =
|
|
6314
|
+
const c = Ls(o.inputs, i.inputs, n);
|
|
6315
6315
|
if (c)
|
|
6316
6316
|
throw new Gi({
|
|
6317
6317
|
abiItem: o,
|
|
@@ -6345,11 +6345,11 @@ function Un(t, e) {
|
|
|
6345
6345
|
})) : !1;
|
|
6346
6346
|
}
|
|
6347
6347
|
}
|
|
6348
|
-
function
|
|
6348
|
+
function Ls(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 Ls(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;
|
|
@@ -6393,7 +6393,7 @@ function iu(t) {
|
|
|
6393
6393
|
throw new Kt(void 0, { docsPath: Or });
|
|
6394
6394
|
return {
|
|
6395
6395
|
abi: [s],
|
|
6396
|
-
functionName: ur(
|
|
6396
|
+
functionName: ur(He(s))
|
|
6397
6397
|
};
|
|
6398
6398
|
}
|
|
6399
6399
|
function dn(t) {
|
|
@@ -6455,7 +6455,7 @@ 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 || [], uu, du].find((i) => i.type === "error" && r === ur(
|
|
6458
|
+
const a = [...e || [], uu, du].find((i) => i.type === "error" && r === ur(He(i)));
|
|
6459
6459
|
if (!a)
|
|
6460
6460
|
throw new rs(r, {
|
|
6461
6461
|
docsPath: "/docs/contract/decodeErrorResult"
|
|
@@ -6466,18 +6466,18 @@ function lu(t) {
|
|
|
6466
6466
|
errorName: a.name
|
|
6467
6467
|
};
|
|
6468
6468
|
}
|
|
6469
|
-
function
|
|
6469
|
+
function Ds({ 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
6473
|
class fu extends y {
|
|
6474
|
-
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to:
|
|
6474
|
+
constructor(e, { account: n, docsPath: r, chain: s, data: a, gas: i, gasPrice: o, maxFeePerGas: u, maxPriorityFeePerGas: c, nonce: d, to: f, value: h, stateOverride: m }) {
|
|
6475
6475
|
var P;
|
|
6476
6476
|
const v = n ? ue(n) : void 0;
|
|
6477
6477
|
let $ = Ft({
|
|
6478
6478
|
from: v == null ? void 0 : v.address,
|
|
6479
|
-
to:
|
|
6480
|
-
value: typeof
|
|
6479
|
+
to: f,
|
|
6480
|
+
value: typeof h < "u" && `${rr(h)} ${((P = s == null ? void 0 : s.nativeCurrency) == null ? void 0 : P.symbol) || "ETH"}`,
|
|
6481
6481
|
data: a,
|
|
6482
6482
|
gas: i,
|
|
6483
6483
|
gasPrice: typeof o < "u" && `${U(o)} gwei`,
|
|
@@ -6486,7 +6486,7 @@ class fu extends y {
|
|
|
6486
6486
|
nonce: d
|
|
6487
6487
|
});
|
|
6488
6488
|
m && ($ += `
|
|
6489
|
-
${
|
|
6489
|
+
${Ho(m)}`), super(e.shortMessage, {
|
|
6490
6490
|
cause: e,
|
|
6491
6491
|
docsPath: r,
|
|
6492
6492
|
metaMessages: [
|
|
@@ -6505,12 +6505,12 @@ ${Wo(m)}`), super(e.shortMessage, {
|
|
|
6505
6505
|
}
|
|
6506
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 ? Ds({
|
|
6509
6509
|
abiItem: u,
|
|
6510
6510
|
args: r,
|
|
6511
6511
|
includeFunctionName: !1,
|
|
6512
6512
|
includeName: !1
|
|
6513
|
-
}) : void 0, d = u ?
|
|
6513
|
+
}) : void 0, d = u ? He(u, { includeName: !0 }) : void 0, f = Ft({
|
|
6514
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}`,
|
|
@@ -6521,8 +6521,8 @@ class hu extends y {
|
|
|
6521
6521
|
docsPath: a,
|
|
6522
6522
|
metaMessages: [
|
|
6523
6523
|
...e.metaMessages ? [...e.metaMessages, " "] : [],
|
|
6524
|
-
|
|
6525
|
-
|
|
6524
|
+
f && "Contract Call:",
|
|
6525
|
+
f
|
|
6526
6526
|
].filter(Boolean),
|
|
6527
6527
|
name: "ContractFunctionExecutionError"
|
|
6528
6528
|
}), Object.defineProperty(this, "abi", {
|
|
@@ -6569,22 +6569,22 @@ class pu extends y {
|
|
|
6569
6569
|
if (n && n !== "0x")
|
|
6570
6570
|
try {
|
|
6571
6571
|
i = lu({ abi: e, data: n });
|
|
6572
|
-
const { abiItem: d, errorName:
|
|
6573
|
-
if (
|
|
6574
|
-
u =
|
|
6575
|
-
else if (
|
|
6576
|
-
const [m] =
|
|
6572
|
+
const { abiItem: d, errorName: f, args: h } = i;
|
|
6573
|
+
if (f === "Error")
|
|
6574
|
+
u = h[0];
|
|
6575
|
+
else if (f === "Panic") {
|
|
6576
|
+
const [m] = h;
|
|
6577
6577
|
u = cu[m];
|
|
6578
6578
|
} else {
|
|
6579
|
-
const m = d ?
|
|
6579
|
+
const m = d ? He(d, { includeName: !0 }) : void 0, v = d && h ? Ds({
|
|
6580
6580
|
abiItem: d,
|
|
6581
|
-
args:
|
|
6581
|
+
args: h,
|
|
6582
6582
|
includeFunctionName: !1,
|
|
6583
6583
|
includeName: !1
|
|
6584
6584
|
}) : void 0;
|
|
6585
6585
|
o = [
|
|
6586
6586
|
m ? `Error: ${m}` : "",
|
|
6587
|
-
v && v !== "()" ? ` ${[...Array((
|
|
6587
|
+
v && v !== "()" ? ` ${[...Array((f == null ? void 0 : f.length) ?? 0).keys()].map(() => " ").join("")}${v}` : ""
|
|
6588
6588
|
];
|
|
6589
6589
|
}
|
|
6590
6590
|
} catch (d) {
|
|
@@ -6664,11 +6664,11 @@ class Vs extends y {
|
|
|
6664
6664
|
}
|
|
6665
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:
|
|
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: f, shortMessage: h } = o, m = t instanceof Xn ? new mu({ functionName: a }) : [bu, Me.code].includes(u) && (c || d || f || h) ? new pu({
|
|
6668
6668
|
abi: e,
|
|
6669
6669
|
data: typeof c == "object" ? c.data : c,
|
|
6670
6670
|
functionName: a,
|
|
6671
|
-
message: o instanceof bs ? d :
|
|
6671
|
+
message: o instanceof bs ? d : h ?? f
|
|
6672
6672
|
}) : t;
|
|
6673
6673
|
return new hu(m, {
|
|
6674
6674
|
abi: e,
|
|
@@ -6703,54 +6703,54 @@ 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();
|
|
6706
|
-
const
|
|
6707
|
-
|
|
6708
|
-
s && Array.isArray(
|
|
6706
|
+
const f = d.map(({ args: h }) => h);
|
|
6707
|
+
f.length !== 0 && t(f).then((h) => {
|
|
6708
|
+
s && Array.isArray(h) && h.sort(s);
|
|
6709
6709
|
for (let m = 0; m < d.length; m++) {
|
|
6710
6710
|
const { resolve: v } = d[m];
|
|
6711
|
-
v == null || v([
|
|
6711
|
+
v == null || v([h[m], h]);
|
|
6712
6712
|
}
|
|
6713
|
-
}).catch((
|
|
6713
|
+
}).catch((h) => {
|
|
6714
6714
|
for (let m = 0; m < d.length; m++) {
|
|
6715
6715
|
const { reject: v } = d[m];
|
|
6716
|
-
v == null || v(
|
|
6716
|
+
v == null || v(h);
|
|
6717
6717
|
}
|
|
6718
6718
|
});
|
|
6719
6719
|
}, i = () => _n.delete(e), o = () => u().map(({ args: d }) => d), u = () => _n.get(e) || [], c = (d) => _n.set(e, [...u(), d]);
|
|
6720
6720
|
return {
|
|
6721
6721
|
flush: i,
|
|
6722
6722
|
async schedule(d) {
|
|
6723
|
-
const { promise:
|
|
6724
|
-
return (n == null ? void 0 : n([...o(), d])) && a(), u().length > 0 ? (c({ args: d, resolve:
|
|
6723
|
+
const { promise: f, resolve: h, reject: m } = _u();
|
|
6724
|
+
return (n == null ? void 0 : n([...o(), d])) && a(), u().length > 0 ? (c({ args: d, resolve: h, reject: m }), f) : (c({ args: d, resolve: h, reject: m }), setTimeout(a, r), f);
|
|
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:
|
|
6731
|
-
if (u && (d ||
|
|
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: f, gas: h, gasPrice: m, maxFeePerBlobGas: v, maxFeePerGas: $, maxPriorityFeePerGas: P, nonce: S, to: R, value: A, stateOverride: O, ...q } = e, F = n ? ue(n) : void 0;
|
|
6731
|
+
if (u && (d || f))
|
|
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 &&
|
|
6735
|
+
const Y = u && c, re = d && f && R && c, C = Y || re, B = Y ? Cu({
|
|
6736
6736
|
code: u,
|
|
6737
6737
|
data: c
|
|
6738
6738
|
}) : re ? Tu({
|
|
6739
6739
|
data: c,
|
|
6740
6740
|
factory: d,
|
|
6741
|
-
factoryData:
|
|
6741
|
+
factoryData: f,
|
|
6742
6742
|
to: R
|
|
6743
6743
|
}) : c;
|
|
6744
6744
|
try {
|
|
6745
6745
|
un(e);
|
|
6746
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(q, { format: J }),
|
|
6749
6749
|
from: F == null ? void 0 : F.address,
|
|
6750
6750
|
accessList: i,
|
|
6751
6751
|
blobs: o,
|
|
6752
6752
|
data: B,
|
|
6753
|
-
gas:
|
|
6753
|
+
gas: h,
|
|
6754
6754
|
gasPrice: m,
|
|
6755
6755
|
maxFeePerBlobGas: v,
|
|
6756
6756
|
maxFeePerGas: $,
|
|
@@ -6780,7 +6780,7 @@ async function Us(t, e) {
|
|
|
6780
6780
|
});
|
|
6781
6781
|
return br === "0x" ? { data: void 0 } : { data: br };
|
|
6782
6782
|
} catch (se) {
|
|
6783
|
-
const V = $u(se), { offchainLookup: X, offchainLookupSignature: J } = await import("./ccip-
|
|
6783
|
+
const V = $u(se), { offchainLookup: X, offchainLookupSignature: J } = await import("./ccip-B7UF-Rim.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
6786
|
throw C && (V == null ? void 0 : V.slice(0, 10)) === "0x101bb98d" ? new yu({ factory: d }) : xu(se, {
|
|
@@ -6807,8 +6807,8 @@ async function Au(t, e) {
|
|
|
6807
6807
|
contract: "multicall3"
|
|
6808
6808
|
});
|
|
6809
6809
|
}
|
|
6810
|
-
const
|
|
6811
|
-
id: `${t.uid}.${
|
|
6810
|
+
const f = (s ? M(s) : void 0) || a, { schedule: h } = Pu({
|
|
6811
|
+
id: `${t.uid}.${f}`,
|
|
6812
6812
|
wait: r,
|
|
6813
6813
|
shouldSplitBatch(P) {
|
|
6814
6814
|
return P.reduce((R, { data: A }) => R + (A.length - 2), 0) > n * 2;
|
|
@@ -6829,7 +6829,7 @@ async function Au(t, e) {
|
|
|
6829
6829
|
data: R,
|
|
6830
6830
|
to: c
|
|
6831
6831
|
},
|
|
6832
|
-
|
|
6832
|
+
f
|
|
6833
6833
|
]
|
|
6834
6834
|
});
|
|
6835
6835
|
return lr({
|
|
@@ -6839,7 +6839,7 @@ async function Au(t, e) {
|
|
|
6839
6839
|
data: A || "0x"
|
|
6840
6840
|
});
|
|
6841
6841
|
}
|
|
6842
|
-
}), [{ returnData: m, success: v }] = await
|
|
6842
|
+
}), [{ returnData: m, success: v }] = await h({ data: i, to: u });
|
|
6843
6843
|
if (!v)
|
|
6844
6844
|
throw new Vs({ data: m });
|
|
6845
6845
|
return m === "0x" ? { data: void 0 } : { data: m };
|
|
@@ -6964,8 +6964,8 @@ function Mu(t, e = {}) {
|
|
|
6964
6964
|
throw new Ke(d);
|
|
6965
6965
|
case kt.code:
|
|
6966
6966
|
throw new kt(d);
|
|
6967
|
-
case
|
|
6968
|
-
throw new
|
|
6967
|
+
case Le.code:
|
|
6968
|
+
throw new Le(d);
|
|
6969
6969
|
case It.code:
|
|
6970
6970
|
throw new It(d);
|
|
6971
6971
|
case St.code:
|
|
@@ -6977,18 +6977,18 @@ function Mu(t, e = {}) {
|
|
|
6977
6977
|
case Ot.code:
|
|
6978
6978
|
throw new Ot(d);
|
|
6979
6979
|
case 5e3:
|
|
6980
|
-
throw new
|
|
6980
|
+
throw new Le(d);
|
|
6981
6981
|
default:
|
|
6982
6982
|
throw c instanceof y ? c : new Io(d);
|
|
6983
6983
|
}
|
|
6984
6984
|
}
|
|
6985
6985
|
}, {
|
|
6986
6986
|
delay: ({ count: c, error: d }) => {
|
|
6987
|
-
var
|
|
6987
|
+
var f;
|
|
6988
6988
|
if (d && d instanceof ys) {
|
|
6989
|
-
const
|
|
6990
|
-
if (
|
|
6991
|
-
return Number.parseInt(
|
|
6989
|
+
const h = (f = d == null ? void 0 : d.headers) == null ? void 0 : f.get("Retry-After");
|
|
6990
|
+
if (h != null && h.match(/\d/))
|
|
6991
|
+
return Number.parseInt(h) * 1e3;
|
|
6992
6992
|
}
|
|
6993
6993
|
return ~~(1 << c) * a;
|
|
6994
6994
|
},
|
|
@@ -7009,16 +7009,16 @@ async function ju(t, e) {
|
|
|
7009
7009
|
to: r,
|
|
7010
7010
|
...o,
|
|
7011
7011
|
account: u
|
|
7012
|
-
}),
|
|
7012
|
+
}), f = lr({
|
|
7013
7013
|
abi: n,
|
|
7014
7014
|
args: s,
|
|
7015
7015
|
functionName: i,
|
|
7016
7016
|
data: d || "0x"
|
|
7017
|
-
}),
|
|
7017
|
+
}), h = n.filter((m) => "name" in m && m.name === e.functionName);
|
|
7018
7018
|
return {
|
|
7019
|
-
result:
|
|
7019
|
+
result: f,
|
|
7020
7020
|
request: {
|
|
7021
|
-
abi:
|
|
7021
|
+
abi: h,
|
|
7022
7022
|
address: r,
|
|
7023
7023
|
args: s,
|
|
7024
7024
|
dataSuffix: a,
|
|
@@ -7056,8 +7056,8 @@ async function Bu(t, e) {
|
|
|
7056
7056
|
account: c,
|
|
7057
7057
|
...u
|
|
7058
7058
|
});
|
|
7059
|
-
} catch (
|
|
7060
|
-
throw fr(
|
|
7059
|
+
} catch (f) {
|
|
7060
|
+
throw fr(f, {
|
|
7061
7061
|
abi: n,
|
|
7062
7062
|
address: s,
|
|
7063
7063
|
args: a,
|
|
@@ -7068,20 +7068,20 @@ async function Bu(t, e) {
|
|
|
7068
7068
|
}
|
|
7069
7069
|
}
|
|
7070
7070
|
const Gn = 256;
|
|
7071
|
-
let Zt = Gn,
|
|
7071
|
+
let Zt = Gn, Lt;
|
|
7072
7072
|
function Gs(t = 11) {
|
|
7073
|
-
if (!
|
|
7074
|
-
|
|
7073
|
+
if (!Lt || Zt + t > Gn * 2) {
|
|
7074
|
+
Lt = "", Zt = 0;
|
|
7075
7075
|
for (let e = 0; e < Gn; e++)
|
|
7076
|
-
|
|
7076
|
+
Lt += (256 + Math.random() * 256 | 0).toString(16).substring(1);
|
|
7077
7077
|
}
|
|
7078
|
-
return
|
|
7078
|
+
return Lt.substring(Zt, Zt++ + t);
|
|
7079
7079
|
}
|
|
7080
7080
|
function Nu(t) {
|
|
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:
|
|
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: f, value: h } = t.transport({
|
|
7082
7082
|
chain: u,
|
|
7083
7083
|
pollingInterval: i
|
|
7084
|
-
}), m = { ...d, ...
|
|
7084
|
+
}), m = { ...d, ...h }, v = {
|
|
7085
7085
|
account: c,
|
|
7086
7086
|
batch: e,
|
|
7087
7087
|
cacheTime: n,
|
|
@@ -7090,7 +7090,7 @@ function Nu(t) {
|
|
|
7090
7090
|
key: s,
|
|
7091
7091
|
name: a,
|
|
7092
7092
|
pollingInterval: i,
|
|
7093
|
-
request:
|
|
7093
|
+
request: f,
|
|
7094
7094
|
transport: m,
|
|
7095
7095
|
type: o,
|
|
7096
7096
|
uid: Gs()
|
|
@@ -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 Zu = "2.13.8",
|
|
7204
|
-
var
|
|
7203
|
+
const Zu = "2.13.8", Lu = () => `@wagmi/core@${Zu}`;
|
|
7204
|
+
var Ws = 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
|
-
}, en,
|
|
7208
|
+
}, en, Hs;
|
|
7209
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 Lu();
|
|
7215
7215
|
}
|
|
7216
7216
|
constructor(e, n = {}) {
|
|
7217
7217
|
var r;
|
|
@@ -7255,13 +7255,13 @@ class Oe 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 Ws(this, en, "m", Hs).call(this, this, e);
|
|
7259
7259
|
}
|
|
7260
7260
|
}
|
|
7261
|
-
en = /* @__PURE__ */ new WeakSet(),
|
|
7262
|
-
return n != null && n(e) ? e : e.cause ?
|
|
7261
|
+
en = /* @__PURE__ */ new WeakSet(), Hs = function t(e, n) {
|
|
7262
|
+
return n != null && n(e) ? e : e.cause ? Ws(this, en, "m", t).call(this, e.cause, n) : e;
|
|
7263
7263
|
};
|
|
7264
|
-
class
|
|
7264
|
+
class Du extends Oe {
|
|
7265
7265
|
constructor() {
|
|
7266
7266
|
super("Connector not connected."), Object.defineProperty(this, "name", {
|
|
7267
7267
|
enumerable: !0,
|
|
@@ -7312,25 +7312,25 @@ class Gu extends Oe {
|
|
|
7312
7312
|
});
|
|
7313
7313
|
}
|
|
7314
7314
|
}
|
|
7315
|
-
async function
|
|
7315
|
+
async function qs(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
7320
|
throw new Gu({ connector: c });
|
|
7321
|
-
const [d,
|
|
7321
|
+
const [d, f] = await Promise.all([
|
|
7322
7322
|
c.getAccounts(),
|
|
7323
7323
|
c.getChainId()
|
|
7324
7324
|
]);
|
|
7325
7325
|
n = {
|
|
7326
7326
|
accounts: d,
|
|
7327
|
-
chainId:
|
|
7327
|
+
chainId: f,
|
|
7328
7328
|
connector: c
|
|
7329
7329
|
};
|
|
7330
7330
|
} else
|
|
7331
7331
|
n = t.state.connections.get(t.state.current);
|
|
7332
7332
|
if (!n)
|
|
7333
|
-
throw new
|
|
7333
|
+
throw new Du();
|
|
7334
7334
|
const r = e.chainId ?? n.chainId, s = await n.connector.getChainId();
|
|
7335
7335
|
if (s !== n.chainId)
|
|
7336
7336
|
throw new Uu({
|
|
@@ -7354,10 +7354,10 @@ async function Hs(t, e = {}) {
|
|
|
7354
7354
|
transport: (c) => zu(u)({ ...c, retryCount: 0 })
|
|
7355
7355
|
});
|
|
7356
7356
|
}
|
|
7357
|
-
async function
|
|
7357
|
+
async function Wn(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 qs(t, {
|
|
7361
7361
|
chainId: r,
|
|
7362
7362
|
connector: s
|
|
7363
7363
|
})).account;
|
|
@@ -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 Wn(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) => Wn(e, {
|
|
7382
7382
|
...n,
|
|
7383
7383
|
...t.address ? { address: t.address } : {},
|
|
7384
7384
|
...t.functionName ? { functionName: t.functionName } : {},
|
|
@@ -7409,13 +7409,13 @@ 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 qs(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 Wn(t, {
|
|
7419
7419
|
...i,
|
|
7420
7420
|
account: n,
|
|
7421
7421
|
chainId: r
|
|
@@ -7620,13 +7620,13 @@ const be = [
|
|
|
7620
7620
|
outputs: [{ name: "", internalType: "bool", type: "bool" }],
|
|
7621
7621
|
stateMutability: "nonpayable"
|
|
7622
7622
|
}
|
|
7623
|
-
],
|
|
7623
|
+
], Wu = /* @__PURE__ */ Ks({
|
|
7624
7624
|
abi: be,
|
|
7625
7625
|
functionName: "allowance"
|
|
7626
|
-
}),
|
|
7626
|
+
}), Hu = /* @__PURE__ */ Ks({
|
|
7627
7627
|
abi: be,
|
|
7628
7628
|
functionName: "balanceOf"
|
|
7629
|
-
}),
|
|
7629
|
+
}), qu = /* @__PURE__ */ yr({
|
|
7630
7630
|
abi: be,
|
|
7631
7631
|
functionName: "approve"
|
|
7632
7632
|
}), Ku = /* @__PURE__ */ yr({
|
|
@@ -7647,7 +7647,7 @@ const be = [
|
|
|
7647
7647
|
}), ed = "0x6080604052348015600e575f80fd5b50610b398061001c5f395ff3fe6080604052600436106100d9575f3560e01c806340c10f191161007c57806395d89b411161005757806395d89b4114610323578063a9059cbb14610368578063d505accf14610387578063dd62ed3e146103a6575f80fd5b806340c10f19146102a257806370a08231146102c15780637ecebe00146102f2575f80fd5b806318160ddd116100b757806318160ddd1461017857806323b872dd1461019e578063313ce567146101bd5780633644e515146101d8575f80fd5b806306fdde03146100dd578063095ea7b31461013457806317d304b014610163575b5f80fd5b3480156100e8575f80fd5b5060408051808201909152600a81527f4d6f636b2045524332300000000000000000000000000000000000000000000060208201525b60405161012b9190610930565b60405180910390f35b34801561013f575f80fd5b5061015361014e3660046109ab565b6103c5565b604051901515815260200161012b565b6101766101713660046109ab565b610452565b005b348015610183575f80fd5b506805345cdf77eb68f44c545b60405190815260200161012b565b3480156101a9575f80fd5b506101536101b83660046109d3565b6104d8565b3480156101c8575f80fd5b506040516012815260200161012b565b3480156101e3575f80fd5b50604080518082018252600a81527f4d6f636b2045524332300000000000000000000000000000000000000000000060209182015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81527fa5c9260bf133e670eeaf4d41f5c4289fc23bb146bf11ba8fa70a2ea91ba1a330918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69181019190915246606082015230608082015260a09020610190565b3480156102ad575f80fd5b506101766102bc3660046109ab565b6104ca565b3480156102cc575f80fd5b506101906102db366004610a0d565b6387a211a2600c9081525f91909152602090205490565b3480156102fd575f80fd5b5061019061030c366004610a0d565b6338377508600c9081525f91909152602090205490565b34801561032e575f80fd5b5060408051808201909152600481527f4d4f434b00000000000000000000000000000000000000000000000000000000602082015261011e565b348015610373575f80fd5b506101536103823660046109ab565b6105a7565b348015610392575f80fd5b506101766103a1366004610a2d565b61061e565b3480156103b1575f80fd5b506101906103c0366004610a9a565b610834565b5f73ffffffffffffffffffffffffffffffffffffffff83166e22d473030f116ddee9f6b43ac78ba3188219151761040357633f68539a5f526004601cfd5b82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa35060015b92915050565b61045d606482610acb565b3410156104ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e65792100000000604482015260640160405180910390fd5b6104d482826108b4565b5050565b5f8360601b6e22d473030f116ddee9f6b43ac78ba3331461052d5733602052637f5e9f208117600c526034600c20805480191561052a5780851115610524576313be252b5f526004601cfd5b84810382555b50505b6387a211a28117600c526020600c208054808511156105535763f4d678b85f526004601cfd5b84810382555050835f526020600c208381540181555082602052600c5160601c8160601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505060019392505050565b5f6387a211a2600c52335f526020600c208054808411156105cf5763f4d678b85f526004601cfd5b83810382555050825f526020600c208281540181555081602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350600192915050565b73ffffffffffffffffffffffffffffffffffffffff86166e22d473030f116ddee9f6b43ac78ba3188519151761065b57633f68539a5f526004601cfd5b60408051808201909152600a81527f4d6f636b204552433230000000000000000000000000000000000000000000006020909101527fa5c9260bf133e670eeaf4d41f5c4289fc23bb146bf11ba8fa70a2ea91ba1a3307fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6428610156106e757631a15a3cc5f526004601cfd5b6040518960601b60601c99508860601b60601c985065383775081901600e52895f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f835284602084015283604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528b60208401528a60408401528960608401528060808401528860a084015260c08320604e526042602c205f528760ff16602052866040528560605260208060805f60015afa8c3d51146107cf5763ddafbaef5f526004601cfd5b019055777f5e9f20000000000000000000000000000000000000000089176040526034602c20889055888a7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608501a360405250505f60605250505050505050565b5f7fffffffffffffffffffffffffffffffffffdd2b8cfcf0ee922116094bc538745d73ffffffffffffffffffffffffffffffffffffffff83160161089957507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61044c565b50602052637f5e9f20600c9081525f91909152603490205490565b6805345cdf77eb68f44c54818101818110156108d75763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c5550506387a211a2600c52815f526020600c208181540181555080602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050565b602081525f82518060208401528060208501604085015e5f6040828501015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011684010191505092915050565b803573ffffffffffffffffffffffffffffffffffffffff811681146109a6575f80fd5b919050565b5f80604083850312156109bc575f80fd5b6109c583610983565b946020939093013593505050565b5f805f606084860312156109e5575f80fd5b6109ee84610983565b92506109fc60208501610983565b929592945050506040919091013590565b5f60208284031215610a1d575f80fd5b610a2682610983565b9392505050565b5f805f805f805f60e0888a031215610a43575f80fd5b610a4c88610983565b9650610a5a60208901610983565b95506040880135945060608801359350608088013560ff81168114610a7d575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215610aab575f80fd5b610ab483610983565b9150610ac260208401610983565b90509250929050565b5f82610afe577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50049056fea2646970667358221220f5df3612b8f8d82660db05f290d8446fb4142408d492fd3d2eb82b366b3cf76964736f6c634300081a0033";
|
|
7648
7648
|
class Js extends ra {
|
|
7649
7649
|
async balanceOf(e, n) {
|
|
7650
|
-
return await
|
|
7650
|
+
return await Hu(this._config, {
|
|
7651
7651
|
address: this.assertValidAddress(),
|
|
7652
7652
|
args: [e],
|
|
7653
7653
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -7655,7 +7655,7 @@ class Js extends ra {
|
|
|
7655
7655
|
});
|
|
7656
7656
|
}
|
|
7657
7657
|
async allowance(e, n, r) {
|
|
7658
|
-
return await
|
|
7658
|
+
return await Wu(this._config, {
|
|
7659
7659
|
address: this.assertValidAddress(),
|
|
7660
7660
|
args: [e, n],
|
|
7661
7661
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
@@ -7673,7 +7673,7 @@ class Js extends ra {
|
|
|
7673
7673
|
// biome-ignore lint/suspicious/noExplicitAny: Accept any shape of valid wagmi/viem parameters, wagmi does the same thing internally
|
|
7674
7674
|
...r
|
|
7675
7675
|
});
|
|
7676
|
-
return { hash: await
|
|
7676
|
+
return { hash: await qu(this._config, s), result: a };
|
|
7677
7677
|
}
|
|
7678
7678
|
async mint(e, n, r) {
|
|
7679
7679
|
return await this.awaitResult(this.mintRaw(e, n, r));
|
|
@@ -7760,7 +7760,7 @@ const td = [
|
|
|
7760
7760
|
].map((t) => ({
|
|
7761
7761
|
...t,
|
|
7762
7762
|
privateKey: pa(t.key)
|
|
7763
|
-
})), nd = "test test test test test test test test test test test junk",
|
|
7763
|
+
})), nd = "test test test test test test test test test test test junk", kd = async function(e, n) {
|
|
7764
7764
|
const r = n.privateKey, s = n.mnemonic ?? nd, a = n.chain || "anvil", [{ config: i, account: o }, u] = va({
|
|
7765
7765
|
chain: a,
|
|
7766
7766
|
rpcUrl: n.rpcUrl,
|
|
@@ -7768,7 +7768,7 @@ const td = [
|
|
|
7768
7768
|
mnemonic: s
|
|
7769
7769
|
}), c = u.id;
|
|
7770
7770
|
if (e.at(0) === "generate")
|
|
7771
|
-
return
|
|
7771
|
+
return Ed({ account: o == null ? void 0 : o.address, chainId: c });
|
|
7772
7772
|
if (e.at(0) === "erc20") {
|
|
7773
7773
|
let A = new Js({ config: i, account: o }, {});
|
|
7774
7774
|
return await A.deploy(), {
|
|
@@ -7780,19 +7780,19 @@ const td = [
|
|
|
7780
7780
|
throw new Error(
|
|
7781
7781
|
`Unable to select a deployed BoostRegistry with chain ID ${c}`
|
|
7782
7782
|
);
|
|
7783
|
-
const
|
|
7783
|
+
const f = new ia({
|
|
7784
7784
|
config: i,
|
|
7785
7785
|
account: o,
|
|
7786
7786
|
address: d
|
|
7787
|
-
}),
|
|
7788
|
-
if (!
|
|
7787
|
+
}), h = oa[c];
|
|
7788
|
+
if (!h)
|
|
7789
7789
|
throw new Error(
|
|
7790
7790
|
`Unable to select a deployed BoostCore with chain ID ${c}`
|
|
7791
7791
|
);
|
|
7792
7792
|
const m = new ca({
|
|
7793
7793
|
config: i,
|
|
7794
7794
|
account: o,
|
|
7795
|
-
address:
|
|
7795
|
+
address: h
|
|
7796
7796
|
});
|
|
7797
7797
|
if (!e.length) throw new Error("No seed provided");
|
|
7798
7798
|
const v = await Promise.all(e.map(rd));
|
|
@@ -7811,10 +7811,10 @@ const td = [
|
|
|
7811
7811
|
case "ManagedBudget": {
|
|
7812
7812
|
const B = {
|
|
7813
7813
|
...C,
|
|
7814
|
-
authorized: [...A.budget.authorized,
|
|
7814
|
+
authorized: [...A.budget.authorized, h],
|
|
7815
7815
|
roles: [...A.budget.roles, En.MANAGER]
|
|
7816
7816
|
};
|
|
7817
|
-
O = await
|
|
7817
|
+
O = await f.initialize(
|
|
7818
7818
|
crypto.randomUUID(),
|
|
7819
7819
|
m.ManagedBudget(B)
|
|
7820
7820
|
);
|
|
@@ -7823,10 +7823,10 @@ const td = [
|
|
|
7823
7823
|
const B = {
|
|
7824
7824
|
managementFee: 0n,
|
|
7825
7825
|
...C,
|
|
7826
|
-
authorized: [...A.budget.authorized,
|
|
7826
|
+
authorized: [...A.budget.authorized, h],
|
|
7827
7827
|
roles: [...A.budget.roles, En.MANAGER]
|
|
7828
7828
|
};
|
|
7829
|
-
O = await
|
|
7829
|
+
O = await f.initialize(
|
|
7830
7830
|
crypto.randomUUID(),
|
|
7831
7831
|
m.ManagedBudgetWithFeesV2(B)
|
|
7832
7832
|
);
|
|
@@ -7834,7 +7834,7 @@ const td = [
|
|
|
7834
7834
|
}
|
|
7835
7835
|
$ = O, P = A.budget, R = O.assertValidAddress();
|
|
7836
7836
|
}
|
|
7837
|
-
const
|
|
7837
|
+
const q = A.incentives.map(async (C) => {
|
|
7838
7838
|
let B = 0n;
|
|
7839
7839
|
switch (C.type) {
|
|
7840
7840
|
case "AllowListIncentive":
|
|
@@ -7867,7 +7867,7 @@ const td = [
|
|
|
7867
7867
|
account: o
|
|
7868
7868
|
}), m.CGDAIncentive(C);
|
|
7869
7869
|
}
|
|
7870
|
-
}), F = await Promise.all(
|
|
7870
|
+
}), F = await Promise.all(q), Y = {
|
|
7871
7871
|
protocolFee: A.protocolFee,
|
|
7872
7872
|
maxParticipants: A.maxParticipants,
|
|
7873
7873
|
budget: O,
|
|
@@ -7887,7 +7887,7 @@ const td = [
|
|
|
7887
7887
|
async function et(t, e, n, r) {
|
|
7888
7888
|
if (n && e) {
|
|
7889
7889
|
let s = new Js(r, n);
|
|
7890
|
-
await
|
|
7890
|
+
await Pd(r, s, t, zr(e.toString()));
|
|
7891
7891
|
}
|
|
7892
7892
|
}
|
|
7893
7893
|
async function rd(t) {
|
|
@@ -7896,28 +7896,28 @@ async function rd(t) {
|
|
|
7896
7896
|
});
|
|
7897
7897
|
return Qs.parse(JSON.parse(e));
|
|
7898
7898
|
}
|
|
7899
|
-
const sd =
|
|
7900
|
-
code:
|
|
7899
|
+
const sd = l.custom(ma, "invalid Hex payload"), k = l.string().transform((t, e) => (/^0x[a-fA-F0-9]{40}$/.test(t) || e.addIssue({
|
|
7900
|
+
code: l.ZodIssueCode.custom,
|
|
7901
7901
|
message: `Invalid Address ${t}`
|
|
7902
|
-
}), t)).pipe(
|
|
7903
|
-
type:
|
|
7904
|
-
owner:
|
|
7905
|
-
authorized:
|
|
7906
|
-
managementFee:
|
|
7907
|
-
roles:
|
|
7902
|
+
}), t)).pipe(l.custom(tn, "invalid eth address")), Ys = l.coerce.number().min(1).max(2).transform(BigInt).pipe(l.custom()), ad = l.object({
|
|
7903
|
+
type: l.literal("ManagedBudgetWithFeesV2"),
|
|
7904
|
+
owner: k,
|
|
7905
|
+
authorized: l.array(k),
|
|
7906
|
+
managementFee: l.coerce.bigint().nonnegative().lt(10000n),
|
|
7907
|
+
roles: l.array(Ys)
|
|
7908
7908
|
}).refine(
|
|
7909
7909
|
(t) => t.authorized.length === t.roles.length,
|
|
7910
7910
|
"length mismatch authorized and roles"
|
|
7911
|
-
), id =
|
|
7912
|
-
type:
|
|
7913
|
-
owner:
|
|
7914
|
-
authorized:
|
|
7915
|
-
roles:
|
|
7911
|
+
), id = l.object({
|
|
7912
|
+
type: l.literal("ManagedBudget"),
|
|
7913
|
+
owner: k,
|
|
7914
|
+
authorized: l.array(k),
|
|
7915
|
+
roles: l.array(Ys)
|
|
7916
7916
|
}).refine(
|
|
7917
7917
|
(t) => t.authorized.length === t.roles.length,
|
|
7918
7918
|
"length mismatch authorized and roles"
|
|
7919
|
-
), fn =
|
|
7920
|
-
|
|
7919
|
+
), fn = l.custom().pipe(
|
|
7920
|
+
l.string().regex(/^(event|function) .*/, {
|
|
7921
7921
|
message: "signature must start with `event` or function`"
|
|
7922
7922
|
}).transform((t) => {
|
|
7923
7923
|
if (t.startsWith("function"))
|
|
@@ -7925,123 +7925,134 @@ const sd = p.custom(ma, "invalid Hex payload"), I = p.string().transform((t, e)
|
|
|
7925
7925
|
if (t.startsWith("event")) return ga(t);
|
|
7926
7926
|
throw new Error("unreachable");
|
|
7927
7927
|
})
|
|
7928
|
-
), od =
|
|
7929
|
-
signatureType:
|
|
7928
|
+
), od = l.object({
|
|
7929
|
+
signatureType: l.nativeEnum(st),
|
|
7930
7930
|
signature: fn,
|
|
7931
|
-
fieldIndex:
|
|
7932
|
-
targetContract:
|
|
7933
|
-
chainid:
|
|
7934
|
-
}), cd =
|
|
7935
|
-
filterType:
|
|
7936
|
-
fieldType:
|
|
7937
|
-
fieldIndex:
|
|
7931
|
+
fieldIndex: l.number().nonnegative(),
|
|
7932
|
+
targetContract: k,
|
|
7933
|
+
chainid: l.number().nonnegative()
|
|
7934
|
+
}), cd = l.object({
|
|
7935
|
+
filterType: l.nativeEnum(Nr),
|
|
7936
|
+
fieldType: l.nativeEnum(Fr),
|
|
7937
|
+
fieldIndex: l.number().nonnegative(),
|
|
7938
7938
|
filterData: sd
|
|
7939
|
-
}), ud =
|
|
7939
|
+
}), ud = l.object({
|
|
7940
7940
|
signature: fn,
|
|
7941
|
-
signatureType:
|
|
7942
|
-
actionType:
|
|
7943
|
-
targetContract:
|
|
7944
|
-
chainid:
|
|
7941
|
+
signatureType: l.nativeEnum(st),
|
|
7942
|
+
actionType: l.number().optional(),
|
|
7943
|
+
targetContract: k,
|
|
7944
|
+
chainid: l.number().nonnegative(),
|
|
7945
7945
|
actionParameter: cd
|
|
7946
|
-
}), dd =
|
|
7947
|
-
type:
|
|
7946
|
+
}), dd = l.object({
|
|
7947
|
+
type: l.literal("EventAction"),
|
|
7948
7948
|
actionClaimant: od,
|
|
7949
|
-
actionSteps:
|
|
7950
|
-
}), ld =
|
|
7951
|
-
type:
|
|
7952
|
-
signers:
|
|
7953
|
-
validatorCaller:
|
|
7954
|
-
maxClaimCount:
|
|
7955
|
-
}), fd =
|
|
7956
|
-
type:
|
|
7957
|
-
signers:
|
|
7958
|
-
validatorCaller:
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7949
|
+
actionSteps: l.array(ud).max(4)
|
|
7950
|
+
}), ld = l.object({
|
|
7951
|
+
type: l.literal("LimitedSignerValidator"),
|
|
7952
|
+
signers: l.array(k),
|
|
7953
|
+
validatorCaller: k,
|
|
7954
|
+
maxClaimCount: l.coerce.number()
|
|
7955
|
+
}), fd = l.object({
|
|
7956
|
+
type: l.literal("PayableLimitedSignerValidator"),
|
|
7957
|
+
signers: l.array(k),
|
|
7958
|
+
validatorCaller: k,
|
|
7959
|
+
maxClaimCount: l.coerce.number(),
|
|
7960
|
+
baseImplementation: k
|
|
7961
|
+
}), hd = l.object({
|
|
7962
|
+
type: l.literal("SignerValidator"),
|
|
7963
|
+
signers: l.array(k),
|
|
7964
|
+
validatorCaller: k
|
|
7965
|
+
}), pd = l.object({
|
|
7966
|
+
type: l.literal("SimpleDenyList"),
|
|
7967
|
+
owner: k,
|
|
7968
|
+
denied: l.array(k)
|
|
7969
|
+
}), md = l.object({
|
|
7970
|
+
type: l.literal("SimpleAllowList"),
|
|
7971
|
+
owner: k,
|
|
7972
|
+
allowed: l.array(k)
|
|
7973
|
+
}), yd = l.object({
|
|
7974
|
+
type: l.literal("AllowListIncentive"),
|
|
7975
|
+
allowList: k,
|
|
7976
|
+
limit: l.coerce.bigint()
|
|
7977
|
+
}), bd = l.object({
|
|
7978
|
+
type: l.literal("ERC20Incentive"),
|
|
7979
|
+
asset: k,
|
|
7980
|
+
shouldMintAndAllocate: l.boolean().optional().default(!1),
|
|
7981
|
+
strategy: l.nativeEnum(Pn),
|
|
7982
|
+
reward: l.coerce.bigint(),
|
|
7983
|
+
limit: l.coerce.bigint(),
|
|
7984
|
+
manager: k.optional()
|
|
7985
|
+
}), gd = l.object({
|
|
7986
|
+
type: l.literal("ERC20VariableIncentive"),
|
|
7987
|
+
asset: k,
|
|
7988
|
+
shouldMintAndAllocate: l.boolean().optional().default(!1),
|
|
7989
|
+
reward: l.coerce.bigint(),
|
|
7990
|
+
limit: l.coerce.bigint(),
|
|
7991
|
+
manager: k
|
|
7992
|
+
}), Xs = l.object({
|
|
7993
|
+
criteriaType: l.nativeEnum(st),
|
|
7988
7994
|
signature: fn,
|
|
7989
|
-
fieldIndex:
|
|
7990
|
-
targetContract:
|
|
7991
|
-
valueType:
|
|
7992
|
-
}),
|
|
7993
|
-
type:
|
|
7994
|
-
asset:
|
|
7995
|
-
shouldMintAndAllocate:
|
|
7996
|
-
reward:
|
|
7997
|
-
limit:
|
|
7998
|
-
manager:
|
|
7995
|
+
fieldIndex: l.number().nonnegative(),
|
|
7996
|
+
targetContract: k,
|
|
7997
|
+
valueType: l.nativeEnum(sa)
|
|
7998
|
+
}), vd = l.object({
|
|
7999
|
+
type: l.literal("ERC20VariableCriteriaIncentiveV2"),
|
|
8000
|
+
asset: k,
|
|
8001
|
+
shouldMintAndAllocate: l.boolean().optional().default(!1),
|
|
8002
|
+
reward: l.coerce.bigint(),
|
|
8003
|
+
limit: l.coerce.bigint(),
|
|
8004
|
+
manager: k.optional(),
|
|
7999
8005
|
criteria: Xs
|
|
8000
|
-
}),
|
|
8001
|
-
type:
|
|
8002
|
-
asset:
|
|
8003
|
-
shouldMintAndAllocate:
|
|
8004
|
-
maxReward:
|
|
8005
|
-
peg:
|
|
8006
|
-
reward:
|
|
8007
|
-
limit:
|
|
8008
|
-
manager:
|
|
8006
|
+
}), wd = l.object({
|
|
8007
|
+
type: l.literal("ERC20PeggedVariableCriteriaIncentiveV2"),
|
|
8008
|
+
asset: k,
|
|
8009
|
+
shouldMintAndAllocate: l.boolean().optional().default(!1),
|
|
8010
|
+
maxReward: l.coerce.bigint(),
|
|
8011
|
+
peg: k,
|
|
8012
|
+
reward: l.coerce.bigint(),
|
|
8013
|
+
limit: l.coerce.bigint(),
|
|
8014
|
+
manager: k.optional(),
|
|
8009
8015
|
criteria: Xs
|
|
8010
|
-
}),
|
|
8011
|
-
type:
|
|
8012
|
-
asset:
|
|
8013
|
-
shouldMintAndAllocate:
|
|
8014
|
-
initialReward:
|
|
8015
|
-
rewardDecay:
|
|
8016
|
-
rewardBoost:
|
|
8017
|
-
totalBudget:
|
|
8018
|
-
manager:
|
|
8019
|
-
}),
|
|
8020
|
-
type:
|
|
8021
|
-
venue:
|
|
8016
|
+
}), xd = l.object({
|
|
8017
|
+
type: l.literal("CGDAIncentive"),
|
|
8018
|
+
asset: k,
|
|
8019
|
+
shouldMintAndAllocate: l.boolean().optional().default(!1),
|
|
8020
|
+
initialReward: l.coerce.bigint(),
|
|
8021
|
+
rewardDecay: l.coerce.bigint(),
|
|
8022
|
+
rewardBoost: l.coerce.bigint(),
|
|
8023
|
+
totalBudget: l.coerce.bigint(),
|
|
8024
|
+
manager: k
|
|
8025
|
+
}), _d = l.object({
|
|
8026
|
+
type: l.literal("PointsIncentive"),
|
|
8027
|
+
venue: k,
|
|
8022
8028
|
selector: fn,
|
|
8023
|
-
reward:
|
|
8024
|
-
limit:
|
|
8025
|
-
}), Qs =
|
|
8026
|
-
protocolFee:
|
|
8027
|
-
maxParticipants:
|
|
8028
|
-
budget:
|
|
8029
|
-
|
|
8029
|
+
reward: l.coerce.bigint(),
|
|
8030
|
+
limit: l.coerce.bigint()
|
|
8031
|
+
}), Qs = l.object({
|
|
8032
|
+
protocolFee: l.coerce.bigint(),
|
|
8033
|
+
maxParticipants: l.coerce.bigint(),
|
|
8034
|
+
budget: l.union([
|
|
8035
|
+
k,
|
|
8030
8036
|
id,
|
|
8031
8037
|
ad
|
|
8032
8038
|
]),
|
|
8033
|
-
action:
|
|
8034
|
-
validator:
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
+
action: l.union([k, dd]),
|
|
8040
|
+
validator: l.union([
|
|
8041
|
+
k,
|
|
8042
|
+
hd,
|
|
8043
|
+
ld,
|
|
8044
|
+
fd
|
|
8045
|
+
]).optional(),
|
|
8046
|
+
allowList: l.union([k, pd, md]).optional(),
|
|
8047
|
+
incentives: l.array(
|
|
8048
|
+
l.union([
|
|
8039
8049
|
yd,
|
|
8040
|
-
gd,
|
|
8041
|
-
vd,
|
|
8042
8050
|
bd,
|
|
8051
|
+
vd,
|
|
8043
8052
|
wd,
|
|
8044
|
-
|
|
8053
|
+
gd,
|
|
8054
|
+
xd,
|
|
8055
|
+
_d
|
|
8045
8056
|
])
|
|
8046
8057
|
)
|
|
8047
8058
|
});
|
|
@@ -8062,14 +8073,14 @@ async function ea({ allowList: t }, { core: e }) {
|
|
|
8062
8073
|
throw new Error("unusupported AllowList: " + t);
|
|
8063
8074
|
}
|
|
8064
8075
|
}
|
|
8065
|
-
async function
|
|
8076
|
+
async function Pd(t, e, n, r = zr("110")) {
|
|
8066
8077
|
return await e.mint(t.account.address, r), await e.approve(n.assertValidAddress(), r), "allocate" in n && await n.allocate({
|
|
8067
8078
|
amount: r,
|
|
8068
8079
|
asset: e.assertValidAddress(),
|
|
8069
8080
|
target: t.account.address
|
|
8070
8081
|
}), { budget: n, erc20: e };
|
|
8071
8082
|
}
|
|
8072
|
-
function
|
|
8083
|
+
function Ed({
|
|
8073
8084
|
asset: t = "0xf3B2d0E4f2d8F453DBCc278b10e88b20d7f19f8D",
|
|
8074
8085
|
account: e = td[0].account,
|
|
8075
8086
|
chainId: n
|
|
@@ -8132,7 +8143,7 @@ function Pd({
|
|
|
8132
8143
|
]
|
|
8133
8144
|
};
|
|
8134
8145
|
}
|
|
8135
|
-
async function
|
|
8146
|
+
async function Id(t, e) {
|
|
8136
8147
|
const n = Qs.parse(t);
|
|
8137
8148
|
let r;
|
|
8138
8149
|
if (typeof n.budget == "string" && tn(n.budget))
|
|
@@ -8173,6 +8184,12 @@ async function kd(t, e) {
|
|
|
8173
8184
|
a.validator = e.LimitedSignerValidator(
|
|
8174
8185
|
n.validator
|
|
8175
8186
|
);
|
|
8187
|
+
break;
|
|
8188
|
+
case "PayableLimitedSignerValidator":
|
|
8189
|
+
a.validator = e.PayableLimitedSignerValidator(
|
|
8190
|
+
n.validator
|
|
8191
|
+
);
|
|
8192
|
+
break;
|
|
8176
8193
|
default:
|
|
8177
8194
|
throw new Error("unsupported Validator: " + n.validator);
|
|
8178
8195
|
}
|
|
@@ -8181,16 +8198,16 @@ async function kd(t, e) {
|
|
|
8181
8198
|
export {
|
|
8182
8199
|
od as A,
|
|
8183
8200
|
y as B,
|
|
8184
|
-
|
|
8201
|
+
xd as C,
|
|
8185
8202
|
dd as E,
|
|
8186
8203
|
ys as H,
|
|
8187
8204
|
vt as I,
|
|
8188
8205
|
ld as L,
|
|
8189
8206
|
ad as M,
|
|
8190
|
-
|
|
8191
|
-
|
|
8207
|
+
fd as P,
|
|
8208
|
+
hd as S,
|
|
8192
8209
|
cn as a,
|
|
8193
|
-
|
|
8210
|
+
qe as b,
|
|
8194
8211
|
Us as c,
|
|
8195
8212
|
lu as d,
|
|
8196
8213
|
os as e,
|
|
@@ -8200,16 +8217,17 @@ export {
|
|
|
8200
8217
|
Ee as i,
|
|
8201
8218
|
cd as j,
|
|
8202
8219
|
ud as k,
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8220
|
+
pd as l,
|
|
8221
|
+
md as m,
|
|
8222
|
+
yd as n,
|
|
8223
|
+
bd as o,
|
|
8224
|
+
gd as p,
|
|
8208
8225
|
Xs as q,
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8226
|
+
vd as r,
|
|
8227
|
+
kd as s,
|
|
8228
|
+
wd as t,
|
|
8229
|
+
_d as u,
|
|
8230
|
+
Qs as v,
|
|
8231
|
+
Ed as w,
|
|
8232
|
+
Id as x
|
|
8215
8233
|
};
|