@latticexyz/world-module-erc20 2.2.15-main-c3c209ef0aba141416824a1613ccd1fe077adee1 → 2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_esm-BQNWKNND.js +10 -0
- package/dist/{_esm-DCAC27XZ.js.map → _esm-BQNWKNND.js.map} +1 -1
- package/dist/ccip-YAWUVTAX.js +2 -0
- package/dist/chunk-GSBUANUZ.js +30 -0
- package/dist/{chunk-AU25RBDM.js.map → chunk-GSBUANUZ.js.map} +1 -1
- package/dist/chunk-LURIOADG.js +2 -0
- package/dist/{chunk-QBDELX7C.js → chunk-TJJDXMQ6.js} +1 -1
- package/dist/{chunk-QBDELX7C.js.map → chunk-TJJDXMQ6.js.map} +1 -1
- package/dist/internal.js +1 -1
- package/dist/mud.config.js +1 -1
- package/dist/{secp256k1-QYN2SJD6.js → secp256k1-UMYSD4MC.js} +2 -2
- package/dist/{secp256k1-QYN2SJD6.js.map → secp256k1-UMYSD4MC.js.map} +1 -1
- package/package.json +8 -10
- package/dist/_esm-DCAC27XZ.js +0 -10
- package/dist/ccip-GJX6Z7AD.js +0 -2
- package/dist/chunk-AU25RBDM.js +0 -30
- package/dist/chunk-SYRP7SJ5.js +0 -2
- /package/dist/{ccip-GJX6Z7AD.js.map → ccip-YAWUVTAX.js.map} +0 -0
- /package/dist/{chunk-SYRP7SJ5.js.map → chunk-LURIOADG.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@latticexyz/world-module-erc20",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1",
|
|
4
4
|
"description": "ERC20 world module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,21 +30,19 @@
|
|
|
30
30
|
"src"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@latticexyz/schema-type": "2.2.
|
|
34
|
-
"@latticexyz/store": "2.2.
|
|
35
|
-
"@latticexyz/store-consumer": "2.2.
|
|
36
|
-
"@latticexyz/world": "2.2.
|
|
33
|
+
"@latticexyz/schema-type": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1",
|
|
34
|
+
"@latticexyz/store": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1",
|
|
35
|
+
"@latticexyz/store-consumer": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1",
|
|
36
|
+
"@latticexyz/world": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@types/node": "^18.15.11",
|
|
40
39
|
"ds-test": "https://github.com/dapphub/ds-test.git#e282159d5170298eb2455a6c05280ab5a73a4ef0",
|
|
41
40
|
"forge-std": "https://github.com/foundry-rs/forge-std.git#74cfb77e308dd188d2f58864aaf44963ae6b88b1",
|
|
42
41
|
"solhint": "^3.3.7",
|
|
43
|
-
"tsup": "^6.7.0",
|
|
44
42
|
"vitest": "0.34.6",
|
|
45
|
-
"@latticexyz/abi-ts": "2.2.
|
|
46
|
-
"@latticexyz/cli": "2.2.
|
|
47
|
-
"@latticexyz/gas-report": "2.2.
|
|
43
|
+
"@latticexyz/abi-ts": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1",
|
|
44
|
+
"@latticexyz/cli": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1",
|
|
45
|
+
"@latticexyz/gas-report": "2.2.16-54e5c06dd4606d2484a790cd1d531931d634d7a1"
|
|
48
46
|
},
|
|
49
47
|
"publishConfig": {
|
|
50
48
|
"access": "public"
|
package/dist/_esm-DCAC27XZ.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as p,b as g,c as Ur,d as X}from"./chunk-SYRP7SJ5.js";var nt=g((li,it)=>{"use strict";var{Duplex:Ir}=p("stream");function rt(r){r.emit("close")}function Dr(){!this.destroyed&&this._writableState.finished&&this.destroy()}function st(r){this.removeListener("error",st),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function Mr(r,e){let t=!0,s=new Ir({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(n,o){let f=!o&&s._readableState.objectMode?n.toString():n;s.push(f)||r.pause()}),r.once("error",function(n){s.destroyed||(t=!1,s.destroy(n))}),r.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(i,n){if(r.readyState===r.CLOSED){n(i),process.nextTick(rt,s);return}let o=!1;r.once("error",function(l){o=!0,n(l)}),r.once("close",function(){o||n(i),process.nextTick(rt,s)}),t&&r.terminate()},s._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){s._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),s._readableState.endEmitted&&s.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},s._read=function(){r.isPaused&&r.resume()},s._write=function(i,n,o){if(r.readyState===r.CONNECTING){r.once("open",function(){s._write(i,n,o)});return}r.send(i,o)},s.on("end",Dr),s.on("error",st),s}it.exports=Mr});var C=g((ci,ft)=>{"use strict";var ot=["nodebuffer","arraybuffer","fragments"],at=typeof Blob<"u";at&&ot.push("blob");ft.exports={BINARY_TYPES:ot,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:at,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var wt=g((hi,bt)=>{var ut=p("fs"),N=p("path"),dt=p("os"),_t=typeof __webpack_require__=="function"?__non_webpack_require__:p,Ar=process.config&&process.config.variables||{},Fr=!!process.env.PREBUILDS_ONLY,lt=process.versions.modules,ve=jr()?"electron":Wr()?"node-webkit":"node",Ee=process.env.npm_config_arch||dt.arch(),be=process.env.npm_config_platform||dt.platform(),pt=process.env.LIBC||(Gr(be)?"musl":"glibc"),we=process.env.ARM_VERSION||(Ee==="arm64"?"8":Ar.arm_version)||"",mt=(process.versions.uv||"").split(".")[0];bt.exports=O;function O(r){return _t(O.resolve(r))}O.resolve=O.path=function(r){r=N.resolve(r||".");try{var e=_t(N.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!Fr){var t=ct(N.join(r,"build/Release"),ht);if(t)return t;var s=ct(N.join(r,"build/Debug"),ht);if(s)return s}var i=f(r);if(i)return i;var n=f(N.dirname(process.execPath));if(n)return n;var o=["platform="+be,"arch="+Ee,"runtime="+ve,"abi="+lt,"uv="+mt,we?"armv="+we:"","libc="+pt,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
|
|
2
|
-
loaded from: `+r+`
|
|
3
|
-
`);function f(l){var a=Oe(N.join(l,"prebuilds")).map(yt),h=a.filter(gt(be,Ee)).sort(xt)[0];if(h){var u=N.join(l,"prebuilds",h.name),_=Oe(u).map(St),y=_.filter(vt(ve,lt)),m=y.sort(Et(ve))[0];if(m)return N.join(u,m.file)}}};function Oe(r){try{return ut.readdirSync(r)}catch{return[]}}function ct(r,e){var t=Oe(r).filter(e);return t[0]&&N.join(r,t[0])}function ht(r){return/\.node$/.test(r)}function yt(r){var e=r.split("-");if(e.length===2){var t=e[0],s=e[1].split("+");if(t&&s.length&&s.every(Boolean))return{name:r,platform:t,architectures:s}}}function gt(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function xt(r,e){return r.architectures.length-e.architectures.length}function St(r){var e=r.split("."),t=e.pop(),s={file:r,specificity:0};if(t==="node"){for(var i=0;i<e.length;i++){var n=e[i];if(n==="node"||n==="electron"||n==="node-webkit")s.runtime=n;else if(n==="napi")s.napi=!0;else if(n.slice(0,3)==="abi")s.abi=n.slice(3);else if(n.slice(0,2)==="uv")s.uv=n.slice(2);else if(n.slice(0,4)==="armv")s.armv=n.slice(4);else if(n==="glibc"||n==="musl")s.libc=n;else continue;s.specificity++}return s}}function vt(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!qr(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==mt||t.armv&&t.armv!==we||t.libc&&t.libc!==pt)}}function qr(r){return r.runtime==="node"&&r.napi}function Et(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function Wr(){return!!(process.versions&&process.versions.nw)}function jr(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function Gr(r){return r==="linux"&&ut.existsSync("/etc/alpine-release")}O.parseTags=St;O.matchTags=vt;O.compareTags=Et;O.parseTuple=yt;O.matchTuple=gt;O.compareTuples=xt});var Ce=g((di,ke)=>{var Te=typeof __webpack_require__=="function"?__non_webpack_require__:p;typeof Te.addon=="function"?ke.exports=Te.addon.bind(Te):ke.exports=wt()});var Tt=g((pi,Ot)=>{"use strict";var $r=(r,e,t,s,i)=>{for(var n=0;n<i;n++)t[s+n]=r[n]^e[n&3]},Vr=(r,e)=>{let t=r.length;for(var s=0;s<t;s++)r[s]^=e[s&3]};Ot.exports={mask:$r,unmask:Vr}});var kt=g((mi,Ne)=>{"use strict";try{Ne.exports=Ce()(__dirname)}catch{Ne.exports=Tt()}});var Z=g((yi,oe)=>{"use strict";var{EMPTY_BUFFER:zr}=C(),Le=Buffer[Symbol.species];function Hr(r,e){if(r.length===0)return zr;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),s=0;for(let i=0;i<r.length;i++){let n=r[i];t.set(n,s),s+=n.length}return s<e?new Le(t.buffer,t.byteOffset,s):t}function Ct(r,e,t,s,i){for(let n=0;n<i;n++)t[s+n]=r[n]^e[n&3]}function Nt(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function Yr(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Pe(r){if(Pe.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Le(r):ArrayBuffer.isView(r)?e=new Le(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Pe.readOnly=!1),e}oe.exports={concat:Hr,mask:Ct,toArrayBuffer:Yr,toBuffer:Pe,unmask:Nt};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=kt();oe.exports.mask=function(e,t,s,i,n){n<48?Ct(e,t,s,i,n):r.mask(e,t,s,i,n)},oe.exports.unmask=function(e,t){e.length<32?Nt(e,t):r.unmask(e,t)}}catch{}});var Bt=g((gi,Pt)=>{"use strict";var Lt=Symbol("kDone"),Be=Symbol("kRun"),Re=class{constructor(e){this[Lt]=()=>{this.pending--,this[Be]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Be]()}[Be](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Lt])}}};Pt.exports=Re});var ee=g((xi,Dt)=>{"use strict";var Q=p("zlib"),Rt=Z(),Kr=Bt(),{kStatusCode:Ut}=C(),Xr=Buffer[Symbol.species],Zr=Buffer.from([0,0,255,255]),le=Symbol("permessage-deflate"),L=Symbol("total-length"),J=Symbol("callback"),R=Symbol("buffers"),fe=Symbol("error"),ae,Ue=class{constructor(e,t,s){if(this._maxPayload=s|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!ae){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ae=new Kr(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[J];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,s=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(s.server_no_context_takeover=!0),t.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(s.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?s.client_max_window_bits=t.clientMaxWindowBits:(s.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(s=>{let i=t[s];if(i.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(i=i[0],s==="client_max_window_bits"){if(i!==!0){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=n}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else if(s==="server_max_window_bits"){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw new TypeError(`Invalid value for parameter "${s}": ${i}`);i=n}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${i}`)}else throw new Error(`Unknown parameter "${s}"`);t[s]=i})}),e}decompress(e,t,s){ae.add(i=>{this._decompress(e,t,(n,o)=>{i(),s(n,o)})})}compress(e,t,s){ae.add(i=>{this._compress(e,t,(n,o)=>{i(),s(n,o)})})}_decompress(e,t,s){let i=this._isServer?"client":"server";if(!this._inflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?Q.Z_DEFAULT_WINDOWBITS:this.params[n];this._inflate=Q.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[le]=this,this._inflate[L]=0,this._inflate[R]=[],this._inflate.on("error",Jr),this._inflate.on("data",It)}this._inflate[J]=s,this._inflate.write(e),t&&this._inflate.write(Zr),this._inflate.flush(()=>{let n=this._inflate[fe];if(n){this._inflate.close(),this._inflate=null,s(n);return}let o=Rt.concat(this._inflate[R],this._inflate[L]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[L]=0,this._inflate[R]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),s(null,o)})}_compress(e,t,s){let i=this._isServer?"server":"client";if(!this._deflate){let n=`${i}_max_window_bits`,o=typeof this.params[n]!="number"?Q.Z_DEFAULT_WINDOWBITS:this.params[n];this._deflate=Q.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[L]=0,this._deflate[R]=[],this._deflate.on("data",Qr)}this._deflate[J]=s,this._deflate.write(e),this._deflate.flush(Q.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let n=Rt.concat(this._deflate[R],this._deflate[L]);t&&(n=new Xr(n.buffer,n.byteOffset,n.length-4)),this._deflate[J]=null,this._deflate[L]=0,this._deflate[R]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),s(null,n)})}};Dt.exports=Ue;function Qr(r){this[R].push(r),this[L]+=r.length}function It(r){if(this[L]+=r.length,this[le]._maxPayload<1||this[L]<=this[le]._maxPayload){this[R].push(r);return}this[fe]=new RangeError("Max payload size exceeded"),this[fe].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[fe][Ut]=1009,this.removeListener("data",It),this.reset()}function Jr(r){this[le]._inflate=null,r[Ut]=1007,this[J](r)}});var At=g((Si,Mt)=>{"use strict";function es(r){let e=r.length,t=0;for(;t<e;)if(!(r[t]&128))t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}Mt.exports=es});var Ft=g((vi,Ie)=>{"use strict";try{Ie.exports=Ce()(__dirname)}catch{Ie.exports=At()}});var j=g((Ei,ce)=>{"use strict";var{isUtf8:qt}=p("buffer"),{hasBlob:ts}=C(),rs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function ss(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function De(r){let e=r.length,t=0;for(;t<e;)if(!(r[t]&128))t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function is(r){return ts&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}ce.exports={isBlob:is,isValidStatusCode:ss,isValidUTF8:De,tokenChars:rs};if(qt)ce.exports.isValidUTF8=function(r){return r.length<24?De(r):qt(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Ft();ce.exports.isValidUTF8=function(e){return e.length<32?De(e):r(e)}}catch{}});var We=g((bi,Ht)=>{"use strict";var{Writable:ns}=p("stream"),Wt=ee(),{BINARY_TYPES:os,EMPTY_BUFFER:jt,kStatusCode:as,kWebSocket:fs}=C(),{concat:Me,toArrayBuffer:ls,unmask:cs}=Z(),{isValidStatusCode:hs,isValidUTF8:Gt}=j(),he=Buffer[Symbol.species],E=0,$t=1,Vt=2,zt=3,Ae=4,Fe=5,ue=6,qe=class extends ns{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||os[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[fs]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=E}_write(e,t,s){if(this._opcode===8&&this._state==E)return s();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(s)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new he(s.buffer,s.byteOffset+e,s.length-e),new he(s.buffer,s.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let s=this._buffers[0],i=t.length-e;e>=s.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(s.buffer,s.byteOffset,e),i),this._buffers[0]=new he(s.buffer,s.byteOffset+e,s.length-e)),e-=s.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case E:this.getInfo(e);break;case $t:this.getPayloadLength16(e);break;case Vt:this.getPayloadLength64(e);break;case zt:this.getMask();break;case Ae:this.getData(e);break;case Fe:case ue:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let s=(t[0]&64)===64;if(s&&!this._extensions[Wt.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(s){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(s){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=$t:this._payloadLength===127?this._state=Vt:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),s=t.readUInt32BE(0);if(s>Math.pow(2,53-32)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}this._payloadLength=s*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=zt:this._state=Ae}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ae}getData(e){let t=jt;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&cs(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Fe,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Wt.extensionName].decompress(e,this._fin,(i,n)=>{if(i)return t(i);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(n)}this.dataMessage(t),this._state===E&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=E;return}let t=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Me(s,t):this._binaryType==="arraybuffer"?i=ls(Me(s,t)):this._binaryType==="blob"?i=new Blob(s):i=s,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=E):(this._state=ue,setImmediate(()=>{this.emit("message",i,!0),this._state=E,this.startLoop(e)}))}else{let i=Me(s,t);if(!this._skipUTF8Validation&&!Gt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(n);return}this._state===Fe||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=E):(this._state=ue,setImmediate(()=>{this.emit("message",i,!1),this._state=E,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,jt),this.end();else{let s=e.readUInt16BE(0);if(!hs(s)){let n=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(n);return}let i=new he(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Gt(i)){let n=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(n);return}this._loop=!1,this.emit("conclude",s,i),this.end()}this._state=E;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=E):(this._state=ue,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=E,this.startLoop(t)}))}createError(e,t,s,i,n){this._loop=!1,this._errored=!0;let o=new e(s?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=n,o[as]=i,o}};Ht.exports=qe});var Ge=g((Oi,Xt)=>{"use strict";var{Duplex:wi}=p("stream"),{randomFillSync:us}=p("crypto"),Yt=ee(),{EMPTY_BUFFER:ds,kWebSocket:_s,NOOP:ps}=C(),{isBlob:G,isValidStatusCode:ms}=j(),{mask:Kt,toBuffer:I}=Z(),b=Symbol("kByteLength"),ys=Buffer.alloc(4),de=8*1024,D,$=de,w=0,gs=1,xs=2,T=class{constructor(e,t,s){this._extensions=t||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=w,this.onerror=ps,this[_s]=void 0}static frame(e,t){let s,i=!1,n=2,o=!1;t.mask&&(s=t.maskBuffer||ys,t.generateMask?t.generateMask(s):($===de&&(D===void 0&&(D=Buffer.alloc(de)),us(D,0,de),$=0),s[0]=D[$++],s[1]=D[$++],s[2]=D[$++],s[3]=D[$++]),o=(s[0]|s[1]|s[2]|s[3])===0,n=6);let f;typeof e=="string"?(!t.mask||o)&&t[b]!==void 0?f=t[b]:(e=Buffer.from(e),f=e.length):(f=e.length,i=t.mask&&t.readOnly&&!o);let l=f;f>=65536?(n+=8,l=127):f>125&&(n+=2,l=126);let a=Buffer.allocUnsafe(i?f+n:n);return a[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(a[0]|=64),a[1]=l,l===126?a.writeUInt16BE(f,2):l===127&&(a[2]=a[3]=0,a.writeUIntBE(f,4,6)),t.mask?(a[1]|=128,a[n-4]=s[0],a[n-3]=s[1],a[n-2]=s[2],a[n-1]=s[3],o?[a,e]:i?(Kt(e,s,a,n,f),[a]):(Kt(e,s,e,0,f),[a,e])):[a,e]}close(e,t,s,i){let n;if(e===void 0)n=ds;else{if(typeof e!="number"||!ms(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)n=Buffer.allocUnsafe(2),n.writeUInt16BE(e,0);else{let f=Buffer.byteLength(t);if(f>123)throw new RangeError("The message must not be greater than 123 bytes");n=Buffer.allocUnsafe(2+f),n.writeUInt16BE(e,0),typeof t=="string"?n.write(t,2):n.set(t,2)}}let o={[b]:n.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==w?this.enqueue([this.dispatch,n,!1,o,i]):this.sendFrame(T.frame(n,o),i)}ping(e,t,s){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):G(e)?(i=e.size,n=!1):(e=I(e),i=e.length,n=I.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[b]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:n,rsv1:!1};G(e)?this._state!==w?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==w?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(T.frame(e,o),s)}pong(e,t,s){let i,n;if(typeof e=="string"?(i=Buffer.byteLength(e),n=!1):G(e)?(i=e.size,n=!1):(e=I(e),i=e.length,n=I.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[b]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:n,rsv1:!1};G(e)?this._state!==w?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==w?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(T.frame(e,o),s)}send(e,t,s){let i=this._extensions[Yt.extensionName],n=t.binary?2:1,o=t.compress,f,l;typeof e=="string"?(f=Buffer.byteLength(e),l=!1):G(e)?(f=e.size,l=!1):(e=I(e),f=e.length,l=I.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=f>=i._threshold),this._compress=o):(o=!1,n=0),t.fin&&(this._firstFragment=!0);let a={[b]:f,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:n,readOnly:l,rsv1:o};G(e)?this._state!==w?this.enqueue([this.getBlobData,e,this._compress,a,s]):this.getBlobData(e,this._compress,a,s):this._state!==w?this.enqueue([this.dispatch,e,this._compress,a,s]):this.dispatch(e,this._compress,a,s)}getBlobData(e,t,s,i){this._bufferedBytes+=s[b],this._state=xs,e.arrayBuffer().then(n=>{if(this._socket.destroyed){let f=new Error("The socket was closed while the blob was being read");process.nextTick(je,this,f,i);return}this._bufferedBytes-=s[b];let o=I(n);t?this.dispatch(o,t,s,i):(this._state=w,this.sendFrame(T.frame(o,s),i),this.dequeue())}).catch(n=>{process.nextTick(Ss,this,n,i)})}dispatch(e,t,s,i){if(!t){this.sendFrame(T.frame(e,s),i);return}let n=this._extensions[Yt.extensionName];this._bufferedBytes+=s[b],this._state=gs,n.compress(e,s.fin,(o,f)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");je(this,l,i);return}this._bufferedBytes-=s[b],this._state=w,s.readOnly=!1,this.sendFrame(T.frame(f,s),i),this.dequeue()})}dequeue(){for(;this._state===w&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][b],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][b],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};Xt.exports=T;function je(r,e,t){typeof t=="function"&&t(e);for(let s=0;s<r._queue.length;s++){let i=r._queue[s],n=i[i.length-1];typeof n=="function"&&n(e)}}function Ss(r,e,t){je(r,e,t),r.onerror(e)}});var nr=g((Ti,ir)=>{"use strict";var{kForOnEventAttribute:te,kListener:$e}=C(),Zt=Symbol("kCode"),Qt=Symbol("kData"),Jt=Symbol("kError"),er=Symbol("kMessage"),tr=Symbol("kReason"),V=Symbol("kTarget"),rr=Symbol("kType"),sr=Symbol("kWasClean"),P=class{constructor(e){this[V]=null,this[rr]=e}get target(){return this[V]}get type(){return this[rr]}};Object.defineProperty(P.prototype,"target",{enumerable:!0});Object.defineProperty(P.prototype,"type",{enumerable:!0});var M=class extends P{constructor(e,t={}){super(e),this[Zt]=t.code===void 0?0:t.code,this[tr]=t.reason===void 0?"":t.reason,this[sr]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Zt]}get reason(){return this[tr]}get wasClean(){return this[sr]}};Object.defineProperty(M.prototype,"code",{enumerable:!0});Object.defineProperty(M.prototype,"reason",{enumerable:!0});Object.defineProperty(M.prototype,"wasClean",{enumerable:!0});var z=class extends P{constructor(e,t={}){super(e),this[Jt]=t.error===void 0?null:t.error,this[er]=t.message===void 0?"":t.message}get error(){return this[Jt]}get message(){return this[er]}};Object.defineProperty(z.prototype,"error",{enumerable:!0});Object.defineProperty(z.prototype,"message",{enumerable:!0});var re=class extends P{constructor(e,t={}){super(e),this[Qt]=t.data===void 0?null:t.data}get data(){return this[Qt]}};Object.defineProperty(re.prototype,"data",{enumerable:!0});var vs={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[te]&&i[$e]===e&&!i[te])return;let s;if(r==="message")s=function(n,o){let f=new re("message",{data:o?n:n.toString()});f[V]=this,_e(e,this,f)};else if(r==="close")s=function(n,o){let f=new M("close",{code:n,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[V]=this,_e(e,this,f)};else if(r==="error")s=function(n){let o=new z("error",{error:n,message:n.message});o[V]=this,_e(e,this,o)};else if(r==="open")s=function(){let n=new P("open");n[V]=this,_e(e,this,n)};else return;s[te]=!!t[te],s[$e]=e,t.once?this.once(r,s):this.on(r,s)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[$e]===e&&!t[te]){this.removeListener(r,t);break}}};ir.exports={CloseEvent:M,ErrorEvent:z,Event:P,EventTarget:vs,MessageEvent:re};function _e(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Ve=g((ki,or)=>{"use strict";var{tokenChars:se}=j();function k(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function Es(r){let e=Object.create(null),t=Object.create(null),s=!1,i=!1,n=!1,o,f,l=-1,a=-1,h=-1,u=0;for(;u<r.length;u++)if(a=r.charCodeAt(u),o===void 0)if(h===-1&&se[a]===1)l===-1&&(l=u);else if(u!==0&&(a===32||a===9))h===-1&&l!==-1&&(h=u);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${u}`);h===-1&&(h=u);let y=r.slice(l,h);a===44?(k(e,y,t),t=Object.create(null)):o=y,l=h=-1}else throw new SyntaxError(`Unexpected character at index ${u}`);else if(f===void 0)if(h===-1&&se[a]===1)l===-1&&(l=u);else if(a===32||a===9)h===-1&&l!==-1&&(h=u);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${u}`);h===-1&&(h=u),k(t,r.slice(l,h),!0),a===44&&(k(e,o,t),t=Object.create(null),o=void 0),l=h=-1}else if(a===61&&l!==-1&&h===-1)f=r.slice(l,u),l=h=-1;else throw new SyntaxError(`Unexpected character at index ${u}`);else if(i){if(se[a]!==1)throw new SyntaxError(`Unexpected character at index ${u}`);l===-1?l=u:s||(s=!0),i=!1}else if(n)if(se[a]===1)l===-1&&(l=u);else if(a===34&&l!==-1)n=!1,h=u;else if(a===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${u}`);else if(a===34&&r.charCodeAt(u-1)===61)n=!0;else if(h===-1&&se[a]===1)l===-1&&(l=u);else if(l!==-1&&(a===32||a===9))h===-1&&(h=u);else if(a===59||a===44){if(l===-1)throw new SyntaxError(`Unexpected character at index ${u}`);h===-1&&(h=u);let y=r.slice(l,h);s&&(y=y.replace(/\\/g,""),s=!1),k(t,f,y),a===44&&(k(e,o,t),t=Object.create(null),o=void 0),f=void 0,l=h=-1}else throw new SyntaxError(`Unexpected character at index ${u}`);if(l===-1||n||a===32||a===9)throw new SyntaxError("Unexpected end of input");h===-1&&(h=u);let _=r.slice(l,h);return o===void 0?k(e,_,t):(f===void 0?k(t,_,!0):s?k(t,f,_.replace(/\\/g,"")):k(t,f,_),k(e,o,t)),e}function bs(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(s=>[e].concat(Object.keys(s).map(i=>{let n=s[i];return Array.isArray(n)||(n=[n]),n.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}or.exports={format:bs,parse:Es}});var Xe=g((Li,gr)=>{"use strict";var ws=p("events"),Os=p("https"),Ts=p("http"),lr=p("net"),ks=p("tls"),{randomBytes:Cs,createHash:Ns}=p("crypto"),{Duplex:Ci,Readable:Ni}=p("stream"),{URL:ze}=p("url"),U=ee(),Ls=We(),Ps=Ge(),{isBlob:Bs}=j(),{BINARY_TYPES:ar,EMPTY_BUFFER:pe,GUID:Rs,kForOnEventAttribute:He,kListener:Us,kStatusCode:Is,kWebSocket:x,NOOP:cr}=C(),{EventTarget:{addEventListener:Ds,removeEventListener:Ms}}=nr(),{format:As,parse:Fs}=Ve(),{toBuffer:qs}=Z(),Ws=30*1e3,hr=Symbol("kAborted"),Ye=[8,13],B=["CONNECTING","OPEN","CLOSING","CLOSED"],js=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,c=class extends ws{constructor(e,t,s){super(),this._binaryType=ar[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=pe,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=c.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(s=t,t=[]):t=[t]),ur(this,e,t,s)):(this._autoPong=s.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){ar.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,t,s){let i=new Ls({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),n=new Ps(e,this._extensions,s.generateMask);this._receiver=i,this._sender=n,this._socket=e,i[x]=this,n[x]=this,e[x]=this,i.on("conclude",Vs),i.on("drain",zs),i.on("error",Hs),i.on("message",Ys),i.on("ping",Ks),i.on("pong",Xs),n.onerror=Zs,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",pr),e.on("data",ye),e.on("end",mr),e.on("error",yr),this._readyState=c.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=c.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[U.extensionName]&&this._extensions[U.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=c.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==c.CLOSED){if(this.readyState===c.CONNECTING){let s="WebSocket was closed before the connection was established";v(this,this._req,s);return}if(this.readyState===c.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=c.CLOSING,this._sender.close(e,t,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),_r(this)}}pause(){this.readyState===c.CONNECTING||this.readyState===c.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,s){if(this.readyState===c.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=t=void 0):typeof t=="function"&&(s=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==c.OPEN){Ke(this,e,s);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||pe,t,s)}pong(e,t,s){if(this.readyState===c.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=t=void 0):typeof t=="function"&&(s=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==c.OPEN){Ke(this,e,s);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||pe,t,s)}resume(){this.readyState===c.CONNECTING||this.readyState===c.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,s){if(this.readyState===c.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(s=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==c.OPEN){Ke(this,e,s);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[U.extensionName]||(i.compress=!1),this._sender.send(e||pe,i,s)}terminate(){if(this.readyState!==c.CLOSED){if(this.readyState===c.CONNECTING){let e="WebSocket was closed before the connection was established";v(this,this._req,e);return}this._socket&&(this._readyState=c.CLOSING,this._socket.destroy())}}};Object.defineProperty(c,"CONNECTING",{enumerable:!0,value:B.indexOf("CONNECTING")});Object.defineProperty(c.prototype,"CONNECTING",{enumerable:!0,value:B.indexOf("CONNECTING")});Object.defineProperty(c,"OPEN",{enumerable:!0,value:B.indexOf("OPEN")});Object.defineProperty(c.prototype,"OPEN",{enumerable:!0,value:B.indexOf("OPEN")});Object.defineProperty(c,"CLOSING",{enumerable:!0,value:B.indexOf("CLOSING")});Object.defineProperty(c.prototype,"CLOSING",{enumerable:!0,value:B.indexOf("CLOSING")});Object.defineProperty(c,"CLOSED",{enumerable:!0,value:B.indexOf("CLOSED")});Object.defineProperty(c.prototype,"CLOSED",{enumerable:!0,value:B.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(c.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(c.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[He])return e[Us];return null},set(e){for(let t of this.listeners(r))if(t[He]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[He]:!0})}})});c.prototype.addEventListener=Ds;c.prototype.removeEventListener=Ms;gr.exports=c;function ur(r,e,t,s){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Ye[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Ye.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ye.join(", ")})`);let n;if(e instanceof ze)n=e;else try{n=new ze(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),r._url=n.href;let o=n.protocol==="wss:",f=n.protocol==="ws+unix:",l;if(n.protocol!=="ws:"&&!o&&!f?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:f&&!n.pathname?l="The URL's pathname is empty":n.hash&&(l="The URL contains a fragment identifier"),l){let d=new SyntaxError(l);if(r._redirects===0)throw d;me(r,d);return}let a=o?443:80,h=Cs(16).toString("base64"),u=o?Os.request:Ts.request,_=new Set,y;if(i.createConnection=i.createConnection||(o?$s:Gs),i.defaultPort=i.defaultPort||a,i.port=n.port||a,i.host=n.hostname.startsWith("[")?n.hostname.slice(1,-1):n.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":h,Connection:"Upgrade",Upgrade:"websocket"},i.path=n.pathname+n.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new U(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=As({[U.extensionName]:y.offer()})),t.length){for(let d of t){if(typeof d!="string"||!js.test(d)||_.has(d))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(d)}i.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(n.username||n.password)&&(i.auth=`${n.username}:${n.password}`),f){let d=i.path.split(":");i.socketPath=d[0],i.path=d[1]}let m;if(i.followRedirects){if(r._redirects===0){r._originalIpc=f,r._originalSecure=o,r._originalHostOrSocketPath=f?i.socketPath:n.host;let d=s&&s.headers;if(s={...s,headers:{}},d)for(let[S,q]of Object.entries(d))s.headers[S.toLowerCase()]=q}else if(r.listenerCount("redirect")===0){let d=f?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:n.host===r._originalHostOrSocketPath;(!d||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,d||delete i.headers.host,i.auth=void 0)}i.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),m=r._req=u(i),r._redirects&&r.emit("redirect",r.url,m)}else m=r._req=u(i);i.timeout&&m.on("timeout",()=>{v(r,m,"Opening handshake has timed out")}),m.on("error",d=>{m===null||m[hr]||(m=r._req=null,me(r,d))}),m.on("response",d=>{let S=d.headers.location,q=d.statusCode;if(S&&i.followRedirects&&q>=300&&q<400){if(++r._redirects>i.maxRedirects){v(r,m,"Maximum redirects exceeded");return}m.abort();let Y;try{Y=new ze(S,e)}catch{let W=new SyntaxError(`Invalid URL: ${S}`);me(r,W);return}ur(r,Y,t,s)}else r.emit("unexpected-response",m,d)||v(r,m,`Unexpected server response: ${d.statusCode}`)}),m.on("upgrade",(d,S,q)=>{if(r.emit("upgrade",d),r.readyState!==c.CONNECTING)return;m=r._req=null;let Y=d.headers.upgrade;if(Y===void 0||Y.toLowerCase()!=="websocket"){v(r,S,"Invalid Upgrade header");return}let Je=Ns("sha1").update(h+Rs).digest("base64");if(d.headers["sec-websocket-accept"]!==Je){v(r,S,"Invalid Sec-WebSocket-Accept header");return}let W=d.headers["sec-websocket-protocol"],K;if(W!==void 0?_.size?_.has(W)||(K="Server sent an invalid subprotocol"):K="Server sent a subprotocol but none was requested":_.size&&(K="Server sent no subprotocol"),K){v(r,S,K);return}W&&(r._protocol=W);let et=d.headers["sec-websocket-extensions"];if(et!==void 0){if(!y){v(r,S,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let xe;try{xe=Fs(et)}catch{v(r,S,"Invalid Sec-WebSocket-Extensions header");return}let tt=Object.keys(xe);if(tt.length!==1||tt[0]!==U.extensionName){v(r,S,"Server indicated an extension that was not requested");return}try{y.accept(xe[U.extensionName])}catch{v(r,S,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[U.extensionName]=y}r.setSocket(S,q,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(m,r):m.end()}function me(r,e){r._readyState=c.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function Gs(r){return r.path=r.socketPath,lr.connect(r)}function $s(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=lr.isIP(r.host)?"":r.host),ks.connect(r)}function v(r,e,t){r._readyState=c.CLOSING;let s=new Error(t);Error.captureStackTrace(s,v),e.setHeader?(e[hr]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(me,r,s)):(e.destroy(s),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Ke(r,e,t){if(e){let s=Bs(e)?e.size:qs(e).length;r._socket?r._sender._bufferedBytes+=s:r._bufferedAmount+=s}if(t){let s=new Error(`WebSocket is not open: readyState ${r.readyState} (${B[r.readyState]})`);process.nextTick(t,s)}}function Vs(r,e){let t=this[x];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[x]!==void 0&&(t._socket.removeListener("data",ye),process.nextTick(dr,t._socket),r===1005?t.close():t.close(r,e))}function zs(){let r=this[x];r.isPaused||r._socket.resume()}function Hs(r){let e=this[x];e._socket[x]!==void 0&&(e._socket.removeListener("data",ye),process.nextTick(dr,e._socket),e.close(r[Is])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function fr(){this[x].emitClose()}function Ys(r,e){this[x].emit("message",r,e)}function Ks(r){let e=this[x];e._autoPong&&e.pong(r,!this._isServer,cr),e.emit("ping",r)}function Xs(r){this[x].emit("pong",r)}function dr(r){r.resume()}function Zs(r){let e=this[x];e.readyState!==c.CLOSED&&(e.readyState===c.OPEN&&(e._readyState=c.CLOSING,_r(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function _r(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),Ws)}function pr(){let r=this[x];this.removeListener("close",pr),this.removeListener("data",ye),this.removeListener("end",mr),r._readyState=c.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[x]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",fr),r._receiver.on("finish",fr))}function ye(r){this[x]._receiver.write(r)||this.pause()}function mr(){let r=this[x];r._readyState=c.CLOSING,r._receiver.end(),this.end()}function yr(){let r=this[x];this.removeListener("error",yr),this.on("error",cr),r&&(r._readyState=c.CLOSING,this.destroy())}});var Sr=g((Pi,xr)=>{"use strict";var{tokenChars:Qs}=j();function Js(r){let e=new Set,t=-1,s=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(s===-1&&Qs[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))s===-1&&t!==-1&&(s=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);s===-1&&(s=i);let f=r.slice(t,s);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);e.add(f),t=s=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let n=r.slice(t,i);if(e.has(n))throw new SyntaxError(`The "${n}" subprotocol is duplicated`);return e.add(n),e}xr.exports={parse:Js}});var kr=g((Ri,Tr)=>{"use strict";var ei=p("events"),ge=p("http"),{Duplex:Bi}=p("stream"),{createHash:ti}=p("crypto"),vr=Ve(),A=ee(),ri=Sr(),si=Xe(),{GUID:ii,kWebSocket:ni}=C(),oi=/^[+/0-9A-Za-z]{22}==$/,Er=0,br=1,Or=2,Ze=class extends ei{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:si,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=ge.createServer((s,i)=>{let n=ge.STATUS_CODES[426];i.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),i.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=ai(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,n,o)=>{this.handleUpgrade(i,n,o,s)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Er}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Or){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(ie,this);return}if(e&&this.once("close",e),this._state!==br)if(this._state=br,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ie,this):process.nextTick(ie,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{ie(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,s,i){t.on("error",wr);let n=e.headers["sec-websocket-key"],o=e.headers.upgrade,f=+e.headers["sec-websocket-version"];if(e.method!=="GET"){F(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){F(this,e,t,400,"Invalid Upgrade header");return}if(n===void 0||!oi.test(n)){F(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(f!==8&&f!==13){F(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){ne(t,400);return}let l=e.headers["sec-websocket-protocol"],a=new Set;if(l!==void 0)try{a=ri.parse(l)}catch{F(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let h=e.headers["sec-websocket-extensions"],u={};if(this.options.perMessageDeflate&&h!==void 0){let _=new A(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=vr.parse(h);y[A.extensionName]&&(_.accept(y[A.extensionName]),u[A.extensionName]=_)}catch{F(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={origin:e.headers[`${f===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(_,(y,m,d,S)=>{if(!y)return ne(t,m||401,d,S);this.completeUpgrade(u,n,a,e,t,s,i)});return}if(!this.options.verifyClient(_))return ne(t,401)}this.completeUpgrade(u,n,a,e,t,s,i)}completeUpgrade(e,t,s,i,n,o,f){if(!n.readable||!n.writable)return n.destroy();if(n[ni])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Er)return ne(n,503);let a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${ti("sha1").update(t+ii).digest("base64")}`],h=new this.options.WebSocket(null,void 0,this.options);if(s.size){let u=this.options.handleProtocols?this.options.handleProtocols(s,i):s.values().next().value;u&&(a.push(`Sec-WebSocket-Protocol: ${u}`),h._protocol=u)}if(e[A.extensionName]){let u=e[A.extensionName].params,_=vr.format({[A.extensionName]:[u]});a.push(`Sec-WebSocket-Extensions: ${_}`),h._extensions=e}this.emit("headers",a,i),n.write(a.concat(`\r
|
|
4
|
-
`).join(`\r
|
|
5
|
-
`)),n.removeListener("error",wr),h.setSocket(n,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(h),h.on("close",()=>{this.clients.delete(h),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ie,this)})),f(h,i)}};Tr.exports=Ze;function ai(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let s of Object.keys(e))r.removeListener(s,e[s])}}function ie(r){r._state=Or,r.emit("close")}function wr(){this.destroy()}function ne(r,e,t,s){t=t||ge.STATUS_CODES[e],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...s},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${ge.STATUS_CODES[e]}\r
|
|
6
|
-
`+Object.keys(s).map(i=>`${i}: ${s[i]}`).join(`\r
|
|
7
|
-
`)+`\r
|
|
8
|
-
\r
|
|
9
|
-
`+t)}function F(r,e,t,s,i){if(r.listenerCount("wsClientError")){let n=new Error(i);Error.captureStackTrace(n,F),r.emit("wsClientError",n,t,e)}else ne(t,s,i)}});var Qe={};Ur(Qe,{Receiver:()=>Nr.default,Sender:()=>Lr.default,WebSocket:()=>H.default,WebSocketServer:()=>Pr.default,createWebSocketStream:()=>Cr.default,default:()=>fi});var Cr=X(nt(),1),Nr=X(We(),1),Lr=X(Ge(),1),H=X(Xe(),1),Pr=X(kr(),1);var fi=H.default;function Br(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}var Di=(()=>{try{return Br()}catch{return H.default?H.default:Qe}})();export{Di as WebSocket};
|
|
10
|
-
//# sourceMappingURL=_esm-DCAC27XZ.js.map
|
package/dist/ccip-GJX6Z7AD.js
DELETED
package/dist/chunk-AU25RBDM.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{a as Tt,b as an,d as Bt,e as un,f as cn,i as kt,j as zt,k as pn,m as dn,n as fn,o as mn}from"./chunk-QBDELX7C.js";var ln="1.0.6";var b=class extends Error{constructor(t,n={}){let r=n.cause instanceof b?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof b&&n.cause.docsPath||n.docsPath,i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${ln}`].join(`
|
|
2
|
-
`);super(i),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function $(e,t){return e.exec(t)?.groups}var Ot=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Ct=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Se=/^\(.+?\).*?$/;var yn=/^tuple(?<array>(\[(\d*)\])*)$/;function Ee(e){let t=e.type;if(yn.test(e.type)&&"components"in e){t="(";let n=e.components.length;for(let o=0;o<n;o++){let i=e.components[o];t+=Ee(i),o<n-1&&(t+=", ")}let r=$(yn,e.type);return t+=`)${r?.array??""}`,Ee({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function W(e){let t="",n=e.length;for(let r=0;r<n;r++){let o=e[r];t+=Ee(o),r!==n-1&&(t+=", ")}return t}function Rt(e){return e.type==="function"?`function ${e.name}(${W(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${W(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${W(e.inputs)})`:e.type==="error"?`error ${e.name}(${W(e.inputs)})`:e.type==="constructor"?`constructor(${W(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}var bn=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function hn(e){return bn.test(e)}function xn(e){return $(bn,e)}var gn=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function wn(e){return gn.test(e)}function vn(e){return $(gn,e)}var $n=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function An(e){return $n.test(e)}function Pn(e){return $($n,e)}var In=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Te(e){return In.test(e)}function Mn(e){return $(In,e)}var Sn=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function En(e){return Sn.test(e)}function Tn(e){return $(Sn,e)}var Gr=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Bn(e){return Gr.test(e)}var Vr=/^receive\(\) external payable$/;function kn(e){return Vr.test(e)}var zn=new Set(["indexed"]),Be=new Set(["calldata","memory","storage"]);var ke=class extends b{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},ze=class extends b{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}};var Oe=class extends b{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},Ce=class extends b{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},Re=class extends b{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},je=class extends b{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},Ue=class extends b{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}};var T=class extends b{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},Fe=class extends b{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},Le=class extends b{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}};var De=class extends b{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}};var Ne=class extends b{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}};function On(e,t){return t?`${t}:${e}`:e}var He=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Cn(e,t={}){if(An(e)){let n=Pn(e);if(!n)throw new T({signature:e,type:"function"});let r=M(n.parameters),o=[],i=r.length;for(let a=0;a<i;a++)o.push(R(r[a],{modifiers:Be,structs:t,type:"function"}));let s=[];if(n.returns){let a=M(n.returns),c=a.length;for(let p=0;p<c;p++)s.push(R(a[p],{modifiers:Be,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:s}}if(wn(e)){let n=vn(e);if(!n)throw new T({signature:e,type:"event"});let r=M(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(R(r[s],{modifiers:zn,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}if(hn(e)){let n=xn(e);if(!n)throw new T({signature:e,type:"error"});let r=M(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(R(r[s],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}if(En(e)){let n=Tn(e);if(!n)throw new T({signature:e,type:"constructor"});let r=M(n.parameters),o=[],i=r.length;for(let s=0;s<i;s++)o.push(R(r[s],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}if(Bn(e))return{type:"fallback"};if(kn(e))return{type:"receive",stateMutability:"payable"};throw new Fe({signature:e})}var Wr=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Zr=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Kr=/^u?int$/;function R(e,t){let n=On(e,t?.type);if(He.has(n))return He.get(n);let r=Se.test(e),o=$(r?Zr:Wr,e);if(!o)throw new Oe({param:e});if(o.name&&Jr(o.name))throw new Ce({param:e,name:o.name});let i=o.name?{name:o.name}:{},s=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},c,p={};if(r){c="tuple";let f=M(o.type),l=[],m=f.length;for(let h=0;h<m;h++)l.push(R(f[h],{structs:a}));p={components:l}}else if(o.type in a)c="tuple",p={components:a[o.type]};else if(Kr.test(o.type))c=`${o.type}256`;else if(c=o.type,t?.type!=="struct"&&!jt(c))throw new ze({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new Re({param:e,type:t?.type,modifier:o.modifier});if(Be.has(o.modifier)&&!Yr(c,!!o.array))throw new je({param:e,type:t?.type,modifier:o.modifier})}let d={type:`${c}${o.array??""}`,...i,...s,...p};return He.set(n,d),d}function M(e,t=[],n="",r=0){let o=e.trim().length;for(let i=0;i<o;i++){let s=e[i],a=e.slice(i+1);switch(s){case",":return r===0?M(a,[...t,n.trim()]):M(a,t,`${n}${s}`,r);case"(":return M(a,t,`${n}${s}`,r+1);case")":return M(a,t,`${n}${s}`,r-1);default:return M(a,t,`${n}${s}`,r)}}if(n==="")return t;if(r!==0)throw new Ne({current:n,depth:r});return t.push(n.trim()),t}function jt(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Ot.test(e)||Ct.test(e)}var Xr=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function Jr(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Ot.test(e)||Ct.test(e)||Xr.test(e)}function Yr(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Rn(e){let t={},n=e.length;for(let s=0;s<n;s++){let a=e[s];if(!Te(a))continue;let c=Mn(a);if(!c)throw new T({signature:a,type:"struct"});let p=c.properties.split(";"),d=[],f=p.length;for(let l=0;l<f;l++){let h=p[l].trim();if(!h)continue;let g=R(h,{type:"struct"});d.push(g)}if(!d.length)throw new Le({signature:a});t[c.name]=d}let r={},o=Object.entries(t),i=o.length;for(let s=0;s<i;s++){let[a,c]=o[s];r[a]=jn(c,t)}return r}var qr=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function jn(e,t,n=new Set){let r=[],o=e.length;for(let i=0;i<o;i++){let s=e[i];if(Se.test(s.type))r.push(s);else{let c=$(qr,s.type);if(!c?.type)throw new Ue({abiParameter:s});let{array:p,type:d}=c;if(d in t){if(n.has(d))throw new De({type:d});r.push({...s,type:`tuple${p??""}`,components:jn(t[d]??[],t,new Set([...n,d]))})}else if(jt(d))r.push(s);else throw new ke({type:d})}}return r}function _e(e){let t=Rn(e),n=[],r=e.length;for(let o=0;o<r;o++){let i=e[o];Te(i)||n.push(Cn(i,t))}return n}function Z(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var Ut=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Un=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Ds=[...Un,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Ns=[...Un,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}];var Fn="0x82ad56cb";var Ln="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Dn="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";var Ft="2.21.19";var Lt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:Ft};var u=class extends Error{constructor(t,n={}){let r=(()=>n.cause instanceof u?n.cause.details:n.cause?.message?n.cause.message:n.details)(),o=(()=>n.cause instanceof u&&n.cause.docsPath||n.docsPath)(),i=Lt.getDocsUrl?.({...n,docsPath:o}),s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...Lt.version?[`Version: ${Lt.version}`]:[]].join(`
|
|
3
|
-
`);super(s,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Ft}walk(t){return Nn(this,t)}};function Nn(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e?Nn(e.cause,t):t?null:e}var H=class extends u{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}};var fe=class extends u{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}};var Hn={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},_n={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function _(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Ve(e.type);return`${e.name}(${Ge(e.inputs,{includeName:t})})`}function Ge(e,{includeName:t=!1}={}){return e?e.map(n=>Qr(n,{includeName:t})).join(t?", ":","):""}function Qr(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ge(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function A(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function x(e){return A(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var We=class extends u{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
4
|
-
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}},me=class extends u{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
5
|
-
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}};var Ze=class extends u{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
6
|
-
`),{metaMessages:[`Params: (${Ge(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}},K=class extends u{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}},Ke=class extends u{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
|
|
7
|
-
`),{name:"AbiEncodingArrayLengthMismatchError"})}},Xe=class extends u{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${x(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},Je=class extends u{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
|
|
8
|
-
`),{name:"AbiEncodingLengthMismatchError"})}};var Ye=class extends u{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
|
|
9
|
-
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}};var j=class extends u{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
10
|
-
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}},qe=class extends u{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
11
|
-
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}};var Qe=class extends u{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${_(t.abiItem)}\`, and`,`\`${n.type}\` in \`${_(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}};var et=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
12
|
-
`),{docsPath:n,name:"InvalidAbiEncodingType"})}},tt=class extends u{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
13
|
-
`),{docsPath:n,name:"InvalidAbiDecodingType"})}},nt=class extends u{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
14
|
-
`),{name:"InvalidArrayError"})}},Ve=class extends u{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
15
|
-
`),{name:"InvalidDefinitionTypeError"})}};var le=class extends u{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},ye=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}},be=class extends u{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}};function G(e,t,n,{strict:r}={}){return A(e,{strict:!1})?eo(e,t,n,{strict:r}):Dt(e,t,n,{strict:r})}function Gn(e,t){if(typeof t=="number"&&t>0&&t>x(e)-1)throw new le({offset:t,position:"start",size:x(e)})}function Vn(e,t,n){if(typeof t=="number"&&typeof n=="number"&&x(e)!==n-t)throw new le({offset:n,position:"end",size:x(e)})}function Dt(e,t,n,{strict:r}={}){Gn(e,t);let o=e.slice(t,n);return r&&Vn(o,t,n),o}function eo(e,t,n,{strict:r}={}){Gn(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Vn(o,t,n),o}function U(e,{dir:t,size:n=32}={}){return typeof e=="string"?B(e,{dir:t,size:n}):to(e,{dir:t,size:n})}function B(e,{dir:t,size:n=32}={}){if(n===null)return e;let r=e.replace("0x","");if(r.length>n*2)throw new ye({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function to(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ye({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let o=0;o<n;o++){let i=t==="right";r[i?o:n-o-1]=e[i?o:e.length-o-1]}return r}var rt=class extends u{constructor({max:t,min:n,signed:r,size:o,value:i}){super(`Number "${i}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},ot=class extends u{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};var st=class extends u{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function he(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function v(e,{size:t}){if(x(e)>t)throw new st({givenSize:x(e),maxSize:t})}function Nt(e,t={}){let{signed:n}=t;t.size&&v(e,{size:t.size});let r=BigInt(e);if(!n)return r;let o=(e.length-2)/2,i=(1n<<BigInt(o)*8n-1n)-1n;return r<=i?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Wn(e,t={}){return Number(Nt(e,t))}var no=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Zn(e,t={}){return typeof e=="number"||typeof e=="bigint"?y(e,t):typeof e=="string"?_t(e,t):typeof e=="boolean"?Ht(e,t):P(e,t)}function Ht(e,t={}){let n=`0x${Number(e)}`;return typeof t.size=="number"?(v(n,{size:t.size}),U(n,{size:t.size})):n}function P(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=no[e[o]];let r=`0x${n}`;return typeof t.size=="number"?(v(r,{size:t.size}),U(r,{dir:"right",size:t.size})):r}function y(e,t={}){let{signed:n,size:r}=t,o=BigInt(e),i;r?n?i=(1n<<BigInt(r)*8n-1n)-1n:i=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof i=="bigint"&&n?-i-1n:0;if(i&&o>i||o<s){let c=typeof e=="bigint"?"n":"";throw new rt({max:i?`${i}${c}`:void 0,min:`${s}${c}`,signed:n,size:r,value:`${e}${c}`})}let a=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?U(a,{size:r}):a}var ro=new TextEncoder;function _t(e,t={}){let n=ro.encode(e);return P(n,t)}var oo=new TextEncoder;function it(e,t={}){return typeof e=="number"||typeof e=="bigint"?io(e,t):typeof e=="boolean"?so(e,t):A(e)?at(e,t):Gt(e,t)}function so(e,t={}){let n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(v(n,{size:t.size}),U(n,{size:t.size})):n}var k={zero:48,nine:57,A:65,F:70,a:97,f:102};function Kn(e){if(e>=k.zero&&e<=k.nine)return e-k.zero;if(e>=k.A&&e<=k.F)return e-(k.A-10);if(e>=k.a&&e<=k.f)return e-(k.a-10)}function at(e,t={}){let n=e;t.size&&(v(n,{size:t.size}),n=U(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);let o=r.length/2,i=new Uint8Array(o);for(let s=0,a=0;s<o;s++){let c=Kn(r.charCodeAt(a++)),p=Kn(r.charCodeAt(a++));if(c===void 0||p===void 0)throw new u(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);i[s]=c*16+p}return i}function io(e,t){let n=y(e,t);return at(n)}function Gt(e,t={}){let n=oo.encode(e);return typeof t.size=="number"?(v(n,{size:t.size}),U(n,{dir:"right",size:t.size})):n}var ut=BigInt(4294967295),Xn=BigInt(32);function ao(e,t=!1){return t?{h:Number(e&ut),l:Number(e>>Xn&ut)}:{h:Number(e>>Xn&ut)|0,l:Number(e&ut)|0}}function Jn(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:i,l:s}=ao(e[o],t);[n[o],r[o]]=[i,s]}return[n,r]}var Yn=(e,t,n)=>e<<n|t>>>32-n,qn=(e,t,n)=>t<<n|e>>>32-n,Qn=(e,t,n)=>t<<n-32|e>>>64-n,er=(e,t,n)=>e<<n-32|t>>>64-n;var rr=[],or=[],sr=[],uo=BigInt(0),xe=BigInt(1),co=BigInt(2),po=BigInt(7),fo=BigInt(256),mo=BigInt(113);for(let e=0,t=xe,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],rr.push(2*(5*r+n)),or.push((e+1)*(e+2)/2%64);let o=uo;for(let i=0;i<7;i++)t=(t<<xe^(t>>po)*mo)%fo,t&co&&(o^=xe<<(xe<<BigInt(i))-xe);sr.push(o)}var[lo,yo]=Jn(sr,!0),tr=(e,t,n)=>n>32?Qn(e,t,n):Yn(e,t,n),nr=(e,t,n)=>n>32?er(e,t,n):qn(e,t,n);function bo(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,p=n[c],d=n[c+1],f=tr(p,d,1)^n[a],l=nr(p,d,1)^n[a+1];for(let m=0;m<50;m+=10)e[s+m]^=f,e[s+m+1]^=l}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=or[s],c=tr(o,i,a),p=nr(o,i,a),d=rr[s];o=e[d],i=e[d+1],e[d]=c,e[d+1]=p}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=lo[r],e[1]^=yo[r]}n.fill(0)}var X=class extends dn{constructor(t,n,r,o=!1,i=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Tt(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=cn(this.state)}keccak(){kt||zt(this.state32),bo(this.state32,this.rounds),kt||zt(this.state32),this.posOut=0,this.pos=0}update(t){Bt(this);let{blockLen:n,state:r}=this;t=pn(t);let o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){Bt(this,!1),an(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Tt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(un(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new X(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},F=(e,t,n)=>fn(()=>new X(t,e,n)),Ri=F(6,144,224/8),ji=F(6,136,256/8),Ui=F(6,104,384/8),Fi=F(6,72,512/8),Li=F(1,144,224/8),ir=F(1,136,256/8),Di=F(1,104,384/8),Ni=F(1,72,512/8),ar=(e,t,n)=>mn((r={})=>new X(t,e,r.dkLen===void 0?n:r.dkLen,!0)),Hi=ar(31,168,128/8),_i=ar(31,136,256/8);function ct(e,t){let n=t||"hex",r=ir(A(e,{strict:!1})?it(e):e);return n==="bytes"?r:Zn(r)}var ho=e=>ct(it(e));function ur(e){return ho(e)}function cr(e){let t=!0,n="",r=0,o="",i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){i=!0;break}continue}if(a===" "){e[s-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=a,n+=a}}if(!i)throw new u("Unable to normalize signature.");return o}var pr=e=>{let t=(()=>typeof e=="string"?e:Rt(e))();return cr(t)};function pt(e){return ur(pr(e))}var J=e=>G(pt(e),0,4);var I=class extends u{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}};var Y=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){let r=this.keys().next().value;r&&this.delete(r)}return this}};var xo=/^0x[a-fA-F0-9]{40}$/,Vt=new Y(8192);function w(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if(Vt.has(r))return Vt.get(r);let o=(()=>xo.test(e)?e.toLowerCase()===e?!0:n?dt(e)===e:!0:!1)();return Vt.set(r,o),o}var Wt=new Y(8192);function dt(e,t){if(Wt.has(`${e}.${t}`))return Wt.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=ct(Gt(n),"bytes"),o=(t?n.substring(`${t}0x`.length):n).split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&o[s]&&(o[s]=o[s].toUpperCase()),(r[s>>1]&15)>=8&&o[s+1]&&(o[s+1]=o[s+1].toUpperCase());let i=`0x${o.join("")}`;return Wt.set(`${e}.${t}`,i),i}var ge=class extends u{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},ft=class extends u{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},mt=class extends u{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};var go={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new mt({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ft({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ge({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ge({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function dr(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(go);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function fr(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=P(e,t);return Nt(n,t)}function mr(e,t={}){let n=e;if(typeof t.size<"u"&&(v(n,{size:t.size}),n=he(n)),n.length>1||n[0]>1)throw new ot(n);return!!n[0]}function E(e,t={}){typeof t.size<"u"&&v(e,{size:t.size});let n=P(e,t);return Wn(n,t)}function lr(e,t={}){let n=e;return typeof t.size<"u"&&(v(n,{size:t.size}),n=he(n,{dir:"right"})),new TextDecoder().decode(n)}function z(e){return typeof e[0]=="string"?we(e):wo(e)}function wo(e){let t=0;for(let o of e)t+=o.length;let n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function we(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function q(e,t){if(e.length!==t.length)throw new Je({expectedLength:e.length,givenLength:t.length});let n=vo({params:e,values:t}),r=Kt(n);return r.length===0?"0x":r}function vo({params:e,values:t}){let n=[];for(let r=0;r<e.length;r++)n.push(Zt({param:e[r],value:t[r]}));return n}function Zt({param:e,value:t}){let n=lt(e.type);if(n){let[r,o]=n;return Ao(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return Eo(t,{param:e});if(e.type==="address")return $o(t);if(e.type==="bool")return Io(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let r=e.type.startsWith("int");return Mo(t,{signed:r})}if(e.type.startsWith("bytes"))return Po(t,{param:e});if(e.type==="string")return So(t);throw new et(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Kt(e){let t=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?t+=32:t+=x(a)}let n=[],r=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?(n.push(y(t+o,{size:32})),r.push(a),o+=x(a)):n.push(a)}return z([...n,...r])}function $o(e){if(!w(e))throw new I({address:e});return{dynamic:!1,encoded:B(e.toLowerCase())}}function Ao(e,{length:t,param:n}){let r=t===null;if(!Array.isArray(e))throw new nt(e);if(!r&&e.length!==t)throw new Ke({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1,i=[];for(let s=0;s<e.length;s++){let a=Zt({param:n,value:e[s]});a.dynamic&&(o=!0),i.push(a)}if(r||o){let s=Kt(i);if(r){let a=y(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?z([a,s]):a}}if(o)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:z(i.map(({encoded:s})=>s))}}function Po(e,{param:t}){let[,n]=t.type.split("bytes"),r=x(e);if(!n){let o=e;return r%32!==0&&(o=B(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:z([B(y(r,{size:32})),o])}}if(r!==Number.parseInt(n))throw new Xe({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:B(e,{dir:"right"})}}function Io(e){if(typeof e!="boolean")throw new u(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:B(Ht(e))}}function Mo(e,{signed:t}){return{dynamic:!1,encoded:y(e,{size:32,signed:t})}}function So(e){let t=_t(e),n=Math.ceil(x(t)/32),r=[];for(let o=0;o<n;o++)r.push(B(G(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:z([B(y(x(t),{size:32})),...r])}}function Eo(e,{param:t}){let n=!1,r=[];for(let o=0;o<t.components.length;o++){let i=t.components[o],s=Array.isArray(e)?o:i.name,a=Zt({param:i,value:e[s]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Kt(r):z(r.map(({encoded:o})=>o))}}function lt(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function yt(e,t){let n=typeof t=="string"?at(t):t,r=dr(n);if(x(n)===0&&e.length>0)throw new K;if(x(t)&&x(t)<32)throw new Ze({data:typeof t=="string"?t:P(t),params:e,size:x(t)});let o=0,i=[];for(let s=0;s<e.length;++s){let a=e[s];r.setPosition(o);let[c,p]=Q(r,a,{staticPosition:0});o+=p,i.push(c)}return i}function Q(e,t,{staticPosition:n}){let r=lt(t.type);if(r){let[o,i]=r;return Bo(e,{...t,type:i},{length:o,staticPosition:n})}if(t.type==="tuple")return Co(e,t,{staticPosition:n});if(t.type==="address")return To(e);if(t.type==="bool")return ko(e);if(t.type.startsWith("bytes"))return zo(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Oo(e,t);if(t.type==="string")return Ro(e,{staticPosition:n});throw new tt(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}var yr=32,Xt=32;function To(e){let t=e.readBytes(32);return[dt(P(Dt(t,-20))),32]}function Bo(e,t,{length:n,staticPosition:r}){if(!n){let s=E(e.readBytes(Xt)),a=r+s,c=a+yr;e.setPosition(a);let p=E(e.readBytes(yr)),d=ve(t),f=0,l=[];for(let m=0;m<p;++m){e.setPosition(c+(d?m*32:f));let[h,g]=Q(e,t,{staticPosition:c});f+=g,l.push(h)}return e.setPosition(r+32),[l,32]}if(ve(t)){let s=E(e.readBytes(Xt)),a=r+s,c=[];for(let p=0;p<n;++p){e.setPosition(a+p*32);let[d]=Q(e,t,{staticPosition:a});c.push(d)}return e.setPosition(r+32),[c,32]}let o=0,i=[];for(let s=0;s<n;++s){let[a,c]=Q(e,t,{staticPosition:r+o});o+=c,i.push(a)}return[i,o]}function ko(e){return[mr(e.readBytes(32),{size:32}),32]}function zo(e,t,{staticPosition:n}){let[r,o]=t.type.split("bytes");if(!o){let s=E(e.readBytes(32));e.setPosition(n+s);let a=E(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];let c=e.readBytes(a);return e.setPosition(n+32),[P(c),32]}return[P(e.readBytes(Number.parseInt(o),32)),32]}function Oo(e,t){let n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),o=e.readBytes(32);return[r>48?fr(o,{signed:n}):E(o,{signed:n}),32]}function Co(e,t,{staticPosition:n}){let r=t.components.length===0||t.components.some(({name:s})=>!s),o=r?[]:{},i=0;if(ve(t)){let s=E(e.readBytes(Xt)),a=n+s;for(let c=0;c<t.components.length;++c){let p=t.components[c];e.setPosition(a+i);let[d,f]=Q(e,p,{staticPosition:a});i+=f,o[r?c:p?.name]=d}return e.setPosition(n+32),[o,32]}for(let s=0;s<t.components.length;++s){let a=t.components[s],[c,p]=Q(e,a,{staticPosition:n});o[r?s:a?.name]=c,i+=p}return[o,i]}function Ro(e,{staticPosition:t}){let n=E(e.readBytes(32)),r=t+n;e.setPosition(r);let o=E(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let i=e.readBytes(o,32),s=lr(he(i));return e.setPosition(t+32),[s,32]}function ve(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(ve);let n=lt(e.type);return!!(n&&ve({...e,type:n[1]}))}function br(e){let{abi:t,data:n}=e,r=G(n,0,4);if(r==="0x")throw new K;let i=[...t||[],Hn,_n].find(s=>s.type==="error"&&r===J(_(s)));if(!i)throw new Ye(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?yt(i.inputs,G(n,4)):void 0,errorName:i.name}}var ee=(e,t,n)=>JSON.stringify(e,(r,o)=>{let i=typeof o=="bigint"?o.toString():o;return typeof t=="function"?t(r,i):i},n);var hr=pt;function bt(e){let{abi:t,args:n=[],name:r}=e,o=A(r,{strict:!1}),i=t.filter(a=>o?a.type==="function"?J(a)===r:a.type==="event"?hr(a)===r:!1:"name"in a&&a.name===r);if(i.length===0)return;if(i.length===1)return i[0];let s;for(let a of i){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((p,d)=>{let f="inputs"in a&&a.inputs[d];return f?Jt(p,f):!1})){if(s&&"inputs"in s&&s.inputs){let p=xr(a.inputs,s.inputs,n);if(p)throw new Qe({abiItem:a,type:p[0]},{abiItem:s,type:p[1]})}s=a}}return s||i[0]}function Jt(e,t){let n=typeof e,r=t.type;switch(r){case"address":return w(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>Jt(Object.values(e)[i],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Jt(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function xr(e,t,n){for(let r in e){let o=e[r],i=t[r];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return xr(o.components,i.components,n[r]);let s=[o.type,i.type];if((()=>s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?w(n[r],{strict:!1}):s.includes("address")&&s.includes("bytes")?w(n[r],{strict:!1}):!1)())return s}}var gr={gwei:9,wei:18},wr={ether:-9,wei:9};function ht(e,t){let n=e.toString(),r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,i]=[n.slice(0,n.length-t),n.slice(n.length-t)];return i=i.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${i?`.${i}`:""}`}function vr(e,t="wei"){return ht(e,gr[t])}function O(e,t="wei"){return ht(e,wr[t])}var xt=class extends u{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}},gt=class extends u{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}};function $r(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
16
|
-
`,"")}function Ar(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
|
|
17
|
-
`;return r.nonce&&(o+=` nonce: ${r.nonce}
|
|
18
|
-
`),r.balance&&(o+=` balance: ${r.balance}
|
|
19
|
-
`),r.code&&(o+=` code: ${r.code}
|
|
20
|
-
`),r.state&&(o+=` state:
|
|
21
|
-
`,o+=$r(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
22
|
-
`,o+=$r(r.stateDiff)),o},` State Override:
|
|
23
|
-
`).slice(0,-1)}function Pr(e){let t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
|
|
24
|
-
`)}var wt=class extends u{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
|
|
25
|
-
`),{name:"FeeConflictError"})}};var $e=e=>e;var vt=class extends u{constructor(t,{account:n,docsPath:r,chain:o,data:i,gas:s,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:p,nonce:d,to:f,value:l,stateOverride:m}){let h=n?Z(n):void 0,g=Pr({from:h?.address,to:f,value:typeof l<"u"&&`${vr(l)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:typeof a<"u"&&`${O(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${O(c)} gwei`,maxPriorityFeePerGas:typeof p<"u"&&`${O(p)} gwei`,nonce:d});m&&(g+=`
|
|
26
|
-
${Ar(m)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}};var $t=class extends u{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}},At=class extends u{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}};var Yt="/docs/contract/decodeFunctionResult";function Ir(e){let{abi:t,args:n,functionName:r,data:o}=e,i=t[0];if(r){let a=bt({abi:t,args:n,name:r});if(!a)throw new j(r,{docsPath:Yt});i=a}if(i.type!=="function")throw new j(void 0,{docsPath:Yt});if(!i.outputs)throw new qe(i.name,{docsPath:Yt});let s=yt(i.outputs,o);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}var qt="/docs/contract/encodeDeployData";function Qt(e){let{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;let o=t.find(s=>"type"in s&&s.type==="constructor");if(!o)throw new We({docsPath:qt});if(!("inputs"in o))throw new me({docsPath:qt});if(!o.inputs||o.inputs.length===0)throw new me({docsPath:qt});let i=q(o.inputs,n);return we([r,i])}var Mr="/docs/contract/encodeFunctionData";function Sr(e){let{abi:t,args:n,functionName:r}=e,o=t[0];if(r){let i=bt({abi:t,args:n,name:r});if(!i)throw new j(r,{docsPath:Mr});o=i}if(o.type!=="function")throw new j(void 0,{docsPath:Mr});return{abi:[o],functionName:J(_(o))}}function Er(e){let{args:t}=e,{abi:n,functionName:r}=(()=>e.abi.length===1&&e.functionName?.startsWith("0x")?e:Sr(e))(),o=n[0],i=r,s="inputs"in o&&o.inputs?q(o.inputs,t??[]):void 0;return we([i,s??"0x"])}function Tr({blockNumber:e,chain:t,contract:n}){let r=t?.contracts?.[n];if(!r)throw new H({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new H({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}var C=class extends u{constructor({cause:t,message:n}={}){let r=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(C,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});var L=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${O(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(L,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});var te=class extends u{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${O(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(te,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});var ne=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(ne,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});var re=class extends u{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
27
|
-
`),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty(re,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});var oe=class extends u{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(oe,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});var se=class extends u{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
28
|
-
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(se,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});var ie=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(ie,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});var ae=class extends u{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(ae,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});var ue=class extends u{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(ue,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});var D=class extends u{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${O(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${O(r)} gwei`:""}).`].join(`
|
|
29
|
-
`),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(D,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});var ce=class extends u{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}};var Ae=class extends u{constructor({body:t,cause:n,details:r,headers:o,status:i,url:s}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${$e(s)}`,t&&`Request body: ${ee(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=i,this.url=s}};function Br(e,t){let n=(e.details||"").toLowerCase(),r=e instanceof u?e.walk(o=>o?.code===C.code):e;return r instanceof u?new C({cause:e,message:r.details}):C.nodeMessage.test(n)?new C({cause:e,message:e.details}):L.nodeMessage.test(n)?new L({cause:e,maxFeePerGas:t?.maxFeePerGas}):te.nodeMessage.test(n)?new te({cause:e,maxFeePerGas:t?.maxFeePerGas}):ne.nodeMessage.test(n)?new ne({cause:e,nonce:t?.nonce}):re.nodeMessage.test(n)?new re({cause:e,nonce:t?.nonce}):oe.nodeMessage.test(n)?new oe({cause:e,nonce:t?.nonce}):se.nodeMessage.test(n)?new se({cause:e}):ie.nodeMessage.test(n)?new ie({cause:e,gas:t?.gas}):ae.nodeMessage.test(n)?new ae({cause:e,gas:t?.gas}):ue.nodeMessage.test(n)?new ue({cause:e}):D.nodeMessage.test(n)?new D({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new ce({cause:e})}function kr(e,{docsPath:t,...n}){let r=(()=>{let o=Br(e,n);return o instanceof ce?e:o})();return new vt(r,{docsPath:t,...n})}function zr(e,{format:t}){if(!t)return{};let n={};function r(i){let s=Object.keys(i);for(let a of s)a in e&&(n[a]=e[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&r(i[a])}let o=t(e||{});return r(o),n}var jo={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Or(e){let t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Uo(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>P(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=y(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=y(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=y(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=y(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=y(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=y(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=jo[e.type]),typeof e.value<"u"&&(t.value=y(e.value)),t}function Uo(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:y(t.chainId),nonce:y(t.nonce),...typeof t.yParity<"u"?{yParity:y(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:y(t.v)}:{}}))}var en=new Map;function Cr({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){let i=async()=>{let d=c();s();let f=d.map(({args:l})=>l);f.length!==0&&e(f).then(l=>{o&&Array.isArray(l)&&l.sort(o);for(let m=0;m<d.length;m++){let{pendingPromise:h}=d[m];h.resolve?.([l[m],l])}}).catch(l=>{for(let m=0;m<d.length;m++){let{pendingPromise:h}=d[m];h.reject?.(l)}})},s=()=>en.delete(t),a=()=>c().map(({args:d})=>d),c=()=>en.get(t)||[],p=d=>en.set(t,[...c(),d]);return{flush:s,async schedule(d){let f={},l=new Promise((g,N)=>{f.resolve=g,f.reject=N});return n?.([...a(),d])&&i(),c().length>0?(p({args:d,pendingPromise:f}),l):(p({args:d,pendingPromise:f}),setTimeout(i,r),l)}}}function Rr(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new be({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new be({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Fo(e){let{balance:t,nonce:n,state:r,stateDiff:o,code:i}=e,s={};if(i!==void 0&&(s.code=i),t!==void 0&&(s.balance=y(t)),n!==void 0&&(s.nonce=y(n)),r!==void 0&&(s.state=Rr(r)),o!==void 0){if(s.state)throw new gt;s.stateDiff=Rr(o)}return s}function jr(e){if(!e)return;let t={};for(let{address:n,...r}of e){if(!w(n,{strict:!1}))throw new I({address:n});if(t[n])throw new xt({address:n});t[n]=Fo(r)}return t}var $c=2n**(8n-1n)-1n,Ac=2n**(16n-1n)-1n,Pc=2n**(24n-1n)-1n,Ic=2n**(32n-1n)-1n,Mc=2n**(40n-1n)-1n,Sc=2n**(48n-1n)-1n,Ec=2n**(56n-1n)-1n,Tc=2n**(64n-1n)-1n,Bc=2n**(72n-1n)-1n,kc=2n**(80n-1n)-1n,zc=2n**(88n-1n)-1n,Oc=2n**(96n-1n)-1n,Cc=2n**(104n-1n)-1n,Rc=2n**(112n-1n)-1n,jc=2n**(120n-1n)-1n,Uc=2n**(128n-1n)-1n,Fc=2n**(136n-1n)-1n,Lc=2n**(144n-1n)-1n,Dc=2n**(152n-1n)-1n,Nc=2n**(160n-1n)-1n,Hc=2n**(168n-1n)-1n,_c=2n**(176n-1n)-1n,Gc=2n**(184n-1n)-1n,Vc=2n**(192n-1n)-1n,Wc=2n**(200n-1n)-1n,Zc=2n**(208n-1n)-1n,Kc=2n**(216n-1n)-1n,Xc=2n**(224n-1n)-1n,Jc=2n**(232n-1n)-1n,Yc=2n**(240n-1n)-1n,qc=2n**(248n-1n)-1n,Qc=2n**(256n-1n)-1n,ep=-(2n**(8n-1n)),tp=-(2n**(16n-1n)),np=-(2n**(24n-1n)),rp=-(2n**(32n-1n)),op=-(2n**(40n-1n)),sp=-(2n**(48n-1n)),ip=-(2n**(56n-1n)),ap=-(2n**(64n-1n)),up=-(2n**(72n-1n)),cp=-(2n**(80n-1n)),pp=-(2n**(88n-1n)),dp=-(2n**(96n-1n)),fp=-(2n**(104n-1n)),mp=-(2n**(112n-1n)),lp=-(2n**(120n-1n)),yp=-(2n**(128n-1n)),bp=-(2n**(136n-1n)),hp=-(2n**(144n-1n)),xp=-(2n**(152n-1n)),gp=-(2n**(160n-1n)),wp=-(2n**(168n-1n)),vp=-(2n**(176n-1n)),$p=-(2n**(184n-1n)),Ap=-(2n**(192n-1n)),Pp=-(2n**(200n-1n)),Ip=-(2n**(208n-1n)),Mp=-(2n**(216n-1n)),Sp=-(2n**(224n-1n)),Ep=-(2n**(232n-1n)),Tp=-(2n**(240n-1n)),Bp=-(2n**(248n-1n)),kp=-(2n**(256n-1n)),zp=2n**8n-1n,Op=2n**16n-1n,Cp=2n**24n-1n,Rp=2n**32n-1n,jp=2n**40n-1n,Up=2n**48n-1n,Fp=2n**56n-1n,Lp=2n**64n-1n,Dp=2n**72n-1n,Np=2n**80n-1n,Hp=2n**88n-1n,_p=2n**96n-1n,Gp=2n**104n-1n,Vp=2n**112n-1n,Wp=2n**120n-1n,Zp=2n**128n-1n,Kp=2n**136n-1n,Xp=2n**144n-1n,Jp=2n**152n-1n,Yp=2n**160n-1n,qp=2n**168n-1n,Qp=2n**176n-1n,ed=2n**184n-1n,td=2n**192n-1n,nd=2n**200n-1n,rd=2n**208n-1n,od=2n**216n-1n,sd=2n**224n-1n,id=2n**232n-1n,ad=2n**240n-1n,ud=2n**248n-1n,Ur=2n**256n-1n;function Fr(e){let{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:o,to:i}=e,s=t?Z(t):void 0;if(s&&!w(s.address))throw new I({address:s.address});if(i&&!w(i))throw new I({address:i});if(typeof n<"u"&&(typeof r<"u"||typeof o<"u"))throw new wt;if(r&&r>Ur)throw new L({maxFeePerGas:r});if(o&&r&&o>r)throw new D({maxFeePerGas:r,maxPriorityFeePerGas:o})}async function Lr(e,t){let{account:n=e.account,batch:r=!!e.batch?.multicall,blockNumber:o,blockTag:i="latest",accessList:s,blobs:a,code:c,data:p,factory:d,factoryData:f,gas:l,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:g,maxPriorityFeePerGas:N,nonce:pe,to:S,value:Pe,stateOverride:Nr,...Hr}=t,tn=n?Z(n):void 0;if(c&&(d||f))throw new u("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&S)throw new u("Cannot provide both `code` & `to` as parameters.");let nn=c&&p,rn=d&&f&&S&&p,on=nn||rn,_r=(()=>nn?No({code:c,data:p}):rn?Ho({data:p,factory:d,factoryData:f,to:S}):p)();try{Fr(t);let V=(o?y(o):void 0)||i,de=jr(Nr),Ie=e.chain?.formatters?.transactionRequest?.format,Me=(Ie||Or)({...zr(Hr,{format:Ie}),from:tn?.address,accessList:s,blobs:a,data:_r,gas:l,gasPrice:m,maxFeePerBlobGas:h,maxFeePerGas:g,maxPriorityFeePerGas:N,nonce:pe,to:on?void 0:S,value:Pe});if(r&&Lo({request:Me})&&!de)try{return await Do(e,{...Me,blockNumber:o,blockTag:i})}catch(Et){if(!(Et instanceof fe)&&!(Et instanceof H))throw Et}let sn=await e.request({method:"eth_call",params:de?[Me,V,de]:[Me,V]});return sn==="0x"?{data:void 0}:{data:sn}}catch(St){let V=_o(St),{offchainLookup:de,offchainLookupSignature:Ie}=await import("./ccip-GJX6Z7AD.js");if(e.ccipRead!==!1&&V?.slice(0,10)===Ie&&S)return{data:await de(e,{data:V,to:S})};throw on&&V?.slice(0,10)==="0x101bb98d"?new $t({factory:d}):kr(St,{...t,account:tn,chain:e.chain})}}function Lo({request:e}){let{data:t,to:n,...r}=e;return!(!t||t.startsWith(Fn)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function Do(e,t){let{batchSize:n=1024,wait:r=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:i="latest",data:s,multicallAddress:a,to:c}=t,p=a;if(!p){if(!e.chain)throw new fe;p=Tr({blockNumber:o,chain:e.chain,contract:"multicall3"})}let f=(o?y(o):void 0)||i,{schedule:l}=Cr({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(g){return g.reduce((pe,{data:S})=>pe+(S.length-2),0)>n*2},fn:async g=>{let N=g.map(Pe=>({allowFailure:!0,callData:Pe.data,target:Pe.to})),pe=Er({abi:Ut,args:[N],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{data:pe,to:p},f]});return Ir({abi:Ut,args:[N],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:m,success:h}]=await l({data:s,to:c});if(!h)throw new At({data:m});return m==="0x"?{data:void 0}:{data:m}}function No(e){let{code:t,data:n}=e;return Qt({abi:_e(["constructor(bytes, bytes)"]),bytecode:Ln,args:[t,n]})}function Ho(e){let{data:t,factory:n,factoryData:r,to:o}=e;return Qt({abi:_e(["constructor(address, bytes, address, bytes)"]),bytecode:Dn,args:[o,t,n,r]})}function _o(e){if(!(e instanceof u))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}var Pt=class extends u{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:i,urls:s}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(a=>` ${$e(a)}`)],` Sender: ${i}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}},It=class extends u{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${$e(n)}`,`Response: ${ee(t)}`],name:"OffchainLookupResponseMalformedError"})}},Mt=class extends u{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}};function Dr(e,t){if(!w(e,{strict:!1}))throw new I({address:e});if(!w(t,{strict:!1}))throw new I({address:t});return e.toLowerCase()===t.toLowerCase()}var Qd="0x556f1830",Go={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function e0(e,{blockNumber:t,blockTag:n,data:r,to:o}){let{args:i}=br({data:r,abi:[Go]}),[s,a,c,p,d]=i,{ccipRead:f}=e,l=f&&typeof f?.request=="function"?f.request:Vo;try{if(!Dr(o,s))throw new Mt({sender:s,to:o});let m=await l({data:c,sender:s,urls:a}),{data:h}=await Lr(e,{blockNumber:t,blockTag:n,data:z([p,q([{type:"bytes"},{type:"bytes"}],[m,d])]),to:o});return h}catch(m){throw new Pt({callbackSelector:p,cause:m,data:r,extraData:d,sender:s,urls:a})}}async function Vo({data:e,sender:t,urls:n}){let r=new Error("An unknown error occurred.");for(let o=0;o<n.length;o++){let i=n[o],s=i.includes("{data}")?"GET":"POST",a=s==="POST"?{data:e,sender:t}:void 0;try{let c=await fetch(i.replace("{sender}",t).replace("{data}",e),{body:JSON.stringify(a),method:s}),p;if(c.headers.get("Content-Type")?.startsWith("application/json")?p=(await c.json()).data:p=await c.text(),!c.ok){r=new Ae({body:a,details:p?.error?ee(p.error):c.statusText,headers:c.headers,status:c.status,url:i});continue}if(!A(p)){r=new It({result:p,url:i});continue}return p}catch(c){r=new Ae({body:a,details:c.message,url:i})}}throw r}export{_t as a,q as b,Qd as c,Go as d,e0 as e,Vo as f};
|
|
30
|
-
//# sourceMappingURL=chunk-AU25RBDM.js.map
|
package/dist/chunk-SYRP7SJ5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
2
|
-
//# sourceMappingURL=chunk-SYRP7SJ5.js.map
|
|
File without changes
|
|
File without changes
|