@gardenfi/core 2.2.0-beta.1 → 2.2.1-beta.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/{ccip-LU9cvfWv.cjs → ccip-B1_TRO36.cjs} +1 -1
- package/dist/{ccip-Coddv-AF.js → ccip-Bllqmmv_.js} +1 -1
- package/dist/{index-BF97ZR9S.js → index-D10jIxwi.js} +20 -17
- package/dist/{index-CTDLWbhh.cjs → index-DyvVJhoD.cjs} +34 -34
- package/dist/index.cjs +1 -1
- package/dist/index.js +34 -31
- package/dist/src/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DyvVJhoD.cjs");class w extends e.BaseError{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{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(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends e.BaseError{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 E(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({body:f,details:t!=null&&t.error?e.stringify(t.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!e.isHex(t)){c=new k({result:t,url:r});continue}return t}catch(s){c=new e.HttpRequestError({body:f,details:s.message,url:r})}}throw c}exports.ccipRequest=m;exports.offchainLookup=E;exports.offchainLookupAbiItem=y;exports.offchainLookupSignature=L;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-
|
|
1
|
+
import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-D10jIxwi.js";
|
|
2
2
|
class S extends p {
|
|
3
3
|
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
4
4
|
var o;
|
|
@@ -5442,7 +5442,7 @@ async function To(e, t) {
|
|
|
5442
5442
|
});
|
|
5443
5443
|
return Z === "0x" ? { data: void 0 } : { data: Z };
|
|
5444
5444
|
} catch (J) {
|
|
5445
|
-
const M = n1(J), { offchainLookup: k, offchainLookupSignature: q } = await import("./ccip-
|
|
5445
|
+
const M = n1(J), { offchainLookup: k, offchainLookupSignature: q } = await import("./ccip-Bllqmmv_.js");
|
|
5446
5446
|
if (e.ccipRead !== !1 && (M == null ? void 0 : M.slice(0, 10)) === q && A)
|
|
5447
5447
|
return { data: await k(e, { data: M, to: A }) };
|
|
5448
5448
|
throw O && (M == null ? void 0 : M.slice(0, 10)) === "0x101bb98d" ? new Ub({ factory: y }) : zh(J, {
|
|
@@ -24269,26 +24269,29 @@ class d5 {
|
|
|
24269
24269
|
}
|
|
24270
24270
|
}
|
|
24271
24271
|
export {
|
|
24272
|
-
|
|
24272
|
+
o5 as A,
|
|
24273
24273
|
D as B,
|
|
24274
|
-
|
|
24275
|
-
|
|
24274
|
+
jr as C,
|
|
24275
|
+
Cd as D,
|
|
24276
24276
|
dA as E,
|
|
24277
|
-
|
|
24277
|
+
By as F,
|
|
24278
24278
|
Ky as G,
|
|
24279
24279
|
_i as H,
|
|
24280
|
-
|
|
24281
|
-
|
|
24282
|
-
|
|
24283
|
-
|
|
24284
|
-
|
|
24285
|
-
|
|
24280
|
+
cA as I,
|
|
24281
|
+
oA as J,
|
|
24282
|
+
aA as K,
|
|
24283
|
+
sA as L,
|
|
24284
|
+
wt as M,
|
|
24285
|
+
vA as N,
|
|
24286
24286
|
Ee as O,
|
|
24287
24287
|
X0 as P,
|
|
24288
24288
|
Ux as Q,
|
|
24289
|
-
|
|
24289
|
+
Rn as R,
|
|
24290
24290
|
yA as S,
|
|
24291
|
-
|
|
24291
|
+
ma as T,
|
|
24292
|
+
ro as U,
|
|
24293
|
+
Bd as V,
|
|
24294
|
+
wE as W,
|
|
24292
24295
|
A1 as a,
|
|
24293
24296
|
Et as b,
|
|
24294
24297
|
To as c,
|
|
@@ -24311,8 +24314,8 @@ export {
|
|
|
24311
24314
|
c5 as t,
|
|
24312
24315
|
J0 as u,
|
|
24313
24316
|
oo as v,
|
|
24314
|
-
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24317
|
+
lA as w,
|
|
24318
|
+
pA as x,
|
|
24319
|
+
Ys as y,
|
|
24320
|
+
Rd as z
|
|
24318
24321
|
};
|