@tuwaio/satellite-evm 1.0.0-fix-test-alpha.25.a7efd7b → 1.0.0-fix-test-alpha.26.9f8bdfd
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';var orbitCore=require('@tuwaio/orbit-core'),orbitEvm=require('@tuwaio/orbit-evm'),satelliteCore=require('@tuwaio/satellite-core'),core=require('@wagmi/core'),connectors=require('@wagmi/connectors');var l=(e,r)=>()=>(e&&(r=e(e=0)),r);function te(e,{strict:r=true}={}){return !e||typeof e!="string"?false:r?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var le=l(()=>{});function $e(e){return te(e,{strict:false})?Math.ceil((e.length-2)/2):e.length}var gr=l(()=>{le();});var je,yr=l(()=>{je="2.37.8";});function Tr(e,r){return r?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Tr(e.cause,r):r?null:e}var De,d,S=l(()=>{yr();De={getDocsUrl:({docsBaseUrl:e,docsPath:r="",docsSlug:t})=>r?`${e??"https://viem.sh"}${r}${t?`#${t}`:""}`:void 0,version:`viem@${je}`},d=class e extends Error{constructor(r,t={}){let o=t.cause instanceof e?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof e&&t.cause.docsPath||t.docsPath,i=De.getDocsUrl?.({...t,docsPath:n}),s=[r||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...o?[`Details: ${o}`]:[],...De.version?[`Version: ${De.version}`]:[]].join(`
|
|
2
2
|
`);super(s,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"version",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"BaseError"}),this.details=o,this.docsPath=n,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=r,this.version=je;}walk(r){return Tr(this,r)}};});var se,wr=l(()=>{S();se=class extends d{constructor({size:r,targetSize:t,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${r}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"});}};});function P(e,{dir:r,size:t=32}={}){return typeof e=="string"?wt(e,{dir:r,size:t}):Et(e,{dir:r,size:t})}function wt(e,{dir:r,size:t=32}={}){if(t===null)return e;let o=e.replace("0x","");if(o.length>t*2)throw new se({size:Math.ceil(o.length/2),targetSize:t,type:"hex"});return `0x${o[r==="right"?"padEnd":"padStart"](t*2,"0")}`}function Et(e,{dir:r,size:t=32}={}){if(t===null)return e;if(e.length>t)throw new se({size:e.length,targetSize:t,type:"bytes"});let o=new Uint8Array(t);for(let n=0;n<t;n++){let i=r==="right";o[i?n:t-n-1]=e[i?n:e.length-n-1];}return o}var Ve=l(()=>{wr();});var de,he,be,We=l(()=>{S();de=class extends d{constructor({max:r,min:t,signed:o,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${n*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${r?`(${t} to ${r})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"});}},he=class extends d{constructor(r){super(`Hex value "${r}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"});}},be=class extends d{constructor({givenSize:r,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${r} bytes.`,{name:"SizeOverflowError"});}};});function ie(e,{dir:r="left"}={}){let t=typeof e=="string"?e.replace("0x",""):e,o=0;for(let n=0;n<t.length-1&&t[r==="left"?n:t.length-n-1].toString()==="0";n++)o++;return t=r==="left"?t.slice(o):t.slice(0,t.length-o),typeof e=="string"?(t.length===1&&r==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}var Er=l(()=>{});function T(e,{size:r}){if($e(e)>r)throw new be({givenSize:$e(e),maxSize:r})}function ge(e,r){let t={to:r},o=t.to;return o==="number"?Cr(e,t):o==="bigint"?Ge(e,t):o==="string"?vr(e,t):o==="boolean"?Sr(e,t):ae(e,t)}function Ge(e,r={}){let{signed:t}=r;r.size&&T(e,{size:r.size});let o=BigInt(e);if(!t)return o;let n=(e.length-2)/2,i=(1n<<BigInt(n)*8n-1n)-1n;return o<=i?o:o-BigInt(`0x${"f".padStart(n*2,"f")}`)-1n}function Sr(e,r={}){let t=e;if(r.size&&(T(t,{size:r.size}),t=ie(t)),ie(t)==="0x00")return false;if(ie(t)==="0x01")return true;throw new he(t)}function Cr(e,r={}){return Number(Ge(e,r))}function vr(e,r={}){let t=ae(e);return r.size&&(T(t,{size:r.size}),t=ie(t,{dir:"right"})),new TextDecoder().decode(t)}var ye=l(()=>{We();gr();Er();Te();});function _e(e,r={}){return typeof e=="number"||typeof e=="bigint"?U(e,r):typeof e=="string"?we(e,r):typeof e=="boolean"?Ar(e,r):Ke(e,r)}function Ar(e,r={}){let t=`0x${Number(e)}`;return typeof r.size=="number"?(T(t,{size:r.size}),P(t,{size:r.size})):t}function Ke(e,r={}){let t="";for(let n=0;n<e.length;n++)t+=St[e[n]];let o=`0x${t}`;return typeof r.size=="number"?(T(o,{size:r.size}),P(o,{dir:"right",size:r.size})):o}function U(e,r={}){let{signed:t,size:o}=r,n=BigInt(e),i;o?t?i=(1n<<BigInt(o)*8n-1n)-1n:i=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&t?-i-1n:0;if(i&&n>i||n<s){let f=typeof e=="bigint"?"n":"";throw new de({max:i?`${i}${f}`:void 0,min:`${s}${f}`,signed:t,size:o,value:`${e}${f}`})}let p=`0x${(t&&n<0?(1n<<BigInt(o*8))+BigInt(n):n).toString(16)}`;return o?P(p,{size:o}):p}function we(e,r={}){let t=Ct.encode(e);return Ke(t,r)}var St,Ct,pe=l(()=>{We();Ve();ye();St=Array.from({length:256},(e,r)=>r.toString(16).padStart(2,"0"));Ct=new TextEncoder;});function Ir(e,r={}){return typeof e=="number"||typeof e=="bigint"?kt(e,r):typeof e=="boolean"?At(e,r):te(e)?ae(e,r):Ze(e,r)}function At(e,r={}){let t=new Uint8Array(1);return t[0]=Number(e),typeof r.size=="number"?(T(t,{size:r.size}),P(t,{size:r.size})):t}function kr(e){if(e>=C.zero&&e<=C.nine)return e-C.zero;if(e>=C.A&&e<=C.F)return e-(C.A-10);if(e>=C.a&&e<=C.f)return e-(C.a-10)}function ae(e,r={}){let t=e;r.size&&(T(t,{size:r.size}),t=P(t,{dir:"right",size:r.size}));let o=t.slice(2);o.length%2&&(o=`0${o}`);let n=o.length/2,i=new Uint8Array(n);for(let s=0,p=0;s<n;s++){let f=kr(o.charCodeAt(p++)),m=kr(o.charCodeAt(p++));if(f===void 0||m===void 0)throw new d(`Invalid byte sequence ("${o[p-2]}${o[p-1]}" in "${o}").`);i[s]=f*16+m;}return i}function kt(e,r){let t=U(e,r);return ae(t)}function Ze(e,r={}){let t=vt.encode(e);return typeof r.size=="number"?(T(t,{size:r.size}),P(t,{dir:"right",size:r.size})):t}var vt,C,Te=l(()=>{S();le();Ve();ye();pe();vt=new TextEncoder;C={zero:48,nine:57,A:65,F:70,a:97,f:102};});function It(e,r=false){return r?{h:Number(e&Ee),l:Number(e>>Rr&Ee)}:{h:Number(e>>Rr&Ee)|0,l:Number(e&Ee)|0}}function Pr(e,r=false){let t=e.length,o=new Uint32Array(t),n=new Uint32Array(t);for(let i=0;i<t;i++){let{h:s,l:p}=It(e[i],r);[o[i],n[i]]=[s,p];}return [o,n]}var Ee,Rr,zr,Br,Mr,Ur,Hr=l(()=>{Ee=BigInt(4294967295),Rr=BigInt(32);zr=(e,r,t)=>e<<t|r>>>32-t,Br=(e,r,t)=>r<<t|e>>>32-t,Mr=(e,r,t)=>r<<t-32|e>>>64-t,Ur=(e,r,t)=>e<<t-32|r>>>64-t;});function Rt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Je(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ce(e,...r){if(!Rt(e))throw new Error("Uint8Array expected");if(r.length>0&&!r.includes(e.length))throw new Error("Uint8Array expected of length "+r+", got length="+e.length)}function Xe(e,r=true){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(r&&e.finished)throw new Error("Hash#digest() has already been called")}function Lr(e,r){ce(e);let t=r.outputLen;if(e.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function Fr(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Qe(...e){for(let r=0;r<e.length;r++)e[r].fill(0);}function zt(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Bt(e){for(let r=0;r<e.length;r++)e[r]=zt(e[r]);return e}function Mt(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function er(e){return typeof e=="string"&&(e=Mt(e)),ce(e),e}function Nr(e){let r=o=>e().update(er(o)).digest(),t=e();return r.outputLen=t.outputLen,r.blockLen=t.blockLen,r.create=()=>e(),r}var Pt,Ye,Se,Or=l(()=>{Pt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;Ye=Pt?e=>e:Bt;Se=class{};});function $t(e,r=24){let t=new Uint32Array(10);for(let o=24-r;o<24;o++){for(let s=0;s<10;s++)t[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let p=(s+8)%10,f=(s+2)%10,m=t[f],c=t[f+1],x=qr(m,c,1)^t[p],a=$r(m,c,1)^t[p+1];for(let u=0;u<50;u+=10)e[s+u]^=x,e[s+u+1]^=a;}let n=e[2],i=e[3];for(let s=0;s<24;s++){let p=Dr[s],f=qr(n,i,p),m=$r(n,i,p),c=jr[s];n=e[c],i=e[c+1],e[c]=f,e[c+1]=m;}for(let s=0;s<50;s+=10){for(let p=0;p<10;p++)t[p]=e[s+p];for(let p=0;p<10;p++)e[s+p]^=~t[(p+2)%10]&t[(p+4)%10];}e[0]^=Ot[o],e[1]^=qt[o];}Qe(t);}var Ut,me,Ht,Lt,Ft,Nt,jr,Dr,Vr,Wr,Ot,qt,qr,$r,rr,jt,Gr,_r=l(()=>{Hr();Or();Ut=BigInt(0),me=BigInt(1),Ht=BigInt(2),Lt=BigInt(7),Ft=BigInt(256),Nt=BigInt(113),jr=[],Dr=[],Vr=[];for(let e=0,r=me,t=1,o=0;e<24;e++){[t,o]=[o,(2*t+3*o)%5],jr.push(2*(5*o+t)),Dr.push((e+1)*(e+2)/2%64);let n=Ut;for(let i=0;i<7;i++)r=(r<<me^(r>>Lt)*Nt)%Ft,r&Ht&&(n^=me<<(me<<BigInt(i))-me);Vr.push(n);}Wr=Pr(Vr,true),Ot=Wr[0],qt=Wr[1],qr=(e,r,t)=>t>32?Mr(e,r,t):zr(e,r,t),$r=(e,r,t)=>t>32?Ur(e,r,t):Br(e,r,t);rr=class e extends Se{constructor(r,t,o,n=false,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=false,this.destroyed=false,this.enableXOF=false,this.blockLen=r,this.suffix=t,this.outputLen=o,this.enableXOF=n,this.rounds=i,Je(o),!(0<r&&r<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Fr(this.state);}clone(){return this._cloneInto()}keccak(){Ye(this.state32),$t(this.state32,this.rounds),Ye(this.state32),this.posOut=0,this.pos=0;}update(r){Xe(this),r=er(r),ce(r);let{blockLen:t,state:o}=this,n=r.length;for(let i=0;i<n;){let s=Math.min(t-this.pos,n-i);for(let p=0;p<s;p++)o[this.pos++]^=r[i++];this.pos===t&&this.keccak();}return this}finish(){if(this.finished)return;this.finished=true;let{state:r,suffix:t,pos:o,blockLen:n}=this;r[o]^=t,(t&128)!==0&&o===n-1&&this.keccak(),r[n-1]^=128,this.keccak();}writeInto(r){Xe(this,false),ce(r),this.finish();let t=this.state,{blockLen:o}=this;for(let n=0,i=r.length;n<i;){this.posOut>=o&&this.keccak();let s=Math.min(o-this.posOut,i-n);r.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s;}return r}xofInto(r){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(r)}xof(r){return Je(r),this.xofInto(new Uint8Array(r))}digestInto(r){if(Lr(r,this),this.finished)throw new Error("digest() was already called");return this.writeInto(r),this.destroy(),r}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true,Qe(this.state);}_cloneInto(r){let{blockLen:t,suffix:o,outputLen:n,rounds:i,enableXOF:s}=this;return r||(r=new e(t,o,n,s,i)),r.state32.set(this.state32),r.pos=this.pos,r.posOut=this.posOut,r.finished=this.finished,r.rounds=i,r.suffix=o,r.outputLen=n,r.enableXOF=s,r.destroyed=this.destroyed,r}},jt=(e,r,t)=>Nr(()=>new rr(r,e,t)),Gr=jt(1,136,256/8);});function Kr(e,r){let t=r,o=Gr(te(e,{strict:false})?Ir(e):e);return t==="bytes"?o:_e(o)}var Zr=l(()=>{_r();le();Te();pe();});var Ce,Jr=l(()=>{S();Ce=class extends d{constructor({address:r}){super(`Address "${r}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"});}};});var z,ve=l(()=>{z=class extends Map{constructor(r){super(),Object.defineProperty(this,"maxSize",{enumerable:true,configurable:true,writable:true,value:void 0}),this.maxSize=r;}get(r){let t=super.get(r);return super.has(r)&&t!==void 0&&(this.delete(r),super.set(r,t)),t}set(r,t){if(super.set(r,t),this.maxSize&&this.size>this.maxSize){let o=this.keys().next().value;o&&this.delete(o);}return this}};});function Ae(e,r){if(tr.has(`${e}.${r}`))return tr.get(`${e}.${r}`);let t=r?`${r}${e.toLowerCase()}`:e.substring(2).toLowerCase(),o=Kr(Ze(t),"bytes"),n=(r?t.substring(`${r}0x`.length):t).split("");for(let s=0;s<40;s+=2)o[s>>1]>>4>=8&&n[s]&&(n[s]=n[s].toUpperCase()),(o[s>>1]&15)>=8&&n[s+1]&&(n[s+1]=n[s+1].toUpperCase());let i=`0x${n.join("")}`;return tr.set(`${e}.${r}`,i),i}function ke(e,r){if(!Xr(e,{strict:false}))throw new Ce({address:e});return Ae(e,r)}var tr,or=l(()=>{Jr();Te();Zr();ve();Qr();tr=new z(8192);});function Xr(e,r){let{strict:t=true}=r??{},o=`${e}.${t}`;if(nr.has(o))return nr.get(o);let n=Dt.test(e)?e.toLowerCase()===e?true:t?Ae(e)===e:true:false;return nr.set(o,n),n}var Dt,nr,Qr=l(()=>{ve();or();Dt=/^0x[a-fA-F0-9]{40}$/,nr=new z(8192);});var w,Ie=l(()=>{w=(e,r,t)=>JSON.stringify(e,(o,n)=>{let i=typeof n=="bigint"?n.toString():n;return typeof r=="function"?r(o,i):i},t);});function sr(e,r){let t=e.toString(),o=t.startsWith("-");o&&(t=t.slice(1)),t=t.padStart(r,"0");let[n,i]=[t.slice(0,t.length-r),t.slice(t.length-r)];return i=i.replace(/(0+)$/,""),`${o?"-":""}${n||"0"}${i?`.${i}`:""}`}var Yr=l(()=>{});var Re,et=l(()=>{Re=e=>e;});var E,v,oe,ne=l(()=>{Ie();S();et();E=class extends d{constructor({body:r,cause:t,details:o,headers:n,status:i,url:s}){super("HTTP request failed.",{cause:t,details:o,metaMessages:[i&&`Status: ${i}`,`URL: ${Re(s)}`,r&&`Request body: ${w(r)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"headers",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"status",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"url",{enumerable:true,configurable:true,writable:true,value:void 0}),this.body=r,this.headers=n,this.status=i,this.url=s;}},v=class extends d{constructor({body:r,error:t,url:o}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${Re(o)}`,`Request body: ${w(r)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"data",{enumerable:true,configurable:true,writable:true,value:void 0}),this.code=t.code,this.data=t.data;}},oe=class extends d{constructor({body:r,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Re(t)}`,`Request body: ${w(r)}`],name:"TimeoutError"});}};});var Vt,h,b,H,L,F,N,B,O,q,$,j,A,M,D,g,V,W,G,_,k,K,Z,J,X,Q,Y,ee,fe,ir=l(()=>{S();ne();Vt=-1,h=class extends d{constructor(r,{code:t,docsPath:o,metaMessages:n,name:i,shortMessage:s}){super(s,{cause:r,docsPath:o,metaMessages:n||r?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name=i||r.name,this.code=r instanceof v?r.code:t??Vt;}},b=class extends h{constructor(r,t){super(r,t),Object.defineProperty(this,"data",{enumerable:true,configurable:true,writable:true,value:void 0}),this.data=t.data;}},H=class e extends h{constructor(r){super(r,{code:e.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."});}};Object.defineProperty(H,"code",{enumerable:true,configurable:true,writable:true,value:-32700});L=class e extends h{constructor(r){super(r,{code:e.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."});}};Object.defineProperty(L,"code",{enumerable:true,configurable:true,writable:true,value:-32600});F=class e extends h{constructor(r,{method:t}={}){super(r,{code:e.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`});}};Object.defineProperty(F,"code",{enumerable:true,configurable:true,writable:true,value:-32601});N=class e extends h{constructor(r){super(r,{code:e.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
3
3
|
`)});}};Object.defineProperty(N,"code",{enumerable:true,configurable:true,writable:true,value:-32602});B=class e extends h{constructor(r){super(r,{code:e.code,name:"InternalRpcError",shortMessage:"An internal error was received."});}};Object.defineProperty(B,"code",{enumerable:true,configurable:true,writable:true,value:-32603});O=class e extends h{constructor(r){super(r,{code:e.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
4
|
-
`)});}};Object.defineProperty(O,"code",{enumerable:true,configurable:true,writable:true,value:-32e3});q=class e extends h{constructor(r){super(r,{code:e.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"ResourceNotFoundRpcError"});}};Object.defineProperty(q,"code",{enumerable:true,configurable:true,writable:true,value:-32001});$=class e extends h{constructor(r){super(r,{code:e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."});}};Object.defineProperty($,"code",{enumerable:true,configurable:true,writable:true,value:-32002});j=class e extends h{constructor(r){super(r,{code:e.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."});}};Object.defineProperty(j,"code",{enumerable:true,configurable:true,writable:true,value:-32003});A=class e extends h{constructor(r,{method:t}={}){super(r,{code:e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`});}};Object.defineProperty(A,"code",{enumerable:true,configurable:true,writable:true,value:-32004});M=class e extends h{constructor(r){super(r,{code:e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."});}};Object.defineProperty(M,"code",{enumerable:true,configurable:true,writable:true,value:-32005});D=class e extends h{constructor(r){super(r,{code:e.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."});}};Object.defineProperty(D,"code",{enumerable:true,configurable:true,writable:true,value:-32006});g=class e extends b{constructor(r){super(r,{code:e.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."});}};Object.defineProperty(g,"code",{enumerable:true,configurable:true,writable:true,value:4001});V=class e extends b{constructor(r){super(r,{code:e.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."});}};Object.defineProperty(V,"code",{enumerable:true,configurable:true,writable:true,value:4100});W=class e extends b{constructor(r,{method:t}={}){super(r,{code:e.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`});}};Object.defineProperty(W,"code",{enumerable:true,configurable:true,writable:true,value:4200});G=class e extends b{constructor(r){super(r,{code:e.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."});}};Object.defineProperty(G,"code",{enumerable:true,configurable:true,writable:true,value:4900});_=class e extends b{constructor(r){super(r,{code:e.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."});}};Object.defineProperty(_,"code",{enumerable:true,configurable:true,writable:true,value:4901});k=class e extends b{constructor(r){super(r,{code:e.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."});}};Object.defineProperty(k,"code",{enumerable:true,configurable:true,writable:true,value:4902});K=class e extends b{constructor(r){super(r,{code:e.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."});}};Object.defineProperty(K,"code",{enumerable:true,configurable:true,writable:true,value:5700});Z=class e extends b{constructor(r){super(r,{code:e.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."});}};Object.defineProperty(Z,"code",{enumerable:true,configurable:true,writable:true,value:5710});J=class e extends b{constructor(r){super(r,{code:e.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."});}};Object.defineProperty(J,"code",{enumerable:true,configurable:true,writable:true,value:5720});X=class e extends b{constructor(r){super(r,{code:e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"});}};Object.defineProperty(X,"code",{enumerable:true,configurable:true,writable:true,value:5730});Q=class e extends b{constructor(r){super(r,{code:e.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."});}};Object.defineProperty(Q,"code",{enumerable:true,configurable:true,writable:true,value:5740});Y=class e extends b{constructor(r){super(r,{code:e.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."});}};Object.defineProperty(Y,"code",{enumerable:true,configurable:true,writable:true,value:5750});ee=class e extends b{constructor(r){super(r,{code:e.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."});}};Object.defineProperty(ee,"code",{enumerable:true,configurable:true,writable:true,value:5760});fe=class extends h{constructor(r){super(r,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."});}};});function rt(){let e=()=>{},r=()=>{};return {promise:new Promise((o,n)=>{e=o,r=n;}),resolve:e,reject:r}}var tt=l(()=>{});function ot({fn:e,id:r,shouldSplitBatch:t,wait:o=0,sort:n}){let i=async()=>{let c=f();s();let x=c.map(({args:a})=>a);x.length!==0&&e(x).then(a=>{n&&Array.isArray(a)&&a.sort(n);for(let u=0;u<c.length;u++){let{resolve:y}=c[u];y?.([a[u],a]);}}).catch(a=>{for(let u=0;u<c.length;u++){let{reject:y}=c[u];y?.(a);}});},s=()=>ar.delete(r),p=()=>f().map(({args:c})=>c),f=()=>ar.get(r)||[],m=c=>ar.set(r,[...f(),c]);return {flush:s,async schedule(c){let{promise:x,resolve:a,reject:u}=rt();return t?.([...p(),c])&&i(),f().length>0?(m({args:c,resolve:a,reject:u}),x):(m({args:c,resolve:a,reject:u}),setTimeout(i,o),x)}}}var ar,nt=l(()=>{tt();ar=new Map;});async function st(e){return new Promise(r=>setTimeout(r,e))}function it(e,{delay:r=100,retryCount:t=2,shouldRetry:o=()=>true}={}){return new Promise((n,i)=>{let s=async({count:p=0}={})=>{let f=async({error:m})=>{let c=typeof r=="function"?r({count:p,error:m}):r;c&&await st(c),s({count:p+1});};try{let m=await e();n(m);}catch(m){if(p<t&&await o({count:p,error:m}))return f({error:m});i(m);}};s();})}var Pe=256,ze;function at(e=11){if(!ze||Pe+e>256*2){ze="",Pe=0;for(let r=0;r<256;r++)ze+=(256+Math.random()*256|0).toString(16).substring(1);}return ze.substring(Pe,Pe+++e)}S();ne();ir();pe();ve();var Be=new z(8192);function pt(e,{enabled:r=true,id:t}){if(!r||!t)return e();if(Be.get(t))return Be.get(t);let o=e().finally(()=>Be.delete(t));return Be.set(t,o),o}Ie();function ct(e,r={}){return async(t,o={})=>{let{dedupe:n=false,methods:i,retryDelay:s=150,retryCount:p=3,uid:f}={...r,...o},{method:m}=t;if(i?.exclude?.includes(m))throw new A(new Error("method not supported"),{method:m});if(i?.include&&!i.include.includes(m))throw new A(new Error("method not supported"),{method:m});let c=n?we(`${f}.${w(t)}`):void 0;return pt(()=>it(async()=>{try{return await e(t)}catch(x){let a=x;switch(a.code){case H.code:throw new H(a);case L.code:throw new L(a);case F.code:throw new F(a,{method:t.method});case N.code:throw new N(a);case B.code:throw new B(a);case O.code:throw new O(a);case q.code:throw new q(a);case $.code:throw new $(a);case j.code:throw new j(a);case A.code:throw new A(a,{method:t.method});case M.code:throw new M(a);case D.code:throw new D(a);case g.code:throw new g(a);case V.code:throw new V(a);case W.code:throw new W(a);case G.code:throw new G(a);case _.code:throw new _(a);case k.code:throw new k(a);case K.code:throw new K(a);case Z.code:throw new Z(a);case J.code:throw new J(a);case X.code:throw new X(a);case Q.code:throw new Q(a);case Y.code:throw new Y(a);case ee.code:throw new ee(a);case 5e3:throw new g(a);default:throw x instanceof d?x:new fe(a)}}},{delay:({count:x,error:a})=>{if(a&&a instanceof E){let u=a?.headers?.get("Retry-After");if(u?.match(/\d/))return Number.parseInt(u,10)*1e3}return ~~(1<<x)*s},retryCount:p,shouldRetry:({error:x})=>Wt(x)}),{enabled:n,id:c})}}function Wt(e){return "code"in e&&typeof e.code=="number"?e.code===-1||e.code===M.code||e.code===B.code:e instanceof E&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:true}function mt(e){return {formatters:void 0,fees:void 0,serializers:void 0,...e}}ne();function ft(e,{errorInstance:r=new Error("timed out"),timeout:t,signal:o}){return new Promise((n,i)=>{(async()=>{let s;try{let p=new AbortController;t>0&&(s=setTimeout(()=>{o?p.abort():i(r);},t)),n(await e({signal:p?.signal||null}));}catch(p){p?.name==="AbortError"&&i(r),i(p);}finally{clearTimeout(s);}})();})}Ie();function Gt(){return {current:0,take(){return this.current++},reset(){this.current=0;}}}var pr=Gt();function Me(e,r={}){return {async request(t){let{body:o,fetchFn:n=r.fetchFn??fetch,onRequest:i=r.onRequest,onResponse:s=r.onResponse,timeout:p=r.timeout??1e4}=t,f={...r.fetchOptions??{},...t.fetchOptions??{}},{headers:m,method:c,signal:x}=f;try{let a=await ft(async({signal:y})=>{let re={...f,body:Array.isArray(o)?w(o.map(I=>({jsonrpc:"2.0",id:I.id??pr.take(),...I}))):w({jsonrpc:"2.0",id:o.id??pr.take(),...o}),headers:{"Content-Type":"application/json",...m},method:c||"POST",signal:x||(p>0?y:null)},Ne=new Request(e,re),xe=await i?.(Ne,re)??{...re,url:e};return await n(xe.url??e,xe)},{errorInstance:new oe({body:o,url:e}),timeout:p,signal:!0});s&&await s(a);let u;if(a.headers.get("Content-Type")?.startsWith("application/json"))u=await a.json();else {u=await a.text();try{u=JSON.parse(u||"{}");}catch(y){if(a.ok)throw y;u={error:u};}}if(!a.ok)throw new E({body:o,details:w(u.error)||a.statusText,headers:a.headers,status:a.status,url:e});return u}catch(a){throw a instanceof E||a instanceof oe?a:new E({body:o,cause:a,url:e})}}}}function _t(e,{body:r,onError:t,onResponse:o}){return e.request({body:r,onError:t,onResponse:o}),e}async function Kt(e,{body:r,timeout:t=1e4}){return e.requestAsync({body:r,timeout:t})}var cr={http(e,r){return Me(e).request(r)},webSocket:_t,webSocketAsync:Kt};var ue="0x0000000000000000000000000000000000000000";function Ue({key:e,methods:r,name:t,request:o,retryCount:n=3,retryDelay:i=150,timeout:s,type:p},f){let m=at();return {config:{key:e,methods:r,name:t,request:o,retryCount:n,retryDelay:i,timeout:s,type:p},request:ct(o,{methods:r,retryCount:n,retryDelay:i,uid:m}),value:f}}function mr(e,r={}){let{key:t="custom",methods:o,name:n="Custom Provider",retryDelay:i}=r;return ({retryCount:s})=>Ue({key:t,methods:o,name:n,request:e.request.bind(e),retryCount:r.retryCount??s,retryDelay:i,type:"custom"})}ne();S();var He=class extends d{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"});}};nt();function fr(e,r={}){let{batch:t,fetchFn:o,fetchOptions:n,key:i="http",methods:s,name:p="HTTP JSON-RPC",onFetchRequest:f,onFetchResponse:m,retryDelay:c,raw:x}=r;return ({chain:a,retryCount:u,timeout:y})=>{let{batchSize:re=1e3,wait:Ne=0}=typeof t=="object"?t:{},xe=r.retryCount??u,Oe=y??r.timeout??1e4,I=a?.rpcUrls.default.http[0];if(!I)throw new He;let dr=Me(I,{fetchFn:o,fetchOptions:n,onRequest:f,onResponse:m,timeout:Oe});return Ue({key:i,methods:s,name:p,async request({method:ht,params:bt}){let hr={method:ht,params:bt},{schedule:gt}=ot({id:I,wait:Ne,shouldSplitBatch(R){return R.length>re},fn:R=>dr.request({body:R}),sort:(R,Tt)=>R.id-Tt.id}),yt=async R=>t?gt(R):[await dr.request({body:R})],[{error:qe,result:br}]=await yt(hr);if(x)return {error:qe,result:br};if(qe)throw new v({body:hr,error:qe,url:I});return br},retryCount:xe,retryDelay:c,timeout:Oe,type:"http"},{fetchOptions:n,url:I})}}ne();ir();or();ye();pe();Yr();var Le=mt({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});var ur=new Map;async function ut({config:e,address:r,chainId:t,chains:o}){if(ur.has(r))return ur.get(r);if(orbitEvm.createViemClient(t,o)){let s=!!await core.getBytecode(e,{address:r});return ur.set(r,s),s}else return false}function _s(e,r){if(!e)throw new Error("Satellite EVM adapter requires a wagmi config object.");return {key:orbitCore.OrbitAdapter.EVM,connect:async({walletType:t,chainId:o})=>{let i=core.getConnectors(e).find(s=>orbitCore.getWalletTypeFromConnectorName(orbitCore.OrbitAdapter.EVM,satelliteCore.formatWalletName(s.name))===t);if(!i)throw new Error("Cannot find connector with this wallet type");try{await core.connect(e,{connector:i,chainId:o}),r&&!satelliteCore.isSafeApp&&await r();let s=core.getAccount(e);return {walletType:t,address:s.address??ue,chainId:s.chainId??Le.id,rpcURL:s.chain?.rpcUrls.default.http[0]??Le.rpcUrls.default.http[0],isConnected:s.isConnected,isContractAddress:!1}}catch(s){throw new Error(s instanceof Error?s.message:String(s))}},disconnect:async()=>await core.disconnect(e),getConnectors:()=>{let t=core.getConnectors(e);return {adapter:orbitCore.OrbitAdapter.EVM,connectors:t.map(o=>o)}},checkAndSwitchNetwork:async t=>await orbitEvm.checkAndSwitchChain(t,e),getBalance:async(t,o)=>{let n=await core.getBalance(e,{address:t,chainId:o});return {value:sr(n.value,n.decimals),symbol:n.symbol}},getExplorerUrl:t=>{let{chain:o}=core.getAccount(e),n=o?.blockExplorers?.default.url;return t?`${n}/${t}`:n},getName:t=>orbitEvm.getName(t),getAvatar:t=>orbitEvm.getAvatar(t),checkIsContractWallet:async({address:t,chainId:o})=>{let n=core.getChains(e);return await ut({config:e,address:t,chainId:o,chains:n})},autoConnectToSafeConnector:async()=>{await orbitCore.delay(null,100);let o=core.getConnectors(e).find(n=>n.name==="Safe");o&&await core.connect(e,{connector:o});}}}Fe.type="impersonated";function Fe(e){let r=e.features??{},t=false,o,n;return core.createConnector(i=>({id:"impersonated",name:"Impersonated Connector",type:Fe.type,async setup(){o=i.chains[0].id;},async connect({chainId:s}={}){if(r.connectError)throw typeof r.connectError=="boolean"?new g(new Error("Failed to connect.")):r.connectError;let{request:p}=await this.getProvider(),f=await p({method:"eth_requestAccounts"}),m=await this.getChainId();return s&&m!==s&&(m=(await this.switchChain({chainId:s})).id),t=true,{accounts:f,chainId:m}},async disconnect(){t=false,n=void 0;},async getAccounts(){if(!t)throw new Error("Not connected connector");let{request:s}=await this.getProvider();return (await s({method:"eth_accounts"})).map(ke)},async getChainId(){let{request:s}=await this.getProvider(),p=await s({method:"eth_chainId"});return ge(p,"number")},async isAuthorized(){return t?!!(await this.getAccounts()).length:false},async switchChain({chainId:s}){let p=i.chains.find(m=>m.id===s);if(!p)throw new k(new core.ChainNotConfiguredError);let{request:f}=await this.getProvider();return await f({method:"wallet_switchEthereumChain",params:[{chainId:U(s)}]}),p},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(ke)});},onChainChanged(s){let p=Number(s);i.emitter.emit("change",{chainId:p});},async onDisconnect(){i.emitter.emit("disconnect"),t=false,n=void 0;},async getProvider({chainId:s}={}){n=e.getAccountAddress()?[e.getAccountAddress()||ue]:void 0;let f=(i.chains.find(c=>c.id===s)??i.chains[0]).rpcUrls.default.http[0];return mr({request:async({method:c,params:x})=>{if(c==="eth_chainId")return U(o);if(c==="eth_requestAccounts")return n;if(c==="eth_signTypedData_v4"&&r.signTypedDataError)throw typeof r.signTypedDataError=="boolean"?new g(new Error("Failed to sign typed data.")):r.signTypedDataError;if(c==="wallet_switchEthereumChain"){if(r.switchChainError)throw typeof r.switchChainError=="boolean"?new g(new Error("Failed to switch chain.")):r.switchChainError;o=ge(x[0].chainId,"number"),this.onChainChanged(o.toString());return}if(c==="personal_sign"){if(r.signMessageError)throw typeof r.signMessageError=="boolean"?new g(new Error("Failed to sign message.")):r.signMessageError;c="eth_sign",x=[x[1],x[0]];}let a={method:c,params:x},{error:u,result:y}=await cr.http(f,{body:a});if(u)throw new v({body:a,error:u,url:f});return y}})({retryCount:1})}}))}var xo={allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/,/metissafe.tech$/],debug:false},dt=e=>{let r=connectors.injected(),t=connectors.coinbaseWallet({appName:e.appName,appLogoUrl:e.appLogoUrl}),o=connectors.safe({...xo}),n=[r,t,o],i=e.appUrl&&e.appIcons&&e.appName&&e.description?{name:e.appName,description:e.description,url:e.appUrl,icons:e.appIcons}:void 0;if(e.projectId){let s=connectors.walletConnect({projectId:e.projectId,metadata:i});n.push(s);}if(e.getImpersonatedAccount){let s=Fe({getAccountAddress:e.getImpersonatedAccount});n.push(s);}return n};var ho=e=>e.reduce((r,t)=>{let o=t.id;return r[o]=fr(),r},{}),ai=({chains:e,transports:r,projectId:t,appLogoUrl:o,appLogo:n,appUrl:i,appIcons:s,appName:p,getImpersonatedAccount:f,description:m,...c})=>{let x=dt({projectId:t,appLogoUrl:o,appUrl:i,appIcons:s,appName:p,getImpersonatedAccount:f,description:m});return core.createConfig({connectors:x,transports:r??ho(e),chains:e,...c})};/*! Bundled license information:
|
|
4
|
+
`)});}};Object.defineProperty(O,"code",{enumerable:true,configurable:true,writable:true,value:-32e3});q=class e extends h{constructor(r){super(r,{code:e.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"ResourceNotFoundRpcError"});}};Object.defineProperty(q,"code",{enumerable:true,configurable:true,writable:true,value:-32001});$=class e extends h{constructor(r){super(r,{code:e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."});}};Object.defineProperty($,"code",{enumerable:true,configurable:true,writable:true,value:-32002});j=class e extends h{constructor(r){super(r,{code:e.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."});}};Object.defineProperty(j,"code",{enumerable:true,configurable:true,writable:true,value:-32003});A=class e extends h{constructor(r,{method:t}={}){super(r,{code:e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`});}};Object.defineProperty(A,"code",{enumerable:true,configurable:true,writable:true,value:-32004});M=class e extends h{constructor(r){super(r,{code:e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."});}};Object.defineProperty(M,"code",{enumerable:true,configurable:true,writable:true,value:-32005});D=class e extends h{constructor(r){super(r,{code:e.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."});}};Object.defineProperty(D,"code",{enumerable:true,configurable:true,writable:true,value:-32006});g=class e extends b{constructor(r){super(r,{code:e.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."});}};Object.defineProperty(g,"code",{enumerable:true,configurable:true,writable:true,value:4001});V=class e extends b{constructor(r){super(r,{code:e.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."});}};Object.defineProperty(V,"code",{enumerable:true,configurable:true,writable:true,value:4100});W=class e extends b{constructor(r,{method:t}={}){super(r,{code:e.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`});}};Object.defineProperty(W,"code",{enumerable:true,configurable:true,writable:true,value:4200});G=class e extends b{constructor(r){super(r,{code:e.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."});}};Object.defineProperty(G,"code",{enumerable:true,configurable:true,writable:true,value:4900});_=class e extends b{constructor(r){super(r,{code:e.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."});}};Object.defineProperty(_,"code",{enumerable:true,configurable:true,writable:true,value:4901});k=class e extends b{constructor(r){super(r,{code:e.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."});}};Object.defineProperty(k,"code",{enumerable:true,configurable:true,writable:true,value:4902});K=class e extends b{constructor(r){super(r,{code:e.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."});}};Object.defineProperty(K,"code",{enumerable:true,configurable:true,writable:true,value:5700});Z=class e extends b{constructor(r){super(r,{code:e.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."});}};Object.defineProperty(Z,"code",{enumerable:true,configurable:true,writable:true,value:5710});J=class e extends b{constructor(r){super(r,{code:e.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."});}};Object.defineProperty(J,"code",{enumerable:true,configurable:true,writable:true,value:5720});X=class e extends b{constructor(r){super(r,{code:e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"});}};Object.defineProperty(X,"code",{enumerable:true,configurable:true,writable:true,value:5730});Q=class e extends b{constructor(r){super(r,{code:e.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."});}};Object.defineProperty(Q,"code",{enumerable:true,configurable:true,writable:true,value:5740});Y=class e extends b{constructor(r){super(r,{code:e.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."});}};Object.defineProperty(Y,"code",{enumerable:true,configurable:true,writable:true,value:5750});ee=class e extends b{constructor(r){super(r,{code:e.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."});}};Object.defineProperty(ee,"code",{enumerable:true,configurable:true,writable:true,value:5760});fe=class extends h{constructor(r){super(r,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."});}};});function rt(){let e=()=>{},r=()=>{};return {promise:new Promise((o,n)=>{e=o,r=n;}),resolve:e,reject:r}}var tt=l(()=>{});function ot({fn:e,id:r,shouldSplitBatch:t,wait:o=0,sort:n}){let i=async()=>{let c=f();s();let x=c.map(({args:a})=>a);x.length!==0&&e(x).then(a=>{n&&Array.isArray(a)&&a.sort(n);for(let u=0;u<c.length;u++){let{resolve:y}=c[u];y?.([a[u],a]);}}).catch(a=>{for(let u=0;u<c.length;u++){let{reject:y}=c[u];y?.(a);}});},s=()=>ar.delete(r),p=()=>f().map(({args:c})=>c),f=()=>ar.get(r)||[],m=c=>ar.set(r,[...f(),c]);return {flush:s,async schedule(c){let{promise:x,resolve:a,reject:u}=rt();return t?.([...p(),c])&&i(),f().length>0?(m({args:c,resolve:a,reject:u}),x):(m({args:c,resolve:a,reject:u}),setTimeout(i,o),x)}}}var ar,nt=l(()=>{tt();ar=new Map;});async function st(e){return new Promise(r=>setTimeout(r,e))}function it(e,{delay:r=100,retryCount:t=2,shouldRetry:o=()=>true}={}){return new Promise((n,i)=>{let s=async({count:p=0}={})=>{let f=async({error:m})=>{let c=typeof r=="function"?r({count:p,error:m}):r;c&&await st(c),s({count:p+1});};try{let m=await e();n(m);}catch(m){if(p<t&&await o({count:p,error:m}))return f({error:m});i(m);}};s();})}var Pe=256,ze;function at(e=11){if(!ze||Pe+e>256*2){ze="",Pe=0;for(let r=0;r<256;r++)ze+=(256+Math.random()*256|0).toString(16).substring(1);}return ze.substring(Pe,Pe+++e)}S();ne();ir();pe();ve();var Be=new z(8192);function pt(e,{enabled:r=true,id:t}){if(!r||!t)return e();if(Be.get(t))return Be.get(t);let o=e().finally(()=>Be.delete(t));return Be.set(t,o),o}Ie();function ct(e,r={}){return async(t,o={})=>{let{dedupe:n=false,methods:i,retryDelay:s=150,retryCount:p=3,uid:f}={...r,...o},{method:m}=t;if(i?.exclude?.includes(m))throw new A(new Error("method not supported"),{method:m});if(i?.include&&!i.include.includes(m))throw new A(new Error("method not supported"),{method:m});let c=n?we(`${f}.${w(t)}`):void 0;return pt(()=>it(async()=>{try{return await e(t)}catch(x){let a=x;switch(a.code){case H.code:throw new H(a);case L.code:throw new L(a);case F.code:throw new F(a,{method:t.method});case N.code:throw new N(a);case B.code:throw new B(a);case O.code:throw new O(a);case q.code:throw new q(a);case $.code:throw new $(a);case j.code:throw new j(a);case A.code:throw new A(a,{method:t.method});case M.code:throw new M(a);case D.code:throw new D(a);case g.code:throw new g(a);case V.code:throw new V(a);case W.code:throw new W(a);case G.code:throw new G(a);case _.code:throw new _(a);case k.code:throw new k(a);case K.code:throw new K(a);case Z.code:throw new Z(a);case J.code:throw new J(a);case X.code:throw new X(a);case Q.code:throw new Q(a);case Y.code:throw new Y(a);case ee.code:throw new ee(a);case 5e3:throw new g(a);default:throw x instanceof d?x:new fe(a)}}},{delay:({count:x,error:a})=>{if(a&&a instanceof E){let u=a?.headers?.get("Retry-After");if(u?.match(/\d/))return Number.parseInt(u,10)*1e3}return ~~(1<<x)*s},retryCount:p,shouldRetry:({error:x})=>Wt(x)}),{enabled:n,id:c})}}function Wt(e){return "code"in e&&typeof e.code=="number"?e.code===-1||e.code===M.code||e.code===B.code:e instanceof E&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:true}function mt(e){return {formatters:void 0,fees:void 0,serializers:void 0,...e}}ne();function ft(e,{errorInstance:r=new Error("timed out"),timeout:t,signal:o}){return new Promise((n,i)=>{(async()=>{let s;try{let p=new AbortController;t>0&&(s=setTimeout(()=>{o?p.abort():i(r);},t)),n(await e({signal:p?.signal||null}));}catch(p){p?.name==="AbortError"&&i(r),i(p);}finally{clearTimeout(s);}})();})}Ie();function Gt(){return {current:0,take(){return this.current++},reset(){this.current=0;}}}var pr=Gt();function Me(e,r={}){return {async request(t){let{body:o,fetchFn:n=r.fetchFn??fetch,onRequest:i=r.onRequest,onResponse:s=r.onResponse,timeout:p=r.timeout??1e4}=t,f={...r.fetchOptions??{},...t.fetchOptions??{}},{headers:m,method:c,signal:x}=f;try{let a=await ft(async({signal:y})=>{let re={...f,body:Array.isArray(o)?w(o.map(I=>({jsonrpc:"2.0",id:I.id??pr.take(),...I}))):w({jsonrpc:"2.0",id:o.id??pr.take(),...o}),headers:{"Content-Type":"application/json",...m},method:c||"POST",signal:x||(p>0?y:null)},Ne=new Request(e,re),xe=await i?.(Ne,re)??{...re,url:e};return await n(xe.url??e,xe)},{errorInstance:new oe({body:o,url:e}),timeout:p,signal:!0});s&&await s(a);let u;if(a.headers.get("Content-Type")?.startsWith("application/json"))u=await a.json();else {u=await a.text();try{u=JSON.parse(u||"{}");}catch(y){if(a.ok)throw y;u={error:u};}}if(!a.ok)throw new E({body:o,details:w(u.error)||a.statusText,headers:a.headers,status:a.status,url:e});return u}catch(a){throw a instanceof E||a instanceof oe?a:new E({body:o,cause:a,url:e})}}}}function _t(e,{body:r,onError:t,onResponse:o}){return e.request({body:r,onError:t,onResponse:o}),e}async function Kt(e,{body:r,timeout:t=1e4}){return e.requestAsync({body:r,timeout:t})}var cr={http(e,r){return Me(e).request(r)},webSocket:_t,webSocketAsync:Kt};var ue="0x0000000000000000000000000000000000000000";function Ue({key:e,methods:r,name:t,request:o,retryCount:n=3,retryDelay:i=150,timeout:s,type:p},f){let m=at();return {config:{key:e,methods:r,name:t,request:o,retryCount:n,retryDelay:i,timeout:s,type:p},request:ct(o,{methods:r,retryCount:n,retryDelay:i,uid:m}),value:f}}function mr(e,r={}){let{key:t="custom",methods:o,name:n="Custom Provider",retryDelay:i}=r;return ({retryCount:s})=>Ue({key:t,methods:o,name:n,request:e.request.bind(e),retryCount:r.retryCount??s,retryDelay:i,type:"custom"})}ne();S();var He=class extends d{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"});}};nt();function fr(e,r={}){let{batch:t,fetchFn:o,fetchOptions:n,key:i="http",methods:s,name:p="HTTP JSON-RPC",onFetchRequest:f,onFetchResponse:m,retryDelay:c,raw:x}=r;return ({chain:a,retryCount:u,timeout:y})=>{let{batchSize:re=1e3,wait:Ne=0}=typeof t=="object"?t:{},xe=r.retryCount??u,Oe=y??r.timeout??1e4,I=a?.rpcUrls.default.http[0];if(!I)throw new He;let dr=Me(I,{fetchFn:o,fetchOptions:n,onRequest:f,onResponse:m,timeout:Oe});return Ue({key:i,methods:s,name:p,async request({method:ht,params:bt}){let hr={method:ht,params:bt},{schedule:gt}=ot({id:I,wait:Ne,shouldSplitBatch(R){return R.length>re},fn:R=>dr.request({body:R}),sort:(R,Tt)=>R.id-Tt.id}),yt=async R=>t?gt(R):[await dr.request({body:R})],[{error:qe,result:br}]=await yt(hr);if(x)return {error:qe,result:br};if(qe)throw new v({body:hr,error:qe,url:I});return br},retryCount:xe,retryDelay:c,timeout:Oe,type:"http"},{fetchOptions:n,url:I})}}ne();ir();or();ye();pe();Yr();var Le=mt({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});var ur=new Map;async function ut({config:e,address:r,chainId:t,chains:o}){if(ur.has(r))return ur.get(r);if(orbitEvm.createViemClient(t,o)){let s=!!await core.getBytecode(e,{address:r});return ur.set(r,s),s}else return false}function _s(e,r){if(!e)throw new Error("Satellite EVM adapter requires a wagmi config object.");return {key:orbitCore.OrbitAdapter.EVM,connect:async({walletType:t,chainId:o})=>{let i=core.getConnectors(e).find(s=>orbitCore.getWalletTypeFromConnectorName(orbitCore.OrbitAdapter.EVM,satelliteCore.formatWalletName(s.name))===t);if(!i)throw new Error("Cannot find connector with this wallet type");try{await core.connect(e,{connector:i,chainId:o}),r&&!satelliteCore.isSafeApp&&await r();let s=core.getAccount(e);return {walletType:t,address:s.address??ue,chainId:s.chainId??Le.id,rpcURL:s.chain?.rpcUrls.default.http[0]??Le.rpcUrls.default.http[0],isConnected:s.isConnected,isContractAddress:!1}}catch(s){throw new Error(s instanceof Error?s.message:String(s))}},disconnect:async()=>await core.disconnect(e),getConnectors:()=>{let t=core.getConnectors(e);return {adapter:orbitCore.OrbitAdapter.EVM,connectors:t.map(o=>o)}},checkAndSwitchNetwork:async t=>await orbitEvm.checkAndSwitchChain(t,e),getBalance:async(t,o)=>{let n=await core.getBalance(e,{address:t,chainId:o});return {value:sr(n.value,n.decimals),symbol:n.symbol}},getExplorerUrl:t=>{let{chain:o}=core.getAccount(e),n=o?.blockExplorers?.default.url;return t?`${n}/${t}`:n},getName:t=>orbitEvm.getName(t),getAvatar:t=>orbitEvm.getAvatar(t),checkIsContractWallet:async({address:t,chainId:o})=>{let n=core.getChains(e);return await ut({config:e,address:t,chainId:o,chains:n})},autoConnectToSafeConnector:async()=>{await orbitCore.delay(null,200);let o=core.getConnectors(e).find(n=>n.name==="Safe");o&&await core.connect(e,{connector:o});}}}Fe.type="impersonated";function Fe(e){let r=e.features??{},t=false,o,n;return core.createConnector(i=>({id:"impersonated",name:"Impersonated Connector",type:Fe.type,async setup(){o=i.chains[0].id;},async connect({chainId:s}={}){if(r.connectError)throw typeof r.connectError=="boolean"?new g(new Error("Failed to connect.")):r.connectError;let{request:p}=await this.getProvider(),f=await p({method:"eth_requestAccounts"}),m=await this.getChainId();return s&&m!==s&&(m=(await this.switchChain({chainId:s})).id),t=true,{accounts:f,chainId:m}},async disconnect(){t=false,n=void 0;},async getAccounts(){if(!t)throw new Error("Not connected connector");let{request:s}=await this.getProvider();return (await s({method:"eth_accounts"})).map(ke)},async getChainId(){let{request:s}=await this.getProvider(),p=await s({method:"eth_chainId"});return ge(p,"number")},async isAuthorized(){return t?!!(await this.getAccounts()).length:false},async switchChain({chainId:s}){let p=i.chains.find(m=>m.id===s);if(!p)throw new k(new core.ChainNotConfiguredError);let{request:f}=await this.getProvider();return await f({method:"wallet_switchEthereumChain",params:[{chainId:U(s)}]}),p},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(ke)});},onChainChanged(s){let p=Number(s);i.emitter.emit("change",{chainId:p});},async onDisconnect(){i.emitter.emit("disconnect"),t=false,n=void 0;},async getProvider({chainId:s}={}){n=e.getAccountAddress()?[e.getAccountAddress()||ue]:void 0;let f=(i.chains.find(c=>c.id===s)??i.chains[0]).rpcUrls.default.http[0];return mr({request:async({method:c,params:x})=>{if(c==="eth_chainId")return U(o);if(c==="eth_requestAccounts")return n;if(c==="eth_signTypedData_v4"&&r.signTypedDataError)throw typeof r.signTypedDataError=="boolean"?new g(new Error("Failed to sign typed data.")):r.signTypedDataError;if(c==="wallet_switchEthereumChain"){if(r.switchChainError)throw typeof r.switchChainError=="boolean"?new g(new Error("Failed to switch chain.")):r.switchChainError;o=ge(x[0].chainId,"number"),this.onChainChanged(o.toString());return}if(c==="personal_sign"){if(r.signMessageError)throw typeof r.signMessageError=="boolean"?new g(new Error("Failed to sign message.")):r.signMessageError;c="eth_sign",x=[x[1],x[0]];}let a={method:c,params:x},{error:u,result:y}=await cr.http(f,{body:a});if(u)throw new v({body:a,error:u,url:f});return y}})({retryCount:1})}}))}var xo={allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/,/metissafe.tech$/],debug:false},dt=e=>{let r=connectors.injected(),t=connectors.coinbaseWallet({appName:e.appName,appLogoUrl:e.appLogoUrl}),o=connectors.safe({...xo}),n=[r,t,o],i=e.appUrl&&e.appIcons&&e.appName&&e.description?{name:e.appName,description:e.description,url:e.appUrl,icons:e.appIcons}:void 0;if(e.projectId){let s=connectors.walletConnect({projectId:e.projectId,metadata:i});n.push(s);}if(e.getImpersonatedAccount){let s=Fe({getAccountAddress:e.getImpersonatedAccount});n.push(s);}return n};var ho=e=>e.reduce((r,t)=>{let o=t.id;return r[o]=fr(),r},{}),ai=({chains:e,transports:r,projectId:t,appLogoUrl:o,appLogo:n,appUrl:i,appIcons:s,appName:p,getImpersonatedAccount:f,description:m,...c})=>{let x=dt({projectId:t,appLogoUrl:o,appUrl:i,appIcons:s,appName:p,getImpersonatedAccount:f,description:m});return core.createConfig({connectors:x,transports:r??ho(e),chains:e,...c})};/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
@noble/hashes/esm/utils.js:
|
|
7
7
|
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|