holosphere 2.0.0-alpha6 → 2.0.0-alpha7
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/cjs/holosphere.cjs +1 -1
- package/dist/esm/holosphere.js +1 -1
- package/dist/{index-BtKHqqet.cjs → index-Bvwyvd0T.cjs} +3 -3
- package/dist/index-Bvwyvd0T.cjs.map +1 -0
- package/dist/{index-CmzkI7SI.cjs → index-C-IlLYlk.cjs} +2 -2
- package/dist/{index-CmzkI7SI.cjs.map → index-C-IlLYlk.cjs.map} +1 -1
- package/dist/{index-NOravBLu.js → index-d6f4RJBM.js} +35 -52
- package/dist/index-d6f4RJBM.js.map +1 -0
- package/dist/{index-JFz-dW43.js → index-jmTHEbR2.js} +2 -2
- package/dist/{index-JFz-dW43.js.map → index-jmTHEbR2.js.map} +1 -1
- package/dist/{indexeddb-storage-OtSAVDZY.js → indexeddb-storage-D8kOl0oK.js} +2 -2
- package/dist/{indexeddb-storage-OtSAVDZY.js.map → indexeddb-storage-D8kOl0oK.js.map} +1 -1
- package/dist/{indexeddb-storage-C4HsulhA.cjs → indexeddb-storage-a8GipaDr.cjs} +2 -2
- package/dist/{indexeddb-storage-C4HsulhA.cjs.map → indexeddb-storage-a8GipaDr.cjs.map} +1 -1
- package/dist/{memory-storage-ChpcYvxA.js → memory-storage-DBQK622V.js} +2 -2
- package/dist/{memory-storage-ChpcYvxA.js.map → memory-storage-DBQK622V.js.map} +1 -1
- package/dist/{memory-storage-MD6ED00P.cjs → memory-storage-gfRovk2O.cjs} +2 -2
- package/dist/{memory-storage-MD6ED00P.cjs.map → memory-storage-gfRovk2O.cjs.map} +1 -1
- package/dist/{secp256k1-DcTYQrqC.cjs → secp256k1-BCAPF45D.cjs} +2 -2
- package/dist/{secp256k1-DcTYQrqC.cjs.map → secp256k1-BCAPF45D.cjs.map} +1 -1
- package/dist/{secp256k1-PfNOEI7a.js → secp256k1-DYm_CMqW.js} +2 -2
- package/dist/{secp256k1-PfNOEI7a.js.map → secp256k1-DYm_CMqW.js.map} +1 -1
- package/package.json +1 -1
- package/src/storage/gun-async.js +14 -12
- package/src/storage/gun-auth.js +26 -18
- package/src/storage/gun-wrapper.js +11 -25
- package/dist/index-BtKHqqet.cjs.map +0 -1
- package/dist/index-NOravBLu.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BtKHqqet.cjs"),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let r=null;function s(s){if(null==r){r={};for(let t=0;t<58;t++)r[e[t]]=BigInt(t)}const n=r[s];return t.assertArgument(null!=n,"invalid base58 value","letter",s),n}const n=BigInt(0),i=BigInt(58);function o(r){const s=t.getBytes(r);let n=t.toBigInt(s),o="";for(;n;)o=e[Number(n%i)]+o,n/=i;for(let t=0;t<s.length&&!s[t];t++)o=e[0]+o;return o}function a(t){let e=n;for(let r=0;r<t.length;r++)e*=i,e+=s(t[r]);return e}function c(e){e=atob(e);const r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return t.getBytes(r)}function l(e){const r=t.getBytes(e);let s="";for(let t=0;t<r.length;t++)s+=String.fromCharCode(r[t]);return btoa(s)}function u(e){return async function(r,s){t.assert(null==s||!s.cancelled,"request cancelled before sending","CANCELLED");const n=r.url.split(":")[0].toLowerCase();t.assert("http"===n||"https"===n,`unsupported protocol ${n}`,"UNSUPPORTED_OPERATION",{info:{protocol:n},operation:"request"}),t.assert("https"===n||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const o=new AbortController,a=setTimeout(()=>{i=t.makeError("request timeout","TIMEOUT"),o.abort()},r.timeout);s&&s.addListener(()=>{i=t.makeError("request cancelled","CANCELLED"),o.abort()});const c=Object.assign({},e,{method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal});let l;try{l=await fetch(r.url,c)}catch(f){if(clearTimeout(a),i)throw i;throw f}clearTimeout(a);const u={};l.headers.forEach((t,e)=>{u[e.toLowerCase()]=t});const h=await l.arrayBuffer(),d=null==h?null:new Uint8Array(h);return{statusCode:l.status,statusMessage:l.statusText,headers:u,body:d}}}let h=u();const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let p=!1;async function g(e,r){try{const r=e.match(d);if(!r)throw new Error("invalid data");return new k(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?c(r[3]):(s=r[3],t.toUtf8Bytes(s.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16))))))}catch(n){return new k(599,"BAD REQUEST (invalid data: URI)",{},null,new E(e))}var s}function m(t){return async function(e,r){try{const r=e.match(f);if(!r)throw new Error("invalid link");return new E(`${t}${r[2]}`)}catch(s){return new k(599,"BAD REQUEST (invalid IPFS URI)",{},null,new E(e))}}}const y={data:g,ipfs:m("https://gateway.ipfs.io/ipfs/")},A=new WeakMap;class w{#t;#e;constructor(t){this.#t=[],this.#e=!1,A.set(t,()=>{if(!this.#e){this.#e=!0;for(const t of this.#t)setTimeout(()=>{t()},0);this.#t=[]}})}addListener(e){t.assert(!this.#e,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#t.push(e)}get cancelled(){return this.#e}checkSignal(){t.assert(!this.cancelled,"cancelled","CANCELLED",{})}}function b(t){if(null==t)throw new Error("missing signal; should not happen");return t.checkSignal(),t}class E{#r;#s;#n;#i;#o;#a;#c;#l;#u;#h;#d;#f;#p;#g;#m;get url(){return this.#a}set url(t){this.#a=String(t)}get body(){return null==this.#c?null:new Uint8Array(this.#c)}set body(e){if(null==e)this.#c=void 0,this.#l=void 0;else if("string"==typeof e)this.#c=t.toUtf8Bytes(e),this.#l="text/plain";else if(e instanceof Uint8Array)this.#c=e,this.#l="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#c=t.toUtf8Bytes(JSON.stringify(e)),this.#l="application/json"}}hasBody(){return null!=this.#c}get method(){return this.#i?this.#i:this.hasBody()?"POST":"GET"}set method(t){null==t&&(t=""),this.#i=String(t).toUpperCase()}get headers(){const e=Object.assign({},this.#n);return this.#u&&(e.authorization=`Basic ${l(t.toUtf8Bytes(this.#u))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#l&&(e["content-type"]=this.#l),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,e){this.#n[String(t).toLowerCase()]=String(e)}clearHeaders(){this.#n={}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const s=e[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#u||null}setCredentials(e,r){t.assertArgument(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#u=`${e}:${r}`}get allowGzip(){return this.#s}set allowGzip(t){this.#s=!!t}get allowInsecureAuthentication(){return!!this.#r}set allowInsecureAuthentication(t){this.#r=!!t}get timeout(){return this.#o}set timeout(e){t.assertArgument(e>=0,"timeout must be non-zero","timeout",e),this.#o=e}get preflightFunc(){return this.#h||null}set preflightFunc(t){this.#h=t}get processFunc(){return this.#d||null}set processFunc(t){this.#d=t}get retryFunc(){return this.#f||null}set retryFunc(t){this.#f=t}get getUrlFunc(){return this.#m||h}set getUrlFunc(t){this.#m=t}constructor(t){this.#a=String(t),this.#r=!1,this.#s=!0,this.#n={},this.#i="",this.#o=3e5,this.#g={slotInterval:250,maxAttempts:12},this.#m=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#c?t.hexlify(this.#c):"null"}>`}setThrottleParams(t){null!=t.slotInterval&&(this.#g.slotInterval=t.slotInterval),null!=t.maxAttempts&&(this.#g.maxAttempts=t.maxAttempts)}async#y(e,r,s,n,i){if(e>=this.#g.maxAttempts)return i.makeServerError("exceeded maximum retry limit");t.assert(v()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),s>0&&await function(t){return new Promise(e=>setTimeout(e,t))}(s);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in y){const t=await y[a](o.url,b(n.#p));if(t instanceof k){let e=t;if(this.processFunc){b(n.#p);try{e=await this.processFunc(o,e)}catch(u){null!=u.throttle&&"number"==typeof u.stall||e.makeServerError("error in post-processing function",u).assertOk()}}return e}o=t}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,b(n.#p));let l=new k(c.statusCode,c.statusMessage,c.headers,c.body,n);if(301===l.statusCode||302===l.statusCode){try{const t=l.headers.location||"";return o.redirect(t).#y(e+1,r,0,n,l)}catch(u){}return l}if(429===l.statusCode&&(null==this.retryFunc||await this.retryFunc(o,l,e))){const t=l.headers["retry-after"];let s=this.#g.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof t&&t.match(/^[1-9][0-9]*$/)&&(s=parseInt(t)),o.clone().#y(e+1,r,s,n,l)}if(this.processFunc){b(n.#p);try{l=await this.processFunc(o,l)}catch(u){null!=u.throttle&&"number"==typeof u.stall||l.makeServerError("error in post-processing function",u).assertOk();let t=this.#g.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return u.stall>=0&&(t=u.stall),o.clone().#y(e+1,r,t,n,l)}}return l}send(){return t.assert(null==this.#p,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#p=new w(this),this.#y(0,v()+this.timeout,0,this,new k(0,"",{},null,this))}cancel(){t.assert(null!=this.#p,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=A.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),s=e.split(":")[0].toLowerCase();t.assert("GET"===this.method&&("https"!==r||"http"!==s)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new E(e);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#n=Object.assign({},this.#n),this.#c&&(n.#c=new Uint8Array(this.#c)),n.#l=this.#l,n}clone(){const t=new E(this.url);return t.#i=this.#i,this.#c&&(t.#c=this.#c),t.#l=this.#l,t.#n=Object.assign({},this.#n),t.#u=this.#u,this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t.#h=this.#h,t.#d=this.#d,t.#f=this.#f,t.#g=Object.assign({},this.#g),t.#m=this.#m,t}static lockConfig(){p=!0}static getGateway(t){return y[t.toLowerCase()]||null}static registerGateway(t,e){if("http"===(t=t.toLowerCase())||"https"===t)throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(p)throw new Error("gateways locked");y[t]=e}static registerGetUrl(t){if(p)throw new Error("gateways locked");h=t}static createGetUrlFunc(t){return u(t)}static createDataGateway(){return g}static createIpfsGatewayFunc(t){return m(t)}}class k{#A;#w;#n;#c;#b;#E;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#c?t.hexlify(this.#c):"null"}>`}get statusCode(){return this.#A}get statusMessage(){return this.#w}get headers(){return Object.assign({},this.#n)}get body(){return null==this.#c?null:new Uint8Array(this.#c)}get bodyText(){try{return null==this.#c?"":t.toUtf8String(this.#c)}catch(e){t.assert(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){t.assert(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const s=e[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(t,e,r,s,n){this.#A=t,this.#w=e,this.#n=Object.keys(r).reduce((t,e)=>(t[e.toLowerCase()]=String(r[e]),t),{}),this.#c=null==s?null:new Uint8Array(s),this.#b=n||null,this.#E={message:""}}makeServerError(t,e){let r;r=t?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:`CLIENT ESCALATED SERVER ERROR (${t=`${this.statusCode} ${this.statusMessage}`})`;const s=new k(599,r,this.headers,this.body,this.#b||void 0);return s.#E={message:t,error:e},s}throwThrottleError(e,r){null==r?r=-1:t.assertArgument(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const s=new Error(e||"throttling requests");throw t.defineProperties(s,{stall:r,throttle:!0}),s}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return null!=this.#c}get request(){return this.#b}ok(){return""===this.#E.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=this.#E;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let s=null;this.request&&(s=this.request.url);let n=null;try{this.#c&&(n=t.toUtf8String(this.#c))}catch(i){}t.assert(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:s,responseBody:n,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function v(){return(new Date).getTime()}function x(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function P(t,e,r){let s=0;for(let n=0;n<r;n++)s=256*s+t[e+n];return s}function B(e,r,s,n){const i=[];for(;s<r+1+n;){const o=I(e,s);i.push(o.result),s+=o.consumed,t.assert(s<=r+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:r})}return{consumed:1+n,result:i}}function I(e,r){t.assert(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const s=r=>{t.assert(r<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:r})};if(e[r]>=248){const t=e[r]-247;s(r+1+t);const n=P(e,r+1,t);return s(r+1+t+n),B(e,r,r+1+t,t+n)}if(e[r]>=192){const t=e[r]-192;return s(r+1+t),B(e,r,r+1,t)}if(e[r]>=184){const n=e[r]-183;s(r+1+n);const i=P(e,r+1,n);s(r+1+n+i);return{consumed:1+n+i,result:t.hexlify(e.slice(r+1+n,r+1+n+i))}}if(e[r]>=128){const n=e[r]-128;s(r+1+n);return{consumed:1+n,result:t.hexlify(e.slice(r+1,r+1+n))}}return{consumed:1,result:x(e[r])}}function N(e){const r=t.getBytes(e,"data"),s=I(r,0);return t.assertArgument(s.consumed===r.length,"unexpected junk after rlp payload","data",e),s.result}function C(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function R(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(R(e))}),t.length<=55)return t.unshift(192+t.length),t;const r=C(t.length);return r.unshift(247+r.length),r.concat(t)}const r=Array.prototype.slice.call(t.getBytes(e,"object"));if(1===r.length&&r[0]<=127)return r;if(r.length<=55)return r.unshift(128+r.length),r;const s=C(r.length);return s.unshift(183+s.length),s.concat(r)}const S="0123456789abcdef";function T(t){let e="0x";for(const r of R(t))e+=S[r>>4],e+=S[15&r];return e}function O(e){const r=t.getBytes(e,"randomBytes");r[6]=15&r[6]|64,r[8]=63&r[8]|128;const s=t.hexlify(r);return[s.substring(2,10),s.substring(10,14),s.substring(14,18),s.substring(18,22),s.substring(22,34)].join("-")}class D extends t.Hash$1{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,t.hash(e);const s=t.toBytes$1(r);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(s.length>n?e.create().update(s).digest():s);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=e.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(e){return t.exists(this),this.iHash.update(e),this}digestInto(e){t.exists(this),t.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:s,destroyed:n,blockLen:i,outputLen:o}=this;return t.finished=s,t.destroyed=n,t.blockLen=i,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const U=(t,e,r)=>new D(t,e).update(r).digest();function F(e,r,s,n){const{c:i,dkLen:o,DK:a,PRF:c,PRFSalt:l}=function(e,r,s,n){t.hash(e);const i=t.checkOpts({dkLen:32,asyncTick:10},n),{c:o,dkLen:a,asyncTick:c}=i;if(t.number(o),t.number(a),t.number(c),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=t.toBytes$1(r),u=t.toBytes$1(s),h=new Uint8Array(a),d=U.create(e,l),f=d._cloneInto().update(u);return{c:o,dkLen:a,asyncTick:c,DK:h,PRF:d,PRFSalt:f}}(e,r,s,n);let u;const h=new Uint8Array(4),d=t.createView(h),f=new Uint8Array(c.outputLen);for(let t=1,p=0;p<o;t++,p+=c.outputLen){const e=a.subarray(p,p+c.outputLen);d.setInt32(0,t,!1),(u=l._cloneInto(u)).update(h).digestInto(f),e.set(f.subarray(0,e.length));for(let t=1;t<i;t++){c._cloneInto(u).update(f).digestInto(f);for(let t=0;t<e.length;t++)e[t]^=f[t]}}return function(t,e,r,s,n){return t.destroy(),e.destroy(),s&&s.destroy(),n.fill(0),r}(c,l,a,u,f)}U.create=(t,e)=>new D(t,e);class L extends t.Hash$1{constructor(e,r,s,n){super(),this.blockLen=e,this.outputLen=r,this.padOffset=s,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=t.createView(this.buffer)}update(e){t.exists(this);const{view:r,buffer:s,blockLen:n}=this,i=(e=t.toBytes$1(e)).length;for(let o=0;o<i;){const a=Math.min(n-this.pos,i-o);if(a===n){const r=t.createView(e);for(;n<=i-o;o+=n)this.process(r,o);continue}s.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){t.exists(this),t.output(e,this),this.finished=!0;const{buffer:r,view:s,blockLen:n,isLE:i}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(s,0),o=0);for(let t=o;t<n;t++)r[t]=0;!function(t,e,r,s){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,s);const n=BigInt(32),i=BigInt(4294967295),o=Number(r>>n&i),a=Number(r&i),c=s?4:0,l=s?0:4;t.setUint32(e+c,o,s),t.setUint32(e+l,a,s)}(s,n-8,BigInt(8*this.length),i),this.process(s,0);const a=t.createView(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)a.setUint32(4*t,u[t],i)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:s,finished:n,destroyed:i,pos:o}=this;return t.length=s,t.pos=o,t.finished=n,t.destroyed=i,s%e&&t.buffer.set(r),t}}const M=(t,e,r)=>t&e^~t&r,G=(t,e,r)=>t&e^t&r^e&r,H=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),z=new Uint32Array(64);class K extends L{constructor(){super(64,32,8,!1),this.A=0|Q[0],this.B=0|Q[1],this.C=0|Q[2],this.D=0|Q[3],this.E=0|Q[4],this.F=0|Q[5],this.G=0|Q[6],this.H=0|Q[7]}get(){const{A:t,B:e,C:r,D:s,E:n,F:i,G:o,H:a}=this;return[t,e,r,s,n,i,o,a]}set(t,e,r,s,n,i,o,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|s,this.E=0|n,this.F=0|i,this.G=0|o,this.H=0|a}process(e,r){for(let t=0;t<16;t++,r+=4)z[t]=e.getUint32(r,!1);for(let h=16;h<64;h++){const e=z[h-15],r=z[h-2],s=t.rotr(e,7)^t.rotr(e,18)^e>>>3,n=t.rotr(r,17)^t.rotr(r,19)^r>>>10;z[h]=n+z[h-7]+s+z[h-16]|0}let{A:s,B:n,C:i,D:o,E:a,F:c,G:l,H:u}=this;for(let h=0;h<64;h++){const e=u+(t.rotr(a,6)^t.rotr(a,11)^t.rotr(a,25))+M(a,c,l)+H[h]+z[h]|0,r=(t.rotr(s,2)^t.rotr(s,13)^t.rotr(s,22))+G(s,n,i)|0;u=l,l=c,c=a,a=o+e|0,o=i,i=n,n=s,s=e+r|0}s=s+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(s,n,i,o,a,c,l,u)}roundClean(){z.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const V=t.wrapConstructor(()=>new K),[q,J]=(()=>t.u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),j=new Uint32Array(80),W=new Uint32Array(80);class _ extends L{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:r,Bl:s,Ch:n,Cl:i,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[t,e,r,s,n,i,o,a,c,l,u,h,d,f,p,g]}set(t,e,r,s,n,i,o,a,c,l,u,h,d,f,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|s,this.Ch=0|n,this.Cl=0|i,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,r){for(let t=0;t<16;t++,r+=4)j[t]=e.getUint32(r),W[t]=e.getUint32(r+=4);for(let w=16;w<80;w++){const e=0|j[w-15],r=0|W[w-15],s=t.u64.rotrSH(e,r,1)^t.u64.rotrSH(e,r,8)^t.u64.shrSH(e,r,7),n=t.u64.rotrSL(e,r,1)^t.u64.rotrSL(e,r,8)^t.u64.shrSL(e,r,7),i=0|j[w-2],o=0|W[w-2],a=t.u64.rotrSH(i,o,19)^t.u64.rotrBH(i,o,61)^t.u64.shrSH(i,o,6),c=t.u64.rotrSL(i,o,19)^t.u64.rotrBL(i,o,61)^t.u64.shrSL(i,o,6),l=t.u64.add4L(n,c,W[w-7],W[w-16]),u=t.u64.add4H(l,s,a,j[w-7],j[w-16]);j[w]=0|u,W[w]=0|l}let{Ah:s,Al:n,Bh:i,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:h,El:d,Fh:f,Fl:p,Gh:g,Gl:m,Hh:y,Hl:A}=this;for(let w=0;w<80;w++){const e=t.u64.rotrSH(h,d,14)^t.u64.rotrSH(h,d,18)^t.u64.rotrBH(h,d,41),r=t.u64.rotrSL(h,d,14)^t.u64.rotrSL(h,d,18)^t.u64.rotrBL(h,d,41),b=h&f^~h&g,E=d&p^~d&m,k=t.u64.add5L(A,r,E,J[w],W[w]),v=t.u64.add5H(k,y,e,b,q[w],j[w]),x=0|k,P=t.u64.rotrSH(s,n,28)^t.u64.rotrBH(s,n,34)^t.u64.rotrBH(s,n,39),B=t.u64.rotrSL(s,n,28)^t.u64.rotrBL(s,n,34)^t.u64.rotrBL(s,n,39),I=s&i^s&a^i&a,N=n&o^n&c^o&c;y=0|g,A=0|m,g=0|f,m=0|p,f=0|h,p=0|d,({h:h,l:d}=t.u64.add(0|l,0|u,0|v,0|x)),l=0|a,u=0|c,a=0|i,c=0|o,i=0|s,o=0|n;const C=t.u64.add3L(x,B,N);s=t.u64.add3H(C,v,P,I),n=0|C}({h:s,l:n}=t.u64.add(0|this.Ah,0|this.Al,0|s,0|n)),({h:i,l:o}=t.u64.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:a,l:c}=t.u64.add(0|this.Ch,0|this.Cl,0|a,0|c)),({h:l,l:u}=t.u64.add(0|this.Dh,0|this.Dl,0|l,0|u)),({h:h,l:d}=t.u64.add(0|this.Eh,0|this.El,0|h,0|d)),({h:f,l:p}=t.u64.add(0|this.Fh,0|this.Fl,0|f,0|p)),({h:g,l:m}=t.u64.add(0|this.Gh,0|this.Gl,0|g,0|m)),({h:y,l:A}=t.u64.add(0|this.Hh,0|this.Hl,0|y,0|A)),this.set(s,n,i,o,a,c,l,u,h,d,f,p,g,m,y,A)}roundClean(){j.fill(0),W.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Z=t.wrapConstructor(()=>new _);const Y=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),X=Y.crypto||Y.msCrypto;function $(e){switch(e){case"sha256":return V.create();case"sha512":return Z.create()}t.assertArgument(!1,"invalid hashing algorithm name","algorithm",e)}let tt=!1;const et=function(e,r,s){return function(e,r){const s={sha256:V,sha512:Z}[e];return t.assertArgument(null!=s,"invalid hmac algorithm","algorithm",e),U.create(s,r)}(e,r).update(s).digest()};let rt=et;function st(e,r,s){const n=t.getBytes(r,"key"),i=t.getBytes(s,"data");return t.hexlify(rt(e,n,i))}st._=et,st.lock=function(){tt=!0},st.register=function(t){if(tt)throw new Error("computeHmac is locked");rt=t},Object.freeze(st);const nt=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),it=Uint8Array.from({length:16},(t,e)=>e);let ot=[it],at=[it.map(t=>(9*t+5)%16)];for(let Ac=0;Ac<4;Ac++)for(let t of[ot,at])t.push(t[Ac].map(t=>nt[t]));const ct=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),lt=ot.map((t,e)=>t.map(t=>ct[e][t])),ut=at.map((t,e)=>t.map(t=>ct[e][t])),ht=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),dt=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ft=(t,e)=>t<<e|t>>>32-e;function pt(t,e,r,s){return 0===t?e^r^s:1===t?e&r|~e&s:2===t?(e|~r)^s:3===t?e&s|r&~s:e^(r|~s)}const gt=new Uint32Array(16);class mt extends L{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:e,h2:r,h3:s,h4:n}=this;return[t,e,r,s,n]}set(t,e,r,s,n){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|s,this.h4=0|n}process(t,e){for(let d=0;d<16;d++,e+=4)gt[d]=t.getUint32(e,!0);let r=0|this.h0,s=r,n=0|this.h1,i=n,o=0|this.h2,a=o,c=0|this.h3,l=c,u=0|this.h4,h=u;for(let d=0;d<5;d++){const t=4-d,e=ht[d],f=dt[d],p=ot[d],g=at[d],m=lt[d],y=ut[d];for(let s=0;s<16;s++){const t=ft(r+pt(d,n,o,c)+gt[p[s]]+e,m[s])+u|0;r=u,u=c,c=0|ft(o,10),o=n,n=t}for(let r=0;r<16;r++){const e=ft(s+pt(t,i,a,l)+gt[g[r]]+f,y[r])+h|0;s=h,h=l,l=0|ft(a,10),a=i,i=e}}this.set(this.h1+o+l|0,this.h2+c+h|0,this.h3+u+s|0,this.h4+r+i|0,this.h0+n+a|0)}roundClean(){gt.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const yt=t.wrapConstructor(()=>new mt);let At=!1;const wt=function(t){return yt(t)};let bt=wt;function Et(e){const r=t.getBytes(e,"data");return t.hexlify(bt(r))}Et._=wt,Et.lock=function(){At=!0},Et.register=function(t){if(At)throw new TypeError("ripemd160 is locked");bt=t},Object.freeze(Et);let kt=!1;const vt=function(e,r,s,n,i){return function(e,r,s,n,i){const o={sha256:V,sha512:Z}[i];return t.assertArgument(null!=o,"invalid pbkdf2 algorithm","algorithm",i),F(o,e,r,{c:s,dkLen:n})}(e,r,s,n,i)};let xt=vt;function Pt(e,r,s,n,i){const o=t.getBytes(e,"password"),a=t.getBytes(r,"salt");return t.hexlify(xt(o,a,s,n,i))}Pt._=vt,Pt.lock=function(){kt=!0},Pt.register=function(t){if(kt)throw new Error("pbkdf2 is locked");xt=t},Object.freeze(Pt);let Bt=!1;const It=function(e){return new Uint8Array(function(e){t.assert(null!=X,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),t.assertArgument(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const r=new Uint8Array(e);return X.getRandomValues(r),r}(e))};let Nt=It;function Ct(t){return Nt(t)}Ct._=It,Ct.lock=function(){Bt=!0},Ct.register=function(t){if(Bt)throw new Error("randomBytes is locked");Nt=t},Object.freeze(Ct);const Rt=(t,e)=>t<<e|t>>>32-e;function St(t,e,r,s,n,i){let o=t[e++]^r[s++],a=t[e++]^r[s++],c=t[e++]^r[s++],l=t[e++]^r[s++],u=t[e++]^r[s++],h=t[e++]^r[s++],d=t[e++]^r[s++],f=t[e++]^r[s++],p=t[e++]^r[s++],g=t[e++]^r[s++],m=t[e++]^r[s++],y=t[e++]^r[s++],A=t[e++]^r[s++],w=t[e++]^r[s++],b=t[e++]^r[s++],E=t[e++]^r[s++],k=o,v=a,x=c,P=l,B=u,I=h,N=d,C=f,R=p,S=g,T=m,O=y,D=A,U=w,F=b,L=E;for(let M=0;M<8;M+=2)B^=Rt(k+D|0,7),R^=Rt(B+k|0,9),D^=Rt(R+B|0,13),k^=Rt(D+R|0,18),S^=Rt(I+v|0,7),U^=Rt(S+I|0,9),v^=Rt(U+S|0,13),I^=Rt(v+U|0,18),F^=Rt(T+N|0,7),x^=Rt(F+T|0,9),N^=Rt(x+F|0,13),T^=Rt(N+x|0,18),P^=Rt(L+O|0,7),C^=Rt(P+L|0,9),O^=Rt(C+P|0,13),L^=Rt(O+C|0,18),v^=Rt(k+P|0,7),x^=Rt(v+k|0,9),P^=Rt(x+v|0,13),k^=Rt(P+x|0,18),N^=Rt(I+B|0,7),C^=Rt(N+I|0,9),B^=Rt(C+N|0,13),I^=Rt(B+C|0,18),O^=Rt(T+S|0,7),R^=Rt(O+T|0,9),S^=Rt(R+O|0,13),T^=Rt(S+R|0,18),D^=Rt(L+F|0,7),U^=Rt(D+L|0,9),F^=Rt(U+D|0,13),L^=Rt(F+U|0,18);n[i++]=o+k|0,n[i++]=a+v|0,n[i++]=c+x|0,n[i++]=l+P|0,n[i++]=u+B|0,n[i++]=h+I|0,n[i++]=d+N|0,n[i++]=f+C|0,n[i++]=p+R|0,n[i++]=g+S|0,n[i++]=m+T|0,n[i++]=y+O|0,n[i++]=A+D|0,n[i++]=w+U|0,n[i++]=b+F|0,n[i++]=E+L|0}function Tt(t,e,r,s,n){let i=s+0,o=s+16*n;for(let a=0;a<16;a++)r[o+a]=t[e+16*(2*n-1)+a];for(let a=0;a<n;a++,i+=16,e+=16)St(r,o,t,e,r,i),a>0&&(o+=16),St(r,i,t,e+=16,r,o)}function Ot(e,r,s){const n=t.checkOpts({dkLen:32,asyncTick:10,maxmem:1073742848},s),{N:i,r:o,p:a,dkLen:c,asyncTick:l,maxmem:u,onProgress:h}=n;if(t.number(i),t.number(o),t.number(a),t.number(c),t.number(l),t.number(u),void 0!==h&&"function"!=typeof h)throw new Error("progressCb should be function");const d=128*o,f=d/4;if(i<=1||i&i-1||i>=2**(d/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>137438953440/d)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(c<0||c>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const p=d*(i+a);if(p>u)throw new Error(`Scrypt: parameters too large, ${p} (128 * r * (N + p)) > ${u} (maxmem)`);const g=F(V,e,r,{c:1,dkLen:d*a}),m=t.u32(g),y=t.u32(new Uint8Array(d*i)),A=t.u32(new Uint8Array(d));let w=()=>{};if(h){const t=2*i*a,e=Math.max(Math.floor(t/1e4),1);let r=0;w=()=>{r++,!h||r%e&&r!==t||h(r/t)}}return{N:i,r:o,p:a,dkLen:c,blockSize32:f,V:y,B32:m,B:g,tmp:A,blockMixCb:w,asyncTick:l}}function Dt(t,e,r,s,n){const i=F(V,t,r,{c:1,dkLen:e});return r.fill(0),s.fill(0),n.fill(0),i}let Ut=!1,Ft=!1;const Lt=async function(e,r,s,n,i,o,a){return await async function(e,r,s){const{N:n,r:i,p:o,dkLen:a,blockSize32:c,V:l,B32:u,B:h,tmp:d,blockMixCb:f,asyncTick:p}=Ot(e,r,s);for(let g=0;g<o;g++){const e=c*g;for(let t=0;t<c;t++)l[t]=u[e+t];let r=0;await t.asyncLoop(n-1,p,()=>{Tt(l,r,l,r+=c,i),f()}),Tt(l,(n-1)*c,u,e,i),f(),await t.asyncLoop(n,p,()=>{const t=u[e+c-16]%n;for(let r=0;r<c;r++)d[r]=u[e+r]^l[t*c+r];Tt(d,0,u,e,i),f()})}return Dt(e,a,h,l,d)}(e,r,{N:s,r:n,p:i,dkLen:o,onProgress:a})},Mt=function(t,e,r,s,n,i){return function(t,e,r){const{N:s,r:n,p:i,dkLen:o,blockSize32:a,V:c,B32:l,B:u,tmp:h,blockMixCb:d}=Ot(t,e,r);for(let f=0;f<i;f++){const t=a*f;for(let e=0;e<a;e++)c[e]=l[t+e];for(let e=0,r=0;e<s-1;e++)Tt(c,r,c,r+=a,n),d();Tt(c,(s-1)*a,l,t,n),d();for(let e=0;e<s;e++){const e=l[t+a-16]%s;for(let r=0;r<a;r++)h[r]=l[t+r]^c[e*a+r];Tt(h,0,l,t,n),d()}}return Dt(t,o,u,c,h)}(t,e,{N:r,r:s,p:n,dkLen:i})};let Gt=Lt,Ht=Mt;async function Qt(e,r,s,n,i,o,a){const c=t.getBytes(e,"passwd"),l=t.getBytes(r,"salt");return t.hexlify(await Gt(c,l,s,n,i,o,a))}function zt(e,r,s,n,i,o){const a=t.getBytes(e,"passwd"),c=t.getBytes(r,"salt");return t.hexlify(Ht(a,c,s,n,i,o))}Qt._=Lt,Qt.lock=function(){Ft=!0},Qt.register=function(t){if(Ft)throw new Error("scrypt is locked");Gt=t},Object.freeze(Qt),zt._=Mt,zt.lock=function(){Ut=!0},zt.register=function(t){if(Ut)throw new Error("scryptSync is locked");Ht=t},Object.freeze(zt);const Kt=function(t){return $("sha256").update(t).digest()},Vt=function(t){return $("sha512").update(t).digest()};let qt=Kt,Jt=Vt,jt=!1,Wt=!1;function _t(e){const r=t.getBytes(e,"data");return t.hexlify(qt(r))}function Zt(e){const r=t.getBytes(e,"data");return t.hexlify(Jt(r))}_t._=Kt,_t.lock=function(){jt=!0},_t.register=function(t){if(jt)throw new Error("sha256 is locked");qt=t},Object.freeze(_t),Zt._=Vt,Zt.lock=function(){Wt=!0},Zt.register=function(t){if(Wt)throw new Error("sha512 is locked");Jt=t},Object.freeze(_t);
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-Bvwyvd0T.cjs"),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let r=null;function s(s){if(null==r){r={};for(let t=0;t<58;t++)r[e[t]]=BigInt(t)}const n=r[s];return t.assertArgument(null!=n,"invalid base58 value","letter",s),n}const n=BigInt(0),i=BigInt(58);function o(r){const s=t.getBytes(r);let n=t.toBigInt(s),o="";for(;n;)o=e[Number(n%i)]+o,n/=i;for(let t=0;t<s.length&&!s[t];t++)o=e[0]+o;return o}function a(t){let e=n;for(let r=0;r<t.length;r++)e*=i,e+=s(t[r]);return e}function c(e){e=atob(e);const r=new Uint8Array(e.length);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return t.getBytes(r)}function l(e){const r=t.getBytes(e);let s="";for(let t=0;t<r.length;t++)s+=String.fromCharCode(r[t]);return btoa(s)}function u(e){return async function(r,s){t.assert(null==s||!s.cancelled,"request cancelled before sending","CANCELLED");const n=r.url.split(":")[0].toLowerCase();t.assert("http"===n||"https"===n,`unsupported protocol ${n}`,"UNSUPPORTED_OPERATION",{info:{protocol:n},operation:"request"}),t.assert("https"===n||!r.credentials||r.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const o=new AbortController,a=setTimeout(()=>{i=t.makeError("request timeout","TIMEOUT"),o.abort()},r.timeout);s&&s.addListener(()=>{i=t.makeError("request cancelled","CANCELLED"),o.abort()});const c=Object.assign({},e,{method:r.method,headers:new Headers(Array.from(r)),body:r.body||void 0,signal:o.signal});let l;try{l=await fetch(r.url,c)}catch(f){if(clearTimeout(a),i)throw i;throw f}clearTimeout(a);const u={};l.headers.forEach((t,e)=>{u[e.toLowerCase()]=t});const h=await l.arrayBuffer(),d=null==h?null:new Uint8Array(h);return{statusCode:l.status,statusMessage:l.statusText,headers:u,body:d}}}let h=u();const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let p=!1;async function g(e,r){try{const r=e.match(d);if(!r)throw new Error("invalid data");return new k(200,"OK",{"content-type":r[1]||"text/plain"},r[2]?c(r[3]):(s=r[3],t.toUtf8Bytes(s.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16))))))}catch(n){return new k(599,"BAD REQUEST (invalid data: URI)",{},null,new E(e))}var s}function m(t){return async function(e,r){try{const r=e.match(f);if(!r)throw new Error("invalid link");return new E(`${t}${r[2]}`)}catch(s){return new k(599,"BAD REQUEST (invalid IPFS URI)",{},null,new E(e))}}}const y={data:g,ipfs:m("https://gateway.ipfs.io/ipfs/")},A=new WeakMap;class w{#t;#e;constructor(t){this.#t=[],this.#e=!1,A.set(t,()=>{if(!this.#e){this.#e=!0;for(const t of this.#t)setTimeout(()=>{t()},0);this.#t=[]}})}addListener(e){t.assert(!this.#e,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#t.push(e)}get cancelled(){return this.#e}checkSignal(){t.assert(!this.cancelled,"cancelled","CANCELLED",{})}}function b(t){if(null==t)throw new Error("missing signal; should not happen");return t.checkSignal(),t}class E{#r;#s;#n;#i;#o;#a;#c;#l;#u;#h;#d;#f;#p;#g;#m;get url(){return this.#a}set url(t){this.#a=String(t)}get body(){return null==this.#c?null:new Uint8Array(this.#c)}set body(e){if(null==e)this.#c=void 0,this.#l=void 0;else if("string"==typeof e)this.#c=t.toUtf8Bytes(e),this.#l="text/plain";else if(e instanceof Uint8Array)this.#c=e,this.#l="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#c=t.toUtf8Bytes(JSON.stringify(e)),this.#l="application/json"}}hasBody(){return null!=this.#c}get method(){return this.#i?this.#i:this.hasBody()?"POST":"GET"}set method(t){null==t&&(t=""),this.#i=String(t).toUpperCase()}get headers(){const e=Object.assign({},this.#n);return this.#u&&(e.authorization=`Basic ${l(t.toUtf8Bytes(this.#u))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#l&&(e["content-type"]=this.#l),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(t){return this.headers[t.toLowerCase()]}setHeader(t,e){this.#n[String(t).toLowerCase()]=String(e)}clearHeaders(){this.#n={}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const s=e[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#u||null}setCredentials(e,r){t.assertArgument(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#u=`${e}:${r}`}get allowGzip(){return this.#s}set allowGzip(t){this.#s=!!t}get allowInsecureAuthentication(){return!!this.#r}set allowInsecureAuthentication(t){this.#r=!!t}get timeout(){return this.#o}set timeout(e){t.assertArgument(e>=0,"timeout must be non-zero","timeout",e),this.#o=e}get preflightFunc(){return this.#h||null}set preflightFunc(t){this.#h=t}get processFunc(){return this.#d||null}set processFunc(t){this.#d=t}get retryFunc(){return this.#f||null}set retryFunc(t){this.#f=t}get getUrlFunc(){return this.#m||h}set getUrlFunc(t){this.#m=t}constructor(t){this.#a=String(t),this.#r=!1,this.#s=!0,this.#n={},this.#i="",this.#o=3e5,this.#g={slotInterval:250,maxAttempts:12},this.#m=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#c?t.hexlify(this.#c):"null"}>`}setThrottleParams(t){null!=t.slotInterval&&(this.#g.slotInterval=t.slotInterval),null!=t.maxAttempts&&(this.#g.maxAttempts=t.maxAttempts)}async#y(e,r,s,n,i){if(e>=this.#g.maxAttempts)return i.makeServerError("exceeded maximum retry limit");t.assert(v()<=r,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),s>0&&await function(t){return new Promise(e=>setTimeout(e,t))}(s);let o=this.clone();const a=(o.url.split(":")[0]||"").toLowerCase();if(a in y){const t=await y[a](o.url,b(n.#p));if(t instanceof k){let e=t;if(this.processFunc){b(n.#p);try{e=await this.processFunc(o,e)}catch(u){null!=u.throttle&&"number"==typeof u.stall||e.makeServerError("error in post-processing function",u).assertOk()}}return e}o=t}this.preflightFunc&&(o=await this.preflightFunc(o));const c=await this.getUrlFunc(o,b(n.#p));let l=new k(c.statusCode,c.statusMessage,c.headers,c.body,n);if(301===l.statusCode||302===l.statusCode){try{const t=l.headers.location||"";return o.redirect(t).#y(e+1,r,0,n,l)}catch(u){}return l}if(429===l.statusCode&&(null==this.retryFunc||await this.retryFunc(o,l,e))){const t=l.headers["retry-after"];let s=this.#g.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof t&&t.match(/^[1-9][0-9]*$/)&&(s=parseInt(t)),o.clone().#y(e+1,r,s,n,l)}if(this.processFunc){b(n.#p);try{l=await this.processFunc(o,l)}catch(u){null!=u.throttle&&"number"==typeof u.stall||l.makeServerError("error in post-processing function",u).assertOk();let t=this.#g.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return u.stall>=0&&(t=u.stall),o.clone().#y(e+1,r,t,n,l)}}return l}send(){return t.assert(null==this.#p,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#p=new w(this),this.#y(0,v()+this.timeout,0,this,new k(0,"",{},null,this))}cancel(){t.assert(null!=this.#p,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=A.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const r=this.url.split(":")[0].toLowerCase(),s=e.split(":")[0].toLowerCase();t.assert("GET"===this.method&&("https"!==r||"http"!==s)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new E(e);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#n=Object.assign({},this.#n),this.#c&&(n.#c=new Uint8Array(this.#c)),n.#l=this.#l,n}clone(){const t=new E(this.url);return t.#i=this.#i,this.#c&&(t.#c=this.#c),t.#l=this.#l,t.#n=Object.assign({},this.#n),t.#u=this.#u,this.allowGzip&&(t.allowGzip=!0),t.timeout=this.timeout,this.allowInsecureAuthentication&&(t.allowInsecureAuthentication=!0),t.#h=this.#h,t.#d=this.#d,t.#f=this.#f,t.#g=Object.assign({},this.#g),t.#m=this.#m,t}static lockConfig(){p=!0}static getGateway(t){return y[t.toLowerCase()]||null}static registerGateway(t,e){if("http"===(t=t.toLowerCase())||"https"===t)throw new Error(`cannot intercept ${t}; use registerGetUrl`);if(p)throw new Error("gateways locked");y[t]=e}static registerGetUrl(t){if(p)throw new Error("gateways locked");h=t}static createGetUrlFunc(t){return u(t)}static createDataGateway(){return g}static createIpfsGatewayFunc(t){return m(t)}}class k{#A;#w;#n;#c;#b;#E;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#c?t.hexlify(this.#c):"null"}>`}get statusCode(){return this.#A}get statusMessage(){return this.#w}get headers(){return Object.assign({},this.#n)}get body(){return null==this.#c?null:new Uint8Array(this.#c)}get bodyText(){try{return null==this.#c?"":t.toUtf8String(this.#c)}catch(e){t.assert(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){t.assert(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const t=this.headers,e=Object.keys(t);let r=0;return{next:()=>{if(r<e.length){const s=e[r++];return{value:[s,t[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(t,e,r,s,n){this.#A=t,this.#w=e,this.#n=Object.keys(r).reduce((t,e)=>(t[e.toLowerCase()]=String(r[e]),t),{}),this.#c=null==s?null:new Uint8Array(s),this.#b=n||null,this.#E={message:""}}makeServerError(t,e){let r;r=t?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${t})`:`CLIENT ESCALATED SERVER ERROR (${t=`${this.statusCode} ${this.statusMessage}`})`;const s=new k(599,r,this.headers,this.body,this.#b||void 0);return s.#E={message:t,error:e},s}throwThrottleError(e,r){null==r?r=-1:t.assertArgument(Number.isInteger(r)&&r>=0,"invalid stall timeout","stall",r);const s=new Error(e||"throttling requests");throw t.defineProperties(s,{stall:r,throttle:!0}),s}getHeader(t){return this.headers[t.toLowerCase()]}hasBody(){return null!=this.#c}get request(){return this.#b}ok(){return""===this.#E.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:r}=this.#E;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let s=null;this.request&&(s=this.request.url);let n=null;try{this.#c&&(n=t.toUtf8String(this.#c))}catch(i){}t.assert(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:r,info:{requestUrl:s,responseBody:n,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function v(){return(new Date).getTime()}function x(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function P(t,e,r){let s=0;for(let n=0;n<r;n++)s=256*s+t[e+n];return s}function B(e,r,s,n){const i=[];for(;s<r+1+n;){const o=I(e,s);i.push(o.result),s+=o.consumed,t.assert(s<=r+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:r})}return{consumed:1+n,result:i}}function I(e,r){t.assert(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const s=r=>{t.assert(r<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:r})};if(e[r]>=248){const t=e[r]-247;s(r+1+t);const n=P(e,r+1,t);return s(r+1+t+n),B(e,r,r+1+t,t+n)}if(e[r]>=192){const t=e[r]-192;return s(r+1+t),B(e,r,r+1,t)}if(e[r]>=184){const n=e[r]-183;s(r+1+n);const i=P(e,r+1,n);s(r+1+n+i);return{consumed:1+n+i,result:t.hexlify(e.slice(r+1+n,r+1+n+i))}}if(e[r]>=128){const n=e[r]-128;s(r+1+n);return{consumed:1+n,result:t.hexlify(e.slice(r+1,r+1+n))}}return{consumed:1,result:x(e[r])}}function N(e){const r=t.getBytes(e,"data"),s=I(r,0);return t.assertArgument(s.consumed===r.length,"unexpected junk after rlp payload","data",e),s.result}function C(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function R(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(R(e))}),t.length<=55)return t.unshift(192+t.length),t;const r=C(t.length);return r.unshift(247+r.length),r.concat(t)}const r=Array.prototype.slice.call(t.getBytes(e,"object"));if(1===r.length&&r[0]<=127)return r;if(r.length<=55)return r.unshift(128+r.length),r;const s=C(r.length);return s.unshift(183+s.length),s.concat(r)}const S="0123456789abcdef";function T(t){let e="0x";for(const r of R(t))e+=S[r>>4],e+=S[15&r];return e}function O(e){const r=t.getBytes(e,"randomBytes");r[6]=15&r[6]|64,r[8]=63&r[8]|128;const s=t.hexlify(r);return[s.substring(2,10),s.substring(10,14),s.substring(14,18),s.substring(18,22),s.substring(22,34)].join("-")}class D extends t.Hash$1{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,t.hash(e);const s=t.toBytes$1(r);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(s.length>n?e.create().update(s).digest():s);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=e.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(e){return t.exists(this),this.iHash.update(e),this}digestInto(e){t.exists(this),t.bytes(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:s,destroyed:n,blockLen:i,outputLen:o}=this;return t.finished=s,t.destroyed=n,t.blockLen=i,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const U=(t,e,r)=>new D(t,e).update(r).digest();function F(e,r,s,n){const{c:i,dkLen:o,DK:a,PRF:c,PRFSalt:l}=function(e,r,s,n){t.hash(e);const i=t.checkOpts({dkLen:32,asyncTick:10},n),{c:o,dkLen:a,asyncTick:c}=i;if(t.number(o),t.number(a),t.number(c),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const l=t.toBytes$1(r),u=t.toBytes$1(s),h=new Uint8Array(a),d=U.create(e,l),f=d._cloneInto().update(u);return{c:o,dkLen:a,asyncTick:c,DK:h,PRF:d,PRFSalt:f}}(e,r,s,n);let u;const h=new Uint8Array(4),d=t.createView(h),f=new Uint8Array(c.outputLen);for(let t=1,p=0;p<o;t++,p+=c.outputLen){const e=a.subarray(p,p+c.outputLen);d.setInt32(0,t,!1),(u=l._cloneInto(u)).update(h).digestInto(f),e.set(f.subarray(0,e.length));for(let t=1;t<i;t++){c._cloneInto(u).update(f).digestInto(f);for(let t=0;t<e.length;t++)e[t]^=f[t]}}return function(t,e,r,s,n){return t.destroy(),e.destroy(),s&&s.destroy(),n.fill(0),r}(c,l,a,u,f)}U.create=(t,e)=>new D(t,e);class L extends t.Hash$1{constructor(e,r,s,n){super(),this.blockLen=e,this.outputLen=r,this.padOffset=s,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=t.createView(this.buffer)}update(e){t.exists(this);const{view:r,buffer:s,blockLen:n}=this,i=(e=t.toBytes$1(e)).length;for(let o=0;o<i;){const a=Math.min(n-this.pos,i-o);if(a===n){const r=t.createView(e);for(;n<=i-o;o+=n)this.process(r,o);continue}s.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===n&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){t.exists(this),t.output(e,this),this.finished=!0;const{buffer:r,view:s,blockLen:n,isLE:i}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(s,0),o=0);for(let t=o;t<n;t++)r[t]=0;!function(t,e,r,s){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,s);const n=BigInt(32),i=BigInt(4294967295),o=Number(r>>n&i),a=Number(r&i),c=s?4:0,l=s?0:4;t.setUint32(e+c,o,s),t.setUint32(e+l,a,s)}(s,n-8,BigInt(8*this.length),i),this.process(s,0);const a=t.createView(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)a.setUint32(4*t,u[t],i)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:s,finished:n,destroyed:i,pos:o}=this;return t.length=s,t.pos=o,t.finished=n,t.destroyed=i,s%e&&t.buffer.set(r),t}}const M=(t,e,r)=>t&e^~t&r,G=(t,e,r)=>t&e^t&r^e&r,H=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Q=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),z=new Uint32Array(64);class K extends L{constructor(){super(64,32,8,!1),this.A=0|Q[0],this.B=0|Q[1],this.C=0|Q[2],this.D=0|Q[3],this.E=0|Q[4],this.F=0|Q[5],this.G=0|Q[6],this.H=0|Q[7]}get(){const{A:t,B:e,C:r,D:s,E:n,F:i,G:o,H:a}=this;return[t,e,r,s,n,i,o,a]}set(t,e,r,s,n,i,o,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|s,this.E=0|n,this.F=0|i,this.G=0|o,this.H=0|a}process(e,r){for(let t=0;t<16;t++,r+=4)z[t]=e.getUint32(r,!1);for(let h=16;h<64;h++){const e=z[h-15],r=z[h-2],s=t.rotr(e,7)^t.rotr(e,18)^e>>>3,n=t.rotr(r,17)^t.rotr(r,19)^r>>>10;z[h]=n+z[h-7]+s+z[h-16]|0}let{A:s,B:n,C:i,D:o,E:a,F:c,G:l,H:u}=this;for(let h=0;h<64;h++){const e=u+(t.rotr(a,6)^t.rotr(a,11)^t.rotr(a,25))+M(a,c,l)+H[h]+z[h]|0,r=(t.rotr(s,2)^t.rotr(s,13)^t.rotr(s,22))+G(s,n,i)|0;u=l,l=c,c=a,a=o+e|0,o=i,i=n,n=s,s=e+r|0}s=s+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(s,n,i,o,a,c,l,u)}roundClean(){z.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const V=t.wrapConstructor(()=>new K),[q,J]=(()=>t.u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),j=new Uint32Array(80),W=new Uint32Array(80);class _ extends L{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:r,Bl:s,Ch:n,Cl:i,Dh:o,Dl:a,Eh:c,El:l,Fh:u,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[t,e,r,s,n,i,o,a,c,l,u,h,d,f,p,g]}set(t,e,r,s,n,i,o,a,c,l,u,h,d,f,p,g){this.Ah=0|t,this.Al=0|e,this.Bh=0|r,this.Bl=0|s,this.Ch=0|n,this.Cl=0|i,this.Dh=0|o,this.Dl=0|a,this.Eh=0|c,this.El=0|l,this.Fh=0|u,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,r){for(let t=0;t<16;t++,r+=4)j[t]=e.getUint32(r),W[t]=e.getUint32(r+=4);for(let w=16;w<80;w++){const e=0|j[w-15],r=0|W[w-15],s=t.u64.rotrSH(e,r,1)^t.u64.rotrSH(e,r,8)^t.u64.shrSH(e,r,7),n=t.u64.rotrSL(e,r,1)^t.u64.rotrSL(e,r,8)^t.u64.shrSL(e,r,7),i=0|j[w-2],o=0|W[w-2],a=t.u64.rotrSH(i,o,19)^t.u64.rotrBH(i,o,61)^t.u64.shrSH(i,o,6),c=t.u64.rotrSL(i,o,19)^t.u64.rotrBL(i,o,61)^t.u64.shrSL(i,o,6),l=t.u64.add4L(n,c,W[w-7],W[w-16]),u=t.u64.add4H(l,s,a,j[w-7],j[w-16]);j[w]=0|u,W[w]=0|l}let{Ah:s,Al:n,Bh:i,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:h,El:d,Fh:f,Fl:p,Gh:g,Gl:m,Hh:y,Hl:A}=this;for(let w=0;w<80;w++){const e=t.u64.rotrSH(h,d,14)^t.u64.rotrSH(h,d,18)^t.u64.rotrBH(h,d,41),r=t.u64.rotrSL(h,d,14)^t.u64.rotrSL(h,d,18)^t.u64.rotrBL(h,d,41),b=h&f^~h&g,E=d&p^~d&m,k=t.u64.add5L(A,r,E,J[w],W[w]),v=t.u64.add5H(k,y,e,b,q[w],j[w]),x=0|k,P=t.u64.rotrSH(s,n,28)^t.u64.rotrBH(s,n,34)^t.u64.rotrBH(s,n,39),B=t.u64.rotrSL(s,n,28)^t.u64.rotrBL(s,n,34)^t.u64.rotrBL(s,n,39),I=s&i^s&a^i&a,N=n&o^n&c^o&c;y=0|g,A=0|m,g=0|f,m=0|p,f=0|h,p=0|d,({h:h,l:d}=t.u64.add(0|l,0|u,0|v,0|x)),l=0|a,u=0|c,a=0|i,c=0|o,i=0|s,o=0|n;const C=t.u64.add3L(x,B,N);s=t.u64.add3H(C,v,P,I),n=0|C}({h:s,l:n}=t.u64.add(0|this.Ah,0|this.Al,0|s,0|n)),({h:i,l:o}=t.u64.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:a,l:c}=t.u64.add(0|this.Ch,0|this.Cl,0|a,0|c)),({h:l,l:u}=t.u64.add(0|this.Dh,0|this.Dl,0|l,0|u)),({h:h,l:d}=t.u64.add(0|this.Eh,0|this.El,0|h,0|d)),({h:f,l:p}=t.u64.add(0|this.Fh,0|this.Fl,0|f,0|p)),({h:g,l:m}=t.u64.add(0|this.Gh,0|this.Gl,0|g,0|m)),({h:y,l:A}=t.u64.add(0|this.Hh,0|this.Hl,0|y,0|A)),this.set(s,n,i,o,a,c,l,u,h,d,f,p,g,m,y,A)}roundClean(){j.fill(0),W.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Z=t.wrapConstructor(()=>new _);const Y=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}(),X=Y.crypto||Y.msCrypto;function $(e){switch(e){case"sha256":return V.create();case"sha512":return Z.create()}t.assertArgument(!1,"invalid hashing algorithm name","algorithm",e)}let tt=!1;const et=function(e,r,s){return function(e,r){const s={sha256:V,sha512:Z}[e];return t.assertArgument(null!=s,"invalid hmac algorithm","algorithm",e),U.create(s,r)}(e,r).update(s).digest()};let rt=et;function st(e,r,s){const n=t.getBytes(r,"key"),i=t.getBytes(s,"data");return t.hexlify(rt(e,n,i))}st._=et,st.lock=function(){tt=!0},st.register=function(t){if(tt)throw new Error("computeHmac is locked");rt=t},Object.freeze(st);const nt=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),it=Uint8Array.from({length:16},(t,e)=>e);let ot=[it],at=[it.map(t=>(9*t+5)%16)];for(let Ac=0;Ac<4;Ac++)for(let t of[ot,at])t.push(t[Ac].map(t=>nt[t]));const ct=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),lt=ot.map((t,e)=>t.map(t=>ct[e][t])),ut=at.map((t,e)=>t.map(t=>ct[e][t])),ht=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),dt=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ft=(t,e)=>t<<e|t>>>32-e;function pt(t,e,r,s){return 0===t?e^r^s:1===t?e&r|~e&s:2===t?(e|~r)^s:3===t?e&s|r&~s:e^(r|~s)}const gt=new Uint32Array(16);class mt extends L{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:e,h2:r,h3:s,h4:n}=this;return[t,e,r,s,n]}set(t,e,r,s,n){this.h0=0|t,this.h1=0|e,this.h2=0|r,this.h3=0|s,this.h4=0|n}process(t,e){for(let d=0;d<16;d++,e+=4)gt[d]=t.getUint32(e,!0);let r=0|this.h0,s=r,n=0|this.h1,i=n,o=0|this.h2,a=o,c=0|this.h3,l=c,u=0|this.h4,h=u;for(let d=0;d<5;d++){const t=4-d,e=ht[d],f=dt[d],p=ot[d],g=at[d],m=lt[d],y=ut[d];for(let s=0;s<16;s++){const t=ft(r+pt(d,n,o,c)+gt[p[s]]+e,m[s])+u|0;r=u,u=c,c=0|ft(o,10),o=n,n=t}for(let r=0;r<16;r++){const e=ft(s+pt(t,i,a,l)+gt[g[r]]+f,y[r])+h|0;s=h,h=l,l=0|ft(a,10),a=i,i=e}}this.set(this.h1+o+l|0,this.h2+c+h|0,this.h3+u+s|0,this.h4+r+i|0,this.h0+n+a|0)}roundClean(){gt.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const yt=t.wrapConstructor(()=>new mt);let At=!1;const wt=function(t){return yt(t)};let bt=wt;function Et(e){const r=t.getBytes(e,"data");return t.hexlify(bt(r))}Et._=wt,Et.lock=function(){At=!0},Et.register=function(t){if(At)throw new TypeError("ripemd160 is locked");bt=t},Object.freeze(Et);let kt=!1;const vt=function(e,r,s,n,i){return function(e,r,s,n,i){const o={sha256:V,sha512:Z}[i];return t.assertArgument(null!=o,"invalid pbkdf2 algorithm","algorithm",i),F(o,e,r,{c:s,dkLen:n})}(e,r,s,n,i)};let xt=vt;function Pt(e,r,s,n,i){const o=t.getBytes(e,"password"),a=t.getBytes(r,"salt");return t.hexlify(xt(o,a,s,n,i))}Pt._=vt,Pt.lock=function(){kt=!0},Pt.register=function(t){if(kt)throw new Error("pbkdf2 is locked");xt=t},Object.freeze(Pt);let Bt=!1;const It=function(e){return new Uint8Array(function(e){t.assert(null!=X,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),t.assertArgument(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const r=new Uint8Array(e);return X.getRandomValues(r),r}(e))};let Nt=It;function Ct(t){return Nt(t)}Ct._=It,Ct.lock=function(){Bt=!0},Ct.register=function(t){if(Bt)throw new Error("randomBytes is locked");Nt=t},Object.freeze(Ct);const Rt=(t,e)=>t<<e|t>>>32-e;function St(t,e,r,s,n,i){let o=t[e++]^r[s++],a=t[e++]^r[s++],c=t[e++]^r[s++],l=t[e++]^r[s++],u=t[e++]^r[s++],h=t[e++]^r[s++],d=t[e++]^r[s++],f=t[e++]^r[s++],p=t[e++]^r[s++],g=t[e++]^r[s++],m=t[e++]^r[s++],y=t[e++]^r[s++],A=t[e++]^r[s++],w=t[e++]^r[s++],b=t[e++]^r[s++],E=t[e++]^r[s++],k=o,v=a,x=c,P=l,B=u,I=h,N=d,C=f,R=p,S=g,T=m,O=y,D=A,U=w,F=b,L=E;for(let M=0;M<8;M+=2)B^=Rt(k+D|0,7),R^=Rt(B+k|0,9),D^=Rt(R+B|0,13),k^=Rt(D+R|0,18),S^=Rt(I+v|0,7),U^=Rt(S+I|0,9),v^=Rt(U+S|0,13),I^=Rt(v+U|0,18),F^=Rt(T+N|0,7),x^=Rt(F+T|0,9),N^=Rt(x+F|0,13),T^=Rt(N+x|0,18),P^=Rt(L+O|0,7),C^=Rt(P+L|0,9),O^=Rt(C+P|0,13),L^=Rt(O+C|0,18),v^=Rt(k+P|0,7),x^=Rt(v+k|0,9),P^=Rt(x+v|0,13),k^=Rt(P+x|0,18),N^=Rt(I+B|0,7),C^=Rt(N+I|0,9),B^=Rt(C+N|0,13),I^=Rt(B+C|0,18),O^=Rt(T+S|0,7),R^=Rt(O+T|0,9),S^=Rt(R+O|0,13),T^=Rt(S+R|0,18),D^=Rt(L+F|0,7),U^=Rt(D+L|0,9),F^=Rt(U+D|0,13),L^=Rt(F+U|0,18);n[i++]=o+k|0,n[i++]=a+v|0,n[i++]=c+x|0,n[i++]=l+P|0,n[i++]=u+B|0,n[i++]=h+I|0,n[i++]=d+N|0,n[i++]=f+C|0,n[i++]=p+R|0,n[i++]=g+S|0,n[i++]=m+T|0,n[i++]=y+O|0,n[i++]=A+D|0,n[i++]=w+U|0,n[i++]=b+F|0,n[i++]=E+L|0}function Tt(t,e,r,s,n){let i=s+0,o=s+16*n;for(let a=0;a<16;a++)r[o+a]=t[e+16*(2*n-1)+a];for(let a=0;a<n;a++,i+=16,e+=16)St(r,o,t,e,r,i),a>0&&(o+=16),St(r,i,t,e+=16,r,o)}function Ot(e,r,s){const n=t.checkOpts({dkLen:32,asyncTick:10,maxmem:1073742848},s),{N:i,r:o,p:a,dkLen:c,asyncTick:l,maxmem:u,onProgress:h}=n;if(t.number(i),t.number(o),t.number(a),t.number(c),t.number(l),t.number(u),void 0!==h&&"function"!=typeof h)throw new Error("progressCb should be function");const d=128*o,f=d/4;if(i<=1||i&i-1||i>=2**(d/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>137438953440/d)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(c<0||c>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const p=d*(i+a);if(p>u)throw new Error(`Scrypt: parameters too large, ${p} (128 * r * (N + p)) > ${u} (maxmem)`);const g=F(V,e,r,{c:1,dkLen:d*a}),m=t.u32(g),y=t.u32(new Uint8Array(d*i)),A=t.u32(new Uint8Array(d));let w=()=>{};if(h){const t=2*i*a,e=Math.max(Math.floor(t/1e4),1);let r=0;w=()=>{r++,!h||r%e&&r!==t||h(r/t)}}return{N:i,r:o,p:a,dkLen:c,blockSize32:f,V:y,B32:m,B:g,tmp:A,blockMixCb:w,asyncTick:l}}function Dt(t,e,r,s,n){const i=F(V,t,r,{c:1,dkLen:e});return r.fill(0),s.fill(0),n.fill(0),i}let Ut=!1,Ft=!1;const Lt=async function(e,r,s,n,i,o,a){return await async function(e,r,s){const{N:n,r:i,p:o,dkLen:a,blockSize32:c,V:l,B32:u,B:h,tmp:d,blockMixCb:f,asyncTick:p}=Ot(e,r,s);for(let g=0;g<o;g++){const e=c*g;for(let t=0;t<c;t++)l[t]=u[e+t];let r=0;await t.asyncLoop(n-1,p,()=>{Tt(l,r,l,r+=c,i),f()}),Tt(l,(n-1)*c,u,e,i),f(),await t.asyncLoop(n,p,()=>{const t=u[e+c-16]%n;for(let r=0;r<c;r++)d[r]=u[e+r]^l[t*c+r];Tt(d,0,u,e,i),f()})}return Dt(e,a,h,l,d)}(e,r,{N:s,r:n,p:i,dkLen:o,onProgress:a})},Mt=function(t,e,r,s,n,i){return function(t,e,r){const{N:s,r:n,p:i,dkLen:o,blockSize32:a,V:c,B32:l,B:u,tmp:h,blockMixCb:d}=Ot(t,e,r);for(let f=0;f<i;f++){const t=a*f;for(let e=0;e<a;e++)c[e]=l[t+e];for(let e=0,r=0;e<s-1;e++)Tt(c,r,c,r+=a,n),d();Tt(c,(s-1)*a,l,t,n),d();for(let e=0;e<s;e++){const e=l[t+a-16]%s;for(let r=0;r<a;r++)h[r]=l[t+r]^c[e*a+r];Tt(h,0,l,t,n),d()}}return Dt(t,o,u,c,h)}(t,e,{N:r,r:s,p:n,dkLen:i})};let Gt=Lt,Ht=Mt;async function Qt(e,r,s,n,i,o,a){const c=t.getBytes(e,"passwd"),l=t.getBytes(r,"salt");return t.hexlify(await Gt(c,l,s,n,i,o,a))}function zt(e,r,s,n,i,o){const a=t.getBytes(e,"passwd"),c=t.getBytes(r,"salt");return t.hexlify(Ht(a,c,s,n,i,o))}Qt._=Lt,Qt.lock=function(){Ft=!0},Qt.register=function(t){if(Ft)throw new Error("scrypt is locked");Gt=t},Object.freeze(Qt),zt._=Mt,zt.lock=function(){Ut=!0},zt.register=function(t){if(Ut)throw new Error("scryptSync is locked");Ht=t},Object.freeze(zt);const Kt=function(t){return $("sha256").update(t).digest()},Vt=function(t){return $("sha512").update(t).digest()};let qt=Kt,Jt=Vt,jt=!1,Wt=!1;function _t(e){const r=t.getBytes(e,"data");return t.hexlify(qt(r))}function Zt(e){const r=t.getBytes(e,"data");return t.hexlify(Jt(r))}_t._=Kt,_t.lock=function(){jt=!0},_t.register=function(t){if(jt)throw new Error("sha256 is locked");qt=t},Object.freeze(_t),Zt._=Vt,Zt.lock=function(){Wt=!0},Zt.register=function(t){if(Wt)throw new Error("sha512 is locked");Jt=t},Object.freeze(_t);
|
|
2
2
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
3
|
const Yt=BigInt(0),Xt=BigInt(1),$t=BigInt(2),te=t=>t instanceof Uint8Array,ee=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function re(t){if(!te(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=ee[t[r]];return e}function se(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function ne(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}function ie(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let s=0;s<r.length;s++){const e=2*s,n=t.slice(e,e+2),i=Number.parseInt(n,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");r[s]=i}return r}function oe(t){return ne(re(t))}function ae(t){if(!te(t))throw new Error("Uint8Array expected");return ne(re(Uint8Array.from(t).reverse()))}function ce(t,e){return ie(t.toString(16).padStart(2*e,"0"))}function le(t,e){return ce(t,e).reverse()}function ue(t,e,r){let s;if("string"==typeof e)try{s=ie(e)}catch(i){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${i}`)}else{if(!te(e))throw new Error(`${t} must be hex string or Uint8Array`);s=Uint8Array.from(e)}const n=s.length;if("number"==typeof r&&n!==r)throw new Error(`${t} expected ${r} bytes, got ${n}`);return s}function he(...t){const e=new Uint8Array(t.reduce((t,e)=>t+e.length,0));let r=0;return t.forEach(t=>{if(!te(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length}),e}const de=t=>($t<<BigInt(t-1))-Xt,fe=t=>new Uint8Array(t),pe=t=>Uint8Array.from(t);function ge(t,e,r){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let s=fe(t),n=fe(t),i=0;const o=()=>{s.fill(1),n.fill(0),i=0},a=(...t)=>r(n,s,...t),c=(t=fe())=>{n=a(pe([0]),t),s=a(),0!==t.length&&(n=a(pe([1]),t),s=a())},l=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const r=[];for(;t<e;){s=a();const e=s.slice();r.push(e),t+=s.length}return he(...r)};return(t,e)=>{let r;for(o(),c(t);!(r=e(l()));)c();return o(),r}}const me={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function ye(t,e,r={}){const s=(e,r,s)=>{const n=me[r];if("function"!=typeof n)throw new Error(`Invalid validator "${r}", expected function`);const i=t[e];if(!(s&&void 0===i||n(i,t)))throw new Error(`Invalid param ${String(e)}=${i} (${typeof i}), expected ${r}`)};for(const[n,i]of Object.entries(e))s(n,i,!1);for(const[n,i]of Object.entries(r))s(n,i,!0);return t}const Ae=Object.freeze(Object.defineProperty({__proto__:null,bitGet:function(t,e){return t>>BigInt(e)&Xt},bitLen:function(t){let e;for(e=0;t>Yt;t>>=Xt,e+=1);return e},bitMask:de,bitSet:(t,e,r)=>t|(r?Xt:Yt)<<BigInt(e),bytesToHex:re,bytesToNumberBE:oe,bytesToNumberLE:ae,concatBytes:he,createHmacDrbg:ge,ensureBytes:ue,equalBytes:function(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},hexToBytes:ie,hexToNumber:ne,numberToBytesBE:ce,numberToBytesLE:le,numberToHexUnpadded:se,numberToVarBytesBE:function(t){return ie(se(t))},utf8ToBytes:function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))},validateObject:ye},Symbol.toStringTag,{value:"Module"})),we=BigInt(0),be=BigInt(1),Ee=BigInt(2),ke=BigInt(3),ve=BigInt(4),xe=BigInt(5),Pe=BigInt(8);
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Be(t,e){const r=t%e;return r>=we?r:e+r}function Ie(t,e,r){if(r<=we||e<we)throw new Error("Expected power/modulo > 0");if(r===be)return we;let s=be;for(;e>we;)e&be&&(s=s*t%r),t=t*t%r,e>>=be;return s}function Ne(t,e,r){let s=t;for(;e-- >we;)s*=s,s%=r;return s}function Ce(t,e){if(t===we||e<=we)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Be(t,e),s=e,n=we,i=be;for(;r!==we;){const t=s%r,e=n-i*(s/r);s=r,r=t,n=i,i=e}if(s!==be)throw new Error("invert: does not exist");return Be(n,e)}function Re(t){if(t%ve===ke){const e=(t+be)/ve;return function(t,r){const s=t.pow(r,e);if(!t.eql(t.sqr(s),r))throw new Error("Cannot find square root");return s}}if(t%Pe===xe){const e=(t-xe)/Pe;return function(t,r){const s=t.mul(r,Ee),n=t.pow(s,e),i=t.mul(r,n),o=t.mul(t.mul(i,Ee),n),a=t.mul(i,t.sub(o,t.ONE));if(!t.eql(t.sqr(a),r))throw new Error("Cannot find square root");return a}}return function(t){const e=(t-be)/Ee;let r,s,n;for(r=t-be,s=0;r%Ee===we;r/=Ee,s++);for(n=Ee;n<t&&Ie(n,e,t)!==t-be;n++);if(1===s){const e=(t+be)/ve;return function(t,r){const s=t.pow(r,e);if(!t.eql(t.sqr(s),r))throw new Error("Cannot find square root");return s}}const i=(r+be)/Ee;return function(t,o){if(t.pow(o,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let a=s,c=t.pow(t.mul(t.ONE,n),r),l=t.pow(o,i),u=t.pow(o,r);for(;!t.eql(u,t.ONE);){if(t.eql(u,t.ZERO))return t.ZERO;let e=1;for(let s=t.sqr(u);e<a&&!t.eql(s,t.ONE);e++)s=t.sqr(s);const r=t.pow(c,be<<BigInt(a-e-1));c=t.sqr(r),l=t.mul(l,r),u=t.mul(u,c),a=e}return l}}(t)}BigInt(9),BigInt(16);const Se=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Te(t,e){const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Oe(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function De(t){const e=Oe(t);return e+Math.ceil(e/2)}
|
|
@@ -9,4 +9,4 @@ const Ue=BigInt(0),Fe=BigInt(1);function Le(t){return ye(t.Fp,Se.reduce((t,e)=>(
|
|
|
9
9
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
10
10
|
const je=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),We=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_e=BigInt(1),Ze=BigInt(2),Ye=(t,e)=>(t+e/Ze)/e;const Xe=function(t,e,r=!1,s={}){if(t<=we)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:n,nByteLength:i}=Te(t,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=Re(t),a=Object.freeze({ORDER:t,BITS:n,BYTES:i,MASK:de(n),ZERO:we,ONE:be,create:e=>Be(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("Invalid field element: expected bigint, got "+typeof e);return we<=e&&e<t},is0:t=>t===we,isOdd:t=>(t&be)===be,neg:e=>Be(-e,t),eql:(t,e)=>t===e,sqr:e=>Be(e*e,t),add:(e,r)=>Be(e+r,t),sub:(e,r)=>Be(e-r,t),mul:(e,r)=>Be(e*r,t),pow:(t,e)=>function(t,e,r){if(r<we)throw new Error("Expected power > 0");if(r===we)return t.ONE;if(r===be)return e;let s=t.ONE,n=e;for(;r>we;)r&be&&(s=t.mul(s,n)),n=t.sqr(n),r>>=be;return s}(a,t,e),div:(e,r)=>Be(e*Ce(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>Ce(e,t),sqrt:s.sqrt||(t=>o(a,t)),invertBatch:t=>function(t,e){const r=new Array(e.length),s=e.reduce((e,s,n)=>t.is0(s)?e:(r[n]=e,t.mul(e,s)),t.ONE),n=t.inv(s);return e.reduceRight((e,s,n)=>t.is0(s)?e:(r[n]=t.mul(e,r[n]),t.mul(e,s)),n),r}(a,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?le(t,i):ce(t,i),fromBytes:t=>{if(t.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${t.length}`);return r?ae(t):oe(t)}});return Object.freeze(a)}(je,void 0,void 0,{sqrt:function(t){const e=je,r=BigInt(3),s=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,h=Ne(u,r,e)*u%e,d=Ne(h,r,e)*u%e,f=Ne(d,Ze,e)*l%e,p=Ne(f,n,e)*f%e,g=Ne(p,i,e)*p%e,m=Ne(g,a,e)*g%e,y=Ne(m,c,e)*m%e,A=Ne(y,a,e)*g%e,w=Ne(A,r,e)*u%e,b=Ne(w,o,e)*p%e,E=Ne(b,s,e)*l%e,k=Ne(E,Ze,e);if(!Xe.eql(Xe.sqr(k),t))throw new Error("Cannot find square root");return k}}),$e=function(t,e){const r=e=>qe({...t,...Je(e)});return Object.freeze({...r(e),create:r})}({a:BigInt(0),b:BigInt(7),Fp:Xe,n:We,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=We,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),s=-_e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,o=BigInt("0x100000000000000000000000000000000"),a=Ye(i*t,e),c=Ye(-s*t,e);let l=Be(t-a*r-c*n,e),u=Be(-a*s-c*i,e);const h=l>o,d=u>o;if(h&&(l=e-l),d&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:l,k2neg:d,k2:u}}}},V);BigInt(0),$e.ProjectivePoint;const tr="0x0000000000000000000000000000000000000000000000000000000000000000",er=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),rr=BigInt("1000000000000000000"),sr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),nr=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),ir=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),or="Ethereum Signed Message:\n",ar=BigInt(0),cr=BigInt(1),lr=BigInt(2),ur=BigInt(27),hr=BigInt(28),dr=BigInt(35),fr=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),pr=fr/lr,gr=Symbol.for("nodejs.util.inspect.custom"),mr={};function yr(e){return t.zeroPadValue(t.toBeArray(e),32)}class Ar{#k;#v;#x;#P;get r(){return this.#k}set r(e){t.assertArgument(32===t.dataLength(e),"invalid r","value",e),this.#k=t.hexlify(e)}get s(){return t.assertArgument(parseInt(this.#v.substring(0,3))<8,"non-canonical s; use ._s","s",this.#v),this.#v}set s(e){t.assertArgument(32===t.dataLength(e),"invalid s","value",e),this.#v=t.hexlify(e)}get _s(){return this.#v}isValid(){return BigInt(this.#v)<=pr}get v(){return this.#x}set v(e){const r=t.getNumber(e,"value");t.assertArgument(27===r||28===r,"invalid v","v",e),this.#x=r}get networkV(){return this.#P}get legacyChainId(){const t=this.networkV;return null==t?null:Ar.getChainId(t)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=t.getBytes(this.s);return this.yParity&&(e[0]|=128),t.hexlify(e)}get compactSerialized(){return t.concat([this.r,this.yParityAndS])}get serialized(){return t.concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,r,s,n){t.assertPrivate(e,mr,"Signature"),this.#k=r,this.#v=s,this.#x=n,this.#P=null}getCanonical(){if(this.isValid())return this;const t=fr-BigInt(this._s),e=55-this.v,r=new Ar(mr,this.r,yr(t),e);return this.networkV&&(r.#P=this.networkV),r}clone(){const t=new Ar(mr,this.r,this._s,this.v);return this.networkV&&(t.#P=this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:null!=t?t.toString():null,r:this.r,s:this._s,v:this.v}}[gr](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(e){const r=t.getBigInt(e,"v");return r==ur||r==hr?ar:(t.assertArgument(r>=dr,"invalid EIP-155 v","v",e),(r-dr)/lr)}static getChainIdV(e,r){return t.getBigInt(e)*lr+BigInt(35+r-27)}static getNormalizedV(e){const r=t.getBigInt(e);return r===ar||r===ur?27:r===cr||r===hr?28:(t.assertArgument(r>=dr,"invalid v","v",e),r&cr?27:28)}static from(e){function r(r,s){t.assertArgument(r,s,"signature",e)}if(null==e)return new Ar(mr,tr,tr,27);if("string"==typeof e){const s=t.getBytes(e,"signature");if(64===s.length){const e=t.hexlify(s.slice(0,32)),r=s.slice(32,64),n=128&r[0]?28:27;return r[0]&=127,new Ar(mr,e,t.hexlify(r),n)}if(65===s.length){const e=t.hexlify(s.slice(0,32)),r=t.hexlify(s.slice(32,64)),n=Ar.getNormalizedV(s[64]);return new Ar(mr,e,r,n)}r(!1,"invalid raw signature length")}if(e instanceof Ar)return e.clone();const s=e.r;r(null!=s,"missing r");const n=yr(s),i=function(e,s){if(null!=e)return yr(e);if(null!=s){r(t.isHexString(s,32),"invalid yParityAndS");const e=t.getBytes(s);return e[0]&=127,t.hexlify(e)}r(!1,"missing s")}(e.s,e.yParityAndS),{networkV:o,v:a}=function(e,s,n){if(null!=e){const r=t.getBigInt(e);return{networkV:r>=dr?r:void 0,v:Ar.getNormalizedV(r)}}if(null!=s)return r(t.isHexString(s,32),"invalid yParityAndS"),{v:128&t.getBytes(s)[0]?28:27};if(null!=n){switch(t.getNumber(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}r(!1,"invalid yParity")}r(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new Ar(mr,n,i,a);return o&&(c.#P=o),r(null==e.yParity||t.getNumber(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),r(null==e.yParityAndS||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}}class wr{#B;constructor(e){t.assertArgument(32===t.dataLength(e),"invalid private key","privateKey","[REDACTED]"),this.#B=t.hexlify(e)}get privateKey(){return this.#B}get publicKey(){return wr.computePublicKey(this.#B)}get compressedPublicKey(){return wr.computePublicKey(this.#B,!0)}sign(e){t.assertArgument(32===t.dataLength(e),"invalid digest length","digest",e);const r=$e.sign(t.getBytesCopy(e),t.getBytesCopy(this.#B),{lowS:!0});return Ar.from({r:t.toBeHex(r.r,32),s:t.toBeHex(r.s,32),v:r.recovery?28:27})}computeSharedSecret(e){const r=wr.computePublicKey(e);return t.hexlify($e.getSharedSecret(t.getBytesCopy(this.#B),t.getBytes(r),!1))}static computePublicKey(e,r){let s=t.getBytes(e,"key");if(32===s.length){const e=$e.getPublicKey(s,!!r);return t.hexlify(e)}if(64===s.length){const t=new Uint8Array(65);t[0]=4,t.set(s,1),s=t}const n=$e.ProjectivePoint.fromHex(s);return t.hexlify(n.toRawBytes(r))}static recoverPublicKey(e,r){t.assertArgument(32===t.dataLength(e),"invalid digest length","digest",e);const s=Ar.from(r);let n=$e.Signature.fromCompact(t.getBytesCopy(t.concat([s.r,s.s])));n=n.addRecoveryBit(s.yParity);const i=n.recoverPublicKey(t.getBytesCopy(e));return t.assertArgument(null!=i,"invalid signature for digest","signature",r),"0x"+i.toHex(!1)}static addPoints(t,e,r){const s=$e.ProjectivePoint.fromHex(wr.computePublicKey(t).substring(2)),n=$e.ProjectivePoint.fromHex(wr.computePublicKey(e).substring(2));return"0x"+s.add(n).toHex(!!r)}}function br(){st.lock(),t.keccak256.lock(),Pt.lock(),Ct.lock(),Et.lock(),Qt.lock(),zt.lock(),_t.lock(),Zt.lock(),Ct.lock()}function Er(e){const r=t.getAddress(e.from);let s=t.getBigInt(e.nonce,"tx.nonce").toString(16);return s="0"===s?"0x":s.length%2?"0x0"+s:"0x"+s,t.getAddress(t.dataSlice(t.keccak256(T([r,s])),12))}function kr(e,r,s){const n=t.getAddress(e),i=t.getBytes(r,"salt"),o=t.getBytes(s,"initCodeHash");return t.assertArgument(32===i.length,"salt must be 32 bytes","salt",r),t.assertArgument(32===o.length,"initCodeHash must be 32 bytes","initCodeHash",s),t.getAddress(t.dataSlice(t.keccak256(t.concat(["0xff",n,i,o])),12))}function vr(e){return{address:t.getAddress(e.address),nonce:t.getBigInt(null!=e.nonce?e.nonce:0),chainId:t.getBigInt(null!=e.chainId?e.chainId:0),signature:Ar.from(e.signature)}}function xr(e){let r;return r="string"==typeof e?wr.computePublicKey(e,!1):e.publicKey,t.getAddress(t.keccak256("0x"+r.substring(4)).substring(26))}function Pr(t,e){return xr(wr.recoverPublicKey(t,e))}const Br=BigInt(0),Ir=BigInt(2),Nr=BigInt(27),Cr=BigInt(28),Rr=BigInt(35),Sr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Tr=Symbol.for("nodejs.util.inspect.custom"),Or=131072,Dr=128;function Ur(t,e){let r=t.toString(16);for(;r.length<2;)r="0"+r;return r+=_t(e).substring(4),"0x"+r}function Fr(e){return"0x"===e?null:t.getAddress(e)}function Lr(e,r){try{return t.accessListify(e)}catch(s){t.assertArgument(!1,s.message,r,e)}}function Mr(e,r){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const r=[];for(let s=0;s<e.length;s++){const n=e[s];if(!Array.isArray(n))throw new Error(`authorization[${s}]: invalid array`);if(6!==n.length)throw new Error(`authorization[${s}]: wrong length`);if(!n[1])throw new Error(`authorization[${s}]: null address`);r.push({address:Fr(n[1]),nonce:Hr(n[2],"nonce"),chainId:Hr(n[0],"chainId"),signature:Ar.from({yParity:Gr(n[3],"yParity"),r:t.zeroPadValue(n[4],32),s:t.zeroPadValue(n[5],32)})})}return r}catch(s){t.assertArgument(!1,s.message,r,e)}}function Gr(e,r){return"0x"===e?0:t.getNumber(e,r)}function Hr(e,r){if("0x"===e)return Br;const s=t.getBigInt(e,r);return t.assertArgument(s<=Sr,"value exceeds uint size",r,s),s}function Qr(e,r){const s=t.getBigInt(e,"value"),n=t.toBeArray(s);return t.assertArgument(n.length<=32,"value too large",`tx.${r}`,s),n}function zr(e){return t.accessListify(e).map(t=>[t.address,t.storageKeys])}function Kr(e,r){t.assertArgument(Array.isArray(e),`invalid ${r}`,"value",e);for(let s=0;s<e.length;s++)t.assertArgument(t.isHexString(e[s],32),"invalid ${ param } hash",`value[${s}]`,e[s]);return e}function Vr(e,r){let s;try{if(s=Gr(r[0],"yParity"),0!==s&&1!==s)throw new Error("bad yParity")}catch(a){t.assertArgument(!1,"invalid yParity","yParity",r[0])}const n=t.zeroPadValue(r[1],32),i=t.zeroPadValue(r[2],32),o=Ar.from({r:n,s:i,yParity:s});e.signature=o}class qr{#I;#N;#C;#R;#S;#T;#O;#D;#U;#F;#L;#M;#G;#H;#Q;#z;#K;#V;get type(){return this.#I}set type(e){switch(e){case null:this.#I=null;break;case 0:case"legacy":this.#I=0;break;case 1:case"berlin":case"eip-2930":this.#I=1;break;case 2:case"london":case"eip-1559":this.#I=2;break;case 3:case"cancun":case"eip-4844":this.#I=3;break;case 4:case"pectra":case"eip-7702":this.#I=4;break;default:t.assertArgument(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#N;return null==e&&3===this.type?t.ZeroAddress:e}set to(e){this.#N=null==e?null:t.getAddress(e)}get nonce(){return this.#R}set nonce(e){this.#R=t.getNumber(e,"value")}get gasLimit(){return this.#S}set gasLimit(e){this.#S=t.getBigInt(e)}get gasPrice(){const t=this.#T;return null!=t||0!==this.type&&1!==this.type?t:Br}set gasPrice(e){this.#T=null==e?null:t.getBigInt(e,"gasPrice")}get maxPriorityFeePerGas(){const t=this.#O;return null==t?2===this.type||3===this.type?Br:null:t}set maxPriorityFeePerGas(e){this.#O=null==e?null:t.getBigInt(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const t=this.#D;return null==t?2===this.type||3===this.type?Br:null:t}set maxFeePerGas(e){this.#D=null==e?null:t.getBigInt(e,"maxFeePerGas")}get data(){return this.#C}set data(e){this.#C=t.hexlify(e)}get value(){return this.#U}set value(e){this.#U=t.getBigInt(e,"value")}get chainId(){return this.#F}set chainId(e){this.#F=t.getBigInt(e)}get signature(){return this.#L||null}set signature(t){this.#L=null==t?null:Ar.from(t)}isValid(){const t=this.signature;if(t&&!t.isValid())return!1;const e=this.authorizationList;if(e)for(const r of e)if(!r.signature.isValid())return!1;return!0}get accessList(){const t=this.#M||null;return null==t?1===this.type||2===this.type||3===this.type?[]:null:t}set accessList(e){this.#M=null==e?null:t.accessListify(e)}get authorizationList(){const t=this.#K||null;return null==t&&4===this.type?[]:t}set authorizationList(t){this.#K=null==t?null:t.map(t=>vr(t))}get maxFeePerBlobGas(){const t=this.#G;return null==t&&3===this.type?Br:t}set maxFeePerBlobGas(e){this.#G=null==e?null:t.getBigInt(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let t=this.#H;return null==t&&3===this.type?[]:t}set blobVersionedHashes(e){if(null!=e){t.assertArgument(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let r=0;r<e.length;r++)t.assertArgument(t.isHexString(e[r],32),"invalid blobVersionedHash",`value[${r}]`,e[r])}this.#H=e}get blobs(){return null==this.#z?null:this.#z.map(t=>Object.assign({},t))}set blobs(e){if(null==e)return void(this.#z=null);const r=[],s=[];for(let n=0;n<e.length;n++){const i=e[n];if(t.isBytesLike(i)){t.assert(this.#Q,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=t.getBytes(i);if(t.assertArgument(e.length<=Or,"blob is too large",`blobs[${n}]`,i),e.length!==Or){const t=new Uint8Array(Or);t.set(e),e=t}const o=this.#Q.blobToKzgCommitment(e),a=t.hexlify(this.#Q.computeBlobKzgProof(e,o));r.push({data:t.hexlify(e),commitment:t.hexlify(o),proof:a}),s.push(Ur(1,o))}else{const e=t.hexlify(i.data),n=t.hexlify(i.commitment),o=t.hexlify(i.proof);r.push({data:e,commitment:n,proof:o}),s.push(Ur(1,n))}}this.#z=r,this.#H=s}get kzg(){return this.#Q}set kzg(e){this.#Q=null==e?null:function(e){return{blobToKzgCommitment:r=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return t.getBytes(e.blobToKzgCommitment(t.hexlify(r)))}else if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return t.getBytes(e.blobToKzgCommitment(r));if("blobToKZGCommitment"in e&&"function"==typeof e.blobToKZGCommitment)return t.getBytes(e.blobToKZGCommitment(t.hexlify(r)));t.assertArgument(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(r,s)=>"computeBlobProof"in e&&"function"==typeof e.computeBlobProof?t.getBytes(e.computeBlobProof(t.hexlify(r),t.hexlify(s))):"computeBlobKzgProof"in e&&"function"==typeof e.computeBlobKzgProof?e.computeBlobKzgProof(r,s):"computeBlobKZGProof"in e&&"function"==typeof e.computeBlobKZGProof?t.getBytes(e.computeBlobKZGProof(t.hexlify(r),t.hexlify(s))):void t.assertArgument(!1,"unsupported KZG library","kzg",e)}}(e)}get blobWrapperVersion(){return this.#V}set blobWrapperVersion(t){this.#V=t}constructor(){this.#I=null,this.#N=null,this.#R=0,this.#S=Br,this.#T=null,this.#O=null,this.#D=null,this.#C="0x",this.#U=Br,this.#F=Br,this.#L=null,this.#M=null,this.#G=null,this.#H=null,this.#Q=null,this.#z=null,this.#K=null,this.#V=null}get hash(){return null==this.signature?null:t.keccak256(this.#q(!0,!1))}get unsignedHash(){return t.keccak256(this.unsignedSerialized)}get from(){return null==this.signature?null:Pr(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return null==this.signature?null:wr.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return null!=this.signature}#q(e,r){t.assert(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const s=e?this.signature:null;switch(this.inferType()){case 0:return function(e,r){const s=[Qr(e.nonce,"nonce"),Qr(e.gasPrice||0,"gasPrice"),Qr(e.gasLimit,"gasLimit"),e.to||"0x",Qr(e.value,"value"),e.data];let n=Br;if(e.chainId!=Br)n=t.getBigInt(e.chainId,"tx.chainId"),t.assertArgument(!r||null==r.networkV||r.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",r);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(n=t)}if(!r)return n!==Br&&(s.push(t.toBeArray(n)),s.push("0x"),s.push("0x")),T(s);let i=BigInt(27+r.yParity);return n!==Br?i=Ar.getChainIdV(n,r.v):BigInt(r.v)!==i&&t.assertArgument(!1,"tx.chainId/sig.v mismatch","sig",r),s.push(t.toBeArray(i)),s.push(t.toBeArray(r.r)),s.push(t.toBeArray(r._s)),T(s)}(this,s);case 1:return function(e,r){const s=[Qr(e.chainId,"chainId"),Qr(e.nonce,"nonce"),Qr(e.gasPrice||0,"gasPrice"),Qr(e.gasLimit,"gasLimit"),e.to||"0x",Qr(e.value,"value"),e.data,zr(e.accessList||[])];return r&&(s.push(Qr(r.yParity,"recoveryParam")),s.push(t.toBeArray(r.r)),s.push(t.toBeArray(r.s))),t.concat(["0x01",T(s)])}(this,s);case 2:return function(e,r){const s=[Qr(e.chainId,"chainId"),Qr(e.nonce,"nonce"),Qr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Qr(e.maxFeePerGas||0,"maxFeePerGas"),Qr(e.gasLimit,"gasLimit"),e.to||"0x",Qr(e.value,"value"),e.data,zr(e.accessList||[])];return r&&(s.push(Qr(r.yParity,"yParity")),s.push(t.toBeArray(r.r)),s.push(t.toBeArray(r.s))),t.concat(["0x02",T(s)])}(this,s);case 3:return function(e,r,s){const n=[Qr(e.chainId,"chainId"),Qr(e.nonce,"nonce"),Qr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Qr(e.maxFeePerGas||0,"maxFeePerGas"),Qr(e.gasLimit,"gasLimit"),e.to||t.ZeroAddress,Qr(e.value,"value"),e.data,zr(e.accessList||[]),Qr(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Kr(e.blobVersionedHashes||[],"blobVersionedHashes")];if(r&&(n.push(Qr(r.yParity,"yParity")),n.push(t.toBeArray(r.r)),n.push(t.toBeArray(r.s)),s)){if(null!=e.blobWrapperVersion){const r=t.toBeArray(e.blobWrapperVersion),i=[];for(const{proof:e}of s){const r=t.getBytes(e),s=r.length/Dr;for(let t=0;t<r.length;t+=s)i.push(r.subarray(t,t+s))}return t.concat(["0x03",T([n,r,s.map(t=>t.data),s.map(t=>t.commitment),i])])}return t.concat(["0x03",T([n,s.map(t=>t.data),s.map(t=>t.commitment),s.map(t=>t.proof)])])}return t.concat(["0x03",T(n)])}(this,s,r?this.blobs:null);case 4:return function(e,r){const s=[Qr(e.chainId,"chainId"),Qr(e.nonce,"nonce"),Qr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Qr(e.maxFeePerGas||0,"maxFeePerGas"),Qr(e.gasLimit,"gasLimit"),e.to||"0x",Qr(e.value,"value"),e.data,zr(e.accessList||[]),(n=e.authorizationList||[],n.map(e=>[Qr(e.chainId,"chainId"),e.address,Qr(e.nonce,"nonce"),Qr(e.signature.yParity,"yParity"),t.toBeArray(e.signature.r),t.toBeArray(e.signature._s)]))];var n;return r&&(s.push(Qr(r.yParity,"yParity")),s.push(t.toBeArray(r.r)),s.push(t.toBeArray(r.s))),t.concat(["0x04",T(s)])}(this,s)}t.assert(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#q(!0,!0)}get unsignedSerialized(){return this.#q(!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const e=null!=this.gasPrice,r=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,s=null!=this.accessList,n=null!=this.#G||this.#H;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&t.assert(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),t.assert(!r||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),t.assert(0!==this.type||!s,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):r?i.push(2):e?(i.push(1),s||i.push(0)):s?(i.push(1),i.push(2)):(n&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return qr.from(this)}toJSON(){const t=t=>null==t?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[Tr](){return this.toString()}toString(){const t=[],e=e=>{let r=this[e];"string"==typeof r&&(r=JSON.stringify(r)),t.push(`${e}: ${r}`)};this.type&&e("type"),e("to"),e("data"),e("nonce"),e("gasLimit"),e("value"),null!=this.chainId&&e("chainId"),this.signature&&(e("from"),t.push(`signature: ${this.signature.toString()}`));const r=this.authorizationList;if(r){const e=[];for(const t of r){const r=[];r.push(`address: ${JSON.stringify(t.address)}`),null!=t.nonce&&r.push(`nonce: ${t.nonce}`),null!=t.chainId&&r.push(`chainId: ${t.chainId}`),t.signature&&r.push(`signature: ${t.signature.toString()}`),e.push(`Authorization { ${r.join(", ")} }`)}t.push(`authorizations: [ ${e.join(", ")} ]`)}return`Transaction { ${t.join(", ")} }`}static from(e){if(null==e)return new qr;if("string"==typeof e){const r=t.getBytes(e);if(r[0]>=127)return qr.from(function(e){const r=N(e);t.assertArgument(Array.isArray(r)&&(9===r.length||6===r.length),"invalid field count for legacy transaction","data",e);const s={type:0,nonce:Gr(r[0],"nonce"),gasPrice:Hr(r[1],"gasPrice"),gasLimit:Hr(r[2],"gasLimit"),to:Fr(r[3]),value:Hr(r[4],"value"),data:t.hexlify(r[5]),chainId:Br};if(6===r.length)return s;const n=Hr(r[6],"v"),i=Hr(r[7],"r"),o=Hr(r[8],"s");if(i===Br&&o===Br)s.chainId=n;else{let e=(n-Rr)/Ir;e<Br&&(e=Br),s.chainId=e,t.assertArgument(e!==Br||n===Nr||n===Cr,"non-canonical legacy v","v",r[6]),s.signature=Ar.from({r:t.zeroPadValue(r[7],32),s:t.zeroPadValue(r[8],32),v:n})}return s}(r));switch(r[0]){case 1:return qr.from(function(e){const r=N(t.getBytes(e).slice(1));t.assertArgument(Array.isArray(r)&&(8===r.length||11===r.length),"invalid field count for transaction type: 1","data",t.hexlify(e));const s={type:1,chainId:Hr(r[0],"chainId"),nonce:Gr(r[1],"nonce"),gasPrice:Hr(r[2],"gasPrice"),gasLimit:Hr(r[3],"gasLimit"),to:Fr(r[4]),value:Hr(r[5],"value"),data:t.hexlify(r[6]),accessList:Lr(r[7],"accessList")};return 8===r.length||Vr(s,r.slice(8)),s}(r));case 2:return qr.from(function(e){const r=N(t.getBytes(e).slice(1));t.assertArgument(Array.isArray(r)&&(9===r.length||12===r.length),"invalid field count for transaction type: 2","data",t.hexlify(e));const s={type:2,chainId:Hr(r[0],"chainId"),nonce:Gr(r[1],"nonce"),maxPriorityFeePerGas:Hr(r[2],"maxPriorityFeePerGas"),maxFeePerGas:Hr(r[3],"maxFeePerGas"),gasPrice:null,gasLimit:Hr(r[4],"gasLimit"),to:Fr(r[5]),value:Hr(r[6],"value"),data:t.hexlify(r[7]),accessList:Lr(r[8],"accessList")};return 9===r.length||Vr(s,r.slice(9)),s}(r));case 3:return qr.from(function(e){let r=N(t.getBytes(e).slice(1)),s="3",n=null,i=null;if(4===r.length&&Array.isArray(r[0])){s="3 (network format)";const e=r[1],n=r[2],o=r[3];t.assertArgument(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),t.assertArgument(Array.isArray(n),"invalid network format: commitments not an array","fields[2]",n),t.assertArgument(Array.isArray(o),"invalid network format: proofs not an array","fields[3]",o),t.assertArgument(e.length===n.length,"invalid network format: blobs/commitments length mismatch","fields",r),t.assertArgument(e.length===o.length,"invalid network format: blobs/proofs length mismatch","fields",r),i=[];for(let t=0;t<r[1].length;t++)i.push({data:e[t],commitment:n[t],proof:o[t]});r=r[0]}else if(5===r.length&&Array.isArray(r[0])){s="3 (EIP-7594 network format)",n=t.getNumber(r[1]);const e=r[2],o=r[3],a=r[4];t.assertArgument(1===n,`unsupported EIP-7594 network format version: ${n}`,"fields[1]",n),t.assertArgument(Array.isArray(e),"invalid EIP-7594 network format: blobs not an array","fields[2]",e),t.assertArgument(Array.isArray(o),"invalid EIP-7594 network format: commitments not an array","fields[3]",o),t.assertArgument(Array.isArray(a),"invalid EIP-7594 network format: proofs not an array","fields[4]",a),t.assertArgument(e.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",r),t.assertArgument(e.length*Dr===a.length,"invalid network format: blobs/proofs length mismatch","fields",r),i=[];for(let r=0;r<e.length;r++){const s=[];for(let t=0;t<Dr;t++)s.push(a[r*Dr+t]);i.push({data:e[r],commitment:o[r],proof:t.concat(s)})}r=r[0]}t.assertArgument(Array.isArray(r)&&(11===r.length||14===r.length),`invalid field count for transaction type: ${s}`,"data",t.hexlify(e));const o={type:3,chainId:Hr(r[0],"chainId"),nonce:Gr(r[1],"nonce"),maxPriorityFeePerGas:Hr(r[2],"maxPriorityFeePerGas"),maxFeePerGas:Hr(r[3],"maxFeePerGas"),gasPrice:null,gasLimit:Hr(r[4],"gasLimit"),to:Fr(r[5]),value:Hr(r[6],"value"),data:t.hexlify(r[7]),accessList:Lr(r[8],"accessList"),maxFeePerBlobGas:Hr(r[9],"maxFeePerBlobGas"),blobVersionedHashes:r[10],blobWrapperVersion:n};i&&(o.blobs=i),t.assertArgument(null!=o.to,`invalid address for transaction type: ${s}`,"data",e),t.assertArgument(Array.isArray(o.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let a=0;a<o.blobVersionedHashes.length;a++)t.assertArgument(t.isHexString(o.blobVersionedHashes[a],32),`invalid blobVersionedHash at index ${a}: must be length 32`,"data",e);return 11===r.length||Vr(o,r.slice(11)),o}(r));case 4:return qr.from(function(e){const r=N(t.getBytes(e).slice(1));t.assertArgument(Array.isArray(r)&&(10===r.length||13===r.length),"invalid field count for transaction type: 4","data",t.hexlify(e));const s={type:4,chainId:Hr(r[0],"chainId"),nonce:Gr(r[1],"nonce"),maxPriorityFeePerGas:Hr(r[2],"maxPriorityFeePerGas"),maxFeePerGas:Hr(r[3],"maxFeePerGas"),gasPrice:null,gasLimit:Hr(r[4],"gasLimit"),to:Fr(r[5]),value:Hr(r[6],"value"),data:t.hexlify(r[7]),accessList:Lr(r[8],"accessList"),authorizationList:Mr(r[9],"authorizationList")};return 10===r.length||Vr(s,r.slice(10)),s}(r))}t.assert(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const r=new qr;return null!=e.type&&(r.type=e.type),null!=e.to&&(r.to=e.to),null!=e.nonce&&(r.nonce=e.nonce),null!=e.gasLimit&&(r.gasLimit=e.gasLimit),null!=e.gasPrice&&(r.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(r.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(r.data=e.data),null!=e.value&&(r.value=e.value),null!=e.chainId&&(r.chainId=e.chainId),null!=e.signature&&(r.signature=Ar.from(e.signature)),null!=e.accessList&&(r.accessList=e.accessList),null!=e.authorizationList&&(r.authorizationList=e.authorizationList),null!=e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(r.kzg=e.kzg),null!=e.blobWrapperVersion&&(r.blobWrapperVersion=e.blobWrapperVersion),null!=e.blobs&&(r.blobs=e.blobs),null!=e.hash&&(t.assertArgument(r.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),t.assertArgument(r.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&(t.assertArgument(r.isSigned(),"unsigned transaction cannot define '.from'","tx",e),t.assertArgument(r.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),r}}function Jr(e){return t.assertArgument("string"==typeof e.address,"invalid address for hashAuthorization","auth.address",e),t.keccak256(t.concat(["0x05",T([null!=e.chainId?t.toBeArray(e.chainId):"0x",t.getAddress(e.address),null!=e.nonce?t.toBeArray(e.nonce):"0x"])]))}function jr(t,e){return Pr(Jr(t),e)}const Wr=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function _r(t){return function(t){let e=0;return()=>t[e++]}(function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let s=r(),n=1,i=[0,1];for(let b=1;b<s;b++)i.push(n+=r());let o=r(),a=e;e+=o;let c=0,l=0;function u(){return 0==c&&(l=l<<8|t[e++],c=8),l>>--c&1}const h=2**31,d=h>>>1,f=d>>1,p=h-1;let g=0;for(let b=0;b<31;b++)g=g<<1|u();let m=[],y=0,A=h;for(;;){let t=Math.floor(((g-y+1)*n-1)/A),e=0,r=s;for(;r-e>1;){let s=e+r>>>1;t<i[s]?r=s:e=s}if(0==e)break;m.push(e);let o=y+Math.floor(A*i[e]/n),a=y+Math.floor(A*i[e+1]/n)-1;for(;0==((o^a)&d);)g=g<<1&p|u(),o=o<<1&p,a=a<<1&p|1;for(;o&~a&f;)g=g&d|g<<1&p>>>1|u(),o=o<<1^d,a=(a^d)<<1|d|1;y=o,A=1+a-o}let w=s-4;return m.map(e=>{switch(e-w){case 3:return w+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return w+256+(t[a++]<<8|t[a++]);case 1:return w+t[a++];default:return e-1}})}(function(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((t,r)=>e[t.charCodeAt(0)]=r);let r=t.length,s=new Uint8Array(6*r>>3);for(let n=0,i=0,o=0,a=0;n<r;n++)a=a<<6|e[t.charCodeAt(n)],o+=6,o>=8&&(s[i++]=a>>(o-=8));return s}(t)))}function Zr(t){return 1&t?~t>>1:t>>1}function Yr(t,e){let r=Array(t);for(let s=0,n=0;s<t;s++)r[s]=n+=Zr(e());return r}function Xr(t,e=0){let r=[];for(;;){let s=t(),n=t();if(!n)break;e+=s;for(let t=0;t<n;t++)r.push(e+t);e+=n+1}return r}function $r(t){return es(()=>{let e=Xr(t);if(e.length)return e})}function ts(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(ss(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(ns(r,t))}return e.flat()}function es(t){let e=[];for(;;){let r=t(e.length);if(!r)break;e.push(r)}return e}function rs(t,e,r){let s=Array(t).fill().map(()=>[]);for(let n=0;n<e;n++)Yr(t,r).forEach((t,e)=>s[e].push(t));return s}function ss(t,e){let r=1+e(),s=e(),n=es(e);return rs(n.length,1+t,e).flatMap((t,e)=>{let[i,...o]=t;return Array(n[e]).fill().map((t,e)=>{let n=e*s;return[i+e*r,o.map(t=>t+n)]})})}function ns(t,e){return rs(1+e(),1+t,e).map(t=>[t[0],t.slice(1)])}function is(t){return`{${function(t){return t.toString(16).toUpperCase().padStart(2,"0")}(t)}}`}function os(t){let e=t.length;if(e<4096)return String.fromCodePoint(...t);let r=[];for(let s=0;s<e;)r.push(String.fromCodePoint(...t.slice(s,s+=4096)));return r.join("")}function as(t,e){let r=t.length,s=r-e.length;for(let n=0;0==s&&n<r;n++)s=t[n]-e[n];return s}const cs=44032,ls=4352,us=4449,hs=4519,ds=28,fs=588;function ps(t){return t>>24&255}function gs(t){return 16777215&t}let ms,ys,As,ws;function bs(t){return t>=cs&&t<55204}function Es(t,e){if(t>=ls&&t<4371&&e>=us&&e<4470)return cs+(t-ls)*fs+(e-us)*ds;if(bs(t)&&e>hs&&e<4547&&(t-cs)%ds==0)return t+(e-hs);{let r=ws.get(t);return r&&(r=r.get(e),r)?r:-1}}function ks(t){ms||function(){let t=_r("AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/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]))),ys=new Set(Xr(t)),As=new Map,ws=new Map;for(let[e,r]of ts(t)){if(!ys.has(e)&&2==r.length){let[t,s]=r,n=ws.get(t);n||(n=new Map,ws.set(t,n)),n.set(s,e)}As.set(e,r.reverse())}}();let e=[],r=[],s=!1;function n(t){let r=ms.get(t);r&&(s=!0,t|=r),e.push(t)}for(let i of t)for(;;){if(i<128)e.push(i);else if(bs(i)){let t=i-cs,e=t%fs/ds|0,r=t%ds;n(ls+(t/fs|0)),n(us+e),r>0&&n(hs+r)}else{let t=As.get(i);t?r.push(...t):n(i)}if(!r.length)break;i=r.pop()}if(s&&e.length>1){let t=ps(e[0]);for(let r=1;r<e.length;r++){let s=ps(e[r]);if(0==s||t<=s){t=s;continue}let n=r-1;for(;;){let r=e[n+1];if(e[n+1]=e[n],e[n]=r,!n)break;if(t=ps(e[--n]),t<=s)break}t=ps(e[r])}}return e}function vs(t){return ks(t).map(gs)}function xs(t){return function(t){let e=[],r=[],s=-1,n=0;for(let i of t){let t=ps(i),o=gs(i);if(-1==s)0==t?s=o:e.push(o);else if(n>0&&n>=t)0==t?(e.push(s,...r),r.length=0,s=o):r.push(o),n=t;else{let i=Es(s,o);i>=0?s=i:0==n&&0==t?(e.push(s),s=o):(r.push(o),n=t)}}return s>=0&&e.push(s,...r),e}(ks(t))}const Ps=".",Bs=t=>Array.from(t);function Is(t,e){return t.P.has(e)||t.Q.has(e)}class Ns extends Array{get is_emoji(){return!0}}let Cs,Rs,Ss,Ts,Os,Ds,Us,Fs,Ls,Ms,Gs;function Hs(){if(Cs)return;let t=_r("AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r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jYYoE7xMfWV2HN2iyIqLI");const e=()=>Xr(t),r=()=>new Set(e()),s=(t,e)=>e.forEach(e=>t.add(e));Cs=new Map(ts(t)),Rs=r(),Ss=e(),Ts=new Set(e().map(t=>Ss[t])),Ss=new Set(Ss),Os=r(),r();let n=$r(t),i=t();const o=()=>{let t=new Set;return e().forEach(e=>s(t,n[e])),s(t,e()),t};Ds=es(e=>{let r=es(t).map(t=>t+96);if(r.length){let s=e>=i;return r[0]-=32,r=os(r),s&&(r=`Restricted[${r}]`),{N:r,P:o(),Q:o(),M:!t(),R:s}}}),Us=r(),Fs=new Map;let a=e().concat(Bs(Us)).sort((t,e)=>t-e);a.forEach((e,r)=>{let s=t(),n=a[r]=s?a[r-s]:{V:[],M:new Map};n.V.push(e),Us.has(e)||Fs.set(e,n)});for(let{V:u,M:h}of new Set(Fs.values())){let t=[];for(let r of u){let e=Ds.filter(t=>Is(t,r)),n=t.find(({G:t})=>e.some(e=>t.has(e)));n||(n={G:new Set,V:[]},t.push(n)),n.V.push(r),s(n.G,e)}let e=t.flatMap(t=>Bs(t.G));for(let{G:r,V:s}of t){let t=new Set(e.filter(t=>!r.has(t)));for(let e of s)h.set(e,t)}}Ls=new Set;let c=new Set;const l=t=>Ls.has(t)?c.add(t):Ls.add(t);for(let u of Ds){for(let t of u.P)l(t);for(let t of u.Q)l(t)}for(let u of Ls)Fs.has(u)||c.has(u)||Fs.set(u,1);s(Ls,vs(Ls)),Ms=function(t){let e=[],r=Xr(t);return function t({S:r,B:s},n,i){if(!(4&r&&i===n[n.length-1])){2&r&&(i=n[n.length-1]),1&r&&e.push(n);for(let e of s)for(let r of e.Q)t(e,[...n,r],i)}}(function e(s){return{S:t(),B:es(()=>{let s=Xr(t).map(t=>r[t]);if(s.length)return e(s)}),Q:s}}([]),[]),e}(t).map(t=>Ns.from(t)).sort(as),Gs=new Map;for(let u of Ms){let t=[Gs];for(let e of u){let r=t.map(t=>{let r=t.get(e);return r||(r=new Map,t.set(e,r)),r});65039===e?t.push(...r):t=r}for(let e of t)e.V=u}}function Qs(t){return(Vs(t)?"":`${zs(Ks([t]))} `)+is(t)}function zs(t){return`"${t}"`}function Ks(t,e=1/0,r=is){let s=[];var n;n=t[0],Hs(),Ss.has(n)&&s.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,o=t.length;for(let a=0;a<o;a++){let e=t[a];Vs(e)&&(s.push(os(t.slice(i,a))),s.push(r(e)),i=a+1)}return s.push(os(t.slice(i,o))),s.join("")}function Vs(t){return Hs(),Os.has(t)}function qs(t){return e=function(t,e,r){if(!t)return[];Hs();let s=0;return t.split(Ps).map(t=>{let n=function(t){let e=[];for(let r=0,s=t.length;r<s;){let s=t.codePointAt(r);r+=s<65536?1:2,e.push(s)}return e}(t),i={input:n,offset:s};s+=n.length+1;try{let t,s=i.tokens=function(t,e,r){let s=[],n=[];for(t=t.slice().reverse();t.length;){let i=Zs(t);if(i)n.length&&(s.push(e(n)),n=[]),s.push(r(i));else{let e=t.pop();if(Ls.has(e))n.push(e);else{let t=Cs.get(e);if(t)n.push(...t);else if(!Rs.has(e))throw Js(e)}}}return n.length&&s.push(e(n)),s}(n,e,r),o=s.length;if(!o)throw new Error("empty label");let a=i.output=s.flat();if(function(t){for(let e=t.lastIndexOf(95);e>0;)if(95!==t[--e])throw new Error("underscore allowed only at start")}(a),!(i.emoji=o>1||s[0].is_emoji)&&a.every(t=>t<128))!function(t){if(t.length>=4&&45==t[2]&&45==t[3])throw new Error(`invalid label extension: "${os(t.slice(0,4))}"`)}(a),t="ASCII";else{let e=s.flatMap(t=>t.is_emoji?[]:t);if(e.length){if(Ss.has(a[0]))throw Ws("leading combining mark");for(let t=1;t<o;t++){let e=s[t];if(!e.is_emoji&&Ss.has(e[0]))throw Ws(`emoji + combining mark: "${os(s[t-1])} + ${Ks([e[0]])}"`)}!function(t){let e=t[0],r=Wr.get(e);if(r)throw Ws(`leading ${r}`);let s=t.length,n=-1;for(let i=1;i<s;i++){e=t[i];let s=Wr.get(e);if(s){if(n==i)throw Ws(`${r} + ${s}`);n=i+1,r=s}}if(n==s)throw Ws(`trailing ${r}`)}(a);let r=Bs(new Set(e)),[n]=function(t){let e=Ds;for(let r of t){let t=e.filter(t=>Is(t,r));if(!t.length)throw Ds.some(t=>Is(t,r))?js(e[0],r):Js(r);if(e=t,1==t.length)break}return e}(r);!function(t,e){for(let r of e)if(!Is(t,r))throw js(t,r);if(t.M){let t=vs(e);for(let e=1,r=t.length;e<r;e++)if(Ts.has(t[e])){let s=e+1;for(let n;s<r&&Ts.has(n=t[s]);s++)for(let r=e;r<s;r++)if(t[r]==n)throw new Error(`duplicate non-spacing marks: ${Qs(n)}`);if(s-e>4)throw new Error(`excessive non-spacing marks: ${zs(Ks(t.slice(e-1,s)))} (${s-e}/4)`);e=s}}}(n,e),function(t,e){let r,s=[];for(let n of e){let t=Fs.get(n);if(1===t)return;if(t){let e=t.M.get(n);if(r=r?r.filter(t=>e.has(t)):Bs(e),!r.length)return}else s.push(n)}if(r)for(let n of r)if(s.every(t=>Is(n,t)))throw new Error(`whole-script confusable: ${t.N}/${n.N}`)}(n,r),t=n.N}else t="Emoji"}i.type=t}catch(o){i.error=o}return i})}(t,xs,_s),e.map(({input:t,error:r,output:s})=>{if(r){let s=r.message;throw new Error(1==e.length?s:`Invalid label ${zs(Ks(t,63))}: ${s}`)}return os(s)}).join(Ps);var e}function Js(t){return new Error(`disallowed character: ${Qs(t)}`)}function js(t,e){let r=Qs(e),s=Ds.find(t=>t.P.has(e));return s&&(r=`${s.N} ${r}`),new Error(`illegal mixture: ${t.N} + ${r}`)}function Ws(t){return new Error(`illegal placement: ${t}`)}function _s(t){return t.filter(t=>65039!=t)}function Zs(t,e){let r,s=Gs,n=t.length;for(;n&&(s=s.get(t[--n]),s);){let{V:e}=s;e&&(r=e,t.length=n)}return r}const Ys=new Uint8Array(32);function Xs(e){return t.assertArgument(0!==e.length,"invalid ENS name; empty component","comp",e),e}function $s(e){const r=t.toUtf8Bytes(tn(e)),s=[];if(0===e.length)return s;let n=0;for(let t=0;t<r.length;t++){46===r[t]&&(s.push(Xs(r.slice(n,t))),n=t+1)}return t.assertArgument(n<r.length,"invalid ENS name; empty component","name",e),s.push(Xs(r.slice(n))),s}function tn(e){try{if(0===e.length)throw new Error("empty label");return qs(e)}catch(r){t.assertArgument(!1,`invalid ENS name (${r.message})`,"name",e)}}function en(t){try{return 0!==$s(t).length}catch(e){}return!1}function rn(e){t.assertArgument("string"==typeof e,"invalid ENS name; not a string","name",e),t.assertArgument(e.length,"invalid ENS name (empty label)","name",e);let r=Ys;const s=$s(e);for(;s.length;)r=t.keccak256(t.concat([r,t.keccak256(s.pop())]));return t.hexlify(r)}function sn(e,r){const s=null!=r?r:63;return t.assertArgument(s<=255,"DNS encoded label cannot exceed 255","length",s),t.hexlify(t.concat($s(e).map(r=>{t.assertArgument(r.length<=s,`label ${JSON.stringify(e)} exceeds ${s} bytes`,"name",e);const n=new Uint8Array(r.length+1);return n.set(r,1),n[0]=n.length-1,n})))+"00"}function nn(e){return"string"==typeof e&&(e=t.toUtf8Bytes(e)),t.keccak256(t.concat([t.toUtf8Bytes(or),t.toUtf8Bytes(String(e.length)),e]))}function on(t,e){return Pr(nn(t),e)}Ys.fill(0);const an=new RegExp("^bytes([0-9]+)$"),cn=new RegExp("^(u?int)([0-9]*)$"),ln=new RegExp("^(.*)\\[([0-9]*)\\]$");function un(e,r,s){switch(e){case"address":return s?t.getBytes(t.zeroPadValue(r,32)):t.getBytes(t.getAddress(r));case"string":return t.toUtf8Bytes(r);case"bytes":return t.getBytes(r);case"bool":return r=r?"0x01":"0x00",s?t.getBytes(t.zeroPadValue(r,32)):t.getBytes(r)}let n=e.match(cn);if(n){let i="int"===n[1],o=parseInt(n[2]||"256");return t.assertArgument((!n[2]||n[2]===String(o))&&o%8==0&&0!==o&&o<=256,"invalid number type","type",e),s&&(o=256),i&&(r=t.toTwos(r,o)),t.getBytes(t.zeroPadValue(t.toBeArray(r),o/8))}if(n=e.match(an),n){const i=parseInt(n[1]);return t.assertArgument(String(i)===n[1]&&0!==i&&i<=32,"invalid bytes type","type",e),t.assertArgument(t.dataLength(r)===i,`invalid value for ${e}`,"value",r),s?t.getBytes(t.zeroPadBytes(r,32)):r}if(n=e.match(ln),n&&Array.isArray(r)){const s=n[1],i=parseInt(n[2]||String(r.length));t.assertArgument(i===r.length,`invalid array length for ${e}`,"value",r);const o=[];return r.forEach(function(t){o.push(un(s,t,!0))}),t.getBytes(t.concat(o))}t.assertArgument(!1,"invalid type","type",e)}function hn(e,r){t.assertArgument(e.length===r.length,"wrong number of values; expected ${ types.length }","values",r);const s=[];return e.forEach(function(t,e){s.push(un(t,r[e]))}),t.hexlify(t.concat(s))}function dn(e,r){return t.keccak256(hn(e,r))}function fn(t,e){return _t(hn(t,e))}const pn=new Uint8Array(32);pn.fill(0);const gn=BigInt(-1),mn=BigInt(0),yn=BigInt(1),An=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const wn=t.toBeHex(yn,32),bn=t.toBeHex(mn,32),En={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},kn=["name","version","chainId","verifyingContract","salt"];function vn(e){return function(r){return t.assertArgument("string"==typeof r,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,r),r}}const xn={name:vn("name"),version:vn("version"),chainId:function(e){const r=t.getBigInt(e,"domain.chainId");return t.assertArgument(r>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(r)?Number(r):t.toQuantity(r)},verifyingContract:function(e){try{return t.getAddress(e).toLowerCase()}catch(r){}t.assertArgument(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const r=t.getBytes(e,"domain.salt");return t.assertArgument(32===r.length,'invalid domain value "salt"',"domain.salt",e),t.hexlify(r)}};function Pn(e){{const r=e.match(/^(u?)int(\d+)$/);if(r){const s=""===r[1],n=parseInt(r[2]);t.assertArgument(n%8==0&&0!==n&&n<=256&&r[2]===String(n),"invalid numeric width","type",e);const i=t.mask(An,s?n-1:n),o=s?(i+yn)*gn:mn;return function(r){const n=t.getBigInt(r,"value");return t.assertArgument(n>=o&&n<=i,`value out-of-bounds for ${e}`,"value",n),t.toBeHex(s?t.toTwos(n,256):n,32)}}}{const r=e.match(/^bytes(\d+)$/);if(r){const s=parseInt(r[1]);return t.assertArgument(0!==s&&s<=32&&r[1]===String(s),"invalid bytes width","type",e),function(r){const n=t.getBytes(r);return t.assertArgument(n.length===s,`invalid length for ${e}`,"value",r),function(e){const r=t.getBytes(e),s=r.length%32;return s?t.concat([r,pn.slice(s)]):t.hexlify(r)}(r)}}}switch(e){case"address":return function(e){return t.zeroPadValue(t.getAddress(e),32)};case"bool":return function(t){return t?wn:bn};case"bytes":return function(e){return t.keccak256(e)};case"string":return function(e){return t.id(e)}}return null}function Bn(t,e){return`${t}(${e.map(({name:t,type:e})=>e+" "+t).join(",")})`}function In(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}class Nn{primaryType;#J;get types(){return JSON.parse(this.#J)}#j;#W;constructor(e){this.#j=new Map,this.#W=new Map;const r=new Map,s=new Map,n=new Map,i={};Object.keys(e).forEach(t=>{i[t]=e[t].map(({name:t,type:r})=>{let{base:s,index:n}=In(r);return"int"!==s||e.int||(s="int256"),"uint"!==s||e.uint||(s="uint256"),{name:t,type:s+(n||"")}}),r.set(t,new Set),s.set(t,[]),n.set(t,new Set)}),this.#J=JSON.stringify(i);for(const a in i){const n=new Set;for(const o of i[a]){t.assertArgument(!n.has(o.name),`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(a)}`,"types",e),n.add(o.name);const i=In(o.type).base;t.assertArgument(i!==a,`circular type reference to ${JSON.stringify(i)}`,"types",e);Pn(i)||(t.assertArgument(s.has(i),`unknown type ${JSON.stringify(i)}`,"types",e),s.get(i).push(a),r.get(a).add(i))}}const o=Array.from(s.keys()).filter(t=>0===s.get(t).length);t.assertArgument(0!==o.length,"missing primary type","types",e),t.assertArgument(1===o.length,`ambiguous primary types or unused types: ${o.map(t=>JSON.stringify(t)).join(", ")}`,"types",e),t.defineProperties(this,{primaryType:o[0]}),function i(o,a){t.assertArgument(!a.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),a.add(o);for(const t of r.get(o))if(s.has(t)){i(t,a);for(const e of a)n.get(e).add(t)}a.delete(o)}(this.primaryType,new Set);for(const[t,a]of n){const e=Array.from(a);e.sort(),this.#j.set(t,Bn(t,i[t])+e.map(t=>Bn(t,i[t])).join(""))}}getEncoder(t){let e=this.#W.get(t);return e||(e=this.#_(t),this.#W.set(t,e)),e}#_(e){{const t=Pn(e);if(t)return t}const r=In(e).array;if(r){const e=r.prefix,s=this.getEncoder(e);return n=>{t.assertArgument(-1===r.count||r.count===n.length,`array length mismatch; expected length ${r.count}`,"value",n);let i=n.map(s);return this.#j.has(e)&&(i=i.map(t.keccak256)),t.keccak256(t.concat(i))}}const s=this.types[e];if(s){const r=t.id(this.#j.get(e));return e=>{const n=s.map(({name:r,type:s})=>{const n=this.getEncoder(s)(e[r]);return this.#j.has(s)?t.keccak256(n):n});return n.unshift(r),t.concat(n)}}t.assertArgument(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const r=this.#j.get(e);return t.assertArgument(r,`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(e,r){return t.keccak256(this.encodeData(e,r))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(e,r,s){if(Pn(e))return s(e,r);const n=In(e).array;if(n)return t.assertArgument(-1===n.count||n.count===r.length,`array length mismatch; expected length ${n.count}`,"value",r),r.map(t=>this._visit(n.prefix,t,s));const i=this.types[e];if(i)return i.reduce((t,{name:e,type:n})=>(t[e]=this._visit(n,r[e],s),t),{});t.assertArgument(!1,`unknown type: ${e}`,"type",e)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Nn(t)}static getPrimaryType(t){return Nn.from(t).primaryType}static hashStruct(t,e,r){return Nn.from(e).hashStruct(t,r)}static hashDomain(e){const r=[];for(const s in e){if(null==e[s])continue;const n=En[s];t.assertArgument(n,`invalid typed-data domain key: ${JSON.stringify(s)}`,"domain",e),r.push({name:s,type:n})}return r.sort((t,e)=>kn.indexOf(t.name)-kn.indexOf(e.name)),Nn.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,s){return t.concat(["0x1901",Nn.hashDomain(e),Nn.from(r).hash(s)])}static hash(e,r,s){return t.keccak256(Nn.encode(e,r,s))}static async resolveNames(e,r,s,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const i={};e.verifyingContract&&!t.isHexString(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=Nn.from(r);o.visit(s,(e,r)=>("address"!==e||t.isHexString(r,20)||(i[r]="0x"),r));for(const t in i)i[t]=await n(t);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),{domain:e,value:s=o.visit(s,(t,e)=>"address"===t&&i[e]?i[e]:e)}}static getPayload(e,r,s){Nn.hashDomain(e);const n={},i=[];kn.forEach(t=>{const r=e[t];null!=r&&(n[t]=xn[t](r),i.push({name:t,type:En[t]}))});const o=Nn.from(r);r=o.types;const a=Object.assign({},r);return t.assertArgument(null==a.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",r),a.EIP712Domain=i,o.encode(s),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(s,(e,r)=>{if(e.match(/^bytes(\d*)/))return t.hexlify(t.getBytes(r));if(e.match(/^u?int/))return t.getBigInt(r).toString();switch(e){case"address":return r.toLowerCase();case"bool":return!!r;case"string":return t.assertArgument("string"==typeof r,"invalid string","value",r),r}t.assertArgument(!1,"unsupported type","type",e)})}}}function Cn(t,e,r,s){return Pr(Nn.hash(t,e,r),s)}function Rn(e){const r=t.toUtf8Bytes(e);if(r.length>31)throw new Error("bytes32 string must be less than 32 bytes");return t.zeroPadBytes(r,32)}function Sn(e){const r=t.getBytes(e,"bytes");if(32!==r.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==r[31])throw new Error("invalid bytes32 string - no null terminator");let s=31;for(;0===r[s-1];)s--;return t.toUtf8String(r.slice(0,s))}class Tn{interface;bytecode;runner;constructor(e,r,s){const n=t.Interface.from(e);r instanceof Uint8Array||("object"==typeof r&&(r=r.object),r.startsWith("0x")||(r="0x"+r)),r=t.hexlify(t.getBytes(r)),t.defineProperties(this,{bytecode:r,interface:n,runner:s||null})}attach(e){return new t.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let r={};const s=this.interface.deploy;if(s.inputs.length+1===e.length&&(r=await t.copyOverrides(e.pop())),s.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const n=await t.resolveArgs(this.runner,s.inputs,e),i=t.concat([this.bytecode,this.interface.encodeDeploy(n)]);return Object.assign({},r,{data:i})}async deploy(...e){const r=await this.getDeployTransaction(...e);t.assert(this.runner&&"function"==typeof this.runner.sendTransaction,"factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const s=await this.runner.sendTransaction(r),n=Er(s);return new t.BaseContract(n,this.interface,this.runner,s)}connect(t){return new Tn(this.interface,this.bytecode,t)}static fromSolidity(e,r){t.assertArgument(null!=e,"bad compiler output","output",e),"string"==typeof e&&(e=JSON.parse(e));const s=e.abi;let n="";return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(s,n,r)}}function On(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):t.assertArgument(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class Dn{name;constructor(e){t.defineProperties(this,{name:e})}connect(t){return this}supportsCoinType(t){return!1}async encodeAddress(t,e){throw new Error("unsupported coin")}async decodeAddress(t,e){throw new Error("unsupported coin")}}const Un=new RegExp("^(ipfs)://(.*)$","i"),Fn=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Un,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class Ln{provider;address;name;#Z;#Y;constructor(e,r,s){t.defineProperties(this,{provider:e,address:r,name:s}),this.#Z=null,this.#Y=new t.Contract(r,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#Z&&(this.#Z=(async()=>{try{return await this.#Y.supportsInterface("0x9061b923")}catch(e){if(t.isError(e,"CALL_EXCEPTION"))return!1;throw this.#Z=null,e}})()),await this.#Z}async#X(e,r){r=(r||[]).slice();const s=this.#Y.interface;r.unshift(rn(this.name));let n=null;await this.supportsWildcard()&&(n=s.getFunction(e),t.assert(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),r=[sn(this.name,255),s.encodeFunctionData(n,r)],e="resolve(bytes,bytes)"),r.push({enableCcipRead:!0});try{const t=await this.#Y[e](...r);return n?s.decodeFunctionResult(n,t)[0]:t}catch(i){if(!t.isError(i,"CALL_EXCEPTION"))throw i}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#X("addr(bytes32)");return null==e||e===t.ZeroAddress?null:e}catch(i){if(t.isError(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let r=e+2147483648;const s=await this.#X("addr(bytes32,uint)",[r]);if(t.isHexString(s,20))return t.getAddress(s)}let r=null;for(const t of this.provider.plugins)if(t instanceof Dn&&t.supportsCoinType(e)){r=t;break}if(null==r)return null;const s=await this.#X("addr(bytes32,uint)",[e]);if(null==s||"0x"===s)return null;const n=await r.decodeAddress(e,s);if(null!=n)return n;t.assert(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:s}})}async getText(t){const e=await this.#X("text(bytes32,string)",[t]);return null==e||"0x"===e?null:e}async getContentHash(){const e=await this.#X("contenthash(bytes32)");if(null==e||"0x"===e)return null;const r=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const t="e3010170"===r[1]?"ipfs":"ipns",e=parseInt(r[4],16);if(r[5].length===2*e)return`${t}://${o("0x"+r[2])}`}const s=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(s&&64===s[1].length)return`bzz://${s[1]}`;t.assert(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(null==n)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let i=0;i<Fn.length;i++){const o=n.match(Fn[i]);if(null==o)continue;const a=o[1].toLowerCase();switch(a){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const t=On(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:t}),{linkage:e,url:t}}case"erc721":case"erc1155":{const i="erc721"===a?"tokenURI(uint256)":"uri(uint256)";e.push({type:a,value:n});const c=await this.getAddress();if(null==c)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(o[2]||"").split("/");if(2!==l.length)return e.push({type:`!${a}caip`,value:o[2]||""}),{url:null,linkage:e};const u=l[1],h=new t.Contract(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===a){const t=await h.ownerOf(u);if(c!==t)return e.push({type:"!owner",value:t}),{url:null,linkage:e};e.push({type:"owner",value:t})}else if("erc1155"===a){const t=await h.balanceOf(c,u);if(!t)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:t.toString()})}let d=await h[i](u);if(null==d||"0x"===d)return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),"erc1155"===a&&(d=d.replace("{id}",t.toBeHex(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=On(d)),e.push({type:"metadata-url",value:d});let f={};const p=await new E(d).send();p.assertOk();try{f=p.bodyJson}catch(r){try{e.push({type:"!metadata",value:p.bodyText})}catch(s){const r=p.body;return r&&e.push({type:"!metadata",value:t.hexlify(r)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!f)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(f)});let g=f.image;if("string"!=typeof g)return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(g.match(/^(https:\/\/|data:)/i));else{if(null==g.match(Un))return e.push({type:"!imageUrl-ipfs",value:g}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:g}),g=On(g)}return e.push({type:"url",value:g}),{linkage:e,url:g}}}}}catch(r){}return{linkage:e,url:null}}static async getEnsAddress(e){const r=await e.getNetwork(),s=r.getPlugin("org.ethers.plugins.network.Ens");return t.assert(s,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:r}}),s.address}static async#$(e,r){const s=await Ln.getEnsAddress(e);try{const n=new t.Contract(s,["function resolver(bytes32) view returns (address)"],e),i=await n.resolver(rn(r),{enableCcipRead:!0});return i===t.ZeroAddress?null:i}catch(n){throw n}return null}static async fromName(t,e){let r=e;for(;;){if(""===r||"."===r)return null;if("eth"!==e&&"eth"===r)return null;const s=await Ln.#$(t,r);if(null!=s){const n=new Ln(t,s,e);return r===e||await n.supportsWildcard()?n:null}r=r.split(".").slice(1).join(".")}}}const Mn=BigInt(0);function Gn(t,e){return function(r){return null==r?e:t(r)}}function Hn(t,e){return r=>{if(e&&null==r)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(e=>t(e))}}function Qn(e,r){return s=>{const n={};for(const o in e){let a=o;if(r&&o in r&&!(a in s))for(const t of r[o])if(t in s){a=t;break}try{const t=e[o](s[a]);void 0!==t&&(n[o]=t)}catch(i){const e=i instanceof Error?i.message:"not-an-error";t.assert(!1,`invalid value for value.${o} (${e})`,"BAD_DATA",{value:s})}}return n}}function zn(e){return t.assertArgument(t.isHexString(e,!0),"invalid data","value",e),e}function Kn(e){return t.assertArgument(t.isHexString(e,32),"invalid hash","value",e),e}const Vn=Qn({address:t.getAddress,blockHash:Kn,blockNumber:t.getNumber,data:zn,index:t.getNumber,removed:Gn(function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}t.assertArgument(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)},!1),topics:Hn(Kn),transactionHash:Kn,transactionIndex:t.getNumber},{index:["logIndex"]});const qn=Qn({hash:Gn(Kn),parentHash:Kn,parentBeaconBlockRoot:Gn(Kn,null),number:t.getNumber,timestamp:t.getNumber,nonce:Gn(zn),difficulty:t.getBigInt,gasLimit:t.getBigInt,gasUsed:t.getBigInt,stateRoot:Gn(Kn,null),receiptsRoot:Gn(Kn,null),blobGasUsed:Gn(t.getBigInt,null),excessBlobGas:Gn(t.getBigInt,null),miner:Gn(t.getAddress),prevRandao:Gn(Kn,null),extraData:zn,baseFeePerGas:Gn(t.getBigInt)},{prevRandao:["mixHash"]});const Jn=Qn({transactionIndex:t.getNumber,blockNumber:t.getNumber,transactionHash:Kn,address:t.getAddress,topics:Hn(Kn),data:zn,index:t.getNumber,blockHash:Kn},{index:["logIndex"]});const jn=Qn({to:Gn(t.getAddress,null),from:Gn(t.getAddress,null),contractAddress:Gn(t.getAddress,null),index:t.getNumber,root:Gn(t.hexlify),gasUsed:t.getBigInt,blobGasUsed:Gn(t.getBigInt,null),logsBloom:Gn(zn),blockHash:Kn,hash:Kn,logs:Hn(function(t){return Jn(t)}),blockNumber:t.getNumber,cumulativeGasUsed:t.getBigInt,effectiveGasPrice:Gn(t.getBigInt),blobGasPrice:Gn(t.getBigInt,null),status:Gn(t.getNumber),type:Gn(t.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Wn(e){e.to&&t.getBigInt(e.to)===Mn&&(e.to="0x0000000000000000000000000000000000000000");const r=Qn({hash:Kn,index:Gn(t.getNumber,void 0),type:e=>"0x"===e||null==e?0:t.getNumber(e),accessList:Gn(t.accessListify,null),blobVersionedHashes:Gn(Hn(Kn,!0),null),authorizationList:Gn(Hn(e=>{let r;if(e.signature)r=e.signature;else{let t=e.yParity;"0x1b"===t?t=0:"0x1c"===t&&(t=1),r=Object.assign({},e,{yParity:t})}return{address:t.getAddress(e.address),chainId:t.getBigInt(e.chainId),nonce:t.getBigInt(e.nonce),signature:Ar.from(r)}},!1),null),blockHash:Gn(Kn,null),blockNumber:Gn(t.getNumber,null),transactionIndex:Gn(t.getNumber,null),from:t.getAddress,gasPrice:Gn(t.getBigInt),maxPriorityFeePerGas:Gn(t.getBigInt),maxFeePerGas:Gn(t.getBigInt),maxFeePerBlobGas:Gn(t.getBigInt,null),gasLimit:t.getBigInt,to:Gn(t.getAddress,null),value:t.getBigInt,nonce:t.getNumber,data:zn,creates:Gn(t.getAddress,null),chainId:Gn(t.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==r.to&&null==r.creates&&(r.creates=Er(r)),1!==e.type&&2!==e.type||null!=e.accessList||(r.accessList=[]),e.signature?r.signature=Ar.from(e.signature):r.signature=Ar.from(e),null==r.chainId){const t=r.signature.legacyChainId;null!=t&&(r.chainId=t)}return r.blockHash&&t.getBigInt(r.blockHash)===Mn&&(r.blockHash=null),r}class _n{name;constructor(e){t.defineProperties(this,{name:e})}clone(){return new _n(this.name)}}class Zn extends _n{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,r){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const s={effectiveBlock:e};function n(e,n){let i=(r||{})[e];null==i&&(i=n),t.assertArgument("number"==typeof i,`invalud value for ${e}`,"costs",r),s[e]=i}n("txBase",21e3),n("txCreate",32e3),n("txDataZero",4),n("txDataNonzero",16),n("txAccessListStorageKey",1900),n("txAccessListAddress",2400),t.defineProperties(this,s)}clone(){return new Zn(this.effectiveBlock,this)}}class Yn extends _n{address;targetNetwork;constructor(e,r){super("org.ethers.plugins.network.Ens"),t.defineProperties(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==r?1:r})}clone(){return new Yn(this.address,this.targetNetwork)}}class Xn extends _n{#tt;get feeDataFunc(){return this.#tt}constructor(t){super("org.ethers.plugins.network.FeeData"),this.#tt=t}async getFeeData(t){return await this.#tt(t)}clone(){return new Xn(this.#tt)}}class $n extends _n{#a;#et;get url(){return this.#a}get processFunc(){return this.#et}constructor(t,e){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#a=t,this.#et=e}clone(){return this}}const ti=new Map;class ei{#rt;#F;#st;constructor(e,r){this.#rt=e,this.#F=t.getBigInt(r),this.#st=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#rt}set name(t){this.#rt=t}get chainId(){return this.#F}set chainId(e){this.#F=t.getBigInt(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===t.getBigInt(e)}catch(r){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===t.getBigInt(e)}catch(r){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===t.getBigInt(e.chainId)}catch(r){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#st.values())}attachPlugin(t){if(this.#st.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return this.#st.set(t.name,t.clone()),this}getPlugin(t){return this.#st.get(t)||null}getPlugins(t){return this.plugins.filter(e=>e.name.split("#")[0]===t)}clone(){const t=new ei(this.name,this.chainId);return this.plugins.forEach(e=>{t.attachPlugin(e.clone())}),t}computeIntrinsicGas(e){const r=this.getPlugin("org.ethers.plugins.network.GasCost")||new Zn;let s=r.txBase;if(null==e.to&&(s+=r.txCreate),e.data)for(let t=2;t<e.data.length;t+=2)"00"===e.data.substring(t,t+2)?s+=r.txDataZero:s+=r.txDataNonzero;if(e.accessList){const n=t.accessListify(e.accessList);for(const t in n)s+=r.txAccessListAddress+r.txAccessListStorageKey*n[t].storageKeys.length}return s}static from(e){if(function(){if(ni)return;function t(t,e,r){const s=function(){const s=new ei(t,e);return null!=r.ensNetwork&&s.attachPlugin(new Yn(null,r.ensNetwork)),s.attachPlugin(new Zn),(r.plugins||[]).forEach(t=>{s.attachPlugin(t)}),s};ei.register(t,s),ei.register(e,s),r.altNames&&r.altNames.forEach(t=>{ei.register(t,s)})}ni=!0,t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("filecoin",314,{}),t("filecoin-calibration",314159,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[si("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[si("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}(),null==e)return ei.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const r=ti.get(e);if(r)return r();if("bigint"==typeof e)return new ei("unknown",e);t.assertArgument(!1,"unknown network","network",e)}if("function"==typeof e.clone){return e.clone()}if("object"==typeof e){t.assertArgument("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const r=new ei(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&r.attachPlugin(new Yn(e.ensAddress,e.ensNetwork)),r}t.assertArgument(!1,"invalid network","network",e)}static register(e,r){"number"==typeof e&&(e=BigInt(e));const s=ti.get(e);s&&t.assertArgument(!1,`conflicting network for ${JSON.stringify(s.name)}`,"nameOrChainId",e),ti.set(e,r)}}function ri(t,e){const r=String(t);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const s=r.split(".");if(1===s.length&&s.push(""),2!==s.length)throw new Error(`invalid gwei value: ${t}`);for(;s[1].length<e;)s[1]+="0";if(s[1].length>9){let t=BigInt(s[1].substring(0,9));s[1].substring(9).match(/^0+$/)||t++,s[1]=t.toString()}return BigInt(s[0]+s[1])}function si(e){return new $n(e,async(e,r,s)=>{let n;s.setHeader("User-Agent","ethers");try{const[t,r]=await Promise.all([s.send(),e()]);n=t;const i=n.bodyJson.standard;return{gasPrice:r.gasPrice,maxFeePerGas:ri(i.maxFee,9),maxPriorityFeePerGas:ri(i.maxPriorityFee,9)}}catch(i){t.assert(!1,`error encountered with polygon gas station (${JSON.stringify(s.url)})`,"SERVER_ERROR",{request:s,response:n,error:i})}})}let ni=!1;function ii(t){return JSON.parse(JSON.stringify(t))}class oi{#nt;#it;#ot;#at;constructor(t){this.#nt=t,this.#it=null,this.#ot=4e3,this.#at=-2}get pollingInterval(){return this.#ot}set pollingInterval(t){this.#ot=t}async#ct(){try{const t=await this.#nt.getBlockNumber();if(-2===this.#at)return void(this.#at=t);if(t!==this.#at){for(let e=this.#at+1;e<=t;e++){if(null==this.#it)return;await this.#nt.emit("block",e)}this.#at=t}}catch(t){}null!=this.#it&&(this.#it=this.#nt._setTimeout(this.#ct.bind(this),this.#ot))}start(){this.#it||(this.#it=this.#nt._setTimeout(this.#ct.bind(this),this.#ot),this.#ct())}stop(){this.#it&&(this.#nt._clearTimeout(this.#it),this.#it=null)}pause(t){this.stop(),t&&(this.#at=-2)}resume(){this.start()}}class ai{#nt;#ct;#lt;constructor(t){this.#nt=t,this.#lt=!1,this.#ct=t=>{this._poll(t,this.#nt)}}async _poll(t,e){throw new Error("sub-classes must override this")}start(){this.#lt||(this.#lt=!0,this.#ct(-2),this.#nt.on("block",this.#ct))}stop(){this.#lt&&(this.#lt=!1,this.#nt.off("block",this.#ct))}pause(t){this.stop()}resume(){this.start()}}class ci extends ai{#ut;#ht;constructor(t,e){super(t),this.#ut=e,this.#ht=-2}pause(t){t&&(this.#ht=-2),super.pause(t)}async _poll(t,e){const r=await e.getBlock(this.#ut);null!=r&&(-2===this.#ht?this.#ht=r.number:r.number>this.#ht&&(e.emit(this.#ut,r.number),this.#ht=r.number))}}class li extends ai{#dt;constructor(t,e){super(t),this.#dt=ii(e)}async _poll(t,e){throw new Error("@TODO")}}class ui extends ai{#ft;constructor(t,e){super(t),this.#ft=e}async _poll(t,e){const r=await e.getTransactionReceipt(this.#ft);r&&e.emit(this.#ft,r)}}class hi{#nt;#dt;#it;#lt;#at;constructor(t,e){this.#nt=t,this.#dt=ii(e),this.#it=this.#ct.bind(this),this.#lt=!1,this.#at=-2}async#ct(t){if(-2===this.#at)return;const e=ii(this.#dt);e.fromBlock=this.#at+1,e.toBlock=t;const r=await this.#nt.getLogs(e);if(0!==r.length)for(const s of r)this.#nt.emit(this.#dt,s),this.#at=s.blockNumber;else this.#at<t-60&&(this.#at=t-60)}start(){this.#lt||(this.#lt=!0,-2===this.#at&&this.#nt.getBlockNumber().then(t=>{this.#at=t}),this.#nt.on("block",this.#it))}stop(){this.#lt&&(this.#lt=!1,this.#nt.off("block",this.#it))}pause(t){this.stop(),t&&(this.#at=-2)}resume(){this.start()}}const di=BigInt(2);function fi(t){return t&&"function"==typeof t.then}function pi(t,e){return t+":"+JSON.stringify(e,(t,e)=>{if(null==e)return"null";if("bigint"==typeof e)return`bigint:${e.toString()}`;if("string"==typeof e)return e.toLowerCase();if("object"==typeof e&&!Array.isArray(e)){const t=Object.keys(e);return t.sort(),t.reduce((t,r)=>(t[r]=e[r],t),{})}return e})}class gi{name;constructor(e){t.defineProperties(this,{name:e})}start(){}stop(){}pause(t){}resume(){}}function mi(t){return(t=Array.from(new Set(t).values())).sort(),t}async function yi(e,r){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(t.isHexString(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:pi("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:pi("orphan",t),filter:(s=t,JSON.parse(JSON.stringify(s)))}}var s;if(e.address||e.topics){const s=e,n={topics:(s.topics||[]).map(t=>null==t?null:Array.isArray(t)?mi(t.map(t=>t.toLowerCase())):t.toLowerCase())};if(s.address){const e=[],i=[],o=s=>{t.isHexString(s)?e.push(s):i.push((async()=>{e.push(await t.resolveAddress(s,r))})())};Array.isArray(s.address)?s.address.forEach(o):o(s.address),i.length&&await Promise.all(i),n.address=mi(e.map(t=>t.toLowerCase()))}return{filter:n,tag:pi("event",n),type:"event"}}t.assertArgument(!1,"unknown ProviderEvent","event",e)}function Ai(){return(new Date).getTime()}const wi={cacheTimeout:250,pollingInterval:4e3};class bi{#pt;#st;#gt;#mt;#yt;#At;#wt;#bt;#Et;#kt;#vt;#xt;constructor(t,e){if(this.#xt=Object.assign({},wi,e||{}),"any"===t)this.#At=!0,this.#yt=null;else if(t){const e=ei.from(t);this.#At=!1,this.#yt=Promise.resolve(e),setTimeout(()=>{this.emit("network",e,null)},0)}else this.#At=!1,this.#yt=null;this.#bt=-1,this.#wt=new Map,this.#pt=new Map,this.#st=new Map,this.#gt=null,this.#mt=!1,this.#Et=1,this.#kt=new Map,this.#vt=!1}get pollingInterval(){return this.#xt.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#st.values())}attachPlugin(t){if(this.#st.get(t.name))throw new Error(`cannot replace existing plugin: ${t.name} `);return this.#st.set(t.name,t.connect(this)),this}getPlugin(t){return this.#st.get(t)||null}get disableCcipRead(){return this.#vt}set disableCcipRead(t){this.#vt=!!t}async#Pt(t){const e=this.#xt.cacheTimeout;if(e<0)return await this._perform(t);const r=pi(t.method,t);let s=this.#wt.get(r);return s||(s=this._perform(t),this.#wt.set(r,s),setTimeout(()=>{this.#wt.get(r)===s&&this.#wt.delete(r)},e)),await s}async ccipReadFetch(e,r,s){if(this.disableCcipRead||0===s.length||null==e.to)return null;const n=e.to.toLowerCase(),i=r.toLowerCase(),o=[];for(let c=0;c<s.length;c++){const r=s[c],l=r.replace("{sender}",n).replace("{data}",i),u=new E(l);-1===r.indexOf("{data}")&&(u.body={data:i,sender:n}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:c,urls:s});let h,d="unknown error";try{h=await u.send()}catch(a){o.push(a.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:{error:a}});continue}try{const t=h.bodyJson;if(t.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:t}),t.data;t.message&&(d=t.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:t})}catch(a){}t.assert(h.statusCode<400||h.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:r,errorMessage:d}}),o.push(d)}t.assert(!1,`error encountered during CCIP fetch: ${o.map(t=>JSON.stringify(t)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:s,errorMessages:o}})}_wrapBlock(e,r){return new t.Block(function(t){const e=qn(t);return e.transactions=t.transactions.map(t=>"string"==typeof t?t:Wn(t)),e}(e),this)}_wrapLog(e,r){return new t.Log(function(t){return Vn(t)}(e),this)}_wrapTransactionReceipt(e,r){return new t.TransactionReceipt(function(t){return jn(t)}(e),this)}_wrapTransactionResponse(e,r){return new t.TransactionResponse(Wn(e),this)}_detectNetwork(){t.assert(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){t.assert(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=t.getNumber(await this.#Pt({method:"getBlockNumber"}),"%response");return this.#bt>=0&&(this.#bt=e),e}_getAddress(e){return t.resolveAddress(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return t.isHexString(e)?t.isHexString(e,32)?e:t.toQuantity(e):("bigint"==typeof e&&(e=t.getNumber(e,"blockTag")),"number"==typeof e?e>=0?t.toQuantity(e):this.#bt>=0?t.toQuantity(this.#bt+e):this.getBlockNumber().then(r=>t.toQuantity(r+e)):void t.assertArgument(!1,"invalid blockTag","blockTag",e))}_getFilter(t){const e=(t.topics||[]).map(t=>null==t?null:Array.isArray(t)?mi(t.map(t=>t.toLowerCase())):t.toLowerCase()),r="blockHash"in t?t.blockHash:void 0,s=(t,s,n)=>{let i;switch(t.length){case 0:break;case 1:i=t[0];break;default:t.sort(),i=t}if(r&&(null!=s||null!=n))throw new Error("invalid filter");const o={};return i&&(o.address=i),e.length&&(o.topics=e),s&&(o.fromBlock=s),n&&(o.toBlock=n),r&&(o.blockHash=r),o};let n,i,o=[];if(t.address)if(Array.isArray(t.address))for(const a of t.address)o.push(this._getAddress(a));else o.push(this._getAddress(t.address));return"fromBlock"in t&&(n=this._getBlockTag(t.fromBlock)),"toBlock"in t&&(i=this._getBlockTag(t.toBlock)),o.filter(t=>"string"!=typeof t).length||null!=n&&"string"!=typeof n||null!=i&&"string"!=typeof i?Promise.all([Promise.all(o),n,i]).then(t=>s(t[0],t[1],t[2])):s(o,n,i)}_getTransactionRequest(e){const r=t.copyRequest(e),s=[];if(["to","from"].forEach(e=>{if(null==r[e])return;const n=t.resolveAddress(r[e],this);fi(n)?s.push(async function(){r[e]=await n}()):r[e]=n}),null!=r.blockTag){const t=this._getBlockTag(r.blockTag);fi(t)?s.push(async function(){r.blockTag=await t}()):r.blockTag=t}return s.length?async function(){return await Promise.all(s),r}():r}async getNetwork(){if(null==this.#yt){const t=(async()=>{try{const t=await this._detectNetwork();return this.emit("network",t,null),t}catch(e){throw this.#yt===t&&(this.#yt=null),e}})();return this.#yt=t,(await t).clone()}const e=this.#yt,[r,s]=await Promise.all([e,this._detectNetwork()]);return r.chainId!==s.chainId&&(this.#At?(this.emit("network",s,r),this.#yt===e&&(this.#yt=Promise.resolve(s))):t.assert(!1,`network changed: ${r.chainId} => ${s.chainId} `,"NETWORK_ERROR",{event:"changed"})),r.clone()}async getFeeData(){const e=await this.getNetwork(),r=async()=>{const{_block:r,gasPrice:s,priorityFee:n}=await t.resolveProperties({_block:this.#Bt("latest",!1),gasPrice:(async()=>{try{const e=await this.#Pt({method:"getGasPrice"});return t.getBigInt(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#Pt({method:"getPriorityFee"});return t.getBigInt(e,"%response")}catch(e){}return null})()});let i=null,o=null;const a=this._wrapBlock(r,e);return a&&a.baseFeePerGas&&(o=null!=n?n:BigInt("1000000000"),i=a.baseFeePerGas*di+o),new t.FeeData(s,i,o)},s=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(s){const e=new E(s.url),n=await s.processFunc(r,this,e);return new t.FeeData(n.gasPrice,n.maxFeePerGas,n.maxPriorityFeePerGas)}return await r()}async estimateGas(e){let r=this._getTransactionRequest(e);return fi(r)&&(r=await r),t.getBigInt(await this.#Pt({method:"estimateGas",transaction:r}),"%response")}async#It(e,r,s){t.assert(s<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:r,enableCcipRead:!0})});const n=t.copyRequest(e);try{return t.hexlify(await this._perform({method:"call",transaction:n,blockTag:r}))}catch(i){if(!this.disableCcipRead&&t.isCallException(i)&&i.data&&s>=0&&"latest"===r&&null!=n.to&&"0x556f1830"===t.dataSlice(i.data,0,4)){const e=i.data,a=await t.resolveAddress(n.to,this);let c;try{c=function(e){const r={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};t.assert(t.dataLength(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const s=t.dataSlice(e,0,32);t.assert(t.dataSlice(s,0,12)===t.dataSlice(Ii,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),r.sender=t.dataSlice(s,12);try{const s=[],n=t.getNumber(t.dataSlice(e,32,64)),i=t.getNumber(t.dataSlice(e,n,n+32)),o=t.dataSlice(e,n+32);for(let t=0;t<i;t++){const e=Ei(o,32*t);if(null==e)throw new Error("abort");s.push(e)}r.urls=s}catch(i){t.assert(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const t=ki(e,64);if(null==t)throw new Error("abort");r.calldata=t}catch(i){t.assert(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}t.assert(t.dataSlice(e,100,128)===t.dataSlice(Ii,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),r.selector=t.dataSlice(e,96,100);try{const t=ki(e,128);if(null==t)throw new Error("abort");r.extraData=t}catch(i){t.assert(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return r.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(t=>r[t]),r}(t.dataSlice(i.data,4))}catch(o){t.assert(!1,o.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:n,info:{data:e}})}t.assert(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:e,reason:"OffchainLookup",transaction:n,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});const l=await this.ccipReadFetch(n,c.calldata,c.urls);t.assert(null!=l,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:n,info:{data:i.data,errorArgs:c.errorArgs}});const u={to:a,data:t.concat([c.selector,Bi([l,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const t=await this.#It(u,r,s+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:t}),t}catch(o){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:o}),o}}throw i}}async#Nt(e){const{value:r}=await t.resolveProperties({network:this.getNetwork(),value:e});return r}async call(e){const{tx:r,blockTag:s}=await t.resolveProperties({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#Nt(this.#It(r,s,e.enableCcipRead?0:-1))}async#Ct(t,e,r){let s=this._getAddress(e),n=this._getBlockTag(r);return"string"==typeof s&&"string"==typeof n||([s,n]=await Promise.all([s,n])),await this.#Nt(this.#Pt(Object.assign(t,{address:s,blockTag:n})))}async getBalance(e,r){return t.getBigInt(await this.#Ct({method:"getBalance"},e,r),"%response")}async getTransactionCount(e,r){return t.getNumber(await this.#Ct({method:"getTransactionCount"},e,r),"%response")}async getCode(e,r){return t.hexlify(await this.#Ct({method:"getCode"},e,r))}async getStorage(e,r,s){const n=t.getBigInt(r,"position");return t.hexlify(await this.#Ct({method:"getStorage",position:n},e,s))}async broadcastTransaction(e){const{blockNumber:r,hash:s,network:n}=await t.resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=qr.from(e);if(i.hash!==s)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,n).replaceableTransaction(r)}async#Bt(e,r){if(t.isHexString(e,32))return await this.#Pt({method:"getBlock",blockHash:e,includeTransactions:r});let s=this._getBlockTag(e);return"string"!=typeof s&&(s=await s),await this.#Pt({method:"getBlock",blockTag:s,includeTransactions:r})}async getBlock(e,r){const{network:s,params:n}=await t.resolveProperties({network:this.getNetwork(),params:this.#Bt(e,!!r)});return null==n?null:this._wrapBlock(n,s)}async getTransaction(e){const{network:r,params:s}=await t.resolveProperties({network:this.getNetwork(),params:this.#Pt({method:"getTransaction",hash:e})});return null==s?null:this._wrapTransactionResponse(s,r)}async getTransactionReceipt(e){const{network:r,params:s}=await t.resolveProperties({network:this.getNetwork(),params:this.#Pt({method:"getTransactionReceipt",hash:e})});if(null==s)return null;if(null==s.gasPrice&&null==s.effectiveGasPrice){const t=await this.#Pt({method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");s.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(s,r)}async getTransactionResult(e){const{result:r}=await t.resolveProperties({network:this.getNetwork(),result:this.#Pt({method:"getTransactionResult",hash:e})});return null==r?null:t.hexlify(r)}async getLogs(e){let r=this._getFilter(e);fi(r)&&(r=await r);const{network:s,params:n}=await t.resolveProperties({network:this.getNetwork(),params:this.#Pt({method:"getLogs",filter:r})});return n.map(t=>this._wrapLog(t,s))}_getProvider(e){t.assert(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(t){return await Ln.fromName(this,t)}async getAvatar(t){const e=await this.getResolver(t);return e?await e.getAvatar():null}async resolveName(t){const e=await this.getResolver(t);return e?await e.getAddress():null}async lookupAddress(e){const r=rn((e=t.getAddress(e)).substring(2).toLowerCase()+".addr.reverse");try{const s=await Ln.getEnsAddress(this),n=new t.Contract(s,["function resolver(bytes32) view returns (address)"],this),i=await n.resolver(r);if(null==i||i===t.ZeroAddress)return null;const o=new t.Contract(i,["function name(bytes32) view returns (string)"],this),a=await o.name(r);return await this.resolveName(a)!==e?null:a}catch(s){if(t.isError(s,"BAD_DATA")&&"0x"===s.value)return null;if(t.isError(s,"CALL_EXCEPTION"))return null;throw s}return null}async waitForTransaction(e,r,s){const n=null!=r?r:1;return 0===n?this.getTransactionReceipt(e):new Promise(async(r,i)=>{let o=null;const a=async t=>{try{const s=await this.getTransactionReceipt(e);if(null!=s&&t-s.blockNumber+1>=n)return r(s),void(o&&(clearTimeout(o),o=null))}catch(s){console.log("EEE",s)}this.once("block",a)};null!=s&&(o=setTimeout(()=>{null!=o&&(o=null,this.off("block",a),i(t.makeError("timeout","TIMEOUT",{reason:"timeout"})))},s)),a(await this.getBlockNumber())})}async waitForBlock(e){t.assert(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(t){const e=this.#kt.get(t);e&&(e.timer&&clearTimeout(e.timer),this.#kt.delete(t))}_setTimeout(t,e){null==e&&(e=0);const r=this.#Et++,s=()=>{this.#kt.delete(r),t()};if(this.paused)this.#kt.set(r,{timer:null,func:s,time:e});else{const t=setTimeout(s,e);this.#kt.set(r,{timer:t,func:s,time:Ai()})}return r}_forEachSubscriber(t){for(const e of this.#pt.values())t(e.subscriber)}_getSubscriber(t){switch(t.type){case"debug":case"error":case"network":return new gi(t.type);case"block":{const t=new oi(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new ci(this,t.type);case"event":return new hi(this,t.filter);case"transaction":return new ui(this,t.hash);case"orphan":return new li(this,t.filter)}throw new Error(`unsupported event: ${t.type}`)}_recoverSubscriber(t,e){for(const r of this.#pt.values())if(r.subscriber===t){r.started&&r.subscriber.stop(),r.subscriber=e,r.started&&e.start(),null!=this.#gt&&e.pause(this.#gt);break}}async#Rt(t,e){let r=await yi(t,this);return"event"===r.type&&e&&e.length>0&&!0===e[0].removed&&(r=await yi({orphan:"drop-log",log:e[0]},this)),this.#pt.get(r.tag)||null}async#St(t){const e=await yi(t,this),r=e.tag;let s=this.#pt.get(r);if(!s){s={subscriber:this._getSubscriber(e),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#pt.set(r,s)}return s}async on(t,e){const r=await this.#St(t);return r.listeners.push({listener:e,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#gt&&r.subscriber.pause(this.#gt)),this}async once(t,e){const r=await this.#St(t);return r.listeners.push({listener:e,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#gt&&r.subscriber.pause(this.#gt)),this}async emit(e,...r){const s=await this.#Rt(e,r);if(!s||0===s.listeners.length)return!1;const n=s.listeners.length;return s.listeners=s.listeners.filter(({listener:s,once:n})=>{const i=new t.EventPayload(this,n?null:s,e);try{s.call(this,...r,i)}catch(o){}return!n}),0===s.listeners.length&&(s.started&&s.subscriber.stop(),this.#pt.delete(s.tag)),n>0}async listenerCount(t){if(t){const e=await this.#Rt(t);return e?e.listeners.length:0}let e=0;for(const{listeners:r}of this.#pt.values())e+=r.length;return e}async listeners(t){if(t){const e=await this.#Rt(t);return e?e.listeners.map(({listener:t})=>t):[]}let e=[];for(const{listeners:r}of this.#pt.values())e=e.concat(r.map(({listener:t})=>t));return e}async off(t,e){const r=await this.#Rt(t);if(!r)return this;if(e){const t=r.listeners.map(({listener:t})=>t).indexOf(e);t>=0&&r.listeners.splice(t,1)}return e&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),this.#pt.delete(r.tag)),this}async removeAllListeners(t){if(t){const{tag:e,started:r,subscriber:s}=await this.#St(t);r&&s.stop(),this.#pt.delete(e)}else for(const[e,{started:r,subscriber:s}]of this.#pt)r&&s.stop(),this.#pt.delete(e);return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return this.off(t,e)}get destroyed(){return this.#mt}destroy(){this.removeAllListeners();for(const t of this.#kt.keys())this._clearTimeout(t);this.#mt=!0}get paused(){return null!=this.#gt}set paused(t){!!t!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#bt=-1,null!=this.#gt){if(this.#gt==!!e)return;t.assert(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#gt=!!e;for(const t of this.#kt.values())t.timer&&clearTimeout(t.timer),t.time=Ai()-t.time}resume(){if(null!=this.#gt){this._forEachSubscriber(t=>t.resume()),this.#gt=null;for(const t of this.#kt.values()){let e=t.time;e<0&&(e=0),t.time=Ai(),setTimeout(t.func,e)}}}}function Ei(e,r){try{const s=ki(e,r);if(s)return t.toUtf8String(s)}catch(s){}return null}function ki(e,r){if("0x"===e)return null;try{const s=t.getNumber(t.dataSlice(e,r,r+32)),n=t.getNumber(t.dataSlice(e,s,s+32));return t.dataSlice(e,s+32,s+32+n)}catch(s){}return null}function vi(e){const r=t.toBeArray(e);if(r.length>32)throw new Error("internal; should not happen");const s=new Uint8Array(32);return s.set(r,32-r.length),s}function xi(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}const Pi=new Uint8Array([]);function Bi(e){const r=[];let s=0;for(let t=0;t<e.length;t++)r.push(Pi),s+=32;for(let n=0;n<e.length;n++){const i=t.getBytes(e[n]);r[n]=vi(s),r.push(vi(i.length)),r.push(xi(i)),s+=32+32*Math.ceil(i.length/32)}return t.concat(r)}const Ii="0x0000000000000000000000000000000000000000000000000000000000000000";function Ni(e,r){if(e.provider)return e.provider;t.assert(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:r})}async function Ci(e,r){let s=t.copyRequest(r);if(null!=s.to&&(s.to=t.resolveAddress(s.to,e)),null!=s.from){const r=s.from;s.from=Promise.all([e.getAddress(),t.resolveAddress(r,e)]).then(([e,r])=>(t.assertArgument(e.toLowerCase()===r.toLowerCase(),"transaction from mismatch","tx.from",r),e))}else s.from=e.getAddress();return await t.resolveProperties(s)}class Ri{provider;constructor(e){t.defineProperties(this,{provider:e||null})}async getNonce(t){return Ni(this,"getTransactionCount").getTransactionCount(await this.getAddress(),t)}async populateCall(t){return await Ci(this,t)}async populateTransaction(e){const r=Ni(this,"populateTransaction"),s=await Ci(this,e);null==s.nonce&&(s.nonce=await this.getNonce("pending")),null==s.gasLimit&&(s.gasLimit=await this.estimateGas(s));const n=await this.provider.getNetwork();if(null!=s.chainId){const r=t.getBigInt(s.chainId);t.assertArgument(r===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else s.chainId=n.chainId;const i=null!=s.maxFeePerGas||null!=s.maxPriorityFeePerGas;if(null==s.gasPrice||2!==s.type&&!i?0!==s.type&&1!==s.type||!i||t.assertArgument(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):t.assertArgument(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==s.type&&null!=s.type||null==s.maxFeePerGas||null==s.maxPriorityFeePerGas)if(0===s.type||1===s.type){const e=await r.getFeeData();t.assert(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==s.gasPrice&&(s.gasPrice=e.gasPrice)}else{const e=await r.getFeeData();if(null==s.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(s.authorizationList&&s.authorizationList.length?s.type=4:s.type=2,null!=s.gasPrice){const t=s.gasPrice;delete s.gasPrice,s.maxFeePerGas=t,s.maxPriorityFeePerGas=t}else null==s.maxFeePerGas&&(s.maxFeePerGas=e.maxFeePerGas),null==s.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(t.assert(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==s.gasPrice&&(s.gasPrice=e.gasPrice),s.type=0):t.assert(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==s.type&&3!==s.type&&4!==s.type||(null==s.maxFeePerGas&&(s.maxFeePerGas=e.maxFeePerGas),null==s.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else s.type=2;return await t.resolveProperties(s)}async populateAuthorization(t){const e=Object.assign({},t);return null==e.chainId&&(e.chainId=(await Ni(this,"getNetwork").getNetwork()).chainId),null==e.nonce&&(e.nonce=await this.getNonce()),e}async estimateGas(t){return Ni(this,"estimateGas").estimateGas(await this.populateCall(t))}async call(t){return Ni(this,"call").call(await this.populateCall(t))}async resolveName(t){const e=Ni(this,"resolveName");return await e.resolveName(t)}async sendTransaction(t){const e=Ni(this,"sendTransaction"),r=await this.populateTransaction(t);delete r.from;const s=qr.from(r);return await e.broadcastTransaction(await this.signTransaction(s))}authorize(e){t.assert(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class Si extends Ri{address;constructor(e,r){super(r),t.defineProperties(this,{address:e})}async getAddress(){return this.address}connect(t){return new Si(this.address,t)}#Tt(e,r){t.assert(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:r})}async signTransaction(t){this.#Tt("transactions","signTransaction")}async signMessage(t){this.#Tt("messages","signMessage")}async signTypedData(t,e,r){this.#Tt("typed-data","signTypedData")}}const Ti=new Set;function Oi(t){Ti.has(t)||(Ti.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}class Di{#nt;#Ot;#it;#lt;#Dt;#Ut;constructor(t){this.#nt=t,this.#Ot=null,this.#it=this.#ct.bind(this),this.#lt=!1,this.#Dt=null,this.#Ut=!1}_subscribe(t){throw new Error("subclasses must override this")}_emitResults(t,e){throw new Error("subclasses must override this")}_recover(t){throw new Error("subclasses must override this")}async#ct(e){try{null==this.#Ot&&(this.#Ot=this._subscribe(this.#nt));let e=null;try{e=await this.#Ot}catch(r){if(!t.isError(r,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==r.operation)throw r}if(null==e)return this.#Ot=null,void this.#nt._recoverSubscriber(this,this._recover(this.#nt));const s=await this.#nt.getNetwork();if(this.#Dt||(this.#Dt=s),this.#Dt.chainId!==s.chainId)throw new Error("chaid changed");if(this.#Ut)return;const n=await this.#nt.send("eth_getFilterChanges",[e]);await this._emitResults(this.#nt,n)}catch(r){console.log("@TODO",r)}this.#nt.once("block",this.#it)}#Ft(){const t=this.#Ot;t&&(this.#Ot=null,t.then(t=>{this.#nt.destroyed||this.#nt.send("eth_uninstallFilter",[t])}))}start(){this.#lt||(this.#lt=!0,this.#ct(-2))}stop(){this.#lt&&(this.#lt=!1,this.#Ut=!0,this.#Ft(),this.#nt.off("block",this.#it))}pause(t){t&&this.#Ft(),this.#nt.off("block",this.#it)}resume(){this.start()}}class Ui extends Di{#Lt;constructor(t,e){var r;super(t),this.#Lt=(r=e,JSON.parse(JSON.stringify(r)))}_recover(t){return new hi(t,this.#Lt)}async _subscribe(t){return await t.send("eth_newFilter",[this.#Lt])}async _emitResults(t,e){for(const r of e)t.emit(this.#Lt,t._wrapLog(r,t._network))}}class Fi extends Di{async _subscribe(t){return await t.send("eth_newPendingTransactionFilter",[])}async _emitResults(t,e){for(const r of e)t.emit("pending",r)}}const Li="bigint,boolean,function,number,string,symbol".split(/,/g);function Mi(t){if(null==t||Li.indexOf(typeof t)>=0)return t;if("function"==typeof t.getAddress)return t;if(Array.isArray(t))return t.map(Mi);if("object"==typeof t)return Object.keys(t).reduce((e,r)=>(e[r]=t[r],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Gi(t){return new Promise(e=>{setTimeout(e,t)})}function Hi(t){return t?t.toLowerCase():t}function Qi(t){return t&&"number"==typeof t.pollingInterval}const zi={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class Ki extends Ri{address;constructor(e,r){super(e),r=t.getAddress(r),t.defineProperties(this,{address:r})}connect(e){t.assert(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(e){const r=Mi(e),s=[];if(r.from){const n=r.from;s.push((async()=>{const s=await t.resolveAddress(n,this.provider);t.assertArgument(null!=s&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=s})())}else r.from=this.address;if(null==r.gasLimit&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),null!=r.to){const e=r.to;s.push((async()=>{r.to=await t.resolveAddress(e,this.provider)})())}s.length&&await Promise.all(s);const n=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(e){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(e);return await new Promise((e,n)=>{const i=[1e3,100];let o=0;const a=async()=>{try{const t=await this.provider.getTransaction(s);if(null!=t)return void e(t.replaceableTransaction(r))}catch(c){if(t.isError(c,"CANCELLED")||t.isError(c,"BAD_DATA")||t.isError(c,"NETWORK_ERROR")||t.isError(c,"UNSUPPORTED_OPERATION"))return null==c.info&&(c.info={}),c.info.sendTransactionHash=s,void n(c);if(t.isError(c,"INVALID_ARGUMENT")&&(o++,null==c.info&&(c.info={}),c.info.sendTransactionHash=s,o>10))return void n(c);this.provider.emit("error",t.makeError("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:c}))}this.provider._setTimeout(()=>{a()},i.pop()||4e3)};a()})}async signTransaction(e){const r=Mi(e);if(r.from){const s=await t.resolveAddress(r.from,this.provider);t.assertArgument(null!=s&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),r.from=s}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(e){const r="string"==typeof e?t.toUtf8Bytes(e):e;return await this.provider.send("personal_sign",[t.hexlify(r),this.address.toLowerCase()])}async signTypedData(e,r,s){const n=Mi(s),i=await Nn.resolveNames(e,r,n,async e=>{const r=await t.resolveAddress(e);return t.assertArgument(null!=r,"TypedData does not support null address","value",e),r});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(Nn.getPayload(i.domain,r,i.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(e){const r="string"==typeof e?t.toUtf8Bytes(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),t.hexlify(r)])}}class Vi extends bi{#xt;#Mt;#Gt;#Ht;#Qt;#Dt;#zt;#Kt(){if(this.#Ht)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#Ht=setTimeout(()=>{this.#Ht=null;const e=this.#Gt;for(this.#Gt=[];e.length;){const r=[e.shift()];for(;e.length&&r.length!==this.#xt.batchMaxCount;){r.push(e.shift());if(JSON.stringify(r.map(t=>t.payload)).length>this.#xt.batchMaxSize){e.unshift(r.pop());break}}(async()=>{const e=1===r.length?r[0].payload:r.map(t=>t.payload);this.emit("debug",{action:"sendRpcPayload",payload:e});try{const s=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:s});for(const{resolve:e,reject:n,payload:i}of r){if(this.destroyed){n(t.makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:i.method}));continue}const r=s.filter(t=>t.id===i.id)[0];if(null==r){const e=t.makeError("missing response for request","BAD_DATA",{value:s,info:{payload:i}});this.emit("error",e),n(e);continue}"error"in r?n(this.getRpcError(i,r)):e(r.result)}}catch(s){this.emit("debug",{action:"receiveRpcError",error:s});for(const{reject:t}of r)t(s)}})()}},e)}constructor(e,r){super(e,r),this.#Mt=1,this.#xt=Object.assign({},zi,r||{}),this.#Gt=[],this.#Ht=null,this.#Dt=null,this.#zt=null;{let t=null;const e=new Promise(e=>{t=e});this.#Qt={promise:e,resolve:t}}const s=this._getOption("staticNetwork");"boolean"==typeof s?(t.assertArgument(!s||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",r),s&&null!=e&&(this.#Dt=ei.from(e))):s&&(t.assertArgument(null==e||s.matches(e),"staticNetwork MUST match network object","options",r),this.#Dt=s)}_getOption(t){return this.#xt[t]}get _network(){return t.assert(this.#Dt,"network is not available yet","NETWORK_ERROR"),this.#Dt}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let r=e.transaction;if(r&&null!=r.type&&t.getBigInt(r.type)&&null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas){const t=await this.getFeeData();null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},r,{type:void 0})}))}}const r=this.getRpcRequest(e);return null!=r?await this.send(r.method,r.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#Dt)return this.#Dt}return this.#zt?await this.#zt:this.ready?(this.#zt=(async()=>{try{const e=ei.from(t.getBigInt(await this.send("eth_chainId",[])));return this.#zt=null,e}catch(e){throw this.#zt=null,e}})(),await this.#zt):(this.#zt=(async()=>{const e={id:this.#Mt++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let r;this.emit("debug",{action:"sendRpcPayload",payload:e});try{r=(await this._send(e))[0],this.#zt=null}catch(s){throw this.#zt=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:r}),"result"in r)return ei.from(t.getBigInt(r.result));throw this.getRpcError(e,r)})(),await this.#zt)}_start(){null!=this.#Qt&&null!=this.#Qt.resolve&&(this.#Qt.resolve(),this.#Qt=null,(async()=>{for(;null==this.#Dt&&!this.destroyed;)try{this.#Dt=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",t.makeError("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await Gi(1e3)}this.#Kt()})())}async _waitUntilReady(){if(null!=this.#Qt)return await this.#Qt.promise}_getSubscriber(t){return"pending"===t.type?new Fi(this):"event"===t.type?this._getOption("polling")?new hi(this,t.filter):new Ui(this,t.filter):"orphan"===t.type&&"drop-log"===t.filter.orphan?new gi("orphan"):super._getSubscriber(t)}get ready(){return null==this.#Qt}getRpcTransaction(e){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(null==e[s])return;let n=s;"gasLimit"===s&&(n="gas"),r[n]=t.toQuantity(t.getBigInt(e[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{null!=e[s]&&(r[s]=t.hexlify(e[s]))}),e.accessList&&(r.accessList=t.accessListify(e.accessList)),e.blobVersionedHashes&&(r.blobVersionedHashes=e.blobVersionedHashes.map(t=>t.toLowerCase())),e.authorizationList&&(r.authorizationList=e.authorizationList.map(e=>{const r=vr(e);return{address:r.address,nonce:t.toQuantity(r.nonce),chainId:t.toQuantity(r.chainId),yParity:t.toQuantity(r.signature.yParity),r:t.toQuantity(r.signature.r),s:t.toQuantity(r.signature.s)}})),r}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Hi(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Hi(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[Hi(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Hi(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&null!=t.filter.address&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(Hi):t.filter.address=Hi(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(e,r){const{method:s}=e,{error:n}=r;if("eth_estimateGas"===s&&n.message){const r=n.message;if(!r.match(/revert/i)&&r.match(/insufficient funds/i))return t.makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:n}});if(r.match(/nonce/i)&&r.match(/too low/i))return t.makeError("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:n}})}if("eth_call"===s||"eth_estimateGas"===s){const r=ji(n),i=t.AbiCoder.getBuiltinCallException("eth_call"===s?"call":"estimateGas",e.params[0],r?r.data:null);return i.info={error:n,payload:e},i}const i=JSON.stringify(function(t){const e=[];return Wi(t,e),e}(n));if("string"==typeof n.message&&n.message.match(/user denied|ethers-user-denied/i)){const r={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return t.makeError("user rejected action","ACTION_REJECTED",{action:r[s]||"unknown",reason:"rejected",info:{payload:e,error:n}})}if("eth_sendRawTransaction"===s||"eth_sendTransaction"===s){const r=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return t.makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:r,info:{error:n}});if(i.match(/nonce/i)&&i.match(/too low/i))return t.makeError("nonce has already been used","NONCE_EXPIRED",{transaction:r,info:{error:n}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return t.makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:r,info:{error:n}});if(i.match(/only replay-protected/i))return t.makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:r,info:{error:n}}})}let o=!!i.match(/the method .* does not exist/i);return o||n&&n.details&&n.details.startsWith("Unauthorized method:")&&(o=!0),o?t.makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:n,payload:e}}):t.makeError("could not coalesce error","UNKNOWN_ERROR",{error:n,payload:e})}send(e,r){if(this.destroyed)return Promise.reject(t.makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const s=this.#Mt++,n=new Promise((t,n)=>{this.#Gt.push({resolve:t,reject:n,payload:{method:e,params:r,id:s,jsonrpc:"2.0"}})});return this.#Kt(),n}async getSigner(e){null==e&&(e=0);const r=this.send("eth_accounts",[]);if("number"==typeof e){const t=await r;if(e>=t.length)throw new Error("no such account");return new Ki(this,t[e])}const{accounts:s}=await t.resolveProperties({network:this.getNetwork(),accounts:r});e=t.getAddress(e);for(const n of s)if(t.getAddress(n)===e)return new Ki(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new Ki(this,t))}destroy(){this.#Ht&&(clearTimeout(this.#Ht),this.#Ht=null);for(const{payload:e,reject:r}of this.#Gt)r(t.makeError("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#Gt=[],super.destroy()}}class qi extends Vi{#Vt;constructor(t,e){super(t,e);let r=this._getOption("pollingInterval");null==r&&(r=zi.pollingInterval),this.#Vt=r}_getSubscriber(t){const e=super._getSubscriber(t);return Qi(e)&&(e.pollingInterval=this.#Vt),e}get pollingInterval(){return this.#Vt}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");this.#Vt=t,this._forEachSubscriber(t=>{Qi(t)&&(t.pollingInterval=this.#Vt)})}}class Ji extends qi{#qt;constructor(t,e,r){null==t&&(t="http://localhost:8545"),super(e,r),this.#qt="string"==typeof t?new E(t):t.clone()}_getConnection(){return this.#qt.clone()}async send(t,e){return await this._start(),await super.send(t,e)}async _send(t){const e=this._getConnection();e.body=JSON.stringify(t),e.setHeader("content-type","application/json");const r=await e.send();r.assertOk();let s=r.bodyJson;return Array.isArray(s)||(s=[s]),s}}function ji(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&t.isHexString(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const t in e){const r=ji(e[t]);if(r)return r}return null}if("string"==typeof e)try{return ji(JSON.parse(e))}catch(r){}return null}function Wi(t,e){if(null!=t){if("string"==typeof t.message&&e.push(t.message),"object"==typeof t)for(const r in t)Wi(t[r],e);if("string"==typeof t)try{return Wi(JSON.parse(t),e)}catch(r){}}}const _i="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class Zi extends Ji{apiKey;constructor(e,r){null==e&&(e="mainnet");const s=ei.from(e);null==r&&(r=_i);const n={polling:!0,staticNetwork:s};super(Zi.getRequest(s,r),s,n),t.defineProperties(this,{apiKey:r})}_getProvider(t){try{return new Zi(t,this.apiKey)}catch(e){}return super._getProvider(t)}static getRequest(e,r){null==r&&(r=_i);const s=new E(`https://${function(e){switch(e){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"filecoin":return"rpc.ankr.com/filecoin";case"filecoin-calibration":return"rpc.ankr.com/filecoin_testnet";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}t.assertArgument(!1,"unsupported network","network",e)}(e.name)}/${r}`);return s.allowGzip=!0,r===_i&&(s.retryFunc=async(t,e,r)=>(Oi("AnkrProvider"),!0)),s}getRpcError(t,e){return"eth_sendRawTransaction"===t.method&&e&&e.error&&"INTERNAL_ERROR: could not replace existing tx"===e.error.message&&(e.error.message="replacement transaction underpriced"),super.getRpcError(t,e)}isCommunityResource(){return this.apiKey===_i}}const Yi="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Xi extends Ji{apiKey;constructor(e,r){null==e&&(e="mainnet");const s=ei.from(e);null==r&&(r=Yi);super(Xi.getRequest(s,r),s,{staticNetwork:s}),t.defineProperties(this,{apiKey:r})}_getProvider(t){try{return new Xi(t,this.apiKey)}catch(e){}return super._getProvider(t)}async _perform(e){if("getTransactionResult"===e.method){const{trace:s,tx:n}=await t.resolveProperties({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(null==s||null==n)return null;let i,o=!1;try{i=s[0].result.output,o="Reverted"===s[0].error}catch(r){}if(i)return t.assert(!o,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:n,invocation:null,revert:null}),i;t.assert(!1,"could not parse trace result","BAD_DATA",{value:s})}return await super._perform(e)}isCommunityResource(){return this.apiKey===Yi}static getRequest(e,r){null==r&&(r=Yi);const s=new E(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.g.alchemy.com";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}t.assertArgument(!1,"unsupported network","network",e)}(e.name)}/v2/${r}`);return s.allowGzip=!0,r===Yi&&(s.retryFunc=async(t,e,r)=>(Oi("alchemy"),!0)),s}}function $i(e){switch(e){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}t.assertArgument(!1,"unsupported network","network",e)}class to extends Ji{apiKey;constructor(e,r){null==e&&(e="mainnet");const s=ei.from(e);null==r&&(r=$i(s.name));super(to.getRequest(s,r),s,{staticNetwork:s}),t.defineProperties(this,{apiKey:r})}_getProvider(t){try{return new to(t,this.apiKey)}catch(e){}return super._getProvider(t)}isCommunityResource(){return this.apiKey===$i(this._network.name)}static getRequest(e,r){null==r&&(r=$i(e.name));const s=new E(`https://${function(e){switch(e){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}t.assertArgument(!1,"unsupported network","network",e)}(e.name)}/${r}`);return s.allowGzip=!0,r===$i(e.name)&&(s.retryFunc=async(t,e,r)=>(Oi("ChainstackProvider"),!0)),s}}class eo extends Ji{constructor(e){null==e&&(e="mainnet");const r=ei.from(e);t.assertArgument("mainnet"===r.name,"unsupported network","network",e),super("https://cloudflare-eth.com/",r,{staticNetwork:r})}}const ro="1 11155111 17000 560048 2741 11124 33111 33139 42170 42161 421614 43114 43113 8453 84532 80069 80094 199 1029 81457 168587773 56 97 42220 11142220 252 2523 100 999 737373 747474 59144 59141 5000 5003 43521 143 10143 1287 1284 1285 10 11155420 204 5611 80002 137 534352 534351 1329 1328 146 14601 988 2201 1923 1924 167013 167000 130 1301 480 4801 51 50 324 300".split(/ /g);const so="org.ethers.plugins.provider.Etherscan";class no extends _n{baseUrl;constructor(e){super(so),t.defineProperties(this,{baseUrl:e})}clone(){return new no(this.baseUrl)}}const io=["enableCcipRead"];let oo=1;class ao extends bi{network;apiKey;#Jt;constructor(e,r){const s=null!=r?r:null;super();const n=ei.from(e);t.assertArgument(ro.indexOf(`${n.chainId}`)>=0,"unsupported network","network",n),this.#Jt=n.getPlugin(so),t.defineProperties(this,{apiKey:s,network:n})}getBaseUrl(){if(this.#Jt)return this.#Jt.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}t.assertArgument(!1,"unsupported network","network",this.network)}getUrl(t,e){let r=Object.keys(e).reduce((t,r)=>{const s=e[r];return null!=s&&(t+=`&${r}=${s}`),t},"");return this.apiKey&&(r+=`&apikey=${this.apiKey}`),`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${t}${r}`}getPostUrl(){return`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e.chainid=this.network.chainId,e}async detectNetwork(){return this.network}async fetch(e,r,s){const n=oo++,i=s?this.getPostUrl():this.getUrl(e,r),o=s?this.getPostData(e,r):null;this.emit("debug",{action:"sendRequest",id:n,url:i,payload:o});const a=new E(i);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(t,e,r)=>(this.isCommunityResource()&&Oi("Etherscan"),Promise.resolve(!0)),a.processFunc=async(r,s)=>{const i=s.hasBody()?JSON.parse(t.toUtf8String(s.body)):{},o=("string"==typeof i.result?i.result:"").toLowerCase().indexOf("rate limit")>=0;return"proxy"===e?i&&0==i.status&&"NOTOK"==i.message&&o&&(this.emit("debug",{action:"receiveError",id:n,reason:"proxy-NOTOK",error:i}),s.throwThrottleError(i.result,2e3)):o&&(this.emit("debug",{action:"receiveError",id:n,reason:"null result",error:i.result}),s.throwThrottleError(i.result,2e3)),s},o&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(o).map(t=>`${t}=${o[t]}`).join("&"));const c=await a.send();try{c.assertOk()}catch(u){this.emit("debug",{action:"receiveError",id:n,error:u,reason:"assertOk"}),t.assert(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:n,error:"missing body",reason:"null body"}),t.assert(!1,"missing response","SERVER_ERROR",{request:a,response:c}));const l=JSON.parse(t.toUtf8String(c.body));return"proxy"===e?("2.0"!=l.jsonrpc&&(this.emit("debug",{action:"receiveError",id:n,result:l,reason:"invalid JSON-RPC"}),t.assert(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:l}})),l.error&&(this.emit("debug",{action:"receiveError",id:n,result:l,reason:"JSON-RPC error"}),t.assert(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:l}})),this.emit("debug",{action:"receiveRequest",id:n,result:l}),l.result):0!=l.status||"No records found"!==l.message&&"No transactions found"!==l.message?((1!=l.status||"string"==typeof l.message&&!l.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:n,result:l}),t.assert(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:l}})),this.emit("debug",{action:"receiveRequest",id:n,result:l}),l.result):(this.emit("debug",{action:"receiveRequest",id:n,result:l}),l.result)}_getTransactionPostData(e){const r={};for(let s in e){if(io.indexOf(s)>=0)continue;if(null==e[s])continue;let n=e[s];if(("type"!==s||0!==n)&&("blockTag"!==s||"latest"!==n)){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[s])n=t.toQuantity(n);else if("accessList"===s)n="["+t.accessListify(n).map(t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`).join(",")+"]";else if("blobVersionedHashes"===s){if(0===n.length)continue;t.assert(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else n=t.hexlify(n);r[s]=n}}return r}_checkError(e,r,s){let n="";if(t.isError(r,"SERVER_ERROR")){try{n=r.info.result.error.message}catch(i){}if(!n)try{n=r.info.message}catch(i){}}if("estimateGas"===e.method&&!n.match(/revert/i)&&n.match(/insufficient funds/i)&&t.assert(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),("call"===e.method||"estimateGas"===e.method)&&n.match(/execution reverted/i)){let s="";try{s=r.info.result.error.data}catch(o){}const n=t.AbiCoder.getBuiltinCallException(e.method,e.transaction,s);throw n.info={request:e,error:r},n}if(n&&"broadcastTransaction"===e.method){const r=qr.from(e.signedTransaction);n.match(/replacement/i)&&n.match(/underpriced/i)&&t.assert(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:r}),n.match(/insufficient funds/)&&t.assert(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&t.assert(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:r})}throw r}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if("mainnet"===this.network.name)return"1000000000";if("optimism"===this.network.name)return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>this._checkError(e,t,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});t.assert(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(r){return this._checkError(e,r,e.transaction)}}case"estimateGas":{const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(r){return this._checkError(e,r,e.transaction)}}}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return"mainnet"!==this.network.name?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let r=this._getAddress(e);var s;(s=r)&&"function"==typeof s.then&&(r=await r);try{const e=await this.fetch("contract",{action:"getabi",address:r}),s=JSON.parse(e);return new t.Contract(r,s,this)}catch(n){return null}}isCommunityResource(){return null==this.apiKey}}const co=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}().WebSocket;class lo{#nt;#dt;get filter(){return JSON.parse(this.#dt)}#jt;#Wt;#_t;constructor(t,e){this.#nt=t,this.#dt=JSON.stringify(e),this.#jt=null,this.#Wt=null,this.#_t=null}start(){this.#jt=this.#nt.send("eth_subscribe",this.filter).then(t=>(this.#nt._register(t,this),t))}stop(){this.#jt.then(t=>{this.#nt.destroyed||this.#nt.send("eth_unsubscribe",[t])}),this.#jt=null}pause(e){t.assert(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#Wt=!!e}resume(){this.#Wt=null}_handleMessage(t){if(null!=this.#jt&&null===this.#Wt){let e=this.#_t;e=null==e?this._emit(this.#nt,t):e.then(async()=>{await this._emit(this.#nt,t)}),this.#_t=e.then(()=>{this.#_t===e&&(this.#_t=null)})}}async _emit(t,e){throw new Error("sub-classes must implemente this; _emit")}}class uo extends lo{constructor(t){super(t,["newHeads"])}async _emit(t,e){t.emit("block",parseInt(e.number))}}class ho extends lo{constructor(t){super(t,["newPendingTransactions"])}async _emit(t,e){t.emit("pending",e)}}class fo extends lo{#Zt;get logFilter(){return JSON.parse(this.#Zt)}constructor(t,e){super(t,["logs",e]),this.#Zt=JSON.stringify(e)}async _emit(t,e){t.emit(this.logFilter,t._wrapLog(e,t._network))}}class po extends Vi{#Yt;#pt;#Xt;constructor(e,r){const s=Object.assign({},null!=r?r:{});t.assertArgument(null==s.batchMaxCount||1===s.batchMaxCount,"sockets-based providers do not support batches","options.batchMaxCount",r),s.batchMaxCount=1,null==s.staticNetwork&&(s.staticNetwork=!0),super(e,s),this.#Yt=new Map,this.#pt=new Map,this.#Xt=new Map}_getSubscriber(t){switch(t.type){case"close":return new gi("close");case"block":return new uo(this);case"pending":return new ho(this);case"event":return new fo(this,t.filter);case"orphan":if("drop-log"===t.filter.orphan)return new gi("drop-log")}return super._getSubscriber(t)}_register(t,e){this.#pt.set(t,e);const r=this.#Xt.get(t);if(r){for(const t of r)e._handleMessage(t);this.#Xt.delete(t)}}async _send(e){t.assertArgument(!Array.isArray(e),"WebSocket does not support batch send","payload",e);const r=new Promise((t,r)=>{this.#Yt.set(e.id,{payload:e,resolve:t,reject:r})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await r]}async _processMessage(e){const r=JSON.parse(e);if(r&&"object"==typeof r&&"id"in r){const e=this.#Yt.get(r.id);if(null==e)return void this.emit("error",t.makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:r}));this.#Yt.delete(r.id),e.resolve(r)}else{if(!r||"eth_subscription"!==r.method)return void this.emit("error",t.makeError("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:r}));{const t=r.params.subscription,e=this.#pt.get(t);if(e)e._handleMessage(r.params.result);else{let e=this.#Xt.get(t);null==e&&(e=[],this.#Xt.set(t,e)),e.push(r.params.result)}}}}async _write(t){throw new Error("sub-classes must override this")}}class go extends po{#qt;#$t;get websocket(){if(null==this.#$t)throw new Error("websocket closed");return this.#$t}constructor(t,e,r){super(e,r),"string"==typeof t?(this.#qt=()=>new co(t),this.#$t=this.#qt()):"function"==typeof t?(this.#qt=t,this.#$t=t()):(this.#qt=null,this.#$t=t),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(t){console.log("failed to start WebsocketProvider",t)}},this.websocket.onmessage=t=>{this._processMessage(t.data)}}async _write(t){this.websocket.send(t)}async destroy(){null!=this.#$t&&(this.#$t.close(),this.#$t=null),super.destroy()}}const mo="84842078b09946638c03157f83405213";class yo extends go{projectId;projectSecret;constructor(e,r){const s=new Ao(e,r),n=s._getConnection();t.assert(!n.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),s._network),t.defineProperties(this,{projectId:s.projectId,projectSecret:s.projectSecret})}isCommunityResource(){return this.projectId===mo}}class Ao extends Ji{projectId;projectSecret;constructor(e,r,s){null==e&&(e="mainnet");const n=ei.from(e);null==r&&(r=mo),null==s&&(s=null);super(Ao.getRequest(n,r,s),n,{staticNetwork:n}),t.defineProperties(this,{projectId:r,projectSecret:s})}_getProvider(t){try{return new Ao(t,this.projectId,this.projectSecret)}catch(e){}return super._getProvider(t)}isCommunityResource(){return this.projectId===mo}static getWebSocketProvider(t,e){return new yo(t,e)}static getRequest(e,r,s){null==r&&(r=mo),null==s&&(s=null);const n=new E(`https://${function(e){switch(e){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":case"base-goerli":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bsc-mainnet.infura.io";case"bnbt":return"bsc-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}t.assertArgument(!1,"unsupported network","network",e)}(e.name)}/v3/${r}`);return n.allowGzip=!0,s&&n.setCredentials("",s),r===mo&&(n.retryFunc=async(t,e,r)=>(Oi("InfuraProvider"),!0)),n}}const wo="919b412a057b5e9c9b6dce193c5a60242d6efadb";class bo extends Ji{token;constructor(e,r){null==e&&(e="mainnet");const s=ei.from(e);null==r&&(r=wo);super(bo.getRequest(s,r),s,{staticNetwork:s}),t.defineProperties(this,{token:r})}_getProvider(t){try{return new bo(t,this.token)}catch(e){}return super._getProvider(t)}isCommunityResource(){return this.token===wo}static getRequest(e,r){null==r&&(r=wo);const s=new E(`https://${function(e){switch(e){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}t.assertArgument(!1,"unsupported network","network",e)}(e.name)}/${r}`);return s.allowGzip=!0,r===wo&&(s.retryFunc=async(t,e,r)=>(Oi("QuickNodeProvider"),!0)),s}}const Eo=BigInt("1"),ko=BigInt("2");function vo(){return(new Date).getTime()}function xo(t){return JSON.stringify(t,(t,e)=>"bigint"==typeof e?{type:"bigint",value:e.toString()}:e)}const Po={stallTimeout:400,priority:1,weight:1},Bo={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};function Io(t){if(null==t)return"null";if(Array.isArray(t))return"["+t.map(Io).join(",")+"]";if("object"==typeof t&&"function"==typeof t.toJSON)return Io(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":case"number":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{"+e.map(e=>`${JSON.stringify(e)}:${Io(t[e])}`).join(",")+"}"}}throw console.log("Could not serialize",t),new Error("Hmm...")}function No(e,r){if("error"in r){const e=r.error;let s;return s=t.isError(e,"CALL_EXCEPTION")?Io(Object.assign({},e,{shortMessage:void 0,reason:void 0,info:void 0})):Io(e),{tag:s,value:e}}const s=r.result;return{tag:Io(s),value:s}}function Co(t,e){const r=new Map;for(const{value:n,tag:i,weight:o}of e){const t=r.get(i)||{value:n,weight:0};t.weight+=o,r.set(i,t)}let s=null;for(const n of r.values())n.weight>=t&&(!s||n.weight>s.weight)&&(s=n);if(s)return s.value}function Ro(t,e){let r=0;const s=new Map;let n=null;const i=[];for(const{value:a,tag:c,weight:l}of e)if(a instanceof Error){const t=s.get(c)||{value:a,weight:0};t.weight+=l,s.set(c,t),(null==n||t.weight>n.weight)&&(n=t)}else i.push(BigInt(a)),r+=l;if(r<t)return n&&n.weight>=t?n.value:void 0;i.sort((t,e)=>t<e?-1:e>t?1:0);const o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+Eo)/ko}function So(t,e){const r=Co(t,e);if(void 0!==r)return r;for(const s of e)if(s.value)return s.value}class To extends bi{quorum;eventQuorum;eventWorkers;#te;#ee;#re;constructor(e,r,s){super(r,s),this.#te=e.map(t=>t instanceof bi?Object.assign({provider:t},Po,Bo):Object.assign({},Po,t,Bo)),this.#ee=-2,this.#re=null,s&&null!=s.quorum?this.quorum=s.quorum:this.quorum=Math.ceil(this.#te.reduce((t,e)=>t+=e.weight,0)/2),this.eventQuorum=1,this.eventWorkers=1,t.assertArgument(this.quorum<=this.#te.reduce((t,e)=>t+e.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#te.map(t=>{const e=Object.assign({},t);for(const r in e)"_"===r[0]&&delete e[r];return e})}async _detectNetwork(){return ei.from(t.getBigInt(await this._perform({method:"chainId"})))}async _translatePerform(t,e){switch(e.method){case"broadcastTransaction":return await t.broadcastTransaction(e.signedTransaction);case"call":return await t.call(Object.assign({},e.transaction,{blockTag:e.blockTag}));case"chainId":return(await t.getNetwork()).chainId;case"estimateGas":return await t.estimateGas(e.transaction);case"getBalance":return await t.getBalance(e.address,e.blockTag);case"getBlock":{const r="blockHash"in e?e.blockHash:e.blockTag;return await t.getBlock(r,e.includeTransactions)}case"getBlockNumber":return await t.getBlockNumber();case"getCode":return await t.getCode(e.address,e.blockTag);case"getGasPrice":return(await t.getFeeData()).gasPrice;case"getPriorityFee":return(await t.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await t.getLogs(e.filter);case"getStorage":return await t.getStorage(e.address,e.position,e.blockTag);case"getTransaction":return await t.getTransaction(e.hash);case"getTransactionCount":return await t.getTransactionCount(e.address,e.blockTag);case"getTransactionReceipt":return await t.getTransactionReceipt(e.hash);case"getTransactionResult":return await t.getTransactionResult(e.hash)}}#se(t){const e=Array.from(t).map(t=>t.config),r=this.#te.slice();!function(t){for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[r],t[r]=s}}(r),r.sort((t,e)=>t.priority-e.priority);for(const s of r)if(!s._lastFatalError&&-1===e.indexOf(s))return s;return null}#ne(t,e){const r=this.#se(t);if(null==r)return null;const s={config:r,result:null,didBump:!1,perform:null,staller:null},n=vo();return s.perform=(async()=>{try{r.requests++;const t=await this._translatePerform(r.provider,e);s.result={result:t}}catch(i){r.errorResponses++,s.result={error:i}}const t=vo()-n;r._totalTime+=t,r.rollingDuration=.95*r.rollingDuration+.05*t,s.perform=null})(),s.staller=(async()=>{var t;await(t=r.stallTimeout,new Promise(e=>{setTimeout(e,t)})),s.staller=null})(),t.add(s),s}async#ie(){let e=this.#re;if(!e){const r=[];this.#te.forEach(t=>{r.push((async()=>{await async function(t,e){for(;(t.blockNumber<0||t.blockNumber<e)&&(t._updateNumber||(t._updateNumber=(async()=>{try{const e=await t.provider.getBlockNumber();e>t.blockNumber&&(t.blockNumber=e)}catch(e){t.blockNumber=-2,t._lastFatalError=e,t._lastFatalErrorTimestamp=vo()}t._updateNumber=null})()),await t._updateNumber,t.outOfSync++,!t._lastFatalError););}(t,0),t._lastFatalError||(t._network=await t.provider.getNetwork())})())}),this.#re=e=(async()=>{await Promise.all(r);let e=null;for(const r of this.#te){if(r._lastFatalError)continue;const s=r._network;null==e?e=s.chainId:s.chainId!==e&&t.assert(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#oe(e,r){const s=[];for(const t of e)if(null!=t.result){const{tag:e,value:n}=No(r.method,t.result);s.push({tag:e,value:n,weight:t.config.weight})}if(!(s.reduce((t,e)=>t+e.weight,0)<this.quorum)){switch(r.method){case"getBlockNumber":{-2===this.#ee&&(this.#ee=Math.ceil(t.getNumber(Ro(this.quorum,this.#te.filter(t=>!t._lastFatalError).map(e=>({value:e.blockNumber,tag:t.getNumber(e.blockNumber).toString(),weight:e.weight}))))));const e=function(e,r){if(1===e)return t.getNumber(Ro(e,r),"%internal");const s=new Map,n=(t,e)=>{const r=s.get(t)||{result:t,weight:0};r.weight+=e,s.set(t,r)};for(const{weight:a,value:c}of r){const e=t.getNumber(c);n(e-1,a),n(e,a),n(e+1,a)}let i,o=0;for(const{weight:t,result:a}of s.values())t>=e&&(t>o||null!=i&&t===o&&a>i)&&(o=t,i=a);return i}(this.quorum,s);if(void 0===e)return;return e>this.#ee&&(this.#ee=e),this.#ee}case"getGasPrice":case"getPriorityFee":case"estimateGas":return Ro(this.quorum,s);case"getBlock":return"blockTag"in r&&"pending"===r.blockTag?So(this.quorum,s):Co(this.quorum,s);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return Co(this.quorum,s);case"broadcastTransaction":return So(this.quorum,s)}t.assert(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${xo(r.method)})`})}}async#ae(e,r){if(0===e.size)throw new Error("no runners?!");const s=[];let n=0;for(const t of e)t.perform&&s.push(t.perform),t.staller?s.push(t.staller):t.didBump||(t.didBump=!0,n++);const i=await this.#oe(e,r);if(void 0!==i){if(i instanceof Error)throw i;return i}for(let t=0;t<n;t++)this.#ne(e,r);return t.assert(s.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:r,results:Array.from(e).map(t=>xo(t.result))}}),await Promise.race(s),await this.#ae(e,r)}async _perform(e){if("broadcastTransaction"===e.method){const r=this.#te.map(t=>null),s=this.#te.map(async({provider:t,weight:s},n)=>{try{const i=await t._perform(e);r[n]=Object.assign(No(e.method,{result:i}),{weight:s})}catch(i){r[n]=Object.assign(No(e.method,{error:i}),{weight:s})}});for(;;){const e=r.filter(t=>null!=t);for(const{value:t}of e)if(!(t instanceof Error))return t;const n=Co(this.quorum,r.filter(t=>null!=t));if(t.isError(n,"INSUFFICIENT_FUNDS"))throw n;const i=s.filter((t,e)=>null==r[e]);if(0===i.length)break;await Promise.race(i)}const n=So(this.quorum,r);if(t.assert(void 0!==n,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:r.map(xo)}}),n instanceof Error)throw n;return n}await this.#ie();const r=new Set;let s=0;for(;;){const t=this.#ne(r,e);if(null==t)break;if(s+=t.config.weight,s>=this.quorum)break}const n=await this.#ae(r,e);for(const t of r)t.perform&&null==t.result&&t.config.lateResponses++;return n}async destroy(){for(const{provider:t}of this.#te)t.destroy();super.destroy()}}const Oo="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function Do(e,r){null==r&&(r={});const s=t=>"-"!==r[t]&&("string"==typeof r.exclusive?t===r.exclusive:!Array.isArray(r.exclusive)||-1!==r.exclusive.indexOf(t));if("string"==typeof e&&e.match(/^https?:/))return new Ji(e);if("string"==typeof e&&e.match(/^wss?:/)||(n=e)&&"function"==typeof n.send&&"function"==typeof n.close)return new go(e);var n;let i=null;try{i=ei.from(e)}catch(c){}const o=[];if(s("publicPolygon")&&i&&("matic"===i.name?o.push(new Ji("https://polygon-rpc.com/",i,{staticNetwork:i})):"matic-amoy"===i.name&&o.push(new Ji("https://rpc-amoy.polygon.technology/",i,{staticNetwork:i}))),s("alchemy"))try{o.push(new Xi(e,r.alchemy))}catch(c){}if(s("ankr")&&null!=r.ankr)try{o.push(new Zi(e,r.ankr))}catch(c){}if(s("chainstack"))try{o.push(new to(e,r.chainstack))}catch(c){}if(s("cloudflare"))try{o.push(new eo(e))}catch(c){}if(s("etherscan"))try{o.push(new ao(e,r.etherscan))}catch(c){}if(s("infura"))try{let t,s=r.infura;"object"==typeof s&&(t=s.projectSecret,s=s.projectId),o.push(new Ao(e,s,t))}catch(c){}if(s("quicknode"))try{let t=r.quicknode;o.push(new bo(e,t))}catch(c){}if(t.assert(o.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),1===o.length)return o[0];let a=Math.floor(o.length/2);return a>2&&(a=2),i&&-1!==Oo.indexOf(i.name)&&(a=1),r&&r.quorum&&(a=r.quorum),new To(o,void 0,{quorum:a})}class Uo extends Ri{signer;#ce;#le;constructor(e){super(e.provider),t.defineProperties(this,{signer:e}),this.#ce=null,this.#le=0}async getAddress(){return this.signer.getAddress()}connect(t){return new Uo(this.signer.connect(t))}async getNonce(t){if("pending"===t){null==this.#ce&&(this.#ce=super.getNonce("pending"));const t=this.#le;return await this.#ce+t}return super.getNonce(t)}increment(){this.#le++}reset(){this.#le=0,this.#ce=null}async sendTransaction(t){const e=this.getNonce("pending");return this.increment(),(t=await this.signer.populateTransaction(t)).nonce=await e,await this.signer.sendTransaction(t)}signTransaction(t){return this.signer.signTransaction(t)}signMessage(t){return this.signer.signMessage(t)}signTypedData(t,e,r){return this.signer.signTypedData(t,e,r)}}class Fo extends qi{#b;#ue;constructor(e,r,s){const n=Object.assign({},null!=s?s:{},{batchMaxCount:1});t.assertArgument(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(r,n),this.#ue=null,s&&s.providerInfo&&(this.#ue=s.providerInfo),this.#b=async(t,r)=>{const s={method:t,params:r};this.emit("debug",{action:"sendEip1193Request",payload:s});try{const t=await e.request(s);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(n){const t=new Error(n.message);throw t.code=n.code,t.data=n.data,t.payload=s,this.emit("debug",{action:"receiveEip1193Error",error:t}),t}}}get providerInfo(){return this.#ue}async send(t,e){return await this._start(),await super.send(t,e)}async _send(e){t.assertArgument(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await this.#b(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(r){return[{id:e.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(t,e){switch((e=JSON.parse(JSON.stringify(e))).error.code||-1){case 4001:e.error.message=`ethers-user-denied: ${e.error.message}`;break;case 4200:e.error.message=`ethers-unsupported: ${e.error.message}`}return super.getRpcError(t,e)}async hasSigner(t){null==t&&(t=0);const e=await this.send("eth_accounts",[]);return"number"==typeof t?e.length>t:(t=t.toLowerCase(),0!==e.filter(e=>e.toLowerCase()===t).length)}async getSigner(t){if(null==t&&(t=0),!(await this.hasSigner(t)))try{await this.#b("eth_requestAccounts",[])}catch(e){const t=e.payload;throw this.getRpcError(t,{id:t.id,error:e})}return await super.getSigner(t)}static async discover(e){if(null==e&&(e={}),e.provider)return new Fo(e.provider);const r=e.window?e.window:"undefined"!=typeof window?window:null;if(null==r)return null;const s=e.anyProvider;if(s&&r.ethereum)return new Fo(r.ethereum);if(!("addEventListener"in r&&"dispatchEvent"in r&&"removeEventListener"in r))return null;const n=e.timeout?e.timeout:300;return 0===n?null:await new Promise((i,o)=>{let a=[];const c=t=>{a.push(t.detail),s&&l()},l=()=>{if(clearTimeout(u),a.length)if(e&&e.filter){const r=e.filter(a.map(t=>Object.assign({},t.info)));if(null==r)i(null);else if(r instanceof Fo)i(r);else{let e=null;if(r.uuid){e=a.filter(t=>r.uuid===t.info.uuid)[0]}if(e){const{provider:t,info:r}=e;i(new Fo(t,void 0,{providerInfo:r}))}else o(t.makeError("filter returned unknown info","UNSUPPORTED_OPERATION",{value:r}))}}else{const{provider:t,info:e}=a[0];i(new Fo(t,void 0,{providerInfo:e}))}else i(null);r.removeEventListener("eip6963:announceProvider",c)},u=setTimeout(()=>{l()},n);r.addEventListener("eip6963:announceProvider",c),r.dispatchEvent(new Event("eip6963:requestProvider"))})}}class Lo extends Ji{apiKey;constructor(e,r){null==e&&(e="mainnet");const s=ei.from(e);null==r&&(r=null);super(Lo.getRequest(s),s,{staticNetwork:s}),t.defineProperties(this,{apiKey:r})}_getProvider(t){try{return new Lo(t,this.apiKey)}catch(e){}return super._getProvider(t)}isCommunityResource(){return null===this.apiKey}getRpcRequest(t){const e=super.getRpcRequest(t);return e&&"eth_estimateGas"===e.method&&1==e.args.length&&(e.args=e.args.slice(),e.args.push("latest")),e}getRpcError(e,r){const s=r?r.error:null;if(s&&-32015===s.code&&!t.isHexString(s.data||"",!0)){const t={"assert(false)":"01","arithmetic underflow or overflow":"11","division or modulo by zero":"12","out-of-bounds array access; popping on an empty array":"31","out-of-bounds access of an array or bytesN":"32"};let e="";"VM execution error."===s.message?e=t[s.data]||"":t[s.message||""]&&(e=t[s.message||""]),e&&(s.message+=` (reverted: ${s.data})`,s.data="0x4e487b7100000000000000000000000000000000000000000000000000000000000000"+e)}else s&&-32e3===s.code&&"wrong transaction nonce"===s.message&&(s.message+=" (nonce too low)");return super.getRpcError(e,r)}static getRequest(e){const r=new E(function(e){switch(e){case"mainnet":return"https://eth.blockscout.com/api/eth-rpc";case"sepolia":return"https://eth-sepolia.blockscout.com/api/eth-rpc";case"holesky":return"https://eth-holesky.blockscout.com/api/eth-rpc";case"classic":return"https://etc.blockscout.com/api/eth-rpc";case"arbitrum":return"https://arbitrum.blockscout.com/api/eth-rpc";case"base":return"https://base.blockscout.com/api/eth-rpc";case"base-sepolia":return"https://base-sepolia.blockscout.com/api/eth-rpc";case"matic":return"https://polygon.blockscout.com/api/eth-rpc";case"optimism":return"https://optimism.blockscout.com/api/eth-rpc";case"optimism-sepolia":return"https://optimism-sepolia.blockscout.com/api/eth-rpc";case"xdai":return"https://gnosis.blockscout.com/api/eth-rpc"}t.assertArgument(!1,"unsupported network","network",e)}(e.name));return r.allowGzip=!0,r}}const Mo="62e1ad51b37b8e00394bda3b";class Go extends Ji{applicationId;applicationSecret;constructor(e,r,s){null==e&&(e="mainnet");const n=ei.from(e);null==r&&(r=Mo),null==s&&(s=null);const i={staticNetwork:n};super(Go.getRequest(n,r,s),n,i),t.defineProperties(this,{applicationId:r,applicationSecret:s})}_getProvider(t){try{return new Go(t,this.applicationId,this.applicationSecret)}catch(e){}return super._getProvider(t)}static getRequest(e,r,s){null==r&&(r=Mo);const n=new E(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}t.assertArgument(!1,"unsupported network","network",e)}(e.name)}/v1/lb/${r}`);return n.allowGzip=!0,s&&n.setCredentials("",s),r===Mo&&(n.retryFunc=async(t,e,r)=>(Oi("PocketProvider"),!0)),n}isCommunityResource(){return this.applicationId===Mo}}const Ho=void 0;class Qo extends Ri{address;#he;constructor(e,r){super(r),t.assertArgument(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#he=e;const s=xr(this.signingKey.publicKey);t.defineProperties(this,{address:s})}get signingKey(){return this.#he}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new Qo(this.#he,t)}async signTransaction(e){e=t.copyRequest(e);const{to:r,from:s}=await t.resolveProperties({to:e.to?t.resolveAddress(e.to,this):void 0,from:e.from?t.resolveAddress(e.from,this):void 0});null!=r&&(e.to=r),null!=s&&(e.from=s),null!=e.from&&(t.assertArgument(t.getAddress(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const n=qr.from(e);return n.signature=this.signingKey.sign(n.unsignedHash),n.serialized}async signMessage(t){return this.signMessageSync(t)}signMessageSync(t){return this.signingKey.sign(nn(t)).serialized}authorizeSync(e){t.assertArgument("string"==typeof e.address,"invalid address for authorizeSync","auth.address",e);const r=this.signingKey.sign(Jr(e));return Object.assign({},{address:t.getAddress(e.address),nonce:t.getBigInt(e.nonce||0),chainId:t.getBigInt(e.chainId||0)},{signature:r})}async authorize(e){return e=Object.assign({},e,{address:await t.resolveAddress(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,r,s){const n=await Nn.resolveNames(e,r,s,async e=>{t.assert(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const r=await this.provider.resolveName(e);return t.assert(null!=r,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),r});return this.signingKey.sign(Nn.hash(n.domain,r,n.value)).serialized}}const zo=" !#$%&'()*+,-./<=>?@[]^_`{|}~",Ko=/^[a-z]*$/i;function Vo(t,e){let r=97;return t.reduce((t,s)=>(s===e?r++:s.match(Ko)?t.push(String.fromCharCode(r)+s):(r=97,t.push(s)),t),[])}function qo(e){return t.assertArgument("0"===e[0],"unsupported auwl data","data",e),function(t,e){for(let n=28;n>=0;n--)t=t.split(zo[n]).join(e.substring(2*n,2*n+2));const r=[],s=t.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(t,e,s,n)=>{if(s)for(let i=parseInt(s);i>=0;i--)r.push(";");else r.push(e.toLowerCase());return""});if(s)throw new Error(`leftovers: ${JSON.stringify(s)}`);return Vo(Vo(r,";"),":")}(e.substring(59),e.substring(1,59))}class Jo{locale;constructor(e){t.defineProperties(this,{locale:e})}split(t){return t.toLowerCase().split(/\s+/g)}join(t){return t.join(" ")}}class jo extends Jo{#C;#de;constructor(t,e,r){super(t),this.#C=e,this.#de=r,this.#fe=null}get _data(){return this.#C}_decodeWords(){return qo(this.#C)}#fe;#pe(){if(null==this.#fe){const e=this._decodeWords();if(t.id(e.join("\n")+"\n")!==this.#de)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#fe=e}return this.#fe}getWord(e){const r=this.#pe();return t.assertArgument(e>=0&&e<r.length,`invalid word index: ${e}`,"index",e),r[e]}getWordIndex(t){return this.#pe().indexOf(t)}}let Wo=null;class _o extends jo{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&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>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==Wo&&(Wo=new _o),Wo}}function Zo(t){return(1<<t)-1<<8-t&255}function Yo(t){return(1<<t)-1&255}function Xo(e,r){t.assertNormalize("NFKD"),null==r&&(r=_o.wordlist());const s=r.split(e);t.assertArgument(s.length%3==0&&s.length>=12&&s.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const n=new Uint8Array(Math.ceil(11*s.length/8));let i=0;for(let l=0;l<s.length;l++){let e=r.getWordIndex(s[l].normalize("NFKD"));t.assertArgument(e>=0,`invalid mnemonic word at index ${l}`,"mnemonic","[ REDACTED ]");for(let t=0;t<11;t++)e&1<<10-t&&(n[i>>3]|=1<<7-i%8),i++}const o=32*s.length/3,a=Zo(s.length/3),c=t.getBytes(_t(n.slice(0,o/8)))[0]&a;return t.assertArgument(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),t.hexlify(n.slice(0,o/8))}function $o(e,r){t.assertArgument(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==r&&(r=_o.wordlist());const s=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(s[s.length-1]<<=8,s[s.length-1]|=e[t],n-=8):(s[s.length-1]<<=n,s[s.length-1]|=e[t]>>8-n,s.push(e[t]&Yo(8-n)),n+=3);const i=e.length/4,o=parseInt(_t(e).substring(2,4),16)&Zo(i);return s[s.length-1]<<=i,s[s.length-1]|=o>>8-i,r.join(s.map(t=>r.getWord(t)))}const ta={};class ea{phrase;password;wordlist;entropy;constructor(e,r,s,n,i){null==n&&(n=""),null==i&&(i=_o.wordlist()),t.assertPrivate(e,ta,"Mnemonic"),t.defineProperties(this,{phrase:s,password:n,wordlist:i,entropy:r})}computeSeed(){const e=t.toUtf8Bytes("mnemonic"+this.password,"NFKD");return Pt(t.toUtf8Bytes(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,r,s){const n=Xo(e,s);return e=$o(t.getBytes(n),s),new ea(ta,n,e,r,s)}static fromEntropy(e,r,s){const n=t.getBytes(e,"entropy"),i=$o(n,s);return new ea(ta,t.hexlify(n),i,r,s)}static entropyToPhrase(e,r){return $o(t.getBytes(e,"entropy"),r)}static phraseToEntropy(t,e){return Xo(t,e)}static isValidMnemonic(t,e){try{return Xo(t,e),!0}catch(r){}return!1}}
|
|
11
11
|
/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */var ra,sa,na,ia=function(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)},oa=function(t,e,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(t,r):n?n.value=r:e.set(t,r),r};const aa={16:10,24:12,32:14},ca=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],la=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],ua=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],ha=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],da=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],fa=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],pa=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],ga=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],ma=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],ya=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Aa=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],wa=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],ba=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Ea=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],ka=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function va(t){const e=[];for(let r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}class xa{get key(){return ia(this,ra,"f").slice()}constructor(t){if(ra.set(this,void 0),sa.set(this,void 0),na.set(this,void 0),!(this instanceof xa))throw Error("AES must be instanitated with `new`");oa(this,ra,new Uint8Array(t),"f");const e=aa[this.key.length];if(null==e)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");oa(this,na,[],"f"),oa(this,sa,[],"f");for(let l=0;l<=e;l++)ia(this,na,"f").push([0,0,0,0]),ia(this,sa,"f").push([0,0,0,0]);const r=4*(e+1),s=this.key.length/4,n=va(this.key);let i;for(let l=0;l<s;l++)i=l>>2,ia(this,na,"f")[i][l%4]=n[l],ia(this,sa,"f")[e-i][l%4]=n[l];let o,a=0,c=s;for(;c<r;){if(o=n[s-1],n[0]^=la[o>>16&255]<<24^la[o>>8&255]<<16^la[255&o]<<8^la[o>>24&255]^ca[a]<<24,a+=1,8!=s)for(let e=1;e<s;e++)n[e]^=n[e-1];else{for(let t=1;t<s/2;t++)n[t]^=n[t-1];o=n[s/2-1],n[s/2]^=la[255&o]^la[o>>8&255]<<8^la[o>>16&255]<<16^la[o>>24&255]<<24;for(let t=s/2+1;t<s;t++)n[t]^=n[t-1]}let t,i,l=0;for(;l<s&&c<r;)t=c>>2,i=c%4,ia(this,na,"f")[t][i]=n[l],ia(this,sa,"f")[e-t][i]=n[l++],c++}for(let l=1;l<e;l++)for(let t=0;t<4;t++)o=ia(this,sa,"f")[l][t],ia(this,sa,"f")[l][t]=wa[o>>24&255]^ba[o>>16&255]^Ea[o>>8&255]^ka[255&o]}encrypt(t){if(16!=t.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const e=ia(this,na,"f").length-1,r=[0,0,0,0];let s=va(t);for(let o=0;o<4;o++)s[o]^=ia(this,na,"f")[0][o];for(let o=1;o<e;o++){for(let t=0;t<4;t++)r[t]=ha[s[t]>>24&255]^da[s[(t+1)%4]>>16&255]^fa[s[(t+2)%4]>>8&255]^pa[255&s[(t+3)%4]]^ia(this,na,"f")[o][t];s=r.slice()}const n=new Uint8Array(16);let i=0;for(let o=0;o<4;o++)i=ia(this,na,"f")[e][o],n[4*o]=255&(la[s[o]>>24&255]^i>>24),n[4*o+1]=255&(la[s[(o+1)%4]>>16&255]^i>>16),n[4*o+2]=255&(la[s[(o+2)%4]>>8&255]^i>>8),n[4*o+3]=255&(la[255&s[(o+3)%4]]^i);return n}decrypt(t){if(16!=t.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const e=ia(this,sa,"f").length-1,r=[0,0,0,0];let s=va(t);for(let o=0;o<4;o++)s[o]^=ia(this,sa,"f")[0][o];for(let o=1;o<e;o++){for(let t=0;t<4;t++)r[t]=ga[s[t]>>24&255]^ma[s[(t+3)%4]>>16&255]^ya[s[(t+2)%4]>>8&255]^Aa[255&s[(t+1)%4]]^ia(this,sa,"f")[o][t];s=r.slice()}const n=new Uint8Array(16);let i=0;for(let o=0;o<4;o++)i=ia(this,sa,"f")[e][o],n[4*o]=255&(ua[s[o]>>24&255]^i>>24),n[4*o+1]=255&(ua[s[(o+3)%4]>>16&255]^i>>16),n[4*o+2]=255&(ua[s[(o+2)%4]>>8&255]^i>>8),n[4*o+3]=255&(ua[255&s[(o+1)%4]]^i);return n}}ra=new WeakMap,sa=new WeakMap,na=new WeakMap;class Pa{constructor(t,e,r){if(r&&!(this instanceof r))throw new Error(`${t} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new xa(e)},name:{enumerable:!0,value:t}})}}var Ba,Ia,Na=function(t,e,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(t,r):n?n.value=r:e.set(t,r),r},Ca=function(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)};class Ra extends Pa{constructor(t,e){if(super("ECC",t,Ra),Ba.set(this,void 0),Ia.set(this,void 0),e){if(e.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Na(this,Ba,new Uint8Array(e),"f")}else Na(this,Ba,new Uint8Array(16),"f");Na(this,Ia,this.iv,"f")}get iv(){return new Uint8Array(Ca(this,Ba,"f"))}encrypt(t){if(t.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){for(let e=0;e<16;e++)Ca(this,Ia,"f")[e]^=t[r+e];Na(this,Ia,this.aes.encrypt(Ca(this,Ia,"f")),"f"),e.set(Ca(this,Ia,"f"),r)}return e}decrypt(t){if(t.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const e=new Uint8Array(t.length);for(let r=0;r<t.length;r+=16){const s=this.aes.decrypt(t.subarray(r,r+16));for(let n=0;n<16;n++)e[r+n]=s[n]^Ca(this,Ia,"f")[n],Ca(this,Ia,"f")[n]=t[r+n]}return e}}Ba=new WeakMap,Ia=new WeakMap;var Sa,Ta,Oa,Da=function(t,e,r,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(t,r):n?n.value=r:e.set(t,r),r},Ua=function(t,e,r,s){if("a"===r&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?s:"a"===r?s.call(t):s?s.value:e.get(t)};class Fa extends Pa{constructor(t,e){super("CTR",t,Fa),Sa.set(this,void 0),Ta.set(this,void 0),Oa.set(this,void 0),Da(this,Oa,new Uint8Array(16),"f"),Ua(this,Oa,"f").fill(0),Da(this,Sa,Ua(this,Oa,"f"),"f"),Da(this,Ta,16,"f"),null==e&&(e=1),"number"==typeof e?this.setCounterValue(e):this.setCounterBytes(e)}get counter(){return new Uint8Array(Ua(this,Oa,"f"))}setCounterValue(t){if(!Number.isInteger(t)||t<0||t>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let e=15;e>=0;--e)Ua(this,Oa,"f")[e]=t%256,t=Math.floor(t/256)}setCounterBytes(t){if(16!==t.length)throw new TypeError("invalid counter initial Uint8Array value length");Ua(this,Oa,"f").set(t)}increment(){for(let t=15;t>=0;t--){if(255!==Ua(this,Oa,"f")[t]){Ua(this,Oa,"f")[t]++;break}Ua(this,Oa,"f")[t]=0}}encrypt(t){var e,r;const s=new Uint8Array(t);for(let n=0;n<s.length;n++)16===Ua(this,Ta,"f")&&(Da(this,Sa,this.aes.encrypt(Ua(this,Oa,"f")),"f"),Da(this,Ta,0,"f"),this.increment()),s[n]^=Ua(this,Sa,"f")[(Da(this,Ta,(r=Ua(this,Ta,"f"),e=r++,r),"f"),e)];return s}decrypt(t){return this.encrypt(t)}}function La(e){return"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),t.getBytesCopy(e)}function Ma(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function Ga(e){return"string"==typeof e?t.toUtf8Bytes(e,"NFKC"):t.getBytesCopy(e)}function Ha(e,r){const s=r.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);t.assertArgument(null!=s,"invalid path","path",r);const n=s[1],i=s[3],o="!"===s[4];let a=e;for(const t of n.toLowerCase().split(".")){if(Array.isArray(a)){if(!t.match(/^[0-9]+$/))break;a=a[parseInt(t)]}else if("object"==typeof a){let e=null;for(const r in a)if(r.toLowerCase()===t){e=a[r];break}a=e}else a=null;if(null==a)break}if(t.assertArgument(!o||null!=a,"missing required value","path",n),i&&null!=a){if("int"===i){if("string"==typeof a&&a.match(/^-?[0-9]+$/))return parseInt(a);if(Number.isSafeInteger(a))return a}if("number"===i&&"string"==typeof a&&a.match(/^-?[0-9.]*$/))return parseFloat(a);if("data"===i&&"string"==typeof a)return La(a);if("array"===i&&Array.isArray(a))return a;if(i===typeof a)return a;t.assertArgument(!1,`wrong type found for ${i} `,"path",n)}return a}Sa=new WeakMap,Ta=new WeakMap,Oa=new WeakMap;const Qa="m/44'/60'/0'/0/0";function za(t){try{const e=JSON.parse(t);if(3===(null!=e.version?parseInt(e.version):0))return!0}catch(e){}return!1}function Ka(e,r){const s=t.getBytes(r),n=Ha(e,"crypto.ciphertext:data!"),i=t.hexlify(t.keccak256(t.concat([s.slice(16,32),n]))).substring(2);t.assertArgument(i===Ha(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const o=function(e,r,s){if("aes-128-ctr"===Ha(e,"crypto.cipher:string")){const n=Ha(e,"crypto.cipherparams.iv:data!"),i=new Fa(r,n);return t.hexlify(i.decrypt(s))}t.assert(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(e,s.slice(0,16),n),a=xr(o);if(e.address){let r=e.address.toLowerCase();r.startsWith("0x")||(r="0x"+r),t.assertArgument(t.getAddress(r)===a,"keystore address/privateKey mismatch","address",e.address)}const c={address:a,privateKey:o};if("0.1"===Ha(e,"x-ethers.version:string")){const r=s.slice(32,64),n=Ha(e,"x-ethers.mnemonicCiphertext:data!"),i=Ha(e,"x-ethers.mnemonicCounter:data!"),o=new Fa(r,i);c.mnemonic={path:Ha(e,"x-ethers.path:string")||Qa,locale:Ha(e,"x-ethers.locale:string")||"en",entropy:t.hexlify(t.getBytes(o.decrypt(n)))}}return c}function Va(e){const r=Ha(e,"crypto.kdf:string");if(r&&"string"==typeof r){if("scrypt"===r.toLowerCase()){const s=Ha(e,"crypto.kdfparams.salt:data!"),n=Ha(e,"crypto.kdfparams.n:int!"),i=Ha(e,"crypto.kdfparams.r:int!"),o=Ha(e,"crypto.kdfparams.p:int!");t.assertArgument(n>0&&!(n&n-1),"invalid kdf.N","kdf.N",n),t.assertArgument(i>0&&o>0,"invalid kdf","kdf",r);const a=Ha(e,"crypto.kdfparams.dklen:int!");return t.assertArgument(32===a,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:s,N:n,r:i,p:o,dkLen:64}}if("pbkdf2"===r.toLowerCase()){const r=Ha(e,"crypto.kdfparams.salt:data!"),s=Ha(e,"crypto.kdfparams.prf:string!"),n=s.split("-").pop();t.assertArgument("sha256"===n||"sha512"===n,"invalid kdf.pdf","kdf.pdf",s);const i=Ha(e,"crypto.kdfparams.c:int!"),o=Ha(e,"crypto.kdfparams.dklen:int!");return t.assertArgument(32===o,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:r,count:i,dkLen:o,algorithm:n}}}t.assertArgument(!1,"unsupported key-derivation function","kdf",r)}function qa(e,r){const s=JSON.parse(e),n=Ga(r),i=Va(s);if("pbkdf2"===i.name){const{salt:t,count:e,dkLen:r,algorithm:o}=i;return Ka(s,Pt(n,t,e,r,o))}t.assert("scrypt"===i.name,"cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:o,N:a,r:c,p:l,dkLen:u}=i;return Ka(s,zt(n,o,a,c,l,u))}function Ja(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}async function ja(e,r,s){const n=JSON.parse(e),i=Ga(r),o=Va(n);if("pbkdf2"===o.name){s&&(s(0),await Ja(0));const{salt:t,count:e,dkLen:r,algorithm:a}=o,c=Pt(i,t,e,r,a);return s&&(s(1),await Ja(0)),Ka(n,c)}t.assert("scrypt"===o.name,"cannot be reached","UNKNOWN_ERROR",{params:o});const{salt:a,N:c,r:l,p:u,dkLen:h}=o;return Ka(n,await Qt(i,a,c,l,u,h,s))}function Wa(e){const r=null!=e.salt?t.getBytes(e.salt,"options.salt"):Ct(32);let s=1<<17,n=8,i=1;return e.scrypt&&(e.scrypt.N&&(s=e.scrypt.N),e.scrypt.r&&(n=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),t.assertArgument("number"==typeof s&&s>0&&Number.isSafeInteger(s)&&(BigInt(s)&BigInt(s-1))===BigInt(0),"invalid scrypt N parameter","options.N",s),t.assertArgument("number"==typeof n&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),t.assertArgument("number"==typeof i&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:r,N:s,r:n,p:i}}function _a(e,r,s,n){const i=t.getBytes(s.privateKey,"privateKey"),o=null!=n.iv?t.getBytes(n.iv,"options.iv"):Ct(16);t.assertArgument(16===o.length,"invalid options.iv length","options.iv",n.iv);const a=null!=n.uuid?t.getBytes(n.uuid,"options.uuid"):Ct(16);t.assertArgument(16===a.length,"invalid options.uuid length","options.uuid",n.iv);const c=e.slice(0,16),l=e.slice(16,32),u=new Fa(c,o),h=t.getBytes(u.encrypt(i)),d=t.keccak256(t.concat([l,h])),f={address:s.address.substring(2).toLowerCase(),id:O(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:t.hexlify(o).substring(2)},ciphertext:t.hexlify(h).substring(2),kdf:"scrypt",kdfparams:{salt:t.hexlify(r.salt).substring(2),n:r.N,dklen:32,p:r.p,r:r.r},mac:d.substring(2)}};if(s.mnemonic){const r=null!=n.client?n.client:`ethers/${t.version}`,i=s.mnemonic.path||Qa,o=s.mnemonic.locale||"en",a=e.slice(32,64),c=t.getBytes(s.mnemonic.entropy,"account.mnemonic.entropy"),l=Ct(16),u=new Fa(a,l),h=t.getBytes(u.encrypt(c)),d=new Date,p="UTC--"+(d.getUTCFullYear()+"-"+Ma(d.getUTCMonth()+1,2)+"-"+Ma(d.getUTCDate(),2)+"T"+Ma(d.getUTCHours(),2)+"-"+Ma(d.getUTCMinutes(),2)+"-"+Ma(d.getUTCSeconds(),2)+".0Z")+"--"+f.address;f["x-ethers"]={client:r,gethFilename:p,path:i,locale:o,mnemonicCounter:t.hexlify(l).substring(2),mnemonicCiphertext:t.hexlify(h).substring(2),version:"0.1"}}return JSON.stringify(f)}function Za(e,r,s){null==s&&(s={});const n=Ga(r),i=Wa(s),o=zt(n,i.salt,i.N,i.r,i.p,64);return _a(t.getBytes(o),i,e,s)}async function Ya(e,r,s){null==s&&(s={});const n=Ga(r),i=Wa(s),o=await Qt(n,i.salt,i.N,i.r,i.p,64,s.progressCallback);return _a(t.getBytes(o),i,e,s)}const Xa="m/44'/60'/0'/0/0",$a=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),tc=2147483648,ec=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function rc(t,e){let r="";for(;t;)r="0123456789abcdef"[t%16]+r,t=Math.trunc(t/16);for(;r.length<2*e;)r="0"+r;return"0x"+r}function sc(e){const r=t.getBytes(e),s=t.dataSlice(_t(_t(r)),0,4);return o(t.concat([r,s]))}const nc={};function ic(e,r,s,n){const i=new Uint8Array(37);e&tc?(t.assert(null!=n,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),i.set(t.getBytes(n),1)):i.set(t.getBytes(s));for(let t=24;t>=0;t-=8)i[33+(t>>3)]=e>>24-t&255;const o=t.getBytes(st("sha512",r,i));return{IL:o.slice(0,32),IR:o.slice(32)}}function oc(e,r){const s=r.split("/");t.assertArgument(s.length>0,"invalid path","path",r),"m"===s[0]&&(t.assertArgument(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",r),s.shift());let n=e;for(let i=0;i<s.length;i++){const e=s[i];if(e.match(/^[0-9]+'$/)){const r=parseInt(e.substring(0,e.length-1));t.assertArgument(r<tc,"invalid path index",`path[${i}]`,e),n=n.deriveChild(tc+r)}else if(e.match(/^[0-9]+$/)){const r=parseInt(e);t.assertArgument(r<tc,"invalid path index",`path[${i}]`,e),n=n.deriveChild(r)}else t.assertArgument(!1,"invalid path component",`path[${i}]`,e)}return n}class ac extends Qo{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,r,s,n,i,o,a,c,l){super(r,l),t.assertPrivate(e,nc,"HDNodeWallet"),t.defineProperties(this,{publicKey:r.compressedPublicKey});const u=t.dataSlice(Et(_t(this.publicKey)),0,4);t.defineProperties(this,{parentFingerprint:s,fingerprint:u,chainCode:n,path:i,index:o,depth:a}),t.defineProperties(this,{mnemonic:c})}connect(t){return new ac(nc,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}#ge(){const t={address:this.address,privateKey:this.privateKey},e=this.mnemonic;return this.path&&e&&"en"===e.wordlist.locale&&""===e.password&&(t.mnemonic={path:this.path,locale:"en",entropy:e.entropy}),t}async encrypt(t,e){return await Ya(this.#ge(),t,{progressCallback:e})}encryptSync(t){return Za(this.#ge(),t)}get extendedKey(){return t.assert(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),sc(t.concat(["0x0488ADE4",rc(this.depth,1),this.parentFingerprint,rc(this.index,4),this.chainCode,t.concat(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new cc(nc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const r=t.getNumber(e,"index");t.assertArgument(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(2147483647&r),r&tc&&(s+="'"));const{IR:n,IL:i}=ic(r,this.chainCode,this.publicKey,this.privateKey),o=new wr(t.toBeHex((t.toBigInt(i)+BigInt(this.privateKey))%ec,32));return new ac(nc,o,this.fingerprint,t.hexlify(n),s,r,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return oc(this,t)}static#me(e,r){t.assertArgument(t.isBytesLike(e),"invalid seed","seed","[REDACTED]");const s=t.getBytes(e,"seed");t.assertArgument(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");const n=t.getBytes(st("sha512",$a,s)),i=new wr(t.hexlify(n.slice(0,32)));return new ac(nc,i,"0x00000000",t.hexlify(n.slice(32)),"m",0,0,r,null)}static fromExtendedKey(e){const r=t.toBeArray(a(e));t.assertArgument(82===r.length||sc(r.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const s=r[4],n=t.hexlify(r.slice(5,9)),i=parseInt(t.hexlify(r.slice(9,13)).substring(2),16),o=t.hexlify(r.slice(13,45)),c=r.slice(45,78);switch(t.hexlify(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=t.hexlify(c);return new cc(nc,xr(e),e,n,o,null,i,s,null)}case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new ac(nc,new wr(c.slice(1)),n,o,null,i,s,null,null)}t.assertArgument(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t,e,r){null==t&&(t=""),null==e&&(e=Xa),null==r&&(r=_o.wordlist());const s=ea.fromEntropy(Ct(16),t,r);return ac.#me(s.computeSeed(),s).derivePath(e)}static fromMnemonic(t,e){return e||(e=Xa),ac.#me(t.computeSeed(),t).derivePath(e)}static fromPhrase(t,e,r,s){null==e&&(e=""),null==r&&(r=Xa),null==s&&(s=_o.wordlist());const n=ea.fromPhrase(t,e,s);return ac.#me(n.computeSeed(),n).derivePath(r)}static fromSeed(t){return ac.#me(t,null)}}class cc extends Si{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,r,s,n,i,o,a,c,l){super(r,l),t.assertPrivate(e,nc,"HDNodeVoidWallet"),t.defineProperties(this,{publicKey:s});const u=t.dataSlice(Et(_t(s)),0,4);t.defineProperties(this,{publicKey:s,fingerprint:u,parentFingerprint:n,chainCode:i,path:o,index:a,depth:c})}connect(t){return new cc(nc,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return t.assert(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),sc(t.concat(["0x0488B21E",rc(this.depth,1),this.parentFingerprint,rc(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const r=t.getNumber(e,"index");t.assertArgument(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(2147483647&r),r&tc&&(s+="'"));const{IR:n,IL:i}=ic(r,this.chainCode,this.publicKey,null),o=wr.addPoints(i,this.publicKey,!0),a=xr(o);return new cc(nc,a,o,this.fingerprint,t.hexlify(n),s,r,this.depth+1,this.provider)}derivePath(t){return oc(this,t)}}function lc(e){const r=t.getNumber(e,"index");return t.assertArgument(r>=0&&r<tc,"invalid account index","index",r),`m/44'/60'/${r}'/0/0`}function uc(e){const r=t.getNumber(e,"index");return t.assertArgument(r>=0&&r<tc,"invalid account index","index",r),`m/44'/60'/0'/0/${r}`}function hc(t){try{if(JSON.parse(t).encseed)return!0}catch(e){}return!1}function dc(e,r){const s=JSON.parse(e),n=Ga(r),i=t.getAddress(Ha(s,"ethaddr:string!")),o=La(Ha(s,"encseed:string!"));t.assertArgument(o&&o.length%16==0,"invalid encseed","json",e);const a=t.getBytes(Pt(n,n,2e3,32,"sha256")).slice(0,16),c=o.slice(0,16),l=o.slice(16),u=new Ra(a,c),h=function(t){if(t.length<16)throw new TypeError("PKCS#7 invalid length");const e=t[t.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");const r=t.length-e;for(let s=0;s<e;s++)if(t[r+s]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(t.subarray(0,r))}(t.getBytes(u.decrypt(l)));let d="";for(let t=0;t<h.length;t++)d+=String.fromCharCode(h[t]);return{address:i,privateKey:t.id(d)}}function fc(t){return new Promise(e=>{setTimeout(()=>{e()},t)})}class pc extends Qo{constructor(t,e){"string"!=typeof t||t.startsWith("0x")||(t="0x"+t),super("string"==typeof t?new wr(t):t,e)}connect(t){return new pc(this.signingKey,t)}async encrypt(t,e){const r={address:this.address,privateKey:this.privateKey};return await Ya(r,t,{progressCallback:e})}encryptSync(t){return Za({address:this.address,privateKey:this.privateKey},t)}static#ye(e){if(t.assertArgument(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const t=ea.fromEntropy(e.mnemonic.entropy),r=ac.fromMnemonic(t,e.mnemonic.path);if(r.address===e.address&&r.privateKey===e.privateKey)return r;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const r=new pc(e.privateKey);return t.assertArgument(r.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),r}static async fromEncryptedJson(t,e,r){let s=null;return za(t)?s=await ja(t,e,r):hc(t)&&(r&&(r(0),await fc(0)),s=dc(t,e),r&&(r(1),await fc(0))),pc.#ye(s)}static fromEncryptedJsonSync(e,r){let s=null;return za(e)?s=qa(e,r):hc(e)?s=dc(e,r):t.assertArgument(!1,"invalid JSON wallet","json","[ REDACTED ]"),pc.#ye(s)}static createRandom(t){const e=ac.createRandom();return t?e.connect(t):e}static fromPhrase(t,e){const r=ac.fromPhrase(t);return e?r.connect(e):r}}class gc extends jo{#Ae;constructor(t,e,r,s){super(t,e,s),this.#Ae=r}get _accent(){return this.#Ae}_decodeWords(){return function(e,r){let s=qo(e).join(",");return r.split(/,/g).forEach(e=>{const n=e.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);t.assertArgument(null!==n,"internal error parsing accents","accents",r);let i=0;const o=function(t,e){const r=(1<<t)-1,s=[];let n=0,i=0,o=0;for(let a=0;a<e.length;a++)for(n=n<<6|")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".indexOf(e[a]),i+=6;i>=t;){const e=n>>i-t;n&=(1<<i-t)-1,i-=t,0===e?o+=r:(s.push(e+o),o=0)}return s}(parseInt(n[3]),n[4]),a=parseInt(n[2]),c=new RegExp(`([${n[1]}])`,"g");s=s.replace(c,(t,e)=>(0===--o[i]&&(e=String.fromCharCode(e.charCodeAt(0),a),i++),e))}),s.split(",")}(this._data,this._accent)}}const mc={en:_o.wordlist()},yc=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:t.AbiCoder,AbstractProvider:bi,AbstractSigner:Ri,AlchemyProvider:Xi,AnkrProvider:Zi,BaseContract:t.BaseContract,BaseWallet:Qo,Block:t.Block,BlockscoutProvider:Lo,BrowserProvider:Fo,ChainstackProvider:to,CloudflareProvider:eo,ConstructorFragment:t.ConstructorFragment,Contract:t.Contract,ContractEventPayload:t.ContractEventPayload,ContractFactory:Tn,ContractTransactionReceipt:t.ContractTransactionReceipt,ContractTransactionResponse:t.ContractTransactionResponse,ContractUnknownEventPayload:t.ContractUnknownEventPayload,EnsPlugin:Yn,EnsResolver:Ln,ErrorDescription:t.ErrorDescription,ErrorFragment:t.ErrorFragment,EtherSymbol:"Ξ",EtherscanPlugin:no,EtherscanProvider:ao,EventFragment:t.EventFragment,EventLog:t.EventLog,EventPayload:t.EventPayload,FallbackFragment:t.FallbackFragment,FallbackProvider:To,FeeData:t.FeeData,FeeDataNetworkPlugin:Xn,FetchCancelSignal:w,FetchRequest:E,FetchResponse:k,FetchUrlFeeDataNetworkPlugin:$n,FixedNumber:t.FixedNumber,Fragment:t.Fragment,FunctionFragment:t.FunctionFragment,GasCostPlugin:Zn,HDNodeVoidWallet:cc,HDNodeWallet:ac,Indexed:t.Indexed,InfuraProvider:Ao,InfuraWebSocketProvider:yo,Interface:t.Interface,IpcSocketProvider:Ho,JsonRpcApiProvider:Vi,JsonRpcProvider:Ji,JsonRpcSigner:Ki,LangEn:_o,Log:t.Log,LogDescription:t.LogDescription,MaxInt256:ir,MaxUint256:sr,MessagePrefix:or,MinInt256:nr,Mnemonic:ea,MulticoinProviderPlugin:Dn,N:er,NamedFragment:t.NamedFragment,Network:ei,NetworkPlugin:_n,NonceManager:Uo,ParamType:t.ParamType,PocketProvider:Go,QuickNodeProvider:bo,Result:t.Result,Signature:Ar,SigningKey:wr,SocketBlockSubscriber:uo,SocketEventSubscriber:fo,SocketPendingSubscriber:ho,SocketProvider:po,SocketSubscriber:lo,StructFragment:t.StructFragment,Transaction:qr,TransactionDescription:t.TransactionDescription,TransactionReceipt:t.TransactionReceipt,TransactionResponse:t.TransactionResponse,Typed:t.Typed,TypedDataEncoder:Nn,UndecodedEventLog:t.UndecodedEventLog,UnmanagedSubscriber:gi,Utf8ErrorFuncs:t.Utf8ErrorFuncs,VoidSigner:Si,Wallet:pc,WebSocketProvider:go,WeiPerEther:rr,Wordlist:Jo,WordlistOwl:jo,WordlistOwlA:gc,ZeroAddress:t.ZeroAddress,ZeroHash:tr,accessListify:t.accessListify,assert:t.assert,assertArgument:t.assertArgument,assertArgumentCount:t.assertArgumentCount,assertNormalize:t.assertNormalize,assertPrivate:t.assertPrivate,authorizationify:vr,checkResultErrors:t.checkResultErrors,computeAddress:xr,computeHmac:st,concat:t.concat,copyRequest:t.copyRequest,dataLength:t.dataLength,dataSlice:t.dataSlice,decodeBase58:a,decodeBase64:c,decodeBytes32String:Sn,decodeRlp:N,decryptCrowdsaleJson:dc,decryptKeystoreJson:ja,decryptKeystoreJsonSync:qa,defaultPath:Xa,defineProperties:t.defineProperties,dnsEncode:sn,encodeBase58:o,encodeBase64:l,encodeBytes32String:Rn,encodeRlp:T,encryptKeystoreJson:Ya,encryptKeystoreJsonSync:Za,ensNormalize:tn,formatEther:t.formatEther,formatUnits:t.formatUnits,fromTwos:t.fromTwos,getAccountPath:lc,getAddress:t.getAddress,getBigInt:t.getBigInt,getBytes:t.getBytes,getBytesCopy:t.getBytesCopy,getCreate2Address:kr,getCreateAddress:Er,getDefaultProvider:Do,getIcapAddress:t.getIcapAddress,getIndexedAccountPath:uc,getNumber:t.getNumber,getUint:t.getUint,hashAuthorization:Jr,hashMessage:nn,hexlify:t.hexlify,id:t.id,isAddress:t.isAddress,isAddressable:t.isAddressable,isBytesLike:t.isBytesLike,isCallException:t.isCallException,isCrowdsaleJson:hc,isError:t.isError,isHexString:t.isHexString,isKeystoreJson:za,isValidName:en,keccak256:t.keccak256,lock:br,makeError:t.makeError,mask:t.mask,namehash:rn,parseEther:t.parseEther,parseUnits:t.parseUnits,pbkdf2:Pt,randomBytes:Ct,recoverAddress:Pr,resolveAddress:t.resolveAddress,resolveProperties:t.resolveProperties,ripemd160:Et,scrypt:Qt,scryptSync:zt,sha256:_t,sha512:Zt,showThrottleMessage:Oi,solidityPacked:hn,solidityPackedKeccak256:dn,solidityPackedSha256:fn,stripZerosLeft:t.stripZerosLeft,toBeArray:t.toBeArray,toBeHex:t.toBeHex,toBigInt:t.toBigInt,toNumber:t.toNumber,toQuantity:t.toQuantity,toTwos:t.toTwos,toUtf8Bytes:t.toUtf8Bytes,toUtf8CodePoints:t.toUtf8CodePoints,toUtf8String:t.toUtf8String,uuidV4:O,verifyAuthorization:jr,verifyMessage:on,verifyTypedData:Cn,version:t.version,wordlists:mc,zeroPadBytes:t.zeroPadBytes,zeroPadValue:t.zeroPadValue},Symbol.toStringTag,{value:"Module"}));exports.AbiCoder=t.AbiCoder,exports.BaseContract=t.BaseContract,exports.Block=t.Block,exports.ConstructorFragment=t.ConstructorFragment,exports.Contract=t.Contract,exports.ContractEventPayload=t.ContractEventPayload,exports.ContractTransactionReceipt=t.ContractTransactionReceipt,exports.ContractTransactionResponse=t.ContractTransactionResponse,exports.ContractUnknownEventPayload=t.ContractUnknownEventPayload,exports.ErrorDescription=t.ErrorDescription,exports.ErrorFragment=t.ErrorFragment,exports.EventFragment=t.EventFragment,exports.EventLog=t.EventLog,exports.EventPayload=t.EventPayload,exports.FallbackFragment=t.FallbackFragment,exports.FeeData=t.FeeData,exports.FixedNumber=t.FixedNumber,exports.Fragment=t.Fragment,exports.FunctionFragment=t.FunctionFragment,exports.Indexed=t.Indexed,exports.Interface=t.Interface,exports.Log=t.Log,exports.LogDescription=t.LogDescription,exports.NamedFragment=t.NamedFragment,exports.ParamType=t.ParamType,exports.Result=t.Result,exports.StructFragment=t.StructFragment,exports.TransactionDescription=t.TransactionDescription,exports.TransactionReceipt=t.TransactionReceipt,exports.TransactionResponse=t.TransactionResponse,exports.Typed=t.Typed,exports.UndecodedEventLog=t.UndecodedEventLog,exports.Utf8ErrorFuncs=t.Utf8ErrorFuncs,exports.ZeroAddress=t.ZeroAddress,exports.accessListify=t.accessListify,exports.assert=t.assert,exports.assertArgument=t.assertArgument,exports.assertArgumentCount=t.assertArgumentCount,exports.assertNormalize=t.assertNormalize,exports.assertPrivate=t.assertPrivate,exports.checkResultErrors=t.checkResultErrors,exports.concat=t.concat,exports.copyRequest=t.copyRequest,exports.dataLength=t.dataLength,exports.dataSlice=t.dataSlice,exports.defineProperties=t.defineProperties,exports.formatEther=t.formatEther,exports.formatUnits=t.formatUnits,exports.fromTwos=t.fromTwos,exports.getAddress=t.getAddress,exports.getBigInt=t.getBigInt,exports.getBytes=t.getBytes,exports.getBytesCopy=t.getBytesCopy,exports.getIcapAddress=t.getIcapAddress,exports.getNumber=t.getNumber,exports.getUint=t.getUint,exports.hexlify=t.hexlify,exports.id=t.id,exports.isAddress=t.isAddress,exports.isAddressable=t.isAddressable,exports.isBytesLike=t.isBytesLike,exports.isCallException=t.isCallException,exports.isError=t.isError,exports.isHexString=t.isHexString,exports.keccak256=t.keccak256,exports.makeError=t.makeError,exports.mask=t.mask,exports.parseEther=t.parseEther,exports.parseUnits=t.parseUnits,exports.resolveAddress=t.resolveAddress,exports.resolveProperties=t.resolveProperties,exports.stripZerosLeft=t.stripZerosLeft,exports.toBeArray=t.toBeArray,exports.toBeHex=t.toBeHex,exports.toBigInt=t.toBigInt,exports.toNumber=t.toNumber,exports.toQuantity=t.toQuantity,exports.toTwos=t.toTwos,exports.toUtf8Bytes=t.toUtf8Bytes,exports.toUtf8CodePoints=t.toUtf8CodePoints,exports.toUtf8String=t.toUtf8String,exports.version=t.version,exports.zeroPadBytes=t.zeroPadBytes,exports.zeroPadValue=t.zeroPadValue,exports.AbstractProvider=bi,exports.AbstractSigner=Ri,exports.AlchemyProvider=Xi,exports.AnkrProvider=Zi,exports.BaseWallet=Qo,exports.BlockscoutProvider=Lo,exports.BrowserProvider=Fo,exports.ChainstackProvider=to,exports.CloudflareProvider=eo,exports.ContractFactory=Tn,exports.EnsPlugin=Yn,exports.EnsResolver=Ln,exports.EtherSymbol="Ξ",exports.EtherscanPlugin=no,exports.EtherscanProvider=ao,exports.FallbackProvider=To,exports.FeeDataNetworkPlugin=Xn,exports.FetchCancelSignal=w,exports.FetchRequest=E,exports.FetchResponse=k,exports.FetchUrlFeeDataNetworkPlugin=$n,exports.GasCostPlugin=Zn,exports.HDNodeVoidWallet=cc,exports.HDNodeWallet=ac,exports.InfuraProvider=Ao,exports.InfuraWebSocketProvider=yo,exports.IpcSocketProvider=Ho,exports.JsonRpcApiProvider=Vi,exports.JsonRpcProvider=Ji,exports.JsonRpcSigner=Ki,exports.LangEn=_o,exports.MaxInt256=ir,exports.MaxUint256=sr,exports.MessagePrefix=or,exports.MinInt256=nr,exports.Mnemonic=ea,exports.MulticoinProviderPlugin=Dn,exports.N=er,exports.Network=ei,exports.NetworkPlugin=_n,exports.NonceManager=Uo,exports.PocketProvider=Go,exports.QuickNodeProvider=bo,exports.Signature=Ar,exports.SigningKey=wr,exports.SocketBlockSubscriber=uo,exports.SocketEventSubscriber=fo,exports.SocketPendingSubscriber=ho,exports.SocketProvider=po,exports.SocketSubscriber=lo,exports.Transaction=qr,exports.TypedDataEncoder=Nn,exports.UnmanagedSubscriber=gi,exports.VoidSigner=Si,exports.Wallet=pc,exports.WebSocketProvider=go,exports.WeiPerEther=rr,exports.Wordlist=Jo,exports.WordlistOwl=jo,exports.WordlistOwlA=gc,exports.ZeroHash=tr,exports.authorizationify=vr,exports.computeAddress=xr,exports.computeHmac=st,exports.decodeBase58=a,exports.decodeBase64=c,exports.decodeBytes32String=Sn,exports.decodeRlp=N,exports.decryptCrowdsaleJson=dc,exports.decryptKeystoreJson=ja,exports.decryptKeystoreJsonSync=qa,exports.defaultPath=Xa,exports.dnsEncode=sn,exports.encodeBase58=o,exports.encodeBase64=l,exports.encodeBytes32String=Rn,exports.encodeRlp=T,exports.encryptKeystoreJson=Ya,exports.encryptKeystoreJsonSync=Za,exports.ensNormalize=tn,exports.ethers=yc,exports.getAccountPath=lc,exports.getCreate2Address=kr,exports.getCreateAddress=Er,exports.getDefaultProvider=Do,exports.getIndexedAccountPath=uc,exports.hashAuthorization=Jr,exports.hashMessage=nn,exports.isCrowdsaleJson=hc,exports.isKeystoreJson=za,exports.isValidName=en,exports.lock=br,exports.namehash=rn,exports.pbkdf2=Pt,exports.randomBytes=Ct,exports.recoverAddress=Pr,exports.ripemd160=Et,exports.scrypt=Qt,exports.scryptSync=zt,exports.sha256=_t,exports.sha512=Zt,exports.showThrottleMessage=Oi,exports.solidityPacked=hn,exports.solidityPackedKeccak256=dn,exports.solidityPackedSha256=fn,exports.uuidV4=O,exports.verifyAuthorization=jr,exports.verifyMessage=on,exports.verifyTypedData=Cn,exports.wordlists=mc;
|
|
12
|
-
//# sourceMappingURL=index-
|
|
12
|
+
//# sourceMappingURL=index-C-IlLYlk.cjs.map
|