@boostxyz/cli 7.0.0 → 7.0.2
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-BN7gY2C0.js +239 -0
- package/dist/ccip-Cg-IYyJw.cjs +1 -0
- package/dist/ccip-DbO2zGlz.cjs +1 -0
- package/dist/{ccip-D-TTnaIp.js → ccip-Dj5XDCKt.js} +52 -49
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +2 -2
- package/dist/commands/deploy.cjs +13 -14
- package/dist/commands/deploy.js +1699 -1570
- package/dist/commands/seed.cjs +1 -1
- package/dist/commands/seed.js +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/seed-C_yVUARN.cjs +38 -0
- package/dist/{seed-Dq5rIA2E.js → seed-Qm19Cx2B.js} +5197 -4643
- package/dist/utils-BTtae95l.cjs +51 -0
- package/dist/{utils-ClgLOuAN.js → utils-godznAAS.js} +14927 -8068
- package/dist/utils.d.ts +4 -4
- package/dist/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/ccip-BZMQ5y3q.js +0 -153
- package/dist/ccip-CovqiIHj.cjs +0 -1
- package/dist/ccip-h61XKzWe.cjs +0 -1
- package/dist/seed-CHyq3tBu.cjs +0 -35
- package/dist/utils-dz3mUqTs.cjs +0 -48
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { a as b, t as x, f as F, A as I, d as C, g as M, b as E, c as D, e as w, h as G, i as A, j as T, I as v, k as m, l as H, m as R, n as k, B as y, o as N, p as P, q as j, r as B, u as U, H as L, v as _ } from "./seed-Qm19Cx2B.js";
|
|
2
|
+
function J(e) {
|
|
3
|
+
const { abi: s, data: a } = e, r = b(a, 0, 4), t = s.find((o) => o.type === "function" && r === x(F(o)));
|
|
4
|
+
if (!t)
|
|
5
|
+
throw new I(r, {
|
|
6
|
+
docsPath: "/docs/contract/decodeFunctionData"
|
|
7
|
+
});
|
|
8
|
+
return {
|
|
9
|
+
functionName: t.name,
|
|
10
|
+
args: "inputs" in t && t.inputs && t.inputs.length > 0 ? C(t.inputs, b(a, 4)) : void 0
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const p = "/docs/contract/encodeErrorResult";
|
|
14
|
+
function O(e) {
|
|
15
|
+
const { abi: s, errorName: a, args: r } = e;
|
|
16
|
+
let t = s[0];
|
|
17
|
+
if (a) {
|
|
18
|
+
const u = M({ abi: s, args: r, name: a });
|
|
19
|
+
if (!u)
|
|
20
|
+
throw new E(a, { docsPath: p });
|
|
21
|
+
t = u;
|
|
22
|
+
}
|
|
23
|
+
if (t.type !== "error")
|
|
24
|
+
throw new E(void 0, { docsPath: p });
|
|
25
|
+
const o = F(t), n = x(o);
|
|
26
|
+
let c = "0x";
|
|
27
|
+
if (r && r.length > 0) {
|
|
28
|
+
if (!t.inputs)
|
|
29
|
+
throw new D(t.name, { docsPath: p });
|
|
30
|
+
c = w(t.inputs, r);
|
|
31
|
+
}
|
|
32
|
+
return G([n, c]);
|
|
33
|
+
}
|
|
34
|
+
const h = "/docs/contract/encodeFunctionResult";
|
|
35
|
+
function W(e) {
|
|
36
|
+
const { abi: s, functionName: a, result: r } = e;
|
|
37
|
+
let t = s[0];
|
|
38
|
+
if (a) {
|
|
39
|
+
const n = M({ abi: s, name: a });
|
|
40
|
+
if (!n)
|
|
41
|
+
throw new A(a, { docsPath: h });
|
|
42
|
+
t = n;
|
|
43
|
+
}
|
|
44
|
+
if (t.type !== "function")
|
|
45
|
+
throw new A(void 0, { docsPath: h });
|
|
46
|
+
if (!t.outputs)
|
|
47
|
+
throw new T(t.name, { docsPath: h });
|
|
48
|
+
const o = (() => {
|
|
49
|
+
if (t.outputs.length === 0)
|
|
50
|
+
return [];
|
|
51
|
+
if (t.outputs.length === 1)
|
|
52
|
+
return [r];
|
|
53
|
+
if (Array.isArray(r))
|
|
54
|
+
return r;
|
|
55
|
+
throw new v(r);
|
|
56
|
+
})();
|
|
57
|
+
return w(t.outputs, o);
|
|
58
|
+
}
|
|
59
|
+
const q = "x-batch-gateway:true";
|
|
60
|
+
async function S(e) {
|
|
61
|
+
const { data: s, ccipRequest: a } = e, { args: [r] } = J({ abi: m, data: s }), t = [], o = [];
|
|
62
|
+
return await Promise.all(r.map(async (n, c) => {
|
|
63
|
+
try {
|
|
64
|
+
o[c] = n.urls.includes(q) ? await S({ data: n.data, ccipRequest: a }) : await a(n), t[c] = !1;
|
|
65
|
+
} catch (u) {
|
|
66
|
+
t[c] = !0, o[c] = z(u);
|
|
67
|
+
}
|
|
68
|
+
})), W({
|
|
69
|
+
abi: m,
|
|
70
|
+
functionName: "query",
|
|
71
|
+
result: [t, o]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function z(e) {
|
|
75
|
+
return e.name === "HttpRequestError" && e.status ? O({
|
|
76
|
+
abi: m,
|
|
77
|
+
errorName: "HttpError",
|
|
78
|
+
args: [e.status, e.shortMessage]
|
|
79
|
+
}) : O({
|
|
80
|
+
abi: [H],
|
|
81
|
+
errorName: "Error",
|
|
82
|
+
args: ["shortMessage" in e ? e.shortMessage : e.message]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function K(e, s) {
|
|
86
|
+
if (!R(e, { strict: !1 }))
|
|
87
|
+
throw new k({ address: e });
|
|
88
|
+
if (!R(s, { strict: !1 }))
|
|
89
|
+
throw new k({ address: s });
|
|
90
|
+
return e.toLowerCase() === s.toLowerCase();
|
|
91
|
+
}
|
|
92
|
+
class Q extends y {
|
|
93
|
+
constructor({ callbackSelector: s, cause: a, data: r, extraData: t, sender: o, urls: n }) {
|
|
94
|
+
var c;
|
|
95
|
+
super(a.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
96
|
+
cause: a,
|
|
97
|
+
metaMessages: [
|
|
98
|
+
...a.metaMessages || [],
|
|
99
|
+
(c = a.metaMessages) != null && c.length ? "" : [],
|
|
100
|
+
"Offchain Gateway Call:",
|
|
101
|
+
n && [
|
|
102
|
+
" Gateway URL(s):",
|
|
103
|
+
...n.map((u) => ` ${N(u)}`)
|
|
104
|
+
],
|
|
105
|
+
` Sender: ${o}`,
|
|
106
|
+
` Data: ${r}`,
|
|
107
|
+
` Callback selector: ${s}`,
|
|
108
|
+
` Extra data: ${t}`
|
|
109
|
+
].flat(),
|
|
110
|
+
name: "OffchainLookupError"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
class V extends y {
|
|
115
|
+
constructor({ result: s, url: a }) {
|
|
116
|
+
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
117
|
+
metaMessages: [
|
|
118
|
+
`Gateway URL: ${N(a)}`,
|
|
119
|
+
`Response: ${P(s)}`
|
|
120
|
+
],
|
|
121
|
+
name: "OffchainLookupResponseMalformedError"
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
class X extends y {
|
|
126
|
+
constructor({ sender: s, to: a }) {
|
|
127
|
+
super("Reverted sender address does not match target contract address (`to`).", {
|
|
128
|
+
metaMessages: [
|
|
129
|
+
`Contract address: ${a}`,
|
|
130
|
+
`OffchainLookup sender address: ${s}`
|
|
131
|
+
],
|
|
132
|
+
name: "OffchainLookupSenderMismatchError"
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const et = "0x556f1830", Y = {
|
|
137
|
+
name: "OffchainLookup",
|
|
138
|
+
type: "error",
|
|
139
|
+
inputs: [
|
|
140
|
+
{
|
|
141
|
+
name: "sender",
|
|
142
|
+
type: "address"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "urls",
|
|
146
|
+
type: "string[]"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "callData",
|
|
150
|
+
type: "bytes"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "callbackFunction",
|
|
154
|
+
type: "bytes4"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "extraData",
|
|
158
|
+
type: "bytes"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
};
|
|
162
|
+
async function at(e, { blockNumber: s, blockTag: a, data: r, to: t }) {
|
|
163
|
+
const { args: o } = j({
|
|
164
|
+
data: r,
|
|
165
|
+
abi: [Y]
|
|
166
|
+
}), [n, c, u, f, d] = o, { ccipRead: i } = e, g = i && typeof (i == null ? void 0 : i.request) == "function" ? i.request : Z;
|
|
167
|
+
try {
|
|
168
|
+
if (!K(t, n))
|
|
169
|
+
throw new X({ sender: n, to: t });
|
|
170
|
+
const l = c.includes(q) ? await S({
|
|
171
|
+
data: u,
|
|
172
|
+
ccipRequest: g
|
|
173
|
+
}) : await g({ data: u, sender: n, urls: c }), { data: $ } = await B(e, {
|
|
174
|
+
blockNumber: s,
|
|
175
|
+
blockTag: a,
|
|
176
|
+
data: U([
|
|
177
|
+
f,
|
|
178
|
+
w([{ type: "bytes" }, { type: "bytes" }], [l, d])
|
|
179
|
+
]),
|
|
180
|
+
to: t
|
|
181
|
+
});
|
|
182
|
+
return $;
|
|
183
|
+
} catch (l) {
|
|
184
|
+
throw new Q({
|
|
185
|
+
callbackSelector: f,
|
|
186
|
+
cause: l,
|
|
187
|
+
data: r,
|
|
188
|
+
extraData: d,
|
|
189
|
+
sender: n,
|
|
190
|
+
urls: c
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async function Z({ data: e, sender: s, urls: a }) {
|
|
195
|
+
var t;
|
|
196
|
+
let r = new Error("An unknown error occurred.");
|
|
197
|
+
for (let o = 0; o < a.length; o++) {
|
|
198
|
+
const n = a[o], c = n.includes("{data}") ? "GET" : "POST", u = c === "POST" ? { data: e, sender: s } : void 0, f = c === "POST" ? { "Content-Type": "application/json" } : {};
|
|
199
|
+
try {
|
|
200
|
+
const d = await fetch(n.replace("{sender}", s.toLowerCase()).replace("{data}", e), {
|
|
201
|
+
body: JSON.stringify(u),
|
|
202
|
+
headers: f,
|
|
203
|
+
method: c
|
|
204
|
+
});
|
|
205
|
+
let i;
|
|
206
|
+
if ((t = d.headers.get("Content-Type")) != null && t.startsWith("application/json") ? i = (await d.json()).data : i = await d.text(), !d.ok) {
|
|
207
|
+
r = new L({
|
|
208
|
+
body: u,
|
|
209
|
+
details: i != null && i.error ? P(i.error) : d.statusText,
|
|
210
|
+
headers: d.headers,
|
|
211
|
+
status: d.status,
|
|
212
|
+
url: n
|
|
213
|
+
});
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
if (!_(i)) {
|
|
217
|
+
r = new V({
|
|
218
|
+
result: i,
|
|
219
|
+
url: n
|
|
220
|
+
});
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
return i;
|
|
224
|
+
} catch (d) {
|
|
225
|
+
r = new L({
|
|
226
|
+
body: u,
|
|
227
|
+
details: d.message,
|
|
228
|
+
url: n
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
throw r;
|
|
233
|
+
}
|
|
234
|
+
export {
|
|
235
|
+
Z as ccipRequest,
|
|
236
|
+
at as offchainLookup,
|
|
237
|
+
Y as offchainLookupAbiItem,
|
|
238
|
+
et as offchainLookupSignature
|
|
239
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./seed-C_yVUARN.cjs");function k(r){const{abi:n,data:a}=r,o=e.slice(a,0,4),t=n.find(c=>c.type==="function"&&o===e.toFunctionSelector(e.formatAbiItem(c)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(o,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(a,4)):void 0}}const h="/docs/contract/encodeErrorResult";function y(r){const{abi:n,errorName:a,args:o}=r;let t=n[0];if(a){const d=e.getAbiItem({abi:n,args:o,name:a});if(!d)throw new e.AbiErrorNotFoundError(a,{docsPath:h});t=d}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:h});const c=e.formatAbiItem(t),s=e.toFunctionSelector(c);let i="0x";if(o&&o.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:h});i=e.encodeAbiParameters(t.inputs,o)}return e.concatHex([s,i])}const m="/docs/contract/encodeFunctionResult";function L(r){const{abi:n,functionName:a,result:o}=r;let t=n[0];if(a){const s=e.getAbiItem({abi:n,name:a});if(!s)throw new e.AbiFunctionNotFoundError(a,{docsPath:m});t=s}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:m});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:m});const c=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[o];if(Array.isArray(o))return o;throw new e.InvalidArrayError(o)})();return e.encodeAbiParameters(t.outputs,c)}const b="x-batch-gateway:true";async function g(r){const{data:n,ccipRequest:a}=r,{args:[o]}=k({abi:e.batchGatewayAbi,data:n}),t=[],c=[];return await Promise.all(o.map(async(s,i)=>{try{c[i]=s.urls.includes(b)?await g({data:s.data,ccipRequest:a}):await a(s),t[i]=!1}catch(d){t[i]=!0,c[i]=F(d)}})),L({abi:e.batchGatewayAbi,functionName:"query",result:[t,c]})}function F(r){return r.name==="HttpRequestError"&&r.status?y({abi:e.batchGatewayAbi,errorName:"HttpError",args:[r.status,r.shortMessage]}):y({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in r?r.shortMessage:r.message]})}function O(r,n){if(!e.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});if(!e.isAddress(n,{strict:!1}))throw new e.InvalidAddressError({address:n});return r.toLowerCase()===n.toLowerCase()}class P extends e.BaseError{constructor({callbackSelector:n,cause:a,data:o,extraData:t,sender:c,urls:s}){var i;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(i=a.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(d=>` ${e.getUrl(d)}`)],` Sender: ${c}`,` Data: ${o}`,` Callback selector: ${n}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class S extends e.BaseError{constructor({result:n,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify(n)}`],name:"OffchainLookupResponseMalformedError"})}}class M extends e.BaseError{constructor({sender:n,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${n}`],name:"OffchainLookupSenderMismatchError"})}}const N="0x556f1830",E={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 q(r,{blockNumber:n,blockTag:a,data:o,to:t}){const{args:c}=e.decodeErrorResult({data:o,abi:[E]}),[s,i,d,l,f]=c,{ccipRead:u}=r,w=u&&typeof(u==null?void 0:u.request)=="function"?u.request:A;try{if(!O(t,s))throw new M({sender:s,to:t});const p=i.includes(b)?await g({data:d,ccipRequest:w}):await w({data:d,sender:s,urls:i}),{data:R}=await e.call(r,{blockNumber:n,blockTag:a,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,f])]),to:t});return R}catch(p){throw new P({callbackSelector:l,cause:p,data:o,extraData:f,sender:s,urls:i})}}async function A({data:r,sender:n,urls:a}){var t;let o=new Error("An unknown error occurred.");for(let c=0;c<a.length;c++){const s=a[c],i=s.includes("{data}")?"GET":"POST",d=i==="POST"?{data:r,sender:n}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const f=await fetch(s.replace("{sender}",n.toLowerCase()).replace("{data}",r),{body:JSON.stringify(d),headers:l,method:i});let u;if((t=f.headers.get("Content-Type"))!=null&&t.startsWith("application/json")?u=(await f.json()).data:u=await f.text(),!f.ok){o=new e.HttpRequestError({body:d,details:u!=null&&u.error?e.stringify(u.error):f.statusText,headers:f.headers,status:f.status,url:s});continue}if(!e.isHex(u)){o=new S({result:u,url:s});continue}return u}catch(f){o=new e.HttpRequestError({body:d,details:f.message,url:s})}}throw o}exports.ccipRequest=A;exports.offchainLookup=q;exports.offchainLookupAbiItem=E;exports.offchainLookupSignature=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils-BTtae95l.cjs");class w extends e.BaseError$1{constructor({callbackSelector:o,cause:a,data:c,extraData:u,sender:d,urls:r}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(f=>` ${e.getUrl(f)}`)],` Sender: ${d}`,` Data: ${c}`,` Callback selector: ${o}`,` Extra data: ${u}`].flat(),name:"OffchainLookupError"})}}class k extends e.BaseError$1{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify$1(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends e.BaseError$1{constructor({sender:o,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const L="0x556f1830",y={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 $(i,{blockNumber:o,blockTag:a,data:c,to:u}){const{args:d}=e.decodeErrorResult({data:c,abi:[y]}),[r,n,f,l,s]=d,{ccipRead:t}=i,h=t&&typeof(t==null?void 0:t.request)=="function"?t.request:m;try{if(!e.isAddressEqual(u,r))throw new b({sender:r,to:u});const p=n.includes(e.localBatchGatewayUrl)?await e.localBatchGatewayRequest({data:f,ccipRequest:h}):await h({data:f,sender:r,urls:n}),{data:g}=await e.call(i,{blockNumber:o,blockTag:a,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,s])]),to:u});return g}catch(p){throw new w({callbackSelector:l,cause:p,data:c,extraData:s,sender:r,urls:n})}}async function m({data:i,sender:o,urls:a}){var u;let c=new Error("An unknown error occurred.");for(let d=0;d<a.length;d++){const r=a[d],n=r.includes("{data}")?"GET":"POST",f=n==="POST"?{data:i,sender:o}:void 0,l=n==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o.toLowerCase()).replace("{data}",i),{body:JSON.stringify(f),headers:l,method:n});let t;if((u=s.headers.get("Content-Type"))!=null&&u.startsWith("application/json")?t=(await s.json()).data:t=await s.text(),!s.ok){c=new e.HttpRequestError$1({body:f,details:t!=null&&t.error?e.stringify$1(t.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!e.isHex$1(t)){c=new k({result:t,url:r});continue}return t}catch(s){c=new e.HttpRequestError$1({body:f,details:s.message,url:r})}}throw c}exports.ccipRequest=m;exports.offchainLookup=$;exports.offchainLookupAbiItem=y;exports.offchainLookupSignature=L;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
class
|
|
3
|
-
constructor({ callbackSelector: r, cause: a, data:
|
|
4
|
-
var
|
|
1
|
+
import { ab as p, al as y, am as w, an as k, ao as b, ap as L, aq as O, ar as E, as as x, at as R, au as m, af as M } from "./utils-godznAAS.js";
|
|
2
|
+
class q extends p {
|
|
3
|
+
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
4
|
+
var o;
|
|
5
5
|
super(a.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
6
6
|
cause: a,
|
|
7
7
|
metaMessages: [
|
|
8
8
|
...a.metaMessages || [],
|
|
9
|
-
(
|
|
9
|
+
(o = a.metaMessages) != null && o.length ? "" : [],
|
|
10
10
|
"Offchain Gateway Call:",
|
|
11
11
|
t && [
|
|
12
12
|
" Gateway URL(s):",
|
|
13
|
-
...t.map((
|
|
13
|
+
...t.map((d) => ` ${y(d)}`)
|
|
14
14
|
],
|
|
15
|
-
` Sender: ${
|
|
16
|
-
` Data: ${
|
|
15
|
+
` Sender: ${f}`,
|
|
16
|
+
` Data: ${n}`,
|
|
17
17
|
` Callback selector: ${r}`,
|
|
18
18
|
` Extra data: ${i}`
|
|
19
19
|
].flat(),
|
|
@@ -21,18 +21,18 @@ class M extends l {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class S extends p {
|
|
25
25
|
constructor({ result: r, url: a }) {
|
|
26
26
|
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
27
27
|
metaMessages: [
|
|
28
|
-
`Gateway URL: ${
|
|
29
|
-
`Response: ${
|
|
28
|
+
`Gateway URL: ${y(a)}`,
|
|
29
|
+
`Response: ${w(r)}`
|
|
30
30
|
],
|
|
31
31
|
name: "OffchainLookupResponseMalformedError"
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
class
|
|
35
|
+
class $ extends p {
|
|
36
36
|
constructor({ sender: r, to: a }) {
|
|
37
37
|
super("Reverted sender address does not match target contract address (`to`).", {
|
|
38
38
|
metaMessages: [
|
|
@@ -43,7 +43,7 @@ class S extends l {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const A = "0x556f1830",
|
|
46
|
+
const A = "0x556f1830", T = {
|
|
47
47
|
name: "OffchainLookup",
|
|
48
48
|
type: "error",
|
|
49
49
|
inputs: [
|
|
@@ -69,59 +69,62 @@ const A = "0x556f1830", $ = {
|
|
|
69
69
|
}
|
|
70
70
|
]
|
|
71
71
|
};
|
|
72
|
-
async function
|
|
73
|
-
const { args:
|
|
74
|
-
data:
|
|
75
|
-
abi: [
|
|
76
|
-
}), [t,
|
|
72
|
+
async function D(c, { blockNumber: r, blockTag: a, data: n, to: i }) {
|
|
73
|
+
const { args: f } = k({
|
|
74
|
+
data: n,
|
|
75
|
+
abi: [T]
|
|
76
|
+
}), [t, o, d, l, s] = f, { ccipRead: e } = c, h = e && typeof (e == null ? void 0 : e.request) == "function" ? e.request : C;
|
|
77
77
|
try {
|
|
78
78
|
if (!b(i, t))
|
|
79
|
-
throw new
|
|
80
|
-
const
|
|
79
|
+
throw new $({ sender: t, to: i });
|
|
80
|
+
const u = o.includes(L) ? await O({
|
|
81
|
+
data: d,
|
|
82
|
+
ccipRequest: h
|
|
83
|
+
}) : await h({ data: d, sender: t, urls: o }), { data: g } = await E(c, {
|
|
81
84
|
blockNumber: r,
|
|
82
85
|
blockTag: a,
|
|
83
|
-
data:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
data: x([
|
|
87
|
+
l,
|
|
88
|
+
R([{ type: "bytes" }, { type: "bytes" }], [u, s])
|
|
86
89
|
]),
|
|
87
90
|
to: i
|
|
88
91
|
});
|
|
89
|
-
return
|
|
90
|
-
} catch (
|
|
91
|
-
throw new
|
|
92
|
-
callbackSelector:
|
|
93
|
-
cause:
|
|
94
|
-
data:
|
|
92
|
+
return g;
|
|
93
|
+
} catch (u) {
|
|
94
|
+
throw new q({
|
|
95
|
+
callbackSelector: l,
|
|
96
|
+
cause: u,
|
|
97
|
+
data: n,
|
|
95
98
|
extraData: s,
|
|
96
99
|
sender: t,
|
|
97
|
-
urls:
|
|
100
|
+
urls: o
|
|
98
101
|
});
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
async function
|
|
104
|
+
async function C({ data: c, sender: r, urls: a }) {
|
|
102
105
|
var i;
|
|
103
|
-
let
|
|
104
|
-
for (let
|
|
105
|
-
const t = a[
|
|
106
|
+
let n = new Error("An unknown error occurred.");
|
|
107
|
+
for (let f = 0; f < a.length; f++) {
|
|
108
|
+
const t = a[f], o = t.includes("{data}") ? "GET" : "POST", d = o === "POST" ? { data: c, sender: r } : void 0, l = o === "POST" ? { "Content-Type": "application/json" } : {};
|
|
106
109
|
try {
|
|
107
|
-
const s = await fetch(t.replace("{sender}", r).replace("{data}", c), {
|
|
108
|
-
body: JSON.stringify(
|
|
109
|
-
headers:
|
|
110
|
-
method:
|
|
110
|
+
const s = await fetch(t.replace("{sender}", r.toLowerCase()).replace("{data}", c), {
|
|
111
|
+
body: JSON.stringify(d),
|
|
112
|
+
headers: l,
|
|
113
|
+
method: o
|
|
111
114
|
});
|
|
112
115
|
let e;
|
|
113
116
|
if ((i = s.headers.get("Content-Type")) != null && i.startsWith("application/json") ? e = (await s.json()).data : e = await s.text(), !s.ok) {
|
|
114
|
-
|
|
115
|
-
body:
|
|
116
|
-
details: e != null && e.error ?
|
|
117
|
+
n = new m({
|
|
118
|
+
body: d,
|
|
119
|
+
details: e != null && e.error ? w(e.error) : s.statusText,
|
|
117
120
|
headers: s.headers,
|
|
118
121
|
status: s.status,
|
|
119
122
|
url: t
|
|
120
123
|
});
|
|
121
124
|
continue;
|
|
122
125
|
}
|
|
123
|
-
if (!
|
|
124
|
-
|
|
126
|
+
if (!M(e)) {
|
|
127
|
+
n = new S({
|
|
125
128
|
result: e,
|
|
126
129
|
url: t
|
|
127
130
|
});
|
|
@@ -129,18 +132,18 @@ async function T({ data: c, sender: r, urls: a }) {
|
|
|
129
132
|
}
|
|
130
133
|
return e;
|
|
131
134
|
} catch (s) {
|
|
132
|
-
|
|
133
|
-
body:
|
|
135
|
+
n = new m({
|
|
136
|
+
body: d,
|
|
134
137
|
details: s.message,
|
|
135
138
|
url: t
|
|
136
139
|
});
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
|
-
throw
|
|
142
|
+
throw n;
|
|
140
143
|
}
|
|
141
144
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
C as ccipRequest,
|
|
146
|
+
D as offchainLookup,
|
|
147
|
+
T as offchainLookupAbiItem,
|
|
145
148
|
A as offchainLookupSignature
|
|
146
149
|
};
|
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-
|
|
2
|
+
"use strict";const w=require("node:fs/promises"),_=require("node:path"),y=require("./utils-BTtae95l.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="8.0.2",T="7.0.2",R=`
|
|
3
3
|
Deploy Boost Protocol V2, and retrieve base implementation addresses.
|
|
4
4
|
|
|
5
5
|
Usage: boost <COMMAND>
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 $, v as k, e as D, o as A } from "./utils-
|
|
4
|
+
import { g as $, v as k, e as D, o as A } from "./utils-godznAAS.js";
|
|
5
5
|
import { commands as S } from "./index.js";
|
|
6
6
|
const O = Symbol("arg flag");
|
|
7
7
|
class l extends Error {
|
|
@@ -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 = "8.0.
|
|
117
|
+
const T = /* @__PURE__ */ $(I), C = "8.0.2", P = "7.0.2", R = `
|
|
118
118
|
Deploy Boost Protocol V2, and retrieve base implementation addresses.
|
|
119
119
|
|
|
120
120
|
Usage: boost <COMMAND>
|