import{t as g,u as C,v as re,w as B,y as U,z as tn,A as rn,C as ne,D as Ge,E as S,F as Fe,G as He,I as nn,H as fe,J as an,K as ur,M as sn,N as Ne,P as Mt,_ as on,Q as W,R as se,S as cn,T as un}from"./index-DxF_wvu4.js";import{W as ho,X as mo,Z as yo,Y as go,$ as wo,a0 as vo,U as Po,a2 as Eo,a3 as xo,V as Ao,a4 as To,a5 as ko,a1 as Ro,a6 as Bo,a7 as Oo}from"./index-DxF_wvu4.js";import{k as $,c as M,i as q,I as Z,s as _e,a as dr,b as dn,d as ln,e as fn,p as mt,f as V,E as Me,F as nt,g as qt,N as Dt,h as zt,j as _t,l as Lt,m as Gt,n as Ht,T as Ut,o as at,U as yt,q as pn,r as lr,t as bn,u as hn,v as mn,w as yn,x as gn,y as fr,P as wn,z as Y,C as st,A as pr,B as br,D as vn,G as hr,H as Pn,W as Wt}from"./number-CKKJIAXr.js";import{K as No,L as jo,M as Co,O as $o,_ as Io,$ as So,a0 as Mo,a1 as qo,a3 as Do,Q as zo,a4 as _o,R as Lo,V as Go,X as Ho,J as Uo,Y as Wo,a6 as Vo,a7 as Jo,a5 as Zo,a8 as Yo,a2 as Qo,Z as Xo,S as Ko}from"./number-CKKJIAXr.js";function En(e,t){return e.exec(t)?.groups}const Vt=/^tuple(?<array>(\[(\d*)\])*)$/;function ot(e){let t=e.type;if(Vt.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let a=0;a<r;a++){const s=e.components[a];t+=ot(s),a<r-1&&(t+=", ")}const n=En(Vt,e.type);return t+=`)${n?.array??""}`,ot({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function de(e){let t="";const r=e.length;for(let n=0;n<r;n++){const a=e[n];t+=ot(a),n!==r-1&&(t+=", ")}return t}function xn(e){return e.type==="function"?`function ${e.name}(${de(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${de(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${de(e.inputs)})`:e.type==="error"?`error ${e.name}(${de(e.inputs)})`:e.type==="constructor"?`constructor(${de(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}function x(e,t,r){return n=>e[t.name]?.(n)??e[r]?.(n)??t(e,n)}function z(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Sn(e.type);return`${e.name}(${Ue(e.inputs,{includeName:t})})`}function Ue(e,{includeName:t=!1}={}){return e?e.map(r=>An(r,{includeName:t})).join(t?", ":","):""}function An(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ue(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class Tn extends g{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class Jt extends g{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class mr extends g{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${Ue(r,{includeName:!0})})`,`Data:   ${t} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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}}class We extends g{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class kn extends g{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Rn extends g{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${C(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Bn extends g{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class yr extends g{constructor(t,{docsPath:r}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class On extends g{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class gr extends g{constructor(t,{docsPath:r}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class Zt extends g{constructor(t,{docsPath:r}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class Le extends g{constructor(t,{docsPath:r}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Fn extends g{constructor(t,{docsPath:r}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Nn extends g{constructor(t,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${z(t.abiItem)}\`, and`,`\`${r.type}\` in \`${z(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:"AbiItemAmbiguityError"})}}class jn extends g{constructor({expectedSize:t,givenSize:r}){super(`Expected bytes${t}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class pe extends g{constructor({abiItem:t,data:r,params:n,size:a}){super([`Data size of ${a} bytes is too small for non-indexed event parameters.`].join(`
`),{metaMessages:[`Params: (${Ue(n,{includeName:!0})})`,`Data:   ${r} (${a} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=a}}class Ve extends g{constructor({abiItem:t,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${z(t,{includeName:!0})}".`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class Cn extends g{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class $n extends g{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class In extends g{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Sn extends g{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Mn extends g{constructor(t){super(`Filter type "${t}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const qn=e=>$(re(e));function Dn(e){return qn(e)}function zn(e){let t=!0,r="",n=0,a="",s=!1;for(let o=0;o<e.length;o++){const i=e[o];if(["(",")",","].includes(i)&&(t=!0),i==="("&&n++,i===")"&&n--,!!t){if(n===0){if(i===" "&&["event","function",""].includes(a))a="";else if(a+=i,i===")"){s=!0;break}continue}if(i===" "){e[o-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}a+=i,r+=i}}if(!s)throw new g("Unable to normalize signature.");return a}const _n=e=>{const t=typeof e=="string"?e:xn(e);return zn(t)};function wr(e){return Dn(_n(e))}const gt=wr;function oe(e,t){if(e.length!==t.length)throw new Bn({expectedLength:e.length,givenLength:t.length});const r=Ln({params:e,values:t}),n=vt(r);return n.length===0?"0x":n}function Ln({params:e,values:t}){const r=[];for(let n=0;n<e.length;n++)r.push(wt({param:e[n],value:t[n]}));return r}function wt({param:e,value:t}){const r=Pt(e.type);if(r){const[n,a]=r;return Hn(t,{length:n,param:{...e,type:a}})}if(e.type==="tuple")return Zn(t,{param:e});if(e.type==="address")return Gn(t);if(e.type==="bool")return Wn(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const n=e.type.startsWith("int");return Vn(t,{signed:n})}if(e.type.startsWith("bytes"))return Un(t,{param:e});if(e.type==="string")return Jn(t);throw new Cn(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function vt(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:i}=e[s];o?t+=32:t+=C(i)}const r=[],n=[];let a=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:i}=e[s];o?(r.push(B(t+a,{size:32})),n.push(i),a+=C(i)):r.push(i)}return M([...r,...n])}function Gn(e){if(!q(e))throw new Z({address:e});return{dynamic:!1,encoded:U(e.toLowerCase())}}function Hn(e,{length:t,param:r}){const n=t===null;if(!Array.isArray(e))throw new In(e);if(!n&&e.length!==t)throw new kn({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let a=!1;const s=[];for(let o=0;o<e.length;o++){const i=wt({param:r,value:e[o]});i.dynamic&&(a=!0),s.push(i)}if(n||a){const o=vt(s);if(n){const i=B(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?M([i,o]):i}}if(a)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:M(s.map(({encoded:o})=>o))}}function Un(e,{param:t}){const[,r]=t.type.split("bytes"),n=C(e);if(!r){let a=e;return n%32!==0&&(a=U(a,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:M([U(B(n,{size:32})),a])}}if(n!==Number.parseInt(r))throw new Rn({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:U(e,{dir:"right"})}}function Wn(e){if(typeof e!="boolean")throw new g(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:U(tn(e))}}function Vn(e,{signed:t}){return{dynamic:!1,encoded:B(e,{size:32,signed:t})}}function Jn(e){const t=rn(e),r=Math.ceil(C(t)/32),n=[];for(let a=0;a<r;a++)n.push(U(_e(t,a*32,(a+1)*32),{dir:"right"}));return{dynamic:!0,encoded:M([U(B(C(t),{size:32})),...n])}}function Zn(e,{param:t}){let r=!1;const n=[];for(let a=0;a<t.components.length;a++){const s=t.components[a],o=Array.isArray(e)?a:s.name,i=wt({param:s,value:e[o]});n.push(i),i.dynamic&&(r=!0)}return{dynamic:r,encoded:r?vt(n):M(n.map(({encoded:a})=>a))}}function Pt(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Et=e=>_e(wr(e),0,4);function je(e){const{abi:t,args:r=[],name:n}=e,a=ne(n,{strict:!1}),s=t.filter(i=>a?i.type==="function"?Et(i)===n:i.type==="event"?gt(i)===n:!1:"name"in i&&i.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const i of s){if(!("inputs"in i))continue;if(!r||r.length===0){if(!i.inputs||i.inputs.length===0)return i;continue}if(!i.inputs||i.inputs.length===0||i.inputs.length!==r.length)continue;if(r.every((u,f)=>{const d="inputs"in i&&i.inputs[f];return d?it(u,d):!1})){if(o&&"inputs"in o&&o.inputs){const u=vr(i.inputs,o.inputs,r);if(u)throw new Nn({abiItem:i,type:u[0]},{abiItem:o,type:u[1]})}o=i}}return o||s[0]}function it(e,t){const r=typeof e,n=t.type;switch(n){case"address":return q(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((a,s)=>it(Object.values(e)[s],a)):/^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(a=>it(a,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function vr(e,t,r){for(const n in e){const a=e[n],s=t[n];if(a.type==="tuple"&&s.type==="tuple"&&"components"in a&&"components"in s)return vr(a.components,s.components,r[n]);const o=[a.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?q(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?q(r[n],{strict:!1}):!1)return o}}const Yt="/docs/contract/encodeEventTopics";function Ce(e){const{abi:t,eventName:r,args:n}=e;let a=t[0];if(r){const c=je({abi:t,name:r});if(!c)throw new Zt(r,{docsPath:Yt});a=c}if(a.type!=="event")throw new Zt(void 0,{docsPath:Yt});const s=z(a),o=gt(s);let i=[];if(n&&"inputs"in a){const c=a.inputs?.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?c?.map(f=>n[f.name])??[]:[];u.length>0&&(i=c?.map((f,d)=>Array.isArray(u[d])?u[d].map((l,p)=>Qt({param:f,value:u[d][p]})):u[d]?Qt({param:f,value:u[d]}):null)??[])}return[o,...i]}function Qt({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return $(re(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Mn(e.type);return oe([e],[t])}function Je(e,{method:t}){const r={};return e.transport.type==="fallback"&&e.transport.onResponse?.(({method:n,response:a,status:s,transport:o})=>{s==="success"&&t===n&&(r[a]=o.request)}),(n=>r[n]||e.request)}async function Pr(e,t){const{address:r,abi:n,args:a,eventName:s,fromBlock:o,strict:i,toBlock:c}=t,u=Je(e,{method:"eth_newFilter"}),f=s?Ce({abi:n,args:a,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?B(o):o,toBlock:typeof c=="bigint"?B(c):c,topics:f}]});return{abi:n,args:a,eventName:s,id:d,request:u(d),strict:!!i,type:"event"}}function H(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const Xt="/docs/contract/encodeFunctionData";function Yn(e){const{abi:t,args:r,functionName:n}=e;let a=t[0];if(n){const s=je({abi:t,args:r,name:n});if(!s)throw new Le(n,{docsPath:Xt});a=s}if(a.type!=="function")throw new Le(void 0,{docsPath:Xt});return{abi:[a],functionName:Et(z(a))}}function K(e){const{args:t}=e,{abi:r,functionName:n}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Yn(e),a=r[0],s=n,o="inputs"in a&&a.inputs?oe(a.inputs,t??[]):void 0;return dr([s,o??"0x"])}const Er={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."},Qn={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Xn={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Kn(e,t={}){typeof t.size<"u"&&Ge(e,{size:t.size});const r=S(e,t);return fe(r,t)}function ea(e,t={}){let r=e;if(typeof t.size<"u"&&(Ge(r,{size:t.size}),r=He(r)),r.length>1||r[0]>1)throw new nn(r);return!!r[0]}function D(e,t={}){typeof t.size<"u"&&Ge(e,{size:t.size});const r=S(e,t);return Fe(r,t)}function ta(e,t={}){let r=e;return typeof t.size<"u"&&(Ge(r,{size:t.size}),r=He(r,{dir:"right"})),new TextDecoder().decode(r)}function Ze(e,t){const r=typeof t=="string"?an(t):t,n=dn(r);if(C(r)===0&&e.length>0)throw new We;if(C(t)&&C(t)<32)throw new mr({data:typeof t=="string"?t:S(t),params:e,size:C(t)});let a=0;const s=[];for(let o=0;o<e.length;++o){const i=e[o];n.setPosition(a);const[c,u]=ee(n,i,{staticPosition:0});a+=u,s.push(c)}return s}function ee(e,t,{staticPosition:r}){const n=Pt(t.type);if(n){const[a,s]=n;return na(e,{...t,type:s},{length:a,staticPosition:r})}if(t.type==="tuple")return ia(e,t,{staticPosition:r});if(t.type==="address")return ra(e);if(t.type==="bool")return aa(e);if(t.type.startsWith("bytes"))return sa(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return oa(e,t);if(t.type==="string")return ca(e,{staticPosition:r});throw new $n(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Kt=32,ct=32;function ra(e){const t=e.readBytes(32);return[ln(S(fn(t,-20))),32]}function na(e,t,{length:r,staticPosition:n}){if(!r){const o=D(e.readBytes(ct)),i=n+o,c=i+Kt;e.setPosition(i);const u=D(e.readBytes(Kt)),f=be(t);let d=0;const l=[];for(let p=0;p<u;++p){e.setPosition(c+(f?p*32:d));const[m,b]=ee(e,t,{staticPosition:c});d+=b,l.push(m)}return e.setPosition(n+32),[l,32]}if(be(t)){const o=D(e.readBytes(ct)),i=n+o,c=[];for(let u=0;u<r;++u){e.setPosition(i+u*32);const[f]=ee(e,t,{staticPosition:i});c.push(f)}return e.setPosition(n+32),[c,32]}let a=0;const s=[];for(let o=0;o<r;++o){const[i,c]=ee(e,t,{staticPosition:n+a});a+=c,s.push(i)}return[s,a]}function aa(e){return[ea(e.readBytes(32),{size:32}),32]}function sa(e,t,{staticPosition:r}){const[n,a]=t.type.split("bytes");if(!a){const o=D(e.readBytes(32));e.setPosition(r+o);const i=D(e.readBytes(32));if(i===0)return e.setPosition(r+32),["0x",32];const c=e.readBytes(i);return e.setPosition(r+32),[S(c),32]}return[S(e.readBytes(Number.parseInt(a),32)),32]}function oa(e,t){const r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256"),a=e.readBytes(32);return[n>48?Kn(a,{signed:r}):D(a,{signed:r}),32]}function ia(e,t,{staticPosition:r}){const n=t.components.length===0||t.components.some(({name:o})=>!o),a=n?[]:{};let s=0;if(be(t)){const o=D(e.readBytes(ct)),i=r+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(i+s);const[f,d]=ee(e,u,{staticPosition:i});s+=d,a[n?c:u?.name]=f}return e.setPosition(r+32),[a,32]}for(let o=0;o<t.components.length;++o){const i=t.components[o],[c,u]=ee(e,i,{staticPosition:r});a[n?o:i?.name]=c,s+=u}return[a,s]}function ca(e,{staticPosition:t}){const r=D(e.readBytes(32)),n=t+r;e.setPosition(n);const a=D(e.readBytes(32));if(a===0)return e.setPosition(t+32),["",32];const s=e.readBytes(a,32),o=ta(He(s));return e.setPosition(t+32),[o,32]}function be(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(be);const r=Pt(e.type);return!!(r&&be({...e,type:r[1]}))}function xr(e){const{abi:t,data:r}=e,n=_e(r,0,4);if(n==="0x")throw new We;const s=[...t||[],Qn,Xn].find(o=>o.type==="error"&&n===Et(z(o)));if(!s)throw new yr(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Ze(s.inputs,_e(r,4)):void 0,errorName:s.name}}const N=(e,t,r)=>JSON.stringify(e,(n,a)=>typeof a=="bigint"?a.toString():a,r);function Ar({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((a,s)=>`${n&&a.name?`${a.name}: `:""}${typeof t[s]=="object"?N(t[s]):t[s]}`).join(", ")})`}class ua extends g{constructor({address:t}){super(`State for account "${t}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class da extends g{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function er(e){return e.reduce((t,{slot:r,value:n})=>`${t}        ${r}: ${n}
`,"")}function la(e){return e.reduce((t,{address:r,...n})=>{let a=`${t}    ${r}:
`;return n.nonce&&(a+=`      nonce: ${n.nonce}
`),n.balance&&(a+=`      balance: ${n.balance}
`),n.code&&(a+=`      code: ${n.code}
`),n.state&&(a+=`      state:
`,a+=er(n.state)),n.stateDiff&&(a+=`      stateDiff:
`,a+=er(n.stateDiff)),a},`  State Override:
`).slice(0,-1)}class Tr extends g{constructor(t,{account:r,docsPath:n,chain:a,data:s,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:d,value:l,stateOverride:p}){const m=r?H(r):void 0;let b=mt({from:m?.address,to:d,value:typeof l<"u"&&`${ur(l)} ${a?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:typeof i<"u"&&`${V(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${V(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${V(u)} gwei`,nonce:f});p&&(b+=`
${la(p)}`),super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",b].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=t}}class fa extends g{constructor(t,{abi:r,args:n,contractAddress:a,docsPath:s,functionName:o,sender:i}){const c=je({abi:r,args:n,name:o}),u=c?Ar({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,f=c?z(c,{includeName:!0}):void 0,d=mt({address:a&&sn(a),function:f,args:u&&u!=="()"&&`${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${u}`,sender:i});super(t.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Contract Call:",d].filter(Boolean)}),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}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=t,this.contractAddress=a,this.functionName=o,this.sender=i}}class ut extends g{constructor({abi:t,data:r,functionName:n,message:a}){let s,o,i,c;if(r&&r!=="0x")try{o=xr({abi:t,data:r});const{abiItem:f,errorName:d,args:l}=o;if(d==="Error")c=l[0];else if(d==="Panic"){const[p]=l;c=Er[p]}else{const p=f?z(f,{includeName:!0}):void 0,m=f&&l?Ar({abiItem:f,args:l,includeFunctionName:!1,includeName:!1}):void 0;i=[p?`Error: ${p}`:"",m&&m!=="()"?`       ${[...Array(d?.length??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(f){s=f}else a&&(c=a);let u;s instanceof yr&&(u=s.signature,i=[`Unable to decode signature "${u}" 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=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:i}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{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=o,this.reason=c,this.signature=u}}class pa extends g{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."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class xt extends g{constructor({data:t,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class J extends g{constructor({body:t,details:r,headers:n,status:a,url:s}){super("HTTP request failed.",{details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${Ne(s)}`,t&&`Request body: ${N(t)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=n,this.status=a,this.url=s}}class kr extends g{constructor({body:t,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${Ne(n)}`,`Request body: ${N(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class tr extends g{constructor({body:t,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Ne(r)}`,`Request body: ${N(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const ba=-1;class j extends g{constructor(t,{code:r,docsPath:n,metaMessages:a,shortMessage:s}){super(s,{cause:t,docsPath:n,metaMessages:a||t?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t.name,this.code=t instanceof kr?t.code:r??ba}}class ie extends j{constructor(t,r){super(t,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class he extends j{constructor(t){super(t,{code:he.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(he,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class me extends j{constructor(t){super(t,{code:me.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(me,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class ye extends j{constructor(t){super(t,{code:ye.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class ge extends j{constructor(t){super(t,{code:ge.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Q extends j{constructor(t){super(t,{code:Q.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(Q,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class X extends j{constructor(t){super(t,{code:X.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(X,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class we extends j{constructor(t){super(t,{code:we.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(we,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ve extends j{constructor(t){super(t,{code:ve.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(ve,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Pe extends j{constructor(t){super(t,{code:Pe.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(Pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Ee extends j{constructor(t){super(t,{code:Ee.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(Ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class ae extends j{constructor(t){super(t,{code:ae.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class xe extends j{constructor(t){super(t,{code:xe.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class te extends ie{constructor(t){super(t,{code:te.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(te,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Ae extends ie{constructor(t){super(t,{code:Ae.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(Ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Te extends ie{constructor(t){super(t,{code:Te.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Te,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ke extends ie{constructor(t){super(t,{code:ke.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(ke,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Re extends ie{constructor(t){super(t,{code:Re.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(Re,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Be extends ie{constructor(t){super(t,{code:Be.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Be,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class ha extends j{constructor(t){super(t,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const ma=3;function Oe(e,{abi:t,address:r,args:n,docsPath:a,functionName:s,sender:o}){const{code:i,data:c,message:u,shortMessage:f}=e instanceof xt?e:e instanceof g?e.walk(l=>"data"in l)||e.walk():{},d=e instanceof We?new pa({functionName:s}):[ma,Q.code].includes(i)&&(c||u||f)?new ut({abi:t,data:typeof c=="object"?c.data:c,functionName:s,message:f??u}):e;return new fa(d,{abi:t,args:n,contractAddress:r,docsPath:a,functionName:s,sender:o})}class ya extends g{constructor(t,{account:r,docsPath:n,chain:a,data:s,gas:o,gasPrice:i,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:f,to:d,value:l}){const p=mt({from:r?.address,to:d,value:typeof l<"u"&&`${ur(l)} ${a?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:typeof i<"u"&&`${V(i)} gwei`,maxFeePerGas:typeof c<"u"&&`${V(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${V(u)} gwei`,nonce:f});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=t}}function Rr(e,t){const r=(e.details||"").toLowerCase(),n=e instanceof g?e.walk(a=>a.code===Me.code):e;return n instanceof g?new Me({cause:e,message:n.details}):Me.nodeMessage.test(r)?new Me({cause:e,message:e.details}):nt.nodeMessage.test(r)?new nt({cause:e,maxFeePerGas:t?.maxFeePerGas}):qt.nodeMessage.test(r)?new qt({cause:e,maxFeePerGas:t?.maxFeePerGas}):Dt.nodeMessage.test(r)?new Dt({cause:e,nonce:t?.nonce}):zt.nodeMessage.test(r)?new zt({cause:e,nonce:t?.nonce}):_t.nodeMessage.test(r)?new _t({cause:e,nonce:t?.nonce}):Lt.nodeMessage.test(r)?new Lt({cause:e}):Gt.nodeMessage.test(r)?new Gt({cause:e,gas:t?.gas}):Ht.nodeMessage.test(r)?new Ht({cause:e,gas:t?.gas}):Ut.nodeMessage.test(r)?new Ut({cause:e}):at.nodeMessage.test(r)?new at({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new yt({cause:e})}function ga(e,{docsPath:t,...r}){const n=(()=>{const a=Rr(e,r);return a instanceof yt?e:a})();return new ya(n,{docsPath:t,...r})}function Br(e,{format:t}){if(!t)return{};const r={};function n(s){const o=Object.keys(s);for(const i of o)i in e&&(r[i]=e[i]),s[i]&&typeof s[i]=="object"&&!Array.isArray(s[i])&&n(s[i])}const a=t(e||{});return n(a),r}function rr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new Mt({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new Mt({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function wa(e){const{balance:t,nonce:r,state:n,stateDiff:a,code:s}=e,o={};if(s!==void 0&&(o.code=s),t!==void 0&&(o.balance=B(t)),r!==void 0&&(o.nonce=B(r)),n!==void 0&&(o.state=rr(n)),a!==void 0){if(o.state)throw new da;o.stateDiff=rr(a)}return o}function Or(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!q(r,{strict:!1}))throw new Z({address:r});if(t[r])throw new ua({address:r});t[r]=wa(n)}return t}function At(e){const{account:t,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:a,to:s}=e,o=t?H(t):void 0;if(o&&!q(o.address))throw new Z({address:o.address});if(s&&!q(s))throw new Z({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof a<"u"))throw new pn;if(n&&n>2n**256n-1n)throw new nt({maxFeePerGas:n});if(a&&n&&a>n)throw new at({maxFeePerGas:n,maxPriorityFeePerGas:a})}class va extends g{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Tt extends g{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Pa extends g{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${V(t)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Fr extends g{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function _(e,{blockHash:t,blockNumber:r,blockTag:n,includeTransactions:a}={}){const s=n??"latest",o=a??!1,i=r!==void 0?B(r):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]}):c=await e.request({method:"eth_getBlockByNumber",params:[i||s,o]}),!c)throw new Fr({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||lr)(c)}async function kt(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function Ea(e,t){return Nr(e,t)}async function Nr(e,t){const{block:r,chain:n=e.chain,request:a}=t||{};if(typeof n?.fees?.defaultPriorityFee=="function"){const s=r||await x(e,_,"getBlock")({});return n.fees.defaultPriorityFee({block:s,client:e,request:a})}if(typeof n?.fees?.defaultPriorityFee<"u")return n?.fees?.defaultPriorityFee;try{const s=await e.request({method:"eth_maxPriorityFeePerGas"});return fe(s)}catch{const[s,o]=await Promise.all([r?Promise.resolve(r):x(e,_,"getBlock")({}),x(e,kt,"getGasPrice")({})]);if(typeof s.baseFeePerGas!="bigint")throw new Tt;const i=o-s.baseFeePerGas;return i<0n?0n:i}}async function xa(e,t){return dt(e,t)}async function dt(e,t){const{block:r,chain:n=e.chain,request:a,type:s="eip1559"}=t||{},o=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:a}):n?.fees?.baseFeeMultiplier??1.2)();if(o<1)throw new va;const c=10**(o.toString().split(".")[1]?.length??0),u=l=>l*BigInt(Math.ceil(o*c))/BigInt(c),f=r||await x(e,_,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){const l=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:u,request:a,type:s});if(l!==null)return l}if(s==="eip1559"){if(typeof f.baseFeePerGas!="bigint")throw new Tt;const l=typeof a?.maxPriorityFeePerGas=="bigint"?a.maxPriorityFeePerGas:await Nr(e,{block:f,chain:n,request:a}),p=u(f.baseFeePerGas);return{maxFeePerGas:a?.maxFeePerGas??p+l,maxPriorityFeePerGas:l}}return{gasPrice:a?.gasPrice??u(await x(e,kt,"getGasPrice")({}))}}async function jr(e,{address:t,blockTag:r="latest",blockNumber:n}){const a=await e.request({method:"eth_getTransactionCount",params:[t,n?B(n):r]});return Fe(a)}async function Cr(e){const t=await e.request({method:"eth_chainId"});return Fe(t)}const Aa=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function $r(e,t){const{account:r=e.account,blobs:n,chain:a,chainId:s,gas:o,kzg:i,nonce:c,parameters:u=Aa,type:f}=t,d=r?H(r):void 0,l={...t,...d?{from:d?.address}:{}};let p;async function m(){return p||(p=await x(e,_,"getBlock")({blockTag:"latest"}),p)}if((u.includes("blobVersionedHashes")||u.includes("sidecars"))&&n&&i){const b=bn({blobs:n,kzg:i});if(u.includes("blobVersionedHashes")){const h=hn({commitments:b,to:"hex"});l.blobVersionedHashes=h}if(u.includes("sidecars")){const h=mn({blobs:n,commitments:b,kzg:i}),y=yn({blobs:n,commitments:b,proofs:h,to:"hex"});l.sidecars=y}}if(u.includes("chainId")&&(a?l.chainId=a.id:typeof s<"u"?l.chainId=s:l.chainId=await x(e,Cr,"getChainId")({})),u.includes("nonce")&&typeof c>"u"&&d&&(l.nonce=await x(e,jr,"getTransactionCount")({address:d.address,blockTag:"pending"})),(u.includes("fees")||u.includes("type"))&&typeof f>"u")try{l.type=gn(l)}catch{const b=await m();l.type=typeof b?.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(u.includes("fees"))if(l.type!=="legacy"&&l.type!=="eip2930"){if(typeof l.maxFeePerGas>"u"||typeof l.maxPriorityFeePerGas>"u"){const b=await m(),{maxFeePerGas:h,maxPriorityFeePerGas:y}=await dt(e,{block:b,chain:a,request:l});if(typeof t.maxPriorityFeePerGas>"u"&&t.maxFeePerGas&&t.maxFeePerGas<y)throw new Pa({maxPriorityFeePerGas:y});l.maxPriorityFeePerGas=y,l.maxFeePerGas=h}}else{if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")throw new Tt;const b=await m(),{gasPrice:h}=await dt(e,{block:b,chain:a,request:l,type:"legacy"});l.gasPrice=h}return u.includes("gas")&&typeof o>"u"&&(l.gas=await x(e,Rt,"estimateGas")({...l,account:d?{address:d.address,type:"json-rpc"}:void 0})),At(l),delete l.parameters,l}async function Rt(e,t){const r=t.account??e.account,n=r?H(r):void 0;try{const{accessList:a,blobs:s,blobVersionedHashes:o,blockNumber:i,blockTag:c,data:u,gas:f,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:b,to:h,value:y,stateOverride:w,...v}=await $r(e,{...t,parameters:n?.type==="local"?void 0:["blobVersionedHashes"]}),k=(i?B(i):void 0)||c,E=Or(w);At(t);const A=e.chain?.formatters?.transactionRequest?.format,T=(A||fr)({...Br(v,{format:A}),from:n?.address,accessList:a,blobs:s,blobVersionedHashes:o,data:u,gas:f,gasPrice:d,maxFeePerBlobGas:l,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:b,to:h,value:y}),O=await e.request({method:"eth_estimateGas",params:E?[T,k??"latest",E]:k?[T,k]:[T]});return BigInt(O)}catch(a){throw ga(a,{...t,account:n,chain:e.chain})}}async function Ta(e,t){const{abi:r,address:n,args:a,functionName:s,...o}=t,i=K({abi:r,args:a,functionName:s});try{return await x(e,Rt,"estimateGas")({data:i,to:n,...o})}catch(c){const u=o.account?H(o.account):void 0;throw Oe(c,{abi:r,address:n,args:a,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u?.address})}}const nr="/docs/contract/decodeEventLog";function Bt(e){const{abi:t,data:r,strict:n,topics:a}=e,s=n??!0,[o,...i]=a;if(!o)throw new On({docsPath:nr});const c=t.find(b=>b.type==="event"&&o===gt(z(b)));if(!(c&&"name"in c)||c.type!=="event")throw new gr(o,{docsPath:nr});const{name:u,inputs:f}=c,d=f?.some(b=>!("name"in b&&b.name));let l=d?[]:{};const p=f.filter(b=>"indexed"in b&&b.indexed);for(let b=0;b<p.length;b++){const h=p[b],y=i[b];if(!y)throw new Ve({abiItem:c,param:h});l[d?b:h.name||b]=ka({param:h,value:y})}const m=f.filter(b=>!("indexed"in b&&b.indexed));if(m.length>0){if(r&&r!=="0x")try{const b=Ze(m,r);if(b)if(d)l=[...l,...b];else for(let h=0;h<m.length;h++)l[m[h].name]=b[h]}catch(b){if(s)throw b instanceof mr||b instanceof wn?new pe({abiItem:c,data:r,params:m,size:C(r)}):b}else if(s)throw new pe({abiItem:c,data:"0x",params:m,size:0})}return{eventName:u,args:Object.values(l).length>0?l:void 0}}function ka({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Ze([e],t)||[])[0]}function Ot({abi:e,eventName:t,logs:r,strict:n=!0}){return r.map(a=>{try{const s=Bt({...a,abi:e,strict:n});return t&&!t.includes(s.eventName)?null:{...s,...a}}catch(s){let o,i;if(s instanceof gr)return null;if(s instanceof pe||s instanceof Ve){if(n)return null;o=s.abiItem.name,i=s.abiItem.inputs?.some(c=>!("name"in c&&c.name))}return{...a,args:i?[]:{},eventName:o}}}).filter(Boolean)}async function Ft(e,{address:t,blockHash:r,fromBlock:n,toBlock:a,event:s,events:o,args:i,strict:c}={}){const u=c??!1,f=o??(s?[s]:void 0);let d=[];f&&(d=[f.flatMap(m=>Ce({abi:[m],eventName:m.name,args:i}))],s&&(d=d[0]));let l;r?l=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):l=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof n=="bigint"?B(n):n,toBlock:typeof a=="bigint"?B(a):a}]});const p=l.map(m=>Y(m));return f?Ot({abi:f,logs:p,strict:u}):p}async function Ir(e,t){const{abi:r,address:n,args:a,blockHash:s,eventName:o,fromBlock:i,toBlock:c,strict:u}=t,f=o?je({abi:r,name:o}):void 0,d=f?void 0:r.filter(l=>l.type==="event");return x(e,Ft,"getLogs")({address:n,args:a,blockHash:s,event:f,events:d,fromBlock:i,toBlock:c,strict:u})}const Ke="/docs/contract/decodeFunctionResult";function ce(e){const{abi:t,args:r,functionName:n,data:a}=e;let s=t[0];if(n){const i=je({abi:t,args:r,name:n});if(!i)throw new Le(n,{docsPath:Ke});s=i}if(s.type!=="function")throw new Le(void 0,{docsPath:Ke});if(!s.outputs)throw new Fn(s.name,{docsPath:Ke});const o=Ze(s.outputs,a);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const lt=[{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"}],Sr=[{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"}],Mr=[...Sr,{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"}]}],Ra=[...Sr,{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"}]}],ar=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],sr=[{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"}]}],Ba=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Oa="0x82ad56cb";function ue({blockNumber:e,chain:t,contract:r}){const n=t?.contracts?.[r];if(!n)throw new st({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new st({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function Fa(e,{docsPath:t,...r}){const n=(()=>{const a=Rr(e,r);return a instanceof yt?e:a})();return new Tr(n,{docsPath:t,...r})}const et=new Map;function qr({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:a}){const s=async()=>{const f=c();o();const d=f.map(({args:l})=>l);d.length!==0&&e(d).then(l=>{a&&Array.isArray(l)&&l.sort(a);for(let p=0;p<f.length;p++){const{pendingPromise:m}=f[p];m.resolve?.([l[p],l])}}).catch(l=>{for(let p=0;p<f.length;p++){const{pendingPromise:m}=f[p];m.reject?.(l)}})},o=()=>et.delete(t),i=()=>c().map(({args:f})=>f),c=()=>et.get(t)||[],u=f=>et.set(t,[...c(),f]);return{flush:o,async schedule(f){const d={},l=new Promise((b,h)=>{d.resolve=b,d.reject=h});return r?.([...i(),f])&&s(),c().length>0?(u({args:f,pendingPromise:d}),l):(u({args:f,pendingPromise:d}),setTimeout(s,n),l)}}}async function $e(e,t){const{account:r=e.account,batch:n=!!e.batch?.multicall,blockNumber:a,blockTag:s="latest",accessList:o,blobs:i,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:p,nonce:m,to:b,value:h,stateOverride:y,...w}=t,v=r?H(r):void 0;try{At(t);const k=(a?B(a):void 0)||s,E=Or(y),A=e.chain?.formatters?.transactionRequest?.format,T=(A||fr)({...Br(w,{format:A}),from:v?.address,accessList:o,blobs:i,data:c,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:l,maxPriorityFeePerGas:p,nonce:m,to:b,value:h});if(n&&Na({request:T})&&!E)try{return await ja(e,{...T,blockNumber:a,blockTag:s})}catch(F){if(!(F instanceof pr)&&!(F instanceof st))throw F}const O=await e.request({method:"eth_call",params:E?[T,k,E]:[T,k]});return O==="0x"?{data:void 0}:{data:O}}catch(P){const k=Ca(P),{offchainLookup:E,offchainLookupSignature:A}=await on(async()=>{const{offchainLookup:R,offchainLookupSignature:T}=await Promise.resolve().then(()=>Os);return{offchainLookup:R,offchainLookupSignature:T}},void 0);if(e.ccipRead!==!1&&k?.slice(0,10)===A&&b)return{data:await E(e,{data:k,to:b})};throw Fa(P,{...t,account:v,chain:e.chain})}}function Na({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(Oa)||!r||Object.values(n).filter(a=>typeof a<"u").length>0)}async function ja(e,t){const{batchSize:r=1024,wait:n=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:a,blockTag:s="latest",data:o,multicallAddress:i,to:c}=t;let u=i;if(!u){if(!e.chain)throw new pr;u=ue({blockNumber:a,chain:e.chain,contract:"multicall3"})}const d=(a?B(a):void 0)||s,{schedule:l}=qr({id:`${e.uid}.${d}`,wait:n,shouldSplitBatch(b){return b.reduce((y,{data:w})=>y+(w.length-2),0)>r*2},fn:async b=>{const h=b.map(v=>({allowFailure:!0,callData:v.data,target:v.to})),y=K({abi:lt,args:[h],functionName:"aggregate3"}),w=await e.request({method:"eth_call",params:[{data:y,to:u},d]});return ce({abi:lt,args:[h],functionName:"aggregate3",data:w||"0x"})}}),[{returnData:p,success:m}]=await l({data:o,to:c});if(!m)throw new xt({data:p});return p==="0x"?{data:void 0}:{data:p}}function Ca(e){if(!(e instanceof g))return;const t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}async function L(e,t){const{abi:r,address:n,args:a,functionName:s,...o}=t,i=K({abi:r,args:a,functionName:s});try{const{data:c}=await x(e,$e,"call")({...o,data:i,to:n});return ce({abi:r,args:a,functionName:s,data:c||"0x"})}catch(c){throw Oe(c,{abi:r,address:n,args:a,docsPath:"/docs/contract/readContract",functionName:s})}}async function $a(e,t){const{abi:r,address:n,args:a,dataSuffix:s,functionName:o,...i}=t,c=i.account?H(i.account):e.account,u=K({abi:r,args:a,functionName:o});try{const{data:f}=await x(e,$e,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:n,...i,account:c}),d=ce({abi:r,args:a,functionName:o,data:f||"0x"}),l=r.filter(p=>"name"in p&&p.name===t.functionName);return{result:d,request:{abi:l,address:n,args:a,dataSuffix:s,functionName:o,...i,account:c}}}catch(f){throw Oe(f,{abi:r,address:n,args:a,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c?.address})}}const tt=new Map,or=new Map;let Ia=0;function G(e,t,r){const n=++Ia,a=()=>tt.get(e)||[],s=()=>{const f=a();tt.set(e,f.filter(d=>d.id!==n))},o=()=>{const f=or.get(e);a().length===1&&f&&f(),s()},i=a();if(tt.set(e,[...i,{id:n,fns:t}]),i&&i.length>0)return o;const c={};for(const f in t)c[f]=((...d)=>{const l=a();if(l.length!==0)for(const p of l)p.fns[f]?.(...d)});const u=r(c);return typeof u=="function"&&or.set(e,u),o}async function ft(e){return new Promise(t=>setTimeout(t,e))}function Ie(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let a=!0;const s=()=>a=!1;return(async()=>{let i;t&&(i=await e({unpoll:s}));const c=await r?.(i)??n;await ft(c);const u=async()=>{a&&(await e({unpoll:s}),await ft(n),u())};u()})(),s}const Sa=new Map,Ma=new Map;function qa(e){const t=(a,s)=>({clear:()=>s.delete(a),get:()=>s.get(a),set:o=>s.set(a,o)}),r=t(e,Sa),n=t(e,Ma);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function Da(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){const n=qa(t),a=n.response.get();if(a&&r>0&&new Date().getTime()-a.created.getTime()<r)return a.data;let s=n.promise.get();s||(s=e(),n.promise.set(s));try{const o=await s;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}const za=e=>`blockNumber.${e}`;async function Se(e,{cacheTime:t=e.cacheTime}={}){const r=await Da(()=>e.request({method:"eth_blockNumber"}),{cacheKey:za(e.uid),cacheTime:t});return BigInt(r)}async function Ye(e,{filter:t}){const r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]=="string")return n;const a=n.map(s=>Y(s));return!("abi"in t)||!t.abi?a:Ot({abi:t.abi,logs:a,strict:r})}async function Qe(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function _a(e,t){const{abi:r,address:n,args:a,batch:s=!0,eventName:o,fromBlock:i,onError:c,onLogs:u,poll:f,pollingInterval:d=e.pollingInterval,strict:l}=t;return(typeof f<"u"?f:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"))?(()=>{const h=l??!1,y=N(["watchContractEvent",n,a,s,e.uid,o,d,h,i]);return G(y,{onLogs:u,onError:c},w=>{let v;i!==void 0&&(v=i-1n);let P,k=!1;const E=Ie(async()=>{if(!k){try{P=await x(e,Pr,"createContractEventFilter")({abi:r,address:n,args:a,eventName:o,strict:h,fromBlock:i})}catch{}k=!0;return}try{let A;if(P)A=await x(e,Ye,"getFilterChanges")({filter:P});else{const R=await x(e,Se,"getBlockNumber")({});v&&v!==R?A=await x(e,Ir,"getContractEvents")({abi:r,address:n,args:a,eventName:o,fromBlock:v+1n,toBlock:R,strict:h}):A=[],v=R}if(A.length===0)return;if(s)w.onLogs(A);else for(const R of A)w.onLogs([R])}catch(A){P&&A instanceof X&&(k=!1),w.onError?.(A)}},{emitOnBegin:!0,interval:d});return async()=>{P&&await x(e,Qe,"uninstallFilter")({filter:P}),E()}})})():(()=>{const h=l??!1,y=N(["watchContractEvent",n,a,s,e.uid,o,d,h]);let w=!0,v=()=>w=!1;return G(y,{onLogs:u,onError:c},P=>((async()=>{try{const k=(()=>{if(e.transport.type==="fallback"){const R=e.transport.transports.find(T=>T.config.type==="webSocket");return R?R.value:e.transport}return e.transport})(),E=o?Ce({abi:r,eventName:o,args:a}):[],{unsubscribe:A}=await k.subscribe({params:["logs",{address:n,topics:E}],onData(R){if(!w)return;const T=R.result;try{const{eventName:O,args:F}=Bt({abi:r,data:T.data,topics:T.topics,strict:l}),I=Y(T,{args:F,eventName:O});P.onLogs([I])}catch(O){let F,I;if(O instanceof pe||O instanceof Ve){if(l)return;F=O.abiItem.name,I=O.abiItem.inputs?.some(St=>!("name"in St&&St.name))}const en=Y(T,{args:I?[]:{},eventName:F});P.onLogs([en])}},onError(R){P.onError?.(R)}});v=A,w||v()}catch(k){c?.(k)}})(),()=>v()))})()}async function La(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const pt=256;let qe=pt,De;function Ga(e=11){if(!De||qe+e>pt*2){De="",qe=0;for(let t=0;t<pt;t++)De+=(256+Math.random()*256|0).toString(16).substring(1)}return De.substring(qe,qe+++e)}function Ha(e){const{batch:t,cacheTime:r=e.pollingInterval??4e3,ccipRead:n,key:a="base",name:s="Base Client",pollingInterval:o=4e3,type:i="base"}=e,c=e.chain,u=e.account?H(e.account):void 0,{config:f,request:d,value:l}=e.transport({chain:c,pollingInterval:o}),p={...f,...l},m={account:u,batch:t,cacheTime:r,ccipRead:n,chain:c,key:a,name:s,pollingInterval:o,request:d,transport:p,type:i,uid:Ga()};function b(h){return y=>{const w=y(h);for(const P in m)delete w[P];const v={...h,...w};return Object.assign(v,{extend:b(v)})}}return Object.assign(m,{extend:b(m)})}function bt(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((a,s)=>{const o=async({count:i=0}={})=>{const c=async({error:u})=>{const f=typeof t=="function"?t({count:i,error:u}):t;f&&await ft(f),o({count:i+1})};try{const u=await e();a(u)}catch(u){if(i<r&&await n({count:i,error:u}))return c({error:u});s(u)}};o()})}function Ua(e,t={}){return async(r,n={})=>{const{retryDelay:a=150,retryCount:s=3}={...t,...n};return bt(async()=>{try{return await e(r)}catch(o){const i=o;switch(i.code){case he.code:throw new he(i);case me.code:throw new me(i);case ye.code:throw new ye(i);case ge.code:throw new ge(i);case Q.code:throw new Q(i);case X.code:throw new X(i);case we.code:throw new we(i);case ve.code:throw new ve(i);case Pe.code:throw new Pe(i);case Ee.code:throw new Ee(i);case ae.code:throw new ae(i);case xe.code:throw new xe(i);case te.code:throw new te(i);case Ae.code:throw new Ae(i);case Te.code:throw new Te(i);case ke.code:throw new ke(i);case Re.code:throw new Re(i);case Be.code:throw new Be(i);case 5e3:throw new te(i);default:throw o instanceof g?o:new ha(i)}}},{delay:({count:o,error:i})=>{if(i&&i instanceof J){const c=i?.headers?.get("Retry-After");if(c?.match(/\d/))return Number.parseInt(c)*1e3}return~~(1<<o)*a},retryCount:s,shouldRetry:({error:o})=>Wa(o)})}}function Wa(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===ae.code||e.code===Q.code:e instanceof J&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function Va({key:e,name:t,request:r,retryCount:n=3,retryDelay:a=150,timeout:s,type:o},i){return{config:{key:e,name:t,request:r,retryCount:n,retryDelay:a,timeout:s,type:o},request:Ua(r,{retryCount:n,retryDelay:a}),value:i}}class Ja extends g{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function Za(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((a,s)=>{(async()=>{let o;try{const i=new AbortController;r>0&&(o=setTimeout(()=>{n&&i.abort()},r)),a(await e({signal:i?.signal||null}))}catch(i){i.name==="AbortError"&&s(t),s(i)}finally{clearTimeout(o)}})()})}function Ya(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ir=Ya();function Qa(e,t={}){return{async request(r){const{body:n,onRequest:a=t.onRequest,onResponse:s=t.onResponse,timeout:o=t.timeout??1e4}=r,i={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:c,method:u,signal:f}=i;try{const d=await Za(async({signal:p})=>{const m={...i,body:Array.isArray(n)?N(n.map(y=>({jsonrpc:"2.0",id:y.id??ir.take(),...y}))):N({jsonrpc:"2.0",id:n.id??ir.take(),...n}),headers:{...c,"Content-Type":"application/json"},method:u||"POST",signal:f||(o>0?p:null)},b=new Request(e,m);return a&&await a(b),await fetch(e,m)},{errorInstance:new tr({body:n,url:e}),timeout:o,signal:!0});s&&await s(d);let l;if(d.headers.get("Content-Type")?.startsWith("application/json")?l=await d.json():(l=await d.text(),l=JSON.parse(l||"{}")),!d.ok)throw new J({body:n,details:N(l.error)||d.statusText,headers:d.headers,status:d.status,url:e});return l}catch(d){throw d instanceof J||d instanceof tr?d:new J({body:n,details:d.message,url:e})}}}}function uo(e,t={}){const{batch:r,fetchOptions:n,key:a="http",name:s="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:i,retryDelay:c}=t;return({chain:u,retryCount:f,timeout:d})=>{const{batchSize:l=1e3,wait:p=0}=typeof r=="object"?r:{},m=t.retryCount??f,b=d??t.timeout??1e4,h=e||u?.rpcUrls.default.http[0];if(!h)throw new Ja;const y=Qa(h,{fetchOptions:n,onRequest:o,onResponse:i,timeout:b});return Va({key:a,name:s,async request({method:w,params:v}){const P={method:w,params:v},{schedule:k}=qr({id:h,wait:p,shouldSplitBatch(T){return T.length>l},fn:T=>y.request({body:T}),sort:(T,O)=>T.id-O.id}),E=async T=>r?k(T):[await y.request({body:T})],[{error:A,result:R}]=await E(P);if(A)throw new kr({body:P,error:A,url:h});return R},retryCount:m,retryDelay:c,timeout:b,type:"http"},{fetchOptions:n,url:h})}}function Nt(e,t){if(!(e instanceof g))return!1;const r=e.walk(n=>n instanceof ut);return r instanceof ut?!!(r.data?.errorName==="ResolverNotFound"||r.data?.errorName==="ResolverWildcardNotSupported"||r.data?.errorName==="ResolverNotContract"||r.data?.errorName==="ResolverError"||r.data?.errorName==="HttpError"||r.reason?.includes("Wildcard on non-extended resolvers is not supported")||t==="reverse"&&r.reason===Er[50]):!1}function Dr(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return ne(t)?t:null}function ze(e){let t=new Uint8Array(32).fill(0);if(!e)return S(t);const r=e.split(".");for(let n=r.length-1;n>=0;n-=1){const a=Dr(r[n]),s=a?re(a):$(W(r[n]),"bytes");t=$(M([t,s]),"bytes")}return S(t)}function Xa(e){return`[${e.slice(2)}]`}function Ka(e){const t=new Uint8Array(32).fill(0);return e?Dr(e)||$(W(e)):S(t)}function Xe(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const r=new Uint8Array(W(t).byteLength+2);let n=0;const a=t.split(".");for(let s=0;s<a.length;s++){let o=W(a[s]);o.byteLength>255&&(o=W(Xa(Ka(a[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function es(e,{blockNumber:t,blockTag:r,coinType:n,name:a,gatewayUrls:s,strict:o,universalResolverAddress:i}){let c=i;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=ue({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u=K({abi:sr,functionName:"addr",...n!=null?{args:[ze(a),BigInt(n)]}:{args:[ze(a)]}}),f={address:c,abi:Mr,functionName:"resolve",args:[se(Xe(a)),u],blockNumber:t,blockTag:r},d=x(e,L,"readContract"),l=s?await d({...f,args:[...f.args,s]}):await d(f);if(l[0]==="0x")return null;const p=ce({abi:sr,args:n!=null?[ze(a),BigInt(n)]:void 0,functionName:"addr",data:l[0]});return p==="0x"||He(p)==="0x00"?null:p}catch(u){if(o)throw u;if(Nt(u,"resolve"))return null;throw u}}class ts extends g{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)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class le extends g{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class jt extends g{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.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class rs extends g{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const ns=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,as=/^(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>\/.*)?$/,ss=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,os=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function is(e){try{const t=await 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"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}}function cr(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function zr({uri:e,gatewayUrls:t}){const r=ss.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};const n=cr(t?.ipfs,"https://ipfs.io"),a=cr(t?.arweave,"https://arweave.net"),s=e.match(ns),{protocol:o,subpath:i,target:c,subtarget:u=""}=s?.groups||{},f=o==="ipns:/"||i==="ipns/",d=o==="ipfs:/"||i==="ipfs/"||as.test(e);if(e.startsWith("http")&&!f&&!d){let p=e;return t?.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((f||d)&&c)return{uri:`${n}/${f?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${a}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let l=e.replace(os,"");if(l.startsWith("<svg")&&(l=`data:image/svg+xml;base64,${btoa(l)}`),l.startsWith("data:")||l.startsWith("{"))return{uri:l,isOnChain:!0,isEncoded:!1};throw new jt({uri:e})}function _r(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new ts({data:e});return e.image||e.image_url||e.image_data}async function cs({gatewayUrls:e,uri:t}){try{const r=await fetch(t).then(a=>a.json());return await Ct({gatewayUrls:e,uri:_r(r)})}catch{throw new jt({uri:t})}}async function Ct({gatewayUrls:e,uri:t}){const{uri:r,isOnChain:n}=zr({uri:t,gatewayUrls:e});if(n||await is(r))return r;throw new jt({uri:t})}function us(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[r,n,a]=t.split("/"),[s,o]=r.split(":"),[i,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new le({reason:"Only EIP-155 supported"});if(!o)throw new le({reason:"Chain ID not found"});if(!c)throw new le({reason:"Contract address not found"});if(!a)throw new le({reason:"Token ID not found"});if(!i)throw new le({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:i.toLowerCase(),contractAddress:c,tokenID:a}}async function ds(e,{nft:t}){if(t.namespace==="erc721")return L(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return L(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 rs({namespace:t.namespace})}async function ls(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?fs(e,{gatewayUrls:t,record:r}):Ct({uri:r,gatewayUrls:t})}async function fs(e,{gatewayUrls:t,record:r}){const n=us(r),a=await ds(e,{nft:n}),{uri:s,isOnChain:o,isEncoded:i}=zr({uri:a,gatewayUrls:t});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const u=i?atob(s.replace("data:application/json;base64,","")):s,f=JSON.parse(u);return Ct({uri:_r(f),gatewayUrls:t})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),cs({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,c)})}async function Lr(e,{blockNumber:t,blockTag:r,name:n,key:a,gatewayUrls:s,strict:o,universalResolverAddress:i}){let c=i;if(!c){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=ue({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{const u={address:c,abi:Mr,functionName:"resolve",args:[se(Xe(n)),K({abi:ar,functionName:"text",args:[ze(n),a]})],blockNumber:t,blockTag:r},f=x(e,L,"readContract"),d=s?await f({...u,args:[...u.args,s]}):await f(u);if(d[0]==="0x")return null;const l=ce({abi:ar,functionName:"text",data:d[0]});return l===""?null:l}catch(u){if(o)throw u;if(Nt(u,"resolve"))return null;throw u}}async function ps(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:a,gatewayUrls:s,strict:o,universalResolverAddress:i}){const c=await x(e,Lr,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:a,universalResolverAddress:i,gatewayUrls:s,strict:o});if(!c)return null;try{return await ls(e,{record:c,gatewayUrls:n})}catch{return null}}async function bs(e,{address:t,blockNumber:r,blockTag:n,gatewayUrls:a,strict:s,universalResolverAddress:o}){let i=o;if(!i){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=ue({blockNumber:r,chain:e.chain,contract:"ensUniversalResolver"})}const c=`${t.toLowerCase().substring(2)}.addr.reverse`;try{const u={address:i,abi:Ra,functionName:"reverse",args:[se(Xe(c))],blockNumber:r,blockTag:n},f=x(e,L,"readContract"),[d,l]=a?await f({...u,args:[...u.args,a]}):await f(u);return t.toLowerCase()!==l.toLowerCase()?null:d}catch(u){if(s)throw u;if(Nt(u,"reverse"))return null;throw u}}async function hs(e,{blockNumber:t,blockTag:r,name:n,universalResolverAddress:a}){let s=a;if(!s){if(!e.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=ue({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}const[o]=await x(e,L,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[se(Xe(n))],blockNumber:t,blockTag:r});return o}async function ms(e){const t=Je(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}async function Gr(e,{address:t,args:r,event:n,events:a,fromBlock:s,strict:o,toBlock:i}={}){const c=a??(n?[n]:void 0),u=Je(e,{method:"eth_newFilter"});let f=[];c&&(f=[c.flatMap(l=>Ce({abi:[l],eventName:l.name,args:r}))],n&&(f=f[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?B(s):s,toBlock:typeof i=="bigint"?B(i):i,...f.length?{topics:f}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:d,request:u(d),strict:!!o,toBlock:i,type:"event"}}async function Hr(e){const t=Je(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}async function ys(e,{address:t,blockNumber:r,blockTag:n="latest"}){const a=r?B(r):void 0,s=await e.request({method:"eth_getBalance",params:[t,a||n]});return BigInt(s)}async function gs(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function ws(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){const a=r!==void 0?B(r):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[a||n]}),Fe(s)}async function vs(e,{address:t,blockNumber:r,blockTag:n="latest"}){const a=r!==void 0?B(r):void 0,s=await e.request({method:"eth_getCode",params:[t,a||n]});if(s!=="0x")return s}function Ps(e){return{baseFeePerGas:e.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:e.reward?.map(t=>t.map(r=>BigInt(r)))}}async function Es(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:a}){const s=r?B(r):void 0,o=await e.request({method:"eth_feeHistory",params:[B(t),s||n,a]});return Ps(o)}async function xs(e,{filter:t}){const r=t.strict??!1,a=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Y(s));return t.abi?Ot({abi:t.abi,logs:a,strict:r}):a}class As extends g{constructor({callbackSelector:t,cause:r,data:n,extraData:a,sender:s,urls:o}){super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],r.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&["  Gateway URL(s):",...o.map(i=>`    ${Ne(i)}`)],`  Sender: ${s}`,`  Data: ${n}`,`  Callback selector: ${t}`,`  Extra data: ${a}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class Ts extends g{constructor({result:t,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Ne(r)}`,`Response: ${N(t)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class ks extends g{constructor({sender:t,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function Ur(e,t){if(!q(e,{strict:!1}))throw new Z({address:e});if(!q(t,{strict:!1}))throw new Z({address:t});return e.toLowerCase()===t.toLowerCase()}const Rs="0x556f1830",Wr={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 Bs(e,{blockNumber:t,blockTag:r,data:n,to:a}){const{args:s}=xr({data:n,abi:[Wr]}),[o,i,c,u,f]=s,{ccipRead:d}=e,l=d&&typeof d?.request=="function"?d.request:Vr;try{if(!Ur(a,o))throw new ks({sender:o,to:a});const p=await l({data:c,sender:o,urls:i}),{data:m}=await $e(e,{blockNumber:t,blockTag:r,data:M([u,oe([{type:"bytes"},{type:"bytes"}],[p,f])]),to:a});return m}catch(p){throw new As({callbackSelector:u,cause:p,data:n,extraData:f,sender:o,urls:i})}}async function Vr({data:e,sender:t,urls:r}){let n=new Error("An unknown error occurred.");for(let a=0;a<r.length;a++){const s=r[a],o=s.includes("{data}")?"GET":"POST",i=o==="POST"?{data:e,sender:t}:void 0;try{const c=await fetch(s.replace("{sender}",t).replace("{data}",e),{body:JSON.stringify(i),method:o});let u;if(c.headers.get("Content-Type")?.startsWith("application/json")?u=(await c.json()).data:u=await c.text(),!c.ok){n=new J({body:i,details:u?.error?N(u.error):c.statusText,headers:c.headers,status:c.status,url:s});continue}if(!ne(u)){n=new Ts({result:u,url:s});continue}return u}catch(c){n=new J({body:i,details:c.message,url:s})}}throw n}const Os=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Vr,offchainLookup:Bs,offchainLookupAbiItem:Wr,offchainLookupSignature:Rs},Symbol.toStringTag,{value:"Module"}));function lo({chains:e,id:t}){return e.find(r=>r.id===t)}const Fs=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ns=/^(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 js(e){const{domain:t={},message:r,primaryType:n}=e,a={EIP712Domain:Ms({domain:t}),...e.types};Ss({domain:t,message:r,primaryType:n,types:a});const s=["0x1901"];return t&&s.push(Cs({domain:t,types:a})),n!=="EIP712Domain"&&s.push(Jr({data:r,primaryType:n,types:a})),$(M(s))}function Cs({domain:e,types:t}){return Jr({data:e,primaryType:"EIP712Domain",types:t})}function Jr({data:e,primaryType:t,types:r}){const n=Zr({data:e,primaryType:t,types:r});return $(n)}function Zr({data:e,primaryType:t,types:r}){const n=[{type:"bytes32"}],a=[$s({primaryType:t,types:r})];for(const s of r[t]){const[o,i]=Qr({types:r,name:s.name,type:s.type,value:e[s.name]});n.push(o),a.push(i)}return oe(n,a)}function $s({primaryType:e,types:t}){const r=se(Is({primaryType:e,types:t}));return $(r)}function Is({primaryType:e,types:t}){let r="";const n=Yr({primaryType:e,types:t});n.delete(e);const a=[e,...Array.from(n).sort()];for(const s of a)r+=`${s}(${t[s].map(({name:o,type:i})=>`${i} ${o}`).join(",")})`;return r}function Yr({primaryType:e,types:t},r=new Set){const a=e.match(/^\w*/u)?.[0];if(r.has(a)||t[a]===void 0)return r;r.add(a);for(const s of t[a])Yr({primaryType:s.type,types:t},r);return r}function Qr({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},$(Zr({data:n,primaryType:r,types:e}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},$(n)];if(r==="string")return[{type:"bytes32"},$(se(n))];if(r.lastIndexOf("]")===r.length-1){const a=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>Qr({name:t,type:a,types:e,value:o}));return[{type:"bytes32"},$(oe(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function Ss(e){const{domain:t,message:r,primaryType:n,types:a}=e,s=(o,i)=>{for(const c of o){const{name:u,type:f}=c,d=i[u],l=f.match(Ns);if(l&&(typeof d=="number"||typeof d=="bigint")){const[b,h,y]=l;B(d,{signed:h==="int",size:Number.parseInt(y)/8})}if(f==="address"&&typeof d=="string"&&!q(d))throw new Z({address:d});const p=f.match(Fs);if(p){const[b,h]=p;if(h&&C(d)!==Number.parseInt(h))throw new jn({expectedSize:Number.parseInt(h),givenSize:C(d)})}const m=a[f];m&&s(m,d)}};if(a.EIP712Domain&&t&&s(a.EIP712Domain,t),n!=="EIP712Domain"){const o=a[n];s(o,r)}}function Ms({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},typeof e?.chainId=="number"&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}const rt="/docs/contract/encodeDeployData";function qs(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const a=t.find(o=>"type"in o&&o.type==="constructor");if(!a)throw new Tn({docsPath:rt});if(!("inputs"in a))throw new Jt({docsPath:rt});if(!a.inputs||a.inputs.length===0)throw new Jt({docsPath:rt});const s=oe(a.inputs,r);return dr([n,s])}const Ds=`Ethereum Signed Message:
`;function Xr(e,t){const r=typeof e=="string"?W(e):e.raw instanceof Uint8Array?e.raw:re(e.raw),n=W(`${Ds}${r.length}`);return $(M([n,r]),t)}function zs(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function _s(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?Fe(e.nonce):void 0,storageProof:e.storageProof?zs(e.storageProof):void 0}}async function Ls(e,{address:t,blockNumber:r,blockTag:n,storageKeys:a}){const s=n??"latest",o=r!==void 0?B(r):void 0,i=await e.request({method:"eth_getProof",params:[t,a,o||s]});return _s(i)}async function Gs(e,{address:t,blockNumber:r,blockTag:n="latest",slot:a}){const s=r!==void 0?B(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,a,s||n]})}async function $t(e,{blockHash:t,blockNumber:r,blockTag:n,hash:a,index:s}){const o=n||"latest",i=r!==void 0?B(r):void 0;let c=null;if(a?c=await e.request({method:"eth_getTransactionByHash",params:[a]}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,B(s)]}):c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||o,B(s)]}),!c)throw new br({blockHash:t,blockNumber:r,blockTag:o,hash:a,index:s});return(e.chain?.formatters?.transaction?.format||vn)(c)}async function Hs(e,{hash:t,transactionReceipt:r}){const[n,a]=await Promise.all([x(e,Se,"getBlockNumber")({}),t?x(e,$t,"getBlockNumber")({hash:t}):void 0]),s=r?.blockNumber||a?.blockNumber;return s?n-s+1n:0n}async function ht(e,{hash:t}){const r=await e.request({method:"eth_getTransactionReceipt",params:[t]});if(!r)throw new hr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||Pn)(r)}async function Us(e,t){const{allowFailure:r=!0,batchSize:n,blockNumber:a,blockTag:s,multicallAddress:o,stateOverride:i}=t,c=t.contracts,u=n??(typeof e.batch?.multicall=="object"&&e.batch.multicall.batchSize||1024);let f=o;if(!f){if(!e.chain)throw new Error("client chain not configured. multicallAddress is required.");f=ue({blockNumber:a,chain:e.chain,contract:"multicall3"})}const d=[[]];let l=0,p=0;for(let h=0;h<c.length;h++){const{abi:y,address:w,args:v,functionName:P}=c[h];try{const k=K({abi:y,args:v,functionName:P});p+=(k.length-2)/2,u>0&&p>u&&d[l].length>0&&(l++,p=(k.length-2)/2,d[l]=[]),d[l]=[...d[l],{allowFailure:!0,callData:k,target:w}]}catch(k){const E=Oe(k,{abi:y,address:w,args:v,docsPath:"/docs/contract/multicall",functionName:P});if(!r)throw E;d[l]=[...d[l],{allowFailure:!0,callData:"0x",target:w}]}}const m=await Promise.allSettled(d.map(h=>x(e,L,"readContract")({abi:lt,address:f,args:[h],blockNumber:a,blockTag:s,functionName:"aggregate3",stateOverride:i}))),b=[];for(let h=0;h<m.length;h++){const y=m[h];if(y.status==="rejected"){if(!r)throw y.reason;for(let v=0;v<d[h].length;v++)b.push({status:"failure",error:y.reason,result:void 0});continue}const w=y.value;for(let v=0;v<w.length;v++){const{returnData:P,success:k}=w[v],{callData:E}=d[h][v],{abi:A,address:R,functionName:T,args:O}=c[b.length];try{if(E==="0x")throw new We;if(!k)throw new xt({data:P});const F=ce({abi:A,args:O,data:P,functionName:T});b.push(r?{result:F,status:"success"}:F)}catch(F){const I=Oe(F,{abi:A,address:R,args:O,docsPath:"/docs/contract/multicall",functionName:T});if(!r)throw I;b.push({error:I,result:void 0,status:"failure"})}}}if(b.length!==c.length)throw new g("multicall results mismatch");return b}const Ws="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";function Vs(e,t){const r=ne(e)?re(e):e,n=ne(t)?re(t):t;return cn(r,n)}function Js({r:e,s:t,v:r,yParity:n}){const a=(()=>{if(n===0||n===1)return n;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new un.Signature(fe(e),fe(t)).toCompactHex()}${a===0?"1b":"1c"}`}async function It(e,{address:t,hash:r,signature:n,...a}){const s=ne(n)?n:typeof n=="object"&&"r"in n&&"s"in n?Js(n):S(n);try{const{data:o}=await x(e,$e,"call")({data:qs({abi:Ba,args:[t,r,s],bytecode:Ws}),...a});return Vs(o??"0x0","0x1")}catch(o){if(o instanceof Tr)return!1;throw o}}async function Zs(e,{address:t,message:r,signature:n,...a}){const s=Xr(r);return It(e,{address:t,hash:s,signature:n,...a})}async function Ys(e,t){const{address:r,signature:n,message:a,primaryType:s,types:o,domain:i,...c}=t,u=js({message:a,primaryType:s,types:o,domain:i});return It(e,{address:r,hash:u,signature:n,...c})}function Kr(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:a,poll:s,pollingInterval:o=e.pollingInterval}){const i=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket");let c;return i?(()=>{const d=N(["watchBlockNumber",e.uid,t,r,o]);return G(d,{onBlockNumber:n,onError:a},l=>Ie(async()=>{try{const p=await x(e,Se,"getBlockNumber")({cacheTime:0});if(c){if(p===c)return;if(p-c>1&&r)for(let m=c+1n;m<p;m++)l.onBlockNumber(m,c),c=m}(!c||p>c)&&(l.onBlockNumber(p,c),c=p)}catch(p){l.onError?.(p)}},{emitOnBegin:t,interval:o}))})():(()=>{const d=N(["watchBlockNumber",e.uid,t,r]);return G(d,{onBlockNumber:n,onError:a},l=>{let p=!0,m=()=>p=!1;return(async()=>{try{const b=(()=>{if(e.transport.type==="fallback"){const y=e.transport.transports.find(w=>w.config.type==="webSocket");return y?y.value:e.transport}return e.transport})(),{unsubscribe:h}=await b.subscribe({params:["newHeads"],onData(y){if(!p)return;const w=fe(y.result?.number);l.onBlockNumber(w,c),c=w},onError(y){l.onError?.(y)}});m=h,p||m()}catch(b){a?.(b)}})(),()=>m()})})()}async function Qs(e,{confirmations:t=1,hash:r,onReplaced:n,pollingInterval:a=e.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:i}){const c=N(["waitForTransactionReceipt",e.uid,r]);let u=0,f,d,l,p=!1;return new Promise((m,b)=>{i&&setTimeout(()=>b(new Wt({hash:r})),i);const h=G(c,{onReplaced:n,resolve:m,reject:b},y=>{const w=x(e,Kr,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:a,async onBlockNumber(v){const P=E=>{w(),E(),h()};let k=v;if(!p){u>s&&P(()=>y.reject(new Wt({hash:r})));try{if(l){if(t>1&&(!l.blockNumber||k-l.blockNumber+1n<t))return;P(()=>y.resolve(l));return}if(f||(p=!0,await bt(async()=>{f=await x(e,$t,"getTransaction")({hash:r}),f.blockNumber&&(k=f.blockNumber)},{delay:o,retryCount:s}),p=!1),l=await x(e,ht,"getTransactionReceipt")({hash:r}),t>1&&(!l.blockNumber||k-l.blockNumber+1n<t))return;P(()=>y.resolve(l))}catch(E){if(E instanceof br||E instanceof hr){if(!f){p=!1;return}try{d=f,p=!0;const A=await bt(()=>x(e,_,"getBlock")({blockNumber:k,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:O})=>O instanceof Fr});p=!1;const R=A.transactions.find(({from:O,nonce:F})=>O===d.from&&F===d.nonce);if(!R||(l=await x(e,ht,"getTransactionReceipt")({hash:R.hash}),t>1&&(!l.blockNumber||k-l.blockNumber+1n<t)))return;let T="replaced";R.to===d.to&&R.value===d.value?T="repriced":R.from===R.to&&R.value===0n&&(T="cancelled"),P(()=>{y.onReplaced?.({reason:T,replacedTransaction:d,transaction:R,transactionReceipt:l}),y.resolve(l)})}catch(A){P(()=>y.reject(A))}}else P(()=>y.reject(E))}finally{u++}}}})})})}function Xs(e,{blockTag:t="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:a,onError:s,includeTransactions:o,poll:i,pollingInterval:c=e.pollingInterval}){const u=typeof i<"u"?i:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),f=o??!1;let d;return u?(()=>{const m=N(["watchBlocks",e.uid,t,r,n,f,c]);return G(m,{onBlock:a,onError:s},b=>Ie(async()=>{try{const h=await x(e,_,"getBlock")({blockTag:t,includeTransactions:f});if(h.number&&d?.number){if(h.number===d.number)return;if(h.number-d.number>1&&r)for(let y=d?.number+1n;y<h.number;y++){const w=await x(e,_,"getBlock")({blockNumber:y,includeTransactions:f});b.onBlock(w,d),d=w}}(!d?.number||t==="pending"&&!h?.number||h.number&&h.number>d.number)&&(b.onBlock(h,d),d=h)}catch(h){b.onError?.(h)}},{emitOnBegin:n,interval:c}))})():(()=>{let m=!0,b=()=>m=!1;return(async()=>{try{const h=(()=>{if(e.transport.type==="fallback"){const w=e.transport.transports.find(v=>v.config.type==="webSocket");return w?w.value:e.transport}return e.transport})(),{unsubscribe:y}=await h.subscribe({params:["newHeads"],onData(w){if(!m)return;const P=(e.chain?.formatters?.block?.format||lr)(w.result);a(P,d),d=P},onError(w){s?.(w)}});b=y,m||b()}catch(h){s?.(h)}})(),()=>b()})()}function Ks(e,{address:t,args:r,batch:n=!0,event:a,events:s,fromBlock:o,onError:i,onLogs:c,poll:u,pollingInterval:f=e.pollingInterval,strict:d}){const l=typeof u<"u"?u:typeof o=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="fallback"&&e.transport.transports[0].config.type==="webSocket"),p=d??!1;return l?(()=>{const h=N(["watchEvent",t,r,n,e.uid,a,f,o]);return G(h,{onLogs:c,onError:i},y=>{let w;o!==void 0&&(w=o-1n);let v,P=!1;const k=Ie(async()=>{if(!P){try{v=await x(e,Gr,"createEventFilter")({address:t,args:r,event:a,events:s,strict:p,fromBlock:o})}catch{}P=!0;return}try{let E;if(v)E=await x(e,Ye,"getFilterChanges")({filter:v});else{const A=await x(e,Se,"getBlockNumber")({});w&&w!==A?E=await x(e,Ft,"getLogs")({address:t,args:r,event:a,events:s,fromBlock:w+1n,toBlock:A}):E=[],w=A}if(E.length===0)return;if(n)y.onLogs(E);else for(const A of E)y.onLogs([A])}catch(E){v&&E instanceof X&&(P=!1),y.onError?.(E)}},{emitOnBegin:!0,interval:f});return async()=>{v&&await x(e,Qe,"uninstallFilter")({filter:v}),k()}})})():(()=>{let h=!0,y=()=>h=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const E=e.transport.transports.find(A=>A.config.type==="webSocket");return E?E.value:e.transport}return e.transport})(),v=s??(a?[a]:void 0);let P=[];v&&(P=[v.flatMap(E=>Ce({abi:[E],eventName:E.name,args:r}))],a&&(P=P[0]));const{unsubscribe:k}=await w.subscribe({params:["logs",{address:t,topics:P}],onData(E){if(!h)return;const A=E.result;try{const{eventName:R,args:T}=Bt({abi:v??[],data:A.data,topics:A.topics,strict:p}),O=Y(A,{args:T,eventName:R});c([O])}catch(R){let T,O;if(R instanceof pe||R instanceof Ve){if(d)return;T=R.abiItem.name,O=R.abiItem.inputs?.some(I=>!("name"in I&&I.name))}const F=Y(A,{args:O?[]:{},eventName:T});c([F])}},onError(E){i?.(E)}});y=k,h||y()}catch(w){i?.(w)}})(),()=>y()})()}function eo(e,{batch:t=!0,onError:r,onTransactions:n,poll:a,pollingInterval:s=e.pollingInterval}){return(typeof a<"u"?a:e.transport.type!=="webSocket")?(()=>{const u=N(["watchPendingTransactions",e.uid,t,s]);return G(u,{onTransactions:n,onError:r},f=>{let d;const l=Ie(async()=>{try{if(!d)try{d=await x(e,Hr,"createPendingTransactionFilter")({});return}catch(m){throw l(),m}const p=await x(e,Ye,"getFilterChanges")({filter:d});if(p.length===0)return;if(t)f.onTransactions(p);else for(const m of p)f.onTransactions([m])}catch(p){f.onError?.(p)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await x(e,Qe,"uninstallFilter")({filter:d}),l()}})})():(()=>{let u=!0,f=()=>u=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(l){if(!u)return;const p=l.result;n([p])},onError(l){r?.(l)}});f=d,u||f()}catch(d){r?.(d)}})(),()=>f()})()}function to(e){const{scheme:t,statement:r,...n}=e.match(ro)?.groups??{},{chainId:a,expirationTime:s,issuedAt:o,notBefore:i,requestId:c,...u}=e.match(no)?.groups??{},f=e.split("Resources:")[1]?.split(`
- `).slice(1);return{...n,...u,...a?{chainId:Number(a)}:{},...s?{expirationTime:new Date(s)}:{},...o?{issuedAt:new Date(o)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...f?{resources:f}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}const ro=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,no=/(?: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>.+))?/;function ao(e){const{address:t,domain:r,message:n,nonce:a,scheme:s,time:o=new Date}=e;if(r&&n.domain!==r||a&&n.nonce!==a||s&&n.scheme!==s||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o<n.notBefore)return!1;try{if(!n.address||t&&!Ur(n.address,t))return!1}catch{return!1}return!0}async function so(e,t){const{address:r,domain:n,message:a,nonce:s,scheme:o,signature:i,time:c=new Date,...u}=t,f=to(a);if(!f.address||!ao({address:r,domain:n,message:f,nonce:s,scheme:o,time:c}))return!1;const l=Xr(a);return It(e,{address:f.address,hash:l,signature:i,...u})}function oo(e){return{call:t=>$e(e,t),createBlockFilter:()=>ms(e),createContractEventFilter:t=>Pr(e,t),createEventFilter:t=>Gr(e,t),createPendingTransactionFilter:()=>Hr(e),estimateContractGas:t=>Ta(e,t),estimateGas:t=>Rt(e,t),getBalance:t=>ys(e,t),getBlobBaseFee:()=>gs(e),getBlock:t=>_(e,t),getBlockNumber:t=>Se(e,t),getBlockTransactionCount:t=>ws(e,t),getBytecode:t=>vs(e,t),getChainId:()=>Cr(e),getContractEvents:t=>Ir(e,t),getEnsAddress:t=>es(e,t),getEnsAvatar:t=>ps(e,t),getEnsName:t=>bs(e,t),getEnsResolver:t=>hs(e,t),getEnsText:t=>Lr(e,t),getFeeHistory:t=>Es(e,t),estimateFeesPerGas:t=>xa(e,t),getFilterChanges:t=>Ye(e,t),getFilterLogs:t=>xs(e,t),getGasPrice:()=>kt(e),getLogs:t=>Ft(e,t),getProof:t=>Ls(e,t),estimateMaxPriorityFeePerGas:t=>Ea(e,t),getStorageAt:t=>Gs(e,t),getTransaction:t=>$t(e,t),getTransactionConfirmations:t=>Hs(e,t),getTransactionCount:t=>jr(e,t),getTransactionReceipt:t=>ht(e,t),multicall:t=>Us(e,t),prepareTransactionRequest:t=>$r(e,t),readContract:t=>L(e,t),sendRawTransaction:t=>La(e,t),simulateContract:t=>$a(e,t),verifyMessage:t=>Zs(e,t),verifySiweMessage:t=>so(e,t),verifyTypedData:t=>Ys(e,t),uninstallFilter:t=>Qe(e,t),waitForTransactionReceipt:t=>Qs(e,t),watchBlocks:t=>Xs(e,t),watchBlockNumber:t=>Kr(e,t),watchContractEvent:t=>_a(e,t),watchEvent:t=>Ks(e,t),watchPendingTransactions:t=>eo(e,t)}}function fo(e){const{key:t="public",name:r="Public Client"}=e;return Ha({...e,key:t,name:r,type:"publicClient"}).extend(oo)}export{Tn as AbiConstructorNotFoundError,Jt as AbiConstructorParamsNotFoundError,mr as AbiDecodingDataSizeTooSmallError,We as AbiDecodingZeroDataError,kn as AbiEncodingArrayLengthMismatchError,Rn as AbiEncodingBytesSizeMismatchError,Bn as AbiEncodingLengthMismatchError,yr as AbiErrorSignatureNotFoundError,Zt as AbiEventNotFoundError,On as AbiEventSignatureEmptyTopicsError,gr as AbiEventSignatureNotFoundError,Le as AbiFunctionNotFoundError,Fn as AbiFunctionOutputsNotFoundError,ua as AccountStateConflictError,g as BaseError,va as BaseFeeScalarError,Fr as BlockNotFoundError,jn as BytesSizeMismatchError,Tr as CallExecutionError,Re as ChainDisconnectedError,st as ChainDoesNotSupportContract,pr as ClientChainNotConfiguredError,fa as ContractFunctionExecutionError,ut as ContractFunctionRevertedError,pa as ContractFunctionZeroDataError,pe as DecodeLogDataMismatch,Ve as DecodeLogTopicsMismatch,Tt as Eip1559FeesNotSupportedError,le as EnsAvatarInvalidNftUriError,rs as EnsAvatarUnsupportedNamespaceError,jt as EnsAvatarUriResolutionError,ya as EstimateGasExecutionError,Me as ExecutionRevertedError,nt as FeeCapTooHighError,qt as FeeCapTooLowError,pn as FeeConflictError,Mn as FilterTypeNotSupportedError,J as HttpRequestError,Lt as InsufficientFundsError,ho as IntegerOutOfRangeError,Q as InternalRpcError,Gt as IntrinsicGasTooHighError,Ht as IntrinsicGasTooLowError,$n as InvalidAbiDecodingTypeError,Cn as InvalidAbiEncodingTypeError,Z as InvalidAddressError,In as InvalidArrayError,nn as InvalidBytesBooleanError,No as InvalidChainIdError,Sn as InvalidDefinitionTypeError,mo as InvalidHexBooleanError,X as InvalidInputRpcError,jo as InvalidLegacyVError,ge as InvalidParamsRpcError,me as InvalidRequestRpcError,Co as InvalidSerializableTransactionError,$o as InvalidStorageKeySizeError,xe as JsonRpcVersionUnsupportedError,ae as LimitExceededRpcError,Pa as MaxFeePerGasTooLowError,ye as MethodNotFoundRpcError,Ee as MethodNotSupportedRpcError,_t as NonceMaxValueError,Dt as NonceTooHighError,zt as NonceTooLowError,he as ParseRpcError,ke as ProviderDisconnectedError,ie as ProviderRpcError,xt as RawContractError,we as ResourceNotFoundRpcError,ve as ResourceUnavailableRpcError,j as RpcError,kr as RpcRequestError,yo as SizeExceedsPaddingSizeError,go as SizeOverflowError,wo as SliceOffsetOutOfBoundsError,da as StateAssignmentConflictError,Be as SwitchChainError,tr as TimeoutError,at as TipAboveFeeCapError,br as TransactionNotFoundError,hr as TransactionReceiptNotFoundError,Pe as TransactionRejectedRpcError,Ut as TransactionTypeNotSupportedError,Ae as UnauthorizedProviderError,yt as UnknownNodeError,ha as UnknownRpcError,Te as UnsupportedProviderMethodError,Ja as UrlRequiredError,te as UserRejectedRequestError,Wt as WaitForTransactionReceiptTimeoutError,At as assertRequest,Io as assertTransactionEIP1559,So as assertTransactionEIP2930,Mo as assertTransactionLegacy,bn as blobsToCommitments,mn as blobsToProofs,vo as boolToBytes,tn as boolToHex,Kn as bytesToBigInt,ea as bytesToBool,S as bytesToHex,D as bytesToNumber,ta as bytesToString,Vr as ccipFetch,Vr as ccipRequest,ln as checksumAddress,qo as commitmentToVersionedHash,hn as commitmentsToVersionedHashes,M as concat,Do as concatBytes,dr as concatHex,Ha as createClient,fo as createPublicClient,Va as createTransport,Ze as decodeAbiParameters,xr as decodeErrorResult,Bt as decodeEventLog,ce as decodeFunctionResult,zo as defineBlock,_o as defineChain,Lo as defineTransaction,Go as defineTransactionReceipt,Ho as defineTransactionRequest,oe as encodeAbiParameters,qs as encodeDeployData,Ce as encodeEventTopics,K as encodeFunctionData,Po as etherUnits,lo as extractChain,lr as formatBlock,ur as formatEther,V as formatGwei,Y as formatLog,vn as formatTransaction,Pn as formatTransactionReceipt,fr as formatTransactionRequest,Eo as formatUnits,xo as fromHex,je as getAbiItem,ue as getChainContractAddress,Oe as getContractError,gt as getEventSelector,_n as getEventSignature,Et as getFunctionSelector,_n as getFunctionSignature,gn as getTransactionType,Ms as getTypesForEIP712Domain,Ao as gweiUnits,Cs as hashDomain,Xr as hashMessage,js as hashTypedData,fe as hexToBigInt,To as hexToBool,an as hexToBytes,Fe as hexToNumber,ko as hexToString,uo as http,q as isAddress,Ur as isAddressEqual,ne as isHex,$ as keccak256,Ka as labelhash,Uo as maxUint16,lt as multicall3Abi,ze as namehash,Ro as numberToBytes,B as numberToHex,Bs as offchainLookup,Wr as offchainLookupAbiItem,Rs as offchainLookupSignature,Bo as pad,Oo as padBytes,U as padHex,Ot as parseEventLogs,Yn as prepareEncodeFunctionData,Ds as presignMessagePrefix,oo as publicActions,Wo as rpcTransactionType,Vo as serializeAccessList,Js as serializeSignature,Jo as serializeTransaction,Zo as sha256,Js as signatureToHex,C as size,_e as slice,fn as sliceBytes,Yo as sliceHex,W as stringToBytes,rn as stringToHex,N as stringify,yn as toBlobSidecars,Qo as toBlobs,re as toBytes,wr as toEventHash,gt as toEventSelector,_n as toEventSignature,wr as toFunctionHash,Et as toFunctionSelector,_n as toFunctionSignature,se as toHex,Xo as toRlp,Ko as transactionType,He as trim,Ss as validateTypedData,bt as withRetry,Za as withTimeout};
