Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@delvtech/drift

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@delvtech/drift - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+12
dist/chunk-CLUZ6G7I.js
var Ne=Object.defineProperty;var i=(n,e)=>Ne(n,"name",{value:e,configurable:!0});import{AbiItem as ke}from"ox";function I({abi:n,name:e,kind:t,values:a}){let r=ke.fromAbi(n,e,{args:a});return!r||!(t in r)?{}:Object.fromEntries(r[t].map(({name:s},c)=>[s||c,a?.[c]]))}i(I,"arrayToObject");var f=class n extends Error{static prefix="\u2716 ";static name="Drift Error";constructor(e,t){let a;try{a=e?.message??String(e)}catch{throw e}super(a),this.name=t?.name??this.constructor.name;let r=e instanceof Error,s=t?.cause??e?.cause,c=e;r||(c=new Error,Error.captureStackTrace?.(c,new.target));let o=c.stack,b;e?.name&&!["Error",this.name].includes(e.name)?b=e.name:r&&!["Error",this.name].includes(e.constructor.name)&&(b=e.constructor.name),Object.defineProperty(this,"stack",{get(){let d=`${t?.prefix??n.prefix}${this.name}`;if(b&&(d+=` [${b}]`),this.message&&(d+=`: ${this.message}`.replaceAll(`
`,`
`)),o){let l=o.split(`
`).slice(1);this.message&&(l=l.filter(u=>!this.message.includes(u.trim()))),l.length&&(d+=`
${l.join(`
`)}`)}return s&&(d+=`
Caused by: ${s.stack||s}`.replaceAll(`
`,`
`)),d.trim()}})}};import{AbiFunction as Re,AbiParameters as ve}from"ox";function T(n){if(typeof n!="object")throw new f(n);let e={message:""},t;try{t=JSON.parse(n.details)}catch{}throw n.shortMessage&&(e.message+=n.shortMessage),t?.message&&(e.message+=`
${t.message}`),e.message+=`
${n.message.replace(n.shortMessage,"").trimStart()}`,e.message=e.message.trimStart(),new f(e)}i(T,"handleError");function ce({abi:n,data:e}){try{let t=e.slice(0,10),a=`0x${e.slice(10)}`,r=Re.fromAbi(n,t),s=ve.decode(r.inputs,a,{as:"Array",checksumAddress:!0}),c=r.name,o=I({abi:n,name:c,kind:"inputs",values:s});return{functionName:c,args:o}}catch(t){T(t)}}i(ce,"decodeFunctionData");function be({abi:n,name:e,kind:t,values:a}){let r=I({abi:n,name:e,kind:t,values:a}),s=Object.values(r);return s.length===1?s[0]:r}i(be,"arrayToSimplified");import{AbiFunction as de}from"ox";function le({abi:n,data:e,fn:t}){try{let a=de.fromAbi(n,t),r=de.decodeResult(a,e,{as:"Array"});return a.outputs.length===1?r:be({abi:n,name:a.name,kind:"outputs",values:r})}catch(a){T(a)}}i(le,"decodeFunctionReturn");var we={type:"constructor",inputs:[],stateMutability:"nonpayable"};function N({abi:n,type:e,name:t,kind:a,value:r}){let s=n.filter(l=>l.type!==e||l.name!==t?!1:a in l);if(!s.length){if(e==="constructor")return{abiEntry:we,params:[]};throw new f(`No matching ABI entry for ${e} ${t} with ${a}`)}if(s.length===1){let l=s[0],u=l[a];return u.length?pe(r,u)?{abiEntry:l,params:[r]}:{abiEntry:l,params:u.map(({name:y},x)=>r?.[y||x])}:{abiEntry:l,params:[]}}let c=r&&typeof r=="object"?Object.keys(r).length:0,o=s[0],b=[],d=0;for(let l of s){let u=l[a];if(!u.length){if(!c)return{abiEntry:l,params:[]};continue}if(pe(r,u))return{abiEntry:l,params:[r]};let y=r||{},x=[],h=0;for(let[E,{name:F}]of u.entries()){let v=F||E;x.push(y[v]),v in y&&h++}h>d&&(o=l,b=x,d=h)}return{abiEntry:o,params:b}}i(N,"prepareParams");function pe(n,e){if(e.length!==1)return!1;if(!n)return!0;let{type:t,name:a}=e[0],r=t.match(/(\[\d*\])+$/)?.[0];if(!r)return typeof n!="object";if(!Array.isArray(n))return!1;if(a)return!0;let s=n;for(let c of r.match(/\[\d*]/g))s=s?.[0];return!Array.isArray(s)}i(pe,"isUnpacked");import{AbiConstructor as Se}from"ox";function me(n){return ee(n).data}i(me,"encodeDeployData");function ee({abi:n,args:e,bytecode:t}){try{let{abiEntry:a,params:r}=N({abi:n,type:"constructor",name:void 0,kind:"inputs",value:e});return{abiEntry:a,data:Se.encode(a,{args:r,bytecode:t})}}catch(a){T(a)}}i(ee,"prepareDeployData");import{AbiFunction as Be}from"ox";function ue(n){return k(n).data}i(ue,"encodeFunctionData");function k({abi:n,args:e,fn:t}){try{let{abiEntry:a,params:r}=N({abi:n,type:"function",name:t,kind:"inputs",value:e});return{abiEntry:a,data:Be.encodeData(a,r)}}catch(a){T(a)}}i(k,"prepareFunctionData");import{AbiFunction as Oe}from"ox";function Ae(n){return He(n).data}i(Ae,"encodeFunctionReturn");function He({abi:n,fn:e,value:t}){try{let{abiEntry:a,params:r}=N({abi:n,type:"function",name:e,kind:"outputs",value:t});return{abiEntry:a,data:Oe.encodeResult(a,r,{as:"Array"})}}catch(a){T(a)}}i(He,"prepareFunctionReturn");var M=class{static{i(this,"AbiEncoder")}encodeDeployData(e){return me(e)}encodeFunctionData(e){return ue(e)}encodeFunctionReturn(e){return Ae(e)}decodeFunctionData(e){return ce(e)}decodeFunctionReturn(e){return le(e)}};function K(n,{abi:e,bytecode:t,args:a={},...r}){let s=n.encodeDeployData({abi:e,bytecode:t,args:a});return n.sendTransaction({data:s,...r})}i(K,"deploy");var Te={1:"0xcA11bde05977b3631167028862bE2a173976CA11",3:"0xcA11bde05977b3631167028862bE2a173976CA11",4:"0xcA11bde05977b3631167028862bE2a173976CA11",5:"0xcA11bde05977b3631167028862bE2a173976CA11",10:"0xcA11bde05977b3631167028862bE2a173976CA11",14:"0xcA11bde05977b3631167028862bE2a173976CA11",16:"0xcA11bde05977b3631167028862bE2a173976CA11",18:"0xcA11bde05977b3631167028862bE2a173976CA11",19:"0xcA11bde05977b3631167028862bE2a173976CA11",25:"0xcA11bde05977b3631167028862bE2a173976CA11",30:"0xcA11bde05977b3631167028862bE2a173976CA11",31:"0xcA11bde05977b3631167028862bE2a173976CA11",40:"0xcA11bde05977b3631167028862bE2a173976CA11",42:"0xcA11bde05977b3631167028862bE2a173976CA11",44:"0xca11bde05977b3631167028862be2a173976ca11",46:"0xca11bde05977b3631167028862be2a173976ca11",56:"0xcA11bde05977b3631167028862bE2a173976CA11",57:"0xcA11bde05977b3631167028862bE2a173976CA11",58:"0xca11bde05977b3631167028862be2a173976ca11",61:"0xcA11bde05977b3631167028862bE2a173976CA11",66:"0xcA11bde05977b3631167028862bE2a173976CA11",69:"0xcA11bde05977b3631167028862bE2a173976CA11",82:"0xca11bde05977b3631167028862be2a173976ca11",83:"0xca11bde05977b3631167028862be2a173976ca11",88:"0xcA11bde05977b3631167028862bE2a173976CA11",89:"0xca11bde05977b3631167028862be2a173976ca11",97:"0xcA11bde05977b3631167028862bE2a173976CA11",100:"0xcA11bde05977b3631167028862bE2a173976CA11",106:"0xcA11bde05977b3631167028862bE2a173976CA11",108:"0xcA11bde05977b3631167028862bE2a173976CA11",109:"0xcA11bde05977b3631167028862bE2a173976CA11",114:"0xcA11bde05977b3631167028862bE2a173976CA11",122:"0xcA11bde05977b3631167028862bE2a173976CA11",128:"0xcA11bde05977b3631167028862bE2a173976CA11",137:"0xcA11bde05977b3631167028862bE2a173976CA11",138:"0xcA11bde05977b3631167028862bE2a173976CA11",146:"0xca11bde05977b3631167028862be2a173976ca11",148:"0xcA11bde05977b3631167028862bE2a173976CA11",169:"0xcA11bde05977b3631167028862bE2a173976CA11",195:"0xca11bde05977b3631167028862be2a173976ca11",196:"0xcA11bde05977b3631167028862bE2a173976CA11",199:"0xca11bde05977b3631167028862be2a173976ca11",204:"0xcA11bde05977b3631167028862bE2a173976CA11",250:"0xcA11bde05977b3631167028862bE2a173976CA11",252:"0xcA11bde05977b3631167028862bE2a173976CA11",255:"0xcA11bde05977b3631167028862bE2a173976CA11",280:"0xF9cda624FBC7e059355ce98a31693d299FACd963",288:"0xcA11bde05977b3631167028862bE2a173976CA11",300:"0xF9cda624FBC7e059355ce98a31693d299FACd963",311:"0xcA11bde05977b3631167028862bE2a173976CA11",314:"0xcA11bde05977b3631167028862bE2a173976CA11",321:"0xcA11bde05977b3631167028862bE2a173976CA11",324:"0xF9cda624FBC7e059355ce98a31693d299FACd963",335:"0xcA11bde05977b3631167028862bE2a173976CA11",338:"0xcA11bde05977b3631167028862bE2a173976CA11",369:"0xcA11bde05977b3631167028862bE2a173976CA11",420:"0xcA11bde05977b3631167028862bE2a173976CA11",424:"0xcA11bde05977b3631167028862bE2a173976CA11",462:"0xca11bde05977b3631167028862be2a173976ca11",463:"0xca11bde05977b3631167028862be2a173976ca11",480:"0xcA11bde05977b3631167028862bE2a173976CA11",499:"0xcA11bde05977b3631167028862bE2a173976CA11",545:"0xcA11bde05977b3631167028862bE2a173976CA11",570:"0xcA11bde05977b3631167028862bE2a173976CA11",592:"0xcA11bde05977b3631167028862bE2a173976CA11",599:"0xcA11bde05977b3631167028862bE2a173976CA11",710:"0xcA11bde05977b3631167028862bE2a173976CA11",747:"0xcA11bde05977b3631167028862bE2a173976CA11",813:"0xcA11bde05977b3631167028862bE2a173976CA11",820:"0xcA11bde05977b3631167028862bE2a173976CA11",943:"0xcA11bde05977b3631167028862bE2a173976CA11",964:"0xcA11bde05977b3631167028862bE2a173976CA11",999:"0xcA11bde05977b3631167028862bE2a173976CA11",1001:"0xca11bde05977b3631167028862be2a173976ca11",1029:"0xca11bde05977b3631167028862be2a173976ca11",1030:"0xca11bde05977b3631167028862be2a173976ca11",1088:"0xcA11bde05977b3631167028862bE2a173976CA11",1101:"0xca11bde05977b3631167028862be2a173976ca11",1111:"0xca11bde05977b3631167028862be2a173976ca11",1114:"0xcA11bde05977b3631167028862bE2a173976CA11",1115:"0xcA11bde05977b3631167028862bE2a173976CA11",1116:"0xcA11bde05977b3631167028862bE2a173976CA11",1130:"0xcA11bde05977b3631167028862bE2a173976CA11",1131:"0xcA11bde05977b3631167028862bE2a173976CA11",1135:"0xcA11bde05977b3631167028862bE2a173976CA11",1234:"0xcA11bde05977b3631167028862bE2a173976CA11",1284:"0xcA11bde05977b3631167028862bE2a173976CA11",1285:"0xcA11bde05977b3631167028862bE2a173976CA11",1287:"0xcA11bde05977b3631167028862bE2a173976CA11",1315:"0xcA11bde05977b3631167028862bE2a173976CA11",1329:"0xcA11bde05977b3631167028862bE2a173976CA11",1442:"0xca11bde05977b3631167028862be2a173976ca11",1514:"0xcA11bde05977b3631167028862bE2a173976CA11",1570:"0xcA11bde05977b3631167028862bE2a173976CA11",1578:"0xca11bde05977b3631167028862be2a173976ca11",1625:"0xca11bde05977b3631167028862be2a173976ca11",1729:"0xcA11bde05977b3631167028862bE2a173976CA11",1875:"0xcA11bde05977b3631167028862bE2a173976CA11",1992:"0xcA11bde05977b3631167028862bE2a173976CA11",1996:"0xcA11bde05977b3631167028862bE2a173976CA11",2e3:"0xcA11bde05977b3631167028862bE2a173976CA11",2001:"0xcA11bde05977b3631167028862bE2a173976CA11",2020:"0xca11bde05977b3631167028862be2a173976ca11",2021:"0xca11bde05977b3631167028862be2a173976ca11",2222:"0xcA11bde05977b3631167028862bE2a173976CA11",2331:"0xcA11bde05977b3631167028862bE2a173976CA11",2358:"0xcA11bde05977b3631167028862bE2a173976CA11",2415:"0xcA11bde05977b3631167028862bE2a173976CA11",2442:"0xca11bde05977b3631167028862be2a173976ca11",2522:"0xcA11bde05977b3631167028862bE2a173976CA11",2710:"0xcA11bde05977b3631167028862bE2a173976CA11",2741:"0xF9cda624FBC7e059355ce98a31693d299FACd963",2810:"0xcA11bde05977b3631167028862bE2a173976CA11",2818:"0xcA11bde05977b3631167028862bE2a173976CA11",3338:"0xca11bde05977b3631167028862be2a173976ca11",3501:"0xcA11bde05977b3631167028862bE2a173976CA11",3502:"0xcA11bde05977b3631167028862bE2a173976CA11",3737:"0xcA11bde05977b3631167028862bE2a173976CA11",3776:"0xcA11bde05977b3631167028862bE2a173976CA11",3799:"0xca11bde05977b3631167028862be2a173976ca11",3939:"0xcA11bde05977b3631167028862bE2a173976CA11",4002:"0xcA11bde05977b3631167028862bE2a173976CA11",4061:"0xcA11bde05977b3631167028862bE2a173976CA11",4062:"0xcA11bde05977b3631167028862bE2a173976CA11",4201:"0xcA11bde05977b3631167028862bE2a173976CA11",4689:"0xcA11bde05977b3631167028862bE2a173976CA11",4759:"0xcA11bde05977b3631167028862bE2a173976CA11",5e3:"0xcA11bde05977b3631167028862bE2a173976CA11",5001:"0xcA11bde05977b3631167028862bE2a173976CA11",5003:"0xcA11bde05977b3631167028862bE2a173976CA11",5101:"0xcA11bde05977b3631167028862bE2a173976CA11",5555:"0xcA11bde05977b3631167028862bE2a173976CA11",5611:"0xcA11bde05977b3631167028862bE2a173976CA11",5700:"0xcA11bde05977b3631167028862bE2a173976CA11",5851:"0xca11bde05977b3631167028862be2a173976ca11",6322:"0xca11bde05977b3631167028862be2a173976ca11",6342:"0xcA11bde05977b3631167028862bE2a173976CA11",6699:"0xcA11bde05977b3631167028862bE2a173976CA11",7e3:"0xcA11bde05977b3631167028862bE2a173976CA11",7001:"0xca11bde05977b3631167028862be2a173976ca11",7070:"0xcA11bde05977b3631167028862bE2a173976CA11",7518:"0xcA11bde05977b3631167028862bE2a173976CA11",7560:"0xcA11bde05977b3631167028862bE2a173976CA11",7700:"0xcA11bde05977b3631167028862bE2a173976CA11",7701:"0xcA11bde05977b3631167028862bE2a173976CA11",7869:"0xcA11bde05977b3631167028862bE2a173976CA11",7979:"0xcA11bde05977b3631167028862bE2a173976CA11",8082:"0xcA11bde05977b3631167028862bE2a173976CA11",8131:"0xcA11bde05977b3631167028862bE2a173976CA11",8217:"0xcA11bde05977b3631167028862bE2a173976CA11",8453:"0xca11bde05977b3631167028862be2a173976ca11",8545:"0xcA11bde05977b3631167028862bE2a173976CA11",8822:"0xcA11bde05977b3631167028862bE2a173976CA11",8899:"0xcA11bde05977b3631167028862bE2a173976CA11",8911:"0xcA11bde05977b3631167028862bE2a173976CA11",9e3:"0xcA11bde05977b3631167028862bE2a173976CA11",9001:"0xcA11bde05977b3631167028862bE2a173976CA11",9393:"0xcA11bde05977b3631167028862bE2a173976CA11",10143:"0xcA11bde05977b3631167028862bE2a173976CA11",10200:"0xcA11bde05977b3631167028862bE2a173976CA11",10242:"0xcA11bde05977b3631167028862bE2a173976CA11",10243:"0xcA11bde05977b3631167028862bE2a173976CA11",11119:"0xcA11bde05977b3631167028862bE2a173976CA11",11124:"0xF9cda624FBC7e059355ce98a31693d299FACd963",11235:"0xcA11bde05977b3631167028862bE2a173976CA11",11503:"0xcA11bde05977b3631167028862bE2a173976CA11",12553:"0xcA11bde05977b3631167028862bE2a173976CA11",13371:"0xcA11bde05977b3631167028862bE2a173976CA11",13473:"0xcA11bde05977b3631167028862bE2a173976CA11",15557:"0xcA11bde05977b3631167028862bE2a173976CA11",17e3:"0xcA11bde05977b3631167028862bE2a173976CA11",17777:"0xcA11bde05977b3631167028862bE2a173976CA11",23294:"0xcA11bde05977b3631167028862bE2a173976CA11",23451:"0xcA11bde05977b3631167028862bE2a173976CA11",32520:"0xcA11bde05977b3631167028862bE2a173976CA11",32659:"0xcA11bde05977b3631167028862bE2a173976CA11",33139:"0xcA11bde05977b3631167028862bE2a173976CA11",34443:"0xcA11bde05977b3631167028862bE2a173976CA11",35441:"0xcA11bde05977b3631167028862bE2a173976CA11",35442:"0xcA11bde05977b3631167028862bE2a173976CA11",35443:"0xcA11bde05977b3631167028862bE2a173976CA11",41455:"0xcA11bde05977b3631167028862bE2a173976CA11",42161:"0xcA11bde05977b3631167028862bE2a173976CA11",42170:"0xcA11bde05977b3631167028862bE2a173976CA11",42220:"0xcA11bde05977b3631167028862bE2a173976CA11",42262:"0xcA11bde05977b3631167028862bE2a173976CA11",42299:"0xcA11bde05977b3631167028862bE2a173976CA11",42766:"0xcA11bde05977b3631167028862bE2a173976CA11",42793:"0xcA11bde05977b3631167028862bE2a173976CA11",43113:"0xcA11bde05977b3631167028862bE2a173976CA11",43114:"0xcA11bde05977b3631167028862bE2a173976CA11",44787:"0xcA11bde05977b3631167028862bE2a173976CA11",46688:"0xcA11bde05977b3631167028862bE2a173976CA11",48899:"0xcA11bde05977b3631167028862bE2a173976CA11",53302:"0xcA11bde05977b3631167028862bE2a173976CA11",53935:"0xcA11bde05977b3631167028862bE2a173976CA11",54176:"0x03657CDcDA1523C073b5e09c37dd199E6fBD1b99",55244:"0xcA11bde05977b3631167028862bE2a173976CA11",57e3:"0xcA11bde05977b3631167028862bE2a173976CA11",57073:"0xcA11bde05977b3631167028862bE2a173976CA11",58008:"0xcA11bde05977b3631167028862bE2a173976CA11",59140:"0xcA11bde05977b3631167028862bE2a173976CA11",59141:"0xca11bde05977b3631167028862be2a173976ca11",59144:"0xcA11bde05977b3631167028862bE2a173976CA11",59902:"0xcA11bde05977b3631167028862bE2a173976CA11",60808:"0xcA11bde05977b3631167028862bE2a173976CA11",64240:"0xca11bde05977b3631167028862be2a173976ca11",71401:"0xcA11bde05977b3631167028862bE2a173976CA11",71402:"0xcA11bde05977b3631167028862bE2a173976CA11",80001:"0xcA11bde05977b3631167028862bE2a173976CA11",80002:"0xcA11bde05977b3631167028862bE2a173976CA11",80069:"0xca11bde05977b3631167028862be2a173976ca11",80094:"0xcA11bde05977b3631167028862bE2a173976CA11",81457:"0xcA11bde05977b3631167028862bE2a173976CA11",84531:"0xca11bde05977b3631167028862be2a173976ca11",84532:"0xcA11bde05977b3631167028862bE2a173976CA11",88811:"0xcA11bde05977b3631167028862bE2a173976CA11",88817:"0xcA11bde05977b3631167028862bE2a173976CA11",88819:"0xcA11bde05977b3631167028862bE2a173976CA11",88882:"0xcA11bde05977b3631167028862bE2a173976CA11",88888:"0xcA11bde05977b3631167028862bE2a173976CA11",94168:"0xcA11bde05977b3631167028862bE2a173976CA11",98866:"0xcA11bde05977b3631167028862bE2a173976CA11",98867:"0xca11bde05977b3631167028862be2a173976ca11",98985:"0xcA11bde05977b3631167028862bE2a173976CA11",111188:"0xcA11bde05977b3631167028862bE2a173976CA11",112358:"0xcA11bde05977b3631167028862bE2a173976CA11",128123:"0xcA11bde05977b3631167028862bE2a173976CA11",132902:"0xcA11bde05977b3631167028862bE2a173976CA11",167e3:"0xca11bde05977b3631167028862be2a173976ca11",167007:"0xcA11bde05977b3631167028862bE2a173976CA11",167008:"0xcA11bde05977b3631167028862bE2a173976CA11",167009:"0xcA11bde05977b3631167028862bE2a173976CA11",200901:"0xca11bde05977b3631167028862be2a173976ca11",313313:"0xcA11bde05977b3631167028862bE2a173976CA11",314159:"0xdbfa261cd7d17bb40479a0493ad6c0fee435859e37aae73aa7e803f3122cc465",325e3:"0xcA11bde05977b3631167028862bE2a173976CA11",421611:"0xcA11bde05977b3631167028862bE2a173976CA11",421613:"0xcA11bde05977b3631167028862bE2a173976CA11",421614:"0xcA11bde05977b3631167028862bE2a173976CA11",534351:"0xca11bde05977b3631167028862be2a173976ca11",534352:"0xcA11bde05977b3631167028862bE2a173976CA11",534353:"0xcA11bde05977b3631167028862bE2a173976CA11",541764:"0x03657CDcDA1523C073b5e09c37dd199E6fBD1b99",560048:"0xca11bde05977b3631167028862be2a173976ca11",656476:"0xcA11bde05977b3631167028862bE2a173976CA11",660279:"0xcA11bde05977b3631167028862bE2a173976CA11",686868:"0xcA11bde05977b3631167028862bE2a173976CA11",713715:"0xcA11bde05977b3631167028862bE2a173976CA11",763373:"0xcA11bde05977b3631167028862bE2a173976CA11",1612127:"0xF9cda624FBC7e059355ce98a31693d299FACd963",1637450:"0xcA11bde05977b3631167028862bE2a173976CA11",6038361:"0xcA11bde05977b3631167028862bE2a173976CA11",7777777:"0xcA11bde05977b3631167028862bE2a173976CA11",9999999:"0xcA11bde05977b3631167028862bE2a173976CA11",11155111:"0xcA11bde05977b3631167028862bE2a173976CA11",11155420:"0xcA11bde05977b3631167028862bE2a173976CA11",12227330:"0xcA11bde05977b3631167028862bE2a173976CA11",23011913:"0xcA11bde05977b3631167028862bE2a173976CA11",37084624:"0xcA11bde05977b3631167028862bE2a173976CA11",52164803:"0xcA11bde05977b3631167028862bE2a173976CA11",68840142:"0xcA11bde05977b3631167028862bE2a173976CA11",89346162:"0xcA11bde05977b3631167028862bE2a173976CA11",111557560:"0xcA11bde05977b3631167028862bE2a173976CA11",168587773:"0xcA11bde05977b3631167028862bE2a173976CA11",245022926:"0xcA11bde05977b3631167028862bE2a173976CA11",245022934:"0xca11bde05977b3631167028862be2a173976ca11",728126428:"TEazPvZwDjDtFeJupyo7QunvnrnUjPH8ED",974399131:"0xcA11bde05977b3631167028862bE2a173976CA11",999999999:"0xcA11bde05977b3631167028862bE2a173976CA11",1020352220:"0xcA11bde05977b3631167028862bE2a173976CA11",1313161554:"0xcA11bde05977b3631167028862bE2a173976CA11",1350216234:"0xcA11bde05977b3631167028862bE2a173976CA11",1444673419:"0xcA11bde05977b3631167028862bE2a173976CA11",1482601649:"0xcA11bde05977b3631167028862bE2a173976CA11",1564830818:"0xcA11bde05977b3631167028862bE2a173976CA11",16666e5:"0xcA11bde05977b3631167028862bE2a173976CA11",2046399126:"0xcA11bde05977b3631167028862bE2a173976CA11",11297108109:"0xca11bde05977b3631167028862be2a173976ca11",11297108099:"0xca11bde05977b3631167028862be2a173976ca11",47279324479:"0xcA11bde05977b3631167028862bE2a173976CA11",5264468217:"0xcA11bde05977b3631167028862bE2a173976CA11",123420000220:"0xcA11bde05977b3631167028862bE2a173976CA11"};function w(n){return Te[n]}i(w,"getMulticallAddress");import{AbiConstructor as ye}from"ox";var te={name:"CodeCaller",abi:[{type:"constructor",inputs:[{name:"bytecode",type:"bytes",internalType:"bytes"},{name:"callParams",type:"bytes",internalType:"bytes"}],stateMutability:"nonpayable"},{type:"error",name:"BytecodeDeploymentFailed",inputs:[]}],bytecode:"0x608060405234801561000f575f80fd5b5060405161021c38038061021c83398101604081905261002e916101a1565b5f8251602084015ff090506001600160a01b038116158061005757506001600160a01b0381163b155b156100755760405163537574ad60e11b815260040160405180910390fd5b5f80826001600160a01b03168460405161008f9190610200565b5f604051808303815f865af19150503d805f81146100c8576040519150601f19603f3d011682016040523d82523d5f602084013e6100cd565b606091505b5091509150816100df57805160208201fd5b805160208201f35b634e487b7160e01b5f52604160045260245ffd5b5f5b838110156101155781810151838201526020016100fd565b50505f910152565b5f82601f83011261012c575f80fd5b81516001600160401b0380821115610146576101466100e7565b604051601f8301601f19908116603f0116810190828211818310171561016e5761016e6100e7565b81604052838152866020858801011115610186575f80fd5b6101978460208301602089016100fb565b9695505050505050565b5f80604083850312156101b2575f80fd5b82516001600160401b03808211156101c8575f80fd5b6101d48683870161011d565b935060208501519150808211156101e9575f80fd5b506101f68582860161011d565b9150509250929050565b5f82516102118184602087016100fb565b919091019291505056fe",methodIdentifiers:{}};function W(n,e){let t=ye.fromAbi(te.abi);return ye.encode(t,{bytecode:te.bytecode,args:[n,e]})}i(W,"encodeBytecodeCallData");function G({abi:n,address:e,fn:t,args:a,to:r=e,bytecode:s,data:c}){if(n&&t){let{abiEntry:o,data:b}=k({abi:n,fn:t,args:a});return{to:r,data:b,abiEntry:o}}if(n&&s){let{abiEntry:o,data:b}=ee({abi:n,bytecode:s,args:a});return{data:b,abiEntry:o}}return s&&c?{data:W(s,c)}:{to:r,data:c}}i(G,"prepareCall");var ae={name:"IMulticall3",abi:[{type:"function",name:"aggregate",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"},{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"aggregate3",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call3[]",components:[{name:"target",type:"address",internalType:"address"},{name:"allowFailure",type:"bool",internalType:"bool"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"aggregate3Value",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call3Value[]",components:[{name:"target",type:"address",internalType:"address"},{name:"allowFailure",type:"bool",internalType:"bool"},{name:"value",type:"uint256",internalType:"uint256"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"blockAndAggregate",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"},{name:"blockHash",type:"bytes32",internalType:"bytes32"},{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"getBasefee",inputs:[],outputs:[{name:"basefee",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getBlockHash",inputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"}],outputs:[{name:"blockHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"getBlockNumber",inputs:[],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getChainId",inputs:[],outputs:[{name:"chainid",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockCoinbase",inputs:[],outputs:[{name:"coinbase",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockDifficulty",inputs:[],outputs:[{name:"difficulty",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockGasLimit",inputs:[],outputs:[{name:"gaslimit",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockTimestamp",inputs:[],outputs:[{name:"timestamp",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getEthBalance",inputs:[{name:"addr",type:"address",internalType:"address"}],outputs:[{name:"balance",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getLastBlockHash",inputs:[],outputs:[{name:"blockHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"tryAggregate",inputs:[{name:"requireSuccess",type:"bool",internalType:"bool"},{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"tryBlockAndAggregate",inputs:[{name:"requireSuccess",type:"bool",internalType:"bool"},{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"},{name:"blockHash",type:"bytes32",internalType:"bytes32"},{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"}],methodIdentifiers:{"aggregate((address,bytes)[])":"252dba42","aggregate3((address,bool,bytes)[])":"82ad56cb","aggregate3Value((address,bool,uint256,bytes)[])":"174dea71","blockAndAggregate((address,bytes)[])":"c3077fa9","getBasefee()":"3e64a696","getBlockHash(uint256)":"ee82ac5e","getBlockNumber()":"42cbb15c","getChainId()":"3408e470","getCurrentBlockCoinbase()":"a8b0574e","getCurrentBlockDifficulty()":"72425d9d","getCurrentBlockGasLimit()":"86d516e8","getCurrentBlockTimestamp()":"0f28c97d","getEthBalance(address)":"4d2301cc","getLastBlockHash()":"27e86d6e","tryAggregate(bool,(address,bytes)[])":"bce38bd7","tryBlockAndAggregate(bool,(address,bytes)[])":"399542e9"}};var De=/^0x[0-9a-fA-F]*$/;function j(n,e){let t=e?.prefix!==!1;return typeof n=="string"&&De.test(t?n:`0x${n}`)}i(j,"isHexString");function R(n,e){let t=e?.prefix===!1?"":"0x";if(typeof n=="number"||typeof n=="bigint")return`${t}${n.toString(16)}`;let a="";if(typeof n=="string"){if(j(n,e))return n;for(let r=0;r<n.length;r++)a+=n.charCodeAt(r).toString(16).padStart(2,"0")}else for(let r of n)a+=r.toString(16).padStart(2,"0");return`${t}${a}`}i(R,"toHexString");function fe(n,e){if(!j(n,e))throw new Error(`Invalid hex string: ${n}`);let t="";for(let a=0;a<n.length;a+=2){let r=n.slice(a,2);if(r==="0x")continue;let s=parseInt(r,16);t+=String.fromCharCode(s)}return t}i(fe,"hexToString");async function xe(n,{calls:e,multicallAddress:t,allowFailure:a=!0,...r}){let s=new Map;if(!t){let o=await n.getChainId();if(t=w(o),!t)throw new f(`No multicall address found for chain ID ${o}. Please provide a valid multicall address.`)}return(await n.call({to:t,data:n.encodeFunctionData({abi:ae.abi,fn:"aggregate3",args:{calls:e.map((o,b)=>{let{to:d,data:l,abiEntry:u}=G(o);return u&&s.set(b,u),{target:d,callData:l||"0x",allowFailure:a}})}}),...r}).then(o=>n.decodeFunctionReturn({abi:ae.abi,data:o,fn:"aggregate3"}))).map(({returnData:o,success:b},d)=>{if(!b)return{success:b,error:new f(fe(o.slice(10),{prefix:!1}))};let l=o,u=s.get(d);return u&&(l=n.decodeFunctionReturn({abi:[u],data:o,fn:u.name})),a===!1?l:{success:b,value:l}})}i(xe,"multicall");async function Ce(n,{abi:e,address:t,fn:a,args:r={},block:s}){let{abiEntry:c,data:o}=k({abi:e,fn:a,args:r}),b=await n.call({to:t,data:o,block:s});return n.decodeFunctionReturn({abi:[c],data:b,fn:a})}i(Ce,"read");async function he(n,{abi:e,fn:t,args:a={},from:r,address:s,...c}){let{abiEntry:o,data:b}=k({abi:e,fn:t,args:a}),d=await n.call({data:b,from:r??await n.getSignerAddress?.().catch(()=>{}),to:s,...c});return n.decodeFunctionReturn({abi:[o],data:d,fn:t})}i(he,"simulateWrite");function L(n,{abi:e,fn:t,args:a={},address:r,...s}){let c=n.encodeFunctionData({abi:e,fn:t,args:a});return n.sendTransaction({data:c,to:r,...s})}i(L,"write");var H=class n extends M{static{i(this,"BaseReadAdapter")}static DEFAULT_POLLING_INTERVAL=4e3;static DEFAULT_TIMEOUT=6e4;pollingInterval;pollingTimeout;multicallAddress;constructor({pollingInterval:e=n.DEFAULT_POLLING_INTERVAL,pollingTimeout:t=n.DEFAULT_TIMEOUT,multicallAddress:a}={}){super(),this.pollingInterval=e,this.pollingTimeout=t,this.multicallAddress=a}read(e){return Ce(this,e)}simulateWrite(e){return he(this,e)}multicall({multicallAddress:e=this.multicallAddress,...t}){return xe(this,{multicallAddress:e,...t})}},ge=class extends H{static{i(this,"BaseReadWriteAdapter")}deploy(e){return K(this,e)}async write(e){return L(this,e)}};function Ee(n){if(n>=100&&n<200)return"pending";if(n>=200&&n<300)return"confirmed";if(n>=400&&n<500)return"failed";if(n>=500&&n<600)return"reverted";if(n>=600&&n<700)return"partially-reverted";throw new f(`Unknown status code: ${n}`)}i(Ee,"getWalletCallsStatusLabel");function q(n,e,t){return e(n)?t(n):Array.isArray(n)?n.map(a=>q(a,e,t)):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([a,r])=>[a,q(r,e,t)])):n}i(q,"convert");import{AbiEvent as Fe,Address as Ie,Block as Me,Provider as Ke,RpcTransport as We,Transaction as Ge,TransactionReceipt as je}from"ox";var ne=class extends H{static{i(this,"DefaultReadAdapter")}provider;constructor({rpcUrl:e,...t}={}){super(t);try{let a=e?We.fromHttp(e):globalThis.ethereum;if(!a)throw new f("No provider found");this.provider=Ke.from(a)}catch(a){T(a)}}getChainId(){return this.provider.request({method:"eth_chainId"}).then(Number).catch(T)}getBlockNumber(){return this.provider.request({method:"eth_blockNumber"}).then(BigInt).catch(T)}getBlock(e){return this.provider.request(j(e)?{method:"eth_getBlockByHash",params:[e,!1]}:{method:"eth_getBlockByNumber",params:[D(e),!1]}).then(Me.fromRpc).then(t=>t?{...t,nonce:BigInt(t.nonce),transactions:t.transactions.slice()}:void 0).catch(T)}getBalance(e){return this.provider.request({method:"eth_getBalance",params:[e.address,D(e.block)]}).then(BigInt).catch(T)}getTransaction({hash:e}){return this.provider.request({method:"eth_getTransactionByHash",params:[e]}).then(t=>{if(!t)return;let{to:a,transactionIndex:r,hash:s,...c}=Ge.fromRpc(t);return{to:a||void 0,transactionIndex:BigInt(r),transactionHash:s,...c}}).catch(T)}waitForTransaction({hash:e,timeout:t=this.pollingTimeout}){return new Promise((a,r)=>{let s=i(()=>this.provider.request({method:"eth_getTransactionReceipt",params:[e]}).then(c=>{if(c){let{to:o,transactionIndex:b,contractAddress:d,...l}=je.fromRpc(c);a({to:o||void 0,transactionIndex:BigInt(b),contractAddress:d||void 0,...l})}else setTimeout(s,this.pollingInterval)}).catch(r),"getReceipt");s(),setTimeout(()=>a(void 0),t)}).catch(T)}sendRawTransaction(e){return this.provider.request({method:"eth_sendRawTransaction",params:[e]})}getEvents({abi:e,address:t,event:a,filter:r,fromBlock:s,toBlock:c}){let{abiEntry:o}=N({abi:e,type:"event",name:a,kind:"inputs",value:r});return this.provider.request({method:"eth_getLogs",params:[{address:t,fromBlock:D(s),toBlock:D(c),topics:Fe.encode(o,r||{}).topics}]}).then(b=>b.map(d=>({args:Fe.decode(o,d),blockHash:d.blockHash,blockNumber:BigInt(d.blockNumber),data:d.data,eventName:a,logIndex:Number(d.logIndex),transactionHash:d.transactionHash}))).catch(T)}call({to:e,data:t,bytecode:a,block:r,...s}){return a&&t&&(t=W(a,t)),this.provider.request({method:"eth_call",params:[{to:e,data:t,...Pe(s)},D(r)]}).catch(T)}},U=class extends ne{static{i(this,"DefaultAdapter")}getSignerAddress(){return this.provider.request({method:"eth_accounts"}).then(([e])=>{if(!e)throw new f("No signer address found");return Ie.checksum(e)}).catch(T)}async getWalletCapabilities(e){return this.provider.request({method:"wallet_getCapabilities",params:[e?.address||await this.getSignerAddress(),e?.chainIds?.map(t=>R(t))||[R(await this.getChainId())]]}).then(t=>Object.fromEntries(Object.entries(t).map(([a,r])=>[Number(a),r]))).catch(T)}getCallsStatus(e){return this.provider.request({method:"wallet_getCallsStatus",params:[e]}).then(({chainId:t,id:a,receipts:r,status:s,...c})=>({chainId:Number(t),id:a,statusCode:s,status:Ee(s),receipts:r?.map(({blockNumber:o,gasUsed:b,status:d,...l})=>({blockNumber:BigInt(o),gasUsed:BigInt(b),status:d==="0x1"?"success":"reverted",...l})),...c})).catch(T)}showCallsStatus(e){return this.provider.request({method:"wallet_showCallsStatus",params:[e]}).catch(T)}async sendTransaction({data:e,to:t,from:a,onMined:r,onMinedTimeout:s,...c}){return a??=await this.getSignerAddress().catch(T),this.provider.request({method:"eth_sendTransaction",params:[{data:e,to:t,from:a,...Pe(c)}]}).then(o=>(r&&this.waitForTransaction({hash:o,timeout:s}).then(r),o)).catch(T)}deploy(e){return K(this,e)}write(e){return L(this,e)}async sendCalls(e){return this.provider.request({method:"wallet_sendCalls",params:[{version:e.version||"2.0.0",id:e.id,chainId:R(e.chainId??await this.getChainId()),from:e.from??await this.getSignerAddress(),atomicRequired:e.atomic??!0,calls:e.calls.map(({capabilities:t,value:a,...r})=>{let{to:s,data:c}=G(r);return{to:s,data:c,capabilities:t,value:a?R(a):void 0}}),capabilities:e.capabilities}]}).catch(T)}};function D(n){return n===void 0?"latest":typeof n=="bigint"?R(n):n}i(D,"prepareBlockParam");function Pe(n){return q(n,e=>typeof e=="bigint"||typeof e=="number",e=>R(e))}i(Pe,"prepareTransactionOptions");import{LRUCache as Le}from"lru-cache";var S=class extends Le{static{i(this,"LruStore")}constructor(e={max:500}){super(e)}};import qe from"safe-stable-stringify";function _(n){return qe(n,(e,t)=>typeof t=="bigint"?`${t}n`:t)}i(_,"stringifyKey");function re(n){return JSON.parse(n,(e,t)=>typeof t=="string"&&/^-?\d+n$/.test(t)?BigInt(t.slice(0,-1)):t)}i(re,"parseKey");import Ue from"lodash.ismatch";async function B({store:n,matchKey:e}){e=await e;let t=re(e),a=[];for await(let[r]of n.entries()){if(r===e){a.push(n.delete(r));continue}let s=re(r);Ue(s,t)&&a.push(n.delete(r))}await Promise.all(a)}i(B,"deleteMatches");async function C({store:n,key:e,fn:t}){if(e=await e,await n.has(e))return n.get(e);let a=await t();return a===void 0||await n.set(e,a),a}i(C,"getOrSet");var O=class{static{i(this,"ClientCache")}namespace;store;constructor({namespace:e,store:t=new S}){this.namespace=e,this.store=t}async clear(){return this.store.clear()}async blockKey(e){return this.#n("block",{block:e})}async preloadBlock({value:e,block:t}){let a=await this.blockKey(t);return this.store.set(a,e)}async getBlock(e){let t=await this.blockKey(e);return this.store.get(t)}async invalidateBlock(e){let t=await this.blockKey(e);return this.store.delete(t)}async clearBlocks(){return B({store:this.store,matchKey:this.blockKey()})}#e({address:e,block:t}={}){return this.#n("balance",{address:e,block:t})}async balanceKey(e){return this.#e(e)}async preloadBalance({value:e,...t}){let a=await this.balanceKey(t);return this.store.set(a,e)}async getBalance(e){let t=await this.balanceKey(e);return this.store.get(t)}async invalidateBalance(e){let t=await this.balanceKey(e);return this.store.delete(t)}async clearBalances(){return B({store:this.store,matchKey:this.#e()})}#t({hash:e}={}){return this.#n("transaction",{hash:e})}async transactionKey({hash:e}){return this.#t({hash:e})}async preloadTransaction({value:e,...t}){let a=await this.transactionKey(t);return this.store.set(a,e)}async getTransaction(e){let t=await this.transactionKey(e);return this.store.get(t)}async invalidateTransaction(e){let t=await this.transactionKey(e);return this.store.delete(t)}async clearTransactions(){return B({store:this.store,matchKey:this.#t()})}async transactionReceiptKey({hash:e}){return this.#n("transactionReceipt",{hash:e})}async preloadTransactionReceipt({value:e,...t}){let a=await this.transactionReceiptKey(t);return this.store.set(a,e)}async getTransactionReceipt(e){let t=await this.transactionReceiptKey(e);return this.store.get(t)}#a({to:e,data:t,value:a,from:r,block:s,accessList:c,blobVersionedHashes:o,chainId:b,blobs:d,bytecode:l,nonce:u}={}){return this.#n("call",{to:e,data:t,value:a,from:r,block:s,accessList:c,blobVersionedHashes:o,chainId:b,blobs:d,bytecode:l,nonce:u})}async callKey(e){return this.#a(e)}async preloadCall({preloadValue:e,...t}){let a=await this.callKey(t);return this.store.set(a,e)}async getCall(e){let t=await this.callKey(e);return this.store.get(t)}async invalidateCall(e){let t=await this.callKey(e);return this.store.delete(t)}async invalidateCallsMatching(e){return B({store:this.store,matchKey:this.#a(e)})}async clearCalls(){return this.invalidateCallsMatching()}async eventsKey({address:e,event:t,filter:a,fromBlock:r="earliest",toBlock:s="latest"}){return this.#n("events",{address:e,event:t,filter:a,fromBlock:r,toBlock:s})}async preloadEvents({value:e,...t}){let a=await this.eventsKey(t);return this.store.set(a,e)}async getEvents(e){let t=await this.eventsKey(e);return this.store.get(t)}#r({address:e,args:t,block:a,fn:r}={}){return this.#n("read",{address:e,args:t,block:a,fn:r})}async readKey(e){return this.#r(e)}async preloadRead({value:e,...t}){let a=await this.readKey(t);return this.store.set(a,e)}async getRead(e){let t=await this.readKey(e);return this.store.get(t)}async invalidateRead(e){let t=await this.readKey(e);return this.store.delete(t)}async invalidateReadsMatching(e){return B({store:this.store,matchKey:this.#r(e)})}async clearReads(){return this.invalidateReadsMatching()}async#i(){return typeof this.namespace=="function"&&(this.namespace=await this.namespace()),this.namespace}async#n(...e){let t=await this.#i();return _([t,...e])}};var $=class extends f{static{i(this,"BlockNotFoundError")}constructor(e,t){super(`Block not found: ${e}`,t)}};var V=class{static{i(this,"HookRegistry")}#e={};on(e,t){this.#e[e]||=[],this.#e[e].push(t)}off(e,t){let a=!1,r=this.#e[e];return r&&(this.#e[e]=r.filter(s=>s===t?(a=!0,!1):!0)),a}once(e,t){let a=i(r=>{this.off(e,a),t(r)},"wrapped");this.on(e,a)}call(e,t){let a,r=this.#e[e];if(r)for(let s of r)a instanceof Promise?a=a.then(()=>s(t)):a=s(t);return a}};var z=class{static{i(this,"MethodInterceptor")}#e=new V;get hooks(){return this.#e}createProxy=i(e=>new Proxy(e,{get:i((t,a,r)=>{let s=Reflect.get(t,a,r);if(a==="constructor"||typeof s!="function")return s;let c=i((...o)=>this.#t({method:a,fn:s.bind(r),args:o}),"wrapped");return Object.defineProperty(c,"name",{get:i(()=>s.name,"get")}),c},"get")}),"createProxy");#t({method:e,fn:t,args:a}){let r=String(e),s=!1,c,o=this.#e.call(`before:${r}`,{get args(){return a},setArgs(...d){a=d},resolve(d){s||(s=!0,c=d)}}),b=i(()=>{s||(c=t(...a));let d=this.#e.call(`after:${r}`,{get args(){return a},get result(){return c},setResult(l){c=l}});return d instanceof Promise?d.then(()=>c):c},"wrappedAfterHooks");return o instanceof Promise?o.then(b):b()}};var Q=class{static{i(this,"MicrotaskQueue")}pending=[];maxBatchSize;#e;constructor({batchFn:e,maxBatchSize:t}){this.maxBatchSize=t,this.#e=e}submit(e){return new Promise((t,a)=>{this.pending.push({request:e,resolve:t,reject:a}),this.pending.length===1&&queueMicrotask(()=>{let r=this.pending;this.pending=[];let s=this.maxBatchSize||r.length,c=[];for(let o=0;o<r.length;o+=s)c.push(r.slice(o,o+s));for(let o of c)try{this.#e(o).catch(b=>{for(let{reject:d}of o)d(b)})}catch(b){for(let{reject:d}of o)d(b)}})})}};async function J({adapter:n,cache:e,params:{calls:t,multicallAddress:a,allowFailure:r,...s}}){let c=new Map,o=[],b=await Promise.all(t.map(async(l,u)=>{let y;if(l.abi?y=await e.getRead({...l,block:s?.block}):y=await e.getCall({...l,...s}),y!==void 0)return r===!1?y:{success:!0,value:y};c.set(u,o.length),o.push(l)}));if(!o.length)return b;let d=await n.multicall({calls:o,multicallAddress:a,allowFailure:r,...s});return Promise.all(b.map(async(l,u)=>{if(l!==void 0)return l;let y=c.get(u),{abi:x,address:h,fn:E,args:F,to:v,data:A}=o[y],P=d[y],g=r===!1?P:P.value;return g!==void 0&&(x?await e.preloadRead({abi:x,address:h,fn:E,args:F,block:s?.block,value:g}):await e.preloadCall({to:v,data:A,...s,preloadValue:g})),P}))}i(J,"cachedMulticall");var X=class extends Q{static{i(this,"MulticallQueue")}#e;#t;#a;constructor({adapter:e,cache:t,getChainId:a,maxBatchSize:r}){super({maxBatchSize:r,batchFn:i(s=>this.#r(s),"batchFn")}),this.#e=e,this.#t=t,this.#a=a}async#r(e){if(e.length===1){let{reject:a,request:r,resolve:s}=e[0];return this.#s(r).then(s).catch(a)}let t=new Map;for(let{request:a,resolve:r,reject:s}of e){let{abi:c,address:o,fn:b,args:d,to:l,data:u,...y}=a,x={abi:c,address:o,fn:b,args:d,to:l,data:u},h=_(y),E=t.get(h);E?(E.calls.push(x),E.callbacks.push({resolve:r,reject:s})):t.set(h,{calls:[x],callbacks:[{resolve:r,reject:s}],options:y})}return Promise.all(t.values().map(a=>this.#i(a)))}async#i(e){if(e.calls.length===1)return this.#n(e);let{calls:t,callbacks:a,options:r}=e,s=await this.#a(),c=w(s);return J({adapter:this.#e,cache:this.#t,params:{calls:t,multicallAddress:c,allowFailure:!0,...r}}).then(o=>{for(let[b,d]of o.entries()){let{resolve:l,reject:u}=e.callbacks[b]||{};d.success?l?.(d.value):u?.(d.error)}}).catch(o=>{if(!c)return this.#n(e);for(let{reject:b}of a)b(o)})}#n({calls:e,callbacks:t,options:a}){return Promise.all(e.map((r,s)=>{let c={...r,...a},{resolve:o,reject:b}=t[s]||{};return this.#s(c).then(o).catch(b)}))}#s(e){return e.abi?C({store:this.#t.store,key:this.#t.readKey(e),fn:i(()=>this.#e.read(e),"fn")}):C({store:this.#t.store,key:this.#t.callKey(e),fn:i(()=>this.#e.call(e),"fn")})}};function ie(n={}){let{adapter:e,store:t,chainId:a,batch:r=!0,maxBatchSize:s,...c}=n,o=new z,b=e||new U(c),l=t&&"clear"in t?t:new S(t);async function u(){return a??=await b.getChainId(),a}i(u,"getChainId");let y=new O({store:l,namespace:u}),x=r?new X({adapter:b,cache:y,getChainId:u,maxBatchSize:s}):void 0,h={...b,adapter:b,hooks:o.hooks,cache:y,isReadWrite(){return typeof this.adapter.write=="function"},extend(A){return Object.assign(this,A)},getChainId:u,async getBlock(A,P){let g=await C({store:this.cache.store,key:this.cache.blockKey(A),fn:i(()=>this.adapter.getBlock(A),"fn")});if(!g&&P?.throws)throw new $(A);return g},getBalance(A){return C({store:this.cache.store,key:this.cache.balanceKey(A),fn:i(()=>this.adapter.getBalance(A),"fn")})},getTransaction(A){return C({store:this.cache.store,key:this.cache.transactionKey(A),fn:i(()=>this.adapter.getTransaction(A),"fn")})},waitForTransaction(A){return C({store:this.cache.store,key:this.cache.transactionReceiptKey(A),fn:i(()=>this.adapter.waitForTransaction(A),"fn")})},getEvents({fromBlock:A="earliest",toBlock:P="latest",...g}){let oe={fromBlock:A,toBlock:P,...g};return C({store:this.cache.store,key:this.cache.eventsKey(oe),fn:i(async()=>this.adapter.getEvents(oe),"fn")})},call(A){return x?.submit(A)??C({store:this.cache.store,key:this.cache.callKey(A),fn:i(()=>this.adapter.call(A),"fn")})},read(A){return x?.submit(A)??C({store:this.cache.store,key:this.cache.readKey(A),fn:i(()=>this.adapter.read(A),"fn")})},async multicall({multicallAddress:A,...P}){if(!A){let g=await this.getChainId();A=w(g)}return J({adapter:this.adapter,cache:this.cache,params:{multicallAddress:A,...P}})}},E=Object.getPrototypeOf(b);function F(){}i(F,"Client"),Object.defineProperties(F,{name:{value:`Client<${b.constructor.name}>`,enumerable:!1,writable:!1,configurable:!0}}),F.prototype=Object.create(E,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0},[Symbol.toStringTag]:{value:F.name,enumerable:!1,writable:!0,configurable:!0}});let v=Object.create(F.prototype,Object.getOwnPropertyDescriptors(h));return o.createProxy(v)}i(ie,"createClient");var Z=class{static{i(this,"ContractCache")}#e;#t;#a;constructor({abi:e,address:t,...a}){let r=a.clientCache?a.clientCache:new O(a);this.#e=e,this.#t=t,this.#a=r}get store(){return this.#a.store}clear(){return this.#a.clear()}eventsKey(e,t){return this.#a.eventsKey({abi:this.#e,address:this.#t,event:e,...t})}preloadEvents(e){return this.#a.preloadEvents({abi:this.#e,address:this.#t,...e})}getEvents(e,t){return this.#a.getEvents({abi:this.#e,address:this.#t,event:e,...t})}readKey(...[e,t,a]){return this.#a.readKey({abi:this.#e,address:this.#t,fn:e,args:t,...a})}preloadRead(e){return this.#a.preloadRead({abi:this.#e,address:this.#t,...e})}getRead(...[e,t,a]){return this.#a.getRead({abi:this.#e,address:this.#t,fn:e,args:t,...a})}invalidateRead(...[e,t,a]){return this.#a.invalidateRead({abi:this.#e,address:this.#t,fn:e,args:t,...a})}invalidateReadsMatching(e,t,a){return this.#a.invalidateReadsMatching({abi:this.#e,address:this.#t,fn:e,args:t,...a})}async clearReads(){return this.#a.invalidateReadsMatching({abi:this.#e,address:this.#t})}};var Y=class{static{i(this,"ReadContract")}abi;address;client;cache;epochBlock;constructor({abi:e,address:t,epochBlock:a,client:r,...s}){this.abi=e,this.address=t,this.client=r??ie(s),this.cache=new Z({abi:e,address:t,clientCache:this.client.cache}),this.epochBlock=a}isReadWrite(){return this.client.isReadWrite()}extend(e){return Object.assign(this,e)}encodeDeployData(...[e,t]){return this.client.encodeDeployData({abi:this.abi,bytecode:e,args:t})}encodeFunctionData(...[e,t]){return this.client.encodeFunctionData({abi:this.abi,fn:e,args:t})}encodeFunctionReturn(e,t){return this.client.encodeFunctionReturn({abi:this.abi,fn:e,value:t})}decodeFunctionData(e){return this.client.decodeFunctionData({abi:this.abi,data:e})}decodeFunctionReturn(e,t){return this.client.decodeFunctionReturn({abi:this.abi,fn:e,data:t})}getEvents(e,{fromBlock:t,...a}={}){return this.epochBlock&&(!t||t==="earliest"||typeof t=="bigint"&&t<this.epochBlock)&&(t=this.epochBlock),this.client.getEvents({abi:this.abi,address:this.address,event:e,fromBlock:t,...a})}read(...[e,t,a]){return this.client.read({abi:this.abi,address:this.address,fn:e,args:t,...a})}simulateWrite(...[e,t,a]){return this.client.simulateWrite({abi:this.abi,address:this.address,fn:e,args:t,...a})}async multicall({calls:e,...t}){return this.client.multicall({calls:e.map(a=>({abi:this.abi,address:this.address,...a})),...t})}},se=class extends Y{static{i(this,"ReadWriteContract")}getSignerAddress(){return this.client.getSignerAddress()}write(...[e,t,a]){return this.client.write({abi:this.abi,address:this.address,fn:e,args:t,...a})}};function vr({abi:n,address:e,epochBlock:t,client:a,...r}){return a=a||ie(r),a.isReadWrite()?new se({abi:n,address:e,client:a,epochBlock:t}):new Y({abi:n,address:e,client:a,epochBlock:t})}i(vr,"createContract");var Or="0x0000000000000000000000000000000000000000";export{i as a,I as b,f as c,ce as d,be as e,le as f,N as g,me as h,ee as i,ue as j,k,Ae as l,He as m,M as n,K as o,w as p,W as q,G as r,ae as s,De as t,j as u,R as v,fe as w,xe as x,Ce as y,he as z,L as A,H as B,ge as C,Ee as D,q as E,ne as F,U as G,S as H,_ as I,re as J,B as K,C as L,O as M,$ as N,z as O,ie as P,Z as Q,Y as R,se as S,vr as T,Or as U};
//# sourceMappingURL=chunk-CLUZ6G7I.js.map

Sorry, the diff of this file is too big to display

+1
-1

@@ -1,2 +0,2 @@

import{A as k,B,C as W,D as H,E as N,F as G,G as K,H as L,I as j,J as $,K as q,L as U,M as X,N as V,O as Z,P as s,Q as z,R as J,S as Q,T as i,U as Y,a as n,b as u,c as r,d as l,e as m,f as c,g as f,h as T,i as b,j as x,k as v,l as A,m as M,n as w,o as C,p as _,q as h,r as O,s as R,t as S,u as D,v as F,w as E,x as g,y as I,z as P}from"./chunk-J65G2IHC.js";var p=class extends r{static{n(this,"NotImplementedError")}constructor({method:a,message:d,...y}){super(`Method not implemented: \`${String(a)}\`.${d?`
import{A as k,B,C as W,D as H,E as N,F as G,G as K,H as L,I as j,J as $,K as q,L as U,M as X,N as V,O as Z,P as s,Q as z,R as J,S as Q,T as i,U as Y,a as n,b as u,c as r,d as l,e as m,f as c,g as f,h as T,i as b,j as x,k as v,l as A,m as M,n as w,o as C,p as _,q as h,r as O,s as R,t as S,u as D,v as F,w as E,x as g,y as I,z as P}from"./chunk-CLUZ6G7I.js";var p=class extends r{static{n(this,"NotImplementedError")}constructor({method:a,message:d,...y}){super(`Method not implemented: \`${String(a)}\`.${d?`

@@ -3,0 +3,0 @@ ${d}

@@ -126,3 +126,3 @@ import * as sinon from 'sinon';

getBlockNumber(): Promise<bigint>;
onGetBlock<T extends BlockIdentifier | undefined = undefined>(block?: T): sinon.SinonStub<[block?: T | undefined], Promise<GetBlockReturn<T>>>;
onGetBlock<T extends BlockIdentifier | undefined>(block?: T): sinon.SinonStub<[block?: T | undefined], Promise<GetBlockReturn<T>>>;
getBlock<T extends BlockIdentifier | undefined = undefined>(block?: T): Promise<GetBlockReturn<T>>;

@@ -149,3 +149,3 @@ onGetBalance(params?: Partial<GetBalanceParams>): sinon.SinonStub<[GetBalanceParams], Promise<bigint>>;

getSignerAddress(): Promise<`0x${string}`>;
onGetWalletCapabilities<const TChainIds extends readonly number[] = []>(params?: GetWalletCapabilitiesParams<TChainIds>): sinon.SinonStub<[(GetWalletCapabilitiesParams<TChainIds> | undefined)?], Promise<WalletCapabilities<TChainIds>>>;
onGetWalletCapabilities<const TChainIds extends readonly number[]>(params?: GetWalletCapabilitiesParams<TChainIds>): sinon.SinonStub<[(GetWalletCapabilitiesParams<TChainIds> | undefined)?], Promise<WalletCapabilities<TChainIds>>>;
getWalletCapabilities<const TChainIds extends readonly number[] = []>(params?: GetWalletCapabilitiesParams<TChainIds>): Promise<WalletCapabilities<TChainIds>>;

@@ -152,0 +152,0 @@ onGetCallsStatus<TId extends HexString>(batchId?: TId): sinon.SinonStub<[batchId: TId], Promise<WalletCallsStatus<TId>>>;

@@ -126,3 +126,3 @@ import * as sinon from 'sinon';

getBlockNumber(): Promise<bigint>;
onGetBlock<T extends BlockIdentifier | undefined = undefined>(block?: T): sinon.SinonStub<[block?: T | undefined], Promise<GetBlockReturn<T>>>;
onGetBlock<T extends BlockIdentifier | undefined>(block?: T): sinon.SinonStub<[block?: T | undefined], Promise<GetBlockReturn<T>>>;
getBlock<T extends BlockIdentifier | undefined = undefined>(block?: T): Promise<GetBlockReturn<T>>;

@@ -149,3 +149,3 @@ onGetBalance(params?: Partial<GetBalanceParams>): sinon.SinonStub<[GetBalanceParams], Promise<bigint>>;

getSignerAddress(): Promise<`0x${string}`>;
onGetWalletCapabilities<const TChainIds extends readonly number[] = []>(params?: GetWalletCapabilitiesParams<TChainIds>): sinon.SinonStub<[(GetWalletCapabilitiesParams<TChainIds> | undefined)?], Promise<WalletCapabilities<TChainIds>>>;
onGetWalletCapabilities<const TChainIds extends readonly number[]>(params?: GetWalletCapabilitiesParams<TChainIds>): sinon.SinonStub<[(GetWalletCapabilitiesParams<TChainIds> | undefined)?], Promise<WalletCapabilities<TChainIds>>>;
getWalletCapabilities<const TChainIds extends readonly number[] = []>(params?: GetWalletCapabilitiesParams<TChainIds>): Promise<WalletCapabilities<TChainIds>>;

@@ -152,0 +152,0 @@ onGetCallsStatus<TId extends HexString>(batchId?: TId): sinon.SinonStub<[batchId: TId], Promise<WalletCallsStatus<TId>>>;

@@ -1,2 +0,2 @@

import{D as O,E as S,I as x,J as v,P as W,S as K,U as B,a as r,c as E,n as w,v as R}from"./chunk-J65G2IHC.js";import H from"lodash.ismatch";import{stub as $}from"sinon";import I from"safe-stable-stringify";function G(a,e=!0){e&&(a=S(a,n=>n&&typeof n=="object"&&"abi"in n,({abi:n,...b})=>({abi:I(n)?.replace(/(?<=.{100}).+/,"\u2026]"),...b})));let t=I(a,_,2)?.replaceAll('\\"','"')?.replace(/"([^"]+)"(:)|"(\d+n)"/g,"$1$2$3")?.replace(/"(\[.*?\])"/g,"$1");return t?.length&&t.length<40?t.replaceAll(/\n\s*/g," "):t}r(G,"formatArgsForDisplay");function _(a,e){return typeof e=="bigint"?`${e}n`:e}r(_,"bigintReplacer");var g=class{static{r(this,"StubStore")}#e=new Map;reset(e){return e?this.#e.delete(e):this.#e.clear()}has(e){let{method:t,key:n,matchPartial:b}=e,o=this.#e.get(t);if(!o)return!1;if(!n)return!!o.defaultStub;let f=x(n);if(o.keyedStubs.has(f))return!0;if(!b)return!1;if(o.defaultStub)return!0;if(!o.keyedStubs.size)return!1;let s=typeof n!="object"?[n]:n;for(let p of o.keyedStubs.keys())if(H(s,v(p)))return!0;return!1}get(e){let{method:t,key:n,matchPartial:b,create:o}=e,f=String(t),s=this.#e.get(t);if(!s&&(s={defaultStub:void 0,keyedStubs:new Map},this.#e.set(t,s),o)){let m=o(T(f));if(n){let C=x(n);s.keyedStubs.set(C,m)}else s.defaultStub=m;return m}if(!n)return s.defaultStub||=o?o(T(f)):T(f),s.defaultStub;let p=x(n);if(s.keyedStubs.has(p))return s.keyedStubs.get(p);if(b){let m=s.defaultStub;if(s.keyedStubs.size){let C=typeof n!="object"?[n]:n,M="";for(let[k,L]of s.keyedStubs.entries())k.length>M.length&&H(C,v(k))&&(m=L,M=k)}if(m)return m}let F=o?o(T(f)):T(f);return s.keyedStubs.set(p,F),F}},y=class extends E{static{r(this,"MissingStubError")}constructor({method:e,args:t,...n}){super(z(String(e),t),n)}};function T(a){return $().callsFake((...e)=>{throw new y({method:a,args:e})})}r(T,"createDefaultStub");function z(a,e){let t=`Missing stub for mock method call.
import{D as O,E as S,I as x,J as v,P as W,S as K,U as B,a as r,c as E,n as w,v as R}from"./chunk-CLUZ6G7I.js";import H from"lodash.ismatch";import{stub as $}from"sinon";import I from"safe-stable-stringify";function G(a,e=!0){e&&(a=S(a,n=>n&&typeof n=="object"&&"abi"in n,({abi:n,...b})=>({abi:I(n)?.replace(/(?<=.{100}).+/,"\u2026]"),...b})));let t=I(a,_,2)?.replaceAll('\\"','"')?.replace(/"([^"]+)"(:)|"(\d+n)"/g,"$1$2$3")?.replace(/"(\[.*?\])"/g,"$1");return t?.length&&t.length<40?t.replaceAll(/\n\s*/g," "):t}r(G,"formatArgsForDisplay");function _(a,e){return typeof e=="bigint"?`${e}n`:e}r(_,"bigintReplacer");var g=class{static{r(this,"StubStore")}#e=new Map;reset(e){return e?this.#e.delete(e):this.#e.clear()}has(e){let{method:t,key:n,matchPartial:b}=e,o=this.#e.get(t);if(!o)return!1;if(!n)return!!o.defaultStub;let f=x(n);if(o.keyedStubs.has(f))return!0;if(!b)return!1;if(o.defaultStub)return!0;if(!o.keyedStubs.size)return!1;let s=typeof n!="object"?[n]:n;for(let p of o.keyedStubs.keys())if(H(s,v(p)))return!0;return!1}get(e){let{method:t,key:n,matchPartial:b,create:o}=e,f=String(t),s=this.#e.get(t);if(!s&&(s={defaultStub:void 0,keyedStubs:new Map},this.#e.set(t,s),o)){let m=o(T(f));if(n){let C=x(n);s.keyedStubs.set(C,m)}else s.defaultStub=m;return m}if(!n)return s.defaultStub||=o?o(T(f)):T(f),s.defaultStub;let p=x(n);if(s.keyedStubs.has(p))return s.keyedStubs.get(p);if(b){let m=s.defaultStub;if(s.keyedStubs.size){let C=typeof n!="object"?[n]:n,M="";for(let[k,L]of s.keyedStubs.entries())k.length>M.length&&H(C,v(k))&&(m=L,M=k)}if(m)return m}let F=o?o(T(f)):T(f);return s.keyedStubs.set(p,F),F}},y=class extends E{static{r(this,"MissingStubError")}constructor({method:e,args:t,...n}){super(z(String(e),t),n)}};function T(a){return $().callsFake((...e)=>{throw new y({method:a,args:e})})}r(T,"createDefaultStub");function z(a,e){let t=`Missing stub for mock method call.

@@ -3,0 +3,0 @@ method: "${a}"`;e&&(t+=`

{
"name": "@delvtech/drift",
"description": "Effortless ethereum development across Web3 libraries",
"version": "1.0.0",
"version": "1.0.1",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "author": "Ryan Goree (https://github.com/ryangoree)",

var Re=Object.defineProperty;var i=(n,e)=>Re(n,"name",{value:e,configurable:!0});import{AbiItem as we}from"ox";function I({abi:n,name:e,kind:t,values:a}){let r=we.fromAbi(n,e,{args:a});return!r||!(t in r)?{}:Object.fromEntries(r[t].map(({name:s},c)=>[s||c,a?.[c]]))}i(I,"arrayToObject");var f=class n extends Error{static prefix="\u2716 ";static name="Drift Error";constructor(e,t){let a;try{a=e?.message??String(e)}catch{throw e}super(a),this.name=t?.name??this.constructor.name;let r=e instanceof Error,s=t?.cause??e?.cause,c=e;r||(c=new Error,Error.captureStackTrace?.(c,new.target));let o=c.stack,b;e?.name&&!["Error",this.name].includes(e.name)?b=e.name:r&&!["Error",this.name].includes(e.constructor.name)&&(b=e.constructor.name),Object.defineProperty(this,"stack",{get(){let d=`${t?.prefix??n.prefix}${this.name}`;if(b&&(d+=` [${b}]`),this.message&&(d+=`: ${this.message}`.replaceAll(`
`,`
`)),o){let l=o.split(`
`).slice(1);this.message&&(l=l.filter(m=>!this.message.includes(m.trim()))),l.length&&(d+=`
${l.join(`
`)}`)}return s&&(d+=`
Caused by: ${s.stack||s}`.replaceAll(`
`,`
`)),d.trim()}})}};import{AbiFunction as Se,AbiParameters as Oe,Hex as ce}from"ox";function T(n){if(typeof n!="object")throw new f(n);let e={message:""},t;try{t=JSON.parse(n.details)}catch{}throw n.shortMessage&&(e.message+=n.shortMessage),t?.message&&(e.message+=`
${t.message}`),e.message+=`
${n.message.replace(n.shortMessage,"").trimStart()}`,e.message=e.message.trimStart(),new f(e)}i(T,"handleError");function be({abi:n,data:e}){try{let t=ce.slice(e,0,4),a=ce.slice(e,4),r=Se.fromAbi(n,t),s=Oe.decode(r.inputs,a,{as:"Array",checksumAddress:!0}),c=r.name,o=I({abi:n,name:c,kind:"inputs",values:s});return{functionName:c,args:o}}catch(t){T(t)}}i(be,"decodeFunctionData");function de({abi:n,name:e,kind:t,values:a}){let r=I({abi:n,name:e,kind:t,values:a}),s=Object.values(r);return s.length===1?s[0]:r}i(de,"arrayToSimplified");import{AbiFunction as le}from"ox";function pe({abi:n,data:e,fn:t}){try{let a=le.fromAbi(n,t),r=le.decodeResult(a,e,{as:"Array"});return a.outputs.length===1?r:de({abi:n,name:a.name,kind:"outputs",values:r})}catch(a){T(a)}}i(pe,"decodeFunctionReturn");var Be={type:"constructor",inputs:[],stateMutability:"nonpayable"};function N({abi:n,type:e,name:t,kind:a,value:r}){let s=n.filter(l=>l.type!==e||l.name!==t?!1:a in l);if(!s.length){if(e==="constructor")return{abiEntry:Be,params:[]};throw new f(`No matching ABI entry for ${e} ${t} with ${a}`)}if(s.length===1){let l=s[0],m=l[a];return m.length?ue(r,m)?{abiEntry:l,params:[r]}:{abiEntry:l,params:m.map(({name:y},x)=>r?.[y||x])}:{abiEntry:l,params:[]}}let c=r&&typeof r=="object"?Object.keys(r).length:0,o=s[0],b=[],d=0;for(let l of s){let m=l[a];if(!m.length){if(!c)return{abiEntry:l,params:[]};continue}if(ue(r,m))return{abiEntry:l,params:[r]};let y=r||{},x=[],h=0;for(let[g,{name:F}]of m.entries()){let R=F||g;x.push(y[R]),R in y&&h++}h>d&&(o=l,b=x,d=h)}return{abiEntry:o,params:b}}i(N,"prepareParams");function ue(n,e){if(e.length!==1)return!1;if(!n)return!0;let{type:t,name:a}=e[0],r=t.match(/(\[\d*\])+$/)?.[0];if(!r)return typeof n!="object";if(!Array.isArray(n))return!1;if(a)return!0;let s=n;for(let c of r.match(/\[\d*]/g))s=s?.[0];return!Array.isArray(s)}i(ue,"isUnpacked");import{AbiConstructor as He}from"ox";function me(n){return ee(n).data}i(me,"encodeDeployData");function ee({abi:n,args:e,bytecode:t}){try{let{abiEntry:a,params:r}=N({abi:n,type:"constructor",name:void 0,kind:"inputs",value:e});return{abiEntry:a,data:He.encode(a,{args:r,bytecode:t})}}catch(a){T(a)}}i(ee,"prepareDeployData");import{AbiFunction as De}from"ox";function Ae(n){return k(n).data}i(Ae,"encodeFunctionData");function k({abi:n,args:e,fn:t}){try{let{abiEntry:a,params:r}=N({abi:n,type:"function",name:t,kind:"inputs",value:e});return{abiEntry:a,data:De.encodeData(a,r)}}catch(a){T(a)}}i(k,"prepareFunctionData");import{AbiFunction as Ie}from"ox";function Te(n){return Me(n).data}i(Te,"encodeFunctionReturn");function Me({abi:n,fn:e,value:t}){try{let{abiEntry:a,params:r}=N({abi:n,type:"function",name:e,kind:"outputs",value:t});return{abiEntry:a,data:Ie.encodeResult(a,r,{as:"Array"})}}catch(a){T(a)}}i(Me,"prepareFunctionReturn");var M=class{static{i(this,"AbiEncoder")}encodeDeployData(e){return me(e)}encodeFunctionData(e){return Ae(e)}encodeFunctionReturn(e){return Te(e)}decodeFunctionData(e){return be(e)}decodeFunctionReturn(e){return pe(e)}};function K(n,{abi:e,bytecode:t,args:a={},...r}){let s=n.encodeDeployData({abi:e,bytecode:t,args:a});return n.sendTransaction({data:s,...r})}i(K,"deploy");var ye={1:"0xcA11bde05977b3631167028862bE2a173976CA11",3:"0xcA11bde05977b3631167028862bE2a173976CA11",4:"0xcA11bde05977b3631167028862bE2a173976CA11",5:"0xcA11bde05977b3631167028862bE2a173976CA11",10:"0xcA11bde05977b3631167028862bE2a173976CA11",14:"0xcA11bde05977b3631167028862bE2a173976CA11",16:"0xcA11bde05977b3631167028862bE2a173976CA11",18:"0xcA11bde05977b3631167028862bE2a173976CA11",19:"0xcA11bde05977b3631167028862bE2a173976CA11",25:"0xcA11bde05977b3631167028862bE2a173976CA11",30:"0xcA11bde05977b3631167028862bE2a173976CA11",31:"0xcA11bde05977b3631167028862bE2a173976CA11",40:"0xcA11bde05977b3631167028862bE2a173976CA11",42:"0xcA11bde05977b3631167028862bE2a173976CA11",44:"0xca11bde05977b3631167028862be2a173976ca11",46:"0xca11bde05977b3631167028862be2a173976ca11",56:"0xcA11bde05977b3631167028862bE2a173976CA11",57:"0xcA11bde05977b3631167028862bE2a173976CA11",58:"0xca11bde05977b3631167028862be2a173976ca11",61:"0xcA11bde05977b3631167028862bE2a173976CA11",66:"0xcA11bde05977b3631167028862bE2a173976CA11",69:"0xcA11bde05977b3631167028862bE2a173976CA11",82:"0xca11bde05977b3631167028862be2a173976ca11",83:"0xca11bde05977b3631167028862be2a173976ca11",88:"0xcA11bde05977b3631167028862bE2a173976CA11",89:"0xca11bde05977b3631167028862be2a173976ca11",97:"0xcA11bde05977b3631167028862bE2a173976CA11",100:"0xcA11bde05977b3631167028862bE2a173976CA11",106:"0xcA11bde05977b3631167028862bE2a173976CA11",108:"0xcA11bde05977b3631167028862bE2a173976CA11",109:"0xcA11bde05977b3631167028862bE2a173976CA11",114:"0xcA11bde05977b3631167028862bE2a173976CA11",122:"0xcA11bde05977b3631167028862bE2a173976CA11",128:"0xcA11bde05977b3631167028862bE2a173976CA11",137:"0xcA11bde05977b3631167028862bE2a173976CA11",138:"0xcA11bde05977b3631167028862bE2a173976CA11",146:"0xca11bde05977b3631167028862be2a173976ca11",148:"0xcA11bde05977b3631167028862bE2a173976CA11",169:"0xcA11bde05977b3631167028862bE2a173976CA11",195:"0xca11bde05977b3631167028862be2a173976ca11",196:"0xcA11bde05977b3631167028862bE2a173976CA11",199:"0xca11bde05977b3631167028862be2a173976ca11",204:"0xcA11bde05977b3631167028862bE2a173976CA11",250:"0xcA11bde05977b3631167028862bE2a173976CA11",252:"0xcA11bde05977b3631167028862bE2a173976CA11",255:"0xcA11bde05977b3631167028862bE2a173976CA11",280:"0xF9cda624FBC7e059355ce98a31693d299FACd963",288:"0xcA11bde05977b3631167028862bE2a173976CA11",300:"0xF9cda624FBC7e059355ce98a31693d299FACd963",311:"0xcA11bde05977b3631167028862bE2a173976CA11",314:"0xcA11bde05977b3631167028862bE2a173976CA11",321:"0xcA11bde05977b3631167028862bE2a173976CA11",324:"0xF9cda624FBC7e059355ce98a31693d299FACd963",335:"0xcA11bde05977b3631167028862bE2a173976CA11",338:"0xcA11bde05977b3631167028862bE2a173976CA11",369:"0xcA11bde05977b3631167028862bE2a173976CA11",420:"0xcA11bde05977b3631167028862bE2a173976CA11",424:"0xcA11bde05977b3631167028862bE2a173976CA11",462:"0xca11bde05977b3631167028862be2a173976ca11",463:"0xca11bde05977b3631167028862be2a173976ca11",480:"0xcA11bde05977b3631167028862bE2a173976CA11",499:"0xcA11bde05977b3631167028862bE2a173976CA11",545:"0xcA11bde05977b3631167028862bE2a173976CA11",570:"0xcA11bde05977b3631167028862bE2a173976CA11",592:"0xcA11bde05977b3631167028862bE2a173976CA11",599:"0xcA11bde05977b3631167028862bE2a173976CA11",710:"0xcA11bde05977b3631167028862bE2a173976CA11",747:"0xcA11bde05977b3631167028862bE2a173976CA11",813:"0xcA11bde05977b3631167028862bE2a173976CA11",820:"0xcA11bde05977b3631167028862bE2a173976CA11",943:"0xcA11bde05977b3631167028862bE2a173976CA11",964:"0xcA11bde05977b3631167028862bE2a173976CA11",999:"0xcA11bde05977b3631167028862bE2a173976CA11",1001:"0xca11bde05977b3631167028862be2a173976ca11",1029:"0xca11bde05977b3631167028862be2a173976ca11",1030:"0xca11bde05977b3631167028862be2a173976ca11",1088:"0xcA11bde05977b3631167028862bE2a173976CA11",1101:"0xca11bde05977b3631167028862be2a173976ca11",1111:"0xca11bde05977b3631167028862be2a173976ca11",1114:"0xcA11bde05977b3631167028862bE2a173976CA11",1115:"0xcA11bde05977b3631167028862bE2a173976CA11",1116:"0xcA11bde05977b3631167028862bE2a173976CA11",1130:"0xcA11bde05977b3631167028862bE2a173976CA11",1131:"0xcA11bde05977b3631167028862bE2a173976CA11",1135:"0xcA11bde05977b3631167028862bE2a173976CA11",1234:"0xcA11bde05977b3631167028862bE2a173976CA11",1284:"0xcA11bde05977b3631167028862bE2a173976CA11",1285:"0xcA11bde05977b3631167028862bE2a173976CA11",1287:"0xcA11bde05977b3631167028862bE2a173976CA11",1315:"0xcA11bde05977b3631167028862bE2a173976CA11",1329:"0xcA11bde05977b3631167028862bE2a173976CA11",1442:"0xca11bde05977b3631167028862be2a173976ca11",1514:"0xcA11bde05977b3631167028862bE2a173976CA11",1570:"0xcA11bde05977b3631167028862bE2a173976CA11",1578:"0xca11bde05977b3631167028862be2a173976ca11",1625:"0xca11bde05977b3631167028862be2a173976ca11",1729:"0xcA11bde05977b3631167028862bE2a173976CA11",1875:"0xcA11bde05977b3631167028862bE2a173976CA11",1992:"0xcA11bde05977b3631167028862bE2a173976CA11",1996:"0xcA11bde05977b3631167028862bE2a173976CA11",2e3:"0xcA11bde05977b3631167028862bE2a173976CA11",2001:"0xcA11bde05977b3631167028862bE2a173976CA11",2020:"0xca11bde05977b3631167028862be2a173976ca11",2021:"0xca11bde05977b3631167028862be2a173976ca11",2222:"0xcA11bde05977b3631167028862bE2a173976CA11",2331:"0xcA11bde05977b3631167028862bE2a173976CA11",2358:"0xcA11bde05977b3631167028862bE2a173976CA11",2415:"0xcA11bde05977b3631167028862bE2a173976CA11",2442:"0xca11bde05977b3631167028862be2a173976ca11",2522:"0xcA11bde05977b3631167028862bE2a173976CA11",2710:"0xcA11bde05977b3631167028862bE2a173976CA11",2741:"0xF9cda624FBC7e059355ce98a31693d299FACd963",2810:"0xcA11bde05977b3631167028862bE2a173976CA11",2818:"0xcA11bde05977b3631167028862bE2a173976CA11",3338:"0xca11bde05977b3631167028862be2a173976ca11",3501:"0xcA11bde05977b3631167028862bE2a173976CA11",3502:"0xcA11bde05977b3631167028862bE2a173976CA11",3737:"0xcA11bde05977b3631167028862bE2a173976CA11",3776:"0xcA11bde05977b3631167028862bE2a173976CA11",3799:"0xca11bde05977b3631167028862be2a173976ca11",3939:"0xcA11bde05977b3631167028862bE2a173976CA11",4002:"0xcA11bde05977b3631167028862bE2a173976CA11",4061:"0xcA11bde05977b3631167028862bE2a173976CA11",4062:"0xcA11bde05977b3631167028862bE2a173976CA11",4201:"0xcA11bde05977b3631167028862bE2a173976CA11",4689:"0xcA11bde05977b3631167028862bE2a173976CA11",4759:"0xcA11bde05977b3631167028862bE2a173976CA11",5e3:"0xcA11bde05977b3631167028862bE2a173976CA11",5001:"0xcA11bde05977b3631167028862bE2a173976CA11",5003:"0xcA11bde05977b3631167028862bE2a173976CA11",5101:"0xcA11bde05977b3631167028862bE2a173976CA11",5555:"0xcA11bde05977b3631167028862bE2a173976CA11",5611:"0xcA11bde05977b3631167028862bE2a173976CA11",5700:"0xcA11bde05977b3631167028862bE2a173976CA11",5851:"0xca11bde05977b3631167028862be2a173976ca11",6322:"0xca11bde05977b3631167028862be2a173976ca11",6342:"0xcA11bde05977b3631167028862bE2a173976CA11",6699:"0xcA11bde05977b3631167028862bE2a173976CA11",7e3:"0xcA11bde05977b3631167028862bE2a173976CA11",7001:"0xca11bde05977b3631167028862be2a173976ca11",7070:"0xcA11bde05977b3631167028862bE2a173976CA11",7518:"0xcA11bde05977b3631167028862bE2a173976CA11",7560:"0xcA11bde05977b3631167028862bE2a173976CA11",7700:"0xcA11bde05977b3631167028862bE2a173976CA11",7701:"0xcA11bde05977b3631167028862bE2a173976CA11",7869:"0xcA11bde05977b3631167028862bE2a173976CA11",7979:"0xcA11bde05977b3631167028862bE2a173976CA11",8082:"0xcA11bde05977b3631167028862bE2a173976CA11",8131:"0xcA11bde05977b3631167028862bE2a173976CA11",8217:"0xcA11bde05977b3631167028862bE2a173976CA11",8453:"0xca11bde05977b3631167028862be2a173976ca11",8545:"0xcA11bde05977b3631167028862bE2a173976CA11",8822:"0xcA11bde05977b3631167028862bE2a173976CA11",8899:"0xcA11bde05977b3631167028862bE2a173976CA11",8911:"0xcA11bde05977b3631167028862bE2a173976CA11",9e3:"0xcA11bde05977b3631167028862bE2a173976CA11",9001:"0xcA11bde05977b3631167028862bE2a173976CA11",9393:"0xcA11bde05977b3631167028862bE2a173976CA11",10143:"0xcA11bde05977b3631167028862bE2a173976CA11",10200:"0xcA11bde05977b3631167028862bE2a173976CA11",10242:"0xcA11bde05977b3631167028862bE2a173976CA11",10243:"0xcA11bde05977b3631167028862bE2a173976CA11",11119:"0xcA11bde05977b3631167028862bE2a173976CA11",11124:"0xF9cda624FBC7e059355ce98a31693d299FACd963",11235:"0xcA11bde05977b3631167028862bE2a173976CA11",11503:"0xcA11bde05977b3631167028862bE2a173976CA11",12553:"0xcA11bde05977b3631167028862bE2a173976CA11",13371:"0xcA11bde05977b3631167028862bE2a173976CA11",13473:"0xcA11bde05977b3631167028862bE2a173976CA11",15557:"0xcA11bde05977b3631167028862bE2a173976CA11",17e3:"0xcA11bde05977b3631167028862bE2a173976CA11",17777:"0xcA11bde05977b3631167028862bE2a173976CA11",23294:"0xcA11bde05977b3631167028862bE2a173976CA11",23451:"0xcA11bde05977b3631167028862bE2a173976CA11",32520:"0xcA11bde05977b3631167028862bE2a173976CA11",32659:"0xcA11bde05977b3631167028862bE2a173976CA11",33139:"0xcA11bde05977b3631167028862bE2a173976CA11",34443:"0xcA11bde05977b3631167028862bE2a173976CA11",35441:"0xcA11bde05977b3631167028862bE2a173976CA11",35442:"0xcA11bde05977b3631167028862bE2a173976CA11",35443:"0xcA11bde05977b3631167028862bE2a173976CA11",41455:"0xcA11bde05977b3631167028862bE2a173976CA11",42161:"0xcA11bde05977b3631167028862bE2a173976CA11",42170:"0xcA11bde05977b3631167028862bE2a173976CA11",42220:"0xcA11bde05977b3631167028862bE2a173976CA11",42262:"0xcA11bde05977b3631167028862bE2a173976CA11",42299:"0xcA11bde05977b3631167028862bE2a173976CA11",42766:"0xcA11bde05977b3631167028862bE2a173976CA11",42793:"0xcA11bde05977b3631167028862bE2a173976CA11",43113:"0xcA11bde05977b3631167028862bE2a173976CA11",43114:"0xcA11bde05977b3631167028862bE2a173976CA11",44787:"0xcA11bde05977b3631167028862bE2a173976CA11",46688:"0xcA11bde05977b3631167028862bE2a173976CA11",48899:"0xcA11bde05977b3631167028862bE2a173976CA11",53302:"0xcA11bde05977b3631167028862bE2a173976CA11",53935:"0xcA11bde05977b3631167028862bE2a173976CA11",54176:"0x03657CDcDA1523C073b5e09c37dd199E6fBD1b99",55244:"0xcA11bde05977b3631167028862bE2a173976CA11",57e3:"0xcA11bde05977b3631167028862bE2a173976CA11",57073:"0xcA11bde05977b3631167028862bE2a173976CA11",58008:"0xcA11bde05977b3631167028862bE2a173976CA11",59140:"0xcA11bde05977b3631167028862bE2a173976CA11",59141:"0xca11bde05977b3631167028862be2a173976ca11",59144:"0xcA11bde05977b3631167028862bE2a173976CA11",59902:"0xcA11bde05977b3631167028862bE2a173976CA11",60808:"0xcA11bde05977b3631167028862bE2a173976CA11",64240:"0xca11bde05977b3631167028862be2a173976ca11",71401:"0xcA11bde05977b3631167028862bE2a173976CA11",71402:"0xcA11bde05977b3631167028862bE2a173976CA11",80001:"0xcA11bde05977b3631167028862bE2a173976CA11",80002:"0xcA11bde05977b3631167028862bE2a173976CA11",80069:"0xca11bde05977b3631167028862be2a173976ca11",80094:"0xcA11bde05977b3631167028862bE2a173976CA11",81457:"0xcA11bde05977b3631167028862bE2a173976CA11",84531:"0xca11bde05977b3631167028862be2a173976ca11",84532:"0xcA11bde05977b3631167028862bE2a173976CA11",88811:"0xcA11bde05977b3631167028862bE2a173976CA11",88817:"0xcA11bde05977b3631167028862bE2a173976CA11",88819:"0xcA11bde05977b3631167028862bE2a173976CA11",88882:"0xcA11bde05977b3631167028862bE2a173976CA11",88888:"0xcA11bde05977b3631167028862bE2a173976CA11",94168:"0xcA11bde05977b3631167028862bE2a173976CA11",98866:"0xcA11bde05977b3631167028862bE2a173976CA11",98867:"0xca11bde05977b3631167028862be2a173976ca11",98985:"0xcA11bde05977b3631167028862bE2a173976CA11",111188:"0xcA11bde05977b3631167028862bE2a173976CA11",112358:"0xcA11bde05977b3631167028862bE2a173976CA11",128123:"0xcA11bde05977b3631167028862bE2a173976CA11",132902:"0xcA11bde05977b3631167028862bE2a173976CA11",167e3:"0xca11bde05977b3631167028862be2a173976ca11",167007:"0xcA11bde05977b3631167028862bE2a173976CA11",167008:"0xcA11bde05977b3631167028862bE2a173976CA11",167009:"0xcA11bde05977b3631167028862bE2a173976CA11",200901:"0xca11bde05977b3631167028862be2a173976ca11",313313:"0xcA11bde05977b3631167028862bE2a173976CA11",314159:"0xdbfa261cd7d17bb40479a0493ad6c0fee435859e37aae73aa7e803f3122cc465",325e3:"0xcA11bde05977b3631167028862bE2a173976CA11",421611:"0xcA11bde05977b3631167028862bE2a173976CA11",421613:"0xcA11bde05977b3631167028862bE2a173976CA11",421614:"0xcA11bde05977b3631167028862bE2a173976CA11",534351:"0xca11bde05977b3631167028862be2a173976ca11",534352:"0xcA11bde05977b3631167028862bE2a173976CA11",534353:"0xcA11bde05977b3631167028862bE2a173976CA11",541764:"0x03657CDcDA1523C073b5e09c37dd199E6fBD1b99",560048:"0xca11bde05977b3631167028862be2a173976ca11",656476:"0xcA11bde05977b3631167028862bE2a173976CA11",660279:"0xcA11bde05977b3631167028862bE2a173976CA11",686868:"0xcA11bde05977b3631167028862bE2a173976CA11",713715:"0xcA11bde05977b3631167028862bE2a173976CA11",763373:"0xcA11bde05977b3631167028862bE2a173976CA11",1612127:"0xF9cda624FBC7e059355ce98a31693d299FACd963",1637450:"0xcA11bde05977b3631167028862bE2a173976CA11",6038361:"0xcA11bde05977b3631167028862bE2a173976CA11",7777777:"0xcA11bde05977b3631167028862bE2a173976CA11",9999999:"0xcA11bde05977b3631167028862bE2a173976CA11",11155111:"0xcA11bde05977b3631167028862bE2a173976CA11",11155420:"0xcA11bde05977b3631167028862bE2a173976CA11",12227330:"0xcA11bde05977b3631167028862bE2a173976CA11",23011913:"0xcA11bde05977b3631167028862bE2a173976CA11",37084624:"0xcA11bde05977b3631167028862bE2a173976CA11",52164803:"0xcA11bde05977b3631167028862bE2a173976CA11",68840142:"0xcA11bde05977b3631167028862bE2a173976CA11",89346162:"0xcA11bde05977b3631167028862bE2a173976CA11",111557560:"0xcA11bde05977b3631167028862bE2a173976CA11",168587773:"0xcA11bde05977b3631167028862bE2a173976CA11",245022926:"0xcA11bde05977b3631167028862bE2a173976CA11",245022934:"0xca11bde05977b3631167028862be2a173976ca11",728126428:"TEazPvZwDjDtFeJupyo7QunvnrnUjPH8ED",974399131:"0xcA11bde05977b3631167028862bE2a173976CA11",999999999:"0xcA11bde05977b3631167028862bE2a173976CA11",1020352220:"0xcA11bde05977b3631167028862bE2a173976CA11",1313161554:"0xcA11bde05977b3631167028862bE2a173976CA11",1350216234:"0xcA11bde05977b3631167028862bE2a173976CA11",1444673419:"0xcA11bde05977b3631167028862bE2a173976CA11",1482601649:"0xcA11bde05977b3631167028862bE2a173976CA11",1564830818:"0xcA11bde05977b3631167028862bE2a173976CA11",16666e5:"0xcA11bde05977b3631167028862bE2a173976CA11",2046399126:"0xcA11bde05977b3631167028862bE2a173976CA11",11297108109:"0xca11bde05977b3631167028862be2a173976ca11",11297108099:"0xca11bde05977b3631167028862be2a173976ca11",47279324479:"0xcA11bde05977b3631167028862bE2a173976CA11",5264468217:"0xcA11bde05977b3631167028862bE2a173976CA11",123420000220:"0xcA11bde05977b3631167028862bE2a173976CA11"};function w(n){return ye[n]}i(w,"getMulticallAddress");import{AbiConstructor as fe}from"ox";var te={name:"CodeCaller",abi:[{type:"constructor",inputs:[{name:"bytecode",type:"bytes",internalType:"bytes"},{name:"callParams",type:"bytes",internalType:"bytes"}],stateMutability:"nonpayable"},{type:"error",name:"BytecodeDeploymentFailed",inputs:[]}],bytecode:"0x608060405234801561000f575f80fd5b5060405161021c38038061021c83398101604081905261002e916101a1565b5f8251602084015ff090506001600160a01b038116158061005757506001600160a01b0381163b155b156100755760405163537574ad60e11b815260040160405180910390fd5b5f80826001600160a01b03168460405161008f9190610200565b5f604051808303815f865af19150503d805f81146100c8576040519150601f19603f3d011682016040523d82523d5f602084013e6100cd565b606091505b5091509150816100df57805160208201fd5b805160208201f35b634e487b7160e01b5f52604160045260245ffd5b5f5b838110156101155781810151838201526020016100fd565b50505f910152565b5f82601f83011261012c575f80fd5b81516001600160401b0380821115610146576101466100e7565b604051601f8301601f19908116603f0116810190828211818310171561016e5761016e6100e7565b81604052838152866020858801011115610186575f80fd5b6101978460208301602089016100fb565b9695505050505050565b5f80604083850312156101b2575f80fd5b82516001600160401b03808211156101c8575f80fd5b6101d48683870161011d565b935060208501519150808211156101e9575f80fd5b506101f68582860161011d565b9150509250929050565b5f82516102118184602087016100fb565b919091019291505056fe",methodIdentifiers:{}};function W(n,e){let t=fe.fromAbi(te.abi);return fe.encode(t,{bytecode:te.bytecode,args:[n,e]})}i(W,"encodeBytecodeCallData");function G({abi:n,address:e,fn:t,args:a,to:r=e,bytecode:s,data:c}){if(n&&t){let{abiEntry:o,data:b}=k({abi:n,fn:t,args:a});return{to:r,data:b,abiEntry:o}}if(n&&s){let{abiEntry:o,data:b}=ee({abi:n,bytecode:s,args:a});return{data:b,abiEntry:o}}return s&&c?{data:W(s,c)}:{to:r,data:c}}i(G,"prepareCall");var ae={name:"IMulticall3",abi:[{type:"function",name:"aggregate",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"},{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"aggregate3",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call3[]",components:[{name:"target",type:"address",internalType:"address"},{name:"allowFailure",type:"bool",internalType:"bool"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"aggregate3Value",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call3Value[]",components:[{name:"target",type:"address",internalType:"address"},{name:"allowFailure",type:"bool",internalType:"bool"},{name:"value",type:"uint256",internalType:"uint256"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"blockAndAggregate",inputs:[{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"},{name:"blockHash",type:"bytes32",internalType:"bytes32"},{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"getBasefee",inputs:[],outputs:[{name:"basefee",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getBlockHash",inputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"}],outputs:[{name:"blockHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"getBlockNumber",inputs:[],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getChainId",inputs:[],outputs:[{name:"chainid",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockCoinbase",inputs:[],outputs:[{name:"coinbase",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockDifficulty",inputs:[],outputs:[{name:"difficulty",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockGasLimit",inputs:[],outputs:[{name:"gaslimit",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getCurrentBlockTimestamp",inputs:[],outputs:[{name:"timestamp",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getEthBalance",inputs:[{name:"addr",type:"address",internalType:"address"}],outputs:[{name:"balance",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getLastBlockHash",inputs:[],outputs:[{name:"blockHash",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"tryAggregate",inputs:[{name:"requireSuccess",type:"bool",internalType:"bool"},{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"},{type:"function",name:"tryBlockAndAggregate",inputs:[{name:"requireSuccess",type:"bool",internalType:"bool"},{name:"calls",type:"tuple[]",internalType:"struct IMulticall3.Call[]",components:[{name:"target",type:"address",internalType:"address"},{name:"callData",type:"bytes",internalType:"bytes"}]}],outputs:[{name:"blockNumber",type:"uint256",internalType:"uint256"},{name:"blockHash",type:"bytes32",internalType:"bytes32"},{name:"returnData",type:"tuple[]",internalType:"struct IMulticall3.Result[]",components:[{name:"success",type:"bool",internalType:"bool"},{name:"returnData",type:"bytes",internalType:"bytes"}]}],stateMutability:"payable"}],methodIdentifiers:{"aggregate((address,bytes)[])":"252dba42","aggregate3((address,bool,bytes)[])":"82ad56cb","aggregate3Value((address,bool,uint256,bytes)[])":"174dea71","blockAndAggregate((address,bytes)[])":"c3077fa9","getBasefee()":"3e64a696","getBlockHash(uint256)":"ee82ac5e","getBlockNumber()":"42cbb15c","getChainId()":"3408e470","getCurrentBlockCoinbase()":"a8b0574e","getCurrentBlockDifficulty()":"72425d9d","getCurrentBlockGasLimit()":"86d516e8","getCurrentBlockTimestamp()":"0f28c97d","getEthBalance(address)":"4d2301cc","getLastBlockHash()":"27e86d6e","tryAggregate(bool,(address,bytes)[])":"bce38bd7","tryBlockAndAggregate(bool,(address,bytes)[])":"399542e9"}};var Ke=/^0x[0-9a-fA-F]*$/;function j(n,{prefix:e=!0}={}){return typeof n=="string"&&Ke.test(e?n:`0x${n}`)}i(j,"isHexString");function v(n,{prefix:e=!0}={}){let t=e===!1?"":"0x";if(typeof n=="number"||typeof n=="bigint")return`${t}${n.toString(16)}`;let a;if(typeof n=="string"){if(j(n,{prefix:e}))return n;a=We().encode(n)}else a=n;let r=[...a].map(s=>s.toString(16).padStart(2,"0")).join("");return`${t}${r}`}i(v,"toHexString");function he(n,e){if(!j(n,e))throw new Error(`Invalid hex string: ${n}`);let t=new Uint8Array(n.replace("0x","").match(/.{1,2}/g)?.map(a=>parseInt(a,16))||[]);return Ge().decode(t)}i(he,"hexToString");var xe;function We(){return xe||=new TextEncoder,xe}i(We,"getTextEncoder");var Ce;function Ge(){return Ce||=new TextDecoder,Ce}i(Ge,"getTextDecoder");async function Ee(n,{calls:e,multicallAddress:t,allowFailure:a=!0,...r}){let s=new Map;if(!t){let o=await n.getChainId();if(t=w(o),!t)throw new f(`No multicall address found for chain ID ${o}. Please provide a valid multicall address.`)}return(await n.call({to:t,data:n.encodeFunctionData({abi:ae.abi,fn:"aggregate3",args:{calls:e.map((o,b)=>{let{to:d,data:l,abiEntry:m}=G(o);return m&&s.set(b,m),{target:d,callData:l||"0x",allowFailure:a}})}}),...r}).then(o=>n.decodeFunctionReturn({abi:ae.abi,data:o,fn:"aggregate3"}))).map(({returnData:o,success:b},d)=>{if(!b)return{success:b,error:new f(he(o.slice(10),{prefix:!1}))};let l=o,m=s.get(d);return m&&(l=n.decodeFunctionReturn({abi:[m],data:o,fn:m.name})),a===!1?l:{success:b,value:l}})}i(Ee,"multicall");async function ge(n,{abi:e,address:t,fn:a,args:r={},block:s}){let{abiEntry:c,data:o}=k({abi:e,fn:a,args:r}),b=await n.call({to:t,data:o,block:s});return n.decodeFunctionReturn({abi:[c],data:b,fn:a})}i(ge,"read");async function Fe(n,{abi:e,fn:t,args:a={},from:r,address:s,...c}){let{abiEntry:o,data:b}=k({abi:e,fn:t,args:a}),d=await n.call({data:b,from:r??await n.getSignerAddress?.().catch(()=>{}),to:s,...c});return n.decodeFunctionReturn({abi:[o],data:d,fn:t})}i(Fe,"simulateWrite");function L(n,{abi:e,fn:t,args:a={},address:r,...s}){let c=n.encodeFunctionData({abi:e,fn:t,args:a});return n.sendTransaction({data:c,to:r,...s})}i(L,"write");var H=class n extends M{static{i(this,"BaseReadAdapter")}static DEFAULT_POLLING_INTERVAL=4e3;static DEFAULT_TIMEOUT=6e4;pollingInterval;pollingTimeout;multicallAddress;constructor({pollingInterval:e=n.DEFAULT_POLLING_INTERVAL,pollingTimeout:t=n.DEFAULT_TIMEOUT,multicallAddress:a}={}){super(),this.pollingInterval=e,this.pollingTimeout=t,this.multicallAddress=a}read(e){return ge(this,e)}simulateWrite(e){return Fe(this,e)}multicall({multicallAddress:e=this.multicallAddress,...t}){return Ee(this,{multicallAddress:e,...t})}},Pe=class extends H{static{i(this,"BaseReadWriteAdapter")}deploy(e){return K(this,e)}async write(e){return L(this,e)}};function Ne(n){if(n>=100&&n<200)return"pending";if(n>=200&&n<300)return"confirmed";if(n>=400&&n<500)return"failed";if(n>=500&&n<600)return"reverted";if(n>=600&&n<700)return"partially-reverted";throw new f(`Unknown status code: ${n}`)}i(Ne,"getWalletCallsStatusLabel");function q(n,e,t){return e(n)?t(n):Array.isArray(n)?n.map(a=>q(a,e,t)):n&&typeof n=="object"?Object.fromEntries(Object.entries(n).map(([a,r])=>[a,q(r,e,t)])):n}i(q,"convert");import{AbiEvent as ke,Address as je,Block as Le,Provider as qe,RpcTransport as Ue,Transaction as _e,TransactionReceipt as $e}from"ox";var ne=class extends H{static{i(this,"DefaultReadAdapter")}provider;constructor({rpcUrl:e,...t}={}){super(t);try{let a=e?Ue.fromHttp(e):globalThis.ethereum;if(!a)throw new f("No provider found");this.provider=qe.from(a)}catch(a){T(a)}}getChainId(){return this.provider.request({method:"eth_chainId"}).then(Number).catch(T)}getBlockNumber(){return this.provider.request({method:"eth_blockNumber"}).then(BigInt).catch(T)}getBlock(e){return this.provider.request(j(e)?{method:"eth_getBlockByHash",params:[e,!1]}:{method:"eth_getBlockByNumber",params:[D(e),!1]}).then(Le.fromRpc).then(t=>t?{...t,nonce:BigInt(t.nonce),transactions:t.transactions.slice()}:void 0).catch(T)}getBalance(e){return this.provider.request({method:"eth_getBalance",params:[e.address,D(e.block)]}).then(BigInt).catch(T)}getTransaction({hash:e}){return this.provider.request({method:"eth_getTransactionByHash",params:[e]}).then(t=>{if(!t)return;let{to:a,transactionIndex:r,hash:s,...c}=_e.fromRpc(t);return{to:a||void 0,transactionIndex:BigInt(r),transactionHash:s,...c}}).catch(T)}waitForTransaction({hash:e,timeout:t=this.pollingTimeout}){return new Promise((a,r)=>{let s=i(()=>this.provider.request({method:"eth_getTransactionReceipt",params:[e]}).then(c=>{if(c){let{to:o,transactionIndex:b,contractAddress:d,...l}=$e.fromRpc(c);a({to:o||void 0,transactionIndex:BigInt(b),contractAddress:d||void 0,...l})}else setTimeout(s,this.pollingInterval)}).catch(r),"getReceipt");s(),setTimeout(()=>a(void 0),t)}).catch(T)}sendRawTransaction(e){return this.provider.request({method:"eth_sendRawTransaction",params:[e]})}getEvents({abi:e,address:t,event:a,filter:r,fromBlock:s,toBlock:c}){let{abiEntry:o}=N({abi:e,type:"event",name:a,kind:"inputs",value:r});return this.provider.request({method:"eth_getLogs",params:[{address:t,fromBlock:D(s),toBlock:D(c),topics:ke.encode(o,r||{}).topics}]}).then(b=>b.map(d=>({args:ke.decode(o,d),blockHash:d.blockHash,blockNumber:BigInt(d.blockNumber),data:d.data,eventName:a,logIndex:Number(d.logIndex),transactionHash:d.transactionHash}))).catch(T)}call({to:e,data:t,bytecode:a,block:r,...s}){return a&&t&&(t=W(a,t)),this.provider.request({method:"eth_call",params:[{to:e,data:t,...ve(s)},D(r)]}).catch(T)}},U=class extends ne{static{i(this,"DefaultAdapter")}getSignerAddress(){return this.provider.request({method:"eth_accounts"}).then(([e])=>{if(!e)throw new f("No signer address found");return je.checksum(e)}).catch(T)}async getWalletCapabilities(e){return this.provider.request({method:"wallet_getCapabilities",params:[e?.address||await this.getSignerAddress(),e?.chainIds?.map(t=>v(t))||[v(await this.getChainId())]]}).then(t=>Object.fromEntries(Object.entries(t).map(([a,r])=>[Number(a),r]))).catch(T)}getCallsStatus(e){return this.provider.request({method:"wallet_getCallsStatus",params:[e]}).then(({chainId:t,id:a,receipts:r,status:s,...c})=>({chainId:Number(t),id:a,statusCode:s,status:Ne(s),receipts:r?.map(({blockNumber:o,gasUsed:b,status:d,...l})=>({blockNumber:BigInt(o),gasUsed:BigInt(b),status:d==="0x1"?"success":"reverted",...l})),...c})).catch(T)}showCallsStatus(e){return this.provider.request({method:"wallet_showCallsStatus",params:[e]}).catch(T)}async sendTransaction({data:e,to:t,from:a,onMined:r,onMinedTimeout:s,...c}){return a??=await this.getSignerAddress().catch(T),this.provider.request({method:"eth_sendTransaction",params:[{data:e,to:t,from:a,...ve(c)}]}).then(o=>(r&&this.waitForTransaction({hash:o,timeout:s}).then(r),o)).catch(T)}deploy(e){return K(this,e)}write(e){return L(this,e)}async sendCalls(e){return this.provider.request({method:"wallet_sendCalls",params:[{version:e.version||"2.0.0",id:e.id,chainId:v(e.chainId??await this.getChainId()),from:e.from??await this.getSignerAddress(),atomicRequired:e.atomic??!0,calls:e.calls.map(({capabilities:t,value:a,...r})=>{let{to:s,data:c}=G(r);return{to:s,data:c,capabilities:t,value:a?v(a):void 0}}),capabilities:e.capabilities}]}).catch(T)}};function D(n){return n===void 0?"latest":typeof n=="bigint"?v(n):n}i(D,"prepareBlockParam");function ve(n){return q(n,e=>typeof e=="bigint"||typeof e=="number",e=>v(e))}i(ve,"prepareTransactionOptions");import{LRUCache as Ve}from"lru-cache";var S=class extends Ve{static{i(this,"LruStore")}constructor(e={max:500}){super(e)}};import ze from"safe-stable-stringify";function _(n){return ze(n,(e,t)=>typeof t=="bigint"?`${t}n`:t)}i(_,"stringifyKey");function re(n){return JSON.parse(n,(e,t)=>typeof t=="string"&&/^-?\d+n$/.test(t)?BigInt(t.slice(0,-1)):t)}i(re,"parseKey");import Qe from"lodash.ismatch";async function O({store:n,matchKey:e}){e=await e;let t=re(e),a=[];for await(let[r]of n.entries()){if(r===e){a.push(n.delete(r));continue}let s=re(r);Qe(s,t)&&a.push(n.delete(r))}await Promise.all(a)}i(O,"deleteMatches");async function C({store:n,key:e,fn:t}){if(e=await e,await n.has(e))return n.get(e);let a=await t();return a===void 0||await n.set(e,a),a}i(C,"getOrSet");var B=class{static{i(this,"ClientCache")}namespace;store;constructor({namespace:e,store:t=new S}){this.namespace=e,this.store=t}async clear(){return this.store.clear()}async blockKey(e){return this.#n("block",{block:e})}async preloadBlock({value:e,block:t}){let a=await this.blockKey(t);return this.store.set(a,e)}async getBlock(e){let t=await this.blockKey(e);return this.store.get(t)}async invalidateBlock(e){let t=await this.blockKey(e);return this.store.delete(t)}async clearBlocks(){return O({store:this.store,matchKey:this.blockKey()})}#e({address:e,block:t}={}){return this.#n("balance",{address:e,block:t})}async balanceKey(e){return this.#e(e)}async preloadBalance({value:e,...t}){let a=await this.balanceKey(t);return this.store.set(a,e)}async getBalance(e){let t=await this.balanceKey(e);return this.store.get(t)}async invalidateBalance(e){let t=await this.balanceKey(e);return this.store.delete(t)}async clearBalances(){return O({store:this.store,matchKey:this.#e()})}#t({hash:e}={}){return this.#n("transaction",{hash:e})}async transactionKey({hash:e}){return this.#t({hash:e})}async preloadTransaction({value:e,...t}){let a=await this.transactionKey(t);return this.store.set(a,e)}async getTransaction(e){let t=await this.transactionKey(e);return this.store.get(t)}async invalidateTransaction(e){let t=await this.transactionKey(e);return this.store.delete(t)}async clearTransactions(){return O({store:this.store,matchKey:this.#t()})}async transactionReceiptKey({hash:e}){return this.#n("transactionReceipt",{hash:e})}async preloadTransactionReceipt({value:e,...t}){let a=await this.transactionReceiptKey(t);return this.store.set(a,e)}async getTransactionReceipt(e){let t=await this.transactionReceiptKey(e);return this.store.get(t)}#a({to:e,data:t,value:a,from:r,block:s,accessList:c,blobVersionedHashes:o,chainId:b,blobs:d,bytecode:l,nonce:m}={}){return this.#n("call",{to:e,data:t,value:a,from:r,block:s,accessList:c,blobVersionedHashes:o,chainId:b,blobs:d,bytecode:l,nonce:m})}async callKey(e){return this.#a(e)}async preloadCall({preloadValue:e,...t}){let a=await this.callKey(t);return this.store.set(a,e)}async getCall(e){let t=await this.callKey(e);return this.store.get(t)}async invalidateCall(e){let t=await this.callKey(e);return this.store.delete(t)}async invalidateCallsMatching(e){return O({store:this.store,matchKey:this.#a(e)})}async clearCalls(){return this.invalidateCallsMatching()}async eventsKey({address:e,event:t,filter:a,fromBlock:r="earliest",toBlock:s="latest"}){return this.#n("events",{address:e,event:t,filter:a,fromBlock:r,toBlock:s})}async preloadEvents({value:e,...t}){let a=await this.eventsKey(t);return this.store.set(a,e)}async getEvents(e){let t=await this.eventsKey(e);return this.store.get(t)}#r({address:e,args:t,block:a,fn:r}={}){return this.#n("read",{address:e,args:t,block:a,fn:r})}async readKey(e){return this.#r(e)}async preloadRead({value:e,...t}){let a=await this.readKey(t);return this.store.set(a,e)}async getRead(e){let t=await this.readKey(e);return this.store.get(t)}async invalidateRead(e){let t=await this.readKey(e);return this.store.delete(t)}async invalidateReadsMatching(e){return O({store:this.store,matchKey:this.#r(e)})}async clearReads(){return this.invalidateReadsMatching()}async#i(){return typeof this.namespace=="function"&&(this.namespace=await this.namespace()),this.namespace}async#n(...e){let t=await this.#i();return _([t,...e])}};var $=class extends f{static{i(this,"BlockNotFoundError")}constructor(e,t){super(`Block not found: ${e}`,t)}};var V=class{static{i(this,"HookRegistry")}#e={};on(e,t){this.#e[e]||=[],this.#e[e].push(t)}off(e,t){let a=!1,r=this.#e[e];return r&&(this.#e[e]=r.filter(s=>s===t?(a=!0,!1):!0)),a}once(e,t){let a=i(r=>{this.off(e,a),t(r)},"wrapped");this.on(e,a)}call(e,t){let a,r=this.#e[e];if(r)for(let s of r)a instanceof Promise?a=a.then(()=>s(t)):a=s(t);return a}};var z=class{static{i(this,"MethodInterceptor")}#e=new V;get hooks(){return this.#e}createProxy=i(e=>new Proxy(e,{get:i((t,a,r)=>{let s=Reflect.get(t,a,r);if(a==="constructor"||typeof s!="function")return s;let c=i((...o)=>this.#t({method:a,fn:s.bind(r),args:o}),"wrapped");return Object.defineProperty(c,"name",{get:i(()=>s.name,"get")}),c},"get")}),"createProxy");#t({method:e,fn:t,args:a}){let r=String(e),s=!1,c,o=this.#e.call(`before:${r}`,{get args(){return a},setArgs(...d){a=d},resolve(d){s||(s=!0,c=d)}}),b=i(()=>{s||(c=t(...a));let d=this.#e.call(`after:${r}`,{get args(){return a},get result(){return c},setResult(l){c=l}});return d instanceof Promise?d.then(()=>c):c},"wrappedAfterHooks");return o instanceof Promise?o.then(b):b()}};var Q=class{static{i(this,"MicrotaskQueue")}pending=[];maxBatchSize;#e;constructor({batchFn:e,maxBatchSize:t}){this.maxBatchSize=t,this.#e=e}submit(e){return new Promise((t,a)=>{this.pending.push({request:e,resolve:t,reject:a}),this.pending.length===1&&queueMicrotask(()=>{let r=this.pending;this.pending=[];let s=this.maxBatchSize||r.length,c=[];for(let o=0;o<r.length;o+=s)c.push(r.slice(o,o+s));for(let o of c)try{this.#e(o).catch(b=>{for(let{reject:d}of o)d(b)})}catch(b){for(let{reject:d}of o)d(b)}})})}};async function J({adapter:n,cache:e,params:{calls:t,multicallAddress:a,allowFailure:r,...s}}){let c=new Map,o=[],b=await Promise.all(t.map(async(l,m)=>{let y;if(l.abi?y=await e.getRead({...l,block:s?.block}):y=await e.getCall({...l,...s}),y!==void 0)return r===!1?y:{success:!0,value:y};c.set(m,o.length),o.push(l)}));if(!o.length)return b;let d=await n.multicall({calls:o,multicallAddress:a,allowFailure:r,...s});return Promise.all(b.map(async(l,m)=>{if(l!==void 0)return l;let y=c.get(m),{abi:x,address:h,fn:g,args:F,to:R,data:A}=o[y],P=d[y],E=r===!1?P:P.value;return E!==void 0&&(x?await e.preloadRead({abi:x,address:h,fn:g,args:F,block:s?.block,value:E}):await e.preloadCall({to:R,data:A,...s,preloadValue:E})),P}))}i(J,"cachedMulticall");var X=class extends Q{static{i(this,"MulticallQueue")}#e;#t;#a;constructor({adapter:e,cache:t,getChainId:a,maxBatchSize:r}){super({maxBatchSize:r,batchFn:i(s=>this.#r(s),"batchFn")}),this.#e=e,this.#t=t,this.#a=a}async#r(e){if(e.length===1){let{reject:a,request:r,resolve:s}=e[0];return this.#s(r).then(s).catch(a)}let t=new Map;for(let{request:a,resolve:r,reject:s}of e){let{abi:c,address:o,fn:b,args:d,to:l,data:m,...y}=a,x={abi:c,address:o,fn:b,args:d,to:l,data:m},h=_(y),g=t.get(h);g?(g.calls.push(x),g.callbacks.push({resolve:r,reject:s})):t.set(h,{calls:[x],callbacks:[{resolve:r,reject:s}],options:y})}return Promise.all(t.values().map(a=>this.#i(a)))}async#i(e){if(e.calls.length===1)return this.#n(e);let{calls:t,callbacks:a,options:r}=e,s=await this.#a(),c=w(s);return J({adapter:this.#e,cache:this.#t,params:{calls:t,multicallAddress:c,allowFailure:!0,...r}}).then(o=>{for(let[b,d]of o.entries()){let{resolve:l,reject:m}=e.callbacks[b]||{};d.success?l?.(d.value):m?.(d.error)}}).catch(o=>{if(!c)return this.#n(e);for(let{reject:b}of a)b(o)})}#n({calls:e,callbacks:t,options:a}){return Promise.all(e.map((r,s)=>{let c={...r,...a},{resolve:o,reject:b}=t[s]||{};return this.#s(c).then(o).catch(b)}))}#s(e){return e.abi?C({store:this.#t.store,key:this.#t.readKey(e),fn:i(()=>this.#e.read(e),"fn")}):C({store:this.#t.store,key:this.#t.callKey(e),fn:i(()=>this.#e.call(e),"fn")})}};function ie(n={}){let{adapter:e,store:t,chainId:a,batch:r=!0,maxBatchSize:s,...c}=n,o=new z,b=e||new U(c),l=t&&"clear"in t?t:new S(t);async function m(){return a??=await b.getChainId(),a}i(m,"getChainId");let y=new B({store:l,namespace:m}),x=r?new X({adapter:b,cache:y,getChainId:m,maxBatchSize:s}):void 0,h={...b,adapter:b,hooks:o.hooks,cache:y,isReadWrite(){return typeof this.adapter.write=="function"},extend(A){return Object.assign(this,A)},getChainId:m,async getBlock(A,P){let E=await C({store:this.cache.store,key:this.cache.blockKey(A),fn:i(()=>this.adapter.getBlock(A),"fn")});if(!E&&P?.throws)throw new $(A);return E},getBalance(A){return C({store:this.cache.store,key:this.cache.balanceKey(A),fn:i(()=>this.adapter.getBalance(A),"fn")})},getTransaction(A){return C({store:this.cache.store,key:this.cache.transactionKey(A),fn:i(()=>this.adapter.getTransaction(A),"fn")})},waitForTransaction(A){return C({store:this.cache.store,key:this.cache.transactionReceiptKey(A),fn:i(()=>this.adapter.waitForTransaction(A),"fn")})},getEvents({fromBlock:A="earliest",toBlock:P="latest",...E}){let oe={fromBlock:A,toBlock:P,...E};return C({store:this.cache.store,key:this.cache.eventsKey(oe),fn:i(async()=>this.adapter.getEvents(oe),"fn")})},call(A){return x?.submit(A)??C({store:this.cache.store,key:this.cache.callKey(A),fn:i(()=>this.adapter.call(A),"fn")})},read(A){return x?.submit(A)??C({store:this.cache.store,key:this.cache.readKey(A),fn:i(()=>this.adapter.read(A),"fn")})},async multicall({multicallAddress:A,...P}){if(!A){let E=await this.getChainId();A=w(E)}return J({adapter:this.adapter,cache:this.cache,params:{multicallAddress:A,...P}})}},g=Object.getPrototypeOf(b);function F(){}i(F,"Client"),Object.defineProperties(F,{name:{value:`Client<${b.constructor.name}>`,enumerable:!1,writable:!1,configurable:!0}}),F.prototype=Object.create(g,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0},[Symbol.toStringTag]:{value:F.name,enumerable:!1,writable:!0,configurable:!0}});let R=Object.create(F.prototype,Object.getOwnPropertyDescriptors(h));return o.createProxy(R)}i(ie,"createClient");var Z=class{static{i(this,"ContractCache")}#e;#t;#a;constructor({abi:e,address:t,...a}){let r=a.clientCache?a.clientCache:new B(a);this.#e=e,this.#t=t,this.#a=r}get store(){return this.#a.store}clear(){return this.#a.clear()}eventsKey(e,t){return this.#a.eventsKey({abi:this.#e,address:this.#t,event:e,...t})}preloadEvents(e){return this.#a.preloadEvents({abi:this.#e,address:this.#t,...e})}getEvents(e,t){return this.#a.getEvents({abi:this.#e,address:this.#t,event:e,...t})}readKey(...[e,t,a]){return this.#a.readKey({abi:this.#e,address:this.#t,fn:e,args:t,...a})}preloadRead(e){return this.#a.preloadRead({abi:this.#e,address:this.#t,...e})}getRead(...[e,t,a]){return this.#a.getRead({abi:this.#e,address:this.#t,fn:e,args:t,...a})}invalidateRead(...[e,t,a]){return this.#a.invalidateRead({abi:this.#e,address:this.#t,fn:e,args:t,...a})}invalidateReadsMatching(e,t,a){return this.#a.invalidateReadsMatching({abi:this.#e,address:this.#t,fn:e,args:t,...a})}async clearReads(){return this.#a.invalidateReadsMatching({abi:this.#e,address:this.#t})}};var Y=class{static{i(this,"ReadContract")}abi;address;client;cache;epochBlock;constructor({abi:e,address:t,epochBlock:a,client:r,...s}){this.abi=e,this.address=t,this.client=r??ie(s),this.cache=new Z({abi:e,address:t,clientCache:this.client.cache}),this.epochBlock=a}isReadWrite(){return this.client.isReadWrite()}extend(e){return Object.assign(this,e)}encodeDeployData(...[e,t]){return this.client.encodeDeployData({abi:this.abi,bytecode:e,args:t})}encodeFunctionData(...[e,t]){return this.client.encodeFunctionData({abi:this.abi,fn:e,args:t})}encodeFunctionReturn(e,t){return this.client.encodeFunctionReturn({abi:this.abi,fn:e,value:t})}decodeFunctionData(e){return this.client.decodeFunctionData({abi:this.abi,data:e})}decodeFunctionReturn(e,t){return this.client.decodeFunctionReturn({abi:this.abi,fn:e,data:t})}getEvents(e,{fromBlock:t,...a}={}){return this.epochBlock&&(!t||t==="earliest"||typeof t=="bigint"&&t<this.epochBlock)&&(t=this.epochBlock),this.client.getEvents({abi:this.abi,address:this.address,event:e,fromBlock:t,...a})}read(...[e,t,a]){return this.client.read({abi:this.abi,address:this.address,fn:e,args:t,...a})}simulateWrite(...[e,t,a]){return this.client.simulateWrite({abi:this.abi,address:this.address,fn:e,args:t,...a})}async multicall({calls:e,...t}){return this.client.multicall({calls:e.map(a=>({abi:this.abi,address:this.address,...a})),...t})}},se=class extends Y{static{i(this,"ReadWriteContract")}getSignerAddress(){return this.client.getSignerAddress()}write(...[e,t,a]){return this.client.write({abi:this.abi,address:this.address,fn:e,args:t,...a})}};function Hr({abi:n,address:e,epochBlock:t,client:a,...r}){return a=a||ie(r),a.isReadWrite()?new se({abi:n,address:e,client:a,epochBlock:t}):new Y({abi:n,address:e,client:a,epochBlock:t})}i(Hr,"createContract");var Kr="0x0000000000000000000000000000000000000000";export{i as a,I as b,f as c,be as d,de as e,pe as f,N as g,me as h,ee as i,Ae as j,k,Te as l,Me as m,M as n,K as o,w as p,W as q,G as r,ae as s,Ke as t,j as u,v,he as w,Ee as x,ge as y,Fe as z,L as A,H as B,Pe as C,Ne as D,q as E,ne as F,U as G,S as H,_ as I,re as J,O as K,C as L,B as M,$ as N,z as O,ie as P,Z as Q,Y as R,se as S,Hr as T,Kr as U};
//# sourceMappingURL=chunk-J65G2IHC.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display