@boostxyz/cli 5.0.6 → 5.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./seed-BsgCaY_s.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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./seed-BtP-9KaP.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-D3rLsa0v.js";
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-DyYeHsUg.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(o,u){super(o),this.name="ArgError",this.code=u,Object.setPrototypeOf(this,l.prototype)}}function v(r,{argv:o=process.argv.slice(2),permissive:u=!1,stopAtPositional:t=!1}={}){if(!r)throw new l("argument specification object is required","ARG_CONFIG_NO_SPEC");const a={_:[]},d={},g={};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"){d[e]=r[e];continue}let n=r[e],c=!1;if(Array.isArray(n)&&n.length===1&&typeof n[0]=="function"){const[h]=n;n=(f,i,m=[])=>(m.push(h(f,i,m[m.length-1])),m),c=h===Boolean||h[N]===!0}else if(typeof n=="function")c=n===Boolean||n[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");g[e]=[n,c]}for(let e=0,n=o.length;e<n;e++){const c=o[e];if(t&&a._.length>0){a._=a._.concat(o.slice(e));break}if(c==="--"){a._=a._.concat(o.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 d;)s=d[s];if(!(s in g))if(u){a._.push(i);continue}else throw new l(`unknown or unexpected option: ${m}`,"ARG_UNKNOWN_OPTION");const[p,A]=g[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(o.length<e+2||o[e+1].length>1&&o[e+1][0]==="-"&&!(o[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(o[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,o,u)=>(u||0)+1);v.ArgError=l;var R=v;const $=y.getDefaultExportFromCjs(R),k="6.1.2",D="5.0.6",E=`
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:o=!1}={}){if(!r)throw new l("argument specification object is required","ARG_CONFIG_NO_SPEC");const s={_:[]},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 n=r[e],c=!1;if(Array.isArray(n)&&n.length===1&&typeof n[0]=="function"){const[h]=n;n=(f,i,m=[])=>(m.push(h(f,i,m[m.length-1])),m),c=h===Boolean||h[N]===!0}else if(typeof n=="function")c=n===Boolean||n[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]=[n,c]}for(let e=0,n=t.length;e<n;e++){const c=t[e];if(o&&s._.length>0){s._=s._.concat(t.slice(e));break}if(c==="--"){s._=s._.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 a=m;for(;a in g;)a=g[a];if(!(a in d))if(u){s._.push(i);continue}else throw new l(`unknown or unexpected option: ${m}`,"ARG_UNKNOWN_OPTION");const[p,A]=d[a];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)s[a]=p(!0,a,s[a]);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===a?"":` (alias for ${a})`;throw new l(`option requires argument: ${m}${G}`,"ARG_MISSING_REQUIRED_LONGARG")}s[a]=p(t[e+1],a,s[a]),++e}else s[a]=p(b,a,s[a])}}else s._.push(c)}return s}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="6.1.3",T="5.1.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
- `;BigInt.prototype.toJSON=function(){return Number(this)};const O=$({"--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,...o}=O,u=r.at(0);if(O["--version"])return console.log(D),0;if(O["--help"])return console.log(E),0;if(!u||!S.commands[u])return console.log(E),127;const t={help:o["--help"],version:o["--version"],chain:o["--chain"],privateKey:o["--privateKey"],mnemonic:o["--mnemonic"],rpcUrl:o["--rpcUrl"],out:o["--out"],cacheDir:o["--cacheDir"],force:o["--force"],format:o["--format"]};t.format||(t.format="env");const a=(c=t.cacheDir)!=null&&c.startsWith("./")?_.resolve(process.cwd(),t.cacheDir):t.cacheDir||_.resolve(process.cwd(),"./.boost"),d=`${r.join("-")}-v${k.split(".").slice(0,2).join("-")}-${t.chain}-${t!=null&&t.privateKey?(h=t.privateKey)==null?void 0:h.slice(t.privateKey.length-5):((f=t.mnemonic)==null?void 0:f.split(" ").at(-1))||""}`,g=_.resolve(a,d);async function e(){const i=await S.commands[u](r.slice(1),t);return u==="seed"&&r.includes("generate")&&(t.format="json"),t.format==="env"?y.objectToEnv(i):JSON.stringify(i,null,2)}let n;if(t.force)n=await e();else try{n=await w.readFile(g,{encoding:"utf-8"});const i=y.validateJson(n);t.format==="json"&&i===!1&&(n=JSON.stringify(y.envToObject(n),null,2)),t.format==="env"&&i!==!1&&(n=y.objectToEnv(i))}catch(i){if(i instanceof Error&&i.message.includes("ENOENT"))n=await e();else throw i}if(typeof n==null)throw new Error("No result found after cache and command operations. This shouldn't happen.");t.out?(await w.mkdir(t.out,{recursive:!0}),await w.writeFile(t.out,n,{encoding:"utf8"}),console.log(`Succesfully wrote result to ${t.out}`)):console.log(n)}I().then((r=0)=>process.exit(r)).catch(r=>{console.error(r),process.exit(1)});
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 o={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"]};o.format||(o.format="env");const s=(c=o.cacheDir)!=null&&c.startsWith("./")?_.resolve(process.cwd(),o.cacheDir):o.cacheDir||_.resolve(process.cwd(),"./.boost"),g=`${r.join("-")}-v${D.split(".").slice(0,2).join("-")}-${o.chain}-${o!=null&&o.privateKey?(h=o.privateKey)==null?void 0:h.slice(o.privateKey.length-5):((f=o.mnemonic)==null?void 0:f.split(" ").at(-1))||""}`,d=_.resolve(s,g);async function e(){const i=await S.commands[u](r.slice(1),o);return u==="seed"&&r.includes("generate")&&(o.format="json"),o.format==="env"?y.objectToEnv(i):JSON.stringify(i,E,2)}let n;if(o.force)n=await e();else try{n=await w.readFile(d,{encoding:"utf-8"});const i=y.validateJson(n);o.format==="json"&&i===!1&&(n=JSON.stringify(y.envToObject(n),E,2)),o.format==="env"&&i!==!1&&(n=y.objectToEnv(i))}catch(i){if(i instanceof Error&&i.message.includes("ENOENT"))n=await e();else throw i}if(typeof n==null)throw new Error("No result found after cache and command operations. This shouldn't happen.");o.out?(await w.mkdir(o.out,{recursive:!0}),await w.writeFile(o.out,n,{encoding:"utf8"}),console.log(`Succesfully wrote result to ${o.out}`)):console.log(n)}I().then((r=0)=>process.exit(r)).catch(r=>{console.error(r),process.exit(1)});
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -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 E, v as $, e as k, o as A } from "./utils-ClgLOuAN.js";
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(o, u) {
9
- super(o), this.name = "ArgError", this.code = u, Object.setPrototypeOf(this, l.prototype);
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: o = process.argv.slice(2),
13
+ argv: t = process.argv.slice(2),
14
14
  permissive: u = !1,
15
- stopAtPositional: t = !1
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 = { _: [] }, p = {}, g = {};
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
- p[e] = r[e];
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
- g[e] = [n, c];
59
+ p[e] = [n, c];
60
60
  }
61
- for (let e = 0, n = o.length; e < n; e++) {
62
- const c = o[e];
63
- if (t && a._.length > 0) {
64
- a._ = a._.concat(o.slice(e));
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(o.slice(e + 1));
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 p; )
77
- s = p[s];
78
- if (!(s in g))
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] = g[s];
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 (o.length < e + 2 || o[e + 1].length > 1 && o[e + 1][0] === "-" && !(o[e + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && (d === Number || // eslint-disable-next-line no-undef
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 R = h === s ? "" : ` (alias for ${s})`;
98
+ const E = h === s ? "" : ` (alias for ${s})`;
99
99
  throw new l(
100
- `option requires argument: ${h}${R}`,
100
+ `option requires argument: ${h}${E}`,
101
101
  "ARG_MISSING_REQUIRED_LONGARG"
102
102
  );
103
103
  }
104
- a[s] = d(o[e + 1], s, a[s]), ++e;
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, o, u) => (u || 0) + 1);
114
+ y.COUNT = y.flag((r, t, u) => (u || 0) + 1);
115
115
  y.ArgError = l;
116
- var D = y;
117
- const I = /* @__PURE__ */ E(D), T = "6.1.2", C = "5.0.6", G = `
116
+ var I = y;
117
+ const T = /* @__PURE__ */ $(I), C = "6.1.3", P = "5.1.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 P() {
157
+ async function j() {
162
158
  var c, m, f;
163
- const { _: r, ...o } = _, u = r.at(0);
159
+ const { _: r, ...t } = _, u = r.at(0);
164
160
  if (_["--version"])
165
- return console.log(C), 0;
161
+ return console.log(P), 0;
166
162
  if (_["--help"])
167
- return console.log(G), 0;
163
+ return console.log(R), 0;
168
164
  if (!u || !S[u])
169
- return console.log(G), 127;
170
- const t = {
171
- help: o["--help"],
172
- version: o["--version"],
173
- chain: o["--chain"],
174
- privateKey: o["--privateKey"],
175
- mnemonic: o["--mnemonic"],
176
- rpcUrl: o["--rpcUrl"],
177
- out: o["--out"],
178
- cacheDir: o["--cacheDir"],
179
- force: o["--force"],
180
- format: o["--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
- t.format || (t.format = "env");
183
- const a = (c = t.cacheDir) != null && c.startsWith("./") ? w.resolve(process.cwd(), t.cacheDir) : t.cacheDir || w.resolve(process.cwd(), "./.boost"), p = `${r.join("-")}-v${T.split(".").slice(0, 2).join("-")}-${t.chain}-${t != null && t.privateKey ? (m = t.privateKey) == null ? void 0 : m.slice(t.privateKey.length - 5) : ((f = t.mnemonic) == null ? void 0 : f.split(" ").at(-1)) || ""}`, g = w.resolve(a, p);
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), t);
186
- return u === "seed" && r.includes("generate") && (t.format = "json"), t.format === "env" ? A(i) : JSON.stringify(i, null, 2);
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 (t.force)
185
+ if (o.force)
190
186
  n = await e();
191
187
  else
192
188
  try {
193
- n = await v.readFile(g, { encoding: "utf-8" });
194
- const i = $(n);
195
- t.format === "json" && i === !1 && (n = JSON.stringify(k(n), null, 2)), t.format === "env" && i !== !1 && (n = A(i));
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
- t.out ? (await v.mkdir(t.out, { recursive: !0 }), await v.writeFile(t.out, n, { encoding: "utf8" }), console.log(`Succesfully wrote result to ${t.out}`)) : console.log(n);
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
- P().then((r = 0) => process.exit(r)).catch((r) => {
207
+ j().then((r = 0) => process.exit(r)).catch((r) => {
208
208
  console.error(r), process.exit(1);
209
209
  });