@boostxyz/cli 5.0.7 → 6.0.0-canary.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-5qPuVSlX.cjs → ccip-BlKmSKBr.cjs} +1 -1
- package/dist/{ccip-BmAT9pAw.js → ccip-D7NdwxMj.js} +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +55 -55
- package/dist/commands/deploy.cjs +14 -14
- package/dist/commands/deploy.d.ts +23 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +367 -337
- package/dist/commands/seed.cjs +1 -1
- package/dist/commands/seed.d.ts +1278 -0
- package/dist/commands/seed.d.ts.map +1 -0
- package/dist/commands/seed.js +19 -15
- package/dist/help.d.ts +3 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/seed-CEYJ5usT.cjs +35 -0
- package/dist/{seed-D3rLsa0v.js → seed-DO57WBCN.js} +7375 -7268
- package/dist/utils.d.ts +67 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/seed-BsgCaY_s.cjs +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./seed-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./seed-CEYJ5usT.cjs");function g(o,r){if(!e.isAddress(o,{strict:!1}))throw new e.InvalidAddressError({address:o});if(!e.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});return o.toLowerCase()===r.toLowerCase()}class k extends e.BaseError{constructor({callbackSelector:r,cause:s,data:c,extraData:d,sender:f,urls:a}){var i;super(s.shortMessage||"An error occurred while fetching for an offchain result.",{cause:s,metaMessages:[...s.metaMessages||[],(i=s.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(u=>` ${e.getUrl(u)}`)],` Sender: ${f}`,` Data: ${c}`,` Callback selector: ${r}`,` Extra data: ${d}`].flat(),name:"OffchainLookupError"})}}class E extends e.BaseError{constructor({result:r,url:s}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(s)}`,`Response: ${e.stringify(r)}`],name:"OffchainLookupResponseMalformedError"})}}class L extends e.BaseError{constructor({sender:r,to:s}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${s}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const b="0x556f1830",h={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function O(o,{blockNumber:r,blockTag:s,data:c,to:d}){const{args:f}=e.decodeErrorResult({data:c,abi:[h]}),[a,i,u,l,n]=f,{ccipRead:t}=o,m=t&&typeof(t==null?void 0:t.request)=="function"?t.request:y;try{if(!g(d,a))throw new L({sender:a,to:d});const p=await m({data:u,sender:a,urls:i}),{data:w}=await e.call(o,{blockNumber:r,blockTag:s,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,n])]),to:d});return w}catch(p){throw new k({callbackSelector:l,cause:p,data:c,extraData:n,sender:a,urls:i})}}async function y({data:o,sender:r,urls:s}){var d;let c=new Error("An unknown error occurred.");for(let f=0;f<s.length;f++){const a=s[f],i=a.includes("{data}")?"GET":"POST",u=i==="POST"?{data:o,sender:r}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const n=await fetch(a.replace("{sender}",r).replace("{data}",o),{body:JSON.stringify(u),headers:l,method:i});let t;if((d=n.headers.get("Content-Type"))!=null&&d.startsWith("application/json")?t=(await n.json()).data:t=await n.text(),!n.ok){c=new e.HttpRequestError({body:u,details:t!=null&&t.error?e.stringify(t.error):n.statusText,headers:n.headers,status:n.status,url:a});continue}if(!e.isHex(t)){c=new E({result:t,url:a});continue}return t}catch(n){c=new e.HttpRequestError({body:u,details:n.message,url:a})}}throw c}exports.ccipRequest=y;exports.offchainLookup=O;exports.offchainLookupAbiItem=h;exports.offchainLookupSignature=b;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as h, I as m, B as p, g as w, a as g, d as E, c as O, b, e as x, H as y, f as M } from "./seed-
|
|
1
|
+
import { i as h, I as m, B as p, g as w, a as g, d as E, c as O, b, e as x, H as y, f as M } from "./seed-DO57WBCN.js";
|
|
2
2
|
function R(r, a) {
|
|
3
3
|
if (!h(r, { strict: !1 }))
|
|
4
4
|
throw new m({ address: r });
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const w=require("node:fs/promises"),_=require("node:path"),y=require("./utils-dz3mUqTs.cjs"),S=require("./index.cjs"),N=Symbol("arg flag");class l extends Error{constructor(
|
|
2
|
+
"use strict";const w=require("node:fs/promises"),_=require("node:path"),y=require("./utils-dz3mUqTs.cjs"),S=require("./index.cjs"),N=Symbol("arg flag");class l extends Error{constructor(t,u){super(t),this.name="ArgError",this.code=u,Object.setPrototypeOf(this,l.prototype)}}function v(r,{argv:t=process.argv.slice(2),permissive:u=!1,stopAtPositional:n=!1}={}){if(!r)throw new l("argument specification object is required","ARG_CONFIG_NO_SPEC");const a={_:[]},g={},d={};for(const e of Object.keys(r)){if(!e)throw new l("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(e[0]!=="-")throw new l(`argument key must start with '-' but found: '${e}'`,"ARG_CONFIG_NONOPT_KEY");if(e.length===1)throw new l(`argument key must have a name; singular '-' keys are not allowed: ${e}`,"ARG_CONFIG_NONAME_KEY");if(typeof r[e]=="string"){g[e]=r[e];continue}let o=r[e],c=!1;if(Array.isArray(o)&&o.length===1&&typeof o[0]=="function"){const[h]=o;o=(f,i,m=[])=>(m.push(h(f,i,m[m.length-1])),m),c=h===Boolean||h[N]===!0}else if(typeof o=="function")c=o===Boolean||o[N]===!0;else throw new l(`type missing or not a function or valid array type: ${e}`,"ARG_CONFIG_VAD_TYPE");if(e[1]!=="-"&&e.length>2)throw new l(`short argument keys (with a single hyphen) must have only one character: ${e}`,"ARG_CONFIG_SHORTOPT_TOOLONG");d[e]=[o,c]}for(let e=0,o=t.length;e<o;e++){const c=t[e];if(n&&a._.length>0){a._=a._.concat(t.slice(e));break}if(c==="--"){a._=a._.concat(t.slice(e+1));break}if(c.length>1&&c[0]==="-"){const h=c[1]==="-"||c.length===2?[c]:c.slice(1).split("").map(f=>`-${f}`);for(let f=0;f<h.length;f++){const i=h[f],[m,b]=i[1]==="-"?i.split(/=(.*)/,2):[i,void 0];let s=m;for(;s in g;)s=g[s];if(!(s in d))if(u){a._.push(i);continue}else throw new l(`unknown or unexpected option: ${m}`,"ARG_UNKNOWN_OPTION");const[p,A]=d[s];if(!A&&f+1<h.length)throw new l(`option requires argument (but was followed by another short argument): ${m}`,"ARG_MISSING_REQUIRED_SHORTARG");if(A)a[s]=p(!0,s,a[s]);else if(b===void 0){if(t.length<e+2||t[e+1].length>1&&t[e+1][0]==="-"&&!(t[e+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(p===Number||typeof BigInt<"u"&&p===BigInt))){const G=m===s?"":` (alias for ${s})`;throw new l(`option requires argument: ${m}${G}`,"ARG_MISSING_REQUIRED_LONGARG")}a[s]=p(t[e+1],s,a[s]),++e}else a[s]=p(b,s,a[s])}}else a._.push(c)}return a}v.flag=r=>(r[N]=!0,r);v.COUNT=v.flag((r,t,u)=>(u||0)+1);v.ArgError=l;var $=v;const k=y.getDefaultExportFromCjs($),D="7.0.0-canary.0",T="6.0.0-canary.0",R=`
|
|
3
3
|
Deploy Boost Protocol V2, and retrieve base implementation addresses.
|
|
4
4
|
|
|
5
5
|
Usage: boost <COMMAND>
|
|
@@ -24,4 +24,4 @@ Options:
|
|
|
24
24
|
--cacheDir Path to artifact cache directory
|
|
25
25
|
--force Bypass cache for given command and configuration, re-running any tasks and re-generating cache artifacts
|
|
26
26
|
--format Specify command output format, either env or json
|
|
27
|
-
|
|
27
|
+
`,E=(r,t)=>typeof t=="bigint"?t.toString():t,O=k({"--help":Boolean,"--version":Boolean,"--chain":String,"--privateKey":String,"--mnemonic":String,"--rpcUrl":String,"--out":String,"--cacheDir":String,"--force":Boolean,"--format":String,"--from":String,"-h":"--help","-v":"--version"});async function I(){var c,h,f;const{_:r,...t}=O,u=r.at(0);if(O["--version"])return console.log(T),0;if(O["--help"])return console.log(R),0;if(!u||!S.commands[u])return console.log(R),127;const n={help:t["--help"],version:t["--version"],chain:t["--chain"],privateKey:t["--privateKey"],mnemonic:t["--mnemonic"],rpcUrl:t["--rpcUrl"],out:t["--out"],cacheDir:t["--cacheDir"],force:t["--force"],format:t["--format"]};n.format||(n.format="env");const a=(c=n.cacheDir)!=null&&c.startsWith("./")?_.resolve(process.cwd(),n.cacheDir):n.cacheDir||_.resolve(process.cwd(),"./.boost"),g=`${r.join("-")}-v${D.split(".").slice(0,2).join("-")}-${n.chain}-${n!=null&&n.privateKey?(h=n.privateKey)==null?void 0:h.slice(n.privateKey.length-5):((f=n.mnemonic)==null?void 0:f.split(" ").at(-1))||""}`,d=_.resolve(a,g);async function e(){const i=await S.commands[u](r.slice(1),n);return u==="seed"&&r.includes("generate")&&(n.format="json"),n.format==="env"?y.objectToEnv(i):JSON.stringify(i,E,2)}let o;if(n.force)o=await e();else try{o=await w.readFile(d,{encoding:"utf-8"});const i=y.validateJson(o);n.format==="json"&&i===!1&&(o=JSON.stringify(y.envToObject(o),E,2)),n.format==="env"&&i!==!1&&(o=y.objectToEnv(i))}catch(i){if(i instanceof Error&&i.message.includes("ENOENT"))o=await e();else throw i}if(typeof o==null)throw new Error("No result found after cache and command operations. This shouldn't happen.");n.out?(await w.mkdir(n.out,{recursive:!0}),await w.writeFile(n.out,o,{encoding:"utf8"}),console.log(`Succesfully wrote result to ${n.out}`)):console.log(o)}I().then((r=0)=>process.exit(r)).catch(r=>{console.error(r),process.exit(1)});
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import v from "node:fs/promises";
|
|
3
3
|
import w from "node:path";
|
|
4
|
-
import { g as
|
|
4
|
+
import { g as $, v as k, e as D, o as A } from "./utils-ClgLOuAN.js";
|
|
5
5
|
import { commands as S } from "./index.js";
|
|
6
6
|
const O = Symbol("arg flag");
|
|
7
7
|
class l extends Error {
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
8
|
+
constructor(t, u) {
|
|
9
|
+
super(t), this.name = "ArgError", this.code = u, Object.setPrototypeOf(this, l.prototype);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
function y(r, {
|
|
13
|
-
argv:
|
|
13
|
+
argv: t = process.argv.slice(2),
|
|
14
14
|
permissive: u = !1,
|
|
15
|
-
stopAtPositional:
|
|
15
|
+
stopAtPositional: o = !1
|
|
16
16
|
} = {}) {
|
|
17
17
|
if (!r)
|
|
18
18
|
throw new l(
|
|
19
19
|
"argument specification object is required",
|
|
20
20
|
"ARG_CONFIG_NO_SPEC"
|
|
21
21
|
);
|
|
22
|
-
const a = { _: [] },
|
|
22
|
+
const a = { _: [] }, g = {}, p = {};
|
|
23
23
|
for (const e of Object.keys(r)) {
|
|
24
24
|
if (!e)
|
|
25
25
|
throw new l(
|
|
@@ -37,7 +37,7 @@ function y(r, {
|
|
|
37
37
|
"ARG_CONFIG_NONAME_KEY"
|
|
38
38
|
);
|
|
39
39
|
if (typeof r[e] == "string") {
|
|
40
|
-
|
|
40
|
+
g[e] = r[e];
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
let n = r[e], c = !1;
|
|
@@ -56,16 +56,16 @@ function y(r, {
|
|
|
56
56
|
`short argument keys (with a single hyphen) must have only one character: ${e}`,
|
|
57
57
|
"ARG_CONFIG_SHORTOPT_TOOLONG"
|
|
58
58
|
);
|
|
59
|
-
|
|
59
|
+
p[e] = [n, c];
|
|
60
60
|
}
|
|
61
|
-
for (let e = 0, n =
|
|
62
|
-
const c =
|
|
63
|
-
if (
|
|
64
|
-
a._ = a._.concat(
|
|
61
|
+
for (let e = 0, n = t.length; e < n; e++) {
|
|
62
|
+
const c = t[e];
|
|
63
|
+
if (o && a._.length > 0) {
|
|
64
|
+
a._ = a._.concat(t.slice(e));
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
67
|
if (c === "--") {
|
|
68
|
-
a._ = a._.concat(
|
|
68
|
+
a._ = a._.concat(t.slice(e + 1));
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
71
|
if (c.length > 1 && c[0] === "-") {
|
|
@@ -73,9 +73,9 @@ function y(r, {
|
|
|
73
73
|
for (let f = 0; f < m.length; f++) {
|
|
74
74
|
const i = m[f], [h, N] = i[1] === "-" ? i.split(/=(.*)/, 2) : [i, void 0];
|
|
75
75
|
let s = h;
|
|
76
|
-
for (; s in
|
|
77
|
-
s =
|
|
78
|
-
if (!(s in
|
|
76
|
+
for (; s in g; )
|
|
77
|
+
s = g[s];
|
|
78
|
+
if (!(s in p))
|
|
79
79
|
if (u) {
|
|
80
80
|
a._.push(i);
|
|
81
81
|
continue;
|
|
@@ -84,7 +84,7 @@ function y(r, {
|
|
|
84
84
|
`unknown or unexpected option: ${h}`,
|
|
85
85
|
"ARG_UNKNOWN_OPTION"
|
|
86
86
|
);
|
|
87
|
-
const [d, b] =
|
|
87
|
+
const [d, b] = p[s];
|
|
88
88
|
if (!b && f + 1 < m.length)
|
|
89
89
|
throw new l(
|
|
90
90
|
`option requires argument (but was followed by another short argument): ${h}`,
|
|
@@ -93,15 +93,15 @@ function y(r, {
|
|
|
93
93
|
if (b)
|
|
94
94
|
a[s] = d(!0, s, a[s]);
|
|
95
95
|
else if (N === void 0) {
|
|
96
|
-
if (
|
|
96
|
+
if (t.length < e + 2 || t[e + 1].length > 1 && t[e + 1][0] === "-" && !(t[e + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && (d === Number || // eslint-disable-next-line no-undef
|
|
97
97
|
typeof BigInt < "u" && d === BigInt))) {
|
|
98
|
-
const
|
|
98
|
+
const E = h === s ? "" : ` (alias for ${s})`;
|
|
99
99
|
throw new l(
|
|
100
|
-
`option requires argument: ${h}${
|
|
100
|
+
`option requires argument: ${h}${E}`,
|
|
101
101
|
"ARG_MISSING_REQUIRED_LONGARG"
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
-
a[s] = d(
|
|
104
|
+
a[s] = d(t[e + 1], s, a[s]), ++e;
|
|
105
105
|
} else
|
|
106
106
|
a[s] = d(N, s, a[s]);
|
|
107
107
|
}
|
|
@@ -111,10 +111,10 @@ function y(r, {
|
|
|
111
111
|
return a;
|
|
112
112
|
}
|
|
113
113
|
y.flag = (r) => (r[O] = !0, r);
|
|
114
|
-
y.COUNT = y.flag((r,
|
|
114
|
+
y.COUNT = y.flag((r, t, u) => (u || 0) + 1);
|
|
115
115
|
y.ArgError = l;
|
|
116
|
-
var
|
|
117
|
-
const
|
|
116
|
+
var I = y;
|
|
117
|
+
const T = /* @__PURE__ */ $(I), C = "7.0.0-canary.0", P = "6.0.0-canary.0", R = `
|
|
118
118
|
Deploy Boost Protocol V2, and retrieve base implementation addresses.
|
|
119
119
|
|
|
120
120
|
Usage: boost <COMMAND>
|
|
@@ -139,11 +139,7 @@ Options:
|
|
|
139
139
|
--cacheDir Path to artifact cache directory
|
|
140
140
|
--force Bypass cache for given command and configuration, re-running any tasks and re-generating cache artifacts
|
|
141
141
|
--format Specify command output format, either env or json
|
|
142
|
-
|
|
143
|
-
BigInt.prototype.toJSON = function() {
|
|
144
|
-
return Number(this);
|
|
145
|
-
};
|
|
146
|
-
const _ = I({
|
|
142
|
+
`, G = (r, t) => typeof t == "bigint" ? t.toString() : t, _ = T({
|
|
147
143
|
"--help": Boolean,
|
|
148
144
|
"--version": Boolean,
|
|
149
145
|
"--chain": String,
|
|
@@ -158,41 +154,45 @@ const _ = I({
|
|
|
158
154
|
"-h": "--help",
|
|
159
155
|
"-v": "--version"
|
|
160
156
|
});
|
|
161
|
-
async function
|
|
157
|
+
async function j() {
|
|
162
158
|
var c, m, f;
|
|
163
|
-
const { _: r, ...
|
|
159
|
+
const { _: r, ...t } = _, u = r.at(0);
|
|
164
160
|
if (_["--version"])
|
|
165
|
-
return console.log(
|
|
161
|
+
return console.log(P), 0;
|
|
166
162
|
if (_["--help"])
|
|
167
|
-
return console.log(
|
|
163
|
+
return console.log(R), 0;
|
|
168
164
|
if (!u || !S[u])
|
|
169
|
-
return console.log(
|
|
170
|
-
const
|
|
171
|
-
help:
|
|
172
|
-
version:
|
|
173
|
-
chain:
|
|
174
|
-
privateKey:
|
|
175
|
-
mnemonic:
|
|
176
|
-
rpcUrl:
|
|
177
|
-
out:
|
|
178
|
-
cacheDir:
|
|
179
|
-
force:
|
|
180
|
-
format:
|
|
165
|
+
return console.log(R), 127;
|
|
166
|
+
const o = {
|
|
167
|
+
help: t["--help"],
|
|
168
|
+
version: t["--version"],
|
|
169
|
+
chain: t["--chain"],
|
|
170
|
+
privateKey: t["--privateKey"],
|
|
171
|
+
mnemonic: t["--mnemonic"],
|
|
172
|
+
rpcUrl: t["--rpcUrl"],
|
|
173
|
+
out: t["--out"],
|
|
174
|
+
cacheDir: t["--cacheDir"],
|
|
175
|
+
force: t["--force"],
|
|
176
|
+
format: t["--format"]
|
|
181
177
|
};
|
|
182
|
-
|
|
183
|
-
const a = (c =
|
|
178
|
+
o.format || (o.format = "env");
|
|
179
|
+
const a = (c = o.cacheDir) != null && c.startsWith("./") ? w.resolve(process.cwd(), o.cacheDir) : o.cacheDir || w.resolve(process.cwd(), "./.boost"), g = `${r.join("-")}-v${C.split(".").slice(0, 2).join("-")}-${o.chain}-${o != null && o.privateKey ? (m = o.privateKey) == null ? void 0 : m.slice(o.privateKey.length - 5) : ((f = o.mnemonic) == null ? void 0 : f.split(" ").at(-1)) || ""}`, p = w.resolve(a, g);
|
|
184
180
|
async function e() {
|
|
185
|
-
const i = await S[u](r.slice(1),
|
|
186
|
-
return u === "seed" && r.includes("generate") && (
|
|
181
|
+
const i = await S[u](r.slice(1), o);
|
|
182
|
+
return u === "seed" && r.includes("generate") && (o.format = "json"), o.format === "env" ? A(i) : JSON.stringify(i, G, 2);
|
|
187
183
|
}
|
|
188
184
|
let n;
|
|
189
|
-
if (
|
|
185
|
+
if (o.force)
|
|
190
186
|
n = await e();
|
|
191
187
|
else
|
|
192
188
|
try {
|
|
193
|
-
n = await v.readFile(
|
|
194
|
-
const i =
|
|
195
|
-
|
|
189
|
+
n = await v.readFile(p, { encoding: "utf-8" });
|
|
190
|
+
const i = k(n);
|
|
191
|
+
o.format === "json" && i === !1 && (n = JSON.stringify(
|
|
192
|
+
D(n),
|
|
193
|
+
G,
|
|
194
|
+
2
|
|
195
|
+
)), o.format === "env" && i !== !1 && (n = A(i));
|
|
196
196
|
} catch (i) {
|
|
197
197
|
if (i instanceof Error && i.message.includes("ENOENT"))
|
|
198
198
|
n = await e();
|
|
@@ -202,8 +202,8 @@ async function P() {
|
|
|
202
202
|
throw new Error(
|
|
203
203
|
"No result found after cache and command operations. This shouldn't happen."
|
|
204
204
|
);
|
|
205
|
-
|
|
205
|
+
o.out ? (await v.mkdir(o.out, { recursive: !0 }), await v.writeFile(o.out, n, { encoding: "utf8" }), console.log(`Succesfully wrote result to ${o.out}`)) : console.log(n);
|
|
206
206
|
}
|
|
207
|
-
|
|
207
|
+
j().then((r = 0) => process.exit(r)).catch((r) => {
|
|
208
208
|
console.error(r), process.exit(1);
|
|
209
209
|
});
|