@sentio/sdk-bundle 2.43.2-rc.2 → 2.43.2-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/lib/aptos/aptos-plugin.d.ts.map +1 -1
  2. package/lib/aptos/aptos-processor.d.ts +6 -2
  3. package/lib/aptos/aptos-processor.d.ts.map +1 -1
  4. package/lib/aptos/builtin/0x1.js +1 -1
  5. package/lib/aptos/builtin/0x3.js +1 -1
  6. package/lib/aptos/builtin/index.js +1 -1
  7. package/lib/aptos/context.d.ts +1 -1
  8. package/lib/aptos/context.d.ts.map +1 -1
  9. package/lib/aptos/ext/index.js +1 -1
  10. package/lib/aptos/index.js +1 -1
  11. package/lib/btc/index.js +1 -1
  12. package/lib/chunk-25ZQVB45.js +3 -0
  13. package/lib/chunk-25ZQVB45.js.map +1 -0
  14. package/lib/{chunk-N5RHN4E6.js → chunk-42WFEVPJ.js} +2 -2
  15. package/lib/{chunk-CVNNI2QT.js → chunk-57ZKWCWX.js} +2 -2
  16. package/lib/{chunk-24SNMMHJ.js → chunk-7CN7I4Z2.js} +2 -2
  17. package/lib/{chunk-BWVUWY2B.js → chunk-BUS6RMUQ.js} +2 -2
  18. package/lib/{chunk-LVDJAXQH.js → chunk-F4KBWSBA.js} +2 -2
  19. package/lib/{chunk-ZZVAJC2R.js → chunk-F4KIC6B2.js} +2 -2
  20. package/lib/{chunk-RYF5PIOA.js → chunk-GC37QHIM.js} +24 -24
  21. package/lib/{chunk-RYF5PIOA.js.map → chunk-GC37QHIM.js.map} +1 -1
  22. package/lib/{chunk-SUKHDM52.js → chunk-GPEBHJLJ.js} +5 -5
  23. package/lib/{chunk-SUKHDM52.js.map → chunk-GPEBHJLJ.js.map} +1 -1
  24. package/lib/{chunk-YSISNI4S.js → chunk-HX5D5IUX.js} +2 -2
  25. package/lib/{chunk-3DTBA2UT.js → chunk-IWVJH75C.js} +2 -2
  26. package/lib/{chunk-QTFRIA2S.js → chunk-NKLMB72N.js} +2 -2
  27. package/lib/{chunk-2TUIAYCA.js → chunk-ORKCLVS6.js} +2 -2
  28. package/lib/{chunk-FZ5WWK6U.js → chunk-PAPBP672.js} +2 -2
  29. package/lib/{chunk-VZXAOB24.js → chunk-T55D6SOB.js} +2 -2
  30. package/lib/{chunk-NKG23ZCL.js → chunk-UDHFPC34.js} +2 -2
  31. package/lib/{chunk-BMP3YCQW.js → chunk-X7AAPXXZ.js} +2 -2
  32. package/lib/{chunk-X2PNG64U.js → chunk-YHVKM472.js} +2 -2
  33. package/lib/core/index.js +1 -1
  34. package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
  35. package/lib/eth/builtin/erc1155.js +1 -1
  36. package/lib/eth/builtin/erc20.js +1 -1
  37. package/lib/eth/builtin/erc721.js +1 -1
  38. package/lib/eth/builtin/index.js +1 -1
  39. package/lib/eth/builtin/weth9.js +1 -1
  40. package/lib/eth/codegen/index.js +1 -1
  41. package/lib/eth/index.js +1 -1
  42. package/lib/fuel/index.js +1 -1
  43. package/lib/index.js +1 -1
  44. package/lib/move/filter.d.ts +4 -0
  45. package/lib/move/filter.d.ts.map +1 -1
  46. package/lib/move/index.js +1 -1
  47. package/lib/solana/builtin/index.js +1 -1
  48. package/lib/solana/index.js +1 -1
  49. package/lib/stark/index.js +1 -1
  50. package/lib/store/index.js +1 -1
  51. package/lib/sui/builtin/0x1.js +1 -1
  52. package/lib/sui/builtin/0x2.js +1 -1
  53. package/lib/sui/builtin/0x3.js +1 -1
  54. package/lib/sui/builtin/index.js +1 -1
  55. package/lib/sui/ext/index.js +1 -1
  56. package/lib/sui/index.js +1 -1
  57. package/lib/testing/index.js +1 -1
  58. package/lib/utils/index.js +1 -1
  59. package/package.json +2 -2
  60. package/src/aptos/aptos-plugin.ts +38 -12
  61. package/src/aptos/aptos-processor.ts +70 -2
  62. package/src/aptos/context.ts +1 -1
  63. package/src/move/filter.ts +5 -0
  64. package/lib/chunk-34S4LLAM.js +0 -3
  65. package/lib/chunk-34S4LLAM.js.map +0 -1
  66. /package/lib/{chunk-N5RHN4E6.js.map → chunk-42WFEVPJ.js.map} +0 -0
  67. /package/lib/{chunk-CVNNI2QT.js.map → chunk-57ZKWCWX.js.map} +0 -0
  68. /package/lib/{chunk-24SNMMHJ.js.map → chunk-7CN7I4Z2.js.map} +0 -0
  69. /package/lib/{chunk-BWVUWY2B.js.map → chunk-BUS6RMUQ.js.map} +0 -0
  70. /package/lib/{chunk-LVDJAXQH.js.map → chunk-F4KBWSBA.js.map} +0 -0
  71. /package/lib/{chunk-ZZVAJC2R.js.map → chunk-F4KIC6B2.js.map} +0 -0
  72. /package/lib/{chunk-YSISNI4S.js.map → chunk-HX5D5IUX.js.map} +0 -0
  73. /package/lib/{chunk-3DTBA2UT.js.map → chunk-IWVJH75C.js.map} +0 -0
  74. /package/lib/{chunk-QTFRIA2S.js.map → chunk-NKLMB72N.js.map} +0 -0
  75. /package/lib/{chunk-2TUIAYCA.js.map → chunk-ORKCLVS6.js.map} +0 -0
  76. /package/lib/{chunk-FZ5WWK6U.js.map → chunk-PAPBP672.js.map} +0 -0
  77. /package/lib/{chunk-VZXAOB24.js.map → chunk-T55D6SOB.js.map} +0 -0
  78. /package/lib/{chunk-NKG23ZCL.js.map → chunk-UDHFPC34.js.map} +0 -0
  79. /package/lib/{chunk-BMP3YCQW.js.map → chunk-X7AAPXXZ.js.map} +0 -0
  80. /package/lib/{chunk-X2PNG64U.js.map → chunk-YHVKM472.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{a as Ta}from"./chunk-2GOCSOX5.js";import{a as Ne}from"./chunk-7H2MCYRO.js";import{A as $r,Cb as ue,D as nt,Fb as $t,Mc as Wr,W as jr,fa as Vn,gd as Un,ld as ir,oa as st,uc as Oe}from"./chunk-RYF5PIOA.js";import{d as Hn,e as Tt,g as H}from"./chunk-LLHU72AA.js";var Jo={};Hn(Jo,{ERC721BoundContractView:()=>or,ERC721ContractView:()=>Gr,ERC721Processor:()=>wt,ERC721ProcessorTemplate:()=>Dn,ERC721__factory:()=>mt,getERC721Contract:()=>ce,getERC721ContractOnContext:()=>$o,mockApprovalForAllLog:()=>Wo,mockApprovalLog:()=>jo,mockTransferLog:()=>zo});var Mn="6.13.1";function Ea(s,t,e){let r=t.split("|").map(a=>a.trim());for(let a=0;a<r.length;a++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof s===t)return}let n=new Error(`invalid value for type ${t}`);throw n.code="INVALID_ARGUMENT",n.argument=`value.${e}`,n.value=s,n}async function de(s){let t=Object.keys(s);return(await Promise.all(t.map(r=>Promise.resolve(s[r])))).reduce((r,n,a)=>(r[t[a]]=n,r),{})}function C(s,t,e){for(let r in t){let n=t[r],a=e?e[r]:null;a&&Ea(n,a,r),Object.defineProperty(s,r,{enumerable:!0,value:n,writable:!1})}}function pe(s){if(s==null)return"null";if(Array.isArray(s))return"[ "+s.map(pe).join(", ")+" ]";if(s instanceof Uint8Array){let t="0123456789abcdef",e="0x";for(let r=0;r<s.length;r++)e+=t[s[r]>>4],e+=t[s[r]&15];return e}if(typeof s=="object"&&typeof s.toJSON=="function")return pe(s.toJSON());switch(typeof s){case"boolean":case"symbol":return s.toString();case"bigint":return BigInt(s).toString();case"number":return s.toString();case"string":return JSON.stringify(s);case"object":{let t=Object.keys(s);return t.sort(),"{ "+t.map(e=>`${pe(e)}: ${pe(s[e])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function gt(s,t){return s&&s.code===t}function cr(s){return gt(s,"CALL_EXCEPTION")}function Et(s,t,e){let r=s;{let a=[];if(e){if("message"in e||"code"in e||"name"in e)throw new Error(`value will overwrite populated values: ${pe(e)}`);for(let o in e){if(o==="shortMessage")continue;let i=e[o];a.push(o+"="+pe(i))}}a.push(`code=${t}`),a.push(`version=${Mn}`),a.length&&(s+=" ("+a.join(", ")+")")}let n;switch(t){case"INVALID_ARGUMENT":n=new TypeError(s);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":n=new RangeError(s);break;default:n=new Error(s)}return C(n,{code:t}),e&&Object.assign(n,e),n.shortMessage==null&&C(n,{shortMessage:r}),n}function y(s,t,e,r){if(!s)throw Et(t,e,r)}function f(s,t,e,r){y(s,t,"INVALID_ARGUMENT",{argument:e,value:r})}function Be(s,t,e){e==null&&(e=""),e&&(e=": "+e),y(s>=t,"missing arguemnt"+e,"MISSING_ARGUMENT",{count:s,expectedCount:t}),y(s<=t,"too many arguments"+e,"UNEXPECTED_ARGUMENT",{count:s,expectedCount:t})}var ka=["NFD","NFC","NFKD","NFKC"].reduce((s,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"){let e=String.fromCharCode(233).normalize("NFD"),r=String.fromCharCode(101,769);if(e!==r)throw new Error("broken")}s.push(t)}catch{}return s},[]);function zr(s){y(ka.indexOf(s)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:s}})}function Ft(s,t,e){if(e==null&&(e=""),s!==t){let r=e,n="new";e&&(r+=".",n+=" "+e),y(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:n})}}function $n(s,t,e){if(s instanceof Uint8Array)return e?new Uint8Array(s):s;if(typeof s=="string"&&s.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let r=new Uint8Array((s.length-2)/2),n=2;for(let a=0;a<r.length;a++)r[a]=parseInt(s.substring(n,n+2),16),n+=2;return r}f(!1,"invalid BytesLike value",t||"value",s)}function _(s,t){return $n(s,t,!1)}function Z(s,t){return $n(s,t,!0)}function U(s,t){return!(typeof s!="string"||!s.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&s.length!==2+2*t||t===!0&&s.length%2!==0)}function Jr(s){return U(s,!0)||s instanceof Uint8Array}var Gn="0123456789abcdef";function P(s){let t=_(s),e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=Gn[(n&240)>>4]+Gn[n&15]}return e}function at(s){return"0x"+s.map(t=>P(t).substring(2)).join("")}function lr(s){return U(s,!0)?(s.length-2)/2:_(s).length}function yt(s,t,e){let r=_(s);return e!=null&&e>r.length&&y(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:e}),P(r.slice(t??0,e??r.length))}function jn(s,t,e){let r=_(s);y(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});let n=new Uint8Array(t);return n.fill(0),e?n.set(r,t-r.length):n.set(r,0),P(n)}function fe(s,t){return jn(s,t,!0)}function ur(s,t){return jn(s,t,!1)}var dr=BigInt(0),lt=BigInt(1),he=9007199254740991;function Kr(s,t){let e=Se(s,"value"),r=BigInt(I(t,"width"));if(y(e>>r===dr,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:s}),e>>r-lt){let n=(lt<<r)-lt;return-((~e&n)+lt)}return e}function Xr(s,t){let e=T(s,"value"),r=BigInt(I(t,"width")),n=lt<<r-lt;if(e<dr){e=-e,y(e<=n,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});let a=(lt<<r)-lt;return(~e&a)+lt}else y(e<n,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});return e}function me(s,t){let e=Se(s,"value"),r=BigInt(I(t,"bits"));return e&(lt<<r)-lt}function T(s,t){switch(typeof s){case"bigint":return s;case"number":return f(Number.isInteger(s),"underflow",t||"value",s),f(s>=-he&&s<=he,"overflow",t||"value",s),BigInt(s);case"string":try{if(s==="")throw new Error("empty string");return s[0]==="-"&&s[1]!=="-"?-BigInt(s.substring(1)):BigInt(s)}catch(e){f(!1,`invalid BigNumberish string: ${e.message}`,t||"value",s)}}f(!1,"invalid BigNumberish value",t||"value",s)}function Se(s,t){let e=T(s,t);return y(e>=dr,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:s}),e}var Wn="0123456789abcdef";function pr(s){if(s instanceof Uint8Array){let t="0x0";for(let e of s)t+=Wn[e>>4],t+=Wn[e&15];return BigInt(t)}return T(s)}function I(s,t){switch(typeof s){case"bigint":return f(s>=-he&&s<=he,"overflow",t||"value",s),Number(s);case"number":return f(Number.isInteger(s),"underflow",t||"value",s),f(s>=-he&&s<=he,"overflow",t||"value",s),s;case"string":try{if(s==="")throw new Error("empty string");return I(BigInt(s),t)}catch(e){f(!1,`invalid numeric string: ${e.message}`,t||"value",s)}}f(!1,"invalid numeric value",t||"value",s)}function Zr(s){return I(pr(s))}function Fe(s,t){let r=Se(s,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{let n=I(t,"width");for(y(n*2>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:s});r.length<n*2;)r="0"+r}return"0x"+r}function De(s){let t=Se(s,"value");if(t===dr)return new Uint8Array([]);let e=t.toString(16);e.length%2&&(e="0"+e);let r=new Uint8Array(e.length/2);for(let n=0;n<r.length;n++){let a=n*2;r[n]=parseInt(e.substring(a,a+2),16)}return r}var Le=class{filter;emitter;#t;constructor(t,e,r){this.#t=e,C(this,{emitter:t,filter:r})}async removeListener(){this.#t!=null&&await this.emitter.off(this.filter,this.#t)}};function va(s,t,e,r,n){f(!1,`invalid codepoint at offset ${t}; ${s}`,"bytes",e)}function zn(s,t,e,r,n){if(s==="BAD_PREFIX"||s==="UNEXPECTED_CONTINUE"){let a=0;for(let o=t+1;o<e.length&&e[o]>>6===2;o++)a++;return a}return s==="OVERRUN"?e.length-t-1:0}function Pa(s,t,e,r,n){return s==="OVERLONG"?(f(typeof n=="number","invalid bad code point for replacement","badCodepoint",n),r.push(n),0):(r.push(65533),zn(s,t,e,r,n))}var Jn=Object.freeze({error:va,ignore:zn,replace:Pa});function Ia(s,t){t==null&&(t=Jn.error);let e=_(s,"bytes"),r=[],n=0;for(;n<e.length;){let a=e[n++];if(!(a>>7)){r.push(a);continue}let o=null,i=null;if((a&224)===192)o=1,i=127;else if((a&240)===224)o=2,i=2047;else if((a&248)===240)o=3,i=65535;else{(a&192)===128?n+=t("UNEXPECTED_CONTINUE",n-1,e,r):n+=t("BAD_PREFIX",n-1,e,r);continue}if(n-1+o>=e.length){n+=t("OVERRUN",n-1,e,r);continue}let c=a&(1<<8-o-1)-1;for(let l=0;l<o;l++){let u=e[n];if((u&192)!=128){n+=t("MISSING_CONTINUE",n,e,r),c=null;break}c=c<<6|u&63,n++}if(c!==null){if(c>1114111){n+=t("OUT_OF_RANGE",n-1-o,e,r,c);continue}if(c>=55296&&c<=57343){n+=t("UTF16_SURROGATE",n-1-o,e,r,c);continue}if(c<=i){n+=t("OVERLONG",n-1-o,e,r,c);continue}r.push(c)}}return r}function ge(s,t){f(typeof s=="string","invalid string value","str",s),t!=null&&(zr(t),s=s.normalize(t));let e=[];for(let r=0;r<s.length;r++){let n=s.charCodeAt(r);if(n<128)e.push(n);else if(n<2048)e.push(n>>6|192),e.push(n&63|128);else if((n&64512)==55296){r++;let a=s.charCodeAt(r);f(r<s.length&&(a&64512)===56320,"invalid surrogate pair","str",s);let o=65536+((n&1023)<<10)+(a&1023);e.push(o>>18|240),e.push(o>>12&63|128),e.push(o>>6&63|128),e.push(o&63|128)}else e.push(n>>12|224),e.push(n>>6&63|128),e.push(n&63|128)}return new Uint8Array(e)}function Aa(s){return s.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function _e(s,t){return Aa(Ia(s,t))}function Kn(s){let t=[];for(;s;)t.unshift(s&255),s>>=8;return t}function Zn(s){if(Array.isArray(s)){let r=[];if(s.forEach(function(a){r=r.concat(Zn(a))}),r.length<=55)return r.unshift(192+r.length),r;let n=Kn(r.length);return n.unshift(247+n.length),n.concat(r)}let t=Array.prototype.slice.call(_(s,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let e=Kn(t.length);return e.unshift(183+e.length),e.concat(t)}var Xn="0123456789abcdef";function Yr(s){let t="0x";for(let e of Zn(s))t+=Xn[e>>4],t+=Xn[e&15];return t}var W=32,Qr=new Uint8Array(W),Ra=["then"],fr={},qn=new WeakMap;function jt(s){return qn.get(s)}function Yn(s,t){qn.set(s,t)}function He(s,t){let e=new Error(`deferred error during ABI decoding triggered accessing ${s}`);throw e.error=t,e}function qr(s,t,e){return s.indexOf(null)>=0?t.map((r,n)=>r instanceof z?qr(jt(r),r,e):r):s.reduce((r,n,a)=>{let o=t.getValue(n);return n in r||(e&&o instanceof z&&(o=qr(jt(o),o,e)),r[n]=o),r},{})}var z=class extends Array{#t;constructor(...t){let e=t[0],r=t[1],n=(t[2]||[]).slice(),a=!0;e!==fr&&(r=t,n=[],a=!1),super(r.length),r.forEach((c,l)=>{this[l]=c});let o=n.reduce((c,l)=>(typeof l=="string"&&c.set(l,(c.get(l)||0)+1),c),new Map);if(Yn(this,Object.freeze(r.map((c,l)=>{let u=n[l];return u!=null&&o.get(u)===1?u:null}))),this.#t=[],this.#t==null&&this.#t,!a)return;Object.freeze(this);let i=new Proxy(this,{get:(c,l,u)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){let p=I(l,"%index");if(p<0||p>=this.length)throw new RangeError("out of result range");let h=c[p];return h instanceof Error&&He(`index ${p}`,h),h}if(Ra.indexOf(l)>=0)return Reflect.get(c,l,u);let d=c[l];if(d instanceof Function)return function(...p){return d.apply(this===u?c:this,p)};if(!(l in c))return c.getValue.apply(this===u?c:this,[l])}return Reflect.get(c,l,u)}});return Yn(i,jt(this)),i}toArray(t){let e=[];return this.forEach((r,n)=>{r instanceof Error&&He(`index ${n}`,r),t&&r instanceof z&&(r=r.toArray(t)),e.push(r)}),e}toObject(t){let e=jt(this);return e.reduce((r,n,a)=>(y(n!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),qr(e,this,t)),{})}slice(t,e){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),e==null&&(e=this.length),e<0&&(e+=this.length,e<0&&(e=0)),e>this.length&&(e=this.length);let r=jt(this),n=[],a=[];for(let o=t;o<e;o++)n.push(this[o]),a.push(r[o]);return new z(fr,n,a)}filter(t,e){let r=jt(this),n=[],a=[];for(let o=0;o<this.length;o++){let i=this[o];i instanceof Error&&He(`index ${o}`,i),t.call(e,i,o,this)&&(n.push(i),a.push(r[o]))}return new z(fr,n,a)}map(t,e){let r=[];for(let n=0;n<this.length;n++){let a=this[n];a instanceof Error&&He(`index ${n}`,a),r.push(t.call(e,a,n,this))}return r}getValue(t){let e=jt(this).indexOf(t);if(e===-1)return;let r=this[e];return r instanceof Error&&He(`property ${JSON.stringify(t)}`,r.error),r}static fromItems(t,e){return new z(fr,t,e)}};function Qn(s){let t=De(s);return y(t.length<=W,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:W,offset:t.length}),t.length!==W&&(t=Z(at([Qr.slice(t.length%W),t]))),t}var M=class{name;type;localName;dynamic;constructor(t,e,r,n){C(this,{name:t,type:e,localName:r,dynamic:n},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){f(!1,t,this.localName,e)}},Wt=class{#t;#e;constructor(){this.#t=[],this.#e=0}get data(){return at(this.#t)}get length(){return this.#e}#r(t){return this.#t.push(t),this.#e+=t.length,t.length}appendWriter(t){return this.#r(Z(t.data))}writeBytes(t){let e=Z(t),r=e.length%W;return r&&(e=Z(at([e,Qr.slice(r)]))),this.#r(e)}writeValue(t){return this.#r(Qn(t))}writeUpdatableValue(){let t=this.#t.length;return this.#t.push(Qr),this.#e+=W,e=>{this.#t[t]=Qn(e)}}},ye=class{allowLoose;#t;#e;#r;#n;#s;constructor(t,e,r){C(this,{allowLoose:!!e}),this.#t=Z(t),this.#r=0,this.#n=null,this.#s=r??1024,this.#e=0}get data(){return P(this.#t)}get dataLength(){return this.#t.length}get consumed(){return this.#e}get bytes(){return new Uint8Array(this.#t)}#a(t){if(this.#n)return this.#n.#a(t);this.#r+=t,y(this.#s<1||this.#r<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Z(this.#t),offset:this.#e,length:t,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#o(t,e,r){let n=Math.ceil(e/W)*W;return this.#e+n>this.#t.length&&(this.allowLoose&&r&&this.#e+e<=this.#t.length?n=e:y(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Z(this.#t),length:this.#t.length,offset:this.#e+n})),this.#t.slice(this.#e,this.#e+n)}subReader(t){let e=new ye(this.#t.slice(this.#e+t),this.allowLoose,this.#s);return e.#n=this,e}readBytes(t,e){let r=this.#o(0,t,!!e);return this.#a(t),this.#e+=r.length,r.slice(0,t)}readValue(){return pr(this.readBytes(W))}readIndex(){return Zr(this.readBytes(W))}};function tn(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}function en(s,...t){if(!(s instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(s.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${s.length}`)}function rn(s,t=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(t&&s.finished)throw new Error("Hash#digest() has already been called")}function ts(s,t){en(s);let e=t.outputLen;if(s.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var hr=BigInt(4294967295),es=BigInt(32);function Oa(s,t=!1){return t?{h:Number(s&hr),l:Number(s>>es&hr)}:{h:Number(s>>es&hr)|0,l:Number(s&hr)|0}}function rs(s,t=!1){let e=new Uint32Array(s.length),r=new Uint32Array(s.length);for(let n=0;n<s.length;n++){let{h:a,l:o}=Oa(s[n],t);[e[n],r[n]]=[a,o]}return[e,r]}var ns=(s,t,e)=>s<<e|t>>>32-e,ss=(s,t,e)=>t<<e|s>>>32-e,as=(s,t,e)=>t<<e-32|s>>>64-e,os=(s,t,e)=>s<<e-32|t>>>64-e;var Na=s=>s instanceof Uint8Array;var is=s=>new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4));var Ba=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ba)throw new Error("Non little-endian hardware is not supported");function Sa(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function gr(s){if(typeof s=="string"&&(s=Sa(s)),!Na(s))throw new Error(`expected Uint8Array, got ${typeof s}`);return s}var mr=class{clone(){return this._cloneInto()}},vi={}.toString;function cs(s){let t=r=>s().update(gr(r)).digest(),e=s();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>s(),t}function ls(s){let t=(r,n)=>s(n).update(gr(r)).digest(),e=s({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=r=>s(r),t}var[ps,fs,hs]=[[],[],[]],Fa=BigInt(0),Ve=BigInt(1),Da=BigInt(2),La=BigInt(7),_a=BigInt(256),Ha=BigInt(113);for(let s=0,t=Ve,e=1,r=0;s<24;s++){[e,r]=[r,(2*e+3*r)%5],ps.push(2*(5*r+e)),fs.push((s+1)*(s+2)/2%64);let n=Fa;for(let a=0;a<7;a++)t=(t<<Ve^(t>>La)*Ha)%_a,t&Da&&(n^=Ve<<(Ve<<BigInt(a))-Ve);hs.push(n)}var[Va,Ua]=rs(hs,!0),us=(s,t,e)=>e>32?as(s,t,e):ns(s,t,e),ds=(s,t,e)=>e>32?os(s,t,e):ss(s,t,e);function Ma(s,t=24){let e=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)e[o]=s[o]^s[o+10]^s[o+20]^s[o+30]^s[o+40];for(let o=0;o<10;o+=2){let i=(o+8)%10,c=(o+2)%10,l=e[c],u=e[c+1],d=us(l,u,1)^e[i],p=ds(l,u,1)^e[i+1];for(let h=0;h<50;h+=10)s[o+h]^=d,s[o+h+1]^=p}let n=s[2],a=s[3];for(let o=0;o<24;o++){let i=fs[o],c=us(n,a,i),l=ds(n,a,i),u=ps[o];n=s[u],a=s[u+1],s[u]=c,s[u+1]=l}for(let o=0;o<50;o+=10){for(let i=0;i<10;i++)e[i]=s[o+i];for(let i=0;i<10;i++)s[o+i]^=~e[(i+2)%10]&e[(i+4)%10]}s[0]^=Va[r],s[1]^=Ua[r]}e.fill(0)}var be=class extends mr{constructor(t,e,r,n=!1,a=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,tn(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=is(this.state)}keccak(){Ma(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){rn(this);let{blockLen:e,state:r}=this;t=gr(t);let n=t.length;for(let a=0;a<n;){let o=Math.min(e-this.pos,n-a);for(let i=0;i<o;i++)r[this.pos++]^=t[a++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,e&128&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){rn(this,!1),en(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,a=t.length;n<a;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,a-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return tn(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ts(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:n,rounds:a,enableXOF:o}=this;return t||(t=new be(e,r,n,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}},Dt=(s,t,e)=>cs(()=>new be(t,s,e)),Oi=Dt(6,144,224/8),Ni=Dt(6,136,256/8),Bi=Dt(6,104,384/8),Si=Dt(6,72,512/8),Fi=Dt(1,144,224/8),ms=Dt(1,136,256/8),Di=Dt(1,104,384/8),Li=Dt(1,72,512/8),gs=(s,t,e)=>ls((r={})=>new be(t,s,r.dkLen===void 0?e:r.dkLen,!0)),_i=gs(31,168,128/8),Hi=gs(31,136,256/8);var ys=!1,bs=function(s){return ms(s)},xs=bs;function Q(s){let t=_(s,"data");return P(xs(t))}Q._=bs;Q.lock=function(){ys=!0};Q.register=function(s){if(ys)throw new TypeError("keccak256 is locked");xs=s};Object.freeze(Q);var yr="0x0000000000000000000000000000000000000000000000000000000000000000";var Cs=BigInt(0),ws=BigInt(1),Ts=BigInt(2),Es=BigInt(27),ks=BigInt(28),br=BigInt(35),xe={};function vs(s){return fe(De(s),32)}var J=class{#t;#e;#r;#n;get r(){return this.#t}set r(t){f(lr(t)===32,"invalid r","value",t),this.#t=P(t)}get s(){return this.#e}set s(t){f(lr(t)===32,"invalid s","value",t);let e=P(t);f(parseInt(e.substring(0,3))<8,"non-canonical s","value",e),this.#e=e}get v(){return this.#r}set v(t){let e=I(t,"value");f(e===27||e===28,"invalid v","v",t),this.#r=e}get networkV(){return this.#n}get legacyChainId(){let t=this.networkV;return t==null?null:J.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){let t=_(this.s);return this.yParity&&(t[0]|=128),P(t)}get compactSerialized(){return at([this.r,this.yParityAndS])}get serialized(){return at([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(t,e,r,n){Ft(t,xe,"Signature"),this.#t=e,this.#e=r,this.#r=n,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let t=new J(xe,this.r,this.s,this.v);return this.networkV&&(t.#n=this.networkV),t}toJSON(){let t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(t){let e=T(t,"v");return e==Es||e==ks?Cs:(f(e>=br,"invalid EIP-155 v","v",t),(e-br)/Ts)}static getChainIdV(t,e){return T(t)*Ts+BigInt(35+e-27)}static getNormalizedV(t){let e=T(t);return e===Cs||e===Es?27:e===ws||e===ks?28:(f(e>=br,"invalid v","v",t),e&ws?27:28)}static from(t){function e(l,u){f(l,u,"signature",t)}if(t==null)return new J(xe,yr,yr,27);if(typeof t=="string"){let l=_(t,"signature");if(l.length===64){let u=P(l.slice(0,32)),d=l.slice(32,64),p=d[0]&128?28:27;return d[0]&=127,new J(xe,u,P(d),p)}if(l.length===65){let u=P(l.slice(0,32)),d=l.slice(32,64);e((d[0]&128)===0,"non-canonical s");let p=J.getNormalizedV(l[64]);return new J(xe,u,P(d),p)}e(!1,"invalid raw signature length")}if(t instanceof J)return t.clone();let r=t.r;e(r!=null,"missing r");let n=vs(r),a=function(l,u){if(l!=null)return vs(l);if(u!=null){e(U(u,32),"invalid yParityAndS");let d=_(u);return d[0]&=127,P(d)}e(!1,"missing s")}(t.s,t.yParityAndS);e((_(a)[0]&128)==0,"non-canonical s");let{networkV:o,v:i}=function(l,u,d){if(l!=null){let p=T(l);return{networkV:p>=br?p:void 0,v:J.getNormalizedV(p)}}if(u!=null)return e(U(u,32),"invalid yParityAndS"),{v:_(u)[0]&128?28:27};if(d!=null){switch(I(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}e(!1,"invalid yParity")}e(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),c=new J(xe,n,a,i);return o&&(c.#n=o),e(t.yParity==null||I(t.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),e(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};var Ga=BigInt(0),$a=BigInt(36);function Ps(s){s=s.toLowerCase();let t=s.substring(2).split(""),e=new Uint8Array(40);for(let n=0;n<40;n++)e[n]=t[n].charCodeAt(0);let r=_(Q(e));for(let n=0;n<40;n+=2)r[n>>1]>>4>=8&&(t[n]=t[n].toUpperCase()),(r[n>>1]&15)>=8&&(t[n+1]=t[n+1].toUpperCase());return"0x"+t.join("")}var nn={};for(let s=0;s<10;s++)nn[String(s)]=String(s);for(let s=0;s<26;s++)nn[String.fromCharCode(65+s)]=String(10+s);var Is=15;function ja(s){s=s.toUpperCase(),s=s.substring(4)+s.substring(0,2)+"00";let t=s.split("").map(r=>nn[r]).join("");for(;t.length>=Is;){let r=t.substring(0,Is);t=parseInt(r,10)%97+t.substring(r.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}var Wa=function(){let s={};for(let t=0;t<36;t++){let e="0123456789abcdefghijklmnopqrstuvwxyz"[t];s[e]=BigInt(t)}return s}();function za(s){s=s.toLowerCase();let t=Ga;for(let e=0;e<s.length;e++)t=t*$a+Wa[s[e]];return t}function S(s){if(f(typeof s=="string","invalid address","address",s),s.match(/^(0x)?[0-9a-fA-F]{40}$/)){s.startsWith("0x")||(s="0x"+s);let t=Ps(s);return f(!s.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===s,"bad address checksum","address",s),t}if(s.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){f(s.substring(2,4)===ja(s),"bad icap checksum","address",s);let t=za(s.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return Ps("0x"+t)}f(!1,"invalid address","address",s)}function sn(s){let t=S(s.from),r=T(s.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,S(yt(Q(Yr([t,r])),12))}function xr(s){return s&&typeof s.getAddress=="function"}async function an(s,t){let e=await t;return(e==null||e==="0x0000000000000000000000000000000000000000")&&(y(typeof s!="string","unconfigured name","UNCONFIGURED_NAME",{value:s}),f(!1,"invalid AddressLike value; did not resolve to a value address","target",s)),S(e)}function zt(s,t){if(typeof s=="string")return s.match(/^0x[0-9a-f]{40}$/i)?S(s):(y(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),an(s,t.resolveName(s)));if(xr(s))return an(s,s.getAddress());if(s&&typeof s.then=="function")return an(s,s);f(!1,"unsupported addressable value","target",s)}var ut={};function m(s,t){let e=!1;return t<0&&(e=!0,t*=-1),new O(ut,`${e?"":"u"}int${t}`,s,{signed:e,width:t})}function B(s,t){return new O(ut,`bytes${t||""}`,s,{size:t})}var As=Symbol.for("_ethers_typed"),O=class{type;value;#t;_typedSymbol;constructor(t,e,r,n){n==null&&(n=null),Ft(ut,t,"Typed"),C(this,{_typedSymbol:As,type:e,value:r}),this.#t=n,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#t}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#t===!0?-1:this.#t===!1?this.value.length:null}static from(t,e){return new O(ut,t,e)}static uint8(t){return m(t,8)}static uint16(t){return m(t,16)}static uint24(t){return m(t,24)}static uint32(t){return m(t,32)}static uint40(t){return m(t,40)}static uint48(t){return m(t,48)}static uint56(t){return m(t,56)}static uint64(t){return m(t,64)}static uint72(t){return m(t,72)}static uint80(t){return m(t,80)}static uint88(t){return m(t,88)}static uint96(t){return m(t,96)}static uint104(t){return m(t,104)}static uint112(t){return m(t,112)}static uint120(t){return m(t,120)}static uint128(t){return m(t,128)}static uint136(t){return m(t,136)}static uint144(t){return m(t,144)}static uint152(t){return m(t,152)}static uint160(t){return m(t,160)}static uint168(t){return m(t,168)}static uint176(t){return m(t,176)}static uint184(t){return m(t,184)}static uint192(t){return m(t,192)}static uint200(t){return m(t,200)}static uint208(t){return m(t,208)}static uint216(t){return m(t,216)}static uint224(t){return m(t,224)}static uint232(t){return m(t,232)}static uint240(t){return m(t,240)}static uint248(t){return m(t,248)}static uint256(t){return m(t,256)}static uint(t){return m(t,256)}static int8(t){return m(t,-8)}static int16(t){return m(t,-16)}static int24(t){return m(t,-24)}static int32(t){return m(t,-32)}static int40(t){return m(t,-40)}static int48(t){return m(t,-48)}static int56(t){return m(t,-56)}static int64(t){return m(t,-64)}static int72(t){return m(t,-72)}static int80(t){return m(t,-80)}static int88(t){return m(t,-88)}static int96(t){return m(t,-96)}static int104(t){return m(t,-104)}static int112(t){return m(t,-112)}static int120(t){return m(t,-120)}static int128(t){return m(t,-128)}static int136(t){return m(t,-136)}static int144(t){return m(t,-144)}static int152(t){return m(t,-152)}static int160(t){return m(t,-160)}static int168(t){return m(t,-168)}static int176(t){return m(t,-176)}static int184(t){return m(t,-184)}static int192(t){return m(t,-192)}static int200(t){return m(t,-200)}static int208(t){return m(t,-208)}static int216(t){return m(t,-216)}static int224(t){return m(t,-224)}static int232(t){return m(t,-232)}static int240(t){return m(t,-240)}static int248(t){return m(t,-248)}static int256(t){return m(t,-256)}static int(t){return m(t,-256)}static bytes1(t){return B(t,1)}static bytes2(t){return B(t,2)}static bytes3(t){return B(t,3)}static bytes4(t){return B(t,4)}static bytes5(t){return B(t,5)}static bytes6(t){return B(t,6)}static bytes7(t){return B(t,7)}static bytes8(t){return B(t,8)}static bytes9(t){return B(t,9)}static bytes10(t){return B(t,10)}static bytes11(t){return B(t,11)}static bytes12(t){return B(t,12)}static bytes13(t){return B(t,13)}static bytes14(t){return B(t,14)}static bytes15(t){return B(t,15)}static bytes16(t){return B(t,16)}static bytes17(t){return B(t,17)}static bytes18(t){return B(t,18)}static bytes19(t){return B(t,19)}static bytes20(t){return B(t,20)}static bytes21(t){return B(t,21)}static bytes22(t){return B(t,22)}static bytes23(t){return B(t,23)}static bytes24(t){return B(t,24)}static bytes25(t){return B(t,25)}static bytes26(t){return B(t,26)}static bytes27(t){return B(t,27)}static bytes28(t){return B(t,28)}static bytes29(t){return B(t,29)}static bytes30(t){return B(t,30)}static bytes31(t){return B(t,31)}static bytes32(t){return B(t,32)}static address(t){return new O(ut,"address",t)}static bool(t){return new O(ut,"bool",!!t)}static bytes(t){return new O(ut,"bytes",t)}static string(t){return new O(ut,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new O(ut,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===As}static dereference(t,e){if(O.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}};var Cr=class extends M{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let r=O.dereference(e,"string");try{r=S(r)}catch(n){return this._throwError(n.message,e)}return t.writeValue(r)}decode(t){return S(Fe(t.readValue(),20))}};var wr=class extends M{coder;constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}};function on(s,t,e){let r=[];if(Array.isArray(e))r=e;else if(e&&typeof e=="object"){let c={};r=t.map(l=>{let u=l.localName;return y(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),y(!c[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),c[u]=!0,e[u]})}else f(!1,"invalid tuple value","tuple",e);f(t.length===r.length,"types/value length mismatch","tuple",e);let n=new Wt,a=new Wt,o=[];t.forEach((c,l)=>{let u=r[l];if(c.dynamic){let d=a.length;c.encode(a,u);let p=n.writeUpdatableValue();o.push(h=>{p(h+d)})}else c.encode(n,u)}),o.forEach(c=>{c(n.length)});let i=s.appendWriter(n);return i+=s.appendWriter(a),i}function cn(s,t){let e=[],r=[],n=s.subReader(0);return t.forEach(a=>{let o=null;if(a.dynamic){let i=s.readIndex(),c=n.subReader(i);try{o=a.decode(c)}catch(l){if(gt(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(s)}catch(i){if(gt(i,"BUFFER_OVERRUN"))throw i;o=i,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");e.push(o),r.push(a.localName||null)}),z.fromItems(e,r)}var Tr=class extends M{coder;length;constructor(t,e,r){let n=t.type+"["+(e>=0?e:"")+"]",a=e===-1||t.dynamic;super("array",n,r,a),C(this,{coder:t,length:e})}defaultValue(){let t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){let r=O.dereference(e,"array");Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,t.writeValue(r.length)),Be(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<r.length;o++)a.push(this.coder);return on(t,a,r)}decode(t){let e=this.length;e===-1&&(e=t.readIndex(),y(e*W<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*W,length:t.dataLength}));let r=[];for(let n=0;n<e;n++)r.push(new wr(this.coder));return cn(t,r)}};var Er=class extends M{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){let r=O.dereference(e,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}};var Ue=class extends M{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=Z(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readIndex(),!0)}},kr=class extends Ue{constructor(t){super("bytes",t)}decode(t){return P(super.decode(t))}};var vr=class extends M{size;constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),C(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,e){let r=Z(O.dereference(e,this.type));return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return P(t.readBytes(this.size))}};var Ja=new Uint8Array([]),Pr=class extends M{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes(Ja)}decode(t){return t.readBytes(0),null}};var Ka=BigInt(0),Xa=BigInt(1),Za=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ir=class extends M{size;signed;constructor(t,e,r){let n=(e?"int":"uint")+t*8;super(n,n,r,!1),C(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let r=T(O.dereference(e,this.type)),n=me(Za,W*8);if(this.signed){let a=me(n,this.size*8-1);(r>a||r<-(a+Xa))&&this._throwError("value out-of-bounds",e),r=Xr(r,8*W)}else(r<Ka||r>me(n,this.size*8))&&this._throwError("value out-of-bounds",e);return t.writeValue(r)}decode(t){let e=me(t.readValue(),this.size*8);return this.signed&&(e=Kr(e,this.size*8)),e}};var Ar=class extends Ue{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,ge(O.dereference(e,"string")))}decode(t){return _e(super.decode(t))}};var Jt=class extends M{coders;constructor(t,e){let r=!1,n=[];t.forEach(o=>{o.dynamic&&(r=!0),n.push(o.type)});let a="tuple("+n.join(",")+")";super("tuple",a,e,r),C(this,{coders:Object.freeze(t.slice())})}defaultValue(){let t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});let e=this.coders.reduce((r,n)=>{let a=n.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,n)=>{let a=r.localName;!a||e[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[n]))}),Object.freeze(t)}encode(t,e){let r=O.dereference(e,"tuple");return on(t,this.coders,r)}decode(t){return cn(t,this.coders)}};function Lt(s){return Q(ge(s))}function ln(s,t){return{address:S(s),storageKeys:t.map((e,r)=>(f(U(e,32),"invalid slot",`storageKeys[${r}]`,e),e.toLowerCase()))}}function Me(s){if(Array.isArray(s))return s.map((e,r)=>Array.isArray(e)?(f(e.length===2,"invalid slot set",`value[${r}]`,e),ln(e[0],e[1])):(f(e!=null&&typeof e=="object","invalid address-slot set","value",s),ln(e.address,e.storageKeys)));f(s!=null&&typeof s=="object","invalid access list","value",s);let t=Object.keys(s).map(e=>{let r=s[e].reduce((n,a)=>(n[a]=!0,n),{});return ln(e,Object.keys(r).sort())});return t.sort((e,r)=>e.address.localeCompare(r.address)),t}function Y(s){let t=new Set;return s.forEach(e=>t.add(e)),Object.freeze(t)}var Ya="external public payable override",Qa=Y(Ya.split(" ")),Hs="constant external internal payable private public pure view override",qa=Y(Hs.split(" ")),Vs="constructor error event fallback function receive struct",Us=Y(Vs.split(" ")),Ms="calldata memory storage payable indexed",to=Y(Ms.split(" ")),eo="tuple returns",ro=[Vs,Ms,eo,Hs].join(" "),no=Y(ro.split(" ")),so={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},ao=new RegExp("^(\\s*)"),oo=new RegExp("^([0-9]+)"),io=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Gs=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),$s=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),et=class{#t;#e;get offset(){return this.#t}get length(){return this.#e.length-this.#t}constructor(t){this.#t=0,this.#e=t.slice()}clone(){return new et(this.#e)}reset(){this.#t=0}#r(t=0,e=0){return new et(this.#e.slice(t,e).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))}popKeyword(t){let e=this.peek();if(e.type!=="KEYWORD"||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){let e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){let t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");let e=this.#r(this.#t+1,t.match+1);return this.#t=t.match+1,e}popParams(){let t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");let e=[];for(;this.#t<t.match-1;){let r=this.peek().linkNext;e.push(this.#r(this.#t+1,r)),this.#t=r}return this.#t=t.match+1,e}peek(){if(this.#t>=this.#e.length)throw new Error("out-of-bounds");return this.#e[this.#t]}peekKeyword(t){let e=this.peekType("KEYWORD");return e!=null&&t.has(e)?e:null}peekType(t){if(this.length===0)return null;let e=this.peek();return e.type===t?e.text:null}pop(){let t=this.peek();return this.#t++,t}toString(){let t=[];for(let e=this.#t;e<this.#e.length;e++){let r=this.#e[e];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};function _t(s){let t=[],e=o=>{let i=a<s.length?JSON.stringify(s[a]):"$EOI";throw new Error(`invalid token ${i} at ${a}: ${o}`)},r=[],n=[],a=0;for(;a<s.length;){let o=s.substring(a),i=o.match(ao);i&&(a+=i[1].length,o=s.substring(a));let c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(c);let l=so[o[0]]||"";if(l){if(c.type=l,c.text=o[0],a++,l==="OPEN_PAREN")r.push(t.length-1),n.push(t.length-1);else if(l=="CLOSE_PAREN")r.length===0&&e("no matching open bracket"),c.match=r.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=n.pop(),t[c.linkBack].linkNext=t.length-1;else if(l==="COMMA")c.linkBack=n.pop(),t[c.linkBack].linkNext=t.length-1,n.push(t.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let u=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){let d=t.pop().text;u=d+u,t[t.length-1].value=I(d)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=u}continue}if(i=o.match(io),i){if(c.text=i[1],a+=c.text.length,no.has(c.text)){c.type="KEYWORD";continue}if(c.text.match($s)){c.type="TYPE";continue}c.type="ID";continue}if(i=o.match(oo),i){c.text=i[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new et(t.map(o=>Object.freeze(o)))}function Rs(s,t){let e=[];for(let r in t.keys())s.has(r)&&e.push(r);if(e.length>1)throw new Error(`conflicting types: ${e.join(", ")}`)}function Rr(s,t){if(t.peekKeyword(Us)){let e=t.pop().text;if(e!==s)throw new Error(`expected ${s}, got ${e}`)}return t.popType("ID")}function vt(s,t){let e=new Set;for(;;){let r=s.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(s.pop(),e.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);e.add(r)}return Object.freeze(e)}function js(s){let t=vt(s,qa);return Rs(t,Y("constant payable nonpayable".split(" "))),Rs(t,Y("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function kt(s,t){return s.popParams().map(e=>F.from(e,t))}function Ws(s){if(s.peekType("AT")){if(s.pop(),s.peekType("NUMBER"))return T(s.pop().text);throw new Error("invalid gas")}return null}function Kt(s){if(s.length)throw new Error(`unexpected tokens at offset ${s.offset}: ${s.toString()}`)}var co=new RegExp(/^(.*)\[([0-9]*)\]$/);function Os(s){let t=s.match($s);if(f(t,"invalid type","type",s),s==="uint")return"uint256";if(s==="int")return"int256";if(t[2]){let e=parseInt(t[2]);f(e!==0&&e<=32,"invalid bytes length","type",s)}else if(t[3]){let e=parseInt(t[3]);f(e!==0&&e<=256&&e%8===0,"invalid numeric width","type",s)}return s}var V={},rt=Symbol.for("_ethers_internal"),Ns="_ParamTypeInternal",Bs="_ErrorInternal",Ss="_EventInternal",Fs="_ConstructorInternal",Ds="_FallbackInternal",Ls="_FunctionInternal",_s="_StructInternal",F=class{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(t,e,r,n,a,o,i,c){if(Ft(t,V,"ParamType"),Object.defineProperty(this,rt,{value:Ns}),o&&(o=Object.freeze(o.slice())),n==="array"){if(i==null||c==null)throw new Error("")}else if(i!=null||c!=null)throw new Error("");if(n==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");C(this,{name:e,type:r,baseType:n,indexed:a,components:o,arrayLength:i,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="json"){let r=this.name||"";if(this.isArray()){let a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}let n={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":e+=this.type,t!=="sighash"&&(this.indexed===!0&&(e+=" indexed"),t==="full"&&this.name&&(e+=" "+this.name)),e}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let r=this;return t.map(n=>r.arrayChildren.walk(n,e))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");let r=this;return t.map((n,a)=>r.components[a].walk(n,e))}return e(this.type,t)}#t(t,e,r,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,i=e.slice();i.forEach((c,l)=>{o.#t(t,c,r,u=>{i[l]=u})}),n(i);return}if(this.isTuple()){let o=this.components,i;if(Array.isArray(e))i=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");i=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in e))throw new Error(`missing value for component ${c.name}`);return e[c.name]})}if(i.length!==this.components.length)throw new Error("array is wrong length");i.forEach((c,l)=>{o[l].#t(t,c,r,u=>{i[l]=u})}),n(i);return}let a=r(this.type,e);a.then?t.push(async function(){n(await a)}()):n(a)}async walkAsync(t,e){let r=[],n=[t];return this.#t(r,t,e,a=>{n[0]=a}),r.length&&await Promise.all(r),n[0]}static from(t,e){if(F.isParamType(t))return t;if(typeof t=="string")try{return F.from(_t(t),e)}catch{f(!1,"invalid param type","obj",t)}else if(t instanceof et){let i="",c="",l=null;vt(t,Y(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",l=t.popParams().map(w=>F.from(w)),i=`tuple(${l.map(w=>w.format()).join(",")})`):(i=Os(t.popType("TYPE")),c=i);let u=null,d=null;for(;t.length&&t.peekType("BRACKET");){let w=t.pop();u=new F(V,"",i,c,null,l,d,u),d=w.value,i+=w.text,c="array",l=null}let p=null;if(vt(t,to).has("indexed")){if(!e)throw new Error("");p=!0}let x=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new F(V,x,i,c,p,l,d,u)}let r=t.name;f(!r||typeof r=="string"&&r.match(Gs),"invalid name","obj.name",r);let n=t.indexed;n==!0?(f(e,"parameter cannot be indexed","obj.indexed",t.indexed),n=!0):n=!1;let a=t.type,o=a.match(co);if(o){let i=parseInt(o[2]||"-1"),c=F.from({type:o[1],components:t.components});return new F(V,r||"",a,"array",n,null,i,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){let i=t.components!=null?t.components.map(l=>F.from(l)):null;return new F(V,r||"",a,"tuple",n,i,null,null)}return a=Os(t.type),new F(V,r||"",a,a,n,null,null,null)}static isParamType(t){return t&&t[rt]===Ns}},dt=class{type;inputs;constructor(t,e,r){Ft(t,V,"Fragment"),r=Object.freeze(r.slice()),C(this,{type:e,inputs:r})}static from(t){if(typeof t=="string"){try{dt.from(JSON.parse(t))}catch{}return dt.from(_t(t))}if(t instanceof et)switch(t.peekKeyword(Us)){case"constructor":return ot.from(t);case"error":return $.from(t);case"event":return q.from(t);case"fallback":case"receive":return ct.from(t);case"function":return tt.from(t);case"struct":return bt.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return ot.from(t);case"error":return $.from(t);case"event":return q.from(t);case"fallback":case"receive":return ct.from(t);case"function":return tt.from(t);case"struct":return bt.from(t)}y(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}f(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return ot.isFragment(t)}static isError(t){return $.isFragment(t)}static isEvent(t){return q.isFragment(t)}static isFunction(t){return tt.isFragment(t)}static isStruct(t){return bt.isFragment(t)}},Xt=class extends dt{name;constructor(t,e,r,n){super(t,e,n),f(typeof r=="string"&&r.match(Gs),"invalid identifier","name",r),n=Object.freeze(n.slice()),C(this,{name:r})}};function Ge(s,t){return"("+t.map(e=>e.format(s)).join(s==="full"?", ":",")+")"}var $=class extends Xt{constructor(t,e,r){super(t,"error",e,r),Object.defineProperty(this,rt,{value:Bs})}get selector(){return Lt(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let e=[];return t!=="sighash"&&e.push("error"),e.push(this.name+Ge(t,this.inputs)),e.join(" ")}static from(t){if($.isFragment(t))return t;if(typeof t=="string")return $.from(_t(t));if(t instanceof et){let e=Rr("error",t),r=kt(t);return Kt(t),new $(V,e,r)}return new $(V,t.name,t.inputs?t.inputs.map(F.from):[])}static isFragment(t){return t&&t[rt]===Bs}},q=class extends Xt{anonymous;constructor(t,e,r,n){super(t,"event",e,r),Object.defineProperty(this,rt,{value:Ss}),C(this,{anonymous:n})}get topicHash(){return Lt(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let e=[];return t!=="sighash"&&e.push("event"),e.push(this.name+Ge(t,this.inputs)),t!=="sighash"&&this.anonymous&&e.push("anonymous"),e.join(" ")}static getTopicHash(t,e){return e=(e||[]).map(n=>F.from(n)),new q(V,t,e,!1).topicHash}static from(t){if(q.isFragment(t))return t;if(typeof t=="string")try{return q.from(_t(t))}catch{f(!1,"invalid event fragment","obj",t)}else if(t instanceof et){let e=Rr("event",t),r=kt(t,!0),n=!!vt(t,Y(["anonymous"])).has("anonymous");return Kt(t),new q(V,e,r,n)}return new q(V,t.name,t.inputs?t.inputs.map(e=>F.from(e,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[rt]===Ss}},ot=class extends dt{payable;gas;constructor(t,e,r,n,a){super(t,e,r),Object.defineProperty(this,rt,{value:Fs}),C(this,{payable:n,gas:a})}format(t){if(y(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let e=[`constructor${Ge(t,this.inputs)}`];return this.payable&&e.push("payable"),this.gas!=null&&e.push(`@${this.gas.toString()}`),e.join(" ")}static from(t){if(ot.isFragment(t))return t;if(typeof t=="string")try{return ot.from(_t(t))}catch{f(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof et){vt(t,Y(["constructor"]));let e=kt(t),r=!!vt(t,Qa).has("payable"),n=Ws(t);return Kt(t),new ot(V,"constructor",e,r,n)}return new ot(V,"constructor",t.inputs?t.inputs.map(F.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[rt]===Fs}},ct=class extends dt{payable;constructor(t,e,r){super(t,"fallback",e),Object.defineProperty(this,rt,{value:Ds}),C(this,{payable:r})}format(t){let e=this.inputs.length===0?"receive":"fallback";if(t==="json"){let r=this.payable?"payable":"nonpayable";return JSON.stringify({type:e,stateMutability:r})}return`${e}()${this.payable?" payable":""}`}static from(t){if(ct.isFragment(t))return t;if(typeof t=="string")try{return ct.from(_t(t))}catch{f(!1,"invalid fallback fragment","obj",t)}else if(t instanceof et){let e=t.toString(),r=t.peekKeyword(Y(["fallback","receive"]));if(f(r,"type must be fallback or receive","obj",e),t.popKeyword(Y(["fallback","receive"]))==="receive"){let i=kt(t);return f(i.length===0,"receive cannot have arguments","obj.inputs",i),vt(t,Y(["payable"])),Kt(t),new ct(V,[],!0)}let a=kt(t);a.length?f(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(i=>i.format("minimal")).join(", ")):a=[F.from("bytes")];let o=js(t);if(f(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),vt(t,Y(["returns"])).has("returns")){let i=kt(t);f(i.length===1&&i[0].type==="bytes","invalid fallback outputs","obj.outputs",i.map(c=>c.format("minimal")).join(", "))}return Kt(t),new ct(V,a,o==="payable")}if(t.type==="receive")return new ct(V,[],!0);if(t.type==="fallback"){let e=[F.from("bytes")],r=t.stateMutability==="payable";return new ct(V,e,r)}f(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[rt]===Ds}},tt=class extends Xt{constant;outputs;stateMutability;payable;gas;constructor(t,e,r,n,a,o){super(t,"function",e,n),Object.defineProperty(this,rt,{value:Ls}),a=Object.freeze(a.slice()),C(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Lt(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});let e=[];return t!=="sighash"&&e.push("function"),e.push(this.name+Ge(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(Ge(t,this.outputs))),this.gas!=null&&e.push(`@${this.gas.toString()}`)),e.join(" ")}static getSelector(t,e){return e=(e||[]).map(n=>F.from(n)),new tt(V,t,"view",e,[],null).selector}static from(t){if(tt.isFragment(t))return t;if(typeof t=="string")try{return tt.from(_t(t))}catch{f(!1,"invalid function fragment","obj",t)}else if(t instanceof et){let r=Rr("function",t),n=kt(t),a=js(t),o=[];vt(t,Y(["returns"])).has("returns")&&(o=kt(t));let i=Ws(t);return Kt(t),new tt(V,r,a,n,o,i)}let e=t.stateMutability;return e==null&&(e="payable",typeof t.constant=="boolean"?(e="view",t.constant||(e="payable",typeof t.payable=="boolean"&&!t.payable&&(e="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(e="nonpayable")),new tt(V,t.name,e,t.inputs?t.inputs.map(F.from):[],t.outputs?t.outputs.map(F.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[rt]===Ls}},bt=class extends Xt{constructor(t,e,r){super(t,"struct",e,r),Object.defineProperty(this,rt,{value:_s})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return bt.from(_t(t))}catch{f(!1,"invalid struct fragment","obj",t)}else if(t instanceof et){let e=Rr("struct",t),r=kt(t);return Kt(t),new bt(V,e,r)}return new bt(V,t.name,t.inputs?t.inputs.map(F.from):[])}static isFragment(t){return t&&t[rt]===_s}};var pt=new Map;pt.set(0,"GENERIC_PANIC");pt.set(1,"ASSERT_FALSE");pt.set(17,"OVERFLOW");pt.set(18,"DIVIDE_BY_ZERO");pt.set(33,"ENUM_RANGE_ERROR");pt.set(34,"BAD_STORAGE_DATA");pt.set(49,"STACK_UNDERFLOW");pt.set(50,"ARRAY_RANGE_ERROR");pt.set(65,"OUT_OF_MEMORY");pt.set(81,"UNINITIALIZED_FUNCTION_CALL");var lo=new RegExp(/^bytes([0-9]*)$/),uo=new RegExp(/^(u?int)([0-9]*)$/),un=null,zs=1024;function po(s,t,e,r){let n="missing revert data",a=null,o=null,i=null;if(e){n="execution reverted";let l=_(e);if(e=P(e),l.length===0)n+=" (no data present; likely require(false) occurred",a="require(false)";else if(l.length%32!==4)n+=" (could not decode reason; invalid data length)";else if(P(l.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],l.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[a]},n+=`: ${JSON.stringify(a)}`}catch{n+=" (could not decode reason; invalid string data)"}else if(P(l.slice(0,4))==="0x4e487b71")try{let u=Number(r.decode(["uint256"],l.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${pt.get(u)||"UNKNOWN"}(${u})`,n+=`: ${a}`}catch{n+=" (could not decode panic code)"}else n+=" (unknown custom error)"}let c={to:t.to?S(t.to):null,data:t.data||"0x"};return t.from&&(c.from=S(t.from)),Et(n,"CALL_EXCEPTION",{action:s,data:e,reason:a,transaction:c,invocation:o,revert:i})}var Pt=class{#t(t){if(t.isArray())return new Tr(this.#t(t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Jt(t.components.map(r=>this.#t(r)),t.name);switch(t.baseType){case"address":return new Cr(t.name);case"bool":return new Er(t.name);case"string":return new Ar(t.name);case"bytes":return new kr(t.name);case"":return new Pr(t.name)}let e=t.type.match(uo);if(e){let r=parseInt(e[2]||"256");return f(r!==0&&r<=256&&r%8===0,"invalid "+e[1]+" bit length","param",t),new Ir(r/8,e[1]==="int",t.name)}if(e=t.type.match(lo),e){let r=parseInt(e[1]);return f(r!==0&&r<=32,"invalid bytes length","param",t),new vr(r,t.name)}f(!1,"invalid type","type",t.type)}getDefaultValue(t){let e=t.map(n=>this.#t(F.from(n)));return new Jt(e,"_").defaultValue()}encode(t,e){Be(e.length,t.length,"types/values length mismatch");let r=t.map(o=>this.#t(F.from(o))),n=new Jt(r,"_"),a=new Wt;return n.encode(a,e),a.data}decode(t,e,r){let n=t.map(o=>this.#t(F.from(o)));return new Jt(n,"_").decode(new ye(e,r,zs))}static _setDefaultMaxInflation(t){f(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),zs=t}static defaultAbiCoder(){return un==null&&(un=new Pt),un}static getBuiltinCallException(t,e,r){return po(t,e,r,Pt.defaultAbiCoder())}};function Js(s){let t=_(s,"bytes");if(t.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(t[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let e=31;for(;t[e-1]===0;)e--;return _e(t.slice(0,e))}var $e=class{fragment;name;signature;topic;args;constructor(t,e,r){let n=t.name,a=t.format();C(this,{fragment:t,name:n,signature:a,topic:e,args:r})}},je=class{fragment;name;args;signature;selector;value;constructor(t,e,r,n){let a=t.name,o=t.format();C(this,{fragment:t,name:a,args:r,signature:o,selector:e,value:n})}},We=class{fragment;name;args;signature;selector;constructor(t,e,r){let n=t.name,a=t.format();C(this,{fragment:t,name:n,args:r,signature:a,selector:e})}},Ce=class{hash;_isIndexed;static isIndexed(t){return!!(t&&t._isIndexed)}constructor(t){C(this,{hash:t,_isIndexed:!0})}},Ks={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Xs={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:s=>`reverted with reason string ${JSON.stringify(s)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:s=>{let t="unknown panic code";return s>=0&&s<=255&&Ks[s.toString()]&&(t=Ks[s.toString()]),`reverted with panic code 0x${s.toString(16)} (${t})`}}},b=class{fragments;deploy;fallback;receive;#t;#e;#r;#n;constructor(t){let e=[];typeof t=="string"?e=JSON.parse(t):e=t,this.#r=new Map,this.#t=new Map,this.#e=new Map;let r=[];for(let o of e)try{r.push(dt.from(o))}catch(i){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,i.message)}C(this,{fragments:Object.freeze(r)});let n=null,a=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((o,i)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}C(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(f(!n||o.payable!==n.payable,"conflicting fallback fragments",`fragments[${i}]`,o),n=o,a=n.payable);return;case"function":c=this.#r;break;case"event":c=this.#e;break;case"error":c=this.#t;break;default:return}let l=o.format();c.has(l)||c.set(l,o)}),this.deploy||C(this,{deploy:ot.from("constructor()")}),C(this,{fallback:n,receive:a})}format(t){let e=t?"minimal":"full";return this.fragments.map(n=>n.format(e))}formatJson(){let t=this.fragments.map(e=>e.format("json"));return JSON.stringify(t.map(e=>JSON.parse(e)))}getAbiCoder(){return Pt.defaultAbiCoder()}#s(t,e,r){if(U(t)){let a=t.toLowerCase();for(let o of this.#r.values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){let a=[];for(let[o,i]of this.#r)o.split("(")[0]===t&&a.push(i);if(e){let o=e.length>0?e[e.length-1]:null,i=e.length,c=!0;O.isTyped(o)&&o.type==="overrides"&&(c=!1,i--);for(let l=a.length-1;l>=0;l--){let u=a[l].inputs.length;u!==i&&(!c||u!==i-1)&&a.splice(l,1)}for(let l=a.length-1;l>=0;l--){let u=a[l].inputs;for(let d=0;d<e.length;d++)if(O.isTyped(e[d])){if(d>=u.length){if(e[d].type==="overrides")continue;a.splice(l,1);break}if(e[d].type!==u[d].baseType){a.splice(l,1);break}}}}if(a.length===1&&e&&e.length!==a[0].inputs.length){let o=e[e.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){let o=a.map(i=>JSON.stringify(i.format())).join(", ");f(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}let n=this.#r.get(tt.from(t).format());return n||null}getFunctionName(t){let e=this.#s(t,null,!1);return f(e,"no matching function","key",t),e.name}hasFunction(t){return!!this.#s(t,null,!1)}getFunction(t,e){return this.#s(t,e||null,!0)}forEachFunction(t){let e=Array.from(this.#r.keys());e.sort((r,n)=>r.localeCompare(n));for(let r=0;r<e.length;r++){let n=e[r];t(this.#r.get(n),r)}}#a(t,e,r){if(U(t)){let a=t.toLowerCase();for(let o of this.#e.values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){let a=[];for(let[o,i]of this.#e)o.split("(")[0]===t&&a.push(i);if(e){for(let o=a.length-1;o>=0;o--)a[o].inputs.length<e.length&&a.splice(o,1);for(let o=a.length-1;o>=0;o--){let i=a[o].inputs;for(let c=0;c<e.length;c++)if(O.isTyped(e[c])&&e[c].type!==i[c].baseType){a.splice(o,1);break}}}if(a.length===0)return null;if(a.length>1&&r){let o=a.map(i=>JSON.stringify(i.format())).join(", ");f(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}let n=this.#e.get(q.from(t).format());return n||null}getEventName(t){let e=this.#a(t,null,!1);return f(e,"no matching event","key",t),e.name}hasEvent(t){return!!this.#a(t,null,!1)}getEvent(t,e){return this.#a(t,e||null,!0)}forEachEvent(t){let e=Array.from(this.#e.keys());e.sort((r,n)=>r.localeCompare(n));for(let r=0;r<e.length;r++){let n=e[r];t(this.#e.get(n),r)}}getError(t,e){if(U(t)){let n=t.toLowerCase();if(Xs[n])return $.from(Xs[n].signature);for(let a of this.#t.values())if(n===a.selector)return a;return null}if(t.indexOf("(")===-1){let n=[];for(let[a,o]of this.#t)a.split("(")[0]===t&&n.push(o);if(n.length===0)return t==="Error"?$.from("error Error(string)"):t==="Panic"?$.from("error Panic(uint256)"):null;if(n.length>1){let a=n.map(o=>JSON.stringify(o.format())).join(", ");f(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return n[0]}if(t=$.from(t).format(),t==="Error(string)")return $.from("error Error(string)");if(t==="Panic(uint256)")return $.from("error Panic(uint256)");let r=this.#t.get(t);return r||null}forEachError(t){let e=Array.from(this.#t.keys());e.sort((r,n)=>r.localeCompare(n));for(let r=0;r<e.length;r++){let n=e[r];t(this.#t.get(n),r)}}_decodeParams(t,e){return this.#n.decode(t,e)}_encodeParams(t,e){return this.#n.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if(typeof t=="string"){let r=this.getError(t);f(r,"unknown error","fragment",t),t=r}return f(yt(e,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,yt(e,4))}encodeErrorResult(t,e){if(typeof t=="string"){let r=this.getError(t);f(r,"unknown error","fragment",t),t=r}return at([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if(typeof t=="string"){let r=this.getFunction(t);f(r,"unknown function","fragment",t),t=r}return f(yt(e,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,yt(e,4))}encodeFunctionData(t,e){if(typeof t=="string"){let r=this.getFunction(t);f(r,"unknown function","fragment",t),t=r}return at([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if(typeof t=="string"){let a=this.getFunction(t);f(a,"unknown function","fragment",t),t=a}let r="invalid length for result data",n=Z(e);if(n.length%32===0)try{return this.#n.decode(t.outputs,n)}catch{r="could not decode result data"}y(!1,r,"BAD_DATA",{value:P(n),info:{method:t.name,signature:t.format()}})}makeError(t,e){let r=_(t,"data"),n=Pt.getBuiltinCallException("call",e,r),a="execution reverted (unknown custom error)";if(n.message.startsWith(a)){let i=P(r.slice(0,4)),c=this.getError(i);if(c)try{let l=this.#n.decode(c.inputs,r.slice(4));n.revert={name:c.name,signature:c.format(),args:l},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch{n.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(e);return o&&(n.invocation={method:o.name,signature:o.signature,args:o.args}),n}encodeFunctionResult(t,e){if(typeof t=="string"){let r=this.getFunction(t);f(r,"unknown function","fragment",t),t=r}return P(this.#n.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if(typeof t=="string"){let a=this.getEvent(t);f(a,"unknown event","eventFragment",t),t=a}y(e.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});let r=[];t.anonymous||r.push(t.topicHash);let n=(a,o)=>a.type==="string"?Lt(o):a.type==="bytes"?Q(P(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=Fe(o):a.type.match(/^bytes/)?o=ur(o,32):a.type==="address"&&this.#n.encode(["address"],[o]),fe(P(o),32));for(e.forEach((a,o)=>{let i=t.inputs[o];if(!i.indexed){f(a==null,"cannot filter non-indexed parameters; must be null","contract."+i.name,a);return}a==null?r.push(null):i.baseType==="array"||i.baseType==="tuple"?f(!1,"filtering with tuples or arrays not supported","contract."+i.name,a):Array.isArray(a)?r.push(a.map(c=>n(i,c))):r.push(n(i,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,e){if(typeof t=="string"){let o=this.getEvent(t);f(o,"unknown event","eventFragment",t),t=o}let r=[],n=[],a=[];return t.anonymous||r.push(t.topicHash),f(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach((o,i)=>{let c=e[i];if(o.indexed)if(o.type==="string")r.push(Lt(c));else if(o.type==="bytes")r.push(Q(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(this.#n.encode([o.type],[c]))}else n.push(o),a.push(c)}),{data:this.#n.encode(n,a),topics:r}}decodeEventLog(t,e,r){if(typeof t=="string"){let h=this.getEvent(t);f(h,"unknown event","eventFragment",t),t=h}if(r!=null&&!t.anonymous){let h=t.topicHash;f(U(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}let n=[],a=[],o=[];t.inputs.forEach((h,x)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(n.push(F.from({type:"bytes32",name:h.name})),o.push(!0)):(n.push(h),o.push(!1)):(a.push(h),o.push(!1))});let i=r!=null?this.#n.decode(n,at(r)):null,c=this.#n.decode(a,e,!0),l=[],u=[],d=0,p=0;return t.inputs.forEach((h,x)=>{let w=null;if(h.indexed)if(i==null)w=new Ce(null);else if(o[x])w=new Ce(i[p++]);else try{w=i[p++]}catch(A){w=A}else try{w=c[d++]}catch(A){w=A}l.push(w),u.push(h.name||null)}),z.fromItems(l,u)}parseTransaction(t){let e=_(t.data,"tx.data"),r=T(t.value!=null?t.value:0,"tx.value"),n=this.getFunction(P(e.slice(0,4)));if(!n)return null;let a=this.#n.decode(n.inputs,e.slice(4));return new je(n,n.selector,a,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new $e(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){let e=P(t),r=this.getError(yt(e,0,4));if(!r)return null;let n=this.#n.decode(r.inputs,yt(e,4));return new We(r,r.selector,n)}static from(t){return t instanceof b?t:typeof t=="string"?new b(JSON.parse(t)):typeof t.formatJson=="function"?new b(t.formatJson()):typeof t.format=="function"?new b(t.format("json")):new b(t)}};var Qs=BigInt(0);function dn(s){return s??null}function j(s){return s==null?null:s.toString()}function qs(s){let t={};s.to&&(t.to=s.to),s.from&&(t.from=s.from),s.data&&(t.data=P(s.data));let e="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let n of e)!(n in s)||s[n]==null||(t[n]=T(s[n],`request.${n}`));let r="type,nonce".split(/,/);for(let n of r)!(n in s)||s[n]==null||(t[n]=I(s[n],`request.${n}`));return s.accessList&&(t.accessList=Me(s.accessList)),"blockTag"in s&&(t.blockTag=s.blockTag),"enableCcipRead"in s&&(t.enableCcipRead=!!s.enableCcipRead),"customData"in s&&(t.customData=s.customData),"blobVersionedHashes"in s&&s.blobVersionedHashes&&(t.blobVersionedHashes=s.blobVersionedHashes.slice()),"kzg"in s&&(t.kzg=s.kzg),"blobs"in s&&s.blobs&&(t.blobs=s.blobs.map(n=>Jr(n)?P(n):Object.assign({},n))),t}var Ys=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#t;constructor(t,e){this.#t=t.transactions.map(r=>typeof r!="string"?new Zt(r,e):r),C(this,{provider:e,hash:dn(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:dn(t.prevRandao),extraData:t.extraData,baseFeePerGas:dn(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return this.#t.map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){let t=this.#t.slice();return t.length===0?[]:(y(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){let{baseFeePerGas:t,difficulty:e,extraData:r,gasLimit:n,gasUsed:a,hash:o,miner:i,prevRandao:c,nonce:l,number:u,parentHash:d,parentBeaconBlockRoot:p,stateRoot:h,receiptsRoot:x,timestamp:w,transactions:A}=this;return{_type:"Block",baseFeePerGas:j(t),difficulty:j(e),extraData:r,gasLimit:j(n),gasUsed:j(a),blobGasUsed:j(this.blobGasUsed),excessBlobGas:j(this.excessBlobGas),hash:o,miner:i,prevRandao:c,nonce:l,number:u,parentHash:d,timestamp:w,parentBeaconBlockRoot:p,stateRoot:h,receiptsRoot:x,transactions:A}}[Symbol.iterator](){let t=0,e=this.transactions;return{next:()=>t<this.length?{value:e[t++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#t.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let e;if(typeof t=="number")e=this.#t[t];else{let r=t.toLowerCase();for(let n of this.#t)if(typeof n=="string"){if(n!==r)continue;e=n;break}else{if(n.hash===r)continue;e=n;break}}if(e==null)throw new Error("no such tx");return typeof e=="string"?await this.provider.getTransaction(e):e}getPrefetchedTransaction(t){let e=this.prefetchedTransactions;if(typeof t=="number")return e[t];t=t.toLowerCase();for(let r of e)if(r.hash===t)return r;f(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return ho(this)}},Ht=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(t,e){this.provider=e;let r=Object.freeze(t.topics.slice());C(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){let{address:t,blockHash:e,blockNumber:r,data:n,index:a,removed:o,topics:i,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:t,blockHash:e,blockNumber:r,data:n,index:a,removed:o,topics:i,transactionHash:c,transactionIndex:l}}async getBlock(){let t=await this.provider.getBlock(this.blockHash);return y(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){let t=await this.provider.getTransaction(this.transactionHash);return y(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){let t=await this.provider.getTransactionReceipt(this.transactionHash);return y(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return mo(this)}},Or=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#t;constructor(t,e){this.#t=Object.freeze(t.logs.map(n=>new Ht(n,e)));let r=Qs;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),C(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return this.#t}toJSON(){let{to:t,from:e,contractAddress:r,hash:n,index:a,blockHash:o,blockNumber:i,logsBloom:c,logs:l,status:u,root:d}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:i,contractAddress:r,cumulativeGasUsed:j(this.cumulativeGasUsed),from:e,gasPrice:j(this.gasPrice),blobGasUsed:j(this.blobGasUsed),blobGasPrice:j(this.blobGasPrice),gasUsed:j(this.gasUsed),hash:n,index:a,logs:l,logsBloom:c,root:d,status:u,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){let t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return ea(this)}reorderedEvent(t){return y(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),ta(this,t)}},Zt=class{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#t;constructor(t,e){this.provider=e,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.#t=-1}toJSON(){let{blockNumber:t,blockHash:e,index:r,hash:n,type:a,to:o,from:i,nonce:c,data:l,signature:u,accessList:d,blobVersionedHashes:p}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:t,blockHash:e,blobVersionedHashes:p,chainId:j(this.chainId),data:l,from:i,gasLimit:j(this.gasLimit),gasPrice:j(this.gasPrice),hash:n,maxFeePerGas:j(this.maxFeePerGas),maxPriorityFeePerGas:j(this.maxPriorityFeePerGas),maxFeePerBlobGas:j(this.maxFeePerBlobGas),nonce:c,signature:u,to:o,index:r,type:a,value:j(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){let r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;let e=this.provider.getBlock(t);if(e==null)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:e,blockNumber:r}=await de({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:r-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,e){let r=t??1,n=e??0,a=this.#t,o=-1,i=a===-1,c=async()=>{if(i)return null;let{blockNumber:p,nonce:h}=await de({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){a=p;return}if(i)return null;let x=await this.getTransaction();if(!(x&&x.blockNumber!=null))for(o===-1&&(o=a-3,o<this.#t&&(o=this.#t));o<=p;){if(i)return null;let w=await this.provider.getBlock(o,!0);if(w==null)return;for(let A of w)if(A===this.hash)return;for(let A=0;A<w.length;A++){let k=await w.getTransaction(A);if(k.from===this.from&&k.nonce===this.nonce){if(i)return null;let N=await this.provider.getTransactionReceipt(k.hash);if(N==null||p-N.blockNumber+1<r)return;let L="replaced";k.data===this.data&&k.to===this.to&&k.value===this.value?L="repriced":k.data==="0x"&&k.from===k.to&&k.value===Qs&&(L="cancelled"),y(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:L==="replaced"||L==="cancelled",reason:L,replacement:k.replaceableTransaction(a),hash:k.hash,receipt:N})}}o++}},l=p=>{if(p==null||p.status!==0)return p;y(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return l(u);if(u){if(await u.confirmations()>=r)return l(u)}else if(await c(),r===0)return null;return await new Promise((p,h)=>{let x=[],w=()=>{x.forEach(k=>k())};if(x.push(()=>{i=!0}),n>0){let k=setTimeout(()=>{w(),h(Et("wait for transaction timeout","TIMEOUT"))},n);x.push(()=>{clearTimeout(k)})}let A=async k=>{if(await k.confirmations()>=r){w();try{p(l(k))}catch(N){h(N)}}};if(x.push(()=>{this.provider.off(this.hash,A)}),this.provider.on(this.hash,A),a>=0){let k=async()=>{try{await c()}catch(N){if(gt(N,"TRANSACTION_REPLACED")){w(),h(N);return}}i||this.provider.once("block",k)};x.push(()=>{this.provider.off("block",k)}),this.provider.once("block",k)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return y(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ea(this)}reorderedEvent(t){return y(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),y(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ta(this,t)}replaceableTransaction(t){f(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);let e=new Zt(this,this.provider);return e.#t=t,e}};function ho(s){return{orphan:"drop-block",hash:s.hash,number:s.number}}function ta(s,t){return{orphan:"reorder-transaction",tx:s,other:t}}function ea(s){return{orphan:"drop-transaction",tx:s}}function mo(s){return{orphan:"drop-log",log:{transactionHash:s.transactionHash,blockHash:s.blockHash,blockNumber:s.blockNumber,address:s.address,data:s.data,topics:Object.freeze(s.topics.slice()),index:s.index}}}var Yt=class extends Ht{interface;fragment;args;constructor(t,e,r){super(t,t.provider);let n=e.decodeEventLog(r,t.data,t.topics);C(this,{args:n,fragment:r,interface:e})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},we=class extends Ht{error;constructor(t,e){super(t,t.provider),C(this,{error:e})}},Nr=class extends Or{#t;constructor(t,e,r){super(r,e),this.#t=t}get logs(){return super.logs.map(t=>{let e=t.topics.length?this.#t.getEvent(t.topics[0]):null;if(e)try{return new Yt(t,this.#t,e)}catch(r){return new we(t,r)}return t})}},Qt=class extends Zt{#t;constructor(t,e,r){super(r,e),this.#t=t}async wait(t,e){let r=await super.wait(t,e);return r==null?null:new Nr(this.#t,this.provider,r)}},Te=class extends Le{log;constructor(t,e,r,n){super(t,e,r),C(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},ze=class extends Te{constructor(t,e,r,n,a){super(t,e,r,new Yt(a,t.interface,n));let o=t.interface.decodeEventLog(n,this.log.data,this.log.topics);C(this,{args:o,fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};var ra=BigInt(0);function sa(s){return s&&typeof s.call=="function"}function aa(s){return s&&typeof s.estimateGas=="function"}function Fr(s){return s&&typeof s.resolveName=="function"}function oa(s){return s&&typeof s.sendTransaction=="function"}function ia(s){if(s!=null){if(Fr(s))return s;if(s.provider)return s.provider}}var pn=class{#t;fragment;constructor(t,e,r){if(C(this,{fragment:e}),e.inputs.length<r.length)throw new Error("too many arguments");let n=te(t.runner,"resolveName"),a=Fr(n)?n:null;this.#t=async function(){let o=await Promise.all(e.inputs.map((i,c)=>r[c]==null?null:i.walkAsync(r[c],(u,d)=>u==="address"?Array.isArray(d)?Promise.all(d.map(p=>zt(p,a))):zt(d,a):d)));return t.interface.encodeFilterTopics(e,o)}()}getTopicFilter(){return this.#t}};function te(s,t){return s==null?null:typeof s[t]=="function"?s:s.provider&&typeof s.provider[t]=="function"?s.provider:null}function qt(s){return s==null?null:s.provider||null}async function ca(s,t){let e=O.dereference(s,"overrides");f(typeof e=="object","invalid overrides parameter","overrides",s);let r=qs(e);return f(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),f(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function go(s,t,e){let r=te(s,"resolveName"),n=Fr(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(e[o],(i,c)=>(c=O.dereference(c,i),i==="address"?zt(c,n):c))))}function yo(s){let t=async function(o){let i=await ca(o,["data"]);i.to=await s.getAddress(),i.from&&(i.from=await zt(i.from,ia(s.runner)));let c=s.interface,l=T(i.value||ra,"overrides.value")===ra,u=(i.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!u&&!l&&f(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),f(c.fallback||u,"cannot send data to receive-only contract","overrides.data",i.data);let d=c.receive||c.fallback&&c.fallback.payable;return f(d||l,"cannot send value to non-payable fallback","overrides.value",i.value),f(c.fallback||u,"cannot send data to receive-only contract","overrides.data",i.data),i},e=async function(o){let i=te(s.runner,"call");y(sa(i),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await t(o);try{return await i.call(c)}catch(l){throw cr(l)&&l.data?s.interface.makeError(l.data,c):l}},r=async function(o){let i=s.runner;y(oa(i),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await i.sendTransaction(await t(o)),l=qt(s.runner);return new Qt(s.interface,l,c)},n=async function(o){let i=te(s.runner,"estimateGas");return y(aa(i),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await i.estimateGas(await t(o))},a=async o=>await r(o);return C(a,{_contract:s,estimateGas:n,populateTransaction:t,send:r,staticCall:e}),a}function bo(s,t){let e=function(...l){let u=s.interface.getFunction(t,l);return y(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:l}}),u},r=async function(...l){let u=e(...l),d={};if(u.inputs.length+1===l.length&&(d=await ca(l.pop()),d.from&&(d.from=await zt(d.from,ia(s.runner)))),u.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let p=await go(s.runner,u.inputs,l);return Object.assign({},d,await de({to:s.getAddress(),data:s.interface.encodeFunctionData(u,p)}))},n=async function(...l){let u=await i(...l);return u.length===1?u[0]:u},a=async function(...l){let u=s.runner;y(oa(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let d=await u.sendTransaction(await r(...l)),p=qt(s.runner);return new Qt(s.interface,p,d)},o=async function(...l){let u=te(s.runner,"estimateGas");return y(aa(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...l))},i=async function(...l){let u=te(s.runner,"call");y(sa(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let d;try{d=await r(...l)}catch(x){let w=l.at(-1).blockTag;throw w&&(x.blockNumber=w),x}let p="0x";try{p=await u.call(d)}catch(x){throw cr(x)&&x.data?s.interface.makeError(x.data,d):x}let h=e(...l);return s.interface.decodeFunctionResult(h,p)},c=async(...l)=>e(...l).constant?await n(...l):await a(...l);return C(c,{name:s.interface.getFunctionName(t),_contract:s,_key:t,getFragment:e,estimateGas:o,populateTransaction:r,send:a,staticCall:n,staticCallResult:i}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let l=s.interface.getFunction(t);return y(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),l}}),c}function xo(s,t){let e=function(...n){let a=s.interface.getEvent(t,n);return y(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:n}}),a},r=function(...n){return new pn(s,e(...n),n)};return C(r,{name:s.interface.getEventName(t),_contract:s,_key:t,getFragment:e}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{let n=s.interface.getEvent(t);return y(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),n}}),r}var Sr=Symbol.for("_ethersInternal_contract"),la=new WeakMap;function Co(s,t){la.set(s[Sr],t)}function it(s){return la.get(s[Sr])}function wo(s){return s&&typeof s=="object"&&"getTopicFilter"in s&&typeof s.getTopicFilter=="function"&&s.fragment}async function mn(s,t){let e,r=null;if(Array.isArray(t)){let a=function(o){if(U(o,32))return o;let i=s.interface.getEvent(o);return f(i,"unknown fragment","name",o),i.topicHash};e=t.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else t==="*"?e=[null]:typeof t=="string"?U(t,32)?e=[t]:(r=s.interface.getEvent(t),f(r,"unknown fragment","event",t),e=[r.topicHash]):wo(t)?e=await t.getTopicFilter():"fragment"in t?(r=t.fragment,e=[r.topicHash]):f(!1,"unknown event name","event",t);e=e.map(a=>{if(a==null)return null;if(Array.isArray(a)){let o=Array.from(new Set(a.map(i=>i.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});let n=e.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:n,topics:e}}async function Je(s,t){let{subs:e}=it(s);return e.get((await mn(s,t)).tag)||null}async function na(s,t,e){let r=qt(s.runner);y(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});let{fragment:n,tag:a,topics:o}=await mn(s,e),{addr:i,subs:c}=it(s),l=c.get(a);if(!l){let d={address:i||s,topics:o},p=A=>{let k=n;if(k==null)try{k=s.interface.getEvent(A.topics[0])}catch{}if(k){let N=k,L=n?s.interface.decodeEventLog(n,A.data,A.topics):[];hn(s,e,L,le=>new ze(s,le,e,N,A))}else hn(s,e,[],N=>new Te(s,N,e,A))},h=[];l={tag:a,listeners:[],start:()=>{h.length||h.push(r.on(d,p))},stop:async()=>{if(h.length==0)return;let A=h;h=[],await Promise.all(A),r.off(d,p)}},c.set(a,l)}return l}var fn=Promise.resolve();async function To(s,t,e,r){await fn;let n=await Je(s,t);if(!n)return!1;let a=n.listeners.length;return n.listeners=n.listeners.filter(({listener:o,once:i})=>{let c=Array.from(e);r&&c.push(r(i?null:o));try{o.call(s,...c)}catch{}return!i}),n.listeners.length===0&&(n.stop(),it(s).subs.delete(n.tag)),a>0}async function hn(s,t,e,r){try{await fn}catch{}let n=To(s,t,e,r);return fn=n,await n}var Br=["then"],ft=class{target;interface;runner;filters;[Sr];fallback;constructor(t,e,r,n){f(typeof t=="string"||xr(t),"invalid value for Contract target","target",t),r==null&&(r=null);let a=b.from(e);C(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,Sr,{value:{}});let o,i=null,c=null;if(n){let d=qt(r);c=new Qt(this.interface,d,n)}let l=new Map;if(typeof t=="string")if(U(t))i=t,o=Promise.resolve(t);else{let d=te(r,"resolveName");if(!Fr(d))throw Et("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=d.resolveName(t).then(p=>{if(p==null)throw Et("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return it(this).addr=p,p})}else o=t.getAddress().then(d=>{if(d==null)throw new Error("TODO");return it(this).addr=d,d});Co(this,{addrPromise:o,addr:i,deployTx:c,subs:l});let u=new Proxy({},{get:(d,p,h)=>{if(typeof p=="symbol"||Br.indexOf(p)>=0)return Reflect.get(d,p,h);try{return this.getEvent(p)}catch(x){if(!gt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,p)=>Br.indexOf(p)>=0?Reflect.has(d,p):Reflect.has(d,p)||this.interface.hasEvent(String(p))});return C(this,{filters:u}),C(this,{fallback:a.receive||a.fallback?yo(this):null}),new Proxy(this,{get:(d,p,h)=>{if(typeof p=="symbol"||p in d||Br.indexOf(p)>=0)return Reflect.get(d,p,h);try{return d.getFunction(p)}catch(x){if(!gt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,p)=>typeof p=="symbol"||p in d||Br.indexOf(p)>=0?Reflect.has(d,p):d.interface.hasFunction(p)})}connect(t){return new ft(this.target,this.interface,t)}attach(t){return new ft(t,this.interface,this.runner)}async getAddress(){return await it(this).addrPromise}async getDeployedCode(){let t=qt(this.runner);y(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let e=await t.getCode(await this.getAddress());return e==="0x"?null:e}async waitForDeployment(){let t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;let r=qt(this.runner);return y(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((n,a)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return n(this);r.once("block",o)}catch(i){a(i)}};o()})}deploymentTransaction(){return it(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),bo(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),xo(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e,r){e==null&&(e=0),r==null&&(r="latest");let{addr:n,addrPromise:a}=it(this),o=n||await a,{fragment:i,topics:c}=await mn(this,t),l={address:o,topics:c,fromBlock:e,toBlock:r},u=qt(this.runner);return y(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(l)).map(d=>{let p=i;if(p==null)try{p=this.interface.getEvent(d.topics[0])}catch{}if(p)try{return new Yt(d,this.interface,p)}catch(h){return new we(d,h)}return new Ht(d,u)})}async on(t,e){let r=await na(this,"on",t);return r.listeners.push({listener:e,once:!1}),r.start(),this}async once(t,e){let r=await na(this,"once",t);return r.listeners.push({listener:e,once:!0}),r.start(),this}async emit(t,...e){return await hn(this,t,e,null)}async listenerCount(t){if(t){let n=await Je(this,t);return n?n.listeners.length:0}let{subs:e}=it(this),r=0;for(let{listeners:n}of e.values())r+=n.length;return r}async listeners(t){if(t){let n=await Je(this,t);return n?n.listeners.map(({listener:a})=>a):[]}let{subs:e}=it(this),r=[];for(let{listeners:n}of e.values())r=r.concat(n.map(({listener:a})=>a));return r}async off(t,e){let r=await Je(this,t);if(!r)return this;if(e){let n=r.listeners.map(({listener:a})=>a).indexOf(e);n>=0&&r.listeners.splice(n,1)}return(e==null||r.listeners.length===0)&&(r.stop(),it(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){let e=await Je(this,t);if(!e)return this;e.stop(),it(this).subs.delete(e.tag)}else{let{subs:e}=it(this);for(let{tag:r,stop:n}of e.values())n(),e.delete(r)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){class e extends ft{constructor(n,a=null){super(n,t,a)}}return e}static from(t,e,r){return r==null&&(r=null),new this(t,e,r)}};function Eo(){return ft}var K=class extends Eo(){};var ua=BigInt(0);function E(s,t){return function(e){return e==null?t:s(e)}}function Ee(s,t){return e=>{if(t&&e==null)return null;if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>s(r))}}function ee(s,t){return e=>{let r={};for(let n in s){let a=n;if(t&&n in t&&!(a in e)){for(let o of t[n])if(o in e){a=o;break}}try{let o=s[n](e[a]);o!==void 0&&(r[n]=o)}catch(o){let i=o instanceof Error?o.message:"not-an-error";y(!1,`invalid value for value.${n} (${i})`,"BAD_DATA",{value:e})}}return r}}function ko(s){switch(s){case!0:case"true":return!0;case!1:case"false":return!1}f(!1,`invalid boolean; ${JSON.stringify(s)}`,"value",s)}function Vt(s){return f(U(s,!0),"invalid data","value",s),s}function G(s){return f(U(s,32),"invalid hash","value",s),s}var vo=ee({address:S,blockHash:G,blockNumber:I,data:Vt,index:I,removed:E(ko,!1),topics:Ee(G),transactionHash:G,transactionIndex:I},{index:["logIndex"]});function da(s){return vo(s)}var Po=ee({hash:E(G),parentHash:G,parentBeaconBlockRoot:E(G,null),number:I,timestamp:I,nonce:E(Vt),difficulty:T,gasLimit:T,gasUsed:T,stateRoot:E(G,null),receiptsRoot:E(G,null),blobGasUsed:E(T,null),excessBlobGas:E(T,null),miner:E(S),prevRandao:E(G,null),extraData:Vt,baseFeePerGas:E(T)},{prevRandao:["mixHash"]});function pa(s){let t=Po(s);return t.transactions=s.transactions.map(e=>typeof e=="string"?e:yn(e)),t}var Io=ee({transactionIndex:I,blockNumber:I,transactionHash:G,address:S,topics:Ee(G),data:Vt,index:I,blockHash:G},{index:["logIndex"]});function gn(s){return Io(s)}var ou=ee({to:E(S,null),from:E(S,null),contractAddress:E(S,null),index:I,root:E(P),gasUsed:T,blobGasUsed:E(T,null),logsBloom:E(Vt),blockHash:G,hash:G,logs:Ee(gn),blockNumber:I,cumulativeGasUsed:T,effectiveGasPrice:E(T),blobGasPrice:E(T,null),status:E(I),type:E(I,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function yn(s){s.to&&T(s.to)===ua&&(s.to="0x0000000000000000000000000000000000000000");let t=ee({hash:G,index:E(I,void 0),type:e=>e==="0x"||e==null?0:I(e),accessList:E(Me,null),blobVersionedHashes:E(Ee(G,!0),null),blockHash:E(G,null),blockNumber:E(I,null),transactionIndex:E(I,null),from:S,gasPrice:E(T),maxPriorityFeePerGas:E(T),maxFeePerGas:E(T),maxFeePerBlobGas:E(T,null),gasLimit:T,to:E(S,null),value:T,nonce:I,data:Vt,creates:E(S,null),chainId:E(T,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(s);if(t.to==null&&t.creates==null&&(t.creates=sn(t)),(s.type===1||s.type===2)&&s.accessList==null&&(t.accessList=[]),s.signature?t.signature=J.from(s.signature):t.signature=J.from(s),t.chainId==null){let e=t.signature.legacyChainId;e!=null&&(t.chainId=e)}return t.blockHash&&T(t.blockHash)===ua&&(t.blockHash=null),t}var Ut=class extends Un{chainId;address;log;block;trace;blockNumber;transactionHash;transaction;transactionReceipt;timestamp;preparedData;constructor(t,e,r,n,a,o,i,c,l,u){super(l),this.chainId=t,this.log=a,this.block=n,this.trace=o,this.address=e.toLowerCase(),this.transaction=i,this.transactionReceipt=c,this.timestamp=r||new Date(0),this.preparedData=u,a?(this.blockNumber=a.blockNumber,this.transactionHash=a.transactionHash):n?this.blockNumber=n.number:o&&(this.blockNumber=o.blockNumber,this.transactionHash=o.transactionHash)}getChainId(){return this.chainId}getMetaDataInternal(t,e){if(this.log)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:this.log.transactionIndex,transactionHash:this.transactionHash||"",logIndex:this.log.index,chainId:this.chainId,name:t,labels:Oe(e)};if(this.trace)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:this.trace.transactionPosition,transactionHash:this.transactionHash||"",logIndex:-1,chainId:this.chainId.toString(),name:t,labels:Oe(e)};if(this.transaction)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:this.transaction.index||0,transactionHash:this.transaction.hash||"",logIndex:-1,chainId:this.chainId.toString(),name:t,labels:Oe(e)};if(this.block)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:-1,transactionHash:"",logIndex:-1,chainId:this.chainId.toString(),name:t,labels:Oe(e)};throw new Error("Invaid ctx argument can't happen")}},ke=class extends Ut{getContractName(){return"account"}},xt=class extends Ut{constructor(t,e,r,n,a,o,i,c,l,u){super(t,e,r,n,a,o,i,c,l,u)}getContractName(){return"*"}getMetaDataInternal(t,e){let r=this.address;this.address="*";let n=super.getMetaDataInternal(t,e);return this.address=r,n}},Ct=class extends Ut{contract;contractName;constructor(t,e,r,n,a,o,i,c,l,u,d){super(r,e.address,n,a,o,i,c,l,u,d),e.context=this,e.callStatic&&(e.callStatic.context=this),e.encodeCall&&(e.encodeCall.context=this),this.contractName=t,this.contract=e}getContractName(){return this.contractName}},It=class{contract;constructor(t){this.contract=t}get rawContract(){return this.contract}get provider(){if(this.contract.runner?.provider)return this.contract.runner.provider;throw Error("Can't find provider for contract"+this.contract.toString())}},At=class{view;address;context;callStatic;encodeCall;constructor(t,e){this.address=t,this.view=e}get rawContract(){return this.view.rawContract}get provider(){return this.view.provider}get filters(){return this.view.rawContract.filters}};process.stdout.write("");var D=Tt(Wr(),1);var Ke=class extends Error{e;constructor(t,e,r){super(t),this.stack=r}toString(){return this.message+`
2
+ import{a as Ta}from"./chunk-2GOCSOX5.js";import{a as Ne}from"./chunk-7H2MCYRO.js";import{A as $r,Cb as ue,D as nt,Fb as $t,Mc as Wr,W as jr,fa as Vn,gd as Un,ld as ir,oa as st,uc as Oe}from"./chunk-GC37QHIM.js";import{d as Hn,e as Tt,g as H}from"./chunk-LLHU72AA.js";var Jo={};Hn(Jo,{ERC721BoundContractView:()=>or,ERC721ContractView:()=>Gr,ERC721Processor:()=>wt,ERC721ProcessorTemplate:()=>Dn,ERC721__factory:()=>mt,getERC721Contract:()=>ce,getERC721ContractOnContext:()=>$o,mockApprovalForAllLog:()=>Wo,mockApprovalLog:()=>jo,mockTransferLog:()=>zo});var Mn="6.13.1";function Ea(s,t,e){let r=t.split("|").map(a=>a.trim());for(let a=0;a<r.length;a++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof s===t)return}let n=new Error(`invalid value for type ${t}`);throw n.code="INVALID_ARGUMENT",n.argument=`value.${e}`,n.value=s,n}async function de(s){let t=Object.keys(s);return(await Promise.all(t.map(r=>Promise.resolve(s[r])))).reduce((r,n,a)=>(r[t[a]]=n,r),{})}function C(s,t,e){for(let r in t){let n=t[r],a=e?e[r]:null;a&&Ea(n,a,r),Object.defineProperty(s,r,{enumerable:!0,value:n,writable:!1})}}function pe(s){if(s==null)return"null";if(Array.isArray(s))return"[ "+s.map(pe).join(", ")+" ]";if(s instanceof Uint8Array){let t="0123456789abcdef",e="0x";for(let r=0;r<s.length;r++)e+=t[s[r]>>4],e+=t[s[r]&15];return e}if(typeof s=="object"&&typeof s.toJSON=="function")return pe(s.toJSON());switch(typeof s){case"boolean":case"symbol":return s.toString();case"bigint":return BigInt(s).toString();case"number":return s.toString();case"string":return JSON.stringify(s);case"object":{let t=Object.keys(s);return t.sort(),"{ "+t.map(e=>`${pe(e)}: ${pe(s[e])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function gt(s,t){return s&&s.code===t}function cr(s){return gt(s,"CALL_EXCEPTION")}function Et(s,t,e){let r=s;{let a=[];if(e){if("message"in e||"code"in e||"name"in e)throw new Error(`value will overwrite populated values: ${pe(e)}`);for(let o in e){if(o==="shortMessage")continue;let i=e[o];a.push(o+"="+pe(i))}}a.push(`code=${t}`),a.push(`version=${Mn}`),a.length&&(s+=" ("+a.join(", ")+")")}let n;switch(t){case"INVALID_ARGUMENT":n=new TypeError(s);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":n=new RangeError(s);break;default:n=new Error(s)}return C(n,{code:t}),e&&Object.assign(n,e),n.shortMessage==null&&C(n,{shortMessage:r}),n}function y(s,t,e,r){if(!s)throw Et(t,e,r)}function f(s,t,e,r){y(s,t,"INVALID_ARGUMENT",{argument:e,value:r})}function Be(s,t,e){e==null&&(e=""),e&&(e=": "+e),y(s>=t,"missing arguemnt"+e,"MISSING_ARGUMENT",{count:s,expectedCount:t}),y(s<=t,"too many arguments"+e,"UNEXPECTED_ARGUMENT",{count:s,expectedCount:t})}var ka=["NFD","NFC","NFKD","NFKC"].reduce((s,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"){let e=String.fromCharCode(233).normalize("NFD"),r=String.fromCharCode(101,769);if(e!==r)throw new Error("broken")}s.push(t)}catch{}return s},[]);function zr(s){y(ka.indexOf(s)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:s}})}function Ft(s,t,e){if(e==null&&(e=""),s!==t){let r=e,n="new";e&&(r+=".",n+=" "+e),y(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:n})}}function $n(s,t,e){if(s instanceof Uint8Array)return e?new Uint8Array(s):s;if(typeof s=="string"&&s.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let r=new Uint8Array((s.length-2)/2),n=2;for(let a=0;a<r.length;a++)r[a]=parseInt(s.substring(n,n+2),16),n+=2;return r}f(!1,"invalid BytesLike value",t||"value",s)}function _(s,t){return $n(s,t,!1)}function Z(s,t){return $n(s,t,!0)}function U(s,t){return!(typeof s!="string"||!s.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&s.length!==2+2*t||t===!0&&s.length%2!==0)}function Jr(s){return U(s,!0)||s instanceof Uint8Array}var Gn="0123456789abcdef";function P(s){let t=_(s),e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=Gn[(n&240)>>4]+Gn[n&15]}return e}function at(s){return"0x"+s.map(t=>P(t).substring(2)).join("")}function lr(s){return U(s,!0)?(s.length-2)/2:_(s).length}function yt(s,t,e){let r=_(s);return e!=null&&e>r.length&&y(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:e}),P(r.slice(t??0,e??r.length))}function jn(s,t,e){let r=_(s);y(t>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:t,offset:t+1});let n=new Uint8Array(t);return n.fill(0),e?n.set(r,t-r.length):n.set(r,0),P(n)}function fe(s,t){return jn(s,t,!0)}function ur(s,t){return jn(s,t,!1)}var dr=BigInt(0),lt=BigInt(1),he=9007199254740991;function Kr(s,t){let e=Se(s,"value"),r=BigInt(I(t,"width"));if(y(e>>r===dr,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:s}),e>>r-lt){let n=(lt<<r)-lt;return-((~e&n)+lt)}return e}function Xr(s,t){let e=T(s,"value"),r=BigInt(I(t,"width")),n=lt<<r-lt;if(e<dr){e=-e,y(e<=n,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});let a=(lt<<r)-lt;return(~e&a)+lt}else y(e<n,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});return e}function me(s,t){let e=Se(s,"value"),r=BigInt(I(t,"bits"));return e&(lt<<r)-lt}function T(s,t){switch(typeof s){case"bigint":return s;case"number":return f(Number.isInteger(s),"underflow",t||"value",s),f(s>=-he&&s<=he,"overflow",t||"value",s),BigInt(s);case"string":try{if(s==="")throw new Error("empty string");return s[0]==="-"&&s[1]!=="-"?-BigInt(s.substring(1)):BigInt(s)}catch(e){f(!1,`invalid BigNumberish string: ${e.message}`,t||"value",s)}}f(!1,"invalid BigNumberish value",t||"value",s)}function Se(s,t){let e=T(s,t);return y(e>=dr,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:s}),e}var Wn="0123456789abcdef";function pr(s){if(s instanceof Uint8Array){let t="0x0";for(let e of s)t+=Wn[e>>4],t+=Wn[e&15];return BigInt(t)}return T(s)}function I(s,t){switch(typeof s){case"bigint":return f(s>=-he&&s<=he,"overflow",t||"value",s),Number(s);case"number":return f(Number.isInteger(s),"underflow",t||"value",s),f(s>=-he&&s<=he,"overflow",t||"value",s),s;case"string":try{if(s==="")throw new Error("empty string");return I(BigInt(s),t)}catch(e){f(!1,`invalid numeric string: ${e.message}`,t||"value",s)}}f(!1,"invalid numeric value",t||"value",s)}function Zr(s){return I(pr(s))}function Fe(s,t){let r=Se(s,"value").toString(16);if(t==null)r.length%2&&(r="0"+r);else{let n=I(t,"width");for(y(n*2>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:s});r.length<n*2;)r="0"+r}return"0x"+r}function De(s){let t=Se(s,"value");if(t===dr)return new Uint8Array([]);let e=t.toString(16);e.length%2&&(e="0"+e);let r=new Uint8Array(e.length/2);for(let n=0;n<r.length;n++){let a=n*2;r[n]=parseInt(e.substring(a,a+2),16)}return r}var Le=class{filter;emitter;#t;constructor(t,e,r){this.#t=e,C(this,{emitter:t,filter:r})}async removeListener(){this.#t!=null&&await this.emitter.off(this.filter,this.#t)}};function va(s,t,e,r,n){f(!1,`invalid codepoint at offset ${t}; ${s}`,"bytes",e)}function zn(s,t,e,r,n){if(s==="BAD_PREFIX"||s==="UNEXPECTED_CONTINUE"){let a=0;for(let o=t+1;o<e.length&&e[o]>>6===2;o++)a++;return a}return s==="OVERRUN"?e.length-t-1:0}function Pa(s,t,e,r,n){return s==="OVERLONG"?(f(typeof n=="number","invalid bad code point for replacement","badCodepoint",n),r.push(n),0):(r.push(65533),zn(s,t,e,r,n))}var Jn=Object.freeze({error:va,ignore:zn,replace:Pa});function Ia(s,t){t==null&&(t=Jn.error);let e=_(s,"bytes"),r=[],n=0;for(;n<e.length;){let a=e[n++];if(!(a>>7)){r.push(a);continue}let o=null,i=null;if((a&224)===192)o=1,i=127;else if((a&240)===224)o=2,i=2047;else if((a&248)===240)o=3,i=65535;else{(a&192)===128?n+=t("UNEXPECTED_CONTINUE",n-1,e,r):n+=t("BAD_PREFIX",n-1,e,r);continue}if(n-1+o>=e.length){n+=t("OVERRUN",n-1,e,r);continue}let c=a&(1<<8-o-1)-1;for(let l=0;l<o;l++){let u=e[n];if((u&192)!=128){n+=t("MISSING_CONTINUE",n,e,r),c=null;break}c=c<<6|u&63,n++}if(c!==null){if(c>1114111){n+=t("OUT_OF_RANGE",n-1-o,e,r,c);continue}if(c>=55296&&c<=57343){n+=t("UTF16_SURROGATE",n-1-o,e,r,c);continue}if(c<=i){n+=t("OVERLONG",n-1-o,e,r,c);continue}r.push(c)}}return r}function ge(s,t){f(typeof s=="string","invalid string value","str",s),t!=null&&(zr(t),s=s.normalize(t));let e=[];for(let r=0;r<s.length;r++){let n=s.charCodeAt(r);if(n<128)e.push(n);else if(n<2048)e.push(n>>6|192),e.push(n&63|128);else if((n&64512)==55296){r++;let a=s.charCodeAt(r);f(r<s.length&&(a&64512)===56320,"invalid surrogate pair","str",s);let o=65536+((n&1023)<<10)+(a&1023);e.push(o>>18|240),e.push(o>>12&63|128),e.push(o>>6&63|128),e.push(o&63|128)}else e.push(n>>12|224),e.push(n>>6&63|128),e.push(n&63|128)}return new Uint8Array(e)}function Aa(s){return s.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function _e(s,t){return Aa(Ia(s,t))}function Kn(s){let t=[];for(;s;)t.unshift(s&255),s>>=8;return t}function Zn(s){if(Array.isArray(s)){let r=[];if(s.forEach(function(a){r=r.concat(Zn(a))}),r.length<=55)return r.unshift(192+r.length),r;let n=Kn(r.length);return n.unshift(247+n.length),n.concat(r)}let t=Array.prototype.slice.call(_(s,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;let e=Kn(t.length);return e.unshift(183+e.length),e.concat(t)}var Xn="0123456789abcdef";function Yr(s){let t="0x";for(let e of Zn(s))t+=Xn[e>>4],t+=Xn[e&15];return t}var W=32,Qr=new Uint8Array(W),Ra=["then"],fr={},qn=new WeakMap;function jt(s){return qn.get(s)}function Yn(s,t){qn.set(s,t)}function He(s,t){let e=new Error(`deferred error during ABI decoding triggered accessing ${s}`);throw e.error=t,e}function qr(s,t,e){return s.indexOf(null)>=0?t.map((r,n)=>r instanceof z?qr(jt(r),r,e):r):s.reduce((r,n,a)=>{let o=t.getValue(n);return n in r||(e&&o instanceof z&&(o=qr(jt(o),o,e)),r[n]=o),r},{})}var z=class extends Array{#t;constructor(...t){let e=t[0],r=t[1],n=(t[2]||[]).slice(),a=!0;e!==fr&&(r=t,n=[],a=!1),super(r.length),r.forEach((c,l)=>{this[l]=c});let o=n.reduce((c,l)=>(typeof l=="string"&&c.set(l,(c.get(l)||0)+1),c),new Map);if(Yn(this,Object.freeze(r.map((c,l)=>{let u=n[l];return u!=null&&o.get(u)===1?u:null}))),this.#t=[],this.#t==null&&this.#t,!a)return;Object.freeze(this);let i=new Proxy(this,{get:(c,l,u)=>{if(typeof l=="string"){if(l.match(/^[0-9]+$/)){let p=I(l,"%index");if(p<0||p>=this.length)throw new RangeError("out of result range");let h=c[p];return h instanceof Error&&He(`index ${p}`,h),h}if(Ra.indexOf(l)>=0)return Reflect.get(c,l,u);let d=c[l];if(d instanceof Function)return function(...p){return d.apply(this===u?c:this,p)};if(!(l in c))return c.getValue.apply(this===u?c:this,[l])}return Reflect.get(c,l,u)}});return Yn(i,jt(this)),i}toArray(t){let e=[];return this.forEach((r,n)=>{r instanceof Error&&He(`index ${n}`,r),t&&r instanceof z&&(r=r.toArray(t)),e.push(r)}),e}toObject(t){let e=jt(this);return e.reduce((r,n,a)=>(y(n!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),qr(e,this,t)),{})}slice(t,e){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),e==null&&(e=this.length),e<0&&(e+=this.length,e<0&&(e=0)),e>this.length&&(e=this.length);let r=jt(this),n=[],a=[];for(let o=t;o<e;o++)n.push(this[o]),a.push(r[o]);return new z(fr,n,a)}filter(t,e){let r=jt(this),n=[],a=[];for(let o=0;o<this.length;o++){let i=this[o];i instanceof Error&&He(`index ${o}`,i),t.call(e,i,o,this)&&(n.push(i),a.push(r[o]))}return new z(fr,n,a)}map(t,e){let r=[];for(let n=0;n<this.length;n++){let a=this[n];a instanceof Error&&He(`index ${n}`,a),r.push(t.call(e,a,n,this))}return r}getValue(t){let e=jt(this).indexOf(t);if(e===-1)return;let r=this[e];return r instanceof Error&&He(`property ${JSON.stringify(t)}`,r.error),r}static fromItems(t,e){return new z(fr,t,e)}};function Qn(s){let t=De(s);return y(t.length<=W,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:W,offset:t.length}),t.length!==W&&(t=Z(at([Qr.slice(t.length%W),t]))),t}var M=class{name;type;localName;dynamic;constructor(t,e,r,n){C(this,{name:t,type:e,localName:r,dynamic:n},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){f(!1,t,this.localName,e)}},Wt=class{#t;#e;constructor(){this.#t=[],this.#e=0}get data(){return at(this.#t)}get length(){return this.#e}#r(t){return this.#t.push(t),this.#e+=t.length,t.length}appendWriter(t){return this.#r(Z(t.data))}writeBytes(t){let e=Z(t),r=e.length%W;return r&&(e=Z(at([e,Qr.slice(r)]))),this.#r(e)}writeValue(t){return this.#r(Qn(t))}writeUpdatableValue(){let t=this.#t.length;return this.#t.push(Qr),this.#e+=W,e=>{this.#t[t]=Qn(e)}}},ye=class{allowLoose;#t;#e;#r;#n;#s;constructor(t,e,r){C(this,{allowLoose:!!e}),this.#t=Z(t),this.#r=0,this.#n=null,this.#s=r??1024,this.#e=0}get data(){return P(this.#t)}get dataLength(){return this.#t.length}get consumed(){return this.#e}get bytes(){return new Uint8Array(this.#t)}#a(t){if(this.#n)return this.#n.#a(t);this.#r+=t,y(this.#s<1||this.#r<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Z(this.#t),offset:this.#e,length:t,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#o(t,e,r){let n=Math.ceil(e/W)*W;return this.#e+n>this.#t.length&&(this.allowLoose&&r&&this.#e+e<=this.#t.length?n=e:y(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Z(this.#t),length:this.#t.length,offset:this.#e+n})),this.#t.slice(this.#e,this.#e+n)}subReader(t){let e=new ye(this.#t.slice(this.#e+t),this.allowLoose,this.#s);return e.#n=this,e}readBytes(t,e){let r=this.#o(0,t,!!e);return this.#a(t),this.#e+=r.length,r.slice(0,t)}readValue(){return pr(this.readBytes(W))}readIndex(){return Zr(this.readBytes(W))}};function tn(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}function en(s,...t){if(!(s instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(s.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${s.length}`)}function rn(s,t=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(t&&s.finished)throw new Error("Hash#digest() has already been called")}function ts(s,t){en(s);let e=t.outputLen;if(s.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var hr=BigInt(4294967295),es=BigInt(32);function Oa(s,t=!1){return t?{h:Number(s&hr),l:Number(s>>es&hr)}:{h:Number(s>>es&hr)|0,l:Number(s&hr)|0}}function rs(s,t=!1){let e=new Uint32Array(s.length),r=new Uint32Array(s.length);for(let n=0;n<s.length;n++){let{h:a,l:o}=Oa(s[n],t);[e[n],r[n]]=[a,o]}return[e,r]}var ns=(s,t,e)=>s<<e|t>>>32-e,ss=(s,t,e)=>t<<e|s>>>32-e,as=(s,t,e)=>t<<e-32|s>>>64-e,os=(s,t,e)=>s<<e-32|t>>>64-e;var Na=s=>s instanceof Uint8Array;var is=s=>new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4));var Ba=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ba)throw new Error("Non little-endian hardware is not supported");function Sa(s){if(typeof s!="string")throw new Error(`utf8ToBytes expected string, got ${typeof s}`);return new Uint8Array(new TextEncoder().encode(s))}function gr(s){if(typeof s=="string"&&(s=Sa(s)),!Na(s))throw new Error(`expected Uint8Array, got ${typeof s}`);return s}var mr=class{clone(){return this._cloneInto()}},vi={}.toString;function cs(s){let t=r=>s().update(gr(r)).digest(),e=s();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>s(),t}function ls(s){let t=(r,n)=>s(n).update(gr(r)).digest(),e=s({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=r=>s(r),t}var[ps,fs,hs]=[[],[],[]],Fa=BigInt(0),Ve=BigInt(1),Da=BigInt(2),La=BigInt(7),_a=BigInt(256),Ha=BigInt(113);for(let s=0,t=Ve,e=1,r=0;s<24;s++){[e,r]=[r,(2*e+3*r)%5],ps.push(2*(5*r+e)),fs.push((s+1)*(s+2)/2%64);let n=Fa;for(let a=0;a<7;a++)t=(t<<Ve^(t>>La)*Ha)%_a,t&Da&&(n^=Ve<<(Ve<<BigInt(a))-Ve);hs.push(n)}var[Va,Ua]=rs(hs,!0),us=(s,t,e)=>e>32?as(s,t,e):ns(s,t,e),ds=(s,t,e)=>e>32?os(s,t,e):ss(s,t,e);function Ma(s,t=24){let e=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)e[o]=s[o]^s[o+10]^s[o+20]^s[o+30]^s[o+40];for(let o=0;o<10;o+=2){let i=(o+8)%10,c=(o+2)%10,l=e[c],u=e[c+1],d=us(l,u,1)^e[i],p=ds(l,u,1)^e[i+1];for(let h=0;h<50;h+=10)s[o+h]^=d,s[o+h+1]^=p}let n=s[2],a=s[3];for(let o=0;o<24;o++){let i=fs[o],c=us(n,a,i),l=ds(n,a,i),u=ps[o];n=s[u],a=s[u+1],s[u]=c,s[u+1]=l}for(let o=0;o<50;o+=10){for(let i=0;i<10;i++)e[i]=s[o+i];for(let i=0;i<10;i++)s[o+i]^=~e[(i+2)%10]&e[(i+4)%10]}s[0]^=Va[r],s[1]^=Ua[r]}e.fill(0)}var be=class extends mr{constructor(t,e,r,n=!1,a=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,tn(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=is(this.state)}keccak(){Ma(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){rn(this);let{blockLen:e,state:r}=this;t=gr(t);let n=t.length;for(let a=0;a<n;){let o=Math.min(e-this.pos,n-a);for(let i=0;i<o;i++)r[this.pos++]^=t[a++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,e&128&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){rn(this,!1),en(t),this.finish();let e=this.state,{blockLen:r}=this;for(let n=0,a=t.length;n<a;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,a-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return tn(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ts(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:r,outputLen:n,rounds:a,enableXOF:o}=this;return t||(t=new be(e,r,n,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}},Dt=(s,t,e)=>cs(()=>new be(t,s,e)),Oi=Dt(6,144,224/8),Ni=Dt(6,136,256/8),Bi=Dt(6,104,384/8),Si=Dt(6,72,512/8),Fi=Dt(1,144,224/8),ms=Dt(1,136,256/8),Di=Dt(1,104,384/8),Li=Dt(1,72,512/8),gs=(s,t,e)=>ls((r={})=>new be(t,s,r.dkLen===void 0?e:r.dkLen,!0)),_i=gs(31,168,128/8),Hi=gs(31,136,256/8);var ys=!1,bs=function(s){return ms(s)},xs=bs;function Q(s){let t=_(s,"data");return P(xs(t))}Q._=bs;Q.lock=function(){ys=!0};Q.register=function(s){if(ys)throw new TypeError("keccak256 is locked");xs=s};Object.freeze(Q);var yr="0x0000000000000000000000000000000000000000000000000000000000000000";var Cs=BigInt(0),ws=BigInt(1),Ts=BigInt(2),Es=BigInt(27),ks=BigInt(28),br=BigInt(35),xe={};function vs(s){return fe(De(s),32)}var J=class{#t;#e;#r;#n;get r(){return this.#t}set r(t){f(lr(t)===32,"invalid r","value",t),this.#t=P(t)}get s(){return this.#e}set s(t){f(lr(t)===32,"invalid s","value",t);let e=P(t);f(parseInt(e.substring(0,3))<8,"non-canonical s","value",e),this.#e=e}get v(){return this.#r}set v(t){let e=I(t,"value");f(e===27||e===28,"invalid v","v",t),this.#r=e}get networkV(){return this.#n}get legacyChainId(){let t=this.networkV;return t==null?null:J.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){let t=_(this.s);return this.yParity&&(t[0]|=128),P(t)}get compactSerialized(){return at([this.r,this.yParityAndS])}get serialized(){return at([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(t,e,r,n){Ft(t,xe,"Signature"),this.#t=e,this.#e=r,this.#r=n,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let t=new J(xe,this.r,this.s,this.v);return this.networkV&&(t.#n=this.networkV),t}toJSON(){let t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(t){let e=T(t,"v");return e==Es||e==ks?Cs:(f(e>=br,"invalid EIP-155 v","v",t),(e-br)/Ts)}static getChainIdV(t,e){return T(t)*Ts+BigInt(35+e-27)}static getNormalizedV(t){let e=T(t);return e===Cs||e===Es?27:e===ws||e===ks?28:(f(e>=br,"invalid v","v",t),e&ws?27:28)}static from(t){function e(l,u){f(l,u,"signature",t)}if(t==null)return new J(xe,yr,yr,27);if(typeof t=="string"){let l=_(t,"signature");if(l.length===64){let u=P(l.slice(0,32)),d=l.slice(32,64),p=d[0]&128?28:27;return d[0]&=127,new J(xe,u,P(d),p)}if(l.length===65){let u=P(l.slice(0,32)),d=l.slice(32,64);e((d[0]&128)===0,"non-canonical s");let p=J.getNormalizedV(l[64]);return new J(xe,u,P(d),p)}e(!1,"invalid raw signature length")}if(t instanceof J)return t.clone();let r=t.r;e(r!=null,"missing r");let n=vs(r),a=function(l,u){if(l!=null)return vs(l);if(u!=null){e(U(u,32),"invalid yParityAndS");let d=_(u);return d[0]&=127,P(d)}e(!1,"missing s")}(t.s,t.yParityAndS);e((_(a)[0]&128)==0,"non-canonical s");let{networkV:o,v:i}=function(l,u,d){if(l!=null){let p=T(l);return{networkV:p>=br?p:void 0,v:J.getNormalizedV(p)}}if(u!=null)return e(U(u,32),"invalid yParityAndS"),{v:_(u)[0]&128?28:27};if(d!=null){switch(I(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}e(!1,"invalid yParity")}e(!1,"missing v")}(t.v,t.yParityAndS,t.yParity),c=new J(xe,n,a,i);return o&&(c.#n=o),e(t.yParity==null||I(t.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),e(t.yParityAndS==null||t.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};var Ga=BigInt(0),$a=BigInt(36);function Ps(s){s=s.toLowerCase();let t=s.substring(2).split(""),e=new Uint8Array(40);for(let n=0;n<40;n++)e[n]=t[n].charCodeAt(0);let r=_(Q(e));for(let n=0;n<40;n+=2)r[n>>1]>>4>=8&&(t[n]=t[n].toUpperCase()),(r[n>>1]&15)>=8&&(t[n+1]=t[n+1].toUpperCase());return"0x"+t.join("")}var nn={};for(let s=0;s<10;s++)nn[String(s)]=String(s);for(let s=0;s<26;s++)nn[String.fromCharCode(65+s)]=String(10+s);var Is=15;function ja(s){s=s.toUpperCase(),s=s.substring(4)+s.substring(0,2)+"00";let t=s.split("").map(r=>nn[r]).join("");for(;t.length>=Is;){let r=t.substring(0,Is);t=parseInt(r,10)%97+t.substring(r.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}var Wa=function(){let s={};for(let t=0;t<36;t++){let e="0123456789abcdefghijklmnopqrstuvwxyz"[t];s[e]=BigInt(t)}return s}();function za(s){s=s.toLowerCase();let t=Ga;for(let e=0;e<s.length;e++)t=t*$a+Wa[s[e]];return t}function S(s){if(f(typeof s=="string","invalid address","address",s),s.match(/^(0x)?[0-9a-fA-F]{40}$/)){s.startsWith("0x")||(s="0x"+s);let t=Ps(s);return f(!s.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===s,"bad address checksum","address",s),t}if(s.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){f(s.substring(2,4)===ja(s),"bad icap checksum","address",s);let t=za(s.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return Ps("0x"+t)}f(!1,"invalid address","address",s)}function sn(s){let t=S(s.from),r=T(s.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,S(yt(Q(Yr([t,r])),12))}function xr(s){return s&&typeof s.getAddress=="function"}async function an(s,t){let e=await t;return(e==null||e==="0x0000000000000000000000000000000000000000")&&(y(typeof s!="string","unconfigured name","UNCONFIGURED_NAME",{value:s}),f(!1,"invalid AddressLike value; did not resolve to a value address","target",s)),S(e)}function zt(s,t){if(typeof s=="string")return s.match(/^0x[0-9a-f]{40}$/i)?S(s):(y(t!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),an(s,t.resolveName(s)));if(xr(s))return an(s,s.getAddress());if(s&&typeof s.then=="function")return an(s,s);f(!1,"unsupported addressable value","target",s)}var ut={};function m(s,t){let e=!1;return t<0&&(e=!0,t*=-1),new O(ut,`${e?"":"u"}int${t}`,s,{signed:e,width:t})}function B(s,t){return new O(ut,`bytes${t||""}`,s,{size:t})}var As=Symbol.for("_ethers_typed"),O=class{type;value;#t;_typedSymbol;constructor(t,e,r,n){n==null&&(n=null),Ft(ut,t,"Typed"),C(this,{_typedSymbol:As,type:e,value:r}),this.#t=n,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#t}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#t===!0?-1:this.#t===!1?this.value.length:null}static from(t,e){return new O(ut,t,e)}static uint8(t){return m(t,8)}static uint16(t){return m(t,16)}static uint24(t){return m(t,24)}static uint32(t){return m(t,32)}static uint40(t){return m(t,40)}static uint48(t){return m(t,48)}static uint56(t){return m(t,56)}static uint64(t){return m(t,64)}static uint72(t){return m(t,72)}static uint80(t){return m(t,80)}static uint88(t){return m(t,88)}static uint96(t){return m(t,96)}static uint104(t){return m(t,104)}static uint112(t){return m(t,112)}static uint120(t){return m(t,120)}static uint128(t){return m(t,128)}static uint136(t){return m(t,136)}static uint144(t){return m(t,144)}static uint152(t){return m(t,152)}static uint160(t){return m(t,160)}static uint168(t){return m(t,168)}static uint176(t){return m(t,176)}static uint184(t){return m(t,184)}static uint192(t){return m(t,192)}static uint200(t){return m(t,200)}static uint208(t){return m(t,208)}static uint216(t){return m(t,216)}static uint224(t){return m(t,224)}static uint232(t){return m(t,232)}static uint240(t){return m(t,240)}static uint248(t){return m(t,248)}static uint256(t){return m(t,256)}static uint(t){return m(t,256)}static int8(t){return m(t,-8)}static int16(t){return m(t,-16)}static int24(t){return m(t,-24)}static int32(t){return m(t,-32)}static int40(t){return m(t,-40)}static int48(t){return m(t,-48)}static int56(t){return m(t,-56)}static int64(t){return m(t,-64)}static int72(t){return m(t,-72)}static int80(t){return m(t,-80)}static int88(t){return m(t,-88)}static int96(t){return m(t,-96)}static int104(t){return m(t,-104)}static int112(t){return m(t,-112)}static int120(t){return m(t,-120)}static int128(t){return m(t,-128)}static int136(t){return m(t,-136)}static int144(t){return m(t,-144)}static int152(t){return m(t,-152)}static int160(t){return m(t,-160)}static int168(t){return m(t,-168)}static int176(t){return m(t,-176)}static int184(t){return m(t,-184)}static int192(t){return m(t,-192)}static int200(t){return m(t,-200)}static int208(t){return m(t,-208)}static int216(t){return m(t,-216)}static int224(t){return m(t,-224)}static int232(t){return m(t,-232)}static int240(t){return m(t,-240)}static int248(t){return m(t,-248)}static int256(t){return m(t,-256)}static int(t){return m(t,-256)}static bytes1(t){return B(t,1)}static bytes2(t){return B(t,2)}static bytes3(t){return B(t,3)}static bytes4(t){return B(t,4)}static bytes5(t){return B(t,5)}static bytes6(t){return B(t,6)}static bytes7(t){return B(t,7)}static bytes8(t){return B(t,8)}static bytes9(t){return B(t,9)}static bytes10(t){return B(t,10)}static bytes11(t){return B(t,11)}static bytes12(t){return B(t,12)}static bytes13(t){return B(t,13)}static bytes14(t){return B(t,14)}static bytes15(t){return B(t,15)}static bytes16(t){return B(t,16)}static bytes17(t){return B(t,17)}static bytes18(t){return B(t,18)}static bytes19(t){return B(t,19)}static bytes20(t){return B(t,20)}static bytes21(t){return B(t,21)}static bytes22(t){return B(t,22)}static bytes23(t){return B(t,23)}static bytes24(t){return B(t,24)}static bytes25(t){return B(t,25)}static bytes26(t){return B(t,26)}static bytes27(t){return B(t,27)}static bytes28(t){return B(t,28)}static bytes29(t){return B(t,29)}static bytes30(t){return B(t,30)}static bytes31(t){return B(t,31)}static bytes32(t){return B(t,32)}static address(t){return new O(ut,"address",t)}static bool(t){return new O(ut,"bool",!!t)}static bytes(t){return new O(ut,"bytes",t)}static string(t){return new O(ut,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new O(ut,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===As}static dereference(t,e){if(O.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}};var Cr=class extends M{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let r=O.dereference(e,"string");try{r=S(r)}catch(n){return this._throwError(n.message,e)}return t.writeValue(r)}decode(t){return S(Fe(t.readValue(),20))}};var wr=class extends M{coder;constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}};function on(s,t,e){let r=[];if(Array.isArray(e))r=e;else if(e&&typeof e=="object"){let c={};r=t.map(l=>{let u=l.localName;return y(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),y(!c[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),c[u]=!0,e[u]})}else f(!1,"invalid tuple value","tuple",e);f(t.length===r.length,"types/value length mismatch","tuple",e);let n=new Wt,a=new Wt,o=[];t.forEach((c,l)=>{let u=r[l];if(c.dynamic){let d=a.length;c.encode(a,u);let p=n.writeUpdatableValue();o.push(h=>{p(h+d)})}else c.encode(n,u)}),o.forEach(c=>{c(n.length)});let i=s.appendWriter(n);return i+=s.appendWriter(a),i}function cn(s,t){let e=[],r=[],n=s.subReader(0);return t.forEach(a=>{let o=null;if(a.dynamic){let i=s.readIndex(),c=n.subReader(i);try{o=a.decode(c)}catch(l){if(gt(l,"BUFFER_OVERRUN"))throw l;o=l,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(s)}catch(i){if(gt(i,"BUFFER_OVERRUN"))throw i;o=i,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");e.push(o),r.push(a.localName||null)}),z.fromItems(e,r)}var Tr=class extends M{coder;length;constructor(t,e,r){let n=t.type+"["+(e>=0?e:"")+"]",a=e===-1||t.dynamic;super("array",n,r,a),C(this,{coder:t,length:e})}defaultValue(){let t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){let r=O.dereference(e,"array");Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,t.writeValue(r.length)),Be(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<r.length;o++)a.push(this.coder);return on(t,a,r)}decode(t){let e=this.length;e===-1&&(e=t.readIndex(),y(e*W<=t.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:t.bytes,offset:e*W,length:t.dataLength}));let r=[];for(let n=0;n<e;n++)r.push(new wr(this.coder));return cn(t,r)}};var Er=class extends M{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){let r=O.dereference(e,"bool");return t.writeValue(r?1:0)}decode(t){return!!t.readValue()}};var Ue=class extends M{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=Z(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readIndex(),!0)}},kr=class extends Ue{constructor(t){super("bytes",t)}decode(t){return P(super.decode(t))}};var vr=class extends M{size;constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),C(this,{size:t},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,e){let r=Z(O.dereference(e,this.type));return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return P(t.readBytes(this.size))}};var Ja=new Uint8Array([]),Pr=class extends M{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes(Ja)}decode(t){return t.readBytes(0),null}};var Ka=BigInt(0),Xa=BigInt(1),Za=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Ir=class extends M{size;signed;constructor(t,e,r){let n=(e?"int":"uint")+t*8;super(n,n,r,!1),C(this,{size:t,signed:e},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(t,e){let r=T(O.dereference(e,this.type)),n=me(Za,W*8);if(this.signed){let a=me(n,this.size*8-1);(r>a||r<-(a+Xa))&&this._throwError("value out-of-bounds",e),r=Xr(r,8*W)}else(r<Ka||r>me(n,this.size*8))&&this._throwError("value out-of-bounds",e);return t.writeValue(r)}decode(t){let e=me(t.readValue(),this.size*8);return this.signed&&(e=Kr(e,this.size*8)),e}};var Ar=class extends Ue{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,ge(O.dereference(e,"string")))}decode(t){return _e(super.decode(t))}};var Jt=class extends M{coders;constructor(t,e){let r=!1,n=[];t.forEach(o=>{o.dynamic&&(r=!0),n.push(o.type)});let a="tuple("+n.join(",")+")";super("tuple",a,e,r),C(this,{coders:Object.freeze(t.slice())})}defaultValue(){let t=[];this.coders.forEach(r=>{t.push(r.defaultValue())});let e=this.coders.reduce((r,n)=>{let a=n.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,n)=>{let a=r.localName;!a||e[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[n]))}),Object.freeze(t)}encode(t,e){let r=O.dereference(e,"tuple");return on(t,this.coders,r)}decode(t){return cn(t,this.coders)}};function Lt(s){return Q(ge(s))}function ln(s,t){return{address:S(s),storageKeys:t.map((e,r)=>(f(U(e,32),"invalid slot",`storageKeys[${r}]`,e),e.toLowerCase()))}}function Me(s){if(Array.isArray(s))return s.map((e,r)=>Array.isArray(e)?(f(e.length===2,"invalid slot set",`value[${r}]`,e),ln(e[0],e[1])):(f(e!=null&&typeof e=="object","invalid address-slot set","value",s),ln(e.address,e.storageKeys)));f(s!=null&&typeof s=="object","invalid access list","value",s);let t=Object.keys(s).map(e=>{let r=s[e].reduce((n,a)=>(n[a]=!0,n),{});return ln(e,Object.keys(r).sort())});return t.sort((e,r)=>e.address.localeCompare(r.address)),t}function Y(s){let t=new Set;return s.forEach(e=>t.add(e)),Object.freeze(t)}var Ya="external public payable override",Qa=Y(Ya.split(" ")),Hs="constant external internal payable private public pure view override",qa=Y(Hs.split(" ")),Vs="constructor error event fallback function receive struct",Us=Y(Vs.split(" ")),Ms="calldata memory storage payable indexed",to=Y(Ms.split(" ")),eo="tuple returns",ro=[Vs,Ms,eo,Hs].join(" "),no=Y(ro.split(" ")),so={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},ao=new RegExp("^(\\s*)"),oo=new RegExp("^([0-9]+)"),io=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),Gs=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),$s=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),et=class{#t;#e;get offset(){return this.#t}get length(){return this.#e.length-this.#t}constructor(t){this.#t=0,this.#e=t.slice()}clone(){return new et(this.#e)}reset(){this.#t=0}#r(t=0,e=0){return new et(this.#e.slice(t,e).map(r=>Object.freeze(Object.assign({},r,{match:r.match-t,linkBack:r.linkBack-t,linkNext:r.linkNext-t}))))}popKeyword(t){let e=this.peek();if(e.type!=="KEYWORD"||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){let e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){let t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");let e=this.#r(this.#t+1,t.match+1);return this.#t=t.match+1,e}popParams(){let t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");let e=[];for(;this.#t<t.match-1;){let r=this.peek().linkNext;e.push(this.#r(this.#t+1,r)),this.#t=r}return this.#t=t.match+1,e}peek(){if(this.#t>=this.#e.length)throw new Error("out-of-bounds");return this.#e[this.#t]}peekKeyword(t){let e=this.peekType("KEYWORD");return e!=null&&t.has(e)?e:null}peekType(t){if(this.length===0)return null;let e=this.peek();return e.type===t?e.text:null}pop(){let t=this.peek();return this.#t++,t}toString(){let t=[];for(let e=this.#t;e<this.#e.length;e++){let r=this.#e[e];t.push(`${r.type}:${r.text}`)}return`<TokenString ${t.join(" ")}>`}};function _t(s){let t=[],e=o=>{let i=a<s.length?JSON.stringify(s[a]):"$EOI";throw new Error(`invalid token ${i} at ${a}: ${o}`)},r=[],n=[],a=0;for(;a<s.length;){let o=s.substring(a),i=o.match(ao);i&&(a+=i[1].length,o=s.substring(a));let c={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(c);let l=so[o[0]]||"";if(l){if(c.type=l,c.text=o[0],a++,l==="OPEN_PAREN")r.push(t.length-1),n.push(t.length-1);else if(l=="CLOSE_PAREN")r.length===0&&e("no matching open bracket"),c.match=r.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=n.pop(),t[c.linkBack].linkNext=t.length-1;else if(l==="COMMA")c.linkBack=n.pop(),t[c.linkBack].linkNext=t.length-1,n.push(t.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let u=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){let d=t.pop().text;u=d+u,t[t.length-1].value=I(d)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=u}continue}if(i=o.match(io),i){if(c.text=i[1],a+=c.text.length,no.has(c.text)){c.type="KEYWORD";continue}if(c.text.match($s)){c.type="TYPE";continue}c.type="ID";continue}if(i=o.match(oo),i){c.text=i[1],c.type="NUMBER",a+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new et(t.map(o=>Object.freeze(o)))}function Rs(s,t){let e=[];for(let r in t.keys())s.has(r)&&e.push(r);if(e.length>1)throw new Error(`conflicting types: ${e.join(", ")}`)}function Rr(s,t){if(t.peekKeyword(Us)){let e=t.pop().text;if(e!==s)throw new Error(`expected ${s}, got ${e}`)}return t.popType("ID")}function vt(s,t){let e=new Set;for(;;){let r=s.peekType("KEYWORD");if(r==null||t&&!t.has(r))break;if(s.pop(),e.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);e.add(r)}return Object.freeze(e)}function js(s){let t=vt(s,qa);return Rs(t,Y("constant payable nonpayable".split(" "))),Rs(t,Y("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function kt(s,t){return s.popParams().map(e=>F.from(e,t))}function Ws(s){if(s.peekType("AT")){if(s.pop(),s.peekType("NUMBER"))return T(s.pop().text);throw new Error("invalid gas")}return null}function Kt(s){if(s.length)throw new Error(`unexpected tokens at offset ${s.offset}: ${s.toString()}`)}var co=new RegExp(/^(.*)\[([0-9]*)\]$/);function Os(s){let t=s.match($s);if(f(t,"invalid type","type",s),s==="uint")return"uint256";if(s==="int")return"int256";if(t[2]){let e=parseInt(t[2]);f(e!==0&&e<=32,"invalid bytes length","type",s)}else if(t[3]){let e=parseInt(t[3]);f(e!==0&&e<=256&&e%8===0,"invalid numeric width","type",s)}return s}var V={},rt=Symbol.for("_ethers_internal"),Ns="_ParamTypeInternal",Bs="_ErrorInternal",Ss="_EventInternal",Fs="_ConstructorInternal",Ds="_FallbackInternal",Ls="_FunctionInternal",_s="_StructInternal",F=class{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(t,e,r,n,a,o,i,c){if(Ft(t,V,"ParamType"),Object.defineProperty(this,rt,{value:Ns}),o&&(o=Object.freeze(o.slice())),n==="array"){if(i==null||c==null)throw new Error("")}else if(i!=null||c!=null)throw new Error("");if(n==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");C(this,{name:e,type:r,baseType:n,indexed:a,components:o,arrayLength:i,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="json"){let r=this.name||"";if(this.isArray()){let a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}let n={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map(r=>r.format(t)).join(t==="full"?", ":",")+")":e+=this.type,t!=="sighash"&&(this.indexed===!0&&(e+=" indexed"),t==="full"&&this.name&&(e+=" "+this.name)),e}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let r=this;return t.map(n=>r.arrayChildren.walk(n,e))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");let r=this;return t.map((n,a)=>r.components[a].walk(n,e))}return e(this.type,t)}#t(t,e,r,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,i=e.slice();i.forEach((c,l)=>{o.#t(t,c,r,u=>{i[l]=u})}),n(i);return}if(this.isTuple()){let o=this.components,i;if(Array.isArray(e))i=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");i=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in e))throw new Error(`missing value for component ${c.name}`);return e[c.name]})}if(i.length!==this.components.length)throw new Error("array is wrong length");i.forEach((c,l)=>{o[l].#t(t,c,r,u=>{i[l]=u})}),n(i);return}let a=r(this.type,e);a.then?t.push(async function(){n(await a)}()):n(a)}async walkAsync(t,e){let r=[],n=[t];return this.#t(r,t,e,a=>{n[0]=a}),r.length&&await Promise.all(r),n[0]}static from(t,e){if(F.isParamType(t))return t;if(typeof t=="string")try{return F.from(_t(t),e)}catch{f(!1,"invalid param type","obj",t)}else if(t instanceof et){let i="",c="",l=null;vt(t,Y(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",l=t.popParams().map(w=>F.from(w)),i=`tuple(${l.map(w=>w.format()).join(",")})`):(i=Os(t.popType("TYPE")),c=i);let u=null,d=null;for(;t.length&&t.peekType("BRACKET");){let w=t.pop();u=new F(V,"",i,c,null,l,d,u),d=w.value,i+=w.text,c="array",l=null}let p=null;if(vt(t,to).has("indexed")){if(!e)throw new Error("");p=!0}let x=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new F(V,x,i,c,p,l,d,u)}let r=t.name;f(!r||typeof r=="string"&&r.match(Gs),"invalid name","obj.name",r);let n=t.indexed;n==!0?(f(e,"parameter cannot be indexed","obj.indexed",t.indexed),n=!0):n=!1;let a=t.type,o=a.match(co);if(o){let i=parseInt(o[2]||"-1"),c=F.from({type:o[1],components:t.components});return new F(V,r||"",a,"array",n,null,i,c)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){let i=t.components!=null?t.components.map(l=>F.from(l)):null;return new F(V,r||"",a,"tuple",n,i,null,null)}return a=Os(t.type),new F(V,r||"",a,a,n,null,null,null)}static isParamType(t){return t&&t[rt]===Ns}},dt=class{type;inputs;constructor(t,e,r){Ft(t,V,"Fragment"),r=Object.freeze(r.slice()),C(this,{type:e,inputs:r})}static from(t){if(typeof t=="string"){try{dt.from(JSON.parse(t))}catch{}return dt.from(_t(t))}if(t instanceof et)switch(t.peekKeyword(Us)){case"constructor":return ot.from(t);case"error":return $.from(t);case"event":return q.from(t);case"fallback":case"receive":return ct.from(t);case"function":return tt.from(t);case"struct":return bt.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return ot.from(t);case"error":return $.from(t);case"event":return q.from(t);case"fallback":case"receive":return ct.from(t);case"function":return tt.from(t);case"struct":return bt.from(t)}y(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}f(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return ot.isFragment(t)}static isError(t){return $.isFragment(t)}static isEvent(t){return q.isFragment(t)}static isFunction(t){return tt.isFragment(t)}static isStruct(t){return bt.isFragment(t)}},Xt=class extends dt{name;constructor(t,e,r,n){super(t,e,n),f(typeof r=="string"&&r.match(Gs),"invalid identifier","name",r),n=Object.freeze(n.slice()),C(this,{name:r})}};function Ge(s,t){return"("+t.map(e=>e.format(s)).join(s==="full"?", ":",")+")"}var $=class extends Xt{constructor(t,e,r){super(t,"error",e,r),Object.defineProperty(this,rt,{value:Bs})}get selector(){return Lt(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let e=[];return t!=="sighash"&&e.push("error"),e.push(this.name+Ge(t,this.inputs)),e.join(" ")}static from(t){if($.isFragment(t))return t;if(typeof t=="string")return $.from(_t(t));if(t instanceof et){let e=Rr("error",t),r=kt(t);return Kt(t),new $(V,e,r)}return new $(V,t.name,t.inputs?t.inputs.map(F.from):[])}static isFragment(t){return t&&t[rt]===Bs}},q=class extends Xt{anonymous;constructor(t,e,r,n){super(t,"event",e,r),Object.defineProperty(this,rt,{value:Ss}),C(this,{anonymous:n})}get topicHash(){return Lt(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let e=[];return t!=="sighash"&&e.push("event"),e.push(this.name+Ge(t,this.inputs)),t!=="sighash"&&this.anonymous&&e.push("anonymous"),e.join(" ")}static getTopicHash(t,e){return e=(e||[]).map(n=>F.from(n)),new q(V,t,e,!1).topicHash}static from(t){if(q.isFragment(t))return t;if(typeof t=="string")try{return q.from(_t(t))}catch{f(!1,"invalid event fragment","obj",t)}else if(t instanceof et){let e=Rr("event",t),r=kt(t,!0),n=!!vt(t,Y(["anonymous"])).has("anonymous");return Kt(t),new q(V,e,r,n)}return new q(V,t.name,t.inputs?t.inputs.map(e=>F.from(e,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[rt]===Ss}},ot=class extends dt{payable;gas;constructor(t,e,r,n,a){super(t,e,r),Object.defineProperty(this,rt,{value:Fs}),C(this,{payable:n,gas:a})}format(t){if(y(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t)))});let e=[`constructor${Ge(t,this.inputs)}`];return this.payable&&e.push("payable"),this.gas!=null&&e.push(`@${this.gas.toString()}`),e.join(" ")}static from(t){if(ot.isFragment(t))return t;if(typeof t=="string")try{return ot.from(_t(t))}catch{f(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof et){vt(t,Y(["constructor"]));let e=kt(t),r=!!vt(t,Qa).has("payable"),n=Ws(t);return Kt(t),new ot(V,"constructor",e,r,n)}return new ot(V,"constructor",t.inputs?t.inputs.map(F.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[rt]===Fs}},ct=class extends dt{payable;constructor(t,e,r){super(t,"fallback",e),Object.defineProperty(this,rt,{value:Ds}),C(this,{payable:r})}format(t){let e=this.inputs.length===0?"receive":"fallback";if(t==="json"){let r=this.payable?"payable":"nonpayable";return JSON.stringify({type:e,stateMutability:r})}return`${e}()${this.payable?" payable":""}`}static from(t){if(ct.isFragment(t))return t;if(typeof t=="string")try{return ct.from(_t(t))}catch{f(!1,"invalid fallback fragment","obj",t)}else if(t instanceof et){let e=t.toString(),r=t.peekKeyword(Y(["fallback","receive"]));if(f(r,"type must be fallback or receive","obj",e),t.popKeyword(Y(["fallback","receive"]))==="receive"){let i=kt(t);return f(i.length===0,"receive cannot have arguments","obj.inputs",i),vt(t,Y(["payable"])),Kt(t),new ct(V,[],!0)}let a=kt(t);a.length?f(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(i=>i.format("minimal")).join(", ")):a=[F.from("bytes")];let o=js(t);if(f(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),vt(t,Y(["returns"])).has("returns")){let i=kt(t);f(i.length===1&&i[0].type==="bytes","invalid fallback outputs","obj.outputs",i.map(c=>c.format("minimal")).join(", "))}return Kt(t),new ct(V,a,o==="payable")}if(t.type==="receive")return new ct(V,[],!0);if(t.type==="fallback"){let e=[F.from("bytes")],r=t.stateMutability==="payable";return new ct(V,e,r)}f(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[rt]===Ds}},tt=class extends Xt{constant;outputs;stateMutability;payable;gas;constructor(t,e,r,n,a,o){super(t,"function",e,n),Object.defineProperty(this,rt,{value:Ls}),a=Object.freeze(a.slice()),C(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Lt(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(t))),outputs:this.outputs.map(r=>JSON.parse(r.format(t)))});let e=[];return t!=="sighash"&&e.push("function"),e.push(this.name+Ge(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(Ge(t,this.outputs))),this.gas!=null&&e.push(`@${this.gas.toString()}`)),e.join(" ")}static getSelector(t,e){return e=(e||[]).map(n=>F.from(n)),new tt(V,t,"view",e,[],null).selector}static from(t){if(tt.isFragment(t))return t;if(typeof t=="string")try{return tt.from(_t(t))}catch{f(!1,"invalid function fragment","obj",t)}else if(t instanceof et){let r=Rr("function",t),n=kt(t),a=js(t),o=[];vt(t,Y(["returns"])).has("returns")&&(o=kt(t));let i=Ws(t);return Kt(t),new tt(V,r,a,n,o,i)}let e=t.stateMutability;return e==null&&(e="payable",typeof t.constant=="boolean"?(e="view",t.constant||(e="payable",typeof t.payable=="boolean"&&!t.payable&&(e="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(e="nonpayable")),new tt(V,t.name,e,t.inputs?t.inputs.map(F.from):[],t.outputs?t.outputs.map(F.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[rt]===Ls}},bt=class extends Xt{constructor(t,e,r){super(t,"struct",e,r),Object.defineProperty(this,rt,{value:_s})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return bt.from(_t(t))}catch{f(!1,"invalid struct fragment","obj",t)}else if(t instanceof et){let e=Rr("struct",t),r=kt(t);return Kt(t),new bt(V,e,r)}return new bt(V,t.name,t.inputs?t.inputs.map(F.from):[])}static isFragment(t){return t&&t[rt]===_s}};var pt=new Map;pt.set(0,"GENERIC_PANIC");pt.set(1,"ASSERT_FALSE");pt.set(17,"OVERFLOW");pt.set(18,"DIVIDE_BY_ZERO");pt.set(33,"ENUM_RANGE_ERROR");pt.set(34,"BAD_STORAGE_DATA");pt.set(49,"STACK_UNDERFLOW");pt.set(50,"ARRAY_RANGE_ERROR");pt.set(65,"OUT_OF_MEMORY");pt.set(81,"UNINITIALIZED_FUNCTION_CALL");var lo=new RegExp(/^bytes([0-9]*)$/),uo=new RegExp(/^(u?int)([0-9]*)$/),un=null,zs=1024;function po(s,t,e,r){let n="missing revert data",a=null,o=null,i=null;if(e){n="execution reverted";let l=_(e);if(e=P(e),l.length===0)n+=" (no data present; likely require(false) occurred",a="require(false)";else if(l.length%32!==4)n+=" (could not decode reason; invalid data length)";else if(P(l.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],l.slice(4))[0],i={signature:"Error(string)",name:"Error",args:[a]},n+=`: ${JSON.stringify(a)}`}catch{n+=" (could not decode reason; invalid string data)"}else if(P(l.slice(0,4))==="0x4e487b71")try{let u=Number(r.decode(["uint256"],l.slice(4))[0]);i={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${pt.get(u)||"UNKNOWN"}(${u})`,n+=`: ${a}`}catch{n+=" (could not decode panic code)"}else n+=" (unknown custom error)"}let c={to:t.to?S(t.to):null,data:t.data||"0x"};return t.from&&(c.from=S(t.from)),Et(n,"CALL_EXCEPTION",{action:s,data:e,reason:a,transaction:c,invocation:o,revert:i})}var Pt=class{#t(t){if(t.isArray())return new Tr(this.#t(t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new Jt(t.components.map(r=>this.#t(r)),t.name);switch(t.baseType){case"address":return new Cr(t.name);case"bool":return new Er(t.name);case"string":return new Ar(t.name);case"bytes":return new kr(t.name);case"":return new Pr(t.name)}let e=t.type.match(uo);if(e){let r=parseInt(e[2]||"256");return f(r!==0&&r<=256&&r%8===0,"invalid "+e[1]+" bit length","param",t),new Ir(r/8,e[1]==="int",t.name)}if(e=t.type.match(lo),e){let r=parseInt(e[1]);return f(r!==0&&r<=32,"invalid bytes length","param",t),new vr(r,t.name)}f(!1,"invalid type","type",t.type)}getDefaultValue(t){let e=t.map(n=>this.#t(F.from(n)));return new Jt(e,"_").defaultValue()}encode(t,e){Be(e.length,t.length,"types/values length mismatch");let r=t.map(o=>this.#t(F.from(o))),n=new Jt(r,"_"),a=new Wt;return n.encode(a,e),a.data}decode(t,e,r){let n=t.map(o=>this.#t(F.from(o)));return new Jt(n,"_").decode(new ye(e,r,zs))}static _setDefaultMaxInflation(t){f(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),zs=t}static defaultAbiCoder(){return un==null&&(un=new Pt),un}static getBuiltinCallException(t,e,r){return po(t,e,r,Pt.defaultAbiCoder())}};function Js(s){let t=_(s,"bytes");if(t.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(t[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let e=31;for(;t[e-1]===0;)e--;return _e(t.slice(0,e))}var $e=class{fragment;name;signature;topic;args;constructor(t,e,r){let n=t.name,a=t.format();C(this,{fragment:t,name:n,signature:a,topic:e,args:r})}},je=class{fragment;name;args;signature;selector;value;constructor(t,e,r,n){let a=t.name,o=t.format();C(this,{fragment:t,name:a,args:r,signature:o,selector:e,value:n})}},We=class{fragment;name;args;signature;selector;constructor(t,e,r){let n=t.name,a=t.format();C(this,{fragment:t,name:n,args:r,signature:a,selector:e})}},Ce=class{hash;_isIndexed;static isIndexed(t){return!!(t&&t._isIndexed)}constructor(t){C(this,{hash:t,_isIndexed:!0})}},Ks={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Xs={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:s=>`reverted with reason string ${JSON.stringify(s)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:s=>{let t="unknown panic code";return s>=0&&s<=255&&Ks[s.toString()]&&(t=Ks[s.toString()]),`reverted with panic code 0x${s.toString(16)} (${t})`}}},b=class{fragments;deploy;fallback;receive;#t;#e;#r;#n;constructor(t){let e=[];typeof t=="string"?e=JSON.parse(t):e=t,this.#r=new Map,this.#t=new Map,this.#e=new Map;let r=[];for(let o of e)try{r.push(dt.from(o))}catch(i){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,i.message)}C(this,{fragments:Object.freeze(r)});let n=null,a=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((o,i)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}C(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(f(!n||o.payable!==n.payable,"conflicting fallback fragments",`fragments[${i}]`,o),n=o,a=n.payable);return;case"function":c=this.#r;break;case"event":c=this.#e;break;case"error":c=this.#t;break;default:return}let l=o.format();c.has(l)||c.set(l,o)}),this.deploy||C(this,{deploy:ot.from("constructor()")}),C(this,{fallback:n,receive:a})}format(t){let e=t?"minimal":"full";return this.fragments.map(n=>n.format(e))}formatJson(){let t=this.fragments.map(e=>e.format("json"));return JSON.stringify(t.map(e=>JSON.parse(e)))}getAbiCoder(){return Pt.defaultAbiCoder()}#s(t,e,r){if(U(t)){let a=t.toLowerCase();for(let o of this.#r.values())if(a===o.selector)return o;return null}if(t.indexOf("(")===-1){let a=[];for(let[o,i]of this.#r)o.split("(")[0]===t&&a.push(i);if(e){let o=e.length>0?e[e.length-1]:null,i=e.length,c=!0;O.isTyped(o)&&o.type==="overrides"&&(c=!1,i--);for(let l=a.length-1;l>=0;l--){let u=a[l].inputs.length;u!==i&&(!c||u!==i-1)&&a.splice(l,1)}for(let l=a.length-1;l>=0;l--){let u=a[l].inputs;for(let d=0;d<e.length;d++)if(O.isTyped(e[d])){if(d>=u.length){if(e[d].type==="overrides")continue;a.splice(l,1);break}if(e[d].type!==u[d].baseType){a.splice(l,1);break}}}}if(a.length===1&&e&&e.length!==a[0].inputs.length){let o=e[e.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){let o=a.map(i=>JSON.stringify(i.format())).join(", ");f(!1,`ambiguous function description (i.e. matches ${o})`,"key",t)}return a[0]}let n=this.#r.get(tt.from(t).format());return n||null}getFunctionName(t){let e=this.#s(t,null,!1);return f(e,"no matching function","key",t),e.name}hasFunction(t){return!!this.#s(t,null,!1)}getFunction(t,e){return this.#s(t,e||null,!0)}forEachFunction(t){let e=Array.from(this.#r.keys());e.sort((r,n)=>r.localeCompare(n));for(let r=0;r<e.length;r++){let n=e[r];t(this.#r.get(n),r)}}#a(t,e,r){if(U(t)){let a=t.toLowerCase();for(let o of this.#e.values())if(a===o.topicHash)return o;return null}if(t.indexOf("(")===-1){let a=[];for(let[o,i]of this.#e)o.split("(")[0]===t&&a.push(i);if(e){for(let o=a.length-1;o>=0;o--)a[o].inputs.length<e.length&&a.splice(o,1);for(let o=a.length-1;o>=0;o--){let i=a[o].inputs;for(let c=0;c<e.length;c++)if(O.isTyped(e[c])&&e[c].type!==i[c].baseType){a.splice(o,1);break}}}if(a.length===0)return null;if(a.length>1&&r){let o=a.map(i=>JSON.stringify(i.format())).join(", ");f(!1,`ambiguous event description (i.e. matches ${o})`,"key",t)}return a[0]}let n=this.#e.get(q.from(t).format());return n||null}getEventName(t){let e=this.#a(t,null,!1);return f(e,"no matching event","key",t),e.name}hasEvent(t){return!!this.#a(t,null,!1)}getEvent(t,e){return this.#a(t,e||null,!0)}forEachEvent(t){let e=Array.from(this.#e.keys());e.sort((r,n)=>r.localeCompare(n));for(let r=0;r<e.length;r++){let n=e[r];t(this.#e.get(n),r)}}getError(t,e){if(U(t)){let n=t.toLowerCase();if(Xs[n])return $.from(Xs[n].signature);for(let a of this.#t.values())if(n===a.selector)return a;return null}if(t.indexOf("(")===-1){let n=[];for(let[a,o]of this.#t)a.split("(")[0]===t&&n.push(o);if(n.length===0)return t==="Error"?$.from("error Error(string)"):t==="Panic"?$.from("error Panic(uint256)"):null;if(n.length>1){let a=n.map(o=>JSON.stringify(o.format())).join(", ");f(!1,`ambiguous error description (i.e. ${a})`,"name",t)}return n[0]}if(t=$.from(t).format(),t==="Error(string)")return $.from("error Error(string)");if(t==="Panic(uint256)")return $.from("error Panic(uint256)");let r=this.#t.get(t);return r||null}forEachError(t){let e=Array.from(this.#t.keys());e.sort((r,n)=>r.localeCompare(n));for(let r=0;r<e.length;r++){let n=e[r];t(this.#t.get(n),r)}}_decodeParams(t,e){return this.#n.decode(t,e)}_encodeParams(t,e){return this.#n.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if(typeof t=="string"){let r=this.getError(t);f(r,"unknown error","fragment",t),t=r}return f(yt(e,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,yt(e,4))}encodeErrorResult(t,e){if(typeof t=="string"){let r=this.getError(t);f(r,"unknown error","fragment",t),t=r}return at([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if(typeof t=="string"){let r=this.getFunction(t);f(r,"unknown function","fragment",t),t=r}return f(yt(e,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,yt(e,4))}encodeFunctionData(t,e){if(typeof t=="string"){let r=this.getFunction(t);f(r,"unknown function","fragment",t),t=r}return at([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if(typeof t=="string"){let a=this.getFunction(t);f(a,"unknown function","fragment",t),t=a}let r="invalid length for result data",n=Z(e);if(n.length%32===0)try{return this.#n.decode(t.outputs,n)}catch{r="could not decode result data"}y(!1,r,"BAD_DATA",{value:P(n),info:{method:t.name,signature:t.format()}})}makeError(t,e){let r=_(t,"data"),n=Pt.getBuiltinCallException("call",e,r),a="execution reverted (unknown custom error)";if(n.message.startsWith(a)){let i=P(r.slice(0,4)),c=this.getError(i);if(c)try{let l=this.#n.decode(c.inputs,r.slice(4));n.revert={name:c.name,signature:c.format(),args:l},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch{n.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(e);return o&&(n.invocation={method:o.name,signature:o.signature,args:o.args}),n}encodeFunctionResult(t,e){if(typeof t=="string"){let r=this.getFunction(t);f(r,"unknown function","fragment",t),t=r}return P(this.#n.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if(typeof t=="string"){let a=this.getEvent(t);f(a,"unknown event","eventFragment",t),t=a}y(e.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});let r=[];t.anonymous||r.push(t.topicHash);let n=(a,o)=>a.type==="string"?Lt(o):a.type==="bytes"?Q(P(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=Fe(o):a.type.match(/^bytes/)?o=ur(o,32):a.type==="address"&&this.#n.encode(["address"],[o]),fe(P(o),32));for(e.forEach((a,o)=>{let i=t.inputs[o];if(!i.indexed){f(a==null,"cannot filter non-indexed parameters; must be null","contract."+i.name,a);return}a==null?r.push(null):i.baseType==="array"||i.baseType==="tuple"?f(!1,"filtering with tuples or arrays not supported","contract."+i.name,a):Array.isArray(a)?r.push(a.map(c=>n(i,c))):r.push(n(i,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(t,e){if(typeof t=="string"){let o=this.getEvent(t);f(o,"unknown event","eventFragment",t),t=o}let r=[],n=[],a=[];return t.anonymous||r.push(t.topicHash),f(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach((o,i)=>{let c=e[i];if(o.indexed)if(o.type==="string")r.push(Lt(c));else if(o.type==="bytes")r.push(Q(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(this.#n.encode([o.type],[c]))}else n.push(o),a.push(c)}),{data:this.#n.encode(n,a),topics:r}}decodeEventLog(t,e,r){if(typeof t=="string"){let h=this.getEvent(t);f(h,"unknown event","eventFragment",t),t=h}if(r!=null&&!t.anonymous){let h=t.topicHash;f(U(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}let n=[],a=[],o=[];t.inputs.forEach((h,x)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(n.push(F.from({type:"bytes32",name:h.name})),o.push(!0)):(n.push(h),o.push(!1)):(a.push(h),o.push(!1))});let i=r!=null?this.#n.decode(n,at(r)):null,c=this.#n.decode(a,e,!0),l=[],u=[],d=0,p=0;return t.inputs.forEach((h,x)=>{let w=null;if(h.indexed)if(i==null)w=new Ce(null);else if(o[x])w=new Ce(i[p++]);else try{w=i[p++]}catch(A){w=A}else try{w=c[d++]}catch(A){w=A}l.push(w),u.push(h.name||null)}),z.fromItems(l,u)}parseTransaction(t){let e=_(t.data,"tx.data"),r=T(t.value!=null?t.value:0,"tx.value"),n=this.getFunction(P(e.slice(0,4)));if(!n)return null;let a=this.#n.decode(n.inputs,e.slice(4));return new je(n,n.selector,a,r)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new $e(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){let e=P(t),r=this.getError(yt(e,0,4));if(!r)return null;let n=this.#n.decode(r.inputs,yt(e,4));return new We(r,r.selector,n)}static from(t){return t instanceof b?t:typeof t=="string"?new b(JSON.parse(t)):typeof t.formatJson=="function"?new b(t.formatJson()):typeof t.format=="function"?new b(t.format("json")):new b(t)}};var Qs=BigInt(0);function dn(s){return s??null}function j(s){return s==null?null:s.toString()}function qs(s){let t={};s.to&&(t.to=s.to),s.from&&(t.from=s.from),s.data&&(t.data=P(s.data));let e="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let n of e)!(n in s)||s[n]==null||(t[n]=T(s[n],`request.${n}`));let r="type,nonce".split(/,/);for(let n of r)!(n in s)||s[n]==null||(t[n]=I(s[n],`request.${n}`));return s.accessList&&(t.accessList=Me(s.accessList)),"blockTag"in s&&(t.blockTag=s.blockTag),"enableCcipRead"in s&&(t.enableCcipRead=!!s.enableCcipRead),"customData"in s&&(t.customData=s.customData),"blobVersionedHashes"in s&&s.blobVersionedHashes&&(t.blobVersionedHashes=s.blobVersionedHashes.slice()),"kzg"in s&&(t.kzg=s.kzg),"blobs"in s&&s.blobs&&(t.blobs=s.blobs.map(n=>Jr(n)?P(n):Object.assign({},n))),t}var Ys=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#t;constructor(t,e){this.#t=t.transactions.map(r=>typeof r!="string"?new Zt(r,e):r),C(this,{provider:e,hash:dn(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:dn(t.prevRandao),extraData:t.extraData,baseFeePerGas:dn(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return this.#t.map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){let t=this.#t.slice();return t.length===0?[]:(y(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){let{baseFeePerGas:t,difficulty:e,extraData:r,gasLimit:n,gasUsed:a,hash:o,miner:i,prevRandao:c,nonce:l,number:u,parentHash:d,parentBeaconBlockRoot:p,stateRoot:h,receiptsRoot:x,timestamp:w,transactions:A}=this;return{_type:"Block",baseFeePerGas:j(t),difficulty:j(e),extraData:r,gasLimit:j(n),gasUsed:j(a),blobGasUsed:j(this.blobGasUsed),excessBlobGas:j(this.excessBlobGas),hash:o,miner:i,prevRandao:c,nonce:l,number:u,parentHash:d,timestamp:w,parentBeaconBlockRoot:p,stateRoot:h,receiptsRoot:x,transactions:A}}[Symbol.iterator](){let t=0,e=this.transactions;return{next:()=>t<this.length?{value:e[t++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#t.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let e;if(typeof t=="number")e=this.#t[t];else{let r=t.toLowerCase();for(let n of this.#t)if(typeof n=="string"){if(n!==r)continue;e=n;break}else{if(n.hash===r)continue;e=n;break}}if(e==null)throw new Error("no such tx");return typeof e=="string"?await this.provider.getTransaction(e):e}getPrefetchedTransaction(t){let e=this.prefetchedTransactions;if(typeof t=="number")return e[t];t=t.toLowerCase();for(let r of e)if(r.hash===t)return r;f(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return ho(this)}},Ht=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(t,e){this.provider=e;let r=Object.freeze(t.topics.slice());C(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:r,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){let{address:t,blockHash:e,blockNumber:r,data:n,index:a,removed:o,topics:i,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:t,blockHash:e,blockNumber:r,data:n,index:a,removed:o,topics:i,transactionHash:c,transactionIndex:l}}async getBlock(){let t=await this.provider.getBlock(this.blockHash);return y(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){let t=await this.provider.getTransaction(this.transactionHash);return y(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){let t=await this.provider.getTransactionReceipt(this.transactionHash);return y(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return mo(this)}},Or=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#t;constructor(t,e){this.#t=Object.freeze(t.logs.map(n=>new Ht(n,e)));let r=Qs;t.effectiveGasPrice!=null?r=t.effectiveGasPrice:t.gasPrice!=null&&(r=t.gasPrice),C(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:r,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return this.#t}toJSON(){let{to:t,from:e,contractAddress:r,hash:n,index:a,blockHash:o,blockNumber:i,logsBloom:c,logs:l,status:u,root:d}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:i,contractAddress:r,cumulativeGasUsed:j(this.cumulativeGasUsed),from:e,gasPrice:j(this.gasPrice),blobGasUsed:j(this.blobGasUsed),blobGasPrice:j(this.blobGasPrice),gasUsed:j(this.gasUsed),hash:n,index:a,logs:l,logsBloom:c,root:d,status:u,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){let t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return ea(this)}reorderedEvent(t){return y(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),ta(this,t)}},Zt=class{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#t;constructor(t,e){this.provider=e,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,this.#t=-1}toJSON(){let{blockNumber:t,blockHash:e,index:r,hash:n,type:a,to:o,from:i,nonce:c,data:l,signature:u,accessList:d,blobVersionedHashes:p}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:t,blockHash:e,blobVersionedHashes:p,chainId:j(this.chainId),data:l,from:i,gasLimit:j(this.gasLimit),gasPrice:j(this.gasPrice),hash:n,maxFeePerGas:j(this.maxFeePerGas),maxPriorityFeePerGas:j(this.maxPriorityFeePerGas),maxFeePerBlobGas:j(this.maxFeePerBlobGas),nonce:c,signature:u,to:o,index:r,type:a,value:j(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){let r=await this.getTransaction();r&&(t=r.blockNumber)}if(t==null)return null;let e=this.provider.getBlock(t);if(e==null)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:e,blockNumber:r}=await de({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:r-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,e){let r=t??1,n=e??0,a=this.#t,o=-1,i=a===-1,c=async()=>{if(i)return null;let{blockNumber:p,nonce:h}=await de({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){a=p;return}if(i)return null;let x=await this.getTransaction();if(!(x&&x.blockNumber!=null))for(o===-1&&(o=a-3,o<this.#t&&(o=this.#t));o<=p;){if(i)return null;let w=await this.provider.getBlock(o,!0);if(w==null)return;for(let A of w)if(A===this.hash)return;for(let A=0;A<w.length;A++){let k=await w.getTransaction(A);if(k.from===this.from&&k.nonce===this.nonce){if(i)return null;let N=await this.provider.getTransactionReceipt(k.hash);if(N==null||p-N.blockNumber+1<r)return;let L="replaced";k.data===this.data&&k.to===this.to&&k.value===this.value?L="repriced":k.data==="0x"&&k.from===k.to&&k.value===Qs&&(L="cancelled"),y(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:L==="replaced"||L==="cancelled",reason:L,replacement:k.replaceableTransaction(a),hash:k.hash,receipt:N})}}o++}},l=p=>{if(p==null||p.status!==0)return p;y(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:p.to,from:p.from,data:""},receipt:p})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return l(u);if(u){if(await u.confirmations()>=r)return l(u)}else if(await c(),r===0)return null;return await new Promise((p,h)=>{let x=[],w=()=>{x.forEach(k=>k())};if(x.push(()=>{i=!0}),n>0){let k=setTimeout(()=>{w(),h(Et("wait for transaction timeout","TIMEOUT"))},n);x.push(()=>{clearTimeout(k)})}let A=async k=>{if(await k.confirmations()>=r){w();try{p(l(k))}catch(N){h(N)}}};if(x.push(()=>{this.provider.off(this.hash,A)}),this.provider.on(this.hash,A),a>=0){let k=async()=>{try{await c()}catch(N){if(gt(N,"TRANSACTION_REPLACED")){w(),h(N);return}}i||this.provider.once("block",k)};x.push(()=>{this.provider.off("block",k)}),this.provider.once("block",k)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return y(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ea(this)}reorderedEvent(t){return y(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),y(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ta(this,t)}replaceableTransaction(t){f(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);let e=new Zt(this,this.provider);return e.#t=t,e}};function ho(s){return{orphan:"drop-block",hash:s.hash,number:s.number}}function ta(s,t){return{orphan:"reorder-transaction",tx:s,other:t}}function ea(s){return{orphan:"drop-transaction",tx:s}}function mo(s){return{orphan:"drop-log",log:{transactionHash:s.transactionHash,blockHash:s.blockHash,blockNumber:s.blockNumber,address:s.address,data:s.data,topics:Object.freeze(s.topics.slice()),index:s.index}}}var Yt=class extends Ht{interface;fragment;args;constructor(t,e,r){super(t,t.provider);let n=e.decodeEventLog(r,t.data,t.topics);C(this,{args:n,fragment:r,interface:e})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},we=class extends Ht{error;constructor(t,e){super(t,t.provider),C(this,{error:e})}},Nr=class extends Or{#t;constructor(t,e,r){super(r,e),this.#t=t}get logs(){return super.logs.map(t=>{let e=t.topics.length?this.#t.getEvent(t.topics[0]):null;if(e)try{return new Yt(t,this.#t,e)}catch(r){return new we(t,r)}return t})}},Qt=class extends Zt{#t;constructor(t,e,r){super(r,e),this.#t=t}async wait(t,e){let r=await super.wait(t,e);return r==null?null:new Nr(this.#t,this.provider,r)}},Te=class extends Le{log;constructor(t,e,r,n){super(t,e,r),C(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},ze=class extends Te{constructor(t,e,r,n,a){super(t,e,r,new Yt(a,t.interface,n));let o=t.interface.decodeEventLog(n,this.log.data,this.log.topics);C(this,{args:o,fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};var ra=BigInt(0);function sa(s){return s&&typeof s.call=="function"}function aa(s){return s&&typeof s.estimateGas=="function"}function Fr(s){return s&&typeof s.resolveName=="function"}function oa(s){return s&&typeof s.sendTransaction=="function"}function ia(s){if(s!=null){if(Fr(s))return s;if(s.provider)return s.provider}}var pn=class{#t;fragment;constructor(t,e,r){if(C(this,{fragment:e}),e.inputs.length<r.length)throw new Error("too many arguments");let n=te(t.runner,"resolveName"),a=Fr(n)?n:null;this.#t=async function(){let o=await Promise.all(e.inputs.map((i,c)=>r[c]==null?null:i.walkAsync(r[c],(u,d)=>u==="address"?Array.isArray(d)?Promise.all(d.map(p=>zt(p,a))):zt(d,a):d)));return t.interface.encodeFilterTopics(e,o)}()}getTopicFilter(){return this.#t}};function te(s,t){return s==null?null:typeof s[t]=="function"?s:s.provider&&typeof s.provider[t]=="function"?s.provider:null}function qt(s){return s==null?null:s.provider||null}async function ca(s,t){let e=O.dereference(s,"overrides");f(typeof e=="object","invalid overrides parameter","overrides",s);let r=qs(e);return f(r.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),f(r.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function go(s,t,e){let r=te(s,"resolveName"),n=Fr(r)?r:null;return await Promise.all(t.map((a,o)=>a.walkAsync(e[o],(i,c)=>(c=O.dereference(c,i),i==="address"?zt(c,n):c))))}function yo(s){let t=async function(o){let i=await ca(o,["data"]);i.to=await s.getAddress(),i.from&&(i.from=await zt(i.from,ia(s.runner)));let c=s.interface,l=T(i.value||ra,"overrides.value")===ra,u=(i.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!u&&!l&&f(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),f(c.fallback||u,"cannot send data to receive-only contract","overrides.data",i.data);let d=c.receive||c.fallback&&c.fallback.payable;return f(d||l,"cannot send value to non-payable fallback","overrides.value",i.value),f(c.fallback||u,"cannot send data to receive-only contract","overrides.data",i.data),i},e=async function(o){let i=te(s.runner,"call");y(sa(i),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await t(o);try{return await i.call(c)}catch(l){throw cr(l)&&l.data?s.interface.makeError(l.data,c):l}},r=async function(o){let i=s.runner;y(oa(i),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await i.sendTransaction(await t(o)),l=qt(s.runner);return new Qt(s.interface,l,c)},n=async function(o){let i=te(s.runner,"estimateGas");return y(aa(i),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await i.estimateGas(await t(o))},a=async o=>await r(o);return C(a,{_contract:s,estimateGas:n,populateTransaction:t,send:r,staticCall:e}),a}function bo(s,t){let e=function(...l){let u=s.interface.getFunction(t,l);return y(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:l}}),u},r=async function(...l){let u=e(...l),d={};if(u.inputs.length+1===l.length&&(d=await ca(l.pop()),d.from&&(d.from=await zt(d.from,ia(s.runner)))),u.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let p=await go(s.runner,u.inputs,l);return Object.assign({},d,await de({to:s.getAddress(),data:s.interface.encodeFunctionData(u,p)}))},n=async function(...l){let u=await i(...l);return u.length===1?u[0]:u},a=async function(...l){let u=s.runner;y(oa(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let d=await u.sendTransaction(await r(...l)),p=qt(s.runner);return new Qt(s.interface,p,d)},o=async function(...l){let u=te(s.runner,"estimateGas");return y(aa(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...l))},i=async function(...l){let u=te(s.runner,"call");y(sa(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let d;try{d=await r(...l)}catch(x){let w=l.at(-1).blockTag;throw w&&(x.blockNumber=w),x}let p="0x";try{p=await u.call(d)}catch(x){throw cr(x)&&x.data?s.interface.makeError(x.data,d):x}let h=e(...l);return s.interface.decodeFunctionResult(h,p)},c=async(...l)=>e(...l).constant?await n(...l):await a(...l);return C(c,{name:s.interface.getFunctionName(t),_contract:s,_key:t,getFragment:e,estimateGas:o,populateTransaction:r,send:a,staticCall:n,staticCallResult:i}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let l=s.interface.getFunction(t);return y(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),l}}),c}function xo(s,t){let e=function(...n){let a=s.interface.getEvent(t,n);return y(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:n}}),a},r=function(...n){return new pn(s,e(...n),n)};return C(r,{name:s.interface.getEventName(t),_contract:s,_key:t,getFragment:e}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{let n=s.interface.getEvent(t);return y(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),n}}),r}var Sr=Symbol.for("_ethersInternal_contract"),la=new WeakMap;function Co(s,t){la.set(s[Sr],t)}function it(s){return la.get(s[Sr])}function wo(s){return s&&typeof s=="object"&&"getTopicFilter"in s&&typeof s.getTopicFilter=="function"&&s.fragment}async function mn(s,t){let e,r=null;if(Array.isArray(t)){let a=function(o){if(U(o,32))return o;let i=s.interface.getEvent(o);return f(i,"unknown fragment","name",o),i.topicHash};e=t.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else t==="*"?e=[null]:typeof t=="string"?U(t,32)?e=[t]:(r=s.interface.getEvent(t),f(r,"unknown fragment","event",t),e=[r.topicHash]):wo(t)?e=await t.getTopicFilter():"fragment"in t?(r=t.fragment,e=[r.topicHash]):f(!1,"unknown event name","event",t);e=e.map(a=>{if(a==null)return null;if(Array.isArray(a)){let o=Array.from(new Set(a.map(i=>i.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});let n=e.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:n,topics:e}}async function Je(s,t){let{subs:e}=it(s);return e.get((await mn(s,t)).tag)||null}async function na(s,t,e){let r=qt(s.runner);y(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});let{fragment:n,tag:a,topics:o}=await mn(s,e),{addr:i,subs:c}=it(s),l=c.get(a);if(!l){let d={address:i||s,topics:o},p=A=>{let k=n;if(k==null)try{k=s.interface.getEvent(A.topics[0])}catch{}if(k){let N=k,L=n?s.interface.decodeEventLog(n,A.data,A.topics):[];hn(s,e,L,le=>new ze(s,le,e,N,A))}else hn(s,e,[],N=>new Te(s,N,e,A))},h=[];l={tag:a,listeners:[],start:()=>{h.length||h.push(r.on(d,p))},stop:async()=>{if(h.length==0)return;let A=h;h=[],await Promise.all(A),r.off(d,p)}},c.set(a,l)}return l}var fn=Promise.resolve();async function To(s,t,e,r){await fn;let n=await Je(s,t);if(!n)return!1;let a=n.listeners.length;return n.listeners=n.listeners.filter(({listener:o,once:i})=>{let c=Array.from(e);r&&c.push(r(i?null:o));try{o.call(s,...c)}catch{}return!i}),n.listeners.length===0&&(n.stop(),it(s).subs.delete(n.tag)),a>0}async function hn(s,t,e,r){try{await fn}catch{}let n=To(s,t,e,r);return fn=n,await n}var Br=["then"],ft=class{target;interface;runner;filters;[Sr];fallback;constructor(t,e,r,n){f(typeof t=="string"||xr(t),"invalid value for Contract target","target",t),r==null&&(r=null);let a=b.from(e);C(this,{target:t,runner:r,interface:a}),Object.defineProperty(this,Sr,{value:{}});let o,i=null,c=null;if(n){let d=qt(r);c=new Qt(this.interface,d,n)}let l=new Map;if(typeof t=="string")if(U(t))i=t,o=Promise.resolve(t);else{let d=te(r,"resolveName");if(!Fr(d))throw Et("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=d.resolveName(t).then(p=>{if(p==null)throw Et("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return it(this).addr=p,p})}else o=t.getAddress().then(d=>{if(d==null)throw new Error("TODO");return it(this).addr=d,d});Co(this,{addrPromise:o,addr:i,deployTx:c,subs:l});let u=new Proxy({},{get:(d,p,h)=>{if(typeof p=="symbol"||Br.indexOf(p)>=0)return Reflect.get(d,p,h);try{return this.getEvent(p)}catch(x){if(!gt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,p)=>Br.indexOf(p)>=0?Reflect.has(d,p):Reflect.has(d,p)||this.interface.hasEvent(String(p))});return C(this,{filters:u}),C(this,{fallback:a.receive||a.fallback?yo(this):null}),new Proxy(this,{get:(d,p,h)=>{if(typeof p=="symbol"||p in d||Br.indexOf(p)>=0)return Reflect.get(d,p,h);try{return d.getFunction(p)}catch(x){if(!gt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,p)=>typeof p=="symbol"||p in d||Br.indexOf(p)>=0?Reflect.has(d,p):d.interface.hasFunction(p)})}connect(t){return new ft(this.target,this.interface,t)}attach(t){return new ft(t,this.interface,this.runner)}async getAddress(){return await it(this).addrPromise}async getDeployedCode(){let t=qt(this.runner);y(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let e=await t.getCode(await this.getAddress());return e==="0x"?null:e}async waitForDeployment(){let t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;let r=qt(this.runner);return y(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((n,a)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return n(this);r.once("block",o)}catch(i){a(i)}};o()})}deploymentTransaction(){return it(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),bo(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),xo(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e,r){e==null&&(e=0),r==null&&(r="latest");let{addr:n,addrPromise:a}=it(this),o=n||await a,{fragment:i,topics:c}=await mn(this,t),l={address:o,topics:c,fromBlock:e,toBlock:r},u=qt(this.runner);return y(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(l)).map(d=>{let p=i;if(p==null)try{p=this.interface.getEvent(d.topics[0])}catch{}if(p)try{return new Yt(d,this.interface,p)}catch(h){return new we(d,h)}return new Ht(d,u)})}async on(t,e){let r=await na(this,"on",t);return r.listeners.push({listener:e,once:!1}),r.start(),this}async once(t,e){let r=await na(this,"once",t);return r.listeners.push({listener:e,once:!0}),r.start(),this}async emit(t,...e){return await hn(this,t,e,null)}async listenerCount(t){if(t){let n=await Je(this,t);return n?n.listeners.length:0}let{subs:e}=it(this),r=0;for(let{listeners:n}of e.values())r+=n.length;return r}async listeners(t){if(t){let n=await Je(this,t);return n?n.listeners.map(({listener:a})=>a):[]}let{subs:e}=it(this),r=[];for(let{listeners:n}of e.values())r=r.concat(n.map(({listener:a})=>a));return r}async off(t,e){let r=await Je(this,t);if(!r)return this;if(e){let n=r.listeners.map(({listener:a})=>a).indexOf(e);n>=0&&r.listeners.splice(n,1)}return(e==null||r.listeners.length===0)&&(r.stop(),it(this).subs.delete(r.tag)),this}async removeAllListeners(t){if(t){let e=await Je(this,t);if(!e)return this;e.stop(),it(this).subs.delete(e.tag)}else{let{subs:e}=it(this);for(let{tag:r,stop:n}of e.values())n(),e.delete(r)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){class e extends ft{constructor(n,a=null){super(n,t,a)}}return e}static from(t,e,r){return r==null&&(r=null),new this(t,e,r)}};function Eo(){return ft}var K=class extends Eo(){};var ua=BigInt(0);function E(s,t){return function(e){return e==null?t:s(e)}}function Ee(s,t){return e=>{if(t&&e==null)return null;if(!Array.isArray(e))throw new Error("not an array");return e.map(r=>s(r))}}function ee(s,t){return e=>{let r={};for(let n in s){let a=n;if(t&&n in t&&!(a in e)){for(let o of t[n])if(o in e){a=o;break}}try{let o=s[n](e[a]);o!==void 0&&(r[n]=o)}catch(o){let i=o instanceof Error?o.message:"not-an-error";y(!1,`invalid value for value.${n} (${i})`,"BAD_DATA",{value:e})}}return r}}function ko(s){switch(s){case!0:case"true":return!0;case!1:case"false":return!1}f(!1,`invalid boolean; ${JSON.stringify(s)}`,"value",s)}function Vt(s){return f(U(s,!0),"invalid data","value",s),s}function G(s){return f(U(s,32),"invalid hash","value",s),s}var vo=ee({address:S,blockHash:G,blockNumber:I,data:Vt,index:I,removed:E(ko,!1),topics:Ee(G),transactionHash:G,transactionIndex:I},{index:["logIndex"]});function da(s){return vo(s)}var Po=ee({hash:E(G),parentHash:G,parentBeaconBlockRoot:E(G,null),number:I,timestamp:I,nonce:E(Vt),difficulty:T,gasLimit:T,gasUsed:T,stateRoot:E(G,null),receiptsRoot:E(G,null),blobGasUsed:E(T,null),excessBlobGas:E(T,null),miner:E(S),prevRandao:E(G,null),extraData:Vt,baseFeePerGas:E(T)},{prevRandao:["mixHash"]});function pa(s){let t=Po(s);return t.transactions=s.transactions.map(e=>typeof e=="string"?e:yn(e)),t}var Io=ee({transactionIndex:I,blockNumber:I,transactionHash:G,address:S,topics:Ee(G),data:Vt,index:I,blockHash:G},{index:["logIndex"]});function gn(s){return Io(s)}var ou=ee({to:E(S,null),from:E(S,null),contractAddress:E(S,null),index:I,root:E(P),gasUsed:T,blobGasUsed:E(T,null),logsBloom:E(Vt),blockHash:G,hash:G,logs:Ee(gn),blockNumber:I,cumulativeGasUsed:T,effectiveGasPrice:E(T),blobGasPrice:E(T,null),status:E(I),type:E(I,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function yn(s){s.to&&T(s.to)===ua&&(s.to="0x0000000000000000000000000000000000000000");let t=ee({hash:G,index:E(I,void 0),type:e=>e==="0x"||e==null?0:I(e),accessList:E(Me,null),blobVersionedHashes:E(Ee(G,!0),null),blockHash:E(G,null),blockNumber:E(I,null),transactionIndex:E(I,null),from:S,gasPrice:E(T),maxPriorityFeePerGas:E(T),maxFeePerGas:E(T),maxFeePerBlobGas:E(T,null),gasLimit:T,to:E(S,null),value:T,nonce:I,data:Vt,creates:E(S,null),chainId:E(T,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(s);if(t.to==null&&t.creates==null&&(t.creates=sn(t)),(s.type===1||s.type===2)&&s.accessList==null&&(t.accessList=[]),s.signature?t.signature=J.from(s.signature):t.signature=J.from(s),t.chainId==null){let e=t.signature.legacyChainId;e!=null&&(t.chainId=e)}return t.blockHash&&T(t.blockHash)===ua&&(t.blockHash=null),t}var Ut=class extends Un{chainId;address;log;block;trace;blockNumber;transactionHash;transaction;transactionReceipt;timestamp;preparedData;constructor(t,e,r,n,a,o,i,c,l,u){super(l),this.chainId=t,this.log=a,this.block=n,this.trace=o,this.address=e.toLowerCase(),this.transaction=i,this.transactionReceipt=c,this.timestamp=r||new Date(0),this.preparedData=u,a?(this.blockNumber=a.blockNumber,this.transactionHash=a.transactionHash):n?this.blockNumber=n.number:o&&(this.blockNumber=o.blockNumber,this.transactionHash=o.transactionHash)}getChainId(){return this.chainId}getMetaDataInternal(t,e){if(this.log)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:this.log.transactionIndex,transactionHash:this.transactionHash||"",logIndex:this.log.index,chainId:this.chainId,name:t,labels:Oe(e)};if(this.trace)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:this.trace.transactionPosition,transactionHash:this.transactionHash||"",logIndex:-1,chainId:this.chainId.toString(),name:t,labels:Oe(e)};if(this.transaction)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:this.transaction.index||0,transactionHash:this.transaction.hash||"",logIndex:-1,chainId:this.chainId.toString(),name:t,labels:Oe(e)};if(this.block)return{address:this.address,contractName:this.getContractName(),blockNumber:BigInt(this.blockNumber),transactionIndex:-1,transactionHash:"",logIndex:-1,chainId:this.chainId.toString(),name:t,labels:Oe(e)};throw new Error("Invaid ctx argument can't happen")}},ke=class extends Ut{getContractName(){return"account"}},xt=class extends Ut{constructor(t,e,r,n,a,o,i,c,l,u){super(t,e,r,n,a,o,i,c,l,u)}getContractName(){return"*"}getMetaDataInternal(t,e){let r=this.address;this.address="*";let n=super.getMetaDataInternal(t,e);return this.address=r,n}},Ct=class extends Ut{contract;contractName;constructor(t,e,r,n,a,o,i,c,l,u,d){super(r,e.address,n,a,o,i,c,l,u,d),e.context=this,e.callStatic&&(e.callStatic.context=this),e.encodeCall&&(e.encodeCall.context=this),this.contractName=t,this.contract=e}getContractName(){return this.contractName}},It=class{contract;constructor(t){this.contract=t}get rawContract(){return this.contract}get provider(){if(this.contract.runner?.provider)return this.contract.runner.provider;throw Error("Can't find provider for contract"+this.contract.toString())}},At=class{view;address;context;callStatic;encodeCall;constructor(t,e){this.address=t,this.view=e}get rawContract(){return this.view.rawContract}get provider(){return this.view.provider}get filters(){return this.view.rawContract.filters}};process.stdout.write("");var D=Tt(Wr(),1);var Ke=class extends Error{e;constructor(t,e,r){super(t),this.stack=r}toString(){return this.message+`
3
3
  `+this.stack?.toString()}};function g(s,t,e){if(s instanceof Ke)return s;let r="Check here for possible cause and fix: https://docs.sentio.xyz/docs/handling-errors#ethers-error",n="",a=s;return a.code==="CALL_EXCEPTION"||a.code==="BAD_DATA"?a.data==="0x"?(t?n=`jsonrpc eth_call return '0x' (likely contract not existed) at chain ${t.chainId}, ${r}:
4
4
  ${s.message}`:n=`jsonrpc eth_call return '0x' (likely contract not existed), ${r}:
5
5
  ${s.message}`,new Ke(n,a,e)):new Ke(`eth call error ${a.message}, ${r}:
@@ -19,4 +19,4 @@ ${JSON.stringify(a)}`,a,e):(n="other error during call error ${e.message}\n"+JSO
19
19
  @noble/hashes/esm/utils.js:
20
20
  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
21
21
  */
22
- //# sourceMappingURL=chunk-CVNNI2QT.js.map
22
+ //# sourceMappingURL=chunk-57ZKWCWX.js.map
@@ -1,3 +1,3 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{g as r}from"./chunk-FOJS2TDD.js";import{a as l}from"./chunk-F2HFFA4Z.js";import{k as b}from"./chunk-X2PNG64U.js";import{a as i,d as m}from"./chunk-4TVQXTHY.js";import{a as u}from"./chunk-7H2MCYRO.js";import{e as p}from"./chunk-LLHU72AA.js";var d=p(u(),1);var a=new Map;async function E(){let o=w.coinlist;try{o=(await(await l("https://raw.githubusercontent.com/solflare-wallet/sui-coinlist/master/sui-coinlist.json")).json()).coinlist}catch{console.warn("Can't not fetch newest coin list, use default list")}I(o)}function I(o){for(let e of o){if(e.address.startsWith("0x2::coin::Coin")||e.network!=="mainnet")continue;let s="native";e.name.includes("Celer")&&(s="Celer"),e.name.includes("LayerZero")&&(s="LayerZero"),e.name.includes("Wormhole")&&(s="Wormhole"),a.set(e.address,{token_type:{type:e.address,account_address:e.address.split("::")[0]},symbol:e.symbol,decimals:e.decimals,bridge:s})}}function N(){return a}function k(o){let[e,s,n]=o.split(i),t=[m(e),s,n].join(i);return a.has(t)}function B(o){let e=a.get(o);if(!e){let s=o.split("::");return{token_type:{type:o,account_address:s[0]},symbol:s[2],decimals:8,bridge:"native"}}return e}var g=new Map;async function R(o,e){let s=a.get(o);if(!s){e=e||d.SuiChainId.SUI_MAINNET;let n=e+"_"+o,t=g.get(n);t||(t=r(e).getCoinMetadata({coinType:o}),g.set(n,t));let c=await t;if(c===null)throw Error("Coin not existed "+n);let f=o.split(i);return{token_type:{type:o,account_address:f[0]},symbol:c.symbol,decimals:c.decimals,bridge:"native"}}return s}async function h(o,e){if(!k(o))return 0;let s=new Date(e/1e3);try{return await b(d.SuiChainId.SUI_MAINNET,o,s)||0}catch(n){throw console.log(JSON.stringify(n)),n}}async function D(o,e,s){let n=await h(e.token_type.type,s);return o.scaleDown(e.decimals).multipliedBy(n)}var w={name:"Sui Coin List",timestamp:"2022-12-01T13:34:30.145Z",logoURI:"https://s2.coinmarketcap.com/static/img/coins/128x128/20947.png",coinlist:[{network:"mainnet",address:"0x2::coin::Coin<0x2::sui::SUI>",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"testnet",address:"0x2::coin::Coin<0x2::sui::SUI>",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"devnet",address:"0x2::coin::Coin<0x2::sui::SUI>",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"mainnet",address:"0x2::sui::SUI",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"testnet",address:"0x2::sui::SUI",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"devnet",address:"0x2::sui::SUI",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST",symbol:"TEST",name:"Test Token",logoURI:"https://suiswap.app/images/token/suiswap-test.svg",tags:[],decimals:8,extensions:{}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT",symbol:"USDT",name:"Tether",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png",tags:[],decimals:8,extensions:{coingeckoId:"tether"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC",symbol:"USDC",name:"USD Coin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL",symbol:"SOL",name:"Solana",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",decimals:8,extensions:{coingeckoId:"solana"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC",symbol:"BTC",name:"Bitcoin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"bitcoin"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI",symbol:"DAI",name:"DAI",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"dai"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB",symbol:"BNB",name:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",decimals:8,tags:[],extensions:{coingeckoId:"binancecoin"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH",symbol:"ETH",name:"Ethereum",logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png",decimals:8,tags:[],extensions:{coingeckoId:"ethereum"}},{network:"testnet",address:"0x31b14985adb91360ed90a5786cb0956c83e7f275a8ae6123f38adab9d2b792b1::usdc::USDC",symbol:"USDC",name:"USD Coin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST",symbol:"TEST",name:"Test Token",logoURI:"https://suiswap.app/images/token/suiswap-test.svg",tags:[],decimals:8,extensions:{}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT",symbol:"USDT",name:"Tether",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png",tags:[],decimals:8,extensions:{coingeckoId:"tether"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC",symbol:"USDC",name:"USD Coin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL",symbol:"SOL",name:"Solana",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",decimals:8,extensions:{coingeckoId:"solana"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC",symbol:"BTC",name:"Bitcoin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"bitcoin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI",symbol:"DAI",name:"DAI",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"dai"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB",symbol:"BNB",name:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",decimals:8,tags:[],extensions:{coingeckoId:"binancecoin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH",symbol:"ETH",name:"Ethereum",logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png",decimals:8,tags:[],extensions:{coingeckoId:"ethereum"}},{network:"mainnet",address:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",symbol:"wETH",name:"Wrapped Ethereum (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png",tags:[],extensions:{coingeckoId:"ethereum"}},{network:"mainnet",address:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",symbol:"wUSDT",name:"Tether (Wormhole)",decimals:6,logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png",tags:[],extensions:{coingeckoId:"tether"}},{network:"mainnet",address:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",symbol:"wUSDC",name:"USD Coin (Wormhole)",decimals:6,logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"mainnet",address:"0xa198f3be41cda8c07b3bf3fee02263526e535d682499806979a111e88a5a8d0f::coin::COIN",symbol:"wCELO",name:"Celo (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/11090/large/InjXBNx9_400x400.jpg",tags:[],extensions:{coingeckoId:"celo"}},{network:"mainnet",address:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",symbol:"wMATIC",name:"Wrapped Matic (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png",tags:[],extensions:{coingeckoId:"matic-network"}},{network:"mainnet",address:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",symbol:"wBNB",name:"Wrapped BNB (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",tags:[],extensions:{coingeckoId:"binancecoin"}},{network:"mainnet",address:"0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",symbol:"wBTC",name:"Wrapped Bitcoin (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/1/large/bitcoin.png",tags:[],extensions:{coingeckoId:"bitcoin"}},{network:"mainnet",address:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",symbol:"wAVAX",name:"Wrapped AVAX (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png",tags:[],extensions:{coingeckoId:"avalanche-2"}},{network:"mainnet",address:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",symbol:"wFTM",name:"Wrapped Fantom (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/4001/large/Fantom_round.png",tags:[],extensions:{coingeckoId:"fantom"}},{network:"mainnet",address:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",symbol:"wGLMR",name:"Wrapped GLMR (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/22459/large/glmr.png",tags:[],extensions:{coingeckoId:"moonbeam"}},{network:"mainnet",address:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",symbol:"wSOL",name:"Wrapped Solana (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/4128/large/solana.png",tags:[],extensions:{coingeckoId:"solana"}},{network:"mainnet",address:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",symbol:"wUSDCsol",name:"USD Coin Solana (Wormhole)",decimals:6,logoURI:"https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",tags:[],extensions:{coingeckoId:"usd-coin"}}]};process.stdout.write("");export{E as a,N as b,k as c,B as d,R as e,h as f,D as g};
3
- //# sourceMappingURL=chunk-24SNMMHJ.js.map
2
+ import{g as r}from"./chunk-FOJS2TDD.js";import{a as l}from"./chunk-F2HFFA4Z.js";import{k as b}from"./chunk-YHVKM472.js";import{a as i,d as m}from"./chunk-4TVQXTHY.js";import{a as u}from"./chunk-7H2MCYRO.js";import{e as p}from"./chunk-LLHU72AA.js";var d=p(u(),1);var a=new Map;async function E(){let o=w.coinlist;try{o=(await(await l("https://raw.githubusercontent.com/solflare-wallet/sui-coinlist/master/sui-coinlist.json")).json()).coinlist}catch{console.warn("Can't not fetch newest coin list, use default list")}I(o)}function I(o){for(let e of o){if(e.address.startsWith("0x2::coin::Coin")||e.network!=="mainnet")continue;let s="native";e.name.includes("Celer")&&(s="Celer"),e.name.includes("LayerZero")&&(s="LayerZero"),e.name.includes("Wormhole")&&(s="Wormhole"),a.set(e.address,{token_type:{type:e.address,account_address:e.address.split("::")[0]},symbol:e.symbol,decimals:e.decimals,bridge:s})}}function N(){return a}function k(o){let[e,s,n]=o.split(i),t=[m(e),s,n].join(i);return a.has(t)}function B(o){let e=a.get(o);if(!e){let s=o.split("::");return{token_type:{type:o,account_address:s[0]},symbol:s[2],decimals:8,bridge:"native"}}return e}var g=new Map;async function R(o,e){let s=a.get(o);if(!s){e=e||d.SuiChainId.SUI_MAINNET;let n=e+"_"+o,t=g.get(n);t||(t=r(e).getCoinMetadata({coinType:o}),g.set(n,t));let c=await t;if(c===null)throw Error("Coin not existed "+n);let f=o.split(i);return{token_type:{type:o,account_address:f[0]},symbol:c.symbol,decimals:c.decimals,bridge:"native"}}return s}async function h(o,e){if(!k(o))return 0;let s=new Date(e/1e3);try{return await b(d.SuiChainId.SUI_MAINNET,o,s)||0}catch(n){throw console.log(JSON.stringify(n)),n}}async function D(o,e,s){let n=await h(e.token_type.type,s);return o.scaleDown(e.decimals).multipliedBy(n)}var w={name:"Sui Coin List",timestamp:"2022-12-01T13:34:30.145Z",logoURI:"https://s2.coinmarketcap.com/static/img/coins/128x128/20947.png",coinlist:[{network:"mainnet",address:"0x2::coin::Coin<0x2::sui::SUI>",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"testnet",address:"0x2::coin::Coin<0x2::sui::SUI>",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"devnet",address:"0x2::coin::Coin<0x2::sui::SUI>",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"mainnet",address:"0x2::sui::SUI",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"testnet",address:"0x2::sui::SUI",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"devnet",address:"0x2::sui::SUI",symbol:"SUI",name:"Sui Coin",decimals:9,logoURI:"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg",tags:[],extensions:{coingeckoId:"sui"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST",symbol:"TEST",name:"Test Token",logoURI:"https://suiswap.app/images/token/suiswap-test.svg",tags:[],decimals:8,extensions:{}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT",symbol:"USDT",name:"Tether",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png",tags:[],decimals:8,extensions:{coingeckoId:"tether"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC",symbol:"USDC",name:"USD Coin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL",symbol:"SOL",name:"Solana",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",decimals:8,extensions:{coingeckoId:"solana"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC",symbol:"BTC",name:"Bitcoin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"bitcoin"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI",symbol:"DAI",name:"DAI",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"dai"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB",symbol:"BNB",name:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",decimals:8,tags:[],extensions:{coingeckoId:"binancecoin"}},{network:"testnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH",symbol:"ETH",name:"Ethereum",logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png",decimals:8,tags:[],extensions:{coingeckoId:"ethereum"}},{network:"testnet",address:"0x31b14985adb91360ed90a5786cb0956c83e7f275a8ae6123f38adab9d2b792b1::usdc::USDC",symbol:"USDC",name:"USD Coin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST",symbol:"TEST",name:"Test Token",logoURI:"https://suiswap.app/images/token/suiswap-test.svg",tags:[],decimals:8,extensions:{}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT",symbol:"USDT",name:"Tether",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png",tags:[],decimals:8,extensions:{coingeckoId:"tether"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC",symbol:"USDC",name:"USD Coin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL",symbol:"SOL",name:"Solana",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png",decimals:8,extensions:{coingeckoId:"solana"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC",symbol:"BTC",name:"Bitcoin",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"bitcoin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI",symbol:"DAI",name:"DAI",logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png",decimals:8,tags:[],extensions:{coingeckoId:"dai"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB",symbol:"BNB",name:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",decimals:8,tags:[],extensions:{coingeckoId:"binancecoin"}},{network:"devnet",address:"0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH",symbol:"ETH",name:"Ethereum",logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png",decimals:8,tags:[],extensions:{coingeckoId:"ethereum"}},{network:"mainnet",address:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",symbol:"wETH",name:"Wrapped Ethereum (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png",tags:[],extensions:{coingeckoId:"ethereum"}},{network:"mainnet",address:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",symbol:"wUSDT",name:"Tether (Wormhole)",decimals:6,logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png",tags:[],extensions:{coingeckoId:"tether"}},{network:"mainnet",address:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",symbol:"wUSDC",name:"USD Coin (Wormhole)",decimals:6,logoURI:"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",tags:[],extensions:{coingeckoId:"usd-coin"}},{network:"mainnet",address:"0xa198f3be41cda8c07b3bf3fee02263526e535d682499806979a111e88a5a8d0f::coin::COIN",symbol:"wCELO",name:"Celo (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/11090/large/InjXBNx9_400x400.jpg",tags:[],extensions:{coingeckoId:"celo"}},{network:"mainnet",address:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",symbol:"wMATIC",name:"Wrapped Matic (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png",tags:[],extensions:{coingeckoId:"matic-network"}},{network:"mainnet",address:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",symbol:"wBNB",name:"Wrapped BNB (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png",tags:[],extensions:{coingeckoId:"binancecoin"}},{network:"mainnet",address:"0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",symbol:"wBTC",name:"Wrapped Bitcoin (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/1/large/bitcoin.png",tags:[],extensions:{coingeckoId:"bitcoin"}},{network:"mainnet",address:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",symbol:"wAVAX",name:"Wrapped AVAX (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png",tags:[],extensions:{coingeckoId:"avalanche-2"}},{network:"mainnet",address:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",symbol:"wFTM",name:"Wrapped Fantom (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/4001/large/Fantom_round.png",tags:[],extensions:{coingeckoId:"fantom"}},{network:"mainnet",address:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",symbol:"wGLMR",name:"Wrapped GLMR (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/22459/large/glmr.png",tags:[],extensions:{coingeckoId:"moonbeam"}},{network:"mainnet",address:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",symbol:"wSOL",name:"Wrapped Solana (Wormhole)",decimals:8,logoURI:"https://assets.coingecko.com/coins/images/4128/large/solana.png",tags:[],extensions:{coingeckoId:"solana"}},{network:"mainnet",address:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",symbol:"wUSDCsol",name:"USD Coin Solana (Wormhole)",decimals:6,logoURI:"https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png",tags:[],extensions:{coingeckoId:"usd-coin"}}]};process.stdout.write("");export{E as a,N as b,k as c,B as d,R as e,h as f,D as g};
3
+ //# sourceMappingURL=chunk-7CN7I4Z2.js.map