1import{a as qq}from"./chunk-VMIBZDFQ.js";import{a as $f,d as s5,f as o5,g as wq,h as i5,i as Pq}from"./chunk-K5EMG2WM.js";import{a as xq}from"./chunk-TSLWMKS5.js";import{b as jq,c as Eq}from"./chunk-GF6E6YOG.js";import{a as v,b as B,f as G,h as p,l as vq,n as y}from"./chunk-VNDKUXGB.js";var Gf=p(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.getSDKVersion=void 0;var Tq=()=>"9.1.0";la.getSDKVersion=Tq});var a5=p(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});pa.generateRequestId=void 0;var Aq=e=>e.toString(16).padStart(2,"0"),Iq=e=>{let t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,Aq).join("")},Oq=()=>typeof window<"u"?Iq(10):new Date().getTime().toString(36);pa.generateRequestId=Oq});var Vf=p(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.MessageFormatter=void 0;var Bq=Gf(),Sq=a5(),Zn=class{};ba.MessageFormatter=Zn;Zn.makeRequest=(e,t)=>({id:(0,Sq.generateRequestId)(),method:e,params:t,env:{sdkVersion:(0,Bq.getSDKVersion)()}});Zn.makeResponse=(e,t,r)=>({id:e,success:!0,version:r,data:t});Zn.makeErrorResponse=(e,t,r)=>({id:e,success:!1,error:t,version:r})});var Br=p(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.RestrictedMethods=Yn.Methods=void 0;var u5=(function(e){return e.sendTransactions="sendTransactions",e.rpcCall="rpcCall",e.getChainInfo="getChainInfo",e.getSafeInfo="getSafeInfo",e.getTxBySafeTxHash="getTxBySafeTxHash",e.getSafeBalances="getSafeBalances",e.signMessage="signMessage",e.signTypedMessage="signTypedMessage",e.getEnvironmentInfo="getEnvironmentInfo",e.getOffChainSignature="getOffChainSignature",e.requestAddressBook="requestAddressBook",e.wallet_getPermissions="wallet_getPermissions",e.wallet_requestPermissions="wallet_requestPermissions",e})(u5||(Yn.Methods=u5={})),c5=(function(e){return e.requestAddressBook="requestAddressBook",e})(c5||(Yn.RestrictedMethods=c5={}))});var d5=p(Sr=>{"use strict";var Cq=Sr&&Sr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Rq=Sr&&Sr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Cq(t,e,r)};
1Object.defineProperty(Sr,"__esModule",{value:!0});var Mq=Vf(),Wf=class{constructor(t=null,r=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:n,data:s,source:o})=>{let a=!s,u=!this.isServer&&o===window.parent,c=typeof s.version<"u"&&parseInt(s.version.split(".")[0]),d=typeof c=="number"&&c>=1,l=!0;return Array.isArray(this.allowedOrigins)&&(l=this.allowedOrigins.find(f=>f.test(n))!==void 0),!a&&u&&d&&l},this.logIncomingMessage=n=>{console.info(`Safe Apps SDK v1: A message was received from origin ${n.origin}. `,n.data)},this.onParentMessage=n=>{this.isValidMessage(n)&&(this.debugMode&&this.logIncomingMessage(n),this.handleIncomingMessage(n.data))},this.handleIncomingMessage=n=>{let{id:s}=n,o=this.callbacks.get(s);o&&(o(n),this.callbacks.delete(s))},this.send=(n,s)=>{let o=Mq.MessageFormatter.makeRequest(n,s);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(o,"*"),new Promise((a,u)=>{this.callbacks.set(o.id,c=>{if(!c.success){u(new Error(c.error));return}a(c)})})},this.allowedOrigins=t,this.debugMode=r,this.isServer||window.addEventListener("message",this.onParentMessage)}};Sr.default=Wf;Rq(Br(),Sr)});var f5=p(ma=>{"use strict";Object.defineProperty(ma,"__esModule",{value:!0});ma.isObjectEIP712TypedData=void 0;var kq=e=>typeof e=="object"&&e!=null&&"domain"in e&&"types"in e&&"message"in e;ma.isObjectEIP712TypedData=kq});var p5=p(l5=>{"use strict";Object.defineProperty(l5,"__esModule",{value:!0})});var b5=p(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.TransferDirection=Dt.TransactionStatus=Dt.TokenType=Dt.Operation=void 0;var ya=qq();Object.defineProperty(Dt,"Operation",{enumerable:!0,get:function(){return ya.Operation}});Object.defineProperty(Dt,"TokenType",{enumerable:!0,get:function(){return ya.TokenType}});Object.defineProperty(Dt,"TransactionStatus",{enumerable:!0,get:function(){return ya.TransactionStatus}});Object.defineProperty(Dt,"TransferDirection",{enumerable:!0,get:function(){return ya.TransferDirection}})});var y5=p(m5=>{"use strict";Object.defineProperty(m5,"__esModule",{value:!0});var EX=Br()});var ha=p($t=>{"use strict";var Nq=$t&&$t.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ga=$t&&$t.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Nq(t,e,r)};Object.defineProperty($t,"__esModule",{value:!0});ga(f5(),$t);ga(p5(),$t);ga(b5(),$t);ga(y5(),$t)});var g5=p(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});va.TXs=void 0;var _a=Br(),Hq=ha(),Kf=class{constructor(t){this.communicator=t}getBySafeTxHash(t){return y(this,null,function*(){if(!t)throw new Error("Invalid safeTxHash");return(yield this.communicator.send(_a.Methods.getTxBySafeTxHash,{safeTxHash:t})).data})}signMessage(t){return y(this,null,function*(){let r={message:t};return(yield this.communicator.send(_a.Methods.signMessage,r)).data})}signTypedMessage(t){return y(this,null,function*(){if(!(0,Hq.isObjectEIP712TypedData)(t))throw new Error("Invalid typed data");return(yield this.communicator.send(_a.Methods.signTypedMessage,{typedData:t})).data})}send(n){return y(this,arguments,function*({txs:t,params:r}){if(!t||!t.length)throw new Error("No transactions were passed");let s={txs:t,params:r};return(yield this.communicator.send(_a.Methods.sendTransactions,s)).data})}};va.TXs=Kf});var Ea=p(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.RPC_CALLS=void 0;ja.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"}});var h5=p(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.Eth=void 0;var pt=Ea(),Fq=Br(),cr={defaultBlockParam:(e="latest")=>
1e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e},Zf=class{constructor(t){this.communicator=t,this.call=this.buildRequest({call:pt.RPC_CALLS.eth_call,formatters:[null,cr.defaultBlockParam]}),this.getBalance=this.buildRequest({call:pt.RPC_CALLS.eth_getBalance,formatters:[null,cr.defaultBlockParam]}),this.getCode=this.buildRequest({call:pt.RPC_CALLS.eth_getCode,formatters:[null,cr.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:pt.RPC_CALLS.eth_getStorageAt,formatters:[null,cr.blockNumberToHex,cr.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:pt.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:pt.RPC_CALLS.eth_getBlockByHash,formatters:[null,cr.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:pt.RPC_CALLS.eth_getBlockByNumber,formatters:[cr.blockNumberToHex,cr.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:pt.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:pt.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:pt.RPC_CALLS.eth_getTransactionCount,formatters:[null,cr.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:pt.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=r=>this.buildRequest({call:pt.RPC_CALLS.eth_estimateGas})([r]),this.setSafeSettings=this.buildRequest({call:pt.RPC_CALLS.safe_setSettings})}buildRequest(t){let{call:r,formatters:n}=t;return s=>y(this,null,function*(){n&&Array.isArray(s)&&n.forEach((u,c)=>{u&&(s[c]=u(s[c]))});let o={call:r,params:s||[]};return(yield this.communicator.send(Fq.Methods.rpcCall,o)).data})}};xa.Eth=Zf});var _5=p(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.version=void 0;wa.version="1.1.0"});var yn=p(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.BaseError=void 0;var zq=_5(),Yf=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,s=r.cause instanceof e&&r.cause.docsPath||r.docsPath,o=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${zq.version}`].join(` 2`);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.shortMessage=t}};Pa.BaseError=Yf});var v5=p(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});Jf.narrow=Uq;function Uq(e){return e}});var ao=p(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.isTupleRegex=dr.integerRegex=dr.bytesRegex=void 0;dr.execTyped=Lq;function Lq(e,t){return e.exec(t)?.groups}dr.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;dr.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)?$/;dr.isTupleRegex=/^\(.+?\).*?$/});var e0=p(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.formatAbiParameter=Xf;var Dq=ao(),j5=/^tuple(?<array>(\[(\d*)\])*)$/;function Xf(e){let t=e.type;if(j5.test(e.type)&&"components"in e){t="(";let r=e.components.length;for(let s=0;s<r;s++){let o=e.components[s];t+=Xf(o),s<r-1&&(t+=", ")}let n=(0,Dq.execTyped)(j5,e.type);return t+=`)${n?.array??""}`,Xf(B(v({},e),{type:t}))}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}});var r0=p(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.formatAbiParameters=Gq;var $q=e0();function Gq(e){let t="",r=e.length;for(let n=0;n<r;n++){let s=e[n];t+=(0,$q.formatAbiParameter)(s),n!==r-1&&(t+=", ")}return t}});var s0=p(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.formatAbiItem=Vq;var uo=r0();function Vq(e){return e.type==="function"?`function ${e.name}(${(0,uo.formatAbiParameters)(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${(0,uo.formatAbiParameters)(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${(0,uo.formatAbiParameters)(e.inputs)})`:e.type==="error"?`error ${e.name}(${(0,uo.formatAbiParameters)(e.inputs)}
2)`:e.type==="constructor"?`constructor(${(0,uo.formatAbiParameters)(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}});var E5=p(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.formatAbi=Kq;var Wq=s0();function Kq(e){let t=[],r=e.length;for(let n=0;n<r;n++){let s=e[n],o=(0,Wq.formatAbiItem)(s);t.push(o)}return t}});var gn=p(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.functionModifiers=qe.eventModifiers=qe.modifiers=void 0;qe.isErrorSignature=Zq;qe.execErrorSignature=Yq;qe.isEventSignature=Jq;qe.execEventSignature=Xq;qe.isFunctionSignature=Qq;qe.execFunctionSignature=eT;qe.isStructSignature=tT;qe.execStructSignature=rT;qe.isConstructorSignature=nT;qe.execConstructorSignature=sT;qe.isFallbackSignature=oT;qe.execFallbackSignature=iT;qe.isReceiveSignature=uT;var Jn=ao(),x5=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Zq(e){return x5.test(e)}function Yq(e){return(0,Jn.execTyped)(x5,e)}var w5=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Jq(e){return w5.test(e)}function Xq(e){return(0,Jn.execTyped)(w5,e)}var P5=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Qq(e){return P5.test(e)}function eT(e){return(0,Jn.execTyped)(P5,e)}var q5=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function tT(e){return q5.test(e)}function rT(e){return(0,Jn.execTyped)(q5,e)}var T5=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function nT(e){return T5.test(e)}function sT(e){return(0,Jn.execTyped)(T5,e)}var A5=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function oT(e){return A5.test(e)}function iT(e){return(0,Jn.execTyped)(A5,e)}var aT=/^receive\(\) external payable$/;function uT(e){return aT.test(e)}qe.modifiers=new Set(["memory","indexed","storage","calldata"]);qe.eventModifiers=new Set(["indexed"]);qe.functionModifiers=new Set(["calldata","memory","storage"])});var co=p(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.UnknownSolidityTypeError=Cr.UnknownTypeError=Cr.InvalidAbiItemError=void 0;var c0=yn(),i0=class extends c0.BaseError{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}};Cr.InvalidAbiItemError=i0;var a0=class extends c0.BaseError{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" 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"})}};Cr.UnknownTypeError=a0;var u0=class extends c0.BaseError{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}};Cr.UnknownSolidityTypeError=u0});var Xn=p(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.InvalidAbiTypeParameterError=De.InvalidFunctionModifierError=De.InvalidModifierError=De.SolidityProtectedKeywordError=De.InvalidParameterError=De.InvalidAbiParametersError=De.InvalidAbiParameterError=void 0;var hn=yn(),d0=class extends hn.BaseError{constructor({param:t}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}};De.InvalidAbiParameterError=d0;var f0=class extends hn.BaseError{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}};De.InvalidAbiParametersError=f0;var l0=class extends hn.BaseError{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}};De.InvalidParameterError=l0;var p0=class extends hn.BaseError{constructor({param:t,name:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${r}" 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"})}};De.SolidityProtectedKeywordError=p0;var b0=class extends hn.BaseError{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}};De.InvalidModifierError=b0;var m0=class extends hn.BaseError{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}};De.InvalidFunctionModifierError=m0;var y0=class extends hn.BaseError{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invali
2d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}};De.InvalidAbiTypeParameterError=y0});var qa=p(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.InvalidStructSignatureError=Rr.UnknownSignatureError=Rr.InvalidSignatureError=void 0;var v0=yn(),g0=class extends v0.BaseError{constructor({signature:t,type:r}){super(`Invalid ${r} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};Rr.InvalidSignatureError=g0;var h0=class extends v0.BaseError{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}};Rr.UnknownSignatureError=h0;var _0=class extends v0.BaseError{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}};Rr.InvalidStructSignatureError=_0});var E0=p(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.CircularReferenceError=void 0;var cT=yn(),j0=class extends cT.BaseError{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}};Ta.CircularReferenceError=j0});var w0=p(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.InvalidParenthesisError=void 0;var dT=yn(),x0=class extends dT.BaseError{constructor({current:t,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};Aa.InvalidParenthesisError=x0});var I5=p(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.parameterCache=void 0;fo.getParameterCacheKey=fT;function fT(e,t,r){let n="";if(r)for(let s of Object.entries(r)){if(!s)continue;let o="";for(let a of s[1])o+=`[${a.type}${a.name?`:${a.name}`:""}]`;n+=`(${s[0]}{${o}})`}return t?`${t}:${e}${n}`:e}fo.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}]])});var vn=p(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.parseSignature=bT;bt.parseFunctionSignature=O5;bt.parseEventSignature=B5;bt.parseErrorSignature=S5;bt.parseConstructorSignature=C5;bt.parseFallbackSignature=R5;bt.parseAbiParameter=_n;bt.splitParameters=_t;bt.isSolidityType=M5;bt.isSolidityKeyword=k5;bt.isValidDataLocation=N5;var Qn=ao(),lT=co(),Ia=Xn(),es=qa(),pT=w0(),Oa=I5(),Ze=gn();function bT(e,t={}){if((0,Ze.isFunctionSignature)(e))return O5(e,t);if((0,Ze.isEventSignature)(e))return B5(e,t);if((0,Ze.isErrorSignature)(e))return S5(e,t);if((0,Ze.isConstructorSignature)(e))return C5(e,t);if((0,Ze.isFallbackSignature)(e))return R5(e);if((0,Ze.isReceiveSignature)(e))return{type:"receive",stateMutability:"payable"};throw new es.UnknownSignatureError({signature:e})}function O5(e,t={}){let r=(0,Ze.execFunctionSignature)(e);if(!r)throw new es.InvalidSignatureError({signature:e,type:"function"});let n=_t(r.parameters),s=[],o=n.length;for(let u=0;u<o;u++)s.push(_n(n[u],{modifiers:Ze.functionModifiers,structs:t,type:"function"}));let a=[];if(r.returns){let u=_t(r.returns),c=u.length;for(let d=0;d<c;d++)a.push(_n(u[d],{modifiers:Ze.functionModifiers,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:s,outputs:a}}function B5(e,t={}){let r=(0,Ze.execEventSignature)(e);if(!r)throw new es.InvalidSignatureError({signature:e,type:"event"});let n=_t(r.parameters),s=[],o=n.length;for(let a=0;a<o;a++)s.push(_n(n[a],{modifiers:Ze.eventModifiers,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:s}}function S5(e,t={}){let r=(0,Ze.execErrorSignature)(e);if(!r)throw new es.InvalidSignatureError({signature:e,type:"error"});let n=_t(r.parameters),s=[],o=n.length;for(let a=0;a<o;a++)s.push(_n(n[a],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:s}}function C5(e,t={}){let r=(0,Ze.execConstructorSignature)(e);if(!r)throw new es.InvalidSignatureError({signature:e,type:"constructor"});let n=_t(r.parameters),s=[],o=n.length;for(let a=0;a<o;a++)s.push(_n(n[a],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:s}}function R5(e){let t=(0,Ze.execFallbackSignature)(e);if(!t)throw new es.InvalidSignatureError({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}var mT=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,yT=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,gT=/^u?int$/;function _n(e,t){let r=(0,Oa.getParameterCacheKey)(e,t?.type,t?.structs);if(Oa.parameterCache.has(r))return Oa.parameterCache.get(r);let n=Qn.isTupleRegex.test(e),s=(0,Qn.execTyped)(n?yT:mT,e);if(!s)throw new Ia.InvalidParameterError({param:e});if(s.name&&k5(s.name))throw new Ia.SolidityProtectedKeywordError({param:e,name:s.name});let o=s.name?{name:s.name}:{},a=s.modifier==="indexed"?{indexed:!0}:{},u=t?.structs??{},c,d={};if(n){c="tuple";let f=_t(s.type),b=[],m=f.length;for(let h=0;h<m;h++)b.push(_n(f[h],{structs:u}));d={components:b}}else if(s.type in u)c="tuple",d={components:u[s.type]};else if(gT.test(s.type))c=`${s.type}256`;else if(s.type==="address payable")c="address";else if(c=s.type,t?.type!=="struct"&&!M5(c))throw new lT.UnknownSolidityTypeError({type:c});if(s.modifier){if(!t?.modifiers?.has?.(s.modifier))throw new Ia.InvalidModifierError({param:e,type:t?.type,modifier:s.modifier});if(Ze.functionModifiers.has(s.modifier)&&!N5(c,!!s.array))throw new Ia.InvalidFunctionModifierError({param:e,type:t?.type,modifier:s.modifier})}let l=v(v(v({type:`${c}${s.array??""}`},o),a),d);return Oa.parameterCache.set(r,l),l}function _t(e,t=[],r="",n=0){let s=e.trim().length;for(let o=0;o<s;o++){let a=e[o],u=e.slice(o+1);switch(a){case",":return n===0?_t(u,[...t,r.trim()]):_t(u,t,`${r}${a}`,n);case"(":return _t(u,t,`${r}${a}`,n+1);case")":return _t(u,t,`${r}${a}`,n-1);default:return _t(u,t,`${r}${a}`,n)}}if(r==="")return t;if(n!==0)throw new pT.InvalidParenthesisError({current:r,depth:n});return t.push(r.trim()),t}function M5(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Qn.bytesRegex.test(e)||Qn.integerRegex.test(e)}var hT=/^(?: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 k5(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Qn.bytesRegex.test(e)||Qn.integerRegex.test(e)||hT.test(e)}function N5(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}});var lo=p(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.parseStructs=ET;var H5=ao(),_T=co(),vT=Xn(),F5=qa(),jT=E0(),z5=gn(),U5=vn();function ET(e){let t={},r=e.length;for(let a=0;a<r;a++){let u=e[a];
2if(!(0,z5.isStructSignature)(u))continue;let c=(0,z5.execStructSignature)(u);if(!c)throw new F5.InvalidSignatureError({signature:u,type:"struct"});let d=c.properties.split(";"),l=[],f=d.length;for(let b=0;b<f;b++){let h=d[b].trim();if(!h)continue;let _=(0,U5.parseAbiParameter)(h,{type:"struct"});l.push(_)}if(!l.length)throw new F5.InvalidStructSignatureError({signature:u});t[c.name]=l}let n={},s=Object.entries(t),o=s.length;for(let a=0;a<o;a++){let[u,c]=s[a];n[u]=L5(c,t)}return n}var xT=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function L5(e,t,r=new Set){let n=[],s=e.length;for(let o=0;o<s;o++){let a=e[o];if(H5.isTupleRegex.test(a.type))n.push(a);else{let c=(0,H5.execTyped)(xT,a.type);if(!c?.type)throw new vT.InvalidAbiTypeParameterError({abiParameter:a});let{array:d,type:l}=c;if(l in t){if(r.has(l))throw new jT.CircularReferenceError({type:l});n.push(B(v({},a),{type:`tuple${d??""}`,components:L5(t[l]??[],t,new Set([...r,l]))}))}else if((0,U5.isSolidityType)(l))n.push(a);else throw new _T.UnknownTypeError({type:l})}}return n}});var D5=p(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});q0.parseAbi=TT;var wT=gn(),PT=lo(),qT=vn();function TT(e){let t=(0,PT.parseStructs)(e),r=[],n=e.length;for(let s=0;s<n;s++){let o=e[s];(0,wT.isStructSignature)(o)||r.push((0,qT.parseSignature)(o,t))}return r}});var G5=p(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});T0.parseAbiItem=BT;var AT=co(),IT=gn(),OT=lo(),$5=vn();function BT(e){let t;if(typeof e=="string")t=(0,$5.parseSignature)(e);else{let r=(0,OT.parseStructs)(e),n=e.length;for(let s=0;s<n;s++){let o=e[s];if(!(0,IT.isStructSignature)(o)){t=(0,$5.parseSignature)(o,r);break}}}if(!t)throw new AT.InvalidAbiItemError({signature:e});return t}});var W5=p(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.parseAbiParameter=RT;var ST=Xn(),A0=gn(),CT=lo(),V5=vn();function RT(e){let t;if(typeof e=="string")t=(0,V5.parseAbiParameter)(e,{modifiers:A0.modifiers});else{let r=(0,CT.parseStructs)(e),n=e.length;for(let s=0;s<n;s++){let o=e[s];if(!(0,A0.isStructSignature)(o)){t=(0,V5.parseAbiParameter)(o,{modifiers:A0.modifiers,structs:r});break}}}if(!t)throw new ST.InvalidAbiParameterError({param:e});return t}});var Y5=p(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.parseAbiParameters=NT;var MT=Xn(),O0=gn(),kT=lo(),K5=vn(),Z5=vn();function NT(e){let t=[];if(typeof e=="string"){let r=(0,K5.splitParameters)(e),n=r.length;for(let s=0;s<n;s++)t.push((0,Z5.parseAbiParameter)(r[s],{modifiers:O0.modifiers}))}else{let r=(0,kT.parseStructs)(e),n=e.length;for(let s=0;s<n;s++){let o=e[s];if((0,O0.isStructSignature)(o))continue;let a=(0,K5.splitParameters)(o),u=a.length;for(let c=0;c<u;c++)t.push((0,Z5.parseAbiParameter)(a[c],{modifiers:O0.modifiers,structs:r}))}}if(t.length===0)throw new MT.InvalidAbiParametersError({params:e});return t}});var fr=p(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.CircularReferenceError=Z.InvalidParenthesisError=Z.UnknownSignatureError=Z.InvalidSignatureError=Z.InvalidStructSignatureError=Z.InvalidAbiParameterError=Z.InvalidAbiParametersError=Z.InvalidParameterError=Z.SolidityProtectedKeywordError=Z.InvalidModifierError=Z.InvalidFunctionModifierError=Z.InvalidAbiTypeParameterError=Z.UnknownSolidityTypeError=Z.InvalidAbiItemError=Z.UnknownTypeError=Z.parseAbiParameters=Z.parseAbiParameter=Z.parseAbiItem=Z.parseAbi=Z.formatAbiParameters=Z.formatAbiParameter=Z.formatAbiItem=Z.formatAbi=Z.narrow=Z.BaseError=void 0;var HT=yn();Object.defineProperty(Z,"BaseError",{enumerable:!0,get:function(){return HT.BaseError}});var FT=v5();Object.defineProperty(Z,"narrow",{enumerable:!0,get:function(){return FT.narrow}});var zT=E5();Object.defineProperty(Z,"formatAbi",{enumerable:!0,get:function(){return zT.formatAbi}});var UT=s0();Object.defineProperty(Z,"formatAbiItem",{enumerable:!0,get:function(){return UT.formatAbiItem}});var LT=e0();Object.defineProperty(Z,"formatAbiParameter",{enumerable:!0,get:function(){return LT.formatAbiParameter}});var DT=r0();Object.defineProperty(Z,"formatAbiParameters",{enumerable:!0,get:function(){return DT.formatAbiParameters}});var $T=D5();Object.defineProperty(Z,"parseAbi",{enumerable:!0,get:function(){return $T.parseAbi}});var GT=G5();Object.defineProperty(Z,"parseAbiItem",{enumerable:!0,get:function(){return GT.parseAbiItem}});var VT=W5();Object.defineProperty(Z,"parseAbiParameter",{enumerable:!0,get:function(){return VT.parseAbiParameter}});var WT=Y5();Object.defineProperty(Z,"parseAbiParameters",{enumerable:!0,get:function(){return WT.parseAbiParameters}});var S0=co();Object.defineProperty(Z,"UnknownTypeError",{enumerable:!0,get:function(){return S0.UnknownTypeError}});Object.defineProperty(Z,"InvalidAbiItemError",{enumerable:!0,get:function(){return S0.InvalidAbiItemError}});Object.defineProperty(Z,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return S0.UnknownSolidityTypeError}});var jn=Xn();Object.defineProperty(Z,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return jn.InvalidAbiTypeParameterError}});Object.defineProperty(Z,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return jn.InvalidFunctionModifierError}});Object.defineProperty(Z,"InvalidModifierError",{enumerable:!0,get:function(){return jn.InvalidModifierError}});Object.defineProperty(Z,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return jn.SolidityProtectedKeywordError}});Object.defineProperty(Z,"InvalidParameterError",{enumerable:!0,get:function(){return jn.InvalidParameterError}});Object.defineProperty(Z,"InvalidAbiParametersError",{enumerable:!0,get:function(){return jn.InvalidAbiParametersError}});Object.defineProperty(Z,"InvalidAbiParameterError",{enumerable:!0,get:function(){return jn.InvalidAbiParameterError}});var C0=qa();Object.defineProperty(Z,"InvalidStructSignatureError",{enumerable:!0,get:function(){return C0.InvalidStructSignatureError}});Object.defineProperty(Z,"InvalidSignatureError",{enumerable:!0,get:function(){return C0.InvalidSignatureError}});Object.defineProperty(Z,"UnknownSignatureError",{enumerable:!0,get:function(){return C0.UnknownSignatureError}});var KT=w0();Object.defineProperty(Z,"InvalidParenthesisError",{enumerable:!0,get:function(){return KT.InvalidParenthesisError}});var ZT=E0();Object.defineProperty(Z,"CircularReferenceError",{enumerable:!0,get:function(){return ZT.CircularReferenceError}})});var ae=p(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.getAction=YT;function YT(e,t,r){let n=e[t.name];if(typeof n=="function")return n;let s=e[r];return typeof s=="function"?s:o=>t(e,o)}});var Gt=p(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.formatAbiItem=XT;Ba.formatAbiParams=M0;
2var JT=ge();function XT(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new JT.InvalidDefinitionTypeError(e.type);return`${e.name}(${M0(e.inputs,{includeName:t})})`}function M0(e,{includeName:t=!1}={}){return e?e.map(r=>QT(r,{includeName:t})).join(t?", ":","):""}function QT(e,{includeName:t}){return e.type.startsWith("tuple")?`(${M0(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}});var $e=p(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.isHex=eA;function eA(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}});var Ye=p(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});N0.size=rA;var tA=$e();function rA(e){return(0,tA.isHex)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}});var J5=p(Sa=>{"use strict";Object.defineProperty(Sa,"__esModule",{value:!0});Sa.version=void 0;Sa.version="2.38.3"});var Q=p(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.BaseError=void 0;po.setErrorConfig=nA;var X5=J5(),Ca={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${X5.version}`};function nA(e){Ca=e}var H0=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,s=r.cause instanceof e&&r.cause.docsPath||r.docsPath,o=Ca.getDocsUrl?.(B(v({},r),{docsPath:s})),a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...n?[`Details: ${n}`]:[],...Ca.version?[`Version: ${Ca.version}`]:[]].join(` 3`);super(a,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=s,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=X5.version}walk(t){return Q5(this,t)}};po.BaseError=H0;function Q5(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Q5(e.cause,t):t?null:e}});var ge=p(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.UnsupportedPackedAbiType=K.InvalidDefinitionTypeError=K.InvalidArrayError=K.InvalidAbiDecodingTypeError=K.InvalidAbiEncodingTypeError=K.DecodeLogTopicsMismatch=K.DecodeLogDataMismatch=K.BytesSizeMismatchError=K.AbiItemAmbiguityError=K.AbiFunctionSignatureNotFoundError=K.AbiFunctionOutputsNotFoundError=K.AbiFunctionNotFoundError=K.AbiEventNotFoundError=K.AbiEventSignatureNotFoundError=K.AbiEventSignatureEmptyTopicsError=K.AbiErrorSignatureNotFoundError=K.AbiErrorNotFoundError=K.AbiErrorInputsNotFoundError=K.AbiEncodingLengthMismatchError=K.AbiEncodingBytesSizeMismatchError=K.AbiEncodingArrayLengthMismatchError=K.AbiDecodingZeroDataError=K.AbiDecodingDataSizeTooSmallError=K.AbiDecodingDataSizeInvalidError=K.AbiConstructorParamsNotFoundError=K.AbiConstructorNotFoundError=void 0;var bo=Gt(),sA=Ye(),be=Q(),F0=class extends be.BaseError{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` 4`),{docsPath:t,name:"AbiConstructorNotFoundError"})}};K.AbiConstructorNotFoundError=F0;var z0=class extends be.BaseError{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` 5`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}};K.AbiConstructorParamsNotFoundError=z0;var U0=class extends be.BaseError{constructor({data:t,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: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}};K.AbiDecodingDataSizeInvalidError=U0;var L0=class extends be.BaseError{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` 7`),{metaMessages:[`Params: (${(0,bo.formatAbiParams)(r,{includeName:!0})})`,`Data: ${t} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=r,this.size=n}};K.AbiDecodingDataSizeTooSmallError=L0;var D0=class extends be.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}};K.AbiDecodingZeroDataError=D0;var $0=class extends be.BaseError{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(` 8`),{name:"AbiEncodingArrayLengthMismatchError"})}};K.AbiEncodingArrayLengthMismatchError=$0;var G0=class extends be.BaseError{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${(0,sA.size)(r)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}};K.AbiEncodingBytesSizeMismatchError=G0;var V0=class extends be.BaseError{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(` 9`),{name:"AbiEncodingLengthMismatchError"})}};K.AbiEncodingLengthMismatchError=V0;var W0=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(` 10`),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}};K.AbiErrorInputsNotFoundError=W0;var K0=class extends be.BaseError{constructor(t,{docsPath:r}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` 11`),{docsPath:r,name:"AbiErrorNotFoundError"})}};K.AbiErrorNotFoundError=K0;var Z0=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(` 12`),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}};K.AbiErrorSignatureNotFoundError=Z0;var Y0=class extends be.BaseError{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}};K.AbiEventSignatureEmptyTopicsError=Y0;var J0=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` 13`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}};K.AbiEventSignatureNotFoundError=J0;var X0=class extends be.BaseError{constructor(t,{docsPath:r}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` 14`),{docsPath:r,name:"AbiEventNotFoundError"})}};K.AbiEventNotFoundError=X0;var Q0=class extends be.BaseError{constructor(t,{docsPath:r}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` 15`),{docsPath:r,name:"AbiFunctionNotFoundError"})}};K.AbiFunctionNotFoundError=Q0;var el=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` 16`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}};K.AbiFunctionOutputsNotFoundError=el;var tl=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(` 17`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}};K.AbiFunctionSignatureNotFoundError=tl;var rl=class extends be.BaseError{constructor(t,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${(0,bo.formatAbiItem)(t.abiItem)}\`, and`,`\`${r.type}\` in \`${(0,bo.formatAbiItem)(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}};K.AbiItemAmbiguityError=rl;var nl=class extends be.BaseError{constructor({expectedSize:t,givenSize:r}){super(`Expected bytes${t}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}};K.BytesSizeMismatchError=nl;var sl=class extends be.BaseError{constructor({abiItem:t,data:r,params:n,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(` 18`),{metaMessages:[`Params: (${(0,bo.formatAbiParams)(n,{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=t,this.data=r,this.params=n,this.size=s}};K.DecodeLogDataMismatch=sl;var ol=class extends be.BaseError{constructor({abiItem:t,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${(0,bo.formatAbiItem)(t,{includeName:!0})}".`].join(` 19`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}};K.DecodeLogTopicsMismatch=ol;var il=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 20`),{docsPath:r,name:"InvalidAbiEncodingType"})}};K.InvalidAbiEncodingTypeError=il;var al=class extends be.BaseError{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 21`),{docsPath:r,name:"InvalidAbiDecodingType"})}};K.InvalidAbiDecodingTypeError=al;var ul=class extends be.BaseError{constructor(t){super([`Value "${t}" is not a valid array.`].join(` 22`),{name:"InvalidArrayError"})}};K.InvalidArrayError=ul;var cl=class extends be.BaseError{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 23`),{name:"InvalidDefinitionTypeError"})}};K.InvalidDefinitionTypeError=cl;var dl=class extends be.BaseError{constructor(t){super(`Type "${t}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}};K.UnsupportedPackedAbiType=dl});var ll=p(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.FilterTypeNotSupportedError=void 0;var oA=Q(),fl=class extends oA.BaseError{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}};Ra.FilterTypeNotSupportedError=fl});var mo=p(Mr=>{"use strict";
23Object.defineProperty(Mr,"__esModule",{value:!0});Mr.InvalidBytesLengthError=Mr.SizeExceedsPaddingSizeError=Mr.SliceOffsetOutOfBoundsError=void 0;var yl=Q(),pl=class extends yl.BaseError{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}};Mr.SliceOffsetOutOfBoundsError=pl;var bl=class extends yl.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};Mr.SizeExceedsPaddingSizeError=bl;var ml=class extends yl.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}};Mr.InvalidBytesLengthError=ml});var lr=p(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.pad=iA;yo.padHex=t2;yo.padBytes=r2;var e2=mo();function iA(e,{dir:t,size:r=32}={}){return typeof e=="string"?t2(e,{dir:t,size:r}):r2(e,{dir:t,size:r})}function t2(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new e2.SizeExceedsPaddingSizeError({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function r2(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new e2.SizeExceedsPaddingSizeError({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let s=0;s<r;s++){let o=t==="right";n[o?s:r-s-1]=e[o?s:e.length-s-1]}return n}});var En=p(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.SizeOverflowError=vt.InvalidHexValueError=vt.InvalidHexBooleanError=vt.InvalidBytesBooleanError=vt.IntegerOutOfRangeError=void 0;var go=Q(),gl=class extends go.BaseError{constructor({max:t,min:r,signed:n,size:s,value:o}){super(`Number "${o}" is not in safe ${s?`${s*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}};vt.IntegerOutOfRangeError=gl;var hl=class extends go.BaseError{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};vt.InvalidBytesBooleanError=hl;var _l=class extends go.BaseError{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}};vt.InvalidHexBooleanError=_l;var vl=class extends go.BaseError{constructor(t){super(`Hex value "${t}" is an odd length (${t.length}). It must be an even length.`,{name:"InvalidHexValueError"})}};vt.InvalidHexValueError=vl;var jl=class extends go.BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};vt.SizeOverflowError=jl});var Vt=p(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.trim=aA;function aA(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let s=0;s<r.length-1&&r[t==="left"?s:r.length-s-1].toString()==="0";s++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}});var Ee=p(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.assertSize=ka;kr.fromHex=uA;kr.hexToBigInt=xl;kr.hexToBool=i2;kr.hexToNumber=a2;kr.hexToString=u2;var s2=En(),n2=Ye(),Ma=Vt(),o2=de();function ka(e,{size:t}){if((0,n2.size)(e)>t)throw new s2.SizeOverflowError({givenSize:(0,n2.size)(e),maxSize:t})}function uA(e,t){let r=typeof t=="string"?{to:t}:t,n=r.to;return n==="number"?a2(e,r):n==="bigint"?xl(e,r):n==="string"?u2(e,r):n==="boolean"?i2(e,r):(0,o2.hexToBytes)(e,r)}function xl(e,t={}){let{signed:r}=t;t.size&&ka(e,{size:t.size});let n=BigInt(e);if(!r)return n;let s=(e.length-2)/2,o=(1n<<BigInt(s)*8n-1n)-1n;return n<=o?n:n-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function i2(e,t={}){let r=e;if(t.size&&(ka(r,{size:t.size}),r=(0,Ma.trim)(r)),(0,Ma.trim)(r)==="0x00")return!1;if((0,Ma.trim)(r)==="0x01")return!0;throw new s2.InvalidHexBooleanError(r)}function a2(e,t={}){return Number(xl(e,t))}function u2(e,t={}){let r=(0,o2.hexToBytes)(e);return t.size&&(ka(r,{size:t.size}),r=(0,Ma.trim)(r,{dir:"right"})),new TextDecoder().decode(r)}});var U=p(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.toHex=fA;xn.boolToHex=d2;xn.bytesToHex=Pl;xn.numberToHex=f2;xn.stringToHex=l2;var cA=En(),wl=lr(),c2=Ee(),dA=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fA(e,t={}){return typeof e=="number"||typeof e=="bigint"?f2(e,t):typeof e=="string"?l2(e,t):typeof e=="boolean"?d2(e,t):Pl(e,t)}function d2(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?((0,c2.assertSize)(r,{size:t.size}),(0,wl.pad)(r,{size:t.size})):r}function Pl(e,t={}){let r="";for(let s=0;s<e.length;s++)r+=dA[e[s]];let n=`0x${r}`;return typeof t.size=="number"?((0,c2.assertSize)(n,{size:t.size}),(0,wl.pad)(n,{dir:"right",size:t.size})):n}function f2(e,t={}){let{signed:r,size:n}=t,s=BigInt(e),o;n?r?o=(1n<<BigInt(n)*8n-1n)-1n:o=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof o=="bigint"&&r?-o-1n:0;if(o&&s>o||s<a){let c=typeof e=="bigint"?"n":"";throw new cA.IntegerOutOfRangeError({max:o?`${o}${c}`:void 0,min:`${a}${c}`,signed:r,size:n,value:`${e}${c}`})}let u=`0x${(r&&s<0?(1n<<BigInt(n*8))+BigInt(s):s).toString(16)}`;return n?(0,wl.pad)(u,{size:n}):u}var lA=new TextEncoder;function l2(e,t={}){let r=lA.encode(e);return Pl(r,t)}});var de=p(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.toBytes=gA;wn.boolToBytes=b2;wn.hexToBytes=Al;wn.numberToBytes=m2;wn.stringToBytes=y2;var pA=Q(),bA=$e(),ql=lr(),Tl=Ee(),mA=U(),yA=new TextEncoder;function gA(e,t={}){return typeof e=="number"||typeof e=="bigint"?m2(e,t):typeof e=="boolean"?b2(e,t):(0,bA.isHex)(e)?Al(e,t):y2(e,t)}function b2(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?((0,Tl.assertSize)(r,{size:t.size}),(0,ql.pad)(r,{size:t.size})):r}var pr={zero:48,nine:57,A:65,F:70,a:97,f:102};function p2(e){if(e>=pr.zero&&e<=pr.nine)return e-pr.zero;if(e>=pr.A&&e<=pr.F)return e-(pr.A-10);if(e>=pr.a&&e<=pr.f)return e-(pr.a-10)}function Al(e,t={}){let r=e;t.size&&((0,Tl.assertSize)(r,{size:t.size}),r=(0,ql.pad)(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let s=n.length/2,o=new Uint8Array(s);for(let a=0,u=0;a<s;a++){let c=p2(n.charCodeAt(u++)),d=p2(n.charCodeAt(u++));if(c===void 0||d===void 0)throw new pA.BaseError(`Invalid byte sequence ("${n[u-2]}${n[u-1]}" in "${n}").`);o[a]=c*16+d}return o}function m2(e,t){let r=(0,mA.numberToHex)(e,t);return Al(r)}function y2(e,t={}){let r=yA.encode(e);return typeof t.size=="number"?((0,Tl.assertSize)(r,{size:t.size}),(0,ql.pad)(r,{dir:"right",size:t.size})):r}});var Je=p(Il=>{"use strict";
23Object.defineProperty(Il,"__esModule",{value:!0});Il.keccak256=EA;var hA=o5(),_A=$e(),vA=de(),jA=U();function EA(e,t){let r=t||"hex",n=(0,hA.keccak_256)((0,_A.isHex)(e,{strict:!1})?(0,vA.toBytes)(e):e);return r==="bytes"?n:(0,jA.toHex)(n)}});var g2=p(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.hashSignature=qA;var xA=de(),wA=Je(),PA=e=>(0,wA.keccak256)((0,xA.toBytes)(e));function qA(e){return PA(e)}});var h2=p(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.normalizeSignature=AA;var TA=Q();function AA(e){let t=!0,r="",n=0,s="",o=!1;for(let a=0;a<e.length;a++){let u=e[a];if(["(",")",","].includes(u)&&(t=!0),u==="("&&n++,u===")"&&n--,!!t){if(n===0){if(u===" "&&["event","function",""].includes(s))s="";else if(s+=u,u===")"){o=!0;break}continue}if(u===" "){e[a-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}s+=u,r+=u}}if(!o)throw new TA.BaseError("Unable to normalize signature.");return s}});var Ha=p(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.toSignature=void 0;var IA=fr(),OA=h2(),BA=e=>{let t=typeof e=="string"?e:(0,IA.formatAbiItem)(e);return(0,OA.normalizeSignature)(t)};Na.toSignature=BA});var ho=p(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.toSignatureHash=RA;var SA=g2(),CA=Ha();function RA(e){return(0,SA.hashSignature)((0,CA.toSignature)(e))}});var Pn=p(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.toEventSelector=void 0;var MA=ho();Fa.toEventSelector=MA.toSignatureHash});var jt=p(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.InvalidAddressError=void 0;var kA=Q(),Cl=class extends kA.BaseError{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};za.InvalidAddressError=Cl});var qn=p(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.LruMap=void 0;var Rl=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}};Ua.LruMap=Rl});var rt=p(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.checksumAddress=_2;La.getAddress=LA;var NA=jt(),HA=de(),FA=Je(),zA=qn(),UA=Xe(),Ml=new zA.LruMap(8192);function _2(e,t){if(Ml.has(`${e}.${t}`))return Ml.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,FA.keccak256)((0,HA.stringToBytes)(r),"bytes"),s=(t?r.substring(`${t}0x`.length):r).split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&s[a]&&(s[a]=s[a].toUpperCase()),(n[a>>1]&15)>=8&&s[a+1]&&(s[a+1]=s[a+1].toUpperCase());let o=`0x${s.join("")}`;return Ml.set(`${e}.${t}`,o),o}function LA(e,t){if(!(0,UA.isAddress)(e,{strict:!1}))throw new NA.InvalidAddressError({address:e});return _2(e,t)}});var Xe=p(Nr=>{"use strict";
23Object.defineProperty(Nr,"__esModule",{value:!0});Nr.isAddressCache=void 0;Nr.isAddress=VA;var DA=qn(),$A=rt(),GA=/^0x[a-fA-F0-9]{40}$/;Nr.isAddressCache=new DA.LruMap(8192);function VA(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(Nr.isAddressCache.has(n))return Nr.isAddressCache.get(n);let s=GA.test(e)?e.toLowerCase()===e?!0:r?(0,$A.checksumAddress)(e)===e:!0:!1;return Nr.isAddressCache.set(n,s),s}});var Oe=p(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.concat=WA;_o.concatBytes=v2;_o.concatHex=j2;function WA(e){return typeof e[0]=="string"?j2(e):v2(e)}function v2(e){let t=0;for(let s of e)t+=s.length;let r=new Uint8Array(t),n=0;for(let s of e)r.set(s,n),n+=s.length;return r}function j2(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}});var mt=p(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.slice=ZA;vo.sliceBytes=P2;vo.sliceHex=q2;var E2=mo(),KA=$e(),Da=Ye();function ZA(e,t,r,{strict:n}={}){return(0,KA.isHex)(e,{strict:!1})?q2(e,t,r,{strict:n}):P2(e,t,r,{strict:n})}function x2(e,t){if(typeof t=="number"&&t>0&&t>(0,Da.size)(e)-1)throw new E2.SliceOffsetOutOfBoundsError({offset:t,position:"start",size:(0,Da.size)(e)})}function w2(e,t,r){if(typeof t=="number"&&typeof r=="number"&&(0,Da.size)(e)!==r-t)throw new E2.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:(0,Da.size)(e)})}function P2(e,t,r,{strict:n}={}){x2(e,t);let s=e.slice(t,r);return n&&w2(s,t,r),s}function q2(e,t,r,{strict:n}={}){x2(e,t);let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&w2(s,t,r),s}});var jo=p(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.integerRegex=Hr.bytesRegex=Hr.arrayRegex=void 0;Hr.arrayRegex=/^(.*)\[([0-9]*)\]$/;Hr.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;Hr.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)?$/});var Et=p($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.encodeAbiParameters=rI;$a.getArrayComponents=T2;var Eo=ge(),YA=jt(),JA=Q(),XA=En(),QA=Xe(),ts=Oe(),Tn=lr(),xo=Ye(),eI=mt(),An=U(),tI=jo();function rI(e,t){if(e.length!==t.length)throw new Eo.AbiEncodingLengthMismatchError({expectedLength:e.length,givenLength:t.length});let r=nI({params:e,values:t}),n=Nl(r);return n.length===0?"0x":n}function nI({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(kl({param:e[n],value:t[n]}));return r}function kl({param:e,value:t}){let r=T2(e.type);if(r){let[n,s]=r;return oI(t,{length:n,param:B(v({},e),{type:s})})}if(e.type==="tuple")return dI(t,{param:e});if(e.type==="address")return sI(t);if(e.type==="bool")return aI(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let n=e.type.startsWith("int"),[,,s="256"]=tI.integerRegex.exec(e.type)??[];return uI(t,{signed:n,size:Number(s)})}if(e.type.startsWith("bytes"))return iI(t,{param:e});if(e.type==="string")return cI(t);throw new Eo.InvalidAbiEncodingTypeError(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Nl(e){let t=0;for(let o=0;o<e.length;o++){let{dynamic:a,encoded:u}=e[o];a?t+=32:t+=(0,xo.size)(u)}let r=[],n=[],s=0;for(let o=0;o<e.length;o++){let{dynamic:a,encoded:u}=e[o];a?(r.push((0,An.numberToHex)(t+s,{size:32})),n.push(u),s+=(0,xo.size)(u)):r.push(u)}return(0,ts.concat)([...r,...n])}function sI(e){if(!(0,QA.isAddress)(e))throw new YA.InvalidAddressError({address:e});return{dynamic:!1,encoded:(0,Tn.padHex)(e.toLowerCase())}}function oI(e,{length:t,param:r}){let n=t===null;if(!Array.isArray(e))throw new Eo.InvalidArrayError(e);if(!n&&e.length!==t)throw new Eo.AbiEncodingArrayLengthMismatchError({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let s=!1,o=[];for(let a=0;a<e.length;a++){let u=kl({param:r,value:e[a]});u.dynamic&&(s=!0),o.push(u)}if(n||s){let a=Nl(o);if(n){let u=(0,An.numberToHex)(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?(0,ts.concat)([u,a]):u}}if(s)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:(0,ts.concat)(o.map(({encoded:a})=>a))}}function iI(e,{param:t}){let[,r]=t.type.split("bytes"),n=(0,xo.size)(e);if(!r){let s=e;return n%32!==0&&(s=(0,Tn.padHex)(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:(0,ts.concat)([(0,Tn.padHex)((0,An.numberToHex)(n,{size:32})),s])}}if(n!==Number.parseInt(r,10))throw new Eo.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,Tn.padHex)(e,{dir:"right"})}}function aI(e){if(typeof e!="boolean")throw new JA.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,Tn.padHex)((0,An.boolToHex)(e))}}function uI(e,{signed:t,size:r=256}){if(typeof r=="number"){let n=2n**(BigInt(r)-(t?1n:0n))-1n,s=t?-n-1n:0n;if(e>n||e<s)throw new XA.IntegerOutOfRangeError({max:n.toString(),min:s.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,An.numberToHex)(e,{size:32,signed:t})}}function cI(e){let t=(0,An.stringToHex)(e),r=Math.ceil((0,xo.size)(t)/32),n=[];for(let s=0;s<r;s++)n.push((0,Tn.padHex)((0,eI.slice)(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,ts.concat)([(0,Tn.padHex)((0,An.numberToHex)((0,xo.size)(t),{size:32})),...n])}}function dI(e,{param:t}){let r=!1,n=[];for(let s=0;s<t.components.length;
23s++){let o=t.components[s],a=Array.isArray(e)?s:o.name,u=kl({param:o,value:e[a]});n.push(u),u.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Nl(n):(0,ts.concat)(n.map(({encoded:s})=>s))}}function T2(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}});var Fr=p(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.toFunctionSelector=void 0;var fI=mt(),lI=ho(),pI=e=>(0,fI.slice)((0,lI.toSignatureHash)(e),0,4);Ga.toFunctionSelector=pI});var Wt=p(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.getAbiItem=hI;wo.isArgOfType=Va;wo.getAmbiguousTypes=Fl;var bI=ge(),mI=$e(),Hl=Xe(),yI=Pn(),gI=Fr();function hI(e){let{abi:t,args:r=[],name:n}=e,s=(0,mI.isHex)(n,{strict:!1}),o=t.filter(u=>s?u.type==="function"?(0,gI.toFunctionSelector)(u)===n:u.type==="event"?(0,yI.toEventSelector)(u)===n:!1:"name"in u&&u.name===n);if(o.length===0)return;if(o.length===1)return o[0];let a;for(let u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return u;continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((d,l)=>{let f="inputs"in u&&u.inputs[l];return f?Va(d,f):!1})){if(a&&"inputs"in a&&a.inputs){let d=Fl(u.inputs,a.inputs,r);if(d)throw new bI.AbiItemAmbiguityError({abiItem:u,type:d[0]},{abiItem:a,type:d[1]})}a=u}}return a||o[0]}function Va(e,t){let r=typeof e,n=t.type;switch(n){case"address":return(0,Hl.isAddress)(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>Va(Object.values(e)[o],s)):/^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(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(s=>Va(s,B(v({},t),{type:n.replace(/(\[[0-9]{0,}\])$/,"")}))):!1}}function Fl(e,t,r){for(let n in e){let s=e[n],o=t[n];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return Fl(s.components,o.components,r[n]);let a=[s.type,o.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?(0,Hl.isAddress)(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?(0,Hl.isAddress)(r[n],{strict:!1}):!1)return a}}});var zr=p(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.encodeEventTopics=qI;var A2=ge(),_I=ll(),vI=de(),jI=Je(),EI=Pn(),xI=Et(),wI=Gt(),PI=Wt(),I2="/docs/contract/encodeEventTopics";function qI(e){let{abi:t,eventName:r,args:n}=e,s=t[0];if(r){let c=(0,PI.getAbiItem)({abi:t,name:r});if(!c)throw new A2.AbiEventNotFoundError(r,{docsPath:I2});s=c}if(s.type!=="event")throw new A2.AbiEventNotFoundError(void 0,{docsPath:I2});let o=(0,wI.formatAbiItem)(s),a=(0,EI.toEventSelector)(o),u=[];if(n&&"inputs"in s){let c=s.inputs?.filter(l=>"indexed"in l&&l.indexed),d=Array.isArray(n)?n:Object.values(n).length>0?c?.map(l=>n[l.name])??[]:[];d.length>0&&(u=c?.map((l,f)=>Array.isArray(d[f])?d[f].map((b,m)=>O2({param:l,value:d[f][m]})):typeof d[f]<"u"&&d[f]!==null?O2({param:l,value:d[f]}):null)??[])}return[a,...u]}function O2({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return(0,jI.keccak256)((0,vI.toBytes)(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new _I.FilterTypeNotSupportedError(e.type);return(0,xI.encodeAbiParameters)([e],[t])}});var Po=p(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.createFilterRequestScope=TI;function TI(e,{method:t}){let r={};return e.transport.type==="fallback"&&e.transport.onResponse?.(({method:n,response:s,status:o,transport:a})=>{o==="success"&&t===n&&(r[s]=a.request)}),n=>r[n]||e.request}});var Wa=p(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});Ll.createContractEventFilter=OI;var AI=zr(),B2=U(),II=Po();function OI(e,t){return y(this,null,function*(){let{address:r,abi:n,args:s,eventName:o,fromBlock:a,strict:u,toBlock:c}=t,d=(0,II.createFilterRequestScope)(e,{method:"eth_newFilter"}),l=o?(0,AI.encodeEventTopics)({abi:n,args:s,eventName:o}):void 0,f=yield e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof a=="bigint"?(0,B2.numberToHex)(a):a,toBlock:typeof c=="bigint"?(0,B2.numberToHex)(c):c,topics:l}]});return{abi:n,args:s,eventName:o,id:f,request:d(f),strict:!!u,type:"event"}})}});var xe=p(Dl=>{"use strict";
23Object.defineProperty(Dl,"__esModule",{value:!0});Dl.parseAccount=BI;function BI(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}});var Gl=p($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.prepareEncodeFunctionData=MI;var S2=ge(),SI=Fr(),CI=Gt(),RI=Wt(),C2="/docs/contract/encodeFunctionData";function MI(e){let{abi:t,args:r,functionName:n}=e,s=t[0];if(n){let o=(0,RI.getAbiItem)({abi:t,args:r,name:n});if(!o)throw new S2.AbiFunctionNotFoundError(n,{docsPath:C2});s=o}if(s.type!=="function")throw new S2.AbiFunctionNotFoundError(void 0,{docsPath:C2});return{abi:[s],functionName:(0,SI.toFunctionSelector)((0,CI.formatAbiItem)(s))}}});var Qe=p(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.encodeFunctionData=FI;var kI=Oe(),NI=Et(),HI=Gl();function FI(e){let{args:t}=e,{abi:r,functionName:n}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:(0,HI.prepareEncodeFunctionData)(e),s=r[0],o=n,a="inputs"in s&&s.inputs?(0,NI.encodeAbiParameters)(s.inputs,t??[]):void 0;return(0,kI.concatHex)([o,a??"0x"])}});var Ka=p(Ur=>{"use strict";
23Object.defineProperty(Ur,"__esModule",{value:!0});Ur.solidityPanic=Ur.solidityError=Ur.panicReasons=void 0;Ur.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."};Ur.solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"};Ur.solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});var Jl=p(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.RecursiveReadLimitExceededError=Lr.PositionOutOfBoundsError=Lr.NegativeOffsetError=void 0;var Yl=Q(),Wl=class extends Yl.BaseError{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}};Lr.NegativeOffsetError=Wl;var Kl=class extends Yl.BaseError{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}};Lr.PositionOutOfBoundsError=Kl;var Zl=class extends Yl.BaseError{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};Lr.RecursiveReadLimitExceededError=Zl});var rs=p(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.createCursor=UI;var Za=Jl(),zI={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 Za.RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Za.PositionOutOfBoundsError({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Za.NegativeOffsetError({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Za.NegativeOffsetError({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function UI(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(zI);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}});var Ya=p(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.fromBytes=DI;In.bytesToBigInt=M2;In.bytesToBool=k2;In.bytesToNumber=N2;In.bytesToString=H2;var LI=En(),R2=Vt(),ns=Ee(),Ql=U();function DI(e,t){let r=typeof t=="string"?{to:t}:t,n=r.to;return n==="number"?N2(e,r):n==="bigint"?M2(e,r):n==="boolean"?k2(e,r):n==="string"?H2(e,r):(0,Ql.bytesToHex)(e,r)}function M2(e,t={}){typeof t.size<"u"&&(0,ns.assertSize)(e,{size:t.size});let r=(0,Ql.bytesToHex)(e,t);return(0,ns.hexToBigInt)(r,t)}
23function k2(e,t={}){let r=e;if(typeof t.size<"u"&&((0,ns.assertSize)(r,{size:t.size}),r=(0,R2.trim)(r)),r.length>1||r[0]>1)throw new LI.InvalidBytesBooleanError(r);return!!r[0]}function N2(e,t={}){typeof t.size<"u"&&(0,ns.assertSize)(e,{size:t.size});let r=(0,Ql.bytesToHex)(e,t);return(0,ns.hexToNumber)(r,t)}function H2(e,t={}){let r=e;return typeof t.size<"u"&&((0,ns.assertSize)(r,{size:t.size}),r=(0,R2.trim)(r,{dir:"right"})),new TextDecoder().decode(r)}});var br=p(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.decodeAbiParameters=ZI;var ep=ge(),$I=rt(),GI=rs(),Ja=Ye(),VI=mt(),WI=Vt(),xt=Ya(),KI=de(),Xa=U(),z2=Et();function ZI(e,t){let r=typeof t=="string"?(0,KI.hexToBytes)(t):t,n=(0,GI.createCursor)(r);if((0,Ja.size)(r)===0&&e.length>0)throw new ep.AbiDecodingZeroDataError;if((0,Ja.size)(t)&&(0,Ja.size)(t)<32)throw new ep.AbiDecodingDataSizeTooSmallError({data:typeof t=="string"?t:(0,Xa.bytesToHex)(t),params:e,size:(0,Ja.size)(t)});let s=0,o=[];for(let a=0;a<e.length;++a){let u=e[a];n.setPosition(s);let[c,d]=ss(n,u,{staticPosition:0});s+=d,o.push(c)}return o}function ss(e,t,{staticPosition:r}){let n=(0,z2.getArrayComponents)(t.type);if(n){let[s,o]=n;return JI(e,B(v({},t),{type:o}),{length:s,staticPosition:r})}if(t.type==="tuple")return tO(e,t,{staticPosition:r});if(t.type==="address")return YI(e);if(t.type==="bool")return XI(e);if(t.type.startsWith("bytes"))return QI(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return eO(e,t);if(t.type==="string")return rO(e,{staticPosition:r});throw new ep.InvalidAbiDecodingTypeError(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}var F2=32,tp=32;function YI(e){let t=e.readBytes(32);return[(0,$I.checksumAddress)((0,Xa.bytesToHex)((0,VI.sliceBytes)(t,-20))),32]}function JI(e,t,{length:r,staticPosition:n}){if(!r){let a=(0,xt.bytesToNumber)(e.readBytes(tp)),u=n+a,c=u+F2;e.setPosition(u);let d=(0,xt.bytesToNumber)(e.readBytes(F2)),l=qo(t),f=0,b=[];for(let m=0;m<d;++m){e.setPosition(c+(l?m*32:f));let[h,_]=ss(e,t,{staticPosition:c});f+=_,b.push(h)}return e.setPosition(n+32),[b,32]}if(qo(t)){let a=(0,xt.bytesToNumber)(e.readBytes(tp)),u=n+a,c=[];for(let d=0;d<r;++d){e.setPosition(u+d*32);let[l]=ss(e,t,{staticPosition:u});c.push(l)}return e.setPosition(n+32),[c,32]}let s=0,o=[];for(let a=0;a<r;++a){let[u,c]=ss(e,t,{staticPosition:n+s});s+=c,o.push(u)}return[o,s]}function XI(e){return[(0,xt.bytesToBool)(e.readBytes(32),{size:32}),32]}function QI(e,t,{staticPosition:r}){let[n,s]=t.type.split("bytes");if(!s){let a=(0,xt.bytesToNumber)(e.readBytes(32));e.setPosition(r+a);let u=(0,xt.bytesToNumber)(e.readBytes(32));if(u===0)return e.setPosition(r+32),["0x",32];let c=e.readBytes(u);return e.setPosition(r+32),[(0,Xa.bytesToHex)(c),32]}return[(0,Xa.bytesToHex)(e.readBytes(Number.parseInt(s,10),32)),32]}function eO(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[n>48?(0,xt.bytesToBigInt)(s,{signed:r}):(0,xt.bytesToNumber)(s,{signed:r}),32]}function tO(e,t,{staticPosition:r}){let n=t.components.length===0||t.components.some(({name:a})=>!a),s=n?[]:{},o=0;if(qo(t)){let a=(0,xt.bytesToNumber)(e.readBytes(tp)),u=r+a;for(let c=0;c<t.components.length;++c){let d=t.components[c];e.setPosition(u+o);let[l,f]=ss(e,d,{staticPosition:u});o+=f,s[n?c:d?.name]=l}return e.setPosition(r+32),[s,32]}for(let a=0;a<t.components.length;++a){let u=t.components[a],[c,d]=ss(e,u,{staticPosition:r});s[n?a:u?.name]=c,o+=d}return[s,o]}function rO(e,{staticPosition:t}){let r=(0,xt.bytesToNumber)(e.readBytes(32)),n=t+r;e.setPosition(n);let s=(0,xt.bytesToNumber)(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];let o=e.readBytes(s,32),a=(0,xt.bytesToString)((0,WI.trim)(o));return e.setPosition(t+32),[a,32]}function qo(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(qo);let r=(0,z2.getArrayComponents)(e.type);return!!(r&&qo(B(v({},e),{type:r[1]})))}});var To=p(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.decodeErrorResult=iO;var U2=Ka(),L2=ge(),D2=mt(),nO=Fr(),sO=br(),oO=Gt();function iO(e){let{abi:t,data:r}=e,n=(0,D2.slice)(r,0,4);if(n==="0x")throw new L2.AbiDecodingZeroDataError;let o=[...t||[],U2.solidityError,U2.solidityPanic].find(a=>a.type==="error"&&n===(0,nO.toFunctionSelector)((0,oO.formatAbiItem)(a)));if(!o)throw new L2.AbiErrorSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?(0,sO.decodeAbiParameters)(o.inputs,(0,D2.slice)(r,4)):void 0,errorName:o.name}}});var Ce=p(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.stringify=void 0;var aO=(e,t,r)=>
23JSON.stringify(e,(n,s)=>{let o=typeof s=="bigint"?s.toString():s;return typeof t=="function"?t(n,o):o},r);Qa.stringify=aO});var op=p(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.formatAbiItemWithArgs=cO;var uO=Ce();function cO({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((s,o)=>`${n&&s.name?`${s.name}: `:""}${typeof t[o]=="object"?(0,uO.stringify)(t[o]):t[o]}`).join(", ")})`}});var os=p(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.weiUnits=Dr.gweiUnits=Dr.etherUnits=void 0;Dr.etherUnits={gwei:9,wei:18};Dr.gweiUnits={ether:-9,wei:9};Dr.weiUnits={ether:-18,gwei:-9}});var Ao=p(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.formatUnits=dO;function dO(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[s,o]=[r.slice(0,r.length-t),r.slice(r.length-t)];return o=o.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${o?`.${o}`:""}`}});var is=p(ap=>{"use strict";Object.defineProperty(ap,"__esModule",{value:!0});ap.formatEther=pO;var fO=os(),lO=Ao();function pO(e,t="wei"){return(0,lO.formatUnits)(e,fO.etherUnits[t])}});var $r=p(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.formatGwei=yO;var bO=os(),mO=Ao();function yO(e,t="wei"){return(0,mO.formatUnits)(e,bO.gweiUnits[t])}});var eu=p(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.StateAssignmentConflictError=Gr.AccountStateConflictError=void 0;Gr.prettyStateMapping=fp;Gr.prettyStateOverride=gO;var $2=Q(),cp=class extends $2.BaseError{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}};Gr.AccountStateConflictError=cp;var dp=class extends $2.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}};Gr.StateAssignmentConflictError=dp;function fp(e){return e.reduce((t,{slot:r,value:n})=>`${t} ${r}: ${n} 24`,"")}function gO(e){return e.reduce((t,s)=>{var o=s,{address:r}=o,n=G(o,["address"]);let a=`${t} ${r}: 25`;return n.nonce&&(a+=` nonce: ${n.nonce} 26`),n.balance&&(a+=` balance: ${n.balance} 27`),n.code&&(a+=` code: ${n.code} 28`),n.state&&(a+=` state: 29`,a+=fp(n.state)),n.stateDiff&&(a+=` stateDiff: 30`,a+=fp(n.stateDiff)),a},` State Override: 31`).slice(0,-1)}});var Ge=p(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.WaitForTransactionReceiptTimeoutError=he.TransactionReceiptRevertedError=he.TransactionReceiptNotFoundError=he.TransactionNotFoundError=he.TransactionExecutionError=he.InvalidStorageKeySizeError=he.InvalidSerializedTransactionError=he.InvalidSerializedTransactionTypeError=he.InvalidSerializableTransactionError=he.InvalidLegacyVError=he.FeeConflictError=void 0;he.prettyPrint=wp;var hO=is(),lp=$r(),Mt=Q();function wp(e){let t=Object.entries(e).map(([n,s])=>s===void 0||s===!1?null:[n,s]).filter(Boolean),r=t.reduce((n,[s])=>Math.max(n,s.length),0);return t.map(([n,s])=>` ${`${n}:`.padEnd(r+1)} ${s}`).join(` 32`)}var pp=class extends Mt.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"})}};he.FeeConflictError=pp;var bp=class extends Mt.BaseError{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}};he.InvalidLegacyVError=bp;var mp=class extends Mt.BaseError{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",wp(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}};he.InvalidSerializableTransactionError=mp;var yp=class extends Mt.BaseError{constructor({serializedType:t}){super(`Serialized transaction type "${t}
33" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=t}};he.InvalidSerializedTransactionTypeError=yp;var gp=class extends Mt.BaseError{constructor({attributes:t,serializedTransaction:r,type:n}){let s=Object.entries(t).map(([o,a])=>typeof a>"u"?o:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${n}" was provided.`,{metaMessages:[`Serialized Transaction: "${r}"`,s.length>0?`Missing Attributes: ${s.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=r,this.type=n}};he.InvalidSerializedTransactionError=gp;var hp=class extends Mt.BaseError{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}};he.InvalidStorageKeySizeError=hp;var _p=class extends Mt.BaseError{constructor(t,{account:r,docsPath:n,chain:s,data:o,gas:a,gasPrice:u,maxFeePerGas:c,maxPriorityFeePerGas:d,nonce:l,to:f,value:b}){let m=wp({chain:s&&`${s?.name} (id: ${s?.id})`,from:r?.address,to:f,value:typeof b<"u"&&`${(0,hO.formatEther)(b)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:a,gasPrice:typeof u<"u"&&`${(0,lp.formatGwei)(u)} gwei`,maxFeePerGas:typeof c<"u"&&`${(0,lp.formatGwei)(c)} gwei`,maxPriorityFeePerGas:typeof d<"u"&&`${(0,lp.formatGwei)(d)} gwei`,nonce:l});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",m].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}};he.TransactionExecutionError=_p;var vp=class extends Mt.BaseError{constructor({blockHash:t,blockNumber:r,blockTag:n,hash:s,index:o}){let a="Transaction";n&&o!==void 0&&(a=`Transaction at block time "${n}" at index "${o}"`),t&&o!==void 0&&(a=`Transaction at block hash "${t}" at index "${o}"`),r&&o!==void 0&&(a=`Transaction at block number "${r}" at index "${o}"`),s&&(a=`Transaction with hash "${s}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}};he.TransactionNotFoundError=vp;var jp=class extends Mt.BaseError{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}};he.TransactionReceiptNotFoundError=jp;var Ep=class extends Mt.BaseError{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}};he.TransactionReceiptRevertedError=Ep;var xp=class extends Mt.BaseError{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}};he.WaitForTransactionReceiptTimeoutError=xp});var tu=p(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.getUrl=as.getContractAddress=void 0;var _O=e=>e;as.getContractAddress=_O;var vO=e=>e;as.getUrl=vO});var mr=p(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.RawContractError=nt.CounterfactualDeploymentFailedError=nt.ContractFunctionZeroDataError=nt.ContractFunctionRevertedError=nt.ContractFunctionExecutionError=nt.CallExecutionError=void 0;var jO=xe(),EO=Ka(),xO=To(),G2=Gt(),V2=op(),wO=Wt(),PO=is(),Pp=$r(),qO=ge(),us=Q(),TO=eu(),W2=Ge(),AO=tu(),qp=class extends us.BaseError{constructor(t,{account:r,docsPath:n,chain:s,data:o,gas:a,gasPrice:u,maxFeePerGas:c,maxPriorityFeePerGas:d,nonce:l,to:f,value:b,stateOverride:m}){let h=r?(0,jO.parseAccount)(r):void 0,_=(0,W2.prettyPrint)({from:h?.address,to:f,value:typeof b<"u"&&`${(0,PO.formatEther)(b)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:a,gasPrice:typeof u<"u"&&`${(0,Pp.formatGwei)(u)} gwei`,maxFeePerGas:typeof c<"u"&&`${(0,Pp.formatGwei)(c)} gwei`,maxPriorityFeePerGas:typeof d<"u"&&`${(0,Pp.formatGwei)(d)} gwei`,nonce:l});m&&(_+=` 34${(0,TO.prettyStateOverride)(m)}`),super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",_].filter(
34Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}};nt.CallExecutionError=qp;var Tp=class extends us.BaseError{constructor(t,{abi:r,args:n,contractAddress:s,docsPath:o,functionName:a,sender:u}){let c=(0,wO.getAbiItem)({abi:r,args:n,name:a}),d=c?(0,V2.formatAbiItemWithArgs)({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=c?(0,G2.formatAbiItem)(c,{includeName:!0}):void 0,f=(0,W2.prettyPrint)({address:s&&(0,AO.getContractAddress)(s),function:l,args:d&&d!=="()"&&`${[...Array(a?.length??0).keys()].map(()=>" ").join("")}${d}`,sender:u});super(t.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],f&&"Contract Call:",f].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=r,this.args=n,this.cause=t,this.contractAddress=s,this.functionName=a,this.sender=u}};nt.ContractFunctionExecutionError=Tp;var Ap=class extends us.BaseError{constructor({abi:t,data:r,functionName:n,message:s}){let o,a,u,c;if(r&&r!=="0x")try{a=(0,xO.decodeErrorResult)({abi:t,data:r});let{abiItem:l,errorName:f,args:b}=a;if(f==="Error")c=b[0];else if(f==="Panic"){let[m]=b;c=EO.panicReasons[m]}else{let m=l?(0,G2.formatAbiItem)(l,{includeName:!0}):void 0,h=l&&b?(0,V2.formatAbiItemWithArgs)({abiItem:l,args:b,includeFunctionName:!1,includeName:!1}):void 0;u=[m?`Error: ${m}`:"",h&&h!=="()"?` ${[...Array(f?.length??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(l){o=l}else s&&(c=s);let d;o instanceof qO.AbiErrorSignatureNotFoundError&&(d=o.signature,u=[`Unable to decode signature "${d}" 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=${d}.`]),super(c&&c!=="execution reverted"||d?[`The contract function "${n}" reverted with the following ${d?"signature":"reason"}:`,c||d].join(` 35`):`The contract function "${n}" reverted.`,{cause:o,metaMessages:u,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=a,this.raw=r,this.reason=c,this.signature=d}};nt.ContractFunctionRevertedError=Ap;var Ip=class extends us.BaseError{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}};nt.ContractFunctionZeroDataError=Ip;var Op=class extends us.BaseError{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{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"})}};nt.CounterfactualDeploymentFailedError=Op;var Bp=class extends us.BaseError{constructor({data:t,message:r}){super(r||"",{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=t}};nt.RawContractError=Bp});var Pt=p(wt=>{"use strict";
35Object.defineProperty(wt,"__esModule",{value:!0});wt.TimeoutError=wt.SocketClosedError=wt.RpcRequestError=wt.WebSocketRequestError=wt.HttpRequestError=void 0;var ru=Ce(),Io=Q(),Oo=tu(),Sp=class extends Io.BaseError{constructor({body:t,cause:r,details:n,headers:s,status:o,url:a}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[o&&`Status: ${o}`,`URL: ${(0,Oo.getUrl)(a)}`,t&&`Request body: ${(0,ru.stringify)(t)}`].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=t,this.headers=s,this.status=o,this.url=a}};wt.HttpRequestError=Sp;var Cp=class extends Io.BaseError{constructor({body:t,cause:r,details:n,url:s}){super("WebSocket request failed.",{cause:r,details:n,metaMessages:[`URL: ${(0,Oo.getUrl)(s)}`,t&&`Request body: ${(0,ru.stringify)(t)}`].filter(Boolean),name:"WebSocketRequestError"})}};wt.WebSocketRequestError=Cp;var Rp=class extends Io.BaseError{constructor({body:t,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${(0,Oo.getUrl)(n)}`,`Request body: ${(0,ru.stringify)(t)}`],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=r.code,this.data=r.data}};wt.RpcRequestError=Rp;var Mp=class extends Io.BaseError{constructor({url:t}={}){super("The socket has been closed.",{metaMessages:[t&&`URL: ${(0,Oo.getUrl)(t)}`].filter(Boolean),name:"SocketClosedError"})}};wt.SocketClosedError=Mp;var kp=class extends Io.BaseError{constructor({body:t,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,Oo.getUrl)(r)}`,`Request body: ${(0,ru.stringify)(t)}`],name:"TimeoutError"})}};wt.TimeoutError=kp});var yr=p(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.UnknownRpcError=V.AtomicityNotSupportedError=V.AtomicReadyWalletRejectedUpgradeError=V.BundleTooLargeError=V.UnknownBundleIdError=V.DuplicateIdError=V.UnsupportedChainIdError=V.UnsupportedNonOptionalCapabilityError=V.SwitchChainError=V.ChainDisconnectedError=V.ProviderDisconnectedError=V.UnsupportedProviderMethodError=V.UnauthorizedProviderError=V.UserRejectedRequestError=V.JsonRpcVersionUnsupportedError=V.LimitExceededRpcError=V.MethodNotSupportedRpcError=V.TransactionRejectedRpcError=V.ResourceUnavailableRpcError=V.ResourceNotFoundRpcError=V.InvalidInputRpcError=V.InternalRpcError=V.InvalidParamsRpcError=V.MethodNotFoundRpcError=V.InvalidRequestRpcError=V.ParseRpcError=V.ProviderRpcError=V.RpcError=void 0;var IO=Q(),OO=Pt(),BO=-1,Fe=class extends IO.BaseError{constructor(t,{code:r,docsPath:n,metaMessages:s,name:o,shortMessage:a}){super(a,{cause:t,docsPath:n,metaMessages:s||t?.metaMessages,name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||t.name,this.code=t instanceof OO.RpcRequestError?t.code:r??BO}};V.RpcError=Fe;var Ve=class extends Fe{constructor(t,r){super(t,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}};V.ProviderRpcError=Ve;var nu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};V.ParseRpcError=nu;Object.defineProperty(nu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var su=class e extends Fe{constructor(t){super(t,{code:e.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};V.InvalidRequestRpcError=su;Object.defineProperty(su,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var ou=class e extends Fe{constructor(t,{method:r}={}){super(t,{code:e.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}};V.MethodNotFoundRpcError=ou;Object.defineProperty(ou,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var iu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 36`)})}};V.InvalidParamsRpcError=iu;Object.defineProperty(iu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var au=class e extends Fe{constructor(t){super(t,{code:e.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};V.InternalRpcError=au;Object.defineProperty(au,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var uu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 37`)})}};V.InvalidInputRpcError=uu;Object.defineProperty(uu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var cu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};V.ResourceNotFoundRpcError=cu;Object.defineProperty(cu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var du=class e extends Fe{constructor(t){super(t,{code:e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};V.ResourceUnavailableRpcError=du;Object.defineProperty(du,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var fu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};V.TransactionRejectedRpcError=fu;Object.defineProperty(fu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var lu=class e extends Fe{constructor(t,{method:r}={}){super(t,{code:e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}};V.MethodNotSupportedRpcError=lu;Object.defineProperty(lu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var pu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};V.LimitExceededRpcError=pu;Object.defineProperty(pu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var bu=class e extends Fe{constructor(t){super(t,{code:e.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};V.JsonRpcVersionUnsupportedError=bu;Object.defineProperty(bu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var mu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};V.UserRejectedRequestError=mu;Object.defineProperty(mu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var yu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};V.UnauthorizedProviderError=yu;Object.defineProperty(yu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var gu=class e extends Ve{constructor(t,{method:r}={}){super(t,{code:e.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}};V.UnsupportedProviderMethodError=gu;Object.defineProperty(gu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var hu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};V.ProviderDisconnectedError=hu;Object.defineProperty(hu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var _u=class e extends Ve{constructor(t){super(t,{code:e.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};V.ChainDisconnectedError=_u;Object.defineProperty(_u,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});var vu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};V.SwitchChainError=vu;Object.defineProperty(vu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});var ju=class e extends Ve{constructor(t){super(t,{code:e.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};V.UnsupportedNonOptionalCapabilityError=ju;Object.defineProperty(ju,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});var Eu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};V.UnsupportedChainIdError=Eu;Object.defineProperty(Eu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});var xu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};V.DuplicateIdError=xu;Object.defineProperty(xu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});var wu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};V.UnknownBundleIdError=wu;Object.defineProperty(wu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});var Pu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};V.BundleTooLargeError=Pu;Object.defineProperty(Pu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});var qu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};V.AtomicReadyWalletRejectedUpgradeError=qu;Object.defineProperty(qu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
37);var Tu=class e extends Ve{constructor(t){super(t,{code:e.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};V.AtomicityNotSupportedError=Tu;Object.defineProperty(Tu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});var Np=class extends Fe{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}};V.UnknownRpcError=Np});var gr=p(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.getContractError=NO;var SO=ge(),CO=Q(),Au=mr(),RO=Pt(),MO=yr(),kO=3;function NO(e,{abi:t,address:r,args:n,docsPath:s,functionName:o,sender:a}){let u=e instanceof Au.RawContractError?e:e instanceof CO.BaseError?e.walk(h=>"data"in h)||e.walk():{},{code:c,data:d,details:l,message:f,shortMessage:b}=u,m=e instanceof SO.AbiDecodingZeroDataError?new Au.ContractFunctionZeroDataError({functionName:o}):[kO,MO.InternalRpcError.code].includes(c)&&(d||l||f||b)?new Au.ContractFunctionRevertedError({abi:t,data:typeof d=="object"?d.data:d,functionName:o,message:u instanceof RO.RpcRequestError?l:b??f}):e;return new Au.ContractFunctionExecutionError(m,{abi:t,args:n,contractAddress:r,docsPath:s,functionName:o,sender:a})}});var zp=p(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.publicKeyToAddress=zO;var HO=rt(),FO=Je();function zO(e){let t=(0,FO.keccak256)(`0x${e.substring(4)}`).substring(26);return(0,HO.checksumAddress)(`0x${t}`)}});var Vr=p(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.notImplemented=ue.bitMask=void 0;ue.isBytes=Ou;ue.abytes=Bu;ue.abool=UO;ue.numberToHexUnpadded=Y2;ue.hexToNumber=Dp;ue.bytesToHex=$p;ue.hexToBytes=Su;ue.bytesToNumberBE=DO;ue.bytesToNumberLE=$O;ue.numberToBytesBE=X2;ue.numberToBytesLE=GO;ue.numberToVarBytesBE=VO;ue.ensureBytes=WO;ue.concatBytes=Q2;ue.equalBytes=KO;ue.utf8ToBytes=ZO;ue.inRange=ev;ue.aInRange=YO;ue.bitLen=JO;ue.bitGet=XO;ue.bitSet=QO;ue.createHmacDrbg=tB;ue.validateObject=nB;ue.memoized=oB;var Iu=BigInt(0),Bo=BigInt(1);function Ou(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Bu(e){if(!Ou(e))throw new Error("Uint8Array expected")}function UO(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Y2(e){let t=e.toString(16);return t.length&1?"0"+t:t}function Dp(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Iu:BigInt("0x"+e)}var J2=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",LO=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function $p(e){if(Bu(e),J2)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=LO[e[r]];return t}var hr={_0:48,_9:57,A:65,F:70,a:97,f:102};function K2(e){if(e>=hr._0&&e<=hr._9)return e-hr._0;if(e>=hr.A&&e<=hr.F)return e-(hr.A-10);if(e>=hr.a&&e<=hr.f)return e-(hr.a-10)}function Su(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(J2)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let s=0,o=0;s<r;s++,o+=2){let a=K2(e.charCodeAt(o)),u=K2(e.charCodeAt(o+1));if(a===void 0||u===void 0){let c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[s]=a*16+u}return n}function DO(e){return Dp($p(e))}function $O(e){return Bu(e),Dp($p(Uint8Array.from(e).reverse()))}function X2(e,t){return Su(e.toString(16).padStart(t*2,"0"))}function GO(e,t){return X2(e,t).reverse()}function VO(e){return Su(Y2(e))}function WO(e,t,r){let n;if(typeof t=="string")try{n=Su(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Ou(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let s=n.length;if(typeof r=="number"&&s!==r)throw new Error(e+" of length "+r+" expected, got "+s);return n}function Q2(...e){let t=0;for(let n=0;n<e.length;n++){let s=e[n];Bu(s),t+=s.length}let r=new Uint8Array(t);for(let n=0,s=0;n<e.length;n++){let o=e[n];r.set(o,s),s+=o.length}return r}function KO(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}function ZO(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}var Up=e=>typeof e=="bigint"&&Iu<=e;function ev(e,t,r){return Up(e)&&Up(t)&&Up(r)&&t<=e&&e<r}function YO(e,t,r,n){if(!ev(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function JO(e){let t;for(t=0;e>Iu;e>>=Bo,t+=1);return t}function XO(e,t){return e>>BigInt(t)&Bo}function QO(e,t,r){return e|(r?Bo:Iu)<<BigInt(t)}var eB=e=>(Bo<<BigInt(e))-Bo;ue.bitMask=eB;var Lp=e=>new Uint8Array(e),Z2=e=>Uint8Array.from(e);function tB(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Lp(e),s=Lp(e),o=0,a=()=>{n.fill(1),s.fill(0),o=0},u=(...f)=>r(s,n,...f),c=(f=Lp(0))=>{s=u(Z2([0]),f),n=u(),f.length!==0&&(s=u(Z2([1]),f),n=u())},d=()=>
vendor: 1,099 bytes, line 37
37{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,b=[];for(;f<t;){n=u();let m=n.slice();b.push(m),f+=n.length}return Q2(...b)};return(f,b)=>{a(),c(f);let m;for(;!(m=b(d()));)c();return a(),m}}var rB={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Ou(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function nB(e,t,r={}){let n=(s,o,a)=>{let u=rB[o];if(typeof u!="function")throw new Error("invalid validator function");let c=e[s];if(!(a&&c===void 0)&&!u(c,e))throw new Error("param "+String(s)+" is invalid. Expected "+o+", got "+c)};for(let[s,o]of Object.entries(t))n(s,o,!1);for(let[s,o]of Object.entries(r))n(s,o,!0);return e}var sB=()=>{throw new Error("not implemented")};ue.notImplemented=sB;function oB(e){let t=new WeakMap;return(r,...n)=>{let s=t.get(r);if(s!==void 0)return s;let o=e(r,...n);return t.set(r,o),o}}});var So=p(ve=>{"use strict";
37Object.defineProperty(ve,"__esModule",{value:!0});ve.isNegativeLE=void 0;ve.mod=yt;ve.pow=uB;ve.pow2=cB;ve.invert=Cu;ve.tonelliShanks=ov;ve.FpSqrt=iv;ve.validateField=pB;ve.FpPow=Gp;ve.FpInvertBatch=av;ve.FpDiv=bB;ve.FpLegendre=Ru;ve.FpIsSquare=mB;ve.nLength=Vp;ve.Field=Wp;ve.FpSqrtOdd=yB;ve.FpSqrtEven=gB;ve.hashToPrivateScalar=hB;ve.getFieldBytesLength=Kp;ve.getMinHashLength=uv;ve.mapHashToField=_B;var iB=$f(),gt=Vr(),et=BigInt(0),Ae=BigInt(1),On=BigInt(2),aB=BigInt(3),tv=BigInt(4),rv=BigInt(5),nv=BigInt(8);function yt(e,t){let r=e%t;return r>=et?r:t+r}function uB(e,t,r){return Gp(Wp(r),e,t)}function cB(e,t,r){let n=e;for(;t-- >et;)n*=n,n%=r;return n}function Cu(e,t){if(e===et)throw new Error("invert: expected non-zero number");if(t<=et)throw new Error("invert: expected positive modulus, got "+t);let r=yt(e,t),n=t,s=et,o=Ae,a=Ae,u=et;for(;r!==et;){let d=n/r,l=n%r,f=s-a*d,b=o-u*d;n=r,r=l,s=a,o=u,a=f,u=b}if(n!==Ae)throw new Error("invert: does not exist");return yt(s,t)}function sv(e,t){let r=(e.ORDER+Ae)/tv,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function dB(e,t){let r=(e.ORDER-rv)/nv,n=e.mul(t,On),s=e.pow(n,r),o=e.mul(t,s),a=e.mul(e.mul(o,On),s),u=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(u),t))throw new Error("Cannot find square root");return u}function ov(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Ae,r=0;for(;t%On===et;)t/=On,r++;let n=On,s=Wp(e);for(;Ru(s,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return sv;let o=s.pow(n,t),a=(t+Ae)/On;return function(c,d){if(c.is0(d))return d;if(Ru(c,d)!==1)throw new Error("Cannot find square root");let l=r,f=c.mul(c.ONE,o),b=c.pow(d,t),m=c.pow(d,a);for(;!c.eql(b,c.ONE);){if(c.is0(b))return c.ZERO;let h=1,_=c.sqr(b);for(;!c.eql(_,c.ONE);)if(h++,_=c.sqr(_),h===l)throw new Error("Cannot find square root");let E=Ae<<BigInt(l-h-1),j=c.pow(f,E);l=h,f=c.sqr(j),b=c.mul(b,f),m=c.mul(m,j)}return m}}function iv(e){return e%tv===aB?sv:e%nv===rv?dB:ov(e)}var fB=(e,t)=>(yt(e,t)&Ae)===Ae;ve.isNegativeLE=fB;var lB=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function pB(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=lB.reduce((n,s)=>(n[s]="function",n),t);return(0,gt.validateObject)(e,r)}function Gp(e,t,r){if(r<et)throw new Error("invalid exponent, negatives unsupported");if(r===et)return e.ONE;if(r===Ae)return t;let n=e.ONE,s=t;for(;r>et;)r&Ae&&(n=e.mul(n,s)),s=e.sqr(s),r>>=Ae;return n}function av(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),s=t.reduce((a,u,c)=>e.is0(u)?a:(n[c]=a,e.mul(a,u)),e.ONE),o=e.inv(s);return t.reduceRight((a,u,c)=>e.is0(u)?a:(n[c]=e.mul(a,n[c]),e.mul(a,u)),o),n}function bB(e,t,r){return e.mul(t,typeof r=="bigint"?Cu(r,e.ORDER):e.inv(r))}function Ru(e,t){let r=(e.ORDER-Ae)/On,n=e.pow(t,r),s=e.eql(n,e.ONE),o=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!s&&!o&&!a)throw new Error("invalid Legendre symbol result");return s?1:o?0:-1}function mB(e,t){return Ru(e,t)===1}function Vp(e,t){t!==void 0&&(0,iB.anumber)(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Wp(e,t,r=!1,n={}){if(e<=et)throw new Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:s,nByteLength:o}=Vp(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a,u=Object.freeze({ORDER:e,isLE:r,BITS:s,BYTES:o,MASK:(0,gt.bitMask)(s),ZERO:et,ONE:Ae,create:c=>yt(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return et<=c&&c<e},is0:c=>c===et,isOdd:c=>(c&Ae)===Ae,neg:c=>yt(-c,e),eql:(c,d)=>c===d,sqr:c=>yt(c*c,e),add:(c,d)=>yt(c+d,e),sub:(c,d)=>yt(c-d,e),mul:(c,d)=>yt(c*d,e),pow:(c,d)=>Gp(u,c,d),div:(c,d)=>yt(c*Cu(d,e),e),sqrN:c=>c*c,addN:(c,d)=>c+d,subN:(c,d)=>c-d,mulN:(c,d)=>c*d,inv:c=>Cu(c,e),sqrt:n.sqrt||(c=>(a||(a=iv(e)),a(u,c))),toBytes:c=>r?(0,gt.numberToBytesLE)(c,o):(0,gt.numberToBytesBE)(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return r?(0,gt.bytesToNumberLE)(c):(0,gt.bytesToNumberBE)(c)},invertBatch:c=>av(u,c),cmov:(c,d,l)=>l?d:c});return Object.freeze(u)}function yB(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}function gB(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function hB(e,t,r=!1){e=(0,gt.ensureBytes)("privateHash",e);let n=e.length,s=Vp(t).nByteLength+8;if(s<24||n<s||n>1024)throw new Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+n);let o=r?(0,gt.bytesToNumberLE)(e):(0,gt.bytesToNumberBE)(e);return yt(o,t-Ae)+Ae}function Kp(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function uv(e){let t=Kp(e);return t+Math.ceil(t/2)}function _B(e,t,r=!1){let n=e.length,s=Kp(t),o=uv(t);if(n<16||n<o||n>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+n);let a=r?(0,gt.bytesToNumberLE)(e):(0,gt.bytesToNumberBE)(e),u=yt(a,t-Ae)+Ae;return r?(0,gt.numberToBytesLE)(u,s):(0,gt.numberToBytesBE)(u,s)}});var mv=p(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.wNAF=vB;cs.pippenger=jB;cs.precomputeMSMUnsafe=EB;cs.validateBasic=xB;var cv=So(),Co=Vr(),dv=BigInt(0),Qp=BigInt(1);function Zp(e,t){let r=t.negate();return e?r:t}function eb(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Yp(e,t){eb(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),s=2**e,o=(0,Co.bitMask)(e),a=BigInt(e);return{windows:r,windowSize:n,mask:o,maxNumber:s,shiftBy:a}}function fv(e,t,r){let{windowSize:n,mask:s,maxNumber:o,shiftBy:a}=r,u=Number(e&s),c=e>>a;u>n&&(u-=o,c+=Qp);let d=t*n,l=d+Math.abs(u)-1,f=u===0,b=u<0,m=t%2!==0;
37return{nextN:c,offset:l,isZero:f,isNeg:b,isNegF:m,offsetF:d}}function lv(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function pv(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}var Jp=new WeakMap,bv=new WeakMap;function Xp(e){return bv.get(e)||1}function vB(e,t){return{constTimeNegate:Zp,hasPrecomputes(r){return Xp(r)!==1},unsafeLadder(r,n,s=e.ZERO){let o=r;for(;n>dv;)n&Qp&&(s=s.add(o)),o=o.double(),n>>=Qp;return s},precomputeWindow(r,n){let{windows:s,windowSize:o}=Yp(n,t),a=[],u=r,c=u;for(let d=0;d<s;d++){c=u,a.push(c);for(let l=1;l<o;l++)c=c.add(u),a.push(c);u=c.double()}return a},wNAF(r,n,s){let o=e.ZERO,a=e.BASE,u=Yp(r,t);for(let c=0;c<u.windows;c++){let{nextN:d,offset:l,isZero:f,isNeg:b,isNegF:m,offsetF:h}=fv(s,c,u);s=d,f?a=a.add(Zp(m,n[h])):o=o.add(Zp(b,n[l]))}return{p:o,f:a}},wNAFUnsafe(r,n,s,o=e.ZERO){let a=Yp(r,t);for(let u=0;u<a.windows&&s!==dv;u++){let{nextN:c,offset:d,isZero:l,isNeg:f}=fv(s,u,a);if(s=c,!l){let b=n[d];o=o.add(f?b.negate():b)}}return o},getPrecomputes(r,n,s){let o=Jp.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&Jp.set(n,s(o))),o},wNAFCached(r,n,s){let o=Xp(r);return this.wNAF(o,this.getPrecomputes(o,r,s),n)},wNAFCachedUnsafe(r,n,s,o){let a=Xp(r);return a===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(a,this.getPrecomputes(a,r,s),n,o)},setWindowSize(r,n){eb(n,t),bv.set(r,n),Jp.delete(r)}}}function jB(e,t,r,n){lv(r,e),pv(n,t);let s=r.length,o=n.length;if(s!==o)throw new Error("arrays of points and scalars must have equal length");let a=e.ZERO,u=(0,Co.bitLen)(BigInt(s)),c=1;u>12?c=u-3:u>4?c=u-2:u>0&&(c=2);let d=(0,Co.bitMask)(c),l=new Array(Number(d)+1).fill(a),f=Math.floor((t.BITS-1)/c)*c,b=a;for(let m=f;m>=0;m-=c){l.fill(a);for(let _=0;_<o;_++){let E=n[_],j=Number(E>>BigInt(m)&d);l[j]=l[j].add(r[_])}let h=a;for(let _=l.length-1,E=a;_>0;_--)E=E.add(l[_]),h=h.add(E);if(b=b.add(h),m!==0)for(let _=0;_<c;_++)b=b.double()}return b}function EB(e,t,r,n){eb(n,t.BITS),lv(r,e);let s=e.ZERO,o=2**n-1,a=Math.ceil(t.BITS/n),u=(0,Co.bitMask)(n),c=r.map(d=>{let l=[];for(let f=0,b=d;f<o;f++)l.push(b),b=b.add(d);return l});return d=>{if(pv(d,t),d.length>r.length)throw new Error("array of scalars must be smaller than array of points");let l=s;for(let f=0;f<a;f++){if(l!==s)for(let m=0;m<n;m++)l=l.double();let b=BigInt(a*n-(f+1)*n);for(let m=0;m<d.length;m++){let h=d[m],_=Number(h>>b&u);_&&(l=l.add(c[m][_-1]))}}return l}}function xB(e){return(0,cv.validateField)(e.Fp),(0,Co.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze(B(v(v({},(0,cv.nLength)(e.n,e.nBitLength)),e),{p:e.Fp.ORDER}))}});var nb=p(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.DER=Be.DERErr=void 0;Be.weierstrassPoints=gv;Be.weierstrass=qB;Be.SWUFpSqrtRatio=hv;Be.mapToCurveSimpleSWU=TB;var Mu=mv(),_r=So(),Y=Vr();function yv(e){e.lowS!==void 0&&(0,Y.abool)("lowS",e.lowS),e.prehash!==void 0&&(0,Y.abool)("prehash",e.prehash)}function wB(e){let t=(0,Mu.validateBasic)(e);(0,Y.validateObject)(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:s}=t;if(r){if(!n.eql(s,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze(v({},t))}var ku=class extends Error{constructor(t=""){super(t)}};Be.DERErr=ku;Be.DER={Err:ku,_tlv:{encode:(e,t)=>{let{Err:r}=Be.DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,s=(0,Y.numberToHexUnpadded)(n);if(s.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?(0,Y.numberToHexUnpadded)(s.length/2|128):"";return(0,Y.numberToHexUnpadded)(e)+o+s+t},decode(e,t){let{Err:r}=Be.DER,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let s=t[n++],o=!!(s&128),a=0;if(!o)a=s;else{let c=s&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let d=t.subarray(n,n+c);
37if(d.length!==c)throw new r("tlv.decode: length bytes not complete");if(d[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let l of d)a=a<<8|l;if(n+=c,a<128)throw new r("tlv.decode(long): not minimal encoding")}let u=t.subarray(n,n+a);if(u.length!==a)throw new r("tlv.decode: wrong value length");return{v:u,l:t.subarray(n+a)}}},_int:{encode(e){let{Err:t}=Be.DER;if(e<kt)throw new t("integer: negative integers are not allowed");let r=(0,Y.numberToHexUnpadded)(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Be.DER;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return(0,Y.bytesToNumberBE)(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=Be.DER,s=(0,Y.ensureBytes)("signature",e),{v:o,l:a}=n.decode(48,s);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:u,l:c}=n.decode(2,o),{v:d,l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(u),s:r.decode(d)}},hexFromSig(e){let{_tlv:t,_int:r}=Be.DER,n=t.encode(2,r.encode(e.r)),s=t.encode(2,r.encode(e.s)),o=n+s;return t.encode(48,o)}};function tb(e,t){return(0,Y.bytesToHex)((0,Y.numberToBytesBE)(e,t))}var kt=BigInt(0),fe=BigInt(1),Wr=BigInt(2),Ro=BigInt(3),rb=BigInt(4);function gv(e){let t=wB(e),{Fp:r}=t,n=(0,_r.Field)(t.n,t.nBitLength),s=t.toBytes||((T,x,A)=>{let I=x.toAffine();return(0,Y.concatBytes)(Uint8Array.from([4]),r.toBytes(I.x),r.toBytes(I.y))}),o=t.fromBytes||(T=>{let x=T.subarray(1),A=r.fromBytes(x.subarray(0,r.BYTES)),I=r.fromBytes(x.subarray(r.BYTES,2*r.BYTES));return{x:A,y:I}});function a(T){let{a:x,b:A}=t,I=r.sqr(T),O=r.mul(I,T);return r.add(r.add(O,r.mul(T,x)),A)}function u(T,x){let A=r.sqr(x),I=a(T);return r.eql(A,I)}if(!u(t.Gx,t.Gy))throw new Error("bad curve params: generator point");let c=r.mul(r.pow(t.a,Ro),rb),d=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,d)))throw new Error("bad curve params: a or b");function l(T){return(0,Y.inRange)(T,fe,t.n)}function f(T){let{allowedPrivateKeyLengths:x,nByteLength:A,wrapPrivateKey:I,n:O}=t;if(x&&typeof T!="bigint"){if((0,Y.isBytes)(T)&&(T=(0,Y.bytesToHex)(T)),typeof T!="string"||!x.includes(T.length))throw new Error("invalid private key");T=T.padStart(A*2,"0")}let S;try{S=typeof T=="bigint"?T:(0,Y.bytesToNumberBE)((0,Y.ensureBytes)("private key",T,A))}catch(C){throw new Error("invalid private key, expected hex or "+A+" bytes, got "+typeof T)}return I&&(S=(0,_r.mod)(S,O)),(0,Y.aInRange)("private key",S,fe,O),S}function b(T){if(!(T instanceof _))throw new Error("ProjectivePoint expected")}let m=(0,Y.memoized)((T,x)=>{let{px:A,py:I,pz:O}=T;if(r.eql(O,r.ONE))return{x:A,y:I};let S=T.is0();x==null&&(x=S?r.ONE:r.inv(O));let C=r.mul(A,x),M=r.mul(I,x),N=r.mul(O,x);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(N,r.ONE))throw new Error("invZ was invalid");return{x:C,y:M}}),h=(0,Y.memoized)(T=>{if(T.is0()){if(t.allowInfinityPoint&&!r.is0(T.py))return;throw new Error("bad point: ZERO")}let{x,y:A}=T.toAffine();if(!r.isValid(x)||!r.isValid(A))throw new Error("bad point: x or y not FE");if(!u(x,A))throw new Error("bad point: equation left != right");if(!T.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class _{constructor(x,A,I){if(x==null||!r.isValid(x))throw new Error("x required");if(A==null||!r.isValid(A)||r.is0(A))throw new Error("y required");if(I==null||!r.isValid(I))throw new Error("z required");this.px=x,this.py=A,this.pz=I,Object.freeze(this)}static fromAffine(x){let{x:A,y:I}=x||{};if(!x||!r.isValid(A)||!r.isValid(I))throw new Error("invalid affine point");if(x instanceof _)throw new Error("projective point not allowed");let O=S=>r.eql(S,r.ZERO);return O(A)&&O(I)?_.ZERO:new _(A,I,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){let A=(0,_r.FpInvertBatch)(r,x.map(I=>I.pz));return x.map((I,O)=>I.toAffine(A[O])).map(_.fromAffine)}static fromHex(x){let A=_.fromAffine(o((0,Y.ensureBytes)("pointHex",x)));return A.assertValidity(),A}static fromPrivateKey(x){return _.BASE.multiply(f(x))}static msm(x,A){return(0,Mu.pippenger)(_,n,x,A)}_setWindowSize(x){q.setWindowSize(this,x)}assertValidity(){h(this)}hasEvenY(){let{y:x}=this.toAffine();if(r.isOdd)return!r.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){b(x);let{px:A,py:I,pz:O}=this,{px:S,py:C,pz:M}=x,N=r.eql(r.mul(A,M),r.mul(S,O)),F=r.eql(r.mul(I,M),r.mul(C,O));return N&&F}negate(){return new _(this.px,r.neg(this.py),this.pz)}double(){let{a:x,b:A}=t,I=r.mul(A,Ro),{px:O,py:S,pz:C}=this,M=r.ZERO,N=r.ZERO,F=r.ZERO,D=r.mul(O,O),X=r.mul(S,S),H=r.mul(C,C),k=r.mul(O,S);return k=r.add(k,k),F=r.mul(O,C),F=r.add(F,F),M=r.mul(x,F),N=r.mul(I,H),N=r.add(M,N),M=r.sub(X,N),N=r.add(X,N),N=r.mul(M,N),M=r.mul(k,M),F=r.mul(I,F),H=r.mul(x,H),k=r.sub(D,H),k=r.mul(x,k),k=r.add(k,F),F=r.add(D,D),D=r.add(F,D),D=r.add(D,H),D=r.mul(D,k),N=r.add(N,D),H=r.mul(S,C),H=r.add(H,H),D=r.mul(H,k),M=r.sub(M,D),F=r.mul(H,X),F=r.add(F,F),F=r.add(F,F),new _(M,N,F)}add(x){b(x);let{px:A,py:I,pz:O}=this,{px:S,py:C,pz:M}=x,N=r.ZERO,F=r.ZERO,D=r.ZERO,X=t.a,H=r.mul(t.b,Ro),k=r.mul(A,S),L=r.mul(I,C),J=r.mul(O,M),z=r.add(A,I),$=r.add(S,C);z=r.mul(z,$),$=r.add(k,L),z=r.sub(z,$),$=r.add(A,O);let oe=r.add(S,M);return $=r.mul($,oe),oe=r.add(k,J),$=r.sub($,oe),oe=r.add(I,O),N=r.add(C,M),oe=r.mul(oe,N),N=r.add(L,J),oe=r.sub(oe,N),D=r.mul(X,$),N=r.mul(H,J),D=r.add(N,D),N=r.sub(L,D),D=r.add(L,D),F=r.mul(N,D),L=r.add(k,k),L=r.add(L,k),J=r.mul(X,J),$=r.mul(H,$),L=r.add(L,J),J=r.sub(k,J),J=r.mul(X,J),$=r.add($,J),k=r.mul(L,$),F=r.add(F,k),k=r.mul(oe,$),N=r.mul(z,N),N=r.sub(N,k),k=r.mul(z,L),D=r.mul(
37oe,D),D=r.add(D,k),new _(N,F,D)}subtract(x){return this.add(x.negate())}is0(){return this.equals(_.ZERO)}wNAF(x){return q.wNAFCached(this,x,_.normalizeZ)}multiplyUnsafe(x){let{endo:A,n:I}=t;(0,Y.aInRange)("scalar",x,kt,I);let O=_.ZERO;if(x===kt)return O;if(this.is0()||x===fe)return this;if(!A||q.hasPrecomputes(this))return q.wNAFCachedUnsafe(this,x,_.normalizeZ);let{k1neg:S,k1:C,k2neg:M,k2:N}=A.splitScalar(x),F=O,D=O,X=this;for(;C>kt||N>kt;)C&fe&&(F=F.add(X)),N&fe&&(D=D.add(X)),X=X.double(),C>>=fe,N>>=fe;return S&&(F=F.negate()),M&&(D=D.negate()),D=new _(r.mul(D.px,A.beta),D.py,D.pz),F.add(D)}multiply(x){let{endo:A,n:I}=t;(0,Y.aInRange)("scalar",x,fe,I);let O,S;if(A){let{k1neg:C,k1:M,k2neg:N,k2:F}=A.splitScalar(x),{p:D,f:X}=this.wNAF(M),{p:H,f:k}=this.wNAF(F);D=q.constTimeNegate(C,D),H=q.constTimeNegate(N,H),H=new _(r.mul(H.px,A.beta),H.py,H.pz),O=D.add(H),S=X.add(k)}else{let{p:C,f:M}=this.wNAF(x);O=C,S=M}return _.normalizeZ([O,S])[0]}multiplyAndAddUnsafe(x,A,I){let O=_.BASE,S=(M,N)=>N===kt||N===fe||!M.equals(O)?M.multiplyUnsafe(N):M.multiply(N),C=S(this,A).add(S(x,I));return C.is0()?void 0:C}toAffine(x){return m(this,x)}isTorsionFree(){let{h:x,isTorsionFree:A}=t;if(x===fe)return!0;if(A)return A(_,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:x,clearCofactor:A}=t;return x===fe?this:A?A(_,this):this.multiplyUnsafe(t.h)}toRawBytes(x=!0){return(0,Y.abool)("isCompressed",x),this.assertValidity(),s(_,this,x)}toHex(x=!0){return(0,Y.abool)("isCompressed",x),(0,Y.bytesToHex)(this.toRawBytes(x))}}_.BASE=new _(t.Gx,t.Gy,r.ONE),_.ZERO=new _(r.ZERO,r.ONE,r.ZERO);let{endo:E,nBitLength:j}=t,q=(0,Mu.wNAF)(_,E?Math.ceil(j/2):j);return{CURVE:t,ProjectivePoint:_,normPrivateKeyToScalar:f,weierstrassEquation:a,isWithinCurveOrder:l}}function PB(e){let t=(0,Mu.validateBasic)(e);return(0,Y.validateObject)(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze(v({lowS:!0},t))}function qB(e){let t=PB(e),{Fp:r,n,nByteLength:s,nBitLength:o}=t,a=r.BYTES+1,u=2*r.BYTES+1;function c(H){return(0,_r.mod)(H,n)}function d(H){return(0,_r.invert)(H,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:f,weierstrassEquation:b,isWithinCurveOrder:m}=gv(B(v({},t),{toBytes(H,k,L){let J=k.toAffine(),z=r.toBytes(J.x),$=Y.concatBytes;return(0,Y.abool)("isCompressed",L),L?$(Uint8Array.from([k.hasEvenY()?2:3]),z):$(Uint8Array.from([4]),z,r.toBytes(J.y))},fromBytes(H){let k=H.length,L=H[0],J=H.subarray(1);if(k===a&&(L===2||L===3)){let z=(0,Y.bytesToNumberBE)(J);if(!(0,Y.inRange)(z,fe,r.ORDER))throw new Error("Point is not on curve");let $=b(z),oe;try{oe=r.sqrt($)}catch(lt){let He=lt instanceof Error?": "+lt.message:"";throw new Error("Point is not on curve"+He)}let je=(oe&fe)===fe;return(L&1)===1!==je&&(oe=r.neg(oe)),{x:z,y:oe}}else if(k===u&&L===4){let z=r.fromBytes(J.subarray(0,r.BYTES)),$=r.fromBytes(J.subarray(r.BYTES,2*r.BYTES));return{x:z,y:$}}else{let z=a,$=u;throw new Error("invalid Point, expected length of "+z+", or uncompressed "+$+", got "+k)}}}));function h(H){let k=n>>fe;return H>k}function _(H){return h(H)?c(-H):H}let E=(H,k,L)=>(0,Y.bytesToNumberBE)(H.slice(k,L));
37class j{constructor(k,L,J){(0,Y.aInRange)("r",k,fe,n),(0,Y.aInRange)("s",L,fe,n),this.r=k,this.s=L,J!=null&&(this.recovery=J),Object.freeze(this)}static fromCompact(k){let L=s;return k=(0,Y.ensureBytes)("compactSignature",k,L*2),new j(E(k,0,L),E(k,L,2*L))}static fromDER(k){let{r:L,s:J}=Be.DER.toSig((0,Y.ensureBytes)("DER",k));return new j(L,J)}assertValidity(){}addRecoveryBit(k){return new j(this.r,this.s,k)}recoverPublicKey(k){let{r:L,s:J,recovery:z}=this,$=O((0,Y.ensureBytes)("msgHash",k));if(z==null||![0,1,2,3].includes(z))throw new Error("recovery id invalid");let oe=z===2||z===3?L+t.n:L;if(oe>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let je=(z&1)===0?"02":"03",Te=l.fromHex(je+tb(oe,r.BYTES)),lt=d(oe),He=c(-$*lt),Ir=c(J*lt),Or=l.BASE.multiplyAndAddUnsafe(Te,He,Ir);if(!Or)throw new Error("point at infinify");return Or.assertValidity(),Or}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new j(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return(0,Y.hexToBytes)(this.toDERHex())}toDERHex(){return Be.DER.hexFromSig(this)}toCompactRawBytes(){return(0,Y.hexToBytes)(this.toCompactHex())}toCompactHex(){let k=s;return tb(this.r,k)+tb(this.s,k)}}let q={isValidPrivateKey(H){try{return f(H),!0}catch(k){return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{let H=(0,_r.getMinHashLength)(t.n);return(0,_r.mapHashToField)(t.randomBytes(H),t.n)},precompute(H=8,k=l.BASE){return k._setWindowSize(H),k.multiply(BigInt(3)),k}};function T(H,k=!0){return l.fromPrivateKey(H).toRawBytes(k)}function x(H){if(typeof H=="bigint")return!1;if(H instanceof l)return!0;let L=(0,Y.ensureBytes)("key",H).length,J=r.BYTES,z=J+1,$=2*J+1;if(!(t.allowedPrivateKeyLengths||s===z))return L===z||L===$}function A(H,k,L=!0){if(x(H)===!0)throw new Error("first arg must be private key");if(x(k)===!1)throw new Error("second arg must be public key");return l.fromHex(k).multiply(f(H)).toRawBytes(L)}let I=t.bits2int||function(H){if(H.length>8192)throw new Error("input is too large");let k=(0,Y.bytesToNumberBE)(H),L=H.length*8-o;return L>0?k>>BigInt(L):k}
37,O=t.bits2int_modN||function(H){return c(I(H))},S=(0,Y.bitMask)(o);function C(H){return(0,Y.aInRange)("num < 2^"+o,H,kt,S),(0,Y.numberToBytesBE)(H,s)}function M(H,k,L=N){if(["recovered","canonical"].some(bn=>bn in L))throw new Error("sign() legacy options not supported");let{hash:J,randomBytes:z}=t,{lowS:$,prehash:oe,extraEntropy:je}=L;$==null&&($=!0),H=(0,Y.ensureBytes)("msgHash",H),yv(L),oe&&(H=(0,Y.ensureBytes)("prehashed msgHash",J(H)));let Te=O(H),lt=f(k),He=[C(lt),C(Te)];if(je!=null&&je!==!1){let bn=je===!0?z(r.BYTES):je;He.push((0,Y.ensureBytes)("extraEntropy",bn))}let Ir=(0,Y.concatBytes)(...He),Or=Te;function Lf(bn){let Wn=I(bn);if(!m(Wn))return;let Df=d(Wn),oo=l.BASE.multiply(Wn).toAffine(),mn=c(oo.x);if(mn===kt)return;let io=c(Df*c(Or+mn*lt));if(io===kt)return;let Kn=(oo.x===mn?0:2)|Number(oo.y&fe),n5=io;return $&&h(io)&&(n5=_(io),Kn^=1),new j(mn,n5,Kn)}return{seed:Ir,k2sig:Lf}}let N={lowS:t.lowS,prehash:!1},F={lowS:t.lowS,prehash:!1};function D(H,k,L=N){let{seed:J,k2sig:z}=M(H,k,L),$=t;return(0,Y.createHmacDrbg)($.hash.outputLen,$.nByteLength,$.hmac)(J,z)}l.BASE._setWindowSize(8);function X(H,k,L,J=F){let z=H;k=(0,Y.ensureBytes)("msgHash",k),L=(0,Y.ensureBytes)("publicKey",L);let{lowS:$,prehash:oe,format:je}=J;if(yv(J),"strict"in J)throw new Error("options.strict was renamed to lowS");if(je!==void 0&&je!=="compact"&&je!=="der")throw new Error("format must be compact or der");let Te=typeof z=="string"||(0,Y.isBytes)(z),lt=!Te&&!je&&typeof z=="object"&&z!==null&&typeof z.r=="bigint"&&typeof z.s=="bigint";if(!Te&&!lt)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let He,Ir;try{if(lt&&(He=new j(z.r,z.s)),Te){try{je!=="compact"&&(He=j.fromDER(z))}catch(Kn){if(!(Kn instanceof Be.DER.Err))throw Kn}!He&&je!=="der"&&(He=j.fromCompact(z))}Ir=l.fromHex(L)}catch(Kn){return!1}if(!He||$&&He.hasHighS())return!1;oe&&(k=t.hash(k));let{r:Or,s:Lf}=He,bn=O(k),Wn=d(Lf),Df=c(bn*Wn),oo=c(Or*Wn),mn=l.BASE.multiplyAndAddUnsafe(Ir,Df,oo)?.toAffine();return mn?c(mn.x)===Or:!1}return{CURVE:t,getPublicKey:T,getSharedSecret:A,sign:D,verify:X,ProjectivePoint:l,Signature:j,utils:q}}function hv(e,t){let r=e.ORDER,n=kt;for(let h=r-fe;h%Wr===kt;h/=Wr)n+=fe;let s=n,o=Wr<<s-fe-fe,a=o*Wr,u=(r-fe)/a,c=(u-fe)/Wr,d=a-fe,l=o,f=e.pow(t,u),b=e.pow(t,(u+fe)/Wr),m=(h,_)=>{let E=f,j=e.pow(_,d),q=e.sqr(j);q=e.mul(q,_);let T=e.mul(h,q);T=e.pow(T,c),T=e.mul(T,j),j=e.mul(T,_),q=e.mul(T,h);let x=e.mul(q,j);T=e.pow(x,l);let A=e.eql(T,e.ONE);j=e.mul(q,b),T=e.mul(x,E),q=e.cmov(j,q,A),x=e.cmov(T,x,A);for(let I=s;I>fe;I--){let O=I-Wr;O=Wr<<O-fe;let S=e.pow(x,O),C=e.eql(S,e.ONE);j=e.mul(q,E),E=e.mul(E,E),S=e.mul(x,E),q=e.cmov(j,q,C),x=e.cmov(S,x,C)}return{isValid:A,value:q}};
37if(e.ORDER%rb===Ro){let h=(e.ORDER-Ro)/rb,_=e.sqrt(e.neg(t));m=(E,j)=>{let q=e.sqr(j),T=e.mul(E,j);q=e.mul(q,T);let x=e.pow(q,h);x=e.mul(x,T);let A=e.mul(x,_),I=e.mul(e.sqr(x),j),O=e.eql(I,E),S=e.cmov(A,x,O);return{isValid:O,value:S}}}return m}function TB(e,t){if((0,_r.validateField)(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=hv(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,o,a,u,c,d,l,f;s=e.sqr(n),s=e.mul(s,t.Z),o=e.sqr(s),o=e.add(o,s),a=e.add(o,e.ONE),a=e.mul(a,t.B),u=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),u=e.mul(u,t.A),o=e.sqr(a),d=e.sqr(u),c=e.mul(d,t.A),o=e.add(o,c),o=e.mul(o,a),d=e.mul(d,u),c=e.mul(d,t.B),o=e.add(o,c),l=e.mul(s,a);let{isValid:b,value:m}=r(o,d);f=e.mul(s,n),f=e.mul(f,m),l=e.cmov(l,a,b),f=e.cmov(f,m,b);let h=e.isOdd(n)===e.isOdd(f);f=e.cmov(e.neg(f),f,h);let _=(0,_r.FpInvertBatch)(e,[u],!0)[0];return l=e.mul(l,_),{x:l,y:f}}}});var jv=p(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.getHash=vv;Nu.createCurve=OB;var AB=Pq(),_v=$f(),IB=nb();function vv(e){return{hash:e,hmac:(t,...r)=>(0,AB.hmac)(e,t,(0,_v.concatBytes)(...r)),randomBytes:_v.randomBytes}}function OB(e,t){let r=n=>(0,IB.weierstrass)(v(v({},e),vv(n)));return B(v({},r(t)),{create:r})}});var Pv=p(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.expand_message_xmd=xv;Bn.expand_message_xof=wv;Bn.hash_to_field=sb;Bn.isogenyMap=CB;Bn.createHasher=RB;var Ev=So(),We=Vr(),BB=We.bytesToNumberBE;function Kr(e,t){if(Mo(e),Mo(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function SB(e,t){let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function Mo(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function xv(e,t,r,n){(0,We.abytes)(e),(0,We.abytes)(t),Mo(r),t.length>255&&(t=n((0,We.concatBytes)((0,We.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:s,blockLen:o}=n,a=Math.ceil(r/s);if(r>65535||a>255)throw new Error("expand_message_xmd: invalid lenInBytes");let u=(0,We.concatBytes)(t,Kr(t.length,1)),c=Kr(0,o),d=Kr(r,2),l=new Array(a),f=n((0,We.concatBytes)(c,e,d,Kr(0,1),u));l[0]=n((0,We.concatBytes)(f,Kr(1,1),u));for(let m=1;m<=a;m++){let h=[SB(f,l[m-1]),Kr(m+1,1),u];l[m]=n((0,We.concatBytes)(...h))}return(0,We.concatBytes)(...l).slice(0,r)}function wv(e,t,r,n,s){if((0,We.abytes)(e),(0,We.abytes)(t),Mo(r),t.length>255){let o=Math.ceil(2*n/8);t=s.create({dkLen:o}).update((0,We.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:r}).update(e).update(Kr(r,2)).update(t).update(Kr(t.length,1)).digest()}function sb(e,t,r){(0,We.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:o,hash:a,expand:u,DST:c}=r;(0,We.abytes)(e),Mo(t);let d=typeof c=="string"?(0,We.utf8ToBytes)(c):c,l=n.toString(2).length,f=Math.ceil((l+s)/8),b=t*o*f,m;if(u==="xmd")m=xv(e,d,b,a);else if(u==="xof")m=wv(e,d,b,s,a);else if(u==="_internal_pass")m=e;else throw new Error('expand must be "xmd" or "xof"');let h=new Array(t);for(let _=0;_<t;_++){let E=new Array(o);for(let j=0;j<o;j++){let q=f*(j+_*o),T=m.subarray(q,q+f);E[j]=(0,Ev.mod)(BB(T),n)}h[_]=E}return h}function CB(e,t){let r=t.map(n=>Array.from(n).reverse());return(n,s)=>{let[o,a,u,c]=r.map(f=>f.reduce((b,m)=>e.add(e.mul(b,n),m))),[d,l]=(0,Ev.FpInvertBatch)(e,[a,c],!0);return n=e.mul(o,d),s=e.mul(s,e.mul(u,l)),{x:n,y:s}}}function RB(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");function n(o){return e.fromAffine(t(o))}function s(o){let a=o.clearCofactor();return a.equals(e.ZERO)?e.ZERO:(a.assertValidity(),a)}return{defaults:r,hashToCurve(o,a){let u=sb(o,2,v(B(v({},r),{DST:r.DST}),a)),c=n(u[0]),d=n(u[1]);return s(c.add(d))},encodeToCurve(o,a){let u=sb(o,1,v(B(v({},r),{DST:r.encodeDST}),a));return s(n(u[0]))},mapToCurve(o){if(!Array.isArray(o))throw new Error("expected array of bigints");for(let a of o)if(typeof a!="bigint")throw new Error("expected array of bigints");return s(n(o))}}}});var Yr=p(Me=>{"use strict";
37Object.defineProperty(Me,"__esModule",{value:!0});Me.encodeToCurve=Me.hashToCurve=Me.secp256k1_hasher=Me.schnorr=Me.secp256k1=void 0;var Hu=wq(),MB=$f(),kB=jv(),Av=Pv(),Re=So(),st=Vr(),NB=nb(),Ho=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Fu=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ub=BigInt(0),ko=BigInt(1),zu=BigInt(2),qv=(e,t)=>(e+t/zu)/t;function Iv(e){let t=Ho,r=BigInt(3),n=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),u=BigInt(44),c=BigInt(88),d=e*e*e%t,l=d*d*e%t,f=(0,Re.pow2)(l,r,t)*l%t,b=(0,Re.pow2)(f,r,t)*l%t,m=(0,Re.pow2)(b,zu,t)*d%t,h=(0,Re.pow2)(m,s,t)*m%t,_=(0,Re.pow2)(h,o,t)*h%t,E=(0,Re.pow2)(_,u,t)*_%t,j=(0,Re.pow2)(E,c,t)*E%t,q=(0,Re.pow2)(j,u,t)*_%t,T=(0,Re.pow2)(q,r,t)*l%t,x=(0,Re.pow2)(T,a,t)*h%t,A=(0,Re.pow2)(x,n,t)*d%t,I=(0,Re.pow2)(A,zu,t);if(!Zr.eql(Zr.sqr(I),e))throw new Error("Cannot find square root");return I}var Zr=(0,Re.Field)(Ho,void 0,void 0,{sqrt:Iv});Me.secp256k1=(0,kB.createCurve)({a:ub,b:BigInt(7),Fp:Zr,n:Fu,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=Fu,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-ko*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),u=qv(o*e,t),c=qv(-n*e,t),d=(0,Re.mod)(e-u*r-c*s,t),l=(0,Re.mod)(-u*n-c*o,t),f=d>a,b=l>a;if(f&&(d=t-d),b&&(l=t-l),d>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:d,k2neg:b,k2:l}}}},Hu.sha256);var Tv={};function Uu(e,...t){let r=Tv[e];if(r===void 0){let n=(0,Hu.sha256)(Uint8Array.from(e,s=>s.charCodeAt(0)));r=(0,st.concatBytes)(n,n),Tv[e]=r}return(0,Hu.sha256)((0,st.concatBytes)(r,...t))}var cb=e=>e.toRawBytes(!0).slice(1),ib=e=>(0,st.numberToBytesBE)(e,32),ob=e=>(0,Re.mod)(e,Ho),No=e=>(0,Re.mod)(e,Fu),db=Me.secp256k1.ProjectivePoint,HB=(e,t,r)=>db.BASE.multiplyAndAddUnsafe(e,t,r);function ab(e){let t=Me.secp256k1.utils.normPrivateKeyToScalar(e),r=db.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:No(-t),bytes:cb(r)}}function Ov(e){(0,st.aInRange)("x",e,ko,Ho);let t=ob(e*e),r=ob(t*e+BigInt(7)),n=Iv(r);n%zu!==ub&&(n=ob(-n));let s=new db(e,n,ko);return s.assertValidity(),s}var ds=st.bytesToNumberBE;function Bv(...e){return No(ds(Uu("BIP0340/challenge",...e)))}function FB(e){return ab(e).bytes}function zB(e,t,r=(0,MB.randomBytes)(32)){let n=(0,st.ensureBytes)("message",e),{bytes:s,scalar:o}=ab(t),a=(0,st.ensureBytes)("auxRand",r,32),u=ib(o^ds(Uu("BIP0340/aux",a))),c=Uu("BIP0340/nonce",u,s,n),d=No(ds(c));if(d===ub)throw new Error("sign failed: k is zero");let{bytes:l,scalar:f}=ab(d),b=Bv(l,s,n),m=new Uint8Array(64);if(m.set(l,0),m.set(ib(No(f+b*o)),32),!Sv(m,n,s))throw new Error("sign: Invalid signature produced");return m}function Sv(e,t,r){let n=(0,st.ensureBytes)("signature",e,64),s=(0,st.ensureBytes)("message",t),o=(0,st.ensureBytes)("publicKey",r,32);try{let a=Ov(ds(o)),u=ds(n.subarray(0,32));if(!(0,st.inRange)(u,ko,Ho))return!1;let c=ds(n.subarray(32,64));if(!(0,st.inRange)(c,ko,Fu))return!1;let d=Bv(ib(u),cb(a),s),l=HB(a,c,No(-d));return!(!l||!l.hasEvenY()||l.toAffine().x!==u)}catch(a){return!1}}Me.schnorr={getPublicKey:FB,sign:zB,verify:Sv,utils:{randomPrivateKey:Me.secp256k1.utils.randomPrivateKey,lift_x:Ov,pointToBytes:cb,numberToBytesBE:st.numberToBytesBE,bytesToNumberBE:st.bytesToNumberBE,taggedHash:Uu,mod:Re.mod}};var UB=(0,Av.isogenyMap)(Zr,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),LB=(0,NB.mapToCurveSimpleSWU)(Zr,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Zr.create(BigInt("-11"))});Me.secp256k1_hasher=(0,Av.createHasher)(Me.secp256k1.ProjectivePoint,e=>{let{x:t,y:r}=LB(Zr.create(e[0]));return UB(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Zr.ORDER,m:1,k:128,expand:"xmd",hash:Hu.sha256});Me.hashToCurve=Me.secp256k1_hasher.hashToCurve;Me.encodeToCurve=Me.secp256k1_hasher.encodeToCurve});
37var Lu=p(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});lb.recoverPublicKey=$B;var Cv=$e(),DB=Ye(),fb=Ee(),Rv=U();function $B(r){return y(this,arguments,function*({hash:e,signature:t}){let n=(0,Cv.isHex)(e)?e:(0,Rv.toHex)(e),{secp256k1:s}=yield Promise.resolve().then(()=>Yr());return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){let{r:l,s:f,v:b,yParity:m}=t,h=Number(m??b),_=Mv(h);return new s.Signature((0,fb.hexToBigInt)(l),(0,fb.hexToBigInt)(f)).addRecoveryBit(_)}let u=(0,Cv.isHex)(t)?t:(0,Rv.toHex)(t);if((0,DB.size)(u)!==65)throw new Error("invalid signature length");let c=(0,fb.hexToNumber)(`0x${u.slice(130)}`),d=Mv(c);return s.Signature.fromCompact(u.substring(2,130)).addRecoveryBit(d)})().recoverPublicKey(n.substring(2)).toHex(!1)}`})}function Mv(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}});var vr=p(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});pb.recoverAddress=WB;var GB=zp(),VB=Lu();function WB(r){return y(this,arguments,function*({hash:e,signature:t}){return(0,GB.publicKeyToAddress)(yield(0,VB.recoverPublicKey)({hash:e,signature:t}))})}});var fs=p(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});Fo.toRlp=bb;Fo.bytesToRlp=XB;Fo.hexToRlp=QB;var KB=Q(),ZB=rs(),YB=de(),JB=U();function bb(e,t="hex"){let r=kv(e),n=(0,ZB.createCursor)(new Uint8Array(r.length));return r.encode(n),t==="hex"?(0,JB.bytesToHex)(n.bytes):n.bytes}function XB(e,t="bytes"){return bb(e,t)}function QB(e,t="hex"){return bb(e,t)}function kv(e){return Array.isArray(e)?eS(e.map(t=>kv(t))):tS(e)}function eS(e){let t=e.reduce((s,o)=>s+o.length,0),r=Nv(t);return{length:t<=55?1+t:1+r+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+r),r===1?s.pushUint8(t):r===2?s.pushUint16(t):r===3?s.pushUint24(t):s.pushUint32(t));for(let{encode:o}of e)o(s)}}}function tS(e){let t=typeof e=="string"?(0,YB.hexToBytes)(e):e,r=Nv(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+r),r===1?s.pushUint8(t.length):r===2?s.pushUint16(t.length):r===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Nv(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new KB.BaseError("Length is too large.")}});var yb=p(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});mb.hashAuthorization=iS;var rS=Oe(),nS=de(),Hv=U(),sS=fs(),oS=Je();function iS(e){let{chainId:t,nonce:r,to:n}=e,s=e.contractAddress??e.address,o=(0,oS.keccak256)((0,rS.concatHex)(["0x05",(0,sS.toRlp)([t?(0,Hv.numberToHex)(t):"0x",s,r?(0,Hv.numberToHex)(r):"0x"])]));return n==="bytes"?(0,nS.hexToBytes)(o):o}});var ls=p(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});gb.recoverAuthorizationAddress=cS;var aS=vr(),uS=yb();function cS(e){return y(this,null,function*(){let{authorization:t,signature:r}=e;return(0,aS.recoverAddress)({hash:(0,uS.hashAuthorization)(t),signature:r??t})})}});var vb=p(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.EstimateGasExecutionError=void 0;var dS=is(),hb=$r(),fS=Q(),lS=Ge(),_b=class extends fS.BaseError{constructor(t,{account:r,docsPath:n,chain:s,data:o,gas:a,gasPrice:u,maxFeePerGas:c,maxPriorityFeePerGas:d,nonce:l,to:f,value:b}){let m=(0,lS.prettyPrint)({from:r?.address,to:f,value:typeof b<"u"&&`${(0,dS.formatEther)(b)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:a,gasPrice:typeof u<"u"&&`${(0,hb.formatGwei)(u)} gwei`,maxFeePerGas:typeof c<"u"&&`${(0,hb.formatGwei)(c)} gwei`,maxPriorityFeePerGas:typeof d<"u"&&`${(0,hb.formatGwei)(d)} gwei`,nonce:l});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",m].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}};Du.EstimateGasExecutionError=_b});var Kt=p(me=>{"use strict";
37Object.defineProperty(me,"__esModule",{value:!0});me.UnknownNodeError=me.TipAboveFeeCapError=me.TransactionTypeNotSupportedError=me.IntrinsicGasTooLowError=me.IntrinsicGasTooHighError=me.InsufficientFundsError=me.NonceMaxValueError=me.NonceTooLowError=me.NonceTooHighError=me.FeeCapTooLowError=me.FeeCapTooHighError=me.ExecutionRevertedError=void 0;var $u=$r(),qt=Q(),zo=class extends qt.BaseError{constructor({cause:t,message:r}={}){let n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};me.ExecutionRevertedError=zo;Object.defineProperty(zo,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(zo,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});var Gu=class extends qt.BaseError{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${(0,$u.formatGwei)(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};me.FeeCapTooHighError=Gu;Object.defineProperty(Gu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});var Vu=class extends qt.BaseError{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${(0,$u.formatGwei)(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};me.FeeCapTooLowError=Vu;Object.defineProperty(Vu,"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/});var Wu=class extends qt.BaseError{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};me.NonceTooHighError=Wu;Object.defineProperty(Wu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});var Ku=class extends qt.BaseError{constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` 38`),{cause:t,name:"NonceTooLowError"})}};me.NonceTooLowError=Ku;Object.defineProperty(Ku,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});var Zu=class extends qt.BaseError{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};me.NonceMaxValueError=Zu;Object.defineProperty(Zu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});var Yu=class extends qt.BaseError{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 39`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};me.InsufficientFundsError=Yu;Object.defineProperty(Yu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});var Ju=class extends qt.BaseError{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};me.IntrinsicGasTooHighError=Ju;Object.defineProperty(Ju,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});var Xu=class extends qt.BaseError{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};me.IntrinsicGasTooLowError=Xu;Object.defineProperty(Xu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});var Qu=class extends qt.BaseError{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};me.TransactionTypeNotSupportedError=Qu;Object.defineProperty(Qu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});var ec=class extends qt.BaseError{constructor({cause:t,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${(0,$u.formatGwei)(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${(0,$u.formatGwei)(n)} gwei`:""}).`].join(` 40`),{cause:t,name:"TipAboveFeeCapError"})}};me.TipAboveFeeCapError=ec;Object.defineProperty(ec,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});var jb=class extends qt.BaseError{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}};me.UnknownNodeError=jb});
40var ps=p(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.containsNodeError=bS;tc.getNodeError=mS;var Fv=Q(),ye=Kt(),pS=Pt(),zv=yr();function bS(e){return e instanceof zv.TransactionRejectedRpcError||e instanceof zv.InvalidInputRpcError||e instanceof pS.RpcRequestError&&e.code===ye.ExecutionRevertedError.code}function mS(e,t){let r=(e.details||"").toLowerCase(),n=e instanceof Fv.BaseError?e.walk(s=>s?.code===ye.ExecutionRevertedError.code):e;return n instanceof Fv.BaseError?new ye.ExecutionRevertedError({cause:e,message:n.details}):ye.ExecutionRevertedError.nodeMessage.test(r)?new ye.ExecutionRevertedError({cause:e,message:e.details}):ye.FeeCapTooHighError.nodeMessage.test(r)?new ye.FeeCapTooHighError({cause:e,maxFeePerGas:t?.maxFeePerGas}):ye.FeeCapTooLowError.nodeMessage.test(r)?new ye.FeeCapTooLowError({cause:e,maxFeePerGas:t?.maxFeePerGas}):ye.NonceTooHighError.nodeMessage.test(r)?new ye.NonceTooHighError({cause:e,nonce:t?.nonce}):ye.NonceTooLowError.nodeMessage.test(r)?new ye.NonceTooLowError({cause:e,nonce:t?.nonce}):ye.NonceMaxValueError.nodeMessage.test(r)?new ye.NonceMaxValueError({cause:e,nonce:t?.nonce}):ye.InsufficientFundsError.nodeMessage.test(r)?new ye.InsufficientFundsError({cause:e}):ye.IntrinsicGasTooHighError.nodeMessage.test(r)?new ye.IntrinsicGasTooHighError({cause:e,gas:t?.gas}):ye.IntrinsicGasTooLowError.nodeMessage.test(r)?new ye.IntrinsicGasTooLowError({cause:e,gas:t?.gas}):ye.TransactionTypeNotSupportedError.nodeMessage.test(r)?new ye.TransactionTypeNotSupportedError({cause:e}):ye.TipAboveFeeCapError.nodeMessage.test(r)?new ye.TipAboveFeeCapError({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new ye.UnknownNodeError({cause:e})}});var xb=p(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});Eb.getEstimateGasError=_S;var yS=vb(),gS=Kt(),hS=ps();function _S(e,n){var s=n,{docsPath:t}=s,r=G(s,["docsPath"]);let o=(()=>{let a=(0,hS.getNodeError)(e,r);return a instanceof gS.UnknownNodeError?e:a})();return new yS.EstimateGasExecutionError(o,v({docsPath:t},r))}});var Jr=p(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});wb.extract=vS;function vS(e,{format:t}){if(!t)return{};let r={};function n(o){let a=Object.keys(o);for(let u of a)u in e&&(r[u]=e[u]),o[u]&&typeof o[u]=="object"&&!Array.isArray(o[u])&&n(o[u])}let s=t(e||{});return n(s),r}});var bs=p(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});Pb.defineFormatter=jS;function jS(e,t){return({exclude:r,format:n})=>({exclude:r,format:(s,o)=>{let a=t(s,o);if(r)for(let u of r)delete a[u];return v(v({},a),n(s,o))},type:e})}});var Nt=p(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.defineTransactionRequest=Xr.rpcTransactionType=void 0;Xr.formatTransactionRequest=Uv;var ot=U(),ES=bs();Xr.rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Uv(e,t){let r={};return typeof e.authorizationList<"u"&&(r.authorizationList=xS(e.authorizationList)),typeof e.accessList<"u"&&(r.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(r.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?r.blobs=e.blobs.map(n=>(0,ot.bytesToHex)(n)):r.blobs=e.blobs),typeof e.data<"u"&&(r.data=e.data),typeof e.from<"u"&&(r.from=e.from),typeof e.gas<"u"&&(r.gas=(0,ot.numberToHex)(e.gas)),typeof e.gasPrice<"u"&&(r.gasPrice=(0,ot.numberToHex)(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=(0,ot.numberToHex)(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(r.maxFeePerGas=(0,ot.numberToHex)(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=(0,ot.numberToHex)(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(r.nonce=(0,ot.numberToHex)(e.nonce)),typeof e.to<"u"&&(r.to=e.to),typeof e.type<"u"&&(r.type=Xr.rpcTransactionType[e.type]),typeof e.value<"u"&&(r.value=(0,ot.numberToHex)(e.value)),r}Xr.defineTransactionRequest=(0,ES.defineFormatter)("transactionRequest",Uv);function xS(e){return e.map(t=>v(v({address:t.address,r:t.r?(0,ot.numberToHex)(BigInt(t.r)):t.r,s:t.s?(0,ot.numberToHex)(BigInt(t.s)):t.s,chainId:(0,ot.numberToHex)(t.chainId),nonce:(0,ot.numberToHex)(t.nonce)},typeof t.yParity<"u"?{yParity:(0,ot.numberToHex)(t.yParity)}:{}),typeof t.v<"u"&&typeof t.yParity>"u"?{v:(0,ot.numberToHex)(t.v)}:{}))}});var rc=p(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.serializeStateMapping=qb;Uo.serializeAccountStateOverride=Gv;Uo.serializeStateOverride=qS;var wS=jt(),Lv=mo(),$v=eu(),PS=Xe(),Dv=U();function qb(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new Lv.InvalidBytesLengthError({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new Lv.InvalidBytesLengthError({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function Gv(e){let{balance:t,nonce:r,state:n,stateDiff:s,code:o}=e,a={};if(o!==void 0&&(a.code=o),t!==void 0&&(a.balance=(0,Dv.numberToHex)(t)),r!==void 0&&(a.nonce=(0,Dv.numberToHex)(r)),n!==void 0&&(a.state=qb(n)),s!==void 0){if(a.state)throw new $v.StateAssignmentC
40onflictError;a.stateDiff=qb(s)}return a}function qS(e){if(!e)return;let t={};for(let r of e){let n=r,{address:s}=n,o=G(n,["address"]);if(!(0,PS.isAddress)(s,{strict:!1}))throw new wS.InvalidAddressError({address:s});if(t[s])throw new $v.AccountStateConflictError({address:s});t[s]=Gv(o)}return t}});var nc=p(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.minInt144=P.minInt136=P.minInt128=P.minInt120=P.minInt112=P.minInt104=P.minInt96=P.minInt88=P.minInt80=P.minInt72=P.minInt64=P.minInt56=P.minInt48=P.minInt40=P.minInt32=P.minInt24=P.minInt16=P.minInt8=P.maxInt256=P.maxInt248=P.maxInt240=P.maxInt232=P.maxInt224=P.maxInt216=P.maxInt208=P.maxInt200=P.maxInt192=P.maxInt184=P.maxInt176=P.maxInt168=P.maxInt160=P.maxInt152=P.maxInt144=P.maxInt136=P.maxInt128=P.maxInt120=P.maxInt112=P.maxInt104=P.maxInt96=P.maxInt88=P.maxInt80=P.maxInt72=P.maxInt64=P.maxInt56=P.maxInt48=P.maxInt40=P.maxInt32=P.maxInt24=P.maxInt16=P.maxInt8=void 0;P.maxUint256=P.maxUint248=P.maxUint240=P.maxUint232=P.maxUint224=P.maxUint216=P.maxUint208=P.maxUint200=P.maxUint192=P.maxUint184=P.maxUint176=P.maxUint168=P.maxUint160=P.maxUint152=P.maxUint144=P.maxUint136=P.maxUint128=P.maxUint120=P.maxUint112=P.maxUint104=P.maxUint96=P.maxUint88=P.maxUint80=P.maxUint72=P.maxUint64=P.maxUint56=P.maxUint48=P.maxUint40=P.maxUint32=P.maxUint24=P.maxUint16=P.maxUint8=P.minInt256=P.minInt248=P.minInt240=P.minInt232=P.minInt224=P.minInt216=P.minInt208=P.minInt200=P.minInt192=P.minInt184=P.minInt176=P.minInt168=P.minInt160=P.minInt152=void 0;P.maxInt8=2n**(8n-1n)-1n;P.maxInt16=2n**(16n-1n)-1n;P.maxInt24=2n**(24n-1n)-1n;P.maxInt32=2n**(32n-1n)-1n;P.maxInt40=2n**(40n-1n)-1n;P.maxInt48=2n**(48n-1n)-1n;P.maxInt56=2n**(56n-1n)-1n;P.maxInt64=2n**(64n-1n)-1n;P.maxInt72=2n**(72n-1n)-1n;P.maxInt80=2n**(80n-1n)-1n;P.maxInt88=2n**(88n-1n)-1n;P.maxInt96=2n**(96n-1n)-1n;P.maxInt104=2n**(104n-1n)-1n;P.maxInt112=2n**(112n-1n)-1n;P.maxInt120=2n**(120n-1n)-1n;P.maxInt128=2n**(128n-1n)-1n;P.maxInt136=2n**(136n-1n)-1n;P.maxInt144=2n**(144n-1n)-1n;P.maxInt152=2n**(152n-1n)-1n;P.maxInt160=2n**(160n-1n)-1n;P.maxInt168=2n**(168n-1n)-1n;P.maxInt176=2n**(176n-1n)-1n;P.maxInt184=2n**(184n-1n)-1n;P.maxInt192=2n**(192n-1n)-1n;P.maxInt200=2n**(200n-1n)-1n;P.maxInt208=2n**(208n-1n)-1n;P.maxInt216=2n**(216n-1n)-1n;P.maxInt224=2n**(224n-1n)-1n;P.maxInt232=2n**(232n-1n)-1n;P.maxInt240=2n**(240n-1n)-1n;P.maxInt248=2n**(248n-1n)-1n;P.maxInt256=2n**(256n-1n)-1n;P.minInt8=-(2n**(8n-1n));P.minInt16=-(2n**(16n-1n));P.minInt24=-(2n**(24n-1n));P.minInt32=-(2n**(32n-1n));P.minInt40=-(2n**(40n-1n));P.minInt48=-(2n**(48n-1n));P.minInt56=-(2n**(56n-1n));P.minInt64=-(2n**(64n-1n));P.minInt72=-(2n**(72n-1n));P.minInt80=-(2n**(80n-1n));P.minInt88=-(2n**(88n-1n));P.minInt96=-(2n**(96n-1n));P.minInt104=-(2n**(104n-1n));P.minInt112=-(2n**(112n-1n));P.minInt120=-(2n**(120n-1n));P.minInt128=-(2n**(128n-1n));P.minInt136=-(2n**(136n-1n));P.minInt144=-(2n**(144n-1n));P.minInt152=-(2n**(152n-1n));P.minInt160=-(2n**(160n-1n));P.minInt168=-(2n**(168n-1n));P.minInt176=-(2n**(176n-1n));P.minInt184=-(2n**(184n-1n));P.minInt192=-(2n**(192n-1n));P.minInt200=-(2n**(200n-1n));P.minInt208=-(2n**(208n-1n));P.minInt216=-(2n**(216n-1n));P.minInt224=-(2n**(224n-1n));P.minInt232=-(2n**(232n-1n));P.minInt240=-(2n**(240n-1n));P.minInt248=-(2n**(248n-1n));P.minInt256=-(2n**(256n-1n));P.maxUint8=2n**8n-1n;P.maxUint16=2n**16n-1n;P.maxUint24=2n**24n-1n;P.maxUint32=2n**32n-1n;P.maxUint40=2n**40n-1n;P.maxUint48=2n**48n-1n;P.maxUint56=2n**56n-1n;P.maxUint64=2n**64n-1n;P.maxUint72=2n**72n-1n;P.maxUint80=2n**80n-1n;P.maxUint88=2n**88n-1n;P.maxUint96=2n**96n-1n;P.maxUint104=2n**104n-1n;P.maxUint112=2n**112n-1n;P.maxUint120=2n**120n-1n;P.maxUint128=2n**128n-1n;P.maxUint136=2n**136n-1n;P.maxUint144=2n**144n-1n;P.maxUint152=2n**152n-1n;P.maxUint160=2n**160n-1n;P.maxUint168=2n**168n-1n;P.maxUint176=2n**176n-1n;P.maxUint184=2n**184n-1n;P.maxUint192=2n**192n-1n;P.maxUint200=2n**200n-1n;P.maxUint208=2n**208n-1n;P.maxUint216=2n**216n-1n;P.maxUint224=2n**224n-1n;P.maxUint232=2n**232n-1n;P.maxUint240=2n**240n-1n;P.maxUint248=2n**248n-1n;P.maxUint256=2n**256n-1n});var Ht=p(Tb=>{"use strict";
40Object.defineProperty(Tb,"__esModule",{value:!0});Tb.assertRequest=OS;var TS=xe(),AS=nc(),Vv=jt(),Wv=Kt(),IS=Ge(),Kv=Xe();function OS(e){let{account:t,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:s,to:o}=e,a=t?(0,TS.parseAccount)(t):void 0;if(a&&!(0,Kv.isAddress)(a.address))throw new Vv.InvalidAddressError({address:a.address});if(o&&!(0,Kv.isAddress)(o))throw new Vv.InvalidAddressError({address:o});if(typeof r<"u"&&(typeof n<"u"||typeof s<"u"))throw new IS.FeeConflictError;if(n&&n>AS.maxUint256)throw new Wv.FeeCapTooHighError({maxFeePerGas:n});if(s&&n&&s>n)throw new Wv.TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:s})}});var Lo=p(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.MaxFeePerGasTooLowError=Qr.Eip1559FeesNotSupportedError=Qr.BaseFeeScalarError=void 0;var BS=$r(),Bb=Q(),Ab=class extends Bb.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}};Qr.BaseFeeScalarError=Ab;var Ib=class extends Bb.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}};Qr.Eip1559FeesNotSupportedError=Ib;var Ob=class extends Bb.BaseError{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,BS.formatGwei)(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}};Qr.MaxFeePerGasTooLowError=Ob});var oc=p(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.BlockNotFoundError=void 0;var SS=Q(),Sb=class extends SS.BaseError{constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}};sc.BlockNotFoundError=Sb});var ms=p(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.defineTransaction=en.transactionType=void 0;en.formatTransaction=Yv;var Zv=Ee(),CS=bs();en.transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Yv(e,t){let r=B(v({},e),{blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,Zv.hexToNumber)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,Zv.hexToNumber)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?en.transactionType[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0});return e.authorizationList&&(r.authorizationList=RS(e.authorizationList)),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}en.defineTransaction=(0,CS.defineFormatter)("transaction",Yv);function RS(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}});var $o=p(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.defineBlock=void 0;Do.formatBlock=Jv;var MS=bs(),kS=ms();function Jv(e,t){let r=(e.transactions??[]).map(n=>typeof n=="string"?n:(0,kS.formatTransaction)(n));return B(v({},e),{baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null})}Do.defineBlock=(0,MS.defineFormatter)("block",Jv)});var Sn=p(Cb=>{"use strict";
40Object.defineProperty(Cb,"__esModule",{value:!0});Cb.getBlock=zS;var NS=oc(),HS=U(),FS=$o();function zS(o){return y(this,arguments,function*(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:s}={}){let a=s??!1,u=r!==void 0?(0,HS.numberToHex)(r):void 0,c=null;if(t?c=yield e.request({method:"eth_getBlockByHash",params:[t,a]},{dedupe:!0}):c=yield e.request({method:"eth_getBlockByNumber",params:[u||n,a]},{dedupe:!!u}),!c)throw new NS.BlockNotFoundError({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||FS.formatBlock)(c,"getBlock")})}});var ic=p(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});Rb.getGasPrice=US;function US(e){return y(this,null,function*(){let t=yield e.request({method:"eth_gasPrice"});return BigInt(t)})}});var kb=p(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.estimateMaxPriorityFeePerGas=GS;ac.internal_estimateMaxPriorityFeePerGas=Qv;var LS=Lo(),DS=Ee(),Mb=ae(),Xv=Sn(),$S=ic();function GS(e,t){return y(this,null,function*(){return Qv(e,t)})}function Qv(e,t){return y(this,null,function*(){let{block:r,chain:n=e.chain,request:s}=t||{};try{let o=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof o=="function"){let u=r||(yield(0,Mb.getAction)(e,Xv.getBlock,"getBlock")({})),c=yield o({block:u,client:e,request:s});if(c===null)throw new Error;return c}if(typeof o<"u")return o;let a=yield e.request({method:"eth_maxPriorityFeePerGas"});return(0,DS.hexToBigInt)(a)}catch(o){let[a,u]=yield Promise.all([r?Promise.resolve(r):(0,Mb.getAction)(e,Xv.getBlock,"getBlock")({}),(0,Mb.getAction)(e,$S.getGasPrice,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new LS.Eip1559FeesNotSupportedError;let c=u-a.baseFeePerGas;return c<0n?0n:c}})}});var Nb=p(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.estimateFeesPerGas=ZS;uc.internal_estimateFeesPerGas=rj;var ej=Lo(),tj=ae(),VS=kb(),WS=Sn(),KS=ic();function ZS(e,t){return y(this,null,function*(){return rj(e,t)})}function rj(e,t){return y(this,null,function*(){let{block:r,chain:n=e.chain,request:s,type:o="eip1559"}=t||{},a=yield y(null,null,function*(){return typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:s}):n?.fees?.baseFeeMultiplier??1.2});if(a<1)throw new ej.BaseFeeScalarError;let c=10**(a.toString().split(".")[1]?.length??0),d=b=>b*BigInt(Math.ceil(a*c))/BigInt(c),l=r||(yield(0,tj.getAction)(e,WS.getBlock,"getBlock")({}));if(typeof n?.fees?.estimateFeesPerGas=="function"){let b=yield n.fees.estimateFeesPerGas({block:r,client:e,multiply:d,request:s,type:o});if(b!==null)return b}if(o==="eip1559"){if(typeof l.baseFeePerGas!="bigint")throw new ej.Eip1559FeesNotSupportedError;let b=typeof s?.maxPriorityFeePerGas=="bigint"?s.maxPriorityFeePerGas:yield(0,VS.internal_estimateMaxPriorityFeePerGas)(e,{block:l,chain:n,request:s}),m=d(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??m+b,maxPriorityFeePerGas:b}}return{gasPrice:s?.gasPrice??d(yield(0,tj.getAction)(e,KS.getGasPrice,"getGasPrice")({}))}})}});var Go=p(Hb=>{"use strict";
40Object.defineProperty(Hb,"__esModule",{value:!0});Hb.getTransactionCount=XS;var YS=Ee(),JS=U();function XS(s,o){return y(this,arguments,function*(e,{address:t,blockTag:r="latest",blockNumber:n}){let a=yield e.request({method:"eth_getTransactionCount",params:[t,typeof n=="bigint"?(0,JS.numberToHex)(n):r]},{dedupe:!!n});return(0,YS.hexToNumber)(a)})}});var Vo=p(Fb=>{"use strict";Object.defineProperty(Fb,"__esModule",{value:!0});Fb.blobsToCommitments=t4;var QS=de(),e4=U();function t4(e){let{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(o=>(0,QS.hexToBytes)(o)):e.blobs,s=[];for(let o of n)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return r==="bytes"?s:s.map(o=>(0,e4.bytesToHex)(o))}});var Wo=p(zb=>{"use strict";Object.defineProperty(zb,"__esModule",{value:!0});zb.blobsToProofs=n4;var nj=de(),r4=U();function n4(e){let{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(a=>(0,nj.hexToBytes)(a)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(a=>(0,nj.hexToBytes)(a)):e.commitments,o=[];for(let a=0;a<n.length;a++){let u=n[a],c=s[a];o.push(Uint8Array.from(t.computeBlobKzgProof(u,c)))}return r==="bytes"?o:o.map(a=>(0,r4.bytesToHex)(a))}});var cc=p(Ub=>{"use strict";Object.defineProperty(Ub,"__esModule",{value:!0});Ub.sha256=u4;var s4=i5(),o4=$e(),i4=de(),a4=U();function u4(e,t){let r=t||"hex",n=(0,s4.sha256)((0,o4.isHex)(e,{strict:!1})?(0,i4.toBytes)(e):e);return r==="bytes"?n:(0,a4.toHex)(n)}});var dc=p(Lb=>{"use strict";Object.defineProperty(Lb,"__esModule",{value:!0});Lb.commitmentToVersionedHash=f4;var c4=U(),d4=cc();function f4(e){let{commitment:t,version:r=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),s=(0,d4.sha256)(t,"bytes");return s.set([r],0),n==="bytes"?s:(0,c4.bytesToHex)(s)}});var fc=p(Db=>{"use strict";Object.defineProperty(Db,"__esModule",{value:!0});Db.commitmentsToVersionedHashes=p4;var l4=dc();function p4(e){let{commitments:t,version:r}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(let o of t)s.push((0,l4.commitmentToVersionedHash)({commitment:o,to:n,version:r}));return s}});var oj=p(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.maxBytesPerTransaction=it.bytesPerBlob=it.fieldElementsPerBlob=it.bytesPerFieldElement=void 0;var sj=6;it.bytesPerFieldElement=32;it.fieldElementsPerBlob=4096;it.bytesPerBlob=it.bytesPerFieldElement*it.fieldElementsPerBlob;it.maxBytesPerTransaction=it.bytesPerBlob*sj-1-1*it.fieldElementsPerBlob*sj});var $b=p(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.versionedHashVersionKzg=void 0;lc.versionedHashVersionKzg=1});var Zb=p(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.InvalidVersionedHashVersionError=Zt.InvalidVersionedHashSizeError=Zt.EmptyBlobError=Zt.BlobSizeTooLargeError=void 0;var b4=$b(),pc=Q(),Gb=class extends pc.BaseError{constructor({maxSize:t,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}};Zt.BlobSizeTooLargeError=Gb;var Vb=class extends pc.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}};Zt.EmptyBlobError=Vb;var Wb=class extends pc.BaseError{constructor({hash:t,size:r}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}};Zt.InvalidVersionedHashSizeError=Wb;var Kb=class extends pc.BaseError{constructor({hash:t,version:r}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${b4.versionedHashVersionKzg}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}};Zt.InvalidVersionedHashVersionError=Kb});var Jb=p(Yb=>{"use strict";Object.defineProperty(Yb,"__esModule",{value:!0});Yb.toBlobs=_4;var Ko=oj(),ij=Zb(),m4=rs(),y4=Ye(),g4=de(),h4=U();function _4(e){let t=e.to??(typeof e.data=="string"?"hex":"bytes"),r=typeof e.data=="string"?(0,g4.hexToBytes)(e.data):e.data,n=(0,y4.size)(r);if(!n)throw new ij.EmptyBlobError;if(n>Ko.maxBytesPerTransaction)throw new ij.BlobSizeTooLargeError({maxSize:Ko.maxBytesPerTransaction,size:n});let s=[],o=!0,a=0;for(;o;){let u=(0,m4.createCursor)(new Uint8Array(Ko.bytesPerBlob)),c=0;for(;c<Ko.fieldElementsPerBlob;){let d=r.slice(a,a+(Ko.bytesPerFieldElement-1));if(u.pushByte(0),u.pushBytes(d),d.length<31){u.pushByte(128),o=!1;break}c++,a+=31}s.push(u)}return t==="bytes"?s.map(u=>u.bytes):s.map(u=>(0,h4.bytesToHex)(u.bytes))}});var Zo=p(Xb=>{"use strict";
40Object.defineProperty(Xb,"__esModule",{value:!0});Xb.toBlobSidecars=x4;var v4=Vo(),j4=Wo(),E4=Jb();function x4(e){let{data:t,kzg:r,to:n}=e,s=e.blobs??(0,E4.toBlobs)({data:t,to:n}),o=e.commitments??(0,v4.blobsToCommitments)({blobs:s,kzg:r,to:n}),a=e.proofs??(0,j4.blobsToProofs)({blobs:s,commitments:o,kzg:r,to:n}),u=[];for(let c=0;c<s.length;c++)u.push({blob:s[c],commitment:o[c],proof:a[c]});return u}});var Yo=p(Qb=>{"use strict";Object.defineProperty(Qb,"__esModule",{value:!0});Qb.getTransactionType=P4;var w4=Ge();function P4(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new w4.InvalidSerializableTransactionError({transaction:e})}});var tn=p(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});em.getChainId=T4;var q4=Ee();function T4(e){return y(this,null,function*(){let t=yield e.request({method:"eth_chainId"},{dedupe:!0});return(0,q4.hexToNumber)(t)})}});var ys=p(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.eip1559NetworkCache=Yt.defaultParameters=void 0;Yt.prepareTransactionRequest=F4;var A4=xe(),aj=Nb(),I4=mc(),O4=Sn(),B4=Go(),uj=Lo(),S4=Vo(),C4=Wo(),R4=fc(),M4=Zo(),bc=ae(),k4=Ht(),N4=Yo(),H4=tn();Yt.defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"];Yt.eip1559NetworkCache=new Map;function F4(e,t){return y(this,null,function*(){let{account:r=e.account,blobs:n,chain:s,gas:o,kzg:a,nonce:u,nonceManager:c,parameters:d=Yt.defaultParameters,type:l}=t,f=r&&(0,A4.parseAccount)(r),b=v(v({},t),f?{from:f?.address}:{}),m;function h(){return y(this,null,function*(){return m||(m=yield(0,bc.getAction)(e,O4.getBlock,"getBlock")({blockTag:"latest"}),m)})}let _;function E(){return y(this,null,function*(){return _||(s?s.id:typeof t.chainId<"u"?t.chainId:(_=yield(0,bc.getAction)(e,H4.getChainId,"getChainId")({}),_))})}if(d.includes("nonce")&&typeof u>"u"&&f)if(c){let j=yield E();b.nonce=yield c.consume({address:f.address,chainId:j,client:e})}else b.nonce=yield(0,bc.getAction)(e,B4.getTransactionCount,"getTransactionCount")({address:f.address,blockTag:"pending"});if((d.includes("blobVersionedHashes")||d.includes("sidecars"))&&n&&a){let j=(0,S4.blobsToCommitments)({blobs:n,kzg:a});if(d.includes("blobVersionedHashes")){let q=(0,R4.commitmentsToVersionedHashes)({commitments:j,to:"hex"});b.blobVersionedHashes=q}if(d.includes("sidecars")){let q=(0,C4.blobsToProofs)({blobs:n,commitments:j,kzg:a}),T=(0,M4.toBlobSidecars)({blobs:n,commitments:j,proofs:q,to:"hex"});b.sidecars=T}}if(d.includes("chainId")&&(b.chainId=yield E()),(d.includes("fees")||d.includes("type"))&&typeof l>"u")try{b.type=(0,N4.getTransactionType)(b)}catch(j){let q=Yt.eip1559NetworkCache.get(e.uid);typeof q>"u"&&(q=typeof(yield h())?.baseFeePerGas=="bigint",Yt.eip1559NetworkCache.set(e.uid,q)),b.type=q?"eip1559":"legacy"}if(d.includes("fees"))if(b.type!=="legacy"&&b.type!=="eip2930"){if(typeof b.maxFeePerGas>"u"||typeof b.maxPriorityFeePerGas>"u"){let j=yield h(),{maxFeePerGas:q,maxPriorityFeePerGas:T}=yield(0,aj.internal_estimateFeesPerGas)(e,{block:j,chain:s,request:b});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<T)throw new uj.MaxFeePerGasTooLowError({maxPriorityFeePerGas:T});b.maxPriorityFeePerGas=T,b.maxFeePerGas=q}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new uj.Eip1559FeesNotSupportedError;if(typeof t.gasPrice>"u"){let j=yield h(),{gasPrice:q}=yield(0,aj.internal_estimateFeesPerGas)(e,{block:j,chain:s,request:b,type:"legacy"});b.gasPrice=q}}return d.includes("gas")&&typeof o>"u"&&(b.gas=yield(0,bc.getAction)(e,I4.estimateGas,"estimateGas")(B(v({},b),{account:f&&{address:f.address,type:"json-rpc"}}))),(0,k4.assertRequest)(b),delete b.parameters,b})}});var mc=p(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.estimateGas=Y4;var z4=xe(),U4=Q(),L4=ls(),D4=U(),$4=xb(),G4=Jr(),V4=Nt(),W4=rc(),K4=Ht(),Z4=ys();function Y4(e,t){return y(this,null,function*(){let{account:r=e.account}=t,n=r?(0,z4.parseAccount)(r):void 0;try{let s=yield(0,Z4.prepareTransactionRequest)(e,B(v({},t),{parameters:n?.type==="local"?void 0:["blobVersionedHashes"]})),{accessList:o,authorizationList:a,blobs:u,blobVersionedHashes:c,blockNumber:d,blockTag:l,data:f,gas:b,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:_,maxPriorityFeePerGas:E,nonce:j,value:q,stateOverride:T}=s,x=G(s,["accessList","authorizationList","blobs","blobVersionedHashes","blockNumber","blockTag","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","
40nonce","value","stateOverride"]),I=(typeof d=="bigint"?(0,D4.numberToHex)(d):void 0)||l,O=(0,W4.serializeStateOverride)(T),S=yield y(null,null,function*(){if(x.to)return x.to;if(a&&a.length>0)return yield(0,L4.recoverAuthorizationAddress)({authorization:a[0]}).catch(()=>{throw new U4.BaseError("`to` is required. Could not infer from `authorizationList`")})});(0,K4.assertRequest)(t);let C=e.chain?.formatters?.transactionRequest?.format,N=(C||V4.formatTransactionRequest)(B(v({},(0,G4.extract)(x,{format:C})),{from:n?.address,accessList:o,authorizationList:a,blobs:u,blobVersionedHashes:c,data:f,gas:b,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:_,maxPriorityFeePerGas:E,nonce:j,to:S,value:q}),"estimateGas");return BigInt(yield e.request({method:"eth_estimateGas",params:O?[N,I??e.experimental_blockTag??"latest",O]:I?[N,I]:[N]}))}catch(o){throw(0,$4.getEstimateGasError)(o,B(v({},t),{account:n,chain:e.chain}))}})}});var nm=p(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.estimateContractGas=r3;var J4=xe(),X4=Qe(),Q4=gr(),e3=ae(),t3=mc();function r3(e,t){return y(this,null,function*(){let d=t,{abi:r,address:n,args:s,functionName:o,dataSuffix:a}=d,u=G(d,["abi","address","args","functionName","dataSuffix"]),c=(0,X4.encodeFunctionData)({abi:r,args:s,functionName:o});try{return yield(0,e3.getAction)(e,t3.estimateGas,"estimateGas")(v({data:`${c}${a?a.replace("0x",""):""}`,to:n},u))}catch(l){let f=u.account?(0,J4.parseAccount)(u.account):void 0;throw(0,Q4.getContractError)(l,{abi:r,address:n,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:f?.address})}})}});var Tt=p(sm=>{"use strict";Object.defineProperty(sm,"__esModule",{value:!0});sm.isAddressEqual=n3;var cj=jt(),dj=Xe();function n3(e,t){if(!(0,dj.isAddress)(e,{strict:!1}))throw new cj.InvalidAddressError({address:e});if(!(0,dj.isAddress)(t,{strict:!1}))throw new cj.InvalidAddressError({address:t});return e.toLowerCase()===t.toLowerCase()}});var hs=p(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.decodeEventLog=u3;var gs=ge(),s3=Jl(),o3=Ye(),i3=Pn(),lj=br(),a3=Gt(),fj="/docs/contract/decodeEventLog";function u3(e){let{abi:t,data:r,strict:n,topics:s}=e,o=n??!0,[a,...u]=s;if(!a)throw new gs.AbiEventSignatureEmptyTopicsError({docsPath:fj});let c=t.find(_=>_.type==="event"&&a===(0,i3.toEventSelector)((0,a3.formatAbiItem)(_)));if(!(c&&"name"in c)||c.type!=="event")throw new gs.AbiEventSignatureNotFoundError(a,{docsPath:fj});let{name:d,inputs:l}=c,f=l?.some(_=>!("name"in _&&_.name)),b=f?[]:{},m=l.map((_,E)=>[_,E]).filter(([_])=>"indexed"in _&&_.indexed);for(let _=0;_<m.length;_++){let[E,j]=m[_],q=u[_];if(!q)throw new gs.DecodeLogTopicsMismatch({abiItem:c,param:E});b[f?j:E.name||j]=c3({param:E,value:q})}let h=l.filter(_=>!("indexed"in _&&_.indexed));if(h.length>0){if(r&&r!=="0x")try{let _=(0,lj.decodeAbiParameters)(h,r);if(_)if(f)for(let E=0;E<l.length;E++)b[E]=b[E]??_.shift();else for(let E=0;E<h.length;E++)b[h[E].name]=_[E]}catch(_){if(o)throw _ instanceof gs.AbiDecodingDataSizeTooSmallError||_ instanceof s3.PositionOutOfBoundsError?new gs.DecodeLogDataMismatch({abiItem:c,data:r,params:h,size:(0,o3.size)(r)}):_}else if(o)throw new gs.DecodeLogDataMismatch({abiItem:c,data:"0x",params:h,size:0})}return{eventName:d,args:Object.values(b).length>0?b:void 0}}function c3({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,lj.decodeAbiParameters)([e],t)||[])[0]}});var _s=p(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});am.parseEventLogs=m3;var im=ge(),d3=Tt(),f3=de(),l3=Je(),p3=Pn(),b3=hs();function m3(e){let{abi:t,args:r,logs:n,strict:s=!0}=e,o=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return n.map(a=>{try{let u=t.find(d=>d.type==="event"&&a.topics[0]===(0,p3.toEventSelector)(d));if(!u)return null;let c=(0,b3.decodeEventLog)(B(v({},a),{abi:[u],strict:s}));return o&&!o.includes(c.eventName)||!y3({args:c.args,inputs:u.inputs,matchArgs:r})?null:v(v({},c),a)}catch(u){let c,d;if(u instanceof im.AbiEventSignatureNotFoundError)return null;if(u instanceof im.DecodeLogDataMismatch||u instanceof im.DecodeLogTopicsMismatch){if
40(s)return null;c=u.abiItem.name,d=u.abiItem.inputs?.some(l=>!("name"in l&&l.name))}return B(v({},a),{args:d?[]:{},eventName:c})}}).filter(Boolean)}function y3(e){let{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function s(o,a,u){try{return o.type==="address"?(0,d3.isAddressEqual)(a,u):o.type==="string"||o.type==="bytes"?(0,l3.keccak256)((0,f3.toBytes)(a))===u:a===u}catch(c){return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((o,a)=>{if(o==null)return!0;let u=r[a];return u?(Array.isArray(o)?o:[o]).some(d=>s(u,d,t[a])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([o,a])=>{if(a==null)return!0;let u=r.find(d=>d.name===o);return u?(Array.isArray(a)?a:[a]).some(d=>s(u,d,t[o])):!1}):!1}});var Jt=p(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.formatLog=g3;function g3(e,{args:t,eventName:r}={}){return v(B(v({},e),{blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null}),r?{args:t,eventName:r}:{})}});var yc=p(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.getLogs=j3;var h3=zr(),_3=_s(),pj=U(),v3=Jt();function j3(d){return y(this,arguments,function*(e,{address:t,blockHash:r,fromBlock:n,toBlock:s,event:o,events:a,args:u,strict:c}={}){let l=c??!1,f=a??(o?[o]:void 0),b=[];f&&(b=[f.flatMap(E=>(0,h3.encodeEventTopics)({abi:[E],eventName:E.name,args:a?void 0:u}))],o&&(b=b[0]));let m;r?m=yield e.request({method:"eth_getLogs",params:[{address:t,topics:b,blockHash:r}]}):m=yield e.request({method:"eth_getLogs",params:[{address:t,topics:b,fromBlock:typeof n=="bigint"?(0,pj.numberToHex)(n):n,toBlock:typeof s=="bigint"?(0,pj.numberToHex)(s):s}]});let h=m.map(_=>(0,v3.formatLog)(_));return f?(0,_3.parseEventLogs)({abi:f,args:u,logs:h,strict:l}):h})}});var gc=p(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});dm.getContractEvents=P3;var E3=Wt(),x3=ae(),w3=yc();function P3(e,t){return y(this,null,function*(){let{abi:r,address:n,args:s,blockHash:o,eventName:a,fromBlock:u,toBlock:c,strict:d}=t,l=a?(0,E3.getAbiItem)({abi:r,name:a}):void 0,f=l?void 0:r.filter(b=>b.type==="event");return(0,x3.getAction)(e,w3.getLogs,"getLogs")({address:n,args:s,blockHash:o,event:l,events:f,fromBlock:u,toBlock:c,strict:d})})}});var Xt=p(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.decodeFunctionResult=A3;var fm=ge(),q3=br(),T3=Wt(),lm="/docs/contract/decodeFunctionResult";function A3(e){let{abi:t,args:r,functionName:n,data:s}=e,o=t[0];if(n){let u=(0,T3.getAbiItem)({abi:t,args:r,name:n});if(!u)throw new fm.AbiFunctionNotFoundError(n,{docsPath:lm});o=u}if(o.type!=="function")throw new fm.AbiFunctionNotFoundError(void 0,{docsPath:lm});if(!o.outputs)throw new fm.AbiFunctionOutputsNotFoundError(o.name,{docsPath:lm});let a=(0,q3.decodeAbiParameters)(o.outputs,s);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}});var bj=p(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.version=void 0;hc.version="0.1.1"});var mj=p(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.getUrl=O3;Jo.getVersion=B3;Jo.prettyPrint=S3;var I3=bj();function O3(e){return e}function B3(){return I3.version}function S3(e){if(!e)return"";let t=Object.entries(e).map(([n,s])=>s===void 0||s===!1?null:[n,s]).filter(Boolean),r=t.reduce((n,[s])=>Math.max(n,s.length),0);return t.map(([n,s])=>` ${`${n}:`.padEnd(r+1)} ${s}`).join(` 41`)}});var at=p(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.BaseError=void 0;var C3=mj(),bm=class e extends Error{constructor(t,r={}){let n=(()=>{if(r.cause instanceof e){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),s=r.cause instanceof e&&r.cause.docsPath||r.docsPath,a=`https://oxlib.sh${s??""}`,u=[t||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||s?["",n?`Details: ${n}`:void 0,s?`See: ${a}`:void 0]:[]].filter(c=>typeof c=="string").join(` 42`);super(u,r.cause?{cause:r.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,C3.getVersion)()}`}),this.cause=r.cause,this.details=n,this.docs=a,this.docsPath=s,this.shortMessage=t}walk(t){return yj(this,t)}};_c.BaseError=bm;function yj(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?yj(e.cause,t):t?null:e}});var mm=p(Se=>{"use strict";
42Object.defineProperty(Se,"__esModule",{value:!0});Se.charCodeMap=void 0;Se.assertSize=R3;Se.assertStartOffset=M3;Se.assertEndOffset=k3;Se.charCodeToBase16=N3;Se.pad=H3;Se.trim=F3;var Qt=Ft();function R3(e,t){if(Qt.size(e)>t)throw new Qt.SizeOverflowError({givenSize:Qt.size(e),maxSize:t})}function M3(e,t){if(typeof t=="number"&&t>0&&t>Qt.size(e)-1)throw new Qt.SliceOffsetOutOfBoundsError({offset:t,position:"start",size:Qt.size(e)})}function k3(e,t,r){if(typeof t=="number"&&typeof r=="number"&&Qt.size(e)!==r-t)throw new Qt.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:Qt.size(e)})}Se.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function N3(e){if(e>=Se.charCodeMap.zero&&e<=Se.charCodeMap.nine)return e-Se.charCodeMap.zero;if(e>=Se.charCodeMap.A&&e<=Se.charCodeMap.F)return e-(Se.charCodeMap.A-10);if(e>=Se.charCodeMap.a&&e<=Se.charCodeMap.f)return e-(Se.charCodeMap.a-10)}function H3(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new Qt.SizeExceedsPaddingSizeError({size:e.length,targetSize:n,type:"Bytes"});let s=new Uint8Array(n);for(let o=0;o<n;o++){let a=r==="right";s[a?o:n-o-1]=e[a?o:e.length-o-1]}return s}function F3(e,t={}){let{dir:r="left"}=t,n=e,s=0;for(let o=0;o<n.length-1&&n[r==="left"?o:n.length-o-1].toString()==="0";o++)s++;return n=r==="left"?n.slice(s):n.slice(0,n.length-s),n}});var ym=p(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.assertSize=z3;Cn.assertStartOffset=U3;Cn.assertEndOffset=L3;Cn.pad=D3;Cn.trim=$3;var er=ke();function z3(e,t){if(er.size(e)>t)throw new er.SizeOverflowError({givenSize:er.size(e),maxSize:t})}function U3(e,t){if(typeof t=="number"&&t>0&&t>er.size(e)-1)throw new er.SliceOffsetOutOfBoundsError({offset:t,position:"start",size:er.size(e)})}function L3(e,t,r){if(typeof t=="number"&&typeof r=="number"&&er.size(e)!==r-t)throw new er.SliceOffsetOutOfBoundsError({offset:r,position:"end",size:er.size(e)})}function D3(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;let s=e.replace("0x","");if(s.length>n*2)throw new er.SizeExceedsPaddingSizeError({size:Math.ceil(s.length/2),targetSize:n,type:"Hex"});return`0x${s[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function $3(e,t={}){let{dir:r="left"}=t,n=e.replace("0x",""),s=0;for(let o=0;o<n.length-1&&n[r==="left"?o:n.length-o-1].toString()==="0";o++)s++;return n=r==="left"?n.slice(s):n.slice(0,n.length-s),n==="0"?"0x":r==="right"&&n.length%2===1?`0x${n}0`:`0x${n}`}});var Xo=p(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.parse=G3;vc.stringify=V3;var gm="#__bigint";function G3(e,t){return JSON.parse(e,(r,n)=>{let s=n;return typeof s=="string"&&s.endsWith(gm)?BigInt(s.slice(0,-gm.length)):typeof t=="function"?t(r,s):s})}function V3(e,t,r){return JSON.stringify(e,(n,s)=>typeof t=="function"?t(n,s):typeof s=="bigint"?s.toString()+gm:s,r)}});var Ft=p(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.SizeExceedsPaddingSizeError=te.SliceOffsetOutOfBoundsError=te.SizeOverflowError=te.InvalidBytesTypeError=te.InvalidBytesBooleanError=void 0;te.assert=gj;te.concat=X3;te.from=Q3;te.fromArray=hj;te.fromBoolean=e9;te.fromHex=jm;te.fromNumber=t9;te.fromString=r9;te.isEqual=n9;te.padLeft=_j;te.padRight=vj;te.random=s9;te.size=o9;te.slice=i9;te.toBigInt=a9;te.toBoolean=u9;te.toHex=c9;te.toNumber=d9;te.toString=f9;te.trimLeft=jj;te.trimRight=Ej;te.validate=l9;var W3=Vr(),vs=at(),Mn=ke(),ut=mm(),K3=ym(),Z3=Xo(),Y3=new TextDecoder,J3=new TextEncoder;function gj(e){if(!(e instanceof Uint8Array)){if(!e)throw new Rn(e);if(typeof e!="object")throw new Rn(e);if(!("BYTES_PER_ELEMENT"in e))throw new Rn(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new Rn(e)}}function X3(...e){let t=0;for(let n of e)t+=n.length;let r=new Uint8Array(t);for(let n=0,s=0;n<e.length;n++){let o=e[n];r.set(o,s),s+=o.length}return r}function Q3(e){return e instanceof Uint8Array?e:typeof e=="string"?jm(e):hj(e)}function hj(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function e9(e,t={}){let{size:r}=t,n=new Uint8Array(1);return n[0]=Number(e),typeof r=="number"?(ut.assertSize(n,r),_j(n,r)):n}function jm(e,t={}){let{size:r}=t,n=e;r&&(K3.assertSize(e,r),n=Mn.padRight(e,r));let s=n.slice(2);s.length%2&&(s=`0${s}`);let o=s.length/2,a=new Uint8Array(o);for(let u=0,c=0;u<o;u++){let d=ut.charCodeToBase16(s.charCodeAt(c++)),l=ut.charCodeToBase16(s.charCodeAt(c++));if(d===void 0||l===void 0)throw new vs.BaseError(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);a[u]=d*16+l}return a}function t9(e,t){let r=Mn.fromNumber(e,t);return jm(r)}function r9(e,t={}){let{size:r}=t,n=J3.encode(e);return typeof r=="number"?(ut.assertSize(n,r),vj(n,r)):n}function n9(e,t){return(0,W3.equalBytes)(e,t)}function _j(e,t){return ut.pad(e,{dir:"left",size:t})}function vj(e,t){return ut.pad(e,{dir:"right",size:t})}function s9(e){return crypto.getRandomValues(new Uint8Array(e))}function o9(e){return e.length}function i9(e,t,r,n={}){let{strict:s}=n;ut.assertStartOffset(e,t);let o=e.slice(t,r);return s&&ut.assertEndOffset(o,t,r),o}function a9(e,t={}){let{size:r}=t;typeof r<"u"&&ut.assertSize(e,r);let n=Mn.fromBytes(e,t);return Mn.toBigInt(n,t)}function u9(e,t={}){let{size:r}=t,n=e;if(typeof r<"u"&&(ut.assertSize(n,r),n=jj(n)),n.length>1||n[0]>1)throw new jc(n);return!!n[0]}function c9(e,t={}){return Mn.fromBytes(e,t)}function d9(e,t={}){let{size:r}=t;typeof r<"u"&&ut.assertSize(e,r);let n=Mn.fromBytes(e,t);return Mn.toNumber(n,t)}function f9(e,t={}){let{size:r}=t,n=e;return typeof r<"u"&&(ut.assertSize(n,r),n=Ej(n)),Y3.decode(n)}function jj(e){return ut.trim(e,{dir:"left"})}function Ej(e){return ut.trim(e,{dir:"right"})}function l9(e){try{return gj(e),!0}catch(t){return!1}}var jc=class extends vs.BaseError{constructor(t){super(`Bytes value \`${t}\` 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"})}};te.InvalidBytesBooleanError=jc;var Rn=class extends vs.BaseError{constructor(t){super(`Value \`${typeof t=="object"?Z3.stringify(t):t}\` of type \`${typeof t}
42\` 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"})}};te.InvalidBytesTypeError=Rn;var hm=class extends vs.BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}};te.SizeOverflowError=hm;var _m=class extends vs.BaseError{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}};te.SliceOffsetOutOfBoundsError=_m;var vm=class extends vs.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};te.SizeExceedsPaddingSizeError=vm});var ke=p(ee=>{"use strict";
42Object.defineProperty(ee,"__esModule",{value:!0});ee.SizeExceedsPaddingSizeError=ee.SliceOffsetOutOfBoundsError=ee.SizeOverflowError=ee.InvalidLengthError=ee.InvalidHexValueError=ee.InvalidHexTypeError=ee.InvalidHexBooleanError=ee.IntegerOutOfRangeError=void 0;ee.assert=xj;ee.concat=h9;ee.from=_9;ee.fromBoolean=v9;ee.fromBytes=Qo;ee.fromNumber=j9;ee.fromString=E9;ee.isEqual=x9;ee.padLeft=qm;ee.padRight=wj;ee.random=w9;ee.slice=P9;ee.size=q9;ee.trimLeft=Pj;ee.trimRight=T9;ee.toBigInt=qj;ee.toBoolean=A9;ee.toBytes=I9;ee.toNumber=O9;ee.toString=B9;ee.validate=S9;var p9=Vr(),js=Ft(),rn=at(),b9=mm(),tr=ym(),m9=Xo(),y9=new TextEncoder,g9=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xj(e,t={}){let{strict:r=!1}=t;if(!e)throw new ei(e);if(typeof e!="string")throw new ei(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e))throw new ti(e);if(!e.startsWith("0x"))throw new ti(e)}function h9(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function _9(e){return e instanceof Uint8Array?Qo(e):Array.isArray(e)?Qo(new Uint8Array(e)):e}function v9(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(tr.assertSize(r,t.size),qm(r,t.size)):r}function Qo(e,t={}){let r="";for(let s=0;s<e.length;s++)r+=g9[e[s]];let n=`0x${r}`;return typeof t.size=="number"?(tr.assertSize(n,t.size),wj(n,t.size)):n}function j9(e,t={}){let{signed:r,size:n}=t,s=BigInt(e),o;n?r?o=(1n<<BigInt(n)*8n-1n)-1n:o=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof o=="bigint"&&r?-o-1n:0;if(o&&s>o||s<a){let d=typeof e=="bigint"?"n":"";throw new Ec({max:o?`${o}${d}`:void 0,min:`${a}${d}`,signed:r,size:n,value:`${e}${d}`})}let c=`0x${(r&&s<0?(1n<<BigInt(n*8))+BigInt(s):s).toString(16)}`;return n?qm(c,n):c}function E9(e,t={}){return Qo(y9.encode(e),t)}function x9(e,t){return(0,p9.equalBytes)(js.fromHex(e),js.fromHex(t))}function qm(e,t){return tr.pad(e,{dir:"left",size:t})}function wj(e,t){return tr.pad(e,{dir:"right",size:t})}function w9(e){return Qo(js.random(e))}function P9(e,t,r,n={}){let{strict:s}=n;tr.assertStartOffset(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return s&&tr.assertEndOffset(o,t,r),o}function q9(e){return Math.ceil((e.length-2)/2)}function Pj(e){return tr.trim(e,{dir:"left"})}function T9(e){return tr.trim(e,{dir:"right"})}function qj(e,t={}){let{signed:r}=t;t.size&&tr.assertSize(e,t.size);let n=BigInt(e);if(!r)return n;let s=(e.length-2)/2,o=(1n<<BigInt(s)*8n)-1n,a=o>>1n;return n<=a?n:n-o-1n}function A9(e,t={}){t.size&&tr.assertSize(e,t.size);let r=Pj(e);if(r==="0x")return!1;if(r==="0x1")return!0;throw new xc(e)}function I9(e,t={}){return js.fromHex(e,t)}function O9(e,t={}){let{signed:r,size:n}=t;return Number(!r&&!n?e:qj(e,t))}function B9(e,t={}){let{size:r}=t,n=js.fromHex(e);return r&&(b9.assertSize(n,r),n=js.trimRight(n)),new TextDecoder().decode(n)}function S9(e,t={}){let{strict:r=!1}=t;try{return xj(e,{strict:r}),!0}catch(n){return!1}}var Ec=class extends rn.BaseError{constructor({max:t,min:r,signed:n,size:s,value:o}){super(`Number \`${o}\` is not in safe${s?` ${s*8}-bit`:""}${n?" signed":" unsigned"} integer range ${t?`(\`${r}\` to \`${t}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};ee.IntegerOutOfRangeError=Ec;var xc=class extends rn.BaseError{constructor(t){super(`Hex value \`"${t}"\` 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"})}};ee.InvalidHexBooleanError=xc;var ei=class extends rn.BaseError{constructor(t){super(`Value \`${typeof t=="object"?m9.stringify(t):t}\` of type \`${typeof t}\` 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"})}};ee.InvalidHexTypeError=ei;var ti=class extends rn.BaseError{constructor(t){super(`Value \`${t}
42\` 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"})}};ee.InvalidHexValueError=ti;var Em=class extends rn.BaseError{constructor(t){super(`Hex value \`"${t}"\` is an odd length (${t.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}};ee.InvalidLengthError=Em;var xm=class extends rn.BaseError{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};ee.SizeOverflowError=xm;var wm=class extends rn.BaseError{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}};ee.SliceOffsetOutOfBoundsError=wm;var Pm=class extends rn.BaseError{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};ee.SizeExceedsPaddingSizeError=Pm});var Tj=p(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.fromRpc=C9;wc.toRpc=R9;var Tm=ke();function C9(e){return B(v({},e),{amount:BigInt(e.amount),index:Number(e.index),validatorIndex:Number(e.validatorIndex)})}function R9(e){return{address:e.address,amount:Tm.fromNumber(e.amount),index:Tm.fromNumber(e.index),validatorIndex:Tm.fromNumber(e.validatorIndex)}}});var Am=p(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.fromRpc=M9;Pc.toRpc=k9;var Es=ke(),Aj=Tj();function M9(e){return v(v(v(v(v(v(v(v({},e.baseFeePerGas&&{baseFeePerGas:BigInt(e.baseFeePerGas)}),e.blobBaseFee&&{blobBaseFee:BigInt(e.blobBaseFee)}),e.feeRecipient&&{feeRecipient:e.feeRecipient}),e.gasLimit&&{gasLimit:BigInt(e.gasLimit)}),e.number&&{number:BigInt(e.number)}),e.prevRandao&&{prevRandao:BigInt(e.prevRandao)}),e.time&&{time:BigInt(e.time)}),e.withdrawals&&{withdrawals:e.withdrawals.map(Aj.fromRpc)})}function k9(e){return v(v(v(v(v(v(v(v({},typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Es.fromNumber(e.baseFeePerGas)}),typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Es.fromNumber(e.blobBaseFee)}),typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient}),typeof e.gasLimit=="bigint"&&{gasLimit:Es.fromNumber(e.gasLimit)}),typeof e.number=="bigint"&&{number:Es.fromNumber(e.number)}),typeof e.prevRandao=="bigint"&&{prevRandao:Es.fromNumber(e.prevRandao)}),typeof e.time=="bigint"&&{time:Es.fromNumber(e.time)}),e.withdrawals&&{withdrawals:e.withdrawals.map(Aj.toRpc)})}});var jr=p(le=>{"use strict";
42Object.defineProperty(le,"__esModule",{value:!0});le.erc4626Abi=le.erc721Abi=le.erc1155Abi=le.erc20Abi_bytes32=le.erc20Abi=le.erc6492SignatureValidatorAbi=le.erc1271Abi=le.addressResolverAbi=le.textResolverAbi=le.universalResolverReverseAbi=le.universalResolverResolveAbi=le.batchGatewayAbi=le.multicall3Abi=void 0;le.multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}];le.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"}]}];var Ij=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}];le.universalResolverResolveAbi=[...Ij,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}];le.universalResolverReverseAbi=[...Ij,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}];le.textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];le.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"}]}];le.erc1271Abi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}];le.erc6492SignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];le.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"}]}];
42le.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"}]}];le.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"}];
42le.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:[]}];le.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"}]});var Oj=p(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.aggregate3Signature=void 0;qc.aggregate3Signature="0x82ad56cb"});var xs=p(rr=>{"use strict";
42Object.defineProperty(rr,"__esModule",{value:!0});rr.multicall3Bytecode=rr.erc6492SignatureValidatorByteCode=rr.deploylessCallViaFactoryBytecode=rr.deploylessCallViaBytecodeBytecode=void 0;rr.deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";rr.deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";rr.erc6492SignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b8152
4260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848
42603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";rr.multicall3Bytecode="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
42150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"});var ws=p(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.InvalidChainIdError=At.ClientChainNotConfiguredError=At.ChainNotFoundError=At.ChainMismatchError=At.ChainDoesNotSupportContract=void 0;var ri=Q(),Im=class extends ri.BaseError{constructor({blockNumber:t,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...t&&n.blockCreated&&n.blockCreated>t?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}};At.ChainDoesNotSupportContract=Im;var Om=class extends ri.BaseError{constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} \u2013 ${t.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${t.id} \u2013 ${t.name}`],name:"ChainMismatchError"})}};At.ChainMismatchError=Om;var Bm=class extends ri.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"})}};At.ChainNotFoundError=Bm;var Sm=class extends ri.BaseError{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}};At.ClientChainNotConfiguredError=Sm;var Cm=class extends ri.BaseError{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}
43" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};At.InvalidChainIdError=Cm});var Ps=p(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.encodeDeployData=F9;var Rm=ge(),N9=Oe(),H9=Et(),Mm="/docs/contract/encodeDeployData";function F9(e){let{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;let s=t.find(a=>"type"in a&&a.type==="constructor");if(!s)throw new Rm.AbiConstructorNotFoundError({docsPath:Mm});if(!("inputs"in s))throw new Rm.AbiConstructorParamsNotFoundError({docsPath:Mm});if(!s.inputs||s.inputs.length===0)throw new Rm.AbiConstructorParamsNotFoundError({docsPath:Mm});let o=(0,H9.encodeAbiParameters)(s.inputs,r);return(0,N9.concatHex)([n,o])}});var Er=p(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.getChainContractAddress=z9;var Bj=ws();function z9({blockNumber:e,chain:t,contract:r}){let n=t?.contracts?.[r];if(!n)throw new Bj.ChainDoesNotSupportContract({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new Bj.ChainDoesNotSupportContract({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}});var Tc=p(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.getCallError=$9;var U9=mr(),L9=Kt(),D9=ps();function $9(e,n){var s=n,{docsPath:t}=s,r=G(s,["docsPath"]);let o=(()=>{let a=(0,D9.getNodeError)(e,r);return a instanceof L9.UnknownNodeError?e:a})();return new U9.CallExecutionError(o,v({docsPath:t},r))}});var Ac=p(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.withResolvers=G9;function G9(){let e=()=>{},t=()=>{};return{promise:new Promise((n,s)=>{e=n,t=s}),resolve:e,reject:t}}});var Ic=p(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.createBatchScheduler=W9;var V9=Ac(),zm=new Map;function W9({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:s}){let o=()=>y(null,null,function*(){let f=c();a();let b=f.map(({args:m})=>m);b.length!==0&&e(b).then(m=>{s&&Array.isArray(m)&&m.sort(s);for(let h=0;h<f.length;h++){let{resolve:_}=f[h];_?.([m[h],m])}}).catch(m=>{for(let h=0;h<f.length;h++){let{reject:_}=f[h];_?.(m)}})}),a=()=>zm.delete(t),u=()=>c().map(({args:f})=>f),c=()=>zm.get(t)||[],d=f=>zm.set(t,[...c(),f]);return{flush:a,schedule(f){return y(this,null,function*(){let{promise:b,resolve:m,reject:h}=(0,V9.withResolvers)();return r?.([...u(),f])&&o(),c().length>0?(d({args:f,resolve:m,reject:h}),b):(d({args:f,resolve:m,reject:h}),setTimeout(o,n),b)})}}}});var Cj=p(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.OffchainLookupSenderMismatchError=nn.OffchainLookupResponseMalformedError=nn.OffchainLookupError=void 0;var K9=Ce(),Gm=Q(),Sj=tu(),Lm=class extends Gm.BaseError{constructor({callbackSelector:t,cause:r,data:n,extraData:s,sender:o,urls:a}){super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],r.metaMessages?.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(u=>` ${(0,Sj.getUrl)(u)}`)],` Sender: ${o}`,` Data: ${n}`,` Callback selector: ${t}`,` Extra data: ${s}`].flat(),name:"OffchainLookupError"})}};nn.OffchainLookupError=Lm;var Dm=class extends Gm.BaseError{constructor({result:t,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,Sj.getUrl)(r)}`,`Response: ${(0,K9.stringify)(t)}`],name:"OffchainLookupResponseMalformedError"})}};nn.OffchainLookupResponseMalformedError=Dm;var $m=class extends Gm.BaseError{constructor({sender:t,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}};nn.OffchainLookupSenderMismatchError=$m});var Oc=p(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.decodeFunctionData=Q9;var Z9=ge(),Rj=mt(),Y9=Fr(),J9=br(),X9=Gt();function Q9(e){let{abi:t,data:r}=e,n=(0,Rj.slice)(r,0,4),s=t.find(o=>o.type==="function"&&n===(0,Y9.toFunctionSelector)((0,X9.formatAbiItem)(o)));if(!s)throw new Z9.AbiFunctionSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:s.name,args:"inputs"in s&&s.inputs&&s.inputs.length>0?(0,J9.decodeAbiParameters)(s.inputs,(0,Rj.slice)(r,4)):void 0}}});var Bc=p(Zm=>{"use strict";
43Object.defineProperty(Zm,"__esModule",{value:!0});Zm.encodeErrorResult=oC;var Wm=ge(),eC=Oe(),tC=Fr(),rC=Et(),nC=Gt(),sC=Wt(),Km="/docs/contract/encodeErrorResult";function oC(e){let{abi:t,errorName:r,args:n}=e,s=t[0];if(r){let c=(0,sC.getAbiItem)({abi:t,args:n,name:r});if(!c)throw new Wm.AbiErrorNotFoundError(r,{docsPath:Km});s=c}if(s.type!=="error")throw new Wm.AbiErrorNotFoundError(void 0,{docsPath:Km});let o=(0,nC.formatAbiItem)(s),a=(0,tC.toFunctionSelector)(o),u="0x";if(n&&n.length>0){if(!s.inputs)throw new Wm.AbiErrorInputsNotFoundError(s.name,{docsPath:Km});u=(0,rC.encodeAbiParameters)(s.inputs,n)}return(0,eC.concatHex)([a,u])}});var Cc=p(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.encodeFunctionResult=uC;var Sc=ge(),iC=Et(),aC=Wt(),Ym="/docs/contract/encodeFunctionResult";function uC(e){let{abi:t,functionName:r,result:n}=e,s=t[0];if(r){let a=(0,aC.getAbiItem)({abi:t,name:r});if(!a)throw new Sc.AbiFunctionNotFoundError(r,{docsPath:Ym});s=a}if(s.type!=="function")throw new Sc.AbiFunctionNotFoundError(void 0,{docsPath:Ym});if(!s.outputs)throw new Sc.AbiFunctionOutputsNotFoundError(s.name,{docsPath:Ym});let o=(()=>{if(s.outputs.length===0)return[];if(s.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new Sc.InvalidArrayError(n)})();return(0,iC.encodeAbiParameters)(s.outputs,o)}});var ni=p(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.localBatchGatewayUrl=void 0;qs.localBatchGatewayRequest=kj;var Xm=jr(),cC=Ka(),dC=Oc(),Mj=Bc(),fC=Cc();qs.localBatchGatewayUrl="x-batch-gateway:true";function kj(e){return y(this,null,function*(){let{data:t,ccipRequest:r}=e,{args:[n]}=(0,dC.decodeFunctionData)({abi:Xm.batchGatewayAbi,data:t}),s=[],o=[];return yield Promise.all(n.map((a,u)=>y(null,null,function*(){try{o[u]=a.urls.includes(qs.localBatchGatewayUrl)?yield kj({data:a.data,ccipRequest:r}):yield r(a),s[u]=!1}catch(c){s[u]=!0,o[u]=lC(c)}}))),(0,fC.encodeFunctionResult)({abi:Xm.batchGatewayAbi,functionName:"query",result:[s,o]})})}function lC(e){return e.name==="HttpRequestError"&&e.status?(0,Mj.encodeErrorResult)({abi:Xm.batchGatewayAbi,errorName:"HttpError",args:[e.status,e.shortMessage]}):(0,Mj.encodeErrorResult)({abi:[cC.solidityError],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}});var Rc=p(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.offchainLookupAbiItem=xr.offchainLookupSignature=void 0;xr.offchainLookup=vC;xr.ccipRequest=Fj;var pC=Ts(),Qm=Cj(),Nj=Pt(),bC=To(),mC=Et(),yC=Tt(),gC=Oe(),hC=$e(),Hj=ni(),_C=Ce();xr.offchainLookupSignature="0x556f1830";xr.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"}]};function vC(o,a){return y(this,arguments,function*(e,{blockNumber:t,blockTag:r,data:n,to:s}){let{args:u}=(0,bC.decodeErrorResult)({data:n,abi:[xr.offchainLookupAbiItem]}),[c,d,l,f,b]=u,{ccipRead:m}=e,h=m&&typeof m?.request=="function"?m.request:Fj;try{if(!(0,yC.isAddressEqual)(s,c))throw new Qm.OffchainLookupSenderMismatchError({sender:c,to:s});let _=d.includes(Hj.localBatchGatewayUrl)?yield(0,Hj.localBatchGatewayRequest)({data:l,ccipRequest:h}):yield h({data:l,sender:c,urls:d}),{data:E}=yield(0,pC.call)(e,{blockNumber:t,blockTag:r,data:(0,gC.concat)([f,(0,mC.encodeAbiParameters)([{type:"bytes"},{type:"bytes"}],[_,b])]),to:s});return E}catch(_){throw new Qm.OffchainLookupError({callbackSelector:f,cause:_,data:n,extraData:b,sender:c,urls:d})}})}function Fj(n){return y(this,arguments,function*({data:e,sender:t,urls:r}){let s=new Error("An unknown error occurred.");for(let o=0;o<r.length;o++){let a=r[o],u=a.includes("{data}")?"GET":"POST",c=u==="POST"?{data:e,sender:t}:void 0,d=u==="POST"?{"Content-Type":"application/json"}:{};try{let l=yield fetch(a.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:d,method:u}),f;if(l.headers.get("Content-Type")?.startsWith("application/json")?f=(yield l.json()).data:f=yield l.text(),!l.ok){s=new Nj.HttpRequestError({body:c,details:f?.error?(0,_C.str
43ingify)(f.error):l.statusText,headers:l.headers,status:l.status,url:a});continue}if(!(0,hC.isHex)(f)){s=new Qm.OffchainLookupResponseMalformedError({result:f,url:a});continue}return f}catch(l){s=new Nj.HttpRequestError({body:c,details:l.message,url:a})}}throw s})}});var Ts=p(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.call=CC;Mc.getRevertErrorData=Vj;var Uj=fr(),jC=Am(),EC=xe(),zj=jr(),xC=Oj(),r1=xs(),e1=Q(),t1=ws(),Lj=mr(),wC=Xt(),Dj=Ps(),PC=Qe(),qC=Er(),$j=U(),TC=Tc(),AC=Jr(),IC=Nt(),OC=Ic(),BC=rc(),SC=Ht();function CC(e,t){return y(this,null,function*(){let D=t,{account:r=e.account,authorizationList:n,batch:s=!!e.batch?.multicall,blockNumber:o,blockTag:a=e.experimental_blockTag??"latest",accessList:u,blobs:c,blockOverrides:d,code:l,data:f,factory:b,factoryData:m,gas:h,gasPrice:_,maxFeePerBlobGas:E,maxFeePerGas:j,maxPriorityFeePerGas:q,nonce:T,to:x,value:A,stateOverride:I}=D,O=G(D,["account","authorizationList","batch","blockNumber","blockTag","accessList","blobs","blockOverrides","code","data","factory","factoryData","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","nonce","to","value","stateOverride"]),S=r?(0,EC.parseAccount)(r):void 0;if(l&&(b||m))throw new e1.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&x)throw new e1.BaseError("Cannot provide both `code` & `to` as parameters.");let C=l&&f,M=b&&m&&x&&f,N=C||M,F=C?Gj({code:l,data:f}):M?kC({data:f,factory:b,factoryData:m,to:x}):f;try{(0,SC.assertRequest)(t);let H=(typeof o=="bigint"?(0,$j.numberToHex)(o):void 0)||a,k=d?jC.toRpc(d):void 0,L=(0,BC.serializeStateOverride)(I),J=e.chain?.formatters?.transactionRequest?.format,$=(J||IC.formatTransactionRequest)(B(v({},(0,AC.extract)(O,{format:J})),{from:S?.address,accessList:u,authorizationList:n,blobs:c,data:F,gas:h,gasPrice:_,maxFeePerBlobGas:E,maxFeePerGas:j,maxPriorityFeePerGas:q,nonce:T,to:N?void 0:x,value:A}),"call");if(s&&RC({request:$})&&!L&&!k)try{return yield MC(e,B(v({},$),{blockNumber:o,blockTag:a}))}catch(Te){if(!(Te instanceof t1.ClientChainNotConfiguredError)&&!(Te instanceof t1.ChainDoesNotSupportContract))throw Te}let oe=(()=>{let Te=[$,H];return L&&k?[...Te,L,k]:L?[...Te,L]:k?[...Te,{},k]:Te})(),je=yield e.request({method:"eth_call",params:oe});return je==="0x"?{data:void 0}:{data:je}}catch(X){let H=Vj(X),{offchainLookup:k,offchainLookupSignature:L}=yield Promise.resolve().then(()=>Rc());if(e.ccipRead!==!1&&H?.slice(0,10)===L&&x)return{data:yield k(e,{data:H,to:x})};throw N&&H?.slice(0,10)==="0x101bb98d"?new Lj.CounterfactualDeploymentFailedError({factory:b}):(0,TC.getCallError)(X,B(v({},t),{account:S,chain:e.chain}))}})}function RC({request:e}){let s=e,{data:t,to:r}=s,n=G(s,["data","to"]);return!(!t||t.startsWith(xC.aggregate3Signature)||!r||Object.values(n).filter(o=>typeof o<"u").length>0)}function MC(e,t){return y(this,null,function*(){let{batchSize:r=1024,deployless:n=!1,wait:s=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:a=e.experimental_blockTag??"latest",data:u,to:c}=t,d=(()=>
43{if(n)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return(0,qC.getChainContractAddress)({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new t1.ClientChainNotConfiguredError})(),f=(typeof o=="bigint"?(0,$j.numberToHex)(o):void 0)||a,{schedule:b}=(0,OC.createBatchScheduler)({id:`${e.uid}.${f}`,wait:s,shouldSplitBatch(_){return _.reduce((j,{data:q})=>j+(q.length-2),0)>r*2},fn:_=>y(null,null,function*(){let E=_.map(T=>({allowFailure:!0,callData:T.data,target:T.to})),j=(0,PC.encodeFunctionData)({abi:zj.multicall3Abi,args:[E],functionName:"aggregate3"}),q=yield e.request({method:"eth_call",params:[v({},d===null?{data:Gj({code:r1.multicall3Bytecode,data:j})}:{to:d,data:j}),f]});return(0,wC.decodeFunctionResult)({abi:zj.multicall3Abi,args:[E],functionName:"aggregate3",data:q||"0x"})})}),[{returnData:m,success:h}]=yield b({data:u,to:c});if(!h)throw new Lj.RawContractError({data:m});return m==="0x"?{data:void 0}:{data:m}})}function Gj(e){let{code:t,data:r}=e;return(0,Dj.encodeDeployData)({abi:(0,Uj.parseAbi)(["constructor(bytes, bytes)"]),bytecode:r1.deploylessCallViaBytecodeBytecode,args:[t,r]})}function kC(e){let{data:t,factory:r,factoryData:n,to:s}=e;return(0,Dj.encodeDeployData)({abi:(0,Uj.parseAbi)(["constructor(address, bytes, address, bytes)"]),bytecode:r1.deploylessCallViaFactoryBytecode,args:[s,t,r,n]})}function Vj(e){if(!(e instanceof e1.BaseError))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}});var zt=p(n1=>{"use strict";Object.defineProperty(n1,"__esModule",{value:!0});n1.readContract=LC;var NC=Xt(),HC=Qe(),FC=gr(),zC=ae(),UC=Ts();function LC(e,t){return y(this,null,function*(){let c=t,{abi:r,address:n,args:s,functionName:o}=c,a=G(c,["abi","address","args","functionName"]),u=(0,HC.encodeFunctionData)({abi:r,args:s,functionName:o});try{let{data:d}=yield(0,zC.getAction)(e,UC.call,"call")(B(v({},a),{data:u,to:n}));return(0,NC.decodeFunctionResult)({abi:r,args:s,functionName:o,data:d||"0x"})}catch(d){throw(0,FC.getContractError)(d,{abi:r,address:n,args:s,docsPath:"/docs/contract/readContract",functionName:o})}})}});var o1=p(s1=>{"use strict";Object.defineProperty(s1,"__esModule",{value:!0});s1.simulateContract=ZC;var DC=xe(),$C=Xt(),GC=Qe(),VC=gr(),WC=ae(),KC=Ts();function ZC(e,t){return y(this,null,function*(){let l=t,{abi:r,address:n,args:s,dataSuffix:o,functionName:a}=l,u=G(l,["abi","address","args","dataSuffix","functionName"]),c=u.account?(0,DC.parseAccount)(u.account):e.account,d=(0,GC.encodeFunctionData)({abi:r,args:s,functionName:a});try{let{data:f}=yield(0,WC.getAction)(e,KC.call,"call")(B(v({batch:!1,data:`${d}${o?o.replace("0x",""):""}`,to:n},u),{account:c})),b=(0,$C.decodeFunctionResult)({abi:r,args:s,functionName:a,data:f||"0x"}),m=r.filter(h=>"name"in h&&h.name===t.functionName);return{result:b,request:B(v({abi:m,address:n,args:s,dataSuffix:o,functionName:a},u),{account:c})}}catch(f){throw(0,VC.getContractError)(f,{abi:r,address:n,args:s,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}})}});var sn=p(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.cleanupCache=It.listenersCache=void 0;It.observe=JC;It.listenersCache=new Map;It.cleanupCache=new Map;var YC=0;function JC(e,t,r){let n=++YC,s=()=>It.listenersCache.get(e)||[],o=()=>{let l=s();It.listenersCache.set(e,l.filter(f=>f.id!==n))},a=()=>{let l=s();if(!l.some(b=>b.id===n))return;let f=It.cleanupCache.get(e);if(l.length===1&&f){let b=f();b instanceof Promise&&b.catch(()=>{})}o()},u=s();if(It.listenersCache.set(e,[...u,{id:n,fns:t}]),u&&u.length>0)return a;let c={};for(let l in t)c[l]=(...f)=>{let b=s();if(b.length!==0)for(let m of b)m.fns[l]?.(...f)};let d=r(c);return typeof d=="function"&&It.cleanupCache.set(e,d),a}});var kc=p(i1=>{"use strict";Object.defineProperty(i1,"__esModule",{value:!0});i1.wait=XC;function XC(e){return y(this,null,function*(){return new Promise(t=>setTimeout(t,e))})}});var kn=p(a1=>{"use strict";Object.defineProperty(a1,"__esModule",{value:!0});a1.poll=QC;var Wj=kc();function QC(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let s=!0,o=()=>s=!1;return y(null,null,function*(){let u;t&&(u=yield e({unpoll:o}));let c=(yield r?.(u))??n;yield(0,Wj.wait)(c);let d=()=>
43y(null,null,function*(){s&&(yield e({unpoll:o}),yield(0,Wj.wait)(n),d())});d()}),o}});var u1=p(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.responseCache=nr.promiseCache=void 0;nr.getCache=Kj;nr.withCache=eR;nr.promiseCache=new Map;nr.responseCache=new Map;function Kj(e){let t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:a=>o.set(s,a)}),r=t(e,nr.promiseCache),n=t(e,nr.responseCache);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}function eR(n,s){return y(this,arguments,function*(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){let o=Kj(t),a=o.response.get();if(a&&r>0&&Date.now()-a.created.getTime()<r)return a.data;let u=o.promise.get();u||(u=e(),o.promise.set(u));try{let c=yield u;return o.response.set({created:new Date,data:c}),c}finally{o.promise.clear()}})}});var As=p(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.getBlockNumberCache=tR;Nc.getBlockNumber=rR;var Zj=u1(),Yj=e=>`blockNumber.${e}`;function tR(e){return(0,Zj.getCache)(Yj(e))}function rR(r){return y(this,arguments,function*(e,{cacheTime:t=e.cacheTime}={}){let n=yield(0,Zj.withCache)(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Yj(e.uid),cacheTime:t});return BigInt(n)})}});var si=p(c1=>{"use strict";Object.defineProperty(c1,"__esModule",{value:!0});c1.getFilterChanges=oR;var nR=_s(),sR=Jt();function oR(r,n){return y(this,arguments,function*(e,{filter:t}){let s="strict"in t&&t.strict,o=yield t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof o[0]=="string")return o;let a=o.map(u=>(0,sR.formatLog)(u));return!("abi"in t)||!t.abi?a:(0,nR.parseEventLogs)({abi:t.abi,logs:a,strict:s})})}});var oi=p(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});d1.uninstallFilter=iR;function iR(r,n){return y(this,arguments,function*(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})})}});var l1=p(f1=>{"use strict";Object.defineProperty(f1,"__esModule",{value:!0});f1.watchContractEvent=yR;var Jj=ge(),aR=yr(),uR=hs(),cR=zr(),Xj=Jt(),ii=ae(),Qj=sn(),dR=kn(),eE=Ce(),fR=Wa(),lR=As(),pR=gc(),bR=si(),mR=oi();function yR(e,t){let{abi:r,address:n,args:s,batch:o=!0,eventName:a,fromBlock:u,onError:c,onLogs:d,poll:l,pollingInterval:f=e.pollingInterval,strict:b}=t;return(typeof l<"u"?l:typeof u=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
43onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{let E=b??!1,j=(0,eE.stringify)(["watchContractEvent",n,s,o,e.uid,a,f,E,u]);return(0,Qj.observe)(j,{onLogs:d,onError:c},q=>{let T;u!==void 0&&(T=u-1n);let x,A=!1,I=(0,dR.poll)(()=>y(null,null,function*(){if(!A){try{x=yield(0,ii.getAction)(e,fR.createContractEventFilter,"createContractEventFilter")({abi:r,address:n,args:s,eventName:a,strict:E,fromBlock:u})}catch(O){}A=!0;return}try{let O;if(x)O=yield(0,ii.getAction)(e,bR.getFilterChanges,"getFilterChanges")({filter:x});else{let S=yield(0,ii.getAction)(e,lR.getBlockNumber,"getBlockNumber")({});T&&T<S?O=yield(0,ii.getAction)(e,pR.getContractEvents,"getContractEvents")({abi:r,address:n,args:s,eventName:a,fromBlock:T+1n,toBlock:S,strict:E}):O=[],T=S}if(O.length===0)return;if(o)q.onLogs(O);else for(let S of O)q.onLogs([S])}catch(O){x&&O instanceof aR.InvalidInputRpcError&&(A=!1),q.onError?.(O)}}),{emitOnBegin:!0,interval:f});return()=>y(null,null,function*(){x&&(yield(0,ii.getAction)(e,mR.uninstallFilter,"uninstallFilter")({filter:x})),I()})})})():(()=>{let E=b??!1,j=(0,eE.stringify)(["watchContractEvent",n,s,o,e.uid,a,f,E]),q=!0,T=()=>q=!1;return(0,Qj.observe)(j,{onLogs:d,onError:c},x=>(y(null,null,function*(){try{let A=(()=>{if(e.transport.type==="fallback"){let S=e.transport.transports.find(C=>C.config.type==="webSocket"||C.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),I=a?(0,cR.encodeEventTopics)({abi:r,eventName:a,args:s}):[],{unsubscribe:O}=yield A.subscribe({params:["logs",{address:n,topics:I}],onData(S){if(!q)return;let C=S.result;try{let{eventName:M,args:N}=(0,uR.decodeEventLog)({abi:r,data:C.data,topics:C.topics,strict:b}),F=(0,Xj.formatLog)(C,{args:N,eventName:M});x.onLogs([F])}catch(M){let N,F;if(M instanceof Jj.DecodeLogDataMismatch||M instanceof Jj.DecodeLogTopicsMismatch){if(b)return;N=M.abiItem.name,F=M.abiItem.inputs?.some(X=>!("name"in X&&X.name))}let D=(0,Xj.formatLog)(C,{args:F?[]:{},eventName:N});x.onLogs([D])}},onError(S){x.onError?.(S)}});T=O,q||T()}catch(A){c?.(A)}}),()=>T()))})()}});var wr=p(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.AccountTypeNotSupportedError=Is.AccountNotFoundError=void 0;var tE=Q(),p1=class extends tE.BaseError{constructor({docsPath:t}={}){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:t,docsSlug:"account",name:"AccountNotFoundError"})}};Is.AccountNotFoundError=p1;var b1=class extends tE.BaseError{constructor({docsPath:t,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:t,metaMessages:r,name:"AccountTypeNotSupportedError"})}};Is.AccountTypeNotSupportedError=b1});var Os=p(m1=>{"use strict";Object.defineProperty(m1,"__esModule",{value:!0});m1.assertCurrentChain=gR;var rE=ws();function gR({chain:e,currentChainId:t}){if(!e)throw new rE.ChainNotFoundError;if(t!==e.id)throw new rE.ChainMismatchError({chain:e,currentChainId:t})}});var ai=p(y1=>{"use strict";Object.defineProperty(y1,"__esModule",{value:!0});y1.getTransactionError=jR;var hR=Kt(),_R=Ge(),vR=ps();function jR(e,n){var s=n,{docsPath:t}=s,r=G(s,["docsPath"]);let o=(()=>{let a=(0,vR.getNodeError)(e,r);return a instanceof hR.UnknownNodeError?e:a})();return new _R.TransactionExecutionError(o,v({docsPath:t},r))}});var Hc=p(g1=>{"use strict";Object.defineProperty(g1,"__esModule",{value:!0});g1.sendRawTransaction=ER;function ER(r,n){return y(this,arguments,function*(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})})}});var ui=p(v1=>{"use strict";Object.defineProperty(v1,"__esModule",{value:!0});v1.sendTransaction=RR;var xR=xe(),Fc=wr(),wR=Q(),PR=ls(),qR=Os(),TR=ai(),AR=Jr(),IR=Nt(),h1=ae(),OR=qn(),BR=Ht(),SR=tn(),nE=ys(),CR=Hc(),_1=new OR.LruMap(128);function RR(e,t){return y(this,null,function*(){let q=t,{account:r=e.account,chain:n=e.chain,accessList:s,authorizationList:o,blobs:a,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:f,maxPriorityFeePerGas:b,nonce:m,type:h,value:_}=q,E=G(q,["account","chain","accessList","authorizationList","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","
44nonce","type","value"]);if(typeof r>"u")throw new Fc.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});let j=r?(0,xR.parseAccount)(r):null;try{(0,BR.assertRequest)(t);let T=yield y(null,null,function*(){if(t.to)return t.to;if(t.to!==null&&o&&o.length>0)return yield(0,PR.recoverAuthorizationAddress)({authorization:o[0]}).catch(()=>{throw new wR.BaseError("`to` is required. Could not infer from `authorizationList`.")})});if(j?.type==="json-rpc"||j===null){let x;n!==null&&(x=yield(0,h1.getAction)(e,SR.getChainId,"getChainId")({}),(0,qR.assertCurrentChain)({currentChainId:x,chain:n}));let A=e.chain?.formatters?.transactionRequest?.format,O=(A||IR.formatTransactionRequest)(B(v({},(0,AR.extract)(E,{format:A})),{accessList:s,authorizationList:o,blobs:a,chainId:x,data:u,from:j?.address,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:f,maxPriorityFeePerGas:b,nonce:m,to:T,type:h,value:_}),"sendTransaction"),S=_1.get(e.uid),C=S?"wallet_sendTransaction":"eth_sendTransaction";try{return yield e.request({method:C,params:[O]},{retryCount:0})}
44catch(M){if(S===!1)throw M;let N=M;if(N.name==="InvalidInputRpcError"||N.name==="InvalidParamsRpcError"||N.name==="MethodNotFoundRpcError"||N.name==="MethodNotSupportedRpcError")return yield e.request({method:"wallet_sendTransaction",params:[O]},{retryCount:0}).then(F=>(_1.set(e.uid,!0),F)).catch(F=>{let D=F;throw D.name==="MethodNotFoundRpcError"||D.name==="MethodNotSupportedRpcError"?(_1.set(e.uid,!1),N):D});throw N}}if(j?.type==="local"){let x=yield(0,h1.getAction)(e,nE.prepareTransactionRequest,"prepareTransactionRequest")(B(v({account:j,accessList:s,authorizationList:o,blobs:a,chain:n,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:f,maxPriorityFeePerGas:b,nonce:m,nonceManager:j.nonceManager,parameters:[...nE.defaultParameters,"sidecars"],type:h,value:_},E),{to:T})),A=n?.serializers?.transaction,I=yield j.signTransaction(x,{serializer:A});return yield(0,h1.getAction)(e,CR.sendRawTransaction,"sendRawTransaction")({serializedTransaction:I})}throw j?.type==="smart"?new Fc.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Fc.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:j?.type})}catch(T){throw T instanceof Fc.AccountTypeNotSupportedError?T:(0,TR.getTransactionError)(T,B(v({},t),{account:j,chain:t.chain||void 0}))}})}});var Lc=p(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.writeContract=zc;var MR=xe(),kR=wr(),NR=Qe(),HR=gr(),FR=ae(),zR=ui();function zc(e,t){return y(this,null,function*(){return zc.internal(e,zR.sendTransaction,"sendTransaction",t)})}(function(e){function t(r,n,s,o){return y(this,null,function*(){let _=o,{abi:a,account:u=r.account,address:c,args:d,dataSuffix:l,functionName:f}=_,b=G(_,["abi","account","address","args","dataSuffix","functionName"]);if(typeof u>"u")throw new kR.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});let m=u?(0,MR.parseAccount)(u):null,h=(0,NR.encodeFunctionData)({abi:a,args:d,functionName:f});try{return yield(0,FR.getAction)(r,n,s)(v({data:`${h}${l?l.replace("0x",""):""}`,to:c,account:m},b))}catch(E){throw(0,HR.getContractError)(E,{abi:a,address:c,args:d,docsPath:"/docs/contract/writeContract",functionName:f,sender:m?.address})}})}e.internal=t})(zc||(Uc.writeContract=zc={}))});var sE=p(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.getContract=KR;di.getFunctionParameters=ci;di.getEventParameters=Dc;var Nn=ae(),UR=Wa(),LR=nm(),DR=gc(),$R=zt(),GR=o1(),VR=l1(),WR=Lc();function KR({abi:e,address:t,client:r}){let n=r,[s,o]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],a=s!=null,u=o!=null,c={},d=!1,l=!1,f=!1;for(let b of e)if(b.type==="function"?b.stateMutability==="view"||b.stateMutability==="pure"?d=!0:l=!0:b.type==="event"&&(f=!0),d&&l&&f)break;return a&&(d&&(c.read=new Proxy({},{get(b,m){return(...h)=>{let{args:_,options:E}=ci(h);return(0,Nn.getAction)(s,$R.readContract,"readContract")(v({abi:e,address:t,functionName:m,args:_},E))}}})),l&&(c.simulate=new Proxy({},{get(b,m){return(...h)=>{let{args:_,options:E}=ci(h);return(0,Nn.getAction)(s,GR.simulateContract,"simulateContract")(v({abi:e,address:t,functionName:m,args:_},E))}}})),f&&(c.createEventFilter=new Proxy({},{get(b,m){return(...h)=>{let _=e.find(q=>q.type==="event"&&q.name===m),{args:E,options:j}=Dc(h,_);return(0,Nn.getAction)(s,UR.createContractEventFilter,"createContractEventFilter")(v({abi:e,address:t,eventName:m,args:E},j))}}}),c.getEvents=new Proxy({},{get(b,m){return(...h)=>{let _=e.find(q=>q.type==="event"&&q.name===m),{args:E,options:j}=Dc(h,_);return(0,Nn.getAction)(s,DR.getContractEvents,"getContractEvents")(v({abi:e,address:t,eventName:m,args:E},j))}}}),c.watchEvent=new Proxy({},{get(b,m){return(...h)=>{let _=e.find(q=>q.type==="event"&&q.name===m),{args:E,options:j}=Dc(h,_);return(0,Nn.getAction)(s,VR.watchContractEvent,"watchContractEvent")(v({abi:e,address:t,eventName:m,args:E},j))}}}))),u&&l&&(c.write=new Proxy({},{get(b,m){return(...h)=>{let{args:_,options:E}=ci(h);return(0,Nn.getAction)(o,WR.writeContract,"writeContract")(v({abi:e,address:t,functionName:m,args:_},E))}}})),(a||u)&&l&&(c.estimateGas=new Proxy({},{get(b,m){return(...h)=>{let{args:_,options:E}=ci(h),j=s??o;return(0,Nn.getAction)(j,LR.estimateContractGas,"estimateContractGas")(B(v({abi:e,address:t,functionName:m,args:_},E),{account:E.account??o.account}))}}})),c.address=t,c.abi=e,c}function ci(e){let t=e.length&&Array.isArray(e[0]),r=t?e[0]:[],n=(t?e[1]:e[0])??{};return{args:r,options:n}}function Dc(e,t){let r=!1;Array.isArray(e[0])?r=!0:e.length===1?r=t.inputs.some(o=>o.indexed):e.length===2&&(r=!0);let n=r?e[0]:void 0,s=(r?e[1]:e[0])??{};return{args:n,options:s}}});var E1=p($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.BundleFailedError=void 0;var ZR=Q(),j1=class extends ZR.BaseError{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}};$c.BundleFailedError=j1});var fi=p(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});x1.withRetry=JR;var YR=kc();function JR(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((s,o)=>{let a=(...c)=>y(null,[...c],function*({count:u=0}={}){let d=f=>y(null,[f],function*({error:l}){let b=typeof t=="function"?t({count:u,error:l}):t;b&&(yield(0,YR.wait)(b)),a({count:u+1})});try{let l=yield e();s(l)}catch(l){if(u<r&&(yield n({count:u,error:l})))return d({error:l});o(l)}});a()})}});var Bs=p(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.defineTransactionReceipt=on.receiptStatuses=void 0;on.formatTransactionReceipt=oE;var XR=Ee(),QR=bs(),eM=Jt(),tM=ms();on.receiptStatuses={"0x0":"reverted","0x1":"success"};function oE(e,t){let r=B(v({},e),{blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>(0,eM.formatLog)(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,XR.hexToNumber)(e.transactionIndex):null,status:e.status?on.receiptStatuses[e.status]:null,type:e.type?tM.transactionType[e.type]||e.type:null});return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}on.defineTransactionReceipt=(0,QR.defineFormatter)("transactionReceipt",oE)});var Vc=p(Pr=>{"use strict";
44Object.defineProperty(Pr,"__esModule",{value:!0});Pr.fallbackTransactionErrorMagicIdentifier=Pr.fallbackMagicIdentifier=void 0;Pr.sendCalls=aM;var rM=xe(),iE=Q(),aE=yr(),nM=Qe(),uE=Oe(),sM=Ee(),Gc=U(),oM=ai(),iM=ui();Pr.fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792";Pr.fallbackTransactionErrorMagicIdentifier=(0,Gc.numberToHex)(0,{size:32});function aM(e,t){return y(this,null,function*(){let{account:r=e.account,capabilities:n,chain:s=e.chain,experimental_fallback:o,experimental_fallbackDelay:a=32,forceAtomic:u=!1,id:c,version:d="2.0.0"}=t,l=r?(0,rM.parseAccount)(r):null,f=t.calls.map(b=>{let m=b,h=m.abi?(0,nM.encodeFunctionData)({abi:m.abi,functionName:m.functionName,args:m.args}):m.data;return{data:m.dataSuffix&&h?(0,uE.concat)([h,m.dataSuffix]):h,to:m.to,value:m.value?(0,Gc.numberToHex)(m.value):void 0}});try{let b=yield e.request({method:"wallet_sendCalls",params:[{atomicRequired:u,calls:f,capabilities:n,chainId:(0,Gc.numberToHex)(s.id),from:l?.address,id:c,version:d}]},{retryCount:0});return typeof b=="string"?{id:b}:b}catch(b){let m=b;if(o&&(m.name==="MethodNotFoundRpcError"||m.name==="MethodNotSupportedRpcError"||m.name==="UnknownRpcError"||m.details.toLowerCase().includes("does not exist / is not available")||m.details.toLowerCase().includes("missing or invalid. request()")||m.details.toLowerCase().includes("did not match any variant of untagged enum")||m.details.toLowerCase().includes("account upgraded to unsupported contract")||m.details.toLowerCase().includes("eip-7702 not supported")||m.details.toLowerCase().includes("unsupported wc_ method")||m.details.toLowerCase().includes("feature toggled misconfigured")||m.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(n&&Object.values(n).some(q=>!q.optional)){let q="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new aE.UnsupportedNonOptionalCapabilityError(new iE.BaseError(q,{details:q}))}if(u&&f.length>1){let j="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new aE.AtomicityNotSupportedError(new iE.BaseError(j,{details:j}))}let h=[];for(let j of f){let q=(0,iM.sendTransaction)(e,{account:l,chain:s,data:j.data,to:j.to,value:j.value?(0,sM.hexToBigInt)(j.value):void 0});h.push(q),a>0&&(yield new Promise(T=>setTimeout(T,a)))}let _=yield Promise.allSettled(h);if(_.every(j=>j.status==="rejected"))throw _[0].reason;let E=_.map(j=>j.status==="fulfilled"?j.value:Pr.fallbackTransactionErrorMagicIdentifier);return{id:(0,uE.concat)([...E,(0,Gc.numberToHex)(s.id,{size:32}),Pr.fallbackMagicIdentifier])}}throw(0,oM.getTransactionError)(b,B(v({},t),{account:l,chain:t.chain}))}})}});var P1=p(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});w1.getCallsStatus=dM;var cE=mt(),uM=Vt(),Wc=Ee(),cM=Bs(),dE=Vc();function dM(e,t){return y(this,null,function*(){function r(f){return y(this,null,function*(){if(f.endsWith(dE.fallbackMagicIdentifier.slice(2))){let m=(0,uM.trim)((0,cE.sliceHex)(f,-64,-32)),h=(0,cE.sliceHex)(f,0,-64).slice(2).match(/.{1,64}/g),_=yield Promise.all(h.map(j=>dE.fallbackTransactionErrorMagicIdentifier.slice(2)!==j?e.request({method:"eth_getTransactionReceipt",params:[`0x${j}`]},{dedupe:!0}):void 0)),E=_.some(j=>j===null)?100:_.every(j=>j?.status==="0x1")?200:_.every(j=>j?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,Wc.hexToNumber)(m),receipts:_.filter(Boolean),status:E,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[f]})})}let l=yield r(t.id),{atomic:n=!1,chainId:s,receipts:o,version:a="2.0.0"}=l,u=G(l,["atomic","chainId","receipts","version"]),[c,d]=(()=>{let f=u.status;return f>=100&&f<200?["pending",f]:f>=200&&f<300?["success",f]:f>=300&&f<700?["failure",f]:f==="CONFIRMED"?["success",200]:f==="PENDING"?["pending",100]:[void 0,f]})();return B(v({},u),{atomic:n,chainId:s?(0,Wc.hexToNumber)(s):void 0,receipts:o?.map(f=>B(v({},f),{blockNumber:(0,Wc.hexToBigInt)(f.blockNumber),gasUsed:(0,Wc.hexToBigInt)(f.gasUsed),status:cM.receiptStatuses[f.status]}))??[],statusCode:d,status:c,version:a})})}});var Zc=p(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.WaitForCallsStatusTimeoutError=void 0;li.waitForCallsStatus=vM;var fM=Q(),lM=E1(),pM=ae(),bM=sn(),mM=kn(),yM=Ac(),gM=fi(),hM=Ce(),_M=P1();function vM(e,t){return y(this,null,function*(){let{id:r,pollingInterval:n=e.pollingInterval,status:s=({statusCode:_})=>_===200||_>=300,retryCount:o=4,retryDelay:a=({count:_})=>~~(1<<_)*200,timeout:u=6e4,throwOnFailure:c=!1}=t,d=(0,hM.stringify)(["waitForCallsStatus",e.uid,r]),{promise:l,resolve:f,reject:b}=(0,yM.withResolvers)(),m,h=(0,bM.observe)(d,{resolve:f,reject:b},_=>{let E=(0,mM.poll)(()=>y(null,null,function*(){let j=q=>{clearTimeout(m),E(),q(),h()};try{let q=yield(0,gM.withRetry)(()=>y(null,null,function*(){let T=yield(0,pM.getAction)(e,_M.getCallsStatus,"getCallsStatus")({id:r});if(c&&T.status==="failure")throw new lM.BundleFailedError(T);return T}),{retryCount:o,delay:a});if(!s(q))return;j(()=>_.resolve(q))}catch(q){j(()=>_.reject(q))}}),{interval:n,emitOnBegin:!0});return E});return m=u?setTimeout(()=>{h(),clearTimeout(m),b(new Kc({id:r}))},u):void 0,yield l})}var Kc=class extends fM.BaseError{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}};li.WaitForCallsStatusTimeoutError=Kc});var A1=p(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});T1.uid=jM;var q1=256,Yc=q1,Jc;function jM(e=11){if(!Jc||Yc+e>q1*2){Jc="",Yc=0;for(let t=0;t<q1;t++)Jc+=(256+Math.random()*256|0).toString(16).substring(1)}return Jc.substring(Yc,Yc+++e)}});var pi=p(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.createClient=wM;Xc.rpcSchema=PM;var EM=xe(),xM=A1();
44function wM(e){let{batch:t,chain:r,ccipRead:n,key:s="base",name:o="Base Client",type:a="base"}=e,u=e.experimental_blockTag??(typeof r?.experimental_preconfirmationTime=="number"?"pending":void 0),c=r?.blockTime??12e3,d=Math.min(Math.max(Math.floor(c/2),500),4e3),l=e.pollingInterval??d,f=e.cacheTime??l,b=e.account?(0,EM.parseAccount)(e.account):void 0,{config:m,request:h,value:_}=e.transport({chain:r,pollingInterval:l}),E=v(v({},m),_),j=v({account:b,batch:t,cacheTime:f,ccipRead:n,chain:r,key:s,name:o,pollingInterval:l,request:h,transport:E,type:a,uid:(0,xM.uid)()},u?{experimental_blockTag:u}:{});function q(T){return x=>{let A=x(T);for(let O in j)delete A[O];let I=v(v({},T),A);return Object.assign(I,{extend:q(I)})}}return Object.assign(j,{extend:q(j)})}function PM(){return null}});var Qc=p(I1=>{"use strict";Object.defineProperty(I1,"__esModule",{value:!0});I1.isNullUniversalResolverError=TM;var qM=Q(),fE=mr();function TM(e){if(!(e instanceof qM.BaseError))return!1;let t=e.walk(r=>r instanceof fE.ContractFunctionRevertedError);return t instanceof fE.ContractFunctionRevertedError?t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile":!1}});var B1=p(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});O1.encodedLabelToLabelhash=IM;var AM=$e();function IM(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;let t=`0x${e.slice(1,65)}`;return(0,AM.isHex)(t)?t:null}});var ed=p(S1=>{"use strict";Object.defineProperty(S1,"__esModule",{value:!0});S1.namehash=SM;var OM=Oe(),lE=de(),pE=U(),bE=Je(),BM=B1();function SM(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,pE.bytesToHex)(t);let r=e.split(".");for(let n=r.length-1;n>=0;n-=1){let s=(0,BM.encodedLabelToLabelhash)(r[n]),o=s?(0,lE.toBytes)(s):(0,bE.keccak256)((0,lE.stringToBytes)(r[n]),"bytes");t=(0,bE.keccak256)((0,OM.concat)([t,o]),"bytes")}return(0,pE.bytesToHex)(t)}});var mE=p(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});C1.encodeLabelhash=CM;function CM(e){return`[${e.slice(2)}]`}});var M1=p(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});R1.labelhash=HM;var RM=de(),MM=U(),kM=Je(),NM=B1();function HM(e){let t=new Uint8Array(32).fill(0);return e?(0,NM.encodedLabelToLabelhash)(e)||(0,kM.keccak256)((0,RM.stringToBytes)(e)):(0,MM.bytesToHex)(t)}});var td=p(N1=>{"use strict";Object.defineProperty(N1,"__esModule",{value:!0});N1.packetToBytes=UM;var k1=de(),FM=mE(),zM=M1();function UM(e){let t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);let r=new Uint8Array((0,k1.stringToBytes)(t).byteLength+2),n=0,s=t.split(".");for(let o=0;o<s.length;o++){let a=(0,k1.stringToBytes)(s[o]);a.byteLength>255&&(a=(0,k1.stringToBytes)((0,FM.encodeLabelhash)((0,zM.labelhash)(s[o])))),r[n]=a.length,r.set(a,n+1),n+=a.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}});var gE=p(F1=>{"use strict";Object.defineProperty(F1,"__esModule",{value:!0});F1.getEnsAddress=XM;var H1=jr(),LM=Xt(),DM=Qe(),$M=Er(),GM=Vt(),VM=U(),WM=Qc(),KM=ni(),yE=ed(),ZM=td(),YM=ae(),JM=zt();function XM(e,t){return y(this,null,function*(){let{blockNumber:r,blockTag:n,coinType:s,name:o,gatewayUrls:a,strict:u}=t,{chain:c}=e,d=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,$M.getChainContractAddress)({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(b=>o.endsWith(b)))return null;let f=s!=null?[(0,yE.namehash)(o),BigInt(s)]:[(0,yE.namehash)(o)];try{let b=(0,DM.encodeFunctionData)({abi:H1.addressResolverAbi,functionName:"addr",args:f}),m={address:d,abi:H1.universalResolverResolveAbi,functionName:"resolveWithGateways",args:[(0,VM.toHex)((0,ZM.packetToBytes)(o)),b,a??[KM.localBatchGatewayUrl]],blockNumber:r,blockTag:n},_=yield(0,YM.getAction)(e,JM.readContract,"readContract")(m);if(_[0]==="0x")return null;let E=(0,LM.decodeFunctionResult)({abi:H1.addressResolverAbi,args:f,functionName:"addr",data:_[0]});return E==="0x"||(0,GM.trim)(E)==="0x00"?null:E}catch(b){if(u)throw b;if((0,WM.isNullUniversalResolverError)(b))return null;throw b}})}});var rd=p(Ot=>{"use strict";
44Object.defineProperty(Ot,"__esModule",{value:!0});Ot.EnsInvalidChainIdError=Ot.EnsAvatarUnsupportedNamespaceError=Ot.EnsAvatarUriResolutionError=Ot.EnsAvatarInvalidNftUriError=Ot.EnsAvatarInvalidMetadataError=void 0;var bi=Q(),z1=class extends bi.BaseError{constructor({data:t}){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(t)}`],name:"EnsAvatarInvalidMetadataError"})}};Ot.EnsAvatarInvalidMetadataError=z1;var U1=class extends bi.BaseError{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}};Ot.EnsAvatarInvalidNftUriError=U1;var L1=class extends bi.BaseError{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}};Ot.EnsAvatarUriResolutionError=L1;var D1=class extends bi.BaseError{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}};Ot.EnsAvatarUnsupportedNamespaceError=D1;var $1=class extends bi.BaseError{constructor({chainId:t}){super(`Invalid ENSIP-11 chainId: ${t}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}};Ot.EnsInvalidChainIdError=$1});var xE=p(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.isImageUri=_E;or.getGateway=G1;or.resolveAvatarUri=vE;or.getJsonImage=jE;or.getMetadataAvatarUri=nk;or.parseAvatarUri=EE;or.parseNftUri=sk;or.getNftTokenUri=ok;var hE=zt(),sr=rd(),QM=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,ek=/^(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>\/.*)?$/,tk=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,rk=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;function _E(e){return y(this,null,function*(){try{let t=yield fetch(e,{method:"HEAD"});return t.status===200?t.headers.get("content-type")?.startsWith("image/"):!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{let n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}})}function G1(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function vE({uri:e,gatewayUrls:t}){let r=tk.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=G1(t?.ipfs,"https://ipfs.io"),s=G1(t?.arweave,"https://arweave.net"),o=e.match(QM),{protocol:a,subpath:u,target:c,subtarget:d=""}=o?.groups||{},l=a==="ipns:/"||u==="ipns/",f=a==="ipfs:/"||u==="ipfs/"||ek.test(e);if(e.startsWith("http")&&!l&&!f){let m=e;return t?.arweave&&(m=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:m,isOnChain:!1,isEncoded:!1}}if((l||f)&&c)return{uri:`${n}/${l?"ipns":"ipfs"}/${c}${d}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&c)return{uri:`${s}/${c}${d||""}`,isOnChain:!1,isEncoded:!1};let b=e.replace(rk,"");if(b.startsWith("<svg")&&(b=`data:image/svg+xml;base64,${btoa(b)}`),b.startsWith("data:")||b.startsWith("{"))return{uri:b,isOnChain:!0,isEncoded:!1};throw new sr.EnsAvatarUriResolutionError({uri:e})}function jE(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new sr.EnsAvatarInvalidMetadataError({data:e});return e.image||e.image_url||e.image_data}function nk(r){return y(this,arguments,function*({gatewayUrls:e,uri:t}){try{let n=yield fetch(t).then(o=>o.json());return yield EE({gatewayUrls:e,uri:jE(n)})}catch(n){throw new sr.EnsAvatarUriResolutionError({uri:t})}})}function EE(r){return y(this,arguments,function*({gatewayUrls:e,uri:t}){let{uri:n,isOnChain:s}=vE({uri:t,gatewayUrls:e});if(s||(yield _E(n)))return n;throw new sr.EnsAvatarUriResolutionError({uri:t})})}function sk(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[r,n,s]=t.split("/"),[o,a]=r.split(":"),[u,c]=n.split(":");if(!o||o.toLowerCase()!=="eip155")throw new sr.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!a)throw new sr.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!c)throw new sr.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!s)throw new sr.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!u)throw new sr.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:u.toLowerCase(),contractAddress:c,tokenID:s}}function ok(r,n){return y(this,arguments,function*(e,{nft:t}){if(t.namespace==="erc721")return(0,hE.readContract)(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}
44],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return(0,hE.readContract)(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new sr.EnsAvatarUnsupportedNamespaceError({namespace:t.namespace})})}});var wE=p(V1=>{"use strict";Object.defineProperty(V1,"__esModule",{value:!0});V1.parseAvatarRecord=ik;var Hn=xE();function ik(n,s){return y(this,arguments,function*(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?ak(e,{gatewayUrls:t,record:r}):(0,Hn.parseAvatarUri)({uri:r,gatewayUrls:t})})}function ak(n,s){return y(this,arguments,function*(e,{gatewayUrls:t,record:r}){let o=(0,Hn.parseNftUri)(r),a=yield(0,Hn.getNftTokenUri)(e,{nft:o}),{uri:u,isOnChain:c,isEncoded:d}=(0,Hn.resolveAvatarUri)({uri:a,gatewayUrls:t});if(c&&(u.includes("data:application/json;base64,")||u.startsWith("{"))){let f=d?atob(u.replace("data:application/json;base64,","")):u,b=JSON.parse(f);return(0,Hn.parseAvatarUri)({uri:(0,Hn.getJsonImage)(b),gatewayUrls:t})}let l=o.tokenID;return o.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),(0,Hn.getMetadataAvatarUri)({gatewayUrls:t,uri:u.replace(/(?:0x)?{id}/,l)})})}});var Z1=p(K1=>{"use strict";Object.defineProperty(K1,"__esModule",{value:!0});K1.getEnsText=hk;var W1=jr(),uk=Xt(),ck=Qe(),dk=Er(),fk=U(),lk=Qc(),pk=ni(),bk=ed(),mk=td(),yk=ae(),gk=zt();function hk(e,t){return y(this,null,function*(){let{blockNumber:r,blockTag:n,key:s,name:o,gatewayUrls:a,strict:u}=t,{chain:c}=e,d=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,dk.getChainContractAddress)({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(f=>o.endsWith(f)))return null;try{let f={address:d,abi:W1.universalResolverResolveAbi,args:[(0,fk.toHex)((0,mk.packetToBytes)(o)),(0,ck.encodeFunctionData)({abi:W1.textResolverAbi,functionName:"text",args:[(0,bk.namehash)(o),s]}),a??[pk.localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},m=yield(0,yk.getAction)(e,gk.readContract,"readContract")(f);if(m[0]==="0x")return null;let h=(0,uk.decodeFunctionResult)({abi:W1.textResolverAbi,functionName:"text",data:m[0]});return h===""?null:h}catch(f){if(u)throw f;if((0,lk.isNullUniversalResolverError)(f))return null;throw f}})}});var PE=p(Y1=>{"use strict";Object.defineProperty(Y1,"__esModule",{value:!0});Y1.getEnsAvatar=Ek;var _k=wE(),vk=ae(),jk=Z1();function Ek(c,d){return y(this,arguments,function*(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:s,gatewayUrls:o,strict:a,universalResolverAddress:u}){let l=yield(0,vk.getAction)(e,jk.getEnsText,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:s,universalResolverAddress:u,gatewayUrls:o,strict:a});if(!l)return null;try{return yield(0,_k.parseAvatarRecord)(e,{record:l,gatewayUrls:n})}catch(f){return null}})}});var qE=p(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});J1.getEnsName=Ik;var xk=jr(),wk=Er(),Pk=Qc(),qk=ni(),Tk=ae(),Ak=zt();function Ik(e,t){return y(this,null,function*(){let{address:r,blockNumber:n,blockTag:s,coinType:o=60n,gatewayUrls:a,strict:u}=t,{chain:c}=e,d=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,wk.getChainContractAddress)({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{let l={address:d,abi:xk.universalResolverReverseAbi,args:[r,o,a??[qk.localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:n,blockTag:s},f=(0,Tk.getAction)(e,Ak.readContract,"readContract"),[b]=yield f(l);return b||null}catch(l){if(u)throw l;if((0,Pk.isNullUniversalResolverError)(l))return null;throw l}})}});var TE=p(X1=>{"use strict";Object.defineProperty(X1,"__esModule",{value:!0});X1.getEnsResolver=Mk;var Ok=Er(),Bk=U(),Sk=td(),Ck=ae(),Rk=zt();function Mk(e,t){return y(this,null,function*(){let{blockNumber:r,blockTag:n,name:s}=t,{chain:o}=e,a=(()=>
44{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,Ok.getChainContractAddress)({blockNumber:r,chain:o,contract:"ensUniversalResolver"})})(),u=o?.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))throw new Error(`${s} is not a valid ENS TLD (${u?.join(", ")}) for chain "${o.name}" (id: ${o.id}).`);let[c]=yield(0,Ck.getAction)(e,Rk.readContract,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,Bk.toHex)((0,Sk.packetToBytes)(s))],blockNumber:r,blockTag:n});return c})}});var ey=p(Q1=>{"use strict";Object.defineProperty(Q1,"__esModule",{value:!0});Q1.createAccessList=Lk;var kk=xe(),Nk=U(),Hk=Tc(),Fk=Jr(),zk=Nt(),Uk=Ht();function Lk(e,t){return y(this,null,function*(){let E=t,{account:r=e.account,blockNumber:n,blockTag:s="latest",blobs:o,data:a,gas:u,gasPrice:c,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:f,to:b,value:m}=E,h=G(E,["account","blockNumber","blockTag","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","to","value"]),_=r?(0,kk.parseAccount)(r):void 0;try{(0,Uk.assertRequest)(t);let q=(typeof n=="bigint"?(0,Nk.numberToHex)(n):void 0)||s,T=e.chain?.formatters?.transactionRequest?.format,A=(T||zk.formatTransactionRequest)(B(v({},(0,Fk.extract)(h,{format:T})),{from:_?.address,blobs:o,data:a,gas:u,gasPrice:c,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:f,to:b,value:m}),"createAccessList"),I=yield e.request({method:"eth_createAccessList",params:[A,q]});return{accessList:I.accessList,gasUsed:BigInt(I.gasUsed)}}catch(j){throw(0,Hk.getCallError)(j,B(v({},t),{account:_,chain:e.chain}))}})}});var AE=p(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.createBlockFilter=$k;var Dk=Po();function $k(e){return y(this,null,function*(){let t=(0,Dk.createFilterRequestScope)(e,{method:"eth_newBlockFilter"}),r=yield e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}})}});var ny=p(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.createEventFilter=Wk;var Gk=zr(),IE=U(),Vk=Po();function Wk(c){return y(this,arguments,function*(e,{address:t,args:r,event:n,events:s,fromBlock:o,strict:a,toBlock:u}={}){let d=s??(n?[n]:void 0),l=(0,Vk.createFilterRequestScope)(e,{method:"eth_newFilter"}),f=[];d&&(f=[d.flatMap(h=>(0,Gk.encodeEventTopics)({abi:[h],eventName:h.name,args:r}))],n&&(f=f[0]));let b=yield e.request({method:"eth_newFilter",params:[v({address:t,fromBlock:typeof o=="bigint"?(0,IE.numberToHex)(o):o,toBlock:typeof u=="bigint"?(0,IE.numberToHex)(u):u},f.length?{topics:f}:{})]});return{abi:d,args:r,eventName:n?n.name:void 0,fromBlock:o,id:b,request:l(b),strict:!!a,toBlock:u,type:"event"}})}});var oy=p(sy=>{"use strict";Object.defineProperty(sy,"__esModule",{value:!0});sy.createPendingTransactionFilter=Zk;var Kk=Po();function Zk(e){return y(this,null,function*(){let t=(0,Kk.createFilterRequestScope)(e,{method:"eth_newPendingTransactionFilter"}),r=yield e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}})}});var OE=p(iy=>{"use strict";Object.defineProperty(iy,"__esModule",{value:!0});iy.getBalance=Jk;var Yk=U();function Jk(s,o){return y(this,arguments,function*(e,{address:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}){let a=typeof r=="bigint"?(0,Yk.numberToHex)(r):void 0,u=yield e.request({method:"eth_getBalance",params:[t,a||n]});return BigInt(u)})}});var BE=p(ay=>{"use strict";Object.defineProperty(ay,"__esModule",{value:!0});ay.getBlobBaseFee=Xk;function Xk(e){return y(this,null,function*(){let t=yield e.request({method:"eth_blobBaseFee"});return BigInt(t)})}});var SE=p(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.getBlockTransactionCount=tN;var Qk=Ee(),eN=U();function tN(s){return y(this,arguments,function*(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let o=r!==void 0?(0,eN.numberToHex)(r):void 0,a;return t?a=yield e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):a=yield e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||n]},{dedupe:!!o}),(0,Qk.hexToNumber)(a)})}});var dy=p(cy=>{"use strict";Object.defineProperty(cy,"__esModule",{value:!0});cy.getCode=nN;var rN=U();function nN(s,o){return y(this,arguments,function*(e,{address:t,blockNumber:r,blockTag:n="latest"}){let a=r!==void 0?(0,rN.numberToHex)(r):void 0,u=yield e.request({method:"eth_getCode",params:[t,a||n]},{dedupe:!!a});if(u!=="0x")return u})}});var CE=p(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.Eip712DomainNotFoundError=void 0;var sN=Q(),fy=class extends sN.BaseError{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}};nd.Eip712DomainNotFoundError=fy});var RE=p(ly=>{"use strict";Object.defineProperty(ly,"__esModule",{value:!0});ly.getEip712Domain=uN;var oN=CE(),iN=ae(),aN=zt();function uN(e,t){return y(this,null,function*(){let{address:r,factory:n,factoryData:s}=t;try{let[o,a,u,c,d,l,f]=yield(0,iN.getAction)(e,aN.readContract,"readContract")({abi:cN,address:r,functionName:"eip712Domain",factory:n,factoryData:s});return{domain:{name:a,version:u,chainId:Number(c),verifyingContract:d,salt:l},extensions:f,fields:o}}catch(o){let a=o;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new oN.Eip712DomainNotFoundError({address:r}):a}})}var cN=[{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"}]});var ME=p(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.formatFeeHistory=dN;function dN(e){return{baseFeePerGas:e.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.olde
44stBlock),reward:e.reward?.map(t=>t.map(r=>BigInt(r)))}}});var NE=p(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.getFeeHistory=lN;var kE=U(),fN=ME();function lN(o,a){return y(this,arguments,function*(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:s}){let u=typeof r=="bigint"?(0,kE.numberToHex)(r):void 0,c=yield e.request({method:"eth_feeHistory",params:[(0,kE.numberToHex)(t),u||n,s]},{dedupe:!!u});return(0,fN.formatFeeHistory)(c)})}});var HE=p(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.getFilterLogs=mN;var pN=_s(),bN=Jt();function mN(r,n){return y(this,arguments,function*(e,{filter:t}){let s=t.strict??!1,a=(yield t.request({method:"eth_getFilterLogs",params:[t.id]})).map(u=>(0,bN.formatLog)(u));return t.abi?(0,pN.parseEventLogs)({abi:t.abi,logs:a,strict:s}):a})}});var jy=p(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.encodePacked=hN;var _y=ge(),yN=jt(),gN=Xe(),FE=Oe(),yy=lr(),gy=U(),hy=jo();function hN(e,t){if(e.length!==t.length)throw new _y.AbiEncodingLengthMismatchError({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let s=e[n],o=t[n];r.push(zE(s,o))}return(0,FE.concatHex)(r)}function zE(e,t,r=!1){if(e==="address"){let a=t;if(!(0,gN.isAddress)(a))throw new yN.InvalidAddressError({address:a});return(0,yy.pad)(a.toLowerCase(),{size:r?32:null})}if(e==="string")return(0,gy.stringToHex)(t);if(e==="bytes")return t;if(e==="bool")return(0,yy.pad)((0,gy.boolToHex)(t),{size:r?32:1});let n=e.match(hy.integerRegex);if(n){let[a,u,c="256"]=n,d=Number.parseInt(c,10)/8;return(0,gy.numberToHex)(t,{size:r?32:d,signed:u==="int"})}let s=e.match(hy.bytesRegex);if(s){let[a,u]=s;if(Number.parseInt(u,10)!==(t.length-2)/2)throw new _y.BytesSizeMismatchError({expectedSize:Number.parseInt(u,10),givenSize:(t.length-2)/2});return(0,yy.pad)(t,{dir:"right",size:r?32:null})}let o=e.match(hy.arrayRegex);if(o&&Array.isArray(t)){let[a,u]=o,c=[];for(let d=0;d<t.length;d++)c.push(zE(u,t[d],!0));return c.length===0?"0x":(0,FE.concatHex)(c)}throw new _y.UnsupportedPackedAbiType(e)}});var sd=p(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.isBytes=_N;function _N(e){return!e||typeof e!="object"||!("BYTES_PER_ELEMENT"in e)?!1:e.BYTES_PER_ELEMENT===1&&e.constructor.name==="Uint8Array"}});var wy=p(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.getContractAddress=wN;mi.getCreateAddress=LE;mi.getCreate2Address=DE;var vN=Oe(),UE=sd(),jN=lr(),EN=mt(),Ss=de(),xN=fs(),xy=Je(),od=rt();function wN(e){return e.opcode==="CREATE2"?DE(e):LE(e)}function LE(e){let t=(0,Ss.toBytes)((0,od.getAddress)(e.from)),r=(0,Ss.toBytes)(e.nonce);return r[0]===0&&(r=new Uint8Array([])),(0,od.getAddress)(`0x${(0,xy.keccak256)((0,xN.toRlp)([t,r],"bytes")).slice(26)}`)}function DE(e){let t=(0,Ss.toBytes)((0,od.getAddress)(e.from)),r=(0,jN.pad)((0,UE.isBytes)(e.salt)?e.salt:(0,Ss.toBytes)(e.salt),{size:32}),n="bytecodeHash"in e?(0,UE.isBytes)(e.bytecodeHash)?e.bytecodeHash:(0,Ss.toBytes)(e.bytecodeHash):(0,xy.keccak256)(e.bytecode,"bytes");return(0,od.getAddress)((0,EN.slice)((0,xy.keccak256)((0,vN.concat)([(0,Ss.toBytes)("0xff"),t,r,n])),12))}});var yi=p(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.assertTransactionEIP7702=IN;Fn.assertTransactionEIP4844=ON;Fn.assertTransactionEIP1559=Ty;Fn.assertTransactionEIP2930=BN;Fn.assertTransactionLegacy=SN;var PN=$b(),qy=nc(),ad=jt(),$E=Q(),Py=Zb(),ud=ws(),id=Kt(),cd=Xe(),qN=Ye(),TN=mt(),AN=Ee();function IN(e){let{authorizationList:t}=e;if(t)for(let r of t){let{chainId:n}=r,s=r.address;if(!(0,cd.isAddress)(s))throw new ad.InvalidAddressError({address:s});if(n<0)throw new ud.InvalidChainIdError({chainId:n})}Ty(e)}function ON(e){let{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Py.EmptyBlobError;for(let r of t){let n=(0,qN.size)(r),s=(0,AN.hexToNumber)((0,TN.slice)(r,0,1));if(n!==32)throw new Py.InvalidVersionedHashSizeError({hash:r,size:n});if(s!==PN.versionedHashVersionKzg)throw new Py.InvalidVersionedHashVersionError({hash:r,version:s})}}Ty(e)}function Ty(e){let{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:s}=e;if(t<=0)throw new ud.InvalidChainIdError({chainId:t});if(s&&!(0,cd.isAddress)(s))throw new ad.InvalidAddressError({address:s});if(n&&n>qy.maxUint256)throw new id.FeeCapTooHighError({maxFeePerGas:n});if(r&&n&&r>n)throw new id.TipAboveFeeCapError({maxFeePerGas:n,maxPriorityFeePerGas:r})}function BN(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:s,to:o}=e;if(t<=0)throw new ud.InvalidChainIdError({chainId:t});if(o&&!(0,cd.isAddress)(o))throw new ad.InvalidAddressError({address:o});if(r||s)throw new $E.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>qy.maxUint256)throw new id.FeeCapTooHighError({maxFeePerGas:n})}function SN(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:s,to:o}=e;if(o&&!(0,cd.isAddress)(o))throw new ad.InvalidAddressError({address:o});if(typeof t<"u"&&t<=0)throw new ud.InvalidChainIdError({chainId:t});if(r||s)throw new $E.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>qy.maxUint256)throw new id.FeeCapTooHighError({maxFeePerGas:n})}});var dd=p(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.serializeAccessList=kN;var CN=jt(),RN=Ge(),MN=Xe();function kN(e){if(!e||e.length===0)return[];let t=[];for(let r=0;r<e.length;r++){let{address:n,storageKeys:s}=e[r];for(let o=0;o<s.length;o++)if(s[o].length-2!==64)throw new RN.InvalidStorageKeySizeError({storageKey:s[o]});if(!(0,MN.isAddress)(n,{strict:!1}))throw new CN.InvalidAddressError({address:n});t.push([n,s])}return t}});var _i=p(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.serializeTransaction=$N;bd.toYParitySignatureArray=hi;var NN=Ge(),HN=Iy(),FN=Vo(),zN=Wo(),UN=fc(),LN=Zo(),ld=Oe(),fd=Vt(),re=U(),Cs=fs(),gi=yi(),DN=Yo(),pd=dd();function $N(e,t){let r=(0,DN.getTransactionType)(e);return r==="eip1559"?WN(e,t):r==="eip2930"?KN(e,t):r==="eip4844"?VN(e,t):r==="eip7702"?GN(e,t):ZN(e,t)}function GN(e,t){let{authorizationList:r,chainId:n,gas:s,nonce:o,to:a,value:u,maxFeePerGas:c,maxPriorityFeePerGas:d,accessList:l,data:f}=e;(0,gi.assertTransactionEIP7702)(e);let b=(0,pd.serializeAccessList)(l),m=(0,HN.serializeAuthorizationList)(r);return(0,ld.concatHex)(["0x04",(0,Cs.toRlp)([(0,re.numberToHex)(n),o?(0,re.numberToHex)(o):"0x",d?(0,re.numberToHex)(d):"0x",c?(0,re.numberToHex)(c):"0x",s?(0,re.numberToHex)(s):"0x",a??"0x",u?(0,re.numberToHex)(u):"0x",f??"0x",b,m,...hi(e,t)])])}function VN(e,t){let{chainId:r,gas:n,nonce:s,to:o,value:a,maxFeePerBlobGas:u,maxFeePerGas:c,maxPriorityFeePerGas:d,accessList:l,data:f}=e;(0,gi.assertTransactionEIP4844)(e);let b=e.blobVersionedHashes,m=e.sidecars;if(e.blobs&&(typeof b>"u"||typeof m>"u")){let T=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(I=>(0,re.bytesToHex)(I)),x=e.kzg,A=(0,FN.blobsToCommitments)({blobs:T,kzg:x});if(typeof b>"u"&&(b=(0,UN.commitmentsToVersionedHashes)({commitments:A})),typeof m>"u"){let I=(0,zN.blobsToProofs)({blobs:T,commitments:A,kzg:x});m=(0,LN.toBlobSidecars)({blobs:T,commitments:A,proofs:I})}}let h=(0,pd.serializeAccessList)(l),_=[(0,re.numberToHex)(r),s?(0,re.numberToHex)(s):"0x",d?(0,re.numberToHex)(d):"0x",c?(0,re.numberToHex)(c):"0x",n?(0,re.numberToHex)(n):"0x",o??"0x",a?(0,re.numberToHex)(a):"0x",f??"0x",h,u?(0,re.numberToHex)(u):"0x",b??[],...hi(e,t)],E=[],j=[],q=[];if(m)for(let T=0;T<m.length;T++){let{blob:x,commitment:A,proof:I}=m[T];E.push(x),j.push(A),q.push(I)}return(0,ld.concatHex)(["0x03",m?(0,Cs.toRlp)([_,E,j,q]):(0,Cs.toRlp)(_)])}function WN(e,t){let{chainId:r,gas:n,nonce:s,to:o,value:a,maxFeePerGas:u,maxPriorityFeePerGas:c,accessList:d,data:l}=e;(0,gi.assertTransactionEIP1559)(e);let f=(0,pd.serializeAccessList)(d),b=[(0,re.numberToHex)(r),s?(0,re.numberToHex)(s):"0x",c?(0,re.numberToHex)(c):"0x",u?(0,re.numberToHex)(u):"0x",n?(0,re.numberToHex)(n):"0x",o??"0x",a?(0,re.numberToHex)(a):"0x",l??"0x",f,...hi(e,t)];return(0,ld.concatHex)(["0x02",(0,Cs.toRlp)(b)])}function KN(e,t){let{chainId:r,gas:n,data:s,nonce:o,to:a,value:u,accessList:c,gasPrice:d}=e;(0,gi.assertTransactionEIP2930)(e);let l=(0,pd.serializeAccessList)(c),f=[(0,re.numberToHex)(r),o?(0,re.numberToHex)(o):"0x",d?(0,re.numberToHex)(d):"0x",n?(0,re.numberToHex)(n):"0x",a??"0x",u?(0,re.numberToHex)(u):"0x",s??"0x",l,...hi(e,t)];return(0,ld.concatHex)(["0x01",(0,Cs.toRlp)(f)])}function ZN(e,t){let{chainId:r=0,gas:n,data:s,nonce:o,to:a,value:u,gasPrice:c}=e;(0,gi.assertTransactionLegacy)(e);let d=[o?(0,re.numberToHex)(o):"0x",c?(0,re.numberToHex)(c):"0x",n?(0,re.numberToHex)(n):"0x",a??"0x",u?(0,re.numberToHex)(u):"0x",s??"0x"];if(t){let l=(()=>
44{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);let m=27n+(t.v===27n?0n:1n);if(t.v!==m)throw new NN.InvalidLegacyVError({v:t.v});return m})(),f=(0,fd.trim)(t.r),b=(0,fd.trim)(t.s);d=[...d,(0,re.numberToHex)(l),f==="0x00"?"0x":f,b==="0x00"?"0x":b]}else r>0&&(d=[...d,(0,re.numberToHex)(r),"0x","0x"]);return(0,Cs.toRlp)(d)}function hi(e,t){let r=t??e,{v:n,yParity:s}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof s>"u")return[];let o=(0,fd.trim)(r.r),a=(0,fd.trim)(r.s);return[typeof s=="number"?s?(0,re.numberToHex)(1):"0x":n===0n?"0x":n===1n?(0,re.numberToHex)(1):n===27n?"0x":(0,re.numberToHex)(1),o==="0x00"?"0x":o,a==="0x00"?"0x":a]}});var Iy=p(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0});Oy.serializeAuthorizationList=JN;var GE=U(),YN=_i();function JN(e){if(!e||e.length===0)return[];let t=[];for(let n of e){let r=n,{chainId:s,nonce:o}=r,a=G(r,["chainId","nonce"]),u=n.address;t.push([s?(0,GE.toHex)(s):"0x",u,o?(0,GE.toHex)(o):"0x",...(0,YN.toYParitySignatureArray)({},a)])}return t}});var Sy=p(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0});By.verifyAuthorization=tH;var XN=rt(),QN=Tt(),eH=ls();function tH(n){return y(this,arguments,function*({address:e,authorization:t,signature:r}){return(0,QN.isAddressEqual)((0,XN.getAddress)(e),yield(0,eH.recoverAuthorizationAddress)({authorization:t,signature:r}))})}});var VE=p(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.promiseCache=void 0;qr.withDedupe=nH;var rH=qn();qr.promiseCache=new rH.LruMap(8192);function nH(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(qr.promiseCache.get(r))return qr.promiseCache.get(r);let n=e().finally(()=>qr.promiseCache.delete(r));return qr.promiseCache.set(r,n),n}});var Cy=p(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.buildRequest=cH;md.shouldRetry=KE;var sH=Q(),WE=Pt(),W=yr(),oH=U(),iH=VE(),aH=fi(),uH=Ce();function cH(e,t={}){return(s,...o)=>y(null,[s,...o],function*(r,n={}){let{dedupe:a=!1,methods:u,retryDelay:c=150,retryCount:d=3,uid:l}=v(v({},t),n),{method:f}=r;if(u?.exclude?.includes(f))throw new W.MethodNotSupportedRpcError(new Error("method not supported"),{method:f});if(u?.include&&!u.include.includes(f))throw new W.MethodNotSupportedRpcError(new Error("method not supported"),{method:f});let b=a?(0,oH.stringToHex)(`${l}.${(0,uH.stringify)(r)}`):void 0;return(0,iH.withDedupe)(()=>(0,aH.withRetry)(()=>y(null,null,function*(){try{return yield e(r)}catch(m){let h=m;switch(h.code){case W.ParseRpcError.code:throw new W.ParseRpcError(h);case W.InvalidRequestRpcError.code:throw new W.InvalidRequestRpcError(h);case W.MethodNotFoundRpcError.code:throw new W.MethodNotFoundRpcError(h,{method:r.method});case W.InvalidParamsRpcError.code:throw new W.InvalidParamsRpcError(h);case W.InternalRpcError.code:throw new W.InternalRpcError(h);case W.InvalidInputRpcError.code:throw new W.InvalidInputRpcError(h);case W.ResourceNotFoundRpcError.code:throw new W.ResourceNotFoundRpcError(h);case W.ResourceUnavailableRpcError.code:throw new W.ResourceUnavailableRpcError(h);case W.TransactionRejectedRpcError.code:throw new W.TransactionRejectedRpcError(h);case W.MethodNotSupportedRpcError.code:throw new W.MethodNotSupportedRpcError(h,{method:r.method});case W.LimitExceededRpcError.code:throw new W.LimitExceededRpcError(h);case W.JsonRpcVersionUnsupportedError.code:throw new W.JsonRpcVersionUnsupportedError(h);case W.UserRejectedRequestError.code:throw new W.UserRejectedRequestError(h);case W.UnauthorizedProviderError.code:throw new W.UnauthorizedProviderError(h);case W.UnsupportedProviderMethodError.code:throw new W.UnsupportedProviderMethodError(h);case W.ProviderDisconnectedError.code:throw new W.ProviderDisconnectedError(h);case W.ChainDisconnectedError.code:throw new W.ChainDisconnectedError(h);case W.SwitchChainError.code:throw new W.SwitchChainError(h);case W.UnsupportedNonOptionalCapabilityError.code:throw new W.UnsupportedNonOptionalCapabilityError(h);case W.UnsupportedChainIdError.code:throw new W.UnsupportedChainIdError(h);case W.DuplicateIdError.code:throw new W.DuplicateIdError(h);case W.UnknownBundleIdError.code:throw new W.UnknownBundleIdError(h);case W.BundleTooLargeError.code:throw new W.BundleTooLargeError(h);case W.AtomicReadyWalletRejectedUpgradeError.code:throw new W.AtomicReadyWalletRejectedUpgradeError(h);case W.AtomicityNotSupportedError.code:throw new W.AtomicityNotSupportedError(h);case 5e3:throw new W.UserRejectedRequestError(h);default:throw m instanceof sH.BaseError?m:new W.UnknownRpcError(h)}}}),{delay:({count:m,error:h})=>{if(h&&h instanceof WE.HttpRequestError){let _=h?.headers?.get("Retry-After");if(_?.match(/\d/))return Number.parseInt(_,10)*1e3}return~~(1<<m)*c},retryCount:d,shouldRetry:({error:m})=>KE(m)}),{enabled:a,id:b})})}function KE(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===W.LimitExceededRpcError.code||e.code===W.InternalRpcError.code:e instanceof WE.HttpRequestError&&e.status?e.status===403||e.status===408||e.status===4
4413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}});var My=p(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});Ry.defineChain=dH;function dH(e){return v({formatters:void 0,fees:void 0,serializers:void 0},e)}});var Ny=p(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0});ky.extractChain=fH;function fH({chains:e,id:t}){return e.find(r=>r.id===t)}});var yd=p(Hy=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});Hy.fromRlp=yH;var lH=Q(),pH=En(),bH=rs(),mH=de(),ZE=U();function yH(e,t="hex"){let r=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new pH.InvalidHexValueError(e);return(0,mH.hexToBytes)(e)}return e})(),n=(0,bH.createCursor)(r,{recursiveReadLimit:Number.POSITIVE_INFINITY});return JE(n,t)}function JE(e,t="hex"){if(e.bytes.length===0)return t==="hex"?(0,ZE.bytesToHex)(e.bytes):e.bytes;let r=e.readByte();if(r<128&&e.decrementPosition(1),r<192){let s=YE(e,r,128),o=e.readBytes(s);return t==="hex"?(0,ZE.bytesToHex)(o):o}let n=YE(e,r,192);return gH(e,n,t)}function YE(e,t,r){if(r===128&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new lH.BaseError("Invalid RLP prefix")}function gH(e,t,r){let n=e.position,s=[];for(;e.position-n<t;)s.push(JE(e,r));return s}});var gd=p(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.isHash=vH;var hH=$e(),_H=Ye();function vH(e){return(0,hH.isHex)(e)&&(0,_H.size)(e)===32}});var Uy=p(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});zy.ripemd160=PH;var jH=s5(),EH=$e(),xH=de(),wH=U();function PH(e,t){let r=t||"hex",n=(0,jH.ripemd160)((0,EH.isHex)(e,{strict:!1})?(0,xH.toBytes)(e):e);return r==="bytes"?n:(0,wH.toHex)(n)}});var Ly=p(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.toEventHash=void 0;var qH=ho();Object.defineProperty(hd,"toEventHash",{enumerable:!0,get:function(){return qH.toSignatureHash}})});var Dy=p(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.toEventSignature=void 0;var TH=Ha();Object.defineProperty(_d,"toEventSignature",{enumerable:!0,get:function(){return TH.toSignature}})});var $y=p(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.toFunctionHash=void 0;var AH=ho();Object.defineProperty(vd,"toFunctionHash",{enumerable:!0,get:function(){return AH.toSignatureHash}})});var Gy=p(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.toFunctionSignature=void 0;var IH=Ha();Object.defineProperty(jd,"toFunctionSignature",{enumerable:!0,get:function(){return IH.toSignature}})});var Vy=p(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.nonceManager=void 0;Rs.createNonceManager=XE;Rs.jsonRpc=QE;var OH=Go(),BH=qn();function XE(e){let{source:t}=e,r=new Map,n=new BH.LruMap(8192),s=new Map,o=({address:u,chainId:c})=>`${u}.${c}`;return{consume(l){return y(this,arguments,function*({address:u,chainId:c,client:d}){let f=o({address:u,chainId:c}),b=this.get({address:u,chainId:c,client:d});this.increment({address:u,chainId:c});let m=yield b;return yield t.set({address:u,chainId:c},m),n.set(f,m),m})},increment(d){return y(this,arguments,function*({address:u,chainId:c}){let l=o({address:u,chainId:c}),f=r.get(l)??0;r.set(l,f+1)})},get(l){return y(this,arguments,function*({address:u,chainId:c,client:d}){let f=o({address:u,chainId:c}),b=s.get(f);return b||(b=y(this,null,function*(){try{let h=yield t.get({address:u,chainId:c,client:d}),_=n.get(f)??0;return _>0&&h<=_?_+1:(n.delete(f),h)}finally{this.reset({address:u,chainId:c})}}),s.set(f,b)),(r.get(f)??0)+(yield b)})},reset({address:u,chainId:c}){let d=o({address:u,chainId:c});r.delete(d),s.delete(d)}}}function QE(){return{get(t){return y(this,null,function*(){let{address:r,client:n}=t;return(0,OH.getTransactionCount)(n,{address:r,blockTag:"pending"})})},set(){}}}Rs.nonceManager=XE({source:QE()})});var Ed=p(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy.withTimeout=SH;function SH(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((s,o)=>{y(null,null,function*(){let a;try{let u=new AbortController;r>0&&(a=setTimeout(()=>{n?u.abort():o(t)},r)),s(yield e({signal:u?.signal||null}))}catch(u){u?.name==="AbortError"&&o(t),o(u)}finally{clearTimeout(a)}})})}});var Ky=p(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.idCache=void 0;function CH(){return{current:0,take(){return this.current++},reset(){this.current=0}}}
44xd.idCache=CH()});var wd=p(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.getHttpRpcClient=MH;var vi=Pt(),RH=Ed(),Zy=Ce(),ex=Ky();function MH(e,t={}){return{request(n){return y(this,null,function*(){let{body:s,fetchFn:o=t.fetchFn??fetch,onRequest:a=t.onRequest,onResponse:u=t.onResponse,timeout:c=t.timeout??1e4}=n,d=v(v({},t.fetchOptions??{}),n.fetchOptions??{}),{headers:l,method:f,signal:b}=d;try{let m=yield(0,RH.withTimeout)(E=>y(null,[E],function*({signal:_}){let j=B(v({},d),{body:Array.isArray(s)?(0,Zy.stringify)(s.map(A=>v({jsonrpc:"2.0",id:A.id??ex.idCache.take()},A))):(0,Zy.stringify)(v({jsonrpc:"2.0",id:s.id??ex.idCache.take()},s)),headers:v({"Content-Type":"application/json"},l),method:f||"POST",signal:b||(c>0?_:null)}),q=new Request(e,j),T=(yield a?.(q,j))??B(v({},j),{url:e});return yield o(T.url??e,T)}),{errorInstance:new vi.TimeoutError({body:s,url:e}),timeout:c,signal:!0});u&&(yield u(m));let h;if(m.headers.get("Content-Type")?.startsWith("application/json"))h=yield m.json();else{h=yield m.text();try{h=JSON.parse(h||"{}")}catch(_){if(m.ok)throw _;h={error:h}}}if(!m.ok)throw new vi.HttpRequestError({body:s,details:(0,Zy.stringify)(h.error)||m.statusText,headers:m.headers,status:m.status,url:e});return h}catch(m){throw m instanceof vi.HttpRequestError||m instanceof vi.TimeoutError?m:new vi.HttpRequestError({body:s,cause:m,url:e})}})}}}});var Xy=p(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.socketClientCache=void 0;
44an.getSocketRpcClient=FH;var Jy=Pt(),kH=Ic(),NH=Ed(),HH=Ky();an.socketClientCache=new Map;function FH(e){return y(this,null,function*(){let{getSocket:t,keepAlive:r=!0,key:n="socket",reconnect:s=!0,url:o}=e,{interval:a=3e4}=typeof r=="object"?r:{},{attempts:u=5,delay:c=2e3}=typeof s=="object"?s:{},d=JSON.stringify({keepAlive:r,key:n,url:o,reconnect:s}),l=an.socketClientCache.get(d);if(l)return l;let f=0,{schedule:b}=(0,kH.createBatchScheduler)({id:d,fn:()=>y(null,null,function*(){let _=new Map,E=new Map,j,q,T,x=!1;function A(){if(s&&f<u){if(x)return;x=!0,f++,q?.close(),setTimeout(()=>y(null,null,function*(){yield I().catch(console.error),x=!1}),c)}else _.clear(),E.clear()}function I(){return y(this,null,function*(){let O=yield t({onClose(){for(let S of _.values())S.onError?.(new Jy.SocketClosedError({url:o}));for(let S of E.values())S.onError?.(new Jy.SocketClosedError({url:o}));A()},onError(S){j=S;for(let C of _.values())C.onError?.(j);for(let C of E.values())C.onError?.(j);A()},onOpen(){j=void 0,f=0},onResponse(S){let C=S.method==="eth_subscription",M=C?S.params.subscription:S.id,N=C?E:_,F=N.get(M);F&&F.onResponse(S),C||N.delete(M)}});if(q=O,r&&(T&&clearInterval(T),T=setInterval(()=>q.ping?.(),a)),s&&E.size>0){let S=E.entries();for(let[C,{onResponse:M,body:N,onError:F}]of S)N&&(E.delete(C),l?.request({body:N,onResponse:M,onError:F}))}return O})}return yield I(),j=void 0,l={close(){T&&clearInterval(T),q.close(),an.socketClientCache.delete(d)},get socket(){return q},request({body:O,onError:S,onResponse:C}){j&&S&&S(j);let M=O.id??HH.idCache.take(),N=F=>{typeof F.id=="number"&&M!==F.id||(O.method==="eth_subscribe"&&typeof F.result=="string"&&E.set(F.result,{onResponse:N,onError:S,body:O}),O.method==="eth_unsubscribe"&&E.delete(O.params?.[0]),C(F))};_.set(M,{onResponse:N,onError:S});try{q.request({body:v({jsonrpc:"2.0",id:M},O)})}catch(F){S?.(F)}},requestAsync({body:O,timeout:S=1e4}){return(0,NH.withTimeout)(()=>new Promise((C,M)=>this.request({body:O,onError:M,onResponse:C})),{errorInstance:new Jy.TimeoutError({body:O,url:o}),timeout:S})},requests:_,subscriptions:E,url:o},an.socketClientCache.set(d,l),[l]})}),[m,[h]]=yield b();return h})}});var qd=p(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.getWebSocketRpcClient=UH;var Pd=Pt(),zH=Xy();function UH(r){return y(this,arguments,function*(e,t={}){let{keepAlive:n,reconnect:s}=t;return(0,zH.getSocketRpcClient)({getSocket(l){return y(this,arguments,function*({onClose:a,onError:u,onOpen:c,onResponse:d}){let f=yield Promise.resolve().then(()=>(Eq(),vq(jq))).then(E=>E.WebSocket),b=new f(e);function m(){b.removeEventListener("close",m),b.removeEventListener("message",h),b.removeEventListener("error",u),b.removeEventListener("open",c),a()}function h({data:E}){if(!(typeof E=="string"&&E.trim().length===0))try{let j=JSON.parse(E);d(j)}catch(j){u(j)}}b.addEventListener("close",m),b.addEventListener("message",h),b.addEventListener("error",u),b.addEventListener("open",c),b.readyState===f.CONNECTING&&(yield new Promise((E,j)=>{b&&(b.onopen=E,b.onerror=j)}));let{close:_}=b;return Object.assign(b,{close(){_.bind(b)(),m()},ping(){try{if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new Pd.WebSocketRequestError({url:b.url,cause:new Pd.SocketClosedError({url:b.url})});let E={jsonrpc:"2.0",id:null,method:"net_version",params:[]};b.send(JSON.stringify(E))}catch(E){u(E)}},request({body:E}){if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new Pd.WebSocketRequestError({body:E,url:b.url,cause:new Pd.SocketClosedError({url:b.url})});return b.send(JSON.stringify(E))}})})},keepAlive:n,reconnect:s,url:e})})}});var eg=p(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.rpc=void 0;ji.getSocket=VH;var LH=wd(),DH=qd();function $H(e,{body:t,onError:r,onResponse:n}){return e.request({body:t,onError:r,onResponse:n}),e}function GH(n,s){return y(this,arguments,function*(e,{body:t,timeout:r=1e4}){return e.requestAsync({body:t,timeout:r})})}function VH(e){return y(this,null,function*(){let t=yield(0,DH.getWebSocketRpcClient)(e);return Object.assign(t.socket,{requests:t.requests,subscriptions:t.subscriptions})})}ji.rpc={http(e,t){return(0,LH.getHttpRpcClient)(e).request(t)}
44,webSocket:$H,webSocketAsync:GH}});var tg=p(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});Td.presignMessagePrefix=void 0;Td.presignMessagePrefix=`�Ethereum Signed Message: 45`});var sg=p(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.toPrefixedMessage=YH;var WH=tg(),KH=Oe(),ZH=Ye(),rg=U();function YH(e){let t=typeof e=="string"?(0,rg.stringToHex)(e):typeof e.raw=="string"?e.raw:(0,rg.bytesToHex)(e.raw),r=(0,rg.stringToHex)(`${WH.presignMessagePrefix}${(0,ZH.size)(t)}`);return(0,KH.concat)([r,t])}});var Ms=p(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});og.hashMessage=QH;var JH=Je(),XH=sg();function QH(e,t){return(0,JH.keccak256)((0,XH.toPrefixedMessage)(e),t)}});var dg=p(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.InvalidStructTypeError=un.InvalidPrimaryTypeError=un.InvalidDomainError=void 0;var eF=Ce(),cg=Q(),ig=class extends cg.BaseError{constructor({domain:t}){super(`Invalid domain "${(0,eF.stringify)(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}};un.InvalidDomainError=ig;var ag=class extends cg.BaseError{constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}};un.InvalidPrimaryTypeError=ag;var ug=class extends cg.BaseError{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}};un.InvalidStructTypeError=ug});var Ei=p(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.serializeTypedData=aF;ks.validateTypedData=uF;ks.getTypesForEIP712Domain=nx;ks.domainSeparator=cF;var tF=ge(),rF=jt(),fg=dg(),nF=Xe(),tx=Ye(),sF=U(),rx=jo(),oF=Ns(),iF=Ce();function aF(e){let{domain:t,message:r,primaryType:n,types:s}=e,o=(c,d)=>{let l=v({},d);for(let f of c){let{name:b,type:m}=f;m==="address"&&(l[b]=l[b].toLowerCase())}return l},a=s.EIP712Domain?t?o(s.EIP712Domain,t):{}:{},u=(()=>{if(n!=="EIP712Domain")return o(s[n],r)})();return(0,iF.stringify)({domain:a,message:u,primaryType:n,types:s})}function uF(e){let{domain:t,message:r,primaryType:n,types:s}=e,o=(a,u)=>{for(let c of a){let{name:d,type:l}=c,f=u[d],b=l.match(rx.integerRegex);if(b&&(typeof f=="number"||typeof f=="bigint")){let[_,E,j]=b;(0,sF.numberToHex)(f,{signed:E==="int",size:Number.parseInt(j,10)/8})}if(l==="address"&&typeof f=="string"&&!(0,nF.isAddress)(f))throw new rF.InvalidAddressError({address:f});let m=l.match(rx.bytesRegex);if(m){let[_,E]=m;if(E&&(0,tx.size)(f)!==Number.parseInt(E,10))throw new tF.BytesSizeMismatchError({expectedSize:Number.parseInt(E,10),givenSize:(0,tx.size)(f)})}let h=s[l];h&&(dF(l),o(h,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new fg.InvalidDomainError({domain:t});o(s.EIP712Domain,t)}if(n!=="EIP712Domain")if(s[n])o(s[n],r);else throw new fg.InvalidPrimaryTypeError({primaryType:n,types:s})}function nx({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId=="number"||typeof e?.chainId=="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function cF({domain:e}){return(0,oF.hashDomain)({domain:e,types:{EIP712Domain:nx({domain:e})}})}function dF(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new fg.InvalidStructTypeError({type:e})}});var Ns=p(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.hashTypedData=lF;Hs.hashDomain=ax;Hs.hashStruct=lg;Hs.encodeType=cx;var ox=Et(),fF=Oe(),ix=U(),zn=Je(),sx=Ei();function lF(e){let{domain:t={},message:r,primaryType:n}=e,s=v({EIP712Domain:(0,sx.getTypesForEIP712Domain)({domain:t})},e.types);(0,sx.validateTypedData)({domain:t,message:r,primaryType:n,types:s});let o=["0x1901"];return t&&o.push(ax({domain:t,types:s})),n!=="EIP712Domain"&&o.push(lg({data:r,primaryType:n,types:s})),(0,zn.keccak256)((0,fF.concat)(o))}function ax({domain:e,types:t}){return lg({data:e,primaryType:"EIP712Domain",types:t})}function lg({data:e,primaryType:t,types:r}){let n=ux({data:e,primaryType:t,types:r});return(0,zn.keccak256)(n)}function ux({data:e,primaryType:t,types:r}){let n=[{type:"bytes32"}],s=[pF({primaryType:t,types:r})];for(let o of r[t]){let[a,u]=fx({types:r,name:o.name,type:o.type,value:e[o.name]});n.push(a),s.push(u)}return(0,ox.encodeAbiParameters)(n,s)}function pF({primaryType:e,types:t}){let r=(0,ix.toHex)(cx({primaryType:e,types:t}));return(0,zn.keccak256)(r)}function cx({primaryType:e,types:t}){let r="",n=dx({primaryType:e,types:t});n.delete(e);let s=[e,...Array.from(n).sort()];for(let o of s)r+=`${o}(${t[o].map(({name:a,type:u})=>`${u} ${a}`).join(",")})`;return r}function dx({primaryType:e,types:t},r=new Set){let s=e.match(/^\w*/u)?.[0];if(r.has(s)||t[s]===void 0)return r;r.add(s);for(let o of t[s])dx({primaryType:o.type,types:t},r);return r}function fx({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},(0,zn.keccak256)(ux({data:n,primaryType:r,types:e}))];
45if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},(0,zn.keccak256)(n)];if(r==="string")return[{type:"bytes32"},(0,zn.keccak256)((0,ix.toHex)(n))];if(r.lastIndexOf("]")===r.length-1){let s=r.slice(0,r.lastIndexOf("[")),o=n.map(a=>fx({name:t,type:s,types:e,value:a}));return[{type:"bytes32"},(0,zn.keccak256)((0,ox.encodeAbiParameters)(o.map(([a])=>a),o.map(([,a])=>a)))]}return[{type:r},n]}});var Ad=p(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.zeroHash=Fs.erc6492MagicBytes=void 0;Fs.erc6492MagicBytes="0x6492649264926492649264926492649264926492649264926492649264926492";Fs.zeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"});var Id=p(pg=>{"use strict";Object.defineProperty(pg,"__esModule",{value:!0});pg.isErc6492Signature=yF;var bF=Ad(),mF=mt();function yF(e){return(0,mF.sliceHex)(e,-32)===bF.erc6492MagicBytes}});var lx=p(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.LruMap=void 0;var bg=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}};Od.LruMap=bg});var bx=p(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.checksum=void 0;xi.clear=hF;var gF=lx(),px={checksum:new gF.LruMap(8192)};xi.checksum=px.checksum;function hF(){for(let e of Object.values(px))e.clear()}});var Bd=p(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.keccak256=EF;zs.ripemd160=xF;zs.sha256=wF;zs.validate=PF;var _F=s5(),vF=o5(),jF=i5(),mg=Ft(),wi=ke();function EF(e,t={}){let{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=(0,vF.keccak_256)(mg.from(e));return r==="Bytes"?n:wi.fromBytes(n)}function xF(e,t={}){let{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=(0,_F.ripemd160)(mg.from(e));return r==="Bytes"?n:wi.fromBytes(n)}function wF(e,t={}){let{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=(0,jF.sha256)(mg.from(e));return r==="Bytes"?n:wi.fromBytes(n)}function PF(e){return wi.validate(e)&&wi.size(e)===32}});var gg=p(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.InvalidSerializedSizeError=Ie.InvalidUncompressedPrefixError=Ie.InvalidCompressedPrefixError=Ie.InvalidPrefixError=Ie.InvalidError=void 0;Ie.assert=kd;Ie.compress=TF;Ie.from=AF;Ie.fromBytes=yx;Ie.fromHex=yg;Ie.toBytes=IF;Ie.toHex=gx;Ie.validate=OF;var mx=Ft(),qi=at(),tt=ke(),qF=Xo();function kd(e,t={}){let{compressed:r}=t,{prefix:n,x:s,y:o}=e;if(r===!1||typeof s=="bigint"&&typeof o=="bigint"){if(n!==4)throw new Pi({prefix:n,cause:new Rd});return}if(r===!0||typeof s=="bigint"&&typeof o>"u"){if(n!==3&&n!==2)throw new Pi({prefix:n,cause:new Cd});return}throw new Sd({publicKey:e})}function TF(e){let{x:t,y:r}=e;return{prefix:r%2n===0n?2:3,x:t}}function AF(e){let t=(()=>{if(tt.validate(e))return yg(e);if(mx.validate(e))return yx(e);let{prefix:r,x:n,y:s}=e;return typeof n=="bigint"&&typeof s=="bigint"?{prefix:r??4,x:n,y:s}:{prefix:r,x:n}})();return kd(t),t}function yx(e){return yg(tt.fromBytes(e))}function yg(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Md({publicKey:e});if(e.length===130){let n=BigInt(tt.slice(e,0,32)),s=BigInt(tt.slice(e,32,64));return{prefix:4,x:n,y:s}}if(e.length===132){let n=Number(tt.slice(e,0,1)),s=BigInt(tt.slice(e,1,33)),o=BigInt(tt.slice(e,33,65));return{prefix:n,x:s,y:o}}let t=Number(tt.slice(e,0,1)),r=BigInt(tt.slice(e,1,33));return{prefix:t,x:r}}function IF(e,t={}){return mx.fromHex(gx(e,t))}function gx(e,t={}){kd(e);let{prefix:r,x:n,y:s}=e,{includePrefix:o=!0}=t;return tt.concat(o?tt.fromNumber(r,{size:1}):"0x",tt.fromNumber(n,{size:32}),typeof s=="bigint"?tt.fromNumber(s,{size:32}):"0x")}function OF(e,t={}){try{return kd(e,t),!0}catch(r){return!1}}var Sd=class extends qi.BaseError{constructor({publicKey:t}){super(`Value \`${qF.stringify(t)}\` 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"})}};Ie.InvalidError=Sd;var Pi=class extends qi.BaseError{constructor({prefix:t,cause:r}){super(`Prefix "${t}
45" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}};Ie.InvalidPrefixError=Pi;var Cd=class extends qi.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"})}};Ie.InvalidCompressedPrefixError=Cd;var Rd=class extends qi.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}};Ie.InvalidUncompressedPrefixError=Rd;var Md=class extends qi.BaseError{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${tt.size(tt.from(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};Ie.InvalidSerializedSizeError=Md});var Ai=p(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.InvalidChecksumError=ct.InvalidInputError=ct.InvalidAddressError=void 0;ct.assert=Us;ct.checksum=vg;ct.from=_x;ct.fromPublicKey=RF;ct.isEqual=MF;ct.validate=kF;var BF=Ft(),hg=bx(),_g=at(),hx=Bd(),SF=gg(),CF=/^0x[a-fA-F0-9]{40}$/;function Us(e,t={}){let{strict:r=!0}=t;if(!CF.test(e))throw new Ti({address:e,cause:new Nd});if(r){if(e.toLowerCase()===e)return;if(vg(e)!==e)throw new Ti({address:e,cause:new Hd})}}function vg(e){if(hg.checksum.has(e))return hg.checksum.get(e);Us(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=hx.keccak256(BF.fromString(t),{as:"Bytes"}),n=t.split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&n[o]&&(n[o]=n[o].toUpperCase()),(r[o>>1]&15)>=8&&n[o+1]&&(n[o+1]=n[o+1].toUpperCase());let s=`0x${n.join("")}`;return hg.checksum.set(e,s),s}function _x(e,t={}){let{checksum:r=!1}=t;return Us(e),r?vg(e):e}function RF(e,t={}){let r=hx.keccak256(`0x${SF.toHex(e).slice(4)}`).substring(26);return _x(`0x${r}`,t)}function MF(e,t){return Us(e,{strict:!1}),Us(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function kF(e,t={}){let{strict:r=!0}=t??{};try{return Us(e,{strict:r}),!0}catch(n){return!1}}var Ti=class extends _g.BaseError{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}};ct.InvalidAddressError=Ti;var Nd=class extends _g.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"})}};ct.InvalidInputError=Nd;var Hd=class extends _g.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}};ct.InvalidChecksumError=Hd});var Fd=p(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.minInt120=w.minInt112=w.minInt104=w.minInt96=w.minInt88=w.minInt80=w.minInt72=w.minInt64=w.minInt56=w.minInt48=w.minInt40=w.minInt32=w.minInt24=w.minInt16=w.minInt8=w.maxInt256=w.maxInt248=w.maxInt240=w.maxInt232=w.maxInt224=w.maxInt216=w.maxInt208=w.maxInt200=w.maxInt192=w.maxInt184=w.maxInt176=w.maxInt168=w.maxInt160=w.maxInt152=w.maxInt144=w.maxInt136=w.maxInt128=w.maxInt120=w.maxInt112=w.maxInt104=w.maxInt96=w.maxInt88=w.maxInt80=w.maxInt72=w.maxInt64=w.maxInt56=w.maxInt48=w.maxInt40=w.maxInt32=w.maxInt24=w.maxInt16=w.maxInt8=w.integerRegex=w.bytesRegex=w.arrayRegex=void 0;w.maxUint256=w.maxUint248=w.maxUint240=w.maxUint232=w.maxUint224=w.maxUint216=w.maxUint208=w.maxUint200=w.maxUint192=w.maxUint184=w.maxUint176=w.maxUint168=w.maxUint160=w.maxUint152=w.maxUint144=w.maxUint136=w.maxUint128=w.maxUint120=w.maxUint112=w.maxUint104=w.maxUint96=w.maxUint88=w.maxUint80=w.maxUint72=w.maxUint64=w.maxUint56=w.maxUint48=w.maxUint40=w.maxUint32=w.maxUint24=w.maxUint16=w.maxUint8=w.minInt256=w.minInt248=w.minInt240=w.minInt232=w.minInt224=w.minInt216=w.minInt208=w.minInt200=w.minInt192=w.minInt184=w.minInt176=w.minInt168=w.minInt160=w.minInt152=w.minInt144=w.minInt136=w.minInt128=void 0;w.arrayRegex=/^(.*)\[([0-9]*)\]$/;w.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
45w.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)?$/;w.maxInt8=2n**(8n-1n)-1n;w.maxInt16=2n**(16n-1n)-1n;w.maxInt24=2n**(24n-1n)-1n;w.maxInt32=2n**(32n-1n)-1n;w.maxInt40=2n**(40n-1n)-1n;w.maxInt48=2n**(48n-1n)-1n;w.maxInt56=2n**(56n-1n)-1n;w.maxInt64=2n**(64n-1n)-1n;w.maxInt72=2n**(72n-1n)-1n;w.maxInt80=2n**(80n-1n)-1n;w.maxInt88=2n**(88n-1n)-1n;w.maxInt96=2n**(96n-1n)-1n;w.maxInt104=2n**(104n-1n)-1n;w.maxInt112=2n**(112n-1n)-1n;w.maxInt120=2n**(120n-1n)-1n;w.maxInt128=2n**(128n-1n)-1n;w.maxInt136=2n**(136n-1n)-1n;w.maxInt144=2n**(144n-1n)-1n;w.maxInt152=2n**(152n-1n)-1n;w.maxInt160=2n**(160n-1n)-1n;w.maxInt168=2n**(168n-1n)-1n;w.maxInt176=2n**(176n-1n)-1n;w.maxInt184=2n**(184n-1n)-1n;w.maxInt192=2n**(192n-1n)-1n;w.maxInt200=2n**(200n-1n)-1n;w.maxInt208=2n**(208n-1n)-1n;w.maxInt216=2n**(216n-1n)-1n;w.maxInt224=2n**(224n-1n)-1n;w.maxInt232=2n**(232n-1n)-1n;w.maxInt240=2n**(240n-1n)-1n;w.maxInt248=2n**(248n-1n)-1n;w.maxInt256=2n**(256n-1n)-1n;w.minInt8=-(2n**(8n-1n));w.minInt16=-(2n**(16n-1n));w.minInt24=-(2n**(24n-1n));w.minInt32=-(2n**(32n-1n));w.minInt40=-(2n**(40n-1n));w.minInt48=-(2n**(48n-1n));w.minInt56=-(2n**(56n-1n));w.minInt64=-(2n**(64n-1n));w.minInt72=-(2n**(72n-1n));w.minInt80=-(2n**(80n-1n));w.minInt88=-(2n**(88n-1n));w.minInt96=-(2n**(96n-1n));w.minInt104=-(2n**(104n-1n));w.minInt112=-(2n**(112n-1n));w.minInt120=-(2n**(120n-1n));w.minInt128=-(2n**(128n-1n));w.minInt136=-(2n**(136n-1n));w.minInt144=-(2n**(144n-1n));w.minInt152=-(2n**(152n-1n));w.minInt160=-(2n**(160n-1n));w.minInt168=-(2n**(168n-1n));w.minInt176=-(2n**(176n-1n));w.minInt184=-(2n**(184n-1n));w.minInt192=-(2n**(192n-1n));w.minInt200=-(2n**(200n-1n));w.minInt208=-(2n**(208n-1n));w.minInt216=-(2n**(216n-1n));w.minInt224=-(2n**(224n-1n));w.minInt232=-(2n**(232n-1n));w.minInt240=-(2n**(240n-1n));w.minInt248=-(2n**(248n-1n));w.minInt256=-(2n**(256n-1n));w.maxUint8=2n**8n-1n;w.maxUint16=2n**16n-1n;w.maxUint24=2n**24n-1n;w.maxUint32=2n**32n-1n;w.maxUint40=2n**40n-1n;w.maxUint48=2n**48n-1n;w.maxUint56=2n**56n-1n;w.maxUint64=2n**64n-1n;w.maxUint72=2n**72n-1n;w.maxUint80=2n**80n-1n;w.maxUint88=2n**88n-1n;w.maxUint96=2n**96n-1n;w.maxUint104=2n**104n-1n;w.maxUint112=2n**112n-1n;w.maxUint120=2n**120n-1n;w.maxUint128=2n**128n-1n;w.maxUint136=2n**136n-1n;w.maxUint144=2n**144n-1n;w.maxUint152=2n**152n-1n;w.maxUint160=2n**160n-1n;w.maxUint168=2n**168n-1n;w.maxUint176=2n**176n-1n;w.maxUint184=2n**184n-1n;w.maxUint192=2n**192n-1n;w.maxUint200=2n**200n-1n;w.maxUint208=2n**208n-1n;w.maxUint216=2n**216n-1n;w.maxUint224=2n**224n-1n;w.maxUint232=2n**232n-1n;w.maxUint240=2n**240n-1n;w.maxUint248=2n**248n-1n;w.maxUint256=2n**256n-1n});var kx=p(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.decodeParameter=Ls;we.decodeAddress=Ex;we.decodeArray=xx;we.decodeBool=wx;we.decodeBytes=Px;we.decodeNumber=qx;we.decodeTuple=Tx;we.decodeString=Ax;we.prepareParameters=FF;we.prepareParameter=zd;we.encode=Eg;we.encodeAddress=Ix;we.encodeArray=Ox;we.encodeBytes=Bx;we.encodeBoolean=Sx;we.encodeNumber=Cx;we.encodeString=Rx;we.encodeTuple=Mx;we.getArrayComponents=Ud;we.hasDynamicChild=Ds;var Ii=$s(),jx=Ai(),dt=Ft(),NF=at(),ce=ke(),HF=Fd();function Ls(e,t,r){let{checksumAddress:n,staticPosition:s}=r,o=Ud(t.type);if(o){let[a,u]=o;return xx(e,B(v({},t),{type:u}),{checksumAddress:n,length:a,staticPosition:s})}if(t.type==="tuple")return Tx(e,t,{checksumAddress:n,staticPosition:s});if(t.type==="address")return Ex(e,{checksum:n});if(t.type==="bool")return wx(e);if(t.type.startsWith("bytes"))return Px(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return qx(e,t);if(t.type==="string")return Ax(e,{staticPosition:s});throw new Ii.InvalidTypeError(t.type)}var vx=32,jg=32;function Ex(e,t={}){let{checksum:r=!1}=t,n=e.readBytes(32);return[(o=>r?jx.checksum(o):o)(ce.fromBytes(dt.slice(n,-20))),32]}function xx(e,t,r){let{checksumAddress:n,length:s,staticPosition:o}=r;if(!s){let c=dt.toNumber(e.readBytes(jg)),d=o+c,l=d+vx;e.setPosition(d);let f=dt.toNumber(e.readBytes(vx)),b=Ds(t),m=0,h=[];for(let _=0;_<f;++_){e.setPosition(l+(b?_*32:m));let[E,j]=Ls(e,t,{checksumAddress:n,staticPosition:l});m+=j,h.push(E)}return e.setPosition(o+32),[h,32]}if(Ds(t)){let c=dt.toNumber(e.readBytes(jg)),d=o+c,l=[];for(let f=0;f<s;++f){e.setPosition(d+f*32);let[b]=Ls(e,t,{checksumAddress:n,staticPosition:d});l.push(b)}return e.setPosition(o+32),[l,32]}let a=0,u=[];for(let c=0;c<s;++c){let[d,l]=Ls(e,t,{checksumAddress:n,staticPosition:o+a});a+=l,u.push(d)}return[u,a]}function wx(e){return[dt.toBoolean(e.readBytes(32),{size:32}),32]}function Px(e,t,{staticPosition:r}){let[n,s]=t.type.split("bytes");if(!s){let a=dt.toNumber(e.readBytes(32));e.setPosition(r+a);let u=dt.toNumber(e.readBytes(32));if(u===0)return e.setPosition(r+32),["0x",32];let c=e.readBytes(u);return e.setPosition(r+32),[ce.fromBytes(c),32]}return[ce.fromBytes(e.readBytes(Number.parseInt(s,10),32)),32]}function qx(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[n>48?dt.toBigInt(s,{signed:r}):dt.toNumber(s,{signed:r}),32]}function Tx(e,t,r){let{checksumAddress:n,staticPosition:s}=r,o=t.components.length===0||t.components.some(({name:c}
45)=>!c),a=o?[]:{},u=0;if(Ds(t)){let c=dt.toNumber(e.readBytes(jg)),d=s+c;for(let l=0;l<t.components.length;++l){let f=t.components[l];e.setPosition(d+u);let[b,m]=Ls(e,f,{checksumAddress:n,staticPosition:d});u+=m,a[o?l:f?.name]=b}return e.setPosition(s+32),[a,32]}for(let c=0;c<t.components.length;++c){let d=t.components[c],[l,f]=Ls(e,d,{checksumAddress:n,staticPosition:s});a[o?c:d?.name]=l,u+=f}return[a,u]}function Ax(e,{staticPosition:t}){let r=dt.toNumber(e.readBytes(32)),n=t+r;e.setPosition(n);let s=dt.toNumber(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];let o=e.readBytes(s,32),a=dt.toString(dt.trimLeft(o));return e.setPosition(t+32),[a,32]}function FF({checksumAddress:e,parameters:t,values:r}){let n=[];for(let s=0;s<t.length;s++)n.push(zd({checksumAddress:e,parameter:t[s],value:r[s]}));return n}function zd({checksumAddress:e=!1,parameter:t,value:r}){let n=t,s=Ud(n.type);if(s){let[o,a]=s;return Ox(r,{checksumAddress:e,length:o,parameter:B(v({},n),{type:a})})}if(n.type==="tuple")return Mx(r,{checksumAddress:e,parameter:n});if(n.type==="address")return Ix(r,{checksum:e});if(n.type==="bool")return Sx(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){let o=n.type.startsWith("int"),[,,a="256"]=HF.integerRegex.exec(n.type)??[];return Cx(r,{signed:o,size:Number(a)})}if(n.type.startsWith("bytes"))return Bx(r,{type:n.type});if(n.type==="string")return Rx(r);throw new Ii.InvalidTypeError(n.type)}function Eg(e){let t=0;for(let o=0;o<e.length;o++){let{dynamic:a,encoded:u}=e[o];a?t+=32:t+=ce.size(u)}let r=[],n=[],s=0;for(let o=0;o<e.length;o++){let{dynamic:a,encoded:u}=e[o];a?(r.push(ce.fromNumber(t+s,{size:32})),n.push(u),s+=ce.size(u)):r.push(u)}return ce.concat(...r,...n)}function Ix(e,t){let{checksum:r=!1}=t;return jx.assert(e,{strict:r}),{dynamic:!1,encoded:ce.padLeft(e.toLowerCase())}}function Ox(e,t){let{checksumAddress:r,length:n,parameter:s}=t,o=n===null;if(!Array.isArray(e))throw new Ii.InvalidArrayError(e);if(!o&&e.length!==n)throw new Ii.ArrayLengthMismatchError({expectedLength:n,givenLength:e.length,type:`${s.type}[${n}]`});let a=!1,u=[];for(let c=0;c<e.length;c++){let d=zd({checksumAddress:r,parameter:s,value:e[c]});d.dynamic&&(a=!0),u.push(d)}if(o||a){let c=Eg(u);if(o){let d=ce.fromNumber(u.length,{size:32});return{dynamic:!0,encoded:u.length>0?ce.concat(d,c):d}}if(a)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:ce.concat(...u.map(({encoded:c})=>c))}}function Bx(e,{type:t}){let[,r]=t.split("bytes"),n=ce.size(e);if(!r){let s=e;return n%32!==0&&(s=ce.padRight(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:ce.concat(ce.padLeft(ce.fromNumber(n,{size:32})),s)}}if(n!==Number.parseInt(r,10))throw new Ii.BytesSizeMismatchError({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:ce.padRight(e)}}function Sx(e){if(typeof e!="boolean")throw new NF.BaseError(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ce.padLeft(ce.fromBoolean(e))}}function Cx(e,{signed:t,size:r}){if(typeof r=="number"){let n=2n**(BigInt(r)-(t?1n:0n))-1n,s=t?-n-1n:0n;if(e>n||e<s)throw new ce.IntegerOutOfRangeError({max:n.toString(),min:s.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:ce.fromNumber(e,{size:32,signed:t})}}function Rx(e){let t=ce.fromString(e),r=Math.ceil(ce.size(t)/32),n=[];for(let s=0;s<r;s++)n.push(ce.padRight(ce.slice(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:ce.concat(ce.padRight(ce.fromNumber(ce.size(t),{size:32})),...n)}}function Mx(e,t){let{checksumAddress:r,parameter:n}=t,s=!1,o=[];for(let a=0;a<n.components.length;a++){let u=n.components[a],c=Array.isArray(e)?a:u.name,d=zd({checksumAddress:r,parameter:u,value:e[c]});o.push(d),d.dynamic&&(s=!0)}return{dynamic:s,encoded:s?Eg(o):ce.concat(...o.map(({encoded:a})=>a))}}function Ud(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ds(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Ds);let r=Ud(e.type);return!!(r&&Ds(B(v({},e),{type:r[1]})))}});var wg=p(Tr=>{"use strict";
45Object.defineProperty(Tr,"__esModule",{value:!0});Tr.RecursiveReadLimitExceededError=Tr.PositionOutOfBoundsError=Tr.NegativeOffsetError=void 0;Tr.create=UF;var xg=at(),zF={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 Dd({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Ld({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Oi({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Oi({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function UF(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(zF);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}var Oi=class extends xg.BaseError{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}};Tr.NegativeOffsetError=Oi;var Ld=class extends xg.BaseError{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}};Tr.PositionOutOfBoundsError=Ld;var Dd=class extends xg.BaseError{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}};Tr.RecursiveReadLimitExceededError=Dd});var $s=p(Pe=>{"use strict";
45Object.defineProperty(Pe,"__esModule",{value:!0});Pe.InvalidTypeError=Pe.InvalidArrayError=Pe.LengthMismatchError=Pe.BytesSizeMismatchError=Pe.ArrayLengthMismatchError=Pe.ZeroDataError=Pe.DataSizeTooSmallError=void 0;Pe.decode=$F;Pe.encode=GF;Pe.encodePacked=Gd;Pe.format=VF;Pe.from=WF;var $d=fr(),LF=Ai(),Bi=Ft(),Un=at(),ir=ke(),qg=kx(),DF=wg(),Pg=Fd();function $F(e,t,r={}){let{as:n="Array",checksumAddress:s=!1}=r,o=typeof t=="string"?Bi.fromHex(t):t,a=DF.create(o);if(Bi.size(o)===0&&e.length>0)throw new Wd;if(Bi.size(o)&&Bi.size(o)<32)throw new Vd({data:typeof t=="string"?t:ir.fromBytes(t),parameters:e,size:Bi.size(o)});let u=0,c=n==="Array"?[]:{};for(let d=0;d<e.length;++d){let l=e[d];a.setPosition(u);let[f,b]=qg.decodeParameter(a,l,{checksumAddress:s,staticPosition:0});u+=b,n==="Array"?c.push(f):c[l.name??d]=f}return c}function GF(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new Si({expectedLength:e.length,givenLength:t.length});let s=qg.prepareParameters({checksumAddress:n,parameters:e,values:t}),o=qg.encode(s);return o.length===0?"0x":o}function Gd(e,t){if(e.length!==t.length)throw new Si({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let s=e[n],o=t[n];r.push(Gd.encode(s,o))}return ir.concat(...r)}(function(e){function t(r,n,s=!1){if(r==="address"){let c=n;return LF.assert(c),ir.padLeft(c.toLowerCase(),s?32:0)}if(r==="string")return ir.fromString(n);if(r==="bytes")return n;if(r==="bool")return ir.padLeft(ir.fromBoolean(n),s?32:1);let o=r.match(Pg.integerRegex);if(o){let[c,d,l="256"]=o,f=Number.parseInt(l,10)/8;return ir.fromNumber(n,{size:s?32:f,signed:d==="int"})}let a=r.match(Pg.bytesRegex);if(a){let[c,d]=a;if(Number.parseInt(d,10)!==(n.length-2)/2)throw new Kd({expectedSize:Number.parseInt(d,10),value:n});return ir.padRight(n,s?32:0)}let u=r.match(Pg.arrayRegex);if(u&&Array.isArray(n)){let[c,d]=u,l=[];for(let f=0;f<n.length;f++)l.push(t(d,n[f],!0));return l.length===0?"0x":ir.concat(...l)}throw new Zd(r)}e.encode=t})(Gd||(Pe.encodePacked=Gd={}));function VF(e){return $d.formatAbiParameters(e)}function WF(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?$d.parseAbiParameters(e):e}var Vd=class extends Un.BaseError{constructor({data:t,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${$d.formatAbiParameters(r)})`,`Data: ${t} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}};Pe.DataSizeTooSmallError=Vd;var Wd=class extends Un.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}};Pe.ZeroDataError=Wd;var Tg=class extends Un.BaseError{constructor({expectedLength:t,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${t}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}};Pe.ArrayLengthMismatchError=Tg;var Kd=class extends Un.BaseError{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${ir.size(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}};Pe.BytesSizeMismatchError=Kd;var Si=class extends Un.BaseError{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${r}`].join(` 46`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}};Pe.LengthMismatchError=Si;var Ag=class extends Un.BaseError{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}};Pe.InvalidArrayError=Ag;var Zd=class extends Un.BaseError{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}};Pe.InvalidTypeError=Zd});var Dx=p(Ut=>{"use strict";
46Object.defineProperty(Ut,"__esModule",{value:!0});Ut.toBytes=KF;Ut.toHex=ZF;Ut.to=Og;Ut.decodeRlpCursor=Bg;Ut.readLength=Ig;Ut.readList=zx;Ut.from=Sg;Ut.fromBytes=YF;Ut.fromHex=JF;var Nx=Ft(),Hx=at(),Yd=ke(),Fx=wg();function KF(e){return Og(e,"Bytes")}function ZF(e){return Og(e,"Hex")}function Og(e,t){let r=t??(typeof e=="string"?"Hex":"Bytes"),n=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new Yd.InvalidLengthError(e);return Nx.fromHex(e)}return e})(),s=Fx.create(n,{recursiveReadLimit:Number.POSITIVE_INFINITY});return Bg(s,r)}function Bg(e,t="Hex"){if(e.bytes.length===0)return t==="Hex"?Yd.fromBytes(e.bytes):e.bytes;let r=e.readByte();if(r<128&&e.decrementPosition(1),r<192){let s=Ig(e,r,128),o=e.readBytes(s);return t==="Hex"?Yd.fromBytes(o):o}let n=Ig(e,r,192);return zx(e,n,t)}function Ig(e,t,r){if(r===128&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new Hx.BaseError("Invalid RLP prefix")}function zx(e,t,r){let n=e.position,s=[];for(;e.position-n<t;)s.push(Bg(e,r));return s}function Sg(e,t){let{as:r}=t,n=Ux(e),s=Fx.create(new Uint8Array(n.length));return n.encode(s),r==="Hex"?Yd.fromBytes(s.bytes):s.bytes}function YF(e,t={}){let{as:r="Bytes"}=t;return Sg(e,{as:r})}function JF(e,t={}){let{as:r="Hex"}=t;return Sg(e,{as:r})}function Ux(e){return Array.isArray(e)?XF(e.map(t=>Ux(t))):QF(e)}function XF(e){let t=e.reduce((s,o)=>s+o.length,0),r=Lx(t);return{length:t<=55?1+t:1+r+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+r),r===1?s.pushUint8(t):r===2?s.pushUint16(t):r===3?s.pushUint24(t):s.pushUint32(t));for(let{encode:o}of e)o(s)}}}function QF(e){let t=typeof e=="string"?Nx.fromHex(e):e,r=Lx(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+r),r===1?s.pushUint8(t.length):r===2?s.pushUint16(t.length):r===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function Lx(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new Hx.BaseError("Length is too large.")}});var Ng=p(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.InvalidVError=ne.InvalidYParityError=ne.InvalidSError=ne.InvalidRError=ne.MissingPropertiesError=ne.InvalidSerializedSizeError=void 0;ne.assert=tf;ne.fromBytes=Gx;ne.fromHex=Rg;ne.extract=r7;ne.from=Mg;ne.fromDerBytes=n7;ne.fromDerHex=Vx;ne.fromLegacy=Wx;ne.fromRpc=Kx;ne.fromTuple=s7;ne.toBytes=o7;ne.toHex=Zx;ne.toDerBytes=i7;ne.toDerHex=a7;ne.toLegacy=u7;ne.toRpc=c7;ne.toTuple=d7;ne.validate=f7;ne.vToYParity=rf;ne.yParityToV=kg;var Cg=Yr(),e7=Ft(),Vs=at(),ze=ke(),t7=Xo(),$x=Fd();function tf(e,t={}){let{recovered:r}=t;if(typeof e.r>"u")throw new Gs({signature:e});if(typeof e.s>"u")throw new Gs({signature:e});if(r&&typeof e.yParity>"u")throw new Gs({signature:e});if(e.r<0n||e.r>$x.maxUint256)throw new Xd({value:e.r});if(e.s<0n||e.s>$x.maxUint256)throw new Qd({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Ln({value:e.yParity})}function Gx(e){return Rg(ze.fromBytes(e))}function Rg(e){if(e.length!==130&&e.length!==132)throw new Jd({signature:e});let t=BigInt(ze.slice(e,0,32)),r=BigInt(ze.slice(e,32,64)),n=(()=>{let s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return rf(s)}catch(o){throw new Ln({value:s})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function r7(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return Mg(e)}function Mg(e){let t=typeof e=="string"?Rg(e):e instanceof Uint8Array?Gx(e):typeof e.r=="string"?Kx(e):e.v?Wx(e):v({r:e.r,s:e.s},typeof e.yParity<"u"?{yParity:e.yParity}:{});return tf(t),t}function n7(e){return Vx(ze.fromBytes(e))}function Vx(e){let{r:t,s:r}=Cg.secp256k1.Signature.fromDER(ze.from(e).slice(2));return{r:t,s:r}}function Wx(e){return{r:e.r,s:e.s,yParity:rf(e.v)}}function Kx(e){let t=(()=>{let r=e.v?Number(e.v):void 0,n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=rf(r)),typeof n!="number")throw new Ln({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function s7(e){let[t,r,n]=e;return Mg({r:r==="0x"?0n:BigInt(r),s:n==="0x"?0n:BigInt(n),yParity:t==="0x"?0:Number(t)})}function o7(e){return e7.fromHex(Zx(e))}function Zx(e){tf(e);let t=e.r,r=e.s;return ze.concat(ze.fromNumber(t,{size:32}),ze.fromNumber(r,{size:32}),typeof e.yParity=="number"?ze.fromNumber(kg(e.yParity),{size:1}):"0x")}function i7(e){return new Cg.secp256k1.Signature(e.r,e.s).toDERRawBytes()}function a7(e){return`0x${new Cg.secp256k1.Signature(e.r,e.s).toDERHex()}`}function u7(e){return{r:e.r,s:e.s,v:kg(e.yParity)}}function c7(e){let{r:t,s:r,yParity:n}=e;return{r:ze.fromNumber(t,{size:32}),s:ze.fromNumber(r,{size:32}),yParity:n===0?"0x0":"0x1"}}function d7(e){let{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":ze.trimLeft(ze.fromNumber(t)),r===0n?"0x":ze.trimLeft(ze.fromNumber(r))]}function f7(e,t={}){try{return tf(e,t),!0}catch(r){return!1}}function rf(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new ef({value:e})}function kg(e){if(e===0)return 27;if(e===1)return 28;throw new Ln({value:e})}var Jd=class extends Vs.BaseError{constructor({signature:t}){super(`Value \`${t}
46\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ze.size(ze.from(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}};ne.InvalidSerializedSizeError=Jd;var Gs=class extends Vs.BaseError{constructor({signature:t}){super(`Signature \`${t7.stringify(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}};ne.MissingPropertiesError=Gs;var Xd=class extends Vs.BaseError{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}};ne.InvalidRError=Xd;var Qd=class extends Vs.BaseError{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}};ne.InvalidSError=Qd;var Ln=class extends Vs.BaseError{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}};ne.InvalidYParityError=Ln;var ef=class extends Vs.BaseError{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}};ne.InvalidVError=ef});var ew=p(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.from=Yx;ht.fromRpc=Hg;ht.fromRpcList=b7;ht.fromTuple=Jx;ht.fromTupleList=m7;ht.getSignPayload=y7;ht.hash=Xx;ht.toRpc=Qx;ht.toRpcList=g7;ht.toTuple=Fg;ht.toTupleList=h7;var l7=Bd(),Ci=ke(),p7=Dx(),Ri=Ng();function Yx(e,t={}){return typeof e.chainId=="string"?Hg(e):v(v({},e),t.signature)}function Hg(e){let{address:t,chainId:r,nonce:n}=e,s=Ri.extract(e);return v({address:t,chainId:Number(r),nonce:BigInt(n)},s)}function b7(e){return e.map(Hg)}function Jx(e){let[t,r,n,s,o,a]=e,u={address:r,chainId:t==="0x"?0:Number(t),nonce:n==="0x"?0n:BigInt(n)};return s&&o&&a&&(u=v(v({},u),Ri.fromTuple([s,o,a]))),Yx(u)}function m7(e){let t=[];for(let r of e)t.push(Jx(r));return t}function y7(e){return Xx(e,{presign:!0})}function Xx(e,t={}){let{presign:r}=t;return l7.keccak256(Ci.concat("0x05",p7.fromHex(Fg(r?{address:e.address,chainId:e.chainId,nonce:e.nonce}:e))))}function Qx(e){let o=e,{address:t,chainId:r,nonce:n}=o,s=G(o,["address","chainId","nonce"]);return v({address:t,chainId:Ci.fromNumber(r),nonce:Ci.fromNumber(n)},Ri.toRpc(s))}function g7(e){return e.map(Qx)}function Fg(e){let{address:t,chainId:r,nonce:n}=e,s=Ri.extract(e);return[r?Ci.fromNumber(r):"0x",t,n?Ci.fromNumber(n):"0x",...s?Ri.toTuple(s):[]]}function h7(e){if(!e||e.length===0)return[];let t=[];for(let r of e)t.push(Fg(r));return t}});var tw=p(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});Ws.extraEntropy=void 0;Ws.setExtraEntropy=_7;Ws.extraEntropy=!1;function _7(e){Ws.extraEntropy=e}});var aw=p(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.noble=void 0;Bt.createKeyPair=j7;Bt.getPublicKey=nw;Bt.getSharedSecret=E7;Bt.randomPrivateKey=sw;Bt.recoverAddress=ow;Bt.recoverPublicKey=iw;Bt.sign=x7;Bt.verify=w7;var cn=Yr(),rw=Ai(),zg=Ft(),Ks=ke(),v7=tw(),nf=gg();Bt.noble=cn.secp256k1;function j7(e={}){let{as:t="Hex"}=e,r=sw({as:t}),n=nw({privateKey:r});return{privateKey:r,publicKey:n}}function nw(e){let{privateKey:t}=e,r=cn.secp256k1.ProjectivePoint.fromPrivateKey(Ks.from(t).slice(2));return nf.from(r)}function E7(e){let{as:t="Hex",privateKey:r,publicKey:n}=e,a=cn.secp256k1.ProjectivePoint.fromHex(nf.toHex(n).slice(2)).multiply(cn.secp256k1.utils.normPrivateKeyToScalar(Ks.from(r).slice(2))).toRawBytes(!0);return t==="Hex"?Ks.fromBytes(a):a}function sw(e={}){let{as:t="Hex"}=e,r=cn.secp256k1.utils.randomPrivateKey();return t==="Hex"?Ks.fromBytes(r):r}function ow(e){return rw.fromPublicKey(iw(e))}function iw(e){let{payload:t,signature:r}
46=e,{r:n,s,yParity:o}=r,u=new cn.secp256k1.Signature(BigInt(n),BigInt(s)).addRecoveryBit(o).recoverPublicKey(Ks.from(t).substring(2));return nf.from(u)}function x7(e){let{extraEntropy:t=v7.extraEntropy,hash:r,payload:n,privateKey:s}=e,{r:o,s:a,recovery:u}=cn.secp256k1.sign(zg.from(n),zg.from(s),v({extraEntropy:typeof t=="boolean"?t:Ks.from(t).slice(2),lowS:!0},r?{prehash:!0}:{}));return{r:o,s:a,yParity:u}}function w7(e){let{address:t,hash:r,payload:n,publicKey:s,signature:o}=e;return t?rw.isEqual(t,ow({payload:n,signature:o})):cn.secp256k1.verify(o,zg.from(n),nf.toBytes(s),...r?[{prehash:!0,lowS:!0}]:[])}});var fw=p(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.InvalidWrappedSignatureError=Ue.suffixParameters=Ue.magicBytes=void 0;Ue.assert=of;Ue.from=T7;Ue.unwrap=dw;Ue.wrap=A7;Ue.validate=I7;var Ug=$s(),uw=ew(),P7=at(),dn=ke(),q7=aw(),cw=Ng();Ue.magicBytes="0x8010801080108010801080108010801080108010801080108010801080108010";Ue.suffixParameters=Ug.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function of(e){if(typeof e=="string"){if(dn.slice(e,-32)!==Ue.magicBytes)throw new sf(e)}else cw.assert(e.authorization)}function T7(e){return typeof e=="string"?dw(e):e}function dw(e){of(e);let t=dn.toNumber(dn.slice(e,-64,-32)),r=dn.slice(e,-t-64,-64),n=dn.slice(e,0,-t-64),[s,o,a]=Ug.decode(Ue.suffixParameters,r),u=uw.from({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s});return v({authorization:u,signature:n},a&&a!=="0x"?{data:a,to:o}:{})}function A7(e){let{data:t,signature:r}=e;of(e);let n=q7.recoverAddress({payload:uw.getSignPayload(e.authorization),signature:cw.from(e.authorization)}),s=Ug.encode(Ue.suffixParameters,[B(v({},e.authorization),{delegation:e.authorization.address,chainId:BigInt(e.authorization.chainId)}),e.to??n,t??"0x"]),o=dn.fromNumber(dn.size(s),{size:32});return dn.concat(r,s,o,Ue.magicBytes)}function I7(e){try{return of(e),!0}catch(t){return!1}}var sf=class extends P7.BaseError{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};Ue.InvalidWrappedSignatureError=sf});var Mi=p(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.SignatureErc8010=void 0;af.SignatureErc8010=fw()});var uf=p(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.isErc8010Signature=B7;var O7=Mi();function B7(e){return O7.SignatureErc8010.validate(e)}});var $g=p(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.parseErc6492Signature=R7;var S7=br(),C7=Id();function R7(e){if(!(0,C7.isErc6492Signature)(e))return{signature:e};let[t,r,n]=(0,S7.decodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],e);return{address:t,data:r,signature:n}}});var Vg=p(Gg=>{"use strict";Object.defineProperty(Gg,"__esModule",{value:!0});Gg.parseErc8010Signature=N7;var M7=Mi(),lw=U(),k7=uf();function N7(e){if(!(0,k7.isErc8010Signature)(e))return{signature:e};let s=M7.SignatureErc8010.unwrap(e),{authorization:t,to:r}=s,n=G(s,["authorization","to"]);return v(v({authorization:{address:t.address,chainId:t.chainId,nonce:Number(t.nonce),r:(0,lw.numberToHex)(t.r,{size:32}),s:(0,lw.numberToHex)(t.s,{size:32}),yParity:t.yParity}},r?{address:r}:{}),n)}});var cf=p(Wg=>{"use strict";Object.defineProperty(Wg,"__esModule",{value:!0});Wg.recoverMessageAddress=z7;var H7=Ms(),F7=vr();function z7(r){return y(this,arguments,function*({message:e,signature:t}){return(0,F7.recoverAddress)({hash:(0,H7.hashMessage)(e),signature:t})})}});var df=p(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});Kg.recoverTypedDataAddress=D7;var U7=Ns(),L7=vr();function D7(e){return y(this,null,function*(){let{domain:t,message:r,primaryType:n,signature:s,types:o}=e;return(0,L7.recoverAddress)({hash:(0,U7.hashTypedData)({domain:t,message:r,primaryType:n,types:o}),signature:s})})}});var Yg=p(Zg=>{"use strict";
46Object.defineProperty(Zg,"__esModule",{value:!0});Zg.serializeErc6492Signature=K7;var $7=Ad(),G7=Et(),V7=Oe(),W7=de();function K7(e){let{address:t,data:r,signature:n,to:s="hex"}=e,o=(0,V7.concatHex)([(0,G7.encodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,r,n]),$7.erc6492MagicBytes]);return s==="hex"?o:(0,W7.hexToBytes)(o)}});var Xg=p(Jg=>{"use strict";Object.defineProperty(Jg,"__esModule",{value:!0});Jg.serializeErc8010Signature=J7;var Z7=Mi(),Y7=de();function J7(e){let{address:t,data:r,signature:n,to:s="hex"}=e,o=Z7.SignatureErc8010.wrap({authorization:{address:e.authorization.address,chainId:e.authorization.chainId,nonce:BigInt(e.authorization.nonce),r:BigInt(e.authorization.r),s:BigInt(e.authorization.s),yParity:e.authorization.yParity},data:r,signature:n,to:t});return s==="hex"?o:(0,Y7.hexToBytes)(o)}});var eh=p(Qg=>{"use strict";Object.defineProperty(Qg,"__esModule",{value:!0});Qg.verifyHash=tz;var X7=rt(),Q7=Tt(),ez=vr();function tz(n){return y(this,arguments,function*({address:e,hash:t,signature:r}){return(0,Q7.isAddressEqual)((0,X7.getAddress)(e),yield(0,ez.recoverAddress)({hash:t,signature:r}))})}});var rh=p(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.verifyMessage=oz;var rz=rt(),nz=Tt(),sz=cf();function oz(n){return y(this,arguments,function*({address:e,message:t,signature:r}){return(0,nz.isAddressEqual)((0,rz.getAddress)(e),yield(0,sz.recoverMessageAddress)({message:t,signature:r}))})}});var sh=p(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.verifyTypedData=cz;var iz=rt(),az=Tt(),uz=df();function cz(e){return y(this,null,function*(){let{address:t,domain:r,message:n,primaryType:s,signature:o,types:a}=e;return(0,az.isAddressEqual)((0,iz.getAddress)(t),yield(0,uz.recoverTypedDataAddress)({domain:r,message:n,primaryType:s,signature:o,types:a}))})}});var ff=p(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.getSerializedTransactionType=pz;var dz=Ge(),fz=mt(),lz=Ee();function pz(e){let t=(0,fz.sliceHex)(e,0,1);if(t==="0x04")return"eip7702";if(t==="0x03")return"eip4844";if(t==="0x02")return"eip1559";if(t==="0x01")return"eip2930";if(t!=="0x"&&(0,lz.hexToNumber)(t)>=192)return"legacy";throw new dz.InvalidSerializedTransactionTypeError({serializedType:t})}});var lf=p(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.parseTransaction=vz;zi.toTransactionArray=Ni;zi.parseAccessList=Hi;var bz=jt(),Zs=Ge(),mz=Xe(),yz=Zo(),se=$e(),pw=lr(),gz=Vt(),ie=Ee(),bw=yd(),hz=gd(),ki=yi(),_z=ff();function vz(e){let t=(0,_z.getSerializedTransactionType)(e);return t==="eip1559"?xz(e):t==="eip2930"?wz(e):t==="eip4844"?Ez(e):t==="eip7702"?jz(e):Pz(e)}function jz(e){let t=Ni(e),[r,n,s,o,a,u,c,d,l,f,b,m,h]=t;if(t.length!==10&&t.length!==13)throw new Zs.InvalidSerializedTransactionError({attributes:v({chainId:r,nonce:n,maxPriorityFeePerGas:s,maxFeePerGas:o,gas:a,to:u,value:c,data:d,accessList:l,authorizationList:f},t.length>9?{v:b,r:m,s:h}:{}),serializedTransaction:e,type:"eip7702"});let _={chainId:(0,ie.hexToNumber)(r),type:"eip7702"};(0,se.isHex)(u)&&u!=="0x"&&(_.to=u),(0,se.isHex)(a)&&a!=="0x"&&(_.gas=(0,ie.hexToBigInt)(a)),(0,se.isHex)(d)&&d!=="0x"&&(_.data=d),(0,se.isHex)(n)&&(_.nonce=n==="0x"?0:(0,ie.hexToNumber)(n)),(0,se.isHex)(c)&&c!=="0x"&&(_.value=(0,ie.hexToBigInt)(c)),(0,se.isHex)(o)&&o!=="0x"&&(_.maxFeePerGas=(0,ie.hexToBigInt)(o)),(0,se.isHex)(s)&&s!=="0x"&&(_.maxPriorityFeePerGas=(0,ie.hexToBigInt)(s)),l.length!==0&&l!=="0x"&&(_.accessList=Hi(l)),f.length!==0&&f!=="0x"&&(_.authorizationList=qz(f)),(0,ki.assertTransactionEIP7702)(_);let E=t.length===13?Fi(t):void 0;return v(v({},E),_)}function Ez(e){let t=Ni(e),r=t.length===4,n=r?t[0]:t,s=r?t.slice(1):[],[o,a,u,c,d,l,f,b,m,h,_,E,j,q]=n,[T,x,A]=s;if(!(n.length===11||n.length===14))throw new Zs.InvalidSerializedTransactionError({attributes:v({chainId:o,nonce:a,maxPriorityFeePerGas:u,maxFeePerGas:c,gas:d,to:l,value:f,data:b,accessList:m},n.length>9?{v:E,r:j,s:q}:{}),serializedTransaction:e,type:"eip4844"});let I={blobVersionedHashes:_,chainId:(0,ie.hexToNumber)(o),to:l,type:"eip4844"};(0,se.isHex)(d)&&d!=="0x"&&(I.gas=(0,ie.hexToBigInt)(d)),(0,se.isHex)(b)&&b!=="0x"&&(I.data=b),(0,se.isHex)(a)&&(I.nonce=a==="0x"?0:(0,ie.hexToNumber)(a)),(0,se.isHex)(f)&&f!=="0x"&&(I.value=(0,ie.hexToBigInt)(f)),(0,se.isHex)(h)&&h!=="0x"&&(I.maxFeePerBlobGas=(0,ie.hexToBigInt)(h)),(0,se.isHex)(c)&&c!=="0x"&&(I.maxFeePerGas=(0,ie.hexToBigInt)(c)),(0,se.isHex)(u)&&u!=="0x"&&(I.maxPriorityFeePerGas=(0,ie.hexToBigInt)(u)),m.length!==0&&m!=="0x"&&(I.accessList=Hi(m)),T&&x&&A&&(I.sidecars=(0,yz.toBlobSidecars)({blobs:T,commitments:x,proofs:A})),(0,ki.assertTransactionEIP4844)(I);let O=n.length===14?Fi(n):void 0;return v(v({},O),I)}function xz(e){let t=Ni(e),[r,n,s,o,a,u,c,d,l,f,b,m]=t;if(!(t.length===9||t.length===12))throw new Zs.InvalidSerializedTransactionError({attributes:v({chainId:r,nonce:n,maxPriorityFeePerGas:s,maxFeePerGas:o,gas:a,to:u,value:c,data:d,accessList:l},t.length>9?{v:f,r:b,s:m}:{}),serializedTransaction:e,type:"eip1559"});let h={chainId:(0,ie.hexToNumber)(r),type:"eip1559"};(0,se.isHex)(u)&&u!=="0x"&&(h.to=u),(0,se.isHex)(a)&&a!=="0x"&&(h.gas=(0,ie.hexToBigInt)(a)),(0,se.isHex)(d)&&d!=="0x"&&(h.data=d),(0,se.isHex)(n)&&(h.nonce=n==="0x"?0:(0,ie.hexToNumber)(n)),(0,se.isHex)(c)&&c!=="0x"&&(h.value=(0,ie.hexToBigInt)(c)),(0,se.isHex)(o)&&o!=="0x"&&(h.maxFeePerGas=(0,ie.hexToBigInt)(o)),(0,se.isHex)(s)&&s!=="0x"&&(h.maxPriorityFeePerGas=(0,ie.hexToBigInt)(s)),l.length!==0&&l!=="0x"&&(h.accessList=Hi(l)),(0,ki.assertTransactionEIP1559)(h);let _=t.length===12?Fi(t):void 0;return v(v({},_),h)}function wz(e){let t=Ni(e),[r,n,s,o,a,u,c,d,l,f,b]=t;if(!(t.length===8||t.length===11))throw new Zs.InvalidSerializedTransactionError({attributes:v({chainId:r,nonce:n,gasPrice:s,gas:o,to:a,value:u,data:c,accessList:d},t.length>8?{v:l,r:f,s:b}:{}),serializedTransaction:e,type:"eip2930"});let m={chainId:(0,ie.hexToNumber)(r),type:"eip2930"};(0,se.isHex)(a)&&a!=="0x"&&(m.to=a),(0,se.isHex)(o)&&o!=="0x"&&(m.gas=(0,ie.hexToBigInt)(o)),(0,se.isHex)(c)&&c!=="0x"&&(m.data=c),(0,se.isHex)(n)&&(m.nonce=n==="0x"?0:(0,ie.hexToNumber)(n)),(0,se.isHex)(u)&&u!=="0x"&&(m.value=(0,ie.hexToBigInt)(u)),(0,se.isHex)(s)&&s!=="0x"&&(m.gasPrice=(0,ie.hexToBigInt)(s)),d.length!==0&&d!=="0x"&&(m.accessList=Hi(d)),(0,ki.assertTransactionEIP2930)(m);let h=t.length===11?Fi(t):void 0;return v(v({},h),m)}function Pz(e){let t=(0,bw.fromRlp)(e,"hex"),[r,n,s,o,a,u,c,d,l]=t;if(!(t.length===6||t.length===9))throw new Zs.InvalidSerializedTransactionError({attributes:v({nonce:r,gasPrice:n,gas:s,to:o,value:a,data:u},t.length>6?{v:c,r:d,s:l}:{}),serializedTransaction:e,type:"legacy"});let f={type:"legacy"};
46if((0,se.isHex)(o)&&o!=="0x"&&(f.to=o),(0,se.isHex)(s)&&s!=="0x"&&(f.gas=(0,ie.hexToBigInt)(s)),(0,se.isHex)(u)&&u!=="0x"&&(f.data=u),(0,se.isHex)(r)&&(f.nonce=r==="0x"?0:(0,ie.hexToNumber)(r)),(0,se.isHex)(a)&&a!=="0x"&&(f.value=(0,ie.hexToBigInt)(a)),(0,se.isHex)(n)&&n!=="0x"&&(f.gasPrice=(0,ie.hexToBigInt)(n)),(0,ki.assertTransactionLegacy)(f),t.length===6)return f;let b=(0,se.isHex)(c)&&c!=="0x"?(0,ie.hexToBigInt)(c):0n;if(l==="0x"&&d==="0x")return b>0&&(f.chainId=Number(b)),f;let m=b,h=Number((m-35n)/2n);if(h>0)f.chainId=h;else if(m!==27n&&m!==28n)throw new Zs.InvalidLegacyVError({v:m});return f.v=m,f.s=l,f.r=d,f.yParity=m%2n===0n?1:0,f}function Ni(e){return(0,bw.fromRlp)(`0x${e.slice(4)}`,"hex")}function Hi(e){let t=[];for(let r=0;r<e.length;r++){let[n,s]=e[r];if(!(0,mz.isAddress)(n,{strict:!1}))throw new bz.InvalidAddressError({address:n});t.push({address:n,storageKeys:s.map(o=>(0,hz.isHash)(o)?o:(0,gz.trim)(o))})}return t}function qz(e){let t=[];for(let r=0;r<e.length;r++){let[n,s,o,a,u,c]=e[r];t.push(v({address:s,chainId:n==="0x"?0:(0,ie.hexToNumber)(n),nonce:o==="0x"?0:(0,ie.hexToNumber)(o)},Fi([a,u,c])))}return t}function Fi(e){let t=e.slice(-3),r=t[0]==="0x"||(0,ie.hexToBigInt)(t[0])===0n?27n:28n;return{r:(0,pw.padHex)(t[1],{size:32}),s:(0,pw.padHex)(t[2],{size:32}),v:r,yParity:r===27n?0:1}}});var ah=p(pf=>{"use strict";
46Object.defineProperty(pf,"__esModule",{value:!0});pf.InvalidDecimalNumberError=void 0;var Tz=Q(),ih=class extends Tz.BaseError{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}};pf.InvalidDecimalNumberError=ih});var Ui=p(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.parseUnits=Iz;var Az=ah();function Iz(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new Az.InvalidDecimalNumberError({value:e});let[r,n="0"]=e.split("."),s=r.startsWith("-");if(s&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),t===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>t){let[o,a,u]=[n.slice(0,t-1),n.slice(t-1,t),n.slice(t)],c=Math.round(+`${a}.${u}`);c>9?n=`${BigInt(o)+BigInt(1)}0`.padStart(o.length+1,"0"):n=`${o}${c}`,n.length>t&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,t)}else n=n.padEnd(t,"0");return BigInt(`${s?"-":""}${r}${n}`)}});var dh=p(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.parseEther=Sz;var Oz=os(),Bz=Ui();function Sz(e,t="wei"){return(0,Bz.parseUnits)(e,Oz.etherUnits[t])}});var lh=p(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.parseGwei=Mz;var Cz=os(),Rz=Ui();function Mz(e,t="wei"){return(0,Rz.parseUnits)(e,Cz.gweiUnits[t])}});var mf=p(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.padBytes=g.pad=g.isHex=g.isBytes=g.concatHex=g.concatBytes=g.concat=g.getChainContractAddress=g.extractChain=g.defineChain=g.assertCurrentChain=g.offchainLookupSignature=g.offchainLookupAbiItem=g.offchainLookup=g.ccipFetch=g.ccipRequest=g.buildRequest=g.verifyAuthorization=g.serializeAuthorizationList=g.recoverAuthorizationAddress=g.hashAuthorization=g.isAddressEqual=g.isAddress=g.getCreateAddress=g.getCreate2Address=g.getContractAddress=g.getAddress=g.parseEventLogs=g.getAbiItem=g.formatAbiItemWithArgs=g.formatAbiParams=g.formatAbiItem=g.encodePacked=g.encodeFunctionResult=g.encodeFunctionData=g.encodeEventTopics=g.encodeErrorResult=g.encodeDeployData=g.encodeAbiParameters=g.decodeFunctionResult=g.decodeFunctionData=g.decodeEventLog=g.decodeErrorResult=g.decodeAbiParameters=g.publicKeyToAddress=g.parseAccount=g.parseAbiParameters=g.parseAbiParameter=g.parseAbiItem=g.parseAbi=void 0;g.ripemd160=g.keccak256=g.isHash=g.getAction=g.formatTransactionRequest=g.defineTransactionRequest=g.defineTransactionReceipt=g.transactionType=g.formatTransaction=g.defineTransaction=g.formatLog=g.defineFormatter=g.extract=g.formatBlock=g.defineBlock=g.getTransactionError=g.getNodeError=g.containsNodeError=g.getEstimateGasError=g.getContractError=g.getCallError=g.toRlp=g.toHex=g.stringToHex=g.numberToHex=g.bytesToHex=g.boolToHex=g.toBytes=g.stringToBytes=g.numberToBytes=g.hexToBytes=g.boolToBytes=g.fromRlp=g.hexToString=g.hexToNumber=g.hexToBool=g.hexToBigInt=g.fromHex=g.fromBytes=g.bytesToString=g.bytesToNumber=g.bytesToBool=g.bytesToBigint=g.bytesToBigInt=g.trim=g.sliceHex=g.sliceBytes=g.slice=g.size=g.padHex=void 0;g.validateTypedData=g.serializeTypedData=g.serializeTransaction=g.serializeAccessList=g.parseTransaction=g.getTransactionType=g.getSerializedTransactionType=g.assertTransactionLegacy=g.assertTransactionEIP2930=g.assertTransactionEIP1559=g.assertRequest=g.stringify=g.verifyTypedData=g.verifyMessage=g.verifyHash=g.serializeErc8010Signature=g.serializeErc6492Signature=g.recoverTypedDataAddress=g.recoverPublicKey=g.recoverMessageAddress=g.recoverAddress=g.parseErc8010Signature=g.parseErc6492Signature=g.isErc8010Signature=g.isErc6492Signature=g.hashTypedData=g.hashStruct=g.hashMessage=g.getWebSocketRpcClient=g.socketClientCache=g.getSocketRpcClient=g.getHttpRpcClient=g.rpc=g.getSocket=g.integerRegex=g.bytesRegex=g.arrayRegex=g.nonceManager=g.createNonceManager=g.getFunctionSignature=g.toFunctionSignature=g.getFunctionSelector=g.toFunctionSelector=g.toFunctionHash=g.getEventSignature=g.toEventSignature=g.getEventSelector=g.toEventSelector=g.toEventHash=g.sha256=void 0;g.parseUnits=g.parseGwei=g.parseEther=g.formatUnits=g.formatGwei=g.formatEther=void 0;var bf=fr();Object.defineProperty(g,"parseAbi",{enumerable:!0,get:function(){return bf.parseAbi}});Object.defineProperty(g,"parseAbiItem",{enumerable:!0,get:function(){return bf.parseAbiItem}});Object.defineProperty(g,"parseAbiParameter",{enumerable:!0,get:function(){return bf.parseAbiParameter}});Object.defineProperty(g,"parseAbiParameters",{enumerable:!0,get:function(){return bf.parseAbiParameters}});var kz=xe();Object.defineProperty(g,"parseAccount",{enumerable:!0,get:function(){return kz.parseAccount}});var Nz=zp();Object.defineProperty(g,"publicKeyToAddress",{enumerable:!0,get:function(){return Nz.publicKeyToAddress}});var Hz=br();Object.defineProperty(g,"decodeAbiParameters",{enumerable:!0,get:function(){return Hz.decodeAbiParameters}});var Fz=To();Object.defineProperty(g,"decodeErrorResult",{enumerable:!0,get:function(){return Fz.decodeErrorResult}});var zz=hs();Object.defineProperty(g,"decodeEventLog",{enumerable:!0,get:function(){return zz.decodeEventLog}});var Uz=Oc();Object.defineProperty(g,"decodeFunctionData",{enumerable:!0,get:function(){return Uz.decodeFunctionData}});var Lz=Xt();Object.defineProperty(g,"decodeFunctionResult",{enumerable:!0,get:function(){return Lz.decodeFunctionResult}});var Dz=Et();Object.defineProperty(g,"encodeAbiParameters",{enumerable:!0,get:function(){return Dz.encodeAbiParameters}});var $z=Ps();Object.defineProperty(g,"encodeDeployData",{enumerable:!0,get:function(){return $z.encodeDeployData}});var Gz=Bc();Object.defineProperty(g,"encodeErrorResult",{enumerable:!0,get:function(){return Gz.encodeErrorResult}});var Vz=zr();Object.defineProperty(g,"encodeEventTopics",{enumerable:!0,get:function(){return Vz.encodeEventTopics}});var Wz=Qe();Object.defineProperty(g,"encodeFunctionData",{enumerable:!0,get:function(){return Wz.encodeFunctionData}});var Kz=Cc();Object.defineProperty(g,"encodeFunctionResult",{enumerable:!0,get:function(){return Kz.encodeFunctionResult}});var Zz=jy();Object.defineProperty(g,"encodePacked",{enumerable:!0,get:function(){return Zz.encodePacked}});var mw=Gt();Object.defineProperty(g,"formatAbiItem",{enumerable:!0,get:function(){return mw.formatAbiItem}});Object.defineProperty(g,"formatAbiParams",{enumerable:!0,get:function(){return mw.formatAbiParams}});var Yz=op();Object.defineProperty(g,"formatAbiItemWithArgs",{enumerable:!0,get:function(){return Yz.formatAbiItemWithArgs}});var Jz=Wt();Object.defineProperty(g,"getAbiItem",{enumerable:!0,get:function(){return Jz.getAbiItem}});var Xz=_s();Object.defineProperty(g,"parseEventLogs",{enumerable:!0,get:function(){return Xz.parseEventLogs}});var Qz=rt();Object.defineProperty(g,"getAddress",{enumerable:!0,get:function(){return Qz.getAddress}});var ph=wy();Object.defineProperty(g,"getContractAddress",{enumerable:!0,get:function(){return ph.getContractAddress}});Object.defineProperty(g,"getCreate2Address",{enumerable:!0,get:function(){return ph.getCreate2Address}});Object.defineProperty(g,"getCreateAddress",{enumerable:!0,get:function(){return ph.getCreateAddress}});var eU=Xe();Object.defineProperty(g,"isAddress",{enumerable:!0,get:function(){return eU.isAddress}});var tU=Tt();Object.defineProperty(g,"isAddressEqual",{enumerable:!0,get:function(){return tU.isAddressEqual}});var rU=yb();Object.defineProperty(g,"hashAuthorization",{enumerable:!0,get:function(){return rU.hashAuthorization}});var nU=ls();Object.defineProperty(g,"recoverAuthorizationAddress",{enumerable:!0,get:function(){return nU.recoverAuthorizationAddress}});var sU=Iy();Object.defineProperty(g,"serializeAuthorizationList",{enumerable:!0,get:function(){return sU.serializeAuthorizationList}});var oU=Sy();Object.defineProperty(g,"verifyAuthorization",{enumerable:!0,get:function(){return oU.verifyAuthorization}});var iU=Cy();Object.defineProperty(g,"buildRequest",{enumerable:!0,get:function(){return iU.buildRequest}});var Li=Rc();Object.defineProperty(g,"ccipRequest",{enumerable:!0,get:function(){return Li.ccipRequest}});Object.defineProperty(g,"ccipFetch",{enumerable:!0,get:function(){return Li.ccipRequest}});Object.defineProperty(g,"offchainLookup",{enumerable:!0,get:function(){return Li.offchainLookup}});Object.defineProperty(g,"offchainLookupAbiItem",{enumerable:!0,get:function(){return Li.offchainLookupAbiItem}});Object.defineProperty(g,"offchainLookupSignature",{enumerable:!0,get:function(){return Li.offchainLookupSignature}});var aU=Os();Object.defineProperty(g,"assertCurrentChain",{enumerable:!0,get:function(){return aU.assertCurrentChain}});var uU=My();Object.defineProperty(g,"defineChain",{enumerable:!0,get:function(){return uU.defineChain}});var cU=Ny();Object.defineProperty(g,"extractChain",{enumerable:!0,get:function(){return cU.extractChain}});var dU=Er();Object.defineProperty(g,"getChainContractAddress",{enumerable:!0,get:function(){return dU.getChainContractAddress}});var bh=Oe();Object.defineProperty(g,"concat",{enumerable:!0,get:function(){return bh.concat}});Object.defineProperty(g,"concatBytes",{enumerable:!0,get:function(){return bh.concatBytes}});Object.defineProperty(g,"concatHex",{enumerable:!0,get:function(){return bh.concatHex}});var fU=sd();Object.defineProperty(g,"isBytes",{enumerable:!0,get:function(){return fU.isBytes}});var lU=$e();Object.defineProperty(g,"isHex",{enumerable:!0,get:function(){return lU.isHex}});var mh=lr();Object.defineProperty(g,"pad",{enumerable:!0,get:function(){return mh.pad}});Object.defineProperty(g,"padBytes",{enumerable:!0,get:function(){return mh.padBytes}});Object.defineProperty(g,"padHex",{enumerable:!0,get:function(){return mh.padHex}});var pU=Ye();Object.defineProperty(g,"size",{enumerable:!0,get:function(){return pU.size}});var yh=mt();Object.defineProperty(g,"slice",{enumerable:!0,get:function(){return yh.slice}});Object.defineProperty(g,"sliceBytes",{enumerable:!0,get:function(){return yh.sliceBytes}});Object.defineProperty(g,"sliceHex",{enumerable:!0,get:function(){return yh.sliceHex}});var bU=Vt();Object.defineProperty(g,"trim",{enumerable:!0,get:function(){return bU.trim}});var Ys=Ya();Object.defineProperty(g,"bytesToBigInt",{enumerable:!0,get:function(){return Ys.bytesToBigInt}});Object.defineProperty(g,"bytesToBigint",{enumerable:!0,get:function(){return Ys.bytesToBigInt}});Object.defineProperty(g,"bytesToBool",{enumerable:!0,get:function(){return Ys.bytesToBool}});Object.defineProperty(g,"bytesToNumber",{enumerable:!0,get:function(){return Ys.bytesToNumber}});Object.defineProperty(g,"bytesToString",{enumerable:!0,get:function(){return Ys.bytesToString}});Object.defineProperty(g,"fromBytes",{enumerable:!0,get:function(){return Ys.fromBytes}});var Di=Ee();Object.defineProperty(g,"fromHex",{enumerable:!0,get:function(){return Di.fromHex}});Object.defineProperty(g,"hexToBigInt",{enumerable:!0,get:function(){return Di.hexToBigInt}});Object.defineProperty(g,"hexToBool",{enumerable:!0,get:function(){return Di.hexToBool}});Object.defineProperty(g,"hexToNumber",{enumerable:!0,get:function(){return Di.hexToNumber}});Object.defineProperty(g,"hexToString",{enumerable:!0,get:function(){return Di.hexToString}});var mU=yd();Object.defineProperty(g,"fromRlp",{enumerable:!0,get:function(){return mU.fromRlp}});var $i=de();Object.defineProperty(g,"boolToBytes",{enumerable:!0,get:function(){return $i.boolToBytes}});Object.defineProperty(g,"hexToBytes",{enumerable:!0,get:function(){return $i.hexToBytes}});Object.defineProperty(g,"numberToBytes",{enumerable:!0,get:function(){return $i.numberToBytes}});Object.defineProperty(g,"stringToBytes",{enumerable:!0,get:function(){return $i.stringToBytes}});Object.defineProperty(g,"toBytes",{enumerable:!0,get:function(){return $i.toBytes}});var Gi=U();Object.defineProperty(g,"boolToHex",{enumerable:!0,get:function(){return Gi.boolToHex}});Object.defineProperty(g,"bytesToHex",{enumerable:!0,get:function(){return Gi.bytesToHex}});Object.defineProperty(g,"numberToHex",{enumerable:!0,get:function(){return Gi.numberToHex}});Object.defineProperty(g,"stringToHex",{enumerable:!0,get:function(){return Gi.stringToHex}});Object.defineProperty(g,"toHex",{enumerable:!0,get:function(){return Gi.toHex}});var yU=fs();Object.defineProperty(g,"toRlp",{enumerable:!0,get:function(){return yU.toRlp}});var gU=Tc();Object.defineProperty(g,"getCallError",{enumerable:!0,get:function(){return gU.getCallError}});var hU=gr();Object.defineProperty(g,"getContractError",{enumerable:!0,get:function(){return hU.getContractError}});var _U=xb();Object.defineProperty(g,"getEstimateGasError",{enumerable:!0,get:function(){return _U.getEstimateGasError}});var yw=ps();Object.defineProperty(g,"containsNodeError",{enumerable:!0,get:function(){return yw.containsNodeError}});Object.defineProperty(g,"getNodeError",{enumerable:!0,get:function(){return yw.getNodeError}});var vU=ai();Object.defineProperty(g,"getTransactionError",{enumerable:!0,get:function(){return vU.getTransactionError}});var gw=$o();Object.defineProperty(g,"defineBlock",{enumerable:!0,get:function(){return gw.defineBlock}});Object.defineProperty(g,"formatBlock",{enumerable:!0,get:function(){return gw.formatBlock}});var jU=Jr();Object.defineProperty(g,"extract",{enumerable:!0,get:function(){return jU.extract}});var EU=bs();Object.defineProperty(g,"defineFormatter",{enumerable:!0,get:function(){return EU.defineFormatter}});var xU=Jt();Object.defineProperty(g,"formatLog",{enumerable:!0,get:function(){return xU.formatLog}});var gh=ms();Object.defineProperty(g,"defineTransaction",{enumerable:!0,get:function(){return gh.defineTransaction}});Object.defineProperty(g,"formatTransaction",{enumerable:!0,get:function(){return gh.formatTransaction}});Object.defineProperty(g,"transactionType",{enumerable:!0,get:function(){return gh.transactionType}});var wU=Bs();Object.defineProperty(g,"defineTransactionReceipt",{enumerable:!0,get:function(){return wU.defineTransactionReceipt}});
46var hw=Nt();Object.defineProperty(g,"defineTransactionRequest",{enumerable:!0,get:function(){return hw.defineTransactionRequest}});Object.defineProperty(g,"formatTransactionRequest",{enumerable:!0,get:function(){return hw.formatTransactionRequest}});var PU=ae();Object.defineProperty(g,"getAction",{enumerable:!0,get:function(){return PU.getAction}});var qU=gd();Object.defineProperty(g,"isHash",{enumerable:!0,get:function(){return qU.isHash}});var TU=Je();Object.defineProperty(g,"keccak256",{enumerable:!0,get:function(){return TU.keccak256}});var AU=Uy();Object.defineProperty(g,"ripemd160",{enumerable:!0,get:function(){return AU.ripemd160}});var IU=cc();Object.defineProperty(g,"sha256",{enumerable:!0,get:function(){return IU.sha256}});var OU=Ly();Object.defineProperty(g,"toEventHash",{enumerable:!0,get:function(){return OU.toEventHash}});var _w=Pn();Object.defineProperty(g,"toEventSelector",{enumerable:!0,get:function(){return _w.toEventSelector}});Object.defineProperty(g,"getEventSelector",{enumerable:!0,get:function(){return _w.toEventSelector}});var vw=Dy();Object.defineProperty(g,"toEventSignature",{enumerable:!0,get:function(){return vw.toEventSignature}});Object.defineProperty(g,"getEventSignature",{enumerable:!0,get:function(){return vw.toEventSignature}});var BU=$y();Object.defineProperty(g,"toFunctionHash",{enumerable:!0,get:function(){return BU.toFunctionHash}});var jw=Fr();Object.defineProperty(g,"toFunctionSelector",{enumerable:!0,get:function(){return jw.toFunctionSelector}});Object.defineProperty(g,"getFunctionSelector",{enumerable:!0,get:function(){return jw.toFunctionSelector}});var Ew=Gy();Object.defineProperty(g,"toFunctionSignature",{enumerable:!0,get:function(){return Ew.toFunctionSignature}});Object.defineProperty(g,"getFunctionSignature",{enumerable:!0,get:function(){return Ew.toFunctionSignature}});var xw=Vy();Object.defineProperty(g,"createNonceManager",{enumerable:!0,get:function(){return xw.createNonceManager}});Object.defineProperty(g,"nonceManager",{enumerable:!0,get:function(){return xw.nonceManager}});var hh=jo();Object.defineProperty(g,"arrayRegex",{enumerable:!0,get:function(){return hh.arrayRegex}});Object.defineProperty(g,"bytesRegex",{enumerable:!0,get:function(){return hh.bytesRegex}});Object.defineProperty(g,"integerRegex",{enumerable:!0,get:function(){return hh.integerRegex}});var ww=eg();Object.defineProperty(g,"getSocket",{enumerable:!0,get:function(){return ww.getSocket}});Object.defineProperty(g,"rpc",{enumerable:!0,get:function(){return ww.rpc}});var SU=wd();Object.defineProperty(g,"getHttpRpcClient",{enumerable:!0,get:function(){return SU.getHttpRpcClient}});var Pw=Xy();Object.defineProperty(g,"getSocketRpcClient",{enumerable:!0,get:function(){return Pw.getSocketRpcClient}});Object.defineProperty(g,"socketClientCache",{enumerable:!0,get:function(){return Pw.socketClientCache}});var CU=qd();Object.defineProperty(g,"getWebSocketRpcClient",{enumerable:!0,get:function(){return CU.getWebSocketRpcClient}});var RU=Ms();Object.defineProperty(g,"hashMessage",{enumerable:!0,get:function(){return RU.hashMessage}});var qw=Ns();Object.defineProperty(g,"hashStruct",{enumerable:!0,get:function(){return qw.hashStruct}});Object.defineProperty(g,"hashTypedData",{enumerable:!0,get:function(){return qw.hashTypedData}});var MU=Id();Object.defineProperty(g,"isErc6492Signature",{enumerable:!0,get:function(){return MU.isErc6492Signature}});var kU=uf();Object.defineProperty(g,"isErc8010Signature",{enumerable:!0,get:function(){return kU.isErc8010Signature}});var NU=$g();Object.defineProperty(g,"parseErc6492Signature",{enumerable:!0,get:function(){return NU.parseErc6492Signature}});var HU=Vg();Object.defineProperty(g,"parseErc8010Signature",{enumerable:!0,get:function(){return HU.parseErc8010Signature}});var FU=vr();Object.defineProperty(g,"recoverAddress",{enumerable:!0,get:function(){return FU.recoverAddress}});var zU=cf();Object.defineProperty(g,"recoverMessageAddress",{enumerable:!0,get:function(){return zU.recoverMessageAddress}});var UU=Lu();Object.defineProperty(g,"recoverPublicKey",{enumerable:!0,get:function(){return UU.recoverPublicKey}});var LU=df();Object.defineProperty(g,"recoverTypedDataAddress",{enumerable:!0,get:function(){return LU.recoverTypedDataAddress}});var DU=Yg();Object.defineProperty(g,"serializeErc6492Signature",{enumerable:!0,get:function(){return DU.serializeErc6492Signature}});var $U=Xg();Object.defineProperty(g,"serializeErc8010Signature",{enumerable:!0,get:function(){return $U.serializeErc8010Signature}});var GU=eh();Object.defineProperty(g,"verifyHash",{enumerable:!0,get:function(){return GU.verifyHash}});var VU=rh();Object.defineProperty(g,"verifyMessage",{enumerable:!0,get:function(){return VU.verifyMessage}});var WU=sh();Object.defineProperty(g,"verifyTypedData",{enumerable:!0,get:function(){return WU.verifyTypedData}
46});var KU=Ce();Object.defineProperty(g,"stringify",{enumerable:!0,get:function(){return KU.stringify}});var ZU=Ht();Object.defineProperty(g,"assertRequest",{enumerable:!0,get:function(){return ZU.assertRequest}});var _h=yi();Object.defineProperty(g,"assertTransactionEIP1559",{enumerable:!0,get:function(){return _h.assertTransactionEIP1559}});Object.defineProperty(g,"assertTransactionEIP2930",{enumerable:!0,get:function(){return _h.assertTransactionEIP2930}});Object.defineProperty(g,"assertTransactionLegacy",{enumerable:!0,get:function(){return _h.assertTransactionLegacy}});var YU=ff();Object.defineProperty(g,"getSerializedTransactionType",{enumerable:!0,get:function(){return YU.getSerializedTransactionType}});var JU=Yo();Object.defineProperty(g,"getTransactionType",{enumerable:!0,get:function(){return JU.getTransactionType}});var XU=lf();Object.defineProperty(g,"parseTransaction",{enumerable:!0,get:function(){return XU.parseTransaction}});var QU=dd();Object.defineProperty(g,"serializeAccessList",{enumerable:!0,get:function(){return QU.serializeAccessList}});var eL=_i();Object.defineProperty(g,"serializeTransaction",{enumerable:!0,get:function(){return eL.serializeTransaction}});var Tw=Ei();Object.defineProperty(g,"serializeTypedData",{enumerable:!0,get:function(){return Tw.serializeTypedData}});Object.defineProperty(g,"validateTypedData",{enumerable:!0,get:function(){return Tw.validateTypedData}});var tL=is();Object.defineProperty(g,"formatEther",{enumerable:!0,get:function(){return tL.formatEther}});var rL=$r();Object.defineProperty(g,"formatGwei",{enumerable:!0,get:function(){return rL.formatGwei}});var nL=Ao();Object.defineProperty(g,"formatUnits",{enumerable:!0,get:function(){return nL.formatUnits}});var sL=dh();Object.defineProperty(g,"parseEther",{enumerable:!0,get:function(){return sL.parseEther}});var oL=lh();Object.defineProperty(g,"parseGwei",{enumerable:!0,get:function(){return oL.parseGwei}});var iL=Ui();Object.defineProperty(g,"parseUnits",{enumerable:!0,get:function(){return iL.parseUnits}})});var Aw=p(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.formatProof=cL;var aL=mf();function uL(e){return e.map(t=>B(v({},t),{value:BigInt(t.value)}))}function cL(e){return B(v({},e),{balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?(0,aL.hexToNumber)(e.nonce):void 0,storageProof:e.storageProof?uL(e.storageProof):void 0})}});var Iw=p(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.getProof=lL;var dL=U(),fL=Aw();function lL(o,a){return y(this,arguments,function*(e,{address:t,blockNumber:r,blockTag:n,storageKeys:s}){let u=n??"latest",c=r!==void 0?(0,dL.numberToHex)(r):void 0,d=yield e.request({method:"eth_getProof",params:[t,s,c||u]});return(0,fL.formatProof)(d)})}});var Ow=p(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});Eh.getStorageAt=bL;var pL=U();function bL(o,a){return y(this,arguments,function*(e,{address:t,blockNumber:r,blockTag:n="latest",slot:s}){let u=r!==void 0?(0,pL.numberToHex)(r):void 0;return yield e.request({method:"eth_getStorageAt",params:[t,s,u||n]})})}});var yf=p(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.getTransaction=gL;var mL=Ge(),xh=U(),yL=ms();function gL(a,u){return y(this,arguments,function*(e,{blockHash:t,blockNumber:r,blockTag:n,hash:s,index:o}){let c=n||"latest",d=r!==void 0?(0,xh.numberToHex)(r):void 0,l=null;if(s?l=yield e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?l=yield e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,xh.numberToHex)(o)]},{dedupe:!0}):(d||c)&&(l=yield e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[d||c,(0,xh.numberToHex)(o)]},{dedupe:!!d})),!l)throw new mL.TransactionNotFoundError({blockHash:t,blockNumber:r,blockTag:c,hash:s,index:o});return(e.chain?.formatters?.transaction?.format||yL.formatTransaction)(l,"getTransaction")})}});var Sw=p(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.getTransactionConfirmations=vL;var Bw=ae(),hL=As(),_L=yf();function vL(n,s){return y(this,arguments,function*(e,{hash:t,transactionReceipt:r}){let[o,a]=yield Promise.all([(0,Bw.getAction)(e,hL.getBlockNumber,"getBlockNumber")({}),t?(0,Bw.getAction)(e,_L.getTransaction,"getTransaction")({hash:t}):void 0]),u=r?.blockNumber||a?.blockNumber;return u?o-u+1n:0n})}});var Th=p(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.getTransactionReceipt=xL;var jL=Ge(),EL=Bs();function xL(r,n){return y(this,arguments,function*(e,{hash:t}){let s=yield e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!s)throw new jL.TransactionReceiptNotFoundError({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||EL.formatTransactionReceipt)(s,"getTransactionReceipt")})}});var Rw=p(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.multicall=RL;var wL=jr(),PL=xs(),qL=ge(),TL=Q(),AL=mr(),IL=Xt(),OL=Qe(),BL=Er(),Cw=gr(),SL=ae(),CL=zt();function RL(e,t){return y(this,null,function*(){let{account:r,authorizationList:n,allowF
46ailure:s=!0,blockNumber:o,blockOverrides:a,blockTag:u,stateOverride:c}=t,d=t.contracts,{batchSize:l=t.batchSize??1024,deployless:f=t.deployless??!1}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},b=(()=>{if(t.multicallAddress)return t.multicallAddress;if(f)return null;if(e.chain)return(0,BL.getChainContractAddress)({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),m=[[]],h=0,_=0;for(let q=0;q<d.length;q++){let{abi:T,address:x,args:A,functionName:I}=d[q];try{let O=(0,OL.encodeFunctionData)({abi:T,args:A,functionName:I});_+=(O.length-2)/2,l>0&&_>l&&m[h].length>0&&(h++,_=(O.length-2)/2,m[h]=[]),m[h]=[...m[h],{allowFailure:!0,callData:O,target:x}]}catch(O){let S=(0,Cw.getContractError)(O,{abi:T,address:x,args:A,docsPath:"/docs/contract/multicall",functionName:I,sender:r});if(!s)throw S;m[h]=[...m[h],{allowFailure:!0,callData:"0x",target:x}]}}let E=yield Promise.allSettled(m.map(q=>(0,SL.getAction)(e,CL.readContract,"readContract")(B(v({},b===null?{code:PL.multicall3Bytecode}:{address:b}),{abi:wL.multicall3Abi,account:r,args:[q],authorizationList:n,blockNumber:o,blockOverrides:a,blockTag:u,functionName:"aggregate3",stateOverride:c})))),j=[];for(let q=0;q<E.length;q++){let T=E[q];if(T.status==="rejected"){if(!s)throw T.reason;for(let A=0;A<m[q].length;A++)j.push({status:"failure",error:T.reason,result:void 0});continue}let x=T.value;for(let A=0;A<x.length;A++){let{returnData:I,success:O}=x[A],{callData:S}=m[q][A],{abi:C,address:M,functionName:N,args:F}=d[j.length];try{if(S==="0x")throw new qL.AbiDecodingZeroDataError;if(!O)throw new AL.RawContractError({data:I});let D=(0,IL.decodeFunctionResult)({abi:C,args:F,data:I,functionName:N});j.push(s?{result:D,status:"success"}:D)}catch(D){let X=(0,Cw.getContractError)(D,{abi:C,address:M,args:F,docsPath:"/docs/contract/multicall",functionName:N});if(!s)throw X;j.push({error:X,result:void 0,status:"failure"})}}}if(j.length!==d.length)throw new TL.BaseError("multicall results mismatch");return j})}});var Oh=p(Ih=>{"use strict";Object.defineProperty(Ih,"__esModule",{value:!0});Ih.simulateBlocks=JL;var ML=Am(),kL=xe(),NL=ge(),HL=mr(),FL=Kt(),zL=Xt(),UL=Qe(),LL=Oe(),DL=U(),$L=gr(),GL=ps(),VL=$o(),WL=Jt(),KL=Nt(),ZL=rc(),YL=Ht();function JL(e,t){return y(this,null,function*(){let{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:o,traceTransfers:a,validation:u}=t;try{let c=[];for(let b of s){let m=b.blockOverrides?ML.toRpc(b.blockOverrides):void 0,h=b.calls.map(E=>{let j=E,q=j.account?(0,kL.parseAccount)(j.account):void 0,T=j.abi?(0,UL.encodeFunctionData)(j):j.data,x=B(v({},j),{data:j.dataSuffix?(0,LL.concat)([T||"0x",j.dataSuffix]):T,from:j.from??q?.address});return(0,YL.assertRequest)(x),(0,KL.formatTransactionRequest)(x)}),_=b.stateOverrides?(0,ZL.serializeStateOverride)(b.stateOverrides):void 0;c.push({blockOverrides:m,calls:h,stateOverrides:_})}let l=(typeof r=="bigint"?(0,DL.numberToHex)(r):void 0)||n;return(yield e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:o,traceTransfers:a,validation:u},l]})).map((b,m)=>B(v({},(0,VL.formatBlock)(b)),{calls:b.calls.map((h,_)=>{let{abi:E,args:j,functionName:q,to:T}=s[m].calls[_],x=h.error?.data??h.returnData,A=BigInt(h.gasUsed),I=h.logs?.map(M=>(0,WL.formatLog)(M)),O=h.status==="0x1"?"success":"failure",S=E&&O==="success"&&x!=="0x"?(0,zL.decodeFunctionResult)({abi:E,data:x,functionName:q}):null,C=(()=>{if(O==="success")return;let M;if(h.error?.data==="0x"?M=new NL.AbiDecodingZeroDataError:h.error&&(M=new HL.RawContractError(h.error)),!!M)return(0,$L.getContractError)(M,{abi:E??[],address:T??"0x",args:j,functionName:q??"<unknown>"})})();return v({data:x,gasUsed:A,logs:I,status:O},O==="success"?{result:S}:{error:C})})}))}catch(c){let d=c,l=(0,GL.getNodeError)(d,{});throw l instanceof FL.UnknownNodeError?d:l}})}});var kw=p(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.normalizeSignature=QL;Vi.isArgOfType=Sh;Vi.getAmbiguousTypes=Mw;var Bh=Ai(),XL=at();function QL(e){let t=!0,r="",n=0,s="",o=!1;for(let a=0;a<e.length;a++){let u=e[a];if(["(",")",","].includes(u)&&(t=!0),u==="("&&n++,u===")"&&n--,!!t){if(n===0){if(u===" "&&["event","function","error",""].includes(s))s="";else if(s+=u,u===")"){o=!0;break}continue}if(u===" "){e[a-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}s+=u,r+=u}}if(!o)throw new XL.BaseError("Unable to normalize signature.");return s}function Sh(e,t){let r=typeof e,n=t.type;switch(n){case"address":return Bh.validate(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>Sh(Object.values(e)[o],s)):/^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(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(s=>Sh(s,B(v({},t),{type:n.replace(/(\[[0-9]{0,}\])$/,"")}))):!1}}function Mw(e,t,r){for(let n in e){let s=e[n],o=t[n];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return Mw(s.components,o.components,r[n]);let a=[s.type,o.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Bh.validate(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?Bh.validate(r[n],{strict:!1}):!1)return a}}});var Mh=p(ft=>{"use strict";
46Object.defineProperty(ft,"__esModule",{value:!0});ft.InvalidSelectorSizeError=ft.NotFoundError=ft.AmbiguityError=void 0;ft.format=tD;ft.from=rD;ft.fromAbi=hf;ft.getSelector=Nw;ft.getSignature=Hw;ft.getSignatureHash=Dn;var Js=fr(),Rh=at(),eD=Bd(),Wi=ke(),Ki=kw();function tD(e){return Js.formatAbiItem(e)}function rD(e,t={}){let{prepare:r=!0}=t,n=Array.isArray(e)||typeof e=="string"?Js.parseAbiItem(e):e;return v(v({},n),r?{hash:Dn(n)}:{})}function hf(e,t,r){let{args:n=[],prepare:s=!0}=r??{},o=Wi.validate(t,{strict:!1}),a=e.filter(d=>o?d.type==="function"||d.type==="error"?Nw(d)===Wi.slice(t,0,4):d.type==="event"?Dn(d)===t:!1:"name"in d&&d.name===t);if(a.length===0)throw new Zi({name:t});if(a.length===1)return v(v({},a[0]),s?{hash:Dn(a[0])}:{});let u;for(let d of a){if(!("inputs"in d))continue;if(!n||n.length===0){if(!d.inputs||d.inputs.length===0)return v(v({},d),s?{hash:Dn(d)}:{});continue}if(!d.inputs||d.inputs.length===0||d.inputs.length!==n.length)continue;if(n.every((f,b)=>{let m="inputs"in d&&d.inputs[b];return m?Ki.isArgOfType(f,m):!1})){if(u&&"inputs"in u&&u.inputs){let f=Ki.getAmbiguousTypes(d.inputs,u.inputs,n);if(f)throw new gf({abiItem:d,type:f[0]},{abiItem:u,type:f[1]})}u=d}}let c=(()=>{if(u)return u;let[d,...l]=a;return B(v({},d),{overloads:l})})();if(!c)throw new Zi({name:t});return v(v({},c),s?{hash:Dn(c)}:{})}function Nw(...e){let t=(()=>{if(Array.isArray(e[0])){let[r,n]=e;return hf(r,n)}return e[0]})();return Wi.slice(Dn(t),0,4)}function Hw(...e){let t=(()=>{if(Array.isArray(e[0])){let[n,s]=e;return hf(n,s)}return e[0]})(),r=typeof t=="string"?t:Js.formatAbiItem(t);return Ki.normalizeSignature(r)}function Dn(...e){let t=(()=>{if(Array.isArray(e[0])){let[r,n]=e;return hf(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:eD.keccak256(Wi.fromString(Hw(t)))}var gf=class extends Rh.BaseError{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Ki.normalizeSignature(Js.formatAbiItem(t.abiItem))}\`, and`,`\`${r.type}\` in \`${Ki.normalizeSignature(Js.formatAbiItem(r.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"})}};ft.AmbiguityError=gf;var Zi=class extends Rh.BaseError{constructor({name:t,data:r,type:n="item"}){let s=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}};ft.NotFoundError=Zi;var Ch=class extends Rh.BaseError{constructor({data:t}){super(`Selector size is invalid. Expected 4 bytes. Received ${Wi.size(t)} bytes ("${t}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}};ft.InvalidSelectorSizeError=Ch});var Uw=p($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.decode=oD;$n.encode=iD;$n.format=aD;$n.from=uD;$n.fromAbi=kh;var nD=fr(),Fw=Mh(),zw=$s(),sD=ke();function oD(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[o,a]=e;return[kh(o),a]}return e})(),{bytecode:n}=r;if(t.inputs.length===0)return;let s=r.data.replace(n,"0x");return zw.decode(t.inputs,s)}function iD(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[o,a]=e;return[kh(o),a]}return e})(),{bytecode:n,args:s}=r;return sD.concat(n,t.inputs?.length&&s?.length?zw.encode(t.inputs,s):"0x")}function aD(e){return nD.formatAbiItem(e)}function uD(e){return Fw.from(e)}function kh(e){let t=e.find(r=>r.type==="constructor");if(!t)throw new Fw.NotFoundError({name:"constructor"});return t}});var Dw=p(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.decodeData=dD;ar.decodeResult=fD;ar.encodeData=lD;ar.encodeResult=pD;ar.format=bD;ar.from=mD;ar.fromAbi=Gn;ar.getSelector=Lw;var cD=fr(),Yi=Mh(),vf=$s(),_f=ke();function dD(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[o,a,u]=e;return[Gn(o,a),u]}return e})(),{overloads:n}=t;if(_f.size(r)<4)throw new Yi.InvalidSelectorSizeError({data:r});if(t.inputs.length===0)return;let s=n?Gn([t,...n],r):t;if(!(_f.size(r)<=4))return vf.decode(s.inputs,_f.slice(r,4))}function fD(...e){let[t,r,n={}]=(()=>
46{if(Array.isArray(e[0])){let[o,a,u,c]=e;return[Gn(o,a),u,c]}return e})(),s=vf.decode(t.outputs,r,n);if(!(s&&Object.keys(s).length===0))return s&&Object.keys(s).length===1?Array.isArray(s)?s[0]:Object.values(s)[0]:s}function lD(...e){let[t,r=[]]=(()=>{if(Array.isArray(e[0])){let[d,l,f]=e;return[Gn(d,l,{args:f}),f]}let[u,c]=e;return[u,c]})(),{overloads:n}=t,s=n?Gn([t,...n],t.name,{args:r}):t,o=Lw(s),a=r.length>0?vf.encode(s.inputs,r):void 0;return a?_f.concat(o,a):o}function pD(...e){let[t,r,n={}]=(()=>{if(Array.isArray(e[0])){let[a,u,c,d]=e;return[Gn(a,u),c,d]}return e})(),{as:s="Array"}=n,o=t.outputs.length===1?[r]:Array.isArray(r)?r:s==="Object"?Object.values(r):[r];return vf.encode(t.outputs,o)}function bD(e){return cD.formatAbiItem(e)}function mD(e,t={}){return Yi.from(e,t)}function Gn(e,t,r){let n=Yi.fromAbi(e,t,r);if(n.type!=="function")throw new Yi.NotFoundError({name:t,type:"function"});return n}function Lw(e){return Yi.getSelector(e)}});var Nh=p(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.zeroAddress=St.ethAddress=St.entryPoint08Address=St.entryPoint07Address=St.entryPoint06Address=void 0;St.entryPoint06Address="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";St.entryPoint07Address="0x0000000071727De22E5E9d8BAf0edAc6f37da032";St.entryPoint08Address="0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108";St.ethAddress="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";St.zeroAddress="0x0000000000000000000000000000000000000000"});var Vw=p(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.simulateCalls=xD;var $w=Uw(),Vn=Dw(),yD=xe(),Lt=Nh(),gD=xs(),hD=Q(),_D=Qe(),Gw=mf(),vD=ey(),jD=Oh(),ED="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";function xD(e,t){return y(this,null,function*(){let{blockNumber:r,blockTag:n,calls:s,stateOverrides:o,traceAssetChanges:a,traceTransfers:u,validation:c}=t,d=t.account?(0,yD.parseAccount)(t.account):void 0;if(a&&!d)throw new hD.BaseError("`account` is required when `traceAssetChanges` is true");let l=d?$w.encode($w.from("constructor(bytes, bytes)"),{bytecode:gD.deploylessCallViaBytecodeBytecode,args:[ED,Vn.encodeData(Vn.from("function getBalance(address)"),[d.address])]}):void 0,f=a?yield Promise.all(t.calls.map(z=>y(null,null,function*(){if(!z.data&&!z.abi)return;let{accessList:$}=yield(0,vD.createAccessList)(e,B(v({account:d.address},z),{data:z.abi?(0,_D.encodeFunctionData)(z):z.data}));return $.map(({address:oe,storageKeys:je})=>je.length>0?oe:null)}))).then(z=>z.flat().filter(Boolean)):[],b=yield(0,jD.simulateBlocks)(e,{blockNumber:r,blockTag:n,blocks:[...a?[{calls:[{data:l}],stateOverrides:o},{calls:f.map((z,$)=>({abi:[Vn.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[d.address],to:z,from:Lt.zeroAddress,nonce:$})),stateOverrides:[{address:Lt.zeroAddress,nonce:0}]}]:[],{calls:[...s,{}].map(z=>B(v({},z),{from:d?.address})),stateOverrides:o},...a?[{calls:[{data:l}]},{calls:f.map((z,$)=>({abi:[Vn.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[d.address],to:z,from:Lt.zeroAddress,nonce:$})),stateOverrides:[{address:Lt.zeroAddress,nonce:0}]},{calls:f.map((z,$)=>({to:z,abi:[Vn.from("function decimals() returns (uint256)")],functionName:"decimals",from:Lt.zeroAddress,nonce:$})),stateOverrides:[{address:Lt.zeroAddress,nonce:0}]},{calls:f.map((z,$)=>({to:z,abi:[Vn.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Lt.zeroAddress,nonce:$})),stateOverrides:[{address:Lt.zeroAddress,nonce:0}]},{calls:f.map((z,$)=>({to:z,abi:[Vn.from("function symbol() returns (string)")],functionName:"symbol",from:Lt.zeroAddress,nonce:$})),stateOverrides:[{address:Lt.zeroAddress,nonce:0}]}]:[]],traceTransfers:u,validation:c}),m=a?b[2]:b[0],[h,_,,E,j,q,T,x]=a?b:[],J=m,{calls:A}=J,I=G(J,["calls"]),O=A.slice(0,-1)??[],S=h?.calls??[],C=_?.calls??[],M=[...S,...C].map(z=>z.status==="success"?(0,Gw.hexToBigInt)(z.data):null),N=E?.calls??[],F=j?.calls??[],D=[...N,...F].map(z=>z.status==="success"?(0,Gw.hexToBigInt)(z.data):null),X=(q?.calls??[]).map(z=>z.status==="success"?z.result:null),H=(x?.calls??[]).map(z=>z.status==="success"?z.result:null),k=(T?.calls??[]).map(z=>z.status==="success"?z.result:null),L=[];for(let[z,$]of D.entries()){let oe=M[z];if(typeof $!="bigint"||typeof oe!="bigint")continue;let je=X[z-1],Te=H[z-1],lt=k[z-1],He=z===0?{address:Lt.ethAddress,decimals:18,symbol
46:"ETH"}:{address:f[z-1],decimals:lt||je?Number(je??1):void 0,symbol:Te??void 0};L.some(Ir=>Ir.token.address===He.address)||L.push({token:He,value:{pre:oe,post:$,diff:$-oe}})}return{assetChanges:L,block:I,results:O}})}});var Zw=p(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.InvalidWrappedSignatureError=Le.universalSignatureValidatorAbi=Le.universalSignatureValidatorBytecode=Le.magicBytes=void 0;Le.assert=Fh;Le.from=PD;Le.unwrap=Kw;Le.wrap=qD;Le.validate=TD;var jf=$s(),wD=at(),Ww=ke();Le.magicBytes="0x6492649264926492649264926492649264926492649264926492649264926492";Le.universalSignatureValidatorBytecode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
46603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";Le.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"}];function Fh(e){if(Ww.slice(e,-32)!==Le.magicBytes)throw new Ef(e)}function PD(e){return typeof e=="string"?Kw(e):e}function Kw(e){Fh(e);let[t,r,n]=jf.decode(jf.from("address, bytes, bytes"),e);return{data:r,signature:n,to:t}}function qD(e){let{data:t,signature:r,to:n}=e;return Ww.concat(jf.encode(jf.from("address, bytes, bytes"),[n,t,r]),Le.magicBytes)}function TD(e){try{return Fh(e),!0}catch(t){return!1}}var Ef=class extends wD.BaseError{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}};Le.InvalidWrappedSignatureError=Ef});var Yw=p(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.SignatureErc6492=void 0;xf.SignatureErc6492=Zw()});var Uh=p(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.serializeSignature=OD;var AD=Yr(),Jw=Ee(),ID=de();function OD({r:e,s:t,to:r="hex",v:n,yParity:s}){let o=(()=>{if(s===0||s===1)return s;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new AD.secp256k1.Signature((0,Jw.hexToBigInt)(e),(0,Jw.hexToBigInt)(t)).toCompactHex()}${o===0?"1b":"1c"}`;return r==="hex"?a:(0,ID.hexToBytes)(a)}});var Qi=p(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.verifyHash=LD;Xi.verifyErc8010=sP;Xi.verifyErc1271=oP;var Xw=Yw(),Qw=Mi(),Ji=jr(),eP=xs(),tP=mr(),BD=Ps(),rP=Qe(),SD=rt(),CD=Tt(),RD=Sy(),MD=Oe(),kD=$e(),ND=Ee(),Lh=U(),Dh=ae(),HD=vr(),FD=Uh(),zD=Ts(),UD=dy(),nP=zt();function LD(e,t){return y(this,null,function*(){let{address:r,hash:n,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??e.chain?.contracts?.erc6492Verifier?.address,multicallAddress:o=t.multicallAddress??e.chain?.contracts?.multicall3?.address}=t,a=(()=>{let u=t.signature;return(0,kD.isHex)(u)?u:typeof u=="object"&&"r"in u&&"s"in u?(0,FD.serializeSignature)(u):(0,Lh.bytesToHex)(u)})();try{return Qw.SignatureErc8010.validate(a)?yield sP(e,B(v({},t),{multicallAddress:o,signature:a})):yield DD(e,B(v({},t),{verifierAddress:s,signature:a}))}catch(u){try{if((0,CD.isAddressEqual)((0,SD.getAddress)(r),yield(0,HD.recoverAddress)({hash:n,signature:a})))return!0}catch(c){}if(u instanceof Ar)return!1;throw u}})}function sP(e,t){return y(this,null,function*(){let{address:r,blockNumber:n,blockTag:s,hash:o,multicallAddress:a}=t,{authorization:u,data:c,signature:d,to:l}=Qw.SignatureErc8010.unwrap(t.signature);if((yield(0,UD.getCode)(e,{address:r,blockNumber:n,blockTag:s}))===(0,MD.concatHex)(["0xef0100",u.address]))return yield oP(e,{address:r,blockNumber:n,blockTag:s,hash:o,signature:d});let b={address:u.address,chainId:Number(u.chainId),nonce:Number(u.nonce),r:(0,Lh.numberToHex)(u.r,{size:32}),s:(0,Lh.numberToHex)(u.s,{size:32}),yParity:u.yParity};if(!(yield(0,RD.verifyAuthorization)({address:r,authorization:b})))throw new Ar;let h=yield(0,Dh.getAction)(e,nP.readContract,"readContract")(B(v({},a?{address:a}:{code:eP.multicall3Bytecode}),{authorizationList:[b],abi:Ji.multicall3Abi,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??r,callData:c}
46]:[],{allowFailure:!0,target:r,callData:(0,rP.encodeFunctionData)({abi:Ji.erc1271Abi,functionName:"isValidSignature",args:[o,d]})}]]}));if(h[h.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new Ar})}function DD(e,t){return y(this,null,function*(){let b=t,{address:r,factory:n,factoryData:s,hash:o,signature:a,verifierAddress:u}=b,c=G(b,["address","factory","factoryData","hash","signature","verifierAddress"]),d=yield y(null,null,function*(){return!n&&!s||Xw.SignatureErc6492.validate(a)?a:Xw.SignatureErc6492.wrap({data:s,signature:a,to:n})}),l=v(u?{to:u,data:(0,rP.encodeFunctionData)({abi:Ji.erc6492SignatureValidatorAbi,functionName:"isValidSig",args:[r,o,d]})}:{data:(0,BD.encodeDeployData)({abi:Ji.erc6492SignatureValidatorAbi,args:[r,o,d],bytecode:eP.erc6492SignatureValidatorByteCode})},c),{data:f}=yield(0,Dh.getAction)(e,zD.call,"call")(l).catch(m=>{throw m instanceof tP.CallExecutionError?new Ar:m});if((0,ND.hexToBool)(f??"0x0"))return!0;throw new Ar})}function oP(e,t){return y(this,null,function*(){let{address:r,blockNumber:n,blockTag:s,hash:o,signature:a}=t;if((yield(0,Dh.getAction)(e,nP.readContract,"readContract")({address:r,abi:Ji.erc1271Abi,args:[o,a],blockNumber:n,blockTag:s,functionName:"isValidSignature"}).catch(c=>{throw c instanceof tP.ContractFunctionExecutionError?new Ar:c})).startsWith("0x1626ba7e"))return!0;throw new Ar})}var Ar=class extends Error{}});var iP=p($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.verifyMessage=VD;var $D=Ms(),GD=Qi();function VD(e,u){return y(this,null,function*(){var c=u,{address:t,message:r,factory:n,factoryData:s,signature:o}=c,a=G(c,["address","message","factory","factoryData","signature"]);let d=(0,$D.hashMessage)(r);return(0,GD.verifyHash)(e,v({address:t,factory:n,factoryData:s,hash:d,signature:o},a))})}});var aP=p(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.verifyTypedData=ZD;var WD=Ns(),KD=Qi();function ZD(e,t){return y(this,null,function*(){let b=t,{address:r,factory:n,factoryData:s,signature:o,message:a,primaryType:u,types:c,domain:d}=b,l=G(b,["address","factory","factoryData","signature","message","primaryType","types","domain"]),f=(0,WD.hashTypedData)({message:a,primaryType:u,types:c,domain:d});return(0,KD.verifyHash)(e,v({address:r,factory:n,factoryData:s,hash:f,signature:o},l))})}});var Wh=p(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.watchBlockNumber=e$;var YD=Ee(),JD=ae(),uP=sn(),XD=kn(),cP=Ce(),QD=As();function e$(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:s,poll:o,pollingInterval:a=e.pollingInterval}){let u=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
46onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),c;return u?(()=>{let f=(0,cP.stringify)(["watchBlockNumber",e.uid,t,r,a]);return(0,uP.observe)(f,{onBlockNumber:n,onError:s},b=>(0,XD.poll)(()=>y(null,null,function*(){try{let m=yield(0,JD.getAction)(e,QD.getBlockNumber,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(m===c)return;if(m-c>1&&r)for(let h=c+1n;h<m;h++)b.onBlockNumber(h,c),c=h}(c===void 0||m>c)&&(b.onBlockNumber(m,c),c=m)}catch(m){b.onError?.(m)}}),{emitOnBegin:t,interval:a}))})():(()=>{let f=(0,cP.stringify)(["watchBlockNumber",e.uid,t,r]);return(0,uP.observe)(f,{onBlockNumber:n,onError:s},b=>{let m=!0,h=()=>m=!1;return y(null,null,function*(){try{let _=(()=>{if(e.transport.type==="fallback"){let j=e.transport.transports.find(q=>q.config.type==="webSocket"||q.config.type==="ipc");return j?j.value:e.transport}return e.transport})(),{unsubscribe:E}=yield _.subscribe({params:["newHeads"],onData(j){if(!m)return;let q=(0,YD.hexToBigInt)(j.result?.number);b.onBlockNumber(q,c),c=q},onError(j){b.onError?.(j)}});h=E,m||h()}catch(_){s?.(_)}}),()=>h()})})()}});var Jh=p(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.waitForTransactionReceipt=u$;var t$=oc(),Kh=Ge(),Xs=ae(),r$=sn(),n$=Ac(),dP=fi(),s$=Ce(),o$=Sn(),i$=yf(),Zh=Th(),a$=Wh();function u$(e,t){return y(this,null,function*(){let{checkReplacement:r=!0,confirmations:n=1,hash:s,onReplaced:o,retryCount:a=6,retryDelay:u=({count:A})=>~~(1<<A)*200,timeout:c=18e4}=t,d=(0,s$.stringify)(["waitForTransactionReceipt",e.uid,s]),l=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,f,b,m,h=!1,_,E,{promise:j,resolve:q,reject:T}=(0,n$.withResolvers)(),x=c?setTimeout(()=>{E?.(),_?.(),T(new Kh.WaitForTransactionReceiptTimeoutError({hash:s}))},c):void 0;return _=(0,r$.observe)(d,{onReplaced:o,resolve:q,reject:T},A=>y(null,null,function*(){if(m=yield(0,Xs.getAction)(e,Zh.getTransactionReceipt,"getTransactionReceipt")({hash:s}).catch(()=>{}),m&&n<=1){clearTimeout(x),A.resolve(m),_?.();return}E=(0,Xs.getAction)(e,a$.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:l,onBlockNumber(O){return y(this,null,function*(){let S=M=>{clearTimeout(x),E?.(),M(),_?.()},C=O;if(!h)try{if(m){if(n>1&&(!m.blockNumber||C-m.blockNumber+1n<n))return;S(()=>A.resolve(m));return}if(r&&!f&&(h=!0,yield(0,dP.withRetry)(()=>y(null,null,function*(){f=yield(0,Xs.getAction)(e,i$.getTransaction,"getTransaction")({hash:s}),f.blockNumber&&(C=f.blockNumber)}),{delay:u,retryCount:a}),h=!1),m=yield(0,Xs.getAction)(e,Zh.getTransactionReceipt,"getTransactionReceipt")({hash:s}),n>1&&(!m.blockNumber||C-m.blockNumber+1n<n))return;S(()=>A.resolve(m))}
46catch(M){if(M instanceof Kh.TransactionNotFoundError||M instanceof Kh.TransactionReceiptNotFoundError){if(!f){h=!1;return}try{b=f,h=!0;let N=yield(0,dP.withRetry)(()=>(0,Xs.getAction)(e,o$.getBlock,"getBlock")({blockNumber:C,includeTransactions:!0}),{delay:u,retryCount:a,shouldRetry:({error:X})=>X instanceof t$.BlockNotFoundError});h=!1;let F=N.transactions.find(({from:X,nonce:H})=>X===b.from&&H===b.nonce);if(!F||(m=yield(0,Xs.getAction)(e,Zh.getTransactionReceipt,"getTransactionReceipt")({hash:F.hash}),n>1&&(!m.blockNumber||C-m.blockNumber+1n<n)))return;let D="replaced";F.to===b.to&&F.value===b.value&&F.input===b.input?D="repriced":F.from===F.to&&F.value===0n&&(D="cancelled"),S(()=>{A.onReplaced?.({reason:D,replacedTransaction:b,transaction:F,transactionReceipt:m}),A.resolve(m)})}catch(N){S(()=>A.reject(N))}}else S(()=>A.reject(M))}})}})})),j})}});var fP=p(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.watchBlocks=l$;var wf=ae(),c$=sn(),d$=kn(),f$=Ce(),Pf=Sn();function l$(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:s,onError:o,includeTransactions:a,poll:u,pollingInterval:c=e.pollingInterval}){let d=typeof u<"u"?u:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
46onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),l=a??!1,f;return d?(()=>{let h=(0,f$.stringify)(["watchBlocks",e.uid,t,r,n,l,c]);return(0,c$.observe)(h,{onBlock:s,onError:o},_=>(0,d$.poll)(()=>y(null,null,function*(){try{let E=yield(0,wf.getAction)(e,Pf.getBlock,"getBlock")({blockTag:t,includeTransactions:l});if(E.number!==null&&f?.number!=null){if(E.number===f.number)return;if(E.number-f.number>1&&r)for(let j=f?.number+1n;j<E.number;j++){let q=yield(0,wf.getAction)(e,Pf.getBlock,"getBlock")({blockNumber:j,includeTransactions:l});_.onBlock(q,f),f=q}}(f?.number==null||t==="pending"&&E?.number==null||E.number!==null&&E.number>f.number)&&(_.onBlock(E,f),f=E)}catch(E){_.onError?.(E)}}),{emitOnBegin:n,interval:c}))})():(()=>{let h=!0,_=!0,E=()=>h=!1;return y(null,null,function*(){try{let T;n&&(0,wf.getAction)(e,Pf.getBlock,"getBlock")({blockTag:t,includeTransactions:l}).then(x=>{h&&_&&(s(x,void 0),_=!1)}).catch(o);let j=(()=>{if(e.transport.type==="fallback"){let x=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return x?x.value:e.transport}return e.transport})(),{unsubscribe:q}=yield j.subscribe({params:["newHeads"],onData(x){return y(this,null,function*(){if(!h)return;let A=yield(0,wf.getAction)(e,Pf.getBlock,"getBlock")({blockNumber:x.result?.number,includeTransactions:l}).catch(()=>{});h&&(s(A,f),_=!1,f=A)})},onError(x){o?.(x)}});E=q,h||E()}catch(j){o?.(j)}}),()=>E()})()}});var bP=p(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.watchEvent=w$;var lP=ge(),p$=yr(),b$=hs(),m$=zr(),pP=Jt(),ea=ae(),y$=sn(),g$=kn(),h$=Ce(),_$=ny(),v$=As(),j$=si(),E$=yc(),x$=oi();function w$(e,{address:t,args:r,batch:n=!0,event:s,events:o,fromBlock:a,onError:u,onLogs:c,poll:d,pollingInterval:l=e.pollingInterval,strict:f}){let b=typeof d<"u"?d:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
46onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),m=f??!1;return b?(()=>{let E=(0,h$.stringify)(["watchEvent",t,r,n,e.uid,s,l,a]);return(0,y$.observe)(E,{onLogs:c,onError:u},j=>{let q;a!==void 0&&(q=a-1n);let T,x=!1,A=(0,g$.poll)(()=>y(null,null,function*(){if(!x){try{T=yield(0,ea.getAction)(e,_$.createEventFilter,"createEventFilter")({address:t,args:r,event:s,events:o,strict:m,fromBlock:a})}catch(I){}x=!0;return}try{let I;if(T)I=yield(0,ea.getAction)(e,j$.getFilterChanges,"getFilterChanges")({filter:T});else{let O=yield(0,ea.getAction)(e,v$.getBlockNumber,"getBlockNumber")({});q&&q!==O?I=yield(0,ea.getAction)(e,E$.getLogs,"getLogs")({address:t,args:r,event:s,events:o,fromBlock:q+1n,toBlock:O}):I=[],q=O}if(I.length===0)return;if(n)j.onLogs(I);else for(let O of I)j.onLogs([O])}catch(I){T&&I instanceof p$.InvalidInputRpcError&&(x=!1),j.onError?.(I)}}),{emitOnBegin:!0,interval:l});return()=>y(null,null,function*(){T&&(yield(0,ea.getAction)(e,x$.uninstallFilter,"uninstallFilter")({filter:T})),A()})})})():(()=>{let E=!0,j=()=>E=!1;return y(null,null,function*(){try{let q=(()=>{if(e.transport.type==="fallback"){let I=e.transport.transports.find(O=>O.config.type==="webSocket"||O.config.type==="ipc");return I?I.value:e.transport}return e.transport})(),T=o??(s?[s]:void 0),x=[];T&&(x=[T.flatMap(O=>(0,m$.encodeEventTopics)({abi:[O],eventName:O.name,args:r}))],s&&(x=x[0]));let{unsubscribe:A}=yield q.subscribe({params:["logs",{address:t,topics:x}],onData(I){if(!E)return;let O=I.result;try{let{eventName:S,args:C}=(0,b$.decodeEventLog)({abi:T??[],data:O.data,topics:O.topics,strict:m}),M=(0,pP.formatLog)(O,{args:C,eventName:S});c([M])}catch(S){let C,M;if(S instanceof lP.DecodeLogDataMismatch||S instanceof lP.DecodeLogTopicsMismatch){if(f)return;C=S.abiItem.name,M=S.abiItem.inputs?.some(F=>!("name"in F&&F.name))}let N=(0,pP.formatLog)(O,{args:M?[]:{},eventName:C});c([N])}},onError(I){u?.(I)}});j=A,E||j()}catch(q){u?.(q)}}),()=>j()})()}});var mP=p(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.watchPendingTransactions=B$;var e_=ae(),P$=sn(),q$=kn(),T$=Ce(),A$=oy(),I$=si(),O$=oi();function B$(e,{batch:t=!0,onError:r,onTransactions:n,poll:s,pollingInterval:o=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{let d=(0,T$.stringify)(["watchPendingTransactions",e.uid,t,o]);return(0,P$.observe)(d,{onTransactions:n,onError:r},l=>{let f,b=(0,q$.poll)(()=>y(null,null,function*(){try{if(!f)try{f=yield(0,e_.getAction)(e,A$.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(h){throw b(),h}let m=yield(0,e_.getAction)(e,I$.getFilterChanges,"getFilterChanges")({filter:f});if(m.length===0)return;if(t)l.onTransactions(m);else for(let h of m)l.onTransactions([h])}catch(m){l.onError?.(m)}}),{emitOnBegin:!0,interval:o});return()=>y(null,null,function*(){f&&(yield(0,e_.getAction)(e,O$.uninstallFilter,"uninstallFilter")({filter:f})),b()})})})():(()=>{let d=!0,l=()=>d=!1;return y(null,null,function*(){try{let{unsubscribe:f}=yield e.transport.subscribe({params:["newPendingTransactions"],onData(b){if(!d)return;let m=b.result;n([m])},onError(b){r?.(b)}});l=f,d||l()}catch(f){r?.(f)}}),()=>l()})()}});var yP=p(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.parseSiweMessage=S$;function S$(e){let f=e.match(C$)?.groups??{},{scheme:t,statement:r}=f,n=G(f,["scheme","statement"]),b=e.match(R$)?.groups??{},{chainId:s,expirationTime:o,issuedAt:a,notBefore:u,requestId:c}=b,d=G(b,["chainId","expirationTime","issuedAt","notBefore","requestId"]),l=e.split("Resources:")[1]?.split(` 47- `).slice(1);return v(v(v(v(v(v(v(v(v(v({},n),d),s?{chainId:Number(s)}:{}),o?{expirationTime:new Date(o)}:{}),a?{issuedAt:new Date(a)}:{}),u?{notBefore:new Date(u)}:{}),c?{requestId:c}:{}),l?{resources:l}:{}),t?{scheme:t}:{}),r?{statement:r}:{})}var C$=/^(?:(?<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)?/,R$=/(?: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>.+))?/});var gP=p(n_=>{"use strict";
47Object.defineProperty(n_,"__esModule",{value:!0});n_.validateSiweMessage=N$;var M$=Xe(),k$=Tt();function N$(e){let{address:t,domain:r,message:n,nonce:s,scheme:o,time:a=new Date}=e;if(r&&n.domain!==r||s&&n.nonce!==s||o&&n.scheme!==o||n.expirationTime&&a>=n.expirationTime||n.notBefore&&a<n.notBefore)return!1;try{if(!n.address||!(0,M$.isAddress)(n.address,{strict:!1})||t&&!(0,k$.isAddressEqual)(n.address,t))return!1}catch(u){return!1}return!0}});var hP=p(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});s_.verifySiweMessage=L$;var H$=Ms(),F$=yP(),z$=gP(),U$=Qi();function L$(e,t){return y(this,null,function*(){let m=t,{address:r,domain:n,message:s,nonce:o,scheme:a,signature:u,time:c=new Date}=m,d=G(m,["address","domain","message","nonce","scheme","signature","time"]),l=(0,F$.parseSiweMessage)(s);if(!l.address||!(0,z$.validateSiweMessage)({address:r,domain:n,message:l,nonce:o,scheme:a,time:c}))return!1;let b=(0,H$.hashMessage)(s);return(0,U$.verifyHash)(e,v({address:l.address,hash:b,signature:u},d))})}});var qf=p(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});o_.sendRawTransactionSync=V$;var D$=Ge(),$$=Bs(),G$=mf();function V$(s,o){return y(this,arguments,function*(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:n}){let a=yield e.request({method:"eth_sendRawTransactionSync",params:n?[t,(0,G$.numberToHex)(n)]:[t]},{retryCount:0}),c=(e.chain?.formatters?.transactionReceipt?.format||$$.formatTransactionReceipt)(a);if(c.status==="reverted"&&r)throw new D$.TransactionReceiptRevertedError({receipt:c});return c})}});var a_=p(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});i_.publicActions=GG;var W$=gE(),K$=PE(),Z$=qE(),Y$=TE(),J$=Z1(),X$=Ts(),Q$=ey(),eG=AE(),tG=Wa(),rG=ny(),nG=oy(),sG=nm(),oG=Nb(),iG=mc(),aG=kb(),uG=OE(),cG=BE(),dG=Sn(),fG=As(),lG=SE(),pG=tn(),_P=dy(),bG=gc(),mG=RE(),yG=NE(),gG=si(),hG=HE(),_G=ic(),vG=yc(),jG=Iw(),EG=Ow(),xG=yf(),wG=Sw(),PG=Go(),qG=Th(),TG=Rw(),AG=zt(),vP=Oh(),IG=Vw(),OG=o1(),BG=oi(),SG=Qi(),CG=iP(),RG=aP(),MG=Jh(),kG=Wh(),NG=fP(),HG=l1(),FG=bP(),zG=mP(),UG=hP(),LG=ys(),DG=Hc(),$G=qf();function GG(e){return{call:t=>(0,X$.call)(e,t),createAccessList:t=>(0,Q$.createAccessList)(e,t),createBlockFilter:()=>(0,eG.createBlockFilter)(e),createContractEventFilter:t=>(0,tG.createContractEventFilter)(e,t),createEventFilter:t=>(0,rG.createEventFilter)(e,t),createPendingTransactionFilter:()=>(0,nG.createPendingTransactionFilter)(e),estimateContractGas:t=>(0,sG.estimateContractGas)(e,t),estimateGas:t=>(0,iG.estimateGas)(e,t),getBalance:t=>(0,uG.getBalance)(e,t),getBlobBaseFee:()=>(0,cG.getBlobBaseFee)(e),getBlock:t=>(0,dG.getBlock)(e,t),getBlockNumber:t=>(0,fG.getBlockNumber)(e,t),getBlockTransactionCount:t=>(0,lG.getBlockTransactionCount)(e,t),getBytecode:t=>(0,_P.getCode)(e,t),getChainId:()=>(0,pG.getChainId)(e),getCode:t=>(0,_P.getCode)(e,t),getContractEvents:t=>(0,bG.getContractEvents)(e,t),getEip712Domain:t=>(0,mG.getEip712Domain)(e,t),getEnsAddress:t=>(0,W$.getEnsAddress)(e,t),getEnsAvatar:t=>(0,K$.getEnsAvatar)(e,t),getEnsName:t=>(0,Z$.getEnsName)(e,t),getEnsResolver:t=>(0,Y$.getEnsResolver)(e,t),getEnsText:t=>(0,J$.getEnsText)(e,t),getFeeHistory:t=>(0,yG.getFeeHistory)(e,t),estimateFeesPerGas:t=>(0,oG.estimateFeesPerGas)(e,t),getFilterChanges:t=>(0,gG.getFilterChanges)(e,t),getFilterLogs:t=>(0,hG.getFilterLogs)(e,t),getGasPrice:()=>(0,_G.getGasPrice)(e),getLogs:t=>(0,vG.getLogs)(e,t),getProof:t=>(0,jG.getProof)(e,t),estimateMaxPriorityFeePerGas:t=>(0,aG.estimateMaxPriorityFeePerGas)(e,t),getStorageAt:t=>(0,EG.getStorageAt)(e,t),getTransaction:t=>(0,xG.getTransaction)(e,t),getTransactionConfirmations:t=>(0,wG.getTransactionConfirmations)(e,t),getTransactionCount:t=>(0,PG.getTransactionCount)(e,t),getTransactionReceipt:t=>(0,qG.getTransactionReceipt)(e,t),multicall:t=>(0,TG.multicall)(e,t),prepareTransactionRequest:t=>(0,LG.prepareTransactionRequest)(e,t),readContract:t=>(0,AG.readContract)(e,t),sendRawTransaction:t=>(0,DG.sendRawTransaction)(e,t),sendRawTransactionSync:t=>(0,$G.sendRawTransactionSync)(e,t),simulate:t=>(0,vP.simulateBlocks)(e,t),simulateBlocks:t=>(0,vP.simulateBlocks)(e,t),simulateCalls:t=>(0,IG.simulateCalls)(e,t),simulateContract:t=>(0,OG.simulateContract)(e,t),verifyHash:t=>(0,SG.verifyHash)(e,t),verifyMessage:t=>(0,CG.verifyMessage)(e,t),verifySiweMessage:t=>(0,UG.verifySiweMessage)(e,t),verifyTypedData:t=>(0,RG.verifyTypedData)(e,t),uninstallFilter:t=>(0,BG.uninstallFilter)(e,t),waitForTransactionReceipt:t=>(0,MG.waitForTransactionReceipt)(e,t),watchBlocks:t=>(0,NG.watchBlocks)(e,t),watchBlockNumber:t=>(0,kG.watchBlockNumber)(e,t),watchContractEvent:t=>(0,HG.watchContractEvent)(e,t),watchEvent:t=>(0,FG.watchEvent)(e,t),watchPendingTransactions:t=>(0,zG.watchPendingTransactions)(e,t)}}});var jP=p(u_=>{"use strict";
47Object.defineProperty(u_,"__esModule",{value:!0});u_.createPublicClient=KG;var VG=pi(),WG=a_();function KG(e){let{key:t="public",name:r="Public Client"}=e;return(0,VG.createClient)(B(v({},e),{key:t,name:r,type:"publicClient"})).extend(WG.publicActions)}});var EP=p(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.dropTransaction=ZG;function ZG(r,n){return y(this,arguments,function*(e,{hash:t}){yield e.request({method:`${e.mode}_dropTransaction`,params:[t]})})}});var xP=p(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});d_.dumpState=YG;function YG(e){return y(this,null,function*(){return e.request({method:`${e.mode}_dumpState`})})}});var wP=p(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});f_.getAutomine=JG;function JG(e){return y(this,null,function*(){return e.mode==="ganache"?yield e.request({method:"eth_mining"}):yield e.request({method:`${e.mode}_getAutomine`})})}});var PP=p(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});l_.getTxpoolContent=XG;function XG(e){return y(this,null,function*(){return yield e.request({method:"txpool_content"})})}});var TP=p(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.getTxpoolStatus=QG;var qP=Ee();function QG(e){return y(this,null,function*(){let{pending:t,queued:r}=yield e.request({method:"txpool_status"});return{pending:(0,qP.hexToNumber)(t),queued:(0,qP.hexToNumber)(r)}})}});var AP=p(b_=>{"use strict";Object.defineProperty(b_,"__esModule",{value:!0});b_.impersonateAccount=eV;function eV(r,n){return y(this,arguments,function*(e,{address:t}){yield e.request({method:`${e.mode}_impersonateAccount`,params:[t]})})}});var IP=p(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});m_.increaseTime=rV;var tV=U();function rV(r,n){return y(this,arguments,function*(e,{seconds:t}){return yield e.request({method:"evm_increaseTime",params:[(0,tV.numberToHex)(t)]})})}});var OP=p(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});y_.inspectTxpool=nV;function nV(e){return y(this,null,function*(){return yield e.request({method:"txpool_inspect"})})}});var BP=p(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.loadState=sV;function sV(r,n){return y(this,arguments,function*(e,{state:t}){yield e.request({method:`${e.mode}_loadState`,params:[t]})})}});var SP=p(__=>{"use strict";
47Object.defineProperty(__,"__esModule",{value:!0});__.mine=oV;var h_=U();function oV(n,s){return y(this,arguments,function*(e,{blocks:t,interval:r}){e.mode==="ganache"?yield e.request({method:"evm_mine",params:[{blocks:(0,h_.numberToHex)(t)}]}):yield e.request({method:`${e.mode}_mine`,params:[(0,h_.numberToHex)(t),(0,h_.numberToHex)(r||0)]})})}});var CP=p(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.removeBlockTimestampInterval=iV;function iV(e){return y(this,null,function*(){yield e.request({method:`${e.mode}_removeBlockTimestampInterval`})})}});var RP=p(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});j_.reset=aV;function aV(n){return y(this,arguments,function*(e,{blockNumber:t,jsonRpcUrl:r}={}){yield e.request({method:`${e.mode}_reset`,params:[{forking:{blockNumber:Number(t),jsonRpcUrl:r}}]})})}});var MP=p(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});E_.revert=uV;function uV(r,n){return y(this,arguments,function*(e,{id:t}){yield e.request({method:"evm_revert",params:[t]})})}});var kP=p(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});x_.sendUnsignedTransaction=fV;var cV=Jr(),dV=Nt();function fV(e,t){return y(this,null,function*(){let j=t,{accessList:r,data:n,from:s,gas:o,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:c,nonce:d,to:l,value:f}=j,b=G(j,["accessList","data","from","gas","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","value"]),m=e.chain?.formatters?.transactionRequest?.format,_=(m||dV.formatTransactionRequest)(B(v({},(0,cV.extract)(b,{format:m})),{accessList:r,data:n,from:s,gas:o,gasPrice:a,maxFeePerGas:u,maxPriorityFeePerGas:c,nonce:d,to:l,value:f}),"sendUnsignedTransaction");return yield e.request({method:"eth_sendUnsignedTransaction",params:[_]})})}});var NP=p(w_=>{"use strict";Object.defineProperty(w_,"__esModule",{value:!0});w_.setAutomine=lV;function lV(e,t){return y(this,null,function*(){e.mode==="ganache"?t?yield e.request({method:"miner_start"}):yield e.request({method:"miner_stop"}):yield e.request({method:"evm_setAutomine",params:[t]})})}});var FP=p(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});P_.setBalance=pV;var HP=U();function pV(n,s){return y(this,arguments,function*(e,{address:t,value:r}){e.mode==="ganache"?yield e.request({method:"evm_setAccountBalance",params:[t,(0,HP.numberToHex)(r)]}):yield e.request({method:`${e.mode}_setBalance`,params:[t,(0,HP.numberToHex)(r)]})})}});var zP=p(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});q_.setBlockGasLimit=mV;var bV=U();function mV(r,n){return y(this,arguments,function*(e,{gasLimit:t}){yield e.request({method:"evm_setBlockGasLimit",params:[(0,bV.numberToHex)(t)]})})}});var UP=p(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});T_.setBlockTimestampInterval=yV;function yV(r,n){return y(this,arguments,function*(e,{interval:t}){let s=e.mode==="hardhat"?t*1e3:t;yield e.request({method:`${e.mode}_setBlockTimestampInterval`,params:[s]})})}});var LP=p(A_=>{"use strict";Object.defineProperty(A_,"__esModule",{value:!0});A_.setCode=gV;function gV(n,s){return y(this,arguments,function*(e,{address:t,bytecode:r}){e.mode==="ganache"?yield e.request({method:"evm_setAccountCode",params:[t,r]}):yield e.request({method:`${e.mode}_setCode`,params:[t,r]})})}});var DP=p(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.setCoinbase=hV;function hV(r,n){return y(this,arguments,function*(e,{address:t}){yield e.request({method:`${e.mode}_setCoinbase`,params:[t]})})}});var $P=p(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.setIntervalMining=_V;function _V(r,n){return y(this,arguments,function*(e,{interval:t}){let s=e.mode==="hardhat"?t*1e3:t;yield e.request({method:"evm_setIntervalMining",params:[s]})})}});var GP=p(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});B_.setLoggingEnabled=vV;function vV(e,t){return y(this,null,function*(){yield e.request({method:`${e.mode}_setLoggingEnabled`,params:[t]})})}});var VP=p(S_=>{"use strict";
47Object.defineProperty(S_,"__esModule",{value:!0});S_.setMinGasPrice=EV;var jV=U();function EV(r,n){return y(this,arguments,function*(e,{gasPrice:t}){yield e.request({method:`${e.mode}_setMinGasPrice`,params:[(0,jV.numberToHex)(t)]})})}});var WP=p(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.setNextBlockBaseFeePerGas=wV;var xV=U();function wV(r,n){return y(this,arguments,function*(e,{baseFeePerGas:t}){yield e.request({method:`${e.mode}_setNextBlockBaseFeePerGas`,params:[(0,xV.numberToHex)(t)]})})}});var KP=p(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.setNextBlockTimestamp=qV;var PV=U();function qV(r,n){return y(this,arguments,function*(e,{timestamp:t}){yield e.request({method:"evm_setNextBlockTimestamp",params:[(0,PV.numberToHex)(t)]})})}});var ZP=p(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});M_.setNonce=AV;var TV=U();function AV(n,s){return y(this,arguments,function*(e,{address:t,nonce:r}){yield e.request({method:`${e.mode}_setNonce`,params:[t,(0,TV.numberToHex)(r)]})})}});var YP=p(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});k_.setRpcUrl=IV;function IV(e,t){return y(this,null,function*(){yield e.request({method:`${e.mode}_setRpcUrl`,params:[t]})})}});var JP=p(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.setStorageAt=BV;var OV=U();function BV(s,o){return y(this,arguments,function*(e,{address:t,index:r,value:n}){yield e.request({method:`${e.mode}_setStorageAt`,params:[t,typeof r=="number"?(0,OV.numberToHex)(r):r,n]})})}});var XP=p(H_=>{"use strict";Object.defineProperty(H_,"__esModule",{value:!0});H_.snapshot=SV;function SV(e){return y(this,null,function*(){return yield e.request({method:"evm_snapshot"})})}});var QP=p(F_=>{"use strict";Object.defineProperty(F_,"__esModule",{value:!0});F_.stopImpersonatingAccount=CV;function CV(r,n){return y(this,arguments,function*(e,{address:t}){yield e.request({method:`${e.mode}_stopImpersonatingAccount`,params:[t]})})}});var U_=p(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});z_.testActions=dW;var RV=EP(),MV=xP(),kV=wP(),NV=PP(),HV=TP(),FV=AP(),zV=IP(),UV=OP(),LV=BP(),DV=SP(),$V=CP(),GV=RP(),VV=MP(),WV=kP(),KV=NP(),ZV=FP(),YV=zP(),JV=UP(),XV=LP(),QV=DP(),eW=$P(),tW=GP(),rW=VP(),nW=WP(),sW=KP(),oW=ZP(),iW=YP(),aW=JP(),uW=XP(),cW=QP();function dW({mode:e}){return t=>{let r=t.extend(()=>({mode:e}));return{dropTransaction:n=>(0,RV.dropTransaction)(r,n),dumpState:()=>(0,MV.dumpState)(r),getAutomine:()=>(0,kV.getAutomine)(r),getTxpoolContent:()=>(0,NV.getTxpoolContent)(r),getTxpoolStatus:()=>(0,HV.getTxpoolStatus)(r),impersonateAccount:n=>(0,FV.impersonateAccount)(r,n),increaseTime:n=>(0,zV.increaseTime)(r,n),inspectTxpool:()=>(0,UV.inspectTxpool)(r),loadState:n=>(0,LV.loadState)(r,n),mine:n=>(0,DV.mine)(r,n),removeBlockTimestampInterval:()=>(0,$V.removeBlockTimestampInterval)(r),reset:n=>(0,GV.reset)(r,n),revert:n=>(0,VV.revert)(r,n),sendUnsignedTransaction:n=>(0,WV.sendUnsignedTransaction)(r,n),setAutomine:n=>(0,KV.setAutomine)(r,n),setBalance:n=>(0,ZV.setBalance)(r,n),setBlockGasLimit:n=>(0,YV.setBlockGasLimit)(r,n),setBlockTimestampInterval:n=>(0,JV.setBlockTimestampInterval)(r,n),setCode:n=>(0,XV.setCode)(r,n),setCoinbase:n=>(0,QV.setCoinbase)(r,n),setIntervalMining:n=>(0,eW.setIntervalMining)(r,n),setLoggingEnabled:n=>(0,tW.setLoggingEnabled)(r,n),setMinGasPrice:n=>(0,rW.setMinGasPrice)(r,n),setNextBlockBaseFeePerGas:n=>(0,nW.setNextBlockBaseFeePerGas)(r,n),setNextBlockTimestamp:n=>(0,sW.setNextBlockTimestamp)(r,n),setNonce:n=>(0,oW.setNonce)(r,n),setRpcUrl:n=>(0,iW.setRpcUrl)(r,n),setStorageAt:n=>(0,aW.setStorageAt)(r,n),snapshot:()=>(0,uW.snapshot)(r),stopImpersonatingAccount:n=>(0,cW.stopImpersonatingAccount)(r,n)}}}});var e8=p(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});L_.createTestClient=pW;var fW=pi(),lW=U_();function pW(e){let{key:t="test",name:r="Test Client",mode:n}=e;return(0,fW.createClient)(B(v({},e),{key:t,name:r,type:"testClient"})).extend(o=>v({mode:n},(0,lW.testActions)({mode:n})(o)))}});var t8=p(D_=>{"use strict";
47Object.defineProperty(D_,"__esModule",{value:!0});D_.addChain=mW;var bW=U();function mW(r,n){return y(this,arguments,function*(e,{chain:t}){let{id:s,name:o,nativeCurrency:a,rpcUrls:u,blockExplorers:c}=t;yield e.request({method:"wallet_addEthereumChain",params:[{chainId:(0,bW.numberToHex)(s),chainName:o,nativeCurrency:a,rpcUrls:u.default.http,blockExplorerUrls:c?Object.values(c).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})})}});var r8=p($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});$_.deployContract=hW;var yW=Ps(),gW=ui();function hW(e,t){let u=t,{abi:r,args:n,bytecode:s}=u,o=G(u,["abi","args","bytecode"]),a=(0,yW.encodeDeployData)({abi:r,args:n,bytecode:s});return(0,gW.sendTransaction)(e,B(v(v({},o),o.authorizationList?{to:null}:{}),{data:a}))}});var n8=p(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});G_.getAddresses=vW;var _W=rt();function vW(e){return y(this,null,function*(){return e.account?.type==="local"?[e.account.address]:(yield e.request({method:"eth_accounts"},{dedupe:!0})).map(r=>(0,_W.checksumAddress)(r))})}});var s8=p(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});V_.getCapabilities=xW;var jW=xe(),EW=U();function xW(r){return y(this,arguments,function*(e,t={}){let{account:n=e.account,chainId:s}=t,o=n?(0,jW.parseAccount)(n):void 0,a=s?[o?.address,[(0,EW.numberToHex)(s)]]:[o?.address],u=yield e.request({method:"wallet_getCapabilities",params:a}),c={};for(let[d,l]of Object.entries(u)){c[Number(d)]={};for(let[f,b]of Object.entries(l))f==="addSubAccount"&&(f="unstable_addSubAccount"),c[Number(d)][f]=b}return typeof s=="number"?c[s]:c})}});var o8=p(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.getPermissions=wW;function wW(e){return y(this,null,function*(){return yield e.request({method:"wallet_getPermissions"},{dedupe:!0})})}});var Z_=p(K_=>{"use strict";Object.defineProperty(K_,"__esModule",{value:!0});K_.prepareAuthorization=IW;var i8=xe(),PW=wr(),qW=Tt(),a8=ae(),TW=tn(),AW=Go();function IW(e,t){return y(this,null,function*(){let{account:r=e.account,chainId:n,nonce:s}=t;if(!r)throw new PW.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});let o=(0,i8.parseAccount)(r),a=(()=>{if(t.executor)return t.executor==="self"?t.executor:(0,i8.parseAccount)(t.executor)})(),u={address:t.contractAddress??t.address,chainId:n,nonce:s};return typeof u.chainId>"u"&&(u.chainId=e.chain?.id??(yield(0,a8.getAction)(e,TW.getChainId,"getChainId")({}))),typeof u.nonce>"u"&&(u.nonce=yield(0,a8.getAction)(e,AW.getTransactionCount,"getTransactionCount")({address:o.address,blockTag:"pending"}),(a==="self"||a?.address&&(0,qW.isAddressEqual)(a.address,o.address))&&(u.nonce+=1)),u})}});var u8=p(Y_=>{"use strict";Object.defineProperty(Y_,"__esModule",{value:!0});Y_.requestAddresses=BW;var OW=rt();function BW(e){return y(this,null,function*(){return(yield e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>(0,OW.getAddress)(r))})}});var c8=p(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});J_.requestPermissions=SW;function SW(e,t){return y(this,null,function*(){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})})}});var d8=p(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.sendCallsSync=MW;var CW=Vc(),RW=Zc();function MW(e,t){return y(this,null,function*(){let{chain:r=e.chain}=t,n=t.timeout??Math.max((r?.blockTime??0)*3,5e3),s=yield(0,CW.sendCalls)(e,t);return yield(0,RW.waitForCallsStatus)(e,B(v({},t),{id:s.id,timeout:n}))})}});var t6=p(e6=>{"use strict";Object.defineProperty(e6,"__esModule",{value:!0});e6.sendTransactionSync=ZW;var kW=xe(),Tf=wr(),NW=Q(),HW=Ge(),FW=ls(),zW=Os(),UW=ai(),LW=Jr(),DW=Nt(),Af=ae(),$W=qn(),GW=Ht(),VW=tn(),WW=Jh(),f8=ys(),KW=qf(),Q_=new $W.LruMap(128);function ZW(e,t){return y(this,null,function*(){let A=t,{account:r=e.account,chain:n=e.chain,accessList:s,authorizationList:o,blobs:a,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:f,maxPriorityFeePerGas:b,nonce:m,pollingInterval:h,throwOnReceiptRevert:_,type:E,value:j}=A,q=G(A,["account","chain","accessList","authorizationList","blobs","data","gas","gasPrice","maxFeePerBlobGas","maxFeePerGas","maxPriorityFeePerGas","
47nonce","pollingInterval","throwOnReceiptRevert","type","value"]),T=t.timeout??Math.max((n?.blockTime??0)*3,5e3);if(typeof r>"u")throw new Tf.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransactionSync"});let x=r?(0,kW.parseAccount)(r):null;try{(0,GW.assertRequest)(t);let I=yield y(null,null,function*(){if(t.to)return t.to;if(t.to!==null&&o&&o.length>0)return yield(0,FW.recoverAuthorizationAddress)({authorization:o[0]}).catch(()=>{throw new NW.BaseError("`to` is required. Could not infer from `authorizationList`.")})});if(x?.type==="json-rpc"||x===null){let O;n!==null&&(O=yield(0,Af.getAction)(e,VW.getChainId,"getChainId")({}),(0,zW.assertCurrentChain)({currentChainId:O,chain:n}));let S=e.chain?.formatters?.transactionRequest?.format,M=(S||DW.formatTransactionRequest)(B(v({},(0,LW.extract)(q,{format:S})),{accessList:s,authorizationList:o,blobs:a,chainId:O,data:u,from:x?.address,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:f,maxPriorityFeePerGas:b,nonce:m,to:I,type:E,value:j}),"sendTransaction"),N=Q_.get(e.uid),F=N?"wallet_sendTransaction":"eth_sendTransaction",D=yield y(null,null,function*(){try{return yield e.request({method:F,params:[M]},{retryCount:0})}catch(H){if(N===!1)throw H;let k=H;if(k.name==="InvalidInputRpcError"||k.name==="InvalidParamsRpcError"||k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError")return yield e.request({method:"wallet_sendTransaction",params:[M]},{retryCount:0}).then(L=>(Q_.set(e.uid,!0),L)).catch(L=>{let J=L;throw J.name==="MethodNotFoundRpcError"||J.name==="MethodNotSupportedRpcError"?(Q_.set(e.uid,!1),k):J});throw k}}),X=yield(0,Af.getAction)(e,WW.waitForTransactionReceipt,"waitForTransactionReceipt")({checkReplacement:!1,hash:D,pollingInterval:h,timeout:T});if(_&&X.status==="reverted")throw new HW.TransactionReceiptRevertedError({receipt:X});return X}if(x?.type==="local"){let O=yield(0,Af.getAction)(e,f8.prepareTransactionRequest,"prepareTransactionRequest")(B(v({account:x,accessList:s,authorizationList:o,blobs:a,chain:n,data:u,gas:c,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:f,maxPriorityFeePerGas:b,nonce:m,nonceManager:x.nonceManager,parameters:[...f8.defaultParameters,"sidecars"],type:E,value:j},q),{to:I})),S=n?.serializers?.transaction,C=yield x.signTransaction(O,{serializer:S});return yield(0,Af.getAction)(e,KW.sendRawTransactionSync,"sendRawTransactionSync")({serializedTransaction:C,throwOnReceiptRevert:_})}throw x?.type==="smart"?new Tf.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Tf.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransactionSync",type:x?.type})}catch(I){throw I instanceof Tf.AccountTypeNotSupportedError?I:(0,UW.getTransactionError)(I,B(v({},t),{account:x,chain:t.chain||void 0}))}})}});var l8=p(r6=>{"use strict";Object.defineProperty(r6,"__esModule",{value:!0});r6.showCallsStatus=YW;function YW(e,t){return y(this,null,function*(){let{id:r}=t;yield e.request({method:"wallet_showCallsStatus",params:[r]})})}});var b8=p(n6=>{"use strict";Object.defineProperty(n6,"__esModule",{value:!0});n6.signAuthorization=QW;var JW=xe(),p8=wr(),XW=Z_();function QW(e,t){return y(this,null,function*(){let{account:r=e.account}=t;if(!r)throw new p8.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});let n=(0,JW.parseAccount)(r);if(!n.signAuthorization)throw new p8.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});let s=yield(0,XW.prepareAuthorization)(e,t);return n.signAuthorization(s)})}});var y8=p(s6=>{"use strict";Object.defineProperty(s6,"__esModule",{value:!0});s6.signMessage=rK;var eK=xe(),tK=wr(),m8=U();function rK(n,s){return y(this,arguments,function*(e,{account:t=e.account,message:r}){if(!t)throw new tK.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});let o=(0,eK.parseAccount)(t);if(o.signMessage)return o.signMessage({message:r});let a=typeof r=="string"?(0,m8.stringToHex)(r):r.raw instanceof Uint8Array?(0,m8.toHex)(r.raw):r.raw;return e.request({method:"personal_sign",params:[a,o.address]},{retryCount:0})})}});var g8=p(o6=>{"use strict";Object.defineProperty(o6,"__esModule",{value:!0});o6.signTransaction=fK;
47var nK=xe(),sK=wr(),oK=Os(),iK=U(),aK=Nt(),uK=ae(),cK=Ht(),dK=tn();function fK(e,t){return y(this,null,function*(){let d=t,{account:r=e.account,chain:n=e.chain}=d,s=G(d,["account","chain"]);if(!r)throw new sK.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});let o=(0,nK.parseAccount)(r);(0,cK.assertRequest)(v({account:o},t));let a=yield(0,uK.getAction)(e,dK.getChainId,"getChainId")({});n!==null&&(0,oK.assertCurrentChain)({currentChainId:a,chain:n});let c=(n?.formatters||e.chain?.formatters)?.transactionRequest?.format||aK.formatTransactionRequest;return o.signTransaction?o.signTransaction(B(v({},s),{chainId:a}),{serializer:e.chain?.serializers?.transaction}):yield e.request({method:"eth_signTransaction",params:[B(v({},c(s,"signTransaction")),{chainId:(0,iK.numberToHex)(a),from:o.address})]},{retryCount:0})})}});var h8=p(a6=>{"use strict";Object.defineProperty(a6,"__esModule",{value:!0});a6.signTypedData=bK;var lK=xe(),pK=wr(),i6=Ei();function bK(e,t){return y(this,null,function*(){let{account:r=e.account,domain:n,message:s,primaryType:o}=t;if(!r)throw new pK.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});let a=(0,lK.parseAccount)(r),u=v({EIP712Domain:(0,i6.getTypesForEIP712Domain)({domain:n})},t.types);if((0,i6.validateTypedData)({domain:n,message:s,primaryType:o,types:u}),a.signTypedData)return a.signTypedData({domain:n,message:s,primaryType:o,types:u});let c=(0,i6.serializeTypedData)({domain:n,message:s,primaryType:o,types:u});return e.request({method:"eth_signTypedData_v4",params:[a.address,c]},{retryCount:0})})}});var _8=p(u6=>{"use strict";Object.defineProperty(u6,"__esModule",{value:!0});u6.switchChain=yK;var mK=U();function yK(r,n){return y(this,arguments,function*(e,{id:t}){yield e.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,mK.numberToHex)(t)}]},{retryCount:0})})}});var v8=p(c6=>{"use strict";Object.defineProperty(c6,"__esModule",{value:!0});c6.watchAsset=gK;function gK(e,t){return y(this,null,function*(){return yield e.request({method:"wallet_watchAsset",params:t},{retryCount:0})})}});var j8=p(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});d6.writeContractSync=vK;var hK=t6(),_K=Lc();function vK(e,t){return y(this,null,function*(){return _K.writeContract.internal(e,hK.sendTransactionSync,"sendTransactionSync",t)})}});var l6=p(f6=>{"use strict";Object.defineProperty(f6,"__esModule",{value:!0});f6.walletActions=KK;var jK=tn(),EK=t8(),xK=r8(),wK=n8(),PK=P1(),qK=s8(),TK=o8(),AK=Z_(),IK=ys(),OK=u8(),BK=c8(),SK=Vc(),CK=d8(),RK=Hc(),MK=qf(),kK=ui(),NK=t6(),HK=l8(),FK=b8(),zK=y8(),UK=g8(),LK=h8(),DK=_8(),$K=Zc(),GK=v8(),VK=Lc(),WK=j8();function KK(e){return{addChain:t=>(0,EK.addChain)(e,t),deployContract:t=>(0,xK.deployContract)(e,t),getAddresses:()=>(0,wK.getAddresses)(e),getCallsStatus:t=>(0,PK.getCallsStatus)(e,t),getCapabilities:t=>(0,qK.getCapabilities)(e,t),getChainId:()=>(0,jK.getChainId)(e),getPermissions:()=>(0,TK.getPermissions)(e),prepareAuthorization:t=>(0,AK.prepareAuthorization)(e,t),prepareTransactionRequest:t=>(0,IK.prepareTransactionRequest)(e,t),requestAddresses:()=>(0,OK.requestAddresses)(e),requestPermissions:t=>(0,BK.requestPermissions)(e,t),sendCalls:t=>(0,SK.sendCalls)(e,t),sendCallsSync:t=>(0,CK.sendCallsSync)(e,t),sendRawTransaction:t=>(0,RK.sendRawTransaction)(e,t),sendRawTransactionSync:t=>(0,MK.sendRawTransactionSync)(e,t),sendTransaction:t=>(0,kK.sendTransaction)(e,t),sendTransactionSync:t=>(0,NK.sendTransactionSync)(e,t),showCallsStatus:t=>(0,HK.showCallsStatus)(e,t),signAuthorization:t=>(0,FK.signAuthorization)(e,t),signMessage:t=>(0,zK.signMessage)(e,t),signTransaction:t=>(0,UK.signTransaction)(e,t),signTypedData:t=>(0,LK.signTypedData)(e,t),switchChain:t=>(0,DK.switchChain)(e,t),waitForCallsStatus:t=>(0,$K.waitForCallsStatus)(e,t),watchAsset:t=>(0,GK.watchAsset)(e,t),writeContract:t=>(0,VK.writeContract)(e,t),writeContractSync:t=>(0,WK.writeContractSync)(e,t)}}});var E8=p(p6=>{"use strict";Object.defineProperty(p6,"__esModule",{value:!0});p6.createWalletClient=JK;var ZK=pi(),YK=l6();function JK(e){let{key:t="wallet",name:r="Wallet Client",transport:n}=e;return(0,ZK.createClient)(B(v({}
47,e),{key:t,name:r,transport:n,type:"walletClient"})).extend(YK.walletActions)}});var Qs=p(b6=>{"use strict";Object.defineProperty(b6,"__esModule",{value:!0});b6.createTransport=eZ;var XK=Cy(),QK=A1();function eZ({key:e,methods:t,name:r,request:n,retryCount:s=3,retryDelay:o=150,timeout:a,type:u},c){let d=(0,QK.uid)();return{config:{key:e,methods:t,name:r,request:n,retryCount:s,retryDelay:o,timeout:a,type:u},request:(0,XK.buildRequest)(n,{methods:t,retryCount:s,retryDelay:o,uid:d}),value:c}}});var x8=p(m6=>{"use strict";Object.defineProperty(m6,"__esModule",{value:!0});m6.custom=rZ;var tZ=Qs();function rZ(e,t={}){let{key:r="custom",methods:n,name:s="Custom Provider",retryDelay:o}=t;return({retryCount:a})=>(0,tZ.createTransport)({key:r,methods:n,name:s,request:e.request.bind(e),retryCount:t.retryCount??a,retryDelay:o,type:"custom"})}});var T8=p(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.fallback=iZ;ta.shouldThrow=P8;ta.rankTransports=q8;var nZ=Kt(),w8=yr(),sZ=kc(),oZ=Qs();function iZ(e,t={}){let{key:r="fallback",name:n="Fallback",rank:s=!1,shouldThrow:o=P8,retryCount:a,retryDelay:u}=t;return b=>{var m=b,{chain:c,pollingInterval:d=4e3,timeout:l}=m,f=G(m,["chain","pollingInterval","timeout"]);let h=e,_=()=>{},E=(0,oZ.createTransport)({key:r,name:n,request(x){return y(this,arguments,function*({method:q,params:T}){let A,I=(O=0)=>y(null,null,function*(){let S=h[O](B(v({},f),{chain:c,retryCount:0,timeout:l}));try{let C=yield S.request({method:q,params:T});return _({method:q,params:T,response:C,transport:S,status:"success"}),C}catch(C){if(_({error:C,method:q,params:T,transport:S,status:"error"}),o(C)||O===h.length-1||(A??=h.slice(O+1).some(M=>{let{include:N,exclude:F}=M({chain:c}).config.methods||{};return N?N.includes(q):F?!F.includes(q):!0}),!A))throw C;return I(O+1)}});return I()})},retryCount:a,retryDelay:u,type:"fallback"},{onResponse:q=>_=q,transports:h.map(q=>q({chain:c,retryCount:0}))});if(s){let q=typeof s=="object"?s:{};q8({chain:c,interval:q.interval??d,onTransports:T=>h=T,ping:q.ping,sampleCount:q.sampleCount,timeout:q.timeout,transports:h,weights:q.weights})}return E}}function P8(e){return!!("code"in e&&typeof e.code=="number"&&(e.code===w8.TransactionRejectedRpcError.code||e.code===w8.UserRejectedRequestError.code||nZ.ExecutionRevertedError.nodeMessage.test(e.message)||e.code===5e3))}function q8({chain:e,interval:t=4e3,onTransports:r,ping:n,sampleCount:s=10,timeout:o=1e3,transports:a,weights:u={}}){let{stability:c=.7,latency:d=.3}=u,l=[],f=()=>y(null,null,function*(){let b=yield Promise.all(a.map(_=>y(null,null,function*(){let E=_({chain:e,retryCount:0,timeout:o}),j=Date.now(),q,T;try{yield n?n({transport:E}):E.request({method:"net_listening"}),T=1}catch(A){T=0}finally{q=Date.now()}return{latency:q-j,success:T}})));l.push(b),l.length>s&&l.shift();let m=Math.max(...l.map(_=>Math.max(..._.map(({latency:E})=>E)))),h=a.map((_,E)=>{let j=l.map(I=>I[E].latency),T=1-j.reduce((I,O)=>I+O,0)/j.length/m,x=l.map(I=>I[E].success),A=x.reduce((I,O)=>I+O,0)/x.length;return A===0?[0,E]:[d*T+c*A,E]}).sort((_,E)=>E[0]-_[0]);r(h.map(([,_])=>a[_])),yield(0,sZ.wait)(t),f()});f()}});var Of=p(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});If.UrlRequiredError=void 0;var aZ=Q(),y6=class extends aZ.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"})}};If.UrlRequiredError=y6});var A8=p(g6=>{"use strict";Object.defineProperty(g6,"__esModule",{value:!0});g6.http=pZ;var uZ=Pt(),cZ=Of(),dZ=Ic(),fZ=wd(),lZ=Qs();function pZ(e,t={}){let{batch:r,fetchFn:n,fetchOptions:s,key:o="http",methods:a,name:u="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:d,retryDelay:l,raw:f}=t;return({chain:b,retryCount:m,timeout:h})=>{let{batchSize:_=1e3,wait:E=0}=typeof r=="object"?r:{},j=t.retryCount??m,q=h??t.timeout??1e4,T=e||b?.rpcUrls.default.http[0];if(!T)throw new cZ.UrlRequiredError;let x=(0,fZ.getHttpRpcClient)(T,{fetchFn:n,fetchOptions:s,onRequest:c,onResponse:d,timeout:q});return(0,lZ.createTransport)({key:o,methods:a,name:u,request(S){return y(this,arguments,function*({method:I,params:O}){let C={method:I,params:O},{schedule:M}=(0,dZ.createBatchScheduler)({id:T,wait:E,shouldSplitBatch(X){return X.length>_},fn:X=>x.request({body:X}),sort:(X,H)=>X.id-H.id}),N=X=>y(null,null,function*(){return r?M(X):[yield x.request({body:X})]}),[{error:F,result:D}]=yield N(C);if(f)return{error:F,result:D};if(F)throw new uZ.RpcRequestError({body:C,error:F,url:T});return D})},retryCount:j,retryDelay:l,timeout:q,type:"http"},{fetchOptions:s,url:T})}}});var I8=p(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});_6.webSocket=hZ;var bZ=Pt(),mZ=Of(),yZ=eg(),h6=qd(),gZ=Qs();function hZ(e,t={}){let{keepAlive:r,key:n="webSocket",methods:s,name:o="WebSocket JSON-RPC",reconnect:a,retryDelay:u}=t;return({chain:c,retryCount:d,timeout:l})=>{let f=t.retryCount??d,b=l??t.timeout??1e4,m=e||c?.rpcUrls.default.webSocket?.[0],h={keepAlive:r,reconnect:a};if(!m)throw new mZ.UrlRequiredError;return(0,gZ.createTransport)({key:n,methods:s,name:o,request(T){return y(this,arguments,function*({method:j,params:q}){let x={method:j,params:q},A=yield(0,h6.getWebSocketRpcClient)(m,h),{error:I,result:O}=yield A.requestAsync({body:x,timeout:b});if(I)throw new bZ.RpcRequestError({body:x,error:I,url:m});return O})},retryCount:f,retryDelay:u,timeout:b,type:"webSocket"},{getSocket(){return(0,yZ.getSocket)(m)},getRpcClient(){return(0,h6.getWebSocketRpcClient)(m,h)},subscribe(x){return y(this,arguments,function*({params:j,onData:q,onError:T}){let A=yield(0,h6.getWebSocketRpcClient)(m,h),{result:I}=yield new Promise((S,C)=>A.request({body:{method:"eth_subscribe",params:j},onError(M){C(M),T?.(M)},onResponse(M){if(M.error){C(M.error),T?.(M.error);return}if(typeof M.id=="number"){S(M);return}M.method==="eth_subscription"&&q(M.params)}}));return{subscriptionId:I,unsubscribe(){return y(this,null,function*(){return new Promise(S=>A.request({body:{method:"eth_unsubscribe",params:[I]},onResponse:S}))})}}})}})}}});var O8=p(Bf=>{"use strict";
47Object.defineProperty(Bf,"__esModule",{value:!0});Bf.ProviderRpcError=void 0;var v6=class extends Error{constructor(t,r){super(r),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=r}};Bf.ProviderRpcError=v6});var B8=p(x6=>{"use strict";Object.defineProperty(x6,"__esModule",{value:!0});x6.decodeDeployData=vZ;var j6=ge(),_Z=br(),E6="/docs/contract/decodeDeployData";function vZ(e){let{abi:t,bytecode:r,data:n}=e;if(n===r)return{bytecode:r};let s=t.find(a=>"type"in a&&a.type==="constructor");if(!s)throw new j6.AbiConstructorNotFoundError({docsPath:E6});if(!("inputs"in s))throw new j6.AbiConstructorParamsNotFoundError({docsPath:E6});if(!s.inputs||s.inputs.length===0)throw new j6.AbiConstructorParamsNotFoundError({docsPath:E6});return{args:(0,_Z.decodeAbiParameters)(s.inputs,`0x${n.replace(r,"")}`),bytecode:r}}});var C8=p(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});w6.fromBlobs=xZ;var S8=rs(),jZ=de(),EZ=U();function xZ(e){let t=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(u=>(0,jZ.hexToBytes)(u)):e.blobs,n=r.reduce((u,c)=>u+c.length,0),s=(0,S8.createCursor)(new Uint8Array(n)),o=!0;for(let u of r){let c=(0,S8.createCursor)(u);for(;o&&c.position<u.length;){c.incrementPosition(1);let d=31;u.length-c.position<31&&(d=u.length-c.position);for(let l in Array.from({length:d})){let f=c.readByte();if(f===128&&!c.inspectBytes(c.remaining).includes(128)){o=!1;break}s.pushByte(f)}}}let a=s.bytes.slice(0,s.position);return t==="hex"?(0,EZ.bytesToHex)(a):a}});var R8=p(P6=>{"use strict";Object.defineProperty(P6,"__esModule",{value:!0});P6.sidecarsToVersionedHashes=PZ;var wZ=dc();function PZ(e){let{sidecars:t,version:r}=e,n=e.to??(typeof t[0].blob=="string"?"hex":"bytes"),s=[];for(let{commitment:o}of t)s.push((0,wZ.commitmentToVersionedHash)({commitment:o,to:n,version:r}));return s}});var M8=p(q6=>{"use strict";Object.defineProperty(q6,"__esModule",{value:!0});q6.toCoinType=AZ;var qZ=rd(),TZ=2147483648;function AZ(e){if(e===1)return 60n;if(e>=TZ||e<0)throw new qZ.EnsInvalidChainIdError({chainId:e});return BigInt((2147483648|e)>>>0)}});var A6=p(T6=>{"use strict";Object.defineProperty(T6,"__esModule",{value:!0});T6.defineKzg=IZ;function IZ({blobToKzgCommitment:e,computeBlobKzgProof:t}){return{blobToKzgCommitment:e,computeBlobKzgProof:t}}});var k8=p(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});I6.setupKzg=BZ;var OZ=A6();function BZ(e,t){try{e.loadTrustedSetup(t)}catch(r){let n=r;if(!n.message.includes("trusted setup is already loaded"))throw n}return(0,OZ.defineKzg)(e)}});var N8=p(O6=>{"use strict";Object.defineProperty(O6,"__esModule",{value:!0});O6.compactSignatureToSignature=RZ;var SZ=de(),CZ=U();function RZ({r:e,yParityAndS:t}){let r=(0,SZ.hexToBytes)(t),n=r[0]&128?1:0,s=r;return n===1&&(s[0]&=127),{r:e,s:(0,CZ.bytesToHex)(s),yParity:n}}});var F8=p(B6=>{"use strict";Object.defineProperty(B6,"__esModule",{value:!0});B6.parseCompactSignature=kZ;var MZ=Yr(),H8=U();function kZ(e){let{r:t,s:r}=MZ.secp256k1.Signature.fromCompact(e.slice(2,130));return{r:(0,H8.numberToHex)(t,{size:32}),yParityAndS:(0,H8.numberToHex)(r,{size:32})}}});var z8=p(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0});S6.parseSignature=HZ;var NZ=Yr(),Sf=U();function HZ(e){let{r:t,s:r}=NZ.secp256k1.Signature.fromCompact(e.slice(2,130)),n=+`0x${e.slice(130)}`,[s,o]=(()=>{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,Sf.numberToHex)(t,{size:32}),s:(0,Sf.numberToHex)(r,{size:32}),v:s,yParity:o}:{r:(0,Sf.numberToHex)(t,{size:32}),s:(0,Sf.numberToHex)(r,{size:32}),yParity:o}}});var U8=p(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});C6.recoverTransactionAddress=DZ;var FZ=Je(),zZ=lf(),UZ=_i(),LZ=vr();function DZ(e){return y(this,null,function*(){let{serializedTransaction:t,signature:r}=e,n=(0,zZ.parseTransaction)(t),s=r??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},o=(0,UZ.serializeTransaction)(B(v({},n),{r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0}));return yield(0,LZ.recoverAddress)({hash:(0,FZ.keccak256)(o),signature:s})})}});var D8=p(R6=>{"use strict";Object.defineProperty(R6,"__esModule",{value:!0});R6.serializeCompactSignature=GZ;var $Z=Yr(),L8=Ee();function GZ({r:e,yParityAndS:t}){return`0x${new $Z.secp256k1.Signature((0,L8.hexToBigInt)(e),(0,L8.hexToBigInt)(t)).toCompactHex()}`}});var $8=p(M6=>{"use strict";Object.defineProperty(M6,"__esModule",{value:!0});M6.signatureToCompactSignature=KZ;var VZ=de(),WZ=U();function KZ(e){let{r:t,s:r,v:n,yParity:s}=e,o=Number(s??n-27n),a=r;if(o===1){let u=(0,VZ.hexToBytes)(r);u[0]|=128,a=(0,WZ.bytesToHex)(u)}return{r:t,yParityAndS:a}}});var cq=p(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.maxInt8=i.universalSignatureValidatorByteCode=i.erc6492SignatureValidatorByteCode=i.deploylessCallViaFactoryBytecode=i.deploylessCallViaBytecodeBytecode=i.zeroHash=i.zeroAddress=i.ethAddress=i.multicall3Abi=i.universalSignatureValidatorAbi=i.erc6492SignatureValidatorAbi=i.erc4626Abi=i.erc1155Abi=i.erc721Ab
47i=i.erc20Abi_bytes32=i.erc20Abi=i.webSocket=i.http=i.shouldThrow=i.fallback=i.custom=i.createTransport=i.walletActions=i.testActions=i.publicActions=i.createWalletClient=i.createTestClient=i.createPublicClient=i.rpcSchema=i.createClient=i.WaitForCallsStatusTimeoutError=i.getContract=i.UnknownTypeError=i.UnknownSignatureError=i.SolidityProtectedKeywordError=i.parseAbiParameters=i.parseAbiParameter=i.parseAbiItem=i.parseAbi=i.InvalidStructSignatureError=i.InvalidSignatureError=i.InvalidParenthesisError=i.InvalidParameterError=i.InvalidModifierError=i.InvalidFunctionModifierError=i.InvalidAbiTypeParameterError=i.InvalidAbiParametersError=i.InvalidAbiParameterError=i.InvalidAbiItemError=i.CircularReferenceError=void 0;i.maxUint152=i.maxUint144=i.maxUint136=i.maxUint128=i.maxUint120=i.maxUint112=i.maxUint104=i.maxUint96=i.maxUint88=i.maxUint80=i.maxUint72=i.maxUint64=i.maxUint56=i.maxUint48=i.maxUint40=i.maxUint32=i.maxUint24=i.maxUint16=i.maxUint8=i.maxInt256=i.maxInt248=i.maxInt240=i.maxInt232=i.maxInt224=i.maxInt216=i.maxInt208=i.maxInt200=i.maxInt192=i.maxInt184=i.maxInt176=i.maxInt168=i.maxInt160=i.maxInt152=i.maxInt144=i.maxInt136=i.maxInt128=i.maxInt120=i.maxInt112=i.maxInt104=i.maxInt96=i.maxInt88=i.maxInt80=i.maxInt72=i.maxInt64=i.maxInt56=i.maxInt48=i.maxInt40=i.maxInt32=i.maxInt24=i.maxInt16=void 0;i.AbiConstructorNotFoundError=i.weiUnits=i.gweiUnits=i.etherUnits=i.presignMessagePrefix=i.minInt256=i.minInt248=i.minInt240=i.minInt232=i.minInt224=i.minInt216=i.minInt208=i.minInt200=i.minInt192=i.minInt184=i.minInt176=i.minInt168=i.minInt160=i.minInt152=i.minInt144=i.minInt136=i.minInt128=i.minInt120=i.minInt112=i.minInt104=i.minInt96=i.minInt88=i.minInt80=i.minInt72=i.minInt64=i.minInt56=i.minInt48=i.minInt40=i.minInt32=i.minInt24=i.minInt16=i.minInt8=i.maxUint256=i.maxUint248=i.maxUint240=i.maxUint232=i.maxUint224=i.maxUint216=i.maxUint208=i.maxUint200=i.maxUint192=i.maxUint184=i.maxUint176=i.maxUint168=i.maxUint160=void 0;i.EnsAvatarUriResolutionError=i.EnsAvatarUnsupportedNamespaceError=i.EnsAvatarInvalidNftUriError=i.SizeOverflowError=i.InvalidHexValueError=i.InvalidHexBooleanError=i.InvalidBytesBooleanError=i.IntegerOutOfRangeError=i.SliceOffsetOutOfBoundsError=i.SizeExceedsPaddingSizeError=i.RawContractError=i.CounterfactualDeploymentFailedError=i.ContractFunctionZeroDataError=i.ContractFunctionRevertedError=i.ContractFunctionExecutionError=i.CallExecutionError=i.InvalidChainIdError=i.ClientChainNotConfiguredError=i.ChainNotFoundError=i.ChainMismatchError=i.ChainDoesNotSupportContract=i.BundleFailedError=i.BlockNotFoundError=i.setErrorConfig=i.BaseError=i.InvalidAddressError=i.UnsupportedPackedAbiType=i.InvalidDefinitionTypeError=i.InvalidArrayError=i.InvalidAbiEncodingTypeError=i.InvalidAbiDecodingTypeError=i.DecodeLogTopicsMismatch=i.DecodeLogDataMismatch=i.BytesSizeMismatchError=i.AbiFunctionSignatureNotFoundError=i.AbiFunctionOutputsNotFoundError=i.AbiFunctionNotFoundError=i.AbiEventSignatureNotFoundError=i.AbiEventSignatureEmptyTopicsError=i.AbiEventNotFoundError=i.AbiErrorSignatureNotFoundError=i.AbiErrorNotFoundError=i.AbiErrorInputsNotFoundError=i.AbiEncodingLengthMismatchError=i.AbiEncodingBytesSizeMismatchError=i.AbiEncodingArrayLengthMismatchError=i.AbiDecodingZeroDataError=i.AbiDecodingDataSizeTooSmallError=i.AbiDecodingDataSizeInvalidError=i.AbiConstructorParamsNotFoundError=void 0;i.UnsupportedProviderMethodError=i.UnsupportedNonOptionalCapabilityError=i.UnsupportedChainIdError=i.UnknownRpcError=i.UnknownBundleIdError=i.UnauthorizedProviderError=i.TransactionRejectedRpcError=i.SwitchChainError=i.RpcError=i.ResourceUnavailableRpcError=i.ResourceNotFoundRpcError=i.ProviderRpcError=i.ProviderDisconnectedError=i.ParseRpcError=i.MethodNotSupportedRpcError=i.MethodNotFoundRpcError=i.LimitExceededRpcError=i.JsonRpcVersionUnsupportedError=i.InvalidRequestRpcError=i.InvalidParamsRpcError=i.InvalidInputRpcError=i.InternalRpcError=i.DuplicateIdError=i.ChainDisconnectedError=i.BundleTooLargeError=i.AtomicReadyWalletRejectedUpgradeError=i.AtomicityNotSupportedError=i.WebSocketRequestError=i.TimeoutError=i.SocketClosedError=i.RpcRequestError=i.HttpRequestError=i.UnknownNodeError=i.TransactionTypeNotSupportedError=i.TipAboveFeeCapError=i.NonceTooLowError=i.NonceTooHighError=i.NonceMaxValueError=i.IntrinsicGasTooLowError=i.IntrinsicGasTooHighError=i.InsufficientFundsError=i.FeeCapTooLowError=i.FeeCapTooHighError=i.ExecutionRevertedError=i.FilterTypeNotSupportedError=i.MaxFeePerGasTooLowError=i.Eip1559FeesNotSupportedError=i.BaseFeeScalarError=i.EstimateGasExecutionError=i.EnsInvalidChainIdError=void 0;i.toBlobs=i.toBlobSidecars=i.sidecarsToVersionedHashes=i.fromBlobs=i.commitmentToVersionedHash=i.commitmentsToVersionedHashes=i.blobsToProofs=i.blobsToCommitments=i.isAddressEqual=i.isAddress=i.getCreateAddress=i.getCreate2Address=i.getContractAddress=i.getAddress=i.checksumAddress=i.prepareEncodeFunctionData=i.parseEventLogs=i.getAbiItem=i.encodePacked=i.encodeFunctionResult=i.encodeFunctionData=i.encodeEventTopics=i.encodeErrorResult=i.encodeDeployData=i.encodeAbiParameters=i.decodeFunctionResult=i.decodeFunctionData=i.decodeEventLog=i.decodeErrorResult=i.decodeDeployData=i.decodeAbiParameters=i.EIP1193ProviderRpcError=i.InvalidDecimalNumberError=i.InvalidStructTypeError=i.InvalidPrimaryTypeError=i.InvalidDomainError=i.UrlRequiredError=i.WaitForTransactionReceiptTimeoutError=i.TransactionReceiptNotFoundError=i.TransactionNotFoundError=i.TransactionExecutionError=i.InvalidStorageKeySizeError=i.InvalidSerializedTransactionTypeError=i.InvalidSerializedTransactionError=i.InvalidSerializableTransactionError=i.InvalidLegacyVError=i.FeeConflictError=i.StateAssignmentC
47onflictError=i.AccountStateConflictError=i.UserRejectedRequestError=void 0;i.getContractError=i.toCoinType=i.namehash=i.labelhash=i.toRlp=i.hexToRlp=i.bytesToRlp=i.toHex=i.stringToHex=i.numberToHex=i.bytesToHex=i.boolToHex=i.toBytes=i.stringToBytes=i.numberToBytes=i.hexToBytes=i.boolToBytes=i.fromRlp=i.hexToString=i.hexToNumber=i.hexToBool=i.hexToBigInt=i.fromHex=i.fromBytes=i.bytesToString=i.bytesToNumber=i.bytesToBool=i.bytesToBigInt=i.trim=i.sliceHex=i.sliceBytes=i.slice=i.size=i.padHex=i.padBytes=i.pad=i.isHex=i.isBytes=i.concatHex=i.concatBytes=i.concat=i.getChainContractAddress=i.extractChain=i.defineChain=i.assertCurrentChain=i.offchainLookupSignature=i.offchainLookupAbiItem=i.offchainLookup=i.ccipFetch=i.ccipRequest=void 0;i.recoverTypedDataAddress=i.recoverTransactionAddress=i.recoverPublicKey=i.recoverMessageAddress=i.recoverAddress=i.parseSignature=i.hexToSignature=i.parseErc8010Signature=i.parseErc6492Signature=i.parseCompactSignature=i.hexToCompactSignature=i.isErc8010Signature=i.isErc6492Signature=i.hashTypedData=i.hashStruct=i.hashDomain=i.hashMessage=i.compactSignatureToSignature=i.withTimeout=i.withRetry=i.withCache=i.nonceManager=i.createNonceManager=i.setupKzg=i.defineKzg=i.getFunctionSignature=i.toFunctionSignature=i.getFunctionSelector=i.toFunctionSelector=i.toFunctionHash=i.getEventSignature=i.toEventSignature=i.getEventSelector=i.toEventSelector=i.toEventHash=i.sha256=i.ripemd160=i.keccak256=i.isHash=i.rpcTransactionType=i.formatTransactionRequest=i.defineTransactionRequest=i.formatTransactionReceipt=i.defineTransactionReceipt=i.transactionType=i.formatTransaction=i.defineTransaction=i.formatLog=i.formatBlock=i.defineBlock=void 0;i.parseUnits=i.parseGwei=i.parseEther=i.formatUnits=i.formatGwei=i.formatEther=i.validateTypedData=i.serializeTypedData=i.getTypesForEIP712Domain=i.domainSeparator=i.serializeTransaction=i.serializeAccessList=i.parseTransaction=i.getTransactionType=i.getSerializedTransactionType=i.assertTransactionLegacy=i.assertTransactionEIP2930=i.assertTransactionEIP1559=i.assertRequest=i.stringify=i.verifyTypedData=i.verifyMessage=i.verifyHash=i.toPrefixedMessage=i.signatureToCompactSignature=i.serializeSignature=i.signatureToHex=i.serializeErc8010Signature=i.serializeErc6492Signature=i.serializeCompactSignature=i.compactSignatureToHex=void 0;var Ne=fr();Object.defineProperty(i,"CircularReferenceError",{enumerable:!0,get:function(){return Ne.CircularReferenceError}});Object.defineProperty(i,"InvalidAbiItemError",{enumerable:!0,get:function(){return Ne.InvalidAbiItemError}});Object.defineProperty(i,"InvalidAbiParameterError",{enumerable:!0,get:function(){return Ne.InvalidAbiParameterError}});Object.defineProperty(i,"InvalidAbiParametersError",{enumerable:!0,get:function(){return Ne.InvalidAbiParametersError}});Object.defineProperty(i,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return Ne.InvalidAbiTypeParameterError}});Object.defineProperty(i,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return Ne.InvalidFunctionModifierError}});Object.defineProperty(i,"InvalidModifierError",{enumerable:!0,get:function(){return Ne.InvalidModifierError}});Object.defineProperty(i,"InvalidParameterError",{enumerable:!0,get:function(){return Ne.InvalidParameterError}});Object.defineProperty(i,"InvalidParenthesisError",{enumerable:!0,get:function(){return Ne.InvalidParenthesisError}});Object.defineProperty(i,"InvalidSignatureError",{enumerable:!0,get:function(){return Ne.InvalidSignatureError}});Object.defineProperty(i,"InvalidStructSignatureError",{enumerable:!0,get:function(){return Ne.InvalidStructSignatureError}});Object.defineProperty(i,"parseAbi",{enumerable:!0,get:function(){return Ne.parseAbi}});Object.defineProperty(i,"parseAbiItem",{enumerable:!0,get:function(){return Ne.parseAbiItem}});Object.defineProperty(i,"parseAbiParameter",{enumerable:!0,get:function(){return Ne.parseAbiParameter}});Object.defineProperty(i,"parseAbiParameters",{enumerable:!0,get:function(){return Ne.parseAbiParameters}});Object.defineProperty(i,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return Ne.SolidityProtectedKeywordError}});Object.defineProperty(i,"UnknownSignatureError",{enumerable:!0,get:function(){return Ne.UnknownSignatureError}});Object.defineProperty(i,"UnknownTypeError",{enumerable:!0,get:function(){return Ne.UnknownTypeError}});var ZZ=sE();Object.defineProperty(i,"getContract",{enumerable:!0,get:function(){return ZZ.getContract}});var YZ=Zc();Object.defineProperty(i,"WaitForCallsStatusTimeoutError",{enumerable:!0,get:function(){return YZ.WaitForCallsStatusTimeoutError}});var G8=pi();Object.defineProperty(i,"createClient",{enumerable:!0,get:function(){return G8.createClient}});Object.defineProperty(i,"rpcSchema",{enumerable:!0,get:function(){return G8.rpcSchema}});var JZ=jP();Object.defineProperty(i,"createPublicClient",{enumerable:!0,get:function(){return JZ.createPublicClient}});var XZ=e8();Object.defineProperty(i,"createTestClient",{enumerable:!0,get:function(){return XZ.createTestClient}});var QZ=E8();Object.defineProperty(i,"createWalletClient",{enumerable:!0,get:function(){return QZ.createWalletClient}});var eY=a_();Object.defineProperty(i,"publicActions",{enumerable:!0,get:function(){return eY.publicActions}});var tY=U_();Object.defineProperty(i,"testActions",{enumerable:!0,get:function(){return tY.testActions}});var rY=l6();Object.defineProperty(i,"walletActions",{enumerable:!0,get:function(){return rY.walletActions}});var nY=Qs();Object.defineProperty(i,"createTransport",{enumerable:!0,get:function(){return nY.createTransport}});var sY=x8();Object.defineProperty(i,"custom",{enumerable:!0,get:function(){return sY.custom}});var V8=T8();Object.defineProperty(i,"fallback",{enumerable:!0,get:function(){return V8.fallback}});Object.defineProperty(i,"shouldThrow",{enumerable:!0,get:function(){return V8.shouldThrow}});var oY=A8();Object.defineProperty(i,"http",{enumerable:!0,get:function(){return oY.http}});var iY=I8();Object.defineProperty(i,"webSocket",{enumerable:!0,get:function(){return iY.webSocket}});var fn=jr();Object.defineProperty(i,"erc20Abi",{enumerable:!0,get:function(){return fn.erc20Abi}});Object.defineProperty(i,"erc20Abi_bytes32",{enumerable:!0,get:function(){return fn.erc20Abi_bytes32}});
47Object.defineProperty(i,"erc721Abi",{enumerable:!0,get:function(){return fn.erc721Abi}});Object.defineProperty(i,"erc1155Abi",{enumerable:!0,get:function(){return fn.erc1155Abi}});Object.defineProperty(i,"erc4626Abi",{enumerable:!0,get:function(){return fn.erc4626Abi}});Object.defineProperty(i,"erc6492SignatureValidatorAbi",{enumerable:!0,get:function(){return fn.erc6492SignatureValidatorAbi}});Object.defineProperty(i,"universalSignatureValidatorAbi",{enumerable:!0,get:function(){return fn.erc6492SignatureValidatorAbi}});Object.defineProperty(i,"multicall3Abi",{enumerable:!0,get:function(){return fn.multicall3Abi}});var W8=Nh();Object.defineProperty(i,"ethAddress",{enumerable:!0,get:function(){return W8.ethAddress}});Object.defineProperty(i,"zeroAddress",{enumerable:!0,get:function(){return W8.zeroAddress}});var aY=Ad();Object.defineProperty(i,"zeroHash",{enumerable:!0,get:function(){return aY.zeroHash}});var Cf=xs();Object.defineProperty(i,"deploylessCallViaBytecodeBytecode",{enumerable:!0,get:function(){return Cf.deploylessCallViaBytecodeBytecode}});Object.defineProperty(i,"deploylessCallViaFactoryBytecode",{enumerable:!0,get:function(){return Cf.deploylessCallViaFactoryBytecode}});Object.defineProperty(i,"erc6492SignatureValidatorByteCode",{enumerable:!0,get:function(){return Cf.erc6492SignatureValidatorByteCode}});Object.defineProperty(i,"universalSignatureValidatorByteCode",{enumerable:!0,get:function(){return Cf.erc6492SignatureValidatorByteCode}});var R=nc();Object.defineProperty(i,"maxInt8",{enumerable:!0,get:function(){return R.maxInt8}});Object.defineProperty(i,"maxInt16",{enumerable:!0,get:function(){return R.maxInt16}});Object.defineProperty(i,"maxInt24",{enumerable:!0,get:function(){return R.maxInt24}});Object.defineProperty(i,"maxInt32",{enumerable:!0,get:function(){return R.maxInt32}});Object.defineProperty(i,"maxInt40",{enumerable:!0,get:function(){return R.maxInt40}});Object.defineProperty(i,"maxInt48",{enumerable:!0,get:function(){return R.maxInt48}});Object.defineProperty(i,"maxInt56",{enumerable:!0,get:function(){return R.maxInt56}});Object.defineProperty(i,"maxInt64",{enumerable:!0,get:function(){return R.maxInt64}});Object.defineProperty(i,"maxInt72",{enumerable:!0,get:function(){return R.maxInt72}});Object.defineProperty(i,"maxInt80",{enumerable:!0,get:function(){return R.maxInt80}});Object.defineProperty(i,"maxInt88",{enumerable:!0,get:function(){return R.maxInt88}});Object.defineProperty(i,"maxInt96",{enumerable:!0,get:function(){return R.maxInt96}});Object.defineProperty(i,"maxInt104",{enumerable:!0,get:function(){return R.maxInt104}});Object.defineProperty(i,"maxInt112",{enumerable:!0,get:function(){return R.maxInt112}});Object.defineProperty(i,"maxInt120",{enumerable:!0,get:function(){return R.maxInt120}});Object.defineProperty(i,"maxInt128",{enumerable:!0,get:function(){return R.maxInt128}});Object.defineProperty(i,"maxInt136",{enumerable:!0,get:function(){return R.maxInt136}});Object.defineProperty(i,"maxInt144",{enumerable:!0,get:function(){return R.maxInt144}});Object.defineProperty(i,"maxInt152",{enumerable:!0,get:function(){return R.maxInt152}});Object.defineProperty(i,"maxInt160",{enumerable:!0,get:function(){return R.maxInt160}});Object.defineProperty(i,"maxInt168",{enumerable:!0,get:function(){return R.maxInt168}});Object.defineProperty(i,"maxInt176",{enumerable:!0,get:function(){return R.maxInt176}});Object.defineProperty(i,"maxInt184",{enumerable:!0,get:function(){return R.maxInt184}});Object.defineProperty(i,"maxInt192",{enumerable:!0,get:function(){return R.maxInt192}});Object.defineProperty(i,"maxInt200",{enumerable:!0,get:function(){return R.maxInt200}});Object.defineProperty(i,"maxInt208",{enumerable:!0,get:function(){return R.maxInt208}});Object.defineProperty(i,"maxInt216",{enumerable:!0,get:function(){return R.maxInt216}});Object.defineProperty(i,"maxInt224",{enumerable:!0,get:function(){return R.maxInt224}});Object.defineProperty(i,"maxInt232",{enumerable:!0,get:function(){return R.maxInt232}});Object.defineProperty(i,"maxInt240",{enumerable:!0,get:function(){return R.maxInt240}});Object.defineProperty(i,"maxInt248",{enumerable:!0,get:function(){return R.maxInt248}});Object.defineProperty(i,"maxInt256",{enumerable:!0,get:function(){return R.maxInt256}});Object.defineProperty(i,"maxUint8",{enumerable:!0,get:function(){return R.maxUint8}});Object.defineProperty(i,"maxUint16",{enumerable:!0,get:function(){return R.maxUint16}});Object.defineProperty(i,"maxUint24",{enumerable:!0,get:function(){return R.maxUint24}}
47);Object.defineProperty(i,"maxUint32",{enumerable:!0,get:function(){return R.maxUint32}});Object.defineProperty(i,"maxUint40",{enumerable:!0,get:function(){return R.maxUint40}});Object.defineProperty(i,"maxUint48",{enumerable:!0,get:function(){return R.maxUint48}});Object.defineProperty(i,"maxUint56",{enumerable:!0,get:function(){return R.maxUint56}});Object.defineProperty(i,"maxUint64",{enumerable:!0,get:function(){return R.maxUint64}});Object.defineProperty(i,"maxUint72",{enumerable:!0,get:function(){return R.maxUint72}});Object.defineProperty(i,"maxUint80",{enumerable:!0,get:function(){return R.maxUint80}});Object.defineProperty(i,"maxUint88",{enumerable:!0,get:function(){return R.maxUint88}});Object.defineProperty(i,"maxUint96",{enumerable:!0,get:function(){return R.maxUint96}});Object.defineProperty(i,"maxUint104",{enumerable:!0,get:function(){return R.maxUint104}});Object.defineProperty(i,"maxUint112",{enumerable:!0,get:function(){return R.maxUint112}});Object.defineProperty(i,"maxUint120",{enumerable:!0,get:function(){return R.maxUint120}});Object.defineProperty(i,"maxUint128",{enumerable:!0,get:function(){return R.maxUint128}});Object.defineProperty(i,"maxUint136",{enumerable:!0,get:function(){return R.maxUint136}});Object.defineProperty(i,"maxUint144",{enumerable:!0,get:function(){return R.maxUint144}});Object.defineProperty(i,"maxUint152",{enumerable:!0,get:function(){return R.maxUint152}});Object.defineProperty(i,"maxUint160",{enumerable:!0,get:function(){return R.maxUint160}});Object.defineProperty(i,"maxUint168",{enumerable:!0,get:function(){return R.maxUint168}});Object.defineProperty(i,"maxUint176",{enumerable:!0,get:function(){return R.maxUint176}});Object.defineProperty(i,"maxUint184",{enumerable:!0,get:function(){return R.maxUint184}});Object.defineProperty(i,"maxUint192",{enumerable:!0,get:function(){return R.maxUint192}});Object.defineProperty(i,"maxUint200",{enumerable:!0,get:function(){return R.maxUint200}});Object.defineProperty(i,"maxUint208",{enumerable:!0,get:function(){return R.maxUint208}});Object.defineProperty(i,"maxUint216",{enumerable:!0,get:function(){return R.maxUint216}});Object.defineProperty(i,"maxUint224",{enumerable:!0,get:function(){return R.maxUint224}});Object.defineProperty(i,"maxUint232",{enumerable:!0,get:function(){return R.maxUint232}});Object.defineProperty(i,"maxUint240",{enumerable:!0,get:function(){return R.maxUint240}});Object.defineProperty(i,"maxUint248",{enumerable:!0,get:function(){return R.maxUint248}});Object.defineProperty(i,"maxUint256",{enumerable:!0,get:function(){return R.maxUint256}});Object.defineProperty(i,"minInt8",{enumerable:!0,get:function(){return R.minInt8}});Object.defineProperty(i,"minInt16",{enumerable:!0,get:function(){return R.minInt16}});Object.defineProperty(i,"minInt24",{enumerable:!0,get:function(){return R.minInt24}});Object.defineProperty(i,"minInt32",{enumerable:!0,get:function(){return R.minInt32}});Object.defineProperty(i,"minInt40",{enumerable:!0,get:function(){return R.minInt40}});Object.defineProperty(i,"minInt48",{enumerable:!0,get:function(){return R.minInt48}});Object.defineProperty(i,"minInt56",{enumerable:!0,get:function(){return R.minInt56}});Object.defineProperty(i,"minInt64",{enumerable:!0,get:function(){return R.minInt64}});Object.defineProperty(i,"minInt72",{enumerable:!0,get:function(){return R.minInt72}});Object.defineProperty(i,"minInt80",{enumerable:!0,get:function(){return R.minInt80}});Object.defineProperty(i,"minInt88",{enumerable:!0,get:function(){return R.minInt88}});Object.defineProperty(i,"minInt96",{enumerable:!0,get:function(){return R.minInt96}});Object.defineProperty(i,"minInt104",{enumerable:!0,get:function(){return R.minInt104}});Object.defineProperty(i,"minInt112",{enumerable:!0,get:function(){return R.minInt112}});Object.defineProperty(i,"minInt120",{enumerable:!0,get:function(){return R.minInt120}});Object.defineProperty(i,"minInt128",{enumerable:!0,get:function(){return R.minInt128}});Object.defineProperty(i,"minInt136",{enumerable:!0,get:function(){return R.minInt136}});Object.defineProperty(i,"minInt144",{enumerable:!0,get:function(){return R.minInt144}});Object.defineProperty(i,"minInt152",{enumerable:!0,get:function(){return R.minInt152}});Object.defineProperty(i,"minInt160",{enumerable:!0,get:function(){return R.minInt160}});Object.defineProperty(i,"minInt168",{enumerable:!0,get:function(){return R.minInt168}});Object.defineProperty(i,"minInt176",{enumerable:!0,get:function(){return R.minInt176}});Object.defineProperty(i,"minInt184",{enumerable:!0,get:function(){return R.minInt184}});Object.defineProperty(i,"minInt192",{enumerable:!0,get:function(){return R.minInt192}});Object.defineProperty(i,"minInt200",{enumerable:!0,get:function(){return R.minInt200}});Object.defineProperty(i,"minInt208",{enumerable:!0,get:function(){return R.minInt208}});Object.defineProperty(i,"minInt216",{enumerable:!0,get:function(){return R.minInt216}});Object.defineProperty(i,"minInt224",{enumerable:!0,get:function(){return R.minInt224}});Object.defineProperty(i,"minInt232",{enumerable:!0,get:function(){return R.minInt232}});Object.defineProperty(i,"minInt240",{enumerable:!0,get:function(){return R.minInt240}});Object.defineProperty(i,"minInt248",{enumerable:!0,get:function(){return R.minInt248}});Object.defineProperty(i,"minInt256",{enumerable:!0,get:function(){return R.minInt256}});var uY=tg();Object.defineProperty(i,"presignMessagePrefix",{enumerable:!0,get:function(){return uY.presignMessagePrefix}});var k6=os();Object.defineProperty(i,"etherUnits",{enumerable:!0,get:function(){return k6.etherUnits}});Object.defineProperty(i,"gweiUnits",{enumerable:!0,get:function(){return k6.gweiUnits}});Object.defineProperty(i,"weiUnits",{enumerable:!0,get:function(){return k6.weiUnits}});var _e=ge();Object.defineProperty(i,"AbiConstructorNotFoundError",{enumerable:!0,get:function(){return _e.AbiConstructorNotFoundError}});Object.defineProperty(i,"AbiConstructorParamsNotFoundError",{enumerable:!0,get:function(){return _e.AbiConstructorParamsNotFoundError}});Object.defineProperty(i,"AbiDecodingDataSizeInvalidError",{enumerable:!0,get:function(){return _e.AbiDecodingDataSizeInvalidError}});Object.defineProperty(i,"AbiDecodingDataSizeTooSmallError",{enumerable:!0,get:function(){return _e.AbiDecodingDataSizeTooSmallError}});Object.defineProperty(i,"AbiDecodingZeroDataError",{enumerable:!0,get:function(){return _e.AbiDecodingZeroDataError}});
47Object.defineProperty(i,"AbiEncodingArrayLengthMismatchError",{enumerable:!0,get:function(){return _e.AbiEncodingArrayLengthMismatchError}});Object.defineProperty(i,"AbiEncodingBytesSizeMismatchError",{enumerable:!0,get:function(){return _e.AbiEncodingBytesSizeMismatchError}});Object.defineProperty(i,"AbiEncodingLengthMismatchError",{enumerable:!0,get:function(){return _e.AbiEncodingLengthMismatchError}});Object.defineProperty(i,"AbiErrorInputsNotFoundError",{enumerable:!0,get:function(){return _e.AbiErrorInputsNotFoundError}});Object.defineProperty(i,"AbiErrorNotFoundError",{enumerable:!0,get:function(){return _e.AbiErrorNotFoundError}});Object.defineProperty(i,"AbiErrorSignatureNotFoundError",{enumerable:!0,get:function(){return _e.AbiErrorSignatureNotFoundError}});Object.defineProperty(i,"AbiEventNotFoundError",{enumerable:!0,get:function(){return _e.AbiEventNotFoundError}});Object.defineProperty(i,"AbiEventSignatureEmptyTopicsError",{enumerable:!0,get:function(){return _e.AbiEventSignatureEmptyTopicsError}});Object.defineProperty(i,"AbiEventSignatureNotFoundError",{enumerable:!0,get:function(){return _e.AbiEventSignatureNotFoundError}});Object.defineProperty(i,"AbiFunctionNotFoundError",{enumerable:!0,get:function(){return _e.AbiFunctionNotFoundError}});Object.defineProperty(i,"AbiFunctionOutputsNotFoundError",{enumerable:!0,get:function(){return _e.AbiFunctionOutputsNotFoundError}});Object.defineProperty(i,"AbiFunctionSignatureNotFoundError",{enumerable:!0,get:function(){return _e.AbiFunctionSignatureNotFoundError}});Object.defineProperty(i,"BytesSizeMismatchError",{enumerable:!0,get:function(){return _e.BytesSizeMismatchError}});Object.defineProperty(i,"DecodeLogDataMismatch",{enumerable:!0,get:function(){return _e.DecodeLogDataMismatch}});Object.defineProperty(i,"DecodeLogTopicsMismatch",{enumerable:!0,get:function(){return _e.DecodeLogTopicsMismatch}});Object.defineProperty(i,"InvalidAbiDecodingTypeError",{enumerable:!0,get:function(){return _e.InvalidAbiDecodingTypeError}});Object.defineProperty(i,"InvalidAbiEncodingTypeError",{enumerable:!0,get:function(){return _e.InvalidAbiEncodingTypeError}});Object.defineProperty(i,"InvalidArrayError",{enumerable:!0,get:function(){return _e.InvalidArrayError}});Object.defineProperty(i,"InvalidDefinitionTypeError",{enumerable:!0,get:function(){return _e.InvalidDefinitionTypeError}});Object.defineProperty(i,"UnsupportedPackedAbiType",{enumerable:!0,get:function(){return _e.UnsupportedPackedAbiType}});var cY=jt();Object.defineProperty(i,"InvalidAddressError",{enumerable:!0,get:function(){return cY.InvalidAddressError}});var K8=Q();Object.defineProperty(i,"BaseError",{enumerable:!0,get:function(){return K8.BaseError}});Object.defineProperty(i,"setErrorConfig",{enumerable:!0,get:function(){return K8.setErrorConfig}});var dY=oc();Object.defineProperty(i,"BlockNotFoundError",{enumerable:!0,get:function(){return dY.BlockNotFoundError}});var fY=E1();Object.defineProperty(i,"BundleFailedError",{enumerable:!0,get:function(){return fY.BundleFailedError}});var ra=ws();Object.defineProperty(i,"ChainDoesNotSupportContract",{enumerable:!0,get:function(){return ra.ChainDoesNotSupportContract}});Object.defineProperty(i,"ChainMismatchError",{enumerable:!0,get:function(){return ra.ChainMismatchError}});Object.defineProperty(i,"ChainNotFoundError",{enumerable:!0,get:function(){return ra.ChainNotFoundError}});Object.defineProperty(i,"ClientChainNotConfiguredError",{enumerable:!0,get:function(){return ra.ClientChainNotConfiguredError}});Object.defineProperty(i,"InvalidChainIdError",{enumerable:!0,get:function(){return ra.InvalidChainIdError}});var eo=mr();Object.defineProperty(i,"CallExecutionError",{enumerable:!0,get:function(){return eo.CallExecutionError}});Object.defineProperty(i,"ContractFunctionExecutionError",{enumerable:!0,get:function(){return eo.ContractFunctionExecutionError}});Object.defineProperty(i,"ContractFunctionRevertedError",{enumerable:!0,get:function(){return eo.ContractFunctionRevertedError}});Object.defineProperty(i,"ContractFunctionZeroDataError",{enumerable:!0,get:function(){return eo.ContractFunctionZeroDataError}});Object.defineProperty(i,"CounterfactualDeploymentFailedError",{enumerable:!0,get:function(){return eo.CounterfactualDeploymentFailedError}});Object.defineProperty(i,"RawContractError",{enumerable:!0,get:function(){return eo.RawContractError}});var Z8=mo();Object.defineProperty(i,"SizeExceedsPaddingSizeError",{enumerable:!0,get:function(){return Z8.SizeExceedsPaddingSizeError}});Object.defineProperty(i,"SliceOffsetOutOfBoundsError",{enumerable:!0,get:function(){return Z8.SliceOffsetOutOfBoundsError}});var na=En();Object.defineProperty(i,"IntegerOutOfRangeError",{enumerable:!0,get:function(){return na.IntegerOutOfRangeError}});Object.defineProperty(i,"InvalidBytesBooleanError",{enumerable:!0,get:function(){return na.InvalidBytesBooleanError}});Object.defineProperty(i,"InvalidHexBooleanError",{enumerable:!0,get:function(){return na.InvalidHexBooleanError}});Object.defineProperty(i,"InvalidHexValueError",{enumerable:!0,get:function(){return na.InvalidHexValueError}});Object.defineProperty(i,"SizeOverflowError",{enumerable:!0,get:function(){return na.SizeOverflowError}});var Rf=rd();Object.defineProperty(i,"EnsAvatarInvalidNftUriError",{enumerable:!0,get:function(){return Rf.EnsAvatarInvalidNftUriError}});Object.defineProperty(i,"EnsAvatarUnsupportedNamespaceError",{enumerable:!0,get:function(){return Rf.EnsAvatarUnsupportedNamespaceError}});Object.defineProperty(i,"EnsAvatarUriResolutionError",{enumerable:!0,get:function(){return Rf.EnsAvatarUriResolutionError}});Object.defineProperty(i,"EnsInvalidChainIdError",{enumerable:!0,get:function(){return Rf.EnsInvalidChainIdError}});var lY=vb();Object.defineProperty(i,"EstimateGasExecutionError",{enumerable:!0,get:function(){return lY.EstimateGasExecutionError}});var N6=Lo();Object.defineProperty(i,"BaseFeeScalarError",{enumerable:!0,get:function(){return N6.BaseFeeScalarError}});Object.defineProperty(i,"Eip1559FeesNotSupportedError",{enumerable:!0,get:function(){return N6.Eip1559FeesNotSupportedError}});Object.defineProperty(i,"MaxFeePerGasTooLowError",{enumerable:!0,get:function(){return N6.MaxFeePerGasTooLowError}});var pY=ll();Object.defineProperty(i,"FilterTypeNotSupportedError",{enumerable:!0,get:function(){return pY.FilterTypeNotSupportedError}});var Ct=Kt();Object.defineProperty(i,"ExecutionRevertedError",{enumerable:!0,get:function(){return Ct.ExecutionRevertedError}});Object.defineProperty(i,"FeeCapTooHighError",{enumerable:!0,get:function(){return Ct.FeeCapTooHighError}});Object.defineProperty(i,"FeeCapTooLowError",{enumerable:!0,get:function(){return Ct.FeeCapTooLowError}});Object.defineProperty(i,"InsufficientFundsError",{enumerable:!0,get:function(){return Ct.InsufficientFundsError}});Object.defineProperty(i,"IntrinsicGasTooHighError",{enumerable:!0,get:function(){return Ct.IntrinsicGasTooHighError}});Object.defineProperty(i,"IntrinsicGasTooLowError",{enumerable:!0,get:function(){return Ct.IntrinsicGasTooLowError}});Object.defineProperty(i,"NonceMaxValueError",{enumerable:!0,get:function(){return Ct.NonceMaxValueError}});Object.defineProperty(i,"NonceTooHighError",{enumerable:!0,get:function(){return Ct.NonceTooHighError}});Object.defineProperty(i,"NonceTooLowError",{enumerable:!0,get:function(){return Ct.NonceTooLowError}});Object.defineProperty(i,"TipAboveFeeCapError",{enumerable:!0,get:function(){return Ct.TipAboveFeeCapError}});Object.defineProperty(i,"TransactionTypeNotSupportedError",{enumerable:!0,get:function(){return Ct.TransactionTypeNotSupportedError}});Object.defineProperty(i,"UnknownNodeError",{enumerable:!0,get:function(){return Ct.UnknownNodeError}});var sa=Pt();Object.defineProperty(i,"HttpRequestError",{enumerable:!0,get:function(){return sa.HttpRequestError}});Object.defineProperty(i,"RpcRequestError",{enumerable:!0,get:function(){return sa.RpcRequestError}});Object.defineProperty(i,"SocketClosedError",{enumerable:!0,get:function(){return sa.SocketClosedError}});Object.defineProperty(i,"TimeoutError",{enumerable:!0,get:function(){return sa.TimeoutError}});Object.defineProperty(i,"WebSocketRequestError",{enumerable:!0,get:function(){return sa.WebSocketRequestError}});var pe=yr();Object.defineProperty(i,"AtomicityNotSupportedError",{enumerable:!0,get:function(){return pe.AtomicityNotSupportedError}});Object.defineProperty(i,"AtomicReadyWalletRejectedUpgradeError",{enumerable:!0,get:function(){return pe.AtomicReadyWalletRejectedUpgradeError}});Object.defineProperty(i,"BundleTooLargeError",{enumerable:!0,get:function(){return pe.BundleTooLargeError}});Object.defineProperty(i,"ChainDisconnectedError",{enumerable:!0,get:function(){return pe.ChainDisconnectedError}});Object.defineProperty(i,"DuplicateIdError",{enumerable:!0,get:function(){return pe.DuplicateIdError}});Object.defineProperty(i,"InternalRpcError",{enumerable:!0,get:function(){return pe.InternalRpcError}});Object.defineProperty(i,"InvalidInputRpcError",{enumerable:!0,get:function(){return pe.InvalidInputRpcError}});Object.defineProperty(i,"InvalidParamsRpcError",{enumerable:!0,get:function(){return pe.InvalidParamsRpcError}});Object.defineProperty(i,"InvalidRequestRpcError",{enumerable:!0,get:function(){return pe.InvalidRequestRpcError}});Object.defineProperty(i,"JsonRpcVersionUnsupportedError",{enumerable:!0,get:function(){return pe.JsonRpcVersionUnsupportedError}});Object.defineProperty(i,"LimitExceededRpcError",{enumerable:!0,get:function(){return pe.LimitExceededRpcError}});Object.defineProperty(i,"MethodNotFoundRpcError",{enumerable:!0,get:function(){return pe.MethodNotFoundRpcError}});Object.defineProperty(i,"MethodNotSupportedRpcError",{enumerable:!0,get:function(){return pe.MethodNotSupportedRpcError}});Object.defineProperty(i,"ParseRpcError",{enumerable:!0,get:function(){return pe.ParseRpcError}});Object.defineProperty(i,"ProviderDisconnectedError",{enumerable:!0,get:function(){return pe.ProviderDisconnectedError}});Object.defineProperty(i,"ProviderRpcError",{enumerable:!0,get:function(){return pe.ProviderRpcError}});Object.defineProperty(i,"ResourceNotFoundRpcError",{enumerable:!0,get:function(){return pe.ResourceNotFoundRpcError}});Object.defineProperty(i,"ResourceUnavailableRpcError",{enumerable:!0,get:function(){return pe.ResourceUnavailableRpcError}});Object.defineProperty(i,"RpcError",{enumerable:!0,get:function(){return pe.RpcError}});Object.defineProperty(i,"SwitchChainError",{enumerable:!0,get:function(){return pe.SwitchChainError}});Object.defineProperty(i,"TransactionRejectedRpcError",{enumerable:!0,get:function(){return pe.TransactionRejectedRpcError}});Object.defineProperty(i,"UnauthorizedProviderError",{enumerable:!0,get:function(){return pe.UnauthorizedProviderError}});Object.defineProperty(i,"UnknownBundleIdError",{enumerable:!0,get:function(){return pe.UnknownBundleIdError}});Object.defineProperty(i,"UnknownRpcError",{enumerable:!0,get:function(){return pe.UnknownRpcError}});Object.defineProperty(i,"UnsupportedChainIdError",{enumerable:!0,get:function(){return pe.UnsupportedChainIdError}});Object.defineProperty(i,"UnsupportedNonOptionalCapabilityError",{enumerable:!0,get:function(){return pe.UnsupportedNonOptionalCapabilityError}});Object.defineProperty(i,"UnsupportedProviderMethodError",{enumerable:!0,get:function(){return pe.UnsupportedProviderMethodError}});Object.defineProperty(i,"UserRejectedRequestError",{enumerable:!0,get:function(){return pe.UserRejectedRequestError}});var Y8=eu();Object.defineProperty(i,"AccountStateConflictError",{enumerable:!0,get:function(){return Y8.AccountStateConflictError}});
47Object.defineProperty(i,"StateAssignmentConflictError",{enumerable:!0,get:function(){return Y8.StateAssignmentConflictError}});var ur=Ge();Object.defineProperty(i,"FeeConflictError",{enumerable:!0,get:function(){return ur.FeeConflictError}});Object.defineProperty(i,"InvalidLegacyVError",{enumerable:!0,get:function(){return ur.InvalidLegacyVError}});Object.defineProperty(i,"InvalidSerializableTransactionError",{enumerable:!0,get:function(){return ur.InvalidSerializableTransactionError}});Object.defineProperty(i,"InvalidSerializedTransactionError",{enumerable:!0,get:function(){return ur.InvalidSerializedTransactionError}});Object.defineProperty(i,"InvalidSerializedTransactionTypeError",{enumerable:!0,get:function(){return ur.InvalidSerializedTransactionTypeError}});Object.defineProperty(i,"InvalidStorageKeySizeError",{enumerable:!0,get:function(){return ur.InvalidStorageKeySizeError}});Object.defineProperty(i,"TransactionExecutionError",{enumerable:!0,get:function(){return ur.TransactionExecutionError}});Object.defineProperty(i,"TransactionNotFoundError",{enumerable:!0,get:function(){return ur.TransactionNotFoundError}});Object.defineProperty(i,"TransactionReceiptNotFoundError",{enumerable:!0,get:function(){return ur.TransactionReceiptNotFoundError}});Object.defineProperty(i,"WaitForTransactionReceiptTimeoutError",{enumerable:!0,get:function(){return ur.WaitForTransactionReceiptTimeoutError}});var bY=Of();Object.defineProperty(i,"UrlRequiredError",{enumerable:!0,get:function(){return bY.UrlRequiredError}});var H6=dg();Object.defineProperty(i,"InvalidDomainError",{enumerable:!0,get:function(){return H6.InvalidDomainError}});Object.defineProperty(i,"InvalidPrimaryTypeError",{enumerable:!0,get:function(){return H6.InvalidPrimaryTypeError}});Object.defineProperty(i,"InvalidStructTypeError",{enumerable:!0,get:function(){return H6.InvalidStructTypeError}});var mY=ah();Object.defineProperty(i,"InvalidDecimalNumberError",{enumerable:!0,get:function(){return mY.InvalidDecimalNumberError}});var yY=O8();Object.defineProperty(i,"EIP1193ProviderRpcError",{enumerable:!0,get:function(){return yY.ProviderRpcError}});var gY=br();Object.defineProperty(i,"decodeAbiParameters",{enumerable:!0,get:function(){return gY.decodeAbiParameters}});var hY=B8();Object.defineProperty(i,"decodeDeployData",{enumerable:!0,get:function(){return hY.decodeDeployData}});var _Y=To();Object.defineProperty(i,"decodeErrorResult",{enumerable:!0,get:function(){return _Y.decodeErrorResult}});var vY=hs();Object.defineProperty(i,"decodeEventLog",{enumerable:!0,get:function(){return vY.decodeEventLog}});var jY=Oc();Object.defineProperty(i,"decodeFunctionData",{enumerable:!0,get:function(){return jY.decodeFunctionData}});var EY=Xt();Object.defineProperty(i,"decodeFunctionResult",{enumerable:!0,get:function(){return EY.decodeFunctionResult}});var xY=Et();Object.defineProperty(i,"encodeAbiParameters",{enumerable:!0,get:function(){return xY.encodeAbiParameters}});var wY=Ps();Object.defineProperty(i,"encodeDeployData",{enumerable:!0,get:function(){return wY.encodeDeployData}});var PY=Bc();Object.defineProperty(i,"encodeErrorResult",{enumerable:!0,get:function(){return PY.encodeErrorResult}});var qY=zr();Object.defineProperty(i,"encodeEventTopics",{enumerable:!0,get:function(){return qY.encodeEventTopics}});var TY=Qe();Object.defineProperty(i,"encodeFunctionData",{enumerable:!0,get:function(){return TY.encodeFunctionData}});var AY=Cc();Object.defineProperty(i,"encodeFunctionResult",{enumerable:!0,get:function(){return AY.encodeFunctionResult}});var IY=jy();Object.defineProperty(i,"encodePacked",{enumerable:!0,get:function(){return IY.encodePacked}});var OY=Wt();Object.defineProperty(i,"getAbiItem",{enumerable:!0,get:function(){return OY.getAbiItem}});var BY=_s();Object.defineProperty(i,"parseEventLogs",{enumerable:!0,get:function(){return BY.parseEventLogs}});
47var SY=Gl();Object.defineProperty(i,"prepareEncodeFunctionData",{enumerable:!0,get:function(){return SY.prepareEncodeFunctionData}});var J8=rt();Object.defineProperty(i,"checksumAddress",{enumerable:!0,get:function(){return J8.checksumAddress}});Object.defineProperty(i,"getAddress",{enumerable:!0,get:function(){return J8.getAddress}});var F6=wy();Object.defineProperty(i,"getContractAddress",{enumerable:!0,get:function(){return F6.getContractAddress}});Object.defineProperty(i,"getCreate2Address",{enumerable:!0,get:function(){return F6.getCreate2Address}});Object.defineProperty(i,"getCreateAddress",{enumerable:!0,get:function(){return F6.getCreateAddress}});var CY=Xe();Object.defineProperty(i,"isAddress",{enumerable:!0,get:function(){return CY.isAddress}});var RY=Tt();Object.defineProperty(i,"isAddressEqual",{enumerable:!0,get:function(){return RY.isAddressEqual}});var MY=Vo();Object.defineProperty(i,"blobsToCommitments",{enumerable:!0,get:function(){return MY.blobsToCommitments}});var kY=Wo();Object.defineProperty(i,"blobsToProofs",{enumerable:!0,get:function(){return kY.blobsToProofs}});var NY=fc();Object.defineProperty(i,"commitmentsToVersionedHashes",{enumerable:!0,get:function(){return NY.commitmentsToVersionedHashes}});var HY=dc();Object.defineProperty(i,"commitmentToVersionedHash",{enumerable:!0,get:function(){return HY.commitmentToVersionedHash}});var FY=C8();Object.defineProperty(i,"fromBlobs",{enumerable:!0,get:function(){return FY.fromBlobs}});var zY=R8();Object.defineProperty(i,"sidecarsToVersionedHashes",{enumerable:!0,get:function(){return zY.sidecarsToVersionedHashes}});var UY=Zo();Object.defineProperty(i,"toBlobSidecars",{enumerable:!0,get:function(){return UY.toBlobSidecars}});var LY=Jb();Object.defineProperty(i,"toBlobs",{enumerable:!0,get:function(){return LY.toBlobs}});var oa=Rc();Object.defineProperty(i,"ccipRequest",{enumerable:!0,get:function(){return oa.ccipRequest}});Object.defineProperty(i,"ccipFetch",{enumerable:!0,get:function(){return oa.ccipRequest}});Object.defineProperty(i,"offchainLookup",{enumerable:!0,get:function(){return oa.offchainLookup}});Object.defineProperty(i,"offchainLookupAbiItem",{enumerable:!0,get:function(){return oa.offchainLookupAbiItem}});Object.defineProperty(i,"offchainLookupSignature",{enumerable:!0,get:function(){return oa.offchainLookupSignature}});var DY=Os();Object.defineProperty(i,"assertCurrentChain",{enumerable:!0,get:function(){return DY.assertCurrentChain}});var $Y=My();Object.defineProperty(i,"defineChain",{enumerable:!0,get:function(){return $Y.defineChain}});var GY=Ny();Object.defineProperty(i,"extractChain",{enumerable:!0,get:function(){return GY.extractChain}});var VY=Er();Object.defineProperty(i,"getChainContractAddress",{enumerable:!0,get:function(){return VY.getChainContractAddress}});var z6=Oe();Object.defineProperty(i,"concat",{enumerable:!0,get:function(){return z6.concat}});Object.defineProperty(i,"concatBytes",{enumerable:!0,get:function(){return z6.concatBytes}});Object.defineProperty(i,"concatHex",{enumerable:!0,get:function(){return z6.concatHex}});var WY=sd();Object.defineProperty(i,"isBytes",{enumerable:!0,get:function(){return WY.isBytes}});var KY=$e();Object.defineProperty(i,"isHex",{enumerable:!0,get:function(){return KY.isHex}});var U6=lr();Object.defineProperty(i,"pad",{enumerable:!0,get:function(){return U6.pad}});Object.defineProperty(i,"padBytes",{enumerable:!0,get:function(){return U6.padBytes}});Object.defineProperty(i,"padHex",{enumerable:!0,get:function(){return U6.padHex}});var ZY=Ye();Object.defineProperty(i,"size",{enumerable:!0,get:function(){return ZY.size}});var L6=mt();Object.defineProperty(i,"slice",{enumerable:!0,get:function(){return L6.slice}});Object.defineProperty(i,"sliceBytes",{enumerable:!0,get:function(){return L6.sliceBytes}});Object.defineProperty(i,"sliceHex",{enumerable:!0,get:function(){return L6.sliceHex}});var YY=Vt();Object.defineProperty(i,"trim",{enumerable:!0,get:function(){return YY.trim}});var ia=Ya();Object.defineProperty(i,"bytesToBigInt",{enumerable:!0,get:function(){return ia.bytesToBigInt}});Object.defineProperty(i,"bytesToBool",{enumerable:!0,get:function(){return ia.bytesToBool}});Object.defineProperty(i,"bytesToNumber",{enumerable:!0,get:function(){return ia.bytesToNumber}});Object.defineProperty(i,"bytesToString",{enumerable:!0,get:function(){return ia.bytesToString}});Object.defineProperty(i,"fromBytes",{enumerable:!0,get:function(){return ia.fromBytes}});var aa=Ee();Object.defineProperty(i,"fromHex",{enumerable:!0,get:function(){return aa.fromHex}});Object.defineProperty(i,"hexToBigInt",{enumerable:!0,get:function(){return aa.hexToBigInt}});Object.defineProperty(i,"hexToBool",{enumerable:!0,get:function(){return aa.hexToBool}});Object.defineProperty(i,"hexToNumber",{enumerable:!0,get:function(){return aa.hexToNumber}});Object.defineProperty(i,"hexToString",{enumerable:!0,get:function(){return aa.hexToString}});var JY=yd();Object.defineProperty(i,"fromRlp",{enumerable:!0,get:function(){return JY.fromRlp}});var ua=de();Object.defineProperty(i,"boolToBytes",{enumerable:!0,get:function(){return ua.boolToBytes}});Object.defineProperty(i,"hexToBytes",{enumerable:!0,get:function(){return ua.hexToBytes}});Object.defineProperty(i,"numberToBytes",{enumerable:!0,get:function(){return ua.numberToBytes}});Object.defineProperty(i,"stringToBytes",{enumerable:!0,get:function(){return ua.stringToBytes}});Object.defineProperty(i,"toBytes",{enumerable:!0,get:function(){return ua.toBytes}});var ca=U();Object.defineProperty(i,"boolToHex",{enumerable:!0,get:function(){return ca.boolToHex}});Object.defineProperty(i,"bytesToHex",{enumerable:!0,get:function(){return ca.bytesToHex}});Object.defineProperty(i,"numberToHex",{enumerable:!0,get:function(){return ca.numberToHex}});Object.defineProperty(i,"stringToHex",{enumerable:!0,get:function(){return ca.stringToHex}});Object.defineProperty(i,"toHex",{enumerable:!0,get:function(){return ca.toHex}});var D6=fs();Object.defineProperty(i,"bytesToRlp",{enumerable:!0,get:function(){return D6.bytesToRlp}});Object.defineProperty(i,"hexToRlp",{enumerable:!0,get:function(){return D6.hexToRlp}});Object.defineProperty(i,"toRlp",{enumerable:!0,get:function(){return D6.toRlp}});var XY=M1();Object.defineProperty(i,"labelhash",{enumerable:!0,get:function(){return XY.labelhash}});var QY=ed();Object.defineProperty(i,"namehash",{enumerable:!0,get:function(){return QY.namehash}});var eJ=M8();Object.defineProperty(i,"toCoinType",{enumerable:!0,get:function(){return eJ.toCoinType}});var tJ=gr();Object.defineProperty(i,"getContractError",{enumerable:!0,get:function(){return tJ.getContractError}});var X8=$o();Object.defineProperty(i,"defineBlock",{enumerable:!0,get:function(){return X8.defineBlock}});Object.defineProperty(i,"formatBlock",{enumerable:!0,get:function(){return X8.formatBlock}});var rJ=Jt();Object.defineProperty(i,"formatLog",{enumerable:!0,get:function(){return rJ.formatLog}});var $6=ms();Object.defineProperty(i,"defineTransaction",{enumerable:!0,get:function(){return $6.defineTransaction}});Object.defineProperty(i,"formatTransaction",{enumerable:!0,get:function(){return $6.formatTransaction}});Object.defineProperty(i,"transactionType",{enumerable:!0,get:function(){return $6.transactionType}});var Q8=Bs();Object.defineProperty(i,"defineTransactionReceipt",{enumerable:!0,get:function(){return Q8.defineTransactionReceipt}});Object.defineProperty(i,"formatTransactionReceipt",{enumerable:!0,get:function(){return Q8.formatTransactionReceipt}});var G6=Nt();Object.defineProperty(i,"defineTransactionRequest",{enumerable:!0,get:function(){return G6.defineTransactionRequest}});Object.defineProperty(i,"formatTransactionRequest",{enumerable:!0,get:function(){return G6.formatTransactionRequest}});Object.defineProperty(i,"rpcTransactionType",{enumerable:!0,get:function(){return G6.rpcTransactionType}});var nJ=gd();Object.defineProperty(i,"isHash",{enumerable:!0,get:function(){return nJ.isHash}});var sJ=Je();Object.defineProperty(i,"keccak256",{enumerable:!0,get:function(){return sJ.keccak256}});var oJ=Uy();Object.defineProperty(i,"ripemd160",{enumerable:!0,get:function(){return oJ.ripemd160}});var iJ=cc();Object.defineProperty(i,"sha256",{enumerable:!0,get:function(){return iJ.sha256}});var aJ=Ly();Object.defineProperty(i,"toEventHash",{enumerable:!0,get:function(){return aJ.toEventHash}});var eq=Pn();Object.defineProperty(i,"toEventSelector",{enumerable:!0,get:function(){return eq.toEventSelector}});Object.defineProperty(i,"getEventSelector",{enumerable:!0,get:function(){return eq.toEventSelector}});var tq=Dy();Object.defineProperty(i,"toEventSignature",{enumerable:!0,get:function(){return tq.toEventSignature}});Object.defineProperty(i,"getEventSignature",{enumerable:!0,get:function(){return tq.toEventSignature}});var uJ=$y();Object.defineProperty(i,"toFunctionHash",{enumerable:!0,get:function(){return uJ.toFunctionHash}});var rq=Fr();Object.defineProperty(i,"toFunctionSelector",{enumerable:!0,get:function(){return rq.toFunctionSelector}});Object.defineProperty(i,"getFunctionSelector",{enumerable:!0,get:function(){return rq.toFunctionSelector}});var nq=Gy();Object.defineProperty(i,"toFunctionSignature",{enumerable:!0,get:function(){return nq.toFunctionSignature}});Object.defineProperty(i,"getFunctionSignature",{enumerable:!0,get:function(){return nq.toFunctionSignature}});var cJ=A6();Object.defineProperty(i,"defineKzg",{enumerable:!0,get:function(){return cJ.defineKzg}});var dJ=k8();Object.defineProperty(i,"setupKzg",{enumerable:!0,get:function(){return dJ.setupKzg}});var sq=Vy();Object.defineProperty(i,"createNonceManager",{enumerable:!0,get:function(){return sq.createNonceManager}});Object.defineProperty(i,"nonceManager",{enumerable:!0,get:function(){return sq.nonceManager}});var fJ=u1();Object.defineProperty(i,"withCache",{enumerable:!0,get:function(){return fJ.withCache}});var lJ=fi();Object.defineProperty(i,"withRetry",{enumerable:!0,get:function(){return lJ.withRetry}});var pJ=Ed();Object.defineProperty(i,"withTimeout",{enumerable:!0,get:function(){return pJ.withTimeout}});var bJ=N8();Object.defineProperty(i,"compactSignatureToSignature",{enumerable:!0,get:function(){return bJ.compactSignatureToSignature}});
47var mJ=Ms();Object.defineProperty(i,"hashMessage",{enumerable:!0,get:function(){return mJ.hashMessage}});var V6=Ns();Object.defineProperty(i,"hashDomain",{enumerable:!0,get:function(){return V6.hashDomain}});Object.defineProperty(i,"hashStruct",{enumerable:!0,get:function(){return V6.hashStruct}});Object.defineProperty(i,"hashTypedData",{enumerable:!0,get:function(){return V6.hashTypedData}});var yJ=Id();Object.defineProperty(i,"isErc6492Signature",{enumerable:!0,get:function(){return yJ.isErc6492Signature}});var gJ=uf();Object.defineProperty(i,"isErc8010Signature",{enumerable:!0,get:function(){return gJ.isErc8010Signature}});var oq=F8();Object.defineProperty(i,"hexToCompactSignature",{enumerable:!0,get:function(){return oq.parseCompactSignature}});Object.defineProperty(i,"parseCompactSignature",{enumerable:!0,get:function(){return oq.parseCompactSignature}});var hJ=$g();Object.defineProperty(i,"parseErc6492Signature",{enumerable:!0,get:function(){return hJ.parseErc6492Signature}});var _J=Vg();Object.defineProperty(i,"parseErc8010Signature",{enumerable:!0,get:function(){return _J.parseErc8010Signature}});var iq=z8();Object.defineProperty(i,"hexToSignature",{enumerable:!0,get:function(){return iq.parseSignature}});Object.defineProperty(i,"parseSignature",{enumerable:!0,get:function(){return iq.parseSignature}});var vJ=vr();Object.defineProperty(i,"recoverAddress",{enumerable:!0,get:function(){return vJ.recoverAddress}});var jJ=cf();Object.defineProperty(i,"recoverMessageAddress",{enumerable:!0,get:function(){return jJ.recoverMessageAddress}});var EJ=Lu();Object.defineProperty(i,"recoverPublicKey",{enumerable:!0,get:function(){return EJ.recoverPublicKey}});var xJ=U8();Object.defineProperty(i,"recoverTransactionAddress",{enumerable:!0,get:function(){return xJ.recoverTransactionAddress}});var wJ=df();Object.defineProperty(i,"recoverTypedDataAddress",{enumerable:!0,get:function(){return wJ.recoverTypedDataAddress}});var aq=D8();Object.defineProperty(i,"compactSignatureToHex",{enumerable:!0,get:function(){return aq.serializeCompactSignature}});Object.defineProperty(i,"serializeCompactSignature",{enumerable:!0,get:function(){return aq.serializeCompactSignature}});var PJ=Yg();Object.defineProperty(i,"serializeErc6492Signature",{enumerable:!0,get:function(){return PJ.serializeErc6492Signature}});var qJ=Xg();Object.defineProperty(i,"serializeErc8010Signature",{enumerable:!0,get:function(){return qJ.serializeErc8010Signature}});var uq=Uh();Object.defineProperty(i,"signatureToHex",{enumerable:!0,get:function(){return uq.serializeSignature}});Object.defineProperty(i,"serializeSignature",{enumerable:!0,get:function(){return uq.serializeSignature}});var TJ=$8();Object.defineProperty(i,"signatureToCompactSignature",{enumerable:!0,get:function(){return TJ.signatureToCompactSignature}});var AJ=sg();Object.defineProperty(i,"toPrefixedMessage",{enumerable:!0,get:function(){return AJ.toPrefixedMessage}});var IJ=eh();Object.defineProperty(i,"verifyHash",{enumerable:!0,get:function(){return IJ.verifyHash}});var OJ=rh();Object.defineProperty(i,"verifyMessage",{enumerable:!0,get:function(){return OJ.verifyMessage}});var BJ=sh();Object.defineProperty(i,"verifyTypedData",{enumerable:!0,get:function(){return BJ.verifyTypedData}});var SJ=Ce();Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return SJ.stringify}});var CJ=Ht();Object.defineProperty(i,"assertRequest",{enumerable:!0,get:function(){return CJ.assertRequest}});var W6=yi();Object.defineProperty(i,"assertTransactionEIP1559",{enumerable:!0,get:function(){return W6.assertTransactionEIP1559}});Object.defineProperty(i,"assertTransactionEIP2930",{enumerable:!0,get:function(){return W6.assertTransactionEIP2930}});Object.defineProperty(i,"assertTransactionLegacy",{enumerable:!0,get:function(){return W6.assertTransactionLegacy}});var RJ=ff();Object.defineProperty(i,"getSerializedTransactionType",{enumerable:!0,get:function(){return RJ.getSerializedTransactionType}});var MJ=Yo();Object.defineProperty(i,"getTransactionType",{enumerable:!0,get:function(){return MJ.getTransactionType}});var kJ=lf();Object.defineProperty(i,"parseTransaction",{enumerable:!0,get:function(){return kJ.parseTransaction}});var NJ=dd();Object.defineProperty(i,"serializeAccessList",{enumerable:!0,get:function(){return NJ.serializeAccessList}});var HJ=_i();Object.defineProperty(i,"serializeTransaction",{enumerable:!0,get:function(){return HJ.serializeTransaction}});var Mf=Ei();Object.defineProperty(i,"domainSeparator",{enumerable:!0,get:function(){return Mf.domainSeparator}});Object.defineProperty(i,"getTypesForEIP712Domain",{enumerable:!0,get:function(){return Mf.getTypesForEIP712Domain}});Object.defineProperty(i,"serializeTypedData",{enumerable:!0,get:function(){return Mf.serializeTypedData}
47});Object.defineProperty(i,"validateTypedData",{enumerable:!0,get:function(){return Mf.validateTypedData}});var FJ=is();Object.defineProperty(i,"formatEther",{enumerable:!0,get:function(){return FJ.formatEther}});var zJ=$r();Object.defineProperty(i,"formatGwei",{enumerable:!0,get:function(){return zJ.formatGwei}});var UJ=Ao();Object.defineProperty(i,"formatUnits",{enumerable:!0,get:function(){return UJ.formatUnits}});var LJ=dh();Object.defineProperty(i,"parseEther",{enumerable:!0,get:function(){return LJ.parseEther}});var DJ=lh();Object.defineProperty(i,"parseGwei",{enumerable:!0,get:function(){return DJ.parseGwei}});var $J=Ui();Object.defineProperty(i,"parseUnits",{enumerable:!0,get:function(){return $J.parseUnits}})});var dq=p(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.MAGIC_VALUE_BYTES=to.MAGIC_VALUE=void 0;var GJ="0x1626ba7e";to.MAGIC_VALUE=GJ;var VJ="0x20c13b0b";to.MAGIC_VALUE_BYTES=VJ});var Z6=p(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.PermissionsError=ro.PERMISSIONS_REQUEST_REJECTED=void 0;ro.PERMISSIONS_REQUEST_REJECTED=4001;var K6=class e extends Error{constructor(t,r,n){super(t),this.code=r,this.data=n,Object.setPrototypeOf(this,e.prototype)}};ro.PermissionsError=K6});var X6=p(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.Wallet=void 0;var Y6=Br(),kf=Z6(),J6=class{constructor(t){this.communicator=t}getPermissions(){return y(this,null,function*(){return(yield this.communicator.send(Y6.Methods.wallet_getPermissions,void 0)).data})}requestPermissions(t){return y(this,null,function*(){if(!this.isPermissionRequestValid(t))throw new kf.PermissionsError("Permissions request is invalid",kf.PERMISSIONS_REQUEST_REJECTED);try{return(yield this.communicator.send(Y6.Methods.wallet_requestPermissions,t)).data}catch(r){throw new kf.PermissionsError("Permissions rejected",kf.PERMISSIONS_REQUEST_REJECTED)}})}isPermissionRequestValid(t){return t.every(r=>typeof r=="object"?Object.keys(r).every(n=>!!Object.values(Y6.RestrictedMethods).includes(n)):!1)}};Nf.Wallet=J6});var pq=p(Q6=>{"use strict";Object.defineProperty(Q6,"__esModule",{value:!0});var WJ=X6(),fq=Z6(),lq=(e,t)=>t.some(r=>r.parentCapability===e),KJ=()=>(e,t,r)=>{let n=r.value;return r.value=function(){return y(this,null,function*(){let s=new WJ.Wallet(this.communicator),o=yield s.getPermissions();if(lq(t,o)||(o=yield s.requestPermissions([{[t]:{}}])),!lq(t,o))throw new fq.PermissionsError("Permissions rejected",fq.PERMISSIONS_REQUEST_REJECTED);return n.apply(this)})},r};Q6.default=KJ});var yq=p(pn=>{"use strict";var ZJ=pn&&pn.__decorate||function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(o=(s<3?a(o):s>3?a(t,r,o):a(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},YJ=pn&&pn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pn,"__esModule",{value:!0});pn.Safe=void 0;var Hf=cq(),bq=dq(),ln=Br(),mq=Ea(),JJ=ha(),XJ=YJ(pq()),Ff=class{constructor(t){this.communicator=t}getChainInfo(){return y(this,null,function*(){return(yield this.communicator.send(ln.Methods.getChainInfo,void 0)).data})}getInfo(){return y(this,null,function*(){return(yield this.communicator.send(ln.Methods.getSafeInfo,void 0)).data})}experimental_getBalances(){return y(this,arguments,function*({currency:t="usd"}={}){return(yield this.communicator.send(ln.Methods.getSafeBalances,{currency:t})).data})}check1271Signature(t,r="0x"){return y(this,null,function*(){let n=yield this.getInfo(),s=(0,Hf.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,r]}),o={call:mq.RPC_CALLS.eth_call,params:[{to:n.safeAddress,data:s},"latest"]};try{return(yield this.communicator.send(ln.Methods.rpcCall,o)).data.slice(0,10).toLowerCase()===bq.MAGIC_VALUE}catch(a){return!1}})}check1271SignatureBytes(t,r="0x"){return y(this,null,function*(){let n=yield this.getInfo(),s=(0,Hf.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,r]}),o={call:mq.RPC_CALLS.eth_call,params:[{to:n.safeAddress,data:s},"latest"]};
47try{return(yield this.communicator.send(ln.Methods.rpcCall,o)).data.slice(0,10).toLowerCase()===bq.MAGIC_VALUE_BYTES}catch(a){return!1}})}calculateMessageHash(t){return(0,Hf.hashMessage)(t)}calculateTypedMessageHash(t){let r=typeof t.domain.chainId=="object"?t.domain.chainId.toNumber():Number(t.domain.chainId),n=t.primaryType;if(!n){let s=Object.values(t.types),o=Object.keys(t.types).filter(a=>s.every(u=>u.every(({type:c})=>c.replace("[","").replace("]","")!==a)));if(o.length===0||o.length>1)throw new Error("Please specify primaryType");n=o[0]}return(0,Hf.hashTypedData)({message:t.message,domain:B(v({},t.domain),{chainId:r,verifyingContract:t.domain.verifyingContract,salt:t.domain.salt}),types:t.types,primaryType:n})}getOffChainSignature(t){return y(this,null,function*(){return(yield this.communicator.send(ln.Methods.getOffChainSignature,t)).data})}isMessageSigned(t,r="0x"){return y(this,null,function*(){let n;if(typeof t=="string"&&(n=()=>y(this,null,function*(){let s=this.calculateMessageHash(t);return yield this.isMessageHashSigned(s,r)})),(0,JJ.isObjectEIP712TypedData)(t)&&(n=()=>y(this,null,function*(){let s=this.calculateTypedMessageHash(t);return yield this.isMessageHashSigned(s,r)})),n)return yield n();throw new Error("Invalid message type")})}isMessageHashSigned(t,r="0x"){return y(this,null,function*(){let n=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(let s of n)if(yield s(t,r))return!0;return!1})}getEnvironmentInfo(){return y(this,null,function*(){return(yield this.communicator.send(ln.Methods.getEnvironmentInfo,void 0)).data})}requestAddressBook(){return y(this,null,function*(){return(yield this.communicator.send(ln.Methods.requestAddressBook,void 0)).data})}};pn.Safe=Ff;ZJ([(0,XJ.default)()],Ff.prototype,"requestAddressBook",null)});var t5=p(da=>{"use strict";var QJ=da&&da.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(da,"__esModule",{value:!0});var eX=QJ(d5()),tX=g5(),rX=h5(),nX=yq(),sX=X6(),e5=class{constructor(t={}){let{allowedDomains:r=null,debug:n=!1}=t;this.communicator=new eX.default(r,n),this.eth=new rX.Eth(this.communicator),this.txs=new tX.TXs(this.communicator),this.safe=new nX.Safe(this.communicator),this.wallet=new sX.Wallet(this.communicator)}};da.default=e5});var gq=p(Ke=>{"use strict";var oX=Ke&&Ke.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),fa=Ke&&Ke.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&oX(t,e,r)},iX=Ke&&Ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getSDKVersion=void 0;var aX=iX(t5());Ke.default=aX.default;fa(t5(),Ke);fa(ha(),Ke);fa(Br(),Ke);fa(Vf(),Ke);var uX=Gf();Object.defineProperty(Ke,"getSDKVersion",{enumerable:!0,get:function(){return uX.getSDKVersion}});fa(Ea(),Ke)});var hq=p(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.numberToHex=no.getLowerCase=void 0;function cX(e){return e&&e.toLowerCase()}no.getLowerCase=cX;function dX(e){return`0x${e.toString(16)}`}no.numberToHex=dX});var _q=p(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.SafeAppProvider=void 0;var so=gq(),fX=xq(),Rt=hq(),r5=class extends fX.EventEmitter{constructor(t,r){super(),this.submittedTxs=new Map,this.safe=t,this.sdk=r}connect(){return y(this,null,function*(){this.emit("connect",{chainId:this.chainId})})}disconnect(){return y(this,null,function*(){})}get chainId(){return this.safe.chainId}request(t){return y(this,null,function*(){let{method:r,params:n=[]}=t;switch(r){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return(0,Rt.numberToHex)(this.chainId);case"personal_sign":{let[c,d]=n;if(this.safe.safeAddress.toLowerCase()!==d.toLowerCase())throw new Error("The address or message hash is invali
47d");let l=yield this.sdk.txs.signMessage(c);return("signature"in l?l.signature:void 0)||"0x"}case"eth_sign":{let[c,d]=n;if(this.safe.safeAddress.toLowerCase()!==c.toLowerCase()||!d.startsWith("0x"))throw new Error("The address or message hash is invalid");let l=yield this.sdk.txs.signMessage(d);return("signature"in l?l.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{let[c,d]=n,l=typeof d=="string"?JSON.parse(d):d;if(this.safe.safeAddress.toLowerCase()!==c.toLowerCase())throw new Error("The address is invalid");let f=yield this.sdk.txs.signTypedMessage(l);return("signature"in f?f.signature:void 0)||"0x"}case"eth_sendTransaction":let s=B(v({},n[0]),{value:n[0].value||"0",data:n[0].data||"0x"});typeof s.gas=="string"&&s.gas.startsWith("0x")&&(s.gas=parseInt(s.gas,16));let o=yield this.sdk.txs.send({txs:[s],params:{safeTxGas:s.gas}});return this.submittedTxs.set(o.safeTxHash,{from:this.safe.safeAddress,hash:o.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:s.data,value:s.value,to:s.to,blockHash:null,blockNumber:null,transactionIndex:null}),o.safeTxHash;case"eth_blockNumber":return(yield this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,Rt.getLowerCase)(n[0]),n[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,Rt.getLowerCase)(n[0]),n[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,Rt.getLowerCase)(n[0]),n[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,Rt.getLowerCase)(n[0]),n[1],n[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([n[0],n[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([n[0],n[1]]);case"eth_getTransactionByHash":let u=n[0];try{u=(yield this.sdk.txs.getBySafeTxHash(u)).txHash||u}catch(c){}return this.submittedTxs.has(u)?this.submittedTxs.get(u):this.sdk.eth.getTransactionByHash([u]).then(c=>(c&&(c.hash=n[0]),c));case"eth_getTransactionReceipt":{let c=n[0];try{c=(yield this.sdk.txs.getBySafeTxHash(c)).txHash||c}catch(d){}return this.sdk.eth.getTransactionReceipt([c]).then(d=>(d&&(d.transactionHash=n[0]),d))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(n[0]);case"eth_call":return this.sdk.eth.call([n[0],n[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([n[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(n[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([n[0]]);case"wallet_sendCalls":{let{from:c,calls:d,chainId:l}=n[0];if(l!==(0,Rt.numberToHex)(this.chainId))throw new Error(`Safe is not on chain ${l}`);if(c!==this.safe.safeAddress)throw Error("Invalid from address");let f=d.map((h,_)=>{if(!h.to)throw new Error(`Invalid call #${_}: missing "to" field`);return{to:h.to,data:h.data??"0x",value:h.value??(0,Rt.numberToHex)(0)}}),{safeTxHash:b}=yield this.sdk.txs.send({txs:f});return{id:b}}case"wallet_getCallsStatus":{let c=n[0],d={[so.TransactionStatus.AWAITING_CONFIRMATIONS]:100,[so.TransactionStatus.AWAITING_EXECUTION]:100,[so.TransactionStatus.SUCCESS]:200,[so.TransactionStatus.CANCELLED]:400,[so.TransactionStatus.FAILED]:500},l=yield this.sdk.txs.getBySafeTxHash(c),f={version:"1.0",id:c,chainId:(0,Rt.numberToHex)(this.chainId),status:d[l.txStatus]};if(!l.txHash)return f;let b=yield this.sdk.eth.getTransactionReceipt([l.txHash]);if(!b)return f;let m=l.txData?.dataDecoded?.method!=="multiSend"?1:l.txData.dataDecoded.parameters?.[0].valueDecoded?.length??1,h=Number(b.blockNumber),_=Number(b.gasUsed);return f.receipts=Array(m).fill({logs:b.logs,status:(0,Rt.numberToHex)(l.txStatus===so.TransactionStatus.SUCCESS?1:0),blockHash:b.blockHash,blockNumber:(0,Rt.numberToHex)(h),gasUsed:(0,Rt.numberToHex)(_),transactionHash:l.txHash}),f}case"wallet_showCallsStatus":throw new Error(`"${t.method}" not supported`);case"wallet_getCapabilities":return{[(0,Rt.numberToHex)(this.chainId)]:{atomicBatch:{supported:!0}}};default:throw Error(`"${t.method}" not implemented`)}})}send(t,r){t||r("Undefined request"),this.request(t).then(n=>
47r(null,{jsonrpc:"2.0",id:t.id,result:n})).catch(n=>r(n,null))}};zf.SafeAppProvider=r5});var pX=p(Uf=>{Object.defineProperty(Uf,"__esModule",{value:!0});Uf.SafeAppProvider=void 0;var lX=_q();Object.defineProperty(Uf,"SafeAppProvider",{enumerable:!0,get:function(){return lX.SafeAppProvider}})});export default pX();
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.