@gardenfi/core 2.1.3-beta.34 → 2.1.3-beta.36
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-D0YHNX8E.js → ccip-CfwyOcMq.js} +1 -1
- package/dist/{ccip-BaTCny3N.cjs → ccip-DXLB6JIO.cjs} +1 -1
- package/dist/{index-C1pa02g5.js → index-CugD05eO.js} +6 -6
- package/dist/{index-CRFfziL8.cjs → index-D-Xox_Qz.cjs} +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{secp256k1-07iE7qoZ.cjs → secp256k1-D5rKh7gQ.cjs} +1 -1
- package/dist/{secp256k1-D4eevYNx.js → secp256k1-D_2XZPF5.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as b, t as O, f as x, A as N, d as P, g as F, a as E, b as S, e as w, c as $, h as A, i as I, I as D, j as m, k as G, B as y, l as L, m as q, n as T, o as C, p as H, q as j, H as R, r as v } from "./index-
|
|
1
|
+
import { s as b, t as O, f as x, A as N, d as P, g as F, a as E, b as S, e as w, c as $, h as A, i as I, I as D, j as m, k as G, B as y, l as L, m as q, n as T, o as C, p as H, q as j, H as R, r as v } from "./index-CugD05eO.js";
|
|
2
2
|
function B(a) {
|
|
3
3
|
const { abi: r, data: e } = a, s = b(e, 0, 4), t = r.find((o) => o.type === "function" && s === O(x(o)));
|
|
4
4
|
if (!t)
|
|
@@ -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-D-Xox_Qz.cjs");function A(a){const{abi:o,data:r}=a,n=e.slice(r,0,4),t=o.find(c=>c.type==="function"&&n===e.toFunctionSelector(e.formatAbiItem(c)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(r,4)):void 0}}const h="/docs/contract/encodeErrorResult";function b(a){const{abi:o,errorName:r,args:n}=a;let t=o[0];if(r){const d=e.getAbiItem({abi:o,args:n,name:r});if(!d)throw new e.AbiErrorNotFoundError(r,{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(n&&n.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:h});i=e.encodeAbiParameters(t.inputs,n)}return e.concatHex([s,i])}const m="/docs/contract/encodeFunctionResult";function R(a){const{abi:o,functionName:r,result:n}=a;let t=o[0];if(r){const s=e.getAbiItem({abi:o,name:r});if(!s)throw new e.AbiFunctionNotFoundError(r,{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[n];if(Array.isArray(n))return n;throw new e.InvalidArrayError(n)})();return e.encodeAbiParameters(t.outputs,c)}const k="x-batch-gateway:true";async function F(a){const{data:o,ccipRequest:r}=a,{args:[n]}=A({abi:e.batchGatewayAbi,data:o}),t=[],c=[];return await Promise.all(n.map(async(s,i)=>{try{c[i]=await r(s),t[i]=!1}catch(d){t[i]=!0,c[i]=L(d)}})),R({abi:e.batchGatewayAbi,functionName:"query",result:[t,c]})}function L(a){return a.name==="HttpRequestError"&&a.status?b({abi:e.batchGatewayAbi,errorName:"HttpError",args:[a.status,a.shortMessage]}):b({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in a?a.shortMessage:a.message]})}class O extends e.BaseError{constructor({callbackSelector:o,cause:r,data:n,extraData:t,sender:c,urls:s}){var i;super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],(i=r.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(d=>` ${e.getUrl(d)}`)],` Sender: ${c}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class q extends e.BaseError{constructor({result:o,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(r)}`,`Response: ${e.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class P extends e.BaseError{constructor({sender:o,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const S="0x556f1830",w={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 x(a,{blockNumber:o,blockTag:r,data:n,to:t}){const{args:c}=e.decodeErrorResult({data:n,abi:[w]}),[s,i,d,l,f]=c,{ccipRead:u}=a,y=u&&typeof(u==null?void 0:u.request)=="function"?u.request:g;try{if(!e.isAddressEqual(t,s))throw new P({sender:s,to:t});const p=i.includes(k)?await F({data:d,ccipRequest:y}):await y({data:d,sender:s,urls:i}),{data:E}=await e.call(a,{blockNumber:o,blockTag:r,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,f])]),to:t});return E}catch(p){throw new O({callbackSelector:l,cause:p,data:n,extraData:f,sender:s,urls:i})}}async function g({data:a,sender:o,urls:r}){var t;let n=new Error("An unknown error occurred.");for(let c=0;c<r.length;c++){const s=r[c],i=s.includes("{data}")?"GET":"POST",d=i==="POST"?{data:a,sender:o}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const f=await fetch(s.replace("{sender}",o.toLowerCase()).replace("{data}",a),{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){n=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)){n=new q({result:u,url:s});continue}return u}catch(f){n=new e.HttpRequestError({body:d,details:f.message,url:s})}}throw n}exports.ccipRequest=g;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=S;
|
|
@@ -3222,7 +3222,7 @@ function Wp(e) {
|
|
|
3222
3222
|
return Ai(`0x${t}`);
|
|
3223
3223
|
}
|
|
3224
3224
|
async function Kp({ hash: e, signature: t }) {
|
|
3225
|
-
const r = hr(e) ? e : X(e), { secp256k1: n } = await import("./secp256k1-
|
|
3225
|
+
const r = hr(e) ? e : X(e), { secp256k1: n } = await import("./secp256k1-D_2XZPF5.js");
|
|
3226
3226
|
return `0x${(() => {
|
|
3227
3227
|
if (typeof t == "object" && "r" in t && "s" in t) {
|
|
3228
3228
|
const { r: f, s: l, v: h, yParity: m } = t, p = Number(m ?? h), g = Kc(p);
|
|
@@ -4808,7 +4808,7 @@ async function Ad(e, t) {
|
|
|
4808
4808
|
});
|
|
4809
4809
|
return ue === "0x" ? { data: void 0 } : { data: ue };
|
|
4810
4810
|
} catch (Y) {
|
|
4811
|
-
const re = Hy(Y), { offchainLookup: le, offchainLookupSignature: be } = await import("./ccip-
|
|
4811
|
+
const re = Hy(Y), { offchainLookup: le, offchainLookupSignature: be } = await import("./ccip-CfwyOcMq.js");
|
|
4812
4812
|
if (e.ccipRead !== !1 && (re == null ? void 0 : re.slice(0, 10)) === be && k)
|
|
4813
4813
|
return { data: await le(e, { data: re, to: k }) };
|
|
4814
4814
|
throw B && (re == null ? void 0 : re.slice(0, 10)) === "0x101bb98d" ? new Gp({ factory: l }) : Ly(Y, {
|
|
@@ -12437,7 +12437,7 @@ const Qi = {
|
|
|
12437
12437
|
quote: "https://api.garden.finance/quote",
|
|
12438
12438
|
info: "https://api.garden.finance/info",
|
|
12439
12439
|
evmRelay: "https://api.garden.finance/relayer",
|
|
12440
|
-
starknetRelay: ""
|
|
12440
|
+
starknetRelay: "https://api.garden.finance/starknet"
|
|
12441
12441
|
},
|
|
12442
12442
|
testnet: {
|
|
12443
12443
|
orderbook: "https://testnet.api.garden.finance",
|
|
@@ -12445,7 +12445,7 @@ const Qi = {
|
|
|
12445
12445
|
quote: "https://testnet.api.garden.finance/quote",
|
|
12446
12446
|
info: "https://testnet.api.garden.finance/info",
|
|
12447
12447
|
evmRelay: "https://testnet.api.garden.finance/relayer",
|
|
12448
|
-
starknetRelay: "https://
|
|
12448
|
+
starknetRelay: "https://testnet.api.garden.finance/starknet"
|
|
12449
12449
|
},
|
|
12450
12450
|
localnet: {
|
|
12451
12451
|
orderbook: "",
|
|
@@ -16720,7 +16720,7 @@ const ks = {
|
|
|
16720
16720
|
} catch (i) {
|
|
16721
16721
|
if (R_(i))
|
|
16722
16722
|
try {
|
|
16723
|
-
|
|
16723
|
+
await t.addChain({ chain: r });
|
|
16724
16724
|
const s = ou({
|
|
16725
16725
|
account: t.account,
|
|
16726
16726
|
chain: r,
|
|
@@ -16731,7 +16731,7 @@ const ks = {
|
|
|
16731
16731
|
walletClient: s
|
|
16732
16732
|
});
|
|
16733
16733
|
} catch (s) {
|
|
16734
|
-
return
|
|
16734
|
+
return G("Failed to add network", s);
|
|
16735
16735
|
}
|
|
16736
16736
|
else
|
|
16737
16737
|
return G("Failed to switch network");
|