phala 1.0.18 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,42 @@
1
+ var Ln="1.0.8";var h=class extends Error{constructor(t,n={}){let r=n.cause instanceof h?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof h&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Ln}`].join(`
2
+ `);super(i),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"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function P(e,t){return e.exec(t)?.groups}var sn=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,an=/^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)?$/,tt=/^\(.+?\).*?$/;var Fn=/^tuple(?<array>(\[(\d*)\])*)$/;function nt(e){let t=e.type;if(Fn.test(e.type)&&"components"in e){t="(";let n=e.components.length;for(let o=0;o<n;o++){let i=e.components[o];t+=nt(i),o<n-1&&(t+=", ")}let r=P(Fn,e.type);return t+=`)${r?.array??""}`,nt({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function K(e){let t="",n=e.length;for(let r=0;r<n;r++){let o=e[r];t+=nt(o),r!==n-1&&(t+=", ")}return t}function un(e){return e.type==="function"?`function ${e.name}(${K(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${K(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${K(e.inputs)})`:e.type==="error"?`error ${e.name}(${K(e.inputs)})`:e.type==="constructor"?`constructor(${K(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var Dn=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Nn(e){return Dn.test(e)}function Hn(e){return P(Dn,e)}var _n=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Vn(e){return _n.test(e)}function Gn(e){return P(_n,e)}var Wn=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Zn(e){return Wn.test(e)}function qn(e){return P(Wn,e)}var Jn=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function X(e){return Jn.test(e)}function Kn(e){return P(Jn,e)}var Xn=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Yn(e){return Xn.test(e)}function Qn(e){return P(Xn,e)}var er=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function tr(e){return er.test(e)}function nr(e){return P(er,e)}var Fo=/^receive\(\) external payable$/;function rr(e){return Fo.test(e)}var or=new Set(["indexed"]),rt=new Set(["calldata","memory","storage"]);var ot=class extends h{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"})}},st=class extends h{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"})}},it=class extends h{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"})}};var at=class extends h{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},ut=class extends h{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" 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"})}},ct=class extends h{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},pt=class extends h{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},dt=class extends h{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}};var B=class extends h{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},ft=class extends h{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},lt=class extends h{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"})}};var mt=class extends h{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"})}};var yt=class extends h{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function sr(e,t,n){let r="";if(n)for(let o of Object.entries(n)){if(!o)continue;let i="";for(let s of o[1])i+=`[${s.type}${s.name?`:${s.name}`:""}]`;r+=`(${o[0]}{${i}})`}return t?`${t}:${e}${r}`:e}var bt=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}]]);function we(e,t={}){if(Zn(e))return Do(e,t);if(Vn(e))return No(e,t);if(Nn(e))return Ho(e,t);if(Yn(e))return _o(e,t);if(tr(e))return Vo(e);if(rr(e))return{type:"receive",stateMutability:"payable"};throw new ft({signature:e})}function Do(e,t={}){let n=qn(e);if(!n)throw new B({signature:e,type:"function"});let r=S(n.parameters),o=[],i=r.length;for(let a=0;a<i;a++)o.push(F(r[a],{modifiers:rt,structs:t,type:"function"}));let s=[];if(n.returns){let a=S(n.returns),c=a.length;for(let p=0;p<c;p++)s.push(F(a[p],{modifiers:rt,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:s}}function No(e,t={}){let n=Gn(e);if(!n)throw new B({signature:e,type:"event"});let r=S(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(F(r[s],{modifiers:or,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Ho(e,t={}){let n=Hn(e);if(!n)throw new B({signature:e,type:"error"});let r=S(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(F(r[s],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function _o(e,t={}){let n=Qn(e);if(!n)throw new B({signature:e,type:"constructor"});let r=S(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(F(r[s],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function Vo(e){let t=nr(e);if(!t)throw new B({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}var Go=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Wo=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Zo=/^u?int$/;function F(e,t){let n=sr(e,t?.type,t?.structs);if(bt.has(n))return bt.get(n);let r=tt.test(e),o=P(r?Wo:Go,e);if(!o)throw new at({param:e});if(o.name&&Jo(o.name))throw new ut({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},c,p={};if(r){c="tuple";let l=S(o.type),m=[],f=l.length;for(let b=0;b<f;b++)m.push(F(l[b],{structs:a}));p={components:m}}else if(o.type in a)c="tuple",p={components:a[o.type]};else if(Zo.test(o.type))c=`${o.type}256`;else if(c=o.type,t?.type!=="struct"&&!cn(c))throw new it({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new ct({param:e,type:t?.type,modifier:o.modifier});if(rt.has(o.modifier)&&!Ko(c,!!o.array))throw new pt({param:e,type:t?.type,modifier:o.modifier})}let d={type:`${c}${o.array??""}`,...i,...s,...p};return bt.set(n,d),d}function S(e,t=[],n="",r=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case",":return r===0?S(a,[...t,n.trim()]):S(a,t,`${n}${s}`,r);case"(":return S(a,t,`${n}${s}`,r+1);case")":return S(a,t,`${n}${s}`,r-1);default:return S(a,t,`${n}${s}`,r)}}if(n==="")return t;if(r!==0)throw new yt({current:n,depth:r});return t.push(n.trim()),t}function cn(e){return e==="address"||e==="bool"||e==="function"||e==="string"||sn.test(e)||an.test(e)}var qo=/^(?: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 Jo(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||sn.test(e)||an.test(e)||qo.test(e)}function Ko(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function ht(e){let t={},n=e.length;for(let s=0;s<n;s++){let a=e[s];if(!X(a))continue;let c=Kn(a);if(!c)throw new B({signature:a,type:"struct"});let p=c.properties.split(";"),d=[],l=p.length;for(let m=0;m<l;m++){let b=p[m].trim();if(!b)continue;let A=F(b,{type:"struct"});d.push(A)}if(!d.length)throw new lt({signature:a});t[c.name]=d}let r={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,c]=o[s];r[a]=ir(c,t)}return r}var Xo=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function ir(e,t,n=new Set){let r=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(tt.test(s.type))r.push(s);else{let c=P(Xo,s.type);if(!c?.type)throw new dt({abiParameter:s});let{array:p,type:d}=c;if(d in t){if(n.has(d))throw new mt({type:d});r.push({...s,type:`tuple${p??""}`,components:ir(t[d]??[],t,new Set([...n,d]))})}else if(cn(d))r.push(s);else throw new st({type:d})}}return r}function xt(e){let t=ht(e),n=[],r=e.length;for(let o=0;o<r;o++){let i=e[o];X(i)||n.push(we(i,t))}return n}function Yo(e){let t;if(typeof e=="string")t=we(e);else{let n=ht(e),r=e.length;for(let o=0;o<r;o++){let i=e[o];if(!X(i)){t=we(i,n);break}}}if(!t)throw new ot({signature:e});return t}function Y(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var pn=[{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"}],ar=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Ji=[...ar,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Ki=[...ar,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],Xi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Yi=[{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"}]}];var Qi=[{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"}];var ur="0x82ad56cb";var cr="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",pr="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",na="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";var dn="2.23.9";var fn={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${dn}`};var u=class extends Error{constructor(t,n={}){let r=(()=>n.cause instanceof u?n.cause.details:n.cause?.message?n.cause.message:n.details)(),o=(()=>n.cause instanceof u&&n.cause.docsPath||n.docsPath)(),i=fn.getDocsUrl?.({...n,docsPath:o}),s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...fn.version?[`Version: ${fn.version}`]:[]].join(`
3
+ `);super(s,n.cause?{cause:n.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=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=dn}walk(t){return dr(this,t)}};function dr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?dr(e.cause,t):t?null:e}var W=class extends u{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}};var ve=class extends u{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}},fr=class extends u{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}};var lr={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."},mr={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},yr={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function E(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new gt(e.type);return`${e.name}(${$e(e.inputs,{includeName:t})})`}function $e(e,{includeName:t=!1}={}){return e?e.map(n=>Qo(n,{includeName:t})).join(t?", ":","):""}function Qo(e,{includeName:t}){return e.type.startsWith("tuple")?`(${$e(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function I(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function x(e){return I(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var wt=class extends u{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"})}},Ae=class extends u{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"})}};var vt=class extends u{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
6
+ `),{metaMessages:[`Params: (${$e(n,{includeName:!0})})`,`Data: ${t} (${r} 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=n,this.size=r}},Q=class extends u{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}},$t=class extends u{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
7
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}},At=class extends u{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${x(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},Pt=class extends u{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
8
+ `),{name:"AbiEncodingLengthMismatchError"})}};var ee=class extends u{constructor(t,{docsPath:n}){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(`
9
+ `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}},br=class extends u{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}},hr=class extends u{constructor(t,{docsPath:n}){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(`
10
+ `),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}},xr=class extends u{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
11
+ `),{docsPath:n,name:"AbiEventNotFoundError"})}},D=class extends u{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
12
+ `),{docsPath:n,name:"AbiFunctionNotFoundError"})}},It=class extends u{constructor(t,{docsPath:n}){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(`
13
+ `),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}};var Mt=class extends u{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${E(t.abiItem)}\`, and`,`\`${n.type}\` in \`${E(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},gr=class extends u{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}},wr=class extends u{constructor({abiItem:t,data:n,params:r,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
14
+ `),{metaMessages:[`Params: (${$e(r,{includeName:!0})})`,`Data: ${n} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=o}},vr=class extends u{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${E(t,{includeName:!0})}".`].join(`
15
+ `),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}},St=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
16
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}},Et=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
17
+ `),{docsPath:n,name:"InvalidAbiDecodingType"})}},Tt=class extends u{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
18
+ `),{name:"InvalidArrayError"})}},gt=class extends u{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
19
+ `),{name:"InvalidDefinitionTypeError"})}};var Pe=class extends u{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},Ie=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}},Me=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}};function Z(e,t,n,{strict:r}={}){return I(e,{strict:!1})?es(e,t,n,{strict:r}):ln(e,t,n,{strict:r})}function $r(e,t){if(typeof t=="number"&&t>0&&t>x(e)-1)throw new Pe({offset:t,position:"start",size:x(e)})}function Ar(e,t,n){if(typeof t=="number"&&typeof n=="number"&&x(e)!==n-t)throw new Pe({offset:n,position:"end",size:x(e)})}function ln(e,t,n,{strict:r}={}){$r(e,t);let o=e.slice(t,n);return r&&Ar(o,t,n),o}function es(e,t,n,{strict:r}={}){$r(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Ar(o,t,n),o}function N(e,{dir:t,size:n=32}={}){return typeof e=="string"?j(e,{dir:t,size:n}):ts(e,{dir:t,size:n})}function j(e,{dir:t,size:n=32}={}){if(n===null)return e;let r=e.replace("0x","");if(r.length>n*2)throw new Ie({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ts(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Ie({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let o=0;o<n;o++){let i=t==="right";r[i?o:n-o-1]=e[i?o:e.length-o-1]}return r}var te=class extends u{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Bt=class extends u{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"})}},kt=class extends u{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}};var Ot=class extends u{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function z(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function v(e,{size:t}){if(x(e)>t)throw new Ot({givenSize:x(e),maxSize:t})}function mn(e,t={}){let{signed:n}=t;t.size&&v(e,{size:t.size});let r=BigInt(e);if(!n)return r;let o=(e.length-2)/2,i=(1n<<BigInt(o)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function ja(e,t={}){let n=e;if(t.size&&(v(n,{size:t.size}),n=z(n)),z(n)==="0x00")return!1;if(z(n)==="0x01")return!0;throw new kt(n)}function Pr(e,t={}){return Number(mn(e,t))}var ns=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ir(e,t={}){return typeof e=="number"||typeof e=="bigint"?y(e,t):typeof e=="string"?bn(e,t):typeof e=="boolean"?yn(e,t):M(e,t)}function yn(e,t={}){let n=`0x${Number(e)}`;return typeof t.size=="number"?(v(n,{size:t.size}),N(n,{size:t.size})):n}function M(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=ns[e[o]];let r=`0x${n}`;return typeof t.size=="number"?(v(r,{size:t.size}),N(r,{dir:"right",size:t.size})):r}function y(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let c=typeof e=="bigint"?"n":"";throw new te({max:i?`${i}${c}`:void 0,min:`${s}${c}`,signed:n,size:r,value:`${e}${c}`})}let a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?N(a,{size:r}):a}var rs=new TextEncoder;function bn(e,t={}){let n=rs.encode(e);return M(n,t)}var os=new TextEncoder;function jt(e,t={}){return typeof e=="number"||typeof e=="bigint"?is(e,t):typeof e=="boolean"?ss(e,t):I(e)?zt(e,t):hn(e,t)}function ss(e,t={}){let n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(v(n,{size:t.size}),N(n,{size:t.size})):n}var C={zero:48,nine:57,A:65,F:70,a:97,f:102};function Mr(e){if(e>=C.zero&&e<=C.nine)return e-C.zero;if(e>=C.A&&e<=C.F)return e-(C.A-10);if(e>=C.a&&e<=C.f)return e-(C.a-10)}function zt(e,t={}){let n=e;t.size&&(v(n,{size:t.size}),n=N(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);let o=r.length/2,i=new Uint8Array(o);for(let s=0,a=0;s<o;s++){let c=Mr(r.charCodeAt(a++)),p=Mr(r.charCodeAt(a++));if(c===void 0||p===void 0)throw new u(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[s]=c*16+p}return i}function is(e,t){let n=y(e,t);return zt(n)}function hn(e,t={}){let n=os.encode(e);return typeof t.size=="number"?(v(n,{size:t.size}),N(n,{dir:"right",size:t.size})):n}function xn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function as(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Se(e,...t){if(!as(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function gn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Sr(e,t){Se(e);let n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}var Ct=BigInt(4294967295),Er=BigInt(32);function us(e,t=!1){return t?{h:Number(e&Ct),l:Number(e>>Er&Ct)}:{h:Number(e>>Er&Ct)|0,l:Number(e&Ct)|0}}function Tr(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:i,l:s}=us(e[o],t);[n[o],r[o]]=[i,s]}return[n,r]}var Br=(e,t,n)=>e<<n|t>>>32-n,kr=(e,t,n)=>t<<n|e>>>32-n,Or=(e,t,n)=>t<<n-32|e>>>64-n,jr=(e,t,n)=>e<<n-32|t>>>64-n;function zr(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function qa(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ja(e,t){return e<<32-t|e>>>t}var wn=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function cs(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function vn(e){for(let t=0;t<e.length;t++)e[t]=cs(e[t])}function ps(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Ut(e){return typeof e=="string"&&(e=ps(e)),Se(e),e}var Rt=class{clone(){return this._cloneInto()}};function Cr(e){let t=r=>e().update(Ut(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Rr(e){let t=(r,o)=>e(o).update(Ut(r)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}var Fr=[],Dr=[],Nr=[],ds=BigInt(0),Ee=BigInt(1),fs=BigInt(2),ls=BigInt(7),ms=BigInt(256),ys=BigInt(113);for(let e=0,t=Ee,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Fr.push(2*(5*r+n)),Dr.push((e+1)*(e+2)/2%64);let o=ds;for(let i=0;i<7;i++)t=(t<<Ee^(t>>ls)*ys)%ms,t&fs&&(o^=Ee<<(Ee<<BigInt(i))-Ee);Nr.push(o)}var[bs,hs]=Tr(Nr,!0),Ur=(e,t,n)=>n>32?Or(e,t,n):Br(e,t,n),Lr=(e,t,n)=>n>32?jr(e,t,n):kr(e,t,n);function xs(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,p=n[c],d=n[c+1],l=Ur(p,d,1)^n[a],m=Lr(p,d,1)^n[a+1];for(let f=0;f<50;f+=10)e[s+f]^=l,e[s+f+1]^=m}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=Dr[s],c=Ur(o,i,a),p=Lr(o,i,a),d=Fr[s];o=e[d],i=e[d+1],e[d]=c,e[d+1]=p}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=bs[r],e[1]^=hs[r]}n.fill(0)}var ne=class extends Rt{constructor(t,n,r,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xn(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=zr(this.state)}keccak(){wn||vn(this.state32),xs(this.state32,this.rounds),wn||vn(this.state32),this.posOut=0,this.pos=0}update(t){gn(this);let{blockLen:n,state:r}=this;t=Ut(t);let o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){gn(this,!1),Se(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xn(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Sr(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new ne(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},H=(e,t,n)=>Cr(()=>new ne(t,e,n)),eu=H(6,144,224/8),tu=H(6,136,256/8),nu=H(6,104,384/8),ru=H(6,72,512/8),ou=H(1,144,224/8),Hr=H(1,136,256/8),su=H(1,104,384/8),iu=H(1,72,512/8),_r=(e,t,n)=>Rr((r={})=>new ne(t,e,r.dkLen===void 0?n:r.dkLen,!0)),au=_r(31,168,128/8),uu=_r(31,136,256/8);function Lt(e,t){let n=t||"hex",r=Hr(I(e,{strict:!1})?jt(e):e);return n==="bytes"?r:Ir(r)}var gs=e=>Lt(jt(e));function Vr(e){return gs(e)}function Gr(e){let t=!0,n="",r=0,o="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){e[s-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!i)throw new u("Unable to normalize signature.");return o}var Wr=e=>{let t=(()=>typeof e=="string"?e:un(e))();return Gr(t)};function Ft(e){return Vr(Wr(e))}var re=e=>Z(Ft(e),0,4);var $=class extends u{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};var oe=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 n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){let r=this.keys().next().value;r&&this.delete(r)}return this}};var ws=/^0x[a-fA-F0-9]{40}$/,$n=new oe(8192);function g(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if($n.has(r))return $n.get(r);let o=(()=>ws.test(e)?e.toLowerCase()===e?!0:n?Te(e)===e:!0:!1)();return $n.set(r,o),o}var An=new oe(8192);function Te(e,t){if(An.has(`${e}.${t}`))return An.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=Lt(hn(n),"bytes"),o=(t?n.substring(`${t}0x`.length):n).split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&o[s]&&(o[s]=o[s].toUpperCase()),(r[s>>1]&15)>=8&&o[s+1]&&(o[s+1]=o[s+1].toUpperCase());let i=`0x${o.join("")}`;return An.set(`${e}.${t}`,i),i}function Du(e,t){if(!g(e,{strict:!1}))throw new $({address:e});return Te(e,t)}var Be=class extends u{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},Dt=class extends u{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},Nt=class extends u{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};var vs={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 Nt({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Dt({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Be({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 Be({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 n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+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 n=this.inspectBytes(e);return this.position+=t??e,n},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 Zr(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(vs);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function qr(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=M(e,t);return mn(n,t)}function Jr(e,t={}){let n=e;if(typeof t.size<"u"&&(v(n,{size:t.size}),n=z(n)),n.length>1||n[0]>1)throw new Bt(n);return!!n[0]}function k(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=M(e,t);return Pr(n,t)}function Kr(e,t={}){let n=e;return typeof t.size<"u"&&(v(n,{size:t.size}),n=z(n,{dir:"right"})),new TextDecoder().decode(n)}function R(e){return typeof e[0]=="string"?ke(e):$s(e)}function $s(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function ke(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}var Yu=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Xr=/^(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)?$/;function se(e,t){if(e.length!==t.length)throw new Pt({expectedLength:e.length,givenLength:t.length});let n=As({params:e,values:t}),r=In(n);return r.length===0?"0x":r}function As({params:e,values:t}){let n=[];for(let r=0;r<e.length;r++)n.push(Pn({param:e[r],value:t[r]}));return n}function Pn({param:e,value:t}){let n=Ht(e.type);if(n){let[r,o]=n;return Is(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Bs(t,{param:e});if(e.type==="address")return Ps(t);if(e.type==="bool")return Ss(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int"),[,,o="256"]=Xr.exec(e.type)??[];return Es(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return Ms(t,{param:e});if(e.type==="string")return Ts(t);throw new St(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function In(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?t+=32:t+=x(a)}let n=[],r=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?(n.push(y(t+o,{size:32})),r.push(a),o+=x(a)):n.push(a)}return R([...n,...r])}function Ps(e){if(!g(e))throw new $({address:e});return{dynamic:!1,encoded:j(e.toLowerCase())}}function Is(e,{length:t,param:n}){let r=t===null;if(!Array.isArray(e))throw new Tt(e);if(!r&&e.length!==t)throw new $t({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1,i=[];for(let s=0;s<e.length;s++){let a=Pn({param:n,value:e[s]});a.dynamic&&(o=!0),i.push(a)}if(r||o){let s=In(i);if(r){let a=y(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?R([a,s]):a}}if(o)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:R(i.map(({encoded:s})=>s))}}function Ms(e,{param:t}){let[,n]=t.type.split("bytes"),r=x(e);if(!n){let o=e;return r%32!==0&&(o=j(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:R([j(y(r,{size:32})),o])}}if(r!==Number.parseInt(n))throw new At({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:j(e,{dir:"right"})}}function Ss(e){if(typeof e!="boolean")throw new u(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:j(yn(e))}}function Es(e,{signed:t,size:n=256}){if(typeof n=="number"){let r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new te({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:y(e,{size:32,signed:t})}}function Ts(e){let t=bn(e),n=Math.ceil(x(t)/32),r=[];for(let o=0;o<n;o++)r.push(j(Z(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:R([j(y(x(t),{size:32})),...r])}}function Bs(e,{param:t}){let n=!1,r=[];for(let o=0;o<t.components.length;o++){let i=t.components[o],s=Array.isArray(e)?o:i.name,a=Pn({param:i,value:e[s]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?In(r):R(r.map(({encoded:o})=>o))}}function Ht(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function _t(e,t){let n=typeof t=="string"?zt(t):t,r=Zr(n);if(x(n)===0&&e.length>0)throw new Q;if(x(t)&&x(t)<32)throw new vt({data:typeof t=="string"?t:M(t),params:e,size:x(t)});let o=0,i=[];for(let s=0;s<e.length;++s){let a=e[s];r.setPosition(o);let[c,p]=ie(r,a,{staticPosition:0});o+=p,i.push(c)}return i}function ie(e,t,{staticPosition:n}){let r=Ht(t.type);if(r){let[o,i]=r;return Os(e,{...t,type:i},{length:o,staticPosition:n})}if(t.type==="tuple")return Rs(e,t,{staticPosition:n});if(t.type==="address")return ks(e);if(t.type==="bool")return js(e);if(t.type.startsWith("bytes"))return zs(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Cs(e,t);if(t.type==="string")return Us(e,{staticPosition:n});throw new Et(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}var Yr=32,Mn=32;function ks(e){let t=e.readBytes(32);return[Te(M(ln(t,-20))),32]}function Os(e,t,{length:n,staticPosition:r}){if(!n){let s=k(e.readBytes(Mn)),a=r+s,c=a+Yr;e.setPosition(a);let p=k(e.readBytes(Yr)),d=Oe(t),l=0,m=[];for(let f=0;f<p;++f){e.setPosition(c+(d?f*32:l));let[b,A]=ie(e,t,{staticPosition:c});l+=A,m.push(b)}return e.setPosition(r+32),[m,32]}if(Oe(t)){let s=k(e.readBytes(Mn)),a=r+s,c=[];for(let p=0;p<n;++p){e.setPosition(a+p*32);let[d]=ie(e,t,{staticPosition:a});c.push(d)}return e.setPosition(r+32),[c,32]}let o=0,i=[];for(let s=0;s<n;++s){let[a,c]=ie(e,t,{staticPosition:r+o});o+=c,i.push(a)}return[i,o]}function js(e){return[Jr(e.readBytes(32),{size:32}),32]}function zs(e,t,{staticPosition:n}){let[r,o]=t.type.split("bytes");if(!o){let s=k(e.readBytes(32));e.setPosition(n+s);let a=k(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];let c=e.readBytes(a);return e.setPosition(n+32),[M(c),32]}return[M(e.readBytes(Number.parseInt(o),32)),32]}function Cs(e,t){let n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),o=e.readBytes(32);return[r>48?qr(o,{signed:n}):k(o,{signed:n}),32]}function Rs(e,t,{staticPosition:n}){let r=t.components.length===0||t.components.some(({name:s})=>!s),o=r?[]:{},i=0;if(Oe(t)){let s=k(e.readBytes(Mn)),a=n+s;for(let c=0;c<t.components.length;++c){let p=t.components[c];e.setPosition(a+i);let[d,l]=ie(e,p,{staticPosition:a});i+=l,o[r?c:p?.name]=d}return e.setPosition(n+32),[o,32]}for(let s=0;s<t.components.length;++s){let a=t.components[s],[c,p]=ie(e,a,{staticPosition:n});o[r?s:a?.name]=c,i+=p}return[o,i]}function Us(e,{staticPosition:t}){let n=k(e.readBytes(32)),r=t+n;e.setPosition(r);let o=k(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=Kr(z(i));return e.setPosition(t+32),[s,32]}function Oe(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Oe);let n=Ht(e.type);return!!(n&&Oe({...e,type:n[1]}))}function Vt(e){let{abi:t,data:n}=e,r=Z(n,0,4);if(r==="0x")throw new Q;let i=[...t||[],mr,yr].find(s=>s.type==="error"&&r===re(E(s)));if(!i)throw new ee(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?_t(i.inputs,Z(n,4)):void 0,errorName:i.name}}var O=(e,t,n)=>JSON.stringify(e,(r,o)=>{let i=typeof o=="bigint"?o.toString():o;return typeof t=="function"?t(r,i):i},n);function Sn({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,i)=>`${r&&o.name?`${o.name}: `:""}${typeof t[i]=="object"?O(t[i]):t[i]}`).join(", ")})`}var Qr=Ft;function ae(e){let{abi:t,args:n=[],name:r}=e,o=I(r,{strict:!1}),i=t.filter(a=>o?a.type==="function"?re(a)===r:a.type==="event"?Qr(a)===r:!1:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let s;for(let a of i){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((p,d)=>{let l="inputs"in a&&a.inputs[d];return l?En(p,l):!1})){if(s&&"inputs"in s&&s.inputs){let p=eo(a.inputs,s.inputs,n);if(p)throw new Mt({abiItem:a,type:p[0]},{abiItem:s,type:p[1]})}s=a}}return s||i[0]}function En(e,t){let n=typeof e,r=t.type;switch(r){case"address":return g(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>En(Object.values(e)[i],o)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>En(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function eo(e,t,n){for(let r in e){let o=e[r],i=t[r];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return eo(o.components,i.components,n[r]);let s=[o.type,i.type];if((()=>s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?g(n[r],{strict:!1}):s.includes("address")&&s.includes("bytes")?g(n[r],{strict:!1}):!1)())return s}}var to={gwei:9,wei:18},no={ether:-9,wei:9};function Gt(e,t){let n=e.toString(),r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${i?`.${i}`:""}`}function ro(e,t="wei"){return Gt(e,to[t])}function U(e,t="wei"){return Gt(e,no[t])}var Wt=class extends u{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}},Zt=class extends u{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}};function oo(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
20
+ `,"")}function so(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
21
+ `;return r.nonce&&(o+=` nonce: ${r.nonce}
22
+ `),r.balance&&(o+=` balance: ${r.balance}
23
+ `),r.code&&(o+=` code: ${r.code}
24
+ `),r.state&&(o+=` state:
25
+ `,o+=oo(r.state)),r.stateDiff&&(o+=` stateDiff:
26
+ `,o+=oo(r.stateDiff)),o},` State Override:
27
+ `).slice(0,-1)}function Jt(e){let t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
28
+ `)}var qt=class extends u{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
29
+ `),{name:"FeeConflictError"})}},io=class extends u{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}},ao=class extends u{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Jt(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"})}};var uo=class extends u{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}};var co=class extends u{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:i}){let s="Transaction";r&&i!==void 0&&(s=`Transaction at block time "${r}" at index "${i}"`),t&&i!==void 0&&(s=`Transaction at block hash "${t}" at index "${i}"`),n&&i!==void 0&&(s=`Transaction at block number "${n}" at index "${i}"`),o&&(s=`Transaction with hash "${o}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}},po=class extends u{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"})}},fo=class extends u{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}};var lo=e=>e,q=e=>e;var Kt=class extends u{constructor(t,{account:n,docsPath:r,chain:o,data:i,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:p,nonce:d,to:l,value:m,stateOverride:f}){let b=n?Y(n):void 0,A=Jt({from:b?.address,to:l,value:typeof m<"u"&&`${ro(m)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:typeof a<"u"&&`${U(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${U(c)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${U(p)} gwei`,nonce:d});f&&(A+=`
30
+ ${so(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",A].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}},mo=class extends u{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:i,functionName:s,sender:a}){let c=ae({abi:n,args:r,name:s}),p=c?Sn({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,d=c?E(c,{includeName:!0}):void 0,l=Jt({address:o&&lo(o),function:d,args:p&&p!=="()"&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${p}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],l&&"Contract Call:",l].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=n,this.args=r,this.cause=t,this.contractAddress=o,this.functionName=s,this.sender=a}},yo=class extends u{constructor({abi:t,data:n,functionName:r,message:o}){let i,s,a,c;if(n&&n!=="0x")try{s=Vt({abi:t,data:n});let{abiItem:d,errorName:l,args:m}=s;if(l==="Error")c=m[0];else if(l==="Panic"){let[f]=m;c=lr[f]}else{let f=d?E(d,{includeName:!0}):void 0,b=d&&m?Sn({abiItem:d,args:m,includeFunctionName:!1,includeName:!1}):void 0;a=[f?`Error: ${f}`:"",b&&b!=="()"?` ${[...Array(l?.length??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(d){i=d}else o&&(c=o);let p;i instanceof ee&&(p=i.signature,a=[`Unable to decode signature "${p}" 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=${p}.`]),super(c&&c!=="execution reverted"||p?[`The contract function "${r}" reverted with the following ${p?"signature":"reason"}:`,c||p].join(`
31
+ `):`The contract function "${r}" reverted.`,{cause:i,metaMessages:a,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=s,this.raw=n,this.reason=c,this.signature=p}},bo=class extends u{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"})}},Xt=class extends u{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"})}},Yt=class extends u{constructor({data:t,message:n}){super(n||"",{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}};var Tn="/docs/contract/decodeFunctionResult";function ho(e){let{abi:t,args:n,functionName:r,data:o}=e,i=t[0];if(r){let a=ae({abi:t,args:n,name:r});if(!a)throw new D(r,{docsPath:Tn});i=a}if(i.type!=="function")throw new D(void 0,{docsPath:Tn});if(!i.outputs)throw new It(i.name,{docsPath:Tn});let s=_t(i.outputs,o);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}var Bn="/docs/contract/encodeDeployData";function kn(e){let{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;let o=t.find(s=>"type"in s&&s.type==="constructor");if(!o)throw new wt({docsPath:Bn});if(!("inputs"in o))throw new Ae({docsPath:Bn});if(!o.inputs||o.inputs.length===0)throw new Ae({docsPath:Bn});let i=se(o.inputs,n);return ke([r,i])}var xo="/docs/contract/encodeFunctionData";function go(e){let{abi:t,args:n,functionName:r}=e,o=t[0];if(r){let i=ae({abi:t,args:n,name:r});if(!i)throw new D(r,{docsPath:xo});o=i}if(o.type!=="function")throw new D(void 0,{docsPath:xo});return{abi:[o],functionName:re(E(o))}}function wo(e){let{args:t}=e,{abi:n,functionName:r}=(()=>e.abi.length===1&&e.functionName?.startsWith("0x")?e:go(e))(),o=n[0],i=r,s="inputs"in o&&o.inputs?se(o.inputs,t??[]):void 0;return ke([i,s??"0x"])}function vo({blockNumber:e,chain:t,contract:n}){let r=t?.contracts?.[n];if(!r)throw new W({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new W({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}var L=class extends u{constructor({cause:t,message:n}={}){let r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(L,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(L,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});var _=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${U(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(_,"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 ue=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${U(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(ue,"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 ce=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(ce,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});var pe=class extends u{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
32
+ `),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty(pe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});var de=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(de,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});var fe=class extends u{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
33
+ `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(fe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});var le=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(le,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});var me=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(me,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});var ye=class extends u{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(ye,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});var V=class extends u{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${U(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${U(r)} gwei`:""}).`].join(`
34
+ `),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(V,"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 be=class extends u{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}};var je=class extends u{constructor({body:t,cause:n,details:r,headers:o,status:i,url:s}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${q(s)}`,t&&`Request body: ${O(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=o,this.status=i,this.url=s}};var Qt=class extends u{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${q(r)}`,`Request body: ${O(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=n.code,this.data=n.data}};var $o=class extends u{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${q(n)}`,`Request body: ${O(t)}`],name:"TimeoutError"})}};var Ls=-1,w=class extends u{constructor(t,{code:n,docsPath:r,metaMessages:o,name:i,shortMessage:s}){super(s,{cause:t,docsPath:r,metaMessages:o||t?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||t.name,this.code=t instanceof Qt?t.code:n??Ls}},G=class extends w{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}},ze=class extends w{constructor(t){super(t,{code:ze.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var Ce=class extends w{constructor(t){super(t,{code:Ce.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(Ce,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var Re=class extends w{constructor(t,{method:n}={}){super(t,{code:Re.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}};Object.defineProperty(Re,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var Ue=class extends w{constructor(t){super(t,{code:Ue.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
35
+ `)})}};Object.defineProperty(Ue,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var Le=class extends w{constructor(t){super(t,{code:Le.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(Le,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var Fe=class extends w{constructor(t){super(t,{code:Fe.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
36
+ `)})}};Object.defineProperty(Fe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var De=class extends w{constructor(t){super(t,{code:De.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(De,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var Ne=class extends w{constructor(t){super(t,{code:Ne.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(Ne,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var He=class extends w{constructor(t){super(t,{code:He.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(He,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var _e=class extends w{constructor(t,{method:n}={}){super(t,{code:_e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}};Object.defineProperty(_e,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var Ve=class extends w{constructor(t){super(t,{code:Ve.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(Ve,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var Ge=class extends w{constructor(t){super(t,{code:Ge.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(Ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var We=class extends G{constructor(t){super(t,{code:We.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(We,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var Ze=class extends G{constructor(t){super(t,{code:Ze.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(Ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var qe=class extends G{constructor(t,{method:n}={}){super(t,{code:qe.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}};Object.defineProperty(qe,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var Je=class extends G{constructor(t){super(t,{code:Je.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(Je,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var Ke=class extends G{constructor(t){super(t,{code:Ke.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(Ke,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});var Xe=class extends G{constructor(t){super(t,{code:Xe.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(Xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});var Ao=class extends w{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}};function Po(e,t){let n=(e.details||"").toLowerCase(),r=e instanceof u?e.walk(o=>o?.code===L.code):e;return r instanceof u?new L({cause:e,message:r.details}):L.nodeMessage.test(n)?new L({cause:e,message:e.details}):_.nodeMessage.test(n)?new _({cause:e,maxFeePerGas:t?.maxFeePerGas}):ue.nodeMessage.test(n)?new ue({cause:e,maxFeePerGas:t?.maxFeePerGas}):ce.nodeMessage.test(n)?new ce({cause:e,nonce:t?.nonce}):pe.nodeMessage.test(n)?new pe({cause:e,nonce:t?.nonce}):de.nodeMessage.test(n)?new de({cause:e,nonce:t?.nonce}):fe.nodeMessage.test(n)?new fe({cause:e}):le.nodeMessage.test(n)?new le({cause:e,gas:t?.gas}):me.nodeMessage.test(n)?new me({cause:e,gas:t?.gas}):ye.nodeMessage.test(n)?new ye({cause:e}):V.nodeMessage.test(n)?new V({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new be({cause:e})}function Io(e,{docsPath:t,...n}){let r=(()=>{let o=Po(e,n);return o instanceof be?e:o})();return new Kt(r,{docsPath:t,...n})}function Mo(e,{format:t}){if(!t)return{};let n={};function r(i){let s=Object.keys(i);for(let a of s)a in e&&(n[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a])}let o=t(e||{});return r(o),n}function Xp(e,t){return({exclude:n,format:r})=>({exclude:n,format:o=>{let i=t(o);if(n)for(let s of n)delete i[s];return{...i,...r(o)}},type:e})}var Fs={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function So(e){let t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Ds(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>M(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=y(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=y(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=y(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=y(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=y(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=y(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Fs[e.type]),typeof e.value<"u"&&(t.value=y(e.value)),t}function Ds(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:y(t.chainId),nonce:y(t.nonce),...typeof t.yParity<"u"?{yParity:y(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:y(t.v)}:{}}))}function Eo(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}var On=new Map;function To({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){let i=async()=>{let d=c();s();let l=d.map(({args:m})=>m);l.length!==0&&e(l).then(m=>{o&&Array.isArray(m)&&m.sort(o);for(let f=0;f<d.length;f++){let{resolve:b}=d[f];b?.([m[f],m])}}).catch(m=>{for(let f=0;f<d.length;f++){let{reject:b}=d[f];b?.(m)}})},s=()=>On.delete(t),a=()=>c().map(({args:d})=>d),c=()=>On.get(t)||[],p=d=>On.set(t,[...c(),d]);return{flush:s,async schedule(d){let{promise:l,resolve:m,reject:f}=Eo();return n?.([...a(),d])&&i(),c().length>0?(p({args:d,resolve:m,reject:f}),l):(p({args:d,resolve:m,reject:f}),setTimeout(i,r),l)}}}function Bo(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Me({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Me({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Ns(e){let{balance:t,nonce:n,state:r,stateDiff:o,code:i}=e,s={};if(i!==void 0&&(s.code=i),t!==void 0&&(s.balance=y(t)),n!==void 0&&(s.nonce=y(n)),r!==void 0&&(s.state=Bo(r)),o!==void 0){if(s.state)throw new Zt;s.stateDiff=Bo(o)}return s}function ko(e){if(!e)return;let t={};for(let{address:n,...r}of e){if(!g(n,{strict:!1}))throw new $({address:n});if(t[n])throw new Wt({address:n});t[n]=Ns(r)}return t}var pd=2n**(8n-1n)-1n,dd=2n**(16n-1n)-1n,fd=2n**(24n-1n)-1n,ld=2n**(32n-1n)-1n,md=2n**(40n-1n)-1n,yd=2n**(48n-1n)-1n,bd=2n**(56n-1n)-1n,hd=2n**(64n-1n)-1n,xd=2n**(72n-1n)-1n,gd=2n**(80n-1n)-1n,wd=2n**(88n-1n)-1n,vd=2n**(96n-1n)-1n,$d=2n**(104n-1n)-1n,Ad=2n**(112n-1n)-1n,Pd=2n**(120n-1n)-1n,Id=2n**(128n-1n)-1n,Md=2n**(136n-1n)-1n,Sd=2n**(144n-1n)-1n,Ed=2n**(152n-1n)-1n,Td=2n**(160n-1n)-1n,Bd=2n**(168n-1n)-1n,kd=2n**(176n-1n)-1n,Od=2n**(184n-1n)-1n,jd=2n**(192n-1n)-1n,zd=2n**(200n-1n)-1n,Cd=2n**(208n-1n)-1n,Rd=2n**(216n-1n)-1n,Ud=2n**(224n-1n)-1n,Ld=2n**(232n-1n)-1n,Fd=2n**(240n-1n)-1n,Dd=2n**(248n-1n)-1n,Nd=2n**(256n-1n)-1n,Hd=-(2n**(8n-1n)),_d=-(2n**(16n-1n)),Vd=-(2n**(24n-1n)),Gd=-(2n**(32n-1n)),Wd=-(2n**(40n-1n)),Zd=-(2n**(48n-1n)),qd=-(2n**(56n-1n)),Jd=-(2n**(64n-1n)),Kd=-(2n**(72n-1n)),Xd=-(2n**(80n-1n)),Yd=-(2n**(88n-1n)),Qd=-(2n**(96n-1n)),ef=-(2n**(104n-1n)),tf=-(2n**(112n-1n)),nf=-(2n**(120n-1n)),rf=-(2n**(128n-1n)),of=-(2n**(136n-1n)),sf=-(2n**(144n-1n)),af=-(2n**(152n-1n)),uf=-(2n**(160n-1n)),cf=-(2n**(168n-1n)),pf=-(2n**(176n-1n)),df=-(2n**(184n-1n)),ff=-(2n**(192n-1n)),lf=-(2n**(200n-1n)),mf=-(2n**(208n-1n)),yf=-(2n**(216n-1n)),bf=-(2n**(224n-1n)),hf=-(2n**(232n-1n)),xf=-(2n**(240n-1n)),gf=-(2n**(248n-1n)),wf=-(2n**(256n-1n)),vf=2n**8n-1n,$f=2n**16n-1n,Af=2n**24n-1n,Pf=2n**32n-1n,If=2n**40n-1n,Mf=2n**48n-1n,Sf=2n**56n-1n,Ef=2n**64n-1n,Tf=2n**72n-1n,Bf=2n**80n-1n,kf=2n**88n-1n,Of=2n**96n-1n,jf=2n**104n-1n,zf=2n**112n-1n,Cf=2n**120n-1n,Rf=2n**128n-1n,Uf=2n**136n-1n,Lf=2n**144n-1n,Ff=2n**152n-1n,Df=2n**160n-1n,Nf=2n**168n-1n,Hf=2n**176n-1n,_f=2n**184n-1n,Vf=2n**192n-1n,Gf=2n**200n-1n,Wf=2n**208n-1n,Zf=2n**216n-1n,qf=2n**224n-1n,Jf=2n**232n-1n,Kf=2n**240n-1n,Xf=2n**248n-1n,Oo=2n**256n-1n;function jo(e){let{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:i}=e,s=t?Y(t):void 0;if(s&&!g(s.address))throw new $({address:s.address});if(i&&!g(i))throw new $({address:i});if(typeof n<"u"&&(typeof r<"u"||typeof o<"u"))throw new qt;if(r&&r>Oo)throw new _({maxFeePerGas:r});if(o&&r&&o>r)throw new V({maxFeePerGas:r,maxPriorityFeePerGas:o})}async function zo(e,t){let{account:n=e.account,batch:r=!!e.batch?.multicall,blockNumber:o,blockTag:i="latest",accessList:s,blobs:a,code:c,data:p,factory:d,factoryData:l,gas:m,gasPrice:f,maxFeePerBlobGas:b,maxFeePerGas:A,maxPriorityFeePerGas:he,nonce:xe,to:T,value:Ye,stateOverride:Ro,...Uo}=t,jn=n?Y(n):void 0;if(c&&(d||l))throw new u("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&T)throw new u("Cannot provide both `code` & `to` as parameters.");let zn=c&&p,Cn=d&&l&&T&&p,Rn=zn||Cn,Lo=(()=>zn?Vs({code:c,data:p}):Cn?Gs({data:p,factory:d,factoryData:l,to:T}):p)();try{jo(t);let J=(o?y(o):void 0)||i,ge=ko(Ro),Qe=e.chain?.formatters?.transactionRequest?.format,et=(Qe||So)({...Mo(Uo,{format:Qe}),from:jn?.address,accessList:s,blobs:a,data:Lo,gas:m,gasPrice:f,maxFeePerBlobGas:b,maxFeePerGas:A,maxPriorityFeePerGas:he,nonce:xe,to:Rn?void 0:T,value:Ye});if(r&&Hs({request:et})&&!ge)try{return await _s(e,{...et,blockNumber:o,blockTag:i})}catch(on){if(!(on instanceof ve)&&!(on instanceof W))throw on}let Un=await e.request({method:"eth_call",params:ge?[et,J,ge]:[et,J]});return Un==="0x"?{data:void 0}:{data:Un}}catch(rn){let J=Ws(rn),{offchainLookup:ge,offchainLookupSignature:Qe}=await import("./ccip-V5MAMPAX.js");if(e.ccipRead!==!1&&J?.slice(0,10)===Qe&&T)return{data:await ge(e,{data:J,to:T})};throw Rn&&J?.slice(0,10)==="0x101bb98d"?new Xt({factory:d}):Io(rn,{...t,account:jn,chain:e.chain})}}function Hs({request:e}){let{data:t,to:n,...r}=e;return!(!t||t.startsWith(ur)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function _s(e,t){let{batchSize:n=1024,wait:r=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:i="latest",data:s,multicallAddress:a,to:c}=t,p=a;if(!p){if(!e.chain)throw new ve;p=vo({blockNumber:o,chain:e.chain,contract:"multicall3"})}let l=(o?y(o):void 0)||i,{schedule:m}=To({id:`${e.uid}.${l}`,wait:r,shouldSplitBatch(A){return A.reduce((xe,{data:T})=>xe+(T.length-2),0)>n*2},fn:async A=>{let he=A.map(Ye=>({allowFailure:!0,callData:Ye.data,target:Ye.to})),xe=wo({abi:pn,args:[he],functionName:"aggregate3"}),T=await e.request({method:"eth_call",params:[{data:xe,to:p},l]});return ho({abi:pn,args:[he],functionName:"aggregate3",data:T||"0x"})}}),[{returnData:f,success:b}]=await m({data:s,to:c});if(!b)throw new Yt({data:f});return f==="0x"?{data:void 0}:{data:f}}function Vs(e){let{code:t,data:n}=e;return kn({abi:xt(["constructor(bytes, bytes)"]),bytecode:cr,args:[t,n]})}function Gs(e){let{data:t,factory:n,factoryData:r,to:o}=e;return kn({abi:xt(["constructor(address, bytes, address, bytes)"]),bytecode:pr,args:[o,t,n,r]})}function Ws(e){if(!(e instanceof u))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}var en=class extends u{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:i,urls:s}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(a=>` ${q(a)}`)],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}},tn=class extends u{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${q(n)}`,`Response: ${O(t)}`],name:"OffchainLookupResponseMalformedError"})}},nn=class extends u{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}};function Co(e,t){if(!g(e,{strict:!1}))throw new $({address:e});if(!g(t,{strict:!1}))throw new $({address:t});return e.toLowerCase()===t.toLowerCase()}var H0="0x556f1830",Zs={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function _0(e,{blockNumber:t,blockTag:n,data:r,to:o}){let{args:i}=Vt({data:r,abi:[Zs]}),[s,a,c,p,d]=i,{ccipRead:l}=e,m=l&&typeof l?.request=="function"?l.request:qs;try{if(!Co(o,s))throw new nn({sender:s,to:o});let f=await m({data:c,sender:s,urls:a}),{data:b}=await zo(e,{blockNumber:t,blockTag:n,data:R([p,se([{type:"bytes"},{type:"bytes"}],[f,d])]),to:o});return b}catch(f){throw new en({callbackSelector:p,cause:f,data:r,extraData:d,sender:s,urls:a})}}async function qs({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let o=0;o<n.length;o++){let i=n[o],s=i.includes("{data}")?"GET":"POST",a=s==="POST"?{data:e,sender:t}:void 0,c=s==="POST"?{"Content-Type":"application/json"}:{};try{let p=await fetch(i.replace("{sender}",t).replace("{data}",e),{body:JSON.stringify(a),headers:c,method:s}),d;if(p.headers.get("Content-Type")?.startsWith("application/json")?d=(await p.json()).data:d=await p.text(),!p.ok){r=new je({body:a,details:d?.error?O(d.error):p.statusText,headers:p.headers,status:p.status,url:i});continue}if(!I(d)){r=new tn({result:d,url:i});continue}return d}catch(p){r=new je({body:a,details:p.message,url:i})}}throw r}export{un as a,Yo as b,E as c,I as d,x as e,u as f,vt as g,Q as h,br as i,hr as j,xr as k,gr as l,wr as m,vr as n,z as o,mn as p,ja as q,Pr as r,Ir as s,M as t,y as u,bn as v,jt as w,zt as x,hn as y,gn as z,Sr as A,qa as B,Ja as C,Ut as D,Rt as E,Cr as F,Hr as G,Lt as H,Qr as I,$ as J,oe as K,Te as L,Du as M,g as N,R as O,ke as P,Z as Q,es as R,Yu as S,Xr as T,se as U,ae as V,Y as W,wo as X,lr as Y,Dt as Z,Zr as _,_t as $,O as aa,ro as ba,U as ca,Jt as da,io as ea,ao as fa,uo as ga,co as ha,po as ia,fo as ja,Kt as ka,mo as la,yo as ma,bo as na,Yt as oa,je as pa,Qt as qa,$o as ra,ze as sa,Ce as ta,Re as ua,Ue as va,Le as wa,Fe as xa,De as ya,Ne as za,He as Aa,_e as Ba,Ve as Ca,Ge as Da,We as Ea,Ze as Fa,qe as Ga,Je as Ha,Ke as Ia,Xe as Ja,Ao as Ka,_ as La,V as Ma,be as Na,Po as Oa,Mo as Pa,Xp as Qa,So as Ra,ko as Sa,Oo as Ta,jo as Ua,Co as Va,ho as Wa,pn as Xa,Ji as Ya,Ki as Za,Xi as _a,Yi as $a,Qi as ab,cr as bb,na as cb,fr as db,kn as eb,vo as fb,Io as gb,Eo as hb,To as ib,H0 as jb,Zs as kb,_0 as lb,qs as mb,zo as nb};
37
+ /*! Bundled license information:
38
+
39
+ @noble/hashes/esm/utils.js:
40
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
41
+ */
42
+ //# sourceMappingURL=chunk-WITLSA6W.js.map