1import{eU as at,eJ as st,eY as Ha,d6 as Da,ab as Tt,fB as L,cC as q,eP as St,d7 as K,fs as vt,bI as he,fG as It,da as $a,bW as Pt,bq as Me,c8 as Ct,bT as At,fv as Ga,a2 as Rt,am as Bt,cY as $,bN as Fe,by as j,B as ge,d5 as y,fr as Mt,bP as za,a1 as Va,f8 as ne,bE as nt,fE as qt,fu as $e,fM as Wa,bS as Ge,fL as Ka,eN as _,f5 as J,cT as kt,cV as Lt,fW as Ja,d4 as pe,cZ as I,ax as Ot,aw as G,cW as w,fz as Nt,ao as Ft,d3 as Ut,ae as jt,fK as Ht,eR as Ue,ck as Dt,cR as $t,cm as Gt,cv as ye,c5 as zt,fe as Vt,bD as Wt,eW as Y,cB as v,q as be,bp as ze,f6 as Ya,cF as fe,bo as Ve,aG as Xa,fP as Qa,b5 as rt,e$ as Kt,bX as Za,fd as Jt,s as le,cM as es,cO as Yt,fN as Xt,fh as Qt,fX as We,f3 as ts,fq as as,bM as ss,cI as ns,fQ as rs,ch as os,bL as Ke,fp as is,fc as cs,co as us,bi as Zt,bQ as ea,cQ as qe,cK as ds,aU as ta,A as aa,a as je,bF as sa,U as na,fb as ra,b as ls,c as hs,d as fs,e as ms,f as gs,g as ps,h as ys,i as bs,j as ws,k as _s,l as Es,m as xs,n as Ts,o as Ss,p as vs,r as Is,t as Ps,u as Cs,v as As,w as Rs,x as Bs,y as Ms,C as qs,z as ks,D as Ls,E as Os,F as Ns,G as Fs,H as Us,I as js,J as Hs,K as Ds,L as $s,M as Gs,N as zs,O as Vs,P as Ws,R as Ks,S as Js,T as Ys,V as Xs,X as Qs,Y as Zs,Z as en,_ as tn,a0 as an,a3 as sn,a4 as nn,a5 as rn,a6 as on,a7 as cn,a8 as un,a9 as dn,aa as ln,ac as hn,ad as fn,af as mn,ag as gn,ah as pn,ai as yn,aj as bn,ak as wn,al as _n,an as En,ap as xn,aq as Tn,ar as Sn,as as vn,at as In,au as Pn,av as Cn,ay as An,az as Rn,aA as Bn,aB as Mn,aE as qn,aF as kn,aH as Ln,aI as On,aJ as Nn,aK as Fn,aL as Un,aM as jn,aN as Hn,aO as Dn,aP as $n,aQ as Gn,aR as zn,aS as Vn,aT as Wn,aV as Kn,aW as Jn,aX as Yn,aY as Xn,aZ as Qn,a_ as Zn,a$ as er,b0 as tr,b1 as ar,b2 as sr,b3 as nr,b4 as rr,b6 as or,b7 as ir,b8 as cr,b9 as ur,ba as dr,bb as lr,bc as hr,bd as fr,be as mr,bf as gr,bg as pr,bh as yr,bj as br,bk as wr,bl as _r,br as Er,bs as xr,bt as Tr,bu as Sr,bw as vr,bx as Ir,bz as Pr,bA as Cr,bB as Ar,bG as Rr,bJ as Br,bK as Mr,bR as qr,bU as kr,bV as Lr,bY as Or,bZ as Nr,b_ as Fr,b$ as Ur,c0 as jr,c1 as Hr,c2 as Dr,c3 as $r,c4 as Gr,c6 as zr,c7 as Vr,c9 as Wr,ca as Kr,cb as Jr,cc as Yr,cd as Xr,ce as ot,cf as it,cg as Qr,cj as Zr,cl as eo,cn as to,cp as ao,cq as so,cr as no,cs as ro,ct as oo,cu as io,cw as co,cx as uo,cy as lo,cz as ho,cE as fo,cH as mo,fC as ct,fH as re,fD as ut,cN as go,cS as po,cU as yo,cX as bo,c_ as wo,c$ as _o,d0 as Eo,d8 as xo,dc as To,dd as So,de as vo,df as Io,dg as Po,dh as Co,di as Ao,dj as Ro,dk as Bo,dl as Mo,dm as qo,dn as ko,dp as Lo,dq as Oo,dr as No,ds as Fo,dt as Uo,du as jo,dv as Ho,dw as Do,dx as $o,dy as Go,dz as zo,dA as Vo,dB as Wo,dC as Ko,dD as Jo,dE as Yo,dF as Xo,dG as Qo,dH as Zo,dI as ei,dJ as ti,dK as ai,dL as si,dM as ni,dN as ri,dO as oi,dP as ii,dQ as ci,dR as ui,dS as di,dT as li,dU as hi,dV as fi,dW as mi,dX as gi,dY as pi,dZ as yi,d_ as bi,d$ as wi,e0 as _i,e1 as Ei,e2 as xi,e3 as Ti,e4 as Si,e5 as vi,e6 as Ii,e7 as Pi,e8 as Ci,e9 as Ai,ea as Ri,eb as Bi,ec as Mi,ed as qi,ee as ki,ef as Li,eg as Oi,eh as Ni,ei as Fi,ej as Ui,ek as ji,el as Hi,em as Di,en as $i,eo as Gi,ep as zi,eq as Vi,er as Wi,es as Ki,et as Ji,eu as Yi,ev as Xi,ew as Qi,ex as Zi,ey as ec,ez as tc,eA as ac,eB as sc,eC as nc,eD as rc,eE as oc,eF as ic,eG as cc,eH as uc,eI as dc,eK as lc,eL as hc,eM as fc,eQ as mc,eS as gc,eT as pc,eV as yc,eX as bc,e_ as wc,f0 as _c,f2 as Ec,f7 as xc,f9 as Tc,fa as Sc,ff as dt,fi as vc,fl as Ic,fo as Pc,ft as Cc,fw as Ac,fx as Rc,fy as Bc,fA as Mc,fI as lt,fF as qc,fJ as kc,fR as Lc,fS as Oc,fU as Nc,fV as Fc,fY as Uc,bH as x,cD as jc,cJ as Hc}from"./index-BRoQaf11.js";import{d as Dc}from"./index-DHBEH4yh.js";import{i as $c,a as oa,b as ia,c as Gc,d as zc,e as ca,s as ua,w as da,k as la,j as Vc,o as ha,B as Wc,W as Kc,f as Jc,g as Yc,h as Xc,p as ht,n as Qc,l as Zc,m as eu,z as tu}from"./parseSignature-ZiZdwPVs.js";import{ccipRequest as He,offchainLookup as au,offchainLookupAbiItem as su,offchainLookupSignature as nu}from"./ccip-Di22C8Hs.js";import{e as ru}from"./events-zUfRDNGD.js";function ou(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const r=Object.getOwnPropertyDescriptor(a,n);r&&Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function iu(e){let t;if(typeof e=="string")t=at(e,{modifiers:st});else{const s=Ha(e),a=e.length;for(let n=0;n<a;n++){const r=e[n];if(!Da(r)){t=at(r,{modifiers:st,structs:s});break}}}if(!t)throw new Tt({param:e});return t}function De(e){return!e||typeof e!="object"||!("BYTES_PER_ELEMENT"in e)?!1:e.BYTES_PER_ELEMENT===1&&e.constructor.name==="Uint8Array"}function cu(e){return e.opcode==="CREATE2"?ma(e):fa(e)}function fa(e){const t=L(q(e.from));let s=L(e.nonce);return s[0]===0&&(s=new Uint8Array([])),q(`0x${K(It([t,s],"bytes")).slice(26)}`)}function ma(e){const t=L(q(e.from)),s=St(De(e.salt)?e.salt:L(e.salt),{size:32}),a="bytecodeHash"in e?De(e.bytecodeHash)?e.bytecodeHash:L(e.bytecodeHash):K(e.bytecode,"bytes");return q(vt(K(he([L("0xff"),t,s,a])),12))}function uu({batchGateways:e,ccipRequest:t=He}){return{async request({data:s,sender:a,urls:n}){if(n.includes($a))return t({data:s,sender:a,urls:e});{const[r,i]=Pt({abi:Me,functionName:"query",data:await t({data:Ct({abi:Me,functionName:"query",args:[[{sender:a,data:s,urls:n}]]}),sender:a,urls:e})});if(r[0]){let c;try{const o=At({abi:[...Me,Ga],data:i[0]});if(o.errorName==="HttpError")c=new Rt({body:{message:o.args[1]},status:o.args[0],url:n.join(" | ")});else{const u=o.args[0];u&&(c=new Error(u))}}catch{}throw c??new Error("An unknown error occurred.")}return i[0]}}}}function du({chains:e,id:t}){return e.find(s=>
1s.id===t)}function Je(e,t="hex"){const s=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new Bt(e);return $(e)}return e})(),a=Fe(s,{recursiveReadLimit:Number.POSITIVE_INFINITY});return ga(a,t)}function ga(e,t="hex"){if(e.bytes.length===0)return t==="hex"?j(e.bytes):e.bytes;const s=e.readByte();if(s<128&&e.decrementPosition(1),s<192){const n=ft(e,s,128),r=e.readBytes(n);return t==="hex"?j(r):r}const a=ft(e,s,192);return lu(e,a,t)}function ft(e,t,s){if(s===128&&t<128)return 1;if(t<=s+55)return t-s;if(t===s+55+1)return e.readUint8();if(t===s+55+2)return e.readUint16();if(t===s+55+3)return e.readUint24();if(t===s+55+4)return e.readUint32();throw new ge("Invalid RLP prefix")}function lu(e,t,s){const a=e.position,n=[];for(;e.position-a<t;)n.push(ga(e,s));return n}function pa(e){return y(e)&&Mt(e)===32}const hu=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),ya=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),fu=ya.map(e=>(9*e+5)%16),ba=(()=>{const s=[[ya],[fu]];for(let a=0;a<4;a++)for(let n of s)n.push(n[a].map(r=>hu[r]));return s})(),wa=ba[0],_a=ba[1],Ea=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),mu=wa.map((e,t)=>e.map(s=>Ea[t][s])),gu=_a.map((e,t)=>e.map(s=>Ea[t][s])),pu=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),yu=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function mt(e,t,s,a){return e===0?t^s^a:e===1?t&s|~t&a:e===2?(t|~s)^a:e===3?t&a|s&~a:t^(s|~a)}const oe=new Uint32Array(16);class bu extends Va{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:s,h2:a,h3:n,h4:r}=this;return[t,s,a,n,r]}set(t,s,a,n,r){this.h0=t|0,this.h1=s|0,this.h2=a|0,this.h3=n|0,this.h4=r|0}process(t,s){for(let d=0;d<16;d++,s+=4)oe[d]=t.getUint32(s,!0);let a=this.h0|0,n=a,r=this.h1|0,i=r,c=this.h2|0,o=c,u=this.h3|0,l=u,h=this.h4|0,f=h;for(let d=0;d<5;d++){const m=4-d,g=pu[d],b=yu[d],T=wa[d],E=_a[d],C=mu[d],P=gu[d];for(let S=0;S<16;S++){const p=ne(a+mt(d,r,c,u)+oe[T[S]]+g,C[S])+h|0;a=h,h=u,u=ne(c,10)|0,c=r,r=p}for(let S=0;S<16;S++){const p=ne(n+mt(m,i,o,l)+oe[E[S]]+b,P[S])+f|0;n=f,f=l,l=ne(o,10)|0,o=i,i=p}}this.set(this.h1+c+l|0,this.h2+u+f|0,this.h3+h+n|0,this.h4+a+i|0,this.h0+r+o|0)}roundClean(){nt(oe)}destroy(){this.destroyed=!0,nt(this.buffer),this.set(0,0,0,0,0)}}const wu=za(()=>new bu),_u=wu;function Eu(e,t){const s=t||"hex",a=_u(y(e,{strict:!1})?L(e):e);return s==="bytes"?a:qt(a)}function xa(e){return $e(e,-32)===$c}function Ta(e){return Wa(e)}function xu(e){if(!xa(e))return{signature:e};const[t,s,a]=Ge([{type:"address"},{type:"bytes"},{type:"bytes"}],e);return{address:t,data:s,signature:a}}function Tu(e){if(!Ta(e))return{signature:e};const{authorization:t,to:s,...a}=Ka(e);return{authorization:{address:t.address,chainId:t.chainId,nonce:Number(t.nonce),r:_(t.r,{size:32}),s:_(t.s,{size:32}),yParity:t.yParity},...s?{address:s}:{},...a}}async function Sa({message:e,signature:t}){return J({hash:kt(e),signature:t})}async function va(e){const{domain:t,message:s,primaryType:a,signature:n,types:r}=e;return J({hash:Lt({domain:t,message:s,primaryType:a,types:r}),signature:n})}function Su(e){const{address:t,data:s,signature:a,to:n="hex"}=e,r=Ja({authorization:{address:e.authorization.address,chainId:e.authorization.chainId,nonce:BigInt(e.authorization.nonce),r:BigInt(e.authorization.r),s:BigInt(e.authorization.s),yParity:e.authorization.yParity},data:s,signature:a,to:t});return n==="hex"?r:$(r)}async function vu({address:e,hash:t,signature:s}){return pe(q(e),await J({hash:t,signature:s}))}async function Iu({address:e,message:t,signature:s}){return pe(q(e),await Sa({message:t,signature:s}))}async function Pu(e){const{address:t,domain:s,message:a,primaryType:n,signature:r,types:i}=e;return pe(q(t),await va({domain:s,message:a,primaryType:n,signature:r,types:i}))}function Ia(e){const t=$e(e,0,1);if(t==="0x04")return"eip7702";if(t==="0x03")return"eip4844";if(t==="0x02")return"eip1559";if(t==="0x01")return"eip2930";if(t!=="0x"&&I(t)>=192)return"legacy";throw new Ot({serializedType:t})}function Pa(e){const t=Ia(e);return t==="eip1559"?Ru(e):t==="eip2930"?Bu(e):t==="eip4844"?Au(e):t==="eip7702"?Cu(e):Mu(e)}function Cu(e){const t=we(e),[s,a,n,r,i,c,o,u,l,h,f,d,m]=t;if(t.length!==10&&t.length!==13)throw new G({attributes:{chainId:s,nonce:a,maxPriorityFeePerGas:n,maxFeePerGas:r,gas:i,to:c,value:o,data:u,accessList:l,authorizationList:h,...t.length>9?{v:f,r:d,s:m}:{}},serializedTransaction:e,type:"eip7702"});const g={chainId:I(s),type:"eip7702"};return y(c)&&c!=="0x"&&(g.to=c),y(i)&&i!=="0x"&&(g.gas=w(i)),y(u)&&u!=="0x"&&(g.data=u),y(a)&&(g.nonce=a==="0x"?0:I(a)
1),y(o)&&o!=="0x"&&(g.value=w(o)),y(r)&&r!=="0x"&&(g.maxFeePerGas=w(r)),y(n)&&n!=="0x"&&(g.maxPriorityFeePerGas=w(n)),l.length!==0&&l!=="0x"&&(g.accessList=_e(l)),h.length!==0&&h!=="0x"&&(g.authorizationList=qu(h)),zc(g),{...t.length===13?X(t):void 0,...g}}function Au(e){const t=we(e),s=t.length===4,a=s?t[0]:t,n=s?t.slice(1):[],[r,i,c,o,u,l,h,f,d,m,g,b,T,E]=a,[C,P,S]=n;if(!(a.length===11||a.length===14))throw new G({attributes:{chainId:r,nonce:i,maxPriorityFeePerGas:c,maxFeePerGas:o,gas:u,to:l,value:h,data:f,accessList:d,...a.length>9?{v:b,r:T,s:E}:{}},serializedTransaction:e,type:"eip4844"});const p={blobVersionedHashes:g,chainId:I(r),to:l,type:"eip4844"};return y(u)&&u!=="0x"&&(p.gas=w(u)),y(f)&&f!=="0x"&&(p.data=f),y(i)&&(p.nonce=i==="0x"?0:I(i)),y(h)&&h!=="0x"&&(p.value=w(h)),y(m)&&m!=="0x"&&(p.maxFeePerBlobGas=w(m)),y(o)&&o!=="0x"&&(p.maxFeePerGas=w(o)),y(c)&&c!=="0x"&&(p.maxPriorityFeePerGas=w(c)),d.length!==0&&d!=="0x"&&(p.accessList=_e(d)),C&&P&&S&&(p.sidecars=Nt({blobs:C,commitments:P,proofs:S})),Gc(p),{...a.length===14?X(a):void 0,...p}}function Ru(e){const t=we(e),[s,a,n,r,i,c,o,u,l,h,f,d]=t;if(!(t.length===9||t.length===12))throw new G({attributes:{chainId:s,nonce:a,maxPriorityFeePerGas:n,maxFeePerGas:r,gas:i,to:c,value:o,data:u,accessList:l,...t.length>9?{v:h,r:f,s:d}:{}},serializedTransaction:e,type:"eip1559"});const m={chainId:I(s),type:"eip1559"};return y(c)&&c!=="0x"&&(m.to=c),y(i)&&i!=="0x"&&(m.gas=w(i)),y(u)&&u!=="0x"&&(m.data=u),y(a)&&(m.nonce=a==="0x"?0:I(a)),y(o)&&o!=="0x"&&(m.value=w(o)),y(r)&&r!=="0x"&&(m.maxFeePerGas=w(r)),y(n)&&n!=="0x"&&(m.maxPriorityFeePerGas=w(n)),l.length!==0&&l!=="0x"&&(m.accessList=_e(l)),oa(m),{...t.length===12?X(t):void 0,...m}}function Bu(e){const t=we(e),[s,a,n,r,i,c,o,u,l,h,f]=t;if(!(t.length===8||t.length===11))throw new G({attributes:{chainId:s,nonce:a,gasPrice:n,gas:r,to:i,value:c,data:o,accessList:u,...t.length>8?{v:l,r:h,s:f}:{}},serializedTransaction:e,type:"eip2930"});const d={chainId:I(s),type:"eip2930"};return y(i)&&i!=="0x"&&(d.to=i),y(r)&&r!=="0x"&&(d.gas=w(r)),y(o)&&o!=="0x"&&(d.data=o),y(a)&&(d.nonce=a==="0x"?0:I(a)),y(c)&&c!=="0x"&&(d.value=w(c)),y(n)&&n!=="0x"&&(d.gasPrice=w(n)),u.length!==0&&u!=="0x"&&(d.accessList=_e(u)),ia(d),{...t.length===11?X(t):void 0,...d}}function Mu(e){const t=Je(e,"hex"),[s,a,n,r,i,c,o,u,l]=t;if(!(t.length===6||t.length===9))throw new G({attributes:{nonce:s,gasPrice:a,gas:n,to:r,value:i,data:c,...t.length>6?{v:o,r:u,s:l}:{}},serializedTransaction:e,type:"legacy"});const h={type:"legacy"};
1if(y(r)&&r!=="0x"&&(h.to=r),y(n)&&n!=="0x"&&(h.gas=w(n)),y(c)&&c!=="0x"&&(h.data=c),y(s)&&(h.nonce=s==="0x"?0:I(s)),y(i)&&i!=="0x"&&(h.value=w(i)),y(a)&&a!=="0x"&&(h.gasPrice=w(a)),ca(h),t.length===6)return h;const f=y(o)&&o!=="0x"?w(o):0n;if(l==="0x"&&u==="0x")return f>0&&(h.chainId=Number(f)),h;const d=f,m=Number((d-35n)/2n);if(m>0)h.chainId=m;else if(d!==27n&&d!==28n)throw new Ft({v:d});return h.v=d,h.s=l,h.r=u,h.yParity=d%2n===0n?1:0,h}function we(e){return Je(`0x${e.slice(4)}`,"hex")}function _e(e){const t=[];for(let s=0;s<e.length;s++){const[a,n]=e[s];if(!Ut(a,{strict:!1}))throw new jt({address:a});t.push({address:a,storageKeys:n.map(r=>pa(r)?r:Ht(r))})}return t}function qu(e){const t=[];for(let s=0;s<e.length;s++){const[a,n,r,i,c,o]=e[s];t.push({address:n,chainId:a==="0x"?0:I(a),nonce:r==="0x"?0:I(r),...X([i,c,o])})}return t}function X(e){const t=e.slice(-3),s=t[0]==="0x"||w(t[0])===0n?27n:28n;return{r:Ue(t[1],{size:32}),s:Ue(t[2],{size:32}),v:s,yParity:s===27n?0:1}}class Ca extends ge{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Ye(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new Ca({value:e});let[s,a="0"]=e.split(".");const n=s.startsWith("-");if(n&&(s=s.slice(1)),a=a.replace(/(0+)$/,""),t===0)Math.round(+`.${a}`)===1&&(s=`${BigInt(s)+1n}`),a="";else if(a.length>t){const[r,i,c]=[a.slice(0,t-1),a.slice(t-1,t),a.slice(t)],o=Math.round(+`${i}.${c}`);o>9?a=`${BigInt(r)+BigInt(1)}0`.padStart(r.length+1,"0"):a=`${r}${o}`,a.length>t&&(a=a.slice(1),s=`${BigInt(s)+1n}`),a=a.slice(0,t)}else a=a.padEnd(t,"0");return BigInt(`${n?"-":""}${s}${a}`)}function ku(e,t="wei"){return Ye(e,Dt[t])}function Lu(e,t="wei"){return Ye(e,$t[t])}async function Ou(e,{hash:t}){await e.request({method:`${e.mode}_dropTransaction`,params:[t]})}async function Nu(e){return e.request({method:`${e.mode}_dumpState`})}async function Fu(e){return e.mode==="ganache"?await e.request({method:"eth_mining"}):await e.request({method:`${e.mode}_getAutomine`})}async function Uu(e){return await e.request({method:"txpool_content"})}async function ju(e){const{pending:t,queued:s}=await e.request({method:"txpool_status"});return{pending:I(t),queued:I(s)}}async function Hu(e,{address:t}){await e.request({method:`${e.mode}_impersonateAccount`,params:[t]})}async function Du(e,{seconds:t}){return await e.request({method:"evm_increaseTime",params:[_(t)]})}async function $u(e){return await e.request({method:"txpool_inspect"})}async function Gu(e,{state:t}){await e.request({method:`${e.mode}_loadState`,params:[t]})}async function zu(e,{blocks:t,interval:s}){e.mode==="ganache"?await e.request({method:"evm_mine",params:[{blocks:_(t)}]}):await e.request({method:`${e.mode}_mine`,params:[_(t),_(s||0)]})}async function Vu(e){await e.request({method:`${e.mode}_removeBlockTimestampInterval`})}async function Wu(e,{blockNumber:t,jsonRpcUrl:s}={}){await e.request({method:`${e.mode}_reset`,params:[{forking:{blockNumber:Number(t),jsonRpcUrl:s}}]})}async function Ku(e,{id:t}){await e.request({method:"evm_revert",params:[t]})}async function Ju(e,t){const{accessList:s,data:a,from:n,gas:r,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:o,nonce:u,to:l,value:h,...f}=t,d=e.chain?.formatters?.transactionRequest?.format,g=(d||ye)({...Gt(f,{format:d}),accessList:s,data:a,from:n,gas:r,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:o,nonce:u,to:l,value:h},"sendUnsignedTransaction");return await e.request({method:"eth_sendUnsignedTransaction",params:[g]})}async function Yu(e,t){e.mode==="ganache"?t?await e.request({method:"miner_start"}):await e.request({method:"miner_stop"}):await e.request({method:"evm_setAutomine",params:[t]})}async function Xu(e,{address:t,value:s}){e.mode==="ganache"?await e.request({method:"evm_setAccountBalance",params:[t,_(s)]}):await e.request({method:`${e.mode}_setBalance`,params:[t,_(s)]})}async function Qu(e,{gasLimit:t}){await e.request({method:"evm_setBlockGasLimit",params:[_(t)]})}async function Zu(e,{interval:t}){const s=e.mode==="hardhat"?t*1e3:t;await e.request({method:`${e.mode}_setBlockTimestampInterval`,params:[s]})}async function ed(e,{address:t,bytecode:s}){e.mode==="ganache"?await e.request({method:"evm_setAccountCode",params:[t,s]}):await e.request({method:`${e.mode}_setCode`,params:[t,s]})}async function td(e,{address:t}){await e.request({method:`${e.mode}_setCoinbase`,params:[t]})}async function ad(e,{interval:t}){const s=e.mode==="hardhat"?t*1e3:t;await e.request({method:"evm_setIntervalMining",params:[s]})}async function sd(e,t){await e.request({method:`${e.mode}_setLoggingEnabled`,params:[t]})}
1async function nd(e,{gasPrice:t}){await e.request({method:`${e.mode}_setMinGasPrice`,params:[_(t)]})}async function rd(e,{baseFeePerGas:t}){await e.request({method:`${e.mode}_setNextBlockBaseFeePerGas`,params:[_(t)]})}async function od(e,{timestamp:t}){await e.request({method:"evm_setNextBlockTimestamp",params:[_(t)]})}async function id(e,{address:t,nonce:s}){await e.request({method:`${e.mode}_setNonce`,params:[t,_(s)]})}async function cd(e,t){await e.request({method:`${e.mode}_setRpcUrl`,params:[t]})}async function ud(e,{address:t,index:s,value:a}){await e.request({method:`${e.mode}_setStorageAt`,params:[t,typeof s=="number"?_(s):s,a]})}async function dd(e){return await e.request({method:"evm_snapshot"})}async function ld(e,{address:t}){await e.request({method:`${e.mode}_stopImpersonatingAccount`,params:[t]})}async function hd(e,{chain:t}){const{id:s,name:a,nativeCurrency:n,rpcUrls:r,blockExplorers:i}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:_(s),chainName:a,nativeCurrency:n,rpcUrls:r.default.http,blockExplorerUrls:i?Object.values(i).map(({url:c})=>c):void 0}]},{dedupe:!0,retryCount:0})}function fd(e,t){const{abi:s,args:a,bytecode:n,...r}=t,i=zt({abi:s,args:a,bytecode:n});return Vt(e,{...r,...r.authorizationList?{to:null}:{},data:i})}async function md(e){return e.account?.type==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(s=>Wt(s))}async function gd(e,t={}){const{account:s=e.account,chainId:a}=t,n=s?Y(s):void 0,r=a?[n?.address,[_(a)]]:[n?.address],i=await e.request({method:"wallet_getCapabilities",params:r}),c={};for(const[o,u]of Object.entries(i)){c[Number(o)]={};for(let[l,h]of Object.entries(u))l==="addSubAccount"&&(l="unstable_addSubAccount"),c[Number(o)][l]=h}return typeof a=="number"?c[a]:c}async function pd(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function yd(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(s=>q(s))}async function bd(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function wd(e,t){const{chain:s=e.chain}=t,a=t.timeout??Math.max((s?.blockTime??0)*3,5e3),n=await v(e,ua,"sendCalls")(t);return await v(e,da,"waitForCallsStatus")({...t,id:n.id,timeout:a})}const ke=new Xa(128);async function Aa(e,t){const{account:s=e.account,assertChainId:a=!0,chain:n=e.chain,accessList:r,authorizationList:i,blobs:c,data:o,dataSuffix:u=typeof e.dataSuffix=="string"?e.dataSuffix:e.dataSuffix?.value,gas:l,gasPrice:h,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:m,nonce:g,pollingInterval:b,throwOnReceiptRevert:T,type:E,value:C,...P}=t,S=t.timeout??Math.max((n?.blockTime??0)*3,5e3);if(typeof s>"u")throw new be({docsPath:"/docs/actions/wallet/sendTransactionSync"});const p=s?Y(s):null;let te;try{ze(t);const O=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await Ya({authorization:i[0]}).catch(()=>{throw new ge("`to` is required. Could not infer from `authorizationList`.")})})();if(p?.type==="json-rpc"||p===null){let V;n!==null&&(V=await v(e,fe,"getChainId")({}),a&&Ve({currentChainId:V,chain:n}));const ae=e.chain?.formatters?.transactionRequest?.format,W=(ae||ye)({...Gt(P,{format:ae}),accessList:r,account:p,authorizationList:i,blobs:c,chainId:V,data:u?he([o??"0x",u]):o,gas:l,gasPrice:h,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:m,nonce:g,to:O,type:E,value:C},"sendTransaction"),se=ke.get(e.uid),Ua=se?"wallet_sendTransaction":"eth_sendTransaction",ja=await(async()=>{try{return await e.request({method:Ua,params:[W]},{retryCount:0})}catch(tt){if(se===!1)throw tt;const F=tt;if(F.name==="InvalidInputRpcError"||F.name==="InvalidParamsRpcError"||F.name==="MethodNotFoundRpcError"||F.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[W]},{retryCount:0}).then(Re=>(ke.set(e.uid,!0),Re)).catch(Re=>{const Be=Re;throw Be.name==="MethodNotFoundRpcError"||Be.name==="MethodNotSupportedRpcError"?(ke.set(e.uid,!1),F):Be});throw F}})(),Ae=await v(e,Qa,"waitForTransactionReceipt")({checkReplacement:!1,hash:ja,pollingInterval:b,timeout:S});if(T&&Ae.status==="reverted")throw new rt({receipt:Ae});return Ae}if(p?.type==="local"){if(p.nonceManager&&typeof g>"u"){const W=P.chainId,se=await(async()=>typeof W=="number"?W:n?n.id:v(e,fe,"getChainId")({}))();te={address:p.address,chainId:se}}const V=await v(e,Kt,"prepareTransactionRequest")({account:p,accessList:r,authorizationList:i,blobs:c,chain:n,data:u?he([o??"0x",u]):o,gas:l,gasPrice:h,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:m,nonce:g,nonceManager:p.nonceManager,parameters:[...Za,"sidecars"],type:E,value:C,...P,to:O}),ae=n?.serializers?.transaction,et=await p.signTransaction(V,{serializer:ae});return await v(e,Jt,"sendRawTransactionSync")({serializedTransaction:et,throwOnReceiptRevert:T,timeout:t.timeout})}throw p?.type==="smart"?new le({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new le({docsPath:"/docs/actions/wallet/sendTransactionSync",type:p?.type})}catch(O){throw O instanceof le?O:(te&&!(O instanceof rt)&&p?.nonceManager?.reset(te),es(O,{...t,account:p,chain:t.chain||void 0}))}}async function _d(e,t){const{id:s}=t;await e.request({method:"wallet_showCallsStatus",params:[s]})}async function Ed(e,t){const{account:s=e.account}=t;if(!s)throw new be({docsPath:"/docs/eip7702/signAuthorization"});const a=Y(s);if(!a.signAuthorization)throw new le({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:a.type});const n=await la(e,t);return a.signAuthorization(n)}async function xd(e,t){const{account:s=e.account,chain:a=e.chain,...n}=t;if(!s)throw new be({docsPath:"/docs/actions/wallet/signTransaction"});const r=Y(s);ze({account:r,...t});const i=await v(e,fe,"getChainId")({});a!==null&&Ve({currentChainId:i,chain:a});const o=(a?.formatters||e.chain?.formatters)?.transactionRequest?.format||ye;return r.signTransaction?r.signTransaction({...n,account:r,chainId:i},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...o({...n,account:r},"signTransaction"),chainId:_(i),from:r.address}]},{retryCount:0})}async function Td(e,t){const{account:s=e.account,domain:a,message:n,primaryType:r}=t;if(!s)throw new be({docsPath:"/docs/actions/wallet/signTypedData"});const i=Y(s),c={EIP712Domain:Yt({domain:a}),...t.types};if(Xt({domain:a,message:n,primaryType:r,types:c}),i.signTypedData)return i.signTypedData({domain:a,message:n,primaryType:r,types:c});const o=Qt({domain:a,message:n,primaryType:r,types:c});return e.request({method:"eth_signTypedData_v4",params:[i.address,o]},{retryCount:0})}async function Sd(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:_(t)}]},{retryCount:0})}async function vd(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}async function Id(e,t){return We.internal(e,Aa,"sendTransactionSync",t)}function Pd({abi:e,address:t,client:s}){const a=s,[n,r]=a?"public"in a&&"wallet"in a?[a.public,a.wallet]:"public"in a?[a.public,void 0]:"wallet"in a?[void 0,a.wallet]:[a,a]:[void 0,void 0],i=n!=null,c=r!=null,o={};let u=!1,l=!1,h=!1;for(const f of e)if(f.type==="function"?f.stateMutability==="view"||f.stateMutability==="pure"?u=!0:l=!0:f.type==="event"&&(h=!0),u&&l&&h)break;return i&&(u&&(o.read=new Proxy({},{get(f,d){return(...m)=>{const{args:g,options:b}=ie(m);return v(n,ts,"readContract")({abi:e,address:t,functionName:d,args:g,...b})}}})),l&&(o.simulate=new Proxy({},{get(f,d){return(...m)=>{const{args:g,options:b}=ie(m);return v(n,as,"simulateContract")({abi:e,address:t,functionName:d,args:g,...b})}}})),h&&(o.createEventFilter=new Proxy({},{get(f,d){return(...m)=>{const g=e.find(E=>E.type==="event"&&E.name===d),{args:b,options:T}=Le(m,g);return v(n,ss,"createContractEventFilter")({abi:e,address:t,eventName:d,args:b,...T})}}}),o.getEvents=new Proxy({},{get(f,d){return(...m)=>{const g=e.find(E=>E.type==="event"&&E.name===d),{args:b,options:T}=Le(m,g);return v(n,ns,"getContractEvents")({abi:e,address:t,eventName:d,args:b,...T})}}}),o.watchEvent=new Proxy({},{get(f,d){return(...m)=>{const g=e.find(E=>E.type==="event"&&E.name===d),{args:b,options:T}=Le(m,g);
1return v(n,rs,"watchContractEvent")({abi:e,address:t,eventName:d,args:b,...T})}}}))),c&&l&&(o.write=new Proxy({},{get(f,d){return(...m)=>{const{args:g,options:b}=ie(m);return v(r,We,"writeContract")({abi:e,address:t,functionName:d,args:g,...b})}}})),(i||c)&&l&&(o.estimateGas=new Proxy({},{get(f,d){return(...m)=>{const{args:g,options:b}=ie(m);return v(n??r,os,"estimateContractGas")({abi:e,address:t,functionName:d,args:g,...b,account:b.account??r.account})}}})),o.address=t,o.abi=e,o}function ie(e){const t=e.length&&Array.isArray(e[0]),s=t?e[0]:[],a=(t?e[1]:e[0])??{};return{args:s,options:a}}function Le(e,t){let s=!1;Array.isArray(e[0])?s=!0:e.length===1?s=t.inputs.some(r=>r.indexed):e.length===2&&(s=!0);const a=s?e[0]:void 0,n=(s?e[1]:e[0])??{};return{args:a,options:n}}function Ra({mode:e}){return t=>{const s=t.extend(()=>({mode:e}));return{dropTransaction:a=>Ou(s,a),dumpState:()=>Nu(s),getAutomine:()=>Fu(s),getTxpoolContent:()=>Uu(s),getTxpoolStatus:()=>ju(s),impersonateAccount:a=>Hu(s,a),increaseTime:a=>Du(s,a),inspectTxpool:()=>$u(s),loadState:a=>Gu(s,a),mine:a=>zu(s,a),removeBlockTimestampInterval:()=>Vu(s),reset:a=>Wu(s,a),revert:a=>Ku(s,a),sendUnsignedTransaction:a=>Ju(s,a),setAutomine:a=>Yu(s,a),setBalance:a=>Xu(s,a),setBlockGasLimit:a=>Qu(s,a),setBlockTimestampInterval:a=>Zu(s,a),setCode:a=>ed(s,a),setCoinbase:a=>td(s,a),setIntervalMining:a=>ad(s,a),setLoggingEnabled:a=>sd(s,a),setMinGasPrice:a=>nd(s,a),setNextBlockBaseFeePerGas:a=>rd(s,a),setNextBlockTimestamp:a=>od(s,a),setNonce:a=>id(s,a),setRpcUrl:a=>cd(s,a),setStorageAt:a=>ud(s,a),snapshot:()=>dd(s),stopImpersonatingAccount:a=>ld(s,a)}}}function Cd(e){const{key:t="test",name:s="Test Client",mode:a}=e;return Ke({...e,key:t,name:s,type:"testClient"}).extend(r=>({mode:a,...Ra({mode:a})(r)}))}function Ba(e){return{addChain:t=>hd(e,t),deployContract:t=>fd(e,t),fillTransaction:t=>us(e,t),getAddresses:()=>md(e),getCallsStatus:t=>Vc(e,t),getCapabilities:t=>gd(e,t),getChainId:()=>fe(e),getPermissions:()=>pd(e),prepareAuthorization:t=>la(e,t),prepareTransactionRequest:t=>Kt(e,t),requestAddresses:()=>yd(e),requestPermissions:t=>bd(e,t),sendCalls:t=>ua(e,t),sendCallsSync:t=>wd(e,t),sendRawTransaction:t=>cs(e,t),sendRawTransactionSync:t=>Jt(e,t),sendTransaction:t=>Vt(e,t),sendTransactionSync:t=>Aa(e,t),showCallsStatus:t=>_d(e,t),signAuthorization:t=>Ed(e,t),signMessage:t=>is(e,t),signTransaction:t=>xd(e,t),signTypedData:t=>Td(e,t),switchChain:t=>Sd(e,t),waitForCallsStatus:t=>da(e,t),watchAsset:t=>vd(e,t),writeContract:t=>We(e,t),writeContractSync:t=>Id(e,t)}}function Ad(e){const{key:t="wallet",name:s="Wallet Client",transport:a}=e;return Ke({...e,key:t,name:s,transport:a,type:"walletClient"}).extend(Ba)}function Rd(e,t={}){const{keepAlive:s,key:a="webSocket",methods:n,name:r="WebSocket JSON-RPC",reconnect:i,retryDelay:c}=t;return({chain:o,retryCount:u,timeout:l})=>{const h=t.retryCount??u,f=l??t.timeout??1e4,d=e||o?.rpcUrls.default.webSocket?.[0],m={keepAlive:s,reconnect:i};if(!d)throw new Zt;return ea({key:a,methods:n,name:r,async request({method:g,params:b}){const T={method:g,params:b},E=await qe(d,m),{error:C,result:P}=await E.requestAsync({body:T,timeout:f});if(C)throw new ta({body:T,error:C,url:d});return P},retryCount:h,retryDelay:c,timeout:f,type:"webSocket"},{getSocket(){return ds(d)},getRpcClient(){return qe(d,m)},async subscribe({params:g,onData:b,onError:T}){const E=await qe(d,m),{result:C}=await new Promise((P,S)=>E.request({body:{method:"eth_subscribe",params:g},onError(p){S(p),T?.(p)},onResponse(p){if(p.error){S(p.error),T?.(p.error);return}if(typeof p.id=="number"){P(p);return}p.method==="eth_subscription"&&b(p.params)}}));return{subscriptionId:C,async unsubscribe(){return new Promise(P=>E.request({body:{method:"eth_unsubscribe",params:[C]},onResponse:P}))}}}})}}class Bd extends Error{constructor(t,s){super(s),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t,this.details=s}}const Oe="/docs/contract/decodeDeployData";function Md(e){const{abi:t,bytecode:s,data:a}=e;if(a===s)return{bytecode:s};const n=t.find(i=>"type"in i&&i.type==="constructor");if(!n)throw new aa({docsPath:Oe});if(!("inputs"in n))throw new je({docsPath:Oe});if(!n.inputs||n.inputs.length===0)throw new je({docsPath:Oe});return{args:Ge(n.inputs,`0x${a.replace(s,"")}`),bytecode:s}}function qd(e){const t=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),s=typeof e.blobs[0]=="string"?e.blobs.map(c=>$(c)):e.blobs,a=s.reduce((c,o)=>c+o.length,0),n=Fe(new Uint8Array(a));let r=!0;for(const c of s){const o=Fe(c);for(;r&&o.position<c.length;){o.incrementPosition(1);let u=31;c.length-o.position<31&&(u=c.length-o.position);for(const l in Array.from({length:u})){const h=o.readByte();if(h===128&&!o.inspectBytes(o.remaining).includes(128)){r=!1;break}n.pushByte(h)}}}const i=n.bytes.slice(0,n.position);return t==="hex"?j(i):i}function kd(e){const{sidecars:t,version:s}=e,a=e.to??(typeof t[0].blob=="string"?"hex":"bytes"),n=[];for(const{commitment:r}of t)n.push(sa({commitment:r,to:a,version:s}));return n}const Ld=2147483648;function Od(e){if(e===1)return 60n;if(e>=Ld||e<0)throw new na({chainId:e});return BigInt((2147483648|e)>>>0)}function Ma({blobToKzgCommitment:e,computeBlobKzgProof:t}){return{blobToKzgCommitment:e,computeBlobKzgProof:t}}function Nd(e,t){try{e.loadTrustedSetup(t)}catch(s){const a=s;if(!a.message.includes("trusted setup is already loaded"))throw a}return Ma(e)}function Fd({r:e,yParityAndS:t}){const s=$(t),a=s[0]&128?1:0,n=s;return a===1&&(n[0]&=127),{r:e,s:j(n),yParity:a}}function gt(e){const{r:t,s}=ra.Signature.fromCompact(e.slice(2,130));return{r:_(t,{size:32}),yParityAndS:_(s,{size:32})}}async function Ud(e){const{serializedTransaction:t,signature:s}=e,a=Pa(t),n=s??{r:a.r,s:a.s,v:a.v,yParity:a.yParity},r=ha({...a,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await J({hash:K(r),signature:n})}function pt({r:e,yParityAndS:t}){return`0x${new ra.Signature(w(e),w(t)).toCompactHex()}`}
1function jd(e){const{r:t,s,v:a,yParity:n}=e,r=Number(n??a-27n);let i=s;if(r===1){const c=$(s);c[0]|=128,i=j(c)}return{r:t,yParityAndS:i}}const Hd=Object.freeze(Object.defineProperty({__proto__:null,AbiConstructorNotFoundError:aa,AbiConstructorParamsNotFoundError:je,AbiDecodingDataSizeInvalidError:ls,AbiDecodingDataSizeTooSmallError:hs,AbiDecodingZeroDataError:fs,AbiEncodingArrayLengthMismatchError:ms,AbiEncodingBytesSizeMismatchError:gs,AbiEncodingLengthMismatchError:ps,AbiErrorInputsNotFoundError:ys,AbiErrorNotFoundError:bs,AbiErrorSignatureNotFoundError:ws,AbiEventNotFoundError:_s,AbiEventSignatureEmptyTopicsError:Es,AbiEventSignatureNotFoundError:xs,AbiFunctionNotFoundError:Ts,AbiFunctionOutputsNotFoundError:Ss,AbiFunctionSignatureNotFoundError:vs,AccountStateConflictError:Is,AtomicReadyWalletRejectedUpgradeError:Ps,AtomicityNotSupportedError:Cs,BaseError:ge,BaseFeeScalarError:As,BlockNotFoundError:Rs,BundleFailedError:Wc,BundleTooLargeError:Bs,BytesSizeMismatchError:Ms,CallExecutionError:qs,ChainDisconnectedError:ks,ChainDoesNotSupportContract:Ls,ChainMismatchError:Os,ChainNotFoundError:Ns,CircularReferenceError:Fs,ClientChainNotConfiguredError:Us,ContractFunctionExecutionError:js,ContractFunctionRevertedError:Hs,ContractFunctionZeroDataError:Ds,CounterfactualDeploymentFailedError:$s,DecodeLogDataMismatch:Gs,DecodeLogTopicsMismatch:zs,DuplicateIdError:Vs,EIP1193ProviderRpcError:Bd,Eip1559FeesNotSupportedError:Ws,EnsAvatarInvalidNftUriError:Ks,EnsAvatarUnsupportedNamespaceError:Js,EnsAvatarUriResolutionError:Ys,EnsInvalidChainIdError:na,EstimateGasExecutionError:Xs,ExecutionRevertedError:Qs,FeeCapTooHighError:Zs,FeeCapTooLowError:en,FeeConflictError:tn,FilterTypeNotSupportedError:an,HttpRequestError:Rt,InsufficientFundsError:sn,IntegerOutOfRangeError:nn,InternalRpcError:rn,IntrinsicGasTooHighError:on,IntrinsicGasTooLowError:cn,InvalidAbiDecodingTypeError:un,InvalidAbiEncodingTypeError:dn,InvalidAbiItemError:ln,InvalidAbiParameterError:Tt,InvalidAbiParametersError:hn,InvalidAbiTypeParameterError:fn,InvalidAddressError:jt,InvalidArrayError:mn,InvalidBytesBooleanError:gn,InvalidChainIdError:pn,InvalidDecimalNumberError:Ca,InvalidDefinitionTypeError:yn,InvalidDomainError:bn,InvalidFunctionModifierError:wn,InvalidHexBooleanError:_n,InvalidHexValueError:Bt,InvalidInputRpcError:En,InvalidLegacyVError:Ft,InvalidModifierError:xn,InvalidParameterError:Tn,InvalidParamsRpcError:Sn,InvalidParenthesisError:vn,InvalidPrimaryTypeError:In,InvalidRequestRpcError:Pn,InvalidSerializableTransactionError:Cn,InvalidSerializedTransactionError:G,InvalidSerializedTransactionTypeError:Ot,InvalidSignatureError:An,InvalidStorageKeySizeError:Rn,InvalidStructSignatureError:Bn,InvalidStructTypeError:Mn,JsonRpcVersionUnsupportedError:qn,LimitExceededRpcError:kn,MaxFeePerGasTooLowError:Ln,MethodNotFoundRpcError:On,MethodNotSupportedRpcError:Nn,NonceMaxValueError:Fn,NonceTooHighError:Un,NonceTooLowError:jn,ParseRpcError:Hn,ProviderDisconnectedError:Dn,ProviderRpcError:$n,RawContractError:Gn,ResourceNotFoundRpcError:zn,ResourceUnavailableRpcError:Vn,RpcError:Wn,RpcRequestError:ta,SizeExceedsPaddingSizeError:Kn,SizeOverflowError:Jn,SliceOffsetOutOfBoundsError:Yn,SocketClosedError:Xn,SolidityProtectedKeywordError:Qn,StateAssignmentConflictError:Zn,SwitchChainError:er,TimeoutError:tr,TipAboveFeeCapError:ar,TransactionExecutionError:sr,TransactionNotFoundError:nr,TransactionReceiptNotFoundError:rr,TransactionRejectedRpcError:or,TransactionTypeNotSupportedError:ir,UnauthorizedProviderError:cr,UnknownBundleIdError:ur,UnknownNodeError:dr,UnknownRpcError:lr,UnknownSignatureError:hr,UnknownTypeError:fr,UnsupportedChainIdError:mr,UnsupportedNonOptionalCapabilityError:gr,UnsupportedPackedAbiType:pr,UnsupportedProviderMethodError:yr,UrlRequiredError:Zt,UserRejectedRequestError:br,WaitForCallsStatusTimeoutError:Kc,WaitForTransactionReceiptTimeoutError:wr,WebSocketRequestError:_r,assertCurrentChain:Ve,assertRequest:ze,assertTransactionEIP1559:oa,assertTransactionEIP2930:ia,assertTransactionLegacy:ca,blobsToCommitments:Er,blobsToProofs:xr,boolToBytes:Tr,boolToHex:Sr,bytesToBigInt:vr,bytesToBool:Ir,bytesToHex:j,bytesToNumber:Pr,bytesToRlp:Cr,bytesToString:Ar,ccipFetch:He,ccipReadTunnel:uu,ccipRequest:He,checksumAddress:Wt,commitmentToVersionedHash:sa,commitmentsToVersionedHashes:Rr,compactSignatureToHex:pt,compactSignatureToSignature:Fd,c
1oncat:he,concatBytes:Br,concatHex:Mr,createClient:Ke,createNonceManager:Jc,createPublicClient:Yc,createTestClient:Cd,createTransport:ea,createWalletClient:Ad,custom:qr,decodeAbiParameters:Ge,decodeDeployData:Md,decodeErrorResult:At,decodeEventLog:kr,decodeFunctionData:Lr,decodeFunctionResult:Pt,defineBlock:Or,defineChain:Nr,defineKzg:Ma,defineTransaction:Fr,defineTransactionReceipt:Ur,defineTransactionRequest:jr,deploylessCallViaBytecodeBytecode:Hr,deploylessCallViaFactoryBytecode:Dr,domainSeparator:$r,encodeAbiParameters:Gr,encodeDeployData:zt,encodeErrorResult:zr,encodeEventTopics:Vr,encodeFunctionData:Ct,encodeFunctionResult:Wr,encodePacked:Xc,erc1155Abi:Kr,erc20Abi:Jr,erc20Abi_bytes32:Yr,erc4626Abi:Xr,erc6492SignatureValidatorAbi:ot,erc6492SignatureValidatorByteCode:it,erc721Abi:Qr,ethAddress:Zr,etherUnits:Dt,extendSchema:eo,extractChain:du,fallback:to,formatBlock:ao,formatEther:so,formatGwei:no,formatLog:ro,formatTransaction:oo,formatTransactionReceipt:io,formatTransactionRequest:ye,formatUnits:co,fromBlobs:qd,fromBytes:uo,fromHex:lo,fromRlp:Je,getAbiItem:ho,getAddress:q,getChainContractAddress:fo,getContract:Pd,getContractAddress:cu,getContractError:mo,getCreate2Address:ma,getCreateAddress:fa,getEventSelector:ct,getEventSignature:re,getFunctionSelector:ut,getFunctionSignature:re,getSerializedTransactionType:Ia,getTransactionType:go,getTypesForEIP712Domain:Yt,gweiUnits:$t,hashDomain:po,hashMessage:kt,hashStruct:yo,hashTypedData:Lt,hexToBigInt:w,hexToBool:bo,hexToBytes:$,hexToCompactSignature:gt,hexToNumber:I,hexToRlp:wo,hexToSignature:ht,hexToString:_o,http:Eo,isAddress:Ut,isAddressEqual:pe,isBytes:De,isErc6492Signature:xa,isErc8010Signature:Ta,isHash:pa,isHex:y,keccak256:K,labelhash:xo,maxInt104:To,maxInt112:So,maxInt120:vo,maxInt128:Io,maxInt136:Po,maxInt144:Co,maxInt152:Ao,maxInt16:Ro,maxInt160:Bo,maxInt168:Mo,maxInt176:qo,maxInt184:ko,maxInt192:Lo,maxInt200:Oo,maxInt208:No,maxInt216:Fo,maxInt224:Uo,maxInt232:jo,maxInt24:Ho,maxInt240:Do,maxInt248:$o,maxInt256:Go,maxInt32:zo,maxInt40:Vo,maxInt48:Wo,maxInt56:Ko,maxInt64:Jo,maxInt72:Yo,maxInt8:Xo,maxInt80:Qo,maxInt88:Zo,maxInt96:ei,maxUint104:ti,maxUint112:ai,maxUint120:si,maxUint128:ni,maxUint136:ri,maxUint144:oi,maxUint152:ii,maxUint16:ci,maxUint160:ui,maxUint168:di,maxUint176:li,maxUint184:hi,maxUint192:fi,maxUint200:mi,maxUint208:gi,maxUint216:pi,maxUint224:yi,maxUint232:bi,maxUint24:wi,maxUint240:_i,maxUint248:Ei,maxUint256:xi,maxUint32:Ti,maxUint40:Si,maxUint48:vi,maxUint56:Ii,maxUint64:Pi,maxUint72:Ci,maxUint8:Ai,maxUint80:Ri,maxUint88:Bi,maxUint96:Mi,minInt104:qi,minInt112:ki,minInt120:Li,minInt128:Oi,minInt136:Ni,minInt144:Fi,minInt152:Ui,minInt16:ji,minInt160:Hi,minInt168:Di,minInt176:$i,minInt184:Gi,minInt192:zi,minInt200:Vi,minInt208:Wi,minInt216:Ki,minInt224:Ji,minInt232:Yi,minInt24:Xi,minInt240:Qi,minInt248:Zi,minInt256:ec,minInt32:tc,minInt40:ac,minInt48:sc,minInt56:nc,minInt64:rc,minInt72:oc,minInt8:ic,minInt80:cc,minInt88:uc,minInt96:dc,multicall3Abi:lc,namehash:hc,nonceManager:Qc,numberToBytes:fc,numberToHex:_,offchainLookup:au,offchainLookupAbiItem:su,offchainLookupSignature:nu,pad:St,padBytes:mc,padHex:Ue,parseAbi:gc,parseAbiItem:pc,parseAbiParameter:iu,parseAbiParameters:yc,parseCompactSignature:gt,parseErc6492Signature:xu,parseErc8010Signature:Tu,parseEther:ku,parseEventLogs:bc,parseGwei:Lu,parseSignature:ht,parseTransaction:Pa,parseUnits:Ye,prepareEncodeFunctionData:wc,presignMessagePrefix:_c,publicActions:Ec,recoverAddress:J,recoverMessageAddress:Sa,recoverPublicKey:xc,recoverTransactionAddress:Ud,recoverTypedDataAddress:va,ripemd160:Eu,rpcSchema:Tc,rpcTransactionType:Sc,serializeAccessList:Zc,serializeCompactSignature:pt,serializeErc6492Signature:eu,serializeErc8010Signature:Su,serializeSignature:dt,serializeTransaction:ha,serializeTypedData:Qt,setErrorConfig:vc,setupKzg:Nd,sha256:Ic,shouldThrow:Pc,sidecarsToVersionedHashes:kd,signatureToCompactSignature:jd,signatureToHex:dt,size:Mt,slice:vt,sliceBytes:Cc,sliceHex:$e,stringToBytes:Ac,stringToHex:Rc,stringify:Bc,testActions:Ra,toBlobSidecars:Nt,toBlobs:Mc,toBytes:L,toCoinType:Od,toEventHash:lt,toEventSelector:ct,toEventSignature:re,toFunctionHash:lt,toFunctionSelector:ut,toFunctionSignature:re,toHex:qt,toPrefixedMessage:qc,toRlp:It,transactionType:kc,trim:Ht,universalSignatureValidatorAbi:ot,universalSignatureValidatorByteCode:it,validateTypedData:Xt,verifyHash:vu,verifyMessage:Iu,verifyTypedData:Pu,walletActions:Ba,webSocket:Rd,weiUnits:Lc,withCache:Oc,withRetry:Nc,withTimeout:Fc,zeroAddress:Uc,zeroHash:tu},Symbol.toStringTag,{value:"Module"}));var Xe={},Ee={},qa={},me={},ka={},Q={},Z={};Object.defineProperty(Z,"__esModule",{value:!0});Z.getSDKVersion=void 0;const Dd=()=>"9.1.0";
1Z.getSDKVersion=Dd;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.generateRequestId=void 0;const $d=e=>e.toString(16).padStart(2,"0"),Gd=e=>{const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t,$d).join("")},zd=()=>typeof window<"u"?Gd(10):new Date().getTime().toString(36);xe.generateRequestId=zd;Object.defineProperty(Q,"__esModule",{value:!0});Q.MessageFormatter=void 0;const Vd=Z,Wd=xe;class Te{}Q.MessageFormatter=Te;Te.makeRequest=(e,t)=>({id:(0,Wd.generateRequestId)(),method:e,params:t,env:{sdkVersion:(0,Vd.getSDKVersion)()}});Te.makeResponse=(e,t,s)=>({id:e,success:!0,version:s,data:t});Te.makeErrorResponse=(e,t,s)=>({id:e,success:!1,error:t,version:s});var B={};Object.defineProperty(B,"__esModule",{value:!0});B.RestrictedMethods=B.Methods=void 0;var yt;(function(e){e.sendTransactions="sendTransactions",e.rpcCall="rpcCall",e.getChainInfo="getChainInfo",e.getSafeInfo="getSafeInfo",e.getTxBySafeTxHash="getTxBySafeTxHash",e.getSafeBalances="getSafeBalances",e.signMessage="signMessage",e.signTypedMessage="signTypedMessage",e.getEnvironmentInfo="getEnvironmentInfo",e.getOffChainSignature="getOffChainSignature",e.requestAddressBook="requestAddressBook",e.wallet_getPermissions="wallet_getPermissions",e.wallet_requestPermissions="wallet_requestPermissions"})(yt||(B.Methods=yt={}));var bt;(function(e){e.requestAddressBook="requestAddressBook"})(bt||(B.RestrictedMethods=bt={}));(function(e){var t=x&&x.__createBinding||(Object.create?function(r,i,c,o){o===void 0&&(o=c);var u=Object.getOwnPropertyDescriptor(i,c);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[c]}}),Object.defineProperty(r,o,u)}:function(r,i,c,o){o===void 0&&(o=c),r[o]=i[c]}),s=x&&x.__exportStar||function(r,i){for(var c in r)c!=="default"&&!Object.prototype.hasOwnProperty.call(i,c)&&t(i,r,c)};Object.defineProperty(e,"__esModule",{value:!0});const a=Q;class n{constructor(i=null,c=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:o,data:u,source:l})=>{const h=!u,f=!this.isServer&&l===window.parent,d=typeof u.version<"u"&&parseInt(u.version.split(".")[0]),m=typeof d=="number"&&d>=1;let g=!0;return Array.isArray(this.allowedOrigins)&&(g=this.allowedOrigins.find(b=>b.test(o))!==void 0),!h&&f&&m&&g},this.logIncomingMessage=o=>{console.info(`Safe Apps SDK v1: A message was received from origin ${o.origin}. `,o.data)},this.onParentMessage=o=>{this.isValidMessage(o)&&(this.debugMode&&this.logIncomingMessage(o),this.handleIncomingMessage(o.data))},this.handleIncomingMessage=o=>{const{id:u}=o,l=this.callbacks.get(u);l&&(l(o),this.callbacks.delete(u))},this.send=(o,u)=>{const l=a.MessageFormatter.makeRequest(o,u);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(l,"*"),new Promise((h,f)=>{this.callbacks.set(l.id,d=>{if(!d.success){f(new Error(d.error));return}h(d)})})},this.allowedOrigins=i,this.debugMode=c,this.isServer||window.addEventListener("message",this.onParentMessage)}}e.default=n,s(B,e)})(ka);var Se={},ve={},Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.isObjectEIP712TypedData=void 0;const Kd=e=>typeof e=="object"&&e!=null&&"domain"in e&&"types"in e&&"message"in e;Ie.isObjectEIP712TypedData=Kd;var La={};Object.defineProperty(La,"__esModule",{value:!0});var Oa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransferDirection=e.TransactionStatus=e.TokenType=e.Operation=void 0;var t=Dc;Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return t.Operation}}),Object.defineProperty(e,"TokenType",{enumerable:!0,get:function(){return t.TokenType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return t.TransactionStatus}}),Object.defineProperty(e,"TransferDirection",{enumerable:!0,get:function(){return t.TransferDirection}})})(Oa);var Na={};Object.defineProperty(Na,"__esModule",{value:!0});(function(e){var t=x&&x.__createBinding||(Object.create?function(a,n,r,i){i===void 0&&(i=r);var c=Object.getOwnPropertyDescriptor(n,r);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(a,i,c)}:function(a,n,r,i){i===void 0&&(i=r),a[i]=n[r]}),s=x&&x.__exportStar||function(a,n){for(var r in a)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,a,r)};
1Object.defineProperty(e,"__esModule",{value:!0}),s(Ie,e),s(La,e),s(Oa,e),s(Na,e)})(ve);Object.defineProperty(Se,"__esModule",{value:!0});Se.TXs=void 0;const ce=B,Jd=ve;class Yd{constructor(t){this.communicator=t}async getBySafeTxHash(t){if(!t)throw new Error("Invalid safeTxHash");return(await this.communicator.send(ce.Methods.getTxBySafeTxHash,{safeTxHash:t})).data}async signMessage(t){const s={message:t};return(await this.communicator.send(ce.Methods.signMessage,s)).data}async signTypedMessage(t){if(!(0,Jd.isObjectEIP712TypedData)(t))throw new Error("Invalid typed data");return(await this.communicator.send(ce.Methods.signTypedMessage,{typedData:t})).data}async send({txs:t,params:s}){if(!t||!t.length)throw new Error("No transactions were passed");const a={txs:t,params:s};return(await this.communicator.send(ce.Methods.sendTransactions,a)).data}}Se.TXs=Yd;var Pe={},z={};Object.defineProperty(z,"__esModule",{value:!0});z.RPC_CALLS=void 0;z.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Eth=void 0;const A=z,Xd=B,M={defaultBlockParam:(e="latest")=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e};class Qd{constructor(t){this.communicator=t,this.call=this.buildRequest({call:A.RPC_CALLS.eth_call,formatters:[null,M.defaultBlockParam]}),this.getBalance=this.buildRequest({call:A.RPC_CALLS.eth_getBalance,formatters:[null,M.defaultBlockParam]}),this.getCode=this.buildRequest({call:A.RPC_CALLS.eth_getCode,formatters:[null,M.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:A.RPC_CALLS.eth_getStorageAt,formatters:[null,M.blockNumberToHex,M.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:A.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:A.RPC_CALLS.eth_getBlockByHash,formatters:[null,M.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:A.RPC_CALLS.eth_getBlockByNumber,formatters:[M.blockNumberToHex,M.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:A.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:A.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:A.RPC_CALLS.eth_getTransactionCount,formatters:[null,M.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:A.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=s=>this.buildRequest({call:A.RPC_CALLS.eth_estimateGas})([s]),this.setSafeSettings=this.buildRequest({call:A.RPC_CALLS.safe_setSettings})}buildRequest(t){const{call:s,formatters:a}=t;return async n=>{a&&Array.isArray(n)&&a.forEach((c,o)=>{c&&(n[o]=c(n[o]))});const r={call:s,params:n||[]};return(await this.communicator.send(Xd.Methods.rpcCall,r)).data}}}Pe.Eth=Qd;var Ce={};const Zd=jc(Hd);var H={};Object.defineProperty(H,"__esModule",{value:!0});H.MAGIC_VALUE_BYTES=H.MAGIC_VALUE=void 0;const el="0x1626ba7e";H.MAGIC_VALUE=el;const tl="0x20c13b0b";H.MAGIC_VALUE_BYTES=tl;var Qe={},ee={},N={};Object.defineProperty(N,"__esModule",{value:!0});N.PermissionsError=N.PERMISSIONS_REQUEST_REJECTED=void 0;N.PERMISSIONS_REQUEST_REJECTED=4001;class Ze extends Error{constructor(t,s,a){super(t),this.code=s,this.data=a,Object.setPrototypeOf(this,Ze.prototype)}}N.PermissionsError=Ze;
1Object.defineProperty(ee,"__esModule",{value:!0});ee.Wallet=void 0;const Ne=B,ue=N;class al{constructor(t){this.communicator=t}async getPermissions(){return(await this.communicator.send(Ne.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(t){if(!this.isPermissionRequestValid(t))throw new ue.PermissionsError("Permissions request is invalid",ue.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(Ne.Methods.wallet_requestPermissions,t)).data}catch{throw new ue.PermissionsError("Permissions rejected",ue.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(t){return t.every(s=>typeof s=="object"?Object.keys(s).every(a=>!!Object.values(Ne.RestrictedMethods).includes(a)):!1)}}ee.Wallet=al;Object.defineProperty(Qe,"__esModule",{value:!0});const sl=ee,wt=N,_t=(e,t)=>t.some(s=>s.parentCapability===e),nl=()=>(e,t,s)=>{const a=s.value;return s.value=async function(){const n=new sl.Wallet(this.communicator);let r=await n.getPermissions();if(_t(t,r)||(r=await n.requestPermissions([{[t]:{}}])),!_t(t,r))throw new wt.PermissionsError("Permissions rejected",wt.PERMISSIONS_REQUEST_REJECTED);return a.apply(this)},s};Qe.default=nl;var rl=x&&x.__decorate||function(e,t,s,a){var n=arguments.length,r=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,s):a,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(e,t,s,a);else for(var c=e.length-1;c>=0;c--)(i=e[c])&&(r=(n<3?i(r):n>3?i(t,s,r):i(t,s))||r);return n>3&&r&&Object.defineProperty(t,s,r),r},ol=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.Safe=void 0;const de=Zd,Et=H,k=B,xt=z,il=ve,cl=ol(Qe);class Fa{constructor(t){this.communicator=t}async getChainInfo(){return(await this.communicator.send(k.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(k.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:t="usd"}={}){return(await this.communicator.send(k.Methods.getSafeBalances,{currency:t})).data}async check1271Signature(t,s="0x"){const a=await this.getInfo(),n=(0,de.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,s]}),r={call:xt.RPC_CALLS.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(k.Methods.rpcCall,r)).data.slice(0,10).toLowerCase()===Et.MAGIC_VALUE}catch{return!1}}async check1271SignatureBytes(t,s="0x"){const a=await this.getInfo(),n=(0,de.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,s]}),r={call:xt.RPC_CALLS.eth_call,params:[{to:a.safeAddress,data:n},"latest"]};try{return(await this.communicator.send(k.Methods.rpcCall,r)).data.slice(0,10).toLowerCase()===Et.MAGIC_VALUE_BYTES}catch{return!1}}calculateMessageHash(t){return(0,de.hashMessage)(t)}calculateTypedMessageHash(t){const s=typeof t.domain.chainId=="object"?t.domain.chainId.toNumber():Number(t.domain.chainId);let a=t.primaryType;if(!a){const n=Object.values(t.types),r=Object.keys(t.types).filter(i=>n.every(c=>c.every(({type:o})=>o.replace("[","").replace("]","")!==i)));if(r.length===0||r.length>1)throw new Error("Please specify primaryType");a=r[0]}return(0,de.hashTypedData)({message:t.message,domain:{...t.domain,chainId:s,verifyingContract:t.domain.verifyingContract,salt:t.domain.salt},types:t.types,primaryType:a})}async getOffChainSignature(t){return(await this.communicator.send(k.Methods.getOffChainSignature,t)).data}async isMessageSigned(t,s="0x"){let a;if(typeof t=="string"&&(a=async()=>{const n=this.calculateMessageHash(t);return await this.isMessageHashSigned(n,s)}),(0,il.isObjectEIP712TypedData)(t)&&(a=async()=>{const n=this.calculateTypedMessageHash(t);return await this.isMessageHashSigned(n,s)}),a)return await a();throw new Error("Invalid message type")}async isMessageHashSigned(t,s="0x"){const a=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const n of a)if(await n(t,s))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(k.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(k.Methods.requestAddressBook,void 0)).data}}Ce.Safe=Fa;rl([(0,cl.default)()],Fa.prototype,"requestAddressBook",null);
1var ul=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(me,"__esModule",{value:!0});const dl=ul(ka),ll=Se,hl=Pe,fl=Ce,ml=ee;class gl{constructor(t={}){const{allowedDomains:s=null,debug:a=!1}=t;this.communicator=new dl.default(s,a),this.eth=new hl.Eth(this.communicator),this.txs=new ll.TXs(this.communicator),this.safe=new fl.Safe(this.communicator),this.wallet=new ml.Wallet(this.communicator)}}me.default=gl;(function(e){var t=x&&x.__createBinding||(Object.create?function(i,c,o,u){u===void 0&&(u=o);var l=Object.getOwnPropertyDescriptor(c,o);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(i,u,l)}:function(i,c,o,u){u===void 0&&(u=o),i[u]=c[o]}),s=x&&x.__exportStar||function(i,c){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(c,o)&&t(c,i,o)},a=x&&x.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(e,"__esModule",{value:!0}),e.getSDKVersion=void 0;const n=a(me);e.default=n.default,s(me,e),s(ve,e),s(B,e),s(Q,e);var r=Z;Object.defineProperty(e,"getSDKVersion",{enumerable:!0,get:function(){return r.getSDKVersion}}),s(z,e)})(qa);var D={};Object.defineProperty(D,"__esModule",{value:!0});D.numberToHex=D.getLowerCase=void 0;function pl(e){return e&&e.toLowerCase()}D.getLowerCase=pl;function yl(e){return`0x${e.toString(16)}`}D.numberToHex=yl;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.SafeAppProvider=void 0;const U=qa,bl=ru,R=D;class wl extends bl.EventEmitter{constructor(t,s){super(),this.submittedTxs=new Map,this.safe=t,this.sdk=s}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(t){const{method:s,params:a=[]}=t;switch(s){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return(0,R.numberToHex)(this.chainId);case"personal_sign":{const[o,u]=a;if(this.safe.safeAddress.toLowerCase()!==u.toLowerCase())throw new Error("The address or message hash is invalid");const l=await this.sdk.txs.signMessage(o);return("signature"in l?l.signature:void 0)||"0x"}case"eth_sign":{const[o,u]=a;if(this.safe.safeAddress.toLowerCase()!==o.toLowerCase()||!u.startsWith("0x"))throw new Error("The address or message hash is invalid");const l=await this.sdk.txs.signMessage(u);return("signature"in l?l.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[o,u]=a,l=typeof u=="string"?JSON.parse(u):u;if(this.safe.safeAddress.toLowerCase()!==o.toLowerCase())throw new Error("The address is invalid");const h=await this.sdk.txs.signTypedMessage(l);return("signature"in h?h.signature:void 0)||"0x"}case"eth_sendTransaction":const n={...a[0],value:a[0].value||"0",data:a[0].data||"0x"};typeof n.gas=="string"&&n.gas.startsWith("0x")&&(n.gas=parseInt(n.gas,16));const r=await this.sdk.txs.send({txs:[n],params:{safeTxGas:n.gas}});return this.submittedTxs.set(r.safeTxHash,{from:this.safe.safeAddress,hash:r.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:n.data,value:n.value,to:n.to,blockHash:null,blockNumber:null,transactionIndex:null}),r.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,R.getLowerCase)(a[0]),a[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,R.getLowerCase)(a[0]),a[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,R.getLowerCase)(a[0]),a[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,R.getLowerCase)(a[0]),a[1],a[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([a[0],a[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([a[0],a[1]]);case"eth_getTransactionByHash":let c=a[0];try{c=(await this.sdk.txs.getBySafeTxHash(c)).txHash||c}catch{}return this.submittedTxs.has(c)?this.submittedTxs.get(c):this.sdk.eth.getTransactionByHash([c]).then(o=>(o&&(o.hash=a[0]),o));case"eth_getTransactionReceipt":{let o=a[0];try{o=(await this.sdk.txs.getBySafeTxHash(o)).txHash||o}catch{}return this.sdk.eth.getTransactionReceipt([o]).then(u=>(u&&(u.transactionHash=a[0]),u))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(a[0]);case"eth_call":return this.sdk.eth.call([a[0],a[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([a[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(a[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([a[0]]);case"wallet_sendCalls":{const{from:o,calls:u,chainId:l}=a[0];if(l!==(0,R.numberToHex)(this.chainId))throw new Error(`Safe is not on chain ${l}`);if(o!==this.safe.safeAddress)throw Error("Invalid from address");const h=u.map((m,g)=>{if(!m.to)throw new Error(`Invalid call #${g}: missing "to" field`);return{to:m.to,data:m.data??"0x",value:m.value??(0,R.numberToHex)(0)}}),{safeTxHash:f}=await this.sdk.txs.send({txs:h});return{id:f}}case"wallet_getCallsStatus":{const o=a[0],u={[U.TransactionStatus.AWAITING_CONFIRMATIONS]:100,[U.TransactionStatus.AWAITING_EXECUTION]:100,[U.TransactionStatus.SUCCESS]:200,[U.TransactionStatus.CANCELLED]:400,[U.TransactionStatus.FAILED]:500},l=await this.sdk.txs.getBySafeTxHash(o),h={version:"1.0",id:o,chainId:(0,R.numberToHex)(this.chainId),status:u[l.txStatus]};if(!l.txHash)return h;const f=await this.sdk.eth.getTransactionReceipt([l.txHash]);if(!f)return h;const d=l.txData?.dataDecoded?.method!=="multiSend"?1:l.txData.dataDecoded.parameters?.[0].valueDecoded?.length??1,m=Number(f.blockNumber),g=Number(f.gasUsed);return h.receipts=Array(d).fill({logs:f.logs,status:(0,R.numberToHex)(l.txStatus===U.TransactionStatus.SUCCESS?1:0),blockHash:f.blockHash,blockNumber:(0,R.numberToHex)(m),gasUsed:(0,R.numberToHex)(g),transactionHash:l.txHash}),h}case"wallet_showCallsStatus":throw new Error(`"${t.method}" not supported`);case"wallet_getCapabilities":return{[(0,R.numberToHex)(this.chainId)]:{atomicBatch:{supported:!0}
1}};default:throw Error(`"${t.method}" not implemented`)}}send(t,s){t||s("Undefined request"),this.request(t).then(a=>s(null,{jsonrpc:"2.0",id:t.id,result:a})).catch(a=>s(a,null))}}Ee.SafeAppProvider=wl;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppProvider=void 0;var t=Ee;Object.defineProperty(e,"SafeAppProvider",{enumerable:!0,get:function(){return t.SafeAppProvider}})})(Xe);const _l=Hc(Xe),Il=ou({__proto__:null,default:_l},[Xe]);export{Il as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.