UNPKG

phala

Version:
34 lines 544 kB
#!/usr/bin/env node import { createRequire } from 'module';const require = createRequire(import.meta.url); var A2=Object.create;var wf=Object.defineProperty;var T2=Object.getOwnPropertyDescriptor;var $2=Object.getOwnPropertyNames;var R2=Object.getPrototypeOf,M2=Object.prototype.hasOwnProperty;var Bn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var P=(e,t)=>()=>(e&&(t=e(e=0)),t);var Jt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cf=(e,t)=>{for(var r in t)wf(e,r,{get:t[r],enumerable:!0})},F2=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $2(t))!M2.call(e,o)&&o!==r&&wf(e,o,{get:()=>t[o],enumerable:!(n=T2(t,o))||n.enumerable});return e};var hi=(e,t,r)=>(r=e!=null?A2(R2(e)):{},F2(t||!e||!e.__esModule?wf(r,"default",{value:e,enumerable:!0}):r,e));var Yg=Jt((R$,Zg)=>{var us=1e3,ps=us*60,ls=ps*60,Eo=ls*24,H2=Eo*7,V2=Eo*365.25;Zg.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return G2(e);if(r==="number"&&isFinite(e))return t.long?K2(e):q2(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function G2(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*V2;case"weeks":case"week":case"w":return r*H2;case"days":case"day":case"d":return r*Eo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ls;case"minutes":case"minute":case"mins":case"min":case"m":return r*ps;case"seconds":case"second":case"secs":case"sec":case"s":return r*us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function q2(e){var t=Math.abs(e);return t>=Eo?Math.round(e/Eo)+"d":t>=ls?Math.round(e/ls)+"h":t>=ps?Math.round(e/ps)+"m":t>=us?Math.round(e/us)+"s":e+"ms"}function K2(e){var t=Math.abs(e);return t>=Eo?Xc(e,t,Eo,"day"):t>=ls?Xc(e,t,ls,"hour"):t>=ps?Xc(e,t,ps,"minute"):t>=us?Xc(e,t,us,"second"):e+" ms"}function Xc(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var _f=Jt((M$,Xg)=>{function W2(e){r.debug=r,r.default=r,r.coerce=c,r.disable=a,r.enable=o,r.enabled=i,r.humanize=Yg(),r.destroy=m,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let p=0;for(let l=0;l<u.length;l++)p=(p<<5)-p+u.charCodeAt(l),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(u){let p,l=null,d,g;function h(...y){if(!h.enabled)return;let b=h,x=Number(new Date),v=x-(p||x);b.diff=v,b.prev=p,b.curr=x,p=x,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let S=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(I,_)=>{if(I==="%%")return"%";S++;let R=r.formatters[_];if(typeof R=="function"){let F=y[S];I=R.call(b,F),y.splice(S,1),S--}return I}),r.formatArgs.call(b,y),(b.log||r.log).apply(b,y)}return h.namespace=u,h.useColors=r.useColors(),h.color=r.selectColor(u),h.extend=n,h.destroy=r.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(d!==r.namespaces&&(d=r.namespaces,g=r.enabled(u)),g),set:y=>{l=y}}),typeof r.init=="function"&&r.init(h),h}function n(u,p){let l=r(this.namespace+(typeof p>"u"?":":p)+u);return l.log=this.log,l}function o(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let p=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let l of p)l[0]==="-"?r.skips.push(l.slice(1)):r.names.push(l)}function s(u,p){let l=0,d=0,g=-1,h=0;for(;l<u.length;)if(d<p.length&&(p[d]===u[l]||p[d]==="*"))p[d]==="*"?(g=d,h=l,d++):(l++,d++);else if(g!==-1)d=g+1,h++,l=h;else return!1;for(;d<p.length&&p[d]==="*";)d++;return d===p.length}function a(){let u=[...r.names,...r.skips.map(p=>"-"+p)].join(",");return r.enable(""),u}function i(u){for(let p of r.skips)if(s(u,p))return!1;for(let p of r.names)if(s(u,p))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Xg.exports=W2});var Qg=Jt((kt,Qc)=>{kt.formatArgs=Z2;kt.save=Y2;kt.load=X2;kt.useColors=J2;kt.storage=Q2();kt.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();kt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function J2(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Z2(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Qc.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),e.splice(n,0,t)}kt.log=console.debug||console.log||(()=>{});function Y2(e){try{e?kt.storage.setItem("debug",e):kt.storage.removeItem("debug")}catch{}}function X2(){let e;try{e=kt.storage.getItem("debug")||kt.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Q2(){try{return localStorage}catch{}}Qc.exports=_f()(kt);var{formatters:eS}=Qc.exports;eS.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var th=Jt((Je,tm)=>{var tS=Bn("tty"),em=Bn("util");Je.init=cS;Je.log=sS;Je.formatArgs=nS;Je.save=aS;Je.load=iS;Je.useColors=rS;Je.destroy=em.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Je.colors=[6,2,3,4,5,1];try{let e=Bn("supports-color");e&&(e.stderr||e).level>=2&&(Je.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Je.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function rS(){return"colors"in Je.inspectOpts?!!Je.inspectOpts.colors:tS.isatty(process.stderr.fd)}function nS(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(` `).join(` `+s),e.push(o+"m+"+tm.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=oS()+t+" "+e[0]}function oS(){return Je.inspectOpts.hideDate?"":new Date().toISOString()+" "}function sS(...e){return process.stderr.write(em.formatWithOptions(Je.inspectOpts,...e)+` `)}function aS(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function iS(){return process.env.DEBUG}function cS(e){e.inspectOpts={};let t=Object.keys(Je.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Je.inspectOpts[t[r]]}tm.exports=_f()(Je);var{formatters:eh}=tm.exports;eh.o=function(e){return this.inspectOpts.colors=this.useColors,em.inspect(e,this.inspectOpts).split(` `).map(t=>t.trim()).join(" ")};eh.O=function(e){return this.inspectOpts.colors=this.useColors,em.inspect(e,this.inspectOpts)}});var rh=Jt((F$,If)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?If.exports=Qg():If.exports=th()});var Pf,oh=P(()=>{Pf="2.38.6"});function sh(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?sh(e.cause,t):t?null:e}var Af,w,K=P(()=>{oh();Af={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${Pf}`},w=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,s=Af.getDocsUrl?.({...r,docsPath:o}),a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...Af.version?[`Version: ${Af.version}`]:[]].join(` `);super(a,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{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,"metaMessages",{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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=Pf}walk(t){return sh(this,t)}}});var fs,rm,nm,om,bi=P(()=>{K();fs=class extends w{constructor({max:t,min:r,signed:n,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},rm=class extends w{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}},nm=class extends w{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}},om=class extends w{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function xe(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var Dt=P(()=>{});function re(e){return xe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var Zt=P(()=>{Dt()});function Ze(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let o=0;o<r.length-1&&r[t==="left"?o:r.length-o-1].toString()==="0";o++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}var Io=P(()=>{});var xi,vi,wi,sm=P(()=>{K();xi=class extends w{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},vi=class extends w{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}},wi=class extends w{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}});function Ln(e,{dir:t,size:r=32}={}){return typeof e=="string"?sn(e,{dir:t,size:r}):mS(e,{dir:t,size:r})}function sn(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new vi({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function mS(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new vi({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let o=0;o<r;o++){let s=t==="right";n[s?o:r-o-1]=e[s?o:e.length-o-1]}return n}var am=P(()=>{sm()});function he(e,t={}){return typeof e=="number"||typeof e=="bigint"?k(e,t):typeof e=="string"?hr(e,t):typeof e=="boolean"?im(e,t):ne(e,t)}function im(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Et(r,{size:t.size}),Ln(r,{size:t.size})):r}function ne(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=uS[e[o]];let n=`0x${r}`;return typeof t.size=="number"?(Et(n,{size:t.size}),Ln(n,{dir:"right",size:t.size})):n}function k(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof s=="bigint"&&r?-s-1n:0;if(s&&o>s||o<a){let c=typeof e=="bigint"?"n":"";throw new fs({max:s?`${s}${c}`:void 0,min:`${a}${c}`,signed:r,size:n,value:`${e}${c}`})}let i=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?Ln(i,{size:n}):i}function hr(e,t={}){let r=pS.encode(e);return ne(r,t)}var uS,pS,D=P(()=>{bi();am();Ge();uS=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));pS=new TextEncoder});function Yt(e,t={}){return typeof e=="number"||typeof e=="bigint"?dS(e,t):typeof e=="boolean"?fS(e,t):xe(e)?qe(e,t):yr(e,t)}function fS(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Et(r,{size:t.size}),Ln(r,{size:t.size})):r}function ah(e){if(e>=an.zero&&e<=an.nine)return e-an.zero;if(e>=an.A&&e<=an.F)return e-(an.A-10);if(e>=an.a&&e<=an.f)return e-(an.a-10)}function qe(e,t={}){let r=e;t.size&&(Et(r,{size:t.size}),r=Ln(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let o=n.length/2,s=new Uint8Array(o);for(let a=0,i=0;a<o;a++){let c=ah(n.charCodeAt(i++)),m=ah(n.charCodeAt(i++));if(c===void 0||m===void 0)throw new w(`Invalid byte sequence ("${n[i-2]}${n[i-1]}" in "${n}").`);s[a]=c*16+m}return s}function dS(e,t){let r=k(e,t);return qe(r)}function yr(e,t={}){let r=lS.encode(e);return typeof t.size=="number"?(Et(r,{size:t.size}),Ln(r,{dir:"right",size:t.size})):r}var lS,an,Ye=P(()=>{K();Dt();am();Ge();D();lS=new TextEncoder;an={zero:48,nine:57,A:65,F:70,a:97,f:102}});function Et(e,{size:t}){if(re(e)>t)throw new om({givenSize:re(e),maxSize:t})}function ye(e,t={}){let{signed:r}=t;t.size&&Et(e,{size:t.size});let n=BigInt(e);if(!r)return n;let o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Tf(e,t={}){let r=e;if(t.size&&(Et(r,{size:t.size}),r=Ze(r)),Ze(r)==="0x00")return!1;if(Ze(r)==="0x01")return!0;throw new nm(r)}function Ae(e,t={}){return Number(ye(e,t))}var Ge=P(()=>{bi();Zt();Io()});function ds(e,t){return({exclude:r,format:n})=>({exclude:r,format:(o,s)=>{let a=t(o,s);if(r)for(let i of r)delete a[i];return{...a,...n(o,s)}},type:e})}var cm=P(()=>{});function _t(e,t){let r={};return typeof e.authorizationList<"u"&&(r.authorizationList=yS(e.authorizationList)),typeof e.accessList<"u"&&(r.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(r.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?r.blobs=e.blobs.map(n=>ne(n)):r.blobs=e.blobs),typeof e.data<"u"&&(r.data=e.data),e.account&&(r.from=e.account.address),typeof e.from<"u"&&(r.from=e.from),typeof e.gas<"u"&&(r.gas=k(e.gas)),typeof e.gasPrice<"u"&&(r.gasPrice=k(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=k(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(r.maxFeePerGas=k(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=k(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(r.nonce=k(e.nonce)),typeof e.to<"u"&&(r.to=e.to),typeof e.type<"u"&&(r.type=hS[e.type]),typeof e.value<"u"&&(r.value=k(e.value)),r}function yS(e){return e.map(t=>({address:t.address,r:t.r?k(BigInt(t.r)):t.r,s:t.s?k(BigInt(t.s)):t.s,chainId:k(t.chainId),nonce:k(t.nonce),...typeof t.yParity<"u"?{yParity:k(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:k(t.v)}:{}}))}var hS,Dn=P(()=>{D();hS={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"}});var ER,_R,IR,PR,AR,TR,$R,RR,MR,FR,BR,NR,LR,DR,UR,zR,OR,jR,HR,VR,GR,qR,KR,WR,JR,ZR,YR,XR,QR,eM,tM,rM,nM,oM,sM,aM,iM,cM,mM,uM,pM,lM,fM,dM,gM,hM,yM,bM,xM,vM,wM,CM,SM,kM,EM,_M,IM,PM,AM,TM,$M,RM,MM,FM,BM,NM,LM,DM,UM,zM,OM,jM,HM,VM,GM,qM,KM,WM,JM,ZM,YM,XM,QM,eF,tF,rF,nF,oF,sF,aF,iF,cF,mF,uF,pF,gs,Mf=P(()=>{ER=2n**(8n-1n)-1n,_R=2n**(16n-1n)-1n,IR=2n**(24n-1n)-1n,PR=2n**(32n-1n)-1n,AR=2n**(40n-1n)-1n,TR=2n**(48n-1n)-1n,$R=2n**(56n-1n)-1n,RR=2n**(64n-1n)-1n,MR=2n**(72n-1n)-1n,FR=2n**(80n-1n)-1n,BR=2n**(88n-1n)-1n,NR=2n**(96n-1n)-1n,LR=2n**(104n-1n)-1n,DR=2n**(112n-1n)-1n,UR=2n**(120n-1n)-1n,zR=2n**(128n-1n)-1n,OR=2n**(136n-1n)-1n,jR=2n**(144n-1n)-1n,HR=2n**(152n-1n)-1n,VR=2n**(160n-1n)-1n,GR=2n**(168n-1n)-1n,qR=2n**(176n-1n)-1n,KR=2n**(184n-1n)-1n,WR=2n**(192n-1n)-1n,JR=2n**(200n-1n)-1n,ZR=2n**(208n-1n)-1n,YR=2n**(216n-1n)-1n,XR=2n**(224n-1n)-1n,QR=2n**(232n-1n)-1n,eM=2n**(240n-1n)-1n,tM=2n**(248n-1n)-1n,rM=2n**(256n-1n)-1n,nM=-(2n**(8n-1n)),oM=-(2n**(16n-1n)),sM=-(2n**(24n-1n)),aM=-(2n**(32n-1n)),iM=-(2n**(40n-1n)),cM=-(2n**(48n-1n)),mM=-(2n**(56n-1n)),uM=-(2n**(64n-1n)),pM=-(2n**(72n-1n)),lM=-(2n**(80n-1n)),fM=-(2n**(88n-1n)),dM=-(2n**(96n-1n)),gM=-(2n**(104n-1n)),hM=-(2n**(112n-1n)),yM=-(2n**(120n-1n)),bM=-(2n**(128n-1n)),xM=-(2n**(136n-1n)),vM=-(2n**(144n-1n)),wM=-(2n**(152n-1n)),CM=-(2n**(160n-1n)),SM=-(2n**(168n-1n)),kM=-(2n**(176n-1n)),EM=-(2n**(184n-1n)),_M=-(2n**(192n-1n)),IM=-(2n**(200n-1n)),PM=-(2n**(208n-1n)),AM=-(2n**(216n-1n)),TM=-(2n**(224n-1n)),$M=-(2n**(232n-1n)),RM=-(2n**(240n-1n)),MM=-(2n**(248n-1n)),FM=-(2n**(256n-1n)),BM=2n**8n-1n,NM=2n**16n-1n,LM=2n**24n-1n,DM=2n**32n-1n,UM=2n**40n-1n,zM=2n**48n-1n,OM=2n**56n-1n,jM=2n**64n-1n,HM=2n**72n-1n,VM=2n**80n-1n,GM=2n**88n-1n,qM=2n**96n-1n,KM=2n**104n-1n,WM=2n**112n-1n,JM=2n**120n-1n,ZM=2n**128n-1n,YM=2n**136n-1n,XM=2n**144n-1n,QM=2n**152n-1n,eF=2n**160n-1n,tF=2n**168n-1n,rF=2n**176n-1n,nF=2n**184n-1n,oF=2n**192n-1n,sF=2n**200n-1n,aF=2n**208n-1n,iF=2n**216n-1n,cF=2n**224n-1n,mF=2n**232n-1n,uF=2n**240n-1n,pF=2n**248n-1n,gs=2n**256n-1n});function Oe(e){return typeof e[0]=="string"?Xe(e):bS(e)}function bS(e){let t=0;for(let o of e)t+=o.length;let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function Xe(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var yt=P(()=>{});var ki,hs,mm,Ff=P(()=>{K();ki=class extends w{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},hs=class extends w{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},mm=class extends w{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function ys(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(xS);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}var xS,um=P(()=>{Ff();xS={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 mm({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new hs({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ki({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ki({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}}});var pm,lh,lm=P(()=>{pm={gwei:9,wei:18},lh={ether:-9,wei:9}});function fm(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[o,s]=[r.slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${s?`.${s}`:""}`}var Bf=P(()=>{});function bs(e,t="wei"){return fm(e,pm[t])}var dm=P(()=>{lm();Bf()});function Ke(e,t="wei"){return fm(e,lh[t])}var xs=P(()=>{lm();Bf()});function Ao(e){let t=Object.entries(e).map(([n,o])=>o===void 0||o===!1?null:[n,o]).filter(Boolean),r=t.reduce((n,[o])=>Math.max(n,o.length),0);return t.map(([n,o])=>` ${`${n}:`.padEnd(r+1)} ${o}`).join(` `)}var gm,hm,ym,bm,xm,vs,ws,Cs,vm,Ut=P(()=>{dm();xs();K();gm=class extends w{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"})}},hm=class extends w{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}},ym=class extends w{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ao(t),"}","","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"})}},bm=class extends w{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}},xm=class extends w{constructor(t,{account:r,docsPath:n,chain:o,data:s,gas:a,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:m,nonce:u,to:p,value:l}){let d=Ao({chain:o&&`${o?.name} (id: ${o?.id})`,from:r?.address,to:p,value:typeof l<"u"&&`${bs(l)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:a,gasPrice:typeof i<"u"&&`${Ke(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${Ke(c)} gwei`,maxPriorityFeePerGas:typeof m<"u"&&`${Ke(m)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",d].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}},vs=class extends w{constructor({blockHash:t,blockNumber:r,blockTag:n,hash:o,index:s}){let a="Transaction";n&&s!==void 0&&(a=`Transaction at block time "${n}" at index "${s}"`),t&&s!==void 0&&(a=`Transaction at block hash "${t}" at index "${s}"`),r&&s!==void 0&&(a=`Transaction at block number "${r}" at index "${s}"`),o&&(a=`Transaction with hash "${o}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}},ws=class extends w{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}},Cs=class extends w{constructor({receipt:t}){super(`Transaction with hash "${t.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=t}},vm=class extends w{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}});function CS(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Nf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function To(e,...t){if(!CS(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Is(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function wm(e,t){To(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function dh(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Un(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Cm(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function xr(e,t){return e<<32-t|e>>>t}function kS(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ES(e){for(let t=0;t<e.length;t++)e[t]=kS(e[t]);return e}function _S(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ei(e){return typeof e=="string"&&(e=_S(e)),To(e),e}function Sm(e){let t=n=>e().update(Ei(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}var SS,Lf,_s,km=P(()=>{SS=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;Lf=SS?e=>e:ES;_s=class{}});function PS(e,t=!1){return t?{h:Number(e&_m),l:Number(e>>yh&_m)}:{h:Number(e>>yh&_m)|0,l:Number(e&_m)|0}}function bh(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:a,l:i}=PS(e[s],t);[n[s],o[s]]=[a,i]}return[n,o]}var _m,yh,xh,vh,wh,Ch,Sh=P(()=>{_m=BigInt(4294967295),yh=BigInt(32);xh=(e,t,r)=>e<<r|t>>>32-r,vh=(e,t,r)=>t<<r|e>>>32-r,wh=(e,t,r)=>t<<r-32|e>>>64-r,Ch=(e,t,r)=>e<<r-32|t>>>64-r});var de,vr=P(()=>{K();de=class extends w{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var $o,Mm,Fm,_i,Ro,Ii=P(()=>{K();$o=class extends w{constructor({blockNumber:t,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...t&&n.blockCreated&&n.blockCreated>t?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}},Mm=class extends w{constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} \u2013 ${t.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${t.id} \u2013 ${t.name}`],name:"ChainMismatchError"})}},Fm=class extends w{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"})}},_i=class extends w{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}},Ro=class extends w{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});var mn,Xt,As,Ts,$s,Rs,Ms,Fs,Bs,Ns,Rr,Qt,On=P(()=>{xs();K();mn=class extends w{constructor({cause:t,message:r}={}){let n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(mn,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(mn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});Xt=class extends w{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Ke(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(Xt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});As=class extends w{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Ke(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(As,"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/});Ts=class extends w{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(Ts,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});$s=class extends w{constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` `),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty($s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});Rs=class extends w{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(Rs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Ms=class extends w{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` `),{cause:t,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"})}};Object.defineProperty(Ms,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});Fs=class extends w{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(Fs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});Bs=class extends w{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(Bs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});Ns=class extends w{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(Ns,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Rr=class extends w{constructor({cause:t,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Ke(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Ke(n)} gwei`:""}).`].join(` `),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(Rr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});Qt=class extends w{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}});var er,Ls=P(()=>{er=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}}});function US(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)r[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let i=(a+8)%10,c=(a+2)%10,m=r[c],u=r[c+1],p=Ah(m,u,1)^r[i],l=Th(m,u,1)^r[i+1];for(let d=0;d<50;d+=10)e[a+d]^=p,e[a+d+1]^=l}let o=e[2],s=e[3];for(let a=0;a<24;a++){let i=Rh[a],c=Ah(o,s,i),m=Th(o,s,i),u=$h[a];o=e[u],s=e[u+1],e[u]=c,e[u+1]=m}for(let a=0;a<50;a+=10){for(let i=0;i<10;i++)r[i]=e[a+i];for(let i=0;i<10;i++)e[a+i]^=~r[(i+2)%10]&r[(i+4)%10]}e[0]^=LS[n],e[1]^=DS[n]}Un(r)}var RS,Pi,MS,FS,BS,NS,$h,Rh,Mh,Fh,LS,DS,Ah,Th,Df,zS,Bm,Uf=P(()=>{Sh();km();RS=BigInt(0),Pi=BigInt(1),MS=BigInt(2),FS=BigInt(7),BS=BigInt(256),NS=BigInt(113),$h=[],Rh=[],Mh=[];for(let e=0,t=Pi,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],$h.push(2*(5*n+r)),Rh.push((e+1)*(e+2)/2%64);let o=RS;for(let s=0;s<7;s++)t=(t<<Pi^(t>>FS)*NS)%BS,t&MS&&(o^=Pi<<(Pi<<BigInt(s))-Pi);Mh.push(o)}Fh=bh(Mh,!0),LS=Fh[0],DS=Fh[1],Ah=(e,t,r)=>r>32?wh(e,t,r):xh(e,t,r),Th=(e,t,r)=>r>32?Ch(e,t,r):vh(e,t,r);Df=class e extends _s{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,Nf(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=dh(this.state)}clone(){return this._cloneInto()}keccak(){Lf(this.state32),US(this.state32,this.rounds),Lf(this.state32),this.posOut=0,this.pos=0}update(t){Is(this),t=Ei(t),To(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let a=Math.min(r-this.pos,o-s);for(let i=0;i<a;i++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){Is(this,!1),To(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Nf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(wm(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Un(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:a}=this;return t||(t=new e(r,n,o,a,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}},zS=(e,t,r)=>Sm(()=>new Df(t,e,r)),Bm=zS(1,136,256/8)});function ge(e,t){let r=t||"hex",n=Bm(xe(e,{strict:!1})?Yt(e):e);return r==="bytes"?n:he(n)}var tr=P(()=>{Uf();Dt();Ye();D()});function un(e,t){if(zf.has(`${e}.${t}`))return zf.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=ge(yr(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&o[a]&&(o[a]=o[a].toUpperCase()),(n[a>>1]&15)>=8&&o[a+1]&&(o[a+1]=o[a+1].toUpperCase());let s=`0x${o.join("")}`;return zf.set(`${e}.${t}`,s),s}function Ds(e,t){if(!ae(e,{strict:!1}))throw new de({address:e});return un(e,t)}var zf,jn=P(()=>{vr();Ye();tr();Ls();zt();zf=new er(8192)});function ae(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(Of.has(n))return Of.get(n);let o=OS.test(e)?e.toLowerCase()===e?!0:r?un(e)===e:!0:!1;return Of.set(n,o),o}var OS,Of,zt=P(()=>{Ls();jn();OS=/^0x[a-fA-F0-9]{40}$/,Of=new er(8192)});function rr(e,t,r,{strict:n}={}){return xe(e,{strict:!1})?Nm(e,t,r,{strict:n}):jf(e,t,r,{strict:n})}function Bh(e,t){if(typeof t=="number"&&t>0&&t>re(e)-1)throw new xi({offset:t,position:"start",size:re(e)})}function Nh(e,t,r){if(typeof t=="number"&&typeof r=="number"&&re(e)!==r-t)throw new xi({offset:r,position:"end",size:re(e)})}function jf(e,t,r,{strict:n}={}){Bh(e,t);let o=e.slice(t,r);return n&&Nh(o,t,r),o}function Nm(e,t,r,{strict:n}={}){Bh(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&Nh(o,t,r),o}var Hn=P(()=>{sm();Dt();Zt()});function nr({blockNumber:e,chain:t,contract:r}){let n=t?.contracts?.[r];if(!n)throw new $o({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new $o({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}var Mo=P(()=>{Ii()});function W(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var Re=P(()=>{});var Vh,Om,Gh,jm=P(()=>{Vh={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."},Om={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Gh={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});function We(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Hm(e.type);return`${e.name}(${Ri(e.inputs,{includeName:t})})`}function Ri(e,{includeName:t=!1}={}){return e?e.map(r=>XS(r,{includeName:t})).join(t?", ":","):""}function XS(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ri(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}var pn=P(()=>{Me()});var Vm,Mi,zs,sr,Gm,qm,Km,Wm,Fi,Os,Jm,js,Bi,wr,Hs,Zm,Ym,Xm,Cr,Mr,Qm,eu,Vs,Hm,Me=P(()=>{pn();Zt();K();Vm=class extends w{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` `),{docsPath:t,name:"AbiConstructorNotFoundError"})}},Mi=class extends w{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}},zs=class extends w{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` `),{metaMessages:[`Params: (${Ri(r,{includeName:!0})})`,`Data: ${t} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=r,this.size=n}},sr=class extends w{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}},Gm=class extends w{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(` `),{name:"AbiEncodingArrayLengthMismatchError"})}},qm=class extends w{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${re(r)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},Km=class extends w{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(` `),{name:"AbiEncodingLengthMismatchError"})}},Wm=class extends w{constructor(t,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(` `),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}},Fi=class extends w{constructor(t,{docsPath:r}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` `),{docsPath:r,name:"AbiErrorNotFoundError"})}},Os=class extends w{constructor(t,{docsPath:r}){super([`Encoded error signature "${t}" not found on 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=${t}.`].join(` `),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}},Jm=class extends w{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}},js=class extends w{constructor(t,{docsPath:r}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` `),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}},Bi=class extends w{constructor(t,{docsPath:r}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` `),{docsPath:r,name:"AbiEventNotFoundError"})}},wr=class extends w{constructor(t,{docsPath:r}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` `),{docsPath:r,name:"AbiFunctionNotFoundError"})}},Hs=class extends w{constructor(t,{docsPath:r}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` `),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}},Zm=class extends w{constructor(t,{docsPath:r}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` `),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}},Ym=class extends w{constructor(t,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${We(t.abiItem)}\`, and`,`\`${r.type}\` in \`${We(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},Xm=class extends w{constructor({expectedSize:t,givenSize:r}){super(`Expected bytes${t}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}},Cr=class extends w{constructor({abiItem:t,data:r,params:n,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(` `),{metaMessages:[`Params: (${Ri(n,{includeName:!0})})`,`Data: ${r} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{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,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=r,this.params=n,this.size=o}},Mr=class extends w{constructor({abiItem:t,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${We(t,{includeName:!0})}".`].join(` `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}},Qm=class extends w{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` `),{docsPath:r,name:"InvalidAbiEncodingType"})}},eu=class extends w{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` `),{docsPath:r,name:"InvalidAbiDecodingType"})}},Vs=class extends w{constructor(t){super([`Value "${t}" is not a valid array.`].join(` `),{name:"InvalidArrayError"})}},Hm=class extends w{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` `),{name:"InvalidDefinitionTypeError"})}}});function qh(e){return QS(e)}var QS,Kh=P(()=>{Ye();tr();QS=e=>ge(Yt(e))});var Wh,Jh=P(()=>{Wh="1.1.0"});var De,Gs=P(()=>{Jh();De=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,s=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${Wh}`].join(` `);super(s),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.shortMessage=t}}});function Ot(e,t){return e.exec(t)?.groups}var Vf,Gf,tu,Ni=P(()=>{Vf=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Gf=/^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)?$/,tu=/^\(.+?\).*?$/});function ru(e){let t=e.type;if(Zh.test(e.type)&&"components"in e){t="(";let r=e.components.length;for(let o=0;o<r;o++){let s=e.components[o];t+=ru(s),o<r-1&&(t+=", ")}let n=Ot(Zh,e.type);return t+=`)${n?.array??""}`,ru({...e,type:t})}return"indexed