1import{df as n_,dg as o_,ay as i_}from"./index-1775808227362-b4wnAXMR.js";import{r as a_}from"./index-1775808227362-tcpCDn4g.js";import{r as Up,a as Ht,b as s_}from"./sha3-1775808227362-DVSzrknm.js";function u_(e,r){for(var t=0;t<r.length;t++){const i=r[t];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(i,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function c_(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const d_=c_(),l_=Object.freeze(Object.defineProperty({__proto__:null,WebSocket:d_},Symbol.toStringTag,{value:"Module"}));var Dc={},mn={},Et={},Mr={},mr={},bn={},hn={},Al;function Lp(){if(Al)return hn;Al=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.getSDKVersion=void 0;const e=()=>"9.1.0";return hn.getSDKVersion=e,hn}var yn={},Tl;function f_(){if(Tl)return yn;Tl=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.generateRequestId=void 0;const e=i=>i.toString(16).padStart(2,"0"),r=i=>{const o=new Uint8Array(i/2);return window.crypto.getRandomValues(o),Array.from(o,e).join("")},t=()=>typeof window<"u"?r(10):new Date().getTime().toString(36);return yn.generateRequestId=t,yn}var Il;function Dp(){if(Il)return bn;Il=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.MessageFormatter=void 0;const e=Lp(),r=f_();class t{}return bn.MessageFormatter=t,t.makeRequest=(i,o)=>({id:(0,r.generateRequestId)(),method:i,params:o,env:{sdkVersion:(0,e.getSDKVersion)()}}),t.makeResponse=(i,o,a)=>({id:i,success:!0,version:a,data:o}),t.makeErrorResponse=(i,o,a)=>({id:i,success:!1,error:o,version:a}),bn}var br={},Sl;function Sr(){if(Sl)return br;Sl=1,Object.defineProperty(br,"__esModule",{value:!0}),br.RestrictedMethods=br.Methods=void 0;var e;(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(e||(br.Methods=e={}));var r;return function(t){t.requestAddressBook="requestAddressBook"}(r||(br.RestrictedMethods=r={})),br}var Bl;function m_(){return Bl||(Bl=1,function(e){var r=mr&&mr.__createBinding||(Object.create?function(a,n,s,u){u===void 0&&(u=s);var c=Object.getOwnPropertyDescriptor(n,s);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[s]}}),Object.defineProperty(a,u,c)}:function(a,n,s,u){u===void 0&&(u=s),a[u]=n[s]}),t=mr&&mr.__exportStar||function(a,n){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(n,s)&&r(n,a,s)};Object.defineProperty(e,"__esModule",{value:!0});const i=Dp();class o{constructor(n=null,s=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:u,data:c,source:l})=>{const d=!c,f=!this.isServer&&l===window.parent,p=typeof c.version<"u"&&parseInt(c.version.split(".")[0]),y=typeof p=="number"&&p>=1;let b=!0;return Array.isArray(this.allowedOrigins)&&(b=this.allowedOrigins.find(w=>w.test(u))!==void 0),!d&&f&&y&&b},this.logIncomingMessage=u=>{console.info(`Safe Apps SDK v1: A message was received from origin ${u.origin}. `,u.data)},this.onParentMessage=u=>{this.isValidMessage(u)&&(this.debugMode&&this.logIncomingMessage(u),this.handleIncomingMessage(u.data))},this.handleIncomingMessage=u=>{const{id:c}=u,l=this.callbacks.get(c);l&&(l(u),this.callbacks.delete(c))},this.send=(u,c)=>
1{const l=i.MessageFormatter.makeRequest(u,c);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(l,"*"),new Promise((d,f)=>{this.callbacks.set(l.id,p=>{if(!p.success){f(new Error(p.error));return}d(p)})})},this.allowedOrigins=n,this.debugMode=s,this.isServer||window.addEventListener("message",this.onParentMessage)}}e.default=o,t(Sr(),e)}(mr)),mr}var pn={},hr={},gn={},Rl;function b_(){if(Rl)return gn;Rl=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.isObjectEIP712TypedData=void 0;const e=r=>typeof r=="object"&&r!=null&&"domain"in r&&"types"in r&&"message"in r;return gn.isObjectEIP712TypedData=e,gn}var Gc={},Ol;function h_(){return Ol||(Ol=1,Object.defineProperty(Gc,"__esModule",{value:!0})),Gc}var Vc={},Cl;function y_(){return Cl||(Cl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TransferDirection=e.TransactionStatus=e.TokenType=e.Operation=void 0;var r=a_();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return r.Operation}}),Object.defineProperty(e,"TokenType",{enumerable:!0,get:function(){return r.TokenType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return r.TransactionStatus}}),Object.defineProperty(e,"TransferDirection",{enumerable:!0,get:function(){return r.TransferDirection}})}(Vc)),Vc}var Wc={},xl;function p_(){return xl||(xl=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Sr()),Wc}var ql;function vd(){return ql||(ql=1,function(e){var r=hr&&hr.__createBinding||(Object.create?function(i,o,a,n){n===void 0&&(n=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,n,s)}:function(i,o,a,n){n===void 0&&(n=a),i[n]=o[a]}),t=hr&&hr.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&r(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),t(b_(),e),t(h_(),e),t(y_(),e),t(p_(),e)}(hr)),hr}var Ml;function g_(){if(Ml)return pn;Ml=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.TXs=void 0;const e=Sr(),r=vd();class t{constructor(o){this.communicator=o}async getBySafeTxHash(o){if(!o)throw new Error("Invalid safeTxHash");return(await this.communicator.send(e.Methods.getTxBySafeTxHash,{safeTxHash:o})).data}async signMessage(o){const a={message:o};return(await this.communicator.send(e.Methods.signMessage,a)).data}async signTypedMessage(o){if(!(0,r.isObjectEIP712TypedData)(o))throw new Error("Invalid typed data");return(await this.communicator.send(e.Methods.signTypedMessage,{typedData:o})).data}async send({txs:o,params:a}){if(!o||!o.length)throw new Error("No transactions were passed");const n={txs:o,params:a};return(await this.communicator.send(e.Methods.sendTransactions,n)).data}}return pn.TXs=t,pn}var _n={},vn={},Hl;function Ed(){return Hl||(Hl=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.RPC_CALLS=void 0,vn.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}),vn}var kl;function __(){if(kl)return _n;kl=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.Eth=void 0;const e=Ed(),r=Sr(),t={defaultBlockParam:(o="latest")=>o,returnFullTxObjectParam:(o=!1)=>o,blockNumberToHex:o=>Number.isInteger(o)?`0x${o.toString(16)}`:o};class i{constructor(a){this.communicator=a,this.call=this.buildRequest({call:e.RPC_CALLS.eth_call,formatters:[null,t.defaultBlockParam]}),this.getBalance=this.buildRequest({call:e.RPC_CALLS.eth_getBalance,formatters:[null,t.defaultBlockParam]}),this.getCode=this.buildRequest({call:e.RPC_CALLS.eth_getCode,formatters:[null,t.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:e.RPC_CALLS.eth_getStorageAt,formatters:[null,t.blockNumberToHex,t.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:e.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:e.RPC_CALLS.eth_getBlockByHash,formatters:[null,t.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:e.RPC_CALLS.eth_getBlockByNumber,formatters:[t.blockNumberToHex,t.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionCount,formatters:[null,t.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:e.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=n=>this.buildRequest({call:e.RPC_CALLS.eth_estimateGas})([n]),this.setSafeSettings=this.buildRequest({call:e.RPC_CALLS.safe_setSettings})}buildRequest(a){const{call:n,formatters:s}=a;return async u=>
1{s&&Array.isArray(u)&&s.forEach((d,f)=>{d&&(u[f]=d(u[f]))});const c={call:n,params:u||[]};return(await this.communicator.send(r.Methods.rpcCall,c)).data}}}return _n.Eth=i,_n}var jt={},Kc={},Zc={},En={},jn={},Fl;function v_(){return Fl||(Fl=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.version=void 0,jn.version="1.0.8"),jn}var $l;function tn(){if($l)return En;$l=1,Object.defineProperty(En,"__esModule",{value:!0}),En.BaseError=void 0;const e=v_();class r extends Error{constructor(i,o={}){const a=o.cause instanceof r?o.cause.details:o.cause?.message?o.cause.message:o.details,n=o.cause instanceof r&&o.cause.docsPath||o.docsPath,s=[i||"An error occurred.","",...o.metaMessages?[...o.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...a?[`Details: ${a}`]:[],`Version: abitype@${e.version}`].join(` 2`);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"}),o.cause&&(this.cause=o.cause),this.details=a,this.docsPath=n,this.metaMessages=o.metaMessages,this.shortMessage=i}}return En.BaseError=r,En}var qo={},Nl;function E_(){if(Nl)return qo;Nl=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.narrow=e;function e(r){return r}return qo}var Mo={},Ho={},ko={},Fo={},gt={},zl;
2function Uu(){if(zl)return gt;zl=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.isTupleRegex=gt.integerRegex=gt.bytesRegex=void 0,gt.execTyped=e;function e(r,t){return r.exec(t)?.groups}return 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.isTupleRegex=/^\(.+?\).*?$/,gt}var Ul;function Gp(){if(Ul)return Fo;Ul=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.formatAbiParameter=t;const e=Uu(),r=/^tuple(?<array>(\[(\d*)\])*)$/;function t(i){let o=i.type;if(r.test(i.type)&&"components"in i){o="(";const a=i.components.length;for(let s=0;s<a;s++){const u=i.components[s];o+=t(u),s<a-1&&(o+=", ")}const n=(0,e.execTyped)(r,i.type);return o+=`)${n?.array??""}`,t({...i,type:o})}return"indexed"in i&&i.indexed&&(o=`${o} indexed`),i.name?`${o} ${i.name}`:o}return Fo}var Ll;function Vp(){if(Ll)return ko;Ll=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.formatAbiParameters=r;const e=Gp();function r(t){let i="";const o=t.length;for(let a=0;a<o;a++){const n=t[a];i+=(0,e.formatAbiParameter)(n),a!==o-1&&(i+=", ")}return i}return ko}var Dl;function Wp(){if(Dl)return Ho;Dl=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.formatAbiItem=r;const e=Vp();function r(t){return t.type==="function"?`function ${t.name}(${(0,e.formatAbiParameters)(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${t.outputs?.length?` returns (${(0,e.formatAbiParameters)(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${(0,e.formatAbiParameters)(t.inputs)})`:t.type==="error"?`error ${t.name}(${(0,e.formatAbiParameters)(t.inputs)})`:t.type==="constructor"?`constructor(${(0,e.formatAbiParameters)(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}return Ho}var Gl;function j_(){if(Gl)return Mo;Gl=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.formatAbi=r;const e=Wp();function r(t){const i=[],o=t.length;for(let a=0;a<o;a++){const n=t[a],s=(0,e.formatAbiItem)(n);i.push(s)}return i}return Mo}var $o={},Re={},Vl;function rn(){if(Vl)return Re;Vl=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.functionModifiers=Re.eventModifiers=Re.modifiers=void 0,Re.isErrorSignature=t,Re.execErrorSignature=i,Re.isEventSignature=a,Re.execEventSignature=n,Re.isFunctionSignature=u,Re.execFunctionSignature=c,Re.isStructSignature=d,Re.execStructSignature=f,Re.isConstructorSignature=y,Re.execConstructorSignature=b,Re.isFallbackSignature=B,Re.execFallbackSignature=x,Re.isReceiveSignature=A;const e=Uu(),r=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function t(O){return r.test(O)}function i(O){return(0,e.execTyped)(r,O)}const o=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function a(O){return o.test(O)}function n(O){return(0,e.execTyped)(o,O)}const s=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function u(O){return s.test(O)}function c(O){return(0,e.execTyped)(s,O)}const l=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function d(O){return l.test(O)}function f(O){return(0,e.execTyped)(l,O)}const p=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function y(O){return p.test(O)}function b(O){return(0,e.execTyped)(p,O)}const w=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function B(O){return w.test(O)}function x(O){return(0,e.execTyped)(w,O)}const M=/^receive\(\) external payable$/;function A(O){return M.test(O)}return Re.modifiers=new Set(["memory","indexed","storage","calldata"]),Re.eventModifiers=new Set(["indexed"]),Re.functionModifiers=new Set(["calldata","memory","storage"]),Re}var No={},wt={},Wl;function Lu(){if(Wl)return wt;Wl=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.UnknownSolidityTypeError=wt.UnknownTypeError=wt.InvalidAbiItemError=void 0;const e=tn();class r extends e.BaseError{constructor({signature:a}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(a,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}wt.InvalidAbiItemError=r;class t extends e.BaseError{constructor({type:a}){super("Unknown type.",{metaMessages:[`Type "${a}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}wt.UnknownTypeError=t;class i extends e.BaseError{constructor({type:a}){super("Unknown type.",{metaMessages:[`Type "${a}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}return wt.UnknownSolidityTypeError=i,wt}var He={},Kl;function uo(){if(Kl)return He;
2Kl=1,Object.defineProperty(He,"__esModule",{value:!0}),He.InvalidAbiTypeParameterError=He.InvalidFunctionModifierError=He.InvalidModifierError=He.SolidityProtectedKeywordError=He.InvalidParameterError=He.InvalidAbiParametersError=He.InvalidAbiParameterError=void 0;const e=tn();class r extends e.BaseError{constructor({param:c}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(c,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}He.InvalidAbiParameterError=r;class t extends e.BaseError{constructor({params:c}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(c,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}He.InvalidAbiParametersError=t;class i extends e.BaseError{constructor({param:c}){super("Invalid ABI parameter.",{details:c}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}He.InvalidParameterError=i;class o extends e.BaseError{constructor({param:c,name:l}){super("Invalid ABI parameter.",{details:c,metaMessages:[`"${l}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}He.SolidityProtectedKeywordError=o;class a extends e.BaseError{constructor({param:c,type:l,modifier:d}){super("Invalid ABI parameter.",{details:c,metaMessages:[`Modifier "${d}" not allowed${l?` in "${l}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}He.InvalidModifierError=a;class n extends e.BaseError{constructor({param:c,type:l,modifier:d}){super("Invalid ABI parameter.",{details:c,metaMessages:[`Modifier "${d}" not allowed${l?` in "${l}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${d}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}He.InvalidFunctionModifierError=n;class s extends e.BaseError{constructor({abiParameter:c}){super("Invalid ABI parameter.",{details:JSON.stringify(c,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}return He.InvalidAbiTypeParameterError=s,He}var Pt={},Zl;function jd(){if(Zl)return Pt;Zl=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.InvalidStructSignatureError=Pt.UnknownSignatureError=Pt.InvalidSignatureError=void 0;const e=tn();class r extends e.BaseError{constructor({signature:a,type:n}){super(`Invalid ${n} signature.`,{details:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}Pt.InvalidSignatureError=r;class t extends e.BaseError{constructor({signature:a}){super("Unknown signature.",{details:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}Pt.UnknownSignatureError=t;class i extends e.BaseError{constructor({signature:a}){super("Invalid struct signature.",{details:a,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}return Pt.InvalidStructSignatureError=i,Pt}var wn={},Jl;function Kp(){if(Jl)return wn;Jl=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.CircularReferenceError=void 0;const e=tn();class r extends e.BaseError{constructor({type:i}){super("Circular reference detected.",{metaMessages:[`Struct "${i}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}return wn.CircularReferenceError=r,wn}var Ge={},Pn={},Yl;function Zp(){if(Yl)return Pn;Yl=1,Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.InvalidParenthesisError=void 0;const e=tn();class r extends e.BaseError{constructor({current:i,depth:o}){super("Unbalanced parentheses.",{metaMessages:[`"${i.trim()}" has too many ${o>0?"opening":"closing"} parentheses.`],details:`Depth "${o}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}return Pn.InvalidParenthesisError=r,Pn}var Hr={},Xl;function w_(){if(Xl)return Hr;
2Xl=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.parameterCache=void 0,Hr.getParameterCacheKey=e;function e(r,t,i){let o="";if(i)for(const a of Object.entries(i)){if(!a)continue;let n="";for(const s of a[1])n+=`[${s.type}${s.name?`:${s.name}`:""}]`;o+=`(${a[0]}{${n}})`}return t?`${t}:${r}${o}`:r}return Hr.parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),Hr}var Ql;function en(){if(Ql)return Ge;Ql=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.parseSignature=s,Ge.parseFunctionSignature=u,Ge.parseEventSignature=c,Ge.parseErrorSignature=l,Ge.parseConstructorSignature=d,Ge.parseFallbackSignature=f,Ge.parseAbiParameter=w,Ge.splitParameters=B,Ge.isSolidityType=x,Ge.isSolidityKeyword=A,Ge.isValidDataLocation=O;const e=Uu(),r=Lu(),t=uo(),i=jd(),o=Zp(),a=w_(),n=rn();function s(E,_={}){if((0,n.isFunctionSignature)(E))return u(E,_);if((0,n.isEventSignature)(E))return c(E,_);if((0,n.isErrorSignature)(E))return l(E,_);if((0,n.isConstructorSignature)(E))return d(E,_);if((0,n.isFallbackSignature)(E))return f(E);if((0,n.isReceiveSignature)(E))return{type:"receive",stateMutability:"payable"};throw new i.UnknownSignatureError({signature:E})}function u(E,_={}){const P=(0,n.execFunctionSignature)(E);if(!P)throw new i.InvalidSignatureError({signature:E,type:"function"});const m=B(P.parameters),T=[],g=m.length;for(let h=0;h<g;h++)T.push(w(m[h],{modifiers:n.functionModifiers,structs:_,type:"function"}));const v=[];if(P.returns){const h=B(P.returns),I=h.length;for(let R=0;R<I;R++)v.push(w(h[R],{modifiers:n.functionModifiers,structs:_,type:"function"}))}return{name:P.name,type:"function",stateMutability:P.stateMutability??"nonpayable",inputs:T,outputs:v}}function c(E,_={}){const P=(0,n.execEventSignature)(E);if(!P)throw new i.InvalidSignatureError({signature:E,type:"event"});const m=B(P.parameters),T=[],g=m.length;for(let v=0;v<g;v++)T.push(w(m[v],{modifiers:n.eventModifiers,structs:_,type:"event"}));return{name:P.name,type:"event",inputs:T}}function l(E,_={}){const P=(0,n.execErrorSignature)(E);if(!P)throw new i.InvalidSignatureError({signature:E,type:"error"});const m=B(P.parameters),T=[],g=m.length;for(let v=0;v<g;v++)T.push(w(m[v],{structs:_,type:"error"}));return{name:P.name,type:"error",inputs:T}}function d(E,_={}){const P=(0,n.execConstructorSignature)(E);if(!P)throw new i.InvalidSignatureError({signature:E,type:"constructor"});const m=B(P.parameters),T=[],g=m.length;for(let v=0;v<g;v++)T.push(w(m[v],{structs:_,type:"constructor"}));return{type:"constructor",stateMutability:P.stateMutability??"nonpayable",inputs:T}}function f(E){const _=(0,n.execFallbackSignature)(E);if(!_)throw new i.InvalidSignatureError({signature:E,type:"fallback"});return{type:"fallback",stateMutability:_.stateMutability??"nonpayable"}}const p=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,y=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,b=/^u?int$/;function w(E,_){const P=(0,a.getParameterCacheKey)(E,_?.type,_?.structs);if(a.parameterCache.has(P))return a.parameterCache.get(P);const m=e.isTupleRegex.test(E),T=(0,e.execTyped)(m?y:p,E);if(!T)throw new t.InvalidParameterError({param:E});if(T.name&&A(T.name))throw new t.SolidityProtectedKeywordError({param:E,name:T.name});const g=T.name?{name:T.name}:{},v=T.modifier==="indexed"?{indexed:!0}:{},h=_?.structs??{};let I,R={};if(m){I="tuple";const S=B(T.type),C=[],H=S.length;for(let F=0;F<H;F++)C.push(w(S[F],{structs:h}));R={components:C}}else if(T.type in h)I="tuple",R={components:h[T.type]};else if(b.test(T.type))I=`${T.type}256`;else if(I=T.type,_?.type!=="struct"&&!x(I))throw new r.UnknownSolidityTypeError({type:I});if(T.modifier){if(!_?.modifiers?.has?.(T.modifier))throw new t.InvalidModifierError({param:E,type:_?.type,modifier:T.modifier});if(n.functionModifiers.has(T.modifier)&&!O(I,!!T.array))throw new t.InvalidFunctionModifierError({param:E,type:_?.type,modifier:T.modifier})}const j={type:`${I}${T.array??""}`,...g,...v,...R};return a.parameterCache.set(P,j),j}function B(E,_=[],P="",m=0){const T=E.trim().length;for(let g=0;g<T;g++){const v=E[g],h=E.slice(g+1);switch(v){case",":return m===0?B(h,[..._,P.trim()]):B(h,_,`${P}${v}`,m);case"(":return B(h,_,`${P}${v}`,m+1);case")":return B(h,_,`${P}${v}`,m-1);default:return B(h,_,`${P}${v}`,m)}}if(P==="")return _;if(m!==0)throw new o.InvalidParenthesisError({current:P,depth:m});return _.push(P.trim()),_}function x(E){return E==="address"||E==="bool"||E==="function"||E==="str
2ing"||e.bytesRegex.test(E)||e.integerRegex.test(E)}const M=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function A(E){return E==="address"||E==="bool"||E==="function"||E==="string"||E==="tuple"||e.bytesRegex.test(E)||e.integerRegex.test(E)||M.test(E)}function O(E,_){return _||E==="bytes"||E==="string"||E==="tuple"}return Ge}var ef;function Du(){if(ef)return No;ef=1,Object.defineProperty(No,"__esModule",{value:!0}),No.parseStructs=s;const e=Uu(),r=Lu(),t=uo(),i=jd(),o=Kp(),a=rn(),n=en();function s(l){const d={},f=l.length;for(let w=0;w<f;w++){const B=l[w];if(!(0,a.isStructSignature)(B))continue;const x=(0,a.execStructSignature)(B);if(!x)throw new i.InvalidSignatureError({signature:B,type:"struct"});const M=x.properties.split(";"),A=[],O=M.length;for(let E=0;E<O;E++){const P=M[E].trim();if(!P)continue;const m=(0,n.parseAbiParameter)(P,{type:"struct"});A.push(m)}if(!A.length)throw new i.InvalidStructSignatureError({signature:B});d[x.name]=A}const p={},y=Object.entries(d),b=y.length;for(let w=0;w<b;w++){const[B,x]=y[w];p[B]=c(x,d)}return p}const u=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function c(l,d,f=new Set){const p=[],y=l.length;for(let b=0;b<y;b++){const w=l[b];if(e.isTupleRegex.test(w.type))p.push(w);else{const x=(0,e.execTyped)(u,w.type);if(!x?.type)throw new t.InvalidAbiTypeParameterError({abiParameter:w});const{array:M,type:A}=x;if(A in d){if(f.has(A))throw new o.CircularReferenceError({type:A});p.push({...w,type:`tuple${M??""}`,components:c(d[A]??[],d,new Set([...f,A]))})}else if((0,n.isSolidityType)(A))p.push(w);else throw new r.UnknownTypeError({type:A})}}return p}return No}var tf;function P_(){if(tf)return $o;tf=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.parseAbi=i;const e=rn(),r=Du(),t=en();function i(o){const a=(0,r.parseStructs)(o),n=[],s=o.length;for(let u=0;u<s;u++){const c=o[u];(0,e.isStructSignature)(c)||n.push((0,t.parseSignature)(c,a))}return n}return $o}var zo={},rf;function A_(){if(rf)return zo;rf=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.parseAbiItem=o;const e=Lu(),r=rn(),t=Du(),i=en();function o(a){let n;if(typeof a=="string")n=(0,i.parseSignature)(a);else{const s=(0,t.parseStructs)(a),u=a.length;for(let c=0;c<u;c++){const l=a[c];if(!(0,r.isStructSignature)(l)){n=(0,i.parseSignature)(l,s);break}}}if(!n)throw new e.InvalidAbiItemError({signature:a});return n}return zo}var Uo={},nf;function T_(){if(nf)return Uo;nf=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.parseAbiParameter=o;const e=uo(),r=rn(),t=Du(),i=en();function o(a){let n;if(typeof a=="string")n=(0,i.parseAbiParameter)(a,{modifiers:r.modifiers});else{const s=(0,t.parseStructs)(a),u=a.length;for(let c=0;c<u;c++){const l=a[c];if(!(0,r.isStructSignature)(l)){n=(0,i.parseAbiParameter)(l,{modifiers:r.modifiers,structs:s});break}}}if(!n)throw new e.InvalidAbiParameterError({param:a});return n}return Uo}var Lo={},of;function I_(){if(of)return Lo;of=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.parseAbiParameters=a;const e=uo(),r=rn(),t=Du(),i=en(),o=en();function a(n){const s=[];if(typeof n=="string"){const u=(0,i.splitParameters)(n),c=u.length;for(let l=0;l<c;l++)s.push((0,o.parseAbiParameter)(u[l],{modifiers:r.modifiers}))}else{const u=(0,t.parseStructs)(n),c=n.length;for(let l=0;l<c;l++){const d=n[l];if((0,r.isStructSignature)(d))continue;const f=(0,i.splitParameters)(d),p=f.length;for(let y=0;y<p;y++)s.push((0,o.parseAbiParameter)(f[y],{modifiers:r.modifiers,structs:u}))}}if(s.length===0)throw new e.InvalidAbiParametersError({params:n});return s}return Lo}var af;function tr(){return af||(af=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CircularReferenceError=e.InvalidParenthesisError=e.UnknownSignatureError=e.InvalidSignatureError=e.InvalidStructSignatureError=e.InvalidAbiParameterError=e.InvalidAbiParametersError=e.InvalidParameterError=e.SolidityProtectedKeywordError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.UnknownSolidityTypeError=e.InvalidAbiItemError=e.UnknownTypeError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.formatAbiParameters=e.formatAbiParameter=e.formatAbiItem=e.formatAbi=e.narrow=e.BaseError=void 0;var r=tn();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return r.BaseError}});var t=E_();Object.defineProperty(e,"narrow",{enumerable:!0,get:function(){return t.narrow}});var i=j_();Object.defineProperty(e,"formatAbi",{enumerable:!0,get:function(){return i.formatAbi}});var o=Wp();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return o.formatAbiItem}});var a=Gp();Object.defineProperty(e,"formatAbiParameter",{enumerable:!0,get:function(){return a.formatAbiParameter}});var n=Vp();Object.defineProperty(e,"formatAbiParameters",{enumerable:!0,get:function(){return n.formatAbiParameters}});var s=P_();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return s.parseAbi}});var u=A_();Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return u.parseAbiItem}});var c=T_();Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return c.parseAbiParameter}});var l=I_();Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return l.parseAbiParameters}});var d=Lu();Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return d.UnknownTypeError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return d.InvalidAbiItemError}}),Object.defineProperty(e,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return d.UnknownSolidityTypeError}});var f=uo();Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return f.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return f.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return f.InvalidModifierError}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return f.SolidityProtectedKeywordError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return f.InvalidParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return f.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return f.InvalidAbiParameterError}});var p=jd();Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return p.InvalidStructSignatureError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return p.InvalidSignatureError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return p.UnknownSignatureError}});var y=Zp();Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return y.InvalidParenthesisError}});var b=Kp();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return b.CircularReferenceError}})}(Zc)),Zc}var kr={},Do={},sf;function _e(){if(sf)return Do;sf=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.getAction=e;function e(r,t,i){const o=r[t.name];if(typeof o=="function")return o;const a=r[i];return typeof a=="function"?a:n=>t(r,n)}return Do}var Go={},Vo={},ae={},An={},uf;function kt(){if(uf)return An;uf=1,Object.defineProperty(An,"__esModule",{value:!0}),An.formatAbiItem=r,An.formatAbiParams=t;const e=Ie();function r(o,{includeName:a=!1}={}){if(o.type!=="function"&&o.type!=="event"&&o.type!=="error")throw new e.InvalidDefinitionTypeError(o.type);return`${o.name}(${t(o.inputs,{includeName:a})})`}function t(o,{includeName:a=!1}={}){return o?o.map(n=>i(n,{includeName:a})).join(a?", ":","):""}function i(o,{includeName:a}){return o.type.startsWith("tuple")?`(${t(o.components,{includeName:a})})${o.type.slice(5)}`:o.type+(a&&o.name?` ${o.name}`:"")}return An}var Wo={},Ko={},cf;function De(){if(cf)return Ko;cf=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.isHex=e;
2function e(r,{strict:t=!0}={}){return!r||typeof r!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(r):r.startsWith("0x")}return Ko}var df;function Ve(){if(df)return Wo;df=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.size=r;const e=De();function r(t){return(0,e.isHex)(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}return Wo}var Fr={},Tn={},lf;function S_(){return lf||(lf=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.version=void 0,Tn.version="2.31.6"),Tn}var ff;function le(){if(ff)return Fr;ff=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.BaseError=void 0,Fr.setErrorConfig=t;const e=S_();let r={getDocsUrl:({docsBaseUrl:a,docsPath:n="",docsSlug:s})=>n?`${a??"https://viem.sh"}${n}${s?`#${s}`:""}`:void 0,version:`viem@${e.version}`};function t(a){r=a}class i extends Error{constructor(n,s={}){const u=s.cause instanceof i?s.cause.details:s.cause?.message?s.cause.message:s.details,c=s.cause instanceof i&&s.cause.docsPath||s.docsPath,l=r.getDocsUrl?.({...s,docsPath:c}),d=[n||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...l?[`Docs: ${l}`]:[],...u?[`Details: ${u}`]:[],...r.version?[`Version: ${r.version}`]:[]].join(` 3`);super(d,s.cause?{cause:s.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=u,this.docsPath=c,this.metaMessages=s.metaMessages,this.name=s.name??this.name,this.shortMessage=n,this.version=e.version}walk(n){return o(this,n)}}Fr.BaseError=i;function o(a,n){return n?.(a)?a:a&&typeof a=="object"&&"cause"in a&&a.cause!==void 0?o(a.cause,n):n?null:a}return Fr}var mf;function Ie(){if(mf)return ae;mf=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.UnsupportedPackedAbiType=ae.InvalidDefinitionTypeError=ae.InvalidArrayError=ae.InvalidAbiDecodingTypeError=ae.InvalidAbiEncodingTypeError=ae.DecodeLogTopicsMismatch=ae.DecodeLogDataMismatch=ae.BytesSizeMismatchError=ae.AbiItemAmbiguityError=ae.AbiFunctionSignatureNotFoundError=ae.AbiFunctionOutputsNotFoundError=ae.AbiFunctionNotFoundError=ae.AbiEventNotFoundError=ae.AbiEventSignatureNotFoundError=ae.AbiEventSignatureEmptyTopicsError=ae.AbiErrorSignatureNotFoundError=ae.AbiErrorNotFoundError=ae.AbiErrorInputsNotFoundError=ae.AbiEncodingLengthMismatchError=ae.AbiEncodingBytesSizeMismatchError=ae.AbiEncodingArrayLengthMismatchError=ae.AbiDecodingZeroDataError=ae.AbiDecodingDataSizeTooSmallError=ae.AbiDecodingDataSizeInvalidError=ae.AbiConstructorParamsNotFoundError=ae.AbiConstructorNotFoundError=void 0;const e=kt(),r=Ve(),t=le();class i extends t.BaseError{constructor({docsPath:I}){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(` 4`),{docsPath:I,name:"AbiConstructorNotFoundError"})}}ae.AbiConstructorNotFoundError=i;class o extends t.BaseError{constructor({docsPath:I}){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(` 5`),{docsPath:I,name:"AbiConstructorParamsNotFoundError"})}}ae.AbiConstructorParamsNotFoundError=o;class a extends t.BaseError{constructor({data:I,size:R}){super([`Data size of ${R}
5 bytes is invalid.`,"Size must be in increments of 32 bytes (size % 32 === 0)."].join(` 6`),{metaMessages:[`Data: ${I} (${R} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}}ae.AbiDecodingDataSizeInvalidError=a;class n extends t.BaseError{constructor({data:I,params:R,size:j}){super([`Data size of ${j} bytes is too small for given parameters.`].join(` 7`),{metaMessages:[`Params: (${(0,e.formatAbiParams)(R,{includeName:!0})})`,`Data: ${I} (${j} 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=I,this.params=R,this.size=j}}ae.AbiDecodingDataSizeTooSmallError=n;class s extends t.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}ae.AbiDecodingZeroDataError=s;class u extends t.BaseError{constructor({expectedLength:I,givenLength:R,type:j}){super([`ABI encoding array length mismatch for type ${j}.`,`Expected length: ${I}`,`Given length: ${R}`].join(` 8`),{name:"AbiEncodingArrayLengthMismatchError"})}}ae.AbiEncodingArrayLengthMismatchError=u;class c extends t.BaseError{constructor({expectedSize:I,value:R}){super(`Size of bytes "${R}" (bytes${(0,r.size)(R)}) does not match expected size (bytes${I}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}ae.AbiEncodingBytesSizeMismatchError=c;class l extends t.BaseError{constructor({expectedLength:I,givenLength:R}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${I}`,`Given length (values): ${R}`].join(` 9`),{name:"AbiEncodingLengthMismatchError"})}}ae.AbiEncodingLengthMismatchError=l;class d extends t.BaseError{constructor(I,{docsPath:R}){super([`Arguments (\`args\`) were provided to "${I}", but "${I}" 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(` 10`),{docsPath:R,name:"AbiErrorInputsNotFoundError"})}}ae.AbiErrorInputsNotFoundError=d;class f extends t.BaseError{constructor(I,{docsPath:R}={}){super([`Error ${I?`"${I}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` 11`),{docsPath:R,name:"AbiErrorNotFoundError"})}}ae.AbiErrorNotFoundError=f;class p extends t.BaseError{constructor(I,{docsPath:R}){super([`Encoded error signature "${I}" 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=${I}.`].join(` 12`),{docsPath:R,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=I}}ae.AbiErrorSignatureNotFoundError=p;class y extends t.BaseError{constructor({docsPath:I}){super("Cannot extract event signature from empty topics.",{docsPath:I,name:"AbiEventSignatureEmptyTopicsError"})}}ae.AbiEventSignatureEmptyTopicsError=y;class b extends t.BaseError{constructor(I,{docsPath:R}){super([`Encoded event signature "${I}" 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=${I}.`].join(` 13`),{docsPath:R,name:"AbiEventSignatureNotFoundError"})}}ae.AbiEventSignatureNotFoundError=b;class w extends t.BaseError{constructor(I,{docsPath:R}={}){super([`Event ${I?`"${I}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` 14`),{docsPath:R,name:"AbiEventNotFoundError"})}}ae.AbiEventNotFoundError=w;class B extends t.BaseError{constructor(I,{docsPath:R}={}){super([`Function ${I?`"${I}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` 15`),{docsPath:R,name:"AbiFunctionNotFoundError"})}}ae.AbiFunctionNotFoundError=B;class x extends t.BaseError{constructor(I,{docsPath:R}){super([`Function "${I}" 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(` 16`),{docsPath:R,name:"AbiFunctionOutputsNotFoundError"})}}ae.AbiFunctionOutputsNotFoundError=x;class M extends t.BaseError{constructor(I,{docsPath:R}){super([`Encoded function signature "${I}" 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=${I}.`].join(` 17`),{docsPath:R,name:"AbiFunctionSignatureNotFoundError"})}}ae.AbiFunctionSignatureNotFoundError=M;class A extends t.BaseError{constructor(I,R){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${I.type}\` in \`${(0,e.formatAbiItem)(I.abiItem)}\`, and`,`\`${R.type}\` in \`${(0,e.formatAbiItem)(R.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}ae.AbiItemAmbiguityError=A;class O extends t.BaseError{constructor({expectedSize:I,givenSize:R}){super(`Expected bytes${I}, got bytes${R}.`,{name:"BytesSizeMismatchError"})}}ae.BytesSizeMismatchError=O;class E extends t.BaseError{constructor({abiItem:I,data:R,params:j,size:S}){super([`Data size of ${S} bytes is too small for non-indexed event parameters.`].join(` 18`),{metaMessages:[`Params: (${(0,e.formatAbiParams)(j,{includeName:!0})})`,`Data: ${R} (${S} 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=I,this.data=R,this.params=j,this.size=S}}ae.DecodeLogDataMismatch=E;class _ extends t.BaseError{constructor({abiItem:I,param:R}){super([`Expected a topic for indexed event parameter${R.name?` "${R.name}"`:""} on event "${(0,e.formatAbiItem)(I,{includeName:!0})}".`].join(` 19`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=I}}ae.DecodeLogTopicsMismatch=_;class P extends t.BaseError{constructor(I,{docsPath:R}){super([`Type "${I}
19" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 20`),{docsPath:R,name:"InvalidAbiEncodingType"})}}ae.InvalidAbiEncodingTypeError=P;class m extends t.BaseError{constructor(I,{docsPath:R}){super([`Type "${I}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 21`),{docsPath:R,name:"InvalidAbiDecodingType"})}}ae.InvalidAbiDecodingTypeError=m;class T extends t.BaseError{constructor(I){super([`Value "${I}" is not a valid array.`].join(` 22`),{name:"InvalidArrayError"})}}ae.InvalidArrayError=T;class g extends t.BaseError{constructor(I){super([`"${I}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 23`),{name:"InvalidDefinitionTypeError"})}}ae.InvalidDefinitionTypeError=g;class v extends t.BaseError{constructor(I){super(`Type "${I}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}return ae.UnsupportedPackedAbiType=v,ae}var In={},bf;function Jp(){if(bf)return In;bf=1,Object.defineProperty(In,"__esModule",{value:!0}),In.FilterTypeNotSupportedError=void 0;const e=le();class r extends e.BaseError{constructor(i){super(`Filter type "${i}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}return In.FilterTypeNotSupportedError=r,In}var Kt={},$r={},At={},hf;function Gu(){if(hf)return At;hf=1,Object.defineProperty(At,"__esModule",{value:!0}),At.InvalidBytesLengthError=At.SizeExceedsPaddingSizeError=At.SliceOffsetOutOfBoundsError=void 0;const e=le();class r extends e.BaseError{constructor({offset:a,position:n,size:s}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${a}" is out-of-bounds (size: ${s}).`,{name:"SliceOffsetOutOfBoundsError"})}}At.SliceOffsetOutOfBoundsError=r;class t extends e.BaseError{constructor({size:a,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${a}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}At.SizeExceedsPaddingSizeError=t;class i extends e.BaseError{constructor({size:a,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} is expected to be ${n} ${s} long, but is ${a} ${s} long.`,{name:"InvalidBytesLengthError"})}}return At.InvalidBytesLengthError=i,At}var yf;function rr(){if(yf)return $r;yf=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.pad=r,$r.padHex=t,$r.padBytes=i;const e=Gu();function r(o,{dir:a,size:n=32}={}){return typeof o=="string"?t(o,{dir:a,size:n}):i(o,{dir:a,size:n})}function t(o,{dir:a,size:n=32}={}){if(n===null)return o;const s=o.replace("0x","");if(s.length>n*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(s.length/2),targetSize:n,type:"hex"});return`0x${s[a==="right"?"padEnd":"padStart"](n*2,"0")}`}function i(o,{dir:a,size:n=32}={}){if(n===null)return o;if(o.length>n)throw new e.SizeExceedsPaddingSizeError({size:o.length,targetSize:n,type:"bytes"});const s=new Uint8Array(n);for(let u=0;u<n;u++){const c=a==="right";s[c?u:n-u-1]=o[c?u:o.length-u-1]}return s}return $r}var Tt={},Je={},pf;function nn(){if(pf)return Je;pf=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.SizeOverflowError=Je.InvalidHexValueError=Je.InvalidHexBooleanError=Je.InvalidBytesBooleanError=Je.IntegerOutOfRangeError=void 0;const e=le();class r extends e.BaseError{constructor({max:s,min:u,signed:c,size:l,value:d}){super(`Number "${d}" is not in safe ${l?`${l*8}-bit ${c?"signed":"unsigned"} `:""}integer range ${s?`(${u} to ${s})`:`(above ${u})`}`,{name:"IntegerOutOfRangeError"})}}Je.IntegerOutOfRangeError=r;class t extends e.BaseError{constructor(s){super(`Bytes value "${s}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}Je.InvalidBytesBooleanError=t;class i extends e.BaseError{constructor(s){super(`Hex value "${s}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}Je.InvalidHexBooleanError=i;class o extends e.BaseError{constructor(s){super(`Hex value "${s}" is an odd length (${s.length}). It must be an even length.`,{name:"InvalidHexValueError"})}}Je.InvalidHexValueError=o;class a extends e.BaseError{constructor({givenSize:s,maxSize:u}
23){super(`Size cannot exceed ${u} bytes. Given size: ${s} bytes.`,{name:"SizeOverflowError"})}}return Je.SizeOverflowError=a,Je}var Zo={},gf;function Ft(){if(gf)return Zo;gf=1,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.trim=e;function e(r,{dir:t="left"}={}){let i=typeof r=="string"?r.replace("0x",""):r,o=0;for(let a=0;a<i.length-1&&i[t==="left"?a:i.length-a-1].toString()==="0";a++)o++;return i=t==="left"?i.slice(o):i.slice(0,i.length-o),typeof r=="string"?(i.length===1&&t==="right"&&(i=`${i}0`),`0x${i.length%2===1?`0${i}`:i}`):i}return Zo}var _f;function Ce(){if(_f)return Tt;_f=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.assertSize=o,Tt.fromHex=a,Tt.hexToBigInt=n,Tt.hexToBool=s,Tt.hexToNumber=u,Tt.hexToString=c;const e=nn(),r=Ve(),t=Ft(),i=we();function o(l,{size:d}){if((0,r.size)(l)>d)throw new e.SizeOverflowError({givenSize:(0,r.size)(l),maxSize:d})}function a(l,d){const f=typeof d=="string"?{to:d}:d,p=f.to;return p==="number"?u(l,f):p==="bigint"?n(l,f):p==="string"?c(l,f):p==="boolean"?s(l,f):(0,i.hexToBytes)(l,f)}function n(l,d={}){const{signed:f}=d;d.size&&o(l,{size:d.size});const p=BigInt(l);if(!f)return p;const y=(l.length-2)/2,b=(1n<<BigInt(y)*8n-1n)-1n;return p<=b?p:p-BigInt(`0x${"f".padStart(y*2,"f")}`)-1n}function s(l,d={}){let f=l;if(d.size&&(o(f,{size:d.size}),f=(0,t.trim)(f)),(0,t.trim)(f)==="0x00")return!1;if((0,t.trim)(f)==="0x01")return!0;throw new e.InvalidHexBooleanError(f)}function u(l,d={}){return Number(n(l,d))}function c(l,d={}){let f=(0,i.hexToBytes)(l);return d.size&&(o(f,{size:d.size}),f=(0,t.trim)(f,{dir:"right"})),new TextDecoder().decode(f)}return Tt}var Zt={},vf;function te(){if(vf)return Zt;vf=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.toHex=o,Zt.boolToHex=a,Zt.bytesToHex=n,Zt.numberToHex=s,Zt.stringToHex=c;const e=nn(),r=rr(),t=Ce(),i=Array.from({length:256},(l,d)=>d.toString(16).padStart(2,"0"));function o(l,d={}){return typeof l=="number"||typeof l=="bigint"?s(l,d):typeof l=="string"?c(l,d):typeof l=="boolean"?a(l,d):n(l,d)}function a(l,d={}){const f=`0x${Number(l)}`;return typeof d.size=="number"?((0,t.assertSize)(f,{size:d.size}),(0,r.pad)(f,{size:d.size})):f}function n(l,d={}){let f="";for(let y=0;y<l.length;y++)f+=i[l[y]];const p=`0x${f}`;return typeof d.size=="number"?((0,t.assertSize)(p,{size:d.size}),(0,r.pad)(p,{dir:"right",size:d.size})):p}function s(l,d={}){const{signed:f,size:p}=d,y=BigInt(l);let b;p?f?b=(1n<<BigInt(p)*8n-1n)-1n:b=2n**(BigInt(p)*8n)-1n:typeof l=="number"&&(b=BigInt(Number.MAX_SAFE_INTEGER));const w=typeof b=="bigint"&&f?-b-1n:0;if(b&&y>b||y<w){const x=typeof l=="bigint"?"n":"";throw new e.IntegerOutOfRangeError({max:b?`${b}${x}`:void 0,min:`${w}${x}`,signed:f,size:p,value:`${l}${x}`})}const B=`0x${(f&&y<0?(1n<<BigInt(p*8))+BigInt(y):y).toString(16)}`;return p?(0,r.pad)(B,{size:p}):B}const u=new TextEncoder;function c(l,d={}){const f=u.encode(l);return n(f,d)}return Zt}var Ef;function we(){if(Ef)return Kt;Ef=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.toBytes=n,Kt.boolToBytes=s,Kt.hexToBytes=l,Kt.numberToBytes=d,Kt.stringToBytes=f;const e=le(),r=De(),t=rr(),i=Ce(),o=te(),a=new TextEncoder;function n(p,y={}){return typeof p=="number"||typeof p=="bigint"?d(p,y):typeof p=="boolean"?s(p,y):(0,r.isHex)(p)?l(p,y):f(p,y)}function s(p,y={}){const b=new Uint8Array(1);return b[0]=Number(p),typeof y.size=="number"?((0,i.assertSize)(b,{size:y.size}),(0,t.pad)(b,{size:y.size})):b}const u={zero:48,nine:57,A:65,F:70,a:97,f:102};function c(p){if(p>=u.zero&&p<=u.nine)return p-u.zero;if(p>=u.A&&p<=u.F)return p-(u.A-10);if(p>=u.a&&p<=u.f)return p-(u.a-10)}function l(p,y={}){let b=p;y.size&&((0,i.assertSize)(b,{size:y.size}),b=(0,t.pad)(b,{dir:"right",size:y.size}));let w=b.slice(2);w.length%2&&(w=`0${w}`);const B=w.length/2,x=new Uint8Array(B);for(let M=0,A=0;M<B;M++){const O=c(w.charCodeAt(A++)),E=c(w.charCodeAt(A++));if(O===void 0||E===void 0)throw new e.BaseError(`Invalid byte sequence ("${w[A-2]}${w[A-1]}" in "${w}").`);x[M]=O*16+E}return x}function d(p,y){const b=(0,o.numberToHex)(p,y);return l(b)}function f(p,y={}){const b=a.encode(p);return typeof y.size=="number"?((0,i.assertSize)(b,{size:y.size}),(0,t.pad)(b,{dir:"right",size:y.size})):b}return Kt}var Jo={},jf;function We(){if(jf)return Jo;jf=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.keccak256=o;const e=Up(),r=De(),t=we(),i=te();function o(a,n){const s=n||"hex",u=(0,e.keccak_256)((0,r.isHex)(a,{strict:!1})?(0,t.toBytes)(a):a);return s==="bytes"?u:(0,i.toHex)(u)}return Jo}var Sn={},Yo={},Xo={},wf;function B_(){if(wf)return Xo;wf=1,Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.hashSignature=i;const e=we(),r=We(),t=o=>(0,r.keccak256)((0,e.toBytes)(o));function i(o){return t(o)}return Xo}var Bn={},Qo={},Pf;function R_(){if(Pf)return Qo;Pf=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.normalizeSignature=r;const e=le();function r(t){let i=!0,o="",a=0,n="",s=!1;for(let u=0;u<t.length;u++){const c=t[u];
23if(["(",")",","].includes(c)&&(i=!0),c==="("&&a++,c===")"&&a--,!!i){if(a===0){if(c===" "&&["event","function",""].includes(n))n="";else if(n+=c,c===")"){s=!0;break}continue}if(c===" "){t[u-1]!==","&&o!==","&&o!==",("&&(o="",i=!1);continue}n+=c,o+=c}}if(!s)throw new e.BaseError("Unable to normalize signature.");return n}return Qo}var Af;function wd(){if(Af)return Bn;Af=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.toSignature=void 0;const e=tr(),r=R_(),t=i=>{const o=typeof i=="string"?i:(0,e.formatAbiItem)(i);return(0,r.normalizeSignature)(o)};return Bn.toSignature=t,Bn}var Tf;function Vu(){if(Tf)return Yo;Tf=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.toSignatureHash=t;const e=B_(),r=wd();function t(i){return(0,e.hashSignature)((0,r.toSignature)(i))}return Yo}var If;function on(){if(If)return Sn;If=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.toEventSelector=void 0;const e=Vu();return Sn.toEventSelector=e.toSignatureHash,Sn}var Rn={},On={},Sf;function ft(){if(Sf)return On;Sf=1,Object.defineProperty(On,"__esModule",{value:!0}),On.InvalidAddressError=void 0;const e=le();class r extends e.BaseError{constructor({address:i}){super(`Address "${i}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}return On.InvalidAddressError=r,On}var Jc={},Cn={},Bf;function co(){if(Bf)return Cn;Bf=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.LruMap=void 0;class e extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const i=super.get(t);return super.has(t)&&i!==void 0&&(this.delete(t),super.set(t,i)),i}set(t,i){if(super.set(t,i),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}return Cn.LruMap=e,Cn}var xn={},Rf;function et(){if(Rf)return xn;Rf=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.checksumAddress=n,xn.getAddress=s;const e=ft(),r=we(),t=We(),i=co(),o=Ke(),a=new i.LruMap(8192);function n(u,c){if(a.has(`${u}.${c}`))return a.get(`${u}.${c}`);const l=c?`${c}${u.toLowerCase()}`:u.substring(2).toLowerCase(),d=(0,t.keccak256)((0,r.stringToBytes)(l),"bytes"),f=(c?l.substring(`${c}0x`.length):l).split("");for(let y=0;y<40;y+=2)d[y>>1]>>4>=8&&f[y]&&(f[y]=f[y].toUpperCase()),(d[y>>1]&15)>=8&&f[y+1]&&(f[y+1]=f[y+1].toUpperCase());const p=`0x${f.join("")}`;return a.set(`${u}.${c}`,p),p}function s(u,c){if(!(0,o.isAddress)(u,{strict:!1}))throw new e.InvalidAddressError({address:u});return n(u,c)}return xn}var Of;function Ke(){return Of||(Of=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAddressCache=void 0,e.isAddress=o;const r=co(),t=et(),i=/^0x[a-fA-F0-9]{40}$/;e.isAddressCache=new r.LruMap(8192);function o(a,n){const{strict:s=!0}=n??{},u=`${a}.${s}`;if(e.isAddressCache.has(u))return e.isAddressCache.get(u);const c=i.test(a)?a.toLowerCase()===a?!0:s?(0,t.checksumAddress)(a)===a:!0:!1;return e.isAddressCache.set(u,c),c}}(Jc)),Jc}var Nr={},Cf;function ke(){if(Cf)return Nr;
23Cf=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.concat=e,Nr.concatBytes=r,Nr.concatHex=t;function e(i){return typeof i[0]=="string"?t(i):r(i)}function r(i){let o=0;for(const s of i)o+=s.length;const a=new Uint8Array(o);let n=0;for(const s of i)a.set(s,n),n+=s.length;return a}function t(i){return`0x${i.reduce((o,a)=>o+a.replace("0x",""),"")}`}return Nr}var zr={},xf;function ot(){if(xf)return zr;xf=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.slice=i,zr.sliceBytes=n,zr.sliceHex=s;const e=Gu(),r=De(),t=Ve();function i(u,c,l,{strict:d}={}){return(0,r.isHex)(u,{strict:!1})?s(u,c,l,{strict:d}):n(u,c,l,{strict:d})}function o(u,c){if(typeof c=="number"&&c>0&&c>(0,t.size)(u)-1)throw new e.SliceOffsetOutOfBoundsError({offset:c,position:"start",size:(0,t.size)(u)})}function a(u,c,l){if(typeof c=="number"&&typeof l=="number"&&(0,t.size)(u)!==l-c)throw new e.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:(0,t.size)(u)})}function n(u,c,l,{strict:d}={}){o(u,c);const f=u.slice(c,l);return d&&a(f,c,l),f}function s(u,c,l,{strict:d}={}){o(u,c);const f=`0x${u.replace("0x","").slice((c??0)*2,(l??u.length)*2)}`;return d&&a(f,c,l),f}return zr}var It={},qf;function Wu(){return qf||(qf=1,Object.defineProperty(It,"__esModule",{value:!0}),It.integerRegex=It.bytesRegex=It.arrayRegex=void 0,It.arrayRegex=/^(.*)\[([0-9]*)\]$/,It.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,It.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)?$/),It}var Mf;function mt(){if(Mf)return Rn;Mf=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.encodeAbiParameters=d,Rn.getArrayComponents=E;const e=Ie(),r=ft(),t=le(),i=nn(),o=Ke(),a=ke(),n=rr(),s=Ve(),u=ot(),c=te(),l=Wu();function d(_,P){if(_.length!==P.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:_.length,givenLength:P.length});const m=f({params:_,values:P}),T=y(m);return T.length===0?"0x":T}function f({params:_,values:P}){const m=[];for(let T=0;T<_.length;T++)m.push(p({param:_[T],value:P[T]}));return m}function p({param:_,value:P}){const m=E(_.type);if(m){const[T,g]=m;return w(P,{length:T,param:{..._,type:g}})}if(_.type==="tuple")return O(P,{param:_});if(_.type==="address")return b(P);if(_.type==="bool")return x(P);if(_.type.startsWith("uint")||_.type.startsWith("int")){const T=_.type.startsWith("int"),[,,g="256"]=l.integerRegex.exec(_.type)??[];return M(P,{signed:T,size:Number(g)})}if(_.type.startsWith("bytes"))return B(P,{param:_});if(_.type==="string")return A(P);throw new e.InvalidAbiEncodingTypeError(_.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function y(_){let P=0;for(let v=0;v<_.length;v++){const{dynamic:h,encoded:I}=_[v];h?P+=32:P+=(0,s.size)(I)}const m=[],T=[];let g=0;for(let v=0;v<_.length;v++){const{dynamic:h,encoded:I}=_[v];h?(m.push((0,c.numberToHex)(P+g,{size:32})),T.push(I),g+=(0,s.size)(I)):m.push(I)}return(0,a.concat)([...m,...T])}function b(_){if(!(0,o.isAddress)(_))throw new r.InvalidAddressError({address:_});return{dynamic:!1,encoded:(0,n.padHex)(_.toLowerCase())}}function w(_,{length:P,param:m}){const T=P===null;if(!Array.isArray(_))throw new e.InvalidArrayError(_);if(!T&&_.length!==P)throw new e.AbiEncodingArrayLengthMismatchError({expectedLength:P,givenLength:_.length,type:`${m.type}[${P}]`});let g=!1;const v=[];for(let h=0;h<_.length;h++){const I=p({param:m,value:_[h]});I.dynamic&&(g=!0),v.push(I)}if(T||g){const h=y(v);if(T){const I=(0,c.numberToHex)(v.length,{size:32});return{dynamic:!0,encoded:v.length>0?(0,a.concat)([I,h]):I}}if(g)return{dynamic:!0,encoded:h}}return{dynamic:!1,encoded:(0,a.concat)(v.map(({encoded:h})=>h))}}function B(_,{param:P}){const[,m]=P.type.split("bytes"),T=(0,s.size)(_);if(!m){let g=_;return T%32!==0&&(g=(0,n.padHex)(g,{dir:"right",size:Math.ceil((_.length-2)/2/32)*32})),{dynamic:!0,encoded:(0,a.concat)([(0,n.padHex)((0,c.numberToHex)(T,{size:32})),g])}}if(T!==Number.parseInt(m))throw new e.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(m),value:_});return{dynamic:!1,encoded:(0,n.padHex)(_,{dir:"right"})}}function x(_){if(typeof _!="boolean")throw new t.BaseError(`Invalid boolean value: "${_}" (type: ${typeof _}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,n.padHex)((0,c.boolToHex)(_))}}function M(_,{signed:P,size:m=256}){if(typeof m=="number"){const T=2n**(BigInt(m)-(P?1n:0n))-1n,g=P?-T-1n:0n;if(_>T||_<g)throw new i.IntegerOutOfRangeError({max:T.toString(),min:g.toString(),signed:P,size:m/8,value:_.toString()})}return{dynamic:!1,encoded:(0,c.numberToHex)(_,{size:32,signed:P})}}
23function A(_){const P=(0,c.stringToHex)(_),m=Math.ceil((0,s.size)(P)/32),T=[];for(let g=0;g<m;g++)T.push((0,n.padHex)((0,u.slice)(P,g*32,(g+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,a.concat)([(0,n.padHex)((0,c.numberToHex)((0,s.size)(P),{size:32})),...T])}}function O(_,{param:P}){let m=!1;const T=[];for(let g=0;g<P.components.length;g++){const v=P.components[g],h=Array.isArray(_)?g:v.name,I=p({param:v,value:_[h]});T.push(I),I.dynamic&&(m=!0)}return{dynamic:m,encoded:m?y(T):(0,a.concat)(T.map(({encoded:g})=>g))}}function E(_){const P=_.match(/^(.*)\[(\d+)?\]$/);return P?[P[2]?Number(P[2]):null,P[1]]:void 0}return Rn}var Ur={},qn={},Hf;function Br(){if(Hf)return qn;Hf=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.toFunctionSelector=void 0;const e=ot(),r=Vu(),t=i=>(0,e.slice)((0,r.toSignatureHash)(i),0,4);return qn.toFunctionSelector=t,qn}var kf;function $t(){if(kf)return Ur;kf=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.getAbiItem=a,Ur.isArgOfType=n,Ur.getAmbiguousTypes=s;const e=Ie(),r=De(),t=Ke(),i=on(),o=Br();function a(u){const{abi:c,args:l=[],name:d}=u,f=(0,r.isHex)(d,{strict:!1}),p=c.filter(b=>f?b.type==="function"?(0,o.toFunctionSelector)(b)===d:b.type==="event"?(0,i.toEventSelector)(b)===d:!1:"name"in b&&b.name===d);if(p.length===0)return;if(p.length===1)return p[0];let y;for(const b of p){if(!("inputs"in b))continue;if(!l||l.length===0){if(!b.inputs||b.inputs.length===0)return b;continue}if(!b.inputs||b.inputs.length===0||b.inputs.length!==l.length)continue;if(l.every((B,x)=>{const M="inputs"in b&&b.inputs[x];return M?n(B,M):!1}
23)){if(y&&"inputs"in y&&y.inputs){const B=s(b.inputs,y.inputs,l);if(B)throw new e.AbiItemAmbiguityError({abiItem:b,type:B[0]},{abiItem:y,type:B[1]})}y=b}}return y||p[0]}function n(u,c){const l=typeof u,d=c.type;switch(d){case"address":return(0,t.isAddress)(u,{strict:!1});case"bool":return l==="boolean";case"function":return l==="string";case"string":return l==="string";default:return d==="tuple"&&"components"in c?Object.values(c.components).every((f,p)=>n(Object.values(u)[p],f)):/^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(d)?l==="number"||l==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(d)?l==="string"||u instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(d)?Array.isArray(u)&&u.every(f=>n(f,{...c,type:d.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function s(u,c,l){for(const d in u){const f=u[d],p=c[d];if(f.type==="tuple"&&p.type==="tuple"&&"components"in f&&"components"in p)return s(f.components,p.components,l[d]);const y=[f.type,p.type];if(y.includes("address")&&y.includes("bytes20")?!0:y.includes("address")&&y.includes("string")?(0,t.isAddress)(l[d],{strict:!1}):y.includes("address")&&y.includes("bytes")?(0,t.isAddress)(l[d],{strict:!1}):!1)return y}}return Ur}var Ff;function Rr(){if(Ff)return Vo;Ff=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.encodeEventTopics=c;const e=Ie(),r=Jp(),t=we(),i=We(),o=on(),a=mt(),n=kt(),s=$t(),u="/docs/contract/encodeEventTopics";function c(d){const{abi:f,eventName:p,args:y}=d;let b=f[0];if(p){const M=(0,s.getAbiItem)({abi:f,name:p});if(!M)throw new e.AbiEventNotFoundError(p,{docsPath:u});b=M}if(b.type!=="event")throw new e.AbiEventNotFoundError(void 0,{docsPath:u});const w=(0,n.formatAbiItem)(b),B=(0,o.toEventSelector)(w);let x=[];
23if(y&&"inputs"in b){const M=b.inputs?.filter(O=>"indexed"in O&&O.indexed),A=Array.isArray(y)?y:Object.values(y).length>0?M?.map(O=>y[O.name])??[]:[];A.length>0&&(x=M?.map((O,E)=>Array.isArray(A[E])?A[E].map((_,P)=>l({param:O,value:A[E][P]})):typeof A[E]<"u"&&A[E]!==null?l({param:O,value:A[E]}):null)??[])}return[B,...x]}function l({param:d,value:f}){if(d.type==="string"||d.type==="bytes")return(0,i.keccak256)((0,t.toBytes)(f));if(d.type==="tuple"||d.type.match(/^(.*)\[(\d+)?\]$/))throw new r.FilterTypeNotSupportedError(d.type);return(0,a.encodeAbiParameters)([d],[f])}return Vo}var ei={},$f;function Ku(){if($f)return ei;$f=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.createFilterRequestScope=e;function e(r,{method:t}){const i={};return r.transport.type==="fallback"&&r.transport.onResponse?.(({method:o,response:a,status:n,transport:s})=>{n==="success"&&t===o&&(i[a]=s.request)}),o=>i[o]||r.request}return ei}var Nf;function Pd(){if(Nf)return Go;Nf=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.createContractEventFilter=i;const e=Rr(),r=te(),t=Ku();async function i(o,a){const{address:n,abi:s,args:u,eventName:c,fromBlock:l,strict:d,toBlock:f}=a,p=(0,t.createFilterRequestScope)(o,{method:"eth_newFilter"}),y=c?(0,e.encodeEventTopics)({abi:s,args:u,eventName:c}):void 0,b=await o.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof l=="bigint"?(0,r.numberToHex)(l):l,toBlock:typeof f=="bigint"?(0,r.numberToHex)(f):f,topics:y}]});return{abi:s,args:u,eventName:c,id:b,request:p(b),strict:!!d,type:"event"}}return Go}var ti={},ri={},zf;function xe(){if(zf)return ri;zf=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.parseAccount=e;function e(r){return typeof r=="string"?{address:r,type:"json-rpc"}:r}return ri}var ni={},oi={},Uf;function Yp(){if(Uf)return oi;Uf=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.prepareEncodeFunctionData=a;const e=Ie(),r=Br(),t=kt(),i=$t(),o="/docs/contract/encodeFunctionData";function a(n){const{abi:s,args:u,functionName:c}=n;let l=s[0];if(c){const d=(0,i.getAbiItem)({abi:s,args:u,name:c});if(!d)throw new e.AbiFunctionNotFoundError(c,{docsPath:o});l=d}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:o});return{abi:[l],functionName:(0,r.toFunctionSelector)((0,t.formatAbiItem)(l))}}return oi}var Lf;function tt(){if(Lf)return ni;Lf=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.encodeFunctionData=i;const e=ke(),r=mt(),t=Yp();function i(o){const{args:a}=o,{abi:n,functionName:s}=o.abi.length===1&&o.functionName?.startsWith("0x")?o:(0,t.prepareEncodeFunctionData)(o),u=n[0],c=s,l="inputs"in u&&u.inputs?(0,r.encodeAbiParameters)(u.inputs,a??[]):void 0;return(0,e.concatHex)([c,l??"0x"])}return ni}var ii={},Ne={},St={},Df;function Zu(){return Df||(Df=1,Object.defineProperty(St,"__esModule",{value:!0}),St.solidityPanic=St.solidityError=St.panicReasons=void 0,St.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."},St.solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},St.solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}),St}var ai={},si={},ui={},Bt={},Gf;function Xp(){if(Gf)return Bt;Gf=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.RecursiveReadLimitExceededError=Bt.PositionOutOfBoundsError=Bt.NegativeOffsetError=void 0;const e=le();class r extends e.BaseError{constructor({offset:a}){super(`Offset \`${a}\` cannot be negative.`,{name:"NegativeOffsetError"})}}Bt.NegativeOffsetError=r;class t extends e.BaseError{constructor({length:a,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${a}\`).`,{name:"PositionOutOfBoundsError"})}}Bt.PositionOutOfBoundsError=t;class i extends e.BaseError{constructor({count:a,limit:n}
23){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${a}\`).`,{name:"RecursiveReadLimitExceededError"})}}return Bt.RecursiveReadLimitExceededError=i,Bt}var Vf;function lo(){if(Vf)return ui;Vf=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.createCursor=t;const e=Xp(),r={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(i){if(i<0||i>this.bytes.length-1)throw new e.PositionOutOfBoundsError({length:this.bytes.length,position:i})},decrementPosition(i){if(i<0)throw new e.NegativeOffsetError({offset:i});const o=this.position-i;this.assertPosition(o),this.position=o},getReadCount(i){return this.positionReadCount.get(i||this.position)||0},incrementPosition(i){if(i<0)throw new e.NegativeOffsetError({offset:i});const o=this.position+i;this.assertPosition(o),this.position=o},inspectByte(i){const o=i??this.position;return this.assertPosition(o),this.bytes[o]},inspectBytes(i,o){const a=o??this.position;return this.assertPosition(a+i-1),this.bytes.subarray(a,a+i)},inspectUint8(i){const o=i??this.position;return this.assertPosition(o),this.bytes[o]},inspectUint16(i){const o=i??this.position;return this.assertPosition(o+1),this.dataView.getUint16(o)},inspectUint24(i){const o=i??this.position;return this.assertPosition(o+2),(this.dataView.getUint16(o)<<8)+this.dataView.getUint8(o+2)},inspectUint32(i){const o=i??this.position;return this.assertPosition(o+3),this.dataView.getUint32(o)},pushByte(i){this.assertPosition(this.position),this.bytes[this.position]=i,this.position++},pushBytes(i){this.assertPosition(this.position+i.length-1),this.bytes.set(i,this.position),this.position+=i.length},pushUint8(i){this.assertPosition(this.position),this.bytes[this.position]=i,this.position++},pushUint16(i){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,i),this.position+=2},pushUint24(i){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,i>>8),this.dataView.setUint8(this.position+2,i&255),this.position+=3},pushUint32(i){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,i),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const i=this.inspectByte();return this.position++,i},readBytes(i,o){this.assertReadLimit(),this._touch();const a=this.inspectBytes(i);return this.position+=o??i,a},readUint8(){this.assertReadLimit(),this._touch();const i=this.inspectUint8();return this.position+=1,i},readUint16(){this.assertReadLimit(),this._touch();const i=this.inspectUint16();return this.position+=2,i},readUint24(){this.assertReadLimit(),this._touch();const i=this.inspectUint24();return this.position+=3,i},readUint32(){this.assertReadLimit(),this._touch();const i=this.inspectUint32();return this.position+=4,i},get remaining(){return this.bytes.length-this.position},setPosition(i){const o=this.position;return this.assertPosition(i),this.position=i,()=>this.position=o},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const i=this.getReadCount();this.positionReadCount.set(this.position,i+1),i>0&&this.recursiveReadCount++}};function t(i,{recursiveReadLimit:o=8192}={}){const a=Object.create(r);return a.bytes=i,a.dataView=new DataView(i.buffer,i.byteOffset,i.byteLength),a.positionReadCount=new Map,a.recursiveReadLimit=o,a}return ui}var Jt={},Wf;function Ad(){if(Wf)return Jt;Wf=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.fromBytes=o,Jt.bytesToBigInt=a,Jt.bytesToBool=n,Jt.bytesToNumber=s,Jt.bytesToString=u;const e=nn(),r=Ft(),t=Ce(),i=te();function o(c,l){const d=typeof l=="string"?{to:l}:l,f=d.to;return f==="number"?s(c,d):f==="bigint"?a(c,d):f==="boolean"?n(c,d):f==="string"?u(c,d):(0,i.bytesToHex)(c,d)}function a(c,l={}){typeof l.size<"u"&&(0,t.assertSize)(c,{size:l.size});const d=(0,i.bytesToHex)(c,l);return(0,t.hexToBigInt)(d,l)}function n(c,l={}){let d=c;if(typeof l.size<"u"&&((0,t.assertSize)(d,{size:l.size}),d=(0,r.trim)(d)),d.length>1||d[0]>1)throw new e.InvalidBytesBooleanError(d);return!!d[0]}function s(c,l={}){typeof l.size<"u"&&(0,t.assertSize)(c,{size:l.size});const d=(0,i.bytesToHex)(c,l);return(0,t.hexToNumber)(d,l)}function u(c,l={}){let d=c;return typeof l.size<"u"&&((0,t.assertSize)(d,{size:l.size}),d=(0,r.trim)(d,{dir:"right"})),new TextDecoder().decode(d)}return Jt}var Kf;function nr(){if(Kf)return si;Kf=1,Object.defineProperty(si,"__esModule",{value:!0}),si.decodeAbiParameters=l;const e=Ie(),r=et(),t=lo(),i=Ve(),o=ot(),a=Ft(),n=Ad(),s=we(),u=te(),c=mt();function l(E,_){const P=typeof _=="string"?(0,s.hexToBytes)(_):_,m=(0,t.createCursor)(P);if((0,i.size)(P)===0&&E.length>0)throw new e.AbiDecodingZeroDataError;if((0,i.size)(_)&&(0,i.size)(_)<32)throw new e.AbiDecodingDataSizeTooSmallError({data:typeof _=="string"?_:(0,u.bytesToHex)(_),params:E,size:(0,i.size)(_)});let T=0;const g=[];for(let v=0;v<E.length;++v){const h=E[v];m.setPosition(T);const[I,R]=d(m,h,{staticPosition:0});T+=R,g.push(I)}return g}function d(E,_,{staticPosition:P}){const m=(0,c.getArrayComponents)(_.type);if(m){const[T,g]=m;return b(E,{..._,type:g},{length:T,staticPosition:P})}if(_.type==="tuple")return M(E,_,{staticPosition:P});if(_.type==="address")return y(E);if(_.type==="bool")return w(E);if(_.type.startsWith("bytes"))return B(E,_,{staticPosition:P});if(_.type.startsWith("uint")||_.type.startsWith("int"))return x(E,_);if(_.type==="string")return A(E,{staticPosition:P});throw new e.InvalidAbiDecodingTypeError(_.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const f=32,p=32;function y(E){const _=E.readBytes(32);return[(0,r.checksumAddress)((0,u.bytesToHex)((0,o.sliceBytes)(_,-20))),32]}function b(E,_,{length:P,staticPosition:m}){if(!P){const v=(0,n.bytesToNumber)(E.readBytes(p)),h=m+v,I=h+f;E.setPosition(h);const R=(0,n.bytesToNumber)(E.readBytes(f)),j=O(_);let S=0;const C=[];for(let H=0;H<R;++H){E.setPosition(I+(j?H*32:S));const[F,q]=d(E,_,{staticPosition:I});S+=q,C.push(F)}return E.setPosition(m+32),[C,32]}if(O(_)){const v=(0,n.bytesToNumber)(E.readBytes(p)),h=m+v,I=[];for(let R=0;R<P;++R){E.setPosition(h+R*32);const[j]=d(E,_,{staticPosition:h});I.push(j)}return E.setPosition(m+32),[I,32]}let T=0;const g=[];for(let v=0;v<P;++v){const[h,I]=d(E,_,{staticPosition:m+T});T+=I,g.push(h)}return[g,T]}function w(E){return[(0,n.bytesToBool)(E.readBytes(32),{size:32}),32]}function B(E,_,{staticPosition:P}){const[m,T]=_.type.split("bytes");if(!T){const v=(0,n.bytesToNumber)(E.readBytes(32));E.setPosition(P+v);const h=(0,n.bytesToNumber)(E.readBytes(32));if(h===0)return E.setPosition(P+32),["0x",32];const I=E.readBytes(h);return E.setPosition(P+32),[(0,u.bytesToHex)(I),32]}return[(0,u.bytesToHex)(E.readBytes(Number.parseInt(T),32)),32]}function x(E,_){const P=_.type.startsWith("int"),m=Number.parseInt(_.type.split("int")[1]||"256"),T=E.readBytes(32);return[m>48?(0,n.bytesToBigInt)(T,{signed:P}):(0,n.bytesToNumber)(T,{signed:P}),32]}function M(E,_,{staticPosition:P}){const m=_.components.length===0||_.components.some(({name:v})=>!v),T=m?[]:{};let g=0;if(O(_)){const v=(0,n.bytesToNumber)(E.readBytes(p)),h=P+v;for(let I=0;I<_.components.length;++I){const R=_.components[I];E.setPosition(h+g);const[j,S]=d(E,R,{staticPosition:h});g+=S,T[m?I:R?.name]=j}return E.setPosition(P+32),[T,32]}for(let v=0;v<_.components.length;++v){const h=_.components[v],[I,R]=d(E,h,{staticPosition:P});T[m?v:h?.name]=I,g+=R}return[T,g]}function A(E,{staticPosition:_}){const P=(0,n.bytesToNumber)(E.readBytes(32)),m=_+P;E.setPosition(m);const T=(0,n.bytesToNumber)(E.readBytes(32));if(T===0)return E.setPosition(_+32),["",32];const g=E.readBytes(T,32),v=(0,n.bytesToString)((0,a.trim)(g));return E.setPosition(_+32),[v,32]}function O(E){const{type:_}=E;if(_==="string"||_==="bytes"||_.endsWith("[]"))return!0;
23if(_==="tuple")return E.components?.some(O);const P=(0,c.getArrayComponents)(E.type);return!!(P&&O({...E,type:P[1]}))}return si}var Zf;function Ju(){if(Zf)return ai;Zf=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.decodeErrorResult=n;const e=Zu(),r=Ie(),t=ot(),i=Br(),o=nr(),a=kt();function n(s){const{abi:u,data:c}=s,l=(0,t.slice)(c,0,4);if(l==="0x")throw new r.AbiDecodingZeroDataError;const f=[...u||[],e.solidityError,e.solidityPanic].find(p=>p.type==="error"&&l===(0,i.toFunctionSelector)((0,a.formatAbiItem)(p)));if(!f)throw new r.AbiErrorSignatureNotFoundError(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:f,args:"inputs"in f&&f.inputs&&f.inputs.length>0?(0,o.decodeAbiParameters)(f.inputs,(0,t.slice)(c,4)):void 0,errorName:f.name}}return ai}var ci={},Mn={},Jf;function Fe(){if(Jf)return Mn;Jf=1,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.stringify=void 0;const e=(r,t,i)=>JSON.stringify(r,(o,a)=>{const n=typeof a=="bigint"?a.toString():a;return typeof t=="function"?t(o,n):n},i);return Mn.stringify=e,Mn}var Yf;function Qp(){if(Yf)return ci;Yf=1,Object.defineProperty(ci,"__esModule",{value:!0}),ci.formatAbiItemWithArgs=r;const e=Fe();function r({abiItem:t,args:i,includeFunctionName:o=!0,includeName:a=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${o?t.name:""}(${t.inputs.map((n,s)=>`${a&&n.name?`${n.name}: `:""}${typeof i[s]=="object"?(0,e.stringify)(i[s]):i[s]}`).join(", ")})`}return ci}var di={},Rt={},Xf;
23function fo(){return Xf||(Xf=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.weiUnits=Rt.gweiUnits=Rt.etherUnits=void 0,Rt.etherUnits={gwei:9,wei:18},Rt.gweiUnits={ether:-9,wei:9},Rt.weiUnits={ether:-18,gwei:-9}),Rt}var li={},Qf;function Yu(){if(Qf)return li;Qf=1,Object.defineProperty(li,"__esModule",{value:!0}),li.formatUnits=e;function e(r,t){let i=r.toString();const o=i.startsWith("-");o&&(i=i.slice(1)),i=i.padStart(t,"0");let[a,n]=[i.slice(0,i.length-t),i.slice(i.length-t)];return n=n.replace(/(0+)$/,""),`${o?"-":""}${a||"0"}${n?`.${n}`:""}`}return li}var em;function mo(){if(em)return di;em=1,Object.defineProperty(di,"__esModule",{value:!0}),di.formatEther=t;const e=fo(),r=Yu();function t(i,o="wei"){return(0,r.formatUnits)(i,e.etherUnits[o])}return di}var fi={},tm;function Or(){if(tm)return fi;tm=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.formatGwei=t;const e=fo(),r=Yu();function t(i,o="wei"){return(0,r.formatUnits)(i,e.gweiUnits[o])}return fi}var Ot={},rm;function Td(){if(rm)return Ot;rm=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.StateAssignmentConflictError=Ot.AccountStateConflictError=void 0,Ot.prettyStateMapping=i,Ot.prettyStateOverride=o;const e=le();class r extends e.BaseError{constructor({address:n}){super(`State for account "${n}" is set multiple times.`,{name:"AccountStateConflictError"})}}Ot.AccountStateConflictError=r;class t extends e.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}Ot.StateAssignmentConflictError=t;function i(a){return a.reduce((n,{slot:s,value:u})=>`${n} ${s}: ${u} 24`,"")}function o(a){return a.reduce((n,{address:s,...u})=>{let c=`${n} ${s}: 25`;return u.nonce&&(c+=` nonce: ${u.nonce} 26`),u.balance&&(c+=` balance: ${u.balance} 27`),u.code&&(c+=` code: ${u.code} 28`),u.state&&(c+=` state: 29`,c+=i(u.state)),u.stateDiff&&(c+=` stateDiff: 30`,c+=i(u.stateDiff)),c},` State Override: 31`).slice(0,-1)}return Ot}var Te={},nm;function rt(){if(nm)return Te;nm=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.WaitForTransactionReceiptTimeoutError=Te.TransactionReceiptNotFoundError=Te.TransactionNotFoundError=Te.TransactionExecutionError=Te.InvalidStorageKeySizeError=Te.InvalidSerializedTransactionError=Te.InvalidSerializedTransactionTypeError=Te.InvalidSerializableTransactionError=Te.InvalidLegacyVError=Te.FeeConflictError=void 0,Te.prettyPrint=i;const e=mo(),r=Or(),t=le();function i(y){const b=Object.entries(y).map(([B,x])=>x===void 0||x===!1?null:[B,x]).filter(Boolean),w=b.reduce((B,[x])=>Math.max(B,x.length),0);return b.map(([B,x])=>` ${`${B}:`.padEnd(w+1)} ${x}`).join(` 32`)}class o extends t.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(` 33`),{name:"FeeConflictError"})}}Te.FeeConflictError=o;class a extends t.BaseError{constructor({v:b}){super(`Invalid \`v\` value "${b}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}Te.InvalidLegacyVError=a;class n extends t.BaseError{constructor({transaction:b}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",i(b),"}","","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"})}}Te.InvalidSerializableTransactionError=n;class s extends t.BaseError{constructor({serializedType:b}){super(`Serialized transaction type "${b}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=b}}Te.InvalidSerializedTransactionTypeError=s;class u extends t.BaseError{constructor({attributes:b,serializedTransaction:w,type:B}){const x=Object.entries(b).map(([M,A])=>typeof A>
33"u"?M:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${B}" was provided.`,{metaMessages:[`Serialized Transaction: "${w}"`,x.length>0?`Missing Attributes: ${x.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=w,this.type=B}}Te.InvalidSerializedTransactionError=u;class c extends t.BaseError{constructor({storageKey:b}){super(`Size for storage key "${b}" is invalid. Expected 32 bytes. Got ${Math.floor((b.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}Te.InvalidStorageKeySizeError=c;class l extends t.BaseError{constructor(b,{account:w,docsPath:B,chain:x,data:M,gas:A,gasPrice:O,maxFeePerGas:E,maxPriorityFeePerGas:_,nonce:P,to:m,value:T}){const g=i({chain:x&&`${x?.name} (id: ${x?.id})`,from:w?.address,to:m,value:typeof T<"u"&&`${(0,e.formatEther)(T)} ${x?.nativeCurrency?.symbol||"ETH"}`,data:M,gas:A,gasPrice:typeof O<"u"&&`${(0,r.formatGwei)(O)} gwei`,maxFeePerGas:typeof E<"u"&&`${(0,r.formatGwei)(E)} gwei`,maxPriorityFeePerGas:typeof _<"u"&&`${(0,r.formatGwei)(_)} gwei`,nonce:P});super(b.shortMessage,{cause:b,docsPath:B,metaMessages:[...b.metaMessages?[...b.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=b}}Te.TransactionExecutionError=l;class d extends t.BaseError{constructor({blockHash:b,blockNumber:w,blockTag:B,hash:x,index:M}){let A="Transaction";B&&M!==void 0&&(A=`Transaction at block time "${B}" at index "${M}"`),b&&M!==void 0&&(A=`Transaction at block hash "${b}" at index "${M}"`),w&&M!==void 0&&(A=`Transaction at block number "${w}" at index "${M}"`),x&&(A=`Transaction with hash "${x}"`),super(`${A} could not be found.`,{name:"TransactionNotFoundError"})}}Te.TransactionNotFoundError=d;class f extends t.BaseError{constructor({hash:b}){super(`Transaction receipt with hash "${b}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}Te.TransactionReceiptNotFoundError=f;class p extends t.BaseError{constructor({hash:b}){super(`Timed out while waiting for transaction with hash "${b}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}return Te.WaitForTransactionReceiptTimeoutError=p,Te}var yr={},om;function Id(){if(om)return yr;
33om=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.getUrl=yr.getContractAddress=void 0;const e=t=>t;yr.getContractAddress=e;const r=t=>t;return yr.getUrl=r,yr}var im;function or(){if(im)return Ne;im=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.RawContractError=Ne.CounterfactualDeploymentFailedError=Ne.ContractFunctionZeroDataError=Ne.ContractFunctionRevertedError=Ne.ContractFunctionExecutionError=Ne.CallExecutionError=void 0;const e=xe(),r=Zu(),t=Ju(),i=kt(),o=Qp(),a=$t(),n=mo(),s=Or(),u=Ie(),c=le(),l=Td(),d=rt(),f=Id();class p extends c.BaseError{constructor(A,{account:O,docsPath:E,chain:_,data:P,gas:m,gasPrice:T,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:h,to:I,value:R,stateOverride:j}){const S=O?(0,e.parseAccount)(O):void 0;let C=(0,d.prettyPrint)({from:S?.address,to:I,value:typeof R<"u"&&`${(0,n.formatEther)(R)} ${_?.nativeCurrency?.symbol||"ETH"}`,data:P,gas:m,gasPrice:typeof T<"u"&&`${(0,s.formatGwei)(T)} gwei`,maxFeePerGas:typeof g<"u"&&`${(0,s.formatGwei)(g)} gwei`,maxPriorityFeePerGas:typeof v<"u"&&`${(0,s.formatGwei)(v)} gwei`,nonce:h});j&&(C+=` 34${(0,l.prettyStateOverride)(j)}`),super(A.shortMessage,{cause:A,docsPath:E,metaMessages:[...A.metaMessages?[...A.metaMessages," "]:[],"Raw Call Arguments:",C].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=A}}Ne.CallExecutionError=p;class y extends c.BaseError{constructor(A,{abi:O,args:E,contractAddress:_,docsPath:P,functionName:m,sender:T}){const g=(0,a.getAbiItem)({abi:O,args:E,name:m}),v=g?(0,o.formatAbiItemWithArgs)({abiItem:g,args:E,includeFunctionName:!1,includeName:!1}):void 0,h=g?(0,i.formatAbiItem)(g,{includeName:!0}):void 0,I=(0,d.prettyPrint)({address:_&&(0,f.getContractAddress)(_),function:h,args:v&&v!=="()"&&`${[...Array(m?.length??0).keys()].map(()=>" ").join("")}${v}`,sender:T});super(A.shortMessage||`An unknown error occurred while executing the contract function "${m}".`,{cause:A,docsPath:P,metaMessages:[...A.metaMessages?[...A.metaMessages," "]:[],I&&"Contract Call:",I].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=O,this.args=E,this.cause=A,this.contractAddress=_,this.functionName=m,this.sender=T}}Ne.ContractFunctionExecutionError=y;class b extends c.BaseError{constructor({abi:A,data:O,functionName:E,message:_}){let P,m,T,g;if(O&&O!=="0x")try{m=(0,t.decodeErrorResult)({abi:A,data:O});const{abiItem:h,errorName:I,args:R}=m;if(I==="Error")g=R[0];else if(I==="Panic"){const[j]=R;g=r.panicReasons[j]}else{const j=h?(0,i.formatAbiItem)(h,{includeName:!0}):void 0,S=h&&R?(0,o.formatAbiItemWithArgs)({abiItem:h,args:R,includeFunctionName:!1,includeName:!1}):void 0;T=[j?`Error: ${j}`:"",S&&S!=="()"?` ${[...Array(I?.length??0).keys()].map(()=>" ").join("")}${S}`:""]}}catch(h){P=h}else _&&(g=_);let v;P instanceof u.AbiErrorSignatureNotFoundError&&(v=P.signature,T=[`Unable to decode signature "${v}" 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=${v}.`]),super(g&&g!=="execution reverted"||v?[`The contract function "${E}" reverted with the following ${v?"signature":"reason"}:`,g||v].join(` 35`):`The contract function "${E}" reverted.`,{cause:P,metaMessages:T,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=m,this.raw=O,this.reason=g,this.signature=v}}Ne.ContractFunctionRevertedError=b;class w extends c.BaseError{constructor({functionName:A}){super(`The contract function "${A}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${A}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}Ne.ContractFunctionZeroDataError=w;class B extends c.BaseError{constructor({factory:A}){super(`Deployment for counterfactual contract call failed${A?` for factory "${A}".`:""}`,{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"})}}Ne.CounterfactualDeploymentFailedError=B;class x extends c.BaseError{constructor({data:A,message:O}){super(O||"",{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=A}}return Ne.RawContractError=x,Ne}var Ye={},am;function bt(){if(am)return Ye;
35am=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.TimeoutError=Ye.SocketClosedError=Ye.RpcRequestError=Ye.WebSocketRequestError=Ye.HttpRequestError=void 0;const e=Fe(),r=le(),t=Id();class i extends r.BaseError{constructor({body:c,cause:l,details:d,headers:f,status:p,url:y}){super("HTTP request failed.",{cause:l,details:d,metaMessages:[p&&`Status: ${p}`,`URL: ${(0,t.getUrl)(y)}`,c&&`Request body: ${(0,e.stringify)(c)}`].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=c,this.headers=f,this.status=p,this.url=y}}Ye.HttpRequestError=i;class o extends r.BaseError{constructor({body:c,cause:l,details:d,url:f}){super("WebSocket request failed.",{cause:l,details:d,metaMessages:[`URL: ${(0,t.getUrl)(f)}`,c&&`Request body: ${(0,e.stringify)(c)}`].filter(Boolean),name:"WebSocketRequestError"})}}Ye.WebSocketRequestError=o;class a extends r.BaseError{constructor({body:c,error:l,url:d}){super("RPC Request failed.",{cause:l,details:l.message,metaMessages:[`URL: ${(0,t.getUrl)(d)}`,`Request body: ${(0,e.stringify)(c)}`],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}),this.code=l.code,this.data=l.data}}Ye.RpcRequestError=a;class n extends r.BaseError{constructor({url:c}={}){super("The socket has been closed.",{metaMessages:[c&&`URL: ${(0,t.getUrl)(c)}`].filter(Boolean),name:"SocketClosedError"})}}Ye.SocketClosedError=n;class s extends r.BaseError{constructor({body:c,url:l}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,t.getUrl)(l)}`,`Request body: ${(0,e.stringify)(c)}`],name:"TimeoutError"})}}return Ye.TimeoutError=s,Ye}var ie={},sm;function ir(){if(sm)return ie;sm=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.UnknownRpcError=ie.AtomicityNotSupportedError=ie.AtomicReadyWalletRejectedUpgradeError=ie.BundleTooLargeError=ie.UnknownBundleIdError=ie.DuplicateIdError=ie.UnsupportedChainIdError=ie.UnsupportedNonOptionalCapabilityError=ie.SwitchChainError=ie.ChainDisconnectedError=ie.ProviderDisconnectedError=ie.UnsupportedProviderMethodError=ie.UnauthorizedProviderError=ie.UserRejectedRequestError=ie.JsonRpcVersionUnsupportedError=ie.LimitExceededRpcError=ie.MethodNotSupportedRpcError=ie.TransactionRejectedRpcError=ie.ResourceUnavailableRpcError=ie.ResourceNotFoundRpcError=ie.InvalidInputRpcError=ie.InternalRpcError=ie.InvalidParamsRpcError=ie.MethodNotFoundRpcError=ie.InvalidRequestRpcError=ie.ParseRpcError=ie.ProviderRpcError=ie.RpcError=void 0;const e=le(),r=bt(),t=-1;class i extends e.BaseError{constructor(j,{code:S,docsPath:C,metaMessages:H,name:F,shortMessage:q}){super(q,{cause:j,docsPath:C,metaMessages:H||j?.metaMessages,name:F||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=F||j.name,this.code=j instanceof r.RpcRequestError?j.code:S??t}}ie.RpcError=i;class o extends i{constructor(j,S){super(j,S),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=S.data}}ie.ProviderRpcError=o;class a extends i{constructor(j){super(j,{code:a.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}ie.ParseRpcError=a,Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class n extends i{constructor(j){super(j,{code:n.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}ie.InvalidRequestRpcError=n,Object.defineProperty(n,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class s extends i{constructor(j,{method:S}={}){super(j,{code:s.code,name:"MethodNotFoundRpcError",shortMessage:`The method${S?` "${S}"`:""} does not exist / is not available.`})}}ie.MethodNotFoundRpcError=s,Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends i{constructor(j){super(j,{code:u.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 36`)})}}ie.InvalidParamsRpcError=u,Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class c extends i{constructor(j){super(j,{code:c.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}ie.InternalRpcError=c,Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class l extends i{constructor(j){super(j,{code:l.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 37`)})}}ie.InvalidInputRpcError=l,Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class d extends i{constructor(j){super(j,{code:d.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}ie.ResourceNotFoundRpcError=d,Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class f extends i{constructor(j){super(j,{code:f.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}ie.ResourceUnavailableRpcError=f,Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class p extends i{constructor(j){super(j,{code:p.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}ie.TransactionRejectedRpcError=p,Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class y extends i{constructor(j,{method:S}={}){super(j,{code:y.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${S?` "${S}"`:""} is not supported.`})}}ie.MethodNotSupportedRpcError=y,Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class b extends i{constructor(j){super(j,{code:b.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}ie.LimitExceededRpcError=b,Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class w extends i{constructor(j){super(j,{code:w.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}ie.JsonRpcVersionUnsupportedError=w,Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class B extends o{constructor(j){super(j,{code:B.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}ie.UserRejectedRequestError=B,Object.defineProperty(B,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class x extends o{constructor(j){super(j,{code:x.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}ie.UnauthorizedProviderError=x,Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class M extends o{constructor(j,{method:S}={}){super(j,{code:M.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${S?` " ${S}"`:""}.`})}}ie.UnsupportedProviderMethodError=M,Object.defineProperty(M,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class A extends o{constructor(j){super(j,{code:A.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}ie.ProviderDisconnectedError=A,Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class O extends o{constructor(j){super(j,{code:O.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}ie.ChainDisconnectedError=O,Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class E extends o{constructor(j){super(j,{code:E.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}ie.SwitchChainError=E,Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class _ extends o{constructor(j){super(j,{code:_.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}ie.UnsupportedNonOptionalCapabilityError=_,Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class P extends o{constructor(j){super(j,{code:P.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}ie.UnsupportedChainIdError=P,Object.defineProperty(P,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class m extends o{constructor(j){super(j,{code:m.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}ie.DuplicateIdError=m,Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class T extends o{constructor(j){super(j,{code:T.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}ie.UnknownBundleIdError=T,Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class g extends o{constructor(j){super(j,{code:g.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}ie.BundleTooLargeError=g,Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class v extends o{constructor(j){super(j,{code:v.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}ie.AtomicReadyWalletRejectedUpgradeError=v,Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
37);class h extends o{constructor(j){super(j,{code:h.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}ie.AtomicityNotSupportedError=h,Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class I extends i{constructor(j){super(j,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}return ie.UnknownRpcError=I,ie}var um;function ar(){if(um)return ii;um=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.getContractError=n;const e=Ie(),r=le(),t=or(),i=bt(),o=ir(),a=3;function n(s,{abi:u,address:c,args:l,docsPath:d,functionName:f,sender:p}){const y=s instanceof t.RawContractError?s:s instanceof r.BaseError?s.walk(O=>"data"in O)||s.walk():{},{code:b,data:w,details:B,message:x,shortMessage:M}=y,A=s instanceof e.AbiDecodingZeroDataError?new t.ContractFunctionZeroDataError({functionName:f}):[a,o.InternalRpcError.code].includes(b)&&(w||B||x||M)?new t.ContractFunctionRevertedError({abi:u,data:typeof w=="object"?w.data:w,functionName:f,message:y instanceof i.RpcRequestError?B:M??x}):s;return new t.ContractFunctionExecutionError(A,{abi:u,args:l,contractAddress:c,docsPath:d,functionName:f,sender:p})}return ii}var mi={},bi={},hi={},yi={},cm;function eg(){if(cm)return yi;cm=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.publicKeyToAddress=t;const e=et(),r=We();function t(i){const o=(0,r.keccak256)(`0x${i.substring(4)}`).substring(26);return(0,e.checksumAddress)(`0x${o}`)}return yi}var pi={},Yc={},ve={},$e={},dm;function tg(){if(dm)return $e;dm=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.SHA512_IV=$e.SHA384_IV=$e.SHA224_IV=$e.SHA256_IV=$e.HashMD=void 0,$e.setBigUint64=r,$e.Chi=t,$e.Maj=i;const e=Ht();function r(a,n,s,u){if(typeof a.setBigUint64=="function")return a.setBigUint64(n,s,u);const c=BigInt(32),l=BigInt(4294967295),d=Number(s>>c&l),f=Number(s&l),p=u?4:0,y=u?0:4;a.setUint32(n+p,d,u),a.setUint32(n+y,f,u)}function t(a,n,s){return a&n^~a&s}function i(a,n,s){return a&n^a&s^n&s}class o extends e.Hash{constructor(n,s,u,c){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=n,this.outputLen=s,this.padOffset=u,this.isLE=c,this.buffer=new Uint8Array(n),this.view=(0,e.createView)(this.buffer)}update(n){(0,e.aexists)(this),n=(0,e.toBytes)(n),(0,e.abytes)(n);const{view:s,buffer:u,blockLen:c}=this,l=n.length;for(let d=0;d<l;
vendor: 1,881 bytes, line 37
37){const f=Math.min(c-this.pos,l-d);if(f===c){const p=(0,e.createView)(n);for(;c<=l-d;d+=c)this.process(p,d);continue}u.set(n.subarray(d,d+f),this.pos),this.pos+=f,d+=f,this.pos===c&&(this.process(s,0),this.pos=0)}return this.length+=n.length,this.roundClean(),this}digestInto(n){(0,e.aexists)(this),(0,e.aoutput)(n,this),this.finished=!0;const{buffer:s,view:u,blockLen:c,isLE:l}=this;let{pos:d}=this;s[d++]=128,(0,e.clean)(this.buffer.subarray(d)),this.padOffset>c-d&&(this.process(u,0),d=0);for(let w=d;w<c;w++)s[w]=0;r(u,c-8,BigInt(this.length*8),l),this.process(u,0);const f=(0,e.createView)(n),p=this.outputLen;if(p%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const y=p/4,b=this.get();if(y>b.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<y;w++)f.setUint32(4*w,b[w],l)}digest(){const{buffer:n,outputLen:s}=this;this.digestInto(n);const u=n.slice(0,s);return this.destroy(),u}_cloneInto(n){n||(n=new this.constructor),n.set(...this.get());const{blockLen:s,buffer:u,length:c,finished:l,destroyed:d,pos:f}=this;return n.destroyed=d,n.finished=l,n.length=c,n.pos=f,c%s&&n.buffer.set(u),n}clone(){return this._cloneInto()}}return $e.HashMD=o,$e.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),$e.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),$e.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),$e.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),$e}var lm;function rg(){if(lm)return ve;
37lm=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.sha512_224=ve.sha512_256=ve.sha384=ve.sha512=ve.sha224=ve.sha256=ve.SHA512_256=ve.SHA512_224=ve.SHA384=ve.SHA512=ve.SHA224=ve.SHA256=void 0;const e=tg(),r=s_(),t=Ht(),i=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),o=new Uint32Array(64);class a extends e.HashMD{constructor(M=32){super(64,M,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:M,B:A,C:O,D:E,E:_,F:P,G:m,H:T}=this;return[M,A,O,E,_,P,m,T]}set(M,A,O,E,_,P,m,T){this.A=M|0,this.B=A|0,this.C=O|0,this.D=E|0,this.E=_|0,this.F=P|0,this.G=m|0,this.H=T|0}process(M,A){for(let h=0;h<16;h++,A+=4)o[h]=M.getUint32(A,!1);for(let h=16;h<64;h++){const I=o[h-15],R=o[h-2],j=(0,t.rotr)(I,7)^(0,t.rotr)(I,18)^I>>>3,S=(0,t.rotr)(R,17)^(0,t.rotr)(R,19)^R>>>10;o[h]=S+o[h-7]+j+o[h-16]|0}let{A:O,B:E,C:_,D:P,E:m,F:T,G:g,H:v}=this;for(let h=0;h<64;h++){const I=(0,t.rotr)(m,6)^(0,t.rotr)(m,11)^(0,t.rotr)(m,25),R=v+I+(0,e.Chi)(m,T,g)+i[h]+o[h]|0,S=((0,t.rotr)(O,2)^(0,t.rotr)(O,13)^(0,t.rotr)(O,22))+(0,e.Maj)(O,E,_)|0;v=g,g=T,T=m,m=P+R|0,P=_,_=E,E=O,O=R+S|0}O=O+this.A|0,E=E+this.B|0,_=_+this.C|0,P=P+this.D|0,m=m+this.E|0,T=T+this.F|0,g=g+this.G|0,v=v+this.H|0,this.set(O,E,_,P,m,T,g,v)}roundClean(){(0,t.clean)(o)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,t.clean)(this.buffer)}}ve.SHA256=a;class n 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}}ve.SHA224=n;const s=r.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","0xf40e3585
375771202a","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(x=>BigInt(x))),u=s[0],c=s[1],l=new Uint32Array(80),d=new Uint32Array(80);class f extends e.HashMD{constructor(M=64){super(128,M,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:M,Al:A,Bh:O,Bl:E,Ch:_,Cl:P,Dh:m,Dl:T,Eh:g,El:v,Fh:h,Fl:I,Gh:R,Gl:j,Hh:S,Hl:C}=this;return[M,A,O,E,_,P,m,T,g,v,h,I,R,j,S,C]}set(M,A,O,E,_,P,m,T,g,v,h,I,R,j,S,C){this.Ah=M|0,this.Al=A|0,this.Bh=O|0,this.Bl=E|0,this.Ch=_|0,this.Cl=P|0,this.Dh=m|0,this.Dl=T|0,this.Eh=g|0,this.El=v|0,this.Fh=h|0,this.Fl=I|0,this.Gh=R|0,this.Gl=j|0,this.Hh=S|0,this.Hl=C|0}process(M,A){for(let q=0;q<16;q++,A+=4)l[q]=M.getUint32(A),d[q]=M.getUint32(A+=4);for(let q=16;q<80;q++){const k=l[q-15]|0,N=d[q-15]|0,D=r.rotrSH(k,N,1)^r.rotrSH(k,N,8)^r.shrSH(k,N,7),W=r.rotrSL(k,N,1)^r.rotrSL(k,N,8)^r.shrSL(k,N,7),$=l[q-2]|0,V=d[q-2]|0,J=r.rotrSH($,V,19)^r.rotrBH($,V,61)^r.shrSH($,V,6),X=r.rotrSL($,V,19)^r.rotrBL($,V,61)^r.shrSL($,V,6),K=r.add4L(W,X,d[q-7],d[q-16]),de=r.add4H(K,D,J,l[q-7],l[q-16]);l[q]=de|0,d[q]=K|0}let{Ah:O,Al:E,Bh:_,Bl:P,Ch:m,Cl:T,Dh:g,Dl:v,Eh:h,El:I,Fh:R,Fl:j,Gh:S,Gl:C,Hh:H,Hl:F}=this;for(let q=0;q<80;q++){const k=r.rotrSH(h,I,14)^r.rotrSH(h,I,18)^r.rotrBH(h,I,41),N=r.rotrSL(h,I,14)^r.rotrSL(h,I,18)^r.rotrBL(h,I,41),D=h&R^~h&S,W=I&j^~I&C,$=r.add5L(F,N,W,c[q],d[q]),V=r.add5H($,H,k,D,u[q],l[q]),J=$|0,X=r.rotrSH(O,E,28)^r.rotrBH(O,E,34)^r.rotrBH(O,E,39),K=r.rotrSL(O,E,28)^r.rotrBL(O,E,34)^r.rotrBL(O,E,39),de=O&_^O&m^_&m,me=E&P^E&T^P&T;H=S|0,F=C|0,S=R|0,C=j|0,R=h|0,j=I|0,{h,l:I}=r.add(g|0,v|0,V|0,J|0),g=m|0,v=T|0,m=_|0,T=P|0,_=O|0,P=E|0;const se=r.add3L(J,K,me);O=r.add3H(se,V,X,de),E=se|0}({h:O,l:E}=r.add(this.Ah|0,this.Al|0,O|0,E|0)),{h:_,l:P}=r.add(this.Bh|0,this.Bl|0,_|0,P|0),{h:m,l:T}=r.add(this.Ch|0,this.Cl|0,m|0,T|0),{h:g,l:v}=r.add(this.Dh|0,this.Dl|0,g|0,v|0),{h,l:I}=r.add(this.Eh|0,this.El|0,h|0,I|0),{h:R,l:j}=r.add(this.Fh|0,this.Fl|0,R|0,j|0),{h:S,l:C}=r.add(this.Gh|0,this.Gl|0,S|0,C|0),{h:H,l:F}=r.add(this.Hh|0,this.Hl|0,H|0,F|0),this.set(O,E,_,P,m,T,g,v,h,I,R,j,S,C,H,F)}roundClean(){(0,t.clean)(l,d)}destroy(){(0,t.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}ve.SHA512=f;class p extends f{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}}ve.SHA384=p;const y=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),b=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class w extends f{constructor(){super(28),this.Ah=y[0]|0,this.Al=y[1]|0,this.Bh=y[2]|0,this.Bl=y[3]|0,this.Ch=y[4]|0,this.Cl=y[5]|0,this.Dh=y[6]|0,this.Dl=y[7]|0,this.Eh=y[8]|0,this.El=y[9]|0,this.Fh=y[10]|0,this.Fl=y[11]|0,this.Gh=y[12]|0,this.Gl=y[13]|0,this.Hh=y[14]|0,this.Hl=y[15]|0}}ve.SHA512_224=w;class B extends f{constructor(){super(32),this.Ah=b[0]|0,this.Al=b[1]|0,this.Bh=b[2]|0,this.Bl=b[3]|0,this.Ch=b[4]|0,this.Cl=b[5]|0,this.Dh=b[6]|0,this.Dl=b[7]|0,this.Eh=b[8]|0,this.El=b[9]|0,this.Fh=b[10]|0,this.Fl=b[11]|0,this.Gh=b[12]|0,this.Gl=b[13]|0,this.Hh=b[14]|0,this.Hl=b[15]|0}}return ve.SHA512_256=B,ve.sha256=(0,t.createHasher)(()=>new a),ve.sha224=(0,t.createHasher)(()=>new n),ve.sha512=(0,t.createHasher)(()=>new f),ve.sha384=(0,t.createHasher)(()=>new p),ve.sha512_256=(0,t.createHasher)(()=>new B),ve.sha512_224=(0,t.createHasher)(()=>new w),ve}var Hn={},Xc={},Qc={},fm;function O_(){return fm||(fm=1,function(e){Object.defineProperty(e,"__esMo
37dule",{value:!0}),e.hmac=e.HMAC=void 0;const r=Ht();class t extends r.Hash{constructor(a,n){super(),this.finished=!1,this.destroyed=!1,(0,r.ahash)(a);const s=(0,r.toBytes)(n);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,c=new Uint8Array(u);c.set(s.length>u?a.create().update(s).digest():s);for(let l=0;l<c.length;l++)c[l]^=54;this.iHash.update(c),this.oHash=a.create();for(let l=0;l<c.length;l++)c[l]^=106;this.oHash.update(c),(0,r.clean)(c)}update(a){return(0,r.aexists)(this),this.iHash.update(a),this}digestInto(a){(0,r.aexists)(this),(0,r.abytes)(a,this.outputLen),this.finished=!0,this.iHash.digestInto(a),this.oHash.update(a),this.oHash.digestInto(a),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||(a=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:s,finished:u,destroyed:c,blockLen:l,outputLen:d}=this;return a=a,a.finished=u,a.destroyed=c,a.blockLen=l,a.outputLen=d,a.oHash=n._cloneInto(a.oHash),a.iHash=s._cloneInto(a.iHash),a}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=t;const i=(o,a,n)=>new t(o,a).update(n).digest();e.hmac=i,e.hmac.create=(o,a)=>new t(o,a)}(Qc)),Qc}var ed={},mm;function bo(){return mm||(mm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.notImplemented=e.bitMask=e.utf8ToBytes=e.randomBytes=e.isBytes=e.hexToBytes=e.concatBytes=e.bytesToUtf8=e.bytesToHex=e.anumber=e.abytes=void 0,e.abool=a,e.numberToHexUnpadded=n,e.hexToNumber=s,e.bytesToNumberBE=u,e.bytesToNumberLE=c,e.numberToBytesBE=l,e.numberToBytesLE=d,e.numberToVarBytesBE=f,e.ensureBytes=p,e.equalBytes=y,e.inRange=w,e.aInRange=B,e.bitLen=x,e.bitGet=M,e.bitSet=A,e.createHmacDrbg=E,e.validateObject=P,e.isHash=m,e._validateObject=T,e.memoized=v;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const r=Ht();var t=Ht();Object.defineProperty(e,"abytes",{enumerable:!0,get:function(){return t.abytes}}),Object.defineProperty(e,"anumber",{enumerable:!0,get:function(){return t.anumber}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return t.bytesToHex}}),Object.defineProperty(e,"bytesToUtf8",{enumerable:!0,get:function(){return t.bytesToUtf8}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return t.concatBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return t.hexToBytes}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return t.isBytes}}),Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return t.randomBytes}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return t.utf8ToBytes}});const i=BigInt(0),o=BigInt(1);function a(h,I){if(typeof I!="boolean")throw new Error(h+" boolean expected, got "+I)}function n(h){const I=h.toString(16);return I.length&1?"0"+I:I}function s(h){if(typeof h!="string")throw new Error("hex string expected, got "+typeof h);return h===""?i:BigInt("0x"+h)}function u(h){return s((0,r.bytesToHex)(h))}function c(h){return(0,r.abytes)(h),s((0,r.bytesToHex)(Uint8Array.from(h).reverse()))}function l(h,I){return(0,r.hexToBytes)(h.toString(16).padStart(I*2,"0"))}function d(h,I){return l(h,I).reverse()}function f(h){return(0,r.hexToBytes)(n(h))}function p(h,I,R){let j;if(typeof I=="string")try{j=(0,r.hexToBytes)(I)}catch(C){throw new Error(h+" must be hex string or Uint8Array, cause: "+C)}else if((0,r.isBytes)(I))j=Uint8Array.from(I);else throw new Error(h+" must be hex string or Uint8Array");const S=j.length;if(typeof R=="number"&&S!==R)throw new Error(h+" of length "+R+" expected, got "+S);return j}function y(h,I){if(h.length!==I.length)return!1;let R=0;for(let j=0;j<h.length;j++)R|=h[j]^I[j];return R===0}const b=h=>typeof h=="bigint"&&i<=h;function w(h,I,R){return b(h)&&b(I)&&b(R)&&I<=h&&h<R}function B(h,I,R,j){if(!w(I,R,j))throw new Error("expected valid "+h+": "+R+" <= n < "+j+", got "+I)}function x(h){let I;for(I=0;h>i;h>>=o,I+=1);return I}function M(h,I){return h>>BigInt(I)&o}function A(h,I,R){return h|(R?o:i)<<BigInt(I)}const O=h=>(o<<BigInt(h))-o;e.bitMask=O;function E(h,I,R){if(typeof h!="number"||h<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 R!="function")throw new Error("hmacFn must be a function");const j=$=>new Uint8Array($),S=$=>Uint8Array.of($);let C=j(h),H=j(h),F=0;const q=()=>{C.fill(1),H.fill(0),F=0},k=(...$)=>R(H,C,...$),N=($=j(0))=>{H=k(S(0),$),C=k(),$.length!==0&&(H=k(S(1),$),C=k())},D=()=>
37{if(F++>=1e3)throw new Error("drbg: tried 1000 values");let $=0;const V=[];for(;$<I;){C=k();const J=C.slice();V.push(J),$+=C.length}return(0,r.concatBytes)(...V)};return($,V)=>{q(),N($);let J;for(;!(J=V(D()));)N();return q(),J}}const _={bigint:h=>typeof h=="bigint",function:h=>typeof h=="function",boolean:h=>typeof h=="boolean",string:h=>typeof h=="string",stringOrUint8Array:h=>typeof h=="string"||(0,r.isBytes)(h),isSafeInteger:h=>Number.isSafeInteger(h),array:h=>Array.isArray(h),field:(h,I)=>I.Fp.isValid(h),hash:h=>typeof h=="function"&&Number.isSafeInteger(h.outputLen)};function P(h,I,R={}){const j=(S,C,H)=>{const F=_[C];if(typeof F!="function")throw new Error("invalid validator function");const q=h[S];if(!(H&&q===void 0)&&!F(q,h))throw new Error("param "+String(S)+" is invalid. Expected "+C+", got "+q)};for(const[S,C]of Object.entries(I))j(S,C,!1);for(const[S,C]of Object.entries(R))j(S,C,!0);return h}function m(h){return typeof h=="function"&&Number.isSafeInteger(h.outputLen)}function T(h,I,R={}){if(!h||typeof h!="object")throw new Error("expected valid options object");function j(S,C,H){const F=h[S];if(H&&F===void 0)return;const q=typeof F;if(q!==C||F===null)throw new Error(`param "${S}" is invalid: expected ${C}, got ${q}`)}Object.entries(I).forEach(([S,C])=>j(S,C,!1)),Object.entries(R).forEach(([S,C])=>j(S,C,!0))}const g=()=>{throw new Error("not implemented")};e.notImplemented=g;function v(h){const I=new WeakMap;return(R,...j)=>{const S=I.get(R);if(S!==void 0)return S;const C=h(R,...j);return I.set(R,C),C}}}(ed)),ed}var at={},Ae={},bm;function Xu(){if(bm)return Ae;bm=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.isNegativeLE=void 0,Ae.mod=u,Ae.pow=c,Ae.pow2=l,Ae.invert=d,Ae.tonelliShanks=y,Ae.FpSqrt=b,Ae.validateField=x,Ae.FpPow=M,Ae.FpInvertBatch=A,Ae.FpDiv=O,Ae.FpLegendre=E,Ae.FpIsSquare=_,Ae.nLength=P,Ae.Field=m,Ae.FpSqrtOdd=T,Ae.FpSqrtEven=g,Ae.hashToPrivateScalar=v,Ae.getFieldBytesLength=h,Ae.getMinHashLength=I,Ae.mapHashToField=R;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=bo(),r=BigInt(0),t=BigInt(1),i=BigInt(2),o=BigInt(3),a=BigInt(4),n=BigInt(5),s=BigInt(8);function u(j,S){const C=j%S;return C>=r?C:S+C}function c(j,S,C){return M(m(C),j,S)}function l(j,S,C){let H=j;for(;S-- >r;)H*=H,H%=C;return H}function d(j,S){if(j===r)throw new Error("invert: expected non-zero number");if(S<=r)throw new Error("invert: expected positive modulus, got "+S);let C=u(j,S),H=S,F=r,q=t;for(;C!==r;){const N=H/C,D=H%C,W=F-q*N;H=C,C=D,F=q,q=W}if(H!==t)throw new Error("invert: does not exist");return u(F,S)}function f(j,S){const C=(j.ORDER+t)/a,H=j.pow(S,C);if(!j.eql(j.sqr(H),S))throw new Error("Cannot find square root");return H}function p(j,S){const C=(j.ORDER-n)/s,H=j.mul(S,i),F=j.pow(H,C),q=j.mul(S,F),k=j.mul(j.mul(q,i),F),N=j.mul(q,j.sub(k,j.ONE));if(!j.eql(j.sqr(N),S))throw new Error("Cannot find square root");return N}function y(j){if(j<BigInt(3))throw new Error("sqrt is not defined for small field");let S=j-t,C=0;for(;S%i===r;)S/=i,C++;let H=i;const F=m(j);for(;E(F,H)===1;)if(H++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(C===1)return f;let q=F.pow(H,S);const k=(S+t)/i;return function(D,W){if(D.is0(W))return W;if(E(D,W)!==1)throw new Error("Cannot find square root");let $=C,V=D.mul(D.ONE,q),J=D.pow(W,S),X=D.pow(W,k);for(;!D.eql(J,D.ONE);){if(D.is0(J))return D.ZERO;let K=1,de=D.sqr(J);for(;!D.eql(de,D.ONE);)if(K++,de=D.sqr(de),K===$)throw new Error("Cannot find square root");const me=t<<BigInt($-K-1),se=D.pow(V,me);$=K,V=D.sqr(se),J=D.mul(J,V),X=D.mul(X,se)}return X}}function b(j){return j%a===o?f:j%s===n?p:y(j)}const w=(j,S)=>(u(j,S)&t)===t;Ae.isNegativeLE=w;const B=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function x(j){const S={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},C=B.reduce((H,F)=>(H[F]="function",H),S);return(0,e._validateObject)(j,C),j}function M(j,S,C){if(C<r)throw new Error("invalid exponent, negatives unsupported");if(C===r)return j.ONE;if(C===t)return S;let H=j.ONE,F=S;for(;C>r;)C&t&&(H=j.mul(H,F)),F=j.sqr(F),C>>=t;return H}function A(j,S,C=!1){const H=new Array(S.length).fill(C?j.ZERO:void 0),F=S.reduce((k,N,D)=>j.is0(N)?k:(H[D]=k,j.mul(k,N)),j.ONE),q=j.inv(F);return S.reduceRight((k,N,D)=>j.is0(N)?k:(H[D]=j.mul(k,H[D]),j.mul(k,N)),q),H}function O(j,S,C){return j.mul(S,typeof C=="bigint"?d(C,j.ORDER):j.inv(C))}function E(j,S){const C=(j.ORDER-t)/i,H=j.pow(S,C),F=j.eql(H,j.ONE),q=j.eql(H,j.ZERO),k=j.eql(H,j.neg(j.ONE));if(!F&&!q&&!k)throw new Error("invalid Legendre symbol result");return F?1:q?0:-1}function _(j,S){return E(j,S)===1}function P(j,S){S!==void 0&&(0,e.anumber)(S);const C=S!==void 0?S:j.toString(2).length,H=Math.ceil(C/8);return{nBitLength:C,nByteLength:H}}function m(j,S,C=!1,H={}){if(j<=r)throw new Error("invalid field: expected ORDER > 0, got "+j);let F,q;if(typeof S=="object"&&S!=null){if(H.sqrt||C)throw new Error("cannot specify opts in two arguments");const $=S;
37$.BITS&&(F=$.BITS),$.sqrt&&(q=$.sqrt),typeof $.isLE=="boolean"&&(C=$.isLE)}else typeof S=="number"&&(F=S),H.sqrt&&(q=H.sqrt);const{nBitLength:k,nByteLength:N}=P(j,F);if(N>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let D;const W=Object.freeze({ORDER:j,isLE:C,BITS:k,BYTES:N,MASK:(0,e.bitMask)(k),ZERO:r,ONE:t,create:$=>u($,j),isValid:$=>{if(typeof $!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof $);return r<=$&&$<j},is0:$=>$===r,isValidNot0:$=>!W.is0($)&&W.isValid($),isOdd:$=>($&t)===t,neg:$=>u(-$,j),eql:($,V)=>$===V,sqr:$=>u($*$,j),add:($,V)=>u($+V,j),sub:($,V)=>u($-V,j),mul:($,V)=>u($*V,j),pow:($,V)=>M(W,$,V),div:($,V)=>u($*d(V,j),j),sqrN:$=>$*$,addN:($,V)=>$+V,subN:($,V)=>$-V,mulN:($,V)=>$*V,inv:$=>d($,j),sqrt:q||($=>(D||(D=b(j)),D(W,$))),toBytes:$=>C?(0,e.numberToBytesLE)($,N):(0,e.numberToBytesBE)($,N),fromBytes:$=>{if($.length!==N)throw new Error("Field.fromBytes: expected "+N+" bytes, got "+$.length);return C?(0,e.bytesToNumberLE)($):(0,e.bytesToNumberBE)($)},invertBatch:$=>A(W,$),cmov:($,V,J)=>J?V:$});return Object.freeze(W)}function T(j,S){if(!j.isOdd)throw new Error("Field doesn't have isOdd");const C=j.sqrt(S);return j.isOdd(C)?C:j.neg(C)}function g(j,S){if(!j.isOdd)throw new Error("Field doesn't have isOdd");const C=j.sqrt(S);return j.isOdd(C)?j.neg(C):C}function v(j,S,C=!1){j=(0,e.ensureBytes)("privateHash",j);const H=j.length,F=P(S).nByteLength+8;if(F<24||H<F||H>1024)throw new Error("hashToPrivateScalar: expected "+F+"-1024 bytes of input, got "+H);const q=C?(0,e.bytesToNumberLE)(j):(0,e.bytesToNumberBE)(j);return u(q,S-t)+t}function h(j){if(typeof j!="bigint")throw new Error("field order must be bigint");const S=j.toString(2).length;return Math.ceil(S/8)}function I(j){const S=h(j);return S+Math.ceil(S/2)}function R(j,S,C=!1){const H=j.length,F=h(S),q=I(S);if(H<16||H<q||H>1024)throw new Error("expected "+q+"-1024 bytes of input, got "+H);const k=C?(0,e.bytesToNumberLE)(j):(0,e.bytesToNumberBE)(j),N=u(k,S-t)+t;return C?(0,e.numberToBytesLE)(N,F):(0,e.numberToBytesBE)(N,F)}return Ae}var hm;function C_(){if(hm)return at;
37hm=1,Object.defineProperty(at,"__esModule",{value:!0}),at.negateCt=o,at.normalizeZ=a,at.wNAF=b,at.mulEndoUnsafe=w,at.pippenger=B,at.precomputeMSMUnsafe=x,at.validateBasic=M,at._createCurveFields=O;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=bo(),r=Xu(),t=BigInt(0),i=BigInt(1);function o(E,_){const P=_.negate();return E?P:_}function a(E,_,P){const m=_==="pz"?v=>v.pz:v=>v.ez,T=(0,r.FpInvertBatch)(E.Fp,P.map(m));return P.map((v,h)=>v.toAffine(T[h])).map(E.fromAffine)}function n(E,_){if(!Number.isSafeInteger(E)||E<=0||E>_)throw new Error("invalid window size, expected [1.."+_+"], got W="+E)}function s(E,_){n(E,_);const P=Math.ceil(_/E)+1,m=2**(E-1),T=2**E,g=(0,e.bitMask)(E),v=BigInt(E);return{windows:P,windowSize:m,mask:g,maxNumber:T,shiftBy:v}}function u(E,_,P){const{windowSize:m,mask:T,maxNumber:g,shiftBy:v}=P;let h=Number(E&T),I=E>>v;h>m&&(h-=g,I+=i);const R=_*m,j=R+Math.abs(h)-1,S=h===0,C=h<0,H=_%2!==0;return{nextN:I,offset:j,isZero:S,isNeg:C,isNegF:H,offsetF:R}}function c(E,_){if(!Array.isArray(E))throw new Error("array expected");E.forEach((P,m)=>{if(!(P instanceof _))throw new Error("invalid point at index "+m)})}function l(E,_){if(!Array.isArray(E))throw new Error("array of scalars expected");E.forEach((P,m)=>{if(!_.isValid(P))throw new Error("invalid scalar at index "+m)})}const d=new WeakMap,f=new WeakMap;function p(E){return f.get(E)||1}function y(E){if(E!==t)throw new Error("invalid wNAF")}function b(E,_){return{constTimeNegate:o,hasPrecomputes(P){return p(P)!==1},unsafeLadder(P,m,T=E.ZERO){let g=P;for(;m>t;)m&i&&(T=T.add(g)),g=g.double(),m>>=i;return T},precomputeWindow(P,m){const{windows:T,windowSize:g}=s(m,_),v=[];let h=P,I=h;for(let R=0;R<T;R++){I=h,v.push(I);for(let j=1;j<g;j++)I=I.add(h),v.push(I);h=I.double()}return v},wNAF(P,m,T){let g=E.ZERO,v=E.BASE;const h=s(P,_);for(let I=0;I<h.windows;I++){const{nextN:R,offset:j,isZero:S,isNeg:C,isNegF:H,offsetF:F}=u(T,I,h);T=R,S?v=v.add(o(H,m[F])):g=g.add(o(C,m[j]))}return y(T),{p:g,f:v}},wNAFUnsafe(P,m,T,g=E.ZERO){const v=s(P,_);for(let h=0;h<v.windows&&T!==t;h++){const{nextN:I,offset:R,isZero:j,isNeg:S}=u(T,h,v);if(T=I,!j){const C=m[R];g=g.add(S?C.negate():C)}}return y(T),g}
37,getPrecomputes(P,m,T){let g=d.get(m);return g||(g=this.precomputeWindow(m,P),P!==1&&(typeof T=="function"&&(g=T(g)),d.set(m,g))),g},wNAFCached(P,m,T){const g=p(P);return this.wNAF(g,this.getPrecomputes(g,P,T),m)},wNAFCachedUnsafe(P,m,T,g){const v=p(P);return v===1?this.unsafeLadder(P,m,g):this.wNAFUnsafe(v,this.getPrecomputes(v,P,T),m,g)},setWindowSize(P,m){n(m,_),f.set(P,m),d.delete(P)}}}function w(E,_,P,m){let T=_,g=E.ZERO,v=E.ZERO;for(;P>t||m>t;)P&i&&(g=g.add(T)),m&i&&(v=v.add(T)),T=T.double(),P>>=i,m>>=i;return{p1:g,p2:v}}function B(E,_,P,m){c(P,E),l(m,_);const T=P.length,g=m.length;if(T!==g)throw new Error("arrays of points and scalars must have equal length");const v=E.ZERO,h=(0,e.bitLen)(BigInt(T));let I=1;h>12?I=h-3:h>4?I=h-2:h>0&&(I=2);const R=(0,e.bitMask)(I),j=new Array(Number(R)+1).fill(v),S=Math.floor((_.BITS-1)/I)*I;let C=v;for(let H=S;H>=0;H-=I){j.fill(v);for(let q=0;q<g;q++){const k=m[q],N=Number(k>>BigInt(H)&R);j[N]=j[N].add(P[q])}let F=v;for(let q=j.length-1,k=v;q>0;q--)k=k.add(j[q]),F=F.add(k);if(C=C.add(F),H!==0)for(let q=0;q<I;q++)C=C.double()}return C}function x(E,_,P,m){n(m,_.BITS),c(P,E);const T=E.ZERO,g=2**m-1,v=Math.ceil(_.BITS/m),h=(0,e.bitMask)(m),I=P.map(R=>{const j=[];for(let S=0,C=R;S<g;S++)j.push(C),C=C.add(R);return j});return R=>{if(l(R,_),R.length>P.length)throw new Error("array of scalars must be smaller than array of points");let j=T;for(let S=0;S<v;S++){if(j!==T)for(let H=0;H<m;H++)j=j.double();const C=BigInt(v*m-(S+1)*m);for(let H=0;H<R.length;H++){const F=R[H],q=Number(F>>C&h);q&&(j=j.add(I[H][q-1]))}}return j}}function M(E){return(0,r.validateField)(E.Fp),(0,e.validateObject)(E,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,r.nLength)(E.n,E.nBitLength),...E,p:E.Fp.ORDER})}function A(E,_){if(_){if(_.ORDER!==E)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return(0,r.validateField)(_),_}else return(0,r.Field)(E)}function O(E,_,P={}){if(!_||typeof _!="object")throw new Error(`expected valid ${E} CURVE object`);for(const h of["p","n","h"]){const I=_[h];if(!(typeof I=="bigint"&&I>t))throw new Error(`CURVE.${h} must be positive bigint`)}const m=A(_.p,P.Fp),T=A(_.n,P.Fn),v=["Gx","Gy","a",E==="weierstrass"?"b":"d"];for(const h of v)if(!m.isValid(_[h]))throw new Error(`CURVE.${h} must be valid field element of CURVE.Fp`);return{Fp:m,Fn:T}}return at}var ym;function ng(){return ym||(ym=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e._legacyHelperEquat=f,e._legacyHelperNormPriv=p,e.weierstrassN=y,e.weierstrassPoints=b,e.ecdsa=B,e.weierstrass=E,e.SWUFpSqrtRatio=_,e.mapToCurveSimpleSWU=P;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const r=O_(),t=bo(),i=C_(),o=Xu();function a(m){m.lowS!==void 0&&(0,t.abool)("lowS",m.lowS),m.prehash!==void 0&&(0,t.abool)("prehash",m.prehash)}class n extends Error{constructor(T=""){super(T)}}e.DERErr=n,e.DER={Err:n,_tlv:{encode:(m,T)=>{const{Err:g}=e.DER;if(m<0||m>256)throw new g("tlv.encode: wrong tag");if(T.length&1)throw new g("tlv.encode: unpadded data");const v=T.length/2,h=(0,t.numberToHexUnpadded)(v);if(h.length/2&128)throw new g("tlv.encode: long form length too big");const I=v>127?(0,t.numberToHexUnpadded)(h.length/2|128):"";return(0,t.numberToHexUnpadded)(m)+I+h+T},decode(m,T){const{Err:g}=e.DER;let v=0;if(m<0||m>256)throw new g("tlv.encode: wrong tag");if(T.length<2||T[v++]!==m)throw new g("tlv.decode: wrong tlv");const h=T[v++],I=!!(h&128);let R=0;if(!I)R=h;else{const S=h&127;if(!S)throw new g("tlv.decode(long): indefinite length not supported");if(S>4)throw new g("tlv.decode(long): byte length is too big");const C=T.subarray(v,v+S);if(C.length!==S)throw new g("tlv.decode: length bytes not complete");if(C[0]===0)throw new g("tlv.decode(long): zero leftmost byte");for(const H of C)R=R<<8|H;if(v+=S,R<128)throw new g("tlv.decode(long): not minimal encoding")}const j=T.subarray(v,v+R);if(j.length!==R)throw new g("tlv.decode: wrong value length");return{v:j,l:T.subarray(v+R)}}},_int:{encode(m){const{Err:T}=e.DER;if(m<s)throw new T("integer: negative integers are not allowed");let g=(0,t.numberToHexUnpadded)(m);if(Number.parseInt(g[0],16)&8&&(g="00"+g),g.length&1)throw new T("unexpected DER parsing assertion: unpadded hex");return g},decode(m){const{Err:T}=e.DER;if(m[0]&128)throw new T("invalid signature integer: negative");if(m[0]===0&&!(m[1]&128))throw new T("invalid signature integer: unnecessary leading zero");return(0,t.bytesToNumberBE)(m)}},toSig(m){const{Err:T,_int:g,_tlv:v}=e.DER,h=(0,t.ensureBytes)("signature",m),{v:I,l:R}=v.decode(48,h);if(R.length)throw new T("invalid signature: left bytes after parsing");const{v:j,l:S}=v.decode(2,I),{v:C,l:H}=v.decode(2,S);if(H.length)throw new T("invalid signature: left bytes after parsing");return{r:g.decode(j),s:g.decode(C)}},hexFromSig(m){const{_tlv:T,_int:g}=e.DER,v=T.encode(2,g.encode(m.r)),h=T.encode(2,g.encode(m.s)),I=v+h;return T.encode(48,I)}};const s=BigInt(0),u=BigInt(1),c=BigInt(2),l=BigInt(3),d=BigInt(4);function f(m,T,g){function v(h){const I=m.sqr(h),R=m.mul(I,h);return m.add(m.add(R,m.mul(h,T)),g)}return v}function p(m,T,g){const{BYTES:v}=m;function h(I){let R;if(typeof I=="bigint")R=I;else{let j=(0,t.ensureBytes)("private key",I);if(T){if(!T.includes(j.length*2))throw new Error("invalid private key");const S=new Uint8Array(v);S.set(j,S.length-j.length),j=S}try{R=m.fromBytes(j)}catch{throw new Error(`invalid private key: expected ui8a of size ${v}, got ${typeof I}`)}}if(g&&(R=m.create(R)),!m.isValidNot0(R))throw new Error("invalid private key: out of range [1..N-1]");return R}return h}function y(m,T={}){const{Fp:g,Fn:v}=(0,i._createCurveFields)("weierstrass",m,T),{h,n:I}=m;(0,t._validateObject)(T,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});
37const{endo:R}=T;if(R&&(!g.is0(m.a)||typeof R.beta!="bigint"||typeof R.splitScalar!="function"))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function j(){if(!g.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function S(se,Z,Q){const{x:Y,y:G}=Z.toAffine(),L=g.toBytes(Y);if((0,t.abool)("isCompressed",Q),Q){j();const ne=!g.isOdd(G);return(0,t.concatBytes)(w(ne),L)}else return(0,t.concatBytes)(Uint8Array.of(4),L,g.toBytes(G))}function C(se){(0,t.abytes)(se);const Z=g.BYTES,Q=Z+1,Y=2*Z+1,G=se.length,L=se[0],ne=se.subarray(1);if(G===Q&&(L===2||L===3)){const re=g.fromBytes(ne);if(!g.isValid(re))throw new Error("bad point: is not on curve, wrong x");const ee=q(re);let oe;try{oe=g.sqrt(ee)}catch(be){const ce=be instanceof Error?": "+be.message:"";throw new Error("bad point: is not on curve, sqrt error"+ce)}j();const ue=g.isOdd(oe);return(L&1)===1!==ue&&(oe=g.neg(oe)),{x:re,y:oe}}else if(G===Y&&L===4){const re=g.fromBytes(ne.subarray(Z*0,Z*1)),ee=g.fromBytes(ne.subarray(Z*1,Z*2));if(!k(re,ee))throw new Error("bad point: is not on curve");return{x:re,y:ee}}else throw new Error(`bad point: got length ${G}, expected compressed=${Q} or uncompressed=${Y}`)}const H=T.toBytes||S,F=T.fromBytes||C,q=f(g,m.a,m.b);function k(se,Z){const Q=g.sqr(Z),Y=q(se);return g.eql(Q,Y)}if(!k(m.Gx,m.Gy))throw new Error("bad curve params: generator point");const N=g.mul(g.pow(m.a,l),d),D=g.mul(g.sqr(m.b),BigInt(27));if(g.is0(g.add(N,D)))throw new Error("bad curve params: a or b");function W(se,Z,Q=!1){if(!g.isValid(Z)||Q&&g.is0(Z))throw new Error(`bad point coordinate ${se}`);return Z}function $(se){if(!(se instanceof K))throw new Error("ProjectivePoint expected")}const V=(0,t.memoized)((se,Z)=>{const{px:Q,py:Y,pz:G}=se;if(g.eql(G,g.ONE))return{x:Q,y:Y};const L=se.is0();Z==null&&(Z=L?g.ONE:g.inv(G));const ne=g.mul(Q,Z),re=g.mul(Y,Z),ee=g.mul(G,Z);if(L)return{x:g.ZERO,y:g.ZERO};if(!g.eql(ee,g.ONE))throw new Error("invZ was invalid");return{x:ne,y:re}}),J=(0,t.memoized)(se=>
37{if(se.is0()){if(T.allowInfinityPoint&&!g.is0(se.py))return;throw new Error("bad point: ZERO")}const{x:Z,y:Q}=se.toAffine();if(!g.isValid(Z)||!g.isValid(Q))throw new Error("bad point: x or y not field elements");if(!k(Z,Q))throw new Error("bad point: equation left != right");if(!se.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function X(se,Z,Q,Y,G){return Q=new K(g.mul(Q.px,se),Q.py,Q.pz),Z=(0,i.negateCt)(Y,Z),Q=(0,i.negateCt)(G,Q),Z.add(Q)}class K{constructor(Z,Q,Y){this.px=W("x",Z),this.py=W("y",Q,!0),this.pz=W("z",Y),Object.freeze(this)}static fromAffine(Z){const{x:Q,y:Y}=Z||{};if(!Z||!g.isValid(Q)||!g.isValid(Y))throw new Error("invalid affine point");if(Z instanceof K)throw new Error("projective point not allowed");return g.is0(Q)&&g.is0(Y)?K.ZERO:new K(Q,Y,g.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(Z){return(0,i.normalizeZ)(K,"pz",Z)}static fromBytes(Z){return(0,t.abytes)(Z),K.fromHex(Z)}static fromHex(Z){const Q=K.fromAffine(F((0,t.ensureBytes)("pointHex",Z)));return Q.assertValidity(),Q}static fromPrivateKey(Z){const Q=p(v,T.allowedPrivateKeyLengths,T.wrapPrivateKey);return K.BASE.multiply(Q(Z))}static msm(Z,Q){return(0,i.pippenger)(K,v,Z,Q)}precompute(Z=8,Q=!0){return me.setWindowSize(this,Z),Q||this.multiply(l),this}_setWindowSize(Z){this.precompute(Z)}assertValidity(){J(this)}hasEvenY(){const{y:Z}=this.toAffine();if(!g.isOdd)throw new Error("Field doesn't support isOdd");return!g.isOdd(Z)}equals(Z){$(Z);const{px:Q,py:Y,pz:G}=this,{px:L,py:ne,pz:re}=Z,ee=g.eql(g.mul(Q,re),g.mul(L,G)),oe=g.eql(g.mul(Y,re),g.mul(ne,G));return ee&&oe}negate(){return new K(this.px,g.neg(this.py),this.pz)}double(){const{a:Z,b:Q}=m,Y=g.mul(Q,l),{px:G,py:L,pz:ne}=this;let re=g.ZERO,ee=g.ZERO,oe=g.ZERO,ue=g.mul(G,G),Pe=g.mul(L,L),be=g.mul(ne,ne),ce=g.mul(G,L);return ce=g.add(ce,ce),oe=g.mul(G,ne),oe=g.add(oe,oe),re=g.mul(Z,oe),ee=g.mul(Y,be),ee=g.add(re,ee),re=g.sub(Pe,ee),ee=g.add(Pe,ee),ee=g.mul(re,ee),re=g.mul(ce,re),oe=g.mul(Y,oe),be=g.mul(Z,be),ce=g.sub(ue,be),ce=g.mul(Z,ce),ce=g.add(ce,oe),oe=g.add(ue,ue),ue=g.add(oe,ue),ue=g.add(ue,be),ue=g.mul(ue,ce),ee=g.add(ee,ue),be=g.mul(L,ne),be=g.add(be,be),ue=g.mul(be,ce),re=g.sub(re,ue),oe=g.mul(be,Pe),oe=g.add(oe,oe),oe=g.add(oe,oe),new K(re,ee,oe)}add(Z){$(Z);const{px:Q,py:Y,pz:G}=this,{px:L,py:ne,pz:re}=Z;let ee=g.ZERO,oe=g.ZERO,ue=g.ZERO;const Pe=m.a,be=g.mul(m.b,l);let ce=g.mul(Q,L),je=g.mul(Y,ne),ye=g.mul(G,re),qe=g.add(Q,Y),pe=g.add(L,ne);qe=g.mul(qe,pe),pe=g.add(ce,je),qe=g.sub(qe,pe),pe=g.add(Q,G);let Me=g.add(L,re);return pe=g.mul(pe,Me),Me=g.add(ce,ye),pe=g.sub(pe,Me),Me=g.add(Y,G),ee=g.add(ne,re),Me=g.mul(Me,ee),ee=g.add(je,ye),Me=g.sub(Me,ee),ue=g.mul(Pe,pe),ee=g.mul(be,ye),ue=g.add(ee,ue),ee=g.sub(je,ue),ue=g.add(je,ue),oe=g.mul(ee,ue),je=g.add(ce,ce),je=g.add(je,ce),ye=g.mul(Pe,ye),pe=g.mul(be,pe),je=g.add(je,ye),ye=g.sub(ce,ye),ye=g.mul(Pe,ye),pe=g.add(pe,ye),ce=g.mul(je,pe),oe=g.add(oe,ce),ce=g.mul(Me,pe),ee=g.mul(qe,ee),ee=g.sub(ee,ce),ce=g.mul(qe,je),ue=g.mul(Me,ue),ue=g.add(ue,ce),new K(ee,oe,ue)}subtract(Z){return this.add(Z.negate())}is0(){return this.equals(K.ZERO)}multiply(Z){const{endo:Q}=T;if(!v.isValidNot0(Z))throw new Error("invalid scalar: out of range");let Y,G;const L=ne=>me.wNAFCached(this,ne,K.normalizeZ);if(Q){const{k1neg:ne,k1:re,k2neg:ee,k2:oe}=Q.splitScalar(Z),{p:ue,f:Pe}=L(re),{p:be,f:ce}=L(oe);G=Pe.add(ce),Y=X(Q.beta,ue,be,ne,ee)}else{const{p:ne,f:re}=L(Z);Y=ne,G=re}return K.normalizeZ([Y,G])[0]}multiplyUnsafe(Z){const{endo:Q}=T,Y=this;if(!v.isValid(Z))throw new Error("invalid scalar: out of range");if(Z===s||Y.is0())return K.ZERO;if(Z===u)return Y;if(me.hasPrecomputes(this))return this.multiply(Z);if(Q){const{k1neg:G,k1:L,k2neg:ne,k2:re}=Q.splitScalar(Z),{p1:ee,p2:oe}=(0,i.mulEndoUnsafe)(K,Y,L,re);return X(Q.beta,ee,oe,G,ne)}else return me.wNAFCachedUnsafe(Y,Z)}multiplyAndAddUnsafe(Z,Q,Y){const G=this.multiplyUnsafe(Q).add(Z.multiplyUnsafe(Y));return G.is0()?void 0:G}toAffine(Z){return V(this,Z)}isTorsionFree(){const{isTorsionFree:Z}=T;return h===u?!0:Z?Z(K,this):me.wNAFCachedUnsafe(this,I).is0()}clearCofactor(){const{clearCofactor:Z}=T;return h===u?this:Z?Z(K,this):this.multiplyUnsafe(h)}toBytes(Z=!0){return(0,t.abool)("isCompressed",Z),this.assertValidity(),H(K,this,Z)}toRawBytes(Z=!0){return this.toBytes(Z)}toHex(Z=!0){return(0,t.bytesToHex)(this.toBytes(Z))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}K.BASE=new K(m.Gx,m.Gy,g.ONE),K.ZERO=new K(g.ZERO,g.ONE,g.ZERO),K.Fp=g,K.Fn=v;const de=v.BITS,me=(0,i.wNAF)(K,T.endo?Math.ceil(de/2):de);return K}function b(m){const{CURVE:T,curveOpts:g}=x(m),v=y(T,g);return A(m,v)}function w(m){return Uint8Array.of(m?2:3)}function B(m,T,g={}){(0,t._validateObject)(T,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const v=T.randomBytes||t.randomBytes,h=T.hmac||((Y,...G)=>(0,r.hmac)(T.hash,Y,(0,t.concatBytes)(...G))),{Fp:I,Fn:R}=m,{ORDER:j,BITS:S}=R;function C(Y){const G=j>>u;return Y>G}function H(Y){return C(Y)?R.neg(Y):Y}function F(Y,G){if(!R.isValidNot0(G))throw new Error(`invalid signature ${Y}: out of range 1..CURVE.n`)}class q{constructor(G,L,ne){F("r",G),F("s",L),this.r=G,this.s=L,ne!=null&&(this.recovery=ne),Object.freeze(this)}static fromCompact(G){const L=R.BYTES,ne=(0,t.ensureBytes)("compactSignature",G,L*2);return new q(R.fromBytes(ne.subarray(0,L)),R.fromBytes(ne.subarray(L,L*2)))}static fromDER(G){const{r:L,s:ne}=e.DER.toSig((0,t.ensureBytes)("DER",G));return new q(L,ne)}assertValidity(){}addRecoveryBit(G){return new q(this.r,this.s,G)}recoverPublicKey(G){const L=I.ORDER,{r:ne,s:re,recovery:ee}=this;if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");if(j*c<L&&ee>1)throw new Error("recovery id is ambiguous for h>1 curve");const ue=ee===2||ee===3?ne+j:ne;if(!I.isValid(ue))throw new Error("recovery id 2 or 3 invalid");const Pe=I.toBytes(ue),be=m.fromHex((0,t.concatBytes)(w((ee&1)===0),Pe)),ce=R.inv(ue),je=J((0,t.ensureBytes)("msgHash",G)),ye=R.create(-je*ce),qe=R.create(re*ce),pe=m.BASE.multiplyUnsafe(ye).add(be.multiplyUnsafe(qe));if(pe.is0())throw new Error("point at infinify");return pe.assertValidity(),pe}hasHighS(){return C(this.s)}normalizeS(){return this.hasHighS()?new q(this.r,R.neg(this.s),this.recovery):this}toBytes(G){if(G==="compact")return(0,t.concatBytes)(R.toBytes(this.r),R.toBytes(this.s));if(G==="der")return(0,t.hexToBytes)(e.DER.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return(0,t.bytesToHex)(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return(0,t.bytesToHex)(this.toBytes("compact"))}}const k=p(R,g.allowedPrivateKeyLengths,g.wrapPrivateKey),N={isValidPrivateKey(Y){try{return k(Y),!0}catch{return!1}},normPrivateKeyToScalar:k,randomPrivateKey:()=>{const Y=j;return(0,o.mapHashToField)(v((0,o.getMinHashLength)(Y)),Y)},precompute(Y=8,G=m.BASE){return G.precompute(Y,!1)}};function D(Y,G=!0){return m.fromPrivateKey(Y).toBytes(G)}function W(Y){if(typeof Y=="bigint")return!1;if(Y instanceof m)return!0;const L=(0,t.ensureBytes)("key",Y).length,ne=I.BYTES,re=ne+1,ee=2*ne+1;
37if(!(g.allowedPrivateKeyLengths||R.BYTES===re))return L===re||L===ee}function $(Y,G,L=!0){if(W(Y)===!0)throw new Error("first arg must be private key");if(W(G)===!1)throw new Error("second arg must be public key");return m.fromHex(G).multiply(k(Y)).toBytes(L)}const V=T.bits2int||function(Y){if(Y.length>8192)throw new Error("input is too large");const G=(0,t.bytesToNumberBE)(Y),L=Y.length*8-S;return L>0?G>>BigInt(L):G},J=T.bits2int_modN||function(Y){return R.create(V(Y))},X=(0,t.bitMask)(S);function K(Y){return(0,t.aInRange)("num < 2^"+S,Y,s,X),R.toBytes(Y)}function de(Y,G,L=me){if(["recovered","canonical"].some(qe=>qe in L))throw new Error("sign() legacy options not supported");const{hash:ne}=T;let{lowS:re,prehash:ee,extraEntropy:oe}=L;re==null&&(re=!0),Y=(0,t.ensureBytes)("msgHash",Y),a(L),ee&&(Y=(0,t.ensureBytes)("prehashed msgHash",ne(Y)));const ue=J(Y),Pe=k(G),be=[K(Pe),K(ue)];if(oe!=null&&oe!==!1){const qe=oe===!0?v(I.BYTES):oe;be.push((0,t.ensureBytes)("extraEntropy",qe))}const ce=(0,t.concatBytes)(...be),je=ue;function ye(qe){const pe=V(qe);if(!R.isValidNot0(pe))return;const Me=R.inv(pe),pt=m.BASE.multiply(pe).toAffine(),Ze=R.create(pt.x);if(Ze===s)return;const nt=R.create(Me*R.create(je+Ze*Pe));if(nt===s)return;let Wt=(pt.x===Ze?0:2)|Number(pt.y&u),it=nt;return re&&C(nt)&&(it=H(nt),Wt^=1),new q(Ze,it,Wt)}return{seed:ce,k2sig:ye}}const me={lowS:T.lowS,prehash:!1},se={lowS:T.lowS,prehash:!1};function Z(Y,G,L=me){const{seed:ne,k2sig:re}=de(Y,G,L);return(0,t.createHmacDrbg)(T.hash.outputLen,R.BYTES,h)(ne,re)}m.BASE.precompute(8);function Q(Y,G,L,ne=se){const re=Y;G=(0,t.ensureBytes)("msgHash",G),L=(0,t.ensureBytes)("publicKey",L),a(ne);const{lowS:ee,prehash:oe,format:ue}=ne;if("strict"in ne)throw new Error("options.strict was renamed to lowS");if(ue!==void 0&&!["compact","der","js"].includes(ue))throw new Error('format must be "compact", "der" or "js"');const Pe=typeof re=="string"||(0,t.isBytes)(re),be=!Pe&&!ue&&typeof re=="object"&&re!==null&&typeof re.r=="bigint"&&typeof re.s=="bigint";if(!Pe&&!be)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ce,je;try{if(be)if(ue===void 0||ue==="js")ce=new q(re.r,re.s);else throw new Error("invalid format");if(Pe){try{ue!=="compact"&&(ce=q.fromDER(re))}catch(it){if(!(it instanceof e.DER.Err))throw it}!ce&&ue!=="der"&&(ce=q.fromCompact(re))}je=m.fromHex(L)}catch{return!1}if(!ce||ee&&ce.hasHighS())return!1;oe&&(G=T.hash(G));const{r:ye,s:qe}=ce,pe=J(G),Me=R.inv(qe),pt=R.create(pe*Me),Ze=R.create(ye*Me),nt=m.BASE.multiplyUnsafe(pt).add(je.multiplyUnsafe(Ze));return nt.is0()?!1:R.create(nt.x)===ye}return Object.freeze({getPublicKey:D,getSharedSecret:$,sign:Z,verify:Q,utils:N,Point:m,Signature:q})}function x(m){const T={a:m.a,b:m.b,p:m.Fp.ORDER,n:m.n,h:m.h,Gx:m.Gx,Gy:m.Gy},g=m.Fp,v=(0,o.Field)(T.n,m.nBitLength),h={Fp:g,Fn:v,allowedPrivateKeyLengths:m.allowedPrivateKeyLengths,allowInfinityPoint:m.allowInfinityPoint,endo:m.endo,wrapPrivateKey:m.wrapPrivateKey,isTorsionFree:m.isTorsionFree,clearCofactor:m.clearCofactor,fromBytes:m.fromBytes,toBytes:m.toBytes};return{CURVE:T,curveOpts:h}}function M(m){const{CURVE:T,curveOpts:g}=x(m),v={hash:m.hash,hmac:m.hmac,randomBytes:m.randomBytes,lowS:m.lowS,bits2int:m.bits2int,bits2int_modN:m.bits2int_modN};return{CURVE:T,curveOpts:g,ecdsaOpts:v}}function A(m,T){const{Fp:g,Fn:v}=T;function h(j){return(0,t.inRange)(j,u,v.ORDER)}const I=f(g,m.a,m.b),R=p(v,m.allowedPrivateKeyLengths,m.wrapPrivateKey);return Object.assign({},{CURVE:m,Point:T,ProjectivePoint:T,normPrivateKeyToScalar:R,weierstrassEquation:I,isWithinCurveOrder:h})}function O(m,T){return Object.assign({},T,{ProjectivePoint:T.Point,CURVE:m})}function E(m){const{CURVE:T,curveOpts:g,ecdsaOpts:v}=M(m),h=y(T,g),I=B(h,v,g);return O(m,I)}function _(m,T){const g=m.ORDER;let v=s;for(let N=g-u;N%c===s;N/=c)v+=u;const h=v,I=c<<h-u-u,R=I*c,j=(g-u)/R,S=(j-u)/c,C=R-u,H=I,F=m.pow(T,j),q=m.pow(T,(j+u)/c);let k=(N,D)=>{let W=F,$=m.pow(D,C),V=m.sqr($);V=m.mul(V,D);let J=m.mul(N,V);J=m.pow(J,S),J=m.mul(J,$),$=m.mul(J,D),V=m.mul(J,N);let X=m.mul(V,$);J=m.pow(X,H);let K=m.eql(J,m.ONE);$=m.mul(V,q),J=m.mul(X,W),V=m.cmov($,V,K),X=m.cmov(J,X,K);for(let de=h;de>u;de--){let me=de-c;me=c<<me-u;let se=m.pow(X,me);const Z=m.eql(se,m.ONE);$=m.mul(V,W),W=m.mul(W,W),se=m.mul(X,W),V=m.cmov($,V,Z),X=m.cmov(se,X,Z)}return{isValid:K,value:V}};if(m.ORDER%d===l){const N=(m.ORDER-l)/d,D=m.sqrt(m.neg(T));k=(W,$)=>{let V=m.sqr($);const J=m.mul(W,$);V=m.mul(V,J);let X=m.pow(V,N);X=m.mul(X,J);const K=m.mul(X,D),de=m.mul(m.sqr(X),$),me=m.eql(de,W);
37let se=m.cmov(K,X,me);return{isValid:me,value:se}}}return k}function P(m,T){(0,o.validateField)(m);const{A:g,B:v,Z:h}=T;if(!m.isValid(g)||!m.isValid(v)||!m.isValid(h))throw new Error("mapToCurveSimpleSWU: invalid opts");const I=_(m,h);if(!m.isOdd)throw new Error("Field does not have .isOdd()");return R=>{let j,S,C,H,F,q,k,N;j=m.sqr(R),j=m.mul(j,h),S=m.sqr(j),S=m.add(S,j),C=m.add(S,m.ONE),C=m.mul(C,v),H=m.cmov(h,m.neg(S),!m.eql(S,m.ZERO)),H=m.mul(H,g),S=m.sqr(C),q=m.sqr(H),F=m.mul(q,g),S=m.add(S,F),S=m.mul(S,C),q=m.mul(q,H),F=m.mul(q,v),S=m.add(S,F),k=m.mul(j,C);const{isValid:D,value:W}=I(S,q);N=m.mul(j,R),N=m.mul(N,W),k=m.cmov(k,C,D),N=m.cmov(N,W,D);const $=m.isOdd(R)===m.isOdd(N);N=m.cmov(m.neg(N),N,$);const V=(0,o.FpInvertBatch)(m,[H],!0)[0];return k=m.mul(k,V),{x:k,y:N}}}}(Xc)),Xc}var pm;function x_(){if(pm)return Hn;pm=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.getHash=r,Hn.createCurve=t;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e=ng();function r(i){return{hash:i}}function t(i,o){const a=n=>(0,e.weierstrass)({...i,hash:n});return{...a(o),create:a}}return Hn}var Yt={},gm;function q_(){if(gm)return Yt;gm=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.expand_message_xmd=n,Yt.expand_message_xof=s,Yt.hash_to_field=u,Yt.isogenyMap=c,Yt.createHasher=l;const e=bo(),r=Xu(),t=e.bytesToNumberBE;function i(d,f){if(a(d),a(f),d<0||d>=1<<8*f)throw new Error("invalid I2OSP input: "+d);const p=Array.from({length:f}).fill(0);for(let y=f-1;y>=0;y--)p[y]=d&255,d>>>=8;return new Uint8Array(p)}function o(d,f){const p=new Uint8Array(d.length);for(let y=0;y<d.length;y++)p[y]=d[y]^f[y];return p}function a(d){if(!Number.isSafeInteger(d))throw new Error("number expected")}function n(d,f,p,y){(0,e.abytes)(d),(0,e.abytes)(f),a(p),f.length>255&&(f=y((0,e.concatBytes)((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-"),f)));const{outputLen:b,blockLen:w}=y,B=Math.ceil(p/b);if(p>65535||B>255)throw new Error("expand_message_xmd: invalid lenInBytes");const x=(0,e.concatBytes)(f,i(f.length,1)),M=i(0,w),A=i(p,2),O=new Array(B),E=y((0,e.concatBytes)(M,d,A,i(0,1),x));O[0]=y((0,e.concatBytes)(E,i(1,1),x));for(let P=1;P<=B;P++){const m=[o(E,O[P-1]),i(P+1,1),x];O[P]=y((0,e.concatBytes)(...m))}return(0,e.concatBytes)(...O).slice(0,p)}function s(d,f,p,y,b){if((0,e.abytes)(d),(0,e.abytes)(f),a(p),f.length>255){const w=Math.ceil(2*y/8);f=b.create({dkLen:w}).update((0,e.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(f).digest()}if(p>65535||f.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return b.create({dkLen:p}).update(d).update(i(p,2)).update(f).update(i(f.length,1)).digest()}function u(d,f,p){(0,e._validateObject)(p,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:y,k:b,m:w,hash:B,expand:x,DST:M}=p;if(!(0,e.isBytes)(M)&&typeof M!="string")throw new Error("DST must be string or uint8array");if(!(0,e.isHash)(p.hash))throw new Error("expected valid hash");(0,e.abytes)(d),a(f);const A=typeof M=="string"?(0,e.utf8ToBytes)(M):M,O=y.toString(2).length,E=Math.ceil((O+b)/8),_=f*w*E;let P;if(x==="xmd")P=n(d,A,_,B);else if(x==="xof")P=s(d,A,_,b,B);else if(x==="_internal_pass")P=d;else throw new Error('expand must be "xmd" or "xof"');const m=new Array(f);for(let T=0;T<f;T++){const g=new Array(w);for(let v=0;v<w;v++){const h=E*(v+T*w),I=P.subarray(h,h+E);g[v]=(0,r.mod)(t(I),y)}m[T]=g}return m}function c(d,f){const p=f.map(y=>Array.from(y).reverse());return(y,b)=>{const[w,B,x,M]=p.map(E=>E.reduce((_,P)=>d.add(d.mul(_,y),P))),[A,O]=(0,r.FpInvertBatch)(d,[B,M],!0);return y=d.mul(w,A),b=d.mul(b,d.mul(x,O)),{x:y,y:b}}}function l(d,f,p){if(typeof f!="function")throw new Error("mapToCurve() must be defined");function y(w){return d.fromAffine(f(w))}function b(w){const B=w.clearCofactor();return B.equals(d.ZERO)?d.ZERO:(B.assertValidity(),B)}return{defaults:p,hashToCurve(w,B){const x=p.DST?p.DST:{},M=Object.assign({},p,x,B),A=u(w,2,M),O=y(A[0]),E=y(A[1]);return b(O.add(E))},encodeToCurve(w,B){const x=p.encodeDST?p.encodeDST:{},M=Object.assign({},p,x,B),A=u(w,1,M);return b(y(A[0]))},mapToCurve(w){if(!Array.isArray(w))throw new Error("expected array of bigints");for(const B of w)if(typeof B!="bigint")throw new Error("expected array of bigints");return b(y(w))}}}return Yt}var _m;function ho(){return _m||(_m=1,function(e){Object.defineProperty(e,"__esMo
37dule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const r=rg(),t=Ht(),i=x_(),o=q_(),a=Xu(),n=ng(),s=bo(),u={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},c=BigInt(0),l=BigInt(1),d=BigInt(2),f=(j,S)=>(j+S/d)/S;function p(j){const S=u.p,C=BigInt(3),H=BigInt(6),F=BigInt(11),q=BigInt(22),k=BigInt(23),N=BigInt(44),D=BigInt(88),W=j*j*j%S,$=W*W*j%S,V=(0,a.pow2)($,C,S)*$%S,J=(0,a.pow2)(V,C,S)*$%S,X=(0,a.pow2)(J,d,S)*W%S,K=(0,a.pow2)(X,F,S)*X%S,de=(0,a.pow2)(K,q,S)*K%S,me=(0,a.pow2)(de,N,S)*de%S,se=(0,a.pow2)(me,D,S)*me%S,Z=(0,a.pow2)(se,N,S)*de%S,Q=(0,a.pow2)(Z,C,S)*$%S,Y=(0,a.pow2)(Q,k,S)*K%S,G=(0,a.pow2)(Y,H,S)*W%S,L=(0,a.pow2)(G,d,S);if(!y.eql(y.sqr(L),j))throw new Error("Cannot find square root");return L}const y=(0,a.Field)(u.p,void 0,void 0,{sqrt:p});e.secp256k1=(0,i.createCurve)({...u,Fp:y,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:j=>{const S=u.n,C=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),H=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),F=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),q=C,k=BigInt("0x100000000000000000000000000000000"),N=f(q*j,S),D=f(-H*j,S);let W=(0,a.mod)(j-N*C-D*F,S),$=(0,a.mod)(-N*H-D*q,S);const V=W>k,J=$>k;if(V&&(W=S-W),J&&($=S-$),W>k||$>k)throw new Error("splitScalar: Endomorphism failed, k="+j);return{k1neg:V,k1:W,k2neg:J,k2:$}}}},r.sha256);const b={};function w(j,...S){let C=b[j];if(C===void 0){const H=(0,r.sha256)(Uint8Array.from(j,F=>F.charCodeAt(0)));C=(0,s.concatBytes)(H,H),b[j]=C}return(0,r.sha256)((0,s.concatBytes)(C,...S))}const B=j=>j.toBytes(!0).slice(1),x=j=>(0,s.numberToBytesBE)(j,32),M=j=>(0,a.mod)(j,u.p),A=j=>(0,a.mod)(j,u.n),O=e.secp256k1.Point,E=j=>j%d===c;function _(j){let S=e.secp256k1.utils.normPrivateKeyToScalar(j),C=O.fromPrivateKey(S);return{scalar:E(C.y)?S:A(-S),bytes:B(C)}}function P(j){(0,s.aInRange)("x",j,l,u.p);const S=M(j*j),C=M(S*j+BigInt(7));let H=p(C);E(H)||(H=M(-H));const F=O.fromAffine({x:j,y:H});return F.assertValidity(),F}const m=s.bytesToNumberBE;function T(...j){return A(m(w("BIP0340/challenge",...j)))}function g(j){return _(j).bytes}function v(j,S,C=(0,t.randomBytes)(32)){const H=(0,s.ensureBytes)("message",j),{bytes:F,scalar:q}=_(S),k=(0,s.ensureBytes)("auxRand",C,32),N=x(q^m(w("BIP0340/aux",k))),D=w("BIP0340/nonce",N,F,H),W=A(m(D));if(W===c)throw new Error("sign failed: k is zero");const{bytes:$,scalar:V}=_(W),J=T($,F,H),X=new Uint8Array(64);if(X.set($,0),X.set(x(A(V+J*q)),32),!h(X,H,F))throw new Error("sign: Invalid signature produced");return X}function h(j,S,C){const H=(0,s.ensureBytes)("signature",j,64),F=(0,s.ensureBytes)("message",S),q=(0,s.ensureBytes)("publicKey",C,32);try{const k=P(m(q)),N=m(H.subarray(0,32));if(!(0,s.inRange)(N,l,u.p))return!1;const D=m(H.subarray(32,64));if(!(0,s.inRange)(D,l,u.n))return!1;const W=T(x(N),B(k),F),$=O.BASE.multiplyUnsafe(D).add(k.multiplyUnsafe(A(-W))),{x:V,y:J}=$.toAffine();return!($.is0()||!E(J)||V!==N)}catch{return!1}}e.schnorr={getPublicKey:g,sign:v,verify:h,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:P,pointToBytes:B,numberToBytesBE:s.numberToBytesBE,bytesToNumberBE:s.bytesToNumberBE,taggedHash:w,mod:a.mod}};const I=(0,o.isogenyMap)(y,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(j=>j.map(S=>BigInt(S)))),R=(0,n.mapToCurveSimpleSWU)(y,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:y.create(BigInt("-11"))});e.secp256k1_hasher=(0,o.createHasher)(e.secp256k1.Point,j=>{const{x:S,y:C}=R(y.create(j[0]));return I(S,C)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:y.ORDER,m:1,k:128,expand:"xmd",hash:r.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve}(Yc)),Yc}var vm;function Sd(){if(vm)return pi;vm=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.recoverPublicKey=o;const e=De(),r=Ve(),t=Ce(),i=te();async function o({hash:n,signature:s}){const u=(0,e.isHex)(n)?n:(0,i.toHex)(n),{secp256k1:c}=await Promise.resolve().then(()=>ho());return`0x${(()=>{if(typeof s=="object"&&"r"in s&&"s"in s){const{r:b,s:w,v:B,yParity:x}=s,M=Number(x??B),A=a(M);return new c.Signature((0,t.hexToBigInt)(b),(0,t.hexToBigInt)(w)).addRecoveryBit(A)}const f=(0,e.isHex)(s)?s:(0,i.toHex)(s);if((0,r.size)(f)!==65)throw new Error("invalid signature length");const p=(0,t.hexToNumber)(`0x${f.slice(130)}`),y=a(p);
37return c.Signature.fromCompact(f.substring(2,130)).addRecoveryBit(y)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function a(n){if(n===0||n===1)return n;if(n===27)return 0;if(n===28)return 1;throw new Error("Invalid yParityOrV value")}return pi}var Em;function sr(){if(Em)return hi;Em=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.recoverAddress=t;const e=eg(),r=Sd();async function t({hash:i,signature:o}){return(0,e.publicKeyToAddress)(await(0,r.recoverPublicKey)({hash:i,signature:o}))}return hi}var gi={},Lr={},jm;function yo(){if(jm)return Lr;jm=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.toRlp=o,Lr.bytesToRlp=a,Lr.hexToRlp=n;const e=le(),r=lo(),t=we(),i=te();function o(d,f="hex"){const p=s(d),y=(0,r.createCursor)(new Uint8Array(p.length));return p.encode(y),f==="hex"?(0,i.bytesToHex)(y.bytes):y.bytes}function a(d,f="bytes"){return o(d,f)}function n(d,f="hex"){return o(d,f)}function s(d){return Array.isArray(d)?u(d.map(f=>s(f))):c(d)}function u(d){const f=d.reduce((b,w)=>b+w.length,0),p=l(f);return{length:f<=55?1+f:1+p+f,encode(b){f<=55?b.pushByte(192+f):(b.pushByte(247+p),p===1?b.pushUint8(f):p===2?b.pushUint16(f):p===3?b.pushUint24(f):b.pushUint32(f));for(const{encode:w}of d)w(b)}}}function c(d){const f=typeof d=="string"?(0,t.hexToBytes)(d):d,p=l(f.length);return{length:f.length===1&&f[0]<128?1:f.length<=55?1+f.length:1+p+f.length,encode(b){f.length===1&&f[0]<128?b.pushBytes(f):f.length<=55?(b.pushByte(128+f.length),b.pushBytes(f)):(b.pushByte(183+p),p===1?b.pushUint8(f.length):p===2?b.pushUint16(f.length):p===3?b.pushUint24(f.length):b.pushUint32(f.length),b.pushBytes(f))}}}function l(d){if(d<2**8)return 1;if(d<2**16)return 2;if(d<2**24)return 3;if(d<2**32)return 4;throw new e.BaseError("Length is too large.")}return Lr}var wm;function og(){if(wm)return gi;wm=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.hashAuthorization=a;const e=ke(),r=we(),t=te(),i=yo(),o=We();function a(n){const{chainId:s,nonce:u,to:c}=n,l=n.contractAddress??n.address,d=(0,o.keccak256)((0,e.concatHex)(["0x05",(0,i.toRlp)([s?(0,t.numberToHex)(s):"0x",l,u?(0,t.numberToHex)(u):"0x"])]));return c==="bytes"?(0,r.hexToBytes)(d):d}return gi}var Pm;function Qu(){if(Pm)return bi;Pm=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.recoverAuthorizationAddress=t;const e=sr(),r=og();async function t(i){const{authorization:o,signature:a}=i;return(0,e.recoverAddress)({hash:(0,r.hashAuthorization)(o),signature:a??o})}return bi}var _i={},kn={},Am;function ig(){if(Am)return kn;Am=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.EstimateGasExecutionError=void 0;const e=mo(),r=Or(),t=le(),i=rt();class o extends t.BaseError{constructor(n,{account:s,docsPath:u,chain:c,data:l,gas:d,gasPrice:f,maxFeePerGas:p,maxPriorityFeePerGas:y,nonce:b,to:w,value:B}){const x=(0,i.prettyPrint)({from:s?.address,to:w,value:typeof B<"u"&&`${(0,e.formatEther)(B)} ${c?.nativeCurrency?.symbol||"ETH"}`,data:l,gas:d,gasPrice:typeof f<"u"&&`${(0,r.formatGwei)(f)} gwei`,maxFeePerGas:typeof p<"u"&&`${(0,r.formatGwei)(p)} gwei`,maxPriorityFeePerGas:typeof y<"u"&&`${(0,r.formatGwei)(y)} gwei`,nonce:b});super(n.shortMessage,{cause:n,docsPath:u,metaMessages:[...n.metaMessages?[...n.metaMessages," "]:[],"Estimate Gas Arguments:",x].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=n}}return kn.EstimateGasExecutionError=o,kn}var Ee={},Tm;function Nt(){if(Tm)return Ee;Tm=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.UnknownNodeError=Ee.TipAboveFeeCapError=Ee.TransactionTypeNotSupportedError=Ee.IntrinsicGasTooLowError=Ee.IntrinsicGasTooHighError=Ee.InsufficientFundsError=Ee.NonceMaxValueError=Ee.NonceTooLowError=Ee.NonceTooHighError=Ee.FeeCapTooLowError=Ee.FeeCapTooHighError=Ee.ExecutionRevertedError=void 0;const e=Or(),r=le();class t extends r.BaseError{constructor({cause:b,message:w}={}){const B=w?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${B?`with reason: ${B}`:"for an unknown reason"}.`,{cause:b,name:"ExecutionRevertedError"})}}Ee.ExecutionRevertedError=t,Object.defineProperty(t,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(t,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class i extends r.BaseError{constructor({cause:b,maxFeePerGas:w}={}){super(`The fee cap (\`maxFeePerGas\`${w?` = ${(0,e.formatGwei)(w)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:b,name:"FeeCapTooHighError"})}}Ee.FeeCapTooHighError=i,Object.defineProperty(i,"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 o extends r.BaseError{constructor({cause:b,maxFeePerGas:w}={}){super(`The fee cap (\`maxFeePerGas\`${w?` = ${(0,e.formatGwei)(w)}`:""} gwei) cannot be lower than the block base fee.`,{cause:b,name:"FeeCapTooLowError"})}}Ee.FeeCapTooLowError=o,Object.defineProperty(o,"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 r.BaseError{constructor({cause:b,nonce:w}={}){super(`Nonce provided for the transaction ${w?`(${w}) `:""}is higher than the next one expected.`,{cause:b,name:"NonceTooHighError"})}}Ee.NonceTooHighError=a,Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});
37class n extends r.BaseError{constructor({cause:b,nonce:w}={}){super([`Nonce provided for the transaction ${w?`(${w}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` 38`),{cause:b,name:"NonceTooLowError"})}}Ee.NonceTooLowError=n,Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class s extends r.BaseError{constructor({cause:b,nonce:w}={}){super(`Nonce provided for the transaction ${w?`(${w}) `:""}exceeds the maximum allowed nonce.`,{cause:b,name:"NonceMaxValueError"})}}Ee.NonceMaxValueError=s,Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class u extends r.BaseError{constructor({cause:b}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 39`),{cause:b,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"})}}Ee.InsufficientFundsError=u,Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class c extends r.BaseError{constructor({cause:b,gas:w}={}){super(`The amount of gas ${w?`(${w}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:b,name:"IntrinsicGasTooHighError"})}}Ee.IntrinsicGasTooHighError=c,Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class l extends r.BaseError{constructor({cause:b,gas:w}={}){super(`The amount of gas ${w?`(${w}) `:""}provided for the transaction is too low.`,{cause:b,name:"IntrinsicGasTooLowError"})}}Ee.IntrinsicGasTooLowError=l,Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class d extends r.BaseError{constructor({cause:b}){super("The transaction type is not supported for this chain.",{cause:b,name:"TransactionTypeNotSupportedError"})}}Ee.TransactionTypeNotSupportedError=d,Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class f extends r.BaseError{constructor({cause:b,maxPriorityFeePerGas:w,maxFeePerGas:B}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${w?` = ${(0,e.formatGwei)(w)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${B?` = ${(0,e.formatGwei)(B)} gwei`:""}).`].join(` 40`),{cause:b,name:"TipAboveFeeCapError"})}}Ee.TipAboveFeeCapError=f,Object.defineProperty(f,"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 p extends r.BaseError{constructor({cause:b}){super(`An error occurred while executing: ${b?.shortMessage}`,{cause:b,name:"UnknownNodeError"})}}return Ee.UnknownNodeError=p,Ee}var Fn={},Im;function po(){if(Im)return Fn;Im=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.containsNodeError=o,Fn.getNodeError=a;const e=le(),r=Nt(),t=bt(),i=ir();function o(n){return n instanceof i.TransactionRejectedRpcError||n instanceof i.InvalidInputRpcError||n instanceof t.RpcRequestError&&n.code===r.ExecutionRevertedError.code}function a(n,s){const u=(n.details||"").toLowerCase(),c=n instanceof e.BaseError?n.walk(l=>l?.code===r.ExecutionRevertedError.code):n;return c instanceof e.BaseError?new r.ExecutionRevertedError({cause:n,message:c.details}):r.ExecutionRevertedError.nodeMessage.test(u)?new r.ExecutionRevertedError({cause:n,message:n.details}):r.FeeCapTooHighError.nodeMessage.test(u)?new r.FeeCapTooHighError({cause:n,maxFeePerGas:s?.maxFeePerGas}):r.FeeCapTooLowError.nodeMessage.test(u)?new r.FeeCapTooLowError({cause:n,maxFeePerGas:s?.maxFeePerGas}):r.NonceTooHighError.nodeMessage.test(u)?new r.NonceTooHighError({cause:n,nonce:s?.nonce}):r.NonceTooLowError.nodeMessage.test(u)?new r.NonceTooLowError({cause:n,nonce:s?.nonce}):r.NonceMaxValueError.nodeMessage.test(u)?new r.NonceMaxValueError({cause:n,nonce:s?.nonce}):r.InsufficientFundsError.nodeMessage.test(u)?new r.InsufficientFundsError({cause:n}):r.IntrinsicGasTooHighError.nodeMessage.test(u)?new r.IntrinsicGasTooHighError({cause:n,gas:s?.gas}):r.IntrinsicGasTooLowError.nodeMessage.test(u)?new r.IntrinsicGasTooLowError({cause:n,gas:s?.gas}):r.TransactionTypeNotSupportedError.nodeMessage.test(u)?new r.TransactionTypeNotSupportedError({cause:n}):r.TipAboveFeeCapError.nodeMessage.test(u)?new r.TipAboveFeeCapError({cause:n,maxFeePerGas:s?.maxFeePerGas,maxPriorityFeePerGas:s?.maxPriorityFeePerGas}):new r.UnknownNodeError({cause:n})}return Fn}var Sm;function ag(){if(Sm)return _i;Sm=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.getEstimateGasError=i;const e=ig(),r=Nt(),t=po();function i(o,{docsPath:a,...n}){const s=(()=>{const u=(0,t.getNodeError)(o,n);return u instanceof r.UnknownNodeError?o:u})();return new e.EstimateGasExecutionError(s,{docsPath:a,...n})}return _i}var vi={},Bm;function an(){if(Bm)return vi;Bm=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.extract=e;function e(r,{format:t}){if(!t)return{};const i={};function o(n){const s=Object.keys(n);for(const u of s)u in r&&(i[u]=r[u]),n[u]&&typeof n[u]=="object"&&!Array.isArray(n[u])&&o(n[u])}const a=t(r||{});return o(a),i}return vi}var td={},Ei={},Rm;function go(){if(Rm)return Ei;Rm=1,Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.defineFormatter=e;function e(r,t){return({exclude:i,format:o})=>({exclude:i,format:a=>{const n=t(a);if(i)for(const s of i)delete n[s];return{...n,...o(a)}},type:r})}return Ei}var Om;function zt(){return Om||(Om=1,function(e){Object.defineProperty(e,"__esMo
40dule",{value:!0}),e.defineTransactionRequest=e.rpcTransactionType=void 0,e.formatTransactionRequest=i;const r=te(),t=go();e.rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function i(a){const n={};return typeof a.authorizationList<"u"&&(n.authorizationList=o(a.authorizationList)),typeof a.accessList<"u"&&(n.accessList=a.accessList),typeof a.blobVersionedHashes<"u"&&(n.blobVersionedHashes=a.blobVersionedHashes),typeof a.blobs<"u"&&(typeof a.blobs[0]!="string"?n.blobs=a.blobs.map(s=>(0,r.bytesToHex)(s)):n.blobs=a.blobs),typeof a.data<"u"&&(n.data=a.data),typeof a.from<"u"&&(n.from=a.from),typeof a.gas<"u"&&(n.gas=(0,r.numberToHex)(a.gas)),typeof a.gasPrice<"u"&&(n.gasPrice=(0,r.numberToHex)(a.gasPrice)),typeof a.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=(0,r.numberToHex)(a.maxFeePerBlobGas)),typeof a.maxFeePerGas<"u"&&(n.maxFeePerGas=(0,r.numberToHex)(a.maxFeePerGas)),typeof a.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=(0,r.numberToHex)(a.maxPriorityFeePerGas)),typeof a.nonce<"u"&&(n.nonce=(0,r.numberToHex)(a.nonce)),typeof a.to<"u"&&(n.to=a.to),typeof a.type<"u"&&(n.type=e.rpcTransactionType[a.type]),typeof a.value<"u"&&(n.value=(0,r.numberToHex)(a.value)),n}e.defineTransactionRequest=(0,t.defineFormatter)("transactionRequest",i);function o(a){return a.map(n=>({address:n.address,r:n.r?(0,r.numberToHex)(BigInt(n.r)):n.r,s:n.s?(0,r.numberToHex)(BigInt(n.s)):n.s,chainId:(0,r.numberToHex)(n.chainId),nonce:(0,r.numberToHex)(n.nonce),...typeof n.yParity<"u"?{yParity:(0,r.numberToHex)(n.yParity)}:{},...typeof n.v<"u"&&typeof n.yParity>"u"?{v:(0,r.numberToHex)(n.v)}:{}}))}}(td)),td}var Dr={},Cm;function Bd(){if(Cm)return Dr;Cm=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.serializeStateMapping=a,Dr.serializeAccountStateOverride=n,Dr.serializeStateOverride=s;const e=ft(),r=Gu(),t=Td(),i=Ke(),o=te();function a(u){if(!(!u||u.length===0))return u.reduce((c,{slot:l,value:d})=>{if(l.length!==66)throw new r.InvalidBytesLengthError({size:l.length,targetSize:66,type:"hex"});if(d.length!==66)throw new r.InvalidBytesLengthError({size:d.length,targetSize:66,type:"hex"});return c[l]=d,c},{})}function n(u){const{balance:c,nonce:l,state:d,stateDiff:f,code:p}=u,y={};if(p!==void 0&&(y.code=p),c!==void 0&&(y.balance=(0,o.numberToHex)(c)),l!==void 0&&(y.nonce=(0,o.numberToHex)(l)),d!==void 0&&(y.state=a(d)),f!==void 0){if(y.state)throw new t.StateAssignmentConflictError;y.stateDiff=a(f)}return y}function s(u){if(!u)return;const c={};for(const{address:l,...d}of u){if(!(0,i.isAddress)(l,{strict:!1}))throw new e.InvalidAddressError({address:l});if(c[l])throw new t.AccountStateConflictError({address:l});c[l]=n(d)}return c}return Dr}var ji={},U={},xm;function Rd(){return xm||(xm=1,Object.defineProperty(U,"__esModule",{value:!0}),U.minInt144=U.minInt136=U.minInt128=U.minInt120=U.minInt112=U.minInt104=U.minInt96=U.minInt88=U.minInt80=U.minInt72=U.minInt64=U.minInt56=U.minInt48=U.minInt40=U.minInt32=U.minInt24=U.minInt16=U.minInt8=U.maxInt256=U.maxInt248=U.maxInt240=U.maxInt232=U.maxInt224=U.maxInt216=U.maxInt208=U.maxInt200=U.maxInt192=U.maxInt184=U.maxInt176=U.maxInt168=U.maxInt160=U.maxInt152=U.maxInt144=U.maxInt136=U.maxInt128=U.maxInt120=U.maxInt112=U.maxInt104=U.maxInt96=U.maxInt88=U.maxInt80=U.maxInt72=U.maxInt64=U.maxInt56=U.maxInt48=U.maxInt40=U.maxInt32=U.maxInt24=U.maxInt16=U.maxInt8=void 0,U.maxUint256=U.maxUint248=U.maxUint240=U.maxUint232=U.maxUint224=U.maxUint216=U.maxUint208=U.maxUint200=U.maxUint192=U.maxUint184=U.maxUint176=U.maxUint168=U.maxUint160=U.maxUint152=U.maxUint144=U.maxUint136=U.maxUint128=U.maxUint120=U.maxUint112=U.maxUint104=U.maxUint96=U.maxUint88=U.maxUint80=U.maxUint72=U.maxUint64=U.maxUint56=U.maxUint48=U.maxUint40=U.maxUint32=U.maxUint24=U.maxUint16=U.maxUint8=U.minInt256=U.minInt248=U.minInt240=U.minInt232=U.minInt224=U.minInt216=U.minInt208=U.minInt200=U.minInt192=U.minInt184=U.minInt176=U.minInt168=U.minInt160=U.minInt152=void 0,U.maxInt8=2n**(8n-1n)-1n,U.maxInt16=2n**(16n-1n)-1n,U.maxInt24=2n**(24n-1n)-1n,U.maxInt32=2n**(32n-1n)-1n,U.maxInt40=2n**(40n-1n)-1n,U.maxInt48=2n**(48n-1n)-1n,U.maxInt56=2n**(56n-1n)-1n,U.maxInt64=2n**(64n-1n)-1n,U.maxInt72=2n**(72n-1n)-1n,U.maxInt80=2n**(80n-1n)-1n,U.maxInt88=2n**(88n-1n)-1n,U.maxInt96=2n**(96n-1n)-1n,U.maxInt104=2n**(104n-1n)-1n,U.maxInt112=2n**(112n-1n)-1n,U.maxInt120=2n**(120n-1n)-1n,U.maxInt128=2n**(128n-1n)-1n,U.maxInt136=2n**(136n-1n)-1n,U.maxInt144=2n**(144n-1n)-1n,U.maxInt152=2n**(152n-1n)-1n,U.maxInt160=2n**(160n-1n)-1n,U.maxInt168=2n**(168
40n-1n)-1n,U.maxInt176=2n**(176n-1n)-1n,U.maxInt184=2n**(184n-1n)-1n,U.maxInt192=2n**(192n-1n)-1n,U.maxInt200=2n**(200n-1n)-1n,U.maxInt208=2n**(208n-1n)-1n,U.maxInt216=2n**(216n-1n)-1n,U.maxInt224=2n**(224n-1n)-1n,U.maxInt232=2n**(232n-1n)-1n,U.maxInt240=2n**(240n-1n)-1n,U.maxInt248=2n**(248n-1n)-1n,U.maxInt256=2n**(256n-1n)-1n,U.minInt8=-(2n**(8n-1n)),U.minInt16=-(2n**(16n-1n)),U.minInt24=-(2n**(24n-1n)),U.minInt32=-(2n**(32n-1n)),U.minInt40=-(2n**(40n-1n)),U.minInt48=-(2n**(48n-1n)),U.minInt56=-(2n**(56n-1n)),U.minInt64=-(2n**(64n-1n)),U.minInt72=-(2n**(72n-1n)),U.minInt80=-(2n**(80n-1n)),U.minInt88=-(2n**(88n-1n)),U.minInt96=-(2n**(96n-1n)),U.minInt104=-(2n**(104n-1n)),U.minInt112=-(2n**(112n-1n)),U.minInt120=-(2n**(120n-1n)),U.minInt128=-(2n**(128n-1n)),U.minInt136=-(2n**(136n-1n)),U.minInt144=-(2n**(144n-1n)),U.minInt152=-(2n**(152n-1n)),U.minInt160=-(2n**(160n-1n)),U.minInt168=-(2n**(168n-1n)),U.minInt176=-(2n**(176n-1n)),U.minInt184=-(2n**(184n-1n)),U.minInt192=-(2n**(192n-1n)),U.minInt200=-(2n**(200n-1n)),U.minInt208=-(2n**(208n-1n)),U.minInt216=-(2n**(216n-1n)),U.minInt224=-(2n**(224n-1n)),U.minInt232=-(2n**(232n-1n)),U.minInt240=-(2n**(240n-1n)),U.minInt248=-(2n**(248n-1n)),U.minInt256=-(2n**(256n-1n)),U.maxUint8=2n**8n-1n,U.maxUint16=2n**16n-1n,U.maxUint24=2n**24n-1n,U.maxUint32=2n**32n-1n,U.maxUint40=2n**40n-1n,U.maxUint48=2n**48n-1n,U.maxUint56=2n**56n-1n,U.maxUint64=2n**64n-1n,U.maxUint72=2n**72n-1n,U.maxUint80=2n**80n-1n,U.maxUint88=2n**88n-1n,U.maxUint96=2n**96n-1n,U.maxUint104=2n**104n-1n,U.maxUint112=2n**112n-1n,U.maxUint120=2n**120n-1n,U.maxUint128=2n**128n-1n,U.maxUint136=2n**136n-1n,U.maxUint144=2n**144n-1n,U.maxUint152=2n**152n-1n,U.maxUint160=2n**160n-1n,U.maxUint168=2n**168n-1n,U.maxUint176=2n**176n-1n,U.maxUint184=2n**184n-1n,U.maxUint192=2n**192n-1n,U.maxUint200=2n**200n-1n,U.maxUint208=2n**208n-1n,U.maxUint216=2n**216n-1n,U.maxUint224=2n**224n-1n,U.maxUint232=2n**232n-1n,U.maxUint240=2n**240n-1n,U.maxUint248=2n**248n-1n,U.maxUint256=2n**256n-1n),U}var qm;function Ut(){if(qm)return ji;qm=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.assertRequest=n;const e=xe(),r=Rd(),t=ft(),i=Nt(),o=rt(),a=Ke();function n(s){const{account:u,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:d,to:f}=s,p=u?(0,e.parseAccount)(u):void 0;if(p&&!(0,a.isAddress)(p.address))throw new t.InvalidAddressError({address:p.address});if(f&&!(0,a.isAddress)(f))throw new t.InvalidAddressError({address:f});if(typeof c<"u"&&(typeof l<"u"||typeof d<"u"))throw new o.FeeConflictError;if(l&&l>r.maxUint256)throw new i.FeeCapTooHighError({maxFeePerGas:l});if(d&&l&&d>l)throw new i.TipAboveFeeCapError({maxFeePerGas:l,maxPriorityFeePerGas:d})}return ji}var rd={},$n={},Ct={},Mm;function ec(){if(Mm)return Ct;Mm=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.MaxFeePerGasTooLowError=Ct.Eip1559FeesNotSupportedError=Ct.BaseFeeScalarError=void 0;const e=Or(),r=le();class t extends r.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}Ct.BaseFeeScalarError=t;class i extends r.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}Ct.Eip1559FeesNotSupportedError=i;class o extends r.BaseError{constructor({maxPriorityFeePerGas:n}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,e.formatGwei)(n)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}return Ct.MaxFeePerGasTooLowError=o,Ct}var Nn={},wi={},zn={},Hm;function Od(){if(Hm)return zn;Hm=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.BlockNotFoundError=void 0;const e=le();class r extends e.BaseError{constructor({blockHash:i,blockNumber:o}){let a="Block";i&&(a=`Block at hash "${i}"`),o&&(a=`Block at number "${o}"`),super(`${a} could not be found.`,{name:"BlockNotFoundError"})}}return zn.BlockNotFoundError=r,zn}var Gr={},nd={},km;function _o(){return km||(km=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransaction=e.transactionType=void 0,e.formatTransaction=i;const r=Ce(),t=go();e.transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function i(a){const n={...a,blockHash:a.blockHash?a.blockHash:null,blockNumber:a.blockNumber?BigInt(a.blockNumber):null,chainId:a.chainId?(0,r.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,r.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&&(n.authorizationList=o(a.authorizationList)),n.yParity=(()=>
40{if(a.yParity)return Number(a.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}e.defineTransaction=(0,t.defineFormatter)("transaction",i);function o(a){return a.map(n=>({address:n.address,chainId:Number(n.chainId),nonce:Number(n.nonce),r:n.r,s:n.s,yParity:Number(n.yParity)}))}}(nd)),nd}var Fm;function tc(){if(Fm)return Gr;Fm=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.defineBlock=void 0,Gr.formatBlock=t;const e=go(),r=_o();function t(i){const o=(i.transactions??[]).map(a=>typeof a=="string"?a:(0,r.formatTransaction)(a));return{...i,baseFeePerGas:i.baseFeePerGas?BigInt(i.baseFeePerGas):null,blobGasUsed:i.blobGasUsed?BigInt(i.blobGasUsed):void 0,difficulty:i.difficulty?BigInt(i.difficulty):void 0,excessBlobGas:i.excessBlobGas?BigInt(i.excessBlobGas):void 0,gasLimit:i.gasLimit?BigInt(i.gasLimit):void 0,gasUsed:i.gasUsed?BigInt(i.gasUsed):void 0,hash:i.hash?i.hash:null,logsBloom:i.logsBloom?i.logsBloom:null,nonce:i.nonce?i.nonce:null,number:i.number?BigInt(i.number):null,size:i.size?BigInt(i.size):void 0,timestamp:i.timestamp?BigInt(i.timestamp):void 0,transactions:o,totalDifficulty:i.totalDifficulty?BigInt(i.totalDifficulty):null}}return Gr.defineBlock=(0,e.defineFormatter)("block",t),Gr}var $m;function sn(){if($m)return wi;$m=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.getBlock=i;const e=Od(),r=te(),t=tc();async function i(o,{blockHash:a,blockNumber:n,blockTag:s,includeTransactions:u}={}){const c=s??"latest",l=u??!1,d=n!==void 0?(0,r.numberToHex)(n):void 0;let f=null;if(a?f=await o.request({method:"eth_getBlockByHash",params:[a,l]},{dedupe:!0}):f=await o.request({method:"eth_getBlockByNumber",params:[d||c,l]},{dedupe:!!d}),!f)throw new e.BlockNotFoundError({blockHash:a,blockNumber:n});return(o.chain?.formatters?.block?.format||t.formatBlock)(f)}return wi}var Pi={},Nm;function Cd(){if(Nm)return Pi;Nm=1,Object.defineProperty(Pi,"__esModule",{value:!0}),Pi.getGasPrice=e;async function e(r){const t=await r.request({method:"eth_gasPrice"});return BigInt(t)}return Pi}var zm;function sg(){if(zm)return Nn;zm=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.estimateMaxPriorityFeePerGas=a,Nn.internal_estimateMaxPriorityFeePerGas=n;const e=ec(),r=Ce(),t=_e(),i=sn(),o=Cd();async function a(s,u){return n(s,u)}async function n(s,u){const{block:c,chain:l=s.chain,request:d}=u||{};try{const f=l?.fees?.maxPriorityFeePerGas??l?.fees?.defaultPriorityFee;if(typeof f=="function"){const y=c||await(0,t.getAction)(s,i.getBlock,"getBlock")({}),b=await f({block:y,client:s,request:d});if(b===null)throw new Error;return b}if(typeof f<"u")return f;const p=await s.request({method:"eth_maxPriorityFeePerGas"});return(0,r.hexToBigInt)(p)}catch{const[f,p]=await Promise.all([c?Promise.resolve(c):(0,t.getAction)(s,i.getBlock,"getBlock")({}),(0,t.getAction)(s,o.getGasPrice,"getGasPrice")({})]);if(typeof f.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const y=p-f.baseFeePerGas;return y<0n?0n:y}}return Nn}var Um;function ug(){if(Um)return $n;Um=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.estimateFeesPerGas=a,$n.internal_estimateFeesPerGas=n;const e=ec(),r=_e(),t=sg(),i=sn(),o=Cd();async function a(s,u){return n(s,u)}async function n(s,u){const{block:c,chain:l=s.chain,request:d,type:f="eip1559"}=u||{},p=await(async()=>typeof l?.fees?.baseFeeMultiplier=="function"?l.fees.baseFeeMultiplier({block:c,client:s,request:d}):l?.fees?.baseFeeMultiplier??1.2)();if(p<1)throw new e.BaseFeeScalarError;const b=10**(p.toString().split(".")[1]?.length??0),w=M=>M*BigInt(Math.ceil(p*b))/BigInt(b),B=c||await(0,r.getAction)(s,i.getBlock,"getBlock")({});if(typeof l?.fees?.estimateFeesPerGas=="function"){const M=await l.fees.estimateFeesPerGas({block:c,client:s,multiply:w,request:d,type:f});if(M!==null)return M}if(f==="eip1559"){if(typeof B.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const M=typeof d?.maxPriorityFeePerGas=="bigint"?d.maxPriorityFeePerGas:await(0,t.internal_estimateMaxPriorityFeePerGas)(s,{block:B,chain:l,request:d}),A=w(B.baseFeePerGas);return{maxFeePerGas:d?.maxFeePerGas??A+M,maxPriorityFeePerGas:M}}return{gasPrice:d?.gasPrice??w(await(0,r.getAction)(s,o.getGasPrice,"getGasPrice")({}))}}return $n}var Ai={},Lm;function rc(){if(Lm)return Ai;Lm=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.getTransactionCount=t;const e=Ce(),r=te();async function t(i,{address:o,blockTag:a="latest",blockNumber:n}){const s=await i.request({method:"eth_getTransactionCount",params:[o,typeof n=="bigint"?(0,r.numberToHex)(n):a]},{dedupe:!!n});return(0,e.hexToNumber)(s)}return Ai}var Ti={},Dm;function nc(){if(Dm)return Ti;Dm=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.blobsToCommitments=t;const e=we(),r=te();function t(i){const{kzg:o}=i,a=i.to??(typeof i.blobs[0]=="string"?"hex":"bytes"),n=typeof i.blobs[0]=="string"?i.blobs.map(u=>(0,e.hexToBytes)(u)):i.blobs,s=[];for(const u of n)s.push(Uint8Array.from(o.blobToKzgCommitment(u)));return a==="bytes"?s:s.map(u=>(0,r.bytesToHex)(u))}return Ti}var Ii={},Gm;function oc(){if(Gm)return Ii;Gm=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.blobsToProofs=t;const e=we(),r=te();function t(i){const{kzg:o}=i,a=i.to??(typeof i.blobs[0]=="string"?"hex":"bytes"),n=typeof i.blobs[0]=="string"?i.blobs.map(c=>(0,e.hexToBytes)(c)):i.blobs,s=typeof i.commitments[0]=="string"?i.commitments.map(c=>(0,e.hexToBytes)(c)):i.commitments,u=[];for(let c=0;c<n.length;c++){const l=n[c],d=s[c];
40u.push(Uint8Array.from(o.computeBlobKzgProof(l,d)))}return a==="bytes"?u:u.map(c=>(0,r.bytesToHex)(c))}return Ii}var Si={},Bi={},Ri={},st={},Vm;function cg(){if(Vm)return st;Vm=1,Object.defineProperty(st,"__esModule",{value:!0}),st.sha224=st.SHA224=st.sha256=st.SHA256=void 0;const e=rg();return st.SHA256=e.SHA256,st.sha256=e.sha256,st.SHA224=e.SHA224,st.sha224=e.sha224,st}var Wm;function xd(){if(Wm)return Ri;Wm=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.sha256=o;const e=cg(),r=De(),t=we(),i=te();function o(a,n){const s=n||"hex",u=(0,e.sha256)((0,r.isHex)(a,{strict:!1})?(0,t.toBytes)(a):a);return s==="bytes"?u:(0,i.toHex)(u)}return Ri}var Km;function qd(){if(Km)return Bi;Km=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.commitmentToVersionedHash=t;const e=te(),r=xd();function t(i){const{commitment:o,version:a=1}=i,n=i.to??(typeof o=="string"?"hex":"bytes"),s=(0,r.sha256)(o,"bytes");return s.set([a],0),n==="bytes"?s:(0,e.bytesToHex)(s)}return Bi}var Zm;function Md(){if(Zm)return Si;Zm=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.commitmentsToVersionedHashes=r;const e=qd();function r(t){const{commitments:i,version:o}=t,a=t.to??(typeof i[0]=="string"?"hex":"bytes"),n=[];for(const s of i)n.push((0,e.commitmentToVersionedHash)({commitment:s,to:a,version:o}));return n}return Si}var Oi={},Ci={},od={},Jm;function M_(){return Jm||(Jm=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxBytesPerTransaction=e.bytesPerBlob=e.fieldElementsPerBlob=e.bytesPerFieldElement=void 0;const r=6;e.bytesPerFieldElement=32,e.fieldElementsPerBlob=4096,e.bytesPerBlob=e.bytesPerFieldElement*e.fieldElementsPerBlob,e.maxBytesPerTransaction=e.bytesPerBlob*r-1-1*e.fieldElementsPerBlob*r}(od)),od}var ut={},Un={},Ym;function dg(){return Ym||(Ym=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.versionedHashVersionKzg=void 0,Un.versionedHashVersionKzg=1),Un}var Xm;function lg(){if(Xm)return ut;Xm=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.InvalidVersionedHashVersionError=ut.InvalidVersionedHashSizeError=ut.EmptyBlobError=ut.BlobSizeTooLargeError=void 0;const e=dg(),r=le();class t extends r.BaseError{constructor({maxSize:s,size:u}){super("Blob size is too large.",{metaMessages:[`Max: ${s} bytes`,`Given: ${u} bytes`],name:"BlobSizeTooLargeError"})}}ut.BlobSizeTooLargeError=t;class i extends r.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}ut.EmptyBlobError=i;class o extends r.BaseError{constructor({hash:s,size:u}){super(`Versioned hash "${s}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${u}`],name:"InvalidVersionedHashSizeError"})}}ut.InvalidVersionedHashSizeError=o;class a extends r.BaseError{constructor({hash:s,version:u}){super(`Versioned hash "${s}" version is invalid.`,{metaMessages:[`Expected: ${e.versionedHashVersionKzg}`,`Received: ${u}`],name:"InvalidVersionedHashVersionError"})}}return ut.InvalidVersionedHashVersionError=a,ut}var Qm;function fg(){if(Qm)return Ci;Qm=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.toBlobs=n;const e=M_(),r=lg(),t=lo(),i=Ve(),o=we(),a=te();
40function n(s){const u=s.to??(typeof s.data=="string"?"hex":"bytes"),c=typeof s.data=="string"?(0,o.hexToBytes)(s.data):s.data,l=(0,i.size)(c);if(!l)throw new r.EmptyBlobError;if(l>e.maxBytesPerTransaction)throw new r.BlobSizeTooLargeError({maxSize:e.maxBytesPerTransaction,size:l});const d=[];let f=!0,p=0;for(;f;){const y=(0,t.createCursor)(new Uint8Array(e.bytesPerBlob));let b=0;for(;b<e.fieldElementsPerBlob;){const w=c.slice(p,p+(e.bytesPerFieldElement-1));if(y.pushByte(0),y.pushBytes(w),w.length<31){y.pushByte(128),f=!1;break}b++,p+=31}d.push(y)}return u==="bytes"?d.map(y=>y.bytes):d.map(y=>(0,a.bytesToHex)(y.bytes))}return Ci}var eb;function ic(){if(eb)return Oi;eb=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.toBlobSidecars=i;const e=nc(),r=oc(),t=fg();function i(o){const{data:a,kzg:n,to:s}=o,u=o.blobs??(0,t.toBlobs)({data:a,to:s}),c=o.commitments??(0,e.blobsToCommitments)({blobs:u,kzg:n,to:s}),l=o.proofs??(0,r.blobsToProofs)({blobs:u,commitments:c,kzg:n,to:s}),d=[];for(let f=0;f<u.length;f++)d.push({blob:u[f],commitment:c[f],proof:l[f]});return d}return Oi}var xi={},tb;function ac(){if(tb)return xi;tb=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.getTransactionType=r;const e=rt();function r(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new e.InvalidSerializableTransactionError({transaction:t})}return xi}var qi={},rb;function un(){if(rb)return qi;rb=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.getChainId=r;const e=Ce();async function r(t){const i=await t.request({method:"eth_chainId"},{dedupe:!0});return(0,e.hexToNumber)(i)}return qi}var nb;function sc(){return nb||(nb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eip1559NetworkCache=e.defaultParameters=void 0,e.prepareTransactionRequest=b;const r=xe(),t=ug(),i=Hd(),o=sn(),a=rc(),n=ec(),s=nc(),u=oc(),c=Md(),l=ic(),d=_e(),f=Ut(),p=ac(),y=un();e.defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],e.eip1559NetworkCache=new Map;async function b(w,B){const{account:x=w.account,blobs:M,chain:A,gas:O,kzg:E,nonce:_,nonceManager:P,parameters:m=e.defaultParameters,type:T}=B,g=x&&(0,r.parseAccount)(x),v={...B,...g?{from:g?.address}:{}};let h;async function I(){return h||(h=await(0,d.getAction)(w,o.getBlock,"getBlock")({blockTag:"latest"}),h)}let R;async function j(){return R||(A?A.id:typeof B.chainId<"u"?B.chainId:(R=await(0,d.getAction)(w,y.getChainId,"getChainId")({}),R))}if(m.includes("nonce")&&typeof _>"u"&&g)if(P){const S=await j();v.nonce=await P.consume({address:g.address,chainId:S,client:w})}else v.nonce=await(0,d.getAction)(w,a.getTransactionCount,"getTransactionCount")({address:g.address,blockTag:"pending"});if((m.includes("blobVersionedHashes")||m.includes("sidecars"))&&M&&E){const S=(0,s.blobsToCommitments)({blobs:M,kzg:E});if(m.includes("blobVersionedHashes")){const C=(0,c.commitmentsToVersionedHashes)({commitments:S,to:"hex"});v.blobVersionedHashes=C}if(m.includes("sidecars")){const C=(0,u.blobsToProofs)({blobs:M,commitments:S,kzg:E}),H=(0,l.toBlobSidecars)({blobs:M,commitments:S,proofs:C,to:"hex"});v.sidecars=H}}if(m.includes("chainId")&&(v.chainId=await j()),(m.includes("fees")||m.includes("type"))&&typeof T>"u")try{v.type=(0,p.getTransactionType)(v)}catch{let S=e.eip1559NetworkCache.get(w.uid);typeof S>"u"&&(S=typeof(await I())?.baseFeePerGas=="bigint",e.eip1559NetworkCache.set(w.uid,S)),v.type=S?"eip1559":"legacy"}if(m.includes("fees"))if(v.type!=="legacy"&&v.type!=="eip2930"){if(typeof v.maxFeePerGas>"u"||typeof v.maxPriorityFeePerGas>"u"){const S=await I(),{maxFeePerGas:C,maxPriorityFeePerGas:H}=await(0,t.internal_estimateFeesPerGas)(w,{block:S,chain:A,request:v});if(typeof B.maxPriorityFeePerGas>"u"&&B.maxFeePerGas&&B.maxFeePerGas<H)throw new n.MaxFeePerGasTooLowError({maxPriorityFeePerGas:H});v.maxPriorityFeePerGas=H,v.maxFeePerGas=C}}else{if(typeof B.maxFeePerGas<"u"||typeof B.maxPriorityFeePerGas<"u")throw new n.Eip1559FeesNotSupportedError;if(typeof B.gasPrice>"u"){const S=await I(),{gasPrice:C}=await(0,t.internal_estimateFeesPerGas)(w,{block:S,chain:A,request:v,type:"legacy"});v.gasPrice=C}}return m.includes("gas")&&typeof O>"u"&&(v.gas=await(0,d.getAction)(w,i.estimateGas,"estimateGas")({...v,account:g&&{address:g.address,type:"json-rpc"}})),(0,f.assertRequest)(v),delete v.parameters,v}}(rd)),rd}var Mi={},ob;function mg(){if(ob)return Mi;ob=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.getBalance=r;const e=te();async function r(t,{address:i,blockNumber:o,blockTag:a="latest"}){const n=typeof o=="bigint"?(0,e.numberToHex)(o):void 0,s=await t.request({method:"eth_getBalance",params:[i,n||a]});return BigInt(s)}return Mi}var ib;function Hd(){if(ib)return mi;
40ib=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.estimateGas=d;const e=xe(),r=le(),t=Qu(),i=te(),o=ag(),a=an(),n=zt(),s=Bd(),u=Ut(),c=sc(),l=mg();async function d(f,p){const{account:y=f.account}=p,b=y?(0,e.parseAccount)(y):void 0;try{let N=function(W){const{block:$,request:V,rpcStateOverride:J}=W;return f.request({method:"eth_estimateGas",params:J?[V,$??"latest",J]:$?[V,$]:[V]})};const{accessList:w,authorizationList:B,blobs:x,blobVersionedHashes:M,blockNumber:A,blockTag:O,data:E,gas:_,gasPrice:P,maxFeePerBlobGas:m,maxFeePerGas:T,maxPriorityFeePerGas:g,nonce:v,value:h,stateOverride:I,...R}=await(0,c.prepareTransactionRequest)(f,{...p,parameters:b?.type==="local"?void 0:["blobVersionedHashes"]}),S=(typeof A=="bigint"?(0,i.numberToHex)(A):void 0)||O,C=(0,s.serializeStateOverride)(I),H=await(async()=>{if(R.to)return R.to;if(B&&B.length>0)return await(0,t.recoverAuthorizationAddress)({authorization:B[0]}).catch(()=>{throw new r.BaseError("`to` is required. Could not infer from `authorizationList`")})})();(0,u.assertRequest)(p);const F=f.chain?.formatters?.transactionRequest?.format,k=(F||n.formatTransactionRequest)({...(0,a.extract)(R,{format:F}),from:b?.address,accessList:w,authorizationList:B,blobs:x,blobVersionedHashes:M,data:E,gas:_,gasPrice:P,maxFeePerBlobGas:m,maxFeePerGas:T,maxPriorityFeePerGas:g,nonce:v,to:H,value:h});let D=BigInt(await N({block:S,request:k,rpcStateOverride:C}));if(B){const W=await(0,l.getBalance)(f,{address:k.from}),$=await Promise.all(B.map(async V=>{const{address:J}=V,X=await N({block:S,request:{authorizationList:void 0,data:E,from:b?.address,to:J,value:(0,i.numberToHex)(W)},rpcStateOverride:C}).catch(()=>100000n);return 2n*BigInt(X)}));D+=$.reduce((V,J)=>V+J,0n)}return D}catch(w){throw(0,o.getEstimateGasError)(w,{...p,account:b,chain:f.chain})}}return mi}var ab;function bg(){if(ab)return ti;ab=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.estimateContractGas=a;const e=xe(),r=tt(),t=ar(),i=_e(),o=Hd();async function a(n,s){const{abi:u,address:c,args:l,functionName:d,dataSuffix:f,...p}=s,y=(0,r.encodeFunctionData)({abi:u,args:l,functionName:d});try{return await(0,i.getAction)(n,o.estimateGas,"estimateGas")({data:`${y}${f?f.replace("0x",""):""}`,to:c,...p})}catch(b){const w=p.account?(0,e.parseAccount)(p.account):void 0;throw(0,t.getContractError)(b,{abi:u,address:c,args:l,docsPath:"/docs/contract/estimateContractGas",functionName:d,sender:w?.address})}}return ti}var Hi={},ki={},Fi={},$i={},sb;function ht(){if(sb)return $i;sb=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.isAddressEqual=t;const e=ft(),r=Ke();function t(i,o){if(!(0,r.isAddress)(i,{strict:!1}))throw new e.InvalidAddressError({address:i});if(!(0,r.isAddress)(o,{strict:!1}))throw new e.InvalidAddressError({address:o});return i.toLowerCase()===o.toLowerCase()}return $i}var Ni={},ub;function vo(){if(ub)return Ni;ub=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.decodeEventLog=s;const e=Ie(),r=Ve(),t=on(),i=Xp(),o=nr(),a=kt(),n="/docs/contract/decodeEventLog";function s(c){const{abi:l,data:d,strict:f,topics:p}=c,y=f??!0,[b,...w]=p;if(!b)throw new e.AbiEventSignatureEmptyTopicsError({docsPath:n});const B=l.find(P=>P.type==="event"&&b===(0,t.toEventSelector)((0,a.formatAbiItem)(P)));if(!(B&&"name"in B)||B.type!=="event")throw new e.AbiEventSignatureNotFoundError(b,{docsPath:n});const{name:x,inputs:M}=B,A=M?.some(P=>!("name"in P&&P.name)),O=A?[]:{},E=M.map((P,m)=>[P,m]).filter(([P])=>"indexed"in P&&P.indexed);for(let P=0;P<E.length;P++){const[m,T]=E[P],g=w[P];if(!g)throw new e.DecodeLogTopicsMismatch({abiItem:B,param:m});O[A?T:m.name||T]=u({param:m,value:g})}const _=M.filter(P=>!("indexed"in P&&P.indexed));if(_.length>0){if(d&&d!=="0x")try{const P=(0,o.decodeAbiParameters)(_,d);if(P)if(A)for(let m=0;m<M.length;m++)O[m]=O[m]??P.shift();else for(let m=0;m<_.length;m++)O[_[m].name]=P[m]}catch(P){if(y)throw P instanceof e.AbiDecodingDataSizeTooSmallError||P instanceof i.PositionOutOfBoundsError?new e.DecodeLogDataMismatch({abiItem:B,data:d,params:_,size:(0,r.size)(d)}):P}
40else if(y)throw new e.DecodeLogDataMismatch({abiItem:B,data:"0x",params:_,size:0})}return{eventName:x,args:Object.values(O).length>0?O:void 0}}function u({param:c,value:l}){return c.type==="string"||c.type==="bytes"||c.type==="tuple"||c.type.match(/^(.*)\[(\d+)?\]$/)?l:((0,o.decodeAbiParameters)([c],l)||[])[0]}return Ni}var cb;function Eo(){if(cb)return Fi;cb=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.parseEventLogs=n;const e=Ie(),r=ht(),t=we(),i=We(),o=on(),a=vo();function n(u){const{abi:c,args:l,logs:d,strict:f=!0}=u,p=(()=>{if(u.eventName)return Array.isArray(u.eventName)?u.eventName:[u.eventName]})();return d.map(y=>{try{const b=c.find(B=>B.type==="event"&&y.topics[0]===(0,o.toEventSelector)(B));if(!b)return null;const w=(0,a.decodeEventLog)({...y,abi:[b],strict:f});return p&&!p.includes(w.eventName)||!s({args:w.args,inputs:b.inputs,matchArgs:l})?null:{...w,...y}}catch(b){let w,B;if(b instanceof e.AbiEventSignatureNotFoundError)return null;if(b instanceof e.DecodeLogDataMismatch||b instanceof e.DecodeLogTopicsMismatch){if(f)return null;w=b.abiItem.name,B=b.abiItem.inputs?.some(x=>!("name"in x&&x.name))}return{...y,args:B?[]:{},eventName:w}}}).filter(Boolean)}function s(u){const{args:c,inputs:l,matchArgs:d}=u;if(!d)return!0;if(!c)return!1;function f(p,y,b){try{return p.type==="address"?(0,r.isAddressEqual)(y,b):p.type==="string"||p.type==="bytes"?(0,i.keccak256)((0,t.toBytes)(y))===b:y===b}catch{return!1}}return Array.isArray(c)&&Array.isArray(d)?d.every((p,y)=>{if(p==null)return!0;const b=l[y];return b?(Array.isArray(p)?p:[p]).some(B=>f(b,B,c[y])):!1}):typeof c=="object"&&!Array.isArray(c)&&typeof d=="object"&&!Array.isArray(d)?Object.entries(d).every(([p,y])=>{if(y==null)return!0;const b=l.find(B=>B.name===p);return b?(Array.isArray(y)?y:[y]).some(B=>f(b,B,c[p])):!1}):!1}return Fi}var zi={},db;function Lt(){if(db)return zi;db=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.formatLog=e;function e(r,{args:t,eventName:i}={}){return{...r,blockHash:r.blockHash?r.blockHash:null,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,logIndex:r.logIndex?Number(r.logIndex):null,transactionHash:r.transactionHash?r.transactionHash:null,transactionIndex:r.transactionIndex?Number(r.transactionIndex):null,...i?{args:t,eventName:i}:{}}}return zi}var lb;function kd(){if(lb)return ki;lb=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.getLogs=o;const e=Rr(),r=Eo(),t=te(),i=Lt();async function o(a,{address:n,blockHash:s,fromBlock:u,toBlock:c,event:l,events:d,args:f,strict:p}={}){const y=p??!1,b=d??(l?[l]:void 0);let w=[];b&&(w=[b.flatMap(A=>(0,e.encodeEventTopics)({abi:[A],eventName:A.name,args:d?void 0:f}))],l&&(w=w[0]));let B;s?B=await a.request({method:"eth_getLogs",params:[{address:n,topics:w,blockHash:s}]}):B=await a.request({method:"eth_getLogs",params:[{address:n,topics:w,fromBlock:typeof u=="bigint"?(0,t.numberToHex)(u):u,toBlock:typeof c=="bigint"?(0,t.numberToHex)(c):c}]});const x=B.map(M=>(0,i.formatLog)(M));return b?(0,r.parseEventLogs)({abi:b,args:f,logs:x,strict:y}):x}return ki}var fb;function Fd(){if(fb)return Hi;fb=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.getContractEvents=i;
40const e=$t(),r=_e(),t=kd();async function i(o,a){const{abi:n,address:s,args:u,blockHash:c,eventName:l,fromBlock:d,toBlock:f,strict:p}=a,y=l?(0,e.getAbiItem)({abi:n,name:l}):void 0,b=y?void 0:n.filter(w=>w.type==="event");return(0,r.getAction)(o,t.getLogs,"getLogs")({address:s,args:u,blockHash:c,event:y,events:b,fromBlock:d,toBlock:f,strict:p})}return Hi}var Ui={},Li={},mb;function Dt(){if(mb)return Li;mb=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.decodeFunctionResult=o;const e=Ie(),r=nr(),t=$t(),i="/docs/contract/decodeFunctionResult";function o(a){const{abi:n,args:s,functionName:u,data:c}=a;let l=n[0];if(u){const f=(0,t.getAbiItem)({abi:n,args:s,name:u});if(!f)throw new e.AbiFunctionNotFoundError(u,{docsPath:i});l=f}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:i});if(!l.outputs)throw new e.AbiFunctionOutputsNotFoundError(l.name,{docsPath:i});const d=(0,r.decodeAbiParameters)(l.outputs,c);if(d&&d.length>1)return d;if(d&&d.length===1)return d[0]}return Li}var Ln={},Dn={},fe={},pr={},id={},bb;function H_(){return bb||(bb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.notImplemented=e.bitMask=e.utf8ToBytes=e.randomBytes=e.isBytes=e.hexToBytes=e.concatBytes=e.bytesToUtf8=e.bytesToHex=e.anumber=e.abytes=void 0,e.abool=a,e.numberToHexUnpadded=n,e.hexToNumber=s,e.bytesToNumberBE=u,e.bytesToNumberLE=c,e.numberToBytesBE=l,e.numberToBytesLE=d,e.numberToVarBytesBE=f,e.ensureBytes=p,e.equalBytes=y,e.inRange=w,e.aInRange=B,e.bitLen=x,e.bitGet=M,e.bitSet=A,e.createHmacDrbg=E,e.validateObject=P,e.isHash=m,e._validateObject=T,e.memoized=v;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const r=Ht();var t=Ht();Object.defineProperty(e,"abytes",{enumerable:!0,get:function(){return t.abytes}}),Object.defineProperty(e,"anumber",{enumerable:!0,get:function(){return t.anumber}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return t.bytesToHex}}),Object.defineProperty(e,"bytesToUtf8",{enumerable:!0,get:function(){return t.bytesToUtf8}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return t.concatBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return t.hexToBytes}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return t.isBytes}}),Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return t.randomBytes}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return t.utf8ToBytes}});const i=BigInt(0),o=BigInt(1);function a(h,I){if(typeof I!="boolean")throw new Error(h+" boolean expected, got "+I)}function n(h){const I=h.toString(16);return I.length&1?"0"+I:I}function s(h){if(typeof h!="string")throw new Error("hex string expected, got "+typeof h);return h===""?i:BigInt("0x"+h)}function u(h){return s((0,r.bytesToHex)(h))}function c(h){return(0,r.abytes)(h),s((0,r.bytesToHex)(Uint8Array.from(h).reverse()))}function l(h,I){return(0,r.hexToBytes)(h.toString(16).padStart(I*2,"0"))}function d(h,I){return l(h,I).reverse()}function f(h){return(0,r.hexToBytes)(n(h))}function p(h,I,R){let j;if(typeof I=="string")try{j=(0,r.hexToBytes)(I)}catch(C){throw new Error(h+" must be hex string or Uint8Array, cause: "+C)}else if((0,r.isBytes)(I))j=Uint8Array.from(I);else throw new Error(h+" must be hex string or Uint8Array");const S=j.length;if(typeof R=="number"&&S!==R)throw new Error(h+" of length "+R+" expected, got "+S);return j}function y(h,I){if(h.length!==I.length)return!1;let R=0;for(let j=0;j<h.length;j++)R|=h[j]^I[j];return R===0}const b=h=>typeof h=="bigint"&&i<=h;function w(h,I,R){return b(h)&&b(I)&&b(R)&&I<=h&&h<R}function B(h,I,R,j){if(!w(I,R,j))throw new Error("expected valid "+h+": "+R+" <= n < "+j+", got "+I)}function x(h){let I;for(I=0;h>i;h>>=o,I+=1);return I}function M(h,I){return h>>BigInt(I)&o}function A(h,I,R){return h|(R?o:i)<<BigInt(I)}const O=h=>(o<<BigInt(h))-o;e.bitMask=O;function E(h,I,R){if(typeof h!="number"||h<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 R!="function")throw new Error("hmacFn must be a function");const j=$=>new Uint8Array($),S=$=>Uint8Array.of($);let C=j(h),H=j(h),F=0;const q=()=>{C.fill(1),H.fill(0),F=0},k=(...$)=>R(H,C,...$),N=($=j(0))=>{H=k(S(0),$),C=k(),$.length!==0&&(H=k(S(1),$),C=k())},D=()=>
40{if(F++>=1e3)throw new Error("drbg: tried 1000 values");let $=0;const V=[];for(;$<I;){C=k();const J=C.slice();V.push(J),$+=C.length}return(0,r.concatBytes)(...V)};return($,V)=>{q(),N($);let J;for(;!(J=V(D()));)N();return q(),J}}const _={bigint:h=>typeof h=="bigint",function:h=>typeof h=="function",boolean:h=>typeof h=="boolean",string:h=>typeof h=="string",stringOrUint8Array:h=>typeof h=="string"||(0,r.isBytes)(h),isSafeInteger:h=>Number.isSafeInteger(h),array:h=>Array.isArray(h),field:(h,I)=>I.Fp.isValid(h),hash:h=>typeof h=="function"&&Number.isSafeInteger(h.outputLen)};function P(h,I,R={}){const j=(S,C,H)=>{const F=_[C];if(typeof F!="function")throw new Error("invalid validator function");const q=h[S];if(!(H&&q===void 0)&&!F(q,h))throw new Error("param "+String(S)+" is invalid. Expected "+C+", got "+q)};for(const[S,C]of Object.entries(I))j(S,C,!1);for(const[S,C]of Object.entries(R))j(S,C,!0);return h}function m(h){return typeof h=="function"&&Number.isSafeInteger(h.outputLen)}function T(h,I,R={}){if(!h||typeof h!="object")throw new Error("expected valid options object");function j(S,C,H){const F=h[S];if(H&&F===void 0)return;const q=typeof F;if(q!==C||F===null)throw new Error(`param "${S}" is invalid: expected ${C}, got ${q}`)}Object.entries(I).forEach(([S,C])=>j(S,C,!1)),Object.entries(R).forEach(([S,C])=>j(S,C,!0))}const g=()=>{throw new Error("not implemented")};e.notImplemented=g;function v(h){const I=new WeakMap;return(R,...j)=>{const S=I.get(R);if(S!==void 0)return S;const C=h(R,...j);return I.set(R,C),C}}}(id)),id}var hb;function hg(){return hb||(hb=1,function(e){var r=pr&&pr.__createBinding||(Object.create?function(i,o,a,n){n===void 0&&(n=a);var s=Object.getOwnPropertyDescriptor(o,a);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(i,n,s)}:function(i,o,a,n){n===void 0&&(n=a),i[n]=o[a]}),t=pr&&pr.__exportStar||function(i,o){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&r(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),t(H_(),e)}(pr)),pr}var he={},Gn={},Vr={},Vn={},yb;function k_(){return yb||(yb=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.version=void 0,Vn.version="0.1.1"),Vn}var pb;function F_(){if(pb)return Vr;pb=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.getUrl=r,Vr.getVersion=t,Vr.prettyPrint=i;const e=k_();function r(o){return o}function t(){return e.version}function i(o){if(!o)return"";const a=Object.entries(o).map(([s,u])=>u===void 0||u===!1?null:[s,u]).filter(Boolean),n=a.reduce((s,[u])=>Math.max(s,u.length),0);return a.map(([s,u])=>` ${`${s}:`.padEnd(n+1)} ${u}`).join(` 41`)}return Vr}var gb;function Gt(){if(gb)return Gn;gb=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.BaseError=void 0;const e=F_();class r extends Error{constructor(o,a={}){const n=(()=>{if(a.cause instanceof r){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})(),s=a.cause instanceof r&&a.cause.docsPath||a.docsPath,c=`https://oxlib.sh${s??""}`,l=[o||"An error occurred.",...a.metaMessages?["",...a.metaMessages]:[],...n||s?["",n?`Details: ${n}`:void 0,s?`See: ${c}`:void 0]:[]].filter(d=>typeof d=="string").join(` 42`);super(l,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,"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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${(0,e.getVersion)()}`}),this.cause=a.cause,this.details=n,this.docs=c,this.docsPath=s,this.shortMessage=o}walk(o){return t(this,o)}}Gn.BaseError=r;function t(i,o){return o?.(i)?i:i&&typeof i=="object"&&"cause"in i&&i.cause?t(i.cause,o):o?null:i}return Gn}var Wn={},_b;function $d(){if(_b)return Wn;_b=1,Object.defineProperty(Wn,"__esModule",{value:!0}
42),Wn.parse=r,Wn.stringify=t;const e="#__bigint";function r(i,o){return JSON.parse(i,(a,n)=>{const s=n;return typeof s=="string"&&s.endsWith(e)?BigInt(s.slice(0,-e.length)):typeof o=="function"?o(a,s):s})}function t(i,o,a){return JSON.stringify(i,(n,s)=>typeof o=="function"?o(n,s):typeof s=="bigint"?s.toString()+e:s,a)}return Wn}var ad={},vb;function yg(){return vb||(vb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeMap=void 0,e.assertSize=t,e.assertStartOffset=i,e.assertEndOffset=o,e.charCodeToBase16=a,e.pad=n,e.trim=s;const r=Cr();function t(u,c){if(r.size(u)>c)throw new r.SizeOverflowError({givenSize:r.size(u),maxSize:c})}function i(u,c){if(typeof c=="number"&&c>0&&c>r.size(u)-1)throw new r.SliceOffsetOutOfBoundsError({offset:c,position:"start",size:r.size(u)})}function o(u,c,l){if(typeof c=="number"&&typeof l=="number"&&r.size(u)!==l-c)throw new r.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:r.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 n(u,c={}){const{dir:l,size:d=32}=c;if(d===0)return u;if(u.length>d)throw new r.SizeExceedsPaddingSizeError({size:u.length,targetSize:d,type:"Bytes"});const f=new Uint8Array(d);for(let p=0;p<d;p++){const y=l==="right";f[y?p:d-p-1]=u[y?p:u.length-p-1]}return f}function s(u,c={}){const{dir:l="left"}=c;let d=u,f=0;for(let p=0;p<d.length-1&&d[l==="left"?p:d.length-p-1].toString()==="0";p++)f++;return d=l==="left"?d.slice(f):d.slice(0,d.length-f),d}}(ad)),ad}var Xt={},Eb;function pg(){if(Eb)return Xt;Eb=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.assertSize=r,Xt.assertStartOffset=t,Xt.assertEndOffset=i,Xt.pad=o,Xt.trim=a;const e=yt();function r(n,s){if(e.size(n)>s)throw new e.SizeOverflowError({givenSize:e.size(n),maxSize:s})}function t(n,s){if(typeof s=="number"&&s>0&&s>e.size(n)-1)throw new e.SliceOffsetOutOfBoundsError({offset:s,position:"start",size:e.size(n)})}function i(n,s,u){if(typeof s=="number"&&typeof u=="number"&&e.size(n)!==u-s)throw new e.SliceOffsetOutOfBoundsError({offset:u,position:"end",size:e.size(n)})}function o(n,s={}){const{dir:u,size:c=32}=s;if(c===0)return n;const l=n.replace("0x","");if(l.length>c*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(l.length/2),targetSize:c,type:"Hex"});return`0x${l[u==="right"?"padEnd":"padStart"](c*2,"0")}`}function a(n,s={}){const{dir:u="left"}=s;let c=n.replace("0x",""),l=0;for(let d=0;d<c.length-1&&c[u==="left"?d:c.length-d-1].toString()==="0";d++)l++;return c=u==="left"?c.slice(l):c.slice(0,c.length-l),c==="0"?"0x":u==="right"&&c.length%2===1?`0x${c}0`:`0x${c}`}return Xt}var jb;function Cr(){if(jb)return he;jb=1,Object.defineProperty(he,"__esModule",{value:!0}),he.SizeExceedsPaddingSizeError=he.SliceOffsetOutOfBoundsError=he.SizeOverflowError=he.InvalidBytesTypeError=he.InvalidBytesBooleanError=void 0,he.assert=u,he.concat=c,he.from=l,he.fromArray=d,he.fromBoolean=f,he.fromHex=p,he.fromNumber=y,he.fromString=b,he.isEqual=w,he.padLeft=B,he.padRight=x,he.random=M,he.size=A,he.slice=O,he.toBigInt=E,he.toBoolean=_,he.toHex=P,he.toNumber=m,he.toString=T,he.trimLeft=g,he.trimRight=v,he.validate=h;const e=hg(),r=Gt(),t=yt(),i=$d(),o=yg(),a=pg(),n=new TextDecoder,s=new TextEncoder;function u(H){if(!(H instanceof Uint8Array)){if(!H)throw new R(H);if(typeof H!="object")throw new R(H);if(!("BYTES_PER_ELEMENT"in H))throw new R(H);if(H.BYTES_PER_ELEMENT!==1||H.constructor.name!=="Uint8Array")throw new R(H)}}function c(...H){let F=0;for(const k of H)F+=k.length;const q=new Uint8Array(F);for(let k=0,N=0;k<H.length;k++){const D=H[k];q.set(D,N),N+=D.length}return q}function l(H){return H instanceof Uint8Array?H:typeof H=="string"?p(H):d(H)}function d(H){return H instanceof Uint8Array?H:new Uint8Array(H)}function f(H,F={}){const{size:q}=F,k=new Uint8Array(1);return k[0]=Number(H),typeof q=="number"?(o.assertSize(k,q),B(k,q)):k}function p(H,F={}){const{size:q}=F;let k=H;q&&(a.assertSize(H,q),k=t.padRight(H,q));let N=k.slice(2);N.length%2&&(N=`0${N}`);
42const D=N.length/2,W=new Uint8Array(D);for(let $=0,V=0;$<D;$++){const J=o.charCodeToBase16(N.charCodeAt(V++)),X=o.charCodeToBase16(N.charCodeAt(V++));if(J===void 0||X===void 0)throw new r.BaseError(`Invalid byte sequence ("${N[V-2]}${N[V-1]}" in "${N}").`);W[$]=J*16+X}return W}function y(H,F){const q=t.fromNumber(H,F);return p(q)}function b(H,F={}){const{size:q}=F,k=s.encode(H);return typeof q=="number"?(o.assertSize(k,q),x(k,q)):k}function w(H,F){return(0,e.equalBytes)(H,F)}function B(H,F){return o.pad(H,{dir:"left",size:F})}function x(H,F){return o.pad(H,{dir:"right",size:F})}function M(H){return crypto.getRandomValues(new Uint8Array(H))}function A(H){return H.length}function O(H,F,q,k={}){const{strict:N}=k;o.assertStartOffset(H,F);const D=H.slice(F,q);return N&&o.assertEndOffset(D,F,q),D}function E(H,F={}){const{size:q}=F;typeof q<"u"&&o.assertSize(H,q);const k=t.fromBytes(H,F);return t.toBigInt(k,F)}function _(H,F={}){const{size:q}=F;let k=H;if(typeof q<"u"&&(o.assertSize(k,q),k=g(k)),k.length>1||k[0]>1)throw new I(k);return!!k[0]}function P(H,F={}){return t.fromBytes(H,F)}function m(H,F={}){const{size:q}=F;typeof q<"u"&&o.assertSize(H,q);const k=t.fromBytes(H,F);return t.toNumber(k,F)}function T(H,F={}){const{size:q}=F;let k=H;return typeof q<"u"&&(o.assertSize(k,q),k=v(k)),n.decode(k)}function g(H){return o.trim(H,{dir:"left"})}function v(H){return o.trim(H,{dir:"right"})}function h(H){try{return u(H),!0}catch{return!1}}class I extends r.BaseError{constructor(F){super(`Bytes value \`${F}\` 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=I;class R extends r.BaseError{constructor(F){super(`Value \`${typeof F=="object"?i.stringify(F):F}\` of type \`${typeof F}\` 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=R;class j extends r.BaseError{constructor({givenSize:F,maxSize:q}){super(`Size cannot exceed \`${q}\` bytes. Given size: \`${F}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}he.SizeOverflowError=j;class S extends r.BaseError{constructor({offset:F,position:q,size:k}){super(`Slice ${q==="start"?"starting":"ending"} at offset \`${F}\` is out-of-bounds (size: \`${k}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}he.SliceOffsetOutOfBoundsError=S;class C extends r.BaseError{constructor({size:F,targetSize:q,type:k}){super(`${k.charAt(0).toUpperCase()}${k.slice(1).toLowerCase()} size (\`${F}\`) exceeds padding size (\`${q}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return he.SizeExceedsPaddingSizeError=C,he}var wb;function yt(){if(wb)return fe;wb=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.SizeExceedsPaddingSizeError=fe.SliceOffsetOutOfBoundsError=fe.SizeOverflowError=fe.InvalidLengthError=fe.InvalidHexValueError=fe.InvalidHexTypeError=fe.InvalidHexBooleanError=fe.IntegerOutOfRangeError=void 0,fe.assert=u,fe.concat=c,fe.from=l,fe.fromBoolean=d,fe.fromBytes=f,fe.fromNumber=p,fe.fromString=y,fe.isEqual=b,fe.padLeft=w,fe.padRight=B,fe.random=x,fe.slice=M,fe.size=A,fe.trimLeft=O,fe.trimRight=E,fe.toBigInt=_,fe.toBoolean=P,fe.toBytes=m,fe.toNumber=T,fe.toString=g,fe.validate=v;const e=hg(),r=Cr(),t=Gt(),i=$d(),o=yg(),a=pg(),n=new TextEncoder,s=Array.from({length:256},(q,k)=>k.toString(16).padStart(2,"0"));function u(q,k={}){const{strict:N=!1}=k;if(!q)throw new R(q);if(typeof q!="string")throw new R(q);if(N&&!/^0x[0-9a-fA-F]*$/.test(q))throw new j(q);if(!q.startsWith("0x"))throw new j(q)}function c(...q){return`0x${q.reduce((k,N)=>k+N.replace("0x",""),"")}`}function l(q){return q instanceof Uint8Array?f(q):Array.isArray(q)?f(new Uint8Array(q)):q}function d(q,k={}){const N=`0x${Number(q)}`;return typeof k.size=="number"?(a.assertSize(N,k.size),w(N,k.size)):N}function f(q,k={}){let N="";for(let W=0;W<q.length;W++)N+=s[q[W]];const D=`0x${N}`;return typeof k.size=="number"?(a.assertSize(D,k.size),B(D,k.size)):D}function p(q,k={}){const{signed:N,size:D}=k,W=BigInt(q);let $;D?N?$=(1n<<BigInt(D)*8n-1n)-1n:$=2n**(BigInt(D)*8n)-1n:typeof q=="number"&&($=BigInt(Number.MAX_SAFE_INTEGER));const V=typeof $=="bigint"&&N?-$-1n:0;if($&&W>$||W<V){const K=typeof q=="bigint"?"n":"";throw new h({max:$?`${$}${K}`:void 0,min:`${V}${K}`,signed:N,size:D,value:`${q}${K}`})}const X=`0x${(N&&W<0?(1n<<BigInt(D*8))+BigInt(W):W).toString(16)}`;return D?w(X,D):X}function y(q,k={}){return f(n.encode(q),k)}function b(q,k){return(0,e.equalBytes)(r.fromHex(q),r.fromHex(k))}function w(q,k){return a.pad(q,{dir:"left",size:k})}function B(q,k){return a.pad(q,{dir:"right",size:k})}function x(q){return f(r.random(q))}function M(q,k,N,D={}){const{strict:W}=D;a.assertStartOffset(q,k);const $=`0x${q.replace("0x","").slice((k??0)*2,(N??q.length)*2)}`;return W&&a.assertEndOffset($,k,N),$}function A(q){return Math.ceil((q.length-2)/2)}function O(q){return a.trim(q,{dir:"left"})}function E(q){return a.trim(q,{dir:"right"})}function _(q,k={}){const{signed:N}=k;k.size&&a.assertSize(q,k.size);const D=BigInt(q);if(!N)return D;const W=(q.length-2)/2,$=(1n<<BigInt(W)*8n)-1n,V=$>>1n;return D<=V?D:D-$-1n}function P(q,k={}){k.size&&a.assertSize(q,k.size);const N=O(q);if(N==="0x")return!1;if(N==="0x1")return!0;throw new I(q)}function m(q,k={}){return r.fromHex(q,k)}function T(q,k={}){const{signed:N,size:D}=k;return Number(!N&&!D?q:_(q,k))}function g(q,k={}){const{size:N}=k;let D=r.fromHex(q);return N&&(o.assertSize(D,N),D=r.trimRight(D)),new TextDecoder().decode(D)}function v(q,k={}){const{strict:N=!1}=k;try{return u(q,{strict:N}),!0}catch{return!1}}class h extends t.BaseError{constructor({max:k,min:N,signed:D,size:W,value:$}){super(`Number \`${$}\` is not in safe${W?` ${W*8}-bit`:""}${D?" signed":" unsigned"} integer range ${k?`(\`${N}\` to \`${k}\`)`:`(above \`${N}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}fe.IntegerOutOfRangeError=h;class I extends t.BaseError{constructor(k){super(`Hex value \`"${k}"\` 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"})}}fe.InvalidHexBooleanError=I;class R extends t.BaseError{constructor(k){super(`Value \`${typeof k=="object"?i.stringify(k):k}\` of type \`${typeof k}
42\` 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"})}}fe.InvalidHexTypeError=R;class j extends t.BaseError{constructor(k){super(`Value \`${k}\` 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"})}}fe.InvalidHexValueError=j;class S extends t.BaseError{constructor(k){super(`Hex value \`"${k}"\` is an odd length (${k.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}fe.InvalidLengthError=S;class C extends t.BaseError{constructor({givenSize:k,maxSize:N}){super(`Size cannot exceed \`${N}\` bytes. Given size: \`${k}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}fe.SizeOverflowError=C;class H extends t.BaseError{constructor({offset:k,position:N,size:D}){super(`Slice ${N==="start"?"starting":"ending"} at offset \`${k}\` is out-of-bounds (size: \`${D}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}fe.SliceOffsetOutOfBoundsError=H;class F extends t.BaseError{constructor({size:k,targetSize:N,type:D}){super(`${D.charAt(0).toUpperCase()}${D.slice(1).toLowerCase()} size (\`${k}\`) exceeds padding size (\`${N}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return fe.SizeExceedsPaddingSizeError=F,fe}var Kn={},Pb;function $_(){if(Pb)return Kn;Pb=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.fromRpc=r,Kn.toRpc=t;const e=yt();function r(i){return{...i,amount:BigInt(i.amount),index:Number(i.index),validatorIndex:Number(i.validatorIndex)}}function t(i){return{address:i.address,amount:e.fromNumber(i.amount),index:e.fromNumber(i.index),validatorIndex:e.fromNumber(i.validatorIndex)}}return Kn}var Ab;function gg(){if(Ab)return Dn;Ab=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.fromRpc=t,Dn.toRpc=i;const e=yt(),r=$_();function t(o){return{...o.baseFeePerGas&&{baseFeePerGas:BigInt(o.baseFeePerGas)},...o.blobBaseFee&&{blobBaseFee:BigInt(o.blobBaseFee)},...o.feeRecipient&&{feeRecipient:o.feeRecipient},...o.gasLimit&&{gasLimit:BigInt(o.gasLimit)},...o.number&&{number:BigInt(o.number)},...o.prevRandao&&{prevRandao:BigInt(o.prevRandao)},...o.time&&{time:BigInt(o.time)},...o.withdrawals&&{withdrawals:o.withdrawals.map(r.fromRpc)}}}function i(o){return{...typeof o.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(o.baseFeePerGas)},...typeof o.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(o.blobBaseFee)},...typeof o.feeRecipient=="string"&&{feeRecipient:o.feeRecipient},...typeof o.gasLimit=="bigint"&&{gasLimit:e.fromNumber(o.gasLimit)},...typeof o.number=="bigint"&&{number:e.fromNumber(o.number)},...typeof o.prevRandao=="bigint"&&{prevRandao:e.fromNumber(o.prevRandao)},...typeof o.time=="bigint"&&{time:e.fromNumber(o.time)},...o.withdrawals&&{withdrawals:o.withdrawals.map(r.toRpc)}}}return Dn}var ge={},Tb;function ur(){if(Tb)return ge;Tb=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.erc4626Abi=ge.erc721Abi=ge.erc1155Abi=ge.erc20Abi_bytes32=ge.erc20Abi=ge.universalSignatureValidatorAbi=ge.smartAccountAbi=ge.addressResolverAbi=ge.textResolverAbi=ge.universalResolverReverseAbi=ge.universalResolverResolveAbi=ge.batchGatewayAbi=ge.multicall3Abi=void 0,ge.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"}],ge.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:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}];return ge.universalResolverResolveAbi=[...e,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",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"}]}],ge.universalResolverReverseAbi=[...e,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],ge.textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ge.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"}]}],ge.smartAccountAbi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],ge.universalSignatureValidatorAbi=[{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"}
42],ge.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"}]}],ge.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"}]}],ge.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"}
42],ge.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:[]}],ge.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"}],ge}var Zn={},Ib;function N_(){return Ib||(Ib=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.aggregate3Signature=void 0,Zn.aggregate3Signature="0x82ad56cb"),Zn}var xt={},Sb;
42function uc(){return Sb||(Sb=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.universalSignatureValidatorByteCode=xt.deploylessCallViaFactoryBytecode=xt.deploylessCallViaBytecodeBytecode=void 0,xt.deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",xt.deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",xt.universalSignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b8152
4260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848
42603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"),xt}var Xe={},Bb;function jo(){if(Bb)return Xe;Bb=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.InvalidChainIdError=Xe.ClientChainNotConfiguredError=Xe.ChainNotFoundError=Xe.ChainMismatchError=Xe.ChainDoesNotSupportContract=void 0;const e=le();class r extends e.BaseError{constructor({blockNumber:s,chain:u,contract:c}){super(`Chain "${u.name}" does not support contract "${c.name}".`,{metaMessages:["This could be due to any of the following:",...s&&c.blockCreated&&c.blockCreated>s?[`- The contract "${c.name}" was not deployed until block ${c.blockCreated} (current block ${s}).`]:[`- The chain does not have the contract "${c.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}Xe.ChainDoesNotSupportContract=r;class t extends e.BaseError{constructor({chain:s,currentChainId:u}){super(`The current chain of the wallet (id: ${u}) does not match the target chain for the transaction (id: ${s.id} – ${s.name}).`,{metaMessages:[`Current Chain ID: ${u}`,`Expected Chain ID: ${s.id} – ${s.name}`],name:"ChainMismatchError"})}}Xe.ChainMismatchError=t;class i 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(` 43`),{name:"ChainNotFoundError"})}}Xe.ChainNotFoundError=i;class o extends e.BaseError{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}Xe.ClientChainNotConfiguredError=o;class a extends e.BaseError{constructor({chainId:s}){super(typeof s=="number"?`Chain ID "${s}
43" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}return Xe.InvalidChainIdError=a,Xe}var Di={},Rb;function wo(){if(Rb)return Di;Rb=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.encodeDeployData=o;const e=Ie(),r=ke(),t=mt(),i="/docs/contract/encodeDeployData";function o(a){const{abi:n,args:s,bytecode:u}=a;if(!s||s.length===0)return u;const c=n.find(d=>"type"in d&&d.type==="constructor");if(!c)throw new e.AbiConstructorNotFoundError({docsPath:i});if(!("inputs"in c))throw new e.AbiConstructorParamsNotFoundError({docsPath:i});if(!c.inputs||c.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:i});const l=(0,t.encodeAbiParameters)(c.inputs,s);return(0,r.concatHex)([u,l])}return Di}var Gi={},Ob;function cr(){if(Ob)return Gi;Ob=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.getChainContractAddress=r;const e=jo();function r({blockNumber:t,chain:i,contract:o}){const a=i?.contracts?.[o];if(!a)throw new e.ChainDoesNotSupportContract({chain:i,contract:{name:o}});if(t&&a.blockCreated&&a.blockCreated>t)throw new e.ChainDoesNotSupportContract({blockNumber:t,chain:i,contract:{name:o,blockCreated:a.blockCreated}});return a.address}return Gi}var Vi={},Cb;function Nd(){if(Cb)return Vi;Cb=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.getCallError=i;const e=or(),r=Nt(),t=po();function i(o,{docsPath:a,...n}){const s=(()=>{const u=(0,t.getNodeError)(o,n);return u instanceof r.UnknownNodeError?o:u})();return new e.CallExecutionError(s,{docsPath:a,...n})}return Vi}var Wi={},Ki={},xb;function zd(){if(xb)return Ki;xb=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.withResolvers=e;function e(){let r=()=>{},t=()=>{};return{promise:new Promise((o,a)=>{r=o,t=a}),resolve:r,reject:t}}return Ki}var qb;function Ud(){if(qb)return Wi;qb=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.createBatchScheduler=t;const e=zd(),r=new Map;function t({fn:i,id:o,shouldSplitBatch:a,wait:n=0,sort:s}){const u=async()=>{const p=d();c();const y=p.map(({args:b})=>b);y.length!==0&&i(y).then(b=>{s&&Array.isArray(b)&&b.sort(s);for(let w=0;w<p.length;w++){const{resolve:B}=p[w];B?.([b[w],b])}}).catch(b=>{for(let w=0;w<p.length;w++){const{reject:B}=p[w];B?.(b)}})},c=()=>r.delete(o),l=()=>d().map(({args:p})=>p),d=()=>r.get(o)||[],f=p=>r.set(o,[...d(),p]);return{flush:c,async schedule(p){const{promise:y,resolve:b,reject:w}=(0,e.withResolvers)();return a?.([...l(),p])&&u(),d().length>0?(f({args:p,resolve:b,reject:w}),y):(f({args:p,resolve:b,reject:w}),setTimeout(u,n),y)}}}return Wi}var sd={},qt={},Mb;function z_(){if(Mb)return qt;Mb=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.OffchainLookupSenderMismatchError=qt.OffchainLookupResponseMalformedError=qt.OffchainLookupError=void 0;const e=Fe(),r=le(),t=Id();class i extends r.BaseError{constructor({callbackSelector:s,cause:u,data:c,extraData:l,sender:d,urls:f}){super(u.shortMessage||"An error occurred while fetching for an offchain result.",{cause:u,metaMessages:[...u.metaMessages||[],u.metaMessages?.length?"":[],"Offchain Gateway Call:",f&&[" Gateway URL(s):",...f.map(p=>` ${(0,t.getUrl)(p)}`)],` Sender: ${d}`,` Data: ${c}`,` Callback selector: ${s}`,` Extra data: ${l}`].flat(),name:"OffchainLookupError"})}}qt.OffchainLookupError=i;class o extends r.BaseError{constructor({result:s,url:u}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,t.getUrl)(u)}`,`Response: ${(0,e.stringify)(s)}`],name:"OffchainLookupResponseMalformedError"})}}qt.OffchainLookupResponseMalformedError=o;class a extends r.BaseError{constructor({sender:s,to:u}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${u}`,`OffchainLookup sender address: ${s}`],name:"OffchainLookupSenderMismatchError"})}}return qt.OffchainLookupSenderMismatchError=a,qt}var ud={},Zi={},Hb;function Ld(){if(Hb)return Zi;Hb=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.decodeFunctionData=a;const e=Ie(),r=ot(),t=Br(),i=nr(),o=kt();function a(n){const{abi:s,data:u}=n,c=(0,r.slice)(u,0,4),l=s.find(d=>d.type==="function"&&c===(0,t.toFunctionSelector)((0,o.formatAbiItem)(d)));if(!l)throw new e.AbiFunctionSignatureNotFoundError(c,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,i.decodeAbiParameters)(l.inputs,(0,r.slice)(u,4)):void 0}}return Zi}var Ji={},kb;function Dd(){if(kb)return Ji;kb=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.encodeErrorResult=s;const e=Ie(),r=ke(),t=Br(),i=mt(),o=kt(),a=$t(),n="/docs/contract/encodeErrorResult";function s(u){const{abi:c,errorName:l,args:d}=u;let f=c[0];if(l){const w=(0,a.getAbiItem)({abi:c,args:d,name:l});if(!w)throw new e.AbiErrorNotFoundError(l,{docsPath:n});f=w}if(f.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:n});const p=(0,o.formatAbiItem)(f),y=(0,t.toFunctionSelector)(p);let b="0x";if(d&&d.length>0){if(!f.inputs)throw new e.AbiErrorInputsNotFoundError(f.name,{docsPath:n});b=(0,i.encodeAbiParameters)(f.inputs,d)}return(0,r.concatHex)([y,b])}return Ji}var Yi={},Fb;function Gd(){if(Fb)return Yi;Fb=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.encodeFunctionResult=o;const e=Ie(),r=mt(),t=$t(),i="/docs/contract/encodeFunctionResult";function o(a){const{abi:n,functionName:s,result:u}=a;let c=n[0];if(s){const d=(0,t.getAbiItem)({abi:n,name:s});if(!d)throw new e.AbiFunctionNotFoundError(s,{docsPath:i});c=d}
43if(c.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:i});if(!c.outputs)throw new e.AbiFunctionOutputsNotFoundError(c.name,{docsPath:i});const l=(()=>{if(c.outputs.length===0)return[];if(c.outputs.length===1)return[u];if(Array.isArray(u))return u;throw new e.InvalidArrayError(u)})();return(0,r.encodeAbiParameters)(c.outputs,l)}return Yi}var $b;function Vd(){return $b||($b=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localBatchGatewayUrl=void 0,e.localBatchGatewayRequest=n;const r=ur(),t=Zu(),i=Ld(),o=Dd(),a=Gd();e.localBatchGatewayUrl="x-batch-gateway:true";async function n(u){const{data:c,ccipRequest:l}=u,{args:[d]}=(0,i.decodeFunctionData)({abi:r.batchGatewayAbi,data:c}),f=[],p=[];return await Promise.all(d.map(async(y,b)=>{try{p[b]=y.urls.includes(e.localBatchGatewayUrl)?await n({data:y.data,ccipRequest:l}):await l(y),f[b]=!1}catch(w){f[b]=!0,p[b]=s(w)}})),(0,a.encodeFunctionResult)({abi:r.batchGatewayAbi,functionName:"query",result:[f,p]})}function s(u){return u.name==="HttpRequestError"&&u.status?(0,o.encodeErrorResult)({abi:r.batchGatewayAbi,errorName:"HttpError",args:[u.status,u.shortMessage]}):(0,o.encodeErrorResult)({abi:[t.solidityError],errorName:"Error",args:["shortMessage"in u?u.shortMessage:u.message]})}}(ud)),ud}var Nb;function Wd(){return Nb||(Nb=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.offchainLookupAbiItem=e.offchainLookupSignature=void 0,e.offchainLookup=d,e.ccipRequest=f;const r=Po(),t=z_(),i=bt(),o=Ju(),a=mt(),n=ht(),s=ke(),u=De(),c=Vd(),l=Fe();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 d(p,{blockNumber:y,blockTag:b,data:w,to:B}){const{args:x}=(0,o.decodeErrorResult)({data:w,abi:[e.offchainLookupAbiItem]}),[M,A,O,E,_]=x,{ccipRead:P}=p,m=P&&typeof P?.request=="function"?P.request:f;try{if(!(0,n.isAddressEqual)(B,M))throw new t.OffchainLookupSenderMismatchError({sender:M,to:B});const T=A.includes(c.localBatchGatewayUrl)?await(0,c.localBatchGatewayRequest)({data:O,ccipRequest:m}):await m({data:O,sender:M,urls:A}),{data:g}=await(0,r.call)(p,{blockNumber:y,blockTag:b,data:(0,s.concat)([E,(0,a.encodeAbiParameters)([{type:"bytes"},{type:"bytes"}],[T,_])]),to:B});return g}catch(T){throw new t.OffchainLookupError({callbackSelector:E,cause:T,data:w,extraData:_,sender:M,urls:A})}}async function f({data:p,sender:y,urls:b}){let w=new Error("An unknown error occurred.");for(let B=0;B<b.length;B++){const x=b[B],M=x.includes("{data}")?"GET":"POST",A=M==="POST"?{data:p,sender:y}:void 0,O=M==="POST"?{"Content-Type":"application/json"}:{};try{const E=await fetch(x.replace("{sender}",y.toLowerCase()).replace("{data}",p),{body:JSON.stringify(A),headers:O,method:M});let _;if(E.headers.get("Content-Type")?.startsWith("application/json")?_=(await E.json()).data:_=await E.text(),!E.ok){w=new i.HttpRequestError({body:A,details:_?.error?(0,l.stringify)(_.error):E.statusText,headers:E.headers,status:E.status,url:x});continue}if(!(0,u.isHex)(_)){w=new t.OffchainLookupResponseMalformedError({result:_,url:x});continue}return _}catch(E){w=new i.HttpRequestError({body:A,details:E.message,url:x})}}throw w}}(sd)),sd}var zb;function Po(){if(zb)return Ln;zb=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.call=A,Ln.getRevertErrorData=m;const e=tr(),r=gg(),t=xe(),i=ur(),o=N_(),a=uc(),n=le(),s=jo(),u=or(),c=Dt(),l=wo(),d=tt(),f=cr(),p=te(),y=Nd(),b=an(),w=zt(),B=Ud(),x=Bd(),M=Ut();async function A(T,g){const{account:v=T.account,authorizationList:h,batch:I=!!T.batch?.multicall,blockNumber:R,blockTag:j="latest",accessList:S,blobs:C,blockOverrides:H,code:F,data:q,factory:k,factoryData:N,gas:D,gasPrice:W,maxFeePerBlobGas:$,maxFeePerGas:V,maxPriorityFeePerGas:J,nonce:X,to:K,value:de,stateOverride:me,...se}=g,Z=v?(0,t.parseAccount)(v):void 0;if(F&&(k||N))throw new n.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(F&&K)throw new n.BaseError("Cannot provide both `code` & `to` as parameters.");const Q=F&&q,Y=k&&N&&K&&q,G=Q||Y,L=Q?_({code:F,data:q}):Y?P({data:q,factory:k,factoryData:N,to:K}):q;try{(0,M.assertRequest)(g);const re=(typeof R=="bigint"?(0,p.numberToHex)(R):void 0)||j,ee=H?r.toRpc(H):void 0,oe=(0,x.serializeStateOverride)(me),ue=T.chain?.formatters?.transactionRequest?.format,be=(ue||w.formatTransactionRequest)({...(0,b.extract)(se,{format:ue}),from:Z?.address,accessList:S,authorizationList:h,blobs:C,data:L,gas:D,gasPrice:W,maxFeePerBlobGas:$,maxFeePerGas:V,maxPriorityFeePerGas:J,nonce:X,to:G?void 0:K,value:de});if(I&&O({request:be})&&!oe&&!ee)try{return await E(T,{...be,blockNumber:R,blockTag:j})}catch(ye){if(!(ye instanceof s.ClientChainNotConfiguredError)&&!(ye instanceof s.ChainDoesNotSupportContract))throw ye}const ce=(()=>{const ye=[be,re];return oe&&ee?[...ye,oe,ee]:oe?[...ye,oe]:ee?[...ye,{},ee]:ye})(),je=await T.request({method:"eth_call",params:ce});return je==="0x"?{data:void 0}:{data:je}}catch(ne){const re=m(ne),{offchainLookup:ee,offchainLookupSignature:oe}=await Promise.resolve().then(()=>Wd());if(T.ccipRead!==!1&&re?.slice(0,10)===oe&&K)return{data:await ee(T,{data:re,to:K}
43)};throw G&&re?.slice(0,10)==="0x101bb98d"?new u.CounterfactualDeploymentFailedError({factory:k}):(0,y.getCallError)(ne,{...g,account:Z,chain:T.chain})}}function O({request:T}){const{data:g,to:v,...h}=T;return!(!g||g.startsWith(o.aggregate3Signature)||!v||Object.values(h).filter(I=>typeof I<"u").length>0)}async function E(T,g){const{batchSize:v=1024,wait:h=0}=typeof T.batch?.multicall=="object"?T.batch.multicall:{},{blockNumber:I,blockTag:R="latest",data:j,multicallAddress:S,to:C}=g;let H=S;if(!H){if(!T.chain)throw new s.ClientChainNotConfiguredError;H=(0,f.getChainContractAddress)({blockNumber:I,chain:T.chain,contract:"multicall3"})}const q=(typeof I=="bigint"?(0,p.numberToHex)(I):void 0)||R,{schedule:k}=(0,B.createBatchScheduler)({id:`${T.uid}.${q}`,wait:h,shouldSplitBatch(W){return W.reduce((V,{data:J})=>V+(J.length-2),0)>v*2},fn:async W=>{const $=W.map(X=>({allowFailure:!0,callData:X.data,target:X.to})),V=(0,d.encodeFunctionData)({abi:i.multicall3Abi,args:[$],functionName:"aggregate3"}),J=await T.request({method:"eth_call",params:[{data:V,to:H},q]});return(0,c.decodeFunctionResult)({abi:i.multicall3Abi,args:[$],functionName:"aggregate3",data:J||"0x"})}}),[{returnData:N,success:D}]=await k({data:j,to:C});if(!D)throw new u.RawContractError({data:N});return N==="0x"?{data:void 0}:{data:N}}function _(T){const{code:g,data:v}=T;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(bytes, bytes)"]),bytecode:a.deploylessCallViaBytecodeBytecode,args:[g,v]})}function P(T){const{data:g,factory:v,factoryData:h,to:I}=T;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(address, bytes, address, bytes)"]),bytecode:a.deploylessCallViaFactoryBytecode,args:[I,g,v,h]})}function m(T){if(!(T instanceof n.BaseError))return;const g=T.walk();return typeof g?.data=="object"?g.data?.data:g.data}return Ln}var Ub;function Vt(){if(Ub)return Ui;Ub=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.readContract=a;const e=Dt(),r=tt(),t=ar(),i=_e(),o=Po();async function a(n,s){const{abi:u,address:c,args:l,functionName:d,...f}=s,p=(0,r.encodeFunctionData)({abi:u,args:l,functionName:d});try{const{data:y}=await(0,i.getAction)(n,o.call,"call")({...f,data:p,to:c});return(0,e.decodeFunctionResult)({abi:u,args:l,functionName:d,data:y||"0x"})}catch(y){throw(0,t.getContractError)(y,{abi:u,address:c,args:l,docsPath:"/docs/contract/readContract",functionName:d})}}return Ui}var Xi={},Lb;function _g(){if(Lb)return Xi;Lb=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.simulateContract=n;const e=xe(),r=Dt(),t=tt(),i=ar(),o=_e(),a=Po();async function n(s,u){const{abi:c,address:l,args:d,dataSuffix:f,functionName:p,...y}=u,b=y.account?(0,e.parseAccount)(y.account):s.account,w=(0,t.encodeFunctionData)({abi:c,args:d,functionName:p});try{const{data:B}=await(0,o.getAction)(s,a.call,"call")({batch:!1,data:`${w}${f?f.replace("0x",""):""}`,to:l,...y,account:b}),x=(0,r.decodeFunctionResult)({abi:c,args:d,functionName:p,data:B||"0x"}),M=c.filter(A=>"name"in A&&A.name===u.functionName);return{result:x,request:{abi:M,address:l,args:d,dataSuffix:f,functionName:p,...y,account:b}}}catch(B){throw(0,i.getContractError)(B,{abi:c,address:l,args:d,docsPath:"/docs/contract/simulateContract",functionName:p,sender:b?.address})}}return Xi}var Qi={},cd={},Db;function xr(){return Db||(Db=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.cleanupCache=e.listenersCache=void 0,e.observe=t,e.listenersCache=new Map,e.cleanupCache=new Map;let r=0;function t(i,o,a){const n=++r,s=()=>e.listenersCache.get(i)||[],u=()=>{const p=s();e.listenersCache.set(i,p.filter(y=>y.id!==n))},c=()=>{const p=s();if(!p.some(b=>b.id===n))return;const y=e.cleanupCache.get(i);if(p.length===1&&y){const b=y();b instanceof Promise&&b.catch(()=>{})}u()},l=s();if(e.listenersCache.set(i,[...l,{id:n,fns:o}]),l&&l.length>0)return c;const d={};for(const p in o)d[p]=(...y)=>{const b=s();if(b.length!==0)for(const w of b)w.fns[p]?.(...y)};const f=a(d);return typeof f=="function"&&e.cleanupCache.set(i,f),c}}(cd)),cd}var ea={},ta={},Gb;function Kd(){if(Gb)return ta;Gb=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.wait=e;async function e(r){return new Promise(t=>setTimeout(t,r))}return ta}var Vb;function cn(){if(Vb)return ea;Vb=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.poll=r;const e=Kd();function r(t,{emitOnBegin:i,initialWaitTime:o,interval:a}){let n=!0;const s=()=>n=!1;return(async()=>{let c;i&&(c=await t({unpoll:s}));const l=await o?.(c)??a;await(0,e.wait)(l);const d=async()=>{n&&(await t({unpoll:s}),await(0,e.wait)(a),d())};d()})(),s}return ea}var Jn={},dd={},Wb;function vg(){return Wb||(Wb=1,function(e){Object.defineProperty(e,"__esMo
43dule",{value:!0}),e.responseCache=e.promiseCache=void 0,e.getCache=r,e.withCache=t,e.promiseCache=new Map,e.responseCache=new Map;function r(i){const o=(s,u)=>({clear:()=>u.delete(s),get:()=>u.get(s),set:c=>u.set(s,c)}),a=o(i,e.promiseCache),n=o(i,e.responseCache);return{clear:()=>{a.clear(),n.clear()},promise:a,response:n}}async function t(i,{cacheKey:o,cacheTime:a=Number.POSITIVE_INFINITY}){const n=r(o),s=n.response.get();if(s&&a>0&&new Date().getTime()-s.created.getTime()<a)return s.data;let u=n.promise.get();u||(u=i(),n.promise.set(u));try{const c=await u;return n.response.set({created:new Date,data:c}),c}finally{n.promise.clear()}}}(dd)),dd}var Kb;function Ao(){if(Kb)return Jn;Kb=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.getBlockNumberCache=t,Jn.getBlockNumber=i;const e=vg(),r=o=>`blockNumber.${o}`;function t(o){return(0,e.getCache)(r(o))}async function i(o,{cacheTime:a=o.cacheTime}={}){const n=await(0,e.withCache)(()=>o.request({method:"eth_blockNumber"}),{cacheKey:r(o.uid),cacheTime:a});return BigInt(n)}return Jn}var ra={},Zb;function cc(){if(Zb)return ra;Zb=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.getFilterChanges=t;const e=Eo(),r=Lt();async function t(i,{filter:o}){const a="strict"in o&&o.strict,n=await o.request({method:"eth_getFilterChanges",params:[o.id]});if(typeof n[0]=="string")return n;const s=n.map(u=>(0,r.formatLog)(u));return!("abi"in o)||!o.abi?s:(0,e.parseEventLogs)({abi:o.abi,logs:s,strict:a})}return ra}var na={},Jb;function dc(){if(Jb)return na;Jb=1,Object.defineProperty(na,"__esModule",{value:!0}),na.uninstallFilter=e;async function e(r,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}return na}var Yb;function Eg(){if(Yb)return Qi;Yb=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.watchContractEvent=y;const e=Ie(),r=ir(),t=vo(),i=Rr(),o=Lt(),a=_e(),n=xr(),s=cn(),u=Fe(),c=Pd(),l=Ao(),d=Fd(),f=cc(),p=dc();function y(b,w){const{abi:B,address:x,args:M,batch:A=!0,eventName:O,fromBlock:E,onError:_,onLogs:P,poll:m,pollingInterval:T=b.pollingInterval,strict:g}=w;return(typeof m<"u"?m:typeof E=="bigint"?!0:!(b.transport.type==="webSocket"||b.transport.type==="ipc"||b.transport.type==="fallback"&&(b.transport.transports[0].c
43onfig.type==="webSocket"||b.transport.transports[0].config.type==="ipc")))?(()=>{const R=g??!1,j=(0,u.stringify)(["watchContractEvent",x,M,A,b.uid,O,T,R,E]);return(0,n.observe)(j,{onLogs:P,onError:_},S=>{let C;E!==void 0&&(C=E-1n);let H,F=!1;const q=(0,s.poll)(async()=>{if(!F){try{H=await(0,a.getAction)(b,c.createContractEventFilter,"createContractEventFilter")({abi:B,address:x,args:M,eventName:O,strict:R,fromBlock:E})}catch{}F=!0;return}try{let k;if(H)k=await(0,a.getAction)(b,f.getFilterChanges,"getFilterChanges")({filter:H});else{const N=await(0,a.getAction)(b,l.getBlockNumber,"getBlockNumber")({});C&&C<N?k=await(0,a.getAction)(b,d.getContractEvents,"getContractEvents")({abi:B,address:x,args:M,eventName:O,fromBlock:C+1n,toBlock:N,strict:R}):k=[],C=N}if(k.length===0)return;if(A)S.onLogs(k);else for(const N of k)S.onLogs([N])}catch(k){H&&k instanceof r.InvalidInputRpcError&&(F=!1),S.onError?.(k)}},{emitOnBegin:!0,interval:T});return async()=>{H&&await(0,a.getAction)(b,p.uninstallFilter,"uninstallFilter")({filter:H}),q()}})})():(()=>{const R=g??!1,j=(0,u.stringify)(["watchContractEvent",x,M,A,b.uid,O,T,R]);let S=!0,C=()=>S=!1;return(0,n.observe)(j,{onLogs:P,onError:_},H=>((async()=>{try{const F=(()=>{if(b.transport.type==="fallback"){const N=b.transport.transports.find(D=>D.config.type==="webSocket"||D.config.type==="ipc");return N?N.value:b.transport}return b.transport})(),q=O?(0,i.encodeEventTopics)({abi:B,eventName:O,args:M}):[],{unsubscribe:k}=await F.subscribe({params:["logs",{address:x,topics:q}],onData(N){if(!S)return;const D=N.result;try{const{eventName:W,args:$}=(0,t.decodeEventLog)({abi:B,data:D.data,topics:D.topics,strict:g}),V=(0,o.formatLog)(D,{args:$,eventName:W});H.onLogs([V])}catch(W){let $,V;if(W instanceof e.DecodeLogDataMismatch||W instanceof e.DecodeLogTopicsMismatch){if(g)return;$=W.abiItem.name,V=W.abiItem.inputs?.some(X=>!("name"in X&&X.name))}const J=(0,o.formatLog)(D,{args:V?[]:{},eventName:$});H.onLogs([J])}},onError(N){H.onError?.(N)}});C=k,S||C()}catch(F){_?.(F)}})(),()=>C()))})()}return Qi}var oa={},gr={},Xb;function qr(){if(Xb)return gr;Xb=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.AccountTypeNotSupportedError=gr.AccountNotFoundError=void 0;const e=le();class r extends e.BaseError{constructor({docsPath:o}={}){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(` 44`),{docsPath:o,docsSlug:"account",name:"AccountNotFoundError"})}}gr.AccountNotFoundError=r;class t extends e.BaseError{constructor({docsPath:o,metaMessages:a,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:o,metaMessages:a,name:"AccountTypeNotSupportedError"})}}return gr.AccountTypeNotSupportedError=t,gr}var ia={},aa={},Qb;function lc(){if(Qb)return aa;Qb=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.assertCurrentChain=r;const e=jo();function r({chain:t,currentChainId:i}){if(!t)throw new e.ChainNotFoundError;if(i!==t.id)throw new e.ChainMismatchError({chain:t,currentChainId:i})}return aa}var sa={},e0;function Zd(){if(e0)return sa;e0=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.getTransactionError=i;const e=Nt(),r=rt(),t=po();function i(o,{docsPath:a,...n}){const s=(()=>{const u=(0,t.getNodeError)(o,n);return u instanceof e.UnknownNodeError?o:u})();return new r.TransactionExecutionError(s,{docsPath:a,...n})}return sa}var ua={},t0;function Jd(){if(t0)return ua;t0=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.sendRawTransaction=e;async function e(r,{serializedTransaction:t}){return r.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}return ua}var r0;function fc(){if(r0)return ia;r0=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.sendTransaction=b;const e=xe(),r=qr(),t=le(),i=Qu(),o=lc(),a=Zd(),n=an(),s=zt(),u=_e(),c=co(),l=Ut(),d=un(),f=sc(),p=Jd(),y=new c.LruMap(128);async function b(w,B){const{account:x=w.account,chain:M=w.chain,accessList:A,authorizationList:O,blobs:E,data:_,gas:P,gasPrice:m,maxFeePerBlobGas:T,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:h,type:I,value:R,...j}=B;if(typeof x>"u")throw new r.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const S=x?(0,e.parseAccount)(x):null;try{(0,l.assertRequest)(B);const C=await(async()=>
44{if(B.to)return B.to;if(B.to!==null&&O&&O.length>0)return await(0,i.recoverAuthorizationAddress)({authorization:O[0]}).catch(()=>{throw new t.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(S?.type==="json-rpc"||S===null){let H;M!==null&&(H=await(0,u.getAction)(w,d.getChainId,"getChainId")({}),(0,o.assertCurrentChain)({currentChainId:H,chain:M}));const F=w.chain?.formatters?.transactionRequest?.format,k=(F||s.formatTransactionRequest)({...(0,n.extract)(j,{format:F}),accessList:A,authorizationList:O,blobs:E,chainId:H,data:_,from:S?.address,gas:P,gasPrice:m,maxFeePerBlobGas:T,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:h,to:C,type:I,value:R}),N=y.get(w.uid),D=N?"wallet_sendTransaction":"eth_sendTransaction";try{return await w.request({method:D,params:[k]},{retryCount:0})}catch(W){if(N===!1)throw W;const $=W;if($.name==="InvalidInputRpcError"||$.name==="InvalidParamsRpcError"||$.name==="MethodNotFoundRpcError"||$.name==="MethodNotSupportedRpcError")return await w.request({method:"wallet_sendTransaction",params:[k]},{retryCount:0}).then(V=>(y.set(w.uid,!0),V)).catch(V=>{const J=V;throw J.name==="MethodNotFoundRpcError"||J.name==="MethodNotSupportedRpcError"?(y.set(w.uid,!1),$):J});throw $}}if(S?.type==="local"){const H=await(0,u.getAction)(w,f.prepareTransactionRequest,"prepareTransactionRequest")({account:S,accessList:A,authorizationList:O,blobs:E,chain:M,data:_,gas:P,gasPrice:m,maxFeePerBlobGas:T,maxFeePerGas:g,maxPriorityFeePerGas:v,nonce:h,nonceManager:S.nonceManager,parameters:[...f.defaultParameters,"sidecars"],type:I,value:R,...j,to:C}),F=M?.serializers?.transaction,q=await S.signTransaction(H,{serializer:F});return await(0,u.getAction)(w,p.sendRawTransaction,"sendRawTransaction")({serializedTransaction:q})}throw S?.type==="smart"?new r.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new r.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:S?.type})}catch(C){throw C instanceof r.AccountTypeNotSupportedError?C:(0,a.getTransactionError)(C,{...B,account:S,chain:B.chain||void 0})}}return ia}var n0;function jg(){if(n0)return oa;n0=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.writeContract=n;const e=xe(),r=qr(),t=tt(),i=ar(),o=_e(),a=fc();async function n(s,u){const{abi:c,account:l=s.account,address:d,args:f,dataSuffix:p,functionName:y,...b}=u;if(typeof l>"u")throw new r.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const w=l?(0,e.parseAccount)(l):null,B=(0,t.encodeFunctionData)({abi:c,args:f,functionName:y});try{return await(0,o.getAction)(s,a.sendTransaction,"sendTransaction")({data:`${B}${p?p.replace("0x",""):""}`,to:d,account:w,...b})}catch(x){throw(0,i.getContractError)(x,{abi:c,address:d,args:f,docsPath:"/docs/contract/writeContract",functionName:y,sender:w?.address})}}return oa}var o0;function U_(){if(o0)return kr;o0=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.getContract=u,kr.getFunctionParameters=c,kr.getEventParameters=l;const e=_e(),r=Pd(),t=bg(),i=Fd(),o=Vt(),a=_g(),n=Eg(),s=jg();function u({abi:d,address:f,client:p}){const y=p,[b,w]=y?"public"in y&&"wallet"in y?[y.public,y.wallet]:"public"in y?[y.public,void 0]:"wallet"in y?[void 0,y.wallet]:[y,y]:[void 0,void 0],B=b!=null,x=w!=null,M={};let A=!1,O=!1,E=!1;for(const _ of d)if(_.type==="function"?_.stateMutability==="view"||_.stateMutability==="pure"?A=!0:O=!0:_.type==="event"&&(E=!0),A&&O&&E)break;return B&&(A&&(M.read=new Proxy({},{get(_,P){return(...m)=>{const{args:T,options:g}=c(m);return(0,e.getAction)(b,o.readContract,"readContract")({abi:d,address:f,functionName:P,args:T,...g})}}})),O&&(M.simulate=new Proxy({},{get(_,P){return(...m)=>{const{args:T,options:g}=c(m);return(0,e.getAction)(b,a.simulateContract,"simulateContract")({abi:d,address:f,functionName:P,args:T,...g})}}})),E&&(M.createEventFilter=new Proxy({},{get(_,P){return(...m)=>{const T=d.find(h=>h.type==="event"&&h.name===P),{args:g,options:v}=l(m,T);return(0,e.getAction)(b,r.createContractEventFilter,"createContractEventFilter")({abi:d,address:f,eventName:P,args:g,...v})}}}),M.getEvents=new Proxy({},{get(_,P){return(...m)=>{const T=d.find(h=>h.type==="event"&&h.name===P),{args:g,options:v}=l(m,T);return(0,e.getAction)(b,i.getContractEvents,"getContractEvents")({abi:d,address:f,eventName:P,args:g,...v})}}}),M.watchEvent=new Proxy({},{get(_,P){return(...m)=>{const T=d.find(h=>h.type==="event"&&h.name===P),{args:g,options:v}=l(m,T);return(0,e.getAction)(b,n.watchContractEvent,"watchContractEvent")({abi:d,address:f,eventName:P,args:g,...v})}}}))),x&&O&&(M.write=new Proxy({},{get(_,P){return(...m)=>{const{args:T,options:g}=c(m);return(0,e.getAction)(w,s.writeContract,"writeContract")({abi:d,address:f,functionName:P,args:T,...g})}}})),(B||x)&&O&&(M.estimateGas=new Proxy({},{get(_,P){return(...m)=>{const{args:T,options:g}=c(m),v=b??w;return(0,e.getAction)(v,t.estimateContractGas,"estimateContractGas")({abi:d,address:f,functionName:P,args:T,...g,account:g.account??w.account})}}})),M.address=f,M.abi=d,M}function c(d){const f=d.length&&Array.isArray(d[0]),p=f?d[0]:[],y=(f?d[1]:d[0])??{};return{args:p,options:y}}function l(d,f){let p=!1;Array.isArray(d[0])?p=!0:d.length===1?p=f.inputs.some(w=>w.indexed):d.length===2&&(p=!0);const y=p?d[0]:void 0,b=(p?d[1]:d[0])??{};return{args:y,options:b}}return kr}var Wr={},ca={},ld={},i0;function mc(){return i0||(i0=1,function(e){Object.defineProperty(e,"__esMo
44dule",{value:!0}),e.defineTransactionReceipt=e.receiptStatuses=void 0,e.formatTransactionReceipt=a;const r=Ce(),t=go(),i=Lt(),o=_o();e.receiptStatuses={"0x0":"reverted","0x1":"success"};function a(n){const s={...n,blockNumber:n.blockNumber?BigInt(n.blockNumber):null,contractAddress:n.contractAddress?n.contractAddress:null,cumulativeGasUsed:n.cumulativeGasUsed?BigInt(n.cumulativeGasUsed):null,effectiveGasPrice:n.effectiveGasPrice?BigInt(n.effectiveGasPrice):null,gasUsed:n.gasUsed?BigInt(n.gasUsed):null,logs:n.logs?n.logs.map(u=>(0,i.formatLog)(u)):null,to:n.to?n.to:null,transactionIndex:n.transactionIndex?(0,r.hexToNumber)(n.transactionIndex):null,status:n.status?e.receiptStatuses[n.status]:null,type:n.type?o.transactionType[n.type]||n.type:null};return n.blobGasPrice&&(s.blobGasPrice=BigInt(n.blobGasPrice)),n.blobGasUsed&&(s.blobGasUsed=BigInt(n.blobGasUsed)),s}e.defineTransactionReceipt=(0,t.defineFormatter)("transactionReceipt",a)}(ld)),ld}var fd={},a0;function wg(){return a0||(a0=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fallbackTransactionErrorMagicIdentifier=e.fallbackMagicIdentifier=void 0,e.sendCalls=l;const r=xe(),t=le(),i=ir(),o=tt(),a=ke(),n=Ce(),s=te(),u=Zd(),c=fc();e.fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",e.fallbackTransactionErrorMagicIdentifier=(0,s.numberToHex)(0,{size:32});async function l(d,f){const{account:p=d.account,capabilities:y,chain:b=d.chain,experimental_fallback:w,experimental_fallbackDelay:B=32,forceAtomic:x=!1,id:M,version:A="2.0.0"}=f,O=p?(0,r.parseAccount)(p):null,E=f.calls.map(_=>{const P=_,m=P.abi?(0,o.encodeFunctionData)({abi:P.abi,functionName:P.functionName,args:P.args}):P.data;return{data:P.dataSuffix&&m?(0,a.concat)([m,P.dataSuffix]):m,to:P.to,value:P.value?(0,s.numberToHex)(P.value):void 0}});try{const _=await d.request({method:"wallet_sendCalls",params:[{atomicRequired:x,calls:E,capabilities:y,chainId:(0,s.numberToHex)(b.id),from:O?.address,id:M,version:A}]},{retryCount:0});return typeof _=="string"?{id:_}:_}catch(_){const P=_;if(w&&(P.name==="MethodNotFoundRpcError"||P.name==="MethodNotSupportedRpcError"||P.name==="UnknownRpcError"||P.details.toLowerCase().includes("does not exist / is not available")||P.details.toLowerCase().includes("missing or invalid. request()")||P.details.toLowerCase().includes("did not match any variant of untagged enum")||P.details.toLowerCase().includes("account upgraded to unsupported contract")||P.details.toLowerCase().includes("eip-7702 not supported")||P.details.toLowerCase().includes("unsupported wc_ method"))){if(y&&Object.values(y).some(h=>!h.optional)){const h="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new i.UnsupportedNonOptionalCapabilityError(new t.BaseError(h,{details:h}))}if(x&&E.length>1){const v="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new i.AtomicityNotSupportedError(new t.BaseError(v,{details:v}))}const m=[];for(const v of E){const h=(0,c.sendTransaction)(d,{account:O,chain:b,data:v.data,to:v.to,value:v.value?(0,n.hexToBigInt)(v.value):void 0});m.push(h),B>0&&await new Promise(I=>setTimeout(I,B))}const T=await Promise.allSettled(m);if(T.every(v=>v.status==="rejected"))throw T[0].reason;const g=T.map(v=>v.status==="fulfilled"?v.value:e.fallbackTransactionErrorMagicIdentifier);return{id:(0,a.concat)([...g,(0,s.numberToHex)(b.id,{size:32}),e.fallbackMagicIdentifier])}}throw(0,u.getTransactionError)(_,{...f,account:O,chain:f.chain})}}}(fd)),fd}var s0;function Pg(){if(s0)return ca;s0=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.getCallsStatus=a;const e=ot(),r=Ft(),t=Ce(),i=mc(),o=wg();async function a(n,s){async function u(w){if(w.endsWith(o.fallbackMagicIdentifier.slice(2))){const x=(0,r.trim)((0,e.sliceHex)(w,-64,-32)),M=(0,e.sliceHex)(w,0,-64).slice(2).match(/.{1,64}/g),A=await Promise.all(M.map(E=>o.fallbackTransactionErrorMagicIdentifier.slice(2)!==E?n.request({method:"eth_getTransactionReceipt",params:[`0x${E}`]},{dedupe:!0}):void 0)),O=A.some(E=>E===null)?100:A.every(E=>
44E?.status==="0x1")?200:A.every(E=>E?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,t.hexToNumber)(x),receipts:A.filter(Boolean),status:O,version:"2.0.0"}}return n.request({method:"wallet_getCallsStatus",params:[w]})}const{atomic:c=!1,chainId:l,receipts:d,version:f="2.0.0",...p}=await u(s.id),[y,b]=(()=>{const w=p.status;return w>=100&&w<200?["pending",w]:w>=200&&w<300?["success",w]:w>=300&&w<700?["failure",w]:w==="CONFIRMED"?["success",200]:w==="PENDING"?["pending",100]:[void 0,w]})();return{...p,atomic:c,chainId:l?(0,t.hexToNumber)(l):void 0,receipts:d?.map(w=>({...w,blockNumber:(0,t.hexToBigInt)(w.blockNumber),gasUsed:(0,t.hexToBigInt)(w.gasUsed),status:i.receiptStatuses[w.status]}))??[],statusCode:b,status:y,version:f}}return ca}var u0;function Ag(){if(u0)return Wr;u0=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.WaitForCallsStatusTimeoutError=void 0,Wr.waitForCallsStatus=n;const e=le(),r=xr(),t=cn(),i=zd(),o=Fe(),a=Pg();async function n(u,c){const{id:l,pollingInterval:d=u.pollingInterval,status:f=({statusCode:A})=>A>=200,timeout:p=6e4}=c,y=(0,o.stringify)(["waitForCallsStatus",u.uid,l]),{promise:b,resolve:w,reject:B}=(0,i.withResolvers)();let x;const M=(0,r.observe)(y,{resolve:w,reject:B},A=>{const O=(0,t.poll)(async()=>{const E=_=>{clearTimeout(x),O(),_(),M()};try{const _=await(0,a.getCallsStatus)(u,{id:l});if(!f(_))return;E(()=>A.resolve(_))}catch(_){E(()=>A.reject(_))}},{interval:d,emitOnBegin:!0});return O});return x=p?setTimeout(()=>{M(),clearTimeout(x),B(new s({id:l}))},p):void 0,await b}class s extends e.BaseError{constructor({id:c}){super(`Timed out while waiting for call bundle with id "${c}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}return Wr.WaitForCallsStatusTimeoutError=s,Wr}var Yn={},da={},c0;function Tg(){if(c0)return da;c0=1,Object.defineProperty(da,"__esModule",{value:!0}),da.uid=i;const e=256;let r=e,t;function i(o=11){if(!t||r+o>e*2){t="",r=0;for(let a=0;a<e;a++)t+=(256+Math.random()*256|0).toString(16).substring(1)}return t.substring(r,r+++o)}return da}var d0;function bc(){if(d0)return Yn;d0=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.createClient=t,Yn.rpcSchema=i;const e=xe(),r=Tg();function t(o){const{batch:a,chain:n,ccipRead:s,key:u="base",name:c="Base Client",type:l="base"}=o,d=n?.blockTime??12e3,f=Math.min(Math.max(Math.floor(d/2),500),4e3),p=o.pollingInterval??f,y=o.cacheTime??p,b=o.account?(0,e.parseAccount)(o.account):void 0,{config:w,request:B,value:x}=o.transport({chain:n,pollingInterval:p}),M={...w,...x},A={account:b,batch:a,cacheTime:y,ccipRead:s,chain:n,key:u,name:c,pollingInterval:p,request:B,transport:M,type:l,uid:(0,r.uid)()};function O(E){return _=>{const P=_(E);for(const T in A)delete P[T];const m={...E,...P};return Object.assign(m,{extend:O(m)})}}return Object.assign(A,{extend:O(A)})}function i(){return null}return Yn}var la={},fa={},Xn={},md={},l0;function L_(){return l0||(l0=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.promiseCache=void 0,e.withDedupe=t;const r=co();e.promiseCache=new r.LruMap(8192);function t(i,{enabled:o=!0,id:a}){if(!o||!a)return i();if(e.promiseCache.get(a))return e.promiseCache.get(a);const n=i().finally(()=>e.promiseCache.delete(a));return e.promiseCache.set(a,n),n}}(md)),md}var ma={},f0;function Yd(){if(f0)return ma;f0=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.withRetry=r;const e=Kd();function r(t,{delay:i=100,retryCount:o=2,shouldRetry:a=()=>!0}={}){return new Promise((n,s)=>{const u=async({count:c=0}={})=>{const l=async({error:d})=>{const f=typeof i=="function"?i({count:c,error:d}):i;f&&await(0,e.wait)(f),u({count:c+1})};try{const d=await t();n(d)}catch(d){if(c<o&&await a({count:c,error:d}))return l({error:d});s(d)}};u()})}return ma}var m0;function Ig(){if(m0)return Xn;m0=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.buildRequest=s,Xn.shouldRetry=u;const e=le(),r=bt(),t=ir(),i=te(),o=L_(),a=Yd(),n=Fe();function s(c,l={}){return async(d,f={})=>{const{dedupe:p=!1,methods:y,retryDelay:b=150,retryCount:w=3,uid:B}={...l,...f},{method:x}=d;if(y?.exclude?.includes(x))throw new t.MethodNotSupportedRpcError(new Error("method not supported"),{method:x});if(y?.include&&!y.include.includes(x))throw new t.MethodNotSupportedRpcError(new Error("method not supported"),{method:x});const M=p?(0,i.stringToHex)(`${B}.${(0,n.stringify)(d)}`):void 0;return(0,o.withDedupe)(()=>(0,a.withRetry)(async()=>{try{return await c(d)}catch(A){const O=A;switch(O.code){case t.ParseRpcError.code:throw new t.ParseRpcError(O);case t.InvalidRequestRpcError.code:throw new t.InvalidRequestRpcError(O);case t.MethodNotFoundRpcError.code:throw new t.MethodNotFoundRpcError(O,{method:d.method});case t.InvalidParamsRpcError.code:throw new t.InvalidParamsRpcError(O);case t.InternalRpcError.code:throw new t.InternalRpcError(O);case t.InvalidInputRpcError.code:throw new t.InvalidInputRpcError(O);case t.ResourceNotFoundRpcError.code:throw new t.ResourceNotFoundRpcError(O);case t.ResourceUnavailableRpcError.code:throw new t.ResourceUnavailableRpcError(O);case t.TransactionRejectedRpcError.code:throw new t.TransactionRejectedRpcError(O);case t.MethodNotSupportedRpcError.code:throw new t.MethodNotSupportedRpcError(O,{method:d.method});case t.LimitExceededRpcError.code:throw new t.LimitExceededRpcError(O);case t.JsonRpcVersionUnsupportedError.code:throw new t.JsonRpcVersionUnsupportedError(O);case t.UserRejectedRequestError.code:throw new t.UserRejectedRequestError(O);case t.UnauthorizedProviderError.code:throw new t.UnauthorizedProviderError(O);case t.UnsupportedProviderMethodError.code:throw new t.UnsupportedProviderMethodError(O);case t.ProviderDisconnectedError.code:throw new t.ProviderDisconnectedError(O);case t.ChainDisconnectedError.code:throw new t.ChainDisconnectedError(O);case t.SwitchChainError.code:throw new t.SwitchChainError(O);case t.UnsupportedNonOptionalCapabilityError.code:throw new t.UnsupportedNonOptionalCapabilityError(O);case t.UnsupportedChainIdError.code:throw new t.UnsupportedChainIdError(O);case t.DuplicateIdError.code:throw new t.DuplicateIdError(O);case t.UnknownBundleIdError.code:throw new t.UnknownBundleIdError(O);
44case t.BundleTooLargeError.code:throw new t.BundleTooLargeError(O);case t.AtomicReadyWalletRejectedUpgradeError.code:throw new t.AtomicReadyWalletRejectedUpgradeError(O);case t.AtomicityNotSupportedError.code:throw new t.AtomicityNotSupportedError(O);case 5e3:throw new t.UserRejectedRequestError(O);default:throw A instanceof e.BaseError?A:new t.UnknownRpcError(O)}}},{delay:({count:A,error:O})=>{if(O&&O instanceof r.HttpRequestError){const E=O?.headers?.get("Retry-After");if(E?.match(/\d/))return Number.parseInt(E)*1e3}return~~(1<<A)*b},retryCount:w,shouldRetry:({error:A})=>u(A)}),{enabled:p,id:M})}}function u(c){return"code"in c&&typeof c.code=="number"?c.code===-1||c.code===t.LimitExceededRpcError.code||c.code===t.InternalRpcError.code:c instanceof r.HttpRequestError&&c.status?c.status===403||c.status===408||c.status===413||c.status===429||c.status===500||c.status===502||c.status===503||c.status===504:!0}return Xn}var b0;function To(){if(b0)return fa;b0=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.createTransport=t;const e=Ig(),r=Tg();function t({key:i,methods:o,name:a,request:n,retryCount:s=3,retryDelay:u=150,timeout:c,type:l},d){const f=(0,r.uid)();return{config:{key:i,methods:o,name:a,request:n,retryCount:s,retryDelay:u,timeout:c,type:l},request:(0,e.buildRequest)(n,{methods:o,retryCount:s,retryDelay:u,uid:f}),value:d}}return fa}var h0;function D_(){if(h0)return la;h0=1,Object.defineProperty(la,"__esModule",{value:!0}),la.custom=r;const e=To();function r(t,i={}){const{key:o="custom",methods:a,name:n="Custom Provider",retryDelay:s}=i;return({retryCount:u})=>(0,e.createTransport)({key:o,methods:a,name:n,request:t.request.bind(t),retryCount:i.retryCount??u,retryDelay:s,type:"custom"})}return la}var Kr={},y0;function G_(){if(y0)return Kr;
44y0=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.fallback=o,Kr.shouldThrow=a,Kr.rankTransports=n;const e=Nt(),r=ir(),t=Kd(),i=To();function o(s,u={}){const{key:c="fallback",name:l="Fallback",rank:d=!1,shouldThrow:f=a,retryCount:p,retryDelay:y}=u;return({chain:b,pollingInterval:w=4e3,timeout:B,...x})=>{let M=s,A=()=>{};const O=(0,i.createTransport)({key:c,name:l,async request({method:E,params:_}){let P;const m=async(T=0)=>{const g=M[T]({...x,chain:b,retryCount:0,timeout:B});try{const v=await g.request({method:E,params:_});return A({method:E,params:_,response:v,transport:g,status:"success"}),v}catch(v){if(A({error:v,method:E,params:_,transport:g,status:"error"}),f(v)||T===M.length-1||(P??=M.slice(T+1).some(h=>{const{include:I,exclude:R}=h({chain:b}).config.methods||{};return I?I.includes(E):R?!R.includes(E):!0}),!P))throw v;return m(T+1)}};return m()},retryCount:p,retryDelay:y,type:"fallback"},{onResponse:E=>A=E,transports:M.map(E=>E({chain:b,retryCount:0}))});if(d){const E=typeof d=="object"?d:{};n({chain:b,interval:E.interval??w,onTransports:_=>M=_,ping:E.ping,sampleCount:E.sampleCount,timeout:E.timeout,transports:M,weights:E.weights})}return O}}function a(s){return!!("code"in s&&typeof s.code=="number"&&(s.code===r.TransactionRejectedRpcError.code||s.code===r.UserRejectedRequestError.code||e.ExecutionRevertedError.nodeMessage.test(s.message)||s.code===5e3))}function n({chain:s,interval:u=4e3,onTransports:c,ping:l,sampleCount:d=10,timeout:f=1e3,transports:p,weights:y={}}){const{stability:b=.7,latency:w=.3}=y,B=[],x=async()=>{const M=await Promise.all(p.map(async E=>{const _=E({chain:s,retryCount:0,timeout:f}),P=Date.now();let m,T;try{await(l?l({transport:_}):_.request({method:"net_listening"})),T=1}catch{T=0}finally{m=Date.now()}return{latency:m-P,success:T}}));B.push(M),B.length>d&&B.shift();const A=Math.max(...B.map(E=>Math.max(...E.map(({latency:_})=>_)))),O=p.map((E,_)=>{const P=B.map(h=>h[_].latency),T=1-P.reduce((h,I)=>h+I,0)/P.length/A,g=B.map(h=>h[_].success),v=g.reduce((h,I)=>h+I,0)/g.length;return v===0?[0,_]:[w*T+b*v,_]}).sort((E,_)=>_[0]-E[0]);c(O.map(([,E])=>p[E])),await(0,t.wait)(u),x()};x()}return Kr}var ba={},Qn={},p0;function Xd(){if(p0)return Qn;p0=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.UrlRequiredError=void 0;const e=le();class r extends e.BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}return Qn.UrlRequiredError=r,Qn}var ha={},ya={},g0;function Qd(){if(g0)return ya;g0=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.withTimeout=e;function e(r,{errorInstance:t=new Error("timed out"),timeout:i,signal:o}){return new Promise((a,n)=>{(async()=>{let s;try{const u=new AbortController;i>0&&(s=setTimeout(()=>{o?u.abort():n(t)},i)),a(await r({signal:u?.signal||null}))}catch(u){u?.name==="AbortError"&&n(t),n(u)}finally{clearTimeout(s)}})()})}return ya}var eo={},_0;function Sg(){if(_0)return eo;_0=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.idCache=void 0;function e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}return eo.idCache=e(),eo}var v0;function el(){if(v0)return ha;v0=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.getHttpRpcClient=o;const e=bt(),r=Qd(),t=Fe(),i=Sg();function o(a,n={}){return{async request(s){const{body:u,onRequest:c=n.onRequest,onResponse:l=n.onResponse,timeout:d=n.timeout??1e4}=s,f={...n.fetchOptions??{},...s.fetchOptions??{}},{headers:p,method:y,signal:b}=f;try{const w=await(0,r.withTimeout)(async({signal:x})=>{const M={...f,body:Array.isArray(u)?(0,t.stringify)(u.map(_=>({jsonrpc:"2.0",id:_.id??i.idCache.take(),..._}))):(0,t.stringify)({jsonrpc:"2.0",id:u.id??i.idCache.take(),...u}),headers:{"Content-Type":"application/json",...p},method:y||"POST",signal:b||(d>0?x:null)},A=new Request(a,M),O=await c?.(A,M)??{...M,url:a};return await fetch(O.url??a,O)},{errorInstance:new e.TimeoutError({body:u,url:a}),timeout:d,signal:!0});l&&await l(w);let B;if(w.headers.get("Content-Type")?.startsWith("application/json"))B=await w.json();else{B=await w.text();try{B=JSON.parse(B||"{}")}
44catch(x){if(w.ok)throw x;B={error:B}}}if(!w.ok)throw new e.HttpRequestError({body:u,details:(0,t.stringify)(B.error)||w.statusText,headers:w.headers,status:w.status,url:a});return B}catch(w){throw w instanceof e.HttpRequestError||w instanceof e.TimeoutError?w:new e.HttpRequestError({body:u,cause:w,url:a})}}}}return ha}var E0;function V_(){if(E0)return ba;E0=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.http=a;const e=bt(),r=Xd(),t=Ud(),i=el(),o=To();function a(n,s={}){const{batch:u,fetchOptions:c,key:l="http",methods:d,name:f="HTTP JSON-RPC",onFetchRequest:p,onFetchResponse:y,retryDelay:b,raw:w}=s;return({chain:B,retryCount:x,timeout:M})=>{const{batchSize:A=1e3,wait:O=0}=typeof u=="object"?u:{},E=s.retryCount??x,_=M??s.timeout??1e4,P=n||B?.rpcUrls.default.http[0];if(!P)throw new r.UrlRequiredError;const m=(0,i.getHttpRpcClient)(P,{fetchOptions:c,onRequest:p,onResponse:y,timeout:_});return(0,o.createTransport)({key:l,methods:d,name:f,async request({method:T,params:g}){const v={method:T,params:g},{schedule:h}=(0,t.createBatchScheduler)({id:P,wait:O,shouldSplitBatch(S){return S.length>A},fn:S=>m.request({body:S}),sort:(S,C)=>S.id-C.id}),I=async S=>u?h(S):[await m.request({body:S})],[{error:R,result:j}]=await I(v);if(w)return{error:R,result:j};if(R)throw new e.RpcRequestError({body:v,error:R,url:P});return j},retryCount:E,retryDelay:b,timeout:_,type:"http"},{fetchOptions:c,url:P})}}return ba}var pa={},ga={},_a={},va={},j0;function tl(){if(j0)return va;j0=1,Object.defineProperty(va,"__esModule",{value:!0}),va.isNullUniversalResolverError=i;const e=Zu(),r=le(),t=or();function i(o,a){if(!(o instanceof r.BaseError))return!1;const n=o.walk(s=>s instanceof t.ContractFunctionRevertedError);return n instanceof t.ContractFunctionRevertedError?!!(n.data?.errorName==="ResolverNotFound"||n.data?.errorName==="ResolverWildcardNotSupported"||n.data?.errorName==="ResolverNotContract"||n.data?.errorName==="ResolverError"||n.data?.errorName==="HttpError"||n.reason?.includes("Wildcard on non-extended resolvers is not supported")||a==="reverse"&&n.reason===e.panicReasons[50]):!1}return va}var Ea={},ja={},w0;function Bg(){if(w0)return ja;w0=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.encodedLabelToLabelhash=r;const e=De();function r(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const i=`0x${t.slice(1,65)}`;return(0,e.isHex)(i)?i:null}return ja}var P0;function rl(){if(P0)return Ea;P0=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.namehash=a;const e=ke(),r=we(),t=te(),i=We(),o=Bg();function a(n){let s=new Uint8Array(32).fill(0);if(!n)return(0,t.bytesToHex)(s);const u=n.split(".");for(let c=u.length-1;c>=0;c-=1){const l=(0,o.encodedLabelToLabelhash)(u[c]),d=l?(0,r.toBytes)(l):(0,i.keccak256)((0,r.stringToBytes)(u[c]),"bytes");s=(0,i.keccak256)((0,e.concat)([s,d]),"bytes")}return(0,t.bytesToHex)(s)}return Ea}var wa={},Pa={},A0;function W_(){if(A0)return Pa;A0=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.encodeLabelhash=e;function e(r){return`[${r.slice(2)}]`}return Pa}var Aa={},T0;function Rg(){if(T0)return Aa;T0=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.labelhash=o;const e=we(),r=te(),t=We(),i=Bg();function o(a){const n=new Uint8Array(32).fill(0);return a?(0,i.encodedLabelToLabelhash)(a)||(0,t.keccak256)((0,e.stringToBytes)(a)):(0,r.bytesToHex)(n)}return Aa}var I0;function hc(){if(I0)return wa;I0=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.packetToBytes=i;const e=we(),r=W_(),t=Rg();function i(o){const a=o.replace(/^\.|\.$/gm,"");if(a.length===0)return new Uint8Array(1);const n=new Uint8Array((0,e.stringToBytes)(a).byteLength+2);let s=0;const u=a.split(".");for(let c=0;c<u.length;c++){let l=(0,e.stringToBytes)(u[c]);l.byteLength>255&&(l=(0,e.stringToBytes)((0,r.encodeLabelhash)((0,t.labelhash)(u[c])))),n[s]=l.length,n.set(l,s+1),s+=l.length+1}return n.byteLength!==s+1?n.slice(0,s+1):n}return wa}var S0;function K_(){if(S0)return _a;S0=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.getEnsAddress=f;const e=ur(),r=Dt(),t=tt(),i=cr(),o=Ft(),a=te(),n=tl(),s=Vd(),u=rl(),c=hc(),l=_e(),d=Vt();async function f(p,y){const{blockNumber:b,blockTag:w,coinType:B,name:x,gatewayUrls:M,strict:A}=y,{chain:O}=p,E=(()=>
44{if(y.universalResolverAddress)return y.universalResolverAddress;if(!O)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,i.getChainContractAddress)({blockNumber:b,chain:O,contract:"ensUniversalResolver"})})(),_=O?.ensTlds;if(_&&!_.some(P=>x.endsWith(P)))return null;try{const P=(0,t.encodeFunctionData)({abi:e.addressResolverAbi,functionName:"addr",...B!=null?{args:[(0,u.namehash)(x),BigInt(B)]}:{args:[(0,u.namehash)(x)]}}),m={address:E,abi:e.universalResolverResolveAbi,functionName:"resolve",args:[(0,a.toHex)((0,c.packetToBytes)(x)),P,M??[s.localBatchGatewayUrl]],blockNumber:b,blockTag:w},g=await(0,l.getAction)(p,d.readContract,"readContract")(m);if(g[0]==="0x")return null;const v=(0,r.decodeFunctionResult)({abi:e.addressResolverAbi,args:B!=null?[(0,u.namehash)(x),BigInt(B)]:void 0,functionName:"addr",data:g[0]});return v==="0x"||(0,o.trim)(v)==="0x00"?null:v}catch(P){if(A)throw P;if((0,n.isNullUniversalResolverError)(P,"resolve"))return null;throw P}}return _a}var Ta={},Ia={},ct={},dt={},B0;function Og(){if(B0)return dt;
44B0=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.EnsAvatarUnsupportedNamespaceError=dt.EnsAvatarUriResolutionError=dt.EnsAvatarInvalidNftUriError=dt.EnsAvatarInvalidMetadataError=void 0;const e=le();class r extends e.BaseError{constructor({data:n}){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(n)}`],name:"EnsAvatarInvalidMetadataError"})}}dt.EnsAvatarInvalidMetadataError=r;class t extends e.BaseError{constructor({reason:n}){super(`ENS NFT avatar URI is invalid. ${n}`,{name:"EnsAvatarInvalidNftUriError"})}}dt.EnsAvatarInvalidNftUriError=t;class i extends e.BaseError{constructor({uri:n}){super(`Unable to resolve ENS avatar URI "${n}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}dt.EnsAvatarUriResolutionError=i;class o extends e.BaseError{constructor({namespace:n}){super(`ENS NFT avatar namespace "${n}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}return dt.EnsAvatarUnsupportedNamespaceError=o,dt}var R0;function Z_(){if(R0)return ct;R0=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.isImageUri=n,ct.getGateway=s,ct.resolveAvatarUri=u,ct.getJsonImage=c,ct.getMetadataAvatarUri=l,ct.parseAvatarUri=d,ct.parseNftUri=f,ct.getNftTokenUri=p;const e=Vt(),r=Og(),t=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,i=/^(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,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,o=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,a=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function n(y){try{const b=await fetch(y,{method:"HEAD"});return b.status===200?b.headers.get("content-type")?.startsWith("image/"):!1}catch(b){return typeof b=="object"&&typeof b.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(w=>{const B=new Image;B.onload=()=>{w(!0)},B.onerror=()=>{w(!1)},B.src=y})}}function s(y,b){return y?y.endsWith("/")?y.slice(0,-1):y:b}function u({uri:y,gatewayUrls:b}){const w=o.test(y);if(w)return{uri:y,isOnChain:!0,isEncoded:w};const B=s(b?.ipfs,"https://ipfs.io"),x=s(b?.arweave,"https://arweave.net"),M=y.match(t),{protocol:A,subpath:O,target:E,subtarget:_=""}=M?.groups||{},P=A==="ipns:/"||O==="ipns/",m=A==="ipfs:/"||O==="ipfs/"||i.test(y);if(y.startsWith("http")&&!P&&!m){let g=y;return b?.arweave&&(g=y.replace(/https:\/\/arweave.net/g,b?.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((P||m)&&E)return{uri:`${B}/${P?"ipns":"ipfs"}/${E}${_}`,isOnChain:!1,isEncoded:!1};if(A==="ar:/"&&E)return{uri:`${x}/${E}${_||""}`,isOnChain:!1,isEncoded:!1};let T=y.replace(a,"");if(T.startsWith("<svg")&&(T=`data:image/svg+xml;base64,${btoa(T)}`),T.startsWith("data:")||T.startsWith("{"))return{uri:T,isOnChain:!0,isEncoded:!1};throw new r.EnsAvatarUriResolutionError({uri:y})}function c(y){if(typeof y!="object"||!("image"in y)&&!("image_url"in y)&&!("image_data"in y))throw new r.EnsAvatarInvalidMetadataError({data:y});return y.image||y.image_url||y.image_data}async function l({gatewayUrls:y,uri:b}){try{const w=await fetch(b).then(x=>x.json());return await d({gatewayUrls:y,uri:c(w)})}catch{throw new r.EnsAvatarUriResolutionError({uri:b})}}async function d({gatewayUrls:y,uri:b}){const{uri:w,isOnChain:B}=u({uri:b,gatewayUrls:y});if(B||await n(w))return w;throw new r.EnsAvatarUriResolutionError({uri:b})}function f(y){let b=y;b.startsWith("did:nft:")&&(b=b.replace("did:nft:","").replace(/_/g,"/"));const[w,B,x]=b.split("/"),[M,A]=w.split(":"),[O,E]=B.split(":");if(!M||M.toLowerCase()!=="eip155")throw new r.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!A)throw new r.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!E)throw new r.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!x)throw new r.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!O)throw new r.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(A),namespace:O.toLowerCase(),contractAddress:E,tokenID:x}}async function p(y,{nft:b}){if(b.namespace==="erc721")return(0,e.readContract)(y,{address:b.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}
44],functionName:"tokenURI",args:[BigInt(b.tokenID)]});if(b.namespace==="erc1155")return(0,e.readContract)(y,{address:b.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(b.tokenID)]});throw new r.EnsAvatarUnsupportedNamespaceError({namespace:b.namespace})}return ct}var O0;function J_(){if(O0)return Ia;O0=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.parseAvatarRecord=r;const e=Z_();async function r(i,{gatewayUrls:o,record:a}){return/eip155:/i.test(a)?t(i,{gatewayUrls:o,record:a}):(0,e.parseAvatarUri)({uri:a,gatewayUrls:o})}async function t(i,{gatewayUrls:o,record:a}){const n=(0,e.parseNftUri)(a),s=await(0,e.getNftTokenUri)(i,{nft:n}),{uri:u,isOnChain:c,isEncoded:l}=(0,e.resolveAvatarUri)({uri:s,gatewayUrls:o});if(c&&(u.includes("data:application/json;base64,")||u.startsWith("{"))){const f=l?atob(u.replace("data:application/json;base64,","")):u,p=JSON.parse(f);return(0,e.parseAvatarUri)({uri:(0,e.getJsonImage)(p),gatewayUrls:o})}let d=n.tokenID;return n.namespace==="erc1155"&&(d=d.replace("0x","").padStart(64,"0")),(0,e.getMetadataAvatarUri)({gatewayUrls:o,uri:u.replace(/(?:0x)?{id}/,d)})}return Ia}var Sa={},C0;function Cg(){if(C0)return Sa;C0=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.getEnsText=d;const e=ur(),r=Dt(),t=tt(),i=cr(),o=te(),a=tl(),n=Vd(),s=rl(),u=hc(),c=_e(),l=Vt();async function d(f,p){const{blockNumber:y,blockTag:b,key:w,name:B,gatewayUrls:x,strict:M}=p,{chain:A}=f,O=(()=>{if(p.universalResolverAddress)return p.universalResolverAddress;if(!A)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,i.getChainContractAddress)({blockNumber:y,chain:A,contract:"ensUniversalResolver"})})(),E=A?.ensTlds;if(E&&!E.some(_=>B.endsWith(_)))return null;try{const _={address:O,abi:e.universalResolverResolveAbi,functionName:"resolve",args:[(0,o.toHex)((0,u.packetToBytes)(B)),(0,t.encodeFunctionData)({abi:e.textResolverAbi,functionName:"text",args:[(0,s.namehash)(B),w]}),x??[n.localBatchGatewayUrl]],blockNumber:y,blockTag:b},m=await(0,c.getAction)(f,l.readContract,"readContract")(_);if(m[0]==="0x")return null;const T=(0,r.decodeFunctionResult)({abi:e.textResolverAbi,functionName:"text",data:m[0]});return T===""?null:T}catch(_){if(M)throw _;if((0,a.isNullUniversalResolverError)(_,"resolve"))return null;throw _}}return Sa}var x0;function Y_(){if(x0)return Ta;x0=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.getEnsAvatar=i;const e=J_(),r=_e(),t=Cg();async function i(o,{blockNumber:a,blockTag:n,assetGatewayUrls:s,name:u,gatewayUrls:c,strict:l,universalResolverAddress:d}){const f=await(0,r.getAction)(o,t.getEnsText,"getEnsText")({blockNumber:a,blockTag:n,key:"avatar",name:u,universalResolverAddress:d,gatewayUrls:c,strict:l});if(!f)return null;try{return await(0,e.parseAvatarRecord)(o,{record:f,gatewayUrls:s})}catch{return null}}return Ta}var Ba={},q0;function X_(){if(q0)return Ba;q0=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.getEnsName=s;const e=ur(),r=cr(),t=te(),i=tl(),o=hc(),a=_e(),n=Vt();async function s(u,{address:c,blockNumber:l,blockTag:d,gatewayUrls:f,strict:p,universalResolverAddress:y}){let b=y;if(!b){if(!u.chain)throw new Error("client chain not configured. universalResolverAddress is required.");b=(0,r.getChainContractAddress)({blockNumber:l,chain:u.chain,contract:"ensUniversalResolver"})}const w=`${c.toLowerCase().substring(2)}.addr.reverse`;try{const B={address:b,abi:e.universalResolverReverseAbi,functionName:"reverse",args:[(0,t.toHex)((0,o.packetToBytes)(w))],blockNumber:l,blockTag:d},x=(0,a.getAction)(u,n.readContract,"readContract"),[M,A]=f?await x({...B,args:[...B.args,f]}):await x(B);return c.toLowerCase()!==A.toLowerCase()?null:M}catch(B){if(p)throw B;if((0,i.isNullUniversalResolverError)(B,"reverse"))return null;throw B}}return Ba}var Ra={},M0;function Q_(){if(M0)return Ra;M0=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.getEnsResolver=a;const e=cr(),r=te(),t=hc(),i=_e(),o=Vt();async function a(n,s){const{blockNumber:u,blockTag:c,name:l}=s,{chain:d}=n,f=(()=>
44{if(s.universalResolverAddress)return s.universalResolverAddress;if(!d)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,e.getChainContractAddress)({blockNumber:u,chain:d,contract:"ensUniversalResolver"})})(),p=d?.ensTlds;if(p&&!p.some(b=>l.endsWith(b)))throw new Error(`${l} is not a valid ENS TLD (${p?.join(", ")}) for chain "${d.name}" (id: ${d.id}).`);const[y]=await(0,i.getAction)(n,o.readContract,"readContract")({address:f,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,r.toHex)((0,t.packetToBytes)(l))],blockNumber:u,blockTag:c});return y}return Ra}var Oa={},H0;function xg(){if(H0)return Oa;H0=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.createAccessList=n;const e=xe(),r=te(),t=Nd(),i=an(),o=zt(),a=Ut();async function n(s,u){const{account:c=s.account,blockNumber:l,blockTag:d="latest",blobs:f,data:p,gas:y,gasPrice:b,maxFeePerBlobGas:w,maxFeePerGas:B,maxPriorityFeePerGas:x,to:M,value:A,...O}=u,E=c?(0,e.parseAccount)(c):void 0;try{(0,a.assertRequest)(u);const P=(typeof l=="bigint"?(0,r.numberToHex)(l):void 0)||d,m=s.chain?.formatters?.transactionRequest?.format,g=(m||o.formatTransactionRequest)({...(0,i.extract)(O,{format:m}),from:E?.address,blobs:f,data:p,gas:y,gasPrice:b,maxFeePerBlobGas:w,maxFeePerGas:B,maxPriorityFeePerGas:x,to:M,value:A}),v=await s.request({method:"eth_createAccessList",params:[g,P]});return{accessList:v.accessList,gasUsed:BigInt(v.gasUsed)}}catch(_){throw(0,t.getCallError)(_,{...u,account:E,chain:s.chain})}}return Oa}var Ca={},k0;function ev(){if(k0)return Ca;k0=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.createBlockFilter=r;const e=Ku();async function r(t){const i=(0,e.createFilterRequestScope)(t,{method:"eth_newBlockFilter"}),o=await t.request({method:"eth_newBlockFilter"});return{id:o,request:i(o),type:"block"}}return Ca}var xa={},F0;function qg(){if(F0)return xa;F0=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.createEventFilter=i;const e=Rr(),r=te(),t=Ku();async function i(o,{address:a,args:n,event:s,events:u,fromBlock:c,strict:l,toBlock:d}={}){const f=u??(s?[s]:void 0),p=(0,t.createFilterRequestScope)(o,{method:"eth_newFilter"});let y=[];f&&(y=[f.flatMap(B=>(0,e.encodeEventTopics)({abi:[B],eventName:B.name,args:n}))],s&&(y=y[0]));const b=await o.request({method:"eth_newFilter",params:[{address:a,fromBlock:typeof c=="bigint"?(0,r.numberToHex)(c):c,toBlock:typeof d=="bigint"?(0,r.numberToHex)(d):d,...y.length?{topics:y}:{}}]});return{abi:f,args:n,eventName:s?s.name:void 0,fromBlock:c,id:b,request:p(b),strict:!!l,toBlock:d,type:"event"}}return xa}var qa={},$0;function Mg(){if($0)return qa;$0=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.createPendingTransactionFilter=r;const e=Ku();async function r(t){const i=(0,e.createFilterRequestScope)(t,{method:"eth_newPendingTransactionFilter"}),o=await t.request({method:"eth_newPendingTransactionFilter"});return{id:o,request:i(o),type:"transaction"}}return qa}var Ma={},N0;function tv(){if(N0)return Ma;N0=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.getBlobBaseFee=e;async function e(r){const t=await r.request({method:"eth_blobBaseFee"});return BigInt(t)}return Ma}var Ha={},z0;function rv(){if(z0)return Ha;z0=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.getBlockTransactionCount=t;const e=Ce(),r=te();async function t(i,{blockHash:o,blockNumber:a,blockTag:n="latest"}={}){const s=a!==void 0?(0,r.numberToHex)(a):void 0;let u;return o?u=await i.request({method:"eth_getBlockTransactionCountByHash",params:[o]},{dedupe:!0}):u=await i.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:!!s}),(0,e.hexToNumber)(u)}return Ha}var ka={},U0;function nv(){if(U0)return ka;U0=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.getCode=r;const e=te();async function r(t,{address:i,blockNumber:o,blockTag:a="latest"}){const n=o!==void 0?(0,e.numberToHex)(o):void 0,s=await t.request({method:"eth_getCode",params:[i,n||a]},{dedupe:!!n});if(s!=="0x")return s}return ka}var Fa={},to={},L0;function ov(){if(L0)return to;L0=1,Object.defineProperty(to,"__esModule",{value:!0}),to.Eip712DomainNotFoundError=void 0;const e=le();class r extends e.BaseError{constructor({address:i}){super(`No EIP-712 domain found on contract "${i}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${i}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}return to.Eip712DomainNotFoundError=r,to}var D0;function iv(){if(D0)return Fa;D0=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.getEip712Domain=i;const e=ov(),r=_e(),t=Vt();async function i(a,n){const{address:s,factory:u,factoryData:c}=n;try{const[l,d,f,p,y,b,w]=await(0,r.getAction)(a,t.readContract,"readContract")({abi:o,address:s,functionName:"eip712Domain",factory:u,factoryData:c});return{domain:{name:d,version:f,chainId:Number(p),verifyingContract:y,salt:b},extensions:w,fields:l}}catch(l){const d=l;throw d.name==="ContractFunctionExecutionError"&&d.cause.name==="ContractFunctionZeroDataError"?new e.Eip712DomainNotFoundError({address:s}):d}}const o=[{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 Fa}var $a={},Na={},G0;function av(){if(G0)return Na;G0=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.formatFeeHistory=e;function e(r){return{baseFeePerGas:r.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:r.gasUsedRatio,oldestBlock:BigInt(r.oldestBlock),reward:r.reward?.map(t=>t.map(i=>BigInt(i)))}}return Na}var V0;function sv(){if(V0)return $a;V0=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.getFeeHistory=t;const e=te(),r=av();async function t(i,{blockCount:o,blockNumber:a,blockTag:n="latest",rewardPercentiles:s}){const u=typeof a=="bigint"?(0,e.numberToHex)(a):void 0,c=await i.request({method:"eth_feeHistory",params:[(0,e.numberToHex)(o),u||n,s]},{dedupe:!!u});return(0,r.formatFeeHistory)(c)}return $a}var za={},W0;function uv(){if(W0)return za;W0=1,Object.defineProperty(za,"__esModule",{value:!0}),za.getFilterLogs=t;const e=Eo(),r=Lt();async function t(i,{filter:o}){const a=o.strict??!1,s=(await o.request({method:"eth_getFilterLogs",params:[o.id]})).map(u=>(0,r.formatLog)(u));return o.abi?(0,e.parseEventLogs)({abi:o.abi,logs:s,strict:a}):s}return za}var Ua={},La={},bd={},Da={},K0;function Hg(){if(K0)return Da;K0=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.defineChain=e;function e(r){return{formatters:void 0,fees:void 0,serializers:void 0,...r}}return Da}var Ga={},Z0;function kg(){if(Z0)return Ga;Z0=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.extractChain=e;function e({chains:r,id:t}){return r.find(i=>i.id===t)}return Ga}var Zr={},Va={},hd={},J0;function Fg(){return J0||(J0=1,function(e){Object.defineProperty(e,"__esMo
44dule",{value:!0}),e.socketClientCache=void 0,e.getSocketRpcClient=a;const r=bt(),t=Ud(),i=Qd(),o=Sg();e.socketClientCache=new Map;async function a(n){const{getSocket:s,keepAlive:u=!0,key:c="socket",reconnect:l=!0,url:d}=n,{interval:f=3e4}=typeof u=="object"?u:{},{attempts:p=5,delay:y=2e3}=typeof l=="object"?l:{};let b=e.socketClientCache.get(`${c}:${d}`);if(b)return b;let w=0;const{schedule:B}=(0,t.createBatchScheduler)({id:`${c}:${d}`,fn:async()=>{const A=new Map,O=new Map;let E,_,P;async function m(){const T=await s({onClose(){for(const g of A.values())g.onError?.(new r.SocketClosedError({url:d}));for(const g of O.values())g.onError?.(new r.SocketClosedError({url:d}));l&&w<p?setTimeout(async()=>{w++,await m().catch(console.error)},y):(A.clear(),O.clear())},onError(g){E=g;for(const v of A.values())v.onError?.(E);for(const v of O.values())v.onError?.(E);b?.close(),l&&w<p?setTimeout(async()=>{w++,await m().catch(console.error)},y):(A.clear(),O.clear())},onOpen(){E=void 0,w=0},onResponse(g){const v=g.method==="eth_subscription",h=v?g.params.subscription:g.id,I=v?O:A,R=I.get(h);R&&R.onResponse(g),v||I.delete(h)}});return _=T,u&&(P&&clearInterval(P),P=setInterval(()=>_.ping?.(),f)),T}return await m(),E=void 0,b={close(){P&&clearInterval(P),_.close(),e.socketClientCache.delete(`${c}:${d}`)},get socket(){return _},request({body:T,onError:g,onResponse:v}){E&&g&&g(E);const h=T.id??o.idCache.take(),I=R=>{typeof R.id=="number"&&h!==R.id||(T.method==="eth_subscribe"&&typeof R.result=="string"&&O.set(R.result,{onResponse:I,onError:g}),T.method==="eth_unsubscribe"&&O.delete(T.params?.[0]),v(R))};A.set(h,{onResponse:I,onError:g});try{_.request({body:{jsonrpc:"2.0",id:h,...T}})}catch(R){g?.(R)}},requestAsync({body:T,timeout:g=1e4}){return(0,i.withTimeout)(()=>new Promise((v,h)=>this.request({body:T,onError:h,onResponse:v})),{errorInstance:new r.TimeoutError({body:T,url:d}),timeout:g})},requests:A,subscriptions:O,url:d},e.socketClientCache.set(`${c}:${d}`,b),[b]}}),[x,[M]]=await B();return M}}(hd)),hd}const cv=n_(l_);var Y0;function nl(){if(Y0)return Va;Y0=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.getWebSocketRpcClient=t;const e=bt(),r=Fg();async function t(i,o={}){const{keepAlive:a,reconnect:n}=o;return(0,r.getSocketRpcClient)({async getSocket({onClose:s,onError:u,onOpen:c,onResponse:l}){const d=await Promise.resolve().then(()=>cv).then(w=>w.WebSocket),f=new d(i);function p(){f.removeEventListener("close",p),f.removeEventListener("message",y),f.removeEventListener("error",u),f.removeEventListener("open",c),s()}function y({data:w}){try{const B=JSON.parse(w);l(B)}catch(B){u(B)}}f.addEventListener("close",p),f.addEventListener("message",y),f.addEventListener("error",u),f.addEventListener("open",c),f.readyState===d.CONNECTING&&await new Promise((w,B)=>{f&&(f.onopen=w,f.onerror=B)});const{close:b}=f;return Object.assign(f,{close(){b.bind(f)(),p()},ping(){try{if(f.readyState===f.CLOSED||f.readyState===f.CLOSING)throw new e.WebSocketRequestError({url:f.url,cause:new e.SocketClosedError({url:f.url})});const w={jsonrpc:"2.0",method:"net_version",params:[]};f.send(JSON.stringify(w))}catch(w){u(w)}},request({body:w}){if(f.readyState===f.CLOSED||f.readyState===f.CLOSING)throw new e.WebSocketRequestError({body:w,url:f.url,cause:new e.SocketClosedError({url:f.url})});return f.send(JSON.stringify(w))}})},keepAlive:a,reconnect:n,url:i})}return Va}var X0;function $g(){if(X0)return Zr;X0=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.rpc=void 0,Zr.getSocket=o;const e=el(),r=nl();function t(a,{body:n,onError:s,onResponse:u}){return a.request({body:n,onError:s,onResponse:u}),a}async function i(a,{body:n,timeout:s=1e4}){return a.requestAsync({body:n,timeout:s})}async function o(a){const n=await(0,r.getWebSocketRpcClient)(a);return Object.assign(n.socket,{requests:n.requests,subscriptions:n.subscriptions})}return Zr.rpc={http(a,n){return(0,e.getHttpRpcClient)(a).request(n)},webSocket:t,webSocketAsync:i},Zr}var _r={},Mt={},Q0;function Ng(){if(Q0)return Mt;Q0=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.InvalidStructTypeError=Mt.InvalidPrimaryTypeError=Mt.InvalidDomainError=void 0;
44const e=Fe(),r=le();class t extends r.BaseError{constructor({domain:n}){super(`Invalid domain "${(0,e.stringify)(n)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}Mt.InvalidDomainError=t;class i extends r.BaseError{constructor({primaryType:n,types:s}){super(`Invalid primary type \`${n}\` must be one of \`${JSON.stringify(Object.keys(s))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}Mt.InvalidPrimaryTypeError=i;class o extends r.BaseError{constructor({type:n}){super(`Struct type "${n}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}return Mt.InvalidStructTypeError=o,Mt}var vr={},eh;function Io(){if(eh)return vr;eh=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.hashTypedData=a,vr.hashDomain=n,vr.hashStruct=s,vr.encodeType=l;const e=mt(),r=ke(),t=te(),i=We(),o=yc();function a(p){const{domain:y={},message:b,primaryType:w}=p,B={EIP712Domain:(0,o.getTypesForEIP712Domain)({domain:y}),...p.types};(0,o.validateTypedData)({domain:y,message:b,primaryType:w,types:B});const x=["0x1901"];return y&&x.push(n({domain:y,types:B})),w!=="EIP712Domain"&&x.push(s({data:b,primaryType:w,types:B})),(0,i.keccak256)((0,r.concat)(x))}function n({domain:p,types:y}){return s({data:p,primaryType:"EIP712Domain",types:y})}function s({data:p,primaryType:y,types:b}){const w=u({data:p,primaryType:y,types:b});return(0,i.keccak256)(w)}function u({data:p,primaryType:y,types:b}){const w=[{type:"bytes32"}],B=[c({primaryType:y,types:b})];for(const x of b[y]){const[M,A]=f({types:b,name:x.name,type:x.type,value:p[x.name]});w.push(M),B.push(A)}return(0,e.encodeAbiParameters)(w,B)}function c({primaryType:p,types:y}){const b=(0,t.toHex)(l({primaryType:p,types:y}));return(0,i.keccak256)(b)}function l({primaryType:p,types:y}){let b="";const w=d({primaryType:p,types:y});w.delete(p);const B=[p,...Array.from(w).sort()];for(const x of B)b+=`${x}(${y[x].map(({name:M,type:A})=>`${A} ${M}`).join(",")})`;return b}function d({primaryType:p,types:y},b=new Set){const B=p.match(/^\w*/u)?.[0];if(b.has(B)||y[B]===void 0)return b;b.add(B);for(const x of y[B])d({primaryType:x.type,types:y},b);return b}function f({types:p,name:y,type:b,value:w}){if(p[b]!==void 0)return[{type:"bytes32"},(0,i.keccak256)(u({data:w,primaryType:b,types:p}))];if(b==="bytes")return w=`0x${(w.length%2?"0":"")+w.slice(2)}`,[{type:"bytes32"},(0,i.keccak256)(w)];if(b==="string")return[{type:"bytes32"},(0,i.keccak256)((0,t.toHex)(w))];if(b.lastIndexOf("]")===b.length-1){const B=b.slice(0,b.lastIndexOf("[")),x=w.map(M=>f({name:y,type:B,types:p,value:M}));return[{type:"bytes32"},(0,i.keccak256)((0,e.encodeAbiParameters)(x.map(([M])=>M),x.map(([,M])=>M)))]}return[{type:b},w]}return vr}var th;function yc(){if(th)return _r;th=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.serializeTypedData=c,_r.validateTypedData=l,_r.getTypesForEIP712Domain=d,_r.domainSeparator=f;const e=Ie(),r=ft(),t=Ng(),i=Ke(),o=Ve(),a=te(),n=Wu(),s=Io(),u=Fe();function c(y){const{domain:b,message:w,primaryType:B,types:x}=y,M=(E,_)=>{const P={..._};for(const m of E){const{name:T,type:g}=m;g==="address"&&(P[T]=P[T].toLowerCase())}return P},A=x.EIP712Domain?b?M(x.EIP712Domain,b):{}:{},O=(()=>{if(B!=="EIP712Domain")return M(x[B],w)})();return(0,u.stringify)({domain:A,message:O,primaryType:B,types:x})}function l(y){const{domain:b,message:w,primaryType:B,types:x}=y,M=(A,O)=>{for(const E of A){const{name:_,type:P}=E,m=O[_],T=P.match(n.integerRegex);if(T&&(typeof m=="number"||typeof m=="bigint")){const[h,I,R]=T;(0,a.numberToHex)(m,{signed:I==="int",size:Number.parseInt(R)/8})}if(P==="address"&&typeof m=="string"&&!(0,i.isAddress)(m))throw new r.InvalidAddressError({address:m});const g=P.match(n.bytesRegex);if(g){const[h,I]=g;if(I&&(0,o.size)(m)!==Number.parseInt(I))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(I),givenSize:(0,o.size)(m)})}const v=x[P];v&&(p(P),M(v,m))}};if(x.EIP712Domain&&b){if(typeof b!="object")throw new t.InvalidDomainError({domain:b});M(x.EIP712Domain,b)}
44if(B!=="EIP712Domain")if(x[B])M(x[B],w);else throw new t.InvalidPrimaryTypeError({primaryType:B,types:x})}function d({domain:y}){return[typeof y?.name=="string"&&{name:"name",type:"string"},y?.version&&{name:"version",type:"string"},(typeof y?.chainId=="number"||typeof y?.chainId=="bigint")&&{name:"chainId",type:"uint256"},y?.verifyingContract&&{name:"verifyingContract",type:"address"},y?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function f({domain:y}){return(0,s.hashDomain)({domain:y,types:{EIP712Domain:d({domain:y})}})}function p(y){if(y==="address"||y==="bool"||y==="string"||y.startsWith("bytes")||y.startsWith("uint")||y.startsWith("int"))throw new t.InvalidStructTypeError({type:y})}return _r}var Wa={},rh;function zg(){if(rh)return Wa;rh=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.encodePacked=s;const e=Ie(),r=ft(),t=Ke(),i=ke(),o=rr(),a=te(),n=Wu();function s(c,l){if(c.length!==l.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:c.length,givenLength:l.length});const d=[];for(let f=0;f<c.length;f++){const p=c[f],y=l[f];d.push(u(p,y))}return(0,i.concatHex)(d)}function u(c,l,d=!1){if(c==="address"){const b=l;if(!(0,t.isAddress)(b))throw new r.InvalidAddressError({address:b});return(0,o.pad)(b.toLowerCase(),{size:d?32:null})}if(c==="string")return(0,a.stringToHex)(l);if(c==="bytes")return l;if(c==="bool")return(0,o.pad)((0,a.boolToHex)(l),{size:d?32:1});const f=c.match(n.integerRegex);if(f){const[b,w,B="256"]=f,x=Number.parseInt(B)/8;return(0,a.numberToHex)(l,{size:d?32:x,signed:w==="int"})}const p=c.match(n.bytesRegex);if(p){const[b,w]=p;if(Number.parseInt(w)!==(l.length-2)/2)throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(w),givenSize:(l.length-2)/2});return(0,o.pad)(l,{dir:"right",size:d?32:null})}const y=c.match(n.arrayRegex);if(y&&Array.isArray(l)){const[b,w]=y,B=[];for(let x=0;x<l.length;x++)B.push(u(w,l[x],!0));return B.length===0?"0x":(0,i.concatHex)(B)}throw new e.UnsupportedPackedAbiType(c)}return Wa}var Ka={},ro={},Qt={},nh;function pc(){if(nh)return Qt;nh=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.assertTransactionEIP7702=d,Qt.assertTransactionEIP4844=f,Qt.assertTransactionEIP1559=p,Qt.assertTransactionEIP2930=y,Qt.assertTransactionLegacy=b;const e=dg(),r=Rd(),t=ft(),i=le(),o=lg(),a=jo(),n=Nt(),s=Ke(),u=Ve(),c=ot(),l=Ce();function d(w){const{authorizationList:B}=w;if(B)for(const x of B){const{chainId:M}=x,A=x.address;if(!(0,s.isAddress)(A))throw new t.InvalidAddressError({address:A});if(M<0)throw new a.InvalidChainIdError({chainId:M})}p(w)}function f(w){const{blobVersionedHashes:B}=w;if(B){if(B.length===0)throw new o.EmptyBlobError;for(const x of B){const M=(0,u.size)(x),A=(0,l.hexToNumber)((0,c.slice)(x,0,1));if(M!==32)throw new o.InvalidVersionedHashSizeError({hash:x,size:M});if(A!==e.versionedHashVersionKzg)throw new o.InvalidVersionedHashVersionError({hash:x,version:A})}}p(w)}function p(w){const{chainId:B,maxPriorityFeePerGas:x,maxFeePerGas:M,to:A}=w;if(B<=0)throw new a.InvalidChainIdError({chainId:B});if(A&&!(0,s.isAddress)(A))throw new t.InvalidAddressError({address:A});if(M&&M>r.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:M});if(x&&M&&x>M)throw new n.TipAboveFeeCapError({maxFeePerGas:M,maxPriorityFeePerGas:x})}function y(w){const{chainId:B,maxPriorityFeePerGas:x,gasPrice:M,maxFeePerGas:A,to:O}=w;if(B<=0)throw new a.InvalidChainIdError({chainId:B});if(O&&!(0,s.isAddress)(O))throw new t.InvalidAddressError({address:O});if(x||A)throw new i.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(M&&M>r.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:M})}function b(w){const{chainId:B,maxPriorityFeePerGas:x,gasPrice:M,maxFeePerGas:A,to:O}=w;if(O&&!(0,s.isAddress)(O))throw new t.InvalidAddressError({address:O});if(typeof B<"u"&&B<=0)throw new a.InvalidChainIdError({chainId:B});if(x||A)throw new i.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(M&&M>r.maxUint256)throw new n.FeeCapTooHighError({maxFeePerGas:M})}return Qt}var Za={},oh;function ol(){if(oh)return Za;oh=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.serializeAccessList=i;const e=ft(),r=rt(),t=Ke();function i(o){if(!o||o.length===0)return[];const a=[];for(let n=0;n<o.length;n++){const{address:s,storageKeys:u}=o[n];for(let c=0;c<u.length;c++)if(u[c].length-2!==64)throw new r.InvalidStorageKeySizeError({storageKey:u[c]});if(!(0,t.isAddress)(s,{strict:!1}))throw new e.InvalidAddressError({address:s});a.push([s,u])}return a}return Za}var ih;function gc(){if(ih)return ro;ih=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.serializeTransaction=p,ro.toYParitySignatureArray=M;
44const e=rt(),r=Ug(),t=nc(),i=oc(),o=Md(),a=ic(),n=ke(),s=Ft(),u=te(),c=yo(),l=pc(),d=ac(),f=ol();function p(A,O){const E=(0,d.getTransactionType)(A);return E==="eip1559"?w(A,O):E==="eip2930"?B(A,O):E==="eip4844"?b(A,O):E==="eip7702"?y(A,O):x(A,O)}function y(A,O){const{authorizationList:E,chainId:_,gas:P,nonce:m,to:T,value:g,maxFeePerGas:v,maxPriorityFeePerGas:h,accessList:I,data:R}=A;(0,l.assertTransactionEIP7702)(A);const j=(0,f.serializeAccessList)(I),S=(0,r.serializeAuthorizationList)(E);return(0,n.concatHex)(["0x04",(0,c.toRlp)([(0,u.numberToHex)(_),m?(0,u.numberToHex)(m):"0x",h?(0,u.numberToHex)(h):"0x",v?(0,u.numberToHex)(v):"0x",P?(0,u.numberToHex)(P):"0x",T??"0x",g?(0,u.numberToHex)(g):"0x",R??"0x",j,S,...M(A,O)])])}function b(A,O){const{chainId:E,gas:_,nonce:P,to:m,value:T,maxFeePerBlobGas:g,maxFeePerGas:v,maxPriorityFeePerGas:h,accessList:I,data:R}=A;(0,l.assertTransactionEIP4844)(A);let j=A.blobVersionedHashes,S=A.sidecars;if(A.blobs&&(typeof j>"u"||typeof S>"u")){const N=typeof A.blobs[0]=="string"?A.blobs:A.blobs.map($=>(0,u.bytesToHex)($)),D=A.kzg,W=(0,t.blobsToCommitments)({blobs:N,kzg:D});if(typeof j>"u"&&(j=(0,o.commitmentsToVersionedHashes)({commitments:W})),typeof S>"u"){const $=(0,i.blobsToProofs)({blobs:N,commitments:W,kzg:D});S=(0,a.toBlobSidecars)({blobs:N,commitments:W,proofs:$})}}const C=(0,f.serializeAccessList)(I),H=[(0,u.numberToHex)(E),P?(0,u.numberToHex)(P):"0x",h?(0,u.numberToHex)(h):"0x",v?(0,u.numberToHex)(v):"0x",_?(0,u.numberToHex)(_):"0x",m??"0x",T?(0,u.numberToHex)(T):"0x",R??"0x",C,g?(0,u.numberToHex)(g):"0x",j??[],...M(A,O)],F=[],q=[],k=[];if(S)for(let N=0;N<S.length;N++){const{blob:D,commitment:W,proof:$}=S[N];F.push(D),q.push(W),k.push($)}return(0,n.concatHex)(["0x03",S?(0,c.toRlp)([H,F,q,k]):(0,c.toRlp)(H)])}function w(A,O){const{chainId:E,gas:_,nonce:P,to:m,value:T,maxFeePerGas:g,maxPriorityFeePerGas:v,accessList:h,data:I}=A;(0,l.assertTransactionEIP1559)(A);const R=(0,f.serializeAccessList)(h),j=[(0,u.numberToHex)(E),P?(0,u.numberToHex)(P):"0x",v?(0,u.numberToHex)(v):"0x",g?(0,u.numberToHex)(g):"0x",_?(0,u.numberToHex)(_):"0x",m??"0x",T?(0,u.numberToHex)(T):"0x",I??"0x",R,...M(A,O)];return(0,n.concatHex)(["0x02",(0,c.toRlp)(j)])}function B(A,O){const{chainId:E,gas:_,data:P,nonce:m,to:T,value:g,accessList:v,gasPrice:h}=A;(0,l.assertTransactionEIP2930)(A);const I=(0,f.serializeAccessList)(v),R=[(0,u.numberToHex)(E),m?(0,u.numberToHex)(m):"0x",h?(0,u.numberToHex)(h):"0x",_?(0,u.numberToHex)(_):"0x",T??"0x",g?(0,u.numberToHex)(g):"0x",P??"0x",I,...M(A,O)];return(0,n.concatHex)(["0x01",(0,c.toRlp)(R)])}function x(A,O){const{chainId:E=0,gas:_,data:P,nonce:m,to:T,value:g,gasPrice:v}=A;(0,l.assertTransactionLegacy)(A);let h=[m?(0,u.numberToHex)(m):"0x",v?(0,u.numberToHex)(v):"0x",_?(0,u.numberToHex)(_):"0x",T??"0x",g?(0,u.numberToHex)(g):"0x",P??"0x"];if(O){const I=(()=>{if(O.v>=35n)return(O.v-35n)/2n>0?O.v:27n+(O.v===35n?0n:1n);if(E>0)return BigInt(E*2)+BigInt(35n+O.v-27n);const S=27n+(O.v===27n?0n:1n);if(O.v!==S)throw new e.InvalidLegacyVError({v:O.v});return S})(),R=(0,s.trim)(O.r),j=(0,s.trim)(O.s);h=[...h,(0,u.numberToHex)(I),R==="0x00"?"0x":R,j==="0x00"?"0x":j]}else E>0&&(h=[...h,(0,u.numberToHex)(E),"0x","0x"]);return(0,c.toRlp)(h)}function M(A,O){const E=O??A,{v:_,yParity:P}=E;if(typeof E.r>"u")return[];if(typeof E.s>"u")return[];if(typeof _>"u"&&typeof P>"u")return[];const m=(0,s.trim)(E.r),T=(0,s.trim)(E.s);return[typeof P=="number"?P?(0,u.numberToHex)(1):"0x":_===0n?"0x":_===1n?(0,u.numberToHex)(1):_===27n?"0x":(0,u.numberToHex)(1),m==="0x00"?"0x":m,T==="0x00"?"0x":T]}return ro}var ah;function Ug(){if(ah)return Ka;ah=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.serializeAuthorizationList=t;const e=te(),r=gc();function t(i){if(!i||i.length===0)return[];const o=[];for(const a of i){const{chainId:n,nonce:s,...u}=a,c=a.address;o.push([n?(0,e.toHex)(n):"0x",c,s?(0,e.toHex)(s):"0x",...(0,r.toYParitySignatureArray)({},u)])}return o}return Ka}var Ja={},sh;function dv(){if(sh)return Ja;sh=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.verifyAuthorization=i;const e=et(),r=ht(),t=Qu();async function i({address:o,authorization:a,signature:n}){return(0,r.isAddressEqual)((0,e.getAddress)(o),await(0,t.recoverAuthorizationAddress)({authorization:a,signature:n}))}return Ja}var Jr={},Ya={},uh;function il(){if(uh)return Ya;uh=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.isBytes=e;function e(r){return!r||typeof r!="object"||!("BYTES_PER_ELEMENT"in r)?!1:r.BYTES_PER_ELEMENT===1&&r.constructor.name==="Uint8Array"}return Ya}var ch;function Lg(){if(ch)return Jr;
44ch=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.getContractAddress=u,Jr.getCreateAddress=c,Jr.getCreate2Address=l;const e=ke(),r=il(),t=rr(),i=ot(),o=we(),a=yo(),n=We(),s=et();function u(d){return d.opcode==="CREATE2"?l(d):c(d)}function c(d){const f=(0,o.toBytes)((0,s.getAddress)(d.from));let p=(0,o.toBytes)(d.nonce);return p[0]===0&&(p=new Uint8Array([])),(0,s.getAddress)(`0x${(0,n.keccak256)((0,a.toRlp)([f,p],"bytes")).slice(26)}`)}function l(d){const f=(0,o.toBytes)((0,s.getAddress)(d.from)),p=(0,t.pad)((0,r.isBytes)(d.salt)?d.salt:(0,o.toBytes)(d.salt),{size:32}),y="bytecodeHash"in d?(0,r.isBytes)(d.bytecodeHash)?d.bytecodeHash:(0,o.toBytes)(d.bytecodeHash):(0,n.keccak256)(d.bytecode,"bytes");return(0,s.getAddress)((0,i.slice)((0,n.keccak256)((0,e.concat)([(0,o.toBytes)("0xff"),f,p,y])),12))}return Jr}var Xa={},dh;function al(){if(dh)return Xa;dh=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.fromRlp=a;const e=le(),r=nn(),t=lo(),i=we(),o=te();function a(c,l="hex"){const d=(()=>{if(typeof c=="string"){if(c.length>3&&c.length%2!==0)throw new r.InvalidHexValueError(c);return(0,i.hexToBytes)(c)}return c})(),f=(0,t.createCursor)(d,{recursiveReadLimit:Number.POSITIVE_INFINITY});return n(f,l)}function n(c,l="hex"){if(c.bytes.length===0)return l==="hex"?(0,o.bytesToHex)(c.bytes):c.bytes;const d=c.readByte();if(d<128&&c.decrementPosition(1),d<192){const p=s(c,d,128),y=c.readBytes(p);return l==="hex"?(0,o.bytesToHex)(y):y}const f=s(c,d,192);return u(c,f,l)}function s(c,l,d){if(d===128&&l<128)return 1;if(l<=d+55)return l-d;if(l===d+55+1)return c.readUint8();if(l===d+55+2)return c.readUint16();if(l===d+55+3)return c.readUint24();if(l===d+55+4)return c.readUint32();throw new e.BaseError("Invalid RLP prefix")}function u(c,l,d){const f=c.position,p=[];for(;c.position-f<l;)p.push(n(c,d));return p}return Xa}var yd={},lh;function Dg(){return lh||(lh=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventSignature=void 0;var r=wd();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return r.toSignature}})}(yd)),yd}var pd={},fh;function Gg(){return fh||(fh=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionSignature=void 0;var r=wd();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return r.toSignature}})}(pd)),pd}var gd={},mh;function Vg(){return mh||(mh=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventHash=void 0;var r=Vu();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return r.toSignatureHash}})}(gd)),gd}var _d={},bh;function Wg(){return bh||(bh=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionHash=void 0;var r=Vu();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return r.toSignatureHash}})}(_d)),_d}var Qa={},hh;function sl(){if(hh)return Qa;hh=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.isHash=t;const e=De(),r=Ve();function t(i){return(0,e.isHex)(i)&&(0,r.size)(i)===32}return Qa}var es={},Er={},ze={},yh;function lv(){if(yh)return ze;yh=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.ripemd160=ze.RIPEMD160=ze.md5=ze.MD5=ze.sha1=ze.SHA1=void 0;const e=tg(),r=Ht(),t=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),i=new Uint32Array(80);class o extends e.HashMD{constructor(){super(64,20,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0}get(){const{A:m,B:T,C:g,D:v,E:h}=this;return[m,T,g,v,h]}set(m,T,g,v,h){this.A=m|0,this.B=T|0,this.C=g|0,this.D=v|0,this.E=h|0}process(m,T){for(let j=0;j<16;j++,T+=4)i[j]=m.getUint32(T,!1);for(let j=16;j<80;j++)i[j]=(0,r.rotl)(i[j-3]^i[j-8]^i[j-14]^i[j-16],1);let{A:g,B:v,C:h,D:I,E:R}=this;for(let j=0;j<80;j++){let S,C;j<20?(S=(0,e.Chi)(v,h,I),C=1518500249):j<40?(S=v^h^I,C=1859775393):j<60?(S=(0,e.Maj)(v,h,I),C=2400959708):(S=v^h^I,C=3395469782);const H=(0,r.rotl)(g,5)+S+R+C+i[j]|0;R=I,I=h,h=(0,r.rotl)(v,30),v=g,g=H}g=g+this.A|0,v=v+this.B|0,h=h+this.C|0,I=I+this.D|0,R=R+this.E|0,this.set(g,v,h,I,R)}roundClean(){(0,r.clean)(i)}destroy(){this.set(0,0,0,0,0),(0,r.clean)(this.buffer)}}ze.SHA1=o,ze.sha1=(0,r.createHasher)(()=>new o);const a=Math.pow(2,32),n=Array.from({length:64},(P,m)=>Math.floor(a*Math.abs(Math.sin(m+1)))),s=t.slice(0,4),u=new Uint32Array(16);class c extends e.HashMD{constructor(){super(64,16,8,!0),this.A=s[0]|0,this.B=s[1]|0,this.C=s[2]|0,this.D=s[3]|0}get(){const{A:m,B:T,C:g,D:v}=this;return[m,T,g,v]}set(m,T,g,v){this.A=m|0,this.B=T|0,this.C=g|0,this.D=v|0}process(m,T){for(let R=0;R<16;R++,T+=4)u[R]=m.getUint32(T,!0);let{A:g,B:v,C:h,D:I}=this;for(let R=0;R<64;R++){let j,S,C;R<16?(j=(0,e.Chi)(v,h,I),S=R,C=[7,12,17,22]):R<32?(j=(0,e.Chi)(I,v,h),S=(5*R+1)%16,C=[5,9,14,20]):R<48?(j=v^h^I,S=(3*R+5)%16,C=[4,11,16,23]):(j=h^(v|~I),S=7*R%16,C=[6,10,15,21]),j=j+g+n[R]+u[S],g=I,I=h,h=v,v=v+(0,r.rotl)(j,C[R%4])}g=g+this.A|0,v=v+this.B|0,h=h+this.C|0,I=I+this.D|0,this.set(g,v,h,I)}roundClean(){(0,r.clean)(u)}destroy(){this.set(0,0,0,0),(0,r.clean)(this.buffer)}}ze.MD5=c,ze.md5=(0,r.createHasher)(()=>new c);const l=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),d=Uint8Array.from(new Array(16).fill(0).map((P,m)=>m)),f=d.map(P=>(9*P+5)%16),p=(()=>{const T=[[d],[f]];for(let g=0;g<4;g++)for(let v of T)v.push(v[g].map(h=>l[h]));return T})(),y=p[0],b=p[1],w=[[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(P=>Uint8Array.from(P)),B=y.map((P,m)=>P.map(T=>w[m][T])),x=b.map((P,m)=>P.map(T=>w[m][T])),M=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),A=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function O(P,m,T,g){return P===0?m^T^g:P===1?m&T|~m&g:P===2?(m|~T)^g:P===3?m&g|T&~g:m^(T|~g)}const E=new Uint32Array(16);class _ 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:m,h1:T,h2:g,h3:v,h4:h}=this;return[m,T,g,v,h]}set(m,T,g,v,h){this.h0=m|0,this.h1=T|0,this.h2=g|0,this.h3=v|0,this.h4=h|0}process(m,T){for(let q=0;q<16;q++,T+=4)E[q]=m.getUint32(T,!0);let g=this.h0|0,v=g,h=this.h1|0,I=h,R=this.h2|0,j=R,S=this.h3|0,C=S,H=this.h4|0,F=H;for(let q=0;q<5;q++){const k=4-q,N=M[q],D=A[q],W=y[q],$=b[q],V=B[q],J=x[q];for(let X=0;X<16;X++){const K=(0,r.rotl)(g+O(q,h,R,S)+E[W[X]]+N,V[X])+H|0;g=H,H=S,S=(0,r.rotl)(R,10)|0,R=h,h=K}for(let X=0;X<16;X++){const K=(0,r.rotl)(v+O(k,I,j,C)+E[$[X]]+D,J[X])+F|0;v=F,F=C,C=(0,r.rotl)(j,10)|0,j=I,I=K}}this.set(this.h1+R+C|0,this.h2+S+F|0,this.h3+H+v|0,this.h4+g+I|0,this.h0+h+j|0)}roundClean(){(0,r.clean)(E)}destroy(){this.destroyed=!0,(0,r.clean)(this.buffer),this.set(0,0,0,0,0)}}return ze.RIPEMD160=_,ze.ripemd160=(0,r.createHasher)(()=>new _),ze}var ph;function Kg(){if(ph)return Er;
44ph=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.ripemd160=Er.RIPEMD160=void 0;const e=lv();return Er.RIPEMD160=e.RIPEMD160,Er.ripemd160=e.ripemd160,Er}var gh;function Zg(){if(gh)return es;gh=1,Object.defineProperty(es,"__esModule",{value:!0}),es.ripemd160=o;const e=Kg(),r=De(),t=we(),i=te();function o(a,n){const s=n||"hex",u=(0,e.ripemd160)((0,r.isHex)(a,{strict:!1})?(0,t.toBytes)(a):a);return s==="bytes"?u:(0,i.toHex)(u)}return es}var ts={},rs={},ns={},no={},_h;function Jg(){return _h||(_h=1,Object.defineProperty(no,"__esModule",{value:!0}),no.presignMessagePrefix=void 0,no.presignMessagePrefix=`�Ethereum Signed Message: 45`),no}var vh;function Yg(){if(vh)return ns;vh=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.toPrefixedMessage=o;const e=Jg(),r=ke(),t=Ve(),i=te();function o(a){const n=typeof a=="string"?(0,i.stringToHex)(a):typeof a.raw=="string"?a.raw:(0,i.bytesToHex)(a.raw),s=(0,i.stringToHex)(`${e.presignMessagePrefix}${(0,t.size)(n)}`);return(0,r.concat)([s,n])}return ns}var Eh;function So(){if(Eh)return rs;Eh=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.hashMessage=t;const e=We(),r=Yg();function t(i,o){return(0,e.keccak256)((0,r.toPrefixedMessage)(i),o)}return rs}var jh;function ul(){if(jh)return ts;jh=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.recoverMessageAddress=t;const e=So(),r=sr();async function t({message:i,signature:o}){return(0,r.recoverAddress)({hash:(0,e.hashMessage)(i),signature:o})}return ts}var os={},wh;function cl(){if(wh)return os;wh=1,Object.defineProperty(os,"__esModule",{value:!0}),os.recoverTypedDataAddress=t;const e=Io(),r=sr();async function t(i){const{domain:o,message:a,primaryType:n,signature:s,types:u}=i;return(0,r.recoverAddress)({hash:(0,e.hashTypedData)({domain:o,message:a,primaryType:n,types:u}),signature:s})}return os}var is={},Ph;function Xg(){if(Ph)return is;Ph=1,Object.defineProperty(is,"__esModule",{value:!0}),is.verifyHash=i;const e=et(),r=ht(),t=sr();async function i({address:o,hash:a,signature:n}){return(0,r.isAddressEqual)((0,e.getAddress)(o),await(0,t.recoverAddress)({hash:a,signature:n}))}return is}var as={},Ah;function Qg(){if(Ah)return as;Ah=1,Object.defineProperty(as,"__esModule",{value:!0}),as.verifyMessage=i;const e=et(),r=ht(),t=ul();async function i({address:o,message:a,signature:n}){return(0,r.isAddressEqual)((0,e.getAddress)(o),await(0,t.recoverMessageAddress)({message:a,signature:n}))}return as}var ss={},Th;function e1(){if(Th)return ss;Th=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.verifyTypedData=i;const e=et(),r=ht(),t=cl();async function i(o){const{address:a,domain:n,message:s,primaryType:u,signature:c,types:l}=o;return(0,r.isAddressEqual)((0,e.getAddress)(a),await(0,t.recoverTypedDataAddress)({domain:n,message:s,primaryType:u,signature:c,types:l}))}return ss}var us={},cs={},jr={},Ih;function dl(){return Ih||(Ih=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.zeroHash=jr.erc6492MagicBytes=void 0,jr.erc6492MagicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",jr.zeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),jr}var Sh;function _c(){if(Sh)return cs;Sh=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.isErc6492Signature=t;const e=dl(),r=ot();function t(i){return(0,r.sliceHex)(i,-32)===e.erc6492MagicBytes}return cs}var Bh;function t1(){if(Bh)return us;Bh=1,Object.defineProperty(us,"__esModule",{value:!0}),us.parseErc6492Signature=t;const e=nr(),r=_c();function t(i){if(!(0,r.isErc6492Signature)(i))return{signature:i};const[o,a,n]=(0,e.decodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],i);return{address:o,data:a,signature:n}}return us}var ds={},Rh;function ll(){if(Rh)return ds;Rh=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.serializeErc6492Signature=o;const e=dl(),r=mt(),t=ke(),i=we();function o(a){const{address:n,data:s,signature:u,to:c="hex"}=a,l=(0,t.concatHex)([(0,r.encodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],[n,s,u]),e.erc6492MagicBytes]);return c==="hex"?l:(0,i.hexToBytes)(l)}return ds}var ls={},Oh;function fl(){if(Oh)return ls;Oh=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.getSerializedTransactionType=i;const e=rt(),r=ot(),t=Ce();function i(o){const a=(0,r.sliceHex)(o,0,1);if(a==="0x04")return"eip7702";if(a==="0x03")return"eip4844";if(a==="0x02")return"eip1559";if(a==="0x01")return"eip2930";if(a!=="0x"&&(0,t.hexToNumber)(a)>=192)return"legacy";throw new e.InvalidSerializedTransactionTypeError({serializedType:a})}return ls}var Yr={},Ch;function ml(){if(Ch)return Yr;
45Ch=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.parseTransaction=f,Yr.toTransactionArray=x,Yr.parseAccessList=M;const e=ft(),r=rt(),t=Ke(),i=ic(),o=De(),a=rr(),n=Ft(),s=Ce(),u=al(),c=sl(),l=pc(),d=fl();function f(E){const _=(0,d.getSerializedTransactionType)(E);return _==="eip1559"?b(E):_==="eip2930"?w(E):_==="eip4844"?y(E):_==="eip7702"?p(E):B(E)}function p(E){const _=x(E),[P,m,T,g,v,h,I,R,j,S,C,H,F]=_;if(_.length!==10&&_.length!==13)throw new r.InvalidSerializedTransactionError({attributes:{chainId:P,nonce:m,maxPriorityFeePerGas:T,maxFeePerGas:g,gas:v,to:h,value:I,data:R,accessList:j,authorizationList:S,..._.length>9?{v:C,r:H,s:F}:{}},serializedTransaction:E,type:"eip7702"});const q={chainId:(0,s.hexToNumber)(P),type:"eip7702"};return(0,o.isHex)(h)&&h!=="0x"&&(q.to=h),(0,o.isHex)(v)&&v!=="0x"&&(q.gas=(0,s.hexToBigInt)(v)),(0,o.isHex)(R)&&R!=="0x"&&(q.data=R),(0,o.isHex)(m)&&(q.nonce=m==="0x"?0:(0,s.hexToNumber)(m)),(0,o.isHex)(I)&&I!=="0x"&&(q.value=(0,s.hexToBigInt)(I)),(0,o.isHex)(g)&&g!=="0x"&&(q.maxFeePerGas=(0,s.hexToBigInt)(g)),(0,o.isHex)(T)&&T!=="0x"&&(q.maxPriorityFeePerGas=(0,s.hexToBigInt)(T)),j.length!==0&&j!=="0x"&&(q.accessList=M(j)),S.length!==0&&S!=="0x"&&(q.authorizationList=A(S)),(0,l.assertTransactionEIP7702)(q),{..._.length===13?O(_):void 0,...q}}function y(E){const _=x(E),P=_.length===4,m=P?_[0]:_,T=P?_.slice(1):[],[g,v,h,I,R,j,S,C,H,F,q,k,N,D]=m,[W,$,V]=T;if(!(m.length===11||m.length===14))throw new r.InvalidSerializedTransactionError({attributes:{chainId:g,nonce:v,maxPriorityFeePerGas:h,maxFeePerGas:I,gas:R,to:j,value:S,data:C,accessList:H,...m.length>9?{v:k,r:N,s:D}:{}},serializedTransaction:E,type:"eip4844"});const J={blobVersionedHashes:q,chainId:(0,s.hexToNumber)(g),type:"eip4844"};return(0,o.isHex)(j)&&j!=="0x"&&(J.to=j),(0,o.isHex)(R)&&R!=="0x"&&(J.gas=(0,s.hexToBigInt)(R)),(0,o.isHex)(C)&&C!=="0x"&&(J.data=C),(0,o.isHex)(v)&&(J.nonce=v==="0x"?0:(0,s.hexToNumber)(v)),(0,o.isHex)(S)&&S!=="0x"&&(J.value=(0,s.hexToBigInt)(S)),(0,o.isHex)(F)&&F!=="0x"&&(J.maxFeePerBlobGas=(0,s.hexToBigInt)(F)),(0,o.isHex)(I)&&I!=="0x"&&(J.maxFeePerGas=(0,s.hexToBigInt)(I)),(0,o.isHex)(h)&&h!=="0x"&&(J.maxPriorityFeePerGas=(0,s.hexToBigInt)(h)),H.length!==0&&H!=="0x"&&(J.accessList=M(H)),W&&$&&V&&(J.sidecars=(0,i.toBlobSidecars)({blobs:W,commitments:$,proofs:V})),(0,l.assertTransactionEIP4844)(J),{...m.length===14?O(m):void 0,...J}}function b(E){const _=x(E),[P,m,T,g,v,h,I,R,j,S,C,H]=_;if(!(_.length===9||_.length===12))throw new r.InvalidSerializedTransactionError({attributes:{chainId:P,nonce:m,maxPriorityFeePerGas:T,maxFeePerGas:g,gas:v,to:h,value:I,data:R,accessList:j,..._.length>9?{v:S,r:C,s:H}:{}},serializedTransaction:E,type:"eip1559"});const F={chainId:(0,s.hexToNumber)(P),type:"eip1559"};return(0,o.isHex)(h)&&h!=="0x"&&(F.to=h),(0,o.isHex)(v)&&v!=="0x"&&(F.gas=(0,s.hexToBigInt)(v)),(0,o.isHex)(R)&&R!=="0x"&&(F.data=R),(0,o.isHex)(m)&&(F.nonce=m==="0x"?0:(0,s.hexToNumber)(m)),(0,o.isHex)(I)&&I!=="0x"&&(F.value=(0,s.hexToBigInt)(I)),(0,o.isHex)(g)&&g!=="0x"&&(F.maxFeePerGas=(0,s.hexToBigInt)(g)),(0,o.isHex)(T)&&T!=="0x"&&(F.maxPriorityFeePerGas=(0,s.hexToBigInt)(T)),j.length!==0&&j!=="0x"&&(F.accessList=M(j)),(0,l.assertTransactionEIP1559)(F),{..._.length===12?O(_):void 0,...F}}function w(E){const _=x(E),[P,m,T,g,v,h,I,R,j,S,C]=_;if(!(_.length===8||_.length===11))throw new r.InvalidSerializedTransactionError({attributes:{chainId:P,nonce:m,gasPrice:T,gas:g,to:v,value:h,data:I,accessList:R,..._.length>8?{v:j,r:S,s:C}:{}},serializedTransaction:E,type:"eip2930"});const H={chainId:(0,s.hexToNumber)(P),type:"eip2930"};return(0,o.isHex)(v)&&v!=="0x"&&(H.to=v),(0,o.isHex)(g)&&g!=="0x"&&(H.gas=(0,s.hexToBigInt)(g)),(0,o.isHex)(I)&&I!=="0x"&&(H.data=I),(0,o.isHex)(m)&&(H.nonce=m==="0x"?0:(0,s.hexToNumber)(m)),(0,o.isHex)(h)&&h!=="0x"&&(H.value=(0,s.hexToBigInt)(h)),(0,o.isHex)(T)&&T!=="0x"&&(H.gasPrice=(0,s.hexToBigInt)(T)),R.length!==0&&R!=="0x"&&(H.accessList=M(R)),(0,l.assertTransactionEIP2930)(H),{..._.length===11?O(_):void 0,...H}}function B(E){const _=(0,u.fromRlp)(E,"hex"),[P,m,T,g,v,h,I,R,j]=_;if(!(_.length===6||_.length===9))throw new r.InvalidSerializedTransactionError({attributes:{nonce:P,gasPrice:m,gas:T,to:g,value:v,data:h,..._.length>6?{v:I,r:R,s:j}:{}},serializedTransaction:E,type:"legacy"});const S={type:"legacy"};
45if((0,o.isHex)(g)&&g!=="0x"&&(S.to=g),(0,o.isHex)(T)&&T!=="0x"&&(S.gas=(0,s.hexToBigInt)(T)),(0,o.isHex)(h)&&h!=="0x"&&(S.data=h),(0,o.isHex)(P)&&(S.nonce=P==="0x"?0:(0,s.hexToNumber)(P)),(0,o.isHex)(v)&&v!=="0x"&&(S.value=(0,s.hexToBigInt)(v)),(0,o.isHex)(m)&&m!=="0x"&&(S.gasPrice=(0,s.hexToBigInt)(m)),(0,l.assertTransactionLegacy)(S),_.length===6)return S;const C=(0,o.isHex)(I)&&I!=="0x"?(0,s.hexToBigInt)(I):0n;if(j==="0x"&&R==="0x")return C>0&&(S.chainId=Number(C)),S;const H=C,F=Number((H-35n)/2n);if(F>0)S.chainId=F;else if(H!==27n&&H!==28n)throw new r.InvalidLegacyVError({v:H});return S.v=H,S.s=j,S.r=R,S.yParity=H%2n===0n?1:0,S}function x(E){return(0,u.fromRlp)(`0x${E.slice(4)}`,"hex")}function M(E){const _=[];for(let P=0;P<E.length;P++){const[m,T]=E[P];if(!(0,t.isAddress)(m,{strict:!1}))throw new e.InvalidAddressError({address:m});_.push({address:m,storageKeys:T.map(g=>(0,c.isHash)(g)?g:(0,n.trim)(g))})}return _}function A(E){const _=[];for(let P=0;P<E.length;P++){const[m,T,g,v,h,I]=E[P];_.push({address:T,chainId:(0,s.hexToNumber)(m),nonce:(0,s.hexToNumber)(g),...O([v,h,I])})}return _}function O(E){const _=E.slice(-3),P=_[0]==="0x"||(0,s.hexToBigInt)(_[0])===0n?27n:28n;return{r:(0,a.padHex)(_[1],{size:32}),s:(0,a.padHex)(_[2],{size:32}),v:P,yParity:P===27n?0:1}}return Yr}var fs={},oo={},xh;function r1(){if(xh)return oo;xh=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.InvalidDecimalNumberError=void 0;const e=le();class r extends e.BaseError{constructor({value:i}){super(`Number \`${i}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}return oo.InvalidDecimalNumberError=r,oo}var qh;function vc(){if(qh)return fs;qh=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.parseUnits=r;const e=r1();function r(t,i){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new e.InvalidDecimalNumberError({value:t});let[o,a="0"]=t.split(".");const n=o.startsWith("-");if(n&&(o=o.slice(1)),a=a.replace(/(0+)$/,""),i===0)Math.round(+`.${a}`)===1&&(o=`${BigInt(o)+1n}`),a="";else if(a.length>i){const[s,u,c]=[a.slice(0,i-1),a.slice(i-1,i),a.slice(i)],l=Math.round(+`${u}.${c}`);l>9?a=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):a=`${s}${l}`,a.length>i&&(a=a.slice(1),o=`${BigInt(o)+1n}`),a=a.slice(0,i)}else a=a.padEnd(i,"0");return BigInt(`${n?"-":""}${o}${a}`)}return fs}var ms={},Mh;function n1(){if(Mh)return ms;Mh=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.parseEther=t;const e=fo(),r=vc();function t(i,o="wei"){return(0,r.parseUnits)(i,e.etherUnits[o])}return ms}var bs={},Hh;function o1(){if(Hh)return bs;Hh=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.parseGwei=t;const e=fo(),r=vc();function t(i,o="wei"){return(0,r.parseUnits)(i,e.gweiUnits[o])}return bs}var wr={},kh;function i1(){if(kh)return wr;kh=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.nonceManager=void 0,wr.createNonceManager=t,wr.jsonRpc=i;const e=rc(),r=co();function t(o){const{source:a}=o,n=new Map,s=new r.LruMap(8192),u=new Map,c=({address:l,chainId:d})=>`${l}.${d}`;return{async consume({address:l,chainId:d,client:f}){const p=c({address:l,chainId:d}),y=this.get({address:l,chainId:d,client:f});this.increment({address:l,chainId:d});const b=await y;return await a.set({address:l,chainId:d},b),s.set(p,b),b},async increment({address:l,chainId:d}){const f=c({address:l,chainId:d}),p=n.get(f)??0;n.set(f,p+1)},async get({address:l,chainId:d,client:f}){const p=c({address:l,chainId:d});let y=u.get(p);return y||(y=(async()=>{try{const w=await a.get({address:l,chainId:d,client:f}),B=s.get(p)??0;return B>0&&w<=B?B+1:(s.delete(p),w)}finally{this.reset({address:l,chainId:d})}})(),u.set(p,y)),(n.get(p)??0)+await y},reset({address:l,chainId:d}){const f=c({address:l,chainId:d});n.delete(f),u.delete(f)}}}function i(){return{async get(o){const{address:a,client:n}=o;return(0,e.getTransactionCount)(n,{address:a,blockTag:"pending"})},set(){}}}return wr.nonceManager=t({source:i()}),wr}var Fh;function bl(){return Fh||(Fh=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getContractAddress=e.publicKeyToAddress=e.parseAccount=e.verifyAuthorization=e.serializeAuthorizationList=e.recoverAuthorizationAddress=e.hashAuthorization=e.formatAbiParams=e.formatAbiItem=e.formatAbiItemWithArgs=e.encodePacked=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.getAbiItem=e.parseEventLogs=e.encodeFunctionResult=e.encodeFunctionData=e.encodeEventTopics=e.encodeErrorResult=e.encodeDeployData=e.encodeAbiParameters=e.decodeFunctionResult=e.decodeFunctionData=e.decodeEventLog=e.decodeErrorResult=e.decodeAbiParameters=e.validateTypedData=e.serializeTypedData=e.stringify=e.getWebSocketRpcClient=e.socketClientCache=e.getSocketRpcClient=e.getHttpRpcClient=e.rpc=e.getSocket=e.integerRegex=e.bytesRegex=e.arrayRegex=e.getChainContractAddress=e.extractChain=e.defineChain=e.assertCurrentChain=e.offchainLookupSignature=e.offchainLookupAbiItem=e.offchainLookup=e.ccipFetch=e.ccipRequest=e.buildRequest=void 0,e.hexToString=e.hexToNumber=e.hexToBigInt=e.hexToBool=e.fromHex=e.fromBytes=e.bytesToString=e.bytesToNumber=e.bytesToBool=e.bytesToBigint=e.bytesToBigInt=e.stringToHex=e.numberToHex=e.toHex=e.bytesToHex=e.boolToHex=e.stringToBytes=e.numberToBytes=e.hexToBytes=e.toBytes=e.boolToBytes=e.toRlp=e.extract=e.formatTransactionRequest=e.defineTransactionRequest=e.defineTransactionReceipt=e.formatLog=e.transactionType=e.formatTransaction=e.defineTransaction=e.formatBlock=e.defineBlock=e.trim=e.sliceHex=e.sliceBytes=e.slice=e.size=e.padHex=e.padBytes=e.pad=e.isHex=e.isBytes=e.concatHex=e.concatBytes=e.concat=e.isAddressEqual=e.isAddress=e.getAddress=e.getCreate2Address=e.getCreateAddress=void 0,e.parseEther=e.parseUnits=e.formatUnits=e.formatGwei=e.formatEther=e.serializeAccessList=e.serializeTransaction=e.parseTransaction=e.assertTransactionLegacy=e.assertTransactionEIP2930=e.assertTransactionEIP1559=e.assertRequest=e.getTransactionType=e.getSerializedTransactionType=e.serializeErc6492Signature=e.isErc6492Signature=e.parseErc6492Signature=e.hashMessage=e.verifyTypedData=e.verifyMessage=e.verifyHash=e.recoverTypedDataAddress=e.recoverPublicKey=e.recoverMessageAddress=e.recoverAddress=e.hashTypedData=e.hashStruct=e.ripemd160=e.sha256=e.keccak256=e.isHash=e.toFunctionHash=e.toEventHash=e.getFunctionSignature=e.toFunctionSignature=e.getEventSignature=e.toEventSignature=e.getFunctionSelector=e.toFunctionSelector=e.getEventSelector=e.toEventSelector=e.defineFormatter=e.getAction=e.getTransactionError=e.getEstimateGasError=e.getContractError=e.getCallError=e.getNodeError=e.containsNodeError=e.fromRlp=void 0,e.nonceManager=e.createNonceManager=e.parseGwei=void 0;var r=Ig();Object.defineProperty(e,"buildRequest",{enumerable:!0,get:function(){return r.buildRequest}});var t=Wd();Object.defineProperty(e,"ccipRequest",{enumerable:!0,get:function(){return t.ccipRequest}}),Object.defineProperty(e,"ccipFetch",{enumerable:!0,get:function(){return t.ccipRequest}}),Object.defineProperty(e,"offchainLookup",{enumerable:!0,get:function(){return t.offchainLookup}}),Object.defineProperty(e,"offchainLookupAbiItem",{enumerable:!0,get:function(){return t.offchainLookupAbiItem}}),Object.defineProperty(e,"offchainLookupSignature",{enumerable:!0,get:function(){return t.offchainLookupSignature}});var i=lc();Object.defineProperty(e,"assertCurrentChain",{enumerable:!0,get:function(){return i.assertCurrentChain}});var o=Hg();Object.defineProperty(e,"defineChain",{enumerable:!0,get:function(){return o.defineChain}});var a=kg();Object.defineProperty(e,"extractChain",{enumerable:!0,get:function(){return a.extractChain}});var n=cr();Object.defineProperty(e,"getChainContractAddress",{enumerable:!0,get:function(){return n.getChainContractAddress}});var s=Wu();Object.defineProperty(e,"arrayRegex",{enumerable:!0,get:function(){return s.arrayRegex}}),Object.defineProperty(e,"bytesRegex",{enumerable:!0,get:function(){return s.bytesRegex}}),Object.defineProperty(e,"integerRegex",{enumerable:!0,get:function(){return s.integerRegex}});var u=$g();Object.defineProperty(e,"getSocket",{enumerable:!0,get:function(){return u.getSocket}}),Object.defineProperty(e,"rpc",{enumerable:!0,get:function(){return u.rpc}});var c=el();Object.defineProperty(e,"getHttpRpcClient",{enumerable:!0,get:function(){return c.getHttpRpcClient}});var l=Fg();Object.defineProperty(e,"getSocketRpcClient",{enumerable:!0,get:function(){return l.getSocketRpcClient}}),Object.defineProperty(e,"socketClientCache",{enumerable:!0,get:function(){return l.socketClientCache}});var d=nl();Object.defineProperty(e,"getWebSocketRpcClient",{enumerable:!0,get:function(){return d.getWebSocketRpcClient}});var f=Fe();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}});var p=yc();Object.defineProperty(e,"serializeTypedData",{enumerable:!0,get:function(){return p.serializeTypedData}
45}),Object.defineProperty(e,"validateTypedData",{enumerable:!0,get:function(){return p.validateTypedData}});var y=nr();Object.defineProperty(e,"decodeAbiParameters",{enumerable:!0,get:function(){return y.decodeAbiParameters}});var b=Ju();Object.defineProperty(e,"decodeErrorResult",{enumerable:!0,get:function(){return b.decodeErrorResult}});var w=vo();Object.defineProperty(e,"decodeEventLog",{enumerable:!0,get:function(){return w.decodeEventLog}});var B=Ld();Object.defineProperty(e,"decodeFunctionData",{enumerable:!0,get:function(){return B.decodeFunctionData}});var x=Dt();Object.defineProperty(e,"decodeFunctionResult",{enumerable:!0,get:function(){return x.decodeFunctionResult}});var M=mt();Object.defineProperty(e,"encodeAbiParameters",{enumerable:!0,get:function(){return M.encodeAbiParameters}});var A=wo();Object.defineProperty(e,"encodeDeployData",{enumerable:!0,get:function(){return A.encodeDeployData}});var O=Dd();Object.defineProperty(e,"encodeErrorResult",{enumerable:!0,get:function(){return O.encodeErrorResult}});var E=Rr();Object.defineProperty(e,"encodeEventTopics",{enumerable:!0,get:function(){return E.encodeEventTopics}});var _=tt();Object.defineProperty(e,"encodeFunctionData",{enumerable:!0,get:function(){return _.encodeFunctionData}});var P=Gd();Object.defineProperty(e,"encodeFunctionResult",{enumerable:!0,get:function(){return P.encodeFunctionResult}});var m=Eo();Object.defineProperty(e,"parseEventLogs",{enumerable:!0,get:function(){return m.parseEventLogs}});var T=$t();Object.defineProperty(e,"getAbiItem",{enumerable:!0,get:function(){return T.getAbiItem}});var g=tr();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return g.parseAbi}}),Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return g.parseAbiItem}}),Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return g.parseAbiParameter}}),Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return g.parseAbiParameters}});var v=zg();Object.defineProperty(e,"encodePacked",{enumerable:!0,get:function(){return v.encodePacked}});var h=Qp();Object.defineProperty(e,"formatAbiItemWithArgs",{enumerable:!0,get:function(){return h.formatAbiItemWithArgs}});var I=kt();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return I.formatAbiItem}}),Object.defineProperty(e,"formatAbiParams",{enumerable:!0,get:function(){return I.formatAbiParams}});var R=og();Object.defineProperty(e,"hashAuthorization",{enumerable:!0,get:function(){return R.hashAuthorization}});var j=Qu();Object.defineProperty(e,"recoverAuthorizationAddress",{enumerable:!0,get:function(){return j.recoverAuthorizationAddress}});var S=Ug();Object.defineProperty(e,"serializeAuthorizationList",{enumerable:!0,get:function(){return S.serializeAuthorizationList}});var C=dv();Object.defineProperty(e,"verifyAuthorization",{enumerable:!0,get:function(){return C.verifyAuthorization}});var H=xe();Object.defineProperty(e,"parseAccount",{enumerable:!0,get:function(){return H.parseAccount}});var F=eg();Object.defineProperty(e,"publicKeyToAddress",{enumerable:!0,get:function(){return F.publicKeyToAddress}});var q=Lg();Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return q.getContractAddress}}),Object.defineProperty(e,"getCreateAddress",{enumerable:!0,get:function(){return q.getCreateAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return q.getCreate2Address}});var k=et();Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return k.getAddress}});var N=Ke();Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return N.isAddress}});var D=ht();Object.defineProperty(e,"isAddressEqual",{enumerable:!0,get:function(){return D.isAddressEqual}});var W=ke();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return W.concat}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return W.concatBytes}}),Object.defineProperty(e,"concatHex",{enumerable:!0,get:function(){return W.concatHex}});var $=il();Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return $.isBytes}});var V=De();Object.defineProperty(e,"isHex",{enumerable:!0,get:function(){return V.isHex}});var J=rr();Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return J.pad}}),Object.defineProperty(e,"padBytes",{enumerable:!0,get:function(){return J.padBytes}}),Object.defineProperty(e,"padHex",{enumerable:!0,get:function(){return J.padHex}});var X=Ve();Object.defineProperty(e,"size",{enumerable:!0,get:function(){return X.size}}
45);var K=ot();Object.defineProperty(e,"slice",{enumerable:!0,get:function(){return K.slice}}),Object.defineProperty(e,"sliceBytes",{enumerable:!0,get:function(){return K.sliceBytes}}),Object.defineProperty(e,"sliceHex",{enumerable:!0,get:function(){return K.sliceHex}});var de=Ft();Object.defineProperty(e,"trim",{enumerable:!0,get:function(){return de.trim}});var me=tc();Object.defineProperty(e,"defineBlock",{enumerable:!0,get:function(){return me.defineBlock}}),Object.defineProperty(e,"formatBlock",{enumerable:!0,get:function(){return me.formatBlock}});var se=_o();Object.defineProperty(e,"defineTransaction",{enumerable:!0,get:function(){return se.defineTransaction}}),Object.defineProperty(e,"formatTransaction",{enumerable:!0,get:function(){return se.formatTransaction}}),Object.defineProperty(e,"transactionType",{enumerable:!0,get:function(){return se.transactionType}});var Z=Lt();Object.defineProperty(e,"formatLog",{enumerable:!0,get:function(){return Z.formatLog}});var Q=mc();Object.defineProperty(e,"defineTransactionReceipt",{enumerable:!0,get:function(){return Q.defineTransactionReceipt}});var Y=zt();Object.defineProperty(e,"defineTransactionRequest",{enumerable:!0,get:function(){return Y.defineTransactionRequest}}),Object.defineProperty(e,"formatTransactionRequest",{enumerable:!0,get:function(){return Y.formatTransactionRequest}});var G=an();Object.defineProperty(e,"extract",{enumerable:!0,get:function(){return G.extract}});var L=yo();Object.defineProperty(e,"toRlp",{enumerable:!0,get:function(){return L.toRlp}});var ne=we();Object.defineProperty(e,"boolToBytes",{enumerable:!0,get:function(){return ne.boolToBytes}}),Object.defineProperty(e,"toBytes",{enumerable:!0,get:function(){return ne.toBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return ne.hexToBytes}}),Object.defineProperty(e,"numberToBytes",{enumerable:!0,get:function(){return ne.numberToBytes}}),Object.defineProperty(e,"stringToBytes",{enumerable:!0,get:function(){return ne.stringToBytes}});var re=te();Object.defineProperty(e,"boolToHex",{enumerable:!0,get:function(){return re.boolToHex}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return re.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return re.toHex}}),Object.defineProperty(e,"numberToHex",{enumerable:!0,get:function(){return re.numberToHex}}),Object.defineProperty(e,"stringToHex",{enumerable:!0,get:function(){return re.stringToHex}});var ee=Ad();Object.defineProperty(e,"bytesToBigInt",{enumerable:!0,get:function(){return ee.bytesToBigInt}}),Object.defineProperty(e,"bytesToBigint",{enumerable:!0,get:function(){return ee.bytesToBigInt}}),Object.defineProperty(e,"bytesToBool",{enumerable:!0,get:function(){return ee.bytesToBool}}),Object.defineProperty(e,"bytesToNumber",{enumerable:!0,get:function(){return ee.bytesToNumber}}),Object.defineProperty(e,"bytesToString",{enumerable:!0,get:function(){return ee.bytesToString}}),Object.defineProperty(e,"fromBytes",{enumerable:!0,get:function(){return ee.fromBytes}});var oe=Ce();Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return oe.fromHex}}),Object.defineProperty(e,"hexToBool",{enumerable:!0,get:function(){return oe.hexToBool}}),Object.defineProperty(e,"hexToBigInt",{enumerable:!0,get:function(){return oe.hexToBigInt}}),Object.defineProperty(e,"hexToNumber",{enumerable:!0,get:function(){return oe.hexToNumber}}),Object.defineProperty(e,"hexToString",{enumerable:!0,get:function(){return oe.hexToString}});var ue=al();Object.defineProperty(e,"fromRlp",{enumerable:!0,get:function(){return ue.fromRlp}});var Pe=po();Object.defineProperty(e,"containsNodeError",{enumerable:!0,get:function(){return Pe.containsNodeError}}),Object.defineProperty(e,"getNodeError",{enumerable:!0,get:function(){return Pe.getNodeError}});var be=Nd();Object.defineProperty(e,"getCallError",{enumerable:!0,get:function(){return be.getCallError}});var ce=ar();Object.defineProperty(e,"getContractError",{enumerable:!0,get:function(){return ce.getContractError}});var je=ag();Object.defineProperty(e,"getEstimateGasError",{enumerable:!0,get:function(){return je.getEstimateGasError}});var ye=Zd();Object.defineProperty(e,"getTransactionError",{enumerable:!0,get:function(){return ye.getTransactionError}});var qe=_e();Object.defineProperty(e,"getAction",{enumerable:!0,get:function(){return qe.getAction}});var pe=go();Object.defineProperty(e,"defineFormatter",{enumerable:!0,get:function(){return pe.defineFormatter}});var Me=on();Object.defineProperty(e,"toEventSelector",{enumerable:!0,get:function(){return Me.toEventSelector}}),Object.defineProperty(e,"getEventSelector",{enumerable:!0,get:function(){return Me.toEventSelector}});
45var pt=Br();Object.defineProperty(e,"toFunctionSelector",{enumerable:!0,get:function(){return pt.toFunctionSelector}}),Object.defineProperty(e,"getFunctionSelector",{enumerable:!0,get:function(){return pt.toFunctionSelector}});var Ze=Dg();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return Ze.toEventSignature}}),Object.defineProperty(e,"getEventSignature",{enumerable:!0,get:function(){return Ze.toEventSignature}});var nt=Gg();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return nt.toFunctionSignature}}),Object.defineProperty(e,"getFunctionSignature",{enumerable:!0,get:function(){return nt.toFunctionSignature}});var Wt=Vg();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return Wt.toEventHash}});var it=Wg();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return it.toFunctionHash}});var Ec=sl();Object.defineProperty(e,"isHash",{enumerable:!0,get:function(){return Ec.isHash}});var jc=We();Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return jc.keccak256}});var wc=xd();Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return wc.sha256}});var Pc=Zg();Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return Pc.ripemd160}});var Bo=Io();Object.defineProperty(e,"hashStruct",{enumerable:!0,get:function(){return Bo.hashStruct}}),Object.defineProperty(e,"hashTypedData",{enumerable:!0,get:function(){return Bo.hashTypedData}});var Ac=sr();Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return Ac.recoverAddress}});var Ro=ul();Object.defineProperty(e,"recoverMessageAddress",{enumerable:!0,get:function(){return Ro.recoverMessageAddress}});var Oo=Sd();Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return Oo.recoverPublicKey}});var dn=cl();Object.defineProperty(e,"recoverTypedDataAddress",{enumerable:!0,get:function(){return dn.recoverTypedDataAddress}});var Tc=Xg();Object.defineProperty(e,"verifyHash",{enumerable:!0,get:function(){return Tc.verifyHash}});var Ic=Qg();Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return Ic.verifyMessage}});var Sc=e1();Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return Sc.verifyTypedData}});var Bc=So();Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return Bc.hashMessage}});var Rc=t1();Object.defineProperty(e,"parseErc6492Signature",{enumerable:!0,get:function(){return Rc.parseErc6492Signature}});var Oc=_c();Object.defineProperty(e,"isErc6492Signature",{enumerable:!0,get:function(){return Oc.isErc6492Signature}});var Cc=ll();Object.defineProperty(e,"serializeErc6492Signature",{enumerable:!0,get:function(){return Cc.serializeErc6492Signature}});var ln=fl();Object.defineProperty(e,"getSerializedTransactionType",{enumerable:!0,get:function(){return ln.getSerializedTransactionType}});var dr=ac();Object.defineProperty(e,"getTransactionType",{enumerable:!0,get:function(){return dr.getTransactionType}});var lr=Ut();Object.defineProperty(e,"assertRequest",{enumerable:!0,get:function(){return lr.assertRequest}});var vt=pc();Object.defineProperty(e,"assertTransactionEIP1559",{enumerable:!0,get:function(){return vt.assertTransactionEIP1559}}),Object.defineProperty(e,"assertTransactionEIP2930",{enumerable:!0,get:function(){return vt.assertTransactionEIP2930}}),Object.defineProperty(e,"assertTransactionLegacy",{enumerable:!0,get:function(){return vt.assertTransactionLegacy}});var fr=ml();Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return fr.parseTransaction}});var xc=gc();Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return xc.serializeTransaction}});var qc=ol();Object.defineProperty(e,"serializeAccessList",{enumerable:!0,get:function(){return qc.serializeAccessList}});var Mc=mo();Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return Mc.formatEther}});var Hc=Or();Object.defineProperty(e,"formatGwei",{enumerable:!0,get:function(){return Hc.formatGwei}});var kc=Yu();Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return kc.formatUnits}});var Fc=vc();Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return Fc.parseUnits}});var $c=n1();Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return $c.parseEther}});var Nc=o1();Object.defineProperty(e,"parseGwei",{enumerable:!0,get:function(){return Nc.parseGwei}});var Co=i1();Object.defineProperty(e,"createNonceManager",{enumerable:!0,get:function(){return Co.createNonceManager}}),Object.defineProperty(e,"nonceManager",{enumerable:!0,get:function(){return Co.nonceManager}})}(bd)),bd}var $h;function fv(){if($h)return La;$h=1,Object.defineProperty(La,"__esModule",{value:!0}),La.formatProof=t;const e=bl();function r(i){return i.map(o=>({...o,value:BigInt(o.value)}))}function t(i){return{...i,balance:i.balance?BigInt(i.balance):void 0,nonce:i.nonce?(0,e.hexToNumber)(i.nonce):void 0,storageProof:i.storageProof?r(i.storageProof):void 0}}return La}var Nh;function mv(){if(Nh)return Ua;Nh=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.getProof=t;const e=te(),r=fv();async function t(i,{address:o,blockNumber:a,blockTag:n,storageKeys:s}){const u=n??"latest",c=a!==void 0?(0,e.numberToHex)(a):void 0,l=await i.request({method:"eth_getProof",params:[o,s,c||u]});return(0,r.formatProof)(l)}return Ua}var hs={},zh;function bv(){if(zh)return hs;zh=1,Object.defineProperty(hs,"__esModule",{value:!0}),hs.getStorageAt=r;const e=te();async function r(t,{address:i,blockNumber:o,blockTag:a="latest",slot:n}){const s=o!==void 0?(0,e.numberToHex)(o):void 0;return await t.request({method:"eth_getStorageAt",params:[i,n,s||a]})}return hs}var ys={},Uh;function hl(){if(Uh)return ys;Uh=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.getTransaction=i;const e=rt(),r=te(),t=_o();async function i(o,{blockHash:a,blockNumber:n,blockTag:s,hash:u,index:c}){const l=s||"latest",d=n!==void 0?(0,r.numberToHex)(n):void 0;let f=null;if(u?f=await o.request({method:"eth_getTransactionByHash",params:[u]},{dedupe:!0}):a?f=await o.request({method:"eth_getTransactionByBlockHashAndIndex",params:[a,(0,r.numberToHex)(c)]},{dedupe:!0}):f=await o.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[d||l,(0,r.numberToHex)(c)]},{dedupe:!!d}),!f)throw new e.TransactionNotFoundError({blockHash:a,blockNumber:n,blockTag:l,hash:u,index:c});return(o.chain?.formatters?.transaction?.format||t.formatTransaction)(f)}return ys}var ps={},Lh;function hv(){if(Lh)return ps;Lh=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.getTransactionConfirmations=i;const e=_e(),r=Ao(),t=hl();async function i(o,{hash:a,transactionReceipt:n}){const[s,u]=await Promise.all([(0,e.getAction)(o,r.getBlockNumber,"getBlockNumber")({}),a?(0,e.getAction)(o,t.getTransaction,"getTransaction")({hash:a}):void 0]),c=n?.blockNumber||u?.blockNumber;return c?s-c+1n:0n}return ps}var gs={},Dh;function a1(){if(Dh)return gs;Dh=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.getTransactionReceipt=t;const e=rt(),r=mc();async function t(i,{hash:o}){const a=await i.request({method:"eth_getTransactionReceipt",params:[o]},{dedupe:!0});if(!a)throw new e.TransactionReceiptNotFoundError({hash:o});return(i.chain?.formatters?.transactionReceipt?.format||r.formatTransactionReceipt)(a)}return gs}var _s={},Gh;function yv(){if(Gh)return _s;Gh=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.multicall=l;const e=ur(),r=Ie(),t=le(),i=or(),o=Dt(),a=tt(),n=cr(),s=ar(),u=_e(),c=Vt();async function l(d,f){const{account:p,allowFailure:y=!0,batchSize:b,blockNumber:w,blockTag:B,multicallAddress:x,stateOverride:M}=f,A=f.contracts,O=b??(typeof d.batch?.multicall=="object"&&d.batch.multicall.batchSize||1024);let E=x;if(!E){if(!d.chain)throw new Error("client chain not configured. multicallAddress is required.");E=(0,n.getChainContractAddress)({blockNumber:w,chain:d.chain,contract:"multicall3"})}const _=[[]];let P=0,m=0;for(let v=0;v<A.length;v++){const{abi:h,address:I,args:R,functionName:j}=A[v];try{const S=(0,a.encodeFunctionData)({abi:h,args:R,functionName:j});m+=(S.length-2)/2,O>0&&m>O&&_[P].length>
450&&(P++,m=(S.length-2)/2,_[P]=[]),_[P]=[..._[P],{allowFailure:!0,callData:S,target:I}]}catch(S){const C=(0,s.getContractError)(S,{abi:h,address:I,args:R,docsPath:"/docs/contract/multicall",functionName:j,sender:p});if(!y)throw C;_[P]=[..._[P],{allowFailure:!0,callData:"0x",target:I}]}}const T=await Promise.allSettled(_.map(v=>(0,u.getAction)(d,c.readContract,"readContract")({abi:e.multicall3Abi,account:p,address:E,args:[v],blockNumber:w,blockTag:B,functionName:"aggregate3",stateOverride:M}))),g=[];for(let v=0;v<T.length;v++){const h=T[v];if(h.status==="rejected"){if(!y)throw h.reason;for(let R=0;R<_[v].length;R++)g.push({status:"failure",error:h.reason,result:void 0});continue}const I=h.value;for(let R=0;R<I.length;R++){const{returnData:j,success:S}=I[R],{callData:C}=_[v][R],{abi:H,address:F,functionName:q,args:k}=A[g.length];try{if(C==="0x")throw new r.AbiDecodingZeroDataError;if(!S)throw new i.RawContractError({data:j});const N=(0,o.decodeFunctionResult)({abi:H,args:k,data:j,functionName:q});g.push(y?{result:N,status:"success"}:N)}catch(N){const D=(0,s.getContractError)(N,{abi:H,address:F,args:k,docsPath:"/docs/contract/multicall",functionName:q});if(!y)throw D;g.push({error:D,result:void 0,status:"failure"})}}}if(g.length!==A.length)throw new t.BaseError("multicall results mismatch");return g}return _s}var vs={},Vh;function s1(){if(Vh)return vs;Vh=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.simulateBlocks=w;const e=gg(),r=xe(),t=Ie(),i=or(),o=Nt(),a=Dt(),n=tt(),s=ke(),u=te(),c=ar(),l=po(),d=tc(),f=Lt(),p=zt(),y=Bd(),b=Ut();async function w(B,x){const{blockNumber:M,blockTag:A="latest",blocks:O,returnFullTransactions:E,traceTransfers:_,validation:P}=x;try{const m=[];for(const h of O){const I=h.blockOverrides?e.toRpc(h.blockOverrides):void 0,R=h.calls.map(S=>{const C=S,H=C.account?(0,r.parseAccount)(C.account):void 0,F=C.abi?(0,n.encodeFunctionData)(C):C.data,q={...C,data:C.dataSuffix?(0,s.concat)([F||"0x",C.dataSuffix]):F,from:C.from??H?.address};return(0,b.assertRequest)(q),(0,p.formatTransactionRequest)(q)}),j=h.stateOverrides?(0,y.serializeStateOverride)(h.stateOverrides):void 0;m.push({blockOverrides:I,calls:R,stateOverrides:j})}const g=(typeof M=="bigint"?(0,u.numberToHex)(M):void 0)||A;return(await B.request({method:"eth_simulateV1",params:[{blockStateCalls:m,returnFullTransactions:E,traceTransfers:_,validation:P},g]})).map((h,I)=>({...(0,d.formatBlock)(h),calls:h.calls.map((R,j)=>{const{abi:S,args:C,functionName:H,to:F}=O[I].calls[j],q=R.error?.data??R.returnData,k=BigInt(R.gasUsed),N=R.logs?.map(V=>(0,f.formatLog)(V)),D=R.status==="0x1"?"success":"failure",W=S&&D==="success"&&q!=="0x"?(0,a.decodeFunctionResult)({abi:S,data:q,functionName:H}):null,$=(()=>{if(D==="success")return;let V;if(R.error?.data==="0x"?V=new t.AbiDecodingZeroDataError:R.error&&(V=new i.RawContractError(R.error)),!!V)return(0,c.getContractError)(V,{abi:S??[],address:F??"0x",args:C,functionName:H??"<unknown>"})})();return{data:q,gasUsed:k,logs:N,status:D,...D==="success"?{result:W}:{error:$}}})}))}catch(m){const T=m,g=(0,l.getNodeError)(T,{});throw g instanceof o.UnknownNodeError?T:g}}return vs}var Es={},er={},Ue={},Pr={},Wh;function u1(){if(Wh)return Pr;Wh=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.keccak256=a,Pr.ripemd160=n,Pr.sha256=s,Pr.validate=u;const e=Kg(),r=Up(),t=cg(),i=Cr(),o=yt();function a(c,l={}){const{as:d=typeof c=="string"?"Hex":"Bytes"}=l,f=(0,r.keccak_256)(i.from(c));return d==="Bytes"?f:o.fromBytes(f)}function n(c,l={}){const{as:d=typeof c=="string"?"Hex":"Bytes"}=l,f=(0,e.ripemd160)(i.from(c));return d==="Bytes"?f:o.fromBytes(f)}function s(c,l={}){const{as:d=typeof c=="string"?"Hex":"Bytes"}=l,f=(0,t.sha256)(i.from(c));return d==="Bytes"?f:o.fromBytes(f)}function u(c){return o.validate(c)&&o.size(c)===32}return Pr}var Xr={},Le={},Qr={},io={},Kh;function pv(){if(Kh)return io;Kh=1,Object.defineProperty(io,"__esModule",{value:!0}),io.LruMap=void 0;class e extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const i=super.get(t);return super.has(t)&&i!==void 0&&(this.delete(t),super.set(t,i)),i}set(t,i){if(super.set(t,i),this.maxSize&&this.size>this.maxSize){const o=this.keys().next().value;o&&this.delete(o)}return this}}return io.LruMap=e,io}var Zh;
45function gv(){if(Zh)return Qr;Zh=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.checksum=void 0,Qr.clear=t;const e=pv(),r={checksum:new e.LruMap(8192)};Qr.checksum=r.checksum;function t(){for(const i of Object.values(r))i.clear()}return Qr}var Oe={},Jh;function _v(){if(Jh)return Oe;Jh=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.InvalidSerializedSizeError=Oe.InvalidUncompressedPrefixError=Oe.InvalidCompressedPrefixError=Oe.InvalidPrefixError=Oe.InvalidError=void 0,Oe.assert=o,Oe.compress=a,Oe.from=n,Oe.fromBytes=s,Oe.fromHex=u,Oe.toBytes=c,Oe.toHex=l,Oe.validate=d;const e=Cr(),r=Gt(),t=yt(),i=$d();function o(B,x={}){const{compressed:M}=x,{prefix:A,x:O,y:E}=B;if(M===!1||typeof O=="bigint"&&typeof E=="bigint"){if(A!==4)throw new p({prefix:A,cause:new b});return}if(M===!0||typeof O=="bigint"&&typeof E>"u"){if(A!==3&&A!==2)throw new p({prefix:A,cause:new y});return}throw new f({publicKey:B})}function a(B){const{x,y:M}=B;return{prefix:M%2n===0n?2:3,x}}function n(B){const x=(()=>{if(t.validate(B))return u(B);if(e.validate(B))return s(B);const{prefix:M,x:A,y:O}=B;return typeof A=="bigint"&&typeof O=="bigint"?{prefix:M??4,x:A,y:O}:{prefix:M,x:A}})();return o(x),x}function s(B){return u(t.fromBytes(B))}function u(B){if(B.length!==132&&B.length!==130&&B.length!==68)throw new w({publicKey:B});if(B.length===130){const A=BigInt(t.slice(B,0,32)),O=BigInt(t.slice(B,32,64));return{prefix:4,x:A,y:O}}if(B.length===132){const A=Number(t.slice(B,0,1)),O=BigInt(t.slice(B,1,33)),E=BigInt(t.slice(B,33,65));return{prefix:A,x:O,y:E}}const x=Number(t.slice(B,0,1)),M=BigInt(t.slice(B,1,33));return{prefix:x,x:M}}function c(B,x={}){return e.fromHex(l(B,x))}function l(B,x={}){o(B);const{prefix:M,x:A,y:O}=B,{includePrefix:E=!0}=x;return t.concat(E?t.fromNumber(M,{size:1}):"0x",t.fromNumber(A,{size:32}),typeof O=="bigint"?t.fromNumber(O,{size:32}):"0x")}function d(B,x={}){try{return o(B,x),!0}catch{return!1}}class f extends r.BaseError{constructor({publicKey:x}){super(`Value \`${i.stringify(x)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}Oe.InvalidError=f;class p extends r.BaseError{constructor({prefix:x,cause:M}){super(`Prefix "${x}" is invalid.`,{cause:M}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}Oe.InvalidPrefixError=p;class y extends r.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}Oe.InvalidCompressedPrefixError=y;class b extends r.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}Oe.InvalidUncompressedPrefixError=b;class w extends r.BaseError{constructor({publicKey:x}){super(`Value \`${x}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${t.size(t.from(x))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}return Oe.InvalidSerializedSizeError=w,Oe}var Yh;function yl(){if(Yh)return Le;Yh=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.InvalidChecksumError=Le.InvalidInputError=Le.InvalidAddressError=void 0,Le.assert=n,Le.checksum=s,Le.from=u,Le.fromPublicKey=c,Le.isEqual=l,Le.validate=d;const e=Cr(),r=gv(),t=Gt(),i=u1(),o=_v(),a=/^0x[a-fA-F0-9]{40}$/;function n(b,w={}){const{strict:B=!0}=w;if(!a.test(b))throw new f({address:b,cause:new p});if(B){if(b.toLowerCase()===b)return;if(s(b)!==b)throw new f({address:b,cause:new y})}}function s(b){if(r.checksum.has(b))return r.checksum.get(b);n(b,{strict:!1});const w=b.substring(2).toLowerCase(),B=i.keccak256(e.fromString(w),{as:"Bytes"}),x=w.split("");for(let A=0;A<40;A+=2)B[A>>1]>>4>=8&&x[A]&&(x[A]=x[A].toUpperCase()),(B[A>>1]&15)>
45=8&&x[A+1]&&(x[A+1]=x[A+1].toUpperCase());const M=`0x${x.join("")}`;return r.checksum.set(b,M),M}function u(b,w={}){const{checksum:B=!1}=w;return n(b),B?s(b):b}function c(b,w={}){const B=i.keccak256(`0x${o.toHex(b).slice(4)}`).substring(26);return u(`0x${B}`,w)}function l(b,w){return n(b,{strict:!1}),n(w,{strict:!1}),b.toLowerCase()===w.toLowerCase()}function d(b,w={}){const{strict:B=!0}=w??{};try{return n(b,{strict:B}),!0}catch{return!1}}class f extends t.BaseError{constructor({address:w,cause:B}){super(`Address "${w}" is invalid.`,{cause:B}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}Le.InvalidAddressError=f;class p extends t.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}Le.InvalidInputError=p;class y extends t.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}return Le.InvalidChecksumError=y,Le}var Xh;function vv(){if(Xh)return Xr;Xh=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.normalizeSignature=t,Xr.isArgOfType=i,Xr.getAmbiguousTypes=o;const e=yl(),r=Gt();function t(a){let n=!0,s="",u=0,c="",l=!1;for(let d=0;d<a.length;d++){const f=a[d];if(["(",")",","].includes(f)&&(n=!0),f==="("&&u++,f===")"&&u--,!!n){if(u===0){if(f===" "&&["event","function","error",""].includes(c))c="";else if(c+=f,f===")"){l=!0;break}continue}if(f===" "){a[d-1]!==","&&s!==","&&s!==",("&&(s="",n=!1);continue}c+=f,s+=f}}if(!l)throw new r.BaseError("Unable to normalize signature.");return c}function i(a,n){const s=typeof a,u=n.type;switch(u){case"address":return e.validate(a,{strict:!1});case"bool":return s==="boolean";case"function":return s==="string";case"string":return s==="string";default:return u==="tuple"&&"components"in n?Object.values(n.components).every((c,l)=>i(Object.values(a)[l],c)):/^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(u)?s==="number"||s==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(u)?s==="string"||a instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(u)?Array.isArray(a)&&a.every(c=>i(c,{...n,type:u.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function o(a,n,s){for(const u in a){const c=a[u],l=n[u];if(c.type==="tuple"&&l.type==="tuple"&&"components"in c&&"components"in l)return o(c.components,l.components,s[u]);const d=[c.type,l.type];if(d.includes("address")&&d.includes("bytes20")?!0:d.includes("address")&&d.includes("string")?e.validate(s[u],{strict:!1}):d.includes("address")&&d.includes("bytes")?e.validate(s[u],{strict:!1}):!1)return d}}return Xr}var Qh;function c1(){if(Qh)return Ue;Qh=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.InvalidSelectorSizeError=Ue.NotFoundError=Ue.AmbiguityError=void 0,Ue.format=a,Ue.from=n,Ue.fromAbi=s,Ue.getSelector=u,Ue.getSignature=c,Ue.getSignatureHash=l;const e=tr(),r=Gt(),t=u1(),i=yt(),o=vv();function a(y){return e.formatAbiItem(y)}function n(y,b={}){const{prepare:w=!0}=b,B=Array.isArray(y)||typeof y=="string"?e.parseAbiItem(y):y;return{...B,...w?{hash:l(B)}:{}}}function s(y,b,w){const{args:B=[],prepare:x=!0}=w??{},M=i.validate(b,{strict:!1}),A=y.filter(_=>M?_.type==="function"||_.type==="error"?u(_)===i.slice(b,0,4):_.type==="event"?l(_)===b:!1:"name"in _&&_.name===b);if(A.length===0)throw new f({name:b});if(A.length===1)return{...A[0],...x?{hash:l(A[0])}:{}};let O;for(const _ of A){if(!("inputs"in _))continue;if(!B||B.length===0){if(!_.inputs||_.inputs.length===0)return{..._,...x?{hash:l(_)}:{}};continue}if(!_.inputs||_.inputs.length===0||_.inputs.length!==B.length)continue;if(B.every((m,T)=>{const g="inputs"in _&&_.inputs[T];return g?o.isArgOfType(m,g):!1})){if(O&&"inputs"in O&&O.inputs){const m=o.getAmbiguousTypes(_.inputs,O.inputs,B);if(m)throw new d({abiItem:_,type:m[0]},{abiItem:O,type:m[1]})}O=_}}const E=(()=>
45{if(O)return O;const[_,...P]=A;return{..._,overloads:P}})();if(!E)throw new f({name:b});return{...E,...x?{hash:l(E)}:{}}}function u(y){return i.slice(l(y),0,4)}function c(y){const b=typeof y=="string"?y:e.formatAbiItem(y);return o.normalizeSignature(b)}function l(y){return typeof y!="string"&&"hash"in y&&y.hash?y.hash:t.keccak256(i.fromString(c(y)))}class d extends r.BaseError{constructor(b,w){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${b.type}\` in \`${o.normalizeSignature(e.formatAbiItem(b.abiItem))}\`, and`,`\`${w.type}\` in \`${o.normalizeSignature(e.formatAbiItem(w.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}Ue.AmbiguityError=d;class f extends r.BaseError{constructor({name:b,data:w,type:B="item"}){const x=b?` with name "${b}"`:w?` with data "${w}"`:"";super(`ABI ${B}${x} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}Ue.NotFoundError=f;class p extends r.BaseError{constructor({data:b}){super(`Selector size is invalid. Expected 4 bytes. Received ${i.size(b)} bytes ("${b}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}return Ue.InvalidSelectorSizeError=p,Ue}var Se={},z={},ey;function d1(){return ey||(ey=1,Object.defineProperty(z,"__esModule",{value:!0}),z.minInt120=z.minInt112=z.minInt104=z.minInt96=z.minInt88=z.minInt80=z.minInt72=z.minInt64=z.minInt56=z.minInt48=z.minInt40=z.minInt32=z.minInt24=z.minInt16=z.minInt8=z.maxInt256=z.maxInt248=z.maxInt240=z.maxInt232=z.maxInt224=z.maxInt216=z.maxInt208=z.maxInt200=z.maxInt192=z.maxInt184=z.maxInt176=z.maxInt168=z.maxInt160=z.maxInt152=z.maxInt144=z.maxInt136=z.maxInt128=z.maxInt120=z.maxInt112=z.maxInt104=z.maxInt96=z.maxInt88=z.maxInt80=z.maxInt72=z.maxInt64=z.maxInt56=z.maxInt48=z.maxInt40=z.maxInt32=z.maxInt24=z.maxInt16=z.maxInt8=z.integerRegex=z.bytesRegex=z.arrayRegex=void 0,z.maxUint256=z.maxUint248=z.maxUint240=z.maxUint232=z.maxUint224=z.maxUint216=z.maxUint208=z.maxUint200=z.maxUint192=z.maxUint184=z.maxUint176=z.maxUint168=z.maxUint160=z.maxUint152=z.maxUint144=z.maxUint136=z.maxUint128=z.maxUint120=z.maxUint112=z.maxUint104=z.maxUint96=z.maxUint88=z.maxUint80=z.maxUint72=z.maxUint64=z.maxUint56=z.maxUint48=z.maxUint40=z.maxUint32=z.maxUint24=z.maxUint16=z.maxUint8=z.minInt256=z.minInt248=z.minInt240=z.minInt232=z.minInt224=z.minInt216=z.minInt208=z.minInt200=z.minInt192=z.minInt184=z.minInt176=z.minInt168=z.minInt160=z.minInt152=z.minInt144=z.minInt136=z.minInt128=void 0,z.arrayRegex=/^(.*)\[([0-9]*)\]$/,z.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,z.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)?$/,z.maxInt8=2n**(8n-1n)-1n,z.maxInt16=2n**(16n-1n)-1n,z.maxInt24=2n**(24n-1n)-1n,z.maxInt32=2n**(32n-1n)-1n,z.maxInt40=2n**(40n-1n)-1n,z.maxInt48=2n**(48n-1n)-1n,z.maxInt56=2n**(56n-1n)-1n,z.maxInt64=2n**(64n-1n)-1n,z.maxInt72=2n**(72n-1n)-1n,z.maxInt80=2n**(80n-1n)-1n,z.maxInt88=2n**(88n-1n)-1n,z.maxInt96=2n**(96n-1n)-1n,z.maxInt104=2n**(104n-1n)-1n,z.maxInt112=2n**(112n-1n)-1n,z.maxInt120=2n**(120n-1n)-1n,z.maxInt128=2n**(128n-1n)-1n,z.maxInt136=2n**(136n-1n)-1n,z.maxInt144=2n**(144n-1n)-1n,z.maxInt152=2n**(152n-1n)-1n,z.maxInt160=2n**(160n-1n)-1n,z.maxInt168=2n**(168n-1n)-1n,z.maxInt176=2n**(176n-1n)-1n,z.maxInt184=2n**(184n-1n)-1n,z.maxInt192=2n**(192n-1n)-1n,z.maxInt200=2n**(200n-1n)-1n,z.maxInt208=2n**(208n-1n)-1n,z.maxInt216=2n**(216n-1n)-1n,z.maxInt224=2n**(224n-1n)-1n,z.maxInt232=2n**(232n-1n)-1n,z.maxInt240=2n**(240n-1n)-1n,z.maxInt248=2n**(248n-1n)-1n,z.maxInt256=2n**(256n-1n)-1n,z.minInt8=-(2n**(8n-1n)),z.minInt16=-(2n**(16n-1n)),z.minInt24=-(2n**(24n-1n)),z.minInt32=-(2n**(32n-1n)),z.minInt40=-(2n**(40n-1n)),z.minInt48=-(2n**(48n-1n)),z.minInt56=-(2n**(56n-1n)),z.minInt64=-(2n**(64n-1n)),z.minInt72=-(2n**(72n-1n)),z.minInt80=-(2n**(80n-1n)),z.minInt88=-(2n**(88n-1n)),z.minInt96=-(2n**(96n-1n)),z.minInt104=-(2n**(104n-1n)),z.minInt112=-(2n**(112n-1n)),z.minInt120=-(2n**(120n-1n)),z.minInt128=-(2n**(128n-1n)),z.minInt136=-(2n**(136n-1n)),z.minInt144=-(2n**(144n-1n)),z.minInt152=-(2n**(152n-1n)),z.minInt160=-(2n**(160n-1n)),z.minInt168=-(2n**(168
45n-1n)),z.minInt176=-(2n**(176n-1n)),z.minInt184=-(2n**(184n-1n)),z.minInt192=-(2n**(192n-1n)),z.minInt200=-(2n**(200n-1n)),z.minInt208=-(2n**(208n-1n)),z.minInt216=-(2n**(216n-1n)),z.minInt224=-(2n**(224n-1n)),z.minInt232=-(2n**(232n-1n)),z.minInt240=-(2n**(240n-1n)),z.minInt248=-(2n**(248n-1n)),z.minInt256=-(2n**(256n-1n)),z.maxUint8=2n**8n-1n,z.maxUint16=2n**16n-1n,z.maxUint24=2n**24n-1n,z.maxUint32=2n**32n-1n,z.maxUint40=2n**40n-1n,z.maxUint48=2n**48n-1n,z.maxUint56=2n**56n-1n,z.maxUint64=2n**64n-1n,z.maxUint72=2n**72n-1n,z.maxUint80=2n**80n-1n,z.maxUint88=2n**88n-1n,z.maxUint96=2n**96n-1n,z.maxUint104=2n**104n-1n,z.maxUint112=2n**112n-1n,z.maxUint120=2n**120n-1n,z.maxUint128=2n**128n-1n,z.maxUint136=2n**136n-1n,z.maxUint144=2n**144n-1n,z.maxUint152=2n**152n-1n,z.maxUint160=2n**160n-1n,z.maxUint168=2n**168n-1n,z.maxUint176=2n**176n-1n,z.maxUint184=2n**184n-1n,z.maxUint192=2n**192n-1n,z.maxUint200=2n**200n-1n,z.maxUint208=2n**208n-1n,z.maxUint216=2n**216n-1n,z.maxUint224=2n**224n-1n,z.maxUint232=2n**232n-1n,z.maxUint240=2n**240n-1n,z.maxUint248=2n**248n-1n,z.maxUint256=2n**256n-1n),z}var Be={},ty;function Ev(){if(ty)return Be;ty=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.decodeParameter=n,Be.decodeAddress=c,Be.decodeArray=l,Be.decodeBool=d,Be.decodeBytes=f,Be.decodeNumber=p,Be.decodeTuple=y,Be.decodeString=b,Be.prepareParameters=w,Be.prepareParameter=B,Be.encode=x,Be.encodeAddress=M,Be.encodeArray=A,Be.encodeBytes=O,Be.encodeBoolean=E,Be.encodeNumber=_,Be.encodeString=P,Be.encodeTuple=m,Be.getArrayComponents=T,Be.hasDynamicChild=g;const e=pl(),r=yl(),t=Cr(),i=Gt(),o=yt(),a=d1();function n(v,h,I){const{checksumAddress:R,staticPosition:j}=I,S=T(h.type);if(S){const[C,H]=S;return l(v,{...h,type:H},{checksumAddress:R,length:C,staticPosition:j})}if(h.type==="tuple")return y(v,h,{checksumAddress:R,staticPosition:j});if(h.type==="address")return c(v,{checksum:R});if(h.type==="bool")return d(v);if(h.type.startsWith("bytes"))return f(v,h,{staticPosition:j});if(h.type.startsWith("uint")||h.type.startsWith("int"))return p(v,h);if(h.type==="string")return b(v,{staticPosition:j});throw new e.InvalidTypeError(h.type)}const s=32,u=32;function c(v,h={}){const{checksum:I=!1}=h,R=v.readBytes(32);return[(S=>I?r.checksum(S):S)(o.fromBytes(t.slice(R,-20))),32]}function l(v,h,I){const{checksumAddress:R,length:j,staticPosition:S}=I;if(!j){const F=t.toNumber(v.readBytes(u)),q=S+F,k=q+s;v.setPosition(q);const N=t.toNumber(v.readBytes(s)),D=g(h);let W=0;const $=[];for(let V=0;V<N;++V){v.setPosition(k+(D?V*32:W));const[J,X]=n(v,h,{checksumAddress:R,staticPosition:k});W+=X,$.push(J)}return v.setPosition(S+32),[$,32]}if(g(h)){const F=t.toNumber(v.readBytes(u)),q=S+F,k=[];for(let N=0;N<j;++N){v.setPosition(q+N*32);const[D]=n(v,h,{checksumAddress:R,staticPosition:q});k.push(D)}return v.setPosition(S+32),[k,32]}let C=0;const H=[];for(let F=0;F<j;++F){const[q,k]=n(v,h,{checksumAddress:R,staticPosition:S+C});C+=k,H.push(q)}return[H,C]}function d(v){return[t.toBoolean(v.readBytes(32),{size:32}),32]}function f(v,h,{staticPosition:I}){const[R,j]=h.type.split("bytes");if(!j){const C=t.toNumber(v.readBytes(32));v.setPosition(I+C);const H=t.toNumber(v.readBytes(32));if(H===0)return v.setPosition(I+32),["0x",32];const F=v.readBytes(H);return v.setPosition(I+32),[o.fromBytes(F),32]}return[o.fromBytes(v.readBytes(Number.parseInt(j),32)),32]}function p(v,h){const I=h.type.startsWith("int"),R=Number.parseInt(h.type.split("int")[1]||"256"),j=v.readBytes(32);return[R>48?t.toBigInt(j,{signed:I}):t.toNumber(j,{signed:I}),32]}function y(v,h,I){const{checksumAddress:R,staticPosition:j}=I,S=h.components.length===0||h.components.some(({name:F})=>!F),C=S?[]:{};let H=0;if(g(h)){const F=t.toNumber(v.readBytes(u)),q=j+F;for(let k=0;k<h.components.length;++k){const N=h.components[k];v.setPosition(q+H);const[D,W]=n(v,N,{checksumAddress:R,staticPosition:q});H+=W,C[S?k:N?.name]=D}return v.setPosition(j+32),[C,32]}for(let F=0;F<h.components.length;++F){const q=h.components[F],[k,N]=n(v,q,{checksumAddress:R,staticPosition:j});C[S?F:q?.name]=k,H+=N}return[C,H]}function b(v,{staticPosition:h}){const I=t.toNumber(v.readBytes(32)),R=h+I;v.setPosition(R);const j=t.toNumber(v.readBytes(32));if(j===0)return v.setPosition(h+32),["",32];const S=v.readBytes(j,32),C=t.toString(t.trimLeft(S));return v.setPosition(h+32),[C,32]}function w({checksumAddress:v,parameters:h,values:I}){const R=[];for(let j=0;j<h.length;j++)R.push(B({checksumAddress:v,parameter:h[j],value:I[j]}));return R}function B({checksumAddress:v=!1,parameter:h,value:I}){const R=h,j=T(R.type);
45if(j){const[S,C]=j;return A(I,{checksumAddress:v,length:S,parameter:{...R,type:C}})}if(R.type==="tuple")return m(I,{checksumAddress:v,parameter:R});if(R.type==="address")return M(I,{checksum:v});if(R.type==="bool")return E(I);if(R.type.startsWith("uint")||R.type.startsWith("int")){const S=R.type.startsWith("int"),[,,C="256"]=a.integerRegex.exec(R.type)??[];return _(I,{signed:S,size:Number(C)})}if(R.type.startsWith("bytes"))return O(I,{type:R.type});if(R.type==="string")return P(I);throw new e.InvalidTypeError(R.type)}function x(v){let h=0;for(let S=0;S<v.length;S++){const{dynamic:C,encoded:H}=v[S];C?h+=32:h+=o.size(H)}const I=[],R=[];let j=0;for(let S=0;S<v.length;S++){const{dynamic:C,encoded:H}=v[S];C?(I.push(o.fromNumber(h+j,{size:32})),R.push(H),j+=o.size(H)):I.push(H)}return o.concat(...I,...R)}function M(v,h){const{checksum:I=!1}=h;return r.assert(v,{strict:I}),{dynamic:!1,encoded:o.padLeft(v.toLowerCase())}}function A(v,h){const{checksumAddress:I,length:R,parameter:j}=h,S=R===null;if(!Array.isArray(v))throw new e.InvalidArrayError(v);if(!S&&v.length!==R)throw new e.ArrayLengthMismatchError({expectedLength:R,givenLength:v.length,type:`${j.type}[${R}]`});let C=!1;const H=[];for(let F=0;F<v.length;F++){const q=B({checksumAddress:I,parameter:j,value:v[F]});q.dynamic&&(C=!0),H.push(q)}if(S||C){const F=x(H);if(S){const q=o.fromNumber(H.length,{size:32});return{dynamic:!0,encoded:H.length>0?o.concat(q,F):q}}if(C)return{dynamic:!0,encoded:F}}return{dynamic:!1,encoded:o.concat(...H.map(({encoded:F})=>F))}}function O(v,{type:h}){const[,I]=h.split("bytes"),R=o.size(v);if(!I){let j=v;return R%32!==0&&(j=o.padRight(j,Math.ceil((v.length-2)/2/32)*32)),{dynamic:!0,encoded:o.concat(o.padLeft(o.fromNumber(R,{size:32})),j)}}if(R!==Number.parseInt(I))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(I),value:v});return{dynamic:!1,encoded:o.padRight(v)}}function E(v){if(typeof v!="boolean")throw new i.BaseError(`Invalid boolean value: "${v}" (type: ${typeof v}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:o.padLeft(o.fromBoolean(v))}}function _(v,{signed:h,size:I}){if(typeof I=="number"){const R=2n**(BigInt(I)-(h?1n:0n))-1n,j=h?-R-1n:0n;if(v>R||v<j)throw new o.IntegerOutOfRangeError({max:R.toString(),min:j.toString(),signed:h,size:I/8,value:v.toString()})}return{dynamic:!1,encoded:o.fromNumber(v,{size:32,signed:h})}}function P(v){const h=o.fromString(v),I=Math.ceil(o.size(h)/32),R=[];for(let j=0;j<I;j++)R.push(o.padRight(o.slice(h,j*32,(j+1)*32)));return{dynamic:!0,encoded:o.concat(o.padRight(o.fromNumber(o.size(h),{size:32})),...R)}}function m(v,h){const{checksumAddress:I,parameter:R}=h;let j=!1;const S=[];for(let C=0;C<R.components.length;C++){const H=R.components[C],F=Array.isArray(v)?C:H.name,q=B({checksumAddress:I,parameter:H,value:v[F]});S.push(q),q.dynamic&&(j=!0)}return{dynamic:j,encoded:j?x(S):o.concat(...S.map(({encoded:C})=>C))}}function T(v){const h=v.match(/^(.*)\[(\d+)?\]$/);return h?[h[2]?Number(h[2]):null,h[1]]:void 0}function g(v){const{type:h}=v;if(h==="string"||h==="bytes"||h.endsWith("[]"))return!0;if(h==="tuple")return v.components?.some(g);const I=T(v.type);return!!(I&&g({...v,type:I[1]}))}return Be}var _t={},ry;function jv(){if(ry)return _t;ry=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.RecursiveReadLimitExceededError=_t.PositionOutOfBoundsError=_t.NegativeOffsetError=void 0,_t.create=t;
45const e=Gt(),r={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 a({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(n){if(n<0||n>this.bytes.length-1)throw new o({length:this.bytes.length,position:n})},decrementPosition(n){if(n<0)throw new i({offset:n});const s=this.position-n;this.assertPosition(s),this.position=s},getReadCount(n){return this.positionReadCount.get(n||this.position)||0},incrementPosition(n){if(n<0)throw new i({offset:n});const s=this.position+n;this.assertPosition(s),this.position=s},inspectByte(n){const s=n??this.position;return this.assertPosition(s),this.bytes[s]},inspectBytes(n,s){const u=s??this.position;return this.assertPosition(u+n-1),this.bytes.subarray(u,u+n)},inspectUint8(n){const s=n??this.position;return this.assertPosition(s),this.bytes[s]},inspectUint16(n){const s=n??this.position;return this.assertPosition(s+1),this.dataView.getUint16(s)},inspectUint24(n){const s=n??this.position;return this.assertPosition(s+2),(this.dataView.getUint16(s)<<8)+this.dataView.getUint8(s+2)},inspectUint32(n){const s=n??this.position;return this.assertPosition(s+3),this.dataView.getUint32(s)},pushByte(n){this.assertPosition(this.position),this.bytes[this.position]=n,this.position++},pushBytes(n){this.assertPosition(this.position+n.length-1),this.bytes.set(n,this.position),this.position+=n.length},pushUint8(n){this.assertPosition(this.position),this.bytes[this.position]=n,this.position++},pushUint16(n){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,n),this.position+=2},pushUint24(n){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,n>>8),this.dataView.setUint8(this.position+2,n&255),this.position+=3},pushUint32(n){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,n),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const n=this.inspectByte();return this.position++,n},readBytes(n,s){this.assertReadLimit(),this._touch();const u=this.inspectBytes(n);return this.position+=s??n,u},readUint8(){this.assertReadLimit(),this._touch();const n=this.inspectUint8();return this.position+=1,n},readUint16(){this.assertReadLimit(),this._touch();const n=this.inspectUint16();return this.position+=2,n},readUint24(){this.assertReadLimit(),this._touch();const n=this.inspectUint24();return this.position+=3,n},readUint32(){this.assertReadLimit(),this._touch();const n=this.inspectUint32();return this.position+=4,n},get remaining(){return this.bytes.length-this.position},setPosition(n){const s=this.position;return this.assertPosition(n),this.position=n,()=>this.position=s},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const n=this.getReadCount();this.positionReadCount.set(this.position,n+1),n>0&&this.recursiveReadCount++}};function t(n,{recursiveReadLimit:s=8192}={}){const u=Object.create(r);return u.bytes=n,u.dataView=new DataView(n.buffer,n.byteOffset,n.byteLength),u.positionReadCount=new Map,u.recursiveReadLimit=s,u}class i extends e.BaseError{constructor({offset:s}){super(`Offset \`${s}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}_t.NegativeOffsetError=i;class o extends e.BaseError{constructor({length:s,position:u}){super(`Position \`${u}\` is out of bounds (\`0 < position < ${s}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}_t.PositionOutOfBoundsError=o;class a extends e.BaseError{constructor({count:s,limit:u}){super(`Recursive read limit of \`${u}\` exceeded (recursive read count: \`${s}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}return _t.RecursiveReadLimitExceededError=a,_t}var ny;function pl(){if(ny)return Se;
45ny=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.InvalidTypeError=Se.InvalidArrayError=Se.LengthMismatchError=Se.BytesSizeMismatchError=Se.ArrayLengthMismatchError=Se.ZeroDataError=Se.DataSizeTooSmallError=void 0,Se.decode=u,Se.encode=c,Se.encodePacked=l,Se.format=d,Se.from=f;const e=tr(),r=yl(),t=Cr(),i=Gt(),o=yt(),a=d1(),n=Ev(),s=jv();function u(A,O,E={}){const{as:_="Array",checksumAddress:P=!1}=E,m=typeof O=="string"?t.fromHex(O):O,T=s.create(m);if(t.size(m)===0&&A.length>0)throw new y;if(t.size(m)&&t.size(m)<32)throw new p({data:typeof O=="string"?O:o.fromBytes(O),parameters:A,size:t.size(m)});let g=0;const v=_==="Array"?[]:{};for(let h=0;h<A.length;++h){const I=A[h];T.setPosition(g);const[R,j]=n.decodeParameter(T,I,{checksumAddress:P,staticPosition:0});g+=j,_==="Array"?v.push(R):v[I.name??h]=R}return v}function c(A,O,E){const{checksumAddress:_=!1}=E??{};if(A.length!==O.length)throw new B({expectedLength:A.length,givenLength:O.length});const P=n.prepareParameters({checksumAddress:_,parameters:A,values:O}),m=n.encode(P);return m.length===0?"0x":m}function l(A,O){if(A.length!==O.length)throw new B({expectedLength:A.length,givenLength:O.length});const E=[];for(let _=0;_<A.length;_++){const P=A[_],m=O[_];E.push(l.encode(P,m))}return o.concat(...E)}(function(A){function O(E,_,P=!1){if(E==="address"){const v=_;return r.assert(v),o.padLeft(v.toLowerCase(),P?32:0)}if(E==="string")return o.fromString(_);if(E==="bytes")return _;if(E==="bool")return o.padLeft(o.fromBoolean(_),P?32:1);const m=E.match(a.integerRegex);if(m){const[v,h,I="256"]=m,R=Number.parseInt(I)/8;return o.fromNumber(_,{size:P?32:R,signed:h==="int"})}const T=E.match(a.bytesRegex);if(T){const[v,h]=T;if(Number.parseInt(h)!==(_.length-2)/2)throw new w({expectedSize:Number.parseInt(h),value:_});return o.padRight(_,P?32:0)}const g=E.match(a.arrayRegex);if(g&&Array.isArray(_)){const[v,h]=g,I=[];for(let R=0;R<_.length;R++)I.push(O(h,_[R],!0));return I.length===0?"0x":o.concat(...I)}throw new M(E)}A.encode=O})(l||(Se.encodePacked=l={}));function d(A){return e.formatAbiParameters(A)}function f(A){return Array.isArray(A)&&typeof A[0]=="string"||typeof A=="string"?e.parseAbiParameters(A):A}class p extends i.BaseError{constructor({data:O,parameters:E,size:_}){super(`Data size of ${_} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e.formatAbiParameters(E)})`,`Data: ${O} (${_} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}Se.DataSizeTooSmallError=p;class y extends i.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}Se.ZeroDataError=y;class b extends i.BaseError{constructor({expectedLength:O,givenLength:E,type:_}){super(`Array length mismatch for type \`${_}\`. Expected: \`${O}\`. Given: \`${E}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}Se.ArrayLengthMismatchError=b;class w extends i.BaseError{constructor({expectedSize:O,value:E}){super(`Size of bytes "${E}" (bytes${o.size(E)}) does not match expected size (bytes${O}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}Se.BytesSizeMismatchError=w;class B extends i.BaseError{constructor({expectedLength:O,givenLength:E}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${O}`,`Given length (values): ${E}`].join(` 46`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}Se.LengthMismatchError=B;class x extends i.BaseError{constructor(O){super(`Value \`${O}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}Se.InvalidArrayError=x;class M extends i.BaseError{constructor(O){super(`Type \`${O}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}return Se.InvalidTypeError=M,Se}var oy;function wv(){if(oy)return er;
46oy=1,Object.defineProperty(er,"__esModule",{value:!0}),er.decode=o,er.encode=a,er.format=n,er.from=s,er.fromAbi=u;const e=tr(),r=c1(),t=pl(),i=yt();function o(c,l){const{bytecode:d}=l;if(c.inputs.length===0)return;const f=l.data.replace(d,"0x");return t.decode(c.inputs,f)}function a(c,l){const{bytecode:d,args:f}=l;return i.concat(d,c.inputs?.length&&f?.length?t.encode(c.inputs,f):"0x")}function n(c){return e.formatAbiItem(c)}function s(c){return r.from(c)}function u(c){const l=c.find(d=>d.type==="constructor");if(!l)throw new r.NotFoundError({name:"constructor"});return l}return er}var lt={},iy;function Pv(){if(iy)return lt;iy=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.decodeData=o,lt.decodeResult=a,lt.encodeData=n,lt.encodeResult=s,lt.format=u,lt.from=c,lt.fromAbi=l,lt.getSelector=d;const e=tr(),r=c1(),t=pl(),i=yt();function o(f,p){const{overloads:y}=f;if(i.size(p)<4)throw new r.InvalidSelectorSizeError({data:p});if(f.inputs.length===0)return;const b=y?l([f,...y],p):f;if(!(i.size(p)<=4))return t.decode(b.inputs,i.slice(p,4))}function a(f,p,y={}){const b=t.decode(f.outputs,p,y);if(!(b&&Object.keys(b).length===0))return b&&Object.keys(b).length===1?Array.isArray(b)?b[0]:Object.values(b)[0]:b}function n(f,...p){const{overloads:y}=f,b=y?l([f,...y],f.name,{args:p[0]}):f,w=d(b),B=p.length>0?t.encode(b.inputs,p[0]):void 0;return B?i.concat(w,B):w}function s(f,p,y={}){const{as:b="Array"}=y,w=f.outputs.length===1?[p]:Array.isArray(p)?p:b==="Object"?Object.values(p):[p];return t.encode(f.outputs,w)}function u(f){return e.formatAbiItem(f)}function c(f,p={}){return r.from(f,p)}function l(f,p,y){const b=r.fromAbi(f,p,y);if(b.type!=="function")throw new r.NotFoundError({name:p,type:"function"});return b}function d(f){return r.getSelector(f)}return lt}var Qe={},ay;function l1(){return ay||(ay=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.zeroAddress=Qe.ethAddress=Qe.entryPoint08Address=Qe.entryPoint07Address=Qe.entryPoint06Address=void 0,Qe.entryPoint06Address="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",Qe.entryPoint07Address="0x0000000071727De22E5E9d8BAf0edAc6f37da032",Qe.entryPoint08Address="0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108",Qe.ethAddress="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Qe.zeroAddress="0x0000000000000000000000000000000000000000"),Qe}var sy;function Av(){if(sy)return Es;sy=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.simulateCalls=d;const e=wv(),r=Pv(),t=xe(),i=l1(),o=uc(),a=le(),n=tt(),s=bl(),u=xg(),c=s1(),l="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function d(f,p){const{blockNumber:y,blockTag:b,calls:w,stateOverrides:B,traceAssetChanges:x,traceTransfers:M,validation:A}=p,O=p.account?(0,t.parseAccount)(p.account):void 0;if(x&&!O)throw new a.BaseError("`account` is required when `traceAssetChanges` is true");const E=O?e.encode(e.from("constructor(bytes, bytes)"),{bytecode:o.deploylessCallViaBytecodeBytecode,args:[l,r.encodeData(r.from("function getBalance(address)"),[O.address])]}):void 0,_=x?await Promise.all(p.calls.map(async K=>{if(!K.data&&!K.abi)return;const{accessList:de}=await(0,u.createAccessList)(f,{account:O.address,...K,data:K.abi?(0,n.encodeFunctionData)(K):K.data});return de.map(({address:me,storageKeys:se})=>se.length>0?me:null)})).then(K=>K.flat().filter(Boolean)):[],P=await(0,c.simulateBlocks)(f,{blockNumber:y,blockTag:b,blocks:[...x?[{calls:[{data:E}],stateOverrides:B},{calls:_.map((K,de)=>({abi:[r.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[O.address],to:K,from:i.zeroAddress,nonce:de})),stateOverrides:[{address:i.zeroAddress,nonce:0}]}]:[],{calls:[...w,{}].map(K=>({...K,from:O?.address})),stateOverrides:B},...x?[{calls:[{data:E}]},{calls:_.map((K,de)=>({abi:[r.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[O.address],to:K,from:i.zeroAddress,nonce:de})),stateOverrides:[{address:i.zeroAddress,nonce:0}]},{calls:_.map((K,de)=>({to:K,abi:[r.from("function decimals() returns (uint256)")],functionName:"decimals",from:i.zeroAddress,nonce:de})),stateOverrides:[{address:i.zeroAddress,nonce:0}]},{calls:_.map((K,de)=>({to:K,abi:[r.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:i.zeroAddress,nonce:de})),stateOverrides:[{address:i.zeroAddress,nonce:0}]},{calls:_.map((K,de)=>({to:K,abi:[r.from("function symbol() returns (string)")],functionName:"symbol",from:i.zeroAddress,nonce:de})),stateOverrides:[{address:i.zeroAddress,nonce:0}]}]:[]],traceTransfers:M,validation:A}),m=x?P[2]:P[0],[T,g,,v,h,I,R,j]=x?P:[],{calls:S,...C}=m,H=S.slice(0,-1)??[],F=T?.calls??[],q=g?.calls??[],k=[...F,...q].map(K=>K.status==="success"?(0,s.hexToBigInt)(K.data):null),N=v?.calls??[],D=h?.calls??[],W=[...N,...D].map(K=>K.status==="success"?(0,s.hexToBigInt)(K.data):null),$=(I?.calls??[]).map(K=>K.status==="success"?K.result:null),V=(j?.calls??[]).map(K=>K.status==="success"?K.result:null),J=(R?.calls??[]).map(K=>K.status==="success"?K.result:null),X=[];for(const[K,de]of W.entries()){const me=k[K];if(typeof de!="bigint"||typeof me!="bigint")continue;const se=$[K-1],Z=V[K-1],Q=J[K-1],Y=K===0?{address:i.ethAddress,decimals:18,symbol
46:"ETH"}:{address:_[K-1],decimals:Q||se?Number(se??1):void 0,symbol:Z??void 0};X.some(G=>G.token.address===Y.address)||X.push({token:Y,value:{pre:me,post:de,diff:de-me}})}return{assetChanges:X,block:C,results:H}}return Es}var js={},ws={},Ps={},uy;function f1(){if(uy)return Ps;uy=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.serializeSignature=i;const e=ho(),r=Ce(),t=we();function i({r:o,s:a,to:n="hex",v:s,yParity:u}){const c=(()=>{if(u===0||u===1)return u;if(s&&(s===27n||s===28n||s>=35n))return s%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),l=`0x${new e.secp256k1.Signature((0,r.hexToBigInt)(o),(0,r.hexToBigInt)(a)).toCompactHex()}${c===0?"1b":"1c"}`;return n==="hex"?l:(0,t.hexToBytes)(l)}return Ps}var cy;function gl(){if(cy)return ws;cy=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.verifyHash=b;const e=ur(),r=uc(),t=or(),i=wo(),o=et(),a=ht(),n=De(),s=te(),u=_e(),c=bl(),l=_c(),d=sr(),f=ll(),p=f1(),y=Po();async function b(w,B){const{address:x,factory:M,factoryData:A,hash:O,signature:E,universalSignatureVerifierAddress:_=w.chain?.contracts?.universalSignatureVerifier?.address,...P}=B,m=(0,n.isHex)(E)?E:typeof E=="object"&&"r"in E&&"s"in E?(0,p.serializeSignature)(E):(0,s.bytesToHex)(E),T=await(async()=>!M&&!A||(0,l.isErc6492Signature)(m)?m:(0,f.serializeErc6492Signature)({address:M,data:A,signature:m}))();try{const g=_?{to:_,data:(0,c.encodeFunctionData)({abi:e.universalSignatureValidatorAbi,functionName:"isValidSig",args:[x,O,T]}),...P}:{data:(0,i.encodeDeployData)({abi:e.universalSignatureValidatorAbi,args:[x,O,T],bytecode:r.universalSignatureValidatorByteCode}),...P},{data:v}=await(0,u.getAction)(w,y.call,"call")(g);return(0,c.hexToBool)(v??"0x0")}catch(g){try{if((0,a.isAddressEqual)((0,o.getAddress)(x),await(0,d.recoverAddress)({hash:O,signature:E})))return!0}catch{}if(g instanceof t.CallExecutionError)return!1;throw g}}return ws}var dy;function Tv(){if(dy)return js;dy=1,Object.defineProperty(js,"__esModule",{value:!0}),js.verifyMessage=t;const e=So(),r=gl();async function t(i,{address:o,message:a,factory:n,factoryData:s,signature:u,...c}){const l=(0,e.hashMessage)(a);return(0,r.verifyHash)(i,{address:o,factory:n,factoryData:s,hash:l,signature:u,...c})}return js}var As={},ly;function Iv(){if(ly)return As;ly=1,Object.defineProperty(As,"__esModule",{value:!0}),As.verifyTypedData=t;const e=Io(),r=gl();async function t(i,o){const{address:a,factory:n,factoryData:s,signature:u,message:c,primaryType:l,types:d,domain:f,...p}=o,y=(0,e.hashTypedData)({message:c,primaryType:l,types:d,domain:f});return(0,r.verifyHash)(i,{address:a,factory:n,factoryData:s,hash:y,signature:u,...p})}return As}var Ts={},Is={},fy;function m1(){if(fy)return Is;fy=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.watchBlockNumber=n;const e=Ce(),r=_e(),t=xr(),i=cn(),o=Fe(),a=Ao();function n(s,{emitOnBegin:u=!1,emitMissed:c=!1,onBlockNumber:l,onError:d,poll:f,pollingInterval:p=s.pollingInterval}){const y=typeof f<"u"?f:!(s.transport.type==="webSocket"||s.transport.type==="ipc"||s.transport.type==="fallback"&&(s.transport.transports[0].c
46onfig.type==="webSocket"||s.transport.transports[0].config.type==="ipc"));let b;return y?(()=>{const x=(0,o.stringify)(["watchBlockNumber",s.uid,u,c,p]);return(0,t.observe)(x,{onBlockNumber:l,onError:d},M=>(0,i.poll)(async()=>{try{const A=await(0,r.getAction)(s,a.getBlockNumber,"getBlockNumber")({cacheTime:0});if(b){if(A===b)return;if(A-b>1&&c)for(let O=b+1n;O<A;O++)M.onBlockNumber(O,b),b=O}(!b||A>b)&&(M.onBlockNumber(A,b),b=A)}catch(A){M.onError?.(A)}},{emitOnBegin:u,interval:p}))})():(()=>{const x=(0,o.stringify)(["watchBlockNumber",s.uid,u,c]);return(0,t.observe)(x,{onBlockNumber:l,onError:d},M=>{let A=!0,O=()=>A=!1;return(async()=>{try{const E=(()=>{if(s.transport.type==="fallback"){const P=s.transport.transports.find(m=>m.config.type==="webSocket"||m.config.type==="ipc");return P?P.value:s.transport}return s.transport})(),{unsubscribe:_}=await E.subscribe({params:["newHeads"],onData(P){if(!A)return;const m=(0,e.hexToBigInt)(P.result?.number);M.onBlockNumber(m,b),b=m},onError(P){M.onError?.(P)}});O=_,A||O()}catch(E){d?.(E)}})(),()=>O()})})()}return Is}var my;function Sv(){if(my)return Ts;my=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.waitForTransactionReceipt=d;const e=Od(),r=rt(),t=_e(),i=xr(),o=zd(),a=Yd(),n=Fe(),s=sn(),u=hl(),c=a1(),l=m1();async function d(f,{confirmations:p=1,hash:y,onReplaced:b,pollingInterval:w=f.pollingInterval,retryCount:B=6,retryDelay:x=({count:A})=>~~(1<<A)*200,timeout:M=18e4}){const A=(0,n.stringify)(["waitForTransactionReceipt",f.uid,y]);let O,E,_,P=!1,m,T;const{promise:g,resolve:v,reject:h}=(0,o.withResolvers)(),I=M?setTimeout(()=>{T(),m(),h(new r.WaitForTransactionReceiptTimeoutError({hash:y}))},M):void 0;return m=(0,i.observe)(A,{onReplaced:b,resolve:v,reject:h},R=>{T=(0,t.getAction)(f,l.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:w,async onBlockNumber(j){const S=H=>{clearTimeout(I),T(),H(),m()};let C=j;if(!P)try{if(_){if(p>1&&(!_.blockNumber||C-_.blockNumber+1n<p))return;S(()=>R.resolve(_));return}if(O||(P=!0,await(0,a.withRetry)(async()=>{O=await(0,t.getAction)(f,u.getTransaction,"getTransaction")({hash:y}),O.blockNumber&&(C=O.blockNumber)},{delay:x,retryCount:B}),P=!1),_=await(0,t.getAction)(f,c.getTransactionReceipt,"getTransactionReceipt")({hash:y}),p>1&&(!_.blockNumber||C-_.blockNumber+1n<p))return;S(()=>R.resolve(_))}catch(H){if(H instanceof r.TransactionNotFoundError||H instanceof r.TransactionReceiptNotFoundError){if(!O){P=!1;return}try{E=O,P=!0;const F=await(0,a.withRetry)(()=>(0,t.getAction)(f,s.getBlock,"getBlock")({blockNumber:C,includeTransactions:!0}),{delay:x,retryCount:B,shouldRetry:({error:N})=>N instanceof e.BlockNotFoundError});P=!1;const q=F.transactions.find(({from:N,nonce:D})=>N===E.from&&D===E.nonce);if(!q||(_=await(0,t.getAction)(f,c.getTransactionReceipt,"getTransactionReceipt")({hash:q.hash}),p>1&&(!_.blockNumber||C-_.blockNumber+1n<p)))return;let k="replaced";q.to===E.to&&q.value===E.value&&q.input===E.input?k="repriced":q.from===q.to&&q.value===0n&&(k="cancelled"),S(()=>{R.onReplaced?.({reason:k,replacedTransaction:E,transaction:q,transactionReceipt:_}),R.resolve(_)})}catch(F){S(()=>R.reject(F))}}else S(()=>R.reject(H))}}})}),g}return Ts}var Ss={},by;function Bv(){if(by)return Ss;by=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.watchBlocks=a;const e=_e(),r=xr(),t=cn(),i=Fe(),o=sn();function a(n,{blockTag:s="latest",emitMissed:u=!1,emitOnBegin:c=!1,onBlock:l,onError:d,includeTransactions:f,poll:p,pollingInterval:y=n.pollingInterval}){const b=typeof p<"u"?p:!(n.transport.type==="webSocket"||n.transport.type==="ipc"||n.transport.type==="fallback"&&(n.transport.transports[0].c
46onfig.type==="webSocket"||n.transport.transports[0].config.type==="ipc")),w=f??!1;let B;return b?(()=>{const A=(0,i.stringify)(["watchBlocks",n.uid,s,u,c,w,y]);return(0,r.observe)(A,{onBlock:l,onError:d},O=>(0,t.poll)(async()=>{try{const E=await(0,e.getAction)(n,o.getBlock,"getBlock")({blockTag:s,includeTransactions:w});if(E.number!==null&&B?.number!=null){if(E.number===B.number)return;if(E.number-B.number>1&&u)for(let _=B?.number+1n;_<E.number;_++){const P=await(0,e.getAction)(n,o.getBlock,"getBlock")({blockNumber:_,includeTransactions:w});O.onBlock(P,B),B=P}}(B?.number==null||s==="pending"&&E?.number==null||E.number!==null&&E.number>B.number)&&(O.onBlock(E,B),B=E)}catch(E){O.onError?.(E)}},{emitOnBegin:c,interval:y}))})():(()=>{let A=!0,O=!0,E=()=>A=!1;return(async()=>{try{c&&(0,e.getAction)(n,o.getBlock,"getBlock")({blockTag:s,includeTransactions:w}).then(m=>{A&&O&&(l(m,void 0),O=!1)}).catch(d);const _=(()=>{if(n.transport.type==="fallback"){const m=n.transport.transports.find(T=>T.config.type==="webSocket"||T.config.type==="ipc");return m?m.value:n.transport}return n.transport})(),{unsubscribe:P}=await _.subscribe({params:["newHeads"],async onData(m){if(!A)return;const T=await(0,e.getAction)(n,o.getBlock,"getBlock")({blockNumber:m.result?.number,includeTransactions:w}).catch(()=>{});A&&(l(T,B),O=!1,B=T)},onError(m){d?.(m)}});E=P,A||E()}catch(_){d?.(_)}})(),()=>E()})()}return Ss}var Bs={},hy;function Rv(){if(hy)return Bs;hy=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.watchEvent=y;const e=Rr(),r=xr(),t=cn(),i=Fe(),o=Ie(),a=ir(),n=vo(),s=Lt(),u=_e(),c=qg(),l=Ao(),d=cc(),f=kd(),p=dc();function y(b,{address:w,args:B,batch:x=!0,event:M,events:A,fromBlock:O,onError:E,onLogs:_,poll:P,pollingInterval:m=b.pollingInterval,strict:T}){const g=typeof P<"u"?P:typeof O=="bigint"?!0:!(b.transport.type==="webSocket"||b.transport.type==="ipc"||b.transport.type==="fallback"&&(b.transport.transports[0].c
46onfig.type==="webSocket"||b.transport.transports[0].config.type==="ipc")),v=T??!1;return g?(()=>{const R=(0,i.stringify)(["watchEvent",w,B,x,b.uid,M,m,O]);return(0,r.observe)(R,{onLogs:_,onError:E},j=>{let S;O!==void 0&&(S=O-1n);let C,H=!1;const F=(0,t.poll)(async()=>{if(!H){try{C=await(0,u.getAction)(b,c.createEventFilter,"createEventFilter")({address:w,args:B,event:M,events:A,strict:v,fromBlock:O})}catch{}H=!0;return}try{let q;if(C)q=await(0,u.getAction)(b,d.getFilterChanges,"getFilterChanges")({filter:C});else{const k=await(0,u.getAction)(b,l.getBlockNumber,"getBlockNumber")({});S&&S!==k?q=await(0,u.getAction)(b,f.getLogs,"getLogs")({address:w,args:B,event:M,events:A,fromBlock:S+1n,toBlock:k}):q=[],S=k}if(q.length===0)return;if(x)j.onLogs(q);else for(const k of q)j.onLogs([k])}catch(q){C&&q instanceof a.InvalidInputRpcError&&(H=!1),j.onError?.(q)}},{emitOnBegin:!0,interval:m});return async()=>{C&&await(0,u.getAction)(b,p.uninstallFilter,"uninstallFilter")({filter:C}),F()}})})():(()=>{let R=!0,j=()=>R=!1;return(async()=>{try{const S=(()=>{if(b.transport.type==="fallback"){const q=b.transport.transports.find(k=>k.config.type==="webSocket"||k.config.type==="ipc");return q?q.value:b.transport}return b.transport})(),C=A??(M?[M]:void 0);let H=[];C&&(H=[C.flatMap(k=>(0,e.encodeEventTopics)({abi:[k],eventName:k.name,args:B}))],M&&(H=H[0]));const{unsubscribe:F}=await S.subscribe({params:["logs",{address:w,topics:H}],onData(q){if(!R)return;const k=q.result;try{const{eventName:N,args:D}=(0,n.decodeEventLog)({abi:C??[],data:k.data,topics:k.topics,strict:v}),W=(0,s.formatLog)(k,{args:D,eventName:N});_([W])}catch(N){let D,W;if(N instanceof o.DecodeLogDataMismatch||N instanceof o.DecodeLogTopicsMismatch){if(T)return;D=N.abiItem.name,W=N.abiItem.inputs?.some(V=>!("name"in V&&V.name))}const $=(0,s.formatLog)(k,{args:W?[]:{},eventName:D});_([$])}},onError(q){E?.(q)}});j=F,R||j()}catch(S){E?.(S)}})(),()=>j()})()}return Bs}var Rs={},yy;function Ov(){if(yy)return Rs;yy=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.watchPendingTransactions=s;const e=_e(),r=xr(),t=cn(),i=Fe(),o=Mg(),a=cc(),n=dc();function s(u,{batch:c=!0,onError:l,onTransactions:d,poll:f,pollingInterval:p=u.pollingInterval}){return(typeof f<"u"?f:u.transport.type!=="webSocket"&&u.transport.type!=="ipc")?(()=>{const B=(0,i.stringify)(["watchPendingTransactions",u.uid,c,p]);return(0,r.observe)(B,{onTransactions:d,onError:l},x=>{let M;const A=(0,t.poll)(async()=>{try{if(!M)try{M=await(0,e.getAction)(u,o.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(E){throw A(),E}const O=await(0,e.getAction)(u,a.getFilterChanges,"getFilterChanges")({filter:M});if(O.length===0)return;if(c)x.onTransactions(O);else for(const E of O)x.onTransactions([E])}catch(O){x.onError?.(O)}},{emitOnBegin:!0,interval:p});return async()=>{M&&await(0,e.getAction)(u,n.uninstallFilter,"uninstallFilter")({filter:M}),A()}})})():(()=>{let B=!0,x=()=>B=!1;return(async()=>{try{const{unsubscribe:M}=await u.transport.subscribe({params:["newPendingTransactions"],onData(A){if(!B)return;const O=A.result;d([O])},onError(A){l?.(A)}});x=M,B||x()}catch(M){l?.(M)}})(),()=>x()})()}return Rs}var Os={},Cs={},py;function Cv(){if(py)return Cs;py=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.parseSiweMessage=e;function e(i){const{scheme:o,statement:a,...n}=i.match(r)?.groups??{},{chainId:s,expirationTime:u,issuedAt:c,notBefore:l,requestId:d,...f}=i.match(t)?.groups??{},p=i.split("Resources:")[1]?.split(` 47- `).slice(1);return{...n,...f,...s?{chainId:Number(s)}:{},...u?{expirationTime:new Date(u)}:{},...c?{issuedAt:new Date(c)}:{},...l?{notBefore:new Date(l)}:{},...d?{requestId:d}:{},...p?{resources:p}:{},...o?{scheme:o}:{},...a?{statement:a}:{}}}const r=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,t=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;return Cs}var xs={},gy;function xv(){if(gy)return xs;gy=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.validateSiweMessage=t;const e=Ke(),r=ht();function t(i){const{address:o,domain:a,message:n,nonce:s,scheme:u,time:c=new Date}=i;if(a&&n.domain!==a||s&&n.nonce!==s||u&&n.scheme!==u||n.expirationTime&&c>=n.expirationTime||n.notBefore&&c<n.notBefore)return!1;try{if(!n.address||!(0,e.isAddress)(n.address,{strict:!1})||o&&!(0,r.isAddressEqual)(n.address,o))return!1}catch{return!1}return!0}return xs}var _y;function qv(){if(_y)return Os;_y=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.verifySiweMessage=o;const e=So(),r=Cv(),t=xv(),i=gl();async function o(a,n){const{address:s,domain:u,message:c,nonce:l,scheme:d,signature:f,time:p=new Date,...y}=n,b=(0,r.parseSiweMessage)(c);if(!b.address||!(0,t.validateSiweMessage)({address:s,domain:u,message:b,nonce:l,scheme:d,time:p}))return!1;const B=(0,e.hashMessage)(c);return(0,i.verifyHash)(a,{address:b.address,hash:B,signature:f,...y})}return Os}var vy;function b1(){if(vy)return ga;vy=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.publicActions=Y;const e=K_(),r=Y_(),t=X_(),i=Q_(),o=Cg(),a=Po(),n=xg(),s=ev(),u=Pd(),c=qg(),l=Mg(),d=bg(),f=ug(),p=Hd(),y=sg(),b=mg(),w=tv(),B=sn(),x=Ao(),M=rv(),A=un(),O=nv(),E=Fd(),_=iv(),P=sv(),m=cc(),T=uv(),g=Cd(),v=kd(),h=mv(),I=bv(),R=hl(),j=hv(),S=rc(),C=a1(),H=yv(),F=Vt(),q=s1(),k=Av(),N=_g(),D=dc(),W=Tv(),$=Iv(),V=Sv(),J=m1(),X=Bv(),K=Eg(),de=Rv(),me=Ov(),se=qv(),Z=sc(),Q=Jd();function Y(G){return{call:L=>(0,a.call)(G,L),createAccessList:L=>(0,n.createAccessList)(G,L),createBlockFilter:()=>(0,s.createBlockFilter)(G),createContractEventFilter:L=>(0,u.createContractEventFilter)(G,L),createEventFilter:L=>(0,c.createEventFilter)(G,L),createPendingTransactionFilter:()=>(0,l.createPendingTransactionFilter)(G),estimateContractGas:L=>(0,d.estimateContractGas)(G,L),estimateGas:L=>(0,p.estimateGas)(G,L),getBalance:L=>(0,b.getBalance)(G,L),getBlobBaseFee:()=>(0,w.getBlobBaseFee)(G),getBlock:L=>(0,B.getBlock)(G,L),getBlockNumber:L=>(0,x.getBlockNumber)(G,L),getBlockTransactionCount:L=>(0,M.getBlockTransactionCount)(G,L),getBytecode:L=>(0,O.getCode)(G,L),getChainId:()=>(0,A.getChainId)(G),getCode:L=>(0,O.getCode)(G,L),getContractEvents:L=>(0,E.getContractEvents)(G,L),getEip712Domain:L=>(0,_.getEip712Domain)(G,L),getEnsAddress:L=>(0,e.getEnsAddress)(G,L),getEnsAvatar:L=>(0,r.getEnsAvatar)(G,L),getEnsName:L=>(0,t.getEnsName)(G,L),getEnsResolver:L=>(0,i.getEnsResolver)(G,L),getEnsText:L=>(0,o.getEnsText)(G,L),getFeeHistory:L=>(0,P.getFeeHistory)(G,L),estimateFeesPerGas:L=>(0,f.estimateFeesPerGas)(G,L),getFilterChanges:L=>(0,m.getFilterChanges)(G,L),getFilterLogs:L=>(0,T.getFilterLogs)(G,L),getGasPrice:()=>(0,g.getGasPrice)(G),getLogs:L=>(0,v.getLogs)(G,L),getProof:L=>(0,h.getProof)(G,L),estimateMaxPriorityFeePerGas:L=>(0,y.estimateMaxPriorityFeePerGas)(G,L),getStorageAt:L=>(0,I.getStorageAt)(G,L),getTransaction:L=>(0,R.getTransaction)(G,L),getTransactionConfirmations:L=>(0,j.getTransactionConfirmations)(G,L),getTransactionCount:L=>(0,S.getTransactionCount)(G,L),getTransactionReceipt:L=>(0,C.getTransactionReceipt)(G,L),multicall:L=>(0,H.multicall)(G,L),prepareTransactionRequest:L=>(0,Z.prepareTransactionRequest)(G,L),readContract:L=>(0,F.readContract)(G,L),sendRawTransaction:L=>(0,Q.sendRawTransaction)(G,L),simulate:L=>(0,q.simulateBlocks)(G,L),simulateBlocks:L=>(0,q.simulateBlocks)(G,L),simulateCalls:L=>(0,k.simulateCalls)(G,L),simulateContract:L=>(0,N.simulateContract)(G,L),verifyMessage:L=>(0,W.verifyMessage)(G,L),verifySiweMessage:L=>(0,se.verifySiweMessage)(G,L),verifyTypedData:L=>
47(0,$.verifyTypedData)(G,L),uninstallFilter:L=>(0,D.uninstallFilter)(G,L),waitForTransactionReceipt:L=>(0,V.waitForTransactionReceipt)(G,L),watchBlocks:L=>(0,X.watchBlocks)(G,L),watchBlockNumber:L=>(0,J.watchBlockNumber)(G,L),watchContractEvent:L=>(0,K.watchContractEvent)(G,L),watchEvent:L=>(0,de.watchEvent)(G,L),watchPendingTransactions:L=>(0,me.watchPendingTransactions)(G,L)}}return ga}var Ey;function Mv(){if(Ey)return pa;Ey=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.createPublicClient=t;const e=bc(),r=b1();function t(i){const{key:o="public",name:a="Public Client"}=i;return(0,e.createClient)({...i,key:o,name:a,type:"publicClient"}).extend(r.publicActions)}return pa}var qs={},Ms={},Hs={},jy;function Hv(){if(jy)return Hs;jy=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.dropTransaction=e;async function e(r,{hash:t}){await r.request({method:`${r.mode}_dropTransaction`,params:[t]})}return Hs}var ks={},wy;function kv(){if(wy)return ks;wy=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.dumpState=e;async function e(r){return r.request({method:`${r.mode}_dumpState`})}return ks}var Fs={},Py;function Fv(){if(Py)return Fs;Py=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.getAutomine=e;async function e(r){return r.mode==="ganache"?await r.request({method:"eth_mining"}):await r.request({method:`${r.mode}_getAutomine`})}return Fs}var $s={},Ay;function $v(){if(Ay)return $s;Ay=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.getTxpoolContent=e;async function e(r){return await r.request({method:"txpool_content"})}return $s}var Ns={},Ty;function Nv(){if(Ty)return Ns;Ty=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.getTxpoolStatus=r;const e=Ce();async function r(t){const{pending:i,queued:o}=await t.request({method:"txpool_status"});return{pending:(0,e.hexToNumber)(i),queued:(0,e.hexToNumber)(o)}}return Ns}var zs={},Iy;function zv(){if(Iy)return zs;Iy=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.impersonateAccount=e;async function e(r,{address:t}){await r.request({method:`${r.mode}_impersonateAccount`,params:[t]})}return zs}var Us={},Sy;function Uv(){if(Sy)return Us;Sy=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.increaseTime=r;const e=te();async function r(t,{seconds:i}){return await t.request({method:"evm_increaseTime",params:[(0,e.numberToHex)(i)]})}return Us}var Ls={},By;function Lv(){if(By)return Ls;By=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.inspectTxpool=e;async function e(r){return await r.request({method:"txpool_inspect"})}return Ls}var Ds={},Ry;function Dv(){if(Ry)return Ds;Ry=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.loadState=e;async function e(r,{state:t}){await r.request({method:`${r.mode}_loadState`,params:[t]})}return Ds}var Gs={},Oy;function Gv(){if(Oy)return Gs;Oy=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.mine=r;const e=te();async function r(t,{blocks:i,interval:o}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:(0,e.numberToHex)(i)}]}):await t.request({method:`${t.mode}_mine`,params:[(0,e.numberToHex)(i),(0,e.numberToHex)(o||0)]})}return Gs}var Vs={},Cy;function Vv(){if(Cy)return Vs;Cy=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.removeBlockTimestampInterval=e;async function e(r){await r.request({method:`${r.mode}_removeBlockTimestampInterval`})}return Vs}var Ws={},xy;function Wv(){if(xy)return Ws;xy=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.reset=e;async function e(r,{blockNumber:t,jsonRpcUrl:i}={}){await r.request({method:`${r.mode}_reset`,params:[{forking:{blockNumber:Number(t),jsonRpcUrl:i}}]})}return Ws}var Ks={},qy;function Kv(){if(qy)return Ks;qy=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.revert=e;async function e(r,{id:t}){await r.request({method:"evm_revert",params:[t]})}return Ks}var Zs={},My;function Zv(){if(My)return Zs;My=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.sendUnsignedTransaction=t;const e=an(),r=zt();async function t(i,o){const{accessList:a,data:n,from:s,gas:u,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:f,to:p,value:y,...b}=o,w=i.chain?.formatters?.transactionRequest?.format,x=(w||r.formatTransactionRequest)({...(0,e.extract)(b,{format:w}),accessList:a,data:n,from:s,gas:u,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:d,nonce:f,to:p,value:y});return await i.request({method:"eth_sendUnsignedTransaction",params:[x]})}return Zs}var Js={},Hy;function Jv(){if(Hy)return Js;Hy=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.setAutomine=e;async function e(r,t){r.mode==="ganache"?t?await r.request({method:"miner_start"}):await r.request({method:"miner_stop"}):await r.request({method:"evm_setAutomine",params:[t]})}return Js}var Ys={},ky;function Yv(){if(ky)return Ys;ky=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.setBalance=r;const e=te();async function r(t,{address:i,value:o}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[i,(0,e.numberToHex)(o)]}):await t.request({method:`${t.mode}_setBalance`,params:[i,(0,e.numberToHex)(o)]})}return Ys}var Xs={},Fy;
47function Xv(){if(Fy)return Xs;Fy=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.setBlockGasLimit=r;const e=te();async function r(t,{gasLimit:i}){await t.request({method:"evm_setBlockGasLimit",params:[(0,e.numberToHex)(i)]})}return Xs}var Qs={},$y;function Qv(){if($y)return Qs;$y=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.setBlockTimestampInterval=e;async function e(r,{interval:t}){const i=r.mode==="hardhat"?t*1e3:t;await r.request({method:`${r.mode}_setBlockTimestampInterval`,params:[i]})}return Qs}var eu={},Ny;function eE(){if(Ny)return eu;Ny=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.setCode=e;async function e(r,{address:t,bytecode:i}){r.mode==="ganache"?await r.request({method:"evm_setAccountCode",params:[t,i]}):await r.request({method:`${r.mode}_setCode`,params:[t,i]})}return eu}var tu={},zy;function tE(){if(zy)return tu;zy=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.setCoinbase=e;async function e(r,{address:t}){await r.request({method:`${r.mode}_setCoinbase`,params:[t]})}return tu}var ru={},Uy;function rE(){if(Uy)return ru;Uy=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.setIntervalMining=e;async function e(r,{interval:t}){const i=r.mode==="hardhat"?t*1e3:t;await r.request({method:"evm_setIntervalMining",params:[i]})}return ru}var nu={},Ly;function nE(){if(Ly)return nu;Ly=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.setLoggingEnabled=e;async function e(r,t){await r.request({method:`${r.mode}_setLoggingEnabled`,params:[t]})}return nu}var ou={},Dy;function oE(){if(Dy)return ou;Dy=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.setMinGasPrice=r;const e=te();async function r(t,{gasPrice:i}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[(0,e.numberToHex)(i)]})}return ou}var iu={},Gy;function iE(){if(Gy)return iu;Gy=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.setNextBlockBaseFeePerGas=r;const e=te();async function r(t,{baseFeePerGas:i}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[(0,e.numberToHex)(i)]})}return iu}var au={},Vy;function aE(){if(Vy)return au;Vy=1,Object.defineProperty(au,"__esModule",{value:!0}),au.setNextBlockTimestamp=r;const e=te();async function r(t,{timestamp:i}){await t.request({method:"evm_setNextBlockTimestamp",params:[(0,e.numberToHex)(i)]})}return au}var su={},Wy;function sE(){if(Wy)return su;Wy=1,Object.defineProperty(su,"__esModule",{value:!0}),su.setNonce=r;const e=te();async function r(t,{address:i,nonce:o}){await t.request({method:`${t.mode}_setNonce`,params:[i,(0,e.numberToHex)(o)]})}return su}var uu={},Ky;function uE(){if(Ky)return uu;Ky=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.setRpcUrl=e;async function e(r,t){await r.request({method:`${r.mode}_setRpcUrl`,params:[t]})}return uu}var cu={},Zy;function cE(){if(Zy)return cu;Zy=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.setStorageAt=r;const e=te();async function r(t,{address:i,index:o,value:a}){await t.request({method:`${t.mode}_setStorageAt`,params:[i,typeof o=="number"?(0,e.numberToHex)(o):o,a]})}return cu}var du={},Jy;function dE(){if(Jy)return du;Jy=1,Object.defineProperty(du,"__esModule",{value:!0}),du.snapshot=e;async function e(r){return await r.request({method:"evm_snapshot"})}return du}var lu={},Yy;function lE(){if(Yy)return lu;Yy=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.stopImpersonatingAccount=e;async function e(r,{address:t}){await r.request({method:`${r.mode}_stopImpersonatingAccount`,params:[t]})}return lu}var Xy;function h1(){if(Xy)return Ms;Xy=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.testActions=I;const e=Hv(),r=kv(),t=Fv(),i=$v(),o=Nv(),a=zv(),n=Uv(),s=Lv(),u=Dv(),c=Gv(),l=Vv(),d=Wv(),f=Kv(),p=Zv(),y=Jv(),b=Yv(),w=Xv(),B=Qv(),x=eE(),M=tE(),A=rE(),O=nE(),E=oE(),_=iE(),P=aE(),m=sE(),T=uE(),g=cE(),v=dE(),h=lE();function I({mode:R}){return j=>{const S=j.extend(()=>({mode:R}));return{dropTransaction:C=>(0,e.dropTransaction)(S,C),dumpState:()=>(0,r.dumpState)(S),getAutomine:()=>(0,t.getAutomine)(S),getTxpoolContent:()=>(0,i.getTxpoolContent)(S),getTxpoolStatus:()=>(0,o.getTxpoolStatus)(S),impersonateAccount:C=>(0,a.impersonateAccount)(S,C),increaseTime:C=>(0,n.increaseTime)(S,C),inspectTxpool:()=>(0,s.inspectTxpool)(S),loadState:C=>(0,u.loadState)(S,C),mine:C=>(0,c.mine)(S,C),removeBlockTimestampInterval:()=>(0,l.removeBlockTimestampInterval)(S),reset:C=>(0,d.reset)(S,C),revert:C=>(0,f.revert)(S,C),sendUnsignedTransaction:C=>(0,p.sendUnsignedTransaction)(S,C),setAutomine:C=>(0,y.setAutomine)(S,C),setBalance:C=>(0,b.setBalance)(S,C),setBlockGasLimit:C=>(0,w.setBlockGasLimit)(S,C),setBlockTimestampInterval:C=>(0,B.setBlockTimestampInterval)(S,C),setCode:C=>(0,x.setCode)(S,C),setCoinbase:C=>(0,M.setCoinbase)(S,C),setIntervalMining:C=>(0,A.setIntervalMining)(S,C),setLoggingEnabled:C=>(0,O.setLoggingEnabled)(S,C),setMinGasPrice:C=>(0,E.setMinGasPrice)(S,C),setNextBlockBaseFeePerGas:C=>(0,_.setNextBlockBaseFeePerGas)(S,C),setNextBlockTimestamp:C=>(0,P.setNextBlockTimestamp)(S,C),setNonce:C=>(0,m.setNonce)(S,C),setRpcUrl:C=>(0,T.setRpcUrl)(S,C),setStorageAt:C=>(0,g.setStorageAt)(S,C),snapshot:()=>(0,v.snapshot)(S),stopImpersonatingAccount:C=>(0,h.stopImpersonatingAccount)(S,C)}}}return Ms}var Qy;function fE(){if(Qy)return qs;Qy=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.createTestClient=t;const e=bc(),r=h1();function t(i){const{key:o="test",name:a="Test Client",mode:n}=i;return(0,e.createClient)({...i,key:o,name:a,type:"testClient"}).extend(u=>({mode:n,...(0,r.testActions)({mode:n})(u)}))}return qs}var fu={},mu={},ep;function mE(){if(ep)return mu;
47ep=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.addChain=r;const e=te();async function r(t,{chain:i}){const{id:o,name:a,nativeCurrency:n,rpcUrls:s,blockExplorers:u}=i;await t.request({method:"wallet_addEthereumChain",params:[{chainId:(0,e.numberToHex)(o),chainName:a,nativeCurrency:n,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:c})=>c):void 0}]},{dedupe:!0,retryCount:0})}return mu}var bu={},tp;function bE(){if(tp)return bu;tp=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.deployContract=t;const e=wo(),r=fc();function t(i,o){const{abi:a,args:n,bytecode:s,...u}=o,c=(0,e.encodeDeployData)({abi:a,args:n,bytecode:s});return(0,r.sendTransaction)(i,{...u,...u.authorizationList?{to:null}:{},data:c})}return bu}var hu={},rp;function hE(){if(rp)return hu;rp=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.getAddresses=r;const e=et();async function r(t){return t.account?.type==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(o=>(0,e.checksumAddress)(o))}return hu}var yu={},np;function yE(){if(np)return yu;np=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.getCapabilities=t;const e=xe(),r=te();async function t(i,o={}){const{account:a=i.account,chainId:n}=o,s=a?(0,e.parseAccount)(a):void 0,u=n?[s?.address,[(0,r.numberToHex)(n)]]:[s?.address],c=await i.request({method:"wallet_getCapabilities",params:u}),l={};for(const[d,f]of Object.entries(c)){l[Number(d)]={};for(let[p,y]of Object.entries(f))p==="addSubAccount"&&(p="unstable_addSubAccount"),l[Number(d)][p]=y}return typeof n=="number"?l[n]:l}return yu}var pu={},op;function pE(){if(op)return pu;op=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.getPermissions=e;async function e(r){return await r.request({method:"wallet_getPermissions"},{dedupe:!0})}return pu}var gu={},ip;function y1(){if(ip)return gu;ip=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.prepareAuthorization=n;const e=xe(),r=qr(),t=ht(),i=_e(),o=un(),a=rc();async function n(s,u){const{account:c=s.account,chainId:l,nonce:d}=u;if(!c)throw new r.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const f=(0,e.parseAccount)(c),p=(()=>
47{if(u.executor)return u.executor==="self"?u.executor:(0,e.parseAccount)(u.executor)})(),y={address:u.contractAddress??u.address,chainId:l,nonce:d};return typeof y.chainId>"u"&&(y.chainId=s.chain?.id??await(0,i.getAction)(s,o.getChainId,"getChainId")({})),typeof y.nonce>"u"&&(y.nonce=await(0,i.getAction)(s,a.getTransactionCount,"getTransactionCount")({address:f.address,blockTag:"pending"}),(p==="self"||p?.address&&(0,t.isAddressEqual)(p.address,f.address))&&(y.nonce+=1)),y}return gu}var _u={},ap;function gE(){if(ap)return _u;ap=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.requestAddresses=r;const e=et();async function r(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(o=>(0,e.getAddress)(o))}return _u}var vu={},sp;function _E(){if(sp)return vu;sp=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.requestPermissions=e;async function e(r,t){return r.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}return vu}var Eu={},up;function vE(){if(up)return Eu;up=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.showCallsStatus=e;async function e(r,t){const{id:i}=t;await r.request({method:"wallet_showCallsStatus",params:[i]})}return Eu}var ju={},cp;function EE(){if(cp)return ju;cp=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.signAuthorization=i;const e=xe(),r=qr(),t=y1();async function i(o,a){const{account:n=o.account}=a;if(!n)throw new r.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const s=(0,e.parseAccount)(n);if(!s.signAuthorization)throw new r.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:s.type});const u=await(0,t.prepareAuthorization)(o,a);return s.signAuthorization(u)}return ju}var wu={},dp;function jE(){if(dp)return wu;dp=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.signMessage=i;const e=xe(),r=qr(),t=te();async function i(o,{account:a=o.account,message:n}){if(!a)throw new r.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const s=(0,e.parseAccount)(a);if(s.signMessage)return s.signMessage({message:n});const u=typeof n=="string"?(0,t.stringToHex)(n):n.raw instanceof Uint8Array?(0,t.toHex)(n.raw):n.raw;return o.request({method:"personal_sign",params:[u,s.address]},{retryCount:0})}return wu}var Pu={},lp;function wE(){if(lp)return Pu;lp=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.signTransaction=u;const e=xe(),r=qr(),t=lc(),i=te(),o=zt(),a=_e(),n=Ut(),s=un();async function u(c,l){const{account:d=c.account,chain:f=c.chain,...p}=l;if(!d)throw new r.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const y=(0,e.parseAccount)(d);(0,n.assertRequest)({account:y,...l});const b=await(0,a.getAction)(c,s.getChainId,"getChainId")({});f!==null&&(0,t.assertCurrentChain)({currentChainId:b,chain:f});const B=(f?.formatters||c.chain?.formatters)?.transactionRequest?.format||o.formatTransactionRequest;return y.signTransaction?y.signTransaction({...p,chainId:b},{serializer:c.chain?.serializers?.transaction}):await c.request({method:"eth_signTransaction",params:[{...B(p),chainId:(0,i.numberToHex)(b),from:y.address}]},{retryCount:0})}return Pu}var Au={},fp;function PE(){if(fp)return Au;fp=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.signTypedData=i;const e=xe(),r=qr(),t=yc();async function i(o,a){const{account:n=o.account,domain:s,message:u,primaryType:c}=a;if(!n)throw new r.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const l=(0,e.parseAccount)(n),d={EIP712Domain:(0,t.getTypesForEIP712Domain)({domain:s}),...a.types};if((0,t.validateTypedData)({domain:s,message:u,primaryType:c,types:d}),l.signTypedData)return l.signTypedData({domain:s,message:u,primaryType:c,types:d});const f=(0,t.serializeTypedData)({domain:s,message:u,primaryType:c,types:d});return o.request({method:"eth_signTypedData_v4",params:[l.address,f]},{retryCount:0})}return Au}var Tu={},mp;function AE(){if(mp)return Tu;mp=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.switchChain=r;const e=te();async function r(t,{id:i}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,e.numberToHex)(i)}]},{retryCount:0})}return Tu}var Iu={},bp;function TE(){if(bp)return Iu;
47bp=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.watchAsset=e;async function e(r,t){return await r.request({method:"wallet_watchAsset",params:t},{retryCount:0})}return Iu}var hp;function p1(){if(hp)return fu;hp=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.walletActions=_;const e=un(),r=mE(),t=bE(),i=hE(),o=Pg(),a=yE(),n=pE(),s=y1(),u=sc(),c=gE(),l=_E(),d=wg(),f=Jd(),p=fc(),y=vE(),b=EE(),w=jE(),B=wE(),x=PE(),M=AE(),A=Ag(),O=TE(),E=jg();function _(P){return{addChain:m=>(0,r.addChain)(P,m),deployContract:m=>(0,t.deployContract)(P,m),getAddresses:()=>(0,i.getAddresses)(P),getCallsStatus:m=>(0,o.getCallsStatus)(P,m),getCapabilities:m=>(0,a.getCapabilities)(P,m),getChainId:()=>(0,e.getChainId)(P),getPermissions:()=>(0,n.getPermissions)(P),prepareAuthorization:m=>(0,s.prepareAuthorization)(P,m),prepareTransactionRequest:m=>(0,u.prepareTransactionRequest)(P,m),requestAddresses:()=>(0,c.requestAddresses)(P),requestPermissions:m=>(0,l.requestPermissions)(P,m),sendCalls:m=>(0,d.sendCalls)(P,m),sendRawTransaction:m=>(0,f.sendRawTransaction)(P,m),sendTransaction:m=>(0,p.sendTransaction)(P,m),showCallsStatus:m=>(0,y.showCallsStatus)(P,m),signAuthorization:m=>(0,b.signAuthorization)(P,m),signMessage:m=>(0,w.signMessage)(P,m),signTransaction:m=>(0,B.signTransaction)(P,m),signTypedData:m=>(0,x.signTypedData)(P,m),switchChain:m=>(0,M.switchChain)(P,m),waitForCallsStatus:m=>(0,A.waitForCallsStatus)(P,m),watchAsset:m=>(0,O.watchAsset)(P,m),writeContract:m=>(0,E.writeContract)(P,m)}}return fu}var Su={},yp;function IE(){if(yp)return Su;yp=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.createWalletClient=t;const e=bc(),r=p1();function t(i){const{key:o="wallet",name:a="Wallet Client",transport:n}=i;return(0,e.createClient)({...i,key:o,name:a,transport:n,type:"walletClient"}).extend(r.walletActions)}return Su}var Bu={},pp;function SE(){if(pp)return Bu;pp=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.webSocket=a;const e=bt(),r=Xd(),t=$g(),i=nl(),o=To();function a(n,s={}){const{keepAlive:u,key:c="webSocket",methods:l,name:d="WebSocket JSON-RPC",reconnect:f,retryDelay:p}=s;return({chain:y,retryCount:b,timeout:w})=>{const B=s.retryCount??b,x=w??s.timeout??1e4,M=n||y?.rpcUrls.default.webSocket?.[0],A={keepAlive:u,reconnect:f};if(!M)throw new r.UrlRequiredError;return(0,o.createTransport)({key:c,methods:l,name:d,async request({method:O,params:E}){const _={method:O,params:E},P=await(0,i.getWebSocketRpcClient)(M,A),{error:m,result:T}=await P.requestAsync({body:_,timeout:x});if(m)throw new e.RpcRequestError({body:_,error:m,url:M});return T},retryCount:B,retryDelay:p,timeout:x,type:"webSocket"},{getSocket(){return(0,t.getSocket)(M)},getRpcClient(){return(0,i.getWebSocketRpcClient)(M,A)},async subscribe({params:O,onData:E,onError:_}){const P=await(0,i.getWebSocketRpcClient)(M,A),{result:m}=await new Promise((T,g)=>P.request({body:{method:"eth_subscribe",params:O},onError(v){g(v),_?.(v)},onResponse(v){if(v.error){g(v.error),_?.(v.error);return}if(typeof v.id=="number"){T(v);return}v.method==="eth_subscription"&&E(v.params)}}));return{subscriptionId:m,async unsubscribe(){return new Promise(T=>P.request({body:{method:"eth_unsubscribe",params:[m]},onResponse:T}))}}}})}}return Bu}var ao={},gp;function BE(){if(gp)return ao;gp=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.ProviderRpcError=void 0;class e extends Error{constructor(t,i){super(i),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t,this.details=i}}return ao.ProviderRpcError=e,ao}var Ru={},_p;function RE(){if(_p)return Ru;_p=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.decodeDeployData=i;const e=Ie(),r=nr(),t="/docs/contract/decodeDeployData";function i(o){const{abi:a,bytecode:n,data:s}=o;if(s===n)return{bytecode:n};const u=a.find(l=>"type"in l&&l.type==="constructor");if(!u)throw new e.AbiConstructorNotFoundError({docsPath:t});if(!("inputs"in u))throw new e.AbiConstructorParamsNotFoundError({docsPath:t});if(!u.inputs||u.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:t});return{args:(0,r.decodeAbiParameters)(u.inputs,`0x${s.replace(n,"")}`),bytecode:n}}return Ru}var Ou={},vp;function OE(){if(vp)return Ou;
47vp=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.compactSignatureToSignature=t;const e=we(),r=te();function t({r:i,yParityAndS:o}){const a=(0,e.hexToBytes)(o),n=a[0]&128?1:0,s=a;return n===1&&(s[0]&=127),{r:i,s:(0,r.bytesToHex)(s),yParity:n}}return Ou}var Cu={},Ep;function CE(){if(Ep)return Cu;Ep=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.parseCompactSignature=t;const e=ho(),r=te();function t(i){const{r:o,s:a}=e.secp256k1.Signature.fromCompact(i.slice(2,130));return{r:(0,r.numberToHex)(o,{size:32}),yParityAndS:(0,r.numberToHex)(a,{size:32})}}return Cu}var xu={},jp;function xE(){if(jp)return xu;jp=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.parseSignature=t;const e=ho(),r=te();function t(i){const{r:o,s:a}=e.secp256k1.Signature.fromCompact(i.slice(2,130)),n=+`0x${i.slice(130)}`,[s,u]=(()=>{if(n===0||n===1)return[void 0,n];if(n===27)return[BigInt(n),0];if(n===28)return[BigInt(n),1];throw new Error("Invalid yParityOrV value")})();return typeof s<"u"?{r:(0,r.numberToHex)(o,{size:32}),s:(0,r.numberToHex)(a,{size:32}),v:s,yParity:u}:{r:(0,r.numberToHex)(o,{size:32}),s:(0,r.numberToHex)(a,{size:32}),yParity:u}}return xu}var qu={},wp;function qE(){if(wp)return qu;
47wp=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.recoverTransactionAddress=o;const e=We(),r=ml(),t=gc(),i=sr();async function o(a){const{serializedTransaction:n,signature:s}=a,u=(0,r.parseTransaction)(n),c=s??{r:u.r,s:u.s,v:u.v,yParity:u.yParity},l=(0,t.serializeTransaction)({...u,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await(0,i.recoverAddress)({hash:(0,e.keccak256)(l),signature:c})}return qu}var Mu={},Pp;function ME(){if(Pp)return Mu;Pp=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.signatureToCompactSignature=t;const e=we(),r=te();function t(i){const{r:o,s:a,v:n,yParity:s}=i,u=Number(s??n-27n);let c=a;if(u===1){const l=(0,e.hexToBytes)(a);l[0]|=128,c=(0,r.bytesToHex)(l)}return{r:o,yParityAndS:c}}return Mu}var Hu={},Ap;function HE(){if(Ap)return Hu;Ap=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.serializeCompactSignature=t;const e=ho(),r=Ce();function t({r:i,yParityAndS:o}){return`0x${new e.secp256k1.Signature((0,r.hexToBigInt)(i),(0,r.hexToBigInt)(o)).toCompactHex()}`}return Hu}var ku={},Tp;function kE(){if(Tp)return ku;Tp=1,Object.defineProperty(ku,"__esModule",{value:!0}),ku.sidecarsToVersionedHashes=r;const e=qd();function r(t){const{sidecars:i,version:o}=t,a=t.to??(typeof i[0].blob=="string"?"hex":"bytes"),n=[];for(const{commitment:s}of i)n.push((0,e.commitmentToVersionedHash)({commitment:s,to:a,version:o}));return n}return ku}var Fu={},Ip;function FE(){if(Ip)return Fu;Ip=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.fromBlobs=i;const e=lo(),r=we(),t=te();function i(o){const a=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),n=typeof o.blobs[0]=="string"?o.blobs.map(d=>(0,r.hexToBytes)(d)):o.blobs,s=n.reduce((d,f)=>d+f.length,0),u=(0,e.createCursor)(new Uint8Array(s));let c=!0;for(const d of n){const f=(0,e.createCursor)(d);for(;c&&f.position<d.length;){f.incrementPosition(1);let p=31;d.length-f.position<31&&(p=d.length-f.position);for(const y in Array.from({length:p})){const b=f.readByte();if(b===128&&!f.inspectBytes(f.remaining).includes(128)){c=!1;break}u.pushByte(b)}}}const l=u.bytes.slice(0,u.position);return a==="hex"?(0,t.bytesToHex)(l):l}return Fu}var $u={},Sp;function g1(){if(Sp)return $u;Sp=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.defineKzg=e;function e({blobToKzgCommitment:r,computeBlobKzgProof:t}){return{blobToKzgCommitment:r,computeBlobKzgProof:t}}return $u}var Nu={},Bp;function $E(){if(Bp)return Nu;Bp=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.setupKzg=r;const e=g1();function r(t,i){try{t.loadTrustedSetup(i)}catch(o){const a=o;if(!a.message.includes("trusted setup is already loaded"))throw a}return(0,e.defineKzg)(t)}return Nu}var Rp;function NE(){return Rp||(Rp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxInt8=e.weiUnits=e.gweiUnits=e.etherUnits=e.universalSignatureValidatorByteCode=e.deploylessCallViaFactoryBytecode=e.deploylessCallViaBytecodeBytecode=e.zeroAddress=e.ethAddress=e.universalSignatureValidatorAbi=e.erc4626Abi=e.erc1155Abi=e.erc721Abi=e.erc20Abi_bytes32=e.erc20Abi=e.multicall3Abi=e.webSocket=e.createWalletClient=e.createTransport=e.walletActions=e.testActions=e.publicActions=e.createTestClient=e.createPublicClient=e.http=e.shouldThrow=e.fallback=e.custom=e.rpcSchema=e.createClient=e.WaitForCallsStatusTimeoutError=e.getContract=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.UnknownSignatureError=e.UnknownTypeError=e.SolidityProtectedKeywordError=e.InvalidStructSignatureError=e.InvalidSignatureError=e.InvalidParenthesisError=e.InvalidParameterError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.InvalidAbiItemError=e.InvalidAbiParametersError=e.InvalidAbiParameterError=e.CircularReferenceError=void 0,e.maxUint152=e.maxUint144=e.maxUint136=e.maxUint128=e.maxUint120=e.maxUint112=e.maxUint104=e.maxUint96=e.maxUint88=e.maxUint80=e.maxUint72=e.maxUint64=e.maxUint56=e.maxUint48=e.maxUint40=e.maxUint32=e.maxUint24=e.maxUint16=e.maxUint8=e.maxInt256=e.maxInt248=e.maxInt240=e.maxInt232=e.maxInt224=e.maxInt216=e.maxInt208=e.max
47Int200=e.maxInt192=e.maxInt184=e.maxInt176=e.maxInt168=e.maxInt160=e.maxInt152=e.maxInt144=e.maxInt136=e.maxInt128=e.maxInt120=e.maxInt112=e.maxInt104=e.maxInt96=e.maxInt88=e.maxInt80=e.maxInt72=e.maxInt64=e.maxInt56=e.maxInt48=e.maxInt40=e.maxInt32=e.maxInt24=e.maxInt16=void 0,e.AbiDecodingDataSizeInvalidError=e.AbiConstructorParamsNotFoundError=e.AbiConstructorNotFoundError=e.presignMessagePrefix=e.zeroHash=e.minInt256=e.minInt248=e.minInt240=e.minInt232=e.minInt224=e.minInt216=e.minInt208=e.minInt200=e.minInt192=e.minInt184=e.minInt176=e.minInt168=e.minInt160=e.minInt152=e.minInt144=e.minInt136=e.minInt128=e.minInt120=e.minInt112=e.minInt104=e.minInt96=e.minInt88=e.minInt80=e.minInt72=e.minInt64=e.minInt56=e.minInt48=e.minInt40=e.minInt32=e.minInt24=e.minInt16=e.minInt8=e.maxUint256=e.maxUint248=e.maxUint240=e.maxUint232=e.maxUint224=e.maxUint216=e.maxUint208=e.maxUint200=e.maxUint192=e.maxUint184=e.maxUint176=e.maxUint168=e.maxUint160=void 0,e.ProviderRpcError=e.ProviderDisconnectedError=e.ParseRpcError=e.MethodNotSupportedRpcError=e.MethodNotFoundRpcError=e.LimitExceededRpcError=e.JsonRpcVersionUnsupportedError=e.InvalidRequestRpcError=e.InvalidParamsRpcError=e.InvalidInputRpcError=e.InternalRpcError=e.DuplicateIdError=e.ChainDisconnectedError=e.BundleTooLargeError=e.AtomicityNotSupportedError=e.AtomicReadyWalletRejectedUpgradeError=e.MaxFeePerGasTooLowError=e.Eip1559FeesNotSupportedError=e.BaseFeeScalarError=e.CounterfactualDeploymentFailedError=e.RawContractError=e.ContractFunctionZeroDataError=e.ContractFunctionRevertedError=e.ContractFunctionExecutionError=e.CallExecutionError=e.BlockNotFoundError=e.setErrorConfig=e.BaseError=e.UnsupportedPackedAbiType=e.InvalidDefinitionTypeError=e.InvalidArrayError=e.InvalidAbiEncodingTypeError=e.InvalidAbiDecodingTypeError=e.DecodeLogTopicsMismatch=e.DecodeLogDataMismatch=e.BytesSizeMismatchError=e.AbiFunctionSignatureNotFoundError=e.AbiFunctionOutputsNotFoundError=e.AbiFunctionNotFoundError=e.AbiEventSignatureNotFoundError=e.AbiEventSignatureEmptyTopicsError=e.AbiEventNotFoundError=e.AbiErrorSignatureNotFoundError=e.AbiErrorNotFoundError=e.AbiErrorInputsNotFoundError=e.AbiEncodingBytesSizeMismatchError=e.AbiEncodingLengthMismatchError=e.AbiEncodingArrayLengthMismatchError=e.AbiDecodingZeroDataError=e.AbiDecodingDataSizeTooSmallError=void 0,e.InvalidSerializedTransactionError=e.InvalidSerializableTransactionError=e.InvalidLegacyVError=e.FeeConflictError=e.InvalidAddressError=e.WebSocketRequestError=e.SocketClosedError=e.TimeoutError=e.RpcRequestError=e.HttpRequestError=e.FilterTypeNotSupportedError=e.UnknownNodeError=e.TransactionTypeNotSupportedError=e.TipAboveFeeCapError=e.NonceTooLowError=e.NonceTooHighError=e.NonceMaxValueError=e.IntrinsicGasTooLowError=e.IntrinsicGasTooHighError=e.InsufficientFundsError=e.FeeCapTooLowError=e.FeeCapTooHighError=e.ExecutionRevertedError=e.EstimateGasExecutionError=e.InvalidDecimalNumberError=e.EnsAvatarUnsupportedNamespaceError=e.EnsAvatarInvalidNftUriError=e.EnsAvatarUriResolutionError=e.SizeOverflowError=e.InvalidHexValueError=e.InvalidHexBooleanError=e.IntegerOutOfRangeError=e.InvalidBytesBooleanError=e.InvalidChainIdError=e.ClientChainNotConfiguredError=e.ChainNotFoundError=e.ChainMismatchError=e.ChainDoesNotSupportContract=e.UserRejectedRequestError=e.UnsupportedProviderMethodError=e.UnsupportedNonOptionalCapabilityError=e.UnsupportedChainIdError=e.UnknownRpcError=e.UnknownBundleIdError=e.UnauthorizedProviderError=e.TransactionRejectedRpcError=e.SwitchChainError=e.RpcError=e.ResourceUnavailableRpcError=e.ResourceNotFoundRpcError=void 0,e.hashStruct=e.hashDomain=e.getTransactionType=e.getSerializedTransactionType=e.getCreateAddress=e.getCreate2Address=e.getContractAddress=e.getAbiItem=e.rpcTransactionType=e.formatTransactionRequest=e.defineTransactionRequest=e.formatTransactionReceipt=e.defineTransactionReceipt=e.transactionType=e.formatTransaction=e.defineTransaction=e.parseEventLogs=e.encodeFunctionResult=e.prepareEncodeFunctionData=e.encodeFunctionData=e.encodeEventTopics=e.encodeErrorResult=e.encodeDeployData=e.encodeAbiParameters=e.decodeFunctionResult=e.decodeFunctionData=e.decodeEventLog=e.decodeErrorResult=e.decodeDeployData=e.decodeAbiParameters=e.formatLog=e.formatBlock=e.defineBlock=e.namehash=e.labelhash=e.EIP
471193ProviderRpcError=e.InvalidStructTypeError=e.InvalidPrimaryTypeError=e.InvalidDomainError=e.StateAssignmentConflictError=e.AccountStateConflictError=e.UrlRequiredError=e.SliceOffsetOutOfBoundsError=e.SizeExceedsPaddingSizeError=e.WaitForTransactionReceiptTimeoutError=e.TransactionReceiptNotFoundError=e.TransactionNotFoundError=e.TransactionExecutionError=e.InvalidStorageKeySizeError=e.InvalidSerializedTransactionTypeError=void 0,e.blobsToCommitments=e.offchainLookupSignature=e.offchainLookupAbiItem=e.offchainLookup=e.ccipFetch=e.ccipRequest=e.fromBytes=e.bytesToString=e.bytesToNumber=e.bytesToBool=e.bytesToBigInt=e.toHex=e.stringToHex=e.numberToHex=e.bytesToHex=e.boolToHex=e.toBytes=e.stringToBytes=e.numberToBytes=e.hexToBytes=e.boolToBytes=e.assertTransactionLegacy=e.assertTransactionEIP2930=e.assertTransactionEIP1559=e.assertRequest=e.serializeErc6492Signature=e.isErc6492Signature=e.parseErc6492Signature=e.verifyTypedData=e.verifyMessage=e.verifyHash=e.toRlp=e.hexToRlp=e.bytesToRlp=e.serializeSignature=e.signatureToHex=e.serializeCompactSignature=e.compactSignatureToHex=e.signatureToCompactSignature=e.recoverTypedDataAddress=e.recoverTransactionAddress=e.recoverPublicKey=e.recoverMessageAddress=e.recoverAddress=e.parseSignature=e.hexToSignature=e.parseCompactSignature=e.hexToCompactSignature=e.compactSignatureToSignature=e.hashTypedData=void 0,e.keccak256=e.isHex=e.isHash=e.isBytes=e.isAddressEqual=e.isAddress=e.toPrefixedMessage=e.hashMessage=e.toFunctionHash=e.toEventHash=e.getFunctionSignature=e.toFunctionSignature=e.getEventSignature=e.toEventSignature=e.getFunctionSelector=e.toFunctionSelector=e.getEventSelector=e.toEventSelector=e.getContractError=e.getAddress=e.checksumAddress=e.fromRlp=e.hexToString=e.hexToNumber=e.hexToBool=e.hexToBigInt=e.fromHex=e.formatUnits=e.formatGwei=e.formatEther=e.withTimeout=e.withRetry=e.withCache=e.encodePacked=e.getChainContractAddress=e.extractChain=e.defineChain=e.assertCurrentChain=e.concatHex=e.concatBytes=e.concat=e.setupKzg=e.defineKzg=e.toBlobs=e.toBlobSidecars=e.fromBlobs=e.blobsToProofs=e.sidecarsToVersionedHashes=e.commitmentsToVersionedHashes=e.commitmentToVersionedHash=void 0,e.nonceManager=e.createNonceManager=e.getTypesForEIP712Domain=e.domainSeparator=e.validateTypedData=e.serializeTypedData=e.trim=e.stringify=e.sliceHex=e.sliceBytes=e.slice=e.size=e.serializeTransaction=e.serializeAccessList=e.parseUnits=e.parseTransaction=e.parseGwei=e.parseEther=e.padHex=e.padBytes=e.pad=e.ripemd160=e.sha256=void 0;var r=tr();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return r.CircularReferenceError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return r.InvalidAbiParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return r.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return r.InvalidAbiItemError}}),Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return r.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return r.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return r.InvalidModifierError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return r.InvalidParameterError}}),Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return r.InvalidParenthesisError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return r.InvalidSignatureError}}),Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return r.InvalidStructSignatureError}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return r.SolidityProtectedKeywordError}}),Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return r.UnknownTypeError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return r.UnknownSignatureError}}),Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return r.parseAbi}}),Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return r.parseAbiItem}}),Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return r.parseAbiParameter}}),Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return r.parseAbiParameters}});var t=U_();Object.defineProperty(e,"getContract",{enumerable:!0,get:function(){return t.getContract}});var i=Ag();Object.defineProperty(e,"WaitForCallsStatusTimeoutError",{enumerable:!0,get:function(){return i.WaitForCallsStatusTimeoutError}});var o=bc();Object.defineProperty(e,"createClient",{enumerable:!0,get:function(){return o.createClient}}),Object.defineProperty(e,"rpcSchema",{enumerable:!0,get:function(){return o.rpcSchema}});var a=D_();Object.defineProperty(e,"custom",{enumerable:!0,get:function(){return a.custom}});var n=G_();Object.defineProperty(e,"fallback",{enumerable:!0,get:function(){return n.fallback}}),Object.defineProperty(e,"shouldThrow",{enumerable:!0,get:function(){return n.shouldThrow}});var s=V_();Object.defineProperty(e,"http",{enumerable:!0,get:function(){return s.http}});var u=Mv();Object.defineProperty(e,"createPublicClient",{enumerable:!0,get:function(){return u.createPublicClient}});var c=fE();Object.defineProperty(e,"createTestClient",{enumerable:!0,get:function(){return c.createTestClient}});var l=b1();Object.defineProperty(e,"publicActions",{enumerable:!0,get:function(){return l.publicActions}});var d=h1();Object.defineProperty(e,"testActions",{enumerable:!0,get:function(){return d.testActions}});var f=p1();Object.defineProperty(e,"walletActions",{enumerable:!0,get:function(){return f.walletActions}});var p=To();Object.defineProperty(e,"createTransport",{enumerable:!0,get:function(){return p.createTransport}});var y=IE();Object.defineProperty(e,"createWalletClient",{enumerable:!0,get:function(){return y.createWalletClient}});var b=SE();Object.defineProperty(e,"webSocket",{enumerable:!0,get:function(){return b.webSocket}});var w=ur();Object.defineProperty(e,"multicall3Abi",{enumerable:!0,get:function(){return w.multicall3Abi}}),Object.defineProperty(e,"erc20Abi",{enumerable:!0,get:function(){return w.erc20Abi}}),Object.defineProperty(e,"erc20Abi_bytes32",{enumerable:!0,get:function(){return w.erc20Abi_bytes32}}
47),Object.defineProperty(e,"erc721Abi",{enumerable:!0,get:function(){return w.erc721Abi}}),Object.defineProperty(e,"erc1155Abi",{enumerable:!0,get:function(){return w.erc1155Abi}}),Object.defineProperty(e,"erc4626Abi",{enumerable:!0,get:function(){return w.erc4626Abi}}),Object.defineProperty(e,"universalSignatureValidatorAbi",{enumerable:!0,get:function(){return w.universalSignatureValidatorAbi}});var B=l1();Object.defineProperty(e,"ethAddress",{enumerable:!0,get:function(){return B.ethAddress}}),Object.defineProperty(e,"zeroAddress",{enumerable:!0,get:function(){return B.zeroAddress}});var x=uc();Object.defineProperty(e,"deploylessCallViaBytecodeBytecode",{enumerable:!0,get:function(){return x.deploylessCallViaBytecodeBytecode}}),Object.defineProperty(e,"deploylessCallViaFactoryBytecode",{enumerable:!0,get:function(){return x.deploylessCallViaFactoryBytecode}}),Object.defineProperty(e,"universalSignatureValidatorByteCode",{enumerable:!0,get:function(){return x.universalSignatureValidatorByteCode}});var M=fo();Object.defineProperty(e,"etherUnits",{enumerable:!0,get:function(){return M.etherUnits}}),Object.defineProperty(e,"gweiUnits",{enumerable:!0,get:function(){return M.gweiUnits}}),Object.defineProperty(e,"weiUnits",{enumerable:!0,get:function(){return M.weiUnits}});var A=Rd();Object.defineProperty(e,"maxInt8",{enumerable:!0,get:function(){return A.maxInt8}}),Object.defineProperty(e,"maxInt16",{enumerable:!0,get:function(){return A.maxInt16}}),Object.defineProperty(e,"maxInt24",{enumerable:!0,get:function(){return A.maxInt24}}),Object.defineProperty(e,"maxInt32",{enumerable:!0,get:function(){return A.maxInt32}}),Object.defineProperty(e,"maxInt40",{enumerable:!0,get:function(){return A.maxInt40}}),Object.defineProperty(e,"maxInt48",{enumerable:!0,get:function(){return A.maxInt48}}),Object.defineProperty(e,"maxInt56",{enumerable:!0,get:function(){return A.maxInt56}}),Object.defineProperty(e,"maxInt64",{enumerable:!0,get:function(){return A.maxInt64}}),Object.defineProperty(e,"maxInt72",{enumerable:!0,get:function(){return A.maxInt72}}),Object.defineProperty(e,"maxInt80",{enumerable:!0,get:function(){return A.maxInt80}}),Object.defineProperty(e,"maxInt88",{enumerable:!0,get:function(){return A.maxInt88}}),Object.defineProperty(e,"maxInt96",{enumerable:!0,get:function(){return A.maxInt96}}),Object.defineProperty(e,"maxInt104",{enumerable:!0,get:function(){return A.maxInt104}}),Object.defineProperty(e,"maxInt112",{enumerable:!0,get:function(){return A.maxInt112}}),Object.defineProperty(e,"maxInt120",{enumerable:!0,get:function(){return A.maxInt120}}),Object.defineProperty(e,"maxInt128",{enumerable:!0,get:function(){return A.maxInt128}}),Object.defineProperty(e,"maxInt136",{enumerable:!0,get:function(){return A.maxInt136}}),Object.defineProperty(e,"maxInt144",{enumerable:!0,get:function(){return A.maxInt144}}),Object.defineProperty(e,"maxInt152",{enumerable:!0,get:function(){return A.maxInt152}}),Object.defineProperty(e,"maxInt160",{enumerable:!0,get:function(){return A.maxInt160}}),Object.defineProperty(e,"maxInt168",{enumerable:!0,get:function(){return A.maxInt168}}),Object.defineProperty(e,"maxInt176",{enumerable:!0,get:function(){return A.maxInt176}}),Object.defineProperty(e,"maxInt184",{enumerable:!0,get:function(){return A.maxInt184}}),Object.defineProperty(e,"maxInt192",{enumerable:!0,get:function(){return A.maxInt192}}),Object.defineProperty(e,"maxInt200",{enumerable:!0,get:function(){return A.maxInt200}}),Object.defineProperty(e,"maxInt208",{enumerable:!0,get:function(){return A.maxInt208}}),Object.defineProperty(e,"maxInt216",{enumerable:!0,get:function(){return A.maxInt216}}),Object.defineProperty(e,"maxInt224",{enumerable:!0,get:function(){return A.maxInt224}}),Object.defineProperty(e,"maxInt232",{enumerable:!0,get:function(){return A.maxInt232}}),Object.defineProperty(e,"maxInt240",{enumerable:!0,get:function(){return A.maxInt240}}),Object.defineProperty(e,"maxInt248",{enumerable:!0,get:function(){return A.maxInt248}}),Object.defineProperty(e,"maxInt256",{enumerable:!0,get:function(){return A.maxInt256}}),Object.defineProperty(e,"maxUint8",{enumerable:!0,get:function(){return A.maxUint8}}),Object.defineProperty(e,"maxUint16",{enumerable:!0,get:function(){return A.maxUint16}}),Object.defineProperty(e,"maxUint24",{enumerable:!0,get:function(){return A.maxUint24}}
47),Object.defineProperty(e,"maxUint32",{enumerable:!0,get:function(){return A.maxUint32}}),Object.defineProperty(e,"maxUint40",{enumerable:!0,get:function(){return A.maxUint40}}),Object.defineProperty(e,"maxUint48",{enumerable:!0,get:function(){return A.maxUint48}}),Object.defineProperty(e,"maxUint56",{enumerable:!0,get:function(){return A.maxUint56}}),Object.defineProperty(e,"maxUint64",{enumerable:!0,get:function(){return A.maxUint64}}),Object.defineProperty(e,"maxUint72",{enumerable:!0,get:function(){return A.maxUint72}}),Object.defineProperty(e,"maxUint80",{enumerable:!0,get:function(){return A.maxUint80}}),Object.defineProperty(e,"maxUint88",{enumerable:!0,get:function(){return A.maxUint88}}),Object.defineProperty(e,"maxUint96",{enumerable:!0,get:function(){return A.maxUint96}}),Object.defineProperty(e,"maxUint104",{enumerable:!0,get:function(){return A.maxUint104}}),Object.defineProperty(e,"maxUint112",{enumerable:!0,get:function(){return A.maxUint112}}),Object.defineProperty(e,"maxUint120",{enumerable:!0,get:function(){return A.maxUint120}}),Object.defineProperty(e,"maxUint128",{enumerable:!0,get:function(){return A.maxUint128}}),Object.defineProperty(e,"maxUint136",{enumerable:!0,get:function(){return A.maxUint136}}),Object.defineProperty(e,"maxUint144",{enumerable:!0,get:function(){return A.maxUint144}}),Object.defineProperty(e,"maxUint152",{enumerable:!0,get:function(){return A.maxUint152}}),Object.defineProperty(e,"maxUint160",{enumerable:!0,get:function(){return A.maxUint160}}),Object.defineProperty(e,"maxUint168",{enumerable:!0,get:function(){return A.maxUint168}}),Object.defineProperty(e,"maxUint176",{enumerable:!0,get:function(){return A.maxUint176}}),Object.defineProperty(e,"maxUint184",{enumerable:!0,get:function(){return A.maxUint184}}),Object.defineProperty(e,"maxUint192",{enumerable:!0,get:function(){return A.maxUint192}}),Object.defineProperty(e,"maxUint200",{enumerable:!0,get:function(){return A.maxUint200}}),Object.defineProperty(e,"maxUint208",{enumerable:!0,get:function(){return A.maxUint208}}),Object.defineProperty(e,"maxUint216",{enumerable:!0,get:function(){return A.maxUint216}}),Object.defineProperty(e,"maxUint224",{enumerable:!0,get:function(){return A.maxUint224}}),Object.defineProperty(e,"maxUint232",{enumerable:!0,get:function(){return A.maxUint232}}),Object.defineProperty(e,"maxUint240",{enumerable:!0,get:function(){return A.maxUint240}}),Object.defineProperty(e,"maxUint248",{enumerable:!0,get:function(){return A.maxUint248}}),Object.defineProperty(e,"maxUint256",{enumerable:!0,get:function(){return A.maxUint256}}),Object.defineProperty(e,"minInt8",{enumerable:!0,get:function(){return A.minInt8}}),Object.defineProperty(e,"minInt16",{enumerable:!0,get:function(){return A.minInt16}}),Object.defineProperty(e,"minInt24",{enumerable:!0,get:function(){return A.minInt24}}),Object.defineProperty(e,"minInt32",{enumerable:!0,get:function(){return A.minInt32}}),Object.defineProperty(e,"minInt40",{enumerable:!0,get:function(){return A.minInt40}}),Object.defineProperty(e,"minInt48",{enumerable:!0,get:function(){return A.minInt48}}),Object.defineProperty(e,"minInt56",{enumerable:!0,get:function(){return A.minInt56}}),Object.defineProperty(e,"minInt64",{enumerable:!0,get:function(){return A.minInt64}}),Object.defineProperty(e,"minInt72",{enumerable:!0,get:function(){return A.minInt72}}),Object.defineProperty(e,"minInt80",{enumerable:!0,get:function(){return A.minInt80}}),Object.defineProperty(e,"minInt88",{enumerable:!0,get:function(){return A.minInt88}}),Object.defineProperty(e,"minInt96",{enumerable:!0,get:function(){return A.minInt96}}),Object.defineProperty(e,"minInt104",{enumerable:!0,get:function(){return A.minInt104}}),Object.defineProperty(e,"minInt112",{enumerable:!0,get:function(){return A.minInt112}}),Object.defineProperty(e,"minInt120",{enumerable:!0,get:function(){return A.minInt120}}),Object.defineProperty(e,"minInt128",{enumerable:!0,get:function(){return A.minInt128}}),Object.defineProperty(e,"minInt136",{enumerable:!0,get:function(){return A.minInt136}}),Object.defineProperty(e,"minInt144",{enumerable:!0,get:function(){return A.minInt144}}),Object.defineProperty(e,"minInt152",{enumerable:!0,get:function(){return A.minInt152}}),Object.defineProperty(e,"minInt160",{enumerable:!0,get:function(){return A.minInt160}}),Object.defineProperty(e,"minInt168",{enumerable:!0,get:function(){return A.minInt168}}),Object.defineProperty(e,"minInt176",{enumerable:!0,get:function(){return A.minInt176}}),Object.defineProperty(e,"minInt184",{enumerable:!0,get:function(){return A.minInt184}}),Object.defineProperty(e,"minInt192",{enumerable:!0,get:function(){return A.minInt192}}),Object.defineProperty(e,"minInt200",{enumerable:!0,get:function(){return A.minInt200}}),Object.defineProperty(e,"minInt208",{enumerable:!0,get:function(){return A.minInt208}}),Object.defineProperty(e,"minInt216",{enumerable:!0,get:function(){return A.minInt216}}),Object.defineProperty(e,"minInt224",{enumerable:!0,get:function(){return A.minInt224}}),Object.defineProperty(e,"minInt232",{enumerable:!0,get:function(){return A.minInt232}}),Object.defineProperty(e,"minInt240",{enumerable:!0,get:function(){return A.minInt240}}),Object.defineProperty(e,"minInt248",{enumerable:!0,get:function(){return A.minInt248}}),Object.defineProperty(e,"minInt256",{enumerable:!0,get:function(){return A.minInt256}});var O=dl();Object.defineProperty(e,"zeroHash",{enumerable:!0,get:function(){return O.zeroHash}});var E=Jg();Object.defineProperty(e,"presignMessagePrefix",{enumerable:!0,get:function(){return E.presignMessagePrefix}});var _=Ie();Object.defineProperty(e,"AbiConstructorNotFoundError",{enumerable:!0,get:function(){return _.AbiConstructorNotFoundError}}),Object.defineProperty(e,"AbiConstructorParamsNotFoundError",{enumerable:!0,get:function(){return _.AbiConstructorParamsNotFoundError}}),Object.defineProperty(e,"AbiDecodingDataSizeInvalidError",{enumerable:!0,get:function(){return _.AbiDecodingDataSizeInvalidError}}),Object.defineProperty(e,"AbiDecodingDataSizeTooSmallError",{enumerable:!0,get:function(){return _.AbiDecodingDataSizeTooSmallError}}),Object.defineProperty(e,"AbiDecodingZeroDataError",{enumerable:!0,get:function(){return _.AbiDecodingZeroDataError}}
47),Object.defineProperty(e,"AbiEncodingArrayLengthMismatchError",{enumerable:!0,get:function(){return _.AbiEncodingArrayLengthMismatchError}}),Object.defineProperty(e,"AbiEncodingLengthMismatchError",{enumerable:!0,get:function(){return _.AbiEncodingLengthMismatchError}}),Object.defineProperty(e,"AbiEncodingBytesSizeMismatchError",{enumerable:!0,get:function(){return _.AbiEncodingBytesSizeMismatchError}}),Object.defineProperty(e,"AbiErrorInputsNotFoundError",{enumerable:!0,get:function(){return _.AbiErrorInputsNotFoundError}}),Object.defineProperty(e,"AbiErrorNotFoundError",{enumerable:!0,get:function(){return _.AbiErrorNotFoundError}}),Object.defineProperty(e,"AbiErrorSignatureNotFoundError",{enumerable:!0,get:function(){return _.AbiErrorSignatureNotFoundError}}),Object.defineProperty(e,"AbiEventNotFoundError",{enumerable:!0,get:function(){return _.AbiEventNotFoundError}}),Object.defineProperty(e,"AbiEventSignatureEmptyTopicsError",{enumerable:!0,get:function(){return _.AbiEventSignatureEmptyTopicsError}}),Object.defineProperty(e,"AbiEventSignatureNotFoundError",{enumerable:!0,get:function(){return _.AbiEventSignatureNotFoundError}}),Object.defineProperty(e,"AbiFunctionNotFoundError",{enumerable:!0,get:function(){return _.AbiFunctionNotFoundError}}),Object.defineProperty(e,"AbiFunctionOutputsNotFoundError",{enumerable:!0,get:function(){return _.AbiFunctionOutputsNotFoundError}}),Object.defineProperty(e,"AbiFunctionSignatureNotFoundError",{enumerable:!0,get:function(){return _.AbiFunctionSignatureNotFoundError}}),Object.defineProperty(e,"BytesSizeMismatchError",{enumerable:!0,get:function(){return _.BytesSizeMismatchError}}),Object.defineProperty(e,"DecodeLogDataMismatch",{enumerable:!0,get:function(){return _.DecodeLogDataMismatch}}),Object.defineProperty(e,"DecodeLogTopicsMismatch",{enumerable:!0,get:function(){return _.DecodeLogTopicsMismatch}}),Object.defineProperty(e,"InvalidAbiDecodingTypeError",{enumerable:!0,get:function(){return _.InvalidAbiDecodingTypeError}}),Object.defineProperty(e,"InvalidAbiEncodingTypeError",{enumerable:!0,get:function(){return _.InvalidAbiEncodingTypeError}}),Object.defineProperty(e,"InvalidArrayError",{enumerable:!0,get:function(){return _.InvalidArrayError}}),Object.defineProperty(e,"InvalidDefinitionTypeError",{enumerable:!0,get:function(){return _.InvalidDefinitionTypeError}}),Object.defineProperty(e,"UnsupportedPackedAbiType",{enumerable:!0,get:function(){return _.UnsupportedPackedAbiType}});var P=le();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return P.BaseError}}),Object.defineProperty(e,"setErrorConfig",{enumerable:!0,get:function(){return P.setErrorConfig}});var m=Od();Object.defineProperty(e,"BlockNotFoundError",{enumerable:!0,get:function(){return m.BlockNotFoundError}});var T=or();Object.defineProperty(e,"CallExecutionError",{enumerable:!0,get:function(){return T.CallExecutionError}}),Object.defineProperty(e,"ContractFunctionExecutionError",{enumerable:!0,get:function(){return T.ContractFunctionExecutionError}}),Object.defineProperty(e,"ContractFunctionRevertedError",{enumerable:!0,get:function(){return T.ContractFunctionRevertedError}}),Object.defineProperty(e,"ContractFunctionZeroDataError",{enumerable:!0,get:function(){return T.ContractFunctionZeroDataError}}),Object.defineProperty(e,"RawContractError",{enumerable:!0,get:function(){return T.RawContractError}}),Object.defineProperty(e,"CounterfactualDeploymentFailedError",{enumerable:!0,get:function(){return T.CounterfactualDeploymentFailedError}});var g=ec();Object.defineProperty(e,"BaseFeeScalarError",{enumerable:!0,get:function(){return g.BaseFeeScalarError}}),Object.defineProperty(e,"Eip1559FeesNotSupportedError",{enumerable:!0,get:function(){return g.Eip1559FeesNotSupportedError}}),Object.defineProperty(e,"MaxFeePerGasTooLowError",{enumerable:!0,get:function(){return g.MaxFeePerGasTooLowError}});var v=ir();Object.defineProperty(e,"AtomicReadyWalletRejectedUpgradeError",{enumerable:!0,get:function(){return v.AtomicReadyWalletRejectedUpgradeError}}),Object.defineProperty(e,"AtomicityNotSupportedError",{enumerable:!0,get:function(){return v.AtomicityNotSupportedError}}),Object.defineProperty(e,"BundleTooLargeError",{enumerable:!0,get:function(){return v.BundleTooLargeError}}),Object.defineProperty(e,"ChainDisconnectedError",{enumerable:!0,get:function(){return v.ChainDisconnectedError}}),Object.defineProperty(e,"DuplicateIdError",{enumerable:!0,get:function(){return v.DuplicateIdError}}),Object.defineProperty(e,"InternalRpcError",{enumerable:!0,get:function(){return v.InternalRpcError}}),Object.defineProperty(e,"InvalidInputRpcError",{enumerable:!0,get:function(){return v.InvalidInputRpcError}}),Object.defineProperty(e,"InvalidParamsRpcError",{enumerable:!0,get:function(){return v.InvalidParamsRpcError}}),Object.defineProperty(e,"InvalidRequestRpcError",{enumerable:!0,get:function(){return v.InvalidRequestRpcError}}),Object.defineProperty(e,"JsonRpcVersionUnsupportedError",{enumerable:!0,get:function(){return v.JsonRpcVersionUnsupportedError}}),Object.defineProperty(e,"LimitExceededRpcError",{enumerable:!0,get:function(){return v.LimitExceededRpcError}}),Object.defineProperty(e,"MethodNotFoundRpcError",{enumerable:!0,get:function(){return v.MethodNotFoundRpcError}}),Object.defineProperty(e,"MethodNotSupportedRpcError",{enumerable:!0,get:function(){return v.MethodNotSupportedRpcError}}),Object.defineProperty(e,"ParseRpcError",{enumerable:!0,get:function(){return v.ParseRpcError}}),Object.defineProperty(e,"ProviderDisconnectedError",{enumerable:!0,get:function(){return v.ProviderDisconnectedError}}),Object.defineProperty(e,"ProviderRpcError",{enumerable:!0,get:function(){return v.ProviderRpcError}}),Object.defineProperty(e,"ResourceNotFoundRpcError",{enumerable:!0,get:function(){return v.ResourceNotFoundRpcError}}),Object.defineProperty(e,"ResourceUnavailableRpcError",{enumerable:!0,get:function(){return v.ResourceUnavailableRpcError}}),Object.defineProperty(e,"RpcError",{enumerable:!0,get:function(){return v.RpcError}}),Object.defineProperty(e,"SwitchChainError",{enumerable:!0,get:function(){return v.SwitchChainError}}),Object.defineProperty(e,"TransactionRejectedRpcError",{enumerable:!0,get:function(){return v.TransactionRejectedRpcError}}),Object.defineProperty(e,"UnauthorizedProviderError",{enumerable:!0,get:function(){return v.UnauthorizedProviderError}}),Object.defineProperty(e,"UnknownBundleIdError",{enumerable:!0,get:function(){return v.UnknownBundleIdError}}),Object.defineProperty(e,"UnknownRpcError",{enumerable:!0,get:function(){return v.UnknownRpcError}}),Object.defineProperty(e,"UnsupportedChainIdError",{enumerable:!0,get:function(){return v.UnsupportedChainIdError}}),Object.defineProperty(e,"UnsupportedNonOptionalCapabilityError",{enumerable:!0,get:function(){return v.UnsupportedNonOptionalCapabilityError}}),Object.defineProperty(e,"UnsupportedProviderMethodError",{enumerable:!0,get:function(){return v.UnsupportedProviderMethodError}}),Object.defineProperty(e,"UserRejectedRequestError",{enumerable:!0,get:function(){return v.UserRejectedRequestError}});var h=jo();Object.defineProperty(e,"ChainDoesNotSupportContract",{enumerable:!0,get:function(){return h.ChainDoesNotSupportContract}}),Object.defineProperty(e,"ChainMismatchError",{enumerable:!0,get:function(){return h.ChainMismatchError}}),Object.defineProperty(e,"ChainNotFoundError",{enumerable:!0,get:function(){return h.ChainNotFoundError}}),Object.defineProperty(e,"ClientChainNotConfiguredError",{enumerable:!0,get:function(){return h.ClientChainNotConfiguredError}}),Object.defineProperty(e,"InvalidChainIdError",{enumerable:!0,get:function(){return h.InvalidChainIdError}});var I=nn();Object.defineProperty(e,"InvalidBytesBooleanError",{enumerable:!0,get:function(){return I.InvalidBytesBooleanError}}),Object.defineProperty(e,"IntegerOutOfRangeError",{enumerable:!0,get:function(){return I.IntegerOutOfRangeError}}),Object.defineProperty(e,"InvalidHexBooleanError",{enumerable:!0,get:function(){return I.InvalidHexBooleanError}}),Object.defineProperty(e,"InvalidHexValueError",{enumerable:!0,get:function(){return I.InvalidHexValueError}}),Object.defineProperty(e,"SizeOverflowError",{enumerable:!0,get:function(){return I.SizeOverflowError}});var R=Og();Object.defineProperty(e,"EnsAvatarUriResolutionError",{enumerable:!0,get:function(){return R.EnsAvatarUriResolutionError}}),Object.defineProperty(e,"EnsAvatarInvalidNftUriError",{enumerable:!0,get:function(){return R.EnsAvatarInvalidNftUriError}}),Object.defineProperty(e,"EnsAvatarUnsupportedNamespaceError",{enumerable:!0,get:function(){return R.EnsAvatarUnsupportedNamespaceError}});var j=r1();Object.defineProperty(e,"InvalidDecimalNumberError",{enumerable:!0,get:function(){return j.InvalidDecimalNumberError}});var S=ig();Object.defineProperty(e,"EstimateGasExecutionError",{enumerable:!0,get:function(){return S.EstimateGasExecutionError}});var C=Nt();Object.defineProperty(e,"ExecutionRevertedError",{enumerable:!0,get:function(){return C.ExecutionRevertedError}}),Object.defineProperty(e,"FeeCapTooHighError",{enumerable:!0,get:function(){return C.FeeCapTooHighError}}),Object.defineProperty(e,"FeeCapTooLowError",{enumerable:!0,get:function(){return C.FeeCapTooLowError}}),Object.defineProperty(e,"InsufficientFundsError",{enumerable:!0,get:function(){return C.InsufficientFundsError}}),Object.defineProperty(e,"IntrinsicGasTooHighError",{enumerable:!0,get:function(){return C.IntrinsicGasTooHighError}}),Object.defineProperty(e,"IntrinsicGasTooLowError",{enumerable:!0,get:function(){return C.IntrinsicGasTooLowError}}),Object.defineProperty(e,"NonceMaxValueError",{enumerable:!0,get:function(){return C.NonceMaxValueError}}),Object.defineProperty(e,"NonceTooHighError",{enumerable:!0,get:function(){return C.NonceTooHighError}}),Object.defineProperty(e,"NonceTooLowError",{enumerable:!0,get:function(){return C.NonceTooLowError}}),Object.defineProperty(e,"TipAboveFeeCapError",{enumerable:!0,get:function(){return C.TipAboveFeeCapError}}),Object.defineProperty(e,"TransactionTypeNotSupportedError",{enumerable:!0,get:function(){return C.TransactionTypeNotSupportedError}}),Object.defineProperty(e,"UnknownNodeError",{enumerable:!0,get:function(){return C.UnknownNodeError}});var H=Jp();Object.defineProperty(e,"FilterTypeNotSupportedError",{enumerable:!0,get:function(){return H.FilterTypeNotSupportedError}});var F=bt();Object.defineProperty(e,"HttpRequestError",{enumerable:!0,get:function(){return F.HttpRequestError}}),Object.defineProperty(e,"RpcRequestError",{enumerable:!0,get:function(){return F.RpcRequestError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return F.TimeoutError}}),Object.defineProperty(e,"SocketClosedError",{enumerable:!0,get:function(){return F.SocketClosedError}}),Object.defineProperty(e,"WebSocketRequestError",{enumerable:!0,get:function(){return F.WebSocketRequestError}});var q=ft();Object.defineProperty(e,"InvalidAddressError",{enumerable:!0,get:function(){return q.InvalidAddressError}});var k=rt();
47Object.defineProperty(e,"FeeConflictError",{enumerable:!0,get:function(){return k.FeeConflictError}}),Object.defineProperty(e,"InvalidLegacyVError",{enumerable:!0,get:function(){return k.InvalidLegacyVError}}),Object.defineProperty(e,"InvalidSerializableTransactionError",{enumerable:!0,get:function(){return k.InvalidSerializableTransactionError}}),Object.defineProperty(e,"InvalidSerializedTransactionError",{enumerable:!0,get:function(){return k.InvalidSerializedTransactionError}}),Object.defineProperty(e,"InvalidSerializedTransactionTypeError",{enumerable:!0,get:function(){return k.InvalidSerializedTransactionTypeError}}),Object.defineProperty(e,"InvalidStorageKeySizeError",{enumerable:!0,get:function(){return k.InvalidStorageKeySizeError}}),Object.defineProperty(e,"TransactionExecutionError",{enumerable:!0,get:function(){return k.TransactionExecutionError}}),Object.defineProperty(e,"TransactionNotFoundError",{enumerable:!0,get:function(){return k.TransactionNotFoundError}}),Object.defineProperty(e,"TransactionReceiptNotFoundError",{enumerable:!0,get:function(){return k.TransactionReceiptNotFoundError}}),Object.defineProperty(e,"WaitForTransactionReceiptTimeoutError",{enumerable:!0,get:function(){return k.WaitForTransactionReceiptTimeoutError}});var N=Gu();Object.defineProperty(e,"SizeExceedsPaddingSizeError",{enumerable:!0,get:function(){return N.SizeExceedsPaddingSizeError}}),Object.defineProperty(e,"SliceOffsetOutOfBoundsError",{enumerable:!0,get:function(){return N.SliceOffsetOutOfBoundsError}});var D=Xd();Object.defineProperty(e,"UrlRequiredError",{enumerable:!0,get:function(){return D.UrlRequiredError}});var W=Td();Object.defineProperty(e,"AccountStateConflictError",{enumerable:!0,get:function(){return W.AccountStateConflictError}}),Object.defineProperty(e,"StateAssignmentConflictError",{enumerable:!0,get:function(){return W.StateAssignmentConflictError}});var $=Ng();Object.defineProperty(e,"InvalidDomainError",{enumerable:!0,get:function(){return $.InvalidDomainError}}),Object.defineProperty(e,"InvalidPrimaryTypeError",{enumerable:!0,get:function(){return $.InvalidPrimaryTypeError}}),Object.defineProperty(e,"InvalidStructTypeError",{enumerable:!0,get:function(){return $.InvalidStructTypeError}});var V=BE();Object.defineProperty(e,"EIP1193ProviderRpcError",{enumerable:!0,get:function(){return V.ProviderRpcError}});var J=Rg();Object.defineProperty(e,"labelhash",{enumerable:!0,get:function(){return J.labelhash}});var X=rl();Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return X.namehash}});var K=tc();Object.defineProperty(e,"defineBlock",{enumerable:!0,get:function(){return K.defineBlock}}),Object.defineProperty(e,"formatBlock",{enumerable:!0,get:function(){return K.formatBlock}});var de=Lt();Object.defineProperty(e,"formatLog",{enumerable:!0,get:function(){return de.formatLog}});var me=nr();Object.defineProperty(e,"decodeAbiParameters",{enumerable:!0,get:function(){return me.decodeAbiParameters}});var se=RE();Object.defineProperty(e,"decodeDeployData",{enumerable:!0,get:function(){return se.decodeDeployData}});var Z=Ju();Object.defineProperty(e,"decodeErrorResult",{enumerable:!0,get:function(){return Z.decodeErrorResult}});var Q=vo();Object.defineProperty(e,"decodeEventLog",{enumerable:!0,get:function(){return Q.decodeEventLog}});var Y=Ld();Object.defineProperty(e,"decodeFunctionData",{enumerable:!0,get:function(){return Y.decodeFunctionData}});var G=Dt();Object.defineProperty(e,"decodeFunctionResult",{enumerable:!0,get:function(){return G.decodeFunctionResult}});var L=mt();Object.defineProperty(e,"encodeAbiParameters",{enumerable:!0,get:function(){return L.encodeAbiParameters}});var ne=wo();Object.defineProperty(e,"encodeDeployData",{enumerable:!0,get:function(){return ne.encodeDeployData}});var re=Dd();Object.defineProperty(e,"encodeErrorResult",{enumerable:!0,get:function(){return re.encodeErrorResult}});var ee=Rr();Object.defineProperty(e,"encodeEventTopics",{enumerable:!0,get:function(){return ee.encodeEventTopics}});var oe=tt();Object.defineProperty(e,"encodeFunctionData",{enumerable:!0,get:function(){return oe.encodeFunctionData}});var ue=Yp();Object.defineProperty(e,"prepareEncodeFunctionData",{enumerable:!0,get:function(){return ue.prepareEncodeFunctionData}});var Pe=Gd();Object.defineProperty(e,"encodeFunctionResult",{enumerable:!0,get:function(){return Pe.encodeFunctionResult}});var be=Eo();Object.defineProperty(e,"parseEventLogs",{enumerable:!0,get:function(){return be.parseEventLogs}});var ce=_o();Object.defineProperty(e,"defineTransaction",{enumerable:!0,get:function(){return ce.defineTransaction}}),Object.defineProperty(e,"formatTransaction",{enumerable:!0,get:function(){return ce.formatTransaction}}),Object.defineProperty(e,"transactionType",{enumerable:!0,get:function(){return ce.transactionType}});var je=mc();Object.defineProperty(e,"defineTransactionReceipt",{enumerable:!0,get:function(){return je.defineTransactionReceipt}}),Object.defineProperty(e,"formatTransactionReceipt",{enumerable:!0,get:function(){return je.formatTransactionReceipt}});var ye=zt();Object.defineProperty(e,"defineTransactionRequest",{enumerable:!0,get:function(){return ye.defineTransactionRequest}}),Object.defineProperty(e,"formatTransactionRequest",{enumerable:!0,get:function(){return ye.formatTransactionRequest}}),Object.defineProperty(e,"rpcTransactionType",{enumerable:!0,get:function(){return ye.rpcTransactionType}});var qe=$t();Object.defineProperty(e,"getAbiItem",{enumerable:!0,get:function(){return qe.getAbiItem}});var pe=Lg();Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return pe.getContractAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return pe.getCreate2Address}}),Object.defineProperty(e,"getCreateAddress",{enumerable:!0,get:function(){return pe.getCreateAddress}});var Me=fl();Object.defineProperty(e,"getSerializedTransactionType",{enumerable:!0,get:function(){return Me.getSerializedTransactionType}});var pt=ac();Object.defineProperty(e,"getTransactionType",{enumerable:!0,get:function(){return pt.getTransactionType}});var Ze=Io();Object.defineProperty(e,"hashDomain",{enumerable:!0,get:function(){return Ze.hashDomain}}),Object.defineProperty(e,"hashStruct",{enumerable:!0,get:function(){return Ze.hashStruct}}),Object.defineProperty(e,"hashTypedData",{enumerable:!0,get:function(){return Ze.hashTypedData}
47});var nt=OE();Object.defineProperty(e,"compactSignatureToSignature",{enumerable:!0,get:function(){return nt.compactSignatureToSignature}});var Wt=CE();Object.defineProperty(e,"hexToCompactSignature",{enumerable:!0,get:function(){return Wt.parseCompactSignature}}),Object.defineProperty(e,"parseCompactSignature",{enumerable:!0,get:function(){return Wt.parseCompactSignature}});var it=xE();Object.defineProperty(e,"hexToSignature",{enumerable:!0,get:function(){return it.parseSignature}}),Object.defineProperty(e,"parseSignature",{enumerable:!0,get:function(){return it.parseSignature}});var Ec=sr();Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return Ec.recoverAddress}});var jc=ul();Object.defineProperty(e,"recoverMessageAddress",{enumerable:!0,get:function(){return jc.recoverMessageAddress}});var wc=Sd();Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return wc.recoverPublicKey}});var Pc=qE();Object.defineProperty(e,"recoverTransactionAddress",{enumerable:!0,get:function(){return Pc.recoverTransactionAddress}});var Bo=cl();Object.defineProperty(e,"recoverTypedDataAddress",{enumerable:!0,get:function(){return Bo.recoverTypedDataAddress}});var Ac=ME();Object.defineProperty(e,"signatureToCompactSignature",{enumerable:!0,get:function(){return Ac.signatureToCompactSignature}});var Ro=HE();Object.defineProperty(e,"compactSignatureToHex",{enumerable:!0,get:function(){return Ro.serializeCompactSignature}}),Object.defineProperty(e,"serializeCompactSignature",{enumerable:!0,get:function(){return Ro.serializeCompactSignature}});var Oo=f1();Object.defineProperty(e,"signatureToHex",{enumerable:!0,get:function(){return Oo.serializeSignature}}),Object.defineProperty(e,"serializeSignature",{enumerable:!0,get:function(){return Oo.serializeSignature}});var dn=yo();Object.defineProperty(e,"bytesToRlp",{enumerable:!0,get:function(){return dn.bytesToRlp}}),Object.defineProperty(e,"hexToRlp",{enumerable:!0,get:function(){return dn.hexToRlp}}),Object.defineProperty(e,"toRlp",{enumerable:!0,get:function(){return dn.toRlp}});var Tc=Xg();Object.defineProperty(e,"verifyHash",{enumerable:!0,get:function(){return Tc.verifyHash}});var Ic=Qg();Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return Ic.verifyMessage}});var Sc=e1();Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return Sc.verifyTypedData}});var Bc=t1();Object.defineProperty(e,"parseErc6492Signature",{enumerable:!0,get:function(){return Bc.parseErc6492Signature}});var Rc=_c();Object.defineProperty(e,"isErc6492Signature",{enumerable:!0,get:function(){return Rc.isErc6492Signature}});var Oc=ll();Object.defineProperty(e,"serializeErc6492Signature",{enumerable:!0,get:function(){return Oc.serializeErc6492Signature}});var Cc=Ut();Object.defineProperty(e,"assertRequest",{enumerable:!0,get:function(){return Cc.assertRequest}});var ln=pc();Object.defineProperty(e,"assertTransactionEIP1559",{enumerable:!0,get:function(){return ln.assertTransactionEIP1559}}),Object.defineProperty(e,"assertTransactionEIP2930",{enumerable:!0,get:function(){return ln.assertTransactionEIP2930}}),Object.defineProperty(e,"assertTransactionLegacy",{enumerable:!0,get:function(){return ln.assertTransactionLegacy}});var dr=we();Object.defineProperty(e,"boolToBytes",{enumerable:!0,get:function(){return dr.boolToBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return dr.hexToBytes}}),Object.defineProperty(e,"numberToBytes",{enumerable:!0,get:function(){return dr.numberToBytes}}),Object.defineProperty(e,"stringToBytes",{enumerable:!0,get:function(){return dr.stringToBytes}}),Object.defineProperty(e,"toBytes",{enumerable:!0,get:function(){return dr.toBytes}});var lr=te();Object.defineProperty(e,"boolToHex",{enumerable:!0,get:function(){return lr.boolToHex}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return lr.bytesToHex}}),Object.defineProperty(e,"numberToHex",{enumerable:!0,get:function(){return lr.numberToHex}}),Object.defineProperty(e,"stringToHex",{enumerable:!0,get:function(){return lr.stringToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return lr.toHex}});var vt=Ad();Object.defineProperty(e,"bytesToBigInt",{enumerable:!0,get:function(){return vt.bytesToBigInt}}),Object.defineProperty(e,"bytesToBool",{enumerable:!0,get:function(){return vt.bytesToBool}}),Object.defineProperty(e,"bytesToNumber",{enumerable:!0,get:function(){return vt.bytesToNumber}}),Object.defineProperty(e,"bytesToString",{enumerable:!0,get:function(){return vt.bytesToString}}),Object.defineProperty(e,"fromBytes",{enumerable:!0,get:function(){return vt.fromBytes}});var fr=Wd();Object.defineProperty(e,"ccipRequest",{enumerable:!0,get:function(){return fr.ccipRequest}}),Object.defineProperty(e,"ccipFetch",{enumerable:!0,get:function(){return fr.ccipRequest}}),Object.defineProperty(e,"offchainLookup",{enumerable:!0,get:function(){return fr.offchainLookup}}),Object.defineProperty(e,"offchainLookupAbiItem",{enumerable:!0,get:function(){return fr.offchainLookupAbiItem}}),Object.defineProperty(e,"offchainLookupSignature",{enumerable:!0,get:function(){return fr.offchainLookupSignature}});var xc=nc();Object.defineProperty(e,"blobsToCommitments",{enumerable:!0,get:function(){return xc.blobsToCommitments}});var qc=qd();Object.defineProperty(e,"commitmentToVersionedHash",{enumerable:!0,get:function(){return qc.commitmentToVersionedHash}});var Mc=Md();Object.defineProperty(e,"commitmentsToVersionedHashes",{enumerable:!0,get:function(){return Mc.commitmentsToVersionedHashes}});var Hc=kE();Object.defineProperty(e,"sidecarsToVersionedHashes",{enumerable:!0,get:function(){return Hc.sidecarsToVersionedHashes}});var kc=oc();Object.defineProperty(e,"blobsToProofs",{enumerable:!0,get:function(){return kc.blobsToProofs}});var Fc=FE();Object.defineProperty(e,"fromBlobs",{enumerable:!0,get:function(){return Fc.fromBlobs}});var $c=ic();Object.defineProperty(e,"toBlobSidecars",{enumerable:!0,get:function(){return $c.toBlobSidecars}});var Nc=fg();Object.defineProperty(e,"toBlobs",{enumerable:!0,get:function(){return Nc.toBlobs}});var Co=g1();Object.defineProperty(e,"defineKzg",{enumerable:!0,get:function(){return Co.defineKzg}});var j1=$E();Object.defineProperty(e,"setupKzg",{enumerable:!0,get:function(){return j1.setupKzg}});var zc=ke();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return zc.concat}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return zc.concatBytes}}),Object.defineProperty(e,"concatHex",{enumerable:!0,get:function(){return zc.concatHex}});var w1=lc();Object.defineProperty(e,"assertCurrentChain",{enumerable:!0,get:function(){return w1.assertCurrentChain}});var P1=Hg();Object.defineProperty(e,"defineChain",{enumerable:!0,get:function(){return P1.defineChain}});var A1=kg();Object.defineProperty(e,"extractChain",{enumerable:!0,get:function(){return A1.extractChain}});var T1=cr();Object.defineProperty(e,"getChainContractAddress",{enumerable:!0,get:function(){return T1.getChainContractAddress}});var I1=zg();Object.defineProperty(e,"encodePacked",{enumerable:!0,get:function(){return I1.encodePacked}});var S1=vg();Object.defineProperty(e,"withCache",{enumerable:!0,get:function(){return S1.withCache}});var B1=Yd();Object.defineProperty(e,"withRetry",{enumerable:!0,get:function(){return B1.withRetry}});var R1=Qd();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return R1.withTimeout}});var O1=mo();Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return O1.formatEther}});var C1=Or();Object.defineProperty(e,"formatGwei",{enumerable:!0,get:function(){return C1.formatGwei}});var x1=Yu();Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return x1.formatUnits}});var fn=Ce();Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return fn.fromHex}}),Object.defineProperty(e,"hexToBigInt",{enumerable:!0,get:function(){return fn.hexToBigInt}}),Object.defineProperty(e,"hexToBool",{enumerable:!0,get:function(){return fn.hexToBool}}),Object.defineProperty(e,"hexToNumber",{enumerable:!0,get:function(){return fn.hexToNumber}}),Object.defineProperty(e,"hexToString",{enumerable:!0,get:function(){return fn.hexToString}});var q1=al();Object.defineProperty(e,"fromRlp",{enumerable:!0,get:function(){return q1.fromRlp}});var _l=et();Object.defineProperty(e,"checksumAddress",{enumerable:!0,get:function(){return _l.checksumAddress}}),Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return _l.getAddress}});var M1=ar();Object.defineProperty(e,"getContractError",{enumerable:!0,get:function(){return M1.getContractError}});var vl=on();Object.defineProperty(e,"toEventSelector",{enumerable:!0,get:function(){return vl.toEventSelector}}),Object.defineProperty(e,"getEventSelector",{enumerable:!0,get:function(){return vl.toEventSelector}});var El=Br();Object.defineProperty(e,"toFunctionSelector",{enumerable:!0,get:function(){return El.toFunctionSelector}}),Object.defineProperty(e,"getFunctionSelector",{enumerable:!0,get:function(){return El.toFunctionSelector}});var jl=Dg();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return jl.toEventSignature}}),Object.defineProperty(e,"getEventSignature",{enumerable:!0,get:function(){return jl.toEventSignature}});var wl=Gg();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return wl.toFunctionSignature}}),Object.defineProperty(e,"getFunctionSignature",{enumerable:!0,get:function(){return wl.toFunctionSignature}});var H1=Vg();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return H1.toEventHash}});var k1=Wg();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return k1.toFunctionHash}});var F1=So();Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return F1.hashMessage}});var $1=Yg();Object.defineProperty(e,"toPrefixedMessage",{enumerable:!0,get:function(){return $1.toPrefixedMessage}});var N1=Ke();Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return N1.isAddress}});var z1=ht();Object.defineProperty(e,"isAddressEqual",{enumerable:!0,get:function(){return z1.isAddressEqual}});var U1=il();Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return U1.isBytes}});var L1=sl();Object.defineProperty(e,"isHash",{enumerable:!0,get:function(){return L1.isHash}});var D1=De();Object.defineProperty(e,"isHex",{enumerable:!0,get:function(){return D1.isHex}});var G1=We();Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return G1.keccak256}});var V1=xd();Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return V1.sha256}});var W1=Zg();Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return W1.ripemd160}});var Uc=rr();Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return Uc.pad}}),Object.defineProperty(e,"padBytes",{enumerable:!0,get:function(){return Uc.padBytes}}),Object.defineProperty(e,"padHex",{enumerable:!0,get:function(){return Uc.padHex}});var K1=n1();Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return K1.parseEther}});var Z1=o1();Object.defineProperty(e,"parseGwei",{enumerable:!0,get:function(){return Z1.parseGwei}});var J1=ml();Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return J1.parseTransaction}});var Y1=vc();Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return Y1.parseUnits}});var X1=ol();Object.defineProperty(e,"serializeAccessList",{enumerable:!0,get:function(){return X1.serializeAccessList}});var Q1=gc();Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return Q1.seri
47alizeTransaction}});var e_=Ve();Object.defineProperty(e,"size",{enumerable:!0,get:function(){return e_.size}});var Lc=ot();Object.defineProperty(e,"slice",{enumerable:!0,get:function(){return Lc.slice}}),Object.defineProperty(e,"sliceBytes",{enumerable:!0,get:function(){return Lc.sliceBytes}}),Object.defineProperty(e,"sliceHex",{enumerable:!0,get:function(){return Lc.sliceHex}});var t_=Fe();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return t_.stringify}});var r_=Ft();Object.defineProperty(e,"trim",{enumerable:!0,get:function(){return r_.trim}});var xo=yc();Object.defineProperty(e,"serializeTypedData",{enumerable:!0,get:function(){return xo.serializeTypedData}}),Object.defineProperty(e,"validateTypedData",{enumerable:!0,get:function(){return xo.validateTypedData}}),Object.defineProperty(e,"domainSeparator",{enumerable:!0,get:function(){return xo.domainSeparator}}),Object.defineProperty(e,"getTypesForEIP712Domain",{enumerable:!0,get:function(){return xo.getTypesForEIP712Domain}});var Pl=i1();Object.defineProperty(e,"createNonceManager",{enumerable:!0,get:function(){return Pl.createNonceManager}}),Object.defineProperty(e,"nonceManager",{enumerable:!0,get:function(){return Pl.nonceManager}})}(Kc)),Kc}var Ar={},Op;function zE(){if(Op)return Ar;Op=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.MAGIC_VALUE_BYTES=Ar.MAGIC_VALUE=void 0;const e="0x1626ba7e";Ar.MAGIC_VALUE=e;const r="0x20c13b0b";return Ar.MAGIC_VALUE_BYTES=r,Ar}var zu={},so={},Tr={},Cp;function _1(){if(Cp)return Tr;Cp=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.PermissionsError=Tr.PERMISSIONS_REQUEST_REJECTED=void 0,Tr.PERMISSIONS_REQUEST_REJECTED=4001;class e extends Error{constructor(t,i,o){super(t),this.code=i,this.data=o,Object.setPrototypeOf(this,e.prototype)}}return Tr.PermissionsError=e,Tr}var xp;function v1(){if(xp)return so;xp=1,Object.defineProperty(so,"__esModule",{value:!0}),so.Wallet=void 0;const e=Sr(),r=_1();class t{constructor(o){this.communicator=o}async getPermissions(){return(await this.communicator.send(e.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(o){if(!this.isPermissionRequestValid(o))throw new r.PermissionsError("Permissions request is invalid",r.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(e.Methods.wallet_requestPermissions,o)).data}catch{throw new r.PermissionsError("Permissions rejected",r.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(o){return o.every(a=>typeof a=="object"?Object.keys(a).every(n=>!!Object.values(e.RestrictedMethods).includes(n)):!1)}}return so.Wallet=t,so}var qp;function UE(){if(qp)return zu;qp=1,Object.defineProperty(zu,"__esModule",{value:!0});const e=v1(),r=_1(),t=(o,a)=>a.some(n=>n.parentCapability===o),i=()=>(o,a,n)=>{const s=n.value;return n.value=async function(){const u=new e.Wallet(this.communicator);let c=await u.getPermissions();if(t(a,c)||(c=await u.requestPermissions([{[a]:{}}])),!t(a,c))throw new r.PermissionsError("Permissions rejected",r.PERMISSIONS_REQUEST_REJECTED);return s.apply(this)},n};return zu.default=i,zu}var Mp;function LE(){if(Mp)return jt;Mp=1;var e=jt&&jt.__decorate||function(c,l,d,f){var p=arguments.length,y=p<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,d):f,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,l,d,f);else for(var w=c.length-1;w>=0;w--)(b=c[w])&&(y=(p<3?b(y):p>3?b(l,d,y):b(l,d))||y);return p>3&&y&&Object.defineProperty(l,d,y),y},r=jt&&jt.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(jt,"__esModule",{value:!0}),jt.Safe=void 0;const t=NE(),i=zE(),o=Sr(),a=Ed(),n=vd(),s=r(UE());class u{constructor(l){this.communicator=l}async getChainInfo(){return(await this.communicator.send(o.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(o.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:l="usd"}={}){return(await this.communicator.send(o.Methods.getSafeBalances,{currency:l})).data}async check1271Signature(l,d="0x"){const f=await this.getInfo(),p=(0,t.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,d]}),y={call:a.RPC_CALLS.eth_call,params:[{to:f.safeAddress,data:p},"latest"]};try{return(await this.communicator.send(o.Methods.rpcCall,y)).data.slice(0,10).toLowerCase()===i.MAGIC_VALUE}catch{return!1}}async check1271SignatureBytes(l,d="0x"){const f=await this.getInfo(),p=(0,t.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,d]}),y={call:a.RPC_CALLS.eth_call,params:[{to:f.safeAddress,data:p},"latest"]};try{return(await this.communicator.send(o.Methods.rpcCall,y)).data.slice(0,10).toLowerCase()===i.MAGIC_VALUE_BYTES}catch{return!1}}calculateMessageHash(l){return(0,t.hashMessage)(l)}calculateTypedMessageHash(l){const d=typeof l.domain.chainId=="object"?l.domain.chainId.toNumber():Number(l.domain.chainId);let f=l.primaryType;if(!f){const p=Object.values(l.types),y=Object.keys(l.types).filter(b=>p.every(w=>w.every(({type:B})=>B.replace("[","").replace("]","")!==b)));if(y.length===0||y.length>1)throw new Error("Please specify primaryType");f=y[0]}return(0,t.hashTypedData)({message:l.message,domain:{...l.domain,chainId:d,verifyingContract:l.domain.verifyingContract,salt:l.domain.salt},types:l.types,primaryType:f})}async getOffChainSignature(l){return(await this.communicator.send(o.Methods.getOffChainSignature,l)).data}async isMessageSigned(l,d="0x"){let f;if(typeof l=="string"&&(f=async()=>{const p=this.calculateMessageHash(l);return await this.isMessageHashSigned(p,d)}),(0,n.isObjectEIP712TypedData)(l)&&(f=async()=>{const p=this.calculateTypedMessageHash(l);return await this.isMessageHashSigned(p,d)}),f)return await f();throw new Error("Invalid message type")}async isMessageHashSigned(l,d="0x"){const f=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const p of f)if(await p(l,d))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(o.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(o.Methods.requestAddressBook,void 0)).data}}return jt.Safe=u,e([(0,s.default)()],u.prototype,"requestAddressBook",null),jt}
47var Hp;function kp(){if(Hp)return Mr;Hp=1;var e=Mr&&Mr.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Mr,"__esModule",{value:!0});const r=e(m_()),t=g_(),i=__(),o=LE(),a=v1();class n{constructor(u={}){const{allowedDomains:c=null,debug:l=!1}=u;this.communicator=new r.default(c,l),this.eth=new i.Eth(this.communicator),this.txs=new t.TXs(this.communicator),this.safe=new o.Safe(this.communicator),this.wallet=new a.Wallet(this.communicator)}}return Mr.default=n,Mr}var Fp;function DE(){return Fp||(Fp=1,function(e){var r=Et&&Et.__createBinding||(Object.create?function(n,s,u,c){c===void 0&&(c=u);var l=Object.getOwnPropertyDescriptor(s,u);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(n,c,l)}:function(n,s,u,c){c===void 0&&(c=u),n[c]=s[u]}),t=Et&&Et.__exportStar||function(n,s){for(var u in n)u!=="default"&&!Object.prototype.hasOwnProperty.call(s,u)&&r(s,n,u)},i=Et&&Et.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(e,"__esModule",{value:!0}),e.getSDKVersion=void 0;const o=i(kp());e.default=o.default,t(kp(),e),t(vd(),e),t(Sr(),e),t(Dp(),e);var a=Lp();Object.defineProperty(e,"getSDKVersion",{enumerable:!0,get:function(){return a.getSDKVersion}}),t(Ed(),e)}(Et)),Et}var Ir={},$p;function GE(){if($p)return Ir;$p=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.numberToHex=Ir.getLowerCase=void 0;function e(t){return t&&t.toLowerCase()}Ir.getLowerCase=e;function r(t){return`0x${t.toString(16)}`}return Ir.numberToHex=r,Ir}var Np;function VE(){if(Np)return mn;Np=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.SafeAppProvider=void 0;const e=DE(),r=o_(),t=GE();class i extends r.EventEmitter{constructor(a,n){super(),this.submittedTxs=new Map,this.safe=a,this.sdk=n}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(a){const{method:n,params:s=[]}=a;switch(n){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return(0,t.numberToHex)(this.chainId);case"personal_sign":{const[f,p]=s;if(this.safe.safeAddress.toLowerCase()!==p.toLowerCase())throw new Error("The address or message hash is invalid");const y=await this.sdk.txs.signMessage(f);return("signature"in y?y.signature:void 0)||"0x"}case"eth_sign":{const[f,p]=s;if(this.safe.safeAddress.toLowerCase()!==f.toLowerCase()||!p.startsWith("0x"))throw new Error("The address or message hash is invalid");const y=await this.sdk.txs.signMessage(p);return("signature"in y?y.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[f,p]=s,y=typeof p=="string"?JSON.parse(p):p;if(this.safe.safeAddress.toLowerCase()!==f.toLowerCase())throw new Error("The address is invalid");const b=await this.sdk.txs.signTypedMessage(y);return("signature"in b?b.signature:void 0)||"0x"}case"eth_sendTransaction":const u={...s[0],value:s[0].value||"0",data:s[0].data||"0x"};typeof u.gas=="string"&&u.gas.startsWith("0x")&&(u.gas=parseInt(u.gas,16));const c=await this.sdk.txs.send({txs:[u],params:{safeTxGas:u.gas}});return this.submittedTxs.set(c.safeTxHash,{from:this.safe.safeAddress,hash:c.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:u.data,value:u.value,to:u.to,blockHash:null,blockNumber:null,transactionIndex:null}),c.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,t.getLowerCase)(s[0]),s[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,t.getLowerCase)(s[0]),s[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,t.getLowerCase)(s[0]),s[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,t.getLowerCase)(s[0]),s[1],s[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([s[0],s[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([s[0],s[1]]);case"eth_getTransactionByHash":let d=s[0];try{d=(await this.sdk.txs.getBySafeTxHash(d)).txHash||d}catch{}return this.submittedTxs.has(d)?this.submittedTxs.get(d):this.sdk.eth.getTransactionByHash([d]).then(f=>(f&&(f.hash=s[0]),f));case"eth_getTransactionReceipt":{let f=s[0];try{f=(await this.sdk.txs.getBySafeTxHash(f)).txHash||f}catch{}return this.sdk.eth.getTransactionReceipt([f]).then(p=>(p&&(p.transactionHash=s[0]),p))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(s[0]);case"eth_call":return this.sdk.eth.call([s[0],s[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([s[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(s[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([s[0]]);case"wallet_sendCalls":{const{from:f,calls:p,chainId:y}=s[0];if(y!==(0,t.numberToHex)(this.chainId))throw new Error(`Safe is not on chain ${y}`);if(f!==this.safe.safeAddress)throw Error("Invalid from address");const b=p.map((x,M)=>
47{if(!x.to)throw new Error(`Invalid call #${M}: missing "to" field`);return{to:x.to,data:x.data??"0x",value:x.value??(0,t.numberToHex)(0)}}),{safeTxHash:w}=await this.sdk.txs.send({txs:b});return{id:w}}case"wallet_getCallsStatus":{const f=s[0],p={[e.TransactionStatus.AWAITING_CONFIRMATIONS]:100,[e.TransactionStatus.AWAITING_EXECUTION]:100,[e.TransactionStatus.SUCCESS]:200,[e.TransactionStatus.CANCELLED]:400,[e.TransactionStatus.FAILED]:500},y=await this.sdk.txs.getBySafeTxHash(f),b={version:"1.0",id:f,chainId:(0,t.numberToHex)(this.chainId),status:p[y.txStatus]};if(!y.txHash)return b;const w=await this.sdk.eth.getTransactionReceipt([y.txHash]);if(!w)return b;const B=y.txData?.dataDecoded?.method!=="multiSend"?1:y.txData.dataDecoded.parameters?.[0].valueDecoded?.length??1,x=Number(w.blockNumber),M=Number(w.gasUsed);return b.receipts=Array(B).fill({logs:w.logs,status:(0,t.numberToHex)(y.txStatus===e.TransactionStatus.SUCCESS?1:0),blockHash:w.blockHash,blockNumber:(0,t.numberToHex)(x),gasUsed:(0,t.numberToHex)(M),transactionHash:y.txHash}),b}case"wallet_showCallsStatus":throw new Error(`"${a.method}" not supported`);case"wallet_getCapabilities":return{[(0,t.numberToHex)(this.chainId)]:{atomicBatch:{supported:!0}}};default:throw Error(`"${a.method}" not implemented`)}}send(a,n){a||n("Undefined request"),this.request(a).then(s=>n(null,{jsonrpc:"2.0",id:a.id,result:s})).catch(s=>n(s,null))}}return mn.SafeAppProvider=i,mn}var zp;function WE(){return zp||(zp=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppProvider=void 0;var r=VE();Object.defineProperty(e,"SafeAppProvider",{enumerable:!0,get:function(){return r.SafeAppProvider}})}(Dc)),Dc}var E1=WE();const KE=i_(E1),XE=u_({__proto__:null,default:KE},[E1]);export{XE as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.