@boostxyz/cli 6.2.2 → 7.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./seed-mbu5bso2.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-ioJnqELC.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-EKNHYsdS.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-D845jBIl.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(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="7.8.0",T="6.2.2",R=`
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="8.0.0-canary.0",T="7.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
- `,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)});
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.js CHANGED
@@ -114,7 +114,7 @@ y.flag = (r) => (r[O] = !0, r);
114
114
  y.COUNT = y.flag((r, t, u) => (u || 0) + 1);
115
115
  y.ArgError = l;
116
116
  var I = y;
117
- const T = /* @__PURE__ */ $(I), C = "7.8.0", P = "6.2.2", R = `
117
+ const T = /* @__PURE__ */ $(I), C = "8.0.0-canary.0", P = "7.0.0-canary.0", R = `
118
118
  Deploy Boost Protocol V2, and retrieve base implementation addresses.
119
119
 
120
120
  Usage: boost <COMMAND>