@tuwaio/satellite-evm 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +21 -37
- package/dist/index.d.ts +21 -37
- package/dist/index.js +1 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -18
- package/dist/_esm-4WQYADT7.mjs +0 -10
- package/dist/_esm-4WQYADT7.mjs.map +0 -1
- package/dist/ccip-NIHGPDTQ.mjs +0 -2
- package/dist/ccip-NIHGPDTQ.mjs.map +0 -1
- package/dist/chunk-6R4Y2ZVK.mjs +0 -2
- package/dist/chunk-6R4Y2ZVK.mjs.map +0 -1
- package/dist/chunk-J3JCN55Z.mjs +0 -36
- package/dist/chunk-J3JCN55Z.mjs.map +0 -1
- package/dist/chunk-LHUJBWEN.mjs +0 -9
- package/dist/chunk-LHUJBWEN.mjs.map +0 -1
- package/dist/secp256k1-P3GTARIT.mjs +0 -10
- package/dist/secp256k1-P3GTARIT.mjs.map +0 -1
package/dist/ccip-NIHGPDTQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"ccip-NIHGPDTQ.mjs"}
|
package/dist/chunk-6R4Y2ZVK.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:true});},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:true}):c,a));export{m as a,n as b,o as c,p as d};//# sourceMappingURL=chunk-6R4Y2ZVK.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-6R4Y2ZVK.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-6R4Y2ZVK.mjs"}
|
package/dist/chunk-J3JCN55Z.mjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {a,s,r,f,k as k$1,o,i,p,g as g$1,j as j$1,l,b as b$1,c,d,e}from'./chunk-LHUJBWEN.mjs';var cr="1.1.0";var x=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${cr}`].join(`
|
|
2
|
-
`);super(i),Object.defineProperty(this,"details",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t;}};function I(e,t){return e.exec(t)?.groups}var _t=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Wt=/^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)?$/,Ue=/^\(.+?\).*?$/;var fr=/^tuple(?<array>(\[(\d*)\])*)$/;function He(e){let t=e.type;if(fr.test(e.type)&&"components"in e){t="(";let n=e.components.length;for(let o=0;o<n;o++){let i=e.components[o];t+=He(i),o<n-1&&(t+=", ");}let r=I(fr,e.type);return t+=`)${r?.array??""}`,He({...e,type:t})}return "indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function oe(e){let t="",n=e.length;for(let r=0;r<n;r++){let o=e[r];t+=He(o),r!==n-1&&(t+=", ");}return t}function qt(e){return e.type==="function"?`function ${e.name}(${oe(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${oe(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${oe(e.inputs)})`:e.type==="error"?`error ${e.name}(${oe(e.inputs)})`:e.type==="constructor"?`constructor(${oe(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var pr=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function dr(e){return pr.test(e)}function lr(e){return I(pr,e)}var mr=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function br(e){return mr.test(e)}function yr(e){return I(mr,e)}var hr=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function xr(e){return hr.test(e)}function gr(e){return I(hr,e)}var wr=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Ne(e){return wr.test(e)}function vr(e){return I(wr,e)}var $r=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Ar(e){return $r.test(e)}function Pr(e){return I($r,e)}var Ir=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Mr(e){return Ir.test(e)}function Er(e){return I(Ir,e)}var Ko=/^receive\(\) external payable$/;function Tr(e){return Ko.test(e)}var Sr=new Set(["indexed"]),Le=new Set(["calldata","memory","storage"]);var De=class extends x{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"UnknownTypeError"});}},Ge=class extends x{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"UnknownSolidityTypeError"});}};var Ve=class extends x{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidParameterError"});}},_e=class extends x{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"SolidityProtectedKeywordError"});}},We=class extends x{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidModifierError"});}},qe=class extends x{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidFunctionModifierError"});}},Ze=class extends x{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidAbiTypeParameterError"});}};var j=class extends x{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidSignatureError"});}},Je=class extends x{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"UnknownSignatureError"});}},Ke=class extends x{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidStructSignatureError"});}};var Xe=class extends x{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"CircularReferenceError"});}};var Ye=class extends x{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"InvalidParenthesisError"});}};function Br(e,t,n){let r="";if(n)for(let o of Object.entries(n)){if(!o)continue;let i="";for(let s of o[1])i+=`[${s.type}${s.name?`:${s.name}`:""}]`;r+=`(${o[0]}{${i}})`;}return t?`${t}:${e}${r}`:e}var Qe=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:true}],["event:address indexed to",{type:"address",name:"to",indexed:true}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:true}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:true}]]);function Rr(e,t={}){if(xr(e))return Xo(e,t);if(br(e))return Yo(e,t);if(dr(e))return Qo(e,t);if(Ar(e))return es(e,t);if(Mr(e))return ts(e);if(Tr(e))return {type:"receive",stateMutability:"payable"};throw new Je({signature:e})}function Xo(e,t={}){let n=gr(e);if(!n)throw new j({signature:e,type:"function"});let r=T(n.parameters),o=[],i=r.length;for(let a=0;a<i;a++)o.push(V(r[a],{modifiers:Le,structs:t,type:"function"}));let s=[];if(n.returns){let a=T(n.returns),c=a.length;for(let f=0;f<c;f++)s.push(V(a[f],{modifiers:Le,structs:t,type:"function"}));}return {name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:s}}function Yo(e,t={}){let n=yr(e);if(!n)throw new j({signature:e,type:"event"});let r=T(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(V(r[s],{modifiers:Sr,structs:t,type:"event"}));return {name:n.name,type:"event",inputs:o}}function Qo(e,t={}){let n=lr(e);if(!n)throw new j({signature:e,type:"error"});let r=T(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(V(r[s],{structs:t,type:"error"}));return {name:n.name,type:"error",inputs:o}}function es(e,t={}){let n=Pr(e);if(!n)throw new j({signature:e,type:"constructor"});let r=T(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(V(r[s],{structs:t,type:"constructor"}));return {type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function ts(e){let t=Er(e);if(!t)throw new j({signature:e,type:"fallback"});return {type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}var ns=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,rs=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,os=/^u?int$/;function V(e,t){let n=Br(e,t?.type,t?.structs);if(Qe.has(n))return Qe.get(n);let r=Ue.test(e),o=I(r?rs:ns,e);if(!o)throw new Ve({param:e});if(o.name&&is(o.name))throw new _e({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:true}:{},a=t?.structs??{},c,f={};if(r){c="tuple";let m=T(o.type),l=[],d=m.length;for(let y=0;y<d;y++)l.push(V(m[y],{structs:a}));f={components:l};}else if(o.type in a)c="tuple",f={components:a[o.type]};else if(os.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,t?.type!=="struct"&&!Zt(c))throw new Ge({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new We({param:e,type:t?.type,modifier:o.modifier});if(Le.has(o.modifier)&&!as(c,!!o.array))throw new qe({param:e,type:t?.type,modifier:o.modifier})}let p={type:`${c}${o.array??""}`,...i,...s,...f};return Qe.set(n,p),p}function T(e,t=[],n="",r=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case ",":return r===0?T(a,[...t,n.trim()]):T(a,t,`${n}${s}`,r);case "(":return T(a,t,`${n}${s}`,r+1);case ")":return T(a,t,`${n}${s}`,r-1);default:return T(a,t,`${n}${s}`,r)}}if(n==="")return t;if(r!==0)throw new Ye({current:n,depth:r});return t.push(n.trim()),t}function Zt(e){return e==="address"||e==="bool"||e==="function"||e==="string"||_t.test(e)||Wt.test(e)}var ss=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function is(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||_t.test(e)||Wt.test(e)||ss.test(e)}function as(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function jr(e){let t={},n=e.length;for(let s=0;s<n;s++){let a=e[s];if(!Ne(a))continue;let c=vr(a);if(!c)throw new j({signature:a,type:"struct"});let f=c.properties.split(";"),p=[],m=f.length;for(let l=0;l<m;l++){let y=f[l].trim();if(!y)continue;let P=V(y,{type:"struct"});p.push(P);}if(!p.length)throw new Ke({signature:a});t[c.name]=p;}let r={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,c]=o[s];r[a]=Or(c,t);}return r}var us=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function Or(e,t,n=new Set){let r=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(Ue.test(s.type))r.push(s);else {let c=I(us,s.type);if(!c?.type)throw new Ze({abiParameter:s});let{array:f,type:p}=c;if(p in t){if(n.has(p))throw new Xe({type:p});r.push({...s,type:`tuple${f??""}`,components:Or(t[p]??[],t,new Set([...n,p]))});}else if(Zt(p))r.push(s);else throw new De({type:p})}}return r}function et(e){let t=jr(e),n=[],r=e.length;for(let o=0;o<r;o++){let i=e[o];Ne(i)||n.push(Rr(i,t));}return n}var zr="0.1.1";function Fr(){return zr}var Ie=class e extends Error{constructor(t,n={}){let r=(()=>{if(n.cause instanceof e){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,s=`https://oxlib.sh${o??""}`,a=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o?["",r?`Details: ${r}`:void 0,o?`See: ${s}`:void 0]:[]].filter(c=>typeof c=="string").join(`
|
|
3
|
-
`);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"docs",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"cause",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:true,configurable:true,writable:true,value:`ox@${Fr()}`}),this.cause=n.cause,this.details=r,this.docs=s,this.docsPath=o,this.shortMessage=t;}walk(t){return kr(this,t)}};function kr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?kr(e.cause,t):t?null:e}function Cr(e,t={}){let{dir:n,size:r=32}=t;if(r===0)return e;let o=e.replace("0x","");if(o.length>r*2)throw new tt({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return `0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}function S(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let f=typeof e=="bigint"?"n":"";throw new Kt({max:i?`${i}${f}`:void 0,min:`${s}${f}`,signed:n,size:r,value:`${e}${f}`})}let c=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?ps(c,r):c}function ps(e,t){return Cr(e,{dir:"left",size:t})}var Kt=class extends Ie{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number \`${i}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"Hex.IntegerOutOfRangeError"});}};var tt=class extends Ie{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"Hex.SizeExceedsPaddingSizeError"});}};function Ur(e){return {address:e.address,amount:S(e.amount),index:S(e.index),validatorIndex:S(e.validatorIndex)}}function Hr(e){return {...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:S(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:S(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:S(e.gasLimit)},...typeof e.number=="bigint"&&{number:S(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:S(e.prevRandao)},...typeof e.time=="bigint"&&{time:S(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(Ur)}}}function se(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var Xt=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],nt=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}];var Lr="0x82ad56cb";var Dr="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Gr="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";var Vr="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";var Yt="2.37.8";var Qt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Yt}`};var u=class e extends Error{constructor(t,n={}){let r=n.cause instanceof e?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof e&&n.cause.docsPath||n.docsPath,i=Qt.getDocsUrl?.({...n,docsPath:o}),s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...Qt.version?[`Version: ${Qt.version}`]:[]].join(`
|
|
4
|
-
`);super(s,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"version",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Yt;}walk(t){return _r(this,t)}};function _r(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?_r(e.cause,t):t?null:e}var Y=class extends u{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"});}};var Me=class extends u{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"});}};var rt={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Wr={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function B(e,{includeName:t=false}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new st(e.type);return `${e.name}(${ot(e.inputs,{includeName:t})})`}function ot(e,{includeName:t=false}={}){return e?e.map(n=>ms(n,{includeName:t})).join(t?", ":","):""}function ms(e,{includeName:t}){return e.type.startsWith("tuple")?`(${ot(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function M(e,{strict:t=true}={}){return !e||typeof e!="string"?false:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function h(e){return M(e,{strict:false})?Math.ceil((e.length-2)/2):e.length}var it=class extends u{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
5
|
-
`),{docsPath:t,name:"AbiConstructorNotFoundError"});}},Ee=class extends u{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
6
|
-
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"});}};var at=class extends u{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
7
|
-
`),{metaMessages:[`Params: (${ot(n,{includeName:true})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"params",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"size",{enumerable:true,configurable:true,writable:true,value:void 0}),this.data=t,this.params=n,this.size=r;}},ie=class extends u{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"});}},ut=class extends u{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
|
|
8
|
-
`),{name:"AbiEncodingArrayLengthMismatchError"});}},ct=class extends u{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${h(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"});}},ft=class extends u{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
|
|
9
|
-
`),{name:"AbiEncodingLengthMismatchError"});}},pt=class extends u{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
10
|
-
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"});}},Te=class extends u{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
11
|
-
`),{docsPath:n,name:"AbiErrorNotFoundError"});}},dt=class extends u{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
|
|
12
|
-
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:true,configurable:true,writable:true,value:void 0}),this.signature=t;}};var R=class extends u{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
13
|
-
`),{docsPath:n,name:"AbiFunctionNotFoundError"});}},ae=class extends u{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
14
|
-
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"});}},lt=class extends u{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
|
|
15
|
-
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"});}},mt=class extends u{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${B(t.abiItem)}\`, and`,`\`${n.type}\` in \`${B(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"});}};var bt=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
16
|
-
`),{docsPath:n,name:"InvalidAbiEncodingType"});}},yt=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
17
|
-
`),{docsPath:n,name:"InvalidAbiDecodingType"});}},ue=class extends u{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
18
|
-
`),{name:"InvalidArrayError"});}},st=class extends u{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
19
|
-
`),{name:"InvalidDefinitionTypeError"});}};var Se=class extends u{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"});}},Be=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"});}},Re=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"});}};function O(e,t,n,{strict:r}={}){return M(e,{strict:false})?bs(e,t,n,{strict:r}):en(e,t,n,{strict:r})}function qr(e,t){if(typeof t=="number"&&t>0&&t>h(e)-1)throw new Se({offset:t,position:"start",size:h(e)})}function Zr(e,t,n){if(typeof t=="number"&&typeof n=="number"&&h(e)!==n-t)throw new Se({offset:n,position:"end",size:h(e)})}function en(e,t,n,{strict:r}={}){qr(e,t);let o=e.slice(t,n);return r&&Zr(o,t,n),o}function bs(e,t,n,{strict:r}={}){qr(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Zr(o,t,n),o}function _(e,{dir:t,size:n=32}={}){return typeof e=="string"?U(e,{dir:t,size:n}):ys(e,{dir:t,size:n})}function U(e,{dir:t,size:n=32}={}){if(n===null)return e;let r=e.replace("0x","");if(r.length>n*2)throw new Be({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return `0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function ys(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Be({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let o=0;o<n;o++){let i=t==="right";r[i?o:n-o-1]=e[i?o:e.length-o-1];}return r}var ce=class extends u{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"});}},ht=class extends u{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"});}},xt=class extends u{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"});}};var gt=class extends u{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"});}};function z(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function v(e,{size:t}){if(h(e)>t)throw new gt({givenSize:h(e),maxSize:t})}function K0(e,t){let n=typeof t=="string"?{to:t}:t,r=n.to;return r==="number"?tn(e,n):r==="bigint"?wt(e,n):r==="string"?xs(e,n):r==="boolean"?hs(e,n):Q(e,n)}function wt(e,t={}){let{signed:n}=t;t.size&&v(e,{size:t.size});let r=BigInt(e);if(!n)return r;let o=(e.length-2)/2,i=(1n<<BigInt(o)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function hs(e,t={}){let n=e;if(t.size&&(v(n,{size:t.size}),n=z(n)),z(n)==="0x00")return false;if(z(n)==="0x01")return true;throw new xt(n)}function tn(e,t={}){return Number(wt(e,t))}function xs(e,t={}){let n=Q(e);return t.size&&(v(n,{size:t.size}),n=z(n,{dir:"right"})),new TextDecoder().decode(n)}var gs=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Jr(e,t={}){return typeof e=="number"||typeof e=="bigint"?b(e,t):typeof e=="string"?rn(e,t):typeof e=="boolean"?nn(e,t):E(e,t)}function nn(e,t={}){let n=`0x${Number(e)}`;return typeof t.size=="number"?(v(n,{size:t.size}),_(n,{size:t.size})):n}function E(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=gs[e[o]];let r=`0x${n}`;return typeof t.size=="number"?(v(r,{size:t.size}),_(r,{dir:"right",size:t.size})):r}function b(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let c=typeof e=="bigint"?"n":"";throw new ce({max:i?`${i}${c}`:void 0,min:`${s}${c}`,signed:n,size:r,value:`${e}${c}`})}let a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?_(a,{size:r}):a}var ws=new TextEncoder;function rn(e,t={}){let n=ws.encode(e);return E(n,t)}var vs=new TextEncoder;function vt(e,t={}){return typeof e=="number"||typeof e=="bigint"?As(e,t):typeof e=="boolean"?$s(e,t):M(e)?Q(e,t):on(e,t)}function $s(e,t={}){let n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(v(n,{size:t.size}),_(n,{size:t.size})):n}var H={zero:48,nine:57,A:65,F:70,a:97,f:102};function Kr(e){if(e>=H.zero&&e<=H.nine)return e-H.zero;if(e>=H.A&&e<=H.F)return e-(H.A-10);if(e>=H.a&&e<=H.f)return e-(H.a-10)}function Q(e,t={}){let n=e;t.size&&(v(n,{size:t.size}),n=_(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);let o=r.length/2,i=new Uint8Array(o);for(let s=0,a=0;s<o;s++){let c=Kr(r.charCodeAt(a++)),f=Kr(r.charCodeAt(a++));if(c===void 0||f===void 0)throw new u(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[s]=c*16+f;}return i}function As(e,t){let n=b(e,t);return Q(n)}function on(e,t={}){let n=vs.encode(e);return typeof t.size=="number"?(v(n,{size:t.size}),_(n,{dir:"right",size:t.size})):n}var Ps=BigInt(0),je=BigInt(1),Is=BigInt(2),Ms=BigInt(7),Es=BigInt(256),Ts=BigInt(113),Qr=[],eo=[],to=[];for(let e=0,t=je,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Qr.push(2*(5*r+n)),eo.push((e+1)*(e+2)/2%64);let o=Ps;for(let i=0;i<7;i++)t=(t<<je^(t>>Ms)*Ts)%Es,t&Is&&(o^=je<<(je<<BigInt(i))-je);to.push(o);}var no=a(to,true),Ss=no[0],Bs=no[1],Xr=(e,t,n)=>n>32?d(e,t,n):b$1(e,t,n),Yr=(e$1,t,n)=>n>32?e(e$1,t,n):c(e$1,t,n);function Rs(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,f=n[c],p=n[c+1],m=Xr(f,p,1)^n[a],l=Yr(f,p,1)^n[a+1];for(let d=0;d<50;d+=10)e[s+d]^=m,e[s+d+1]^=l;}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=eo[s],c=Xr(o,i,a),f=Yr(o,i,a),p=Qr[s];o=e[p],i=e[p+1],e[p]=c,e[p+1]=f;}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10];}e[0]^=Ss[r],e[1]^=Bs[r];}l(n);}var sn=class e extends r{constructor(t,n,r,o=false,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=false,this.destroyed=false,this.enableXOF=false,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,f(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=k$1(this.state);}clone(){return this._cloneInto()}keccak(){o(this.state32),Rs(this.state32,this.rounds),o(this.state32),this.posOut=0,this.pos=0;}update(t){i(this),t=p(t),g$1(t);let{blockLen:n,state:r}=this,o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak();}return this}finish(){if(this.finished)return;this.finished=true;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,(n&128)!==0&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak();}writeInto(t){i(this,false),g$1(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s;}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return f(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(j$1(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true,l(this.state);}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new e(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},js=(e,t,n)=>s(()=>new sn(t,e,n));var ro=js(1,136,256/8);function $t(e,t){let n=t||"hex",r=ro(M(e,{strict:false})?vt(e):e);return n==="bytes"?r:Jr(r)}var Os=e=>$t(vt(e));function oo(e){return Os(e)}function so(e){let t=true,n="",r=0,o="",i=false;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=true),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=true;break}continue}if(a===" "){e[s-1]!==","&&n!==","&&n!==",("&&(n="",t=false);continue}o+=a,n+=a;}}if(!i)throw new u("Unable to normalize signature.");return o}var io=e=>{let t=typeof e=="string"?e:qt(e);return so(t)};function At(e){return oo(io(e))}var F=e=>O(At(e),0,4);var A=class extends u{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"});}};var fe=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:true,configurable:true,writable:true,value:void 0}),this.maxSize=t;}get(t){let n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){let r=this.keys().next().value;r&&this.delete(r);}return this}};var zs=/^0x[a-fA-F0-9]{40}$/,an=new fe(8192);function g(e,t){let{strict:n=true}=t??{},r=`${e}.${n}`;if(an.has(r))return an.get(r);let o=zs.test(e)?e.toLowerCase()===e?true:n?Oe(e)===e:true:false;return an.set(r,o),o}var un=new fe(8192);function Oe(e,t){if(un.has(`${e}.${t}`))return un.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=$t(on(n),"bytes"),o=(t?n.substring(`${t}0x`.length):n).split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&o[s]&&(o[s]=o[s].toUpperCase()),(r[s>>1]&15)>=8&&o[s+1]&&(o[s+1]=o[s+1].toUpperCase());let i=`0x${o.join("")}`;return un.set(`${e}.${t}`,i),i}function Da(e,t){if(!g(e,{strict:false}))throw new A({address:e});return Oe(e,t)}var ze=class extends u{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"});}},Pt=class extends u{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"});}},It=class extends u{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"});}};var Fs={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new It({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new Pt({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ze({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t;},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ze({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t;},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++;},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length;},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++;},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2;},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3;},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4;},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++;}};function ao(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(Fs);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function uo(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=E(e,t);return wt(n,t)}function co(e,t={}){let n=e;if(typeof t.size<"u"&&(v(n,{size:t.size}),n=z(n)),n.length>1||n[0]>1)throw new ht(n);return !!n[0]}function k(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=E(e,t);return tn(n,t)}function fo(e,t={}){let n=e;return typeof t.size<"u"&&(v(n,{size:t.size}),n=z(n,{dir:"right"})),new TextDecoder().decode(n)}function N(e){return typeof e[0]=="string"?ee(e):ks(e)}function ks(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function ee(e){return `0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}var po=/^(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 C(e,t){if(e.length!==t.length)throw new ft({expectedLength:e.length,givenLength:t.length});let n=Cs({params:e,values:t}),r=fn(n);return r.length===0?"0x":r}function Cs({params:e,values:t}){let n=[];for(let r=0;r<e.length;r++)n.push(cn({param:e[r],value:t[r]}));return n}function cn({param:e,value:t}){let n=Mt(e.type);if(n){let[r,o]=n;return Hs(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Vs(t,{param:e});if(e.type==="address")return Us(t);if(e.type==="bool")return Ls(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int"),[,,o="256"]=po.exec(e.type)??[];return Ds(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return Ns(t,{param:e});if(e.type==="string")return Gs(t);throw new bt(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function fn(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?t+=32:t+=h(a);}let n=[],r=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?(n.push(b(t+o,{size:32})),r.push(a),o+=h(a)):n.push(a);}return N([...n,...r])}function Us(e){if(!g(e))throw new A({address:e});return {dynamic:false,encoded:U(e.toLowerCase())}}function Hs(e,{length:t,param:n}){let r=t===null;if(!Array.isArray(e))throw new ue(e);if(!r&&e.length!==t)throw new ut({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=false,i=[];for(let s=0;s<e.length;s++){let a=cn({param:n,value:e[s]});a.dynamic&&(o=true),i.push(a);}if(r||o){let s=fn(i);if(r){let a=b(i.length,{size:32});return {dynamic:true,encoded:i.length>0?N([a,s]):a}}if(o)return {dynamic:true,encoded:s}}return {dynamic:false,encoded:N(i.map(({encoded:s})=>s))}}function Ns(e,{param:t}){let[,n]=t.type.split("bytes"),r=h(e);if(!n){let o=e;return r%32!==0&&(o=U(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:true,encoded:N([U(b(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new ct({expectedSize:Number.parseInt(n,10),value:e});return {dynamic:false,encoded:U(e,{dir:"right"})}}function Ls(e){if(typeof e!="boolean")throw new u(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return {dynamic:false,encoded:U(nn(e))}}function Ds(e,{signed:t,size:n=256}){if(typeof n=="number"){let r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new ce({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return {dynamic:false,encoded:b(e,{size:32,signed:t})}}function Gs(e){let t=rn(e),n=Math.ceil(h(t)/32),r=[];for(let o=0;o<n;o++)r.push(U(O(t,o*32,(o+1)*32),{dir:"right"}));return {dynamic:true,encoded:N([U(b(h(t),{size:32})),...r])}}function Vs(e,{param:t}){let n=false,r=[];for(let o=0;o<t.components.length;o++){let i=t.components[o],s=Array.isArray(e)?o:i.name,a=cn({param:i,value:e[s]});r.push(a),a.dynamic&&(n=true);}return {dynamic:n,encoded:n?fn(r):N(r.map(({encoded:o})=>o))}}function Mt(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function de(e,t){let n=typeof t=="string"?Q(t):t,r=ao(n);if(h(n)===0&&e.length>0)throw new ie;if(h(t)&&h(t)<32)throw new at({data:typeof t=="string"?t:E(t),params:e,size:h(t)});let o=0,i=[];for(let s=0;s<e.length;++s){let a=e[s];r.setPosition(o);let[c,f]=pe(r,a,{staticPosition:0});o+=f,i.push(c);}return i}function pe(e,t,{staticPosition:n}){let r=Mt(t.type);if(r){let[o,i]=r;return Ws(e,{...t,type:i},{length:o,staticPosition:n})}if(t.type==="tuple")return Ks(e,t,{staticPosition:n});if(t.type==="address")return _s(e);if(t.type==="bool")return qs(e);if(t.type.startsWith("bytes"))return Zs(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Js(e,t);if(t.type==="string")return Xs(e,{staticPosition:n});throw new yt(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}var lo=32,pn=32;function _s(e){let t=e.readBytes(32);return [Oe(E(en(t,-20))),32]}function Ws(e,t,{length:n,staticPosition:r}){if(!n){let s=k(e.readBytes(pn)),a=r+s,c=a+lo;e.setPosition(a);let f=k(e.readBytes(lo)),p=Fe(t),m=0,l=[];for(let d=0;d<f;++d){e.setPosition(c+(p?d*32:m));let[y,P]=pe(e,t,{staticPosition:c});m+=P,l.push(y);}return e.setPosition(r+32),[l,32]}if(Fe(t)){let s=k(e.readBytes(pn)),a=r+s,c=[];for(let f=0;f<n;++f){e.setPosition(a+f*32);let[p]=pe(e,t,{staticPosition:a});c.push(p);}return e.setPosition(r+32),[c,32]}let o=0,i=[];for(let s=0;s<n;++s){let[a,c]=pe(e,t,{staticPosition:r+o});o+=c,i.push(a);}return [i,o]}function qs(e){return [co(e.readBytes(32),{size:32}),32]}function Zs(e,t,{staticPosition:n}){let[r,o]=t.type.split("bytes");if(!o){let s=k(e.readBytes(32));e.setPosition(n+s);let a=k(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];let c=e.readBytes(a);return e.setPosition(n+32),[E(c),32]}return [E(e.readBytes(Number.parseInt(o,10),32)),32]}function Js(e,t){let n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return [r>48?uo(o,{signed:n}):k(o,{signed:n}),32]}function Ks(e,t,{staticPosition:n}){let r=t.components.length===0||t.components.some(({name:s})=>!s),o=r?[]:{},i=0;if(Fe(t)){let s=k(e.readBytes(pn)),a=n+s;for(let c=0;c<t.components.length;++c){let f=t.components[c];e.setPosition(a+i);let[p,m]=pe(e,f,{staticPosition:a});i+=m,o[r?c:f?.name]=p;}return e.setPosition(n+32),[o,32]}for(let s=0;s<t.components.length;++s){let a=t.components[s],[c,f]=pe(e,a,{staticPosition:n});o[r?s:a?.name]=c,i+=f;}return [o,i]}function Xs(e,{staticPosition:t}){let n=k(e.readBytes(32)),r=t+n;e.setPosition(r);let o=k(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=fo(z(i));return e.setPosition(t+32),[s,32]}function Fe(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return true;if(t==="tuple")return e.components?.some(Fe);let n=Mt(e.type);return !!(n&&Fe({...e,type:n[1]}))}function mo(e){let{abi:t,data:n}=e,r=O(n,0,4);if(r==="0x")throw new ie;let i=[...t||[],rt,Wr].find(s=>s.type==="error"&&r===F(B(s)));if(!i)throw new dt(r,{docsPath:"/docs/contract/decodeErrorResult"});return {abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?de(i.inputs,O(n,4)):void 0,errorName:i.name}}var W=(e,t,n)=>JSON.stringify(e,(r,o)=>{let i=typeof o=="bigint"?o.toString():o;return typeof t=="function"?t(r,i):i},n);var bo=At;function q(e){let{abi:t,args:n=[],name:r}=e,o=M(r,{strict:false}),i=t.filter(a=>o?a.type==="function"?F(a)===r:a.type==="event"?bo(a)===r:false:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let s;for(let a of i){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((f,p)=>{let m="inputs"in a&&a.inputs[p];return m?dn(f,m):false})){if(s&&"inputs"in s&&s.inputs){let f=yo(a.inputs,s.inputs,n);if(f)throw new mt({abiItem:a,type:f[0]},{abiItem:s,type:f[1]})}s=a;}}return s||i[0]}function dn(e,t){let n=typeof e,r=t.type;switch(r){case "address":return g(e,{strict:false});case "bool":return n==="boolean";case "function":return n==="string";case "string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>dn(Object.values(e)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>dn(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):false}}function yo(e,t,n){for(let r in e){let o=e[r],i=t[r];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return yo(o.components,i.components,n[r]);let s=[o.type,i.type];if(s.includes("address")&&s.includes("bytes20")?true:s.includes("address")&&s.includes("string")?g(n[r],{strict:false}):s.includes("address")&&s.includes("bytes")?g(n[r],{strict:false}):false)return s}}var ho={gwei:9,wei:18},xo={ether:-9,wei:9};function Et(e,t){let n=e.toString(),r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${i?`.${i}`:""}`}function go(e,t="wei"){return Et(e,ho[t])}function L(e,t="wei"){return Et(e,xo[t])}var Tt=class extends u{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"});}},St=class extends u{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"});}};function wo(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
20
|
-
`,"")}function vo(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
|
|
21
|
-
`;return r.nonce&&(o+=` nonce: ${r.nonce}
|
|
22
|
-
`),r.balance&&(o+=` balance: ${r.balance}
|
|
23
|
-
`),r.code&&(o+=` code: ${r.code}
|
|
24
|
-
`),r.state&&(o+=` state:
|
|
25
|
-
`,o+=wo(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
26
|
-
`,o+=wo(r.stateDiff)),o},` State Override:
|
|
27
|
-
`).slice(0,-1)}function $o(e){let t=Object.entries(e).map(([r,o])=>o===void 0||o===false?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
|
|
28
|
-
`)}var Bt=class extends u{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
|
|
29
|
-
`),{name:"FeeConflictError"});}};var te=e=>e;var Rt=class extends u{constructor(t,{account:n,docsPath:r,chain:o,data:i,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:f,nonce:p,to:m,value:l,stateOverride:d}){let y=n?se(n):void 0,P=$o({from:y?.address,to:m,value:typeof l<"u"&&`${go(l)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:typeof a<"u"&&`${L(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${L(c)} gwei`,maxPriorityFeePerGas:typeof f<"u"&&`${L(f)} gwei`,nonce:p});d&&(P+=`
|
|
30
|
-
${vo(d)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",P].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:true,configurable:true,writable:true,value:void 0}),this.cause=t;}};var jt=class extends u{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"});}},Ot=class extends u{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:3}),Object.defineProperty(this,"data",{enumerable:true,configurable:true,writable:true,value:void 0}),this.data=t;}};var ln="/docs/contract/decodeFunctionResult";function Ao(e){let{abi:t,args:n,functionName:r,data:o}=e,i=t[0];if(r){let a=q({abi:t,args:n,name:r});if(!a)throw new R(r,{docsPath:ln});i=a;}if(i.type!=="function")throw new R(void 0,{docsPath:ln});if(!i.outputs)throw new ae(i.name,{docsPath:ln});let s=de(i.outputs,o);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}var mn="/docs/contract/encodeDeployData";function bn(e){let{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;let o=t.find(s=>"type"in s&&s.type==="constructor");if(!o)throw new it({docsPath:mn});if(!("inputs"in o))throw new Ee({docsPath:mn});if(!o.inputs||o.inputs.length===0)throw new Ee({docsPath:mn});let i=C(o.inputs,n);return ee([r,i])}var Po="/docs/contract/encodeFunctionData";function Io(e){let{abi:t,args:n,functionName:r}=e,o=t[0];if(r){let i=q({abi:t,args:n,name:r});if(!i)throw new R(r,{docsPath:Po});o=i;}if(o.type!=="function")throw new R(void 0,{docsPath:Po});return {abi:[o],functionName:F(B(o))}}function Mo(e){let{args:t}=e,{abi:n,functionName:r}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:Io(e),o=n[0],i=r,s="inputs"in o&&o.inputs?C(o.inputs,t??[]):void 0;return ee([i,s??"0x"])}function Eo({blockNumber:e,chain:t,contract:n}){let r=t?.contracts?.[n];if(!r)throw new Y({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Y({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}var D=class extends u{constructor({cause:t,message:n}={}){let r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"});}};Object.defineProperty(D,"code",{enumerable:true,configurable:true,writable:true,value:3});Object.defineProperty(D,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/execution reverted/});var Z=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${L(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"});}};Object.defineProperty(Z,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});var le=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${L(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"});}};Object.defineProperty(le,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});var me=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"});}};Object.defineProperty(me,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/nonce too high/});var be=class extends u{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
31
|
-
`),{cause:t,name:"NonceTooLowError"});}};Object.defineProperty(be,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/nonce too low|transaction already imported|already known/});var ye=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"});}};Object.defineProperty(ye,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/nonce has max value/});var he=class extends u{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
32
|
-
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"});}};Object.defineProperty(he,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/insufficient funds|exceeds transaction sender account balance/});var xe=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"});}};Object.defineProperty(xe,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/intrinsic gas too high|gas limit reached/});var ge=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"});}};Object.defineProperty(ge,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/intrinsic gas too low/});var we=class extends u{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"});}};Object.defineProperty(we,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/transaction type not valid/});var J=class extends u{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${L(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${L(r)} gwei`:""}).`].join(`
|
|
33
|
-
`),{cause:t,name:"TipAboveFeeCapError"});}};Object.defineProperty(J,"nodeMessage",{enumerable:true,configurable:true,writable:true,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});var ve=class extends u{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"});}};var ke=class extends u{constructor({body:t,cause:n,details:r,headers:o,status:i,url:s}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${te(s)}`,t&&`Request body: ${W(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"headers",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"status",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"url",{enumerable:true,configurable:true,writable:true,value:void 0}),this.body=t,this.headers=o,this.status=i,this.url=s;}};var zt=class extends u{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${te(r)}`,`Request body: ${W(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0}),Object.defineProperty(this,"data",{enumerable:true,configurable:true,writable:true,value:void 0}),this.code=n.code,this.data=n.data;}};var To=class extends u{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${te(n)}`,`Request body: ${W(t)}`],name:"TimeoutError"});}};var Ys=-1,w=class extends u{constructor(t,{code:n,docsPath:r,metaMessages:o,name:i,shortMessage:s}){super(s,{cause:t,docsPath:r,metaMessages:o||t?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:true,configurable:true,writable:true,value:void 0}),this.name=i||t.name,this.code=t instanceof zt?t.code:n??Ys;}},$=class extends w{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:true,configurable:true,writable:true,value:void 0}),this.data=n.data;}},yn=class e extends w{constructor(t){super(t,{code:e.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."});}};Object.defineProperty(yn,"code",{enumerable:true,configurable:true,writable:true,value:-32700});var hn=class e extends w{constructor(t){super(t,{code:e.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."});}};Object.defineProperty(hn,"code",{enumerable:true,configurable:true,writable:true,value:-32600});var xn=class e extends w{constructor(t,{method:n}={}){super(t,{code:e.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`});}};Object.defineProperty(xn,"code",{enumerable:true,configurable:true,writable:true,value:-32601});var gn=class e extends w{constructor(t){super(t,{code:e.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
34
|
-
`)});}};Object.defineProperty(gn,"code",{enumerable:true,configurable:true,writable:true,value:-32602});var wn=class e extends w{constructor(t){super(t,{code:e.code,name:"InternalRpcError",shortMessage:"An internal error was received."});}};Object.defineProperty(wn,"code",{enumerable:true,configurable:true,writable:true,value:-32603});var vn=class e extends w{constructor(t){super(t,{code:e.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
35
|
-
`)});}};Object.defineProperty(vn,"code",{enumerable:true,configurable:true,writable:true,value:-32e3});var $n=class e extends w{constructor(t){super(t,{code:e.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:true,configurable:true,writable:true,value:"ResourceNotFoundRpcError"});}};Object.defineProperty($n,"code",{enumerable:true,configurable:true,writable:true,value:-32001});var An=class e extends w{constructor(t){super(t,{code:e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."});}};Object.defineProperty(An,"code",{enumerable:true,configurable:true,writable:true,value:-32002});var Pn=class e extends w{constructor(t){super(t,{code:e.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."});}};Object.defineProperty(Pn,"code",{enumerable:true,configurable:true,writable:true,value:-32003});var In=class e extends w{constructor(t,{method:n}={}){super(t,{code:e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`});}};Object.defineProperty(In,"code",{enumerable:true,configurable:true,writable:true,value:-32004});var Mn=class e extends w{constructor(t){super(t,{code:e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."});}};Object.defineProperty(Mn,"code",{enumerable:true,configurable:true,writable:true,value:-32005});var En=class e extends w{constructor(t){super(t,{code:e.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."});}};Object.defineProperty(En,"code",{enumerable:true,configurable:true,writable:true,value:-32006});var Tn=class e extends ${constructor(t){super(t,{code:e.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."});}};Object.defineProperty(Tn,"code",{enumerable:true,configurable:true,writable:true,value:4001});var Sn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."});}};Object.defineProperty(Sn,"code",{enumerable:true,configurable:true,writable:true,value:4100});var Bn=class e extends ${constructor(t,{method:n}={}){super(t,{code:e.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`});}};Object.defineProperty(Bn,"code",{enumerable:true,configurable:true,writable:true,value:4200});var Rn=class e extends ${constructor(t){super(t,{code:e.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."});}};Object.defineProperty(Rn,"code",{enumerable:true,configurable:true,writable:true,value:4900});var jn=class e extends ${constructor(t){super(t,{code:e.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."});}};Object.defineProperty(jn,"code",{enumerable:true,configurable:true,writable:true,value:4901});var On=class e extends ${constructor(t){super(t,{code:e.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."});}};Object.defineProperty(On,"code",{enumerable:true,configurable:true,writable:true,value:4902});var zn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."});}};Object.defineProperty(zn,"code",{enumerable:true,configurable:true,writable:true,value:5700});var Fn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."});}};Object.defineProperty(Fn,"code",{enumerable:true,configurable:true,writable:true,value:5710});var kn=class e extends ${constructor(t){super(t,{code:e.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."});}};Object.defineProperty(kn,"code",{enumerable:true,configurable:true,writable:true,value:5720});var Cn=class e extends ${constructor(t){super(t,{code:e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"});}};Object.defineProperty(Cn,"code",{enumerable:true,configurable:true,writable:true,value:5730});var Un=class e extends ${constructor(t){super(t,{code:e.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."});}};Object.defineProperty(Un,"code",{enumerable:true,configurable:true,writable:true,value:5740});var Hn=class e extends ${constructor(t){super(t,{code:e.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."});}};Object.defineProperty(Hn,"code",{enumerable:true,configurable:true,writable:true,value:5750});var Nn=class e extends ${constructor(t){super(t,{code:e.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."});}};Object.defineProperty(Nn,"code",{enumerable:true,configurable:true,writable:true,value:5760});var So=class extends w{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."});}};function Bo(e,t){let n=(e.details||"").toLowerCase(),r=e instanceof u?e.walk(o=>o?.code===D.code):e;return r instanceof u?new D({cause:e,message:r.details}):D.nodeMessage.test(n)?new D({cause:e,message:e.details}):Z.nodeMessage.test(n)?new Z({cause:e,maxFeePerGas:t?.maxFeePerGas}):le.nodeMessage.test(n)?new le({cause:e,maxFeePerGas:t?.maxFeePerGas}):me.nodeMessage.test(n)?new me({cause:e,nonce:t?.nonce}):be.nodeMessage.test(n)?new be({cause:e,nonce:t?.nonce}):ye.nodeMessage.test(n)?new ye({cause:e,nonce:t?.nonce}):he.nodeMessage.test(n)?new he({cause:e}):xe.nodeMessage.test(n)?new xe({cause:e,gas:t?.gas}):ge.nodeMessage.test(n)?new ge({cause:e,gas:t?.gas}):we.nodeMessage.test(n)?new we({cause:e}):J.nodeMessage.test(n)?new J({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new ve({cause:e})}function Ro(e,{docsPath:t,...n}){let r=(()=>{let o=Bo(e,n);return o instanceof ve?e:o})();return new Rt(r,{docsPath:t,...n})}function jo(e,{format:t}){if(!t)return {};let n={};function r(i){let s=Object.keys(i);for(let a of s)a in e&&(n[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a]);}let o=t(e||{});return r(o),n}var Qs={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Oo(e){let t={};return typeof e.authorizationList<"u"&&(t.authorizationList=ei(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>E(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=b(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=b(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=b(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=b(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=b(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=b(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Qs[e.type]),typeof e.value<"u"&&(t.value=b(e.value)),t}function ei(e){return e.map(t=>({address:t.address,r:t.r?b(BigInt(t.r)):t.r,s:t.s?b(BigInt(t.s)):t.s,chainId:b(t.chainId),nonce:b(t.nonce),...typeof t.yParity<"u"?{yParity:b(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:b(t.v)}:{}}))}function zo(){let e=()=>{},t=()=>{};return {promise:new Promise((r,o)=>{e=r,t=o;}),resolve:e,reject:t}}var Ln=new Map;function Fo({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){let i=async()=>{let p=c();s();let m=p.map(({args:l})=>l);m.length!==0&&e(m).then(l=>{o&&Array.isArray(l)&&l.sort(o);for(let d=0;d<p.length;d++){let{resolve:y}=p[d];y?.([l[d],l]);}}).catch(l=>{for(let d=0;d<p.length;d++){let{reject:y}=p[d];y?.(l);}});},s=()=>Ln.delete(t),a=()=>c().map(({args:p})=>p),c=()=>Ln.get(t)||[],f=p=>Ln.set(t,[...c(),p]);return {flush:s,async schedule(p){let{promise:m,resolve:l,reject:d}=zo();return n?.([...a(),p])&&i(),c().length>0?(f({args:p,resolve:l,reject:d}),m):(f({args:p,resolve:l,reject:d}),setTimeout(i,r),m)}}}function ko(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Re({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Re({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function ti(e){let{balance:t,nonce:n,state:r,stateDiff:o,code:i}=e,s={};if(i!==void 0&&(s.code=i),t!==void 0&&(s.balance=b(t)),n!==void 0&&(s.nonce=b(n)),r!==void 0&&(s.state=ko(r)),o!==void 0){if(s.state)throw new St;s.stateDiff=ko(o);}return s}function Co(e){if(!e)return;let t={};for(let{address:n,...r}of e){if(!g(n,{strict:false}))throw new A({address:n});if(t[n])throw new Tt({address:n});t[n]=ti(r);}return t}var Uo=2n**256n-1n;function Ho(e){let{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:i}=e,s=t?se(t):void 0;if(s&&!g(s.address))throw new A({address:s.address});if(i&&!g(i))throw new A({address:i});if(typeof n<"u"&&(typeof r<"u"||typeof o<"u"))throw new Bt;if(r&&r>Uo)throw new Z({maxFeePerGas:r});if(o&&r&&o>r)throw new J({maxFeePerGas:r,maxPriorityFeePerGas:o})}async function No(e,t){let{account:n=e.account,authorizationList:r,batch:o=!!e.batch?.multicall,blockNumber:i,blockTag:s=e.experimental_blockTag??"latest",accessList:a,blobs:c,blockOverrides:f,code:p,data:m,factory:l,factoryData:d,gas:y,gasPrice:P,maxFeePerBlobGas:$e,maxFeePerGas:ne,maxPriorityFeePerGas:Ae,nonce:Ce,to:re,value:_o,stateOverride:Wo,...qo}=t,qn=n?se(n):void 0;if(p&&(l||d))throw new u("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(p&&re)throw new u("Cannot provide both `code` & `to` as parameters.");let Zn=p&&m,Jn=l&&d&&re&&m,Kn=Zn||Jn,Zo=Zn?Lo({code:p,data:m}):Jn?oi({data:m,factory:l,factoryData:d,to:re}):m;try{Ho(t);let Pe=(typeof i=="bigint"?b(i):void 0)||s,K=f?Hr(f):void 0,X=Co(Wo),Xn=e.chain?.formatters?.transactionRequest?.format,Ht=(Xn||Oo)({...jo(qo,{format:Xn}),from:qn?.address,accessList:a,authorizationList:r,blobs:c,data:Zo,gas:y,gasPrice:P,maxFeePerBlobGas:$e,maxFeePerGas:ne,maxPriorityFeePerGas:Ae,nonce:Ce,to:Kn?void 0:re,value:_o});if(o&&ni({request:Ht})&&!X&&!K)try{return await ri(e,{...Ht,blockNumber:i,blockTag:s})}catch(G){if(!(G instanceof Me)&&!(G instanceof Y))throw G}let Jo=(()=>{let G=[Ht,Pe];return X&&K?[...G,X,K]:X?[...G,X]:K?[...G,{},K]:G})(),Yn=await e.request({method:"eth_call",params:Jo});return Yn==="0x"?{data:void 0}:{data:Yn}}catch(Ut){let Pe=si(Ut),{offchainLookup:K,offchainLookupSignature:X}=await import('./ccip-NIHGPDTQ.mjs');if(e.ccipRead!==false&&Pe?.slice(0,10)===X&&re)return {data:await K(e,{data:Pe,to:re})};throw Kn&&Pe?.slice(0,10)==="0x101bb98d"?new jt({factory:l}):Ro(Ut,{...t,account:qn,chain:e.chain})}}function ni({request:e}){let{data:t,to:n,...r}=e;return !(!t||t.startsWith(Lr)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function ri(e,t){let{batchSize:n=1024,deployless:r=false,wait:o=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:i,blockTag:s=e.experimental_blockTag??"latest",data:a,to:c}=t,f=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Eo({blockNumber:i,chain:e.chain,contract:"multicall3"});throw new Me})(),m=(typeof i=="bigint"?b(i):void 0)||s,{schedule:l}=Fo({id:`${e.uid}.${m}`,wait:o,shouldSplitBatch(P){return P.reduce((ne,{data:Ae})=>ne+(Ae.length-2),0)>n*2},fn:async P=>{let $e=P.map(Ce=>({allowFailure:true,callData:Ce.data,target:Ce.to})),ne=Mo({abi:Xt,args:[$e],functionName:"aggregate3"}),Ae=await e.request({method:"eth_call",params:[{...f===null?{data:Lo({code:Vr,data:ne})}:{to:f,data:ne}},m]});return Ao({abi:Xt,args:[$e],functionName:"aggregate3",data:Ae||"0x"})}}),[{returnData:d,success:y}]=await l({data:a,to:c});if(!y)throw new Ot({data:d});return d==="0x"?{data:void 0}:{data:d}}function Lo(e){let{code:t,data:n}=e;return bn({abi:et(["constructor(bytes, bytes)"]),bytecode:Dr,args:[t,n]})}function oi(e){let{data:t,factory:n,factoryData:r,to:o}=e;return bn({abi:et(["constructor(address, bytes, address, bytes)"]),bytecode:Gr,args:[o,t,n,r]})}function si(e){if(!(e instanceof u))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}var Ft=class extends u{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:i,urls:s}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(a=>` ${te(a)}`)],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"});}},kt=class extends u{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${te(n)}`,`Response: ${W(t)}`],name:"OffchainLookupResponseMalformedError"});}},Ct=class extends u{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"});}};function Do(e,t){if(!g(e,{strict:false}))throw new A({address:e});if(!g(t,{strict:false}))throw new A({address:t});return e.toLowerCase()===t.toLowerCase()}function Go(e){let{abi:t,data:n}=e,r=O(n,0,4),o=t.find(i=>i.type==="function"&&r===F(B(i)));if(!o)throw new lt(r,{docsPath:"/docs/contract/decodeFunctionData"});return {functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?de(o.inputs,O(n,4)):void 0}}var Dn="/docs/contract/encodeErrorResult";function Gn(e){let{abi:t,errorName:n,args:r}=e,o=t[0];if(n){let c=q({abi:t,args:r,name:n});if(!c)throw new Te(n,{docsPath:Dn});o=c;}if(o.type!=="error")throw new Te(void 0,{docsPath:Dn});let i=B(o),s=F(i),a="0x";if(r&&r.length>0){if(!o.inputs)throw new pt(o.name,{docsPath:Dn});a=C(o.inputs,r);}return ee([s,a])}var Vn="/docs/contract/encodeFunctionResult";function Vo(e){let{abi:t,functionName:n,result:r}=e,o=t[0];if(n){let s=q({abi:t,name:n});if(!s)throw new R(n,{docsPath:Vn});o=s;}if(o.type!=="function")throw new R(void 0,{docsPath:Vn});if(!o.outputs)throw new ae(o.name,{docsPath:Vn});let i=(()=>{if(o.outputs.length===0)return [];if(o.outputs.length===1)return [r];if(Array.isArray(r))return r;throw new ue(r)})();return C(o.outputs,i)}var _n="x-batch-gateway:true";async function Wn(e){let{data:t,ccipRequest:n}=e,{args:[r]}=Go({abi:nt,data:t}),o=[],i=[];return await Promise.all(r.map(async(s,a)=>{try{i[a]=s.urls.includes(_n)?await Wn({data:s.data,ccipRequest:n}):await n(s),o[a]=!1;}catch(c){o[a]=true,i[a]=ii(c);}})),Vo({abi:nt,functionName:"query",result:[o,i]})}function ii(e){return e.name==="HttpRequestError"&&e.status?Gn({abi:nt,errorName:"HttpError",args:[e.status,e.shortMessage]}):Gn({abi:[rt],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}var nd="0x556f1830",ai={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 rd(e,{blockNumber:t,blockTag:n,data:r,to:o}){let{args:i}=mo({data:r,abi:[ai]}),[s,a,c,f,p]=i,{ccipRead:m}=e,l=m&&typeof m?.request=="function"?m.request:ui;try{if(!Do(o,s))throw new Ct({sender:s,to:o});let d=a.includes(_n)?await Wn({data:c,ccipRequest:l}):await l({data:c,sender:s,urls:a}),{data:y}=await No(e,{blockNumber:t,blockTag:n,data:N([f,C([{type:"bytes"},{type:"bytes"}],[d,p])]),to:o});return y}catch(d){throw new Ft({callbackSelector:f,cause:d,data:r,extraData:p,sender:s,urls:a})}}async function ui({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let o=0;o<n.length;o++){let i=n[o],s=i.includes("{data}")?"GET":"POST",a=s==="POST"?{data:e,sender:t}:void 0,c=s==="POST"?{"Content-Type":"application/json"}:{};try{let f=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:c,method:s}),p;if(f.headers.get("Content-Type")?.startsWith("application/json")?p=(await f.json()).data:p=await f.text(),!f.ok){r=new ke({body:a,details:p?.error?W(p.error):f.statusText,headers:f.headers,status:f.status,url:i});continue}if(!M(p)){r=new kt({result:p,url:i});continue}return p}catch(f){r=new ke({body:a,details:f.message,url:i});}}throw r}export{jn as A,On as B,zn as C,Fn as D,kn as E,Cn as F,Un as G,Hn as H,Nn as I,So as J,Fo as K,nd as L,ai as M,rd as N,ui as O,u as a,K0 as b,b as c,rn as d,fe as e,Da as f,W as g,ke as h,zt as i,To as j,yn as k,hn as l,xn as m,gn as n,wn as o,vn as p,$n as q,An as r,Pn as s,In as t,Mn as u,En as v,Tn as w,Sn as x,Bn as y,Rn as z};//# sourceMappingURL=chunk-J3JCN55Z.mjs.map
|
|
36
|
-
//# sourceMappingURL=chunk-J3JCN55Z.mjs.map
|