=0&&UA().update(v(x)).digest(),I=A();return P.outputLen=I.outputLen,P.blockLen=I.blockLen,P.create=()=>A(),P}function k(A){const P=(x,N)=>A(N).update(v(x)).digest(),I=A({});return P.outputLen=I.outputLen,P.blockLen=I.blockLen,P.create=x=>A(x),P}function h(A){const P=(x,N)=>A(N).update(v(x)).digest(),I=A({});return P.outputLen=I.outputLen,P.blockLen=I.blockLen,P.create=x=>A(x),P}e.wrapConstructor=F,e.wrapConstructorWithOpts=k,e.wrapXOFConstructorWithOpts=h;function M(A=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(A));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(A));throw new Error("crypto.getRandomValues must be defined")}})(Nd)),Nd}var Pl;function vv(){if(Pl)return Se;Pl=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.shake256=Se.shake128=Se.keccak_512=Se.keccak_384=Se.keccak_256=Se.keccak_224=Se.sha3_512=Se.sha3_384=Se.sha3_256=Se.sha3_224=Se.Keccak=void 0,Se.keccakP=O;const e=xp(),t=mr(),n=BigInt(0),r=BigInt(1),i=BigInt(2),a=BigInt(7),o=BigInt(256),c=BigInt(113),u=[],d=[],l=[];for(let s=0,y=r,g=1,E=0;s<24;s++){[g,E]=[E,(2*g+3*E)%5],u.push(2*(5*E+g)),d.push((s+1)*(s+2)/2%64);let B=n;for(let _=0;_<7;_++)y=(y<>a)*c)%o,y&i&&(B^=r<<(r<g>32?(0,e.rotlBH)(s,y,g):(0,e.rotlSH)(s,y,g),p=(s,y,g)=>g>32?(0,e.rotlBL)(s,y,g):(0,e.rotlSL)(s,y,g);function O(s,y=24){const g=new Uint32Array(10);for(let E=24-y;E<24;E++){for(let v=0;v<10;v++)g[v]=s[v]^s[v+10]^s[v+20]^s[v+30]^s[v+40];for(let v=0;v<10;v+=2){const C=(v+8)%10,q=(v+2)%10,R=g[q],H=g[q+1],F=w(R,H,1)^g[C],k=p(R,H,1)^g[C+1];for(let h=0;h<50;h+=10)s[v+h]^=F,s[v+h+1]^=k}let B=s[2],_=s[3];for(let v=0;v<24;v++){const C=d[v],q=w(B,_,C),R=p(B,_,C),H=u[v];B=s[H],_=s[H+1],s[H]=q,s[H+1]=R}for(let v=0;v<50;v+=10){for(let C=0;C<10;C++)g[C]=s[v+C];for(let C=0;C<10;C++)s[v+C]^=~g[(C+2)%10]&g[(C+4)%10]}s[0]^=b[E],s[1]^=T[E]}(0,t.clean)(g)}class S extends t.Hash{constructor(y,g,E,B=!1,_=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=y,this.suffix=g,this.outputLen=E,this.enableXOF=B,this.rounds=_,(0,t.anumber)(E),!(0=E&&this.keccak();const v=Math.min(E-this.posOut,_-B);y.set(g.subarray(this.posOut,this.posOut+v),B),this.posOut+=v,B+=v}return y}xofInto(y){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(y)}xof(y){return(0,t.anumber)(y),this.xofInto(new Uint8Array(y))}digestInto(y){if((0,t.aoutput)(y,this),this.finished)throw new Error("digest() was already called");return this.writeInto(y),this.destroy(),y}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,t.clean)(this.state)}_cloneInto(y){const{blockLen:g,suffix:E,outputLen:B,rounds:_,enableXOF:v}=this;return y||(y=new S(g,E,B,v,_)),y.state32.set(this.state32),y.pos=this.pos,y.posOut=this.posOut,y.finished=this.finished,y.rounds=_,y.suffix=E,y.outputLen=B,y.enableXOF=v,y.destroyed=this.destroyed,y}}Se.Keccak=S;const m=(s,y,g)=>(0,t.createHasher)(()=>new S(y,s,g));Se.sha3_224=m(6,144,224/8),Se.sha3_256=m(6,136,256/8),Se.sha3_384=m(6,104,384/8),Se.sha3_512=m(6,72,512/8),Se.keccak_224=m(1,144,224/8),Se.keccak_256=m(1,136,256/8),Se.keccak_384=m(1,104,384/8),Se.keccak_512=m(1,72,512/8);const j=(s,y,g)=>(0,t.createXOFer)((E={})=>new S(y,s,E.dkLen===void 0?g:E.dkLen,!0));return Se.shake128=j(31,168,128/8),Se.shake256=j(31,136,256/8),Se}var Al;function at(){if(Al)return Li;Al=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.keccak256=i;const e=vv(),t=nt(),n=Pe(),r=ie();function i(a,o){const c=o||"hex",u=(0,e.keccak_256)((0,t.isHex)(a,{strict:!1})?(0,n.toBytes)(a):a);return c==="bytes"?u:(0,r.toHex)(u)}return Li}var ro={},Ui={},zi={},Tl;function Ev(){if(Tl)return zi;Tl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.hashSignature=r;const e=Pe(),t=at(),n=i=>(0,t.keccak256)((0,e.toBytes)(i));function r(i){return n(i)}return zi}var no={},Di={},Sl;function wv(){if(Sl)return Di;Sl=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.normalizeSignature=t;const e=fe();function t(n){let r=!0,i="",a=0,o="",c=!1;for(let u=0;u{const i=typeof r=="string"?r:(0,e.formatAbiItem)(r);return(0,t.normalizeSignature)(i)};return no.toSignature=n,no}var Bl;function zu(){if(Bl)return Ui;Bl=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.toSignatureHash=n;const e=Ev(),t=gf();function n(r){return(0,e.hashSignature)((0,t.toSignature)(r))}return Ui}var Rl;function Rn(){if(Rl)return ro;Rl=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.toEventSelector=void 0;const e=zu();return ro.toEventSelector=e.toSignatureHash,ro}var oo={},io={},Ol;function St(){if(Ol)return io;Ol=1,Object.defineProperty(io,"__esModule",{value:!0}),io.InvalidAddressError=void 0;const e=fe();class t extends e.BaseError{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"})}}return io.InvalidAddressError=t,io}var Fd={},so={},Cl;function Xr(){if(Cl)return so;Cl=1,Object.defineProperty(so,"__esModule",{value:!0}),so.LruMap=void 0;class e extends Map{constructor(n){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=n}get(n){const r=super.get(n);return super.has(n)&&r!==void 0&&(this.delete(n),super.set(n,r)),r}set(n,r){if(super.set(n,r),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}return so.LruMap=e,so}var ao={},xl;function yt(){if(xl)return ao;xl=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.checksumAddress=o,ao.getAddress=c;const e=St(),t=Pe(),n=at(),r=Xr(),i=ct(),a=new r.LruMap(8192);function o(u,d){if(a.has(`${u}.${d}`))return a.get(`${u}.${d}`);const l=d?`${d}${u.toLowerCase()}`:u.substring(2).toLowerCase(),f=(0,n.keccak256)((0,t.stringToBytes)(l),"bytes"),b=(d?l.substring(`${d}0x`.length):l).split("");for(let w=0;w<40;w+=2)f[w>>1]>>4>=8&&b[w]&&(b[w]=b[w].toUpperCase()),(f[w>>1]&15)>=8&&b[w+1]&&(b[w+1]=b[w+1].toUpperCase());const T=`0x${b.join("")}`;return a.set(`${u}.${d}`,T),T}function c(u,d){if(!(0,i.isAddress)(u,{strict:!1}))throw new e.InvalidAddressError({address:u});return o(u,d)}return ao}var ql;function ct(){return ql||(ql=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAddressCache=void 0,e.isAddress=i;const t=Xr(),n=yt(),r=/^0x[a-fA-F0-9]{40}$/;e.isAddressCache=new t.LruMap(8192);function i(a,o){const{strict:c=!0}=o??{},u=`${a}.${c}`;if(e.isAddressCache.has(u))return e.isAddressCache.get(u);const d=r.test(a)?a.toLowerCase()===a?!0:c?(0,n.checksumAddress)(a)===a:!0:!1;return e.isAddressCache.set(u,d),d}})(Fd)),Fd}var fn={},Hl;function De(){if(Hl)return fn;Hl=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.concat=e,fn.concatBytes=t,fn.concatHex=n;function e(r){return typeof r[0]=="string"?n(r):t(r)}function t(r){let i=0;for(const c of r)i+=c.length;const a=new Uint8Array(i);let o=0;for(const c of r)a.set(c,o),o+=c.length;return a}function n(r){return`0x${r.reduce((i,a)=>i+a.replace("0x",""),"")}`}return fn}var ln={},Ml;function vt(){if(Ml)return ln;Ml=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.slice=r,ln.sliceBytes=o,ln.sliceHex=c;const e=Uu(),t=nt(),n=st();function r(u,d,l,{strict:f}={}){return(0,t.isHex)(u,{strict:!1})?c(u,d,l,{strict:f}):o(u,d,l,{strict:f})}function i(u,d){if(typeof d=="number"&&d>0&&d>(0,n.size)(u)-1)throw new e.SliceOffsetOutOfBoundsError({offset:d,position:"start",size:(0,n.size)(u)})}function a(u,d,l){if(typeof d=="number"&&typeof l=="number"&&(0,n.size)(u)!==l-d)throw new e.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:(0,n.size)(u)})}function o(u,d,l,{strict:f}={}){i(u,d);const b=u.slice(d,l);return f&&a(b,d,l),b}function c(u,d,l,{strict:f}={}){i(u,d);const b=`0x${u.replace("0x","").slice((d??0)*2,(l??u.length)*2)}`;return f&&a(b,d,l),b}return ln}var Gt={},kl;function Du(){return kl||(kl=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.integerRegex=Gt.bytesRegex=Gt.arrayRegex=void 0,Gt.arrayRegex=/^(.*)\[([0-9]*)\]$/,Gt.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Gt.integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/),Gt}var Nl;function It(){if(Nl)return oo;Nl=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.encodeAbiParameters=f,oo.getArrayComponents=g;const e=qe(),t=St(),n=fe(),r=Bn(),i=ct(),a=De(),o=br(),c=st(),u=vt(),d=ie(),l=Du();function f(E,B){if(E.length!==B.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:E.length,givenLength:B.length});const _=b({params:E,values:B}),v=w(_);return v.length===0?"0x":v}function b({params:E,values:B}){const _=[];for(let v=0;v0?(0,a.concat)([H,R]):H}}if(C)return{dynamic:!0,encoded:R}}return{dynamic:!1,encoded:(0,a.concat)(q.map(({encoded:R})=>R))}}function S(E,{param:B}){const[,_]=B.type.split("bytes"),v=(0,c.size)(E);if(!_){let C=E;return v%32!==0&&(C=(0,o.padHex)(C,{dir:"right",size:Math.ceil((E.length-2)/2/32)*32})),{dynamic:!0,encoded:(0,a.concat)([(0,o.padHex)((0,d.numberToHex)(v,{size:32})),C])}}if(v!==Number.parseInt(_,10))throw new e.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(_,10),value:E});return{dynamic:!1,encoded:(0,o.padHex)(E,{dir:"right"})}}function m(E){if(typeof E!="boolean")throw new n.BaseError(`Invalid boolean value: "${E}" (type: ${typeof E}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,o.padHex)((0,d.boolToHex)(E))}}function j(E,{signed:B,size:_=256}){if(typeof _=="number"){const v=2n**(BigInt(_)-(B?1n:0n))-1n,C=B?-v-1n:0n;if(E>v||EC))}}function g(E){const B=E.match(/^(.*)\[(\d+)?\]$/);return B?[B[2]?Number(B[2]):null,B[1]]:void 0}return oo}var bn={},co={},Fl;function Qr(){if(Fl)return co;Fl=1,Object.defineProperty(co,"__esModule",{value:!0}),co.toFunctionSelector=void 0;const e=vt(),t=zu(),n=r=>(0,e.slice)((0,t.toSignatureHash)(r),0,4);return co.toFunctionSelector=n,co}var Ll;function er(){if(Ll)return bn;Ll=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.getAbiItem=a,bn.isArgOfType=o,bn.getAmbiguousTypes=c;const e=qe(),t=nt(),n=ct(),r=Rn(),i=Qr();function a(u){const{abi:d,args:l=[],name:f}=u,b=(0,t.isHex)(f,{strict:!1}),T=d.filter(p=>b?p.type==="function"?(0,i.toFunctionSelector)(p)===f:p.type==="event"?(0,r.toEventSelector)(p)===f:!1:"name"in p&&p.name===f);if(T.length===0)return;if(T.length===1)return T[0];let w;for(const p of T){if(!("inputs"in p))continue;if(!l||l.length===0){if(!p.inputs||p.inputs.length===0)return p;continue}if(!p.inputs||p.inputs.length===0||p.inputs.length!==l.length)continue;if(l.every((S,m)=>{const j="inputs"in p&&p.inputs[m];return j?o(S,j):!1})){if(w&&"inputs"in w&&w.inputs){const S=c(p.inputs,w.inputs,l);if(S)throw new e.AbiItemAmbiguityError({abiItem:p,type:S[0]},{abiItem:w,type:S[1]})}w=p}}return w||T[0]}function o(u,d){const l=typeof u,f=d.type;switch(f){case"address":return(0,n.isAddress)(u,{strict:!1});case"bool":return l==="boolean";case"function":return l==="string";case"string":return l==="string";default:return f==="tuple"&&"components"in d?Object.values(d.components).every((b,T)=>l==="object"&&o(Object.values(u)[T],b)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(f)?l==="number"||l==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(f)?l==="string"||u instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(f)?Array.isArray(u)&&u.every(b=>o(b,{...d,type:f.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function c(u,d,l){for(const f in u){const b=u[f],T=d[f];if(b.type==="tuple"&&T.type==="tuple"&&"components"in b&&"components"in T)return c(b.components,T.components,l[f]);const w=[b.type,T.type];if(w.includes("address")&&w.includes("bytes20")?!0:w.includes("address")&&w.includes("string")?(0,n.isAddress)(l[f],{strict:!1}):w.includes("address")&&w.includes("bytes")?(0,n.isAddress)(l[f],{strict:!1}):!1)return w}}return bn}var Ul;function $r(){if(Ul)return Mi;Ul=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.encodeEventTopics=d;const e=qe(),t=Cp(),n=Pe(),r=at(),i=Rn(),a=It(),o=Qt(),c=er(),u="/docs/contract/encodeEventTopics";function d(f){const{abi:b,eventName:T,args:w}=f;let p=b[0];if(T){const j=(0,c.getAbiItem)({abi:b,name:T});if(!j)throw new e.AbiEventNotFoundError(T,{docsPath:u});p=j}if(p.type!=="event")throw new e.AbiEventNotFoundError(void 0,{docsPath:u});const O=(0,o.formatAbiItem)(p),S=(0,i.toEventSelector)(O);let m=[];if(w&&"inputs"in p){const j=p.inputs?.filter(y=>"indexed"in y&&y.indexed),s=Array.isArray(w)?w:Object.values(w).length>0?j?.map(y=>w[y.name])??[]:[];s.length>0&&(m=j?.map((y,g)=>Array.isArray(s[g])?s[g].map((E,B)=>l({param:y,value:s[g][B]})):typeof s[g]<"u"&&s[g]!==null?l({param:y,value:s[g]}):null)??[])}return[S,...m]}function l({param:f,value:b}){if(f.type==="string"||f.type==="bytes")return(0,r.keccak256)((0,n.toBytes)(b));if(f.type==="tuple"||f.type.match(/^(.*)\[(\d+)?\]$/))throw new t.FilterTypeNotSupportedError(f.type);return(0,a.encodeAbiParameters)([f],[b])}return Mi}var Gi={},zl;function Gu(){if(zl)return Gi;zl=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.createFilterRequestScope=e;function e(t,{method:n}){const r={};return t.transport.type==="fallback"&&t.transport.onResponse?.(({method:i,response:a,status:o,transport:c})=>{o==="success"&&n===i&&(r[a]=c.request)}),(i=>r[i]||t.request)}return Gi}var Dl;function pf(){if(Dl)return Hi;Dl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.createContractEventFilter=r;const e=$r(),t=ie(),n=Gu();async function r(i,a){const{address:o,abi:c,args:u,eventName:d,fromBlock:l,strict:f,toBlock:b}=a,T=(0,n.createFilterRequestScope)(i,{method:"eth_newFilter"}),w=d?(0,e.encodeEventTopics)({abi:c,args:u,eventName:d}):void 0,p=await i.request({method:"eth_newFilter",params:[{address:o,fromBlock:typeof l=="bigint"?(0,t.numberToHex)(l):l,toBlock:typeof b=="bigint"?(0,t.numberToHex)(b):b,topics:w}]});return{abi:c,args:u,eventName:d,id:p,request:T(p),strict:!!f,type:"event"}}return Hi}var Vi={},Wi={},Gl;function He(){if(Gl)return Wi;Gl=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.parseAccount=e;function e(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}return Wi}var Ki={},Zi={},Vl;function qp(){if(Vl)return Zi;Vl=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.prepareEncodeFunctionData=a;const e=qe(),t=Qr(),n=Qt(),r=er(),i="/docs/contract/encodeFunctionData";function a(o){const{abi:c,args:u,functionName:d}=o;let l=c[0];if(d){const f=(0,r.getAbiItem)({abi:c,args:u,name:d});if(!f)throw new e.AbiFunctionNotFoundError(d,{docsPath:i});l=f}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:i});return{abi:[l],functionName:(0,t.toFunctionSelector)((0,n.formatAbiItem)(l))}}return Zi}var Wl;function ut(){if(Wl)return Ki;Wl=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.encodeFunctionData=r;const e=De(),t=It(),n=qp();function r(i){const{args:a}=i,{abi:o,functionName:c}=i.abi.length===1&&i.functionName?.startsWith("0x")?i:(0,n.prepareEncodeFunctionData)(i),u=o[0],d=c,l="inputs"in u&&u.inputs?(0,t.encodeAbiParameters)(u.inputs,a??[]):void 0;return(0,e.concatHex)([d,l??"0x"])}return Ki}var Yi={},Qe={},Vt={},Kl;function _f(){return Kl||(Kl=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.solidityPanic=Vt.solidityError=Vt.panicReasons=void 0,Vt.panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Vt.solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Vt.solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}),Vt}var Ji={},Xi={},Qi={},Wt={},Zl;function Hp(){if(Zl)return Wt;Zl=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.RecursiveReadLimitExceededError=Wt.PositionOutOfBoundsError=Wt.NegativeOffsetError=void 0;const e=fe();class t extends e.BaseError{constructor({offset:a}){super(`Offset \`${a}\` cannot be negative.`,{name:"NegativeOffsetError"})}}Wt.NegativeOffsetError=t;class n extends e.BaseError{constructor({length:a,position:o}){super(`Position \`${o}\` is out of bounds (\`0 < position < ${a}\`).`,{name:"PositionOutOfBoundsError"})}}Wt.PositionOutOfBoundsError=n;class r extends e.BaseError{constructor({count:a,limit:o}){super(`Recursive read limit of \`${o}\` exceeded (recursive read count: \`${a}\`).`,{name:"RecursiveReadLimitExceededError"})}}return Wt.RecursiveReadLimitExceededError=r,Wt}var Yl;function Vo(){if(Yl)return Qi;Yl=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.createCursor=n;const e=Hp(),t={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new e.RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(r){if(r<0||r>this.bytes.length-1)throw new e.PositionOutOfBoundsError({length:this.bytes.length,position:r})},decrementPosition(r){if(r<0)throw new e.NegativeOffsetError({offset:r});const i=this.position-r;this.assertPosition(i),this.position=i},getReadCount(r){return this.positionReadCount.get(r||this.position)||0},incrementPosition(r){if(r<0)throw new e.NegativeOffsetError({offset:r});const i=this.position+r;this.assertPosition(i),this.position=i},inspectByte(r){const i=r??this.position;return this.assertPosition(i),this.bytes[i]},inspectBytes(r,i){const a=i??this.position;return this.assertPosition(a+r-1),this.bytes.subarray(a,a+r)},inspectUint8(r){const i=r??this.position;return this.assertPosition(i),this.bytes[i]},inspectUint16(r){const i=r??this.position;return this.assertPosition(i+1),this.dataView.getUint16(i)},inspectUint24(r){const i=r??this.position;return this.assertPosition(i+2),(this.dataView.getUint16(i)<<8)+this.dataView.getUint8(i+2)},inspectUint32(r){const i=r??this.position;return this.assertPosition(i+3),this.dataView.getUint32(i)},pushByte(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushBytes(r){this.assertPosition(this.position+r.length-1),this.bytes.set(r,this.position),this.position+=r.length},pushUint8(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushUint16(r){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,r),this.position+=2},pushUint24(r){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,r>>8),this.dataView.setUint8(this.position+2,r&255),this.position+=3},pushUint32(r){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,r),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const r=this.inspectByte();return this.position++,r},readBytes(r,i){this.assertReadLimit(),this._touch();const a=this.inspectBytes(r);return this.position+=i??r,a},readUint8(){this.assertReadLimit(),this._touch();const r=this.inspectUint8();return this.position+=1,r},readUint16(){this.assertReadLimit(),this._touch();const r=this.inspectUint16();return this.position+=2,r},readUint24(){this.assertReadLimit(),this._touch();const r=this.inspectUint24();return this.position+=3,r},readUint32(){this.assertReadLimit(),this._touch();const r=this.inspectUint32();return this.position+=4,r},get remaining(){return this.bytes.length-this.position},setPosition(r){const i=this.position;return this.assertPosition(r),this.position=r,()=>this.position=i},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const r=this.getReadCount();this.positionReadCount.set(this.position,r+1),r>0&&this.recursiveReadCount++}};function n(r,{recursiveReadLimit:i=8192}={}){const a=Object.create(t);return a.bytes=r,a.dataView=new DataView(r.buffer??r,r.byteOffset,r.byteLength),a.positionReadCount=new Map,a.recursiveReadLimit=i,a}return Qi}var sr={},Jl;function vf(){if(Jl)return sr;Jl=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.fromBytes=i,sr.bytesToBigInt=a,sr.bytesToBool=o,sr.bytesToNumber=c,sr.bytesToString=u;const e=Bn(),t=$t(),n=Ne(),r=ie();function i(d,l){const f=typeof l=="string"?{to:l}:l,b=f.to;return b==="number"?c(d,f):b==="bigint"?a(d,f):b==="boolean"?o(d,f):b==="string"?u(d,f):(0,r.bytesToHex)(d,f)}function a(d,l={}){typeof l.size<"u"&&(0,n.assertSize)(d,{size:l.size});const f=(0,r.bytesToHex)(d,l);return(0,n.hexToBigInt)(f,l)}function o(d,l={}){let f=d;if(typeof l.size<"u"&&((0,n.assertSize)(f,{size:l.size}),f=(0,t.trim)(f)),f.length>1||f[0]>1)throw new e.InvalidBytesBooleanError(f);return!!f[0]}function c(d,l={}){typeof l.size<"u"&&(0,n.assertSize)(d,{size:l.size});const f=(0,r.bytesToHex)(d,l);return(0,n.hexToNumber)(f,l)}function u(d,l={}){let f=d;return typeof l.size<"u"&&((0,n.assertSize)(f,{size:l.size}),f=(0,t.trim)(f,{dir:"right"})),new TextDecoder().decode(f)}return sr}var Xl;function hr(){if(Xl)return Xi;Xl=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.decodeAbiParameters=l;const e=qe(),t=yt(),n=Vo(),r=st(),i=vt(),a=$t(),o=vf(),c=Pe(),u=ie(),d=It();function l(g,E){const B=typeof E=="string"?(0,c.hexToBytes)(E):E,_=(0,n.createCursor)(B);if((0,r.size)(B)===0&&g.length>0)throw new e.AbiDecodingZeroDataError;if((0,r.size)(E)&&(0,r.size)(E)<32)throw new e.AbiDecodingDataSizeTooSmallError({data:typeof E=="string"?E:(0,u.bytesToHex)(E),params:g,size:(0,r.size)(E)});let v=0;const C=[];for(let q=0;q48?(0,o.bytesToBigInt)(v,{signed:B}):(0,o.bytesToNumber)(v,{signed:B}),32]}function j(g,E,{staticPosition:B}){const _=E.components.length===0||E.components.some(({name:q})=>!q),v=_?[]:{};let C=0;if(y(E)){const q=(0,o.bytesToNumber)(g.readBytes(T)),R=B+q;for(let H=0;HT.type==="error"&&l===(0,r.toFunctionSelector)((0,a.formatAbiItem)(T)));if(!b)throw new t.AbiErrorSignatureNotFoundError(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:b,args:"inputs"in b&&b.inputs&&b.inputs.length>0?(0,i.decodeAbiParameters)(b.inputs,(0,n.slice)(d,4)):void 0,errorName:b.name}}return Ji}var $i={},uo={},$l;function Ve(){if($l)return uo;$l=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.stringify=void 0;const e=(t,n,r)=>JSON.stringify(t,(i,a)=>{const o=typeof a=="bigint"?a.toString():a;return typeof n=="function"?n(i,o):o},r);return uo.stringify=e,uo}var eb;function Mp(){if(eb)return $i;eb=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.formatAbiItemWithArgs=t;const e=Ve();function t({abiItem:n,args:r,includeFunctionName:i=!0,includeName:a=!1}){if("name"in n&&"inputs"in n&&n.inputs)return`${i?n.name:""}(${n.inputs.map((o,c)=>`${a&&o.name?`${o.name}: `:""}${typeof r[c]=="object"?(0,e.stringify)(r[c]):r[c]}`).join(", ")})`}return $i}var es={},Kt={},tb;function Wo(){return tb||(tb=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.weiUnits=Kt.gweiUnits=Kt.etherUnits=void 0,Kt.etherUnits={gwei:9,wei:18},Kt.gweiUnits={ether:-9,wei:9},Kt.weiUnits={ether:-18,gwei:-9}),Kt}var ts={},rb;function Wu(){if(rb)return ts;rb=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.formatUnits=e;function e(t,n){let r=t.toString();const i=r.startsWith("-");i&&(r=r.slice(1)),r=r.padStart(n,"0");let[a,o]=[r.slice(0,r.length-n),r.slice(r.length-n)];return o=o.replace(/(0+)$/,""),`${i?"-":""}${a||"0"}${o?`.${o}`:""}`}return ts}var nb;function Ko(){if(nb)return es;nb=1,Object.defineProperty(es,"__esModule",{value:!0}),es.formatEther=n;const e=Wo(),t=Wu();function n(r,i="wei"){return(0,t.formatUnits)(r,e.etherUnits[i])}return es}var rs={},ob;function en(){if(ob)return rs;ob=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.formatGwei=n;const e=Wo(),t=Wu();function n(r,i="wei"){return(0,t.formatUnits)(r,e.gweiUnits[i])}return rs}var Zt={},ib;function Ef(){if(ib)return Zt;ib=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.StateAssignmentConflictError=Zt.AccountStateConflictError=void 0,Zt.prettyStateMapping=r,Zt.prettyStateOverride=i;const e=fe();class t extends e.BaseError{constructor({address:o}){super(`State for account "${o}" is set multiple times.`,{name:"AccountStateConflictError"})}}Zt.AccountStateConflictError=t;class n extends e.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}Zt.StateAssignmentConflictError=n;function r(a){return a.reduce((o,{slot:c,value:u})=>`${o} ${c}: ${u}
+`,"")}function i(a){return a.reduce((o,{address:c,...u})=>{let d=`${o} ${c}:
+`;return u.nonce&&(d+=` nonce: ${u.nonce}
+`),u.balance&&(d+=` balance: ${u.balance}
+`),u.code&&(d+=` code: ${u.code}
+`),u.state&&(d+=` state:
+`,d+=r(u.state)),u.stateDiff&&(d+=` stateDiff:
+`,d+=r(u.stateDiff)),d},` State Override:
+`).slice(0,-1)}return Zt}var Ie={},sb;function dt(){if(sb)return Ie;sb=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.WaitForTransactionReceiptTimeoutError=Ie.TransactionReceiptRevertedError=Ie.TransactionReceiptNotFoundError=Ie.TransactionNotFoundError=Ie.TransactionExecutionError=Ie.InvalidStorageKeySizeError=Ie.InvalidSerializedTransactionError=Ie.InvalidSerializedTransactionTypeError=Ie.InvalidSerializableTransactionError=Ie.InvalidLegacyVError=Ie.FeeConflictError=void 0,Ie.prettyPrint=r;const e=Ko(),t=en(),n=fe();function r(p){const O=Object.entries(p).map(([m,j])=>j===void 0||j===!1?null:[m,j]).filter(Boolean),S=O.reduce((m,[j])=>Math.max(m,j.length),0);return O.map(([m,j])=>` ${`${m}:`.padEnd(S+1)} ${j}`).join(`
+`)}class i extends n.BaseError{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
+`),{name:"FeeConflictError"})}}Ie.FeeConflictError=i;class a extends n.BaseError{constructor({v:O}){super(`Invalid \`v\` value "${O}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}Ie.InvalidLegacyVError=a;class o extends n.BaseError{constructor({transaction:O}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",r(O),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}Ie.InvalidSerializableTransactionError=o;class c extends n.BaseError{constructor({serializedType:O}){super(`Serialized transaction type "${O}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=O}}Ie.InvalidSerializedTransactionTypeError=c;class u extends n.BaseError{constructor({attributes:O,serializedTransaction:S,type:m}){const j=Object.entries(O).map(([s,y])=>typeof y>"u"?s:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${m}" was provided.`,{metaMessages:[`Serialized Transaction: "${S}"`,j.length>0?`Missing Attributes: ${j.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=S,this.type=m}}Ie.InvalidSerializedTransactionError=u;class d extends n.BaseError{constructor({storageKey:O}){super(`Size for storage key "${O}" is invalid. Expected 32 bytes. Got ${Math.floor((O.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}Ie.InvalidStorageKeySizeError=d;class l extends n.BaseError{constructor(O,{account:S,docsPath:m,chain:j,data:s,gas:y,gasPrice:g,maxFeePerGas:E,maxPriorityFeePerGas:B,nonce:_,to:v,value:C}){const q=r({chain:j&&`${j?.name} (id: ${j?.id})`,from:S?.address,to:v,value:typeof C<"u"&&`${(0,e.formatEther)(C)} ${j?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:y,gasPrice:typeof g<"u"&&`${(0,t.formatGwei)(g)} gwei`,maxFeePerGas:typeof E<"u"&&`${(0,t.formatGwei)(E)} gwei`,maxPriorityFeePerGas:typeof B<"u"&&`${(0,t.formatGwei)(B)} gwei`,nonce:_});super(O.shortMessage,{cause:O,docsPath:m,metaMessages:[...O.metaMessages?[...O.metaMessages," "]:[],"Request Arguments:",q].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=O}}Ie.TransactionExecutionError=l;class f extends n.BaseError{constructor({blockHash:O,blockNumber:S,blockTag:m,hash:j,index:s}){let y="Transaction";m&&s!==void 0&&(y=`Transaction at block time "${m}" at index "${s}"`),O&&s!==void 0&&(y=`Transaction at block hash "${O}" at index "${s}"`),S&&s!==void 0&&(y=`Transaction at block number "${S}" at index "${s}"`),j&&(y=`Transaction with hash "${j}"`),super(`${y} could not be found.`,{name:"TransactionNotFoundError"})}}Ie.TransactionNotFoundError=f;class b extends n.BaseError{constructor({hash:O}){super(`Transaction receipt with hash "${O}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}Ie.TransactionReceiptNotFoundError=b;class T extends n.BaseError{constructor({receipt:O}){super(`Transaction with hash "${O.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=O}}Ie.TransactionReceiptRevertedError=T;class w extends n.BaseError{constructor({hash:O}){super(`Timed out while waiting for transaction with hash "${O}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}return Ie.WaitForTransactionReceiptTimeoutError=w,Ie}var qr={},ab;function wf(){if(ab)return qr;ab=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.getUrl=qr.getContractAddress=void 0;const e=n=>n;qr.getContractAddress=e;const t=n=>n;return qr.getUrl=t,qr}var cb;function yr(){if(cb)return Qe;cb=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.RawContractError=Qe.CounterfactualDeploymentFailedError=Qe.ContractFunctionZeroDataError=Qe.ContractFunctionRevertedError=Qe.ContractFunctionExecutionError=Qe.CallExecutionError=void 0;const e=He(),t=_f(),n=Vu(),r=Qt(),i=Mp(),a=er(),o=Ko(),c=en(),u=qe(),d=fe(),l=Ef(),f=dt(),b=wf();class T extends d.BaseError{constructor(s,{account:y,docsPath:g,chain:E,data:B,gas:_,gasPrice:v,maxFeePerGas:C,maxPriorityFeePerGas:q,nonce:R,to:H,value:F,stateOverride:k}){const h=y?(0,e.parseAccount)(y):void 0;let M=(0,f.prettyPrint)({from:h?.address,to:H,value:typeof F<"u"&&`${(0,o.formatEther)(F)} ${E?.nativeCurrency?.symbol||"ETH"}`,data:B,gas:_,gasPrice:typeof v<"u"&&`${(0,c.formatGwei)(v)} gwei`,maxFeePerGas:typeof C<"u"&&`${(0,c.formatGwei)(C)} gwei`,maxPriorityFeePerGas:typeof q<"u"&&`${(0,c.formatGwei)(q)} gwei`,nonce:R});k&&(M+=`
+${(0,l.prettyStateOverride)(k)}`),super(s.shortMessage,{cause:s,docsPath:g,metaMessages:[...s.metaMessages?[...s.metaMessages," "]:[],"Raw Call Arguments:",M].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=s}}Qe.CallExecutionError=T;class w extends d.BaseError{constructor(s,{abi:y,args:g,contractAddress:E,docsPath:B,functionName:_,sender:v}){const C=(0,a.getAbiItem)({abi:y,args:g,name:_}),q=C?(0,i.formatAbiItemWithArgs)({abiItem:C,args:g,includeFunctionName:!1,includeName:!1}):void 0,R=C?(0,r.formatAbiItem)(C,{includeName:!0}):void 0,H=(0,f.prettyPrint)({address:E&&(0,b.getContractAddress)(E),function:R,args:q&&q!=="()"&&`${[...Array(_?.length??0).keys()].map(()=>" ").join("")}${q}`,sender:v});super(s.shortMessage||`An unknown error occurred while executing the contract function "${_}".`,{cause:s,docsPath:B,metaMessages:[...s.metaMessages?[...s.metaMessages," "]:[],H&&"Contract Call:",H].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=y,this.args=g,this.cause=s,this.contractAddress=E,this.functionName=_,this.sender=v}}Qe.ContractFunctionExecutionError=w;class p extends d.BaseError{constructor({abi:s,data:y,functionName:g,message:E}){let B,_,v,C;if(y&&y!=="0x")try{_=(0,n.decodeErrorResult)({abi:s,data:y});const{abiItem:R,errorName:H,args:F}=_;if(H==="Error")C=F[0];else if(H==="Panic"){const[k]=F;C=t.panicReasons[k]}else{const k=R?(0,r.formatAbiItem)(R,{includeName:!0}):void 0,h=R&&F?(0,i.formatAbiItemWithArgs)({abiItem:R,args:F,includeFunctionName:!1,includeName:!1}):void 0;v=[k?`Error: ${k}`:"",h&&h!=="()"?` ${[...Array(H?.length??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(R){B=R}else E&&(C=E);let q;B instanceof u.AbiErrorSignatureNotFoundError&&(q=B.signature,v=[`Unable to decode signature "${q}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${q}.`]),super(C&&C!=="execution reverted"||q?[`The contract function "${g}" reverted with the following ${q?"signature":"reason"}:`,C||q].join(`
+`):`The contract function "${g}" reverted.`,{cause:B,metaMessages:v,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=_,this.raw=y,this.reason=C,this.signature=q}}Qe.ContractFunctionRevertedError=p;class O extends d.BaseError{constructor({functionName:s}){super(`The contract function "${s}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${s}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}Qe.ContractFunctionZeroDataError=O;class S extends d.BaseError{constructor({factory:s}){super(`Deployment for counterfactual contract call failed${s?` for factory "${s}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}Qe.CounterfactualDeploymentFailedError=S;class m extends d.BaseError{constructor({data:s,message:y}){super(y||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s}}return Qe.RawContractError=m,Qe}var lt={},ub;function Bt(){if(ub)return lt;ub=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.TimeoutError=lt.SocketClosedError=lt.RpcRequestError=lt.WebSocketRequestError=lt.HttpRequestError=void 0;const e=Ve(),t=fe(),n=wf();class r extends t.BaseError{constructor({body:d,cause:l,details:f,headers:b,status:T,url:w}){super("HTTP request failed.",{cause:l,details:f,metaMessages:[T&&`Status: ${T}`,`URL: ${(0,n.getUrl)(w)}`,d&&`Request body: ${(0,e.stringify)(d)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=d,this.headers=b,this.status=T,this.url=w}}lt.HttpRequestError=r;class i extends t.BaseError{constructor({body:d,cause:l,details:f,url:b}){super("WebSocket request failed.",{cause:l,details:f,metaMessages:[`URL: ${(0,n.getUrl)(b)}`,d&&`Request body: ${(0,e.stringify)(d)}`].filter(Boolean),name:"WebSocketRequestError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=b}}lt.WebSocketRequestError=i;class a extends t.BaseError{constructor({body:d,error:l,url:f}){super("RPC Request failed.",{cause:l,details:l.message,metaMessages:[`URL: ${(0,n.getUrl)(f)}`,`Request body: ${(0,e.stringify)(d)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=l.code,this.data=l.data,this.url=f}}lt.RpcRequestError=a;class o extends t.BaseError{constructor({url:d}={}){super("The socket has been closed.",{metaMessages:[d&&`URL: ${(0,n.getUrl)(d)}`].filter(Boolean),name:"SocketClosedError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=d}}lt.SocketClosedError=o;class c extends t.BaseError{constructor({body:d,url:l}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,n.getUrl)(l)}`,`Request body: ${(0,e.stringify)(d)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=l}}return lt.TimeoutError=c,lt}var ae={},db;function gr(){if(db)return ae;db=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.UnknownRpcError=ae.AtomicityNotSupportedError=ae.AtomicReadyWalletRejectedUpgradeError=ae.BundleTooLargeError=ae.UnknownBundleIdError=ae.DuplicateIdError=ae.UnsupportedChainIdError=ae.UnsupportedNonOptionalCapabilityError=ae.SwitchChainError=ae.ChainDisconnectedError=ae.ProviderDisconnectedError=ae.UnsupportedProviderMethodError=ae.UnauthorizedProviderError=ae.UserRejectedRequestError=ae.JsonRpcVersionUnsupportedError=ae.LimitExceededRpcError=ae.MethodNotSupportedRpcError=ae.TransactionRejectedRpcError=ae.ResourceUnavailableRpcError=ae.ResourceNotFoundRpcError=ae.InvalidInputRpcError=ae.InternalRpcError=ae.InvalidParamsRpcError=ae.MethodNotFoundRpcError=ae.InvalidRequestRpcError=ae.ParseRpcError=ae.ProviderRpcError=ae.RpcError=void 0;const e=fe(),t=Bt(),n=-1;class r extends e.BaseError{constructor(k,{code:h,docsPath:M,metaMessages:A,name:P,shortMessage:I}){super(I,{cause:k,docsPath:M,metaMessages:A||k?.metaMessages,name:P||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=P||k.name,this.code=k instanceof t.RpcRequestError?k.code:h??n}}ae.RpcError=r;class i extends r{constructor(k,h){super(k,h),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=h.data}}ae.ProviderRpcError=i;class a extends r{constructor(k){super(k,{code:a.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}ae.ParseRpcError=a,Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class o extends r{constructor(k){super(k,{code:o.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}ae.InvalidRequestRpcError=o,Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class c extends r{constructor(k,{method:h}={}){super(k,{code:c.code,name:"MethodNotFoundRpcError",shortMessage:`The method${h?` "${h}"`:""} does not exist / is not available.`})}}ae.MethodNotFoundRpcError=c,Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends r{constructor(k){super(k,{code:u.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
+`)})}}ae.InvalidParamsRpcError=u,Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends r{constructor(k){super(k,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}ae.InternalRpcError=d,Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class l extends r{constructor(k){super(k,{code:l.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
+`)})}}ae.InvalidInputRpcError=l,Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class f extends r{constructor(k){super(k,{code:f.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}ae.ResourceNotFoundRpcError=f,Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class b extends r{constructor(k){super(k,{code:b.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}ae.ResourceUnavailableRpcError=b,Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class T extends r{constructor(k){super(k,{code:T.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}ae.TransactionRejectedRpcError=T,Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class w extends r{constructor(k,{method:h}={}){super(k,{code:w.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${h?` "${h}"`:""} is not supported.`})}}ae.MethodNotSupportedRpcError=w,Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class p extends r{constructor(k){super(k,{code:p.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}ae.LimitExceededRpcError=p,Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class O extends r{constructor(k){super(k,{code:O.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}ae.JsonRpcVersionUnsupportedError=O,Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class S extends i{constructor(k){super(k,{code:S.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}ae.UserRejectedRequestError=S,Object.defineProperty(S,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class m extends i{constructor(k){super(k,{code:m.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}ae.UnauthorizedProviderError=m,Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class j extends i{constructor(k,{method:h}={}){super(k,{code:j.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${h?` " ${h}"`:""}.`})}}ae.UnsupportedProviderMethodError=j,Object.defineProperty(j,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class s extends i{constructor(k){super(k,{code:s.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}ae.ProviderDisconnectedError=s,Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class y extends i{constructor(k){super(k,{code:y.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}ae.ChainDisconnectedError=y,Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class g extends i{constructor(k){super(k,{code:g.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}ae.SwitchChainError=g,Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class E extends i{constructor(k){super(k,{code:E.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}ae.UnsupportedNonOptionalCapabilityError=E,Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class B extends i{constructor(k){super(k,{code:B.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}ae.UnsupportedChainIdError=B,Object.defineProperty(B,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class _ extends i{constructor(k){super(k,{code:_.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}ae.DuplicateIdError=_,Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class v extends i{constructor(k){super(k,{code:v.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}ae.UnknownBundleIdError=v,Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class C extends i{constructor(k){super(k,{code:C.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}ae.BundleTooLargeError=C,Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class q extends i{constructor(k){super(k,{code:q.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}ae.AtomicReadyWalletRejectedUpgradeError=q,Object.defineProperty(q,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class R extends i{constructor(k){super(k,{code:R.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}ae.AtomicityNotSupportedError=R,Object.defineProperty(R,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class H extends r{constructor(k){super(k,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}return ae.UnknownRpcError=H,ae}var fb;function pr(){if(fb)return Yi;fb=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.getContractError=o;const e=qe(),t=fe(),n=yr(),r=Bt(),i=gr(),a=3;function o(c,{abi:u,address:d,args:l,docsPath:f,functionName:b,sender:T}){const w=c instanceof n.RawContractError?c:c instanceof t.BaseError?c.walk(y=>"data"in y)||c.walk():{},{code:p,data:O,details:S,message:m,shortMessage:j}=w,s=c instanceof e.AbiDecodingZeroDataError?new n.ContractFunctionZeroDataError({functionName:b}):[a,i.InternalRpcError.code].includes(p)&&(O||S||m||j)||p===i.InvalidInputRpcError.code&&S==="execution reverted"&&O?new n.ContractFunctionRevertedError({abi:u,data:typeof O=="object"?O.data:O,functionName:b,message:w instanceof r.RpcRequestError?S:j??m}):c;return new n.ContractFunctionExecutionError(s,{abi:u,args:l,contractAddress:d,docsPath:f,functionName:b,sender:T})}return Yi}var ns={},os={},is={},ss={},lb;function kp(){if(lb)return ss;lb=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.publicKeyToAddress=n;const e=yt(),t=at();function n(r){const i=(0,t.keccak256)(`0x${r.substring(4)}`).substring(26);return(0,e.checksumAddress)(`0x${i}`)}return ss}var as={},Ld={},Ee={},Ye={},bb;function Np(){if(bb)return Ye;bb=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.SHA512_IV=Ye.SHA384_IV=Ye.SHA224_IV=Ye.SHA256_IV=Ye.HashMD=void 0,Ye.setBigUint64=t,Ye.Chi=n,Ye.Maj=r;const e=mr();function t(a,o,c,u){if(typeof a.setBigUint64=="function")return a.setBigUint64(o,c,u);const d=BigInt(32),l=BigInt(4294967295),f=Number(c>>d&l),b=Number(c&l),T=u?4:0,w=u?0:4;a.setUint32(o+T,f,u),a.setUint32(o+w,b,u)}function n(a,o,c){return a&o^~a&c}function r(a,o,c){return a&o^a&c^o&c}class i extends e.Hash{constructor(o,c,u,d){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=o,this.outputLen=c,this.padOffset=u,this.isLE=d,this.buffer=new Uint8Array(o),this.view=(0,e.createView)(this.buffer)}update(o){(0,e.aexists)(this),o=(0,e.toBytes)(o),(0,e.abytes)(o);const{view:c,buffer:u,blockLen:d}=this,l=o.length;for(let f=0;fd-f&&(this.process(u,0),f=0);for(let O=f;Op.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O>>3,h=(0,n.rotr)(F,17)^(0,n.rotr)(F,19)^F>>>10;i[R]=h+i[R-7]+k+i[R-16]|0}let{A:y,B:g,C:E,D:B,E:_,F:v,G:C,H:q}=this;for(let R=0;R<64;R++){const H=(0,n.rotr)(_,6)^(0,n.rotr)(_,11)^(0,n.rotr)(_,25),F=q+H+(0,e.Chi)(_,v,C)+r[R]+i[R]|0,h=((0,n.rotr)(y,2)^(0,n.rotr)(y,13)^(0,n.rotr)(y,22))+(0,e.Maj)(y,g,E)|0;q=C,C=v,v=_,_=B+F|0,B=E,E=g,g=y,y=F+h|0}y=y+this.A|0,g=g+this.B|0,E=E+this.C|0,B=B+this.D|0,_=_+this.E|0,v=v+this.F|0,C=C+this.G|0,q=q+this.H|0,this.set(y,g,E,B,_,v,C,q)}roundClean(){(0,n.clean)(i)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.clean)(this.buffer)}}Ee.SHA256=a;class o extends a{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}Ee.SHA224=o;const c=t.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(m=>BigInt(m))),u=c[0],d=c[1],l=new Uint32Array(80),f=new Uint32Array(80);class b extends e.HashMD{constructor(j=64){super(128,j,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:j,Al:s,Bh:y,Bl:g,Ch:E,Cl:B,Dh:_,Dl:v,Eh:C,El:q,Fh:R,Fl:H,Gh:F,Gl:k,Hh:h,Hl:M}=this;return[j,s,y,g,E,B,_,v,C,q,R,H,F,k,h,M]}set(j,s,y,g,E,B,_,v,C,q,R,H,F,k,h,M){this.Ah=j|0,this.Al=s|0,this.Bh=y|0,this.Bl=g|0,this.Ch=E|0,this.Cl=B|0,this.Dh=_|0,this.Dl=v|0,this.Eh=C|0,this.El=q|0,this.Fh=R|0,this.Fl=H|0,this.Gh=F|0,this.Gl=k|0,this.Hh=h|0,this.Hl=M|0}process(j,s){for(let I=0;I<16;I++,s+=4)l[I]=j.getUint32(s),f[I]=j.getUint32(s+=4);for(let I=16;I<80;I++){const x=l[I-15]|0,N=f[I-15]|0,U=t.rotrSH(x,N,1)^t.rotrSH(x,N,8)^t.shrSH(x,N,7),L=t.rotrSL(x,N,1)^t.rotrSL(x,N,8)^t.shrSL(x,N,7),z=l[I-2]|0,D=f[I-2]|0,J=t.rotrSH(z,D,19)^t.rotrBH(z,D,61)^t.shrSH(z,D,6),Z=t.rotrSL(z,D,19)^t.rotrBL(z,D,61)^t.shrSL(z,D,6),Y=t.add4L(L,Z,f[I-7],f[I-16]),X=t.add4H(Y,U,J,l[I-7],l[I-16]);l[I]=X|0,f[I]=Y|0}let{Ah:y,Al:g,Bh:E,Bl:B,Ch:_,Cl:v,Dh:C,Dl:q,Eh:R,El:H,Fh:F,Fl:k,Gh:h,Gl:M,Hh:A,Hl:P}=this;for(let I=0;I<80;I++){const x=t.rotrSH(R,H,14)^t.rotrSH(R,H,18)^t.rotrBH(R,H,41),N=t.rotrSL(R,H,14)^t.rotrSL(R,H,18)^t.rotrBL(R,H,41),U=R&F^~R&h,L=H&k^~H&M,z=t.add5L(P,N,L,d[I],f[I]),D=t.add5H(z,A,x,U,u[I],l[I]),J=z|0,Z=t.rotrSH(y,g,28)^t.rotrBH(y,g,34)^t.rotrBH(y,g,39),Y=t.rotrSL(y,g,28)^t.rotrBL(y,g,34)^t.rotrBL(y,g,39),X=y&E^y&_^E&_,oe=g&B^g&v^B&v;A=h|0,P=M|0,h=F|0,M=k|0,F=R|0,k=H|0,{h:R,l:H}=t.add(C|0,q|0,D|0,J|0),C=_|0,q=v|0,_=E|0,v=B|0,E=y|0,B=g|0;const W=t.add3L(J,Y,oe);y=t.add3H(W,D,Z,X),g=W|0}({h:y,l:g}=t.add(this.Ah|0,this.Al|0,y|0,g|0)),{h:E,l:B}=t.add(this.Bh|0,this.Bl|0,E|0,B|0),{h:_,l:v}=t.add(this.Ch|0,this.Cl|0,_|0,v|0),{h:C,l:q}=t.add(this.Dh|0,this.Dl|0,C|0,q|0),{h:R,l:H}=t.add(this.Eh|0,this.El|0,R|0,H|0),{h:F,l:k}=t.add(this.Fh|0,this.Fl|0,F|0,k|0),{h,l:M}=t.add(this.Gh|0,this.Gl|0,h|0,M|0),{h:A,l:P}=t.add(this.Hh|0,this.Hl|0,A|0,P|0),this.set(y,g,E,B,_,v,C,q,R,H,F,k,h,M,A,P)}roundClean(){(0,n.clean)(l,f)}destroy(){(0,n.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Ee.SHA512=b;class T extends b{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}Ee.SHA384=T;const w=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),p=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class O extends b{constructor(){super(28),this.Ah=w[0]|0,this.Al=w[1]|0,this.Bh=w[2]|0,this.Bl=w[3]|0,this.Ch=w[4]|0,this.Cl=w[5]|0,this.Dh=w[6]|0,this.Dl=w[7]|0,this.Eh=w[8]|0,this.El=w[9]|0,this.Fh=w[10]|0,this.Fl=w[11]|0,this.Gh=w[12]|0,this.Gl=w[13]|0,this.Hh=w[14]|0,this.Hl=w[15]|0}}Ee.SHA512_224=O;class S extends b{constructor(){super(32),this.Ah=p[0]|0,this.Al=p[1]|0,this.Bh=p[2]|0,this.Bl=p[3]|0,this.Ch=p[4]|0,this.Cl=p[5]|0,this.Dh=p[6]|0,this.Dl=p[7]|0,this.Eh=p[8]|0,this.El=p[9]|0,this.Fh=p[10]|0,this.Fl=p[11]|0,this.Gh=p[12]|0,this.Gl=p[13]|0,this.Hh=p[14]|0,this.Hl=p[15]|0}}return Ee.SHA512_256=S,Ee.sha256=(0,n.createHasher)(()=>new a),Ee.sha224=(0,n.createHasher)(()=>new o),Ee.sha512=(0,n.createHasher)(()=>new b),Ee.sha384=(0,n.createHasher)(()=>new T),Ee.sha512_256=(0,n.createHasher)(()=>new S),Ee.sha512_224=(0,n.createHasher)(()=>new O),Ee}var fo={},Ud={},hb;function jv(){return hb||(hb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=mr();class n extends t.Hash{constructor(a,o){super(),this.finished=!1,this.destroyed=!1,(0,t.ahash)(a);const c=(0,t.toBytes)(o);if(this.iHash=a.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const u=this.blockLen,d=new Uint8Array(u);d.set(c.length>u?a.create().update(c).digest():c);for(let l=0;lnew n(i,a).update(o).digest();e.hmac=r,e.hmac.create=(i,a)=>new n(i,a)})(Ud)),Ud}var zd={},Hr={},Re={},pe={},yb;function Zo(){if(yb)return pe;yb=1;Object.defineProperty(pe,"__esModule",{value:!0}),pe.notImplemented=pe.bitMask=void 0,pe.isBytes=n,pe.abytes=r,pe.abool=i,pe.numberToHexUnpadded=a,pe.hexToNumber=o,pe.bytesToHex=d,pe.hexToBytes=b,pe.bytesToNumberBE=T,pe.bytesToNumberLE=w,pe.numberToBytesBE=p,pe.numberToBytesLE=O,pe.numberToVarBytesBE=S,pe.ensureBytes=m,pe.concatBytes=j,pe.equalBytes=s,pe.utf8ToBytes=y,pe.inRange=E,pe.aInRange=B,pe.bitLen=_,pe.bitGet=v,pe.bitSet=C,pe.createHmacDrbg=F,pe.validateObject=h,pe.memoized=A;const e=BigInt(0),t=BigInt(1);function n(P){return P instanceof Uint8Array||ArrayBuffer.isView(P)&&P.constructor.name==="Uint8Array"}function r(P){if(!n(P))throw new Error("Uint8Array expected")}function i(P,I){if(typeof I!="boolean")throw new Error(P+" boolean expected, got "+I)}function a(P){const I=P.toString(16);return I.length&1?"0"+I:I}function o(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);return P===""?e:BigInt("0x"+P)}const c=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",u=Array.from({length:256},(P,I)=>I.toString(16).padStart(2,"0"));function d(P){if(r(P),c)return P.toHex();let I="";for(let x=0;x=l._0&&P<=l._9)return P-l._0;if(P>=l.A&&P<=l.F)return P-(l.A-10);if(P>=l.a&&P<=l.f)return P-(l.a-10)}function b(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);if(c)return Uint8Array.fromHex(P);const I=P.length,x=I/2;if(I%2)throw new Error("hex string expected, got unpadded hex of length "+I);const N=new Uint8Array(x);for(let U=0,L=0;Utypeof P=="bigint"&&e<=P;function E(P,I,x){return g(P)&&g(I)&&g(x)&&I<=P&&Pe;P>>=t,I+=1);return I}function v(P,I){return P>>BigInt(I)&t}function C(P,I,x){return P|(x?t:e)<(t<new Uint8Array(P),H=P=>Uint8Array.from(P);function F(P,I,x){if(typeof P!="number"||P<2)throw new Error("hashLen must be a number");if(typeof I!="number"||I<2)throw new Error("qByteLen must be a number");if(typeof x!="function")throw new Error("hmacFn must be a function");let N=R(P),U=R(P),L=0;const z=()=>{N.fill(1),U.fill(0),L=0},D=(...X)=>x(U,N,...X),J=(X=R(0))=>{U=D(H([0]),X),N=D(),X.length!==0&&(U=D(H([1]),X),N=D())},Z=()=>{if(L++>=1e3)throw new Error("drbg: tried 1000 values");let X=0;const oe=[];for(;X{z(),J(X);let W;for(;!(W=oe(Z()));)J();return z(),W}}const k={bigint:P=>typeof P=="bigint",function:P=>typeof P=="function",boolean:P=>typeof P=="boolean",string:P=>typeof P=="string",stringOrUint8Array:P=>typeof P=="string"||n(P),isSafeInteger:P=>Number.isSafeInteger(P),array:P=>Array.isArray(P),field:(P,I)=>I.Fp.isValid(P),hash:P=>typeof P=="function"&&Number.isSafeInteger(P.outputLen)};function h(P,I,x={}){const N=(U,L,z)=>{const D=k[L];if(typeof D!="function")throw new Error("invalid validator function");const J=P[U];if(!(z&&J===void 0)&&!D(J,P))throw new Error("param "+String(U)+" is invalid. Expected "+L+", got "+J)};for(const[U,L]of Object.entries(I))N(U,L,!1);for(const[U,L]of Object.entries(x))N(U,L,!0);return P}const M=()=>{throw new Error("not implemented")};pe.notImplemented=M;function A(P){const I=new WeakMap;return(x,...N)=>{const U=I.get(x);if(U!==void 0)return U;const L=P(x,...N);return I.set(x,L),L}}return pe}var gb;function Ku(){if(gb)return Re;gb=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.isNegativeLE=void 0,Re.mod=d,Re.pow=l,Re.pow2=f,Re.invert=b,Re.tonelliShanks=p,Re.FpSqrt=O,Re.validateField=j,Re.FpPow=s,Re.FpInvertBatch=y,Re.FpDiv=g,Re.FpLegendre=E,Re.FpIsSquare=B,Re.nLength=_,Re.Field=v,Re.FpSqrtOdd=C,Re.FpSqrtEven=q,Re.hashToPrivateScalar=R,Re.getFieldBytesLength=H,Re.getMinHashLength=F,Re.mapHashToField=k;const e=mr(),t=Zo(),n=BigInt(0),r=BigInt(1),i=BigInt(2),a=BigInt(3),o=BigInt(4),c=BigInt(5),u=BigInt(8);function d(h,M){const A=h%M;return A>=n?A:M+A}function l(h,M,A){return s(v(A),h,M)}function f(h,M,A){let P=h;for(;M-- >n;)P*=P,P%=A;return P}function b(h,M){if(h===n)throw new Error("invert: expected non-zero number");if(M<=n)throw new Error("invert: expected positive modulus, got "+M);let A=d(h,M),P=M,I=n,x=r;for(;A!==n;){const U=P/A,L=P%A,z=I-x*U;P=A,A=L,I=x,x=z}if(P!==r)throw new Error("invert: does not exist");return d(I,M)}function T(h,M){const A=(h.ORDER+r)/o,P=h.pow(M,A);if(!h.eql(h.sqr(P),M))throw new Error("Cannot find square root");return P}function w(h,M){const A=(h.ORDER-c)/u,P=h.mul(M,i),I=h.pow(P,A),x=h.mul(M,I),N=h.mul(h.mul(x,i),I),U=h.mul(x,h.sub(N,h.ONE));if(!h.eql(h.sqr(U),M))throw new Error("Cannot find square root");return U}function p(h){if(h1e3)throw new Error("Cannot find square root: probably non-prime P");if(A===1)return T;let x=I.pow(P,M);const N=(M+r)/i;return function(L,z){if(L.is0(z))return z;if(E(L,z)!==1)throw new Error("Cannot find square root");let D=A,J=L.mul(L.ONE,x),Z=L.pow(z,M),Y=L.pow(z,N);for(;!L.eql(Z,L.ONE);){if(L.is0(Z))return L.ZERO;let X=1,oe=L.sqr(Z);for(;!L.eql(oe,L.ONE);)if(X++,oe=L.sqr(oe),X===D)throw new Error("Cannot find square root");const W=r<(d(h,M)&r)===r;Re.isNegativeLE=S;const m=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function j(h){const M={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},A=m.reduce((P,I)=>(P[I]="function",P),M);return(0,t.validateObject)(h,A)}function s(h,M,A){if(An;)A&r&&(P=h.mul(P,I)),I=h.sqr(I),A>>=r;return P}function y(h,M,A=!1){const P=new Array(M.length).fill(A?h.ZERO:void 0),I=M.reduce((N,U,L)=>h.is0(U)?N:(P[L]=N,h.mul(N,U)),h.ONE),x=h.inv(I);return M.reduceRight((N,U,L)=>h.is0(U)?N:(P[L]=h.mul(N,P[L]),h.mul(N,U)),x),P}function g(h,M,A){return h.mul(M,typeof A=="bigint"?b(A,h.ORDER):h.inv(A))}function E(h,M){const A=(h.ORDER-r)/i,P=h.pow(M,A),I=h.eql(P,h.ONE),x=h.eql(P,h.ZERO),N=h.eql(P,h.neg(h.ONE));if(!I&&!x&&!N)throw new Error("invalid Legendre symbol result");return I?1:x?0:-1}function B(h,M){return E(h,M)===1}function _(h,M){M!==void 0&&(0,e.anumber)(M);const A=M!==void 0?M:h.toString(2).length,P=Math.ceil(A/8);return{nBitLength:A,nByteLength:P}}function v(h,M,A=!1,P={}){if(h<=n)throw new Error("invalid field: expected ORDER > 0, got "+h);const{nBitLength:I,nByteLength:x}=_(h,M);if(x>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let N;const U=Object.freeze({ORDER:h,isLE:A,BITS:I,BYTES:x,MASK:(0,t.bitMask)(I),ZERO:n,ONE:r,create:L=>d(L,h),isValid:L=>{if(typeof L!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof L);return n<=L&&LL===n,isOdd:L=>(L&r)===r,neg:L=>d(-L,h),eql:(L,z)=>L===z,sqr:L=>d(L*L,h),add:(L,z)=>d(L+z,h),sub:(L,z)=>d(L-z,h),mul:(L,z)=>d(L*z,h),pow:(L,z)=>s(U,L,z),div:(L,z)=>d(L*b(z,h),h),sqrN:L=>L*L,addN:(L,z)=>L+z,subN:(L,z)=>L-z,mulN:(L,z)=>L*z,inv:L=>b(L,h),sqrt:P.sqrt||(L=>(N||(N=O(h)),N(U,L))),toBytes:L=>A?(0,t.numberToBytesLE)(L,x):(0,t.numberToBytesBE)(L,x),fromBytes:L=>{if(L.length!==x)throw new Error("Field.fromBytes: expected "+x+" bytes, got "+L.length);return A?(0,t.bytesToNumberLE)(L):(0,t.bytesToNumberBE)(L)},invertBatch:L=>y(U,L),cmov:(L,z,D)=>D?z:L});return Object.freeze(U)}function C(h,M){if(!h.isOdd)throw new Error("Field doesn't have isOdd");const A=h.sqrt(M);return h.isOdd(A)?A:h.neg(A)}function q(h,M){if(!h.isOdd)throw new Error("Field doesn't have isOdd");const A=h.sqrt(M);return h.isOdd(A)?h.neg(A):A}function R(h,M,A=!1){h=(0,t.ensureBytes)("privateHash",h);const P=h.length,I=_(M).nByteLength+8;if(I<24||P1024)throw new Error("hashToPrivateScalar: expected "+I+"-1024 bytes of input, got "+P);const x=A?(0,t.bytesToNumberLE)(h):(0,t.bytesToNumberBE)(h);return d(x,M-r)+r}function H(h){if(typeof h!="bigint")throw new Error("field order must be bigint");const M=h.toString(2).length;return Math.ceil(M/8)}function F(h){const M=H(h);return M+Math.ceil(M/2)}function k(h,M,A=!1){const P=h.length,I=H(M),x=F(M);if(P<16||P1024)throw new Error("expected "+x+"-1024 bytes of input, got "+P);const N=A?(0,t.bytesToNumberLE)(h):(0,t.bytesToNumberBE)(h),U=d(N,M-r)+r;return A?(0,t.numberToBytesLE)(U,I):(0,t.numberToBytesBE)(U,I)}return Re}var pb;function Pv(){if(pb)return Hr;pb=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.wNAF=T,Hr.pippenger=w,Hr.precomputeMSMUnsafe=p,Hr.validateBasic=O;const e=Ku(),t=Zo(),n=BigInt(0),r=BigInt(1);function i(S,m){const j=m.negate();return S?j:m}function a(S,m){if(!Number.isSafeInteger(S)||S<=0||S>m)throw new Error("invalid window size, expected [1.."+m+"], got W="+S)}function o(S,m){a(S,m);const j=Math.ceil(m/S)+1,s=2**(S-1),y=2**S,g=(0,t.bitMask)(S),E=BigInt(S);return{windows:j,windowSize:s,mask:g,maxNumber:y,shiftBy:E}}function c(S,m,j){const{windowSize:s,mask:y,maxNumber:g,shiftBy:E}=j;let B=Number(S&y),_=S>>E;B>s&&(B-=g,_+=r);const v=m*s,C=v+Math.abs(B)-1,q=B===0,R=B<0,H=m%2!==0;return{nextN:_,offset:C,isZero:q,isNeg:R,isNegF:H,offsetF:v}}function u(S,m){if(!Array.isArray(S))throw new Error("array expected");S.forEach((j,s)=>{if(!(j instanceof m))throw new Error("invalid point at index "+s)})}function d(S,m){if(!Array.isArray(S))throw new Error("array of scalars expected");S.forEach((j,s)=>{if(!m.isValid(j))throw new Error("invalid scalar at index "+s)})}const l=new WeakMap,f=new WeakMap;function b(S){return f.get(S)||1}function T(S,m){return{constTimeNegate:i,hasPrecomputes(j){return b(j)!==1},unsafeLadder(j,s,y=S.ZERO){let g=j;for(;s>n;)s&r&&(y=y.add(g)),g=g.double(),s>>=r;return y},precomputeWindow(j,s){const{windows:y,windowSize:g}=o(s,m),E=[];let B=j,_=B;for(let v=0;v12?_=B-3:B>4?_=B-2:B>0&&(_=2);const v=(0,t.bitMask)(_),C=new Array(Number(v)+1).fill(E),q=Math.floor((m.BITS-1)/_)*_;let R=E;for(let H=q;H>=0;H-=_){C.fill(E);for(let k=0;k>BigInt(H)&v);C[M]=C[M].add(j[k])}let F=E;for(let k=C.length-1,h=E;k>0;k--)h=h.add(C[k]),F=F.add(h);if(R=R.add(F),H!==0)for(let k=0;k<_;k++)R=R.double()}return R}function p(S,m,j,s){a(s,m.BITS),u(j,S);const y=S.ZERO,g=2**s-1,E=Math.ceil(m.BITS/s),B=(0,t.bitMask)(s),_=j.map(v=>{const C=[];for(let q=0,R=v;q{if(d(v,m),v.length>j.length)throw new Error("array of scalars must be smaller than array of points");let C=y;for(let q=0;q>R&B);k&&(C=C.add(_[H][k-1]))}}return C}}function O(S){return(0,e.validateField)(S.Fp),(0,t.validateObject)(S,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(S.n,S.nBitLength),...S,p:S.Fp.ORDER})}return Hr}var _b;function Lp(){return _b||(_b=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e.weierstrassPoints=T,e.weierstrass=p,e.SWUFpSqrtRatio=O,e.mapToCurveSimpleSWU=S;const t=Pv(),n=Ku(),r=Zo();function i(m){m.lowS!==void 0&&(0,r.abool)("lowS",m.lowS),m.prehash!==void 0&&(0,r.abool)("prehash",m.prehash)}function a(m){const j=(0,t.validateBasic)(m);(0,r.validateObject)(j,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:s,Fp:y,a:g}=j;if(s){if(!y.eql(g,y.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof s!="object"||typeof s.beta!="bigint"||typeof s.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...j})}class o extends Error{constructor(j=""){super(j)}}e.DERErr=o,e.DER={Err:o,_tlv:{encode:(m,j)=>{const{Err:s}=e.DER;if(m<0||m>256)throw new s("tlv.encode: wrong tag");if(j.length&1)throw new s("tlv.encode: unpadded data");const y=j.length/2,g=(0,r.numberToHexUnpadded)(y);if(g.length/2&128)throw new s("tlv.encode: long form length too big");const E=y>127?(0,r.numberToHexUnpadded)(g.length/2|128):"";return(0,r.numberToHexUnpadded)(m)+E+g+j},decode(m,j){const{Err:s}=e.DER;let y=0;if(m<0||m>256)throw new s("tlv.encode: wrong tag");if(j.length<2||j[y++]!==m)throw new s("tlv.decode: wrong tlv");const g=j[y++],E=!!(g&128);let B=0;if(!E)B=g;else{const v=g&127;if(!v)throw new s("tlv.decode(long): indefinite length not supported");if(v>4)throw new s("tlv.decode(long): byte length is too big");const C=j.subarray(y,y+v);if(C.length!==v)throw new s("tlv.decode: length bytes not complete");if(C[0]===0)throw new s("tlv.decode(long): zero leftmost byte");for(const q of C)B=B<<8|q;if(y+=v,B<128)throw new s("tlv.decode(long): not minimal encoding")}const _=j.subarray(y,y+B);if(_.length!==B)throw new s("tlv.decode: wrong value length");return{v:_,l:j.subarray(y+B)}}},_int:{encode(m){const{Err:j}=e.DER;if(m{const U=x.toAffine();return(0,r.concatBytes)(Uint8Array.from([4]),s.toBytes(U.x),s.toBytes(U.y))}),E=j.fromBytes||(I=>{const x=I.subarray(1),N=s.fromBytes(x.subarray(0,s.BYTES)),U=s.fromBytes(x.subarray(s.BYTES,2*s.BYTES));return{x:N,y:U}});function B(I){const{a:x,b:N}=j,U=s.sqr(I),L=s.mul(U,I);return s.add(s.add(L,s.mul(I,x)),N)}function _(I,x){const N=s.sqr(x),U=B(I);return s.eql(N,U)}if(!_(j.Gx,j.Gy))throw new Error("bad curve params: generator point");const v=s.mul(s.pow(j.a,f),b),C=s.mul(s.sqr(j.b),BigInt(27));if(s.is0(s.add(v,C)))throw new Error("bad curve params: a or b");function q(I){return(0,r.inRange)(I,d,j.n)}function R(I){const{allowedPrivateKeyLengths:x,nByteLength:N,wrapPrivateKey:U,n:L}=j;if(x&&typeof I!="bigint"){if((0,r.isBytes)(I)&&(I=(0,r.bytesToHex)(I)),typeof I!="string"||!x.includes(I.length))throw new Error("invalid private key");I=I.padStart(N*2,"0")}let z;try{z=typeof I=="bigint"?I:(0,r.bytesToNumberBE)((0,r.ensureBytes)("private key",I,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof I)}return U&&(z=(0,n.mod)(z,L)),(0,r.aInRange)("private key",z,d,L),z}function H(I){if(!(I instanceof h))throw new Error("ProjectivePoint expected")}const F=(0,r.memoized)((I,x)=>{const{px:N,py:U,pz:L}=I;if(s.eql(L,s.ONE))return{x:N,y:U};const z=I.is0();x==null&&(x=z?s.ONE:s.inv(L));const D=s.mul(N,x),J=s.mul(U,x),Z=s.mul(L,x);if(z)return{x:s.ZERO,y:s.ZERO};if(!s.eql(Z,s.ONE))throw new Error("invZ was invalid");return{x:D,y:J}}),k=(0,r.memoized)(I=>{if(I.is0()){if(j.allowInfinityPoint&&!s.is0(I.py))return;throw new Error("bad point: ZERO")}const{x,y:N}=I.toAffine();if(!s.isValid(x)||!s.isValid(N))throw new Error("bad point: x or y not FE");if(!_(x,N))throw new Error("bad point: equation left != right");if(!I.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(x,N,U){if(x==null||!s.isValid(x))throw new Error("x required");if(N==null||!s.isValid(N)||s.is0(N))throw new Error("y required");if(U==null||!s.isValid(U))throw new Error("z required");this.px=x,this.py=N,this.pz=U,Object.freeze(this)}static fromAffine(x){const{x:N,y:U}=x||{};if(!x||!s.isValid(N)||!s.isValid(U))throw new Error("invalid affine point");if(x instanceof h)throw new Error("projective point not allowed");const L=z=>s.eql(z,s.ZERO);return L(N)&&L(U)?h.ZERO:new h(N,U,s.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){const N=(0,n.FpInvertBatch)(s,x.map(U=>U.pz));return x.map((U,L)=>U.toAffine(N[L])).map(h.fromAffine)}static fromHex(x){const N=h.fromAffine(E((0,r.ensureBytes)("pointHex",x)));return N.assertValidity(),N}static fromPrivateKey(x){return h.BASE.multiply(R(x))}static msm(x,N){return(0,t.pippenger)(h,y,x,N)}_setWindowSize(x){P.setWindowSize(this,x)}assertValidity(){k(this)}hasEvenY(){const{y:x}=this.toAffine();if(s.isOdd)return!s.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){H(x);const{px:N,py:U,pz:L}=this,{px:z,py:D,pz:J}=x,Z=s.eql(s.mul(N,J),s.mul(z,L)),Y=s.eql(s.mul(U,J),s.mul(D,L));return Z&&Y}negate(){return new h(this.px,s.neg(this.py),this.pz)}double(){const{a:x,b:N}=j,U=s.mul(N,f),{px:L,py:z,pz:D}=this;let J=s.ZERO,Z=s.ZERO,Y=s.ZERO,X=s.mul(L,L),oe=s.mul(z,z),W=s.mul(D,D),K=s.mul(L,z);return K=s.add(K,K),Y=s.mul(L,D),Y=s.add(Y,Y),J=s.mul(x,Y),Z=s.mul(U,W),Z=s.add(J,Z),J=s.sub(oe,Z),Z=s.add(oe,Z),Z=s.mul(J,Z),J=s.mul(K,J),Y=s.mul(U,Y),W=s.mul(x,W),K=s.sub(X,W),K=s.mul(x,K),K=s.add(K,Y),Y=s.add(X,X),X=s.add(Y,X),X=s.add(X,W),X=s.mul(X,K),Z=s.add(Z,X),W=s.mul(z,D),W=s.add(W,W),X=s.mul(W,K),J=s.sub(J,X),Y=s.mul(W,oe),Y=s.add(Y,Y),Y=s.add(Y,Y),new h(J,Z,Y)}add(x){H(x);const{px:N,py:U,pz:L}=this,{px:z,py:D,pz:J}=x;let Z=s.ZERO,Y=s.ZERO,X=s.ZERO;const oe=j.a,W=s.mul(j.b,f);let K=s.mul(N,z),$=s.mul(U,D),re=s.mul(L,J),te=s.add(N,U),ne=s.add(z,D);te=s.mul(te,ne),ne=s.add(K,$),te=s.sub(te,ne),ne=s.add(N,L);let se=s.add(z,J);return ne=s.mul(ne,se),se=s.add(K,re),ne=s.sub(ne,se),se=s.add(U,L),Z=s.add(D,J),se=s.mul(se,Z),Z=s.add($,re),se=s.sub(se,Z),X=s.mul(oe,ne),Z=s.mul(W,re),X=s.add(Z,X),Z=s.sub($,X),X=s.add($,X),Y=s.mul(Z,X),$=s.add(K,K),$=s.add($,K),re=s.mul(oe,re),ne=s.mul(W,ne),$=s.add($,re),re=s.sub(K,re),re=s.mul(oe,re),ne=s.add(ne,re),K=s.mul($,ne),Y=s.add(Y,K),K=s.mul(se,ne),Z=s.mul(te,Z),Z=s.sub(Z,K),K=s.mul(te,$),X=s.mul(se,X),X=s.add(X,K),new h(Z,Y,X)}subtract(x){return this.add(x.negate())}is0(){return this.equals(h.ZERO)}wNAF(x){return P.wNAFCached(this,x,h.normalizeZ)}multiplyUnsafe(x){const{endo:N,n:U}=j;(0,r.aInRange)("scalar",x,u,U);const L=h.ZERO;if(x===u)return L;if(this.is0()||x===d)return this;if(!N||P.hasPrecomputes(this))return P.wNAFCachedUnsafe(this,x,h.normalizeZ);let{k1neg:z,k1:D,k2neg:J,k2:Z}=N.splitScalar(x),Y=L,X=L,oe=this;for(;D>u||Z>u;)D&d&&(Y=Y.add(oe)),Z&d&&(X=X.add(oe)),oe=oe.double(),D>>=d,Z>>=d;return z&&(Y=Y.negate()),J&&(X=X.negate()),X=new h(s.mul(X.px,N.beta),X.py,X.pz),Y.add(X)}multiply(x){const{endo:N,n:U}=j;(0,r.aInRange)("scalar",x,d,U);let L,z;if(N){const{k1neg:D,k1:J,k2neg:Z,k2:Y}=N.splitScalar(x);let{p:X,f:oe}=this.wNAF(J),{p:W,f:K}=this.wNAF(Y);X=P.constTimeNegate(D,X),W=P.constTimeNegate(Z,W),W=new h(s.mul(W.px,N.beta),W.py,W.pz),L=X.add(W),z=oe.add(K)}else{const{p:D,f:J}=this.wNAF(x);L=D,z=J}return h.normalizeZ([L,z])[0]}multiplyAndAddUnsafe(x,N,U){const L=h.BASE,z=(J,Z)=>Z===u||Z===d||!J.equals(L)?J.multiplyUnsafe(Z):J.multiply(Z),D=z(this,N).add(z(x,U));return D.is0()?void 0:D}toAffine(x){return F(this,x)}isTorsionFree(){const{h:x,isTorsionFree:N}=j;if(x===d)return!0;if(N)return N(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:x,clearCofactor:N}=j;return x===d?this:N?N(h,this):this.multiplyUnsafe(j.h)}toRawBytes(x=!0){return(0,r.abool)("isCompressed",x),this.assertValidity(),g(h,this,x)}toHex(x=!0){return(0,r.abool)("isCompressed",x),(0,r.bytesToHex)(this.toRawBytes(x))}}h.BASE=new h(j.Gx,j.Gy,s.ONE),h.ZERO=new h(s.ZERO,s.ONE,s.ZERO);const{endo:M,nBitLength:A}=j,P=(0,t.wNAF)(h,M?Math.ceil(A/2):A);return{CURVE:j,ProjectivePoint:h,normPrivateKeyToScalar:R,weierstrassEquation:B,isWithinCurveOrder:q}}function w(m){const j=(0,t.validateBasic)(m);return(0,r.validateObject)(j,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...j})}function p(m){const j=w(m),{Fp:s,n:y,nByteLength:g,nBitLength:E}=j,B=s.BYTES+1,_=2*s.BYTES+1;function v(W){return(0,n.mod)(W,y)}function C(W){return(0,n.invert)(W,y)}const{ProjectivePoint:q,normPrivateKeyToScalar:R,weierstrassEquation:H,isWithinCurveOrder:F}=T({...j,toBytes(W,K,$){const re=K.toAffine(),te=s.toBytes(re.x),ne=r.concatBytes;return(0,r.abool)("isCompressed",$),$?ne(Uint8Array.from([K.hasEvenY()?2:3]),te):ne(Uint8Array.from([4]),te,s.toBytes(re.y))},fromBytes(W){const K=W.length,$=W[0],re=W.subarray(1);if(K===B&&($===2||$===3)){const te=(0,r.bytesToNumberBE)(re);if(!(0,r.inRange)(te,d,s.ORDER))throw new Error("Point is not on curve");const ne=H(te);let se;try{se=s.sqrt(ne)}catch(be){const me=be instanceof Error?": "+be.message:"";throw new Error("Point is not on curve"+me)}const ee=(se&d)===d;return($&1)===1!==ee&&(se=s.neg(se)),{x:te,y:se}}else if(K===_&&$===4){const te=s.fromBytes(re.subarray(0,s.BYTES)),ne=s.fromBytes(re.subarray(s.BYTES,2*s.BYTES));return{x:te,y:ne}}else{const te=B,ne=_;throw new Error("invalid Point, expected length of "+te+", or uncompressed "+ne+", got "+K)}}});function k(W){const K=y>>d;return W>K}function h(W){return k(W)?v(-W):W}const M=(W,K,$)=>(0,r.bytesToNumberBE)(W.slice(K,$));class A{constructor(K,$,re){(0,r.aInRange)("r",K,d,y),(0,r.aInRange)("s",$,d,y),this.r=K,this.s=$,re!=null&&(this.recovery=re),Object.freeze(this)}static fromCompact(K){const $=g;return K=(0,r.ensureBytes)("compactSignature",K,$*2),new A(M(K,0,$),M(K,$,2*$))}static fromDER(K){const{r:$,s:re}=e.DER.toSig((0,r.ensureBytes)("DER",K));return new A($,re)}assertValidity(){}addRecoveryBit(K){return new A(this.r,this.s,K)}recoverPublicKey(K){const{r:$,s:re,recovery:te}=this,ne=L((0,r.ensureBytes)("msgHash",K));if(te==null||![0,1,2,3].includes(te))throw new Error("recovery id invalid");const se=te===2||te===3?$+j.n:$;if(se>=s.ORDER)throw new Error("recovery id 2 or 3 invalid");const ee=(te&1)===0?"02":"03",Q=q.fromHex(ee+c(se,s.BYTES)),be=C(se),me=v(-ne*be),Ue=v(re*be),Ae=q.BASE.multiplyAndAddUnsafe(Q,me,Ue);if(!Ae)throw new Error("point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return k(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,v(-this.s),this.recovery):this}toDERRawBytes(){return(0,r.hexToBytes)(this.toDERHex())}toDERHex(){return e.DER.hexFromSig(this)}toCompactRawBytes(){return(0,r.hexToBytes)(this.toCompactHex())}toCompactHex(){const K=g;return c(this.r,K)+c(this.s,K)}}const P={isValidPrivateKey(W){try{return R(W),!0}catch{return!1}},normPrivateKeyToScalar:R,randomPrivateKey:()=>{const W=(0,n.getMinHashLength)(j.n);return(0,n.mapHashToField)(j.randomBytes(W),j.n)},precompute(W=8,K=q.BASE){return K._setWindowSize(W),K.multiply(BigInt(3)),K}};function I(W,K=!0){return q.fromPrivateKey(W).toRawBytes(K)}function x(W){if(typeof W=="bigint")return!1;if(W instanceof q)return!0;const $=(0,r.ensureBytes)("key",W).length,re=s.BYTES,te=re+1,ne=2*re+1;if(!(j.allowedPrivateKeyLengths||g===te))return $===te||$===ne}function N(W,K,$=!0){if(x(W)===!0)throw new Error("first arg must be private key");if(x(K)===!1)throw new Error("second arg must be public key");return q.fromHex(K).multiply(R(W)).toRawBytes($)}const U=j.bits2int||function(W){if(W.length>8192)throw new Error("input is too large");const K=(0,r.bytesToNumberBE)(W),$=W.length*8-E;return $>0?K>>BigInt($):K},L=j.bits2int_modN||function(W){return v(U(W))},z=(0,r.bitMask)(E);function D(W){return(0,r.aInRange)("num < 2^"+E,W,u,z),(0,r.numberToBytesBE)(W,g)}function J(W,K,$=Z){if(["recovered","canonical"].some(Me=>Me in $))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:te}=j;let{lowS:ne,prehash:se,extraEntropy:ee}=$;ne==null&&(ne=!0),W=(0,r.ensureBytes)("msgHash",W),i($),se&&(W=(0,r.ensureBytes)("prehashed msgHash",re(W)));const Q=L(W),be=R(K),me=[D(be),D(Q)];if(ee!=null&&ee!==!1){const Me=ee===!0?te(s.BYTES):ee;me.push((0,r.ensureBytes)("extraEntropy",Me))}const Ue=(0,r.concatBytes)(...me),Ae=Q;function Xe(Me){const Te=U(Me);if(!F(Te))return;const pt=C(Te),Ke=q.BASE.multiply(Te).toAffine(),Le=v(Ke.x);if(Le===u)return;const Ze=v(pt*v(Ae+Le*be));if(Ze===u)return;let ze=(Ke.x===Le?0:2)|Number(Ke.y&d),xt=Ze;return ne&&k(Ze)&&(xt=h(Ze),ze^=1),new A(Le,xt,ze)}return{seed:Ue,k2sig:Xe}}const Z={lowS:j.lowS,prehash:!1},Y={lowS:j.lowS,prehash:!1};function X(W,K,$=Z){const{seed:re,k2sig:te}=J(W,K,$),ne=j;return(0,r.createHmacDrbg)(ne.hash.outputLen,ne.nByteLength,ne.hmac)(re,te)}q.BASE._setWindowSize(8);function oe(W,K,$,re=Y){const te=W;K=(0,r.ensureBytes)("msgHash",K),$=(0,r.ensureBytes)("publicKey",$);const{lowS:ne,prehash:se,format:ee}=re;if(i(re),"strict"in re)throw new Error("options.strict was renamed to lowS");if(ee!==void 0&&ee!=="compact"&&ee!=="der")throw new Error("format must be compact or der");const Q=typeof te=="string"||(0,r.isBytes)(te),be=!Q&&!ee&&typeof te=="object"&&te!==null&&typeof te.r=="bigint"&&typeof te.s=="bigint";if(!Q&&!be)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let me,Ue;try{if(be&&(me=new A(te.r,te.s)),Q){try{ee!=="compact"&&(me=A.fromDER(te))}catch(ze){if(!(ze instanceof e.DER.Err))throw ze}!me&&ee!=="der"&&(me=A.fromCompact(te))}Ue=q.fromHex($)}catch{return!1}if(!me||ne&&me.hasHighS())return!1;se&&(K=j.hash(K));const{r:Ae,s:Xe}=me,Me=L(K),Te=C(Xe),pt=v(Me*Te),Ke=v(Ae*Te),Le=q.BASE.multiplyAndAddUnsafe(Ue,pt,Ke)?.toAffine();return Le?v(Le.x)===Ae:!1}return{CURVE:j,getPublicKey:I,getSharedSecret:N,sign:X,verify:oe,ProjectivePoint:q,Signature:A,utils:P}}function O(m,j){const s=m.ORDER;let y=u;for(let k=s-d;k%l===u;k/=l)y+=d;const g=y,E=l<{let M=R,A=m.pow(h,C),P=m.sqr(A);P=m.mul(P,h);let I=m.mul(k,P);I=m.pow(I,v),I=m.mul(I,A),A=m.mul(I,h),P=m.mul(I,k);let x=m.mul(P,A);I=m.pow(x,q);let N=m.eql(I,m.ONE);A=m.mul(P,H),I=m.mul(x,M),P=m.cmov(A,P,N),x=m.cmov(I,x,N);for(let U=g;U>d;U--){let L=U-l;L=l<{let P=m.sqr(A);const I=m.mul(M,A);P=m.mul(P,I);let x=m.pow(P,k);x=m.mul(x,I);const N=m.mul(x,h),U=m.mul(m.sqr(x),A),L=m.eql(U,M);let z=m.cmov(N,x,L);return{isValid:L,value:z}}}return F}function S(m,j){if((0,n.validateField)(m),!m.isValid(j.A)||!m.isValid(j.B)||!m.isValid(j.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const s=O(m,j.Z);if(!m.isOdd)throw new Error("Fp.isOdd is not implemented!");return y=>{let g,E,B,_,v,C,q,R;g=m.sqr(y),g=m.mul(g,j.Z),E=m.sqr(g),E=m.add(E,g),B=m.add(E,m.ONE),B=m.mul(B,j.B),_=m.cmov(j.Z,m.neg(E),!m.eql(E,m.ZERO)),_=m.mul(_,j.A),E=m.sqr(B),C=m.sqr(_),v=m.mul(C,j.A),E=m.add(E,v),E=m.mul(E,B),C=m.mul(C,_),v=m.mul(C,j.B),E=m.add(E,v),q=m.mul(g,B);const{isValid:H,value:F}=s(E,C);R=m.mul(g,y),R=m.mul(R,F),q=m.cmov(q,B,H),R=m.cmov(R,F,H);const k=m.isOdd(y)===m.isOdd(R);R=m.cmov(m.neg(R),R,k);const h=(0,n.FpInvertBatch)(m,[_],!0)[0];return q=m.mul(q,h),{x:q,y:R}}}})(zd)),zd}var vb;function Av(){if(vb)return fo;vb=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.getHash=r,fo.createCurve=i;const e=jv(),t=mr(),n=Lp();function r(a){return{hash:a,hmac:(o,...c)=>(0,e.hmac)(a,o,(0,t.concatBytes)(...c)),randomBytes:t.randomBytes}}function i(a,o){const c=u=>(0,n.weierstrass)({...a,...r(u)});return{...c(o),create:c}}return fo}var ar={},Eb;function Tv(){if(Eb)return ar;Eb=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.expand_message_xmd=o,ar.expand_message_xof=c,ar.hash_to_field=u,ar.isogenyMap=d,ar.createHasher=l;const e=Ku(),t=Zo(),n=t.bytesToNumberBE;function r(f,b){if(a(f),a(b),f<0||f>=1<<8*b)throw new Error("invalid I2OSP input: "+f);const T=Array.from({length:b}).fill(0);for(let w=b-1;w>=0;w--)T[w]=f&255,f>>>=8;return new Uint8Array(T)}function i(f,b){const T=new Uint8Array(f.length);for(let w=0;w255&&(b=w((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),b)));const{outputLen:p,blockLen:O}=w,S=Math.ceil(T/p);if(T>65535||S>255)throw new Error("expand_message_xmd: invalid lenInBytes");const m=(0,t.concatBytes)(b,r(b.length,1)),j=r(0,O),s=r(T,2),y=new Array(S),g=w((0,t.concatBytes)(j,f,s,r(0,1),m));y[0]=w((0,t.concatBytes)(g,r(1,1),m));for(let B=1;B<=S;B++){const _=[i(g,y[B-1]),r(B+1,1),m];y[B]=w((0,t.concatBytes)(..._))}return(0,t.concatBytes)(...y).slice(0,T)}function c(f,b,T,w,p){if((0,t.abytes)(f),(0,t.abytes)(b),a(T),b.length>255){const O=Math.ceil(2*w/8);b=p.create({dkLen:O}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(b).digest()}if(T>65535||b.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return p.create({dkLen:T}).update(f).update(r(T,2)).update(b).update(r(b.length,1)).digest()}function u(f,b,T){(0,t.validateObject)(T,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:w,k:p,m:O,hash:S,expand:m,DST:j}=T;(0,t.abytes)(f),a(b);const s=typeof j=="string"?(0,t.utf8ToBytes)(j):j,y=w.toString(2).length,g=Math.ceil((y+p)/8),E=b*O*g;let B;if(m==="xmd")B=o(f,s,E,S);else if(m==="xof")B=c(f,s,E,p,S);else if(m==="_internal_pass")B=f;else throw new Error('expand must be "xmd" or "xof"');const _=new Array(b);for(let v=0;vArray.from(w).reverse());return(w,p)=>{const[O,S,m,j]=T.map(g=>g.reduce((E,B)=>f.add(f.mul(E,w),B))),[s,y]=(0,e.FpInvertBatch)(f,[S,j],!0);return w=f.mul(O,s),p=f.mul(p,f.mul(m,y)),{x:w,y:p}}}function l(f,b,T){if(typeof b!="function")throw new Error("mapToCurve() must be defined");function w(O){return f.fromAffine(b(O))}function p(O){const S=O.clearCofactor();return S.equals(f.ZERO)?f.ZERO:(S.assertValidity(),S)}return{defaults:T,hashToCurve(O,S){const m=u(O,2,{...T,DST:T.DST,...S}),j=w(m[0]),s=w(m[1]);return p(j.add(s))},encodeToCurve(O,S){const m=u(O,1,{...T,DST:T.encodeDST,...S});return p(w(m[0]))},mapToCurve(O){if(!Array.isArray(O))throw new Error("expected array of bigints");for(const S of O)if(typeof S!="bigint")throw new Error("expected array of bigints");return p(w(O))}}}return ar}var wb;function Yo(){return wb||(wb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;const t=Fp(),n=mr(),r=Av(),i=Tv(),a=Ku(),o=Zo(),c=Lp(),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(0),f=BigInt(1),b=BigInt(2),T=(h,M)=>(h+M/b)/M;function w(h){const M=u,A=BigInt(3),P=BigInt(6),I=BigInt(11),x=BigInt(22),N=BigInt(23),U=BigInt(44),L=BigInt(88),z=h*h*h%M,D=z*z*h%M,J=(0,a.pow2)(D,A,M)*D%M,Z=(0,a.pow2)(J,A,M)*D%M,Y=(0,a.pow2)(Z,b,M)*z%M,X=(0,a.pow2)(Y,I,M)*Y%M,oe=(0,a.pow2)(X,x,M)*X%M,W=(0,a.pow2)(oe,U,M)*oe%M,K=(0,a.pow2)(W,L,M)*W%M,$=(0,a.pow2)(K,U,M)*oe%M,re=(0,a.pow2)($,A,M)*D%M,te=(0,a.pow2)(re,N,M)*X%M,ne=(0,a.pow2)(te,P,M)*z%M,se=(0,a.pow2)(ne,b,M);if(!p.eql(p.sqr(se),h))throw new Error("Cannot find square root");return se}const p=(0,a.Field)(u,void 0,void 0,{sqrt:w});e.secp256k1=(0,r.createCurve)({a:l,b:BigInt(7),Fp:p,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:h=>{const M=d,A=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),P=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),I=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),x=A,N=BigInt("0x100000000000000000000000000000000"),U=T(x*h,M),L=T(-P*h,M);let z=(0,a.mod)(h-U*A-L*I,M),D=(0,a.mod)(-U*P-L*x,M);const J=z>N,Z=D>N;if(J&&(z=M-z),Z&&(D=M-D),z>N||D>N)throw new Error("splitScalar: Endomorphism failed, k="+h);return{k1neg:J,k1:z,k2neg:Z,k2:D}}}},t.sha256);const O={};function S(h,...M){let A=O[h];if(A===void 0){const P=(0,t.sha256)(Uint8Array.from(h,I=>I.charCodeAt(0)));A=(0,o.concatBytes)(P,P),O[h]=A}return(0,t.sha256)((0,o.concatBytes)(A,...M))}const m=h=>h.toRawBytes(!0).slice(1),j=h=>(0,o.numberToBytesBE)(h,32),s=h=>(0,a.mod)(h,u),y=h=>(0,a.mod)(h,d),g=e.secp256k1.ProjectivePoint,E=(h,M,A)=>g.BASE.multiplyAndAddUnsafe(h,M,A);function B(h){let M=e.secp256k1.utils.normPrivateKeyToScalar(h),A=g.fromPrivateKey(M);return{scalar:A.hasEvenY()?M:y(-M),bytes:m(A)}}function _(h){(0,o.aInRange)("x",h,f,u);const M=s(h*h),A=s(M*h+BigInt(7));let P=w(A);P%b!==l&&(P=s(-P));const I=new g(h,P,f);return I.assertValidity(),I}const v=o.bytesToNumberBE;function C(...h){return y(v(S("BIP0340/challenge",...h)))}function q(h){return B(h).bytes}function R(h,M,A=(0,n.randomBytes)(32)){const P=(0,o.ensureBytes)("message",h),{bytes:I,scalar:x}=B(M),N=(0,o.ensureBytes)("auxRand",A,32),U=j(x^v(S("BIP0340/aux",N))),L=S("BIP0340/nonce",U,I,P),z=y(v(L));if(z===l)throw new Error("sign failed: k is zero");const{bytes:D,scalar:J}=B(z),Z=C(D,I,P),Y=new Uint8Array(64);if(Y.set(D,0),Y.set(j(y(J+Z*x)),32),!H(Y,P,I))throw new Error("sign: Invalid signature produced");return Y}function H(h,M,A){const P=(0,o.ensureBytes)("signature",h,64),I=(0,o.ensureBytes)("message",M),x=(0,o.ensureBytes)("publicKey",A,32);try{const N=_(v(x)),U=v(P.subarray(0,32));if(!(0,o.inRange)(U,f,u))return!1;const L=v(P.subarray(32,64));if(!(0,o.inRange)(L,f,d))return!1;const z=C(j(U),m(N),I),D=E(N,L,y(-z));return!(!D||!D.hasEvenY()||D.toAffine().x!==U)}catch{return!1}}e.schnorr={getPublicKey:q,sign:R,verify:H,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:_,pointToBytes:m,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:S,mod:a.mod}};const F=(0,i.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(h=>h.map(M=>BigInt(M)))),k=(0,c.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))});e.secp256k1_hasher=(0,i.createHasher)(e.secp256k1.ProjectivePoint,h=>{const{x:M,y:A}=k(p.create(h[0]));return F(M,A)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve})(Ld)),Ld}var jb;function jf(){if(jb)return as;jb=1,Object.defineProperty(as,"__esModule",{value:!0}),as.recoverPublicKey=i;const e=nt(),t=st(),n=Ne(),r=ie();async function i({hash:o,signature:c}){const u=(0,e.isHex)(o)?o:(0,r.toHex)(o),{secp256k1:d}=await Promise.resolve().then(()=>Yo());return`0x${(()=>{if(typeof c=="object"&&"r"in c&&"s"in c){const{r:p,s:O,v:S,yParity:m}=c,j=Number(m??S),s=a(j);return new d.Signature((0,n.hexToBigInt)(p),(0,n.hexToBigInt)(O)).addRecoveryBit(s)}const b=(0,e.isHex)(c)?c:(0,r.toHex)(c);if((0,t.size)(b)!==65)throw new Error("invalid signature length");const T=(0,n.hexToNumber)(`0x${b.slice(130)}`),w=a(T);return d.Signature.fromCompact(b.substring(2,130)).addRecoveryBit(w)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function a(o){if(o===0||o===1)return o;if(o===27)return 0;if(o===28)return 1;throw new Error("Invalid yParityOrV value")}return as}var Pb;function _r(){if(Pb)return is;Pb=1,Object.defineProperty(is,"__esModule",{value:!0}),is.recoverAddress=n;const e=kp(),t=jf();async function n({hash:r,signature:i}){return(0,e.publicKeyToAddress)(await(0,t.recoverPublicKey)({hash:r,signature:i}))}return is}var cs={},mn={},Ab;function Jo(){if(Ab)return mn;Ab=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.toRlp=i,mn.bytesToRlp=a,mn.hexToRlp=o;const e=fe(),t=Vo(),n=Pe(),r=ie();function i(f,b="hex"){const T=c(f),w=(0,t.createCursor)(new Uint8Array(T.length));return T.encode(w),b==="hex"?(0,r.bytesToHex)(w.bytes):w.bytes}function a(f,b="bytes"){return i(f,b)}function o(f,b="hex"){return i(f,b)}function c(f){return Array.isArray(f)?u(f.map(b=>c(b))):d(f)}function u(f){const b=f.reduce((p,O)=>p+O.length,0),T=l(b);return{length:b<=55?1+b:1+T+b,encode(p){b<=55?p.pushByte(192+b):(p.pushByte(247+T),T===1?p.pushUint8(b):T===2?p.pushUint16(b):T===3?p.pushUint24(b):p.pushUint32(b));for(const{encode:O}of f)O(p)}}}function d(f){const b=typeof f=="string"?(0,n.hexToBytes)(f):f,T=l(b.length);return{length:b.length===1&&b[0]<128?1:b.length<=55?1+b.length:1+T+b.length,encode(p){b.length===1&&b[0]<128?p.pushBytes(b):b.length<=55?(p.pushByte(128+b.length),p.pushBytes(b)):(p.pushByte(183+T),T===1?p.pushUint8(b.length):T===2?p.pushUint16(b.length):T===3?p.pushUint24(b.length):p.pushUint32(b.length),p.pushBytes(b))}}}function l(f){if(f<2**8)return 1;if(f<2**16)return 2;if(f<2**24)return 3;if(f<2**32)return 4;throw new e.BaseError("Length is too large.")}return mn}var Tb;function Up(){if(Tb)return cs;Tb=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.hashAuthorization=a;const e=De(),t=Pe(),n=ie(),r=Jo(),i=at();function a(o){const{chainId:c,nonce:u,to:d}=o,l=o.contractAddress??o.address,f=(0,i.keccak256)((0,e.concatHex)(["0x05",(0,r.toRlp)([c?(0,n.numberToHex)(c):"0x",l,u?(0,n.numberToHex)(u):"0x"])]));return d==="bytes"?(0,t.hexToBytes)(f):f}return cs}var Sb;function Xo(){if(Sb)return os;Sb=1,Object.defineProperty(os,"__esModule",{value:!0}),os.recoverAuthorizationAddress=n;const e=_r(),t=Up();async function n(r){const{authorization:i,signature:a}=r;return(0,e.recoverAddress)({hash:(0,t.hashAuthorization)(i),signature:a??i})}return os}var us={},lo={},Ib;function zp(){if(Ib)return lo;Ib=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.EstimateGasExecutionError=void 0;const e=Ko(),t=en(),n=fe(),r=dt();class i extends n.BaseError{constructor(o,{account:c,docsPath:u,chain:d,data:l,gas:f,gasPrice:b,maxFeePerGas:T,maxPriorityFeePerGas:w,nonce:p,to:O,value:S}){const m=(0,r.prettyPrint)({from:c?.address,to:O,value:typeof S<"u"&&`${(0,e.formatEther)(S)} ${d?.nativeCurrency?.symbol||"ETH"}`,data:l,gas:f,gasPrice:typeof b<"u"&&`${(0,t.formatGwei)(b)} gwei`,maxFeePerGas:typeof T<"u"&&`${(0,t.formatGwei)(T)} gwei`,maxPriorityFeePerGas:typeof w<"u"&&`${(0,t.formatGwei)(w)} gwei`,nonce:p});super(o.shortMessage,{cause:o,docsPath:u,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],"Estimate Gas Arguments:",m].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=o}}return lo.EstimateGasExecutionError=i,lo}var we={},Bb;function tr(){if(Bb)return we;Bb=1,Object.defineProperty(we,"__esModule",{value:!0}),we.UnknownNodeError=we.TipAboveFeeCapError=we.TransactionTypeNotSupportedError=we.IntrinsicGasTooLowError=we.IntrinsicGasTooHighError=we.InsufficientFundsError=we.NonceMaxValueError=we.NonceTooLowError=we.NonceTooHighError=we.FeeCapTooLowError=we.FeeCapTooHighError=we.ExecutionRevertedError=void 0;const e=en(),t=fe();class n extends t.BaseError{constructor({cause:p,message:O}={}){const S=O?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${S?`with reason: ${S}`:"for an unknown reason"}.`,{cause:p,name:"ExecutionRevertedError"})}}we.ExecutionRevertedError=n,Object.defineProperty(n,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class r extends t.BaseError{constructor({cause:p,maxFeePerGas:O}={}){super(`The fee cap (\`maxFeePerGas\`${O?` = ${(0,e.formatGwei)(O)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:p,name:"FeeCapTooHighError"})}}we.FeeCapTooHighError=r,Object.defineProperty(r,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class i extends t.BaseError{constructor({cause:p,maxFeePerGas:O}={}){super(`The fee cap (\`maxFeePerGas\`${O?` = ${(0,e.formatGwei)(O)}`:""} gwei) cannot be lower than the block base fee.`,{cause:p,name:"FeeCapTooLowError"})}}we.FeeCapTooLowError=i,Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class a extends t.BaseError{constructor({cause:p,nonce:O}={}){super(`Nonce provided for the transaction ${O?`(${O}) `:""}is higher than the next one expected.`,{cause:p,name:"NonceTooHighError"})}}we.NonceTooHighError=a,Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class o extends t.BaseError{constructor({cause:p,nonce:O}={}){super([`Nonce provided for the transaction ${O?`(${O}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
+`),{cause:p,name:"NonceTooLowError"})}}we.NonceTooLowError=o,Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class c extends t.BaseError{constructor({cause:p,nonce:O}={}){super(`Nonce provided for the transaction ${O?`(${O}) `:""}exceeds the maximum allowed nonce.`,{cause:p,name:"NonceMaxValueError"})}}we.NonceMaxValueError=c,Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class u extends t.BaseError{constructor({cause:p}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
+`),{cause:p,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}we.InsufficientFundsError=u,Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class d extends t.BaseError{constructor({cause:p,gas:O}={}){super(`The amount of gas ${O?`(${O}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:p,name:"IntrinsicGasTooHighError"})}}we.IntrinsicGasTooHighError=d,Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class l extends t.BaseError{constructor({cause:p,gas:O}={}){super(`The amount of gas ${O?`(${O}) `:""}provided for the transaction is too low.`,{cause:p,name:"IntrinsicGasTooLowError"})}}we.IntrinsicGasTooLowError=l,Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends t.BaseError{constructor({cause:p}){super("The transaction type is not supported for this chain.",{cause:p,name:"TransactionTypeNotSupportedError"})}}we.TransactionTypeNotSupportedError=f,Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class b extends t.BaseError{constructor({cause:p,maxPriorityFeePerGas:O,maxFeePerGas:S}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${O?` = ${(0,e.formatGwei)(O)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${S?` = ${(0,e.formatGwei)(S)} gwei`:""}).`].join(`
+`),{cause:p,name:"TipAboveFeeCapError"})}}we.TipAboveFeeCapError=b,Object.defineProperty(b,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class T extends t.BaseError{constructor({cause:p}){super(`An error occurred while executing: ${p?.shortMessage}`,{cause:p,name:"UnknownNodeError"})}}return we.UnknownNodeError=T,we}var bo={},Rb;function Qo(){if(Rb)return bo;Rb=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.containsNodeError=i,bo.getNodeError=a;const e=fe(),t=tr(),n=Bt(),r=gr();function i(o){return o instanceof r.TransactionRejectedRpcError||o instanceof r.InvalidInputRpcError||o instanceof n.RpcRequestError&&o.code===t.ExecutionRevertedError.code}function a(o,c){const u=(o.details||"").toLowerCase(),d=o instanceof e.BaseError?o.walk(l=>l?.code===t.ExecutionRevertedError.code):o;return d instanceof e.BaseError?new t.ExecutionRevertedError({cause:o,message:d.details}):t.ExecutionRevertedError.nodeMessage.test(u)?new t.ExecutionRevertedError({cause:o,message:o.details}):t.FeeCapTooHighError.nodeMessage.test(u)?new t.FeeCapTooHighError({cause:o,maxFeePerGas:c?.maxFeePerGas}):t.FeeCapTooLowError.nodeMessage.test(u)?new t.FeeCapTooLowError({cause:o,maxFeePerGas:c?.maxFeePerGas}):t.NonceTooHighError.nodeMessage.test(u)?new t.NonceTooHighError({cause:o,nonce:c?.nonce}):t.NonceTooLowError.nodeMessage.test(u)?new t.NonceTooLowError({cause:o,nonce:c?.nonce}):t.NonceMaxValueError.nodeMessage.test(u)?new t.NonceMaxValueError({cause:o,nonce:c?.nonce}):t.InsufficientFundsError.nodeMessage.test(u)?new t.InsufficientFundsError({cause:o}):t.IntrinsicGasTooHighError.nodeMessage.test(u)?new t.IntrinsicGasTooHighError({cause:o,gas:c?.gas}):t.IntrinsicGasTooLowError.nodeMessage.test(u)?new t.IntrinsicGasTooLowError({cause:o,gas:c?.gas}):t.TransactionTypeNotSupportedError.nodeMessage.test(u)?new t.TransactionTypeNotSupportedError({cause:o}):t.TipAboveFeeCapError.nodeMessage.test(u)?new t.TipAboveFeeCapError({cause:o,maxFeePerGas:c?.maxFeePerGas,maxPriorityFeePerGas:c?.maxPriorityFeePerGas}):new t.UnknownNodeError({cause:o})}return bo}var Ob;function Dp(){if(Ob)return us;Ob=1,Object.defineProperty(us,"__esModule",{value:!0}),us.getEstimateGasError=r;const e=zp(),t=tr(),n=Qo();function r(i,{docsPath:a,...o}){const c=(()=>{const u=(0,n.getNodeError)(i,o);return u instanceof t.UnknownNodeError?i:u})();return new e.EstimateGasExecutionError(c,{docsPath:a,...o})}return us}var ds={},Cb;function vr(){if(Cb)return ds;Cb=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.extract=e;function e(t,{format:n}){if(!n)return{};const r={};function i(o){const c=Object.keys(o);for(const u of c)u in t&&(r[u]=t[u]),o[u]&&typeof o[u]=="object"&&!Array.isArray(o[u])&&i(o[u])}const a=n(t||{});return i(a),r}return ds}var Dd={},fs={},xb;function $o(){if(xb)return fs;xb=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.defineFormatter=e;function e(t,n){return({exclude:r,format:i})=>({exclude:r,format:(a,o)=>{const c=n(a,o);if(r)for(const u of r)delete c[u];return{...c,...i(a,o)}},type:t})}return fs}var qb;function Rt(){return qb||(qb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransactionRequest=e.rpcTransactionType=void 0,e.formatTransactionRequest=r;const t=ie(),n=$o();e.rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function r(a,o){const c={};return typeof a.authorizationList<"u"&&(c.authorizationList=i(a.authorizationList)),typeof a.accessList<"u"&&(c.accessList=a.accessList),typeof a.blobVersionedHashes<"u"&&(c.blobVersionedHashes=a.blobVersionedHashes),typeof a.blobs<"u"&&(typeof a.blobs[0]!="string"?c.blobs=a.blobs.map(u=>(0,t.bytesToHex)(u)):c.blobs=a.blobs),typeof a.data<"u"&&(c.data=a.data),a.account&&(c.from=a.account.address),typeof a.from<"u"&&(c.from=a.from),typeof a.gas<"u"&&(c.gas=(0,t.numberToHex)(a.gas)),typeof a.gasPrice<"u"&&(c.gasPrice=(0,t.numberToHex)(a.gasPrice)),typeof a.maxFeePerBlobGas<"u"&&(c.maxFeePerBlobGas=(0,t.numberToHex)(a.maxFeePerBlobGas)),typeof a.maxFeePerGas<"u"&&(c.maxFeePerGas=(0,t.numberToHex)(a.maxFeePerGas)),typeof a.maxPriorityFeePerGas<"u"&&(c.maxPriorityFeePerGas=(0,t.numberToHex)(a.maxPriorityFeePerGas)),typeof a.nonce<"u"&&(c.nonce=(0,t.numberToHex)(a.nonce)),typeof a.to<"u"&&(c.to=a.to),typeof a.type<"u"&&(c.type=e.rpcTransactionType[a.type]),typeof a.value<"u"&&(c.value=(0,t.numberToHex)(a.value)),c}e.defineTransactionRequest=(0,n.defineFormatter)("transactionRequest",r);function i(a){return a.map(o=>({address:o.address,r:o.r?(0,t.numberToHex)(BigInt(o.r)):o.r,s:o.s?(0,t.numberToHex)(BigInt(o.s)):o.s,chainId:(0,t.numberToHex)(o.chainId),nonce:(0,t.numberToHex)(o.nonce),...typeof o.yParity<"u"?{yParity:(0,t.numberToHex)(o.yParity)}:{},...typeof o.v<"u"&&typeof o.yParity>"u"?{v:(0,t.numberToHex)(o.v)}:{}}))}})(Dd)),Dd}var hn={},Hb;function Pf(){if(Hb)return hn;Hb=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.serializeStateMapping=a,hn.serializeAccountStateOverride=o,hn.serializeStateOverride=c;const e=St(),t=Uu(),n=Ef(),r=ct(),i=ie();function a(u){if(!(!u||u.length===0))return u.reduce((d,{slot:l,value:f})=>{if(l.length!==66)throw new t.InvalidBytesLengthError({size:l.length,targetSize:66,type:"hex"});if(f.length!==66)throw new t.InvalidBytesLengthError({size:f.length,targetSize:66,type:"hex"});return d[l]=f,d},{})}function o(u){const{balance:d,nonce:l,state:f,stateDiff:b,code:T}=u,w={};if(T!==void 0&&(w.code=T),d!==void 0&&(w.balance=(0,i.numberToHex)(d)),l!==void 0&&(w.nonce=(0,i.numberToHex)(l)),f!==void 0&&(w.state=a(f)),b!==void 0){if(w.state)throw new n.StateAssignmentConflictError;w.stateDiff=a(b)}return w}function c(u){if(!u)return;const d={};for(const{address:l,...f}of u){if(!(0,r.isAddress)(l,{strict:!1}))throw new e.InvalidAddressError({address:l});if(d[l])throw new n.AccountStateConflictError({address:l});d[l]=o(f)}return d}return hn}var ls={},V={},Mb;function Af(){return Mb||(Mb=1,Object.defineProperty(V,"__esModule",{value:!0}),V.minInt144=V.minInt136=V.minInt128=V.minInt120=V.minInt112=V.minInt104=V.minInt96=V.minInt88=V.minInt80=V.minInt72=V.minInt64=V.minInt56=V.minInt48=V.minInt40=V.minInt32=V.minInt24=V.minInt16=V.minInt8=V.maxInt256=V.maxInt248=V.maxInt240=V.maxInt232=V.maxInt224=V.maxInt216=V.maxInt208=V.maxInt200=V.maxInt192=V.maxInt184=V.maxInt176=V.maxInt168=V.maxInt160=V.maxInt152=V.maxInt144=V.maxInt136=V.maxInt128=V.maxInt120=V.maxInt112=V.maxInt104=V.maxInt96=V.maxInt88=V.maxInt80=V.maxInt72=V.maxInt64=V.maxInt56=V.maxInt48=V.maxInt40=V.maxInt32=V.maxInt24=V.maxInt16=V.maxInt8=void 0,V.maxUint256=V.maxUint248=V.maxUint240=V.maxUint232=V.maxUint224=V.maxUint216=V.maxUint208=V.maxUint200=V.maxUint192=V.maxUint184=V.maxUint176=V.maxUint168=V.maxUint160=V.maxUint152=V.maxUint144=V.maxUint136=V.maxUint128=V.maxUint120=V.maxUint112=V.maxUint104=V.maxUint96=V.maxUint88=V.maxUint80=V.maxUint72=V.maxUint64=V.maxUint56=V.maxUint48=V.maxUint40=V.maxUint32=V.maxUint24=V.maxUint16=V.maxUint8=V.minInt256=V.minInt248=V.minInt240=V.minInt232=V.minInt224=V.minInt216=V.minInt208=V.minInt200=V.minInt192=V.minInt184=V.minInt176=V.minInt168=V.minInt160=V.minInt152=void 0,V.maxInt8=2n**(8n-1n)-1n,V.maxInt16=2n**(16n-1n)-1n,V.maxInt24=2n**(24n-1n)-1n,V.maxInt32=2n**(32n-1n)-1n,V.maxInt40=2n**(40n-1n)-1n,V.maxInt48=2n**(48n-1n)-1n,V.maxInt56=2n**(56n-1n)-1n,V.maxInt64=2n**(64n-1n)-1n,V.maxInt72=2n**(72n-1n)-1n,V.maxInt80=2n**(80n-1n)-1n,V.maxInt88=2n**(88n-1n)-1n,V.maxInt96=2n**(96n-1n)-1n,V.maxInt104=2n**(104n-1n)-1n,V.maxInt112=2n**(112n-1n)-1n,V.maxInt120=2n**(120n-1n)-1n,V.maxInt128=2n**(128n-1n)-1n,V.maxInt136=2n**(136n-1n)-1n,V.maxInt144=2n**(144n-1n)-1n,V.maxInt152=2n**(152n-1n)-1n,V.maxInt160=2n**(160n-1n)-1n,V.maxInt168=2n**(168n-1n)-1n,V.maxInt176=2n**(176n-1n)-1n,V.maxInt184=2n**(184n-1n)-1n,V.maxInt192=2n**(192n-1n)-1n,V.maxInt200=2n**(200n-1n)-1n,V.maxInt208=2n**(208n-1n)-1n,V.maxInt216=2n**(216n-1n)-1n,V.maxInt224=2n**(224n-1n)-1n,V.maxInt232=2n**(232n-1n)-1n,V.maxInt240=2n**(240n-1n)-1n,V.maxInt248=2n**(248n-1n)-1n,V.maxInt256=2n**(256n-1n)-1n,V.minInt8=-(2n**(8n-1n)),V.minInt16=-(2n**(16n-1n)),V.minInt24=-(2n**(24n-1n)),V.minInt32=-(2n**(32n-1n)),V.minInt40=-(2n**(40n-1n)),V.minInt48=-(2n**(48n-1n)),V.minInt56=-(2n**(56n-1n)),V.minInt64=-(2n**(64n-1n)),V.minInt72=-(2n**(72n-1n)),V.minInt80=-(2n**(80n-1n)),V.minInt88=-(2n**(88n-1n)),V.minInt96=-(2n**(96n-1n)),V.minInt104=-(2n**(104n-1n)),V.minInt112=-(2n**(112n-1n)),V.minInt120=-(2n**(120n-1n)),V.minInt128=-(2n**(128n-1n)),V.minInt136=-(2n**(136n-1n)),V.minInt144=-(2n**(144n-1n)),V.minInt152=-(2n**(152n-1n)),V.minInt160=-(2n**(160n-1n)),V.minInt168=-(2n**(168n-1n)),V.minInt176=-(2n**(176n-1n)),V.minInt184=-(2n**(184n-1n)),V.minInt192=-(2n**(192n-1n)),V.minInt200=-(2n**(200n-1n)),V.minInt208=-(2n**(208n-1n)),V.minInt216=-(2n**(216n-1n)),V.minInt224=-(2n**(224n-1n)),V.minInt232=-(2n**(232n-1n)),V.minInt240=-(2n**(240n-1n)),V.minInt248=-(2n**(248n-1n)),V.minInt256=-(2n**(256n-1n)),V.maxUint8=2n**8n-1n,V.maxUint16=2n**16n-1n,V.maxUint24=2n**24n-1n,V.maxUint32=2n**32n-1n,V.maxUint40=2n**40n-1n,V.maxUint48=2n**48n-1n,V.maxUint56=2n**56n-1n,V.maxUint64=2n**64n-1n,V.maxUint72=2n**72n-1n,V.maxUint80=2n**80n-1n,V.maxUint88=2n**88n-1n,V.maxUint96=2n**96n-1n,V.maxUint104=2n**104n-1n,V.maxUint112=2n**112n-1n,V.maxUint120=2n**120n-1n,V.maxUint128=2n**128n-1n,V.maxUint136=2n**136n-1n,V.maxUint144=2n**144n-1n,V.maxUint152=2n**152n-1n,V.maxUint160=2n**160n-1n,V.maxUint168=2n**168n-1n,V.maxUint176=2n**176n-1n,V.maxUint184=2n**184n-1n,V.maxUint192=2n**192n-1n,V.maxUint200=2n**200n-1n,V.maxUint208=2n**208n-1n,V.maxUint216=2n**216n-1n,V.maxUint224=2n**224n-1n,V.maxUint232=2n**232n-1n,V.maxUint240=2n**240n-1n,V.maxUint248=2n**248n-1n,V.maxUint256=2n**256n-1n),V}var kb;function Ot(){if(kb)return ls;kb=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.assertRequest=a;const e=He(),t=Af(),n=St(),r=tr(),i=ct();function a(o){const{account:c,maxFeePerGas:u,maxPriorityFeePerGas:d,to:l}=o,f=c?(0,e.parseAccount)(c):void 0;if(f&&!(0,i.isAddress)(f.address))throw new n.InvalidAddressError({address:f.address});if(l&&!(0,i.isAddress)(l))throw new n.InvalidAddressError({address:l});if(u&&u>t.maxUint256)throw new r.FeeCapTooHighError({maxFeePerGas:u});if(d&&u&&d>u)throw new r.TipAboveFeeCapError({maxFeePerGas:u,maxPriorityFeePerGas:d})}return ls}var Gd={},mo={},Yt={},Nb;function ei(){if(Nb)return Yt;Nb=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.MaxFeePerGasTooLowError=Yt.Eip1559FeesNotSupportedError=Yt.BaseFeeScalarError=void 0;const e=en(),t=fe();class n extends t.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}Yt.BaseFeeScalarError=n;class r extends t.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}Yt.Eip1559FeesNotSupportedError=r;class i extends t.BaseError{constructor({maxPriorityFeePerGas:o}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,e.formatGwei)(o)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}return Yt.MaxFeePerGasTooLowError=i,Yt}var ho={},bs={},yo={},Fb;function Tf(){if(Fb)return yo;Fb=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.BlockNotFoundError=void 0;const e=fe();class t extends e.BaseError{constructor({blockHash:r,blockNumber:i}){let a="Block";r&&(a=`Block at hash "${r}"`),i&&(a=`Block at number "${i}"`),super(`${a} could not be found.`,{name:"BlockNotFoundError"})}}return yo.BlockNotFoundError=t,yo}var yn={},Vd={},Lb;function On(){return Lb||(Lb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransaction=e.transactionType=void 0,e.formatTransaction=r;const t=Ne(),n=$o();e.transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function r(a,o){const c={...a,blockHash:a.blockHash?a.blockHash:null,blockNumber:a.blockNumber?BigInt(a.blockNumber):null,chainId:a.chainId?(0,t.hexToNumber)(a.chainId):void 0,gas:a.gas?BigInt(a.gas):void 0,gasPrice:a.gasPrice?BigInt(a.gasPrice):void 0,maxFeePerBlobGas:a.maxFeePerBlobGas?BigInt(a.maxFeePerBlobGas):void 0,maxFeePerGas:a.maxFeePerGas?BigInt(a.maxFeePerGas):void 0,maxPriorityFeePerGas:a.maxPriorityFeePerGas?BigInt(a.maxPriorityFeePerGas):void 0,nonce:a.nonce?(0,t.hexToNumber)(a.nonce):void 0,to:a.to?a.to:null,transactionIndex:a.transactionIndex?Number(a.transactionIndex):null,type:a.type?e.transactionType[a.type]:void 0,typeHex:a.type?a.type:void 0,value:a.value?BigInt(a.value):void 0,v:a.v?BigInt(a.v):void 0};return a.authorizationList&&(c.authorizationList=i(a.authorizationList)),c.yParity=(()=>{if(a.yParity)return Number(a.yParity);if(typeof c.v=="bigint"){if(c.v===0n||c.v===27n)return 0;if(c.v===1n||c.v===28n)return 1;if(c.v>=35n)return c.v%2n===0n?1:0}})(),c.type==="legacy"&&(delete c.accessList,delete c.maxFeePerBlobGas,delete c.maxFeePerGas,delete c.maxPriorityFeePerGas,delete c.yParity),c.type==="eip2930"&&(delete c.maxFeePerBlobGas,delete c.maxFeePerGas,delete c.maxPriorityFeePerGas),c.type==="eip1559"&&delete c.maxFeePerBlobGas,c}e.defineTransaction=(0,n.defineFormatter)("transaction",r);function i(a){return a.map(o=>({address:o.address,chainId:Number(o.chainId),nonce:Number(o.nonce),r:o.r,s:o.s,yParity:Number(o.yParity)}))}})(Vd)),Vd}var Ub;function Zu(){if(Ub)return yn;Ub=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.defineBlock=void 0,yn.formatBlock=n;const e=$o(),t=On();function n(r,i){const a=(r.transactions??[]).map(o=>typeof o=="string"?o:(0,t.formatTransaction)(o));return{...r,baseFeePerGas:r.baseFeePerGas?BigInt(r.baseFeePerGas):null,blobGasUsed:r.blobGasUsed?BigInt(r.blobGasUsed):void 0,difficulty:r.difficulty?BigInt(r.difficulty):void 0,excessBlobGas:r.excessBlobGas?BigInt(r.excessBlobGas):void 0,gasLimit:r.gasLimit?BigInt(r.gasLimit):void 0,gasUsed:r.gasUsed?BigInt(r.gasUsed):void 0,hash:r.hash?r.hash:null,logsBloom:r.logsBloom?r.logsBloom:null,nonce:r.nonce?r.nonce:null,number:r.number?BigInt(r.number):null,size:r.size?BigInt(r.size):void 0,timestamp:r.timestamp?BigInt(r.timestamp):void 0,transactions:a,totalDifficulty:r.totalDifficulty?BigInt(r.totalDifficulty):null}}return yn.defineBlock=(0,e.defineFormatter)("block",n),yn}var zb;function tn(){if(zb)return bs;zb=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.getBlock=r;const e=Tf(),t=ie(),n=Zu();async function r(i,{blockHash:a,blockNumber:o,blockTag:c=i.experimental_blockTag??"latest",includeTransactions:u}={}){const d=u??!1,l=o!==void 0?(0,t.numberToHex)(o):void 0;let f=null;if(a?f=await i.request({method:"eth_getBlockByHash",params:[a,d]},{dedupe:!0}):f=await i.request({method:"eth_getBlockByNumber",params:[l||c,d]},{dedupe:!!l}),!f)throw new e.BlockNotFoundError({blockHash:a,blockNumber:o});return(i.chain?.formatters?.block?.format||n.formatBlock)(f,"getBlock")}return bs}var ms={},Db;function Sf(){if(Db)return ms;Db=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.getGasPrice=e;async function e(t){const n=await t.request({method:"eth_gasPrice"});return BigInt(n)}return ms}var Gb;function Gp(){if(Gb)return ho;Gb=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.estimateMaxPriorityFeePerGas=a,ho.internal_estimateMaxPriorityFeePerGas=o;const e=ei(),t=Ne(),n=ge(),r=tn(),i=Sf();async function a(c,u){return o(c,u)}async function o(c,u){const{block:d,chain:l=c.chain,request:f}=u||{};try{const b=l?.fees?.maxPriorityFeePerGas??l?.fees?.defaultPriorityFee;if(typeof b=="function"){const w=d||await(0,n.getAction)(c,r.getBlock,"getBlock")({}),p=await b({block:w,client:c,request:f});if(p===null)throw new Error;return p}if(typeof b<"u")return b;const T=await c.request({method:"eth_maxPriorityFeePerGas"});return(0,t.hexToBigInt)(T)}catch{const[b,T]=await Promise.all([d?Promise.resolve(d):(0,n.getAction)(c,r.getBlock,"getBlock")({}),(0,n.getAction)(c,i.getGasPrice,"getGasPrice")({})]);if(typeof b.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const w=T-b.baseFeePerGas;return w<0n?0n:w}}return ho}var Vb;function Vp(){if(Vb)return mo;Vb=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.estimateFeesPerGas=a,mo.internal_estimateFeesPerGas=o;const e=ei(),t=ge(),n=Gp(),r=tn(),i=Sf();async function a(c,u){return o(c,u)}async function o(c,u){const{block:d,chain:l=c.chain,request:f,type:b="eip1559"}=u||{},T=await(async()=>typeof l?.fees?.baseFeeMultiplier=="function"?l.fees.baseFeeMultiplier({block:d,client:c,request:f}):l?.fees?.baseFeeMultiplier??1.2)();if(T<1)throw new e.BaseFeeScalarError;const p=10**(T.toString().split(".")[1]?.length??0),O=j=>j*BigInt(Math.ceil(T*p))/BigInt(p),S=d||await(0,t.getAction)(c,r.getBlock,"getBlock")({});if(typeof l?.fees?.estimateFeesPerGas=="function"){const j=await l.fees.estimateFeesPerGas({block:d,client:c,multiply:O,request:f,type:b});if(j!==null)return j}if(b==="eip1559"){if(typeof S.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const j=typeof f?.maxPriorityFeePerGas=="bigint"?f.maxPriorityFeePerGas:await(0,n.internal_estimateMaxPriorityFeePerGas)(c,{block:S,chain:l,request:f}),s=O(S.baseFeePerGas);return{maxFeePerGas:f?.maxFeePerGas??s+j,maxPriorityFeePerGas:j}}return{gasPrice:f?.gasPrice??O(await(0,t.getAction)(c,i.getGasPrice,"getGasPrice")({}))}}return mo}var hs={},Wb;function Yu(){if(Wb)return hs;Wb=1,Object.defineProperty(hs,"__esModule",{value:!0}),hs.getTransactionCount=n;const e=Ne(),t=ie();async function n(r,{address:i,blockTag:a="latest",blockNumber:o}){const c=await r.request({method:"eth_getTransactionCount",params:[i,typeof o=="bigint"?(0,t.numberToHex)(o):a]},{dedupe:!!o});return(0,e.hexToNumber)(c)}return hs}var ys={},Kb;function Ju(){if(Kb)return ys;Kb=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.blobsToCommitments=n;const e=Pe(),t=ie();function n(r){const{kzg:i}=r,a=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),o=typeof r.blobs[0]=="string"?r.blobs.map(u=>(0,e.hexToBytes)(u)):r.blobs,c=[];for(const u of o)c.push(Uint8Array.from(i.blobToKzgCommitment(u)));return a==="bytes"?c:c.map(u=>(0,t.bytesToHex)(u))}return ys}var gs={},Zb;function Xu(){if(Zb)return gs;Zb=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.blobsToProofs=n;const e=Pe(),t=ie();function n(r){const{kzg:i}=r,a=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),o=typeof r.blobs[0]=="string"?r.blobs.map(d=>(0,e.hexToBytes)(d)):r.blobs,c=typeof r.commitments[0]=="string"?r.commitments.map(d=>(0,e.hexToBytes)(d)):r.commitments,u=[];for(let d=0;d(0,t.bytesToHex)(d))}return gs}var ps={},_s={},vs={},Et={},Yb;function Sv(){if(Yb)return Et;Yb=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.sha224=Et.SHA224=Et.sha256=Et.SHA256=void 0;const e=Fp();return Et.SHA256=e.SHA256,Et.sha256=e.sha256,Et.SHA224=e.SHA224,Et.sha224=e.sha224,Et}var Jb;function If(){if(Jb)return vs;Jb=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.sha256=i;const e=Sv(),t=nt(),n=Pe(),r=ie();function i(a,o){const c=o||"hex",u=(0,e.sha256)((0,t.isHex)(a,{strict:!1})?(0,n.toBytes)(a):a);return c==="bytes"?u:(0,r.toHex)(u)}return vs}var Xb;function Bf(){if(Xb)return _s;Xb=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.commitmentToVersionedHash=n;const e=ie(),t=If();function n(r){const{commitment:i,version:a=1}=r,o=r.to??(typeof i=="string"?"hex":"bytes"),c=(0,t.sha256)(i,"bytes");return c.set([a],0),o==="bytes"?c:(0,e.bytesToHex)(c)}return _s}var Qb;function Rf(){if(Qb)return ps;Qb=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.commitmentsToVersionedHashes=t;const e=Bf();function t(n){const{commitments:r,version:i}=n,a=n.to??(typeof r[0]=="string"?"hex":"bytes"),o=[];for(const c of r)o.push((0,e.commitmentToVersionedHash)({commitment:c,to:a,version:i}));return o}return ps}var Es={},ws={},Wd={},$b;function Iv(){return $b||($b=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxBytesPerTransaction=e.bytesPerBlob=e.fieldElementsPerBlob=e.bytesPerFieldElement=void 0;const t=6;e.bytesPerFieldElement=32,e.fieldElementsPerBlob=4096,e.bytesPerBlob=e.bytesPerFieldElement*e.fieldElementsPerBlob,e.maxBytesPerTransaction=e.bytesPerBlob*t-1-1*e.fieldElementsPerBlob*t})(Wd)),Wd}var wt={},go={},em;function Wp(){return em||(em=1,Object.defineProperty(go,"__esModule",{value:!0}),go.versionedHashVersionKzg=void 0,go.versionedHashVersionKzg=1),go}var tm;function Kp(){if(tm)return wt;tm=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.InvalidVersionedHashVersionError=wt.InvalidVersionedHashSizeError=wt.EmptyBlobError=wt.BlobSizeTooLargeError=void 0;const e=Wp(),t=fe();class n extends t.BaseError{constructor({maxSize:c,size:u}){super("Blob size is too large.",{metaMessages:[`Max: ${c} bytes`,`Given: ${u} bytes`],name:"BlobSizeTooLargeError"})}}wt.BlobSizeTooLargeError=n;class r extends t.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}wt.EmptyBlobError=r;class i extends t.BaseError{constructor({hash:c,size:u}){super(`Versioned hash "${c}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${u}`],name:"InvalidVersionedHashSizeError"})}}wt.InvalidVersionedHashSizeError=i;class a extends t.BaseError{constructor({hash:c,version:u}){super(`Versioned hash "${c}" version is invalid.`,{metaMessages:[`Expected: ${e.versionedHashVersionKzg}`,`Received: ${u}`],name:"InvalidVersionedHashVersionError"})}}return wt.InvalidVersionedHashVersionError=a,wt}var rm;function Zp(){if(rm)return ws;rm=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.toBlobs=o;const e=Iv(),t=Kp(),n=Vo(),r=st(),i=Pe(),a=ie();function o(c){const u=c.to??(typeof c.data=="string"?"hex":"bytes"),d=typeof c.data=="string"?(0,i.hexToBytes)(c.data):c.data,l=(0,r.size)(d);if(!l)throw new t.EmptyBlobError;if(l>e.maxBytesPerTransaction)throw new t.BlobSizeTooLargeError({maxSize:e.maxBytesPerTransaction,size:l});const f=[];let b=!0,T=0;for(;b;){const w=(0,n.createCursor)(new Uint8Array(e.bytesPerBlob));let p=0;for(;pw.bytes):f.map(w=>(0,a.bytesToHex)(w.bytes))}return ws}var nm;function Qu(){if(nm)return Es;nm=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.toBlobSidecars=r;const e=Ju(),t=Xu(),n=Zp();function r(i){const{data:a,kzg:o,to:c}=i,u=i.blobs??(0,n.toBlobs)({data:a,to:c}),d=i.commitments??(0,e.blobsToCommitments)({blobs:u,kzg:o,to:c}),l=i.proofs??(0,t.blobsToProofs)({blobs:u,commitments:d,kzg:o,to:c}),f=[];for(let b=0;b{const u=(0,n.getNodeError)(i,o);return u instanceof e.UnknownNodeError?i:u})();return new t.TransactionExecutionError(c,{docsPath:a,...o})}return As}var Ts={},sm;function Er(){if(sm)return Ts;sm=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.getChainId=t;const e=Ne();async function t(n){const r=await n.request({method:"eth_chainId"},{dedupe:!0});return(0,e.hexToNumber)(r)}return Ts}var am;function Of(){if(am)return Ps;am=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.fillTransaction=l;const e=He(),t=ei(),n=ti(),r=vr(),i=On(),a=Rt(),o=ge(),c=Ot(),u=tn(),d=Er();async function l(f,b){const{account:T=f.account,accessList:w,authorizationList:p,chain:O=f.chain,blobVersionedHashes:S,blobs:m,data:j,gas:s,gasPrice:y,maxFeePerBlobGas:g,maxFeePerGas:E,maxPriorityFeePerGas:B,nonce:_,nonceManager:v,to:C,type:q,value:R,...H}=b,F=await(async()=>{if(!T||!v||typeof _<"u")return _;const A=(0,e.parseAccount)(T),P=O?O.id:await(0,o.getAction)(f,d.getChainId,"getChainId")({});return await v.consume({address:A.address,chainId:P,client:f})})();(0,c.assertRequest)(b);const k=O?.formatters?.transactionRequest?.format,M=(k||a.formatTransactionRequest)({...(0,r.extract)(H,{format:k}),account:T?(0,e.parseAccount)(T):void 0,accessList:w,authorizationList:p,blobs:m,blobVersionedHashes:S,data:j,gas:s,gasPrice:y,maxFeePerBlobGas:g,maxFeePerGas:E,maxPriorityFeePerGas:B,nonce:F,to:C,type:q,value:R},"fillTransaction");try{const A=await f.request({method:"eth_fillTransaction",params:[M]}),I=(O?.formatters?.transaction?.format||i.formatTransaction)(A.tx);delete I.blockHash,delete I.blockNumber,delete I.r,delete I.s,delete I.transactionIndex,delete I.v,delete I.yParity,I.data=I.input,I.gas&&(I.gas=b.gas??I.gas),I.gasPrice&&(I.gasPrice=b.gasPrice??I.gasPrice),I.maxFeePerBlobGas&&(I.maxFeePerBlobGas=b.maxFeePerBlobGas??I.maxFeePerBlobGas),I.maxFeePerGas&&(I.maxFeePerGas=b.maxFeePerGas??I.maxFeePerGas),I.maxPriorityFeePerGas&&(I.maxPriorityFeePerGas=b.maxPriorityFeePerGas??I.maxPriorityFeePerGas),I.nonce&&(I.nonce=b.nonce??I.nonce);const x=await(async()=>{if(typeof O?.fees?.baseFeeMultiplier=="function"){const z=await(0,o.getAction)(f,u.getBlock,"getBlock")({});return O.fees.baseFeeMultiplier({block:z,client:f,request:b})}return O?.fees?.baseFeeMultiplier??1.2})();if(x<1)throw new t.BaseFeeScalarError;const U=10**(x.toString().split(".")[1]?.length??0),L=z=>z*BigInt(Math.ceil(x*U))/BigInt(U);return I.maxFeePerGas&&!b.maxFeePerGas&&(I.maxFeePerGas=L(I.maxFeePerGas)),I.gasPrice&&!b.gasPrice&&(I.gasPrice=L(I.gasPrice)),{raw:A.raw,transaction:{from:M.from,...I}}}catch(A){throw(0,n.getTransactionError)(A,{...b,chain:f.chain})}}return Ps}var cm;function ri(){return cm||(cm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.supportsFillTransaction=e.eip1559NetworkCache=e.defaultParameters=void 0,e.prepareTransactionRequest=S;const t=He(),n=Vp(),r=Cf(),i=tn(),a=Yu(),o=ei(),c=Ju(),u=Xu(),d=Rf(),l=Qu(),f=ge(),b=Xr(),T=Ot(),w=$u(),p=Of(),O=Er();e.defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],e.eip1559NetworkCache=new Map,e.supportsFillTransaction=new b.LruMap(128);async function S(m,j){let s=j;s.account??=m.account,s.parameters??=e.defaultParameters;const{account:y,chain:g=m.chain,nonceManager:E,parameters:B}=s,_=(()=>{if(typeof g?.prepareTransactionRequest=="function")return{fn:g.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(g?.prepareTransactionRequest))return{fn:g.prepareTransactionRequest[0],runAt:g.prepareTransactionRequest[1].runAt}})();let v;async function C(){return v||(typeof s.chainId<"u"?s.chainId:g?g.id:(v=await(0,f.getAction)(m,O.getChainId,"getChainId")({}),v))}const q=y&&(0,t.parseAccount)(y);let R=s.nonce;if(B.includes("nonce")&&typeof R>"u"&&q&&E){const x=await C();R=await E.consume({address:q.address,chainId:x,client:m})}_?.fn&&_.runAt?.includes("beforeFillTransaction")&&(s=await _.fn({...s,chain:g},{phase:"beforeFillTransaction"}),R??=s.nonce);const F=((B.includes("blobVersionedHashes")||B.includes("sidecars"))&&s.kzg&&s.blobs||e.supportsFillTransaction.get(m.uid)===!1||!["fees","gas"].some(N=>B.includes(N))?!1:!!(B.includes("chainId")&&typeof s.chainId!="number"||B.includes("nonce")&&typeof R!="number"||B.includes("fees")&&typeof s.gasPrice!="bigint"&&(typeof s.maxFeePerGas!="bigint"||typeof s.maxPriorityFeePerGas!="bigint")||B.includes("gas")&&typeof s.gas!="bigint"))?await(0,f.getAction)(m,p.fillTransaction,"fillTransaction")({...s,nonce:R}).then(x=>{const{chainId:N,from:U,gas:L,gasPrice:z,nonce:D,maxFeePerBlobGas:J,maxFeePerGas:Z,maxPriorityFeePerGas:Y,type:X,...oe}=x.transaction;return e.supportsFillTransaction.set(m.uid,!0),{...s,...U?{from:U}:{},...X?{type:X}:{},...typeof N<"u"?{chainId:N}:{},...typeof L<"u"?{gas:L}:{},...typeof z<"u"?{gasPrice:z}:{},...typeof D<"u"?{nonce:D}:{},...typeof J<"u"?{maxFeePerBlobGas:J}:{},...typeof Z<"u"?{maxFeePerGas:Z}:{},...typeof Y<"u"?{maxPriorityFeePerGas:Y}:{},..."nonceKey"in oe&&typeof oe.nonceKey<"u"?{nonceKey:oe.nonceKey}:{}}}).catch(x=>{const N=x;return N.name!=="TransactionExecutionError"||N.walk?.(L=>{const z=L;return z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError"})&&e.supportsFillTransaction.set(m.uid,!1),s}):s;R??=F.nonce,s={...F,...q?{from:q?.address}:{},...R?{nonce:R}:{}};const{blobs:k,gas:h,kzg:M,type:A}=s;_?.fn&&_.runAt?.includes("beforeFillParameters")&&(s=await _.fn({...s,chain:g},{phase:"beforeFillParameters"}));let P;async function I(){return P||(P=await(0,f.getAction)(m,i.getBlock,"getBlock")({blockTag:"latest"}),P)}if(B.includes("nonce")&&typeof R>"u"&&q&&!E&&(s.nonce=await(0,f.getAction)(m,a.getTransactionCount,"getTransactionCount")({address:q.address,blockTag:"pending"})),(B.includes("blobVersionedHashes")||B.includes("sidecars"))&&k&&M){const x=(0,c.blobsToCommitments)({blobs:k,kzg:M});if(B.includes("blobVersionedHashes")){const N=(0,d.commitmentsToVersionedHashes)({commitments:x,to:"hex"});s.blobVersionedHashes=N}if(B.includes("sidecars")){const N=(0,u.blobsToProofs)({blobs:k,commitments:x,kzg:M}),U=(0,l.toBlobSidecars)({blobs:k,commitments:x,proofs:N,to:"hex"});s.sidecars=U}}if(B.includes("chainId")&&(s.chainId=await C()),(B.includes("fees")||B.includes("type"))&&typeof A>"u")try{s.type=(0,w.getTransactionType)(s)}catch{let x=e.eip1559NetworkCache.get(m.uid);typeof x>"u"&&(x=typeof(await I())?.baseFeePerGas=="bigint",e.eip1559NetworkCache.set(m.uid,x)),s.type=x?"eip1559":"legacy"}if(B.includes("fees"))if(s.type!=="legacy"&&s.type!=="eip2930"){if(typeof s.maxFeePerGas>"u"||typeof s.maxPriorityFeePerGas>"u"){const x=await I(),{maxFeePerGas:N,maxPriorityFeePerGas:U}=await(0,n.internal_estimateFeesPerGas)(m,{block:x,chain:g,request:s});if(typeof s.maxPriorityFeePerGas>"u"&&s.maxFeePerGas&&s.maxFeePerGas"u"){const x=await I(),{gasPrice:N}=await(0,n.internal_estimateFeesPerGas)(m,{block:x,chain:g,request:s,type:"legacy"});s.gasPrice=N}}return B.includes("gas")&&typeof h>"u"&&(s.gas=await(0,f.getAction)(m,r.estimateGas,"estimateGas")({...s,account:q,prepare:q?.type==="local"?[]:["blobVersionedHashes"]})),_?.fn&&_.runAt?.includes("afterFillParameters")&&(s=await _.fn({...s,chain:g},{phase:"afterFillParameters"})),(0,T.assertRequest)(s),delete s.parameters,s}})(Gd)),Gd}var um;function Cf(){if(um)return ns;um=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.estimateGas=l;const e=He(),t=fe(),n=Xo(),r=ie(),i=Dp(),a=vr(),o=Rt(),c=Pf(),u=Ot(),d=ri();async function l(f,b){const{account:T=f.account,prepare:w=!0}=b,p=T?(0,e.parseAccount)(T):void 0,O=(()=>{if(Array.isArray(w))return w;if(p?.type!=="local")return["blobVersionedHashes"]})();try{const S=await(async()=>{if(b.to)return b.to;if(b.authorizationList&&b.authorizationList.length>0)return await(0,n.recoverAuthorizationAddress)({authorization:b.authorizationList[0]}).catch(()=>{throw new t.BaseError("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:m,authorizationList:j,blobs:s,blobVersionedHashes:y,blockNumber:g,blockTag:E,data:B,gas:_,gasPrice:v,maxFeePerBlobGas:C,maxFeePerGas:q,maxPriorityFeePerGas:R,nonce:H,value:F,stateOverride:k,...h}=w?await(0,d.prepareTransactionRequest)(f,{...b,parameters:O,to:S}):b;if(_&&b.gas!==_)return _;const A=(typeof g=="bigint"?(0,r.numberToHex)(g):void 0)||E,P=(0,c.serializeStateOverride)(k);(0,u.assertRequest)(b);const I=f.chain?.formatters?.transactionRequest?.format,N=(I||o.formatTransactionRequest)({...(0,a.extract)(h,{format:I}),account:p,accessList:m,authorizationList:j,blobs:s,blobVersionedHashes:y,data:B,gasPrice:v,maxFeePerBlobGas:C,maxFeePerGas:q,maxPriorityFeePerGas:R,nonce:H,to:S,value:F},"estimateGas");return BigInt(await f.request({method:"eth_estimateGas",params:P?[N,A??f.experimental_blockTag??"latest",P]:A?[N,A]:[N]}))}catch(S){throw(0,i.getEstimateGasError)(S,{...b,account:p,chain:f.chain})}}return ns}var dm;function Yp(){if(dm)return Vi;dm=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.estimateContractGas=a;const e=He(),t=ut(),n=pr(),r=ge(),i=Cf();async function a(o,c){const{abi:u,address:d,args:l,functionName:f,dataSuffix:b,...T}=c,w=(0,t.encodeFunctionData)({abi:u,args:l,functionName:f});try{return await(0,r.getAction)(o,i.estimateGas,"estimateGas")({data:`${w}${b?b.replace("0x",""):""}`,to:d,...T})}catch(p){const O=T.account?(0,e.parseAccount)(T.account):void 0;throw(0,n.getContractError)(p,{abi:u,address:d,args:l,docsPath:"/docs/contract/estimateContractGas",functionName:f,sender:O?.address})}}return Vi}var Ss={},Is={},Bs={},Rs={},fm;function Ct(){if(fm)return Rs;fm=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.isAddressEqual=n;const e=St(),t=ct();function n(r,i){if(!(0,t.isAddress)(r,{strict:!1}))throw new e.InvalidAddressError({address:r});if(!(0,t.isAddress)(i,{strict:!1}))throw new e.InvalidAddressError({address:i});return r.toLowerCase()===i.toLowerCase()}return Rs}var Os={},lm;function ni(){if(lm)return Os;lm=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.decodeEventLog=c;const e=qe(),t=Hp(),n=st(),r=Rn(),i=hr(),a=Qt(),o="/docs/contract/decodeEventLog";function c(d){const{abi:l,data:f,strict:b,topics:T}=d,w=b??!0,[p,...O]=T;if(!p)throw new e.AbiEventSignatureEmptyTopicsError({docsPath:o});const S=l.find(B=>B.type==="event"&&p===(0,r.toEventSelector)((0,a.formatAbiItem)(B)));if(!(S&&"name"in S)||S.type!=="event")throw new e.AbiEventSignatureNotFoundError(p,{docsPath:o});const{name:m,inputs:j}=S,s=j?.some(B=>!("name"in B&&B.name)),y=s?[]:{},g=j.map((B,_)=>[B,_]).filter(([B])=>"indexed"in B&&B.indexed);for(let B=0;B!("indexed"in B&&B.indexed));if(E.length>0){if(f&&f!=="0x")try{const B=(0,i.decodeAbiParameters)(E,f);if(B)if(s)for(let _=0;_0?y:void 0}}function u({param:d,value:l}){return d.type==="string"||d.type==="bytes"||d.type==="tuple"||d.type.match(/^(.*)\[(\d+)?\]$/)?l:((0,i.decodeAbiParameters)([d],l)||[])[0]}return Os}var bm;function oi(){if(bm)return Bs;bm=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.parseEventLogs=a;const e=Ct(),t=Pe(),n=at(),r=Rn(),i=ni();function a(c){const{abi:u,args:d,logs:l,strict:f=!0}=c,b=(()=>{if(c.eventName)return Array.isArray(c.eventName)?c.eventName:[c.eventName]})();return l.map(T=>{const w=u.filter(S=>S.type==="event"&&T.topics[0]===(0,r.toEventSelector)(S));if(w.length===0)return null;let p,O;for(const S of w)try{p=(0,i.decodeEventLog)({...T,abi:[S],strict:!0}),O=S;break}catch{}if(!p&&!f){O=w[0];try{p=(0,i.decodeEventLog)({...T,abi:[O],strict:!1})}catch{const S=O.inputs?.some(m=>!("name"in m&&m.name));return{...T,args:S?[]:{},eventName:O.name}}}return!p||!O||b&&!b.includes(p.eventName)||!o({args:p.args,inputs:O.inputs,matchArgs:d})?null:{...p,...T}}).filter(Boolean)}function o(c){const{args:u,inputs:d,matchArgs:l}=c;if(!l)return!0;if(!u)return!1;function f(b,T,w){try{return b.type==="address"?(0,e.isAddressEqual)(T,w):b.type==="string"||b.type==="bytes"?(0,n.keccak256)((0,t.toBytes)(T))===w:T===w}catch{return!1}}return Array.isArray(u)&&Array.isArray(l)?l.every((b,T)=>{if(b==null)return!0;const w=d[T];return w?(Array.isArray(b)?b:[b]).some(O=>f(w,O,u[T])):!1}):typeof u=="object"&&!Array.isArray(u)&&typeof l=="object"&&!Array.isArray(l)?Object.entries(l).every(([b,T])=>{if(T==null)return!0;const w=d.find(O=>O.name===b);return w?(Array.isArray(T)?T:[T]).some(O=>f(w,O,u[b])):!1}):!1}return Bs}var Cs={},mm;function rr(){if(mm)return Cs;mm=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.formatLog=e;function e(t,{args:n,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:n,eventName:r}:{}}}return Cs}var hm;function xf(){if(hm)return Is;hm=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.getLogs=i;const e=$r(),t=oi(),n=ie(),r=rr();async function i(a,{address:o,blockHash:c,fromBlock:u,toBlock:d,event:l,events:f,args:b,strict:T}={}){const w=T??!1,p=f??(l?[l]:void 0);let O=[];p&&(O=[p.flatMap(s=>(0,e.encodeEventTopics)({abi:[s],eventName:s.name,args:f?void 0:b}))],l&&(O=O[0]));let S;c?S=await a.request({method:"eth_getLogs",params:[{address:o,topics:O,blockHash:c}]}):S=await a.request({method:"eth_getLogs",params:[{address:o,topics:O,fromBlock:typeof u=="bigint"?(0,n.numberToHex)(u):u,toBlock:typeof d=="bigint"?(0,n.numberToHex)(d):d}]});const m=S.map(j=>(0,r.formatLog)(j));return p?(0,t.parseEventLogs)({abi:p,args:b,logs:m,strict:w}):m}return Is}var ym;function qf(){if(ym)return Ss;ym=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.getContractEvents=r;const e=er(),t=ge(),n=xf();async function r(i,a){const{abi:o,address:c,args:u,blockHash:d,eventName:l,fromBlock:f,toBlock:b,strict:T}=a,w=l?(0,e.getAbiItem)({abi:o,name:l}):void 0,p=w?void 0:o.filter(O=>O.type==="event");return(0,t.getAction)(i,n.getLogs,"getLogs")({address:c,args:u,blockHash:d,event:w,events:p,fromBlock:f,toBlock:b,strict:T})}return Ss}var xs={},qs={},gm;function nr(){if(gm)return qs;gm=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.decodeFunctionResult=i;const e=qe(),t=hr(),n=er(),r="/docs/contract/decodeFunctionResult";function i(a){const{abi:o,args:c,functionName:u,data:d}=a;let l=o[0];if(u){const b=(0,n.getAbiItem)({abi:o,args:c,name:u});if(!b)throw new e.AbiFunctionNotFoundError(u,{docsPath:r});l=b}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!l.outputs)throw new e.AbiFunctionOutputsNotFoundError(l.name,{docsPath:r});const f=(0,t.decodeAbiParameters)(l.outputs,d);if(f&&f.length>1)return f;if(f&&f.length===1)return f[0]}return qs}var po={},_o={},le={},_e={},pm;function rn(){if(pm)return _e;pm=1;Object.defineProperty(_e,"__esModule",{value:!0}),_e.notImplemented=_e.bitMask=void 0,_e.isBytes=n,_e.abytes=r,_e.abool=i,_e.numberToHexUnpadded=a,_e.hexToNumber=o,_e.bytesToHex=d,_e.hexToBytes=b,_e.bytesToNumberBE=T,_e.bytesToNumberLE=w,_e.numberToBytesBE=p,_e.numberToBytesLE=O,_e.numberToVarBytesBE=S,_e.ensureBytes=m,_e.concatBytes=j,_e.equalBytes=s,_e.utf8ToBytes=y,_e.inRange=E,_e.aInRange=B,_e.bitLen=_,_e.bitGet=v,_e.bitSet=C,_e.createHmacDrbg=F,_e.validateObject=h,_e.memoized=A;const e=BigInt(0),t=BigInt(1);function n(P){return P instanceof Uint8Array||ArrayBuffer.isView(P)&&P.constructor.name==="Uint8Array"}function r(P){if(!n(P))throw new Error("Uint8Array expected")}function i(P,I){if(typeof I!="boolean")throw new Error(P+" boolean expected, got "+I)}function a(P){const I=P.toString(16);return I.length&1?"0"+I:I}function o(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);return P===""?e:BigInt("0x"+P)}const c=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",u=Array.from({length:256},(P,I)=>I.toString(16).padStart(2,"0"));function d(P){if(r(P),c)return P.toHex();let I="";for(let x=0;x=l._0&&P<=l._9)return P-l._0;if(P>=l.A&&P<=l.F)return P-(l.A-10);if(P>=l.a&&P<=l.f)return P-(l.a-10)}function b(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);if(c)return Uint8Array.fromHex(P);const I=P.length,x=I/2;if(I%2)throw new Error("hex string expected, got unpadded hex of length "+I);const N=new Uint8Array(x);for(let U=0,L=0;Utypeof P=="bigint"&&e<=P;function E(P,I,x){return g(P)&&g(I)&&g(x)&&I<=P&&Pe;P>>=t,I+=1);return I}function v(P,I){return P>>BigInt(I)&t}function C(P,I,x){return P|(x?t:e)<(t<new Uint8Array(P),H=P=>Uint8Array.from(P);function F(P,I,x){if(typeof P!="number"||P<2)throw new Error("hashLen must be a number");if(typeof I!="number"||I<2)throw new Error("qByteLen must be a number");if(typeof x!="function")throw new Error("hmacFn must be a function");let N=R(P),U=R(P),L=0;const z=()=>{N.fill(1),U.fill(0),L=0},D=(...X)=>x(U,N,...X),J=(X=R(0))=>{U=D(H([0]),X),N=D(),X.length!==0&&(U=D(H([1]),X),N=D())},Z=()=>{if(L++>=1e3)throw new Error("drbg: tried 1000 values");let X=0;const oe=[];for(;X{z(),J(X);let W;for(;!(W=oe(Z()));)J();return z(),W}}const k={bigint:P=>typeof P=="bigint",function:P=>typeof P=="function",boolean:P=>typeof P=="boolean",string:P=>typeof P=="string",stringOrUint8Array:P=>typeof P=="string"||n(P),isSafeInteger:P=>Number.isSafeInteger(P),array:P=>Array.isArray(P),field:(P,I)=>I.Fp.isValid(P),hash:P=>typeof P=="function"&&Number.isSafeInteger(P.outputLen)};function h(P,I,x={}){const N=(U,L,z)=>{const D=k[L];if(typeof D!="function")throw new Error("invalid validator function");const J=P[U];if(!(z&&J===void 0)&&!D(J,P))throw new Error("param "+String(U)+" is invalid. Expected "+L+", got "+J)};for(const[U,L]of Object.entries(I))N(U,L,!1);for(const[U,L]of Object.entries(x))N(U,L,!0);return P}const M=()=>{throw new Error("not implemented")};_e.notImplemented=M;function A(P){const I=new WeakMap;return(x,...N)=>{const U=I.get(x);if(U!==void 0)return U;const L=P(x,...N);return I.set(x,L),L}}return _e}var he={},vo={},gn={},Eo={},_m;function Bv(){return _m||(_m=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.version=void 0,Eo.version="0.1.1"),Eo}var vm;function Rv(){if(vm)return gn;vm=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.getUrl=t,gn.getVersion=n,gn.prettyPrint=r;const e=Bv();function t(i){return i}function n(){return e.version}function r(i){if(!i)return"";const a=Object.entries(i).map(([c,u])=>u===void 0||u===!1?null:[c,u]).filter(Boolean),o=a.reduce((c,[u])=>Math.max(c,u.length),0);return a.map(([c,u])=>` ${`${c}:`.padEnd(o+1)} ${u}`).join(`
+`)}return gn}var Em;function gt(){if(Em)return vo;Em=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.BaseError=void 0;const e=Rv();class t extends Error{static setStaticOptions(i){t.prototype.docsOrigin=i.docsOrigin,t.prototype.showVersion=i.showVersion,t.prototype.version=i.version}constructor(i,a={}){const o=(()=>{if(a.cause instanceof t){if(a.cause.details)return a.cause.details;if(a.cause.shortMessage)return a.cause.shortMessage}return a.cause&&"details"in a.cause&&typeof a.cause.details=="string"?a.cause.details:a.cause?.message?a.cause.message:a.details})(),c=a.cause instanceof t&&a.cause.docsPath||a.docsPath,u=a.docsOrigin??t.prototype.docsOrigin,d=`${u}${c??""}`,l=!!(a.version??t.prototype.showVersion),f=a.version??t.prototype.version,b=[i||"An error occurred.",...a.metaMessages?["",...a.metaMessages]:[],...o||c||l?["",o?`Details: ${o}`:void 0,c?`See: ${d}`:void 0,l?`Version: ${f}`:void 0]:[]].filter(T=>typeof T=="string").join(`
+`);super(b,a.cause?{cause:a.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=a.cause,this.details=o,this.docs=d,this.docsOrigin=u,this.docsPath=c,this.shortMessage=i,this.showVersion=l,this.version=f}walk(i){return n(this,i)}}vo.BaseError=t,Object.defineProperty(t,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${(0,e.getVersion)()}`}}),t.setStaticOptions(t.defaultStaticOptions);function n(r,i){return i?.(r)?r:r&&typeof r=="object"&&"cause"in r&&r.cause?n(r.cause,i):i?null:r}return vo}var Kd={},wm;function Jp(){return wm||(wm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeMap=void 0,e.assertSize=n,e.assertStartOffset=r,e.assertEndOffset=i,e.charCodeToBase16=a,e.pad=o,e.trim=c;const t=Mt();function n(u,d){if(t.size(u)>d)throw new t.SizeOverflowError({givenSize:t.size(u),maxSize:d})}function r(u,d){if(typeof d=="number"&&d>0&&d>t.size(u)-1)throw new t.SliceOffsetOutOfBoundsError({offset:d,position:"start",size:t.size(u)})}function i(u,d,l){if(typeof d=="number"&&typeof l=="number"&&t.size(u)!==l-d)throw new t.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:t.size(u)})}e.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function a(u){if(u>=e.charCodeMap.zero&&u<=e.charCodeMap.nine)return u-e.charCodeMap.zero;if(u>=e.charCodeMap.A&&u<=e.charCodeMap.F)return u-(e.charCodeMap.A-10);if(u>=e.charCodeMap.a&&u<=e.charCodeMap.f)return u-(e.charCodeMap.a-10)}function o(u,d={}){const{dir:l,size:f=32}=d;if(f===0)return u;if(u.length>f)throw new t.SizeExceedsPaddingSizeError({size:u.length,targetSize:f,type:"Bytes"});const b=new Uint8Array(f);for(let T=0;Tc)throw new e.SizeOverflowError({givenSize:e.size(o),maxSize:c})}function n(o,c){if(typeof c=="number"&&c>0&&c>e.size(o)-1)throw new e.SliceOffsetOutOfBoundsError({offset:c,position:"start",size:e.size(o)})}function r(o,c,u){if(typeof c=="number"&&typeof u=="number"&&e.size(o)!==u-c)throw new e.SliceOffsetOutOfBoundsError({offset:u,position:"end",size:e.size(o)})}function i(o,c={}){const{dir:u,size:d=32}=c;if(d===0)return o;const l=o.replace("0x","");if(l.length>d*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(l.length/2),targetSize:d,type:"Hex"});return`0x${l[u==="right"?"padEnd":"padStart"](d*2,"0")}`}function a(o,c={}){const{dir:u="left"}=c;let d=o.replace("0x",""),l=0;for(let f=0;f{const c=o;return typeof c=="string"&&c.endsWith(e)?BigInt(c.slice(0,-e.length)):typeof i=="function"?i(a,c):c})}function n(r,i,a){return JSON.stringify(r,(o,c)=>typeof i=="function"?i(o,c):typeof c=="bigint"?c.toString()+e:c,a)}return wo}var Am;function Mt(){if(Am)return he;Am=1,Object.defineProperty(he,"__esModule",{value:!0}),he.SizeExceedsPaddingSizeError=he.SliceOffsetOutOfBoundsError=he.SizeOverflowError=he.InvalidBytesTypeError=he.InvalidBytesBooleanError=void 0,he.assert=u,he.concat=d,he.from=l,he.fromArray=f,he.fromBoolean=b,he.fromHex=T,he.fromNumber=w,he.fromString=p,he.isEqual=O,he.padLeft=S,he.padRight=m,he.random=j,he.size=s,he.slice=y,he.toBigInt=g,he.toBoolean=E,he.toHex=B,he.toNumber=_,he.toString=v,he.trimLeft=C,he.trimRight=q,he.validate=R;const e=rn(),t=gt(),n=We(),r=Jp(),i=Xp(),a=ed(),o=new TextDecoder,c=new TextEncoder;function u(A){if(!(A instanceof Uint8Array)){if(!A)throw new F(A);if(typeof A!="object")throw new F(A);if(!("BYTES_PER_ELEMENT"in A))throw new F(A);if(A.BYTES_PER_ELEMENT!==1||A.constructor.name!=="Uint8Array")throw new F(A)}}function d(...A){let P=0;for(const x of A)P+=x.length;const I=new Uint8Array(P);for(let x=0,N=0;x1||x[0]>1)throw new H(x);return!!x[0]}function B(A,P={}){return n.fromBytes(A,P)}function _(A,P={}){const{size:I}=P;typeof I<"u"&&r.assertSize(A,I);const x=n.fromBytes(A,P);return n.toNumber(x,P)}function v(A,P={}){const{size:I}=P;let x=A;return typeof I<"u"&&(r.assertSize(x,I),x=q(x)),o.decode(x)}function C(A){return r.trim(A,{dir:"left"})}function q(A){return r.trim(A,{dir:"right"})}function R(A){try{return u(A),!0}catch{return!1}}class H extends t.BaseError{constructor(P){super(`Bytes value \`${P}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}he.InvalidBytesBooleanError=H;class F extends t.BaseError{constructor(P){super(`Value \`${typeof P=="object"?a.stringify(P):P}\` of type \`${typeof P}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}he.InvalidBytesTypeError=F;class k extends t.BaseError{constructor({givenSize:P,maxSize:I}){super(`Size cannot exceed \`${I}\` bytes. Given size: \`${P}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}he.SizeOverflowError=k;class h extends t.BaseError{constructor({offset:P,position:I,size:x}){super(`Slice ${I==="start"?"starting":"ending"} at offset \`${P}\` is out-of-bounds (size: \`${x}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}he.SliceOffsetOutOfBoundsError=h;class M extends t.BaseError{constructor({size:P,targetSize:I,type:x}){super(`${x.charAt(0).toUpperCase()}${x.slice(1).toLowerCase()} size (\`${P}\`) exceeds padding size (\`${I}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return he.SizeExceedsPaddingSizeError=M,he}var Tm;function We(){if(Tm)return le;Tm=1,Object.defineProperty(le,"__esModule",{value:!0}),le.SizeExceedsPaddingSizeError=le.SliceOffsetOutOfBoundsError=le.SizeOverflowError=le.InvalidLengthError=le.InvalidHexValueError=le.InvalidHexTypeError=le.InvalidHexBooleanError=le.IntegerOutOfRangeError=void 0,le.assert=u,le.concat=d,le.from=l,le.fromBoolean=f,le.fromBytes=b,le.fromNumber=T,le.fromString=w,le.isEqual=p,le.padLeft=O,le.padRight=S,le.random=m,le.slice=j,le.size=s,le.trimLeft=y,le.trimRight=g,le.toBigInt=E,le.toBoolean=B,le.toBytes=_,le.toNumber=v,le.toString=C,le.validate=q;const e=rn(),t=Mt(),n=gt(),r=Jp(),i=Xp(),a=ed(),o=new TextEncoder,c=Array.from({length:256},(I,x)=>x.toString(16).padStart(2,"0"));function u(I,x={}){const{strict:N=!1}=x;if(!I)throw new F(I);if(typeof I!="string")throw new F(I);if(N&&!/^0x[0-9a-fA-F]*$/.test(I))throw new k(I);if(!I.startsWith("0x"))throw new k(I)}function d(...I){return`0x${I.reduce((x,N)=>x+N.replace("0x",""),"")}`}function l(I){return I instanceof Uint8Array?b(I):Array.isArray(I)?b(new Uint8Array(I)):I}function f(I,x={}){const N=`0x${Number(I)}`;return typeof x.size=="number"?(i.assertSize(N,x.size),O(N,x.size)):N}function b(I,x={}){let N="";for(let L=0;Lz||L>1n;return U<=D?U:U-z-1n}function B(I,x={}){x.size&&i.assertSize(I,x.size);const N=y(I);if(N==="0x")return!1;if(N==="0x1")return!0;throw new H(I)}function _(I,x={}){return t.fromHex(I,x)}function v(I,x={}){const{signed:N,size:U}=x;return Number(!N&&!U?I:E(I,x))}function C(I,x={}){const{size:N}=x;let U=t.fromHex(I);return N&&(r.assertSize(U,N),U=t.trimRight(U)),new TextDecoder().decode(U)}function q(I,x={}){const{strict:N=!1}=x;try{return u(I,{strict:N}),!0}catch{return!1}}class R extends n.BaseError{constructor({max:x,min:N,signed:U,size:L,value:z}){super(`Number \`${z}\` is not in safe${L?` ${L*8}-bit`:""}${U?" signed":" unsigned"} integer range ${x?`(\`${N}\` to \`${x}\`)`:`(above \`${N}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}le.IntegerOutOfRangeError=R;class H extends n.BaseError{constructor(x){super(`Hex value \`"${x}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}}le.InvalidHexBooleanError=H;class F extends n.BaseError{constructor(x){super(`Value \`${typeof x=="object"?a.stringify(x):x}\` of type \`${typeof x}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}le.InvalidHexTypeError=F;class k extends n.BaseError{constructor(x){super(`Value \`${x}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}le.InvalidHexValueError=k;class h extends n.BaseError{constructor(x){super(`Hex value \`"${x}"\` is an odd length (${x.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}le.InvalidLengthError=h;class M extends n.BaseError{constructor({givenSize:x,maxSize:N}){super(`Size cannot exceed \`${N}\` bytes. Given size: \`${x}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}le.SizeOverflowError=M;class A extends n.BaseError{constructor({offset:x,position:N,size:U}){super(`Slice ${N==="start"?"starting":"ending"} at offset \`${x}\` is out-of-bounds (size: \`${U}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}le.SliceOffsetOutOfBoundsError=A;class P extends n.BaseError{constructor({size:x,targetSize:N,type:U}){super(`${U.charAt(0).toUpperCase()}${U.slice(1).toLowerCase()} size (\`${x}\`) exceeds padding size (\`${N}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return le.SizeExceedsPaddingSizeError=P,le}var jo={},Sm;function Ov(){if(Sm)return jo;Sm=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.fromRpc=t,jo.toRpc=n;const e=We();function t(r){return{...r,amount:BigInt(r.amount),index:Number(r.index),validatorIndex:Number(r.validatorIndex)}}function n(r){return{address:r.address,amount:e.fromNumber(r.amount),index:e.fromNumber(r.index),validatorIndex:e.fromNumber(r.validatorIndex)}}return jo}var Im;function Qp(){if(Im)return _o;Im=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.fromRpc=n,_o.toRpc=r;const e=We(),t=Ov();function n(i){return{...i.baseFeePerGas&&{baseFeePerGas:BigInt(i.baseFeePerGas)},...i.blobBaseFee&&{blobBaseFee:BigInt(i.blobBaseFee)},...i.feeRecipient&&{feeRecipient:i.feeRecipient},...i.gasLimit&&{gasLimit:BigInt(i.gasLimit)},...i.number&&{number:BigInt(i.number)},...i.prevRandao&&{prevRandao:BigInt(i.prevRandao)},...i.time&&{time:BigInt(i.time)},...i.withdrawals&&{withdrawals:i.withdrawals.map(t.fromRpc)}}}function r(i){return{...typeof i.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(i.baseFeePerGas)},...typeof i.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(i.blobBaseFee)},...typeof i.feeRecipient=="string"&&{feeRecipient:i.feeRecipient},...typeof i.gasLimit=="bigint"&&{gasLimit:e.fromNumber(i.gasLimit)},...typeof i.number=="bigint"&&{number:e.fromNumber(i.number)},...typeof i.prevRandao=="bigint"&&{prevRandao:e.fromNumber(i.prevRandao)},...typeof i.time=="bigint"&&{time:e.fromNumber(i.time)},...i.withdrawals&&{withdrawals:i.withdrawals.map(t.toRpc)}}}return _o}var ve={},Bm;function wr(){if(Bm)return ve;Bm=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.erc4626Abi=ve.erc721Abi=ve.erc1155Abi=ve.erc20Abi_bytes32=ve.erc20Abi=ve.erc6492SignatureValidatorAbi=ve.erc1271Abi=ve.addressResolverAbi=ve.textResolverAbi=ve.universalResolverReverseAbi=ve.universalResolverResolveAbi=ve.batchGatewayAbi=ve.multicall3Abi=void 0,ve.multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ve.batchGatewayAbi=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}];const e=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}];return ve.universalResolverResolveAbi=[...e,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],ve.universalResolverReverseAbi=[...e,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],ve.textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ve.addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],ve.erc1271Abi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],ve.erc6492SignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],ve.erc20Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],ve.erc20Abi_bytes32=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],ve.erc1155Abi=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],ve.erc721Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],ve.erc4626Abi=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}],ve}var Po={},Rm;function Cv(){return Rm||(Rm=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.aggregate3Signature=void 0,Po.aggregate3Signature="0x82ad56cb"),Po}var jt={},Om;function ii(){return Om||(Om=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.multicall3Bytecode=jt.erc6492SignatureValidatorByteCode=jt.deploylessCallViaFactoryBytecode=jt.deploylessCallViaBytecodeBytecode=void 0,jt.deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",jt.deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",jt.erc6492SignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",jt.multicall3Bytecode="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"),jt}var bt={},Cm;function si(){if(Cm)return bt;Cm=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.InvalidChainIdError=bt.ClientChainNotConfiguredError=bt.ChainNotFoundError=bt.ChainMismatchError=bt.ChainDoesNotSupportContract=void 0;const e=fe();class t extends e.BaseError{constructor({blockNumber:c,chain:u,contract:d}){super(`Chain "${u.name}" does not support contract "${d.name}".`,{metaMessages:["This could be due to any of the following:",...c&&d.blockCreated&&d.blockCreated>c?[`- The contract "${d.name}" was not deployed until block ${d.blockCreated} (current block ${c}).`]:[`- The chain does not have the contract "${d.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}bt.ChainDoesNotSupportContract=t;class n extends e.BaseError{constructor({chain:c,currentChainId:u}){super(`The current chain of the wallet (id: ${u}) does not match the target chain for the transaction (id: ${c.id} – ${c.name}).`,{metaMessages:[`Current Chain ID: ${u}`,`Expected Chain ID: ${c.id} – ${c.name}`],name:"ChainMismatchError"})}}bt.ChainMismatchError=n;class r extends e.BaseError{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
+`),{name:"ChainNotFoundError"})}}bt.ChainNotFoundError=r;class i extends e.BaseError{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}bt.ClientChainNotConfiguredError=i;class a extends e.BaseError{constructor({chainId:c}){super(typeof c=="number"?`Chain ID "${c}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}return bt.InvalidChainIdError=a,bt}var Hs={},xm;function ai(){if(xm)return Hs;xm=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.encodeDeployData=i;const e=qe(),t=De(),n=It(),r="/docs/contract/encodeDeployData";function i(a){const{abi:o,args:c,bytecode:u}=a;if(!c||c.length===0)return u;const d=o.find(f=>"type"in f&&f.type==="constructor");if(!d)throw new e.AbiConstructorNotFoundError({docsPath:r});if(!("inputs"in d))throw new e.AbiConstructorParamsNotFoundError({docsPath:r});if(!d.inputs||d.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:r});const l=(0,n.encodeAbiParameters)(d.inputs,c);return(0,t.concatHex)([u,l])}return Hs}var Ms={},qm;function jr(){if(qm)return Ms;qm=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.getChainContractAddress=t;const e=si();function t({blockNumber:n,chain:r,contract:i}){const a=r?.contracts?.[i];if(!a)throw new e.ChainDoesNotSupportContract({chain:r,contract:{name:i}});if(n&&a.blockCreated&&a.blockCreated>n)throw new e.ChainDoesNotSupportContract({blockNumber:n,chain:r,contract:{name:i,blockCreated:a.blockCreated}});return a.address}return Ms}var ks={},Hm;function Hf(){if(Hm)return ks;Hm=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.getCallError=r;const e=yr(),t=tr(),n=Qo();function r(i,{docsPath:a,...o}){const c=(()=>{const u=(0,n.getNodeError)(i,o);return u instanceof t.UnknownNodeError?i:u})();return new e.CallExecutionError(c,{docsPath:a,...o})}return ks}var Ns={},Fs={},Mm;function Mf(){if(Mm)return Fs;Mm=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.withResolvers=e;function e(){let t=()=>{},n=()=>{};return{promise:new Promise((i,a)=>{t=i,n=a}),resolve:t,reject:n}}return Fs}var km;function kf(){if(km)return Ns;km=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.createBatchScheduler=n;const e=Mf(),t=new Map;function n({fn:r,id:i,shouldSplitBatch:a,wait:o=0,sort:c}){const u=async()=>{const T=f();d();const w=T.map(({args:p})=>p);w.length!==0&&r(w).then(p=>{c&&Array.isArray(p)&&p.sort(c);for(let O=0;O{for(let O=0;Ot.delete(i),l=()=>f().map(({args:T})=>T),f=()=>t.get(i)||[],b=T=>t.set(i,[...f(),T]);return{flush:d,async schedule(T){const{promise:w,resolve:p,reject:O}=(0,e.withResolvers)();return a?.([...l(),T])&&u(),f().length>0?(b({args:T,resolve:p,reject:O}),w):(b({args:T,resolve:p,reject:O}),setTimeout(u,o),w)}}}return Ns}var Zd={},Jt={},Nm;function xv(){if(Nm)return Jt;Nm=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.OffchainLookupSenderMismatchError=Jt.OffchainLookupResponseMalformedError=Jt.OffchainLookupError=void 0;const e=Ve(),t=fe(),n=wf();class r extends t.BaseError{constructor({callbackSelector:c,cause:u,data:d,extraData:l,sender:f,urls:b}){super(u.shortMessage||"An error occurred while fetching for an offchain result.",{cause:u,metaMessages:[...u.metaMessages||[],u.metaMessages?.length?"":[],"Offchain Gateway Call:",b&&[" Gateway URL(s):",...b.map(T=>` ${(0,n.getUrl)(T)}`)],` Sender: ${f}`,` Data: ${d}`,` Callback selector: ${c}`,` Extra data: ${l}`].flat(),name:"OffchainLookupError"})}}Jt.OffchainLookupError=r;class i extends t.BaseError{constructor({result:c,url:u}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,n.getUrl)(u)}`,`Response: ${(0,e.stringify)(c)}`],name:"OffchainLookupResponseMalformedError"})}}Jt.OffchainLookupResponseMalformedError=i;class a extends t.BaseError{constructor({sender:c,to:u}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${u}`,`OffchainLookup sender address: ${c}`],name:"OffchainLookupSenderMismatchError"})}}return Jt.OffchainLookupSenderMismatchError=a,Jt}var Yd={},Ls={},Fm;function Nf(){if(Fm)return Ls;Fm=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.decodeFunctionData=a;const e=qe(),t=vt(),n=Qr(),r=hr(),i=Qt();function a(o){const{abi:c,data:u}=o,d=(0,t.slice)(u,0,4),l=c.find(f=>f.type==="function"&&d===(0,n.toFunctionSelector)((0,i.formatAbiItem)(f)));if(!l)throw new e.AbiFunctionSignatureNotFoundError(d,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,r.decodeAbiParameters)(l.inputs,(0,t.slice)(u,4)):void 0}}return Ls}var Us={},Lm;function Ff(){if(Lm)return Us;Lm=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.encodeErrorResult=c;const e=qe(),t=De(),n=Qr(),r=It(),i=Qt(),a=er(),o="/docs/contract/encodeErrorResult";function c(u){const{abi:d,errorName:l,args:f}=u;let b=d[0];if(l){const O=(0,a.getAbiItem)({abi:d,args:f,name:l});if(!O)throw new e.AbiErrorNotFoundError(l,{docsPath:o});b=O}if(b.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:o});const T=(0,i.formatAbiItem)(b),w=(0,n.toFunctionSelector)(T);let p="0x";if(f&&f.length>0){if(!b.inputs)throw new e.AbiErrorInputsNotFoundError(b.name,{docsPath:o});p=(0,r.encodeAbiParameters)(b.inputs,f)}return(0,t.concatHex)([w,p])}return Us}var zs={},Um;function Lf(){if(Um)return zs;Um=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.encodeFunctionResult=i;const e=qe(),t=It(),n=er(),r="/docs/contract/encodeFunctionResult";function i(a){const{abi:o,functionName:c,result:u}=a;let d=o[0];if(c){const f=(0,n.getAbiItem)({abi:o,name:c});if(!f)throw new e.AbiFunctionNotFoundError(c,{docsPath:r});d=f}if(d.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!d.outputs)throw new e.AbiFunctionOutputsNotFoundError(d.name,{docsPath:r});const l=(()=>{if(d.outputs.length===0)return[];if(d.outputs.length===1)return[u];if(Array.isArray(u))return u;throw new e.InvalidArrayError(u)})();return(0,t.encodeAbiParameters)(d.outputs,l)}return zs}var zm;function td(){return zm||(zm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localBatchGatewayUrl=void 0,e.localBatchGatewayRequest=o;const t=wr(),n=_f(),r=Nf(),i=Ff(),a=Lf();e.localBatchGatewayUrl="x-batch-gateway:true";async function o(u){const{data:d,ccipRequest:l}=u,{args:[f]}=(0,r.decodeFunctionData)({abi:t.batchGatewayAbi,data:d}),b=[],T=[];return await Promise.all(f.map(async(w,p)=>{try{T[p]=w.urls.includes(e.localBatchGatewayUrl)?await o({data:w.data,ccipRequest:l}):await l(w),b[p]=!1}catch(O){b[p]=!0,T[p]=c(O)}})),(0,a.encodeFunctionResult)({abi:t.batchGatewayAbi,functionName:"query",result:[b,T]})}function c(u){return u.name==="HttpRequestError"&&u.status?(0,i.encodeErrorResult)({abi:t.batchGatewayAbi,errorName:"HttpError",args:[u.status,u.shortMessage]}):(0,i.encodeErrorResult)({abi:[n.solidityError],errorName:"Error",args:["shortMessage"in u?u.shortMessage:u.message]})}})(Yd)),Yd}var Dm;function Uf(){return Dm||(Dm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.offchainLookupAbiItem=e.offchainLookupSignature=void 0,e.offchainLookup=f,e.ccipRequest=b;const t=ci(),n=xv(),r=Bt(),i=Vu(),a=It(),o=Ct(),c=De(),u=nt(),d=td(),l=Ve();e.offchainLookupSignature="0x556f1830",e.offchainLookupAbiItem={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function f(T,{blockNumber:w,blockTag:p,data:O,to:S}){const{args:m}=(0,i.decodeErrorResult)({data:O,abi:[e.offchainLookupAbiItem]}),[j,s,y,g,E]=m,{ccipRead:B}=T,_=B&&typeof B?.request=="function"?B.request:b;try{if(!(0,o.isAddressEqual)(S,j))throw new n.OffchainLookupSenderMismatchError({sender:j,to:S});const v=s.includes(d.localBatchGatewayUrl)?await(0,d.localBatchGatewayRequest)({data:y,ccipRequest:_}):await _({data:y,sender:j,urls:s}),{data:C}=await(0,t.call)(T,{blockNumber:w,blockTag:p,data:(0,c.concat)([g,(0,a.encodeAbiParameters)([{type:"bytes"},{type:"bytes"}],[v,E])]),to:S});return C}catch(v){throw new n.OffchainLookupError({callbackSelector:g,cause:v,data:O,extraData:E,sender:j,urls:s})}}async function b({data:T,sender:w,urls:p}){let O=new Error("An unknown error occurred.");for(let S=0;S{const Te=[Ae,ee];return be&&Q?[...Te,be,Q]:be?[...Te,be]:Q?[...Te,{},Q]:Te})(),Me=await v.request({method:"eth_call",params:Xe});return Me==="0x"?{data:void 0}:{data:Me}}catch(se){const ee=_(se),{offchainLookup:Q,offchainLookupSignature:be}=await Promise.resolve().then(()=>Uf());if(v.ccipRead!==!1&&ee?.slice(0,10)===be&&Y)return{data:await Q(v,{data:ee,to:Y})};throw te&&ee?.slice(0,10)==="0x101bb98d"?new u.CounterfactualDeploymentFailedError({factory:x}):(0,w.getCallError)(se,{...C,account:K,chain:v.chain})}}function y({request:v}){const{data:C,to:q,...R}=v;return!(!C||C.startsWith(i.aggregate3Signature)||!q||Object.values(R).filter(H=>typeof H<"u").length>0)}async function g(v,C){const{batchSize:q=1024,deployless:R=!1,wait:H=0}=typeof v.batch?.multicall=="object"?v.batch.multicall:{},{blockNumber:F,blockTag:k=v.experimental_blockTag??"latest",data:h,to:M}=C,A=(()=>{if(R)return null;if(C.multicallAddress)return C.multicallAddress;if(v.chain)return(0,b.getChainContractAddress)({blockNumber:F,chain:v.chain,contract:"multicall3"});throw new c.ClientChainNotConfiguredError})(),I=(typeof F=="bigint"?(0,T.numberToHex)(F):void 0)||k,{schedule:x}=(0,S.createBatchScheduler)({id:`${v.uid}.${I}`,wait:H,shouldSplitBatch(L){return L.reduce((D,{data:J})=>D+(J.length-2),0)>q*2},fn:async L=>{const z=L.map(Z=>({allowFailure:!0,callData:Z.data,target:Z.to})),D=(0,f.encodeFunctionData)({abi:r.multicall3Abi,args:[z],functionName:"aggregate3"}),J=await v.request({method:"eth_call",params:[{...A===null?{data:E({code:a.multicall3Bytecode,data:D})}:{to:A,data:D}},I]});return(0,d.decodeFunctionResult)({abi:r.multicall3Abi,args:[z],functionName:"aggregate3",data:J||"0x"})}}),[{returnData:N,success:U}]=await x({data:h,to:M});if(!U)throw new u.RawContractError({data:N});return N==="0x"?{data:void 0}:{data:N}}function E(v){const{code:C,data:q}=v;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(bytes, bytes)"]),bytecode:a.deploylessCallViaBytecodeBytecode,args:[C,q]})}function B(v){const{data:C,factory:q,factoryData:R,to:H}=v;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(address, bytes, address, bytes)"]),bytecode:a.deploylessCallViaFactoryBytecode,args:[H,C,q,R]})}function _(v){if(!(v instanceof o.BaseError))return;const C=v.walk();return typeof C?.data=="object"?C.data?.data:C.data}return po}var Vm;function kt(){if(Vm)return xs;Vm=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.readContract=a;const e=nr(),t=ut(),n=pr(),r=ge(),i=ci();async function a(o,c){const{abi:u,address:d,args:l,functionName:f,...b}=c,T=(0,t.encodeFunctionData)({abi:u,args:l,functionName:f});try{const{data:w}=await(0,r.getAction)(o,i.call,"call")({...b,data:T,to:d});return(0,e.decodeFunctionResult)({abi:u,args:l,functionName:f,data:w||"0x"})}catch(w){throw(0,n.getContractError)(w,{abi:u,address:d,args:l,docsPath:"/docs/contract/readContract",functionName:f})}}return xs}var Ds={},Wm;function $p(){if(Wm)return Ds;Wm=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.simulateContract=o;const e=He(),t=nr(),n=ut(),r=pr(),i=ge(),a=ci();async function o(c,u){const{abi:d,address:l,args:f,dataSuffix:b,functionName:T,...w}=u,p=w.account?(0,e.parseAccount)(w.account):c.account,O=(0,n.encodeFunctionData)({abi:d,args:f,functionName:T});try{const{data:S}=await(0,i.getAction)(c,a.call,"call")({batch:!1,data:`${O}${b?b.replace("0x",""):""}`,to:l,...w,account:p}),m=(0,t.decodeFunctionResult)({abi:d,args:f,functionName:T,data:S||"0x"}),j=d.filter(s=>"name"in s&&s.name===u.functionName);return{result:m,request:{abi:j,address:l,args:f,dataSuffix:b,functionName:T,...w,account:p}}}catch(S){throw(0,r.getContractError)(S,{abi:d,address:l,args:f,docsPath:"/docs/contract/simulateContract",functionName:T,sender:p?.address})}}return Ds}var Gs={},Jd={},Km;function nn(){return Km||(Km=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.cleanupCache=e.listenersCache=void 0,e.observe=n,e.listenersCache=new Map,e.cleanupCache=new Map;let t=0;function n(r,i,a){const o=++t,c=()=>e.listenersCache.get(r)||[],u=()=>{const T=c();e.listenersCache.set(r,T.filter(w=>w.id!==o))},d=()=>{const T=c();if(!T.some(p=>p.id===o))return;const w=e.cleanupCache.get(r);if(T.length===1&&w){const p=w();p instanceof Promise&&p.catch(()=>{})}u()},l=c();if(e.listenersCache.set(r,[...l,{id:o,fns:i}]),l&&l.length>0)return d;const f={};for(const T in i)f[T]=((...w)=>{const p=c();if(p.length!==0)for(const O of p)O.fns[T]?.(...w)});const b=a(f);return typeof b=="function"&&e.cleanupCache.set(r,b),d}})(Jd)),Jd}var Vs={},Ws={},Zm;function zf(){if(Zm)return Ws;Zm=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.wait=e;async function e(t){return new Promise(n=>setTimeout(n,t))}return Ws}var Ym;function Cn(){if(Ym)return Vs;Ym=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.poll=t;const e=zf();function t(n,{emitOnBegin:r,initialWaitTime:i,interval:a}){let o=!0;const c=()=>o=!1;return(async()=>{let d;r&&(d=await n({unpoll:c}));const l=await i?.(d)??a;await(0,e.wait)(l);const f=async()=>{o&&(await n({unpoll:c}),await(0,e.wait)(a),f())};f()})(),c}return Vs}var Ao={},Xd={},Jm;function e_(){return Jm||(Jm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.responseCache=e.promiseCache=void 0,e.getCache=t,e.withCache=n,e.promiseCache=new Map,e.responseCache=new Map;function t(r){const i=(c,u)=>({clear:()=>u.delete(c),get:()=>u.get(c),set:d=>u.set(c,d)}),a=i(r,e.promiseCache),o=i(r,e.responseCache);return{clear:()=>{a.clear(),o.clear()},promise:a,response:o}}async function n(r,{cacheKey:i,cacheTime:a=Number.POSITIVE_INFINITY}){const o=t(i),c=o.response.get();if(c&&a>0&&Date.now()-c.created.getTime()`blockNumber.${i}`;function n(i){return(0,e.getCache)(t(i))}async function r(i,{cacheTime:a=i.cacheTime}={}){const o=await(0,e.withCache)(()=>i.request({method:"eth_blockNumber"}),{cacheKey:t(i.uid),cacheTime:a});return BigInt(o)}return Ao}var Ks={},Qm;function rd(){if(Qm)return Ks;Qm=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.getFilterChanges=n;const e=oi(),t=rr();async function n(r,{filter:i}){const a="strict"in i&&i.strict,o=await i.request({method:"eth_getFilterChanges",params:[i.id]});if(typeof o[0]=="string")return o;const c=o.map(u=>(0,t.formatLog)(u));return!("abi"in i)||!i.abi?c:(0,e.parseEventLogs)({abi:i.abi,logs:c,strict:a})}return Ks}var Zs={},$m;function nd(){if($m)return Zs;$m=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.uninstallFilter=e;async function e(t,{filter:n}){return n.request({method:"eth_uninstallFilter",params:[n.id]})}return Zs}var eh;function t_(){if(eh)return Gs;eh=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.watchContractEvent=w;const e=qe(),t=gr(),n=ni(),r=$r(),i=rr(),a=ge(),o=nn(),c=Cn(),u=Ve(),d=pf(),l=ui(),f=qf(),b=rd(),T=nd();function w(p,O){const{abi:S,address:m,args:j,batch:s=!0,eventName:y,fromBlock:g,onError:E,onLogs:B,poll:_,pollingInterval:v=p.pollingInterval,strict:C}=O;return(typeof _<"u"?_:typeof g=="bigint"?!0:!(p.transport.type==="webSocket"||p.transport.type==="ipc"||p.transport.type==="fallback"&&(p.transport.transports[0].config.type==="webSocket"||p.transport.transports[0].config.type==="ipc")))?(()=>{const F=C??!1,k=(0,u.stringify)(["watchContractEvent",m,j,s,p.uid,y,v,F,g]);return(0,o.observe)(k,{onLogs:B,onError:E},h=>{let M;g!==void 0&&(M=g-1n);let A,P=!1;const I=(0,c.poll)(async()=>{if(!P){try{A=await(0,a.getAction)(p,d.createContractEventFilter,"createContractEventFilter")({abi:S,address:m,args:j,eventName:y,strict:F,fromBlock:g})}catch{}P=!0;return}try{let x;if(A)x=await(0,a.getAction)(p,b.getFilterChanges,"getFilterChanges")({filter:A});else{const N=await(0,a.getAction)(p,l.getBlockNumber,"getBlockNumber")({});M&&M{A&&await(0,a.getAction)(p,T.uninstallFilter,"uninstallFilter")({filter:A}),I()}})})():(()=>{const F=C??!1,k=(0,u.stringify)(["watchContractEvent",m,j,s,p.uid,y,v,F]);let h=!0,M=()=>h=!1;return(0,o.observe)(k,{onLogs:B,onError:E},A=>((async()=>{try{const P=(()=>{if(p.transport.type==="fallback"){const N=p.transport.transports.find(U=>U.config.type==="webSocket"||U.config.type==="ipc");return N?N.value:p.transport}return p.transport})(),I=y?(0,r.encodeEventTopics)({abi:S,eventName:y,args:j}):[],{unsubscribe:x}=await P.subscribe({params:["logs",{address:m,topics:I}],onData(N){if(!h)return;const U=N.result;try{const{eventName:L,args:z}=(0,n.decodeEventLog)({abi:S,data:U.data,topics:U.topics,strict:C}),D=(0,i.formatLog)(U,{args:z,eventName:L});A.onLogs([D])}catch(L){let z,D;if(L instanceof e.DecodeLogDataMismatch||L instanceof e.DecodeLogTopicsMismatch){if(C)return;z=L.abiItem.name,D=L.abiItem.inputs?.some(Z=>!("name"in Z&&Z.name))}const J=(0,i.formatLog)(U,{args:D?[]:{},eventName:z});A.onLogs([J])}},onError(N){A.onError?.(N)}});M=x,h||M()}catch(P){E?.(P)}})(),()=>M()))})()}return Gs}var To={},Mr={},th;function Pr(){if(th)return Mr;th=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.AccountTypeNotSupportedError=Mr.AccountNotFoundError=void 0;const e=fe();class t extends e.BaseError{constructor({docsPath:i}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
+`),{docsPath:i,docsSlug:"account",name:"AccountNotFoundError"})}}Mr.AccountNotFoundError=t;class n extends e.BaseError{constructor({docsPath:i,metaMessages:a,type:o}){super(`Account type "${o}" is not supported.`,{docsPath:i,metaMessages:a,name:"AccountTypeNotSupportedError"})}}return Mr.AccountTypeNotSupportedError=n,Mr}var Ys={},Js={},rh;function di(){if(rh)return Js;rh=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.assertCurrentChain=t;const e=si();function t({chain:n,currentChainId:r}){if(!n)throw new e.ChainNotFoundError;if(r!==n.id)throw new e.ChainMismatchError({chain:n,currentChainId:r})}return Js}var Xs={},nh;function Df(){if(nh)return Xs;nh=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.sendRawTransaction=e;async function e(t,{serializedTransaction:n}){return t.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}return Xs}var oh;function od(){if(oh)return Ys;oh=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.sendTransaction=p;const e=He(),t=Pr(),n=fe(),r=Xo(),i=di(),a=ti(),o=vr(),c=Rt(),u=ge(),d=Xr(),l=Ot(),f=Er(),b=ri(),T=Df(),w=new d.LruMap(128);async function p(O,S){const{account:m=O.account,chain:j=O.chain,accessList:s,authorizationList:y,blobs:g,data:E,gas:B,gasPrice:_,maxFeePerBlobGas:v,maxFeePerGas:C,maxPriorityFeePerGas:q,nonce:R,type:H,value:F,...k}=S;if(typeof m>"u")throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const h=m?(0,e.parseAccount)(m):null;try{(0,l.assertRequest)(S);const M=await(async()=>{if(S.to)return S.to;if(S.to!==null&&y&&y.length>0)return await(0,r.recoverAuthorizationAddress)({authorization:y[0]}).catch(()=>{throw new n.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(h?.type==="json-rpc"||h===null){let A;j!==null&&(A=await(0,u.getAction)(O,f.getChainId,"getChainId")({}),(0,i.assertCurrentChain)({currentChainId:A,chain:j}));const P=O.chain?.formatters?.transactionRequest?.format,x=(P||c.formatTransactionRequest)({...(0,o.extract)(k,{format:P}),accessList:s,account:h,authorizationList:y,blobs:g,chainId:A,data:E,gas:B,gasPrice:_,maxFeePerBlobGas:v,maxFeePerGas:C,maxPriorityFeePerGas:q,nonce:R,to:M,type:H,value:F},"sendTransaction"),N=w.get(O.uid),U=N?"wallet_sendTransaction":"eth_sendTransaction";try{return await O.request({method:U,params:[x]},{retryCount:0})}catch(L){if(N===!1)throw L;const z=L;if(z.name==="InvalidInputRpcError"||z.name==="InvalidParamsRpcError"||z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError")return await O.request({method:"wallet_sendTransaction",params:[x]},{retryCount:0}).then(D=>(w.set(O.uid,!0),D)).catch(D=>{const J=D;throw J.name==="MethodNotFoundRpcError"||J.name==="MethodNotSupportedRpcError"?(w.set(O.uid,!1),z):J});throw z}}if(h?.type==="local"){const A=await(0,u.getAction)(O,b.prepareTransactionRequest,"prepareTransactionRequest")({account:h,accessList:s,authorizationList:y,blobs:g,chain:j,data:E,gas:B,gasPrice:_,maxFeePerBlobGas:v,maxFeePerGas:C,maxPriorityFeePerGas:q,nonce:R,nonceManager:h.nonceManager,parameters:[...b.defaultParameters,"sidecars"],type:H,value:F,...k,to:M}),P=j?.serializers?.transaction,I=await h.signTransaction(A,{serializer:P});return await(0,u.getAction)(O,T.sendRawTransaction,"sendRawTransaction")({serializedTransaction:I})}throw h?.type==="smart"?new t.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new t.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:h?.type})}catch(M){throw M instanceof t.AccountTypeNotSupportedError?M:(0,a.getTransactionError)(M,{...S,account:h,chain:S.chain||void 0})}}return Ys}var ih;function Gf(){if(ih)return To;ih=1,Object.defineProperty(To,"__esModule",{value:!0}),To.writeContract=o;const e=He(),t=Pr(),n=ut(),r=pr(),i=ge(),a=od();async function o(c,u){return o.internal(c,a.sendTransaction,"sendTransaction",u)}return(function(c){async function u(d,l,f,b){const{abi:T,account:w=d.account,address:p,args:O,dataSuffix:S,functionName:m,...j}=b;if(typeof w>"u")throw new t.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const s=w?(0,e.parseAccount)(w):null,y=(0,n.encodeFunctionData)({abi:T,args:O,functionName:m});try{return await(0,i.getAction)(d,l,f)({data:`${y}${S?S.replace("0x",""):""}`,to:p,account:s,...j})}catch(g){throw(0,r.getContractError)(g,{abi:T,address:p,args:O,docsPath:"/docs/contract/writeContract",functionName:m,sender:s?.address})}}c.internal=u})(o||(To.writeContract=o={})),To}var sh;function qv(){if(sh)return cn;sh=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.getContract=u,cn.getFunctionParameters=d,cn.getEventParameters=l;const e=ge(),t=pf(),n=Yp(),r=qf(),i=kt(),a=$p(),o=t_(),c=Gf();function u({abi:f,address:b,client:T}){const w=T,[p,O]=w?"public"in w&&"wallet"in w?[w.public,w.wallet]:"public"in w?[w.public,void 0]:"wallet"in w?[void 0,w.wallet]:[w,w]:[void 0,void 0],S=p!=null,m=O!=null,j={};let s=!1,y=!1,g=!1;for(const E of f)if(E.type==="function"?E.stateMutability==="view"||E.stateMutability==="pure"?s=!0:y=!0:E.type==="event"&&(g=!0),s&&y&&g)break;return S&&(s&&(j.read=new Proxy({},{get(E,B){return(..._)=>{const{args:v,options:C}=d(_);return(0,e.getAction)(p,i.readContract,"readContract")({abi:f,address:b,functionName:B,args:v,...C})}}})),y&&(j.simulate=new Proxy({},{get(E,B){return(..._)=>{const{args:v,options:C}=d(_);return(0,e.getAction)(p,a.simulateContract,"simulateContract")({abi:f,address:b,functionName:B,args:v,...C})}}})),g&&(j.createEventFilter=new Proxy({},{get(E,B){return(..._)=>{const v=f.find(R=>R.type==="event"&&R.name===B),{args:C,options:q}=l(_,v);return(0,e.getAction)(p,t.createContractEventFilter,"createContractEventFilter")({abi:f,address:b,eventName:B,args:C,...q})}}}),j.getEvents=new Proxy({},{get(E,B){return(..._)=>{const v=f.find(R=>R.type==="event"&&R.name===B),{args:C,options:q}=l(_,v);return(0,e.getAction)(p,r.getContractEvents,"getContractEvents")({abi:f,address:b,eventName:B,args:C,...q})}}}),j.watchEvent=new Proxy({},{get(E,B){return(..._)=>{const v=f.find(R=>R.type==="event"&&R.name===B),{args:C,options:q}=l(_,v);return(0,e.getAction)(p,o.watchContractEvent,"watchContractEvent")({abi:f,address:b,eventName:B,args:C,...q})}}}))),m&&y&&(j.write=new Proxy({},{get(E,B){return(..._)=>{const{args:v,options:C}=d(_);return(0,e.getAction)(O,c.writeContract,"writeContract")({abi:f,address:b,functionName:B,args:v,...C})}}})),(S||m)&&y&&(j.estimateGas=new Proxy({},{get(E,B){return(..._)=>{const{args:v,options:C}=d(_),q=p??O;return(0,e.getAction)(q,n.estimateContractGas,"estimateContractGas")({abi:f,address:b,functionName:B,args:v,...C,account:C.account??O.account})}}})),j.address=b,j.abi=f,j}function d(f){const b=f.length&&Array.isArray(f[0]),T=b?f[0]:[],w=(b?f[1]:f[0])??{};return{args:T,options:w}}function l(f,b){let T=!1;Array.isArray(f[0])?T=!0:f.length===1?T=b.inputs.some(O=>O.indexed):f.length===2&&(T=!0);const w=T?f[0]:void 0,p=(T?f[1]:f[0])??{};return{args:w,options:p}}return cn}var pn={},So={},ah;function r_(){if(ah)return So;ah=1,Object.defineProperty(So,"__esModule",{value:!0}),So.BundleFailedError=void 0;const e=fe();class t extends e.BaseError{constructor(r){super(`Call bundle failed with status: ${r.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=r}}return So.BundleFailedError=t,So}var Qs={},ch;function id(){if(ch)return Qs;ch=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.withRetry=t;const e=zf();function t(n,{delay:r=100,retryCount:i=2,shouldRetry:a=()=>!0}={}){return new Promise((o,c)=>{const u=async({count:d=0}={})=>{const l=async({error:f})=>{const b=typeof r=="function"?r({count:d,error:f}):r;b&&await(0,e.wait)(b),u({count:d+1})};try{const f=await n();o(f)}catch(f){if(d(0,r.formatLog)(d)):null,to:o.to?o.to:null,transactionIndex:o.transactionIndex?(0,t.hexToNumber)(o.transactionIndex):null,status:o.status?e.receiptStatuses[o.status]:null,type:o.type?i.transactionType[o.type]||o.type:null};return o.blobGasPrice&&(u.blobGasPrice=BigInt(o.blobGasPrice)),o.blobGasUsed&&(u.blobGasUsed=BigInt(o.blobGasUsed)),u}e.defineTransactionReceipt=(0,n.defineFormatter)("transactionReceipt",a)})(Qd)),Qd}var $d={},dh;function Vf(){return dh||(dh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fallbackTransactionErrorMagicIdentifier=e.fallbackMagicIdentifier=void 0,e.sendCalls=l;const t=He(),n=fe(),r=gr(),i=ut(),a=De(),o=Ne(),c=ie(),u=ti(),d=od();e.fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",e.fallbackTransactionErrorMagicIdentifier=(0,c.numberToHex)(0,{size:32});async function l(f,b){const{account:T=f.account,capabilities:w,chain:p=f.chain,experimental_fallback:O,experimental_fallbackDelay:S=32,forceAtomic:m=!1,id:j,version:s="2.0.0"}=b,y=T?(0,t.parseAccount)(T):null,g=b.calls.map(E=>{const B=E,_=B.abi?(0,i.encodeFunctionData)({abi:B.abi,functionName:B.functionName,args:B.args}):B.data;return{data:B.dataSuffix&&_?(0,a.concat)([_,B.dataSuffix]):_,to:B.to,value:B.value?(0,c.numberToHex)(B.value):void 0}});try{const E=await f.request({method:"wallet_sendCalls",params:[{atomicRequired:m,calls:g,capabilities:w,chainId:(0,c.numberToHex)(p.id),from:y?.address,id:j,version:s}]},{retryCount:0});return typeof E=="string"?{id:E}:E}catch(E){const B=E;if(O&&(B.name==="MethodNotFoundRpcError"||B.name==="MethodNotSupportedRpcError"||B.name==="UnknownRpcError"||B.details.toLowerCase().includes("does not exist / is not available")||B.details.toLowerCase().includes("missing or invalid. request()")||B.details.toLowerCase().includes("did not match any variant of untagged enum")||B.details.toLowerCase().includes("account upgraded to unsupported contract")||B.details.toLowerCase().includes("eip-7702 not supported")||B.details.toLowerCase().includes("unsupported wc_ method")||B.details.toLowerCase().includes("feature toggled misconfigured")||B.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(w&&Object.values(w).some(R=>!R.optional)){const R="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new r.UnsupportedNonOptionalCapabilityError(new n.BaseError(R,{details:R}))}if(m&&g.length>1){const q="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new r.AtomicityNotSupportedError(new n.BaseError(q,{details:q}))}const _=[];for(const q of g){const R=(0,d.sendTransaction)(f,{account:y,chain:p,data:q.data,to:q.to,value:q.value?(0,o.hexToBigInt)(q.value):void 0});_.push(R),S>0&&await new Promise(H=>setTimeout(H,S))}const v=await Promise.allSettled(_);if(v.every(q=>q.status==="rejected"))throw v[0].reason;const C=v.map(q=>q.status==="fulfilled"?q.value:e.fallbackTransactionErrorMagicIdentifier);return{id:(0,a.concat)([...C,(0,c.numberToHex)(p.id,{size:32}),e.fallbackMagicIdentifier])}}throw(0,u.getTransactionError)(E,{...b,account:y,chain:b.chain})}}})($d)),$d}var fh;function n_(){if(fh)return $s;fh=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.getCallsStatus=a;const e=vt(),t=$t(),n=Ne(),r=fi(),i=Vf();async function a(o,c){async function u(O){if(O.endsWith(i.fallbackMagicIdentifier.slice(2))){const m=(0,t.trim)((0,e.sliceHex)(O,-64,-32)),j=(0,e.sliceHex)(O,0,-64).slice(2).match(/.{1,64}/g),s=await Promise.all(j.map(g=>i.fallbackTransactionErrorMagicIdentifier.slice(2)!==g?o.request({method:"eth_getTransactionReceipt",params:[`0x${g}`]},{dedupe:!0}):void 0)),y=s.some(g=>g===null)?100:s.every(g=>g?.status==="0x1")?200:s.every(g=>g?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,n.hexToNumber)(m),receipts:s.filter(Boolean),status:y,version:"2.0.0"}}return o.request({method:"wallet_getCallsStatus",params:[O]})}const{atomic:d=!1,chainId:l,receipts:f,version:b="2.0.0",...T}=await u(c.id),[w,p]=(()=>{const O=T.status;return O>=100&&O<200?["pending",O]:O>=200&&O<300?["success",O]:O>=300&&O<700?["failure",O]:O==="CONFIRMED"?["success",200]:O==="PENDING"?["pending",100]:[void 0,O]})();return{...T,atomic:d,chainId:l?(0,n.hexToNumber)(l):void 0,receipts:f?.map(O=>({...O,blockNumber:(0,n.hexToBigInt)(O.blockNumber),gasUsed:(0,n.hexToBigInt)(O.gasUsed),status:r.receiptStatuses[O.status]}))??[],statusCode:p,status:w,version:b}}return $s}var lh;function Wf(){if(lh)return pn;lh=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.WaitForCallsStatusTimeoutError=void 0,pn.waitForCallsStatus=d;const e=fe(),t=r_(),n=ge(),r=nn(),i=Cn(),a=Mf(),o=id(),c=Ve(),u=n_();async function d(f,b){const{id:T,pollingInterval:w=f.pollingInterval,status:p=({statusCode:v})=>v===200||v>=300,retryCount:O=4,retryDelay:S=({count:v})=>~~(1<{const C=(0,i.poll)(async()=>{const q=R=>{clearTimeout(B),C(),R(),_()};try{const R=await(0,o.withRetry)(async()=>{const H=await(0,n.getAction)(f,u.getCallsStatus,"getCallsStatus")({id:T});if(j&&H.status==="failure")throw new t.BundleFailedError(H);return H},{retryCount:O,delay:S});if(!p(R))return;q(()=>v.resolve(R))}catch(R){q(()=>v.reject(R))}},{interval:w,emitOnBegin:!0});return C});return B=m?setTimeout(()=>{_(),clearTimeout(B),E(new l({id:T}))},m):void 0,await y}class l extends e.BaseError{constructor({id:b}){super(`Timed out while waiting for call bundle with id "${b}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}return pn.WaitForCallsStatusTimeoutError=l,pn}var Io={},ea={},bh;function o_(){if(bh)return ea;bh=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.uid=r;const e=256;let t=e,n;function r(i=11){if(!n||t+i>e*2){n="",t=0;for(let a=0;a{const _=B(E);for(const C in y)delete _[C];const v={...E,..._};return Object.assign(v,{extend:g(v)})}}return Object.assign(y,{extend:g(y)})}function r(){return null}return Io}var ta={},ra={},na={},oa={},hh;function Kf(){if(hh)return oa;hh=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.isNullUniversalResolverError=n;const e=fe(),t=yr();function n(r){if(!(r instanceof e.BaseError))return!1;const i=r.walk(a=>a instanceof t.ContractFunctionRevertedError);return i instanceof t.ContractFunctionRevertedError?i.data?.errorName==="HttpError"||i.data?.errorName==="ResolverError"||i.data?.errorName==="ResolverNotContract"||i.data?.errorName==="ResolverNotFound"||i.data?.errorName==="ReverseAddressMismatch"||i.data?.errorName==="UnsupportedResolverProfile":!1}return oa}var ia={},sa={},yh;function i_(){if(yh)return sa;yh=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.encodedLabelToLabelhash=t;const e=nt();function t(n){if(n.length!==66||n.indexOf("[")!==0||n.indexOf("]")!==65)return null;const r=`0x${n.slice(1,65)}`;return(0,e.isHex)(r)?r:null}return sa}var gh;function Zf(){if(gh)return ia;gh=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.namehash=a;const e=De(),t=Pe(),n=ie(),r=at(),i=i_();function a(o){let c=new Uint8Array(32).fill(0);if(!o)return(0,n.bytesToHex)(c);const u=o.split(".");for(let d=u.length-1;d>=0;d-=1){const l=(0,i.encodedLabelToLabelhash)(u[d]),f=l?(0,t.toBytes)(l):(0,r.keccak256)((0,t.stringToBytes)(u[d]),"bytes");c=(0,r.keccak256)((0,e.concat)([c,f]),"bytes")}return(0,n.bytesToHex)(c)}return ia}var aa={},ca={},ph;function Hv(){if(ph)return ca;ph=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.encodeLabelhash=e;function e(t){return`[${t.slice(2)}]`}return ca}var ua={},_h;function s_(){if(_h)return ua;_h=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.labelhash=i;const e=Pe(),t=ie(),n=at(),r=i_();function i(a){const o=new Uint8Array(32).fill(0);return a?(0,r.encodedLabelToLabelhash)(a)||(0,n.keccak256)((0,e.stringToBytes)(a)):(0,t.bytesToHex)(o)}return ua}var vh;function Yf(){if(vh)return aa;vh=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.packetToBytes=r;const e=Pe(),t=Hv(),n=s_();function r(i){const a=i.replace(/^\.|\.$/gm,"");if(a.length===0)return new Uint8Array(1);const o=new Uint8Array((0,e.stringToBytes)(a).byteLength+2);let c=0;const u=a.split(".");for(let d=0;d255&&(l=(0,e.stringToBytes)((0,t.encodeLabelhash)((0,n.labelhash)(u[d])))),o[c]=l.length,o.set(l,c+1),c+=l.length+1}return o.byteLength!==c+1?o.slice(0,c+1):o}return aa}var Eh;function Mv(){if(Eh)return na;Eh=1,Object.defineProperty(na,"__esModule",{value:!0}),na.getEnsAddress=b;const e=wr(),t=nr(),n=ut(),r=jr(),i=$t(),a=ie(),o=Kf(),c=td(),u=Zf(),d=Yf(),l=ge(),f=kt();async function b(T,w){const{blockNumber:p,blockTag:O,coinType:S,name:m,gatewayUrls:j,strict:s}=w,{chain:y}=T,g=(()=>{if(w.universalResolverAddress)return w.universalResolverAddress;if(!y)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:p,chain:y,contract:"ensUniversalResolver"})})(),E=y?.ensTlds;if(E&&!E.some(_=>m.endsWith(_)))return null;const B=S!=null?[(0,u.namehash)(m),BigInt(S)]:[(0,u.namehash)(m)];try{const _=(0,n.encodeFunctionData)({abi:e.addressResolverAbi,functionName:"addr",args:B}),v={address:g,abi:e.universalResolverResolveAbi,functionName:"resolveWithGateways",args:[(0,a.toHex)((0,d.packetToBytes)(m)),_,j??[c.localBatchGatewayUrl]],blockNumber:p,blockTag:O},q=await(0,l.getAction)(T,f.readContract,"readContract")(v);if(q[0]==="0x")return null;const R=(0,t.decodeFunctionResult)({abi:e.addressResolverAbi,args:B,functionName:"addr",data:q[0]});return R==="0x"||(0,i.trim)(R)==="0x00"?null:R}catch(_){if(s)throw _;if((0,o.isNullUniversalResolverError)(_))return null;throw _}}return na}var da={},fa={},Pt={},mt={},wh;function Jf(){if(wh)return mt;wh=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.EnsInvalidChainIdError=mt.EnsAvatarUnsupportedNamespaceError=mt.EnsAvatarUriResolutionError=mt.EnsAvatarInvalidNftUriError=mt.EnsAvatarInvalidMetadataError=void 0;const e=fe();class t extends e.BaseError{constructor({data:c}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(c)}`],name:"EnsAvatarInvalidMetadataError"})}}mt.EnsAvatarInvalidMetadataError=t;class n extends e.BaseError{constructor({reason:c}){super(`ENS NFT avatar URI is invalid. ${c}`,{name:"EnsAvatarInvalidNftUriError"})}}mt.EnsAvatarInvalidNftUriError=n;class r extends e.BaseError{constructor({uri:c}){super(`Unable to resolve ENS avatar URI "${c}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}mt.EnsAvatarUriResolutionError=r;class i extends e.BaseError{constructor({namespace:c}){super(`ENS NFT avatar namespace "${c}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}mt.EnsAvatarUnsupportedNamespaceError=i;class a extends e.BaseError{constructor({chainId:c}){super(`Invalid ENSIP-11 chainId: ${c}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}return mt.EnsInvalidChainIdError=a,mt}var jh;function kv(){if(jh)return Pt;jh=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.isImageUri=o,Pt.getGateway=c,Pt.resolveAvatarUri=u,Pt.getJsonImage=d,Pt.getMetadataAvatarUri=l,Pt.parseAvatarUri=f,Pt.parseNftUri=b,Pt.getNftTokenUri=T;const e=kt(),t=Jf(),n=/(?https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,r=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,i=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,a=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function o(w){try{const p=await fetch(w,{method:"HEAD"});return p.status===200?p.headers.get("content-type")?.startsWith("image/"):!1}catch(p){return typeof p=="object"&&typeof p.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(O=>{const S=new Image;S.onload=()=>{O(!0)},S.onerror=()=>{O(!1)},S.src=w})}}function c(w,p){return w?w.endsWith("/")?w.slice(0,-1):w:p}function u({uri:w,gatewayUrls:p}){const O=i.test(w);if(O)return{uri:w,isOnChain:!0,isEncoded:O};const S=c(p?.ipfs,"https://ipfs.io"),m=c(p?.arweave,"https://arweave.net"),j=w.match(n),{protocol:s,subpath:y,target:g,subtarget:E=""}=j?.groups||{},B=s==="ipns:/"||y==="ipns/",_=s==="ipfs:/"||y==="ipfs/"||r.test(w);if(w.startsWith("http")&&!B&&!_){let C=w;return p?.arweave&&(C=w.replace(/https:\/\/arweave.net/g,p?.arweave)),{uri:C,isOnChain:!1,isEncoded:!1}}if((B||_)&&g)return{uri:`${S}/${B?"ipns":"ipfs"}/${g}${E}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&g)return{uri:`${m}/${g}${E||""}`,isOnChain:!1,isEncoded:!1};let v=w.replace(a,"");if(v.startsWith("m.json());return await f({gatewayUrls:w,uri:d(O)})}catch{throw new t.EnsAvatarUriResolutionError({uri:p})}}async function f({gatewayUrls:w,uri:p}){const{uri:O,isOnChain:S}=u({uri:p,gatewayUrls:w});if(S||await o(O))return O;throw new t.EnsAvatarUriResolutionError({uri:p})}function b(w){let p=w;p.startsWith("did:nft:")&&(p=p.replace("did:nft:","").replace(/_/g,"/"));const[O,S,m]=p.split("/"),[j,s]=O.split(":"),[y,g]=S.split(":");if(!j||j.toLowerCase()!=="eip155")throw new t.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!s)throw new t.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!g)throw new t.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!m)throw new t.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!y)throw new t.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s,10),namespace:y.toLowerCase(),contractAddress:g,tokenID:m}}async function T(w,{nft:p}){if(p.namespace==="erc721")return(0,e.readContract)(w,{address:p.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(p.tokenID)]});if(p.namespace==="erc1155")return(0,e.readContract)(w,{address:p.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(p.tokenID)]});throw new t.EnsAvatarUnsupportedNamespaceError({namespace:p.namespace})}return Pt}var Ph;function Nv(){if(Ph)return fa;Ph=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.parseAvatarRecord=t;const e=kv();async function t(r,{gatewayUrls:i,record:a}){return/eip155:/i.test(a)?n(r,{gatewayUrls:i,record:a}):(0,e.parseAvatarUri)({uri:a,gatewayUrls:i})}async function n(r,{gatewayUrls:i,record:a}){const o=(0,e.parseNftUri)(a),c=await(0,e.getNftTokenUri)(r,{nft:o}),{uri:u,isOnChain:d,isEncoded:l}=(0,e.resolveAvatarUri)({uri:c,gatewayUrls:i});if(d&&(u.includes("data:application/json;base64,")||u.startsWith("{"))){const b=l?atob(u.replace("data:application/json;base64,","")):u,T=JSON.parse(b);return(0,e.parseAvatarUri)({uri:(0,e.getJsonImage)(T),gatewayUrls:i})}let f=o.tokenID;return o.namespace==="erc1155"&&(f=f.replace("0x","").padStart(64,"0")),(0,e.getMetadataAvatarUri)({gatewayUrls:i,uri:u.replace(/(?:0x)?{id}/,f)})}return fa}var la={},Ah;function a_(){if(Ah)return la;Ah=1,Object.defineProperty(la,"__esModule",{value:!0}),la.getEnsText=f;const e=wr(),t=nr(),n=ut(),r=jr(),i=ie(),a=Kf(),o=td(),c=Zf(),u=Yf(),d=ge(),l=kt();async function f(b,T){const{blockNumber:w,blockTag:p,key:O,name:S,gatewayUrls:m,strict:j}=T,{chain:s}=b,y=(()=>{if(T.universalResolverAddress)return T.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:w,chain:s,contract:"ensUniversalResolver"})})(),g=s?.ensTlds;if(g&&!g.some(E=>S.endsWith(E)))return null;try{const E={address:y,abi:e.universalResolverResolveAbi,args:[(0,i.toHex)((0,u.packetToBytes)(S)),(0,n.encodeFunctionData)({abi:e.textResolverAbi,functionName:"text",args:[(0,c.namehash)(S),O]}),m??[o.localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:w,blockTag:p},_=await(0,d.getAction)(b,l.readContract,"readContract")(E);if(_[0]==="0x")return null;const v=(0,t.decodeFunctionResult)({abi:e.textResolverAbi,functionName:"text",data:_[0]});return v===""?null:v}catch(E){if(j)throw E;if((0,a.isNullUniversalResolverError)(E))return null;throw E}}return la}var Th;function Fv(){if(Th)return da;Th=1,Object.defineProperty(da,"__esModule",{value:!0}),da.getEnsAvatar=r;const e=Nv(),t=ge(),n=a_();async function r(i,{blockNumber:a,blockTag:o,assetGatewayUrls:c,name:u,gatewayUrls:d,strict:l,universalResolverAddress:f}){const b=await(0,t.getAction)(i,n.getEnsText,"getEnsText")({blockNumber:a,blockTag:o,key:"avatar",name:u,universalResolverAddress:f,gatewayUrls:d,strict:l});if(!b)return null;try{return await(0,e.parseAvatarRecord)(i,{record:b,gatewayUrls:c})}catch{return null}}return da}var ba={},Sh;function Lv(){if(Sh)return ba;Sh=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.getEnsName=o;const e=wr(),t=jr(),n=Kf(),r=td(),i=ge(),a=kt();async function o(c,u){const{address:d,blockNumber:l,blockTag:f,coinType:b=60n,gatewayUrls:T,strict:w}=u,{chain:p}=c,O=(()=>{if(u.universalResolverAddress)return u.universalResolverAddress;if(!p)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,t.getChainContractAddress)({blockNumber:l,chain:p,contract:"ensUniversalResolver"})})();try{const S={address:O,abi:e.universalResolverReverseAbi,args:[d,b,T??[r.localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:l,blockTag:f},m=(0,i.getAction)(c,a.readContract,"readContract"),[j]=await m(S);return j||null}catch(S){if(w)throw S;if((0,n.isNullUniversalResolverError)(S))return null;throw S}}return ba}var ma={},Ih;function Uv(){if(Ih)return ma;Ih=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.getEnsResolver=a;const e=jr(),t=ie(),n=Yf(),r=ge(),i=kt();async function a(o,c){const{blockNumber:u,blockTag:d,name:l}=c,{chain:f}=o,b=(()=>{if(c.universalResolverAddress)return c.universalResolverAddress;if(!f)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,e.getChainContractAddress)({blockNumber:u,chain:f,contract:"ensUniversalResolver"})})(),T=f?.ensTlds;if(T&&!T.some(p=>l.endsWith(p)))throw new Error(`${l} is not a valid ENS TLD (${T?.join(", ")}) for chain "${f.name}" (id: ${f.id}).`);const[w]=await(0,r.getAction)(o,i.readContract,"readContract")({address:b,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,t.toHex)((0,n.packetToBytes)(l))],blockNumber:u,blockTag:d});return w}return ma}var ha={},Bh;function c_(){if(Bh)return ha;Bh=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.createAccessList=o;const e=He(),t=ie(),n=Hf(),r=vr(),i=Rt(),a=Ot();async function o(c,u){const{account:d=c.account,blockNumber:l,blockTag:f="latest",blobs:b,data:T,gas:w,gasPrice:p,maxFeePerBlobGas:O,maxFeePerGas:S,maxPriorityFeePerGas:m,to:j,value:s,...y}=u,g=d?(0,e.parseAccount)(d):void 0;try{(0,a.assertRequest)(u);const B=(typeof l=="bigint"?(0,t.numberToHex)(l):void 0)||f,_=c.chain?.formatters?.transactionRequest?.format,C=(_||i.formatTransactionRequest)({...(0,r.extract)(y,{format:_}),account:g,blobs:b,data:T,gas:w,gasPrice:p,maxFeePerBlobGas:O,maxFeePerGas:S,maxPriorityFeePerGas:m,to:j,value:s},"createAccessList"),q=await c.request({method:"eth_createAccessList",params:[C,B]});return{accessList:q.accessList,gasUsed:BigInt(q.gasUsed)}}catch(E){throw(0,n.getCallError)(E,{...u,account:g,chain:c.chain})}}return ha}var ya={},Rh;function zv(){if(Rh)return ya;Rh=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.createBlockFilter=t;const e=Gu();async function t(n){const r=(0,e.createFilterRequestScope)(n,{method:"eth_newBlockFilter"}),i=await n.request({method:"eth_newBlockFilter"});return{id:i,request:r(i),type:"block"}}return ya}var ga={},Oh;function u_(){if(Oh)return ga;Oh=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.createEventFilter=r;const e=$r(),t=ie(),n=Gu();async function r(i,{address:a,args:o,event:c,events:u,fromBlock:d,strict:l,toBlock:f}={}){const b=u??(c?[c]:void 0),T=(0,n.createFilterRequestScope)(i,{method:"eth_newFilter"});let w=[];b&&(w=[b.flatMap(S=>(0,e.encodeEventTopics)({abi:[S],eventName:S.name,args:o}))],c&&(w=w[0]));const p=await i.request({method:"eth_newFilter",params:[{address:a,fromBlock:typeof d=="bigint"?(0,t.numberToHex)(d):d,toBlock:typeof f=="bigint"?(0,t.numberToHex)(f):f,...w.length?{topics:w}:{}}]});return{abi:b,args:o,eventName:c?c.name:void 0,fromBlock:d,id:p,request:T(p),strict:!!l,toBlock:f,type:"event"}}return ga}var pa={},Ch;function d_(){if(Ch)return pa;Ch=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.createPendingTransactionFilter=t;const e=Gu();async function t(n){const r=(0,e.createFilterRequestScope)(n,{method:"eth_newPendingTransactionFilter"}),i=await n.request({method:"eth_newPendingTransactionFilter"});return{id:i,request:r(i),type:"transaction"}}return pa}var _a={},xh;function Dv(){if(xh)return _a;xh=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.getBalance=t;const e=ie();async function t(n,{address:r,blockNumber:i,blockTag:a=n.experimental_blockTag??"latest"}){const o=typeof i=="bigint"?(0,e.numberToHex)(i):void 0,c=await n.request({method:"eth_getBalance",params:[r,o||a]});return BigInt(c)}return _a}var va={},qh;function Gv(){if(qh)return va;qh=1,Object.defineProperty(va,"__esModule",{value:!0}),va.getBlobBaseFee=e;async function e(t){const n=await t.request({method:"eth_blobBaseFee"});return BigInt(n)}return va}var Ea={},Hh;function Vv(){if(Hh)return Ea;Hh=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.getBlockTransactionCount=n;const e=Ne(),t=ie();async function n(r,{blockHash:i,blockNumber:a,blockTag:o="latest"}={}){const c=a!==void 0?(0,t.numberToHex)(a):void 0;let u;return i?u=await r.request({method:"eth_getBlockTransactionCountByHash",params:[i]},{dedupe:!0}):u=await r.request({method:"eth_getBlockTransactionCountByNumber",params:[c||o]},{dedupe:!!c}),(0,e.hexToNumber)(u)}return Ea}var wa={},Mh;function f_(){if(Mh)return wa;Mh=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.getCode=t;const e=ie();async function t(n,{address:r,blockNumber:i,blockTag:a="latest"}){const o=i!==void 0?(0,e.numberToHex)(i):void 0,c=await n.request({method:"eth_getCode",params:[r,o||a]},{dedupe:!!o});if(c!=="0x")return c}return wa}var ja={},Bo={},kh;function Wv(){if(kh)return Bo;kh=1,Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.Eip712DomainNotFoundError=void 0;const e=fe();class t extends e.BaseError{constructor({address:r}){super(`No EIP-712 domain found on contract "${r}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${r}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}return Bo.Eip712DomainNotFoundError=t,Bo}var Nh;function Kv(){if(Nh)return ja;Nh=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.getEip712Domain=r;const e=Wv(),t=ge(),n=kt();async function r(a,o){const{address:c,factory:u,factoryData:d}=o;try{const[l,f,b,T,w,p,O]=await(0,t.getAction)(a,n.readContract,"readContract")({abi:i,address:c,functionName:"eip712Domain",factory:u,factoryData:d});return{domain:{name:f,version:b,chainId:Number(T),verifyingContract:w,salt:p},extensions:O,fields:l}}catch(l){const f=l;throw f.name==="ContractFunctionExecutionError"&&f.cause.name==="ContractFunctionZeroDataError"?new e.Eip712DomainNotFoundError({address:c}):f}}const i=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];return ja}var Pa={},Aa={},Fh;function Zv(){if(Fh)return Aa;Fh=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.formatFeeHistory=e;function e(t){return{baseFeePerGas:t.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:t.reward?.map(n=>n.map(r=>BigInt(r)))}}return Aa}var Lh;function Yv(){if(Lh)return Pa;Lh=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.getFeeHistory=n;const e=ie(),t=Zv();async function n(r,{blockCount:i,blockNumber:a,blockTag:o="latest",rewardPercentiles:c}){const u=typeof a=="bigint"?(0,e.numberToHex)(a):void 0,d=await r.request({method:"eth_feeHistory",params:[(0,e.numberToHex)(i),u||o,c]},{dedupe:!!u});return(0,t.formatFeeHistory)(d)}return Pa}var Ta={},Uh;function Jv(){if(Uh)return Ta;Uh=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.getFilterLogs=n;const e=oi(),t=rr();async function n(r,{filter:i}){const a=i.strict??!1,c=(await i.request({method:"eth_getFilterLogs",params:[i.id]})).map(u=>(0,t.formatLog)(u));return i.abi?(0,e.parseEventLogs)({abi:i.abi,logs:c,strict:a}):c}return Ta}var Sa={},Ia={},ef={},Ba={},zh;function l_(){if(zh)return Ba;zh=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.encodePacked=c;const e=qe(),t=St(),n=ct(),r=De(),i=br(),a=ie(),o=Du();function c(d,l){if(d.length!==l.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:d.length,givenLength:l.length});const f=[];for(let b=0;bt.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:j});if(m&&j&&m>j)throw new o.TipAboveFeeCapError({maxFeePerGas:j,maxPriorityFeePerGas:m})}function w(O){const{chainId:S,maxPriorityFeePerGas:m,gasPrice:j,maxFeePerGas:s,to:y}=O;if(S<=0)throw new a.InvalidChainIdError({chainId:S});if(y&&!(0,c.isAddress)(y))throw new n.InvalidAddressError({address:y});if(m||s)throw new r.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(j&&j>t.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:j})}function p(O){const{chainId:S,maxPriorityFeePerGas:m,gasPrice:j,maxFeePerGas:s,to:y}=O;if(y&&!(0,c.isAddress)(y))throw new n.InvalidAddressError({address:y});if(typeof S<"u"&&S<=0)throw new a.InvalidChainIdError({chainId:S});if(m||s)throw new r.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(j&&j>t.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:j})}return ur}var Ca={},Wh;function Qf(){if(Wh)return Ca;Wh=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.serializeAccessList=r;const e=St(),t=dt(),n=ct();function r(i){if(!i||i.length===0)return[];const a=[];for(let o=0;o"u"||typeof h>"u")){const N=typeof s.blobs[0]=="string"?s.blobs:s.blobs.map(z=>(0,u.bytesToHex)(z)),U=s.kzg,L=(0,n.blobsToCommitments)({blobs:N,kzg:U});if(typeof k>"u"&&(k=(0,i.commitmentsToVersionedHashes)({commitments:L})),typeof h>"u"){const z=(0,r.blobsToProofs)({blobs:N,commitments:L,kzg:U});h=(0,a.toBlobSidecars)({blobs:N,commitments:L,proofs:z})}}const M=(0,b.serializeAccessList)(H),A=[(0,u.numberToHex)(g),B?(0,u.numberToHex)(B):"0x",R?(0,u.numberToHex)(R):"0x",q?(0,u.numberToHex)(q):"0x",E?(0,u.numberToHex)(E):"0x",_??"0x",v?(0,u.numberToHex)(v):"0x",F??"0x",M,C?(0,u.numberToHex)(C):"0x",k??[],...j(s,y)],P=[],I=[],x=[];if(h)for(let N=0;N{if(y.v>=35n)return(y.v-35n)/2n>0?y.v:27n+(y.v===35n?0n:1n);if(g>0)return BigInt(g*2)+BigInt(35n+y.v-27n);const h=27n+(y.v===27n?0n:1n);if(y.v!==h)throw new e.InvalidLegacyVError({v:y.v});return h})(),F=(0,c.trim)(y.r),k=(0,c.trim)(y.s);R=[...R,(0,u.numberToHex)(H),F==="0x00"?"0x":F,k==="0x00"?"0x":k]}else g>0&&(R=[...R,(0,u.numberToHex)(g),"0x","0x"]);return(0,d.toRlp)(R)}function j(s,y){const g=y??s,{v:E,yParity:B}=g;if(typeof g.r>"u")return[];if(typeof g.s>"u")return[];if(typeof E>"u"&&typeof B>"u")return[];const _=(0,c.trim)(g.r),v=(0,c.trim)(g.s);return[typeof B=="number"?B?(0,u.numberToHex)(1):"0x":E===0n?"0x":E===1n?(0,u.numberToHex)(1):E===27n?"0x":(0,u.numberToHex)(1),_==="0x00"?"0x":_,v==="0x00"?"0x":v]}return Ro}var Zh;function m_(){if(Zh)return Oa;Zh=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.serializeAuthorizationList=n;const e=ie(),t=cd();function n(r){if(!r||r.length===0)return[];const i=[];for(const a of r){const{chainId:o,nonce:c,...u}=a,d=a.address;i.push([o?(0,e.toHex)(o):"0x",d,c?(0,e.toHex)(c):"0x",...(0,t.toYParitySignatureArray)({},u)])}return i}return Oa}var xa={},Yh;function h_(){if(Yh)return xa;Yh=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.verifyAuthorization=r;const e=yt(),t=Ct(),n=Xo();async function r({address:i,authorization:a,signature:o}){return(0,t.isAddressEqual)((0,e.getAddress)(i),await(0,n.recoverAuthorizationAddress)({authorization:a,signature:o}))}return xa}var Oo={},tf={},Jh;function Xv(){return Jh||(Jh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.promiseCache=void 0,e.withDedupe=n;const t=Xr();e.promiseCache=new t.LruMap(8192);function n(r,{enabled:i=!0,id:a}){if(!i||!a)return r();if(e.promiseCache.get(a))return e.promiseCache.get(a);const o=r().finally(()=>e.promiseCache.delete(a));return e.promiseCache.set(a,o),o}})(tf)),tf}var Xh;function y_(){if(Xh)return Oo;Xh=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.buildRequest=c,Oo.shouldRetry=u;const e=fe(),t=Bt(),n=gr(),r=ie(),i=Xv(),a=id(),o=Ve();function c(d,l={}){return async(f,b={})=>{const{dedupe:T=!1,methods:w,retryDelay:p=150,retryCount:O=3,uid:S}={...l,...b},{method:m}=f;if(w?.exclude?.includes(m))throw new n.MethodNotSupportedRpcError(new Error("method not supported"),{method:m});if(w?.include&&!w.include.includes(m))throw new n.MethodNotSupportedRpcError(new Error("method not supported"),{method:m});const j=T?(0,r.stringToHex)(`${S}.${(0,o.stringify)(f)}`):void 0;return(0,i.withDedupe)(()=>(0,a.withRetry)(async()=>{try{return await d(f)}catch(s){const y=s;switch(y.code){case n.ParseRpcError.code:throw new n.ParseRpcError(y);case n.InvalidRequestRpcError.code:throw new n.InvalidRequestRpcError(y);case n.MethodNotFoundRpcError.code:throw new n.MethodNotFoundRpcError(y,{method:f.method});case n.InvalidParamsRpcError.code:throw new n.InvalidParamsRpcError(y);case n.InternalRpcError.code:throw new n.InternalRpcError(y);case n.InvalidInputRpcError.code:throw new n.InvalidInputRpcError(y);case n.ResourceNotFoundRpcError.code:throw new n.ResourceNotFoundRpcError(y);case n.ResourceUnavailableRpcError.code:throw new n.ResourceUnavailableRpcError(y);case n.TransactionRejectedRpcError.code:throw new n.TransactionRejectedRpcError(y);case n.MethodNotSupportedRpcError.code:throw new n.MethodNotSupportedRpcError(y,{method:f.method});case n.LimitExceededRpcError.code:throw new n.LimitExceededRpcError(y);case n.JsonRpcVersionUnsupportedError.code:throw new n.JsonRpcVersionUnsupportedError(y);case n.UserRejectedRequestError.code:throw new n.UserRejectedRequestError(y);case n.UnauthorizedProviderError.code:throw new n.UnauthorizedProviderError(y);case n.UnsupportedProviderMethodError.code:throw new n.UnsupportedProviderMethodError(y);case n.ProviderDisconnectedError.code:throw new n.ProviderDisconnectedError(y);case n.ChainDisconnectedError.code:throw new n.ChainDisconnectedError(y);case n.SwitchChainError.code:throw new n.SwitchChainError(y);case n.UnsupportedNonOptionalCapabilityError.code:throw new n.UnsupportedNonOptionalCapabilityError(y);case n.UnsupportedChainIdError.code:throw new n.UnsupportedChainIdError(y);case n.DuplicateIdError.code:throw new n.DuplicateIdError(y);case n.UnknownBundleIdError.code:throw new n.UnknownBundleIdError(y);case n.BundleTooLargeError.code:throw new n.BundleTooLargeError(y);case n.AtomicReadyWalletRejectedUpgradeError.code:throw new n.AtomicReadyWalletRejectedUpgradeError(y);case n.AtomicityNotSupportedError.code:throw new n.AtomicityNotSupportedError(y);case 5e3:throw new n.UserRejectedRequestError(y);default:throw s instanceof e.BaseError?s:new n.UnknownRpcError(y)}}},{delay:({count:s,error:y})=>{if(y&&y instanceof t.HttpRequestError){const g=y?.headers?.get("Retry-After");if(g?.match(/\d/))return Number.parseInt(g,10)*1e3}return~~(1<u(s)}),{enabled:T,id:j})}}function u(d){return"code"in d&&typeof d.code=="number"?d.code===-1||d.code===n.LimitExceededRpcError.code||d.code===n.InternalRpcError.code:d instanceof t.HttpRequestError&&d.status?d.status===403||d.status===408||d.status===413||d.status===429||d.status===500||d.status===502||d.status===503||d.status===504:!0}return Oo}var Co={},Qh;function g_(){if(Qh)return Co;Qh=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.defineChain=e,Co.extendSchema=t;function e(n){const r={formatters:void 0,fees:void 0,serializers:void 0,...n};function i(a){return o=>{const c=typeof o=="function"?o(a):o,u={...a,...c};return Object.assign(u,{extend:i(u)})}}return Object.assign(r,{extend:i(r)})}function t(){return{}}return Co}var qa={},$h;function p_(){if($h)return qa;$h=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.extractChain=e;function e({chains:t,id:n}){return t.find(r=>r.id===n)}return qa}var Ha={},e1;function $f(){if(e1)return Ha;e1=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.fromRlp=a;const e=fe(),t=Bn(),n=Vo(),r=Pe(),i=ie();function a(d,l="hex"){const f=(()=>{if(typeof d=="string"){if(d.length>3&&d.length%2!==0)throw new t.InvalidHexValueError(d);return(0,r.hexToBytes)(d)}return d})(),b=(0,n.createCursor)(f,{recursiveReadLimit:Number.POSITIVE_INFINITY});return o(b,l)}function o(d,l="hex"){if(d.bytes.length===0)return l==="hex"?(0,i.bytesToHex)(d.bytes):d.bytes;const f=d.readByte();if(f<128&&d.decrementPosition(1),f<192){const T=c(d,f,128),w=d.readBytes(T);return l==="hex"?(0,i.bytesToHex)(w):w}const b=c(d,f,192);return u(d,b,l)}function c(d,l,f){if(f===128&&l<128)return 1;if(l<=f+55)return l-f;if(l===f+55+1)return d.readUint8();if(l===f+55+2)return d.readUint16();if(l===f+55+3)return d.readUint24();if(l===f+55+4)return d.readUint32();throw new e.BaseError("Invalid RLP prefix")}function u(d,l,f){const b=d.position,T=[];for(;d.position-bnew i);const a=Math.pow(2,32),o=Array.from({length:64},(B,_)=>Math.floor(a*Math.abs(Math.sin(_+1)))),c=n.slice(0,4),u=new Uint32Array(16);class d extends e.HashMD{constructor(){super(64,16,8,!0),this.A=c[0]|0,this.B=c[1]|0,this.C=c[2]|0,this.D=c[3]|0}get(){const{A:_,B:v,C,D:q}=this;return[_,v,C,q]}set(_,v,C,q){this.A=_|0,this.B=v|0,this.C=C|0,this.D=q|0}process(_,v){for(let F=0;F<16;F++,v+=4)u[F]=_.getUint32(v,!0);let{A:C,B:q,C:R,D:H}=this;for(let F=0;F<64;F++){let k,h,M;F<16?(k=(0,e.Chi)(q,R,H),h=F,M=[7,12,17,22]):F<32?(k=(0,e.Chi)(H,q,R),h=(5*F+1)%16,M=[5,9,14,20]):F<48?(k=q^R^H,h=(3*F+5)%16,M=[4,11,16,23]):(k=R^(q|~H),h=7*F%16,M=[6,10,15,21]),k=k+C+o[F]+u[h],C=H,H=R,R=q,q=q+(0,t.rotl)(k,M[F%4])}C=C+this.A|0,q=q+this.B|0,R=R+this.C|0,H=H+this.D|0,this.set(C,q,R,H)}roundClean(){(0,t.clean)(u)}destroy(){this.set(0,0,0,0),(0,t.clean)(this.buffer)}}$e.MD5=d,$e.md5=(0,t.createHasher)(()=>new d);const l=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),f=Uint8Array.from(new Array(16).fill(0).map((B,_)=>_)),b=f.map(B=>(9*B+5)%16),T=(()=>{const v=[[f],[b]];for(let C=0;C<4;C++)for(let q of v)q.push(q[C].map(R=>l[R]));return v})(),w=T[0],p=T[1],O=[[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(B=>Uint8Array.from(B)),S=w.map((B,_)=>B.map(v=>O[_][v])),m=p.map((B,_)=>B.map(v=>O[_][v])),j=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),s=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function y(B,_,v,C){return B===0?_^v^C:B===1?_&v|~_&C:B===2?(_|~v)^C:B===3?_&C|v&~C:_^(v|~C)}const g=new Uint32Array(16);class E extends e.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:_,h1:v,h2:C,h3:q,h4:R}=this;return[_,v,C,q,R]}set(_,v,C,q,R){this.h0=_|0,this.h1=v|0,this.h2=C|0,this.h3=q|0,this.h4=R|0}process(_,v){for(let I=0;I<16;I++,v+=4)g[I]=_.getUint32(v,!0);let C=this.h0|0,q=C,R=this.h1|0,H=R,F=this.h2|0,k=F,h=this.h3|0,M=h,A=this.h4|0,P=A;for(let I=0;I<5;I++){const x=4-I,N=j[I],U=s[I],L=w[I],z=p[I],D=S[I],J=m[I];for(let Z=0;Z<16;Z++){const Y=(0,t.rotl)(C+y(I,R,F,h)+g[L[Z]]+N,D[Z])+A|0;C=A,A=h,h=(0,t.rotl)(F,10)|0,F=R,R=Y}for(let Z=0;Z<16;Z++){const Y=(0,t.rotl)(q+y(x,H,k,M)+g[z[Z]]+U,J[Z])+P|0;q=P,P=M,M=(0,t.rotl)(k,10)|0,k=H,H=Y}}this.set(this.h1+F+M|0,this.h2+h+P|0,this.h3+A+q|0,this.h4+C+H|0,this.h0+R+k|0)}roundClean(){(0,t.clean)(g)}destroy(){this.destroyed=!0,(0,t.clean)(this.buffer),this.set(0,0,0,0,0)}}return $e.RIPEMD160=E,$e.ripemd160=(0,t.createHasher)(()=>new E),$e}var n1;function $v(){if(n1)return kr;n1=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.ripemd160=kr.RIPEMD160=void 0;const e=Qv();return kr.RIPEMD160=e.RIPEMD160,kr.ripemd160=e.ripemd160,kr}var o1;function __(){if(o1)return ka;o1=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.ripemd160=i;const e=$v(),t=nt(),n=Pe(),r=ie();function i(a,o){const c=o||"hex",u=(0,e.ripemd160)((0,t.isHex)(a,{strict:!1})?(0,n.toBytes)(a):a);return c==="bytes"?u:(0,r.toHex)(u)}return ka}var rf={},i1;function v_(){return i1||(i1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventHash=void 0;var t=zu();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return t.toSignatureHash}})})(rf)),rf}var nf={},s1;function E_(){return s1||(s1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventSignature=void 0;var t=gf();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return t.toSignature}})})(nf)),nf}var of={},a1;function w_(){return a1||(a1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionHash=void 0;var t=zu();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return t.toSignatureHash}})})(of)),of}var sf={},c1;function j_(){return c1||(c1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionSignature=void 0;var t=gf();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return t.toSignature}})})(sf)),sf}var Nr={},u1;function P_(){if(u1)return Nr;u1=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.nonceManager=void 0,Nr.createNonceManager=n,Nr.jsonRpc=r;const e=Yu(),t=Xr();function n(i){const{source:a}=i,o=new Map,c=new t.LruMap(8192),u=new Map,d=({address:l,chainId:f})=>`${l}.${f}`;return{async consume({address:l,chainId:f,client:b}){const T=d({address:l,chainId:f}),w=this.get({address:l,chainId:f,client:b});this.increment({address:l,chainId:f});const p=await w;return await a.set({address:l,chainId:f},p),c.set(T,p),p},async increment({address:l,chainId:f}){const b=d({address:l,chainId:f}),T=o.get(b)??0;o.set(b,T+1)},async get({address:l,chainId:f,client:b}){const T=d({address:l,chainId:f});let w=u.get(T);return w||(w=(async()=>{try{const O=await a.get({address:l,chainId:f,client:b}),S=c.get(T)??0;return S>0&&O<=S?S+1:(c.delete(T),O)}finally{this.reset({address:l,chainId:f})}})(),u.set(T,w)),(o.get(T)??0)+await w},reset({address:l,chainId:f}){const b=d({address:l,chainId:f});o.delete(b),u.delete(b)}}}function r(){return{async get(i){const{address:a,client:o}=i;return(0,e.getTransactionCount)(o,{address:a,blockTag:"pending"})},set(){}}}return Nr.nonceManager=n({source:r()}),Nr}var vn={},Na={},Fa={},d1;function t0(){if(d1)return Fa;d1=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.withTimeout=e;function e(t,{errorInstance:n=new Error("timed out"),timeout:r,signal:i}){return new Promise((a,o)=>{(async()=>{let c;try{const u=new AbortController;r>0&&(c=setTimeout(()=>{i?u.abort():o(n)},r)),a(await t({signal:u?.signal||null}))}catch(u){u?.name==="AbortError"&&o(n),o(u)}finally{clearTimeout(c)}})()})}return Fa}var xo={},f1;function A_(){if(f1)return xo;f1=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.idCache=void 0;function e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}return xo.idCache=e(),xo}var l1;function r0(){if(l1)return Na;l1=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.getHttpRpcClient=i;const e=Bt(),t=t0(),n=Ve(),r=A_();function i(a,o={}){return{async request(c){const{body:u,fetchFn:d=o.fetchFn??fetch,onRequest:l=o.onRequest,onResponse:f=o.onResponse,timeout:b=o.timeout??1e4}=c,T={...o.fetchOptions??{},...c.fetchOptions??{}},{headers:w,method:p,signal:O}=T;try{const S=await(0,t.withTimeout)(async({signal:j})=>{const s={...T,body:Array.isArray(u)?(0,n.stringify)(u.map(B=>({jsonrpc:"2.0",id:B.id??r.idCache.take(),...B}))):(0,n.stringify)({jsonrpc:"2.0",id:u.id??r.idCache.take(),...u}),headers:{"Content-Type":"application/json",...w},method:p||"POST",signal:O||(b>0?j:null)},y=new Request(a,s),g=await l?.(y,s)??{...s,url:a};return await d(g.url??a,g)},{errorInstance:new e.TimeoutError({body:u,url:a}),timeout:b,signal:!0});f&&await f(S);let m;if(S.headers.get("Content-Type")?.startsWith("application/json"))m=await S.json();else{m=await S.text();try{m=JSON.parse(m||"{}")}catch(j){if(S.ok)throw j;m={error:m}}}if(!S.ok)throw new e.HttpRequestError({body:u,details:(0,n.stringify)(m.error)||S.statusText,headers:S.headers,status:S.status,url:a});return m}catch(S){throw S instanceof e.HttpRequestError||S instanceof e.TimeoutError?S:new e.HttpRequestError({body:u,cause:S,url:a})}}}}return Na}var La={},af={},b1;function T_(){return b1||(b1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.socketClientCache=void 0,e.getSocketRpcClient=a;const t=Bt(),n=kf(),r=t0(),i=A_();e.socketClientCache=new Map;async function a(o){const{getSocket:c,keepAlive:u=!0,key:d="socket",reconnect:l=!0,url:f}=o,{interval:b=3e4}=typeof u=="object"?u:{},{attempts:T=5,delay:w=2e3}=typeof l=="object"?l:{},p=JSON.stringify({keepAlive:u,key:d,url:f,reconnect:l});let O=e.socketClientCache.get(p);if(O)return O;let S=0;const{schedule:m}=(0,n.createBatchScheduler)({id:p,fn:async()=>{const y=new Map,g=new Map;let E,B,_,v=!1;function C(){if(l&&S{await q().catch(console.error),v=!1},w)}else y.clear(),g.clear()}async function q(){const R=await c({onClose(){for(const H of y.values())H.onError?.(new t.SocketClosedError({url:f}));for(const H of g.values())H.onError?.(new t.SocketClosedError({url:f}));C()},onError(H){E=H;for(const F of y.values())F.onError?.(E);for(const F of g.values())F.onError?.(E);C()},onOpen(){E=void 0,S=0},onResponse(H){const F=H.method==="eth_subscription",k=F?H.params.subscription:H.id,h=F?g:y,M=h.get(k);M&&M.onResponse(H),F||h.delete(k)}});if(B=R,u&&(_&&clearInterval(_),_=setInterval(()=>B.ping?.(),b)),l&&g.size>0){const H=g.entries();for(const[F,{onResponse:k,body:h,onError:M}]of H)h&&(g.delete(F),O?.request({body:h,onResponse:k,onError:M}))}return R}return await q(),E=void 0,O={close(){_&&clearInterval(_),B.close(),e.socketClientCache.delete(p)},get socket(){return B},request({body:R,onError:H,onResponse:F}){E&&H&&H(E);const k=R.id??i.idCache.take(),h=M=>{typeof M.id=="number"&&k!==M.id||(R.method==="eth_subscribe"&&typeof M.result=="string"&&g.set(M.result,{onResponse:h,onError:H,body:R}),F(M))};R.method==="eth_unsubscribe"&&g.delete(R.params?.[0]),y.set(k,{onResponse:h,onError:H});try{B.request({body:{jsonrpc:"2.0",id:k,...R}})}catch(M){H?.(M)}},requestAsync({body:R,timeout:H=1e4}){return(0,r.withTimeout)(()=>new Promise((F,k)=>this.request({body:R,onError:k,onResponse:F})),{errorInstance:new t.TimeoutError({body:R,url:f}),timeout:H})},requests:y,subscriptions:g,url:f},e.socketClientCache.set(p,O),[O]}}),[j,[s]]=await m();return s}})(af)),af}const e6=Z2(tv);var m1;function n0(){if(m1)return La;m1=1,Object.defineProperty(La,"__esModule",{value:!0}),La.getWebSocketRpcClient=n;const e=Bt(),t=T_();async function n(r,i={}){const{keepAlive:a,reconnect:o}=i;return(0,t.getSocketRpcClient)({async getSocket({onClose:c,onError:u,onOpen:d,onResponse:l}){const f=await Promise.resolve().then(()=>e6).then(O=>O.WebSocket),b=new f(r);function T(){b.removeEventListener("close",T),b.removeEventListener("message",w),b.removeEventListener("error",u),b.removeEventListener("open",d),c()}function w({data:O}){if(!(typeof O=="string"&&O.trim().length===0))try{const S=JSON.parse(O);l(S)}catch(S){u(S)}}b.addEventListener("close",T),b.addEventListener("message",w),b.addEventListener("error",u),b.addEventListener("open",d),b.readyState===f.CONNECTING&&await new Promise((O,S)=>{b&&(b.onopen=O,b.onerror=S)});const{close:p}=b;return Object.assign(b,{close(){p.bind(b)(),T()},ping(){try{if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new e.WebSocketRequestError({url:b.url,cause:new e.SocketClosedError({url:b.url})});const O={jsonrpc:"2.0",id:null,method:"net_version",params:[]};b.send(JSON.stringify(O))}catch(O){u(O)}},request({body:O}){if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new e.WebSocketRequestError({body:O,url:b.url,cause:new e.SocketClosedError({url:b.url})});return b.send(JSON.stringify(O))}})},keepAlive:a,reconnect:o,url:r})}return La}var h1;function S_(){if(h1)return vn;h1=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.rpc=void 0,vn.getSocket=i;const e=r0(),t=n0();function n(a,{body:o,onError:c,onResponse:u}){return a.request({body:o,onError:c,onResponse:u}),a}async function r(a,{body:o,timeout:c=1e4}){return a.requestAsync({body:o,timeout:c})}async function i(a){const o=await(0,t.getWebSocketRpcClient)(a);return Object.assign(o.socket,{requests:o.requests,subscriptions:o.subscriptions})}return vn.rpc={http(a,o){return(0,e.getHttpRpcClient)(a).request(o)},webSocket:n,webSocketAsync:r},vn}var Ua={},za={},qo={},y1;function I_(){return y1||(y1=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.presignMessagePrefix=void 0,qo.presignMessagePrefix=`Ethereum Signed Message:
+`),qo}var g1;function B_(){if(g1)return za;g1=1,Object.defineProperty(za,"__esModule",{value:!0}),za.toPrefixedMessage=i;const e=I_(),t=De(),n=st(),r=ie();function i(a){const o=typeof a=="string"?(0,r.stringToHex)(a):typeof a.raw=="string"?a.raw:(0,r.bytesToHex)(a.raw),c=(0,r.stringToHex)(`${e.presignMessagePrefix}${(0,n.size)(o)}`);return(0,t.concat)([c,o])}return za}var p1;function li(){if(p1)return Ua;p1=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.hashMessage=n;const e=at(),t=B_();function n(r,i){return(0,e.keccak256)((0,t.toPrefixedMessage)(r),i)}return Ua}var Fr={},Lr={},Xt={},_1;function R_(){if(_1)return Xt;_1=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.InvalidStructTypeError=Xt.InvalidPrimaryTypeError=Xt.InvalidDomainError=void 0;const e=Ve(),t=fe();class n extends t.BaseError{constructor({domain:o}){super(`Invalid domain "${(0,e.stringify)(o)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}Xt.InvalidDomainError=n;class r extends t.BaseError{constructor({primaryType:o,types:c}){super(`Invalid primary type \`${o}\` must be one of \`${JSON.stringify(Object.keys(c))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}Xt.InvalidPrimaryTypeError=r;class i extends t.BaseError{constructor({type:o}){super(`Struct type "${o}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}return Xt.InvalidStructTypeError=i,Xt}var v1;function ud(){if(v1)return Lr;v1=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.serializeTypedData=d,Lr.validateTypedData=l,Lr.getTypesForEIP712Domain=f,Lr.domainSeparator=b;const e=qe(),t=St(),n=R_(),r=ct(),i=st(),a=ie(),o=Du(),c=bi(),u=Ve();function d(w){const{domain:p,message:O,primaryType:S,types:m}=w,j=(g,E)=>{const B={...E};for(const _ of g){const{name:v,type:C}=_;C==="address"&&(B[v]=B[v].toLowerCase())}return B},s=m.EIP712Domain?p?j(m.EIP712Domain,p):{}:{},y=(()=>{if(S!=="EIP712Domain")return j(m[S],O)})();return(0,u.stringify)({domain:s,message:y,primaryType:S,types:m})}function l(w){const{domain:p,message:O,primaryType:S,types:m}=w,j=(s,y)=>{for(const g of s){const{name:E,type:B}=g,_=y[E],v=B.match(o.integerRegex);if(v&&(typeof _=="number"||typeof _=="bigint")){const[R,H,F]=v;(0,a.numberToHex)(_,{signed:H==="int",size:Number.parseInt(F,10)/8})}if(B==="address"&&typeof _=="string"&&!(0,r.isAddress)(_))throw new t.InvalidAddressError({address:_});const C=B.match(o.bytesRegex);if(C){const[R,H]=C;if(H&&(0,i.size)(_)!==Number.parseInt(H,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(H,10),givenSize:(0,i.size)(_)})}const q=m[B];q&&(T(B),j(q,_))}};if(m.EIP712Domain&&p){if(typeof p!="object")throw new n.InvalidDomainError({domain:p});j(m.EIP712Domain,p)}if(S!=="EIP712Domain")if(m[S])j(m[S],O);else throw new n.InvalidPrimaryTypeError({primaryType:S,types:m})}function f({domain:w}){return[typeof w?.name=="string"&&{name:"name",type:"string"},w?.version&&{name:"version",type:"string"},(typeof w?.chainId=="number"||typeof w?.chainId=="bigint")&&{name:"chainId",type:"uint256"},w?.verifyingContract&&{name:"verifyingContract",type:"address"},w?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function b({domain:w}){return(0,c.hashDomain)({domain:w,types:{EIP712Domain:f({domain:w})}})}function T(w){if(w==="address"||w==="bool"||w==="string"||w.startsWith("bytes")||w.startsWith("uint")||w.startsWith("int"))throw new n.InvalidStructTypeError({type:w})}return Lr}var E1;function bi(){if(E1)return Fr;E1=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.hashTypedData=a,Fr.hashDomain=o,Fr.hashStruct=c,Fr.encodeType=l;const e=It(),t=De(),n=ie(),r=at(),i=ud();function a(T){const{domain:w={},message:p,primaryType:O}=T,S={EIP712Domain:(0,i.getTypesForEIP712Domain)({domain:w}),...T.types};(0,i.validateTypedData)({domain:w,message:p,primaryType:O,types:S});const m=["0x1901"];return w&&m.push(o({domain:w,types:S})),O!=="EIP712Domain"&&m.push(c({data:p,primaryType:O,types:S})),(0,r.keccak256)((0,t.concat)(m))}function o({domain:T,types:w}){return c({data:T,primaryType:"EIP712Domain",types:w})}function c({data:T,primaryType:w,types:p}){const O=u({data:T,primaryType:w,types:p});return(0,r.keccak256)(O)}function u({data:T,primaryType:w,types:p}){const O=[{type:"bytes32"}],S=[d({primaryType:w,types:p})];for(const m of p[w]){const[j,s]=b({types:p,name:m.name,type:m.type,value:T[m.name]});O.push(j),S.push(s)}return(0,e.encodeAbiParameters)(O,S)}function d({primaryType:T,types:w}){const p=(0,n.toHex)(l({primaryType:T,types:w}));return(0,r.keccak256)(p)}function l({primaryType:T,types:w}){let p="";const O=f({primaryType:T,types:w});O.delete(T);const S=[T,...Array.from(O).sort()];for(const m of S)p+=`${m}(${w[m].map(({name:j,type:s})=>`${s} ${j}`).join(",")})`;return p}function f({primaryType:T,types:w},p=new Set){const S=T.match(/^\w*/u)?.[0];if(p.has(S)||w[S]===void 0)return p;p.add(S);for(const m of w[S])f({primaryType:m.type,types:w},p);return p}function b({types:T,name:w,type:p,value:O}){if(T[p]!==void 0)return[{type:"bytes32"},(0,r.keccak256)(u({data:O,primaryType:p,types:T}))];if(p==="bytes")return[{type:"bytes32"},(0,r.keccak256)(O)];if(p==="string")return[{type:"bytes32"},(0,r.keccak256)((0,n.toHex)(O))];if(p.lastIndexOf("]")===p.length-1){const S=p.slice(0,p.lastIndexOf("[")),m=O.map(j=>b({name:w,type:S,types:T,value:j}));return[{type:"bytes32"},(0,r.keccak256)((0,e.encodeAbiParameters)(m.map(([j])=>j),m.map(([,j])=>j)))]}return[{type:p},O]}return Fr}var Da={},Ur={},w1;function o0(){return w1||(w1=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.zeroHash=Ur.erc6492MagicBytes=void 0,Ur.erc6492MagicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",Ur.zeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),Ur}var j1;function i0(){if(j1)return Da;j1=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.isErc6492Signature=n;const e=o0(),t=vt();function n(r){return(0,t.sliceHex)(r,-32)===e.erc6492MagicBytes}return Da}var Ga={},Ho={},cf={},Ce={},et={},En={},Mo={},P1;function t6(){if(P1)return Mo;P1=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.LruMap=void 0;class e extends Map{constructor(n){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=n}get(n){const r=super.get(n);return super.has(n)&&r!==void 0&&(this.delete(n),super.set(n,r)),r}set(n,r){if(super.set(n,r),this.maxSize&&this.size>this.maxSize){const i=this.keys().next().value;i&&this.delete(i)}return this}}return Mo.LruMap=e,Mo}var A1;function r6(){if(A1)return En;A1=1,Object.defineProperty(En,"__esModule",{value:!0}),En.checksum=void 0,En.clear=n;const e=t6(),t={checksum:new e.LruMap(8192)};En.checksum=t.checksum;function n(){for(const r of Object.values(t))r.clear()}return En}var zr={},Dr={},tt={},Je={},uf={},ko={},T1;function n6(){return T1||(T1=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.crypto=void 0,ko.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),ko}var S1;function Ar(){return S1||(S1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=i,e.ahash=a,e.aexists=o,e.aoutput=c,e.u8=u,e.u32=d,e.clean=l,e.createView=f,e.rotr=b,e.rotl=T,e.byteSwap=w,e.byteSwap32=p,e.bytesToHex=m,e.hexToBytes=y,e.asyncLoop=E,e.utf8ToBytes=B,e.bytesToUtf8=_,e.toBytes=v,e.kdfInputToBytes=C,e.concatBytes=q,e.checkOpts=R,e.createHasher=F,e.createOptHasher=k,e.createXOFer=h,e.randomBytes=M;const t=n6();function n(A){return A instanceof Uint8Array||ArrayBuffer.isView(A)&&A.constructor.name==="Uint8Array"}function r(A){if(!Number.isSafeInteger(A)||A<0)throw new Error("positive integer expected, got "+A)}function i(A,...P){if(!n(A))throw new Error("Uint8Array expected");if(P.length>0&&!P.includes(A.length))throw new Error("Uint8Array expected of length "+P+", got length="+A.length)}function a(A){if(typeof A!="function"||typeof A.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(A.outputLen),r(A.blockLen)}function o(A,P=!0){if(A.destroyed)throw new Error("Hash instance has been destroyed");if(P&&A.finished)throw new Error("Hash#digest() has already been called")}function c(A,P){i(A);const I=P.outputLen;if(A.length>>P}function T(A,P){return A< >>32-P>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function w(A){return A<<24&4278190080|A<<8&16711680|A>>>8&65280|A>>>24&255}e.swap8IfBE=e.isLE?A=>A:A=>w(A),e.byteSwapIfBE=e.swap8IfBE;function p(A){for(let P=0;PA:p;const O=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",S=Array.from({length:256},(A,P)=>P.toString(16).padStart(2,"0"));function m(A){if(i(A),O)return A.toHex();let P="";for(let I=0;I=j._0&&A<=j._9)return A-j._0;if(A>=j.A&&A<=j.F)return A-(j.A-10);if(A>=j.a&&A<=j.f)return A-(j.a-10)}function y(A){if(typeof A!="string")throw new Error("hex string expected, got "+typeof A);if(O)return Uint8Array.fromHex(A);const P=A.length,I=P/2;if(P%2)throw new Error("hex string expected, got unpadded hex of length "+P);const x=new Uint8Array(I);for(let N=0,U=0;N{};e.nextTick=g;async function E(A,P,I){let x=Date.now();for(let N=0;N=0&&UA().update(v(x)).digest(),I=A();return P.outputLen=I.outputLen,P.blockLen=I.blockLen,P.create=()=>A(),P}function k(A){const P=(x,N)=>A(N).update(v(x)).digest(),I=A({});return P.outputLen=I.outputLen,P.blockLen=I.blockLen,P.create=x=>A(x),P}function h(A){const P=(x,N)=>A(N).update(v(x)).digest(),I=A({});return P.outputLen=I.outputLen,P.blockLen=I.blockLen,P.create=x=>A(x),P}e.wrapConstructor=F,e.wrapConstructorWithOpts=k,e.wrapXOFConstructorWithOpts=h;function M(A=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(A));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(A));throw new Error("crypto.getRandomValues must be defined")}})(uf)),uf}var I1;function O_(){if(I1)return Je;I1=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.SHA512_IV=Je.SHA384_IV=Je.SHA224_IV=Je.SHA256_IV=Je.HashMD=void 0,Je.setBigUint64=t,Je.Chi=n,Je.Maj=r;const e=Ar();function t(a,o,c,u){if(typeof a.setBigUint64=="function")return a.setBigUint64(o,c,u);const d=BigInt(32),l=BigInt(4294967295),f=Number(c>>d&l),b=Number(c&l),T=u?4:0,w=u?0:4;a.setUint32(o+T,f,u),a.setUint32(o+w,b,u)}function n(a,o,c){return a&o^~a&c}function r(a,o,c){return a&o^a&c^o&c}class i extends e.Hash{constructor(o,c,u,d){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=o,this.outputLen=c,this.padOffset=u,this.isLE=d,this.buffer=new Uint8Array(o),this.view=(0,e.createView)(this.buffer)}update(o){(0,e.aexists)(this),o=(0,e.toBytes)(o),(0,e.abytes)(o);const{view:c,buffer:u,blockLen:d}=this,l=o.length;for(let f=0;fd-f&&(this.process(u,0),f=0);for(let O=f;O