@boostxyz/cli 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/deploy.cjs +1 -1
- package/dist/commands/deploy.js +1410 -282
- package/dist/commands/seed.cjs +2 -2
- package/dist/commands/seed.js +136 -136
- package/package.json +2 -2
package/dist/commands/seed.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import Ct from "node:fs/promises";
|
|
2
|
-
import
|
|
3
|
-
import { Deployable as
|
|
4
|
-
import { B as Zt, l as jt, p as Mt, c as Pt, f as $t, h as Dt, s as Vt, r as Bt, w as Lt, m as zt, n as Ut, q as ze, t as Wt, u as qt, x as
|
|
5
|
-
class
|
|
2
|
+
import St from "node:path";
|
|
3
|
+
import { Deployable as It, SignatureType as se, FilterType as nt, PrimitiveType as at, StrategyType as Me, BOOST_REGISTRY_ADDRESSES as At, BoostRegistry as Et, BOOST_CORE_ADDRESSES as Nt, BoostCore as Ot, Roles as rt, allowListFromAddress as Rt } from "@boostxyz/sdk";
|
|
4
|
+
import { B as Zt, l as jt, p as Mt, c as Pt, f as $t, h as Dt, s as Vt, r as Bt, w as Lt, m as zt, n as Ut, q as ze, t as Wt, u as qt, x as Ft, k as Gt } from "../utils-CbGtTEVk.js";
|
|
5
|
+
class Yt extends Zt {
|
|
6
6
|
constructor({ value: e }) {
|
|
7
7
|
super(`Number \`${e}\` is not a valid decimal number.`, {
|
|
8
8
|
name: "InvalidDecimalNumberError"
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Ht(n, e) {
|
|
13
13
|
if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(n))
|
|
14
|
-
throw new
|
|
14
|
+
throw new Yt({ value: n });
|
|
15
15
|
let [t, a = "0"] = n.split(".");
|
|
16
16
|
const r = t.startsWith("-");
|
|
17
17
|
if (r && (t = t.slice(1)), a = a.replace(/(0+)$/, ""), e === 0)
|
|
@@ -28,9 +28,9 @@ function Jt(n, e) {
|
|
|
28
28
|
return BigInt(`${r ? "-" : ""}${t}${a}`);
|
|
29
29
|
}
|
|
30
30
|
function st(n, e = "wei") {
|
|
31
|
-
return
|
|
31
|
+
return Ht(n, jt[e]);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const Ke = "0x0000000000000000000000000000000000000000";
|
|
34
34
|
function Pe(n, e) {
|
|
35
35
|
if (n === e)
|
|
36
36
|
return !0;
|
|
@@ -132,18 +132,18 @@ function We(n, e, t) {
|
|
|
132
132
|
const r = n[t];
|
|
133
133
|
return typeof r == "function" ? r : (s) => e(n, s);
|
|
134
134
|
}
|
|
135
|
-
const
|
|
135
|
+
const Jt = "2.13.8", Kt = () => `@wagmi/core@${Jt}`;
|
|
136
136
|
var it = function(n, e, t, a) {
|
|
137
137
|
if (t === "a" && !a) throw new TypeError("Private accessor was defined without a getter");
|
|
138
138
|
if (typeof e == "function" ? n !== e || !a : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
139
139
|
return t === "m" ? a : t === "a" ? a.call(n) : a ? a.value : e.get(n);
|
|
140
140
|
}, we, ot;
|
|
141
|
-
class
|
|
141
|
+
class G extends Error {
|
|
142
142
|
get docsBaseUrl() {
|
|
143
143
|
return "https://wagmi.sh/core";
|
|
144
144
|
}
|
|
145
145
|
get version() {
|
|
146
|
-
return
|
|
146
|
+
return Kt();
|
|
147
147
|
}
|
|
148
148
|
constructor(e, t = {}) {
|
|
149
149
|
var a;
|
|
@@ -173,7 +173,7 @@ class F extends Error {
|
|
|
173
173
|
writable: !0,
|
|
174
174
|
value: "WagmiCoreError"
|
|
175
175
|
});
|
|
176
|
-
const r = t.cause instanceof
|
|
176
|
+
const r = t.cause instanceof G ? t.cause.details : (a = t.cause) != null && a.message ? t.cause.message : t.details, s = t.cause instanceof G && t.cause.docsPath || t.docsPath;
|
|
177
177
|
this.message = [
|
|
178
178
|
e || "An error occurred.",
|
|
179
179
|
"",
|
|
@@ -193,7 +193,7 @@ class F extends Error {
|
|
|
193
193
|
we = /* @__PURE__ */ new WeakSet(), ot = function n(e, t) {
|
|
194
194
|
return t != null && t(e) ? e : e.cause ? it(this, we, "m", n).call(this, e.cause, t) : e;
|
|
195
195
|
};
|
|
196
|
-
class
|
|
196
|
+
class Xt extends G {
|
|
197
197
|
constructor() {
|
|
198
198
|
super("Connector not connected."), Object.defineProperty(this, "name", {
|
|
199
199
|
enumerable: !0,
|
|
@@ -203,7 +203,7 @@ class Kt extends F {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
class
|
|
206
|
+
class Qt extends G {
|
|
207
207
|
constructor({ address: e, connector: t }) {
|
|
208
208
|
super(`Account "${e}" not found for connector "${t.name}".`), Object.defineProperty(this, "name", {
|
|
209
209
|
enumerable: !0,
|
|
@@ -213,7 +213,7 @@ class Xt extends F {
|
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
class en extends
|
|
216
|
+
class en extends G {
|
|
217
217
|
constructor({ connectionChainId: e, connectorChainId: t }) {
|
|
218
218
|
super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`, {
|
|
219
219
|
metaMessages: [
|
|
@@ -228,7 +228,7 @@ class en extends F {
|
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
class tn extends
|
|
231
|
+
class tn extends G {
|
|
232
232
|
constructor({ connector: e }) {
|
|
233
233
|
super(`Connector "${e.name}" unavailable while reconnecting.`, {
|
|
234
234
|
details: [
|
|
@@ -262,7 +262,7 @@ async function ct(n, e = {}) {
|
|
|
262
262
|
} else
|
|
263
263
|
t = n.state.connections.get(n.state.current);
|
|
264
264
|
if (!t)
|
|
265
|
-
throw new
|
|
265
|
+
throw new Xt();
|
|
266
266
|
const a = e.chainId ?? t.chainId, r = await t.connector.getChainId();
|
|
267
267
|
if (r !== t.chainId)
|
|
268
268
|
throw new en({
|
|
@@ -274,7 +274,7 @@ async function ct(n, e = {}) {
|
|
|
274
274
|
return s.getClient({ chainId: a });
|
|
275
275
|
const i = Mt(e.account ?? t.accounts[0]);
|
|
276
276
|
if (i.address = Pt(i.address), e.account && !t.accounts.some((c) => c.toLowerCase() === i.address.toLowerCase()))
|
|
277
|
-
throw new
|
|
277
|
+
throw new Qt({
|
|
278
278
|
address: i.address,
|
|
279
279
|
connector: s
|
|
280
280
|
});
|
|
@@ -317,7 +317,7 @@ function qe(n) {
|
|
|
317
317
|
abi: n.abi
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Xe(n, e) {
|
|
321
321
|
const { chainId: t, ...a } = e, r = n.getClient({ chainId: t });
|
|
322
322
|
return We(r, Bt, "readContract")(a);
|
|
323
323
|
}
|
|
@@ -325,20 +325,20 @@ function dt(n) {
|
|
|
325
325
|
return n.address !== void 0 && typeof n.address == "object" ? (e, t) => {
|
|
326
326
|
var a;
|
|
327
327
|
const r = Ue(e), s = Ne(e), i = (t == null ? void 0 : t.chainId) ?? s.chainId ?? r;
|
|
328
|
-
return
|
|
328
|
+
return Xe(e, {
|
|
329
329
|
...t,
|
|
330
330
|
...n.functionName ? { functionName: n.functionName } : {},
|
|
331
331
|
address: (a = n.address) == null ? void 0 : a[i],
|
|
332
332
|
abi: n.abi
|
|
333
333
|
});
|
|
334
|
-
} : (e, t) =>
|
|
334
|
+
} : (e, t) => Xe(e, {
|
|
335
335
|
...t,
|
|
336
336
|
...n.address ? { address: n.address } : {},
|
|
337
337
|
...n.functionName ? { functionName: n.functionName } : {},
|
|
338
338
|
abi: n.abi
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
-
async function
|
|
341
|
+
async function Qe(n, e) {
|
|
342
342
|
const { account: t, chainId: a, connector: r, __mode: s, ...i } = e;
|
|
343
343
|
let o;
|
|
344
344
|
typeof t == "object" && t.type === "local" ? o = n.getClient({ chainId: a }) : o = await ct(n, { account: t, chainId: a, connector: r });
|
|
@@ -360,18 +360,18 @@ async function Xe(n, e) {
|
|
|
360
360
|
chain: a ? { id: a } : null
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Fe(n) {
|
|
364
364
|
return n.address !== void 0 && typeof n.address == "object" ? (e, t) => {
|
|
365
365
|
var a;
|
|
366
366
|
const r = Ue(e), s = Ne(e);
|
|
367
367
|
let i;
|
|
368
|
-
return t.chainId ? i = t.chainId : t.account && t.account === s.address || t.account === void 0 ? i = s.chainId : i = r,
|
|
368
|
+
return t.chainId ? i = t.chainId : t.account && t.account === s.address || t.account === void 0 ? i = s.chainId : i = r, Qe(e, {
|
|
369
369
|
...t,
|
|
370
370
|
...n.functionName ? { functionName: n.functionName } : {},
|
|
371
371
|
address: i ? (a = n.address) == null ? void 0 : a[i] : void 0,
|
|
372
372
|
abi: n.abi
|
|
373
373
|
});
|
|
374
|
-
} : (e, t) =>
|
|
374
|
+
} : (e, t) => Qe(e, {
|
|
375
375
|
...t,
|
|
376
376
|
...n.address ? { address: n.address } : {},
|
|
377
377
|
...n.functionName ? { functionName: n.functionName } : {},
|
|
@@ -557,13 +557,13 @@ const B = [
|
|
|
557
557
|
}), an = /* @__PURE__ */ dt({
|
|
558
558
|
abi: B,
|
|
559
559
|
functionName: "balanceOf"
|
|
560
|
-
}), rn = /* @__PURE__ */
|
|
560
|
+
}), rn = /* @__PURE__ */ Fe({
|
|
561
561
|
abi: B,
|
|
562
562
|
functionName: "approve"
|
|
563
|
-
}), sn = /* @__PURE__ */
|
|
563
|
+
}), sn = /* @__PURE__ */ Fe({
|
|
564
564
|
abi: B,
|
|
565
565
|
functionName: "mint"
|
|
566
|
-
}), on = /* @__PURE__ */
|
|
566
|
+
}), on = /* @__PURE__ */ Fe({
|
|
567
567
|
abi: B,
|
|
568
568
|
functionName: "mintPayable"
|
|
569
569
|
}), cn = /* @__PURE__ */ qe({
|
|
@@ -576,7 +576,7 @@ const B = [
|
|
|
576
576
|
abi: B,
|
|
577
577
|
functionName: "mintPayable"
|
|
578
578
|
}), ln = "0x6080604052348015600e575f80fd5b50610e138061001c5f395ff3fe6080604052600436106100dc575f3560e01c806340c10f191161007e57806395d89b411161005857806395d89b41146102bc578063a9059cbb146102e6578063d505accf14610322578063dd62ed3e1461034a576100dc565b806340c10f191461021c57806370a08231146102445780637ecebe0014610280576100dc565b806318160ddd116100ba57806318160ddd1461016257806323b872dd1461018c578063313ce567146101c85780633644e515146101f2576100dc565b806306fdde03146100e0578063095ea7b31461010a57806317d304b014610146575b5f80fd5b3480156100eb575f80fd5b506100f4610386565b60405161010191906109bf565b60405180910390f35b348015610115575f80fd5b50610130600480360381019061012b9190610a70565b6103c3565b60405161013d9190610ac8565b60405180910390f35b610160600480360381019061015b9190610a70565b610413565b005b34801561016d575f80fd5b50610176610470565b6040516101839190610af0565b60405180910390f35b348015610197575f80fd5b506101b260048036038101906101ad9190610b09565b610481565b6040516101bf9190610ac8565b60405180910390f35b3480156101d3575f80fd5b506101dc610552565b6040516101e99190610b74565b60405180910390f35b3480156101fd575f80fd5b5061020661055a565b6040516102139190610ba5565b60405180910390f35b348015610227575f80fd5b50610242600480360381019061023d9190610a70565b6105ea565b005b34801561024f575f80fd5b5061026a60048036038101906102659190610bbe565b6105f8565b6040516102779190610af0565b60405180910390f35b34801561028b575f80fd5b506102a660048036038101906102a19190610bbe565b610611565b6040516102b39190610af0565b60405180910390f35b3480156102c7575f80fd5b506102d061062a565b6040516102dd91906109bf565b60405180910390f35b3480156102f1575f80fd5b5061030c60048036038101906103079190610a70565b610667565b6040516103199190610ac8565b60405180910390f35b34801561032d575f80fd5b5061034860048036038101906103439190610c3d565b6106f5565b005b348015610355575f80fd5b50610370600480360381019061036b9190610cda565b610891565b60405161037d9190610af0565b60405180910390f35b60606040518060400160405280600a81526020017f4d6f636b20455243323000000000000000000000000000000000000000000000815250905090565b5f82602052637f5e9f20600c52335f52816034600c2055815f52602c5160601c337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560205fa36001905092915050565b6064816104209190610d45565b341015610462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045990610dbf565b60405180910390fd5b61046c82826108af565b5050565b5f6805345cdf77eb68f44c54905090565b5f61048d848484610941565b8360601b33602052637f5e9f208117600c526034600c20805460018101156104ca57808511156104c4576313be252b5f526004601cfd5b84810382555b6387a211a28317600c526020600c208054808711156104f05763f4d678b85f526004601cfd5b8681038255875f526020600c2087815401815587602052600c5160601c8660601c7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a3505050505050610547848484610946565b600190509392505050565b5f6012905090565b5f8061056461094b565b90505f801b810361058157610577610386565b8051906020012090505b6040517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81528160208201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604082015246606082015230608082015260a081209250505090565b6105f482826108af565b5050565b5f6387a211a2600c52815f526020600c20549050919050565b5f6338377508600c52815f526020600c20549050919050565b60606040518060400160405280600481526020017f4d4f434b00000000000000000000000000000000000000000000000000000000815250905090565b5f610673338484610941565b6387a211a2600c52335f526020600c2080548084111561069a5763f4d678b85f526004601cfd5b8381038255845f526020600c2084815401815584602052600c5160601c337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a35050506106eb338484610946565b6001905092915050565b5f6106fe61094b565b90505f801b810361071b57610711610386565b8051906020012090505b8442111561073057631a15a3cc5f526004601cfd5b6040518860601b60601c98508760601b60601c975065383775081901600e52885f526020600c2080547f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f83528360208401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6604084015246606084015230608084015260a08320602e527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c983528a60208401528960408401528860608401528060808401528760a084015260c08320604e526042602c205f528660ff16602052856040528460605260208060805f60015afa8b3d51146108385763ddafbaef5f526004601cfd5b80820183558a637f5e9f2060a01b17604052896034602c20558a8c7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925602060608801a3836040525f606052505050505050505050505050565b5f81602052637f5e9f20600c52825f526034600c2054905092915050565b6108ba5f8383610941565b6805345cdf77eb68f44c54818101818110156108dd5763e5cfe9575f526004601cfd5b806805345cdf77eb68f44c556387a211a2600c52835f526020600c2083815401815583602052600c5160601c5f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef602080a350505061093d5f8383610946565b5050565b505050565b505050565b5f90565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f6109918261094f565b61099b8185610959565b93506109ab818560208601610969565b6109b481610977565b840191505092915050565b5f6020820190508181035f8301526109d78184610987565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a0c826109e3565b9050919050565b610a1c81610a02565b8114610a26575f80fd5b50565b5f81359050610a3781610a13565b92915050565b5f819050919050565b610a4f81610a3d565b8114610a59575f80fd5b50565b5f81359050610a6a81610a46565b92915050565b5f8060408385031215610a8657610a856109df565b5b5f610a9385828601610a29565b9250506020610aa485828601610a5c565b9150509250929050565b5f8115159050919050565b610ac281610aae565b82525050565b5f602082019050610adb5f830184610ab9565b92915050565b610aea81610a3d565b82525050565b5f602082019050610b035f830184610ae1565b92915050565b5f805f60608486031215610b2057610b1f6109df565b5b5f610b2d86828701610a29565b9350506020610b3e86828701610a29565b9250506040610b4f86828701610a5c565b9150509250925092565b5f60ff82169050919050565b610b6e81610b59565b82525050565b5f602082019050610b875f830184610b65565b92915050565b5f819050919050565b610b9f81610b8d565b82525050565b5f602082019050610bb85f830184610b96565b92915050565b5f60208284031215610bd357610bd26109df565b5b5f610be084828501610a29565b91505092915050565b610bf281610b59565b8114610bfc575f80fd5b50565b5f81359050610c0d81610be9565b92915050565b610c1c81610b8d565b8114610c26575f80fd5b50565b5f81359050610c3781610c13565b92915050565b5f805f805f805f60e0888a031215610c5857610c576109df565b5b5f610c658a828b01610a29565b9750506020610c768a828b01610a29565b9650506040610c878a828b01610a5c565b9550506060610c988a828b01610a5c565b9450506080610ca98a828b01610bff565b93505060a0610cba8a828b01610c29565b92505060c0610ccb8a828b01610c29565b91505092959891949750929550565b5f8060408385031215610cf057610cef6109df565b5b5f610cfd85828601610a29565b9250506020610d0e85828601610a29565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610d4f82610a3d565b9150610d5a83610a3d565b925082610d6a57610d69610d18565b5b828204905092915050565b7f4d6f636b45524332303a2067696d6d65206d6f7265206d6f6e657921000000005f82015250565b5f610da9601c83610959565b9150610db482610d75565b602082019050919050565b5f6020820190508181035f830152610dd681610d9d565b905091905056fea2646970667358221220a588f9f821e157f856641e8171dc78ec959e3c73080238aa8696355fc5d4a5d064736f6c634300081a0033";
|
|
579
|
-
class ut extends
|
|
579
|
+
class ut extends It {
|
|
580
580
|
async balanceOf(e, t) {
|
|
581
581
|
return await an(this._config, {
|
|
582
582
|
address: this.assertValidAddress(),
|
|
@@ -955,7 +955,7 @@ function f(n, e) {
|
|
|
955
955
|
});
|
|
956
956
|
n.common.issues.push(a);
|
|
957
957
|
}
|
|
958
|
-
class
|
|
958
|
+
class I {
|
|
959
959
|
constructor() {
|
|
960
960
|
this.value = "valid";
|
|
961
961
|
}
|
|
@@ -983,7 +983,7 @@ class S {
|
|
|
983
983
|
value: i
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
return
|
|
986
|
+
return I.mergeObjectSync(e, a);
|
|
987
987
|
}
|
|
988
988
|
static mergeObjectSync(e, t) {
|
|
989
989
|
const a = {};
|
|
@@ -998,7 +998,7 @@ class S {
|
|
|
998
998
|
}
|
|
999
999
|
const b = Object.freeze({
|
|
1000
1000
|
status: "aborted"
|
|
1001
|
-
}),
|
|
1001
|
+
}), X = (n) => ({ status: "dirty", value: n }), A = (n) => ({ status: "valid", value: n }), Ve = (n) => n.status === "aborted", Be = (n) => n.status === "dirty", ie = (n) => n.status === "valid", oe = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
1002
1002
|
function Ce(n, e, t, a) {
|
|
1003
1003
|
if (typeof e == "function" ? n !== e || !a : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1004
1004
|
return e.get(n);
|
|
@@ -1069,7 +1069,7 @@ class v {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
_processInputParams(e) {
|
|
1071
1071
|
return {
|
|
1072
|
-
status: new
|
|
1072
|
+
status: new I(),
|
|
1073
1073
|
ctx: {
|
|
1074
1074
|
common: e.parent.common,
|
|
1075
1075
|
data: e.data,
|
|
@@ -1195,7 +1195,7 @@ class v {
|
|
|
1195
1195
|
});
|
|
1196
1196
|
}
|
|
1197
1197
|
brand() {
|
|
1198
|
-
return new
|
|
1198
|
+
return new Ge({
|
|
1199
1199
|
typeName: y.ZodBranded,
|
|
1200
1200
|
type: this,
|
|
1201
1201
|
...g(this._def)
|
|
@@ -1232,7 +1232,7 @@ class v {
|
|
|
1232
1232
|
}
|
|
1233
1233
|
const yn = /^c[^\s-]{8,}$/i, bn = /^[0-9a-z]+$/, gn = /^[0-9A-HJKMNP-TV-Z]{26}$/, vn = /^[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, _n = /^[a-z0-9_-]{21}$/i, xn = /^[-+]?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)?)??$/, wn = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, kn = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1234
1234
|
let je;
|
|
1235
|
-
const Tn = /^(?:(?: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])$/, Cn = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
|
|
1235
|
+
const Tn = /^(?:(?: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])$/, Cn = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/, Sn = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ht = "((\\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])))", In = new RegExp(`^${ht}$`);
|
|
1236
1236
|
function pt(n) {
|
|
1237
1237
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
1238
1238
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
@@ -1258,7 +1258,7 @@ class N extends v {
|
|
|
1258
1258
|
received: s.parsedType
|
|
1259
1259
|
}), b;
|
|
1260
1260
|
}
|
|
1261
|
-
const a = new
|
|
1261
|
+
const a = new I();
|
|
1262
1262
|
let r;
|
|
1263
1263
|
for (const s of this._def.checks)
|
|
1264
1264
|
if (s.kind === "min")
|
|
@@ -1368,7 +1368,7 @@ class N extends v {
|
|
|
1368
1368
|
code: d.invalid_string,
|
|
1369
1369
|
validation: "datetime",
|
|
1370
1370
|
message: s.message
|
|
1371
|
-
}), a.dirty()) : s.kind === "date" ?
|
|
1371
|
+
}), a.dirty()) : s.kind === "date" ? In.test(e.data) || (r = this._getOrReturnCtx(e, r), f(r, {
|
|
1372
1372
|
code: d.invalid_string,
|
|
1373
1373
|
validation: "date",
|
|
1374
1374
|
message: s.message
|
|
@@ -1384,7 +1384,7 @@ class N extends v {
|
|
|
1384
1384
|
validation: "ip",
|
|
1385
1385
|
code: d.invalid_string,
|
|
1386
1386
|
message: s.message
|
|
1387
|
-
}), a.dirty()) : s.kind === "base64" ?
|
|
1387
|
+
}), a.dirty()) : s.kind === "base64" ? Sn.test(e.data) || (r = this._getOrReturnCtx(e, r), f(r, {
|
|
1388
1388
|
validation: "base64",
|
|
1389
1389
|
code: d.invalid_string,
|
|
1390
1390
|
message: s.message
|
|
@@ -1624,7 +1624,7 @@ class z extends v {
|
|
|
1624
1624
|
}), b;
|
|
1625
1625
|
}
|
|
1626
1626
|
let a;
|
|
1627
|
-
const r = new
|
|
1627
|
+
const r = new I();
|
|
1628
1628
|
for (const s of this._def.checks)
|
|
1629
1629
|
s.kind === "int" ? _.isInteger(e.data) || (a = this._getOrReturnCtx(e, a), f(a, {
|
|
1630
1630
|
code: d.invalid_type,
|
|
@@ -1796,7 +1796,7 @@ class U extends v {
|
|
|
1796
1796
|
}), b;
|
|
1797
1797
|
}
|
|
1798
1798
|
let a;
|
|
1799
|
-
const r = new
|
|
1799
|
+
const r = new I();
|
|
1800
1800
|
for (const s of this._def.checks)
|
|
1801
1801
|
s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (a = this._getOrReturnCtx(e, a), f(a, {
|
|
1802
1802
|
code: d.too_small,
|
|
@@ -1928,7 +1928,7 @@ ce.create = (n) => new ce({
|
|
|
1928
1928
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1929
1929
|
...g(n)
|
|
1930
1930
|
});
|
|
1931
|
-
class
|
|
1931
|
+
class Y extends v {
|
|
1932
1932
|
_parse(e) {
|
|
1933
1933
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== h.date) {
|
|
1934
1934
|
const s = this._getOrReturnCtx(e);
|
|
@@ -1944,7 +1944,7 @@ class G extends v {
|
|
|
1944
1944
|
code: d.invalid_date
|
|
1945
1945
|
}), b;
|
|
1946
1946
|
}
|
|
1947
|
-
const a = new
|
|
1947
|
+
const a = new I();
|
|
1948
1948
|
let r;
|
|
1949
1949
|
for (const s of this._def.checks)
|
|
1950
1950
|
s.kind === "min" ? e.data.getTime() < s.value && (r = this._getOrReturnCtx(e, r), f(r, {
|
|
@@ -1968,7 +1968,7 @@ class G extends v {
|
|
|
1968
1968
|
};
|
|
1969
1969
|
}
|
|
1970
1970
|
_addCheck(e) {
|
|
1971
|
-
return new
|
|
1971
|
+
return new Y({
|
|
1972
1972
|
...this._def,
|
|
1973
1973
|
checks: [...this._def.checks, e]
|
|
1974
1974
|
});
|
|
@@ -2000,13 +2000,13 @@ class G extends v {
|
|
|
2000
2000
|
return e != null ? new Date(e) : null;
|
|
2001
2001
|
}
|
|
2002
2002
|
}
|
|
2003
|
-
|
|
2003
|
+
Y.create = (n) => new Y({
|
|
2004
2004
|
checks: [],
|
|
2005
2005
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
2006
2006
|
typeName: y.ZodDate,
|
|
2007
2007
|
...g(n)
|
|
2008
2008
|
});
|
|
2009
|
-
class
|
|
2009
|
+
class Se extends v {
|
|
2010
2010
|
_parse(e) {
|
|
2011
2011
|
if (this._getType(e) !== h.symbol) {
|
|
2012
2012
|
const a = this._getOrReturnCtx(e);
|
|
@@ -2019,7 +2019,7 @@ class Ie extends v {
|
|
|
2019
2019
|
return A(e.data);
|
|
2020
2020
|
}
|
|
2021
2021
|
}
|
|
2022
|
-
|
|
2022
|
+
Se.create = (n) => new Se({
|
|
2023
2023
|
typeName: y.ZodSymbol,
|
|
2024
2024
|
...g(n)
|
|
2025
2025
|
});
|
|
@@ -2069,7 +2069,7 @@ te.create = (n) => new te({
|
|
|
2069
2069
|
typeName: y.ZodAny,
|
|
2070
2070
|
...g(n)
|
|
2071
2071
|
});
|
|
2072
|
-
class
|
|
2072
|
+
class F extends v {
|
|
2073
2073
|
constructor() {
|
|
2074
2074
|
super(...arguments), this._unknown = !0;
|
|
2075
2075
|
}
|
|
@@ -2077,7 +2077,7 @@ class H extends v {
|
|
|
2077
2077
|
return A(e.data);
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
|
-
|
|
2080
|
+
F.create = (n) => new F({
|
|
2081
2081
|
typeName: y.ZodUnknown,
|
|
2082
2082
|
...g(n)
|
|
2083
2083
|
});
|
|
@@ -2095,7 +2095,7 @@ V.create = (n) => new V({
|
|
|
2095
2095
|
typeName: y.ZodNever,
|
|
2096
2096
|
...g(n)
|
|
2097
2097
|
});
|
|
2098
|
-
class
|
|
2098
|
+
class Ie extends v {
|
|
2099
2099
|
_parse(e) {
|
|
2100
2100
|
if (this._getType(e) !== h.undefined) {
|
|
2101
2101
|
const a = this._getOrReturnCtx(e);
|
|
@@ -2108,7 +2108,7 @@ class Se extends v {
|
|
|
2108
2108
|
return A(e.data);
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
|
-
|
|
2111
|
+
Ie.create = (n) => new Ie({
|
|
2112
2112
|
typeName: y.ZodVoid,
|
|
2113
2113
|
...g(n)
|
|
2114
2114
|
});
|
|
@@ -2148,9 +2148,9 @@ class O extends v {
|
|
|
2148
2148
|
exact: !1,
|
|
2149
2149
|
message: r.maxLength.message
|
|
2150
2150
|
}), a.dirty()), t.common.async)
|
|
2151
|
-
return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new j(t, i, t.path, o)))).then((i) =>
|
|
2151
|
+
return Promise.all([...t.data].map((i, o) => r.type._parseAsync(new j(t, i, t.path, o)))).then((i) => I.mergeArray(a, i));
|
|
2152
2152
|
const s = [...t.data].map((i, o) => r.type._parseSync(new j(t, i, t.path, o)));
|
|
2153
|
-
return
|
|
2153
|
+
return I.mergeArray(a, s);
|
|
2154
2154
|
}
|
|
2155
2155
|
get element() {
|
|
2156
2156
|
return this._def.type;
|
|
@@ -2185,12 +2185,12 @@ O.create = (n, e) => new O({
|
|
|
2185
2185
|
typeName: y.ZodArray,
|
|
2186
2186
|
...g(e)
|
|
2187
2187
|
});
|
|
2188
|
-
function
|
|
2188
|
+
function K(n) {
|
|
2189
2189
|
if (n instanceof k) {
|
|
2190
2190
|
const e = {};
|
|
2191
2191
|
for (const t in n.shape) {
|
|
2192
2192
|
const a = n.shape[t];
|
|
2193
|
-
e[t] = Z.create(
|
|
2193
|
+
e[t] = Z.create(K(a));
|
|
2194
2194
|
}
|
|
2195
2195
|
return new k({
|
|
2196
2196
|
...n._def,
|
|
@@ -2198,8 +2198,8 @@ function Q(n) {
|
|
|
2198
2198
|
});
|
|
2199
2199
|
} else return n instanceof O ? new O({
|
|
2200
2200
|
...n._def,
|
|
2201
|
-
type:
|
|
2202
|
-
}) : n instanceof Z ? Z.create(
|
|
2201
|
+
type: K(n.element)
|
|
2202
|
+
}) : n instanceof Z ? Z.create(K(n.unwrap())) : n instanceof q ? q.create(K(n.unwrap())) : n instanceof M ? M.create(n.items.map((e) => K(e))) : n;
|
|
2203
2203
|
}
|
|
2204
2204
|
class k extends v {
|
|
2205
2205
|
constructor() {
|
|
@@ -2264,15 +2264,15 @@ class k extends v {
|
|
|
2264
2264
|
return r.common.async ? Promise.resolve().then(async () => {
|
|
2265
2265
|
const c = [];
|
|
2266
2266
|
for (const m of u) {
|
|
2267
|
-
const C = await m.key,
|
|
2267
|
+
const C = await m.key, J = await m.value;
|
|
2268
2268
|
c.push({
|
|
2269
2269
|
key: C,
|
|
2270
|
-
value:
|
|
2270
|
+
value: J,
|
|
2271
2271
|
alwaysSet: m.alwaysSet
|
|
2272
2272
|
});
|
|
2273
2273
|
}
|
|
2274
2274
|
return c;
|
|
2275
|
-
}).then((c) =>
|
|
2275
|
+
}).then((c) => I.mergeObjectSync(a, c)) : I.mergeObjectSync(a, u);
|
|
2276
2276
|
}
|
|
2277
2277
|
get shape() {
|
|
2278
2278
|
return this._def.shape();
|
|
@@ -2435,7 +2435,7 @@ class k extends v {
|
|
|
2435
2435
|
* @deprecated
|
|
2436
2436
|
*/
|
|
2437
2437
|
deepPartial() {
|
|
2438
|
-
return
|
|
2438
|
+
return K(this);
|
|
2439
2439
|
}
|
|
2440
2440
|
partial(e) {
|
|
2441
2441
|
const t = {};
|
|
@@ -2561,7 +2561,7 @@ le.create = (n, e) => new le({
|
|
|
2561
2561
|
typeName: y.ZodUnion,
|
|
2562
2562
|
...g(e)
|
|
2563
2563
|
});
|
|
2564
|
-
const D = (n) => n instanceof pe ? D(n.schema) : n instanceof R ? D(n.innerType()) : n instanceof me ? [n.value] : n instanceof W ? n.options : n instanceof ye ? _.objectValues(n.enum) : n instanceof be ? D(n._def.innerType) : n instanceof de ? [void 0] : n instanceof ue ? [null] : n instanceof Z ? [void 0, ...D(n.unwrap())] : n instanceof q ? [null, ...D(n.unwrap())] : n instanceof
|
|
2564
|
+
const D = (n) => n instanceof pe ? D(n.schema) : n instanceof R ? D(n.innerType()) : n instanceof me ? [n.value] : n instanceof W ? n.options : n instanceof ye ? _.objectValues(n.enum) : n instanceof be ? D(n._def.innerType) : n instanceof de ? [void 0] : n instanceof ue ? [null] : n instanceof Z ? [void 0, ...D(n.unwrap())] : n instanceof q ? [null, ...D(n.unwrap())] : n instanceof Ge || n instanceof ve ? D(n.unwrap()) : n instanceof ge ? D(n._def.innerType) : [];
|
|
2565
2565
|
class Oe extends v {
|
|
2566
2566
|
_parse(e) {
|
|
2567
2567
|
const { ctx: t } = this._processInputParams(e);
|
|
@@ -2716,7 +2716,7 @@ class M extends v {
|
|
|
2716
2716
|
const u = this._def.items[o] || this._def.rest;
|
|
2717
2717
|
return u ? u._parse(new j(a, i, a.path, o)) : null;
|
|
2718
2718
|
}).filter((i) => !!i);
|
|
2719
|
-
return a.common.async ? Promise.all(s).then((i) =>
|
|
2719
|
+
return a.common.async ? Promise.all(s).then((i) => I.mergeArray(t, i)) : I.mergeArray(t, s);
|
|
2720
2720
|
}
|
|
2721
2721
|
get items() {
|
|
2722
2722
|
return this._def.items;
|
|
@@ -2760,7 +2760,7 @@ class he extends v {
|
|
|
2760
2760
|
value: i._parse(new j(a, a.data[o], a.path, o)),
|
|
2761
2761
|
alwaysSet: o in a.data
|
|
2762
2762
|
});
|
|
2763
|
-
return a.common.async ?
|
|
2763
|
+
return a.common.async ? I.mergeObjectAsync(t, r) : I.mergeObjectSync(t, r);
|
|
2764
2764
|
}
|
|
2765
2765
|
get element() {
|
|
2766
2766
|
return this._def.valueType;
|
|
@@ -2827,7 +2827,7 @@ Ae.create = (n, e, t) => new Ae({
|
|
|
2827
2827
|
typeName: y.ZodMap,
|
|
2828
2828
|
...g(t)
|
|
2829
2829
|
});
|
|
2830
|
-
class
|
|
2830
|
+
class H extends v {
|
|
2831
2831
|
_parse(e) {
|
|
2832
2832
|
const { status: t, ctx: a } = this._processInputParams(e);
|
|
2833
2833
|
if (a.parsedType !== h.set)
|
|
@@ -2866,13 +2866,13 @@ class J extends v {
|
|
|
2866
2866
|
return a.common.async ? Promise.all(o).then((u) => i(u)) : i(o);
|
|
2867
2867
|
}
|
|
2868
2868
|
min(e, t) {
|
|
2869
|
-
return new
|
|
2869
|
+
return new H({
|
|
2870
2870
|
...this._def,
|
|
2871
2871
|
minSize: { value: e, message: p.toString(t) }
|
|
2872
2872
|
});
|
|
2873
2873
|
}
|
|
2874
2874
|
max(e, t) {
|
|
2875
|
-
return new
|
|
2875
|
+
return new H({
|
|
2876
2876
|
...this._def,
|
|
2877
2877
|
maxSize: { value: e, message: p.toString(t) }
|
|
2878
2878
|
});
|
|
@@ -2884,14 +2884,14 @@ class J extends v {
|
|
|
2884
2884
|
return this.min(1, e);
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
|
-
|
|
2887
|
+
H.create = (n, e) => new H({
|
|
2888
2888
|
valueType: n,
|
|
2889
2889
|
minSize: null,
|
|
2890
2890
|
maxSize: null,
|
|
2891
2891
|
typeName: y.ZodSet,
|
|
2892
2892
|
...g(e)
|
|
2893
2893
|
});
|
|
2894
|
-
class
|
|
2894
|
+
class Q extends v {
|
|
2895
2895
|
constructor() {
|
|
2896
2896
|
super(...arguments), this.validate = this.implement;
|
|
2897
2897
|
}
|
|
@@ -2939,11 +2939,11 @@ class X extends v {
|
|
|
2939
2939
|
if (this._def.returns instanceof ne) {
|
|
2940
2940
|
const o = this;
|
|
2941
2941
|
return A(async function(...u) {
|
|
2942
|
-
const c = new E([]), m = await o._def.args.parseAsync(u, s).catch((
|
|
2943
|
-
throw c.addIssue(a(u,
|
|
2942
|
+
const c = new E([]), m = await o._def.args.parseAsync(u, s).catch((S) => {
|
|
2943
|
+
throw c.addIssue(a(u, S)), c;
|
|
2944
2944
|
}), C = await Reflect.apply(i, this, m);
|
|
2945
|
-
return await o._def.returns._def.type.parseAsync(C, s).catch((
|
|
2946
|
-
throw c.addIssue(r(C,
|
|
2945
|
+
return await o._def.returns._def.type.parseAsync(C, s).catch((S) => {
|
|
2946
|
+
throw c.addIssue(r(C, S)), c;
|
|
2947
2947
|
});
|
|
2948
2948
|
});
|
|
2949
2949
|
} else {
|
|
@@ -2966,13 +2966,13 @@ class X extends v {
|
|
|
2966
2966
|
return this._def.returns;
|
|
2967
2967
|
}
|
|
2968
2968
|
args(...e) {
|
|
2969
|
-
return new
|
|
2969
|
+
return new Q({
|
|
2970
2970
|
...this._def,
|
|
2971
|
-
args: M.create(e).rest(
|
|
2971
|
+
args: M.create(e).rest(F.create())
|
|
2972
2972
|
});
|
|
2973
2973
|
}
|
|
2974
2974
|
returns(e) {
|
|
2975
|
-
return new
|
|
2975
|
+
return new Q({
|
|
2976
2976
|
...this._def,
|
|
2977
2977
|
returns: e
|
|
2978
2978
|
});
|
|
@@ -2984,9 +2984,9 @@ class X extends v {
|
|
|
2984
2984
|
return this.parse(e);
|
|
2985
2985
|
}
|
|
2986
2986
|
static create(e, t, a) {
|
|
2987
|
-
return new
|
|
2988
|
-
args: e || M.create([]).rest(
|
|
2989
|
-
returns: t ||
|
|
2987
|
+
return new Q({
|
|
2988
|
+
args: e || M.create([]).rest(F.create()),
|
|
2989
|
+
returns: t || F.create(),
|
|
2990
2990
|
typeName: y.ZodFunction,
|
|
2991
2991
|
...g(a)
|
|
2992
2992
|
});
|
|
@@ -3178,7 +3178,7 @@ class R extends v {
|
|
|
3178
3178
|
path: a.path,
|
|
3179
3179
|
parent: a
|
|
3180
3180
|
});
|
|
3181
|
-
return u.status === "aborted" ? b : u.status === "dirty" || t.value === "dirty" ?
|
|
3181
|
+
return u.status === "aborted" ? b : u.status === "dirty" || t.value === "dirty" ? X(u.value) : u;
|
|
3182
3182
|
});
|
|
3183
3183
|
{
|
|
3184
3184
|
if (t.value === "aborted")
|
|
@@ -3188,7 +3188,7 @@ class R extends v {
|
|
|
3188
3188
|
path: a.path,
|
|
3189
3189
|
parent: a
|
|
3190
3190
|
});
|
|
3191
|
-
return o.status === "aborted" ? b : o.status === "dirty" || t.value === "dirty" ?
|
|
3191
|
+
return o.status === "aborted" ? b : o.status === "dirty" || t.value === "dirty" ? X(o.value) : o;
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
3194
|
if (r.type === "refinement") {
|
|
@@ -3347,7 +3347,7 @@ Ee.create = (n) => new Ee({
|
|
|
3347
3347
|
...g(n)
|
|
3348
3348
|
});
|
|
3349
3349
|
const On = Symbol("zod_brand");
|
|
3350
|
-
class
|
|
3350
|
+
class Ge extends v {
|
|
3351
3351
|
_parse(e) {
|
|
3352
3352
|
const { ctx: t } = this._processInputParams(e), a = t.data;
|
|
3353
3353
|
return this._def.type._parse({
|
|
@@ -3370,7 +3370,7 @@ class _e extends v {
|
|
|
3370
3370
|
path: a.path,
|
|
3371
3371
|
parent: a
|
|
3372
3372
|
});
|
|
3373
|
-
return s.status === "aborted" ? b : s.status === "dirty" ? (t.dirty(),
|
|
3373
|
+
return s.status === "aborted" ? b : s.status === "dirty" ? (t.dirty(), X(s.value)) : this._def.out._parseAsync({
|
|
3374
3374
|
data: s.value,
|
|
3375
3375
|
path: a.path,
|
|
3376
3376
|
parent: a
|
|
@@ -3432,7 +3432,7 @@ var y;
|
|
|
3432
3432
|
})(y || (y = {}));
|
|
3433
3433
|
const Zn = (n, e = {
|
|
3434
3434
|
message: `Input not instance of ${n.name}`
|
|
3435
|
-
}) => bt((t) => t instanceof n, e), gt = N.create, vt = z.create, jn = Ee.create, Mn = U.create, _t = ce.create, Pn =
|
|
3435
|
+
}) => bt((t) => t instanceof n, e), gt = N.create, vt = z.create, jn = Ee.create, Mn = U.create, _t = ce.create, Pn = Y.create, $n = Se.create, Dn = de.create, Vn = ue.create, Bn = te.create, Ln = F.create, zn = V.create, Un = Ie.create, Wn = O.create, qn = k.create, Fn = k.strictCreate, Gn = le.create, Yn = Oe.create, Hn = fe.create, Jn = M.create, Kn = he.create, Xn = Ae.create, Qn = H.create, ea = Q.create, ta = pe.create, na = me.create, aa = W.create, ra = ye.create, sa = ne.create, tt = R.create, ia = Z.create, oa = q.create, ca = R.createWithPreprocess, da = _e.create, ua = () => gt().optional(), la = () => vt().optional(), fa = () => _t().optional(), ha = {
|
|
3436
3436
|
string: (n) => N.create({ ...n, coerce: !0 }),
|
|
3437
3437
|
number: (n) => z.create({ ...n, coerce: !0 }),
|
|
3438
3438
|
boolean: (n) => ce.create({
|
|
@@ -3440,7 +3440,7 @@ const Zn = (n, e = {
|
|
|
3440
3440
|
coerce: !0
|
|
3441
3441
|
}),
|
|
3442
3442
|
bigint: (n) => U.create({ ...n, coerce: !0 }),
|
|
3443
|
-
date: (n) =>
|
|
3443
|
+
date: (n) => Y.create({ ...n, coerce: !0 })
|
|
3444
3444
|
}, pa = b;
|
|
3445
3445
|
var l = /* @__PURE__ */ Object.freeze({
|
|
3446
3446
|
__proto__: null,
|
|
@@ -3450,9 +3450,9 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3450
3450
|
makeIssue: Te,
|
|
3451
3451
|
EMPTY_PATH: mn,
|
|
3452
3452
|
addIssueToContext: f,
|
|
3453
|
-
ParseStatus:
|
|
3453
|
+
ParseStatus: I,
|
|
3454
3454
|
INVALID: b,
|
|
3455
|
-
DIRTY:
|
|
3455
|
+
DIRTY: X,
|
|
3456
3456
|
OK: A,
|
|
3457
3457
|
isAborted: Ve,
|
|
3458
3458
|
isDirty: Be,
|
|
@@ -3472,14 +3472,14 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3472
3472
|
ZodNumber: z,
|
|
3473
3473
|
ZodBigInt: U,
|
|
3474
3474
|
ZodBoolean: ce,
|
|
3475
|
-
ZodDate:
|
|
3476
|
-
ZodSymbol:
|
|
3475
|
+
ZodDate: Y,
|
|
3476
|
+
ZodSymbol: Se,
|
|
3477
3477
|
ZodUndefined: de,
|
|
3478
3478
|
ZodNull: ue,
|
|
3479
3479
|
ZodAny: te,
|
|
3480
|
-
ZodUnknown:
|
|
3480
|
+
ZodUnknown: F,
|
|
3481
3481
|
ZodNever: V,
|
|
3482
|
-
ZodVoid:
|
|
3482
|
+
ZodVoid: Ie,
|
|
3483
3483
|
ZodArray: O,
|
|
3484
3484
|
ZodObject: k,
|
|
3485
3485
|
ZodUnion: le,
|
|
@@ -3488,8 +3488,8 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3488
3488
|
ZodTuple: M,
|
|
3489
3489
|
ZodRecord: he,
|
|
3490
3490
|
ZodMap: Ae,
|
|
3491
|
-
ZodSet:
|
|
3492
|
-
ZodFunction:
|
|
3491
|
+
ZodSet: H,
|
|
3492
|
+
ZodFunction: Q,
|
|
3493
3493
|
ZodLazy: pe,
|
|
3494
3494
|
ZodLiteral: me,
|
|
3495
3495
|
ZodEnum: W,
|
|
@@ -3503,7 +3503,7 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3503
3503
|
ZodCatch: ge,
|
|
3504
3504
|
ZodNaN: Ee,
|
|
3505
3505
|
BRAND: On,
|
|
3506
|
-
ZodBranded:
|
|
3506
|
+
ZodBranded: Ge,
|
|
3507
3507
|
ZodPipeline: _e,
|
|
3508
3508
|
ZodReadonly: ve,
|
|
3509
3509
|
custom: bt,
|
|
@@ -3519,15 +3519,15 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3519
3519
|
bigint: Mn,
|
|
3520
3520
|
boolean: _t,
|
|
3521
3521
|
date: Pn,
|
|
3522
|
-
discriminatedUnion:
|
|
3522
|
+
discriminatedUnion: Yn,
|
|
3523
3523
|
effect: tt,
|
|
3524
3524
|
enum: aa,
|
|
3525
3525
|
function: ea,
|
|
3526
3526
|
instanceof: Zn,
|
|
3527
|
-
intersection:
|
|
3527
|
+
intersection: Hn,
|
|
3528
3528
|
lazy: ta,
|
|
3529
3529
|
literal: na,
|
|
3530
|
-
map:
|
|
3530
|
+
map: Xn,
|
|
3531
3531
|
nan: jn,
|
|
3532
3532
|
nativeEnum: ra,
|
|
3533
3533
|
never: zn,
|
|
@@ -3542,15 +3542,15 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3542
3542
|
pipeline: da,
|
|
3543
3543
|
preprocess: ca,
|
|
3544
3544
|
promise: sa,
|
|
3545
|
-
record:
|
|
3546
|
-
set:
|
|
3547
|
-
strictObject:
|
|
3545
|
+
record: Kn,
|
|
3546
|
+
set: Qn,
|
|
3547
|
+
strictObject: Fn,
|
|
3548
3548
|
string: gt,
|
|
3549
3549
|
symbol: $n,
|
|
3550
3550
|
transformer: tt,
|
|
3551
|
-
tuple:
|
|
3551
|
+
tuple: Jn,
|
|
3552
3552
|
undefined: Dn,
|
|
3553
|
-
union:
|
|
3553
|
+
union: Gn,
|
|
3554
3554
|
unknown: Ln,
|
|
3555
3555
|
void: Un,
|
|
3556
3556
|
NEVER: pa,
|
|
@@ -3559,7 +3559,7 @@ var l = /* @__PURE__ */ Object.freeze({
|
|
|
3559
3559
|
ZodError: E
|
|
3560
3560
|
});
|
|
3561
3561
|
const ma = "test test test test test test test test test test test junk", za = async function(e, t) {
|
|
3562
|
-
const a = t.privateKey, r = t.mnemonic ?? ma, s = t.chain || "anvil", [{ config: i, account: o }, u] =
|
|
3562
|
+
const a = t.privateKey, r = t.mnemonic ?? ma, s = t.chain || "anvil", [{ config: i, account: o }, u] = Gt({
|
|
3563
3563
|
chain: s,
|
|
3564
3564
|
rpcUrl: t.rpcUrl,
|
|
3565
3565
|
privateKey: a,
|
|
@@ -3582,79 +3582,79 @@ const ma = "test test test test test test test test test test test junk", za = a
|
|
|
3582
3582
|
config: i,
|
|
3583
3583
|
account: o,
|
|
3584
3584
|
address: m
|
|
3585
|
-
}),
|
|
3586
|
-
if (!
|
|
3585
|
+
}), J = Nt[c];
|
|
3586
|
+
if (!J)
|
|
3587
3587
|
throw new Error(
|
|
3588
3588
|
`Unable to select a deployed BoostCore with chain ID ${c}`
|
|
3589
3589
|
);
|
|
3590
|
-
const
|
|
3590
|
+
const S = new Ot({
|
|
3591
3591
|
config: i,
|
|
3592
3592
|
account: o,
|
|
3593
|
-
address:
|
|
3593
|
+
address: J
|
|
3594
3594
|
});
|
|
3595
3595
|
if (!e.length) throw new Error("No seed provided");
|
|
3596
3596
|
const xt = await Promise.all(e.map(ya));
|
|
3597
|
-
let Ze,
|
|
3598
|
-
const
|
|
3597
|
+
let Ze, Ye;
|
|
3598
|
+
const He = [];
|
|
3599
3599
|
for (const T of xt) {
|
|
3600
3600
|
let P;
|
|
3601
3601
|
if (typeof T.budget == "string" && ze(T.budget))
|
|
3602
|
-
P =
|
|
3603
|
-
else if (Pe(
|
|
3602
|
+
P = S.ManagedBudget(T.budget);
|
|
3603
|
+
else if (Pe(Ye, T.budget) && Ze)
|
|
3604
3604
|
P = Ze;
|
|
3605
3605
|
else {
|
|
3606
3606
|
const x = {
|
|
3607
3607
|
...T.budget,
|
|
3608
|
-
authorized: [...T.budget.authorized,
|
|
3608
|
+
authorized: [...T.budget.authorized, J],
|
|
3609
3609
|
roles: [...T.budget.roles, rt.MANAGER]
|
|
3610
3610
|
};
|
|
3611
3611
|
P = await C.initialize(
|
|
3612
3612
|
crypto.randomUUID(),
|
|
3613
|
-
|
|
3614
|
-
), Ze = P,
|
|
3613
|
+
S.ManagedBudget(x)
|
|
3614
|
+
), Ze = P, Ye = T.budget;
|
|
3615
3615
|
}
|
|
3616
3616
|
const wt = T.incentives.map(async (x) => {
|
|
3617
3617
|
let $ = 0n;
|
|
3618
3618
|
switch (x.type) {
|
|
3619
3619
|
case "AllowListIncentive":
|
|
3620
|
-
return
|
|
3620
|
+
return S.AllowListIncentive(x);
|
|
3621
3621
|
case "PointsIncentive":
|
|
3622
|
-
return
|
|
3622
|
+
return S.PointsIncentive(x);
|
|
3623
3623
|
case "ERC20Incentive":
|
|
3624
3624
|
return x.strategy === Me.RAFFLE && ($ += x.reward), x.strategy === Me.POOL && ($ += x.reward * x.limit), x.shouldMintAndAllocate && await xe(P, $, x.asset, {
|
|
3625
3625
|
config: i,
|
|
3626
3626
|
account: o
|
|
3627
|
-
}),
|
|
3627
|
+
}), S.ERC20Incentive(x);
|
|
3628
3628
|
case "ERC20VariableCriteriaIncentive":
|
|
3629
3629
|
return $ += x.limit, x.shouldMintAndAllocate && await xe(P, $, x.asset, {
|
|
3630
3630
|
config: i,
|
|
3631
3631
|
account: o
|
|
3632
|
-
}),
|
|
3632
|
+
}), S.ERC20VariableCriteriaIncentive(x);
|
|
3633
3633
|
case "ERC20VariableIncentive":
|
|
3634
3634
|
return $ += x.limit, x.shouldMintAndAllocate && await xe(P, $, x.asset, {
|
|
3635
3635
|
config: i,
|
|
3636
3636
|
account: o
|
|
3637
|
-
}),
|
|
3637
|
+
}), S.ERC20VariableIncentive(x);
|
|
3638
3638
|
case "CGDAIncentive":
|
|
3639
3639
|
return $ += x.totalBudget, x.shouldMintAndAllocate && await xe(P, $, x.asset, {
|
|
3640
3640
|
config: i,
|
|
3641
3641
|
account: o
|
|
3642
|
-
}),
|
|
3642
|
+
}), S.CGDAIncentive(x);
|
|
3643
3643
|
}
|
|
3644
|
-
}), kt = await Promise.all(wt),
|
|
3644
|
+
}), kt = await Promise.all(wt), Je = {
|
|
3645
3645
|
protocolFee: T.protocolFee,
|
|
3646
3646
|
maxParticipants: T.maxParticipants,
|
|
3647
3647
|
budget: P,
|
|
3648
|
-
action:
|
|
3649
|
-
allowList: await Ma(T, { core:
|
|
3648
|
+
action: S.EventAction(T.action),
|
|
3649
|
+
allowList: await Ma(T, { core: S }),
|
|
3650
3650
|
incentives: kt
|
|
3651
3651
|
};
|
|
3652
|
-
T.validator && (
|
|
3653
|
-
const Tt = await
|
|
3654
|
-
|
|
3652
|
+
T.validator && (Je.validator = S.SignerValidator(T.validator));
|
|
3653
|
+
const Tt = await S.createBoost(Je);
|
|
3654
|
+
He.push(Tt.id.toString());
|
|
3655
3655
|
}
|
|
3656
3656
|
return {
|
|
3657
|
-
boostIds:
|
|
3657
|
+
boostIds: He
|
|
3658
3658
|
};
|
|
3659
3659
|
};
|
|
3660
3660
|
async function xe(n, e, t, a) {
|
|
@@ -3664,7 +3664,7 @@ async function xe(n, e, t, a) {
|
|
|
3664
3664
|
}
|
|
3665
3665
|
}
|
|
3666
3666
|
async function ya(n) {
|
|
3667
|
-
const e = await Ct.readFile(
|
|
3667
|
+
const e = await Ct.readFile(St.normalize(n), {
|
|
3668
3668
|
encoding: "utf8"
|
|
3669
3669
|
});
|
|
3670
3670
|
return ja.parse(JSON.parse(e));
|
|
@@ -3686,7 +3686,7 @@ const ba = l.custom(Ut, "invalid Hex payload"), w = l.string().transform((n, e)
|
|
|
3686
3686
|
}).transform((n) => {
|
|
3687
3687
|
if (n.startsWith("function"))
|
|
3688
3688
|
return Wt(qt(n));
|
|
3689
|
-
if (n.startsWith("event")) return
|
|
3689
|
+
if (n.startsWith("event")) return Ft(n);
|
|
3690
3690
|
throw new Error("unreachable");
|
|
3691
3691
|
})
|
|
3692
3692
|
), _a = l.object({
|
|
@@ -3719,11 +3719,11 @@ const ba = l.custom(Ut, "invalid Hex payload"), w = l.string().transform((n, e)
|
|
|
3719
3719
|
type: l.literal("SimpleDenyList"),
|
|
3720
3720
|
owner: w,
|
|
3721
3721
|
denied: l.array(w)
|
|
3722
|
-
}),
|
|
3722
|
+
}), Sa = l.object({
|
|
3723
3723
|
type: l.literal("SimpleAllowList"),
|
|
3724
3724
|
owner: w,
|
|
3725
3725
|
allowed: l.array(w)
|
|
3726
|
-
}),
|
|
3726
|
+
}), Ia = l.object({
|
|
3727
3727
|
type: l.literal("AllowListIncentive"),
|
|
3728
3728
|
allowList: w,
|
|
3729
3729
|
limit: l.coerce.bigint()
|
|
@@ -3776,10 +3776,10 @@ const ba = l.custom(Ut, "invalid Hex payload"), w = l.string().transform((n, e)
|
|
|
3776
3776
|
budget: l.union([w, va]),
|
|
3777
3777
|
action: l.union([w, ka]),
|
|
3778
3778
|
validator: l.union([w, Ta]).optional(),
|
|
3779
|
-
allowList: l.union([w, Ca,
|
|
3779
|
+
allowList: l.union([w, Ca, Sa]).optional(),
|
|
3780
3780
|
incentives: l.array(
|
|
3781
3781
|
l.union([
|
|
3782
|
-
|
|
3782
|
+
Ia,
|
|
3783
3783
|
Aa,
|
|
3784
3784
|
Oa,
|
|
3785
3785
|
Ea,
|
|
@@ -3832,7 +3832,7 @@ function $a({
|
|
|
3832
3832
|
signatureType: se.FUNC,
|
|
3833
3833
|
signature: "function mint(address to, uint256 amount)",
|
|
3834
3834
|
fieldIndex: 0,
|
|
3835
|
-
targetContract:
|
|
3835
|
+
targetContract: Ke,
|
|
3836
3836
|
chainid: t
|
|
3837
3837
|
},
|
|
3838
3838
|
actionSteps: [
|
|
@@ -3840,7 +3840,7 @@ function $a({
|
|
|
3840
3840
|
signature: "event Minted(address to, uint256 amount)",
|
|
3841
3841
|
signatureType: se.FUNC,
|
|
3842
3842
|
actionType: 0,
|
|
3843
|
-
targetContract:
|
|
3843
|
+
targetContract: Ke,
|
|
3844
3844
|
chainid: t,
|
|
3845
3845
|
actionParameter: {
|
|
3846
3846
|
filterType: nt.EQUAL,
|
|
@@ -3878,7 +3878,7 @@ export {
|
|
|
3878
3878
|
_a as ActionClaimantSchema,
|
|
3879
3879
|
xa as ActionStepCriteriaSchema,
|
|
3880
3880
|
wa as ActionStepSchema,
|
|
3881
|
-
|
|
3881
|
+
Ia as AllowListIncentiveSchema,
|
|
3882
3882
|
ja as BoostSeedConfigSchema,
|
|
3883
3883
|
Ra as CGDAIncentiveSchema,
|
|
3884
3884
|
Aa as ERC20IncentiveSchema,
|
|
@@ -3889,7 +3889,7 @@ export {
|
|
|
3889
3889
|
va as ManagedBudgetSchema,
|
|
3890
3890
|
Za as PointsIncentiveSchema,
|
|
3891
3891
|
Ta as SignerValidatorSchema,
|
|
3892
|
-
|
|
3892
|
+
Sa as SimpleAllowListSchema,
|
|
3893
3893
|
Ca as SimpleDenyListSchema,
|
|
3894
3894
|
$a as makeSeed,
|
|
3895
3895
|
za as seed
|