@zk-email/sdk 3.0.0-nightly.12 → 3.0.0-nightly.13

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,4 +1,4 @@
1
- import { B as l, g as m, s as y, d as k, i as b, c as O, a as E, e as L, H as h, b as x } from "./index-ChVXVSTS.mjs";
1
+ import { B as l, g as m, s as y, d as k, i as b, c as O, a as E, e as L, H as h, b as x } from "./index-CpjhxL_U.mjs";
2
2
  class M extends l {
3
3
  constructor({ callbackSelector: r, cause: a, data: o, extraData: i, sender: d, urls: t }) {
4
4
  var n;
@@ -144,4 +144,4 @@ export {
144
144
  $ as offchainLookupAbiItem,
145
145
  A as offchainLookupSignature
146
146
  };
147
- //# sourceMappingURL=ccip-DgpWHe07.mjs.map
147
+ //# sourceMappingURL=ccip-Cnd7Z1RF.mjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BC3uU88I.js");class w extends t.BaseError{constructor({callbackSelector:o,cause:a,data:n,extraData:f,sender:u,urls:r}){var c;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(c=a.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(d=>` ${t.getUrl(d)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${f}`].flat(),name:"OffchainLookupError"})}}class k extends t.BaseError{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t.getUrl(a)}`,`Response: ${t.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends t.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 E="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 L(i,{blockNumber:o,blockTag:a,data:n,to:f}){const{args:u}=t.decodeErrorResult({data:n,abi:[h]}),[r,c,d,p,s]=u,{ccipRead:e}=i,m=e&&typeof(e==null?void 0:e.request)=="function"?e.request:y;try{if(!t.isAddressEqual(f,r))throw new b({sender:r,to:f});const l=await m({data:d,sender:r,urls:c}),{data:g}=await t.call(i,{blockNumber:o,blockTag:a,data:t.concat([p,t.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[l,s])]),to:f});return g}catch(l){throw new w({callbackSelector:p,cause:l,data:n,extraData:s,sender:r,urls:c})}}async function y({data:i,sender:o,urls:a}){var f;let n=new Error("An unknown error occurred.");for(let u=0;u<a.length;u++){const r=a[u],c=r.includes("{data}")?"GET":"POST",d=c==="POST"?{data:i,sender:o}:void 0,p=c==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o).replace("{data}",i),{body:JSON.stringify(d),headers:p,method:c});let e;if((f=s.headers.get("Content-Type"))!=null&&f.startsWith("application/json")?e=(await s.json()).data:e=await s.text(),!s.ok){n=new t.HttpRequestError({body:d,details:e!=null&&e.error?t.stringify(e.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!t.isHex(e)){n=new k({result:e,url:r});continue}return e}catch(s){n=new t.HttpRequestError({body:d,details:s.message,url:r})}}throw n}exports.ccipRequest=y;exports.offchainLookup=L;exports.offchainLookupAbiItem=h;exports.offchainLookupSignature=E;
2
- //# sourceMappingURL=ccip-dpXvRpU3.js.map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DWs8SRDd.js");class w extends t.BaseError{constructor({callbackSelector:o,cause:a,data:n,extraData:f,sender:u,urls:r}){var c;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(c=a.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(d=>` ${t.getUrl(d)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${f}`].flat(),name:"OffchainLookupError"})}}class k extends t.BaseError{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${t.getUrl(a)}`,`Response: ${t.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends t.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 E="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 L(i,{blockNumber:o,blockTag:a,data:n,to:f}){const{args:u}=t.decodeErrorResult({data:n,abi:[h]}),[r,c,d,p,s]=u,{ccipRead:e}=i,m=e&&typeof(e==null?void 0:e.request)=="function"?e.request:y;try{if(!t.isAddressEqual(f,r))throw new b({sender:r,to:f});const l=await m({data:d,sender:r,urls:c}),{data:g}=await t.call(i,{blockNumber:o,blockTag:a,data:t.concat([p,t.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[l,s])]),to:f});return g}catch(l){throw new w({callbackSelector:p,cause:l,data:n,extraData:s,sender:r,urls:c})}}async function y({data:i,sender:o,urls:a}){var f;let n=new Error("An unknown error occurred.");for(let u=0;u<a.length;u++){const r=a[u],c=r.includes("{data}")?"GET":"POST",d=c==="POST"?{data:i,sender:o}:void 0,p=c==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o).replace("{data}",i),{body:JSON.stringify(d),headers:p,method:c});let e;if((f=s.headers.get("Content-Type"))!=null&&f.startsWith("application/json")?e=(await s.json()).data:e=await s.text(),!s.ok){n=new t.HttpRequestError({body:d,details:e!=null&&e.error?t.stringify(e.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!t.isHex(e)){n=new k({result:e,url:r});continue}return e}catch(s){n=new t.HttpRequestError({body:d,details:s.message,url:r})}}throw n}exports.ccipRequest=y;exports.offchainLookup=L;exports.offchainLookupAbiItem=h;exports.offchainLookupSignature=E;
2
+ //# sourceMappingURL=ccip-DzQKtfSz.js.map