PageSourceSearch

https://marryonchain.com/_nuxt/web3-provider.8836c5b9.js

js marryonchain.com collected 2026-10-02 18:10:14 UTC 88,081 bytes, 1 lines download raw bytes

1import{a as x,q as Ae,m as Y,c as z,b as P,L as h,t as X,B as y,e as H,d as k,o as ut,h as M,k as Wt,s as D,l as L,g as lt,u as ge,f as ht,p as jt,j as Q,n as me,v as vt,w as rt,x as pe,P as we,i as $,r as S,F as ye,y as Ee,S as be}from"./index.87e0af35.js";import{h as ke}from"./hash.b5e63729.js";import{b as Ct}from"./index.9fe82dcc.js";import"./bn.c5232f5f.js";import"./entry.0711d117.js";import"./buffer-es6.96052bf7.js";import"./buffer-es6.67bbede9.js";const ft="providers/5.7.2",ve="0x0000000000000000000000000000000000000000",Ne="0x0000000000000000000000000000000000000000000000000000000000000000",Vt="hash/5.7.0";function Zt(i){i=atob(i);const t=[];for(let e=0;e<i.length;e++)t.push(i.charCodeAt(e));return x(t)}function $t(i){i=x(i);let t="";for(let e=0;e<i.length;e++)t+=String.fromCharCode(i[e]);return btoa(t)}function te(i,t){t==null&&(t=1);const e=[],r=e.forEach,n=function(s,o){r.call(s,function(l){o>0&&Array.isArray(l)?n(l,o-1):e.push(l)})};return n(i,t),e}function Ce(i){const t={};for(let e=0;e<i.length;e++){const r=i[e];t[r[0]]=r[1]}return t}function Be(i){let t=0;function e(){return i[t++]<<8|i[t++]}let r=e(),n=1,s=[0,1];for(let v=1;v<r;v++)s.push(n+=e());let o=e(),l=t;t+=o;let a=0,c=0;function u(){return a==0&&(c=c<<8|i[t++],a=8),c>>--a&1}const d=31,w=Math.pow(2,d),E=w>>>1,b=E>>1,N=w-1;let R=0;for(let v=0;v<d;v++)R=R<<1|u();let g=[],m=0,C=w;for(;;){let v=Math.floor(((R-m+1)*n-1)/C),_=0,At=r;for(;At-_>1;){let gt=_+At>>>1;v<s[gt]?At=gt:_=gt}if(_==0)break;g.push(_);let J=m+Math.floor(C*s[_]/n),K=m+Math.floor(C*s[_+1]/n)-1;for(;!((J^K)&E);)R=R<<1&N|u(),J=J<<1&N,K=K<<1&N|1;for(;J&~K&b;)R=R&E|R<<1&N>>>1|u(),J=J<<1^E,K=(K^E)<<1|E|1;m=J,C=1+K-J}let I=r-4;return g.map(v=>{switch(v-I){case 3:return I+65792+(i[l++]<<16|i[l++]<<8|i[l++]);case 2:return I+256+(i[l++]<<8|i[l++]);case 1:return I+i[l++];default:return v-1}})}function Ie(i){let t=0;return()=>i[t++]}function Te(i){return Ie(Be(i))}function Re(i){return i&1?~i>>1:i>>1}function Pe(i,t){let e=Array(i);for(let r=0;r<i;r++)e[r]=1+t();return e}function Bt(i,t){let e=Array(i);for(let r=0,n=-1;r<i;r++)e[r]=n+=1+t();return e}function xe(i,t){let e=Array(i);for(let r=0,n=0;r<i;r++)e[r]=n+=Re(t());return e}function at(i,t){let e=Bt(i(),i),r=i(),n=Bt(r,i),s=Pe(r,i);for(let o=0;o<r;o++)for(let l=0;l<s[o];l++)e.push(n[o]+l);return t?e.map(o=>t[o]):e}function _e(i){let t=[];for(;;){let e=i();if(e==0)break;t.push(Le(e,i))}for(;;){let e=i()-1;if(e<0)break;t.push(De(e,i))}return Ce(te(t))}function Oe(i){let t=[];for(;;){let e=i();if(e==0)break;t.push(e)}return t}function ee(i,t,e){let r=Array(i).fill(void 0).map(()=>[]);for(let n=0;n<t;n++)xe(i,e).forEach((s,o)=>r[o].push(s));return r}function Le(i,t){let e=1+t(),r=t(),n=Oe(t),s=ee(n.length,1+i,t);return te(s.map((o,l)=>{const a=o[0],c=o.slice(1);return Array(n[l]).fill(void 0).map((u,d)=>{let w=d*r;return[a+d*e,c.map(E=>E+w)]})}))}function De(i,t){let e=1+t();return ee(e,1+i,t).map(n=>[n[0],n.slice(1)])}function Se(i){let t=at(i).sort((r,n)=>r-n);return e();function e(){let r=[];for(;;){let c=at(i,t);if(c.length==0)break;r.push({set:new Set(c),node:e()})}r.sort((c,u)=>u.set.size-c.set.size);let n=i(),s=n%3;n=n/3|0;let o=!!(n&1);n>>=1;let l=n==1,a=n==2;return{branches:r,valid:s,fe0f:o,save:l,check:a}}}function Qe(){return Te(Zt
vendor: 14,757 bytes, line 1
1("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCis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ZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))
1}const dt=Qe(),Ue=new Set(at(dt)),Me=new Set(at(dt)),He=_e(dt),Ge=Se(dt),It=45,Tt=95;function re(i){return Ae(i)}function qe(i){return i.filter(t=>t!=65039)}function ne(i){for(let t of i.split(".")){let e=re(t);try{for(let r=e.lastIndexOf(Tt)-1;r>=0;r--)if(e[r]!==Tt)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every(r=>r<128)&&e[2]===It&&e[3]===It)throw new Error("invalid label extension")}catch(r){throw new Error(`Invalid label "${t}": ${r.message}`)}}return i}function Je(i){return ne(Fe(i,qe))}function Fe(i,t){let e=re(i).reverse(),r=[];for(;e.length;){let n=Ke(e);if(n){r.push(...t(n));continue}let s=e.pop();if(Ue.has(s)){r.push(s);continue}if(Me.has(s))continue;let o=He[s];if(o){r.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return ne(Ye(String.fromCodePoint(...r)))}function Ye(i){return i.normalize("NFC")}function Ke(i,t){var e;let r=Ge,n,s,o=[],l=i.length;for(t&&(t.length=0);l;){let a=i[--l];if(r=(e=r.branches.find(c=>c.set.has(a)))===null||e===void 0?void 0:e.node,!r)break;
1if(r.save)s=a;else if(r.check&&a===s)break;o.push(a),r.fe0f&&(o.push(65039),l>0&&i[l-1]==65039&&l--),r.valid&&(n=o.slice(),r.valid==2&&n.splice(1,1),t&&t.push(...i.slice(l).reverse()),i.length=l)}return n}const ze=new h(Vt),ie=new Uint8Array(32);ie.fill(0);function Rt(i){if(i.length===0)throw new Error("invalid ENS name; empty component");return i}function se(i){const t=X(Je(i)),e=[];if(i.length===0)return e;let r=0;for(let n=0;n<t.length;n++)t[n]===46&&(e.push(Rt(t.slice(r,n))),r=n+1);if(r>=t.length)throw new Error("invalid ENS name; empty component");return e.push(Rt(t.slice(r))),e}function st(i){typeof i!="string"&&ze.throwArgumentError("invalid ENS name; not a string","name",i);let t=ie;const e=se(i);for(;e.length;)t=Y(z([t,Y(e.pop())]));return P(t)}function Xe(i){return P(z(se(i).map(t=>{if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e})))+"00"}var We=globalThis&&globalThis.__awaiter||function(i,t,e,r){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(d){o(d)}}function a(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(i,t||[])).next())})};const B=new h(Vt),oe=new Uint8Array(32);oe.fill(0);const je=y.from(-1),le=y.from(0),ae=y.from(1),Ve=y.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ze(i){const t=x(i),e=t.length%32;return e?M([t,oe.slice(e)]):P(t)}const $e=H(ae.toHexString(),32),tr=H(le.toHexString(),32),Pt={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},mt=["name","version","chainId","verifyingContract","salt"];function xt(i){return function(t){return typeof t!="string"&&B.throwArgumentError(`invalid domain value for ${JSON.stringify(i)}`,`domain.${i}`,t),t}}const er={name:xt("name"),version:xt("version"),chainId:function(i){try{return y.from(i).toString()}catch{}return B.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",i)},verifyingContract:function(i){try{return lt(i).toLowerCase()}catch{}return B.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",i)},salt:function(i){try{const t=x(i);if(t.length!==32)throw new Error("bad length");return P(t)}catch{}return B.throwArgumentError('invalid domain value "salt"',"domain.salt",i)}};function pt(i){{const t=i.match(/^(u?)int(\d*)$/);if(t){const e=t[1]==="",r=parseInt(t[2]||"256");(r%8!==0||r>256||t[2]&&t[2]!==String(r))&&B.throwArgumentError("invalid numeric width","type",i);const n=Ve.mask(e?r-1:r),s=e?n.add(ae).mul(je):le;return function(o){const l=y.from(o);return(l.lt(s)||l.gt(n))&&B.throwArgumentError(`value out-of-bounds for ${i}`,"value",o),H(l.toTwos(256).toHexString(),32)}}}{const t=i.match(/^bytes(\d+)$/);if(t){const e=parseInt(t[1]);return(e===0||e>32||t[1]!==String(e))&&B.throwArgumentError("invalid bytes width","type",i),function(r){return x(r).length!==e&&B.throwArgumentError(`invalid length for ${i}`,"value",r),Ze(r)}}}switch(i){case"address":return function(t){return H(lt(t),32)};case"bool":return function(t){return t?$e:tr};case"bytes":return function(t){return Y(t)};case"string":return function(t){return Wt(t)}}return null}function _t(i,t){return`${i}(${t.map(({name:e,type:r})=>r+" "+e).join(",")})`}class O{constructor(t){k(this,"types",Object.freeze(ut(t))),k(this,"_encoderCache",{}),k(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach(l=>{e[l]={},r[l]=[],n[l]={}});for(const l in t){const a={};t[l].forEach(c=>{a[c.name]&&B.throwArgumentError(`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(l)}`,"types",t),a[c.name]=!0;const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===l&&B.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",t),!pt(u)&&(r[u]||B.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",t),r[u].push(l),e[l][u]=!0)})}const s=Object.keys(r).filter(l=>r[l].length===0);s.length===0?B.throwArgumentError("missing primary type","types",t):s.length>1&&B.throwArgumentError(`ambiguous primary types or unused types: ${s.map(l
1=>JSON.stringify(l)).join(", ")}`,"types",t),k(this,"primaryType",s[0]);function o(l,a){a[l]&&B.throwArgumentError(`circular type reference to ${JSON.stringify(l)}`,"types",t),a[l]=!0,Object.keys(e[l]).forEach(c=>{r[c]&&(o(c,a),Object.keys(a).forEach(u=>{n[u][c]=!0}))}),delete a[l]}o(this.primaryType,{});for(const l in n){const a=Object.keys(n[l]);a.sort(),this._types[l]=_t(l,t[l])+a.map(c=>_t(c,t[c])).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const n=pt(t);if(n)return n}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const n=e[1],s=this.getEncoder(n),o=parseInt(e[3]);return l=>{o>=0&&l.length!==o&&B.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",l);let a=l.map(s);return this._types[n]&&(a=a.map(Y)),Y(M(a))}}const r=this.types[t];if(r){const n=Wt(this._types[t]);return s=>{const o=r.map(({name:l,type:a})=>{const c=this.getEncoder(a)(s[l]);return this._types[a]?Y(c):c});return o.unshift(n),M(o)}}return B.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||B.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Y(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(pt(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const o=n[1],l=parseInt(n[3]);return l>=0&&e.length!==l&&B.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map(a=>this._visit(o,a,r))}const s=this.types[t];return s?s.reduce((o,{name:l,type:a})=>(o[l]=this._visit(a,e[l],r),o),{}):B.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new O(t)}static getPrimaryType(t){return O.from(t).primaryType}static hashStruct(t,e,r){return O.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=Pt[r];n||B.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort((r,n)=>mt.indexOf(r.name)-mt.indexOf(n.name)),O.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return M(["0x1901",O.hashDomain(t),O.from(e).hash(r)])}static hash(t,e,r){return Y(O.encode(t,e,r))}static resolveNames(t,e,r,n){return We(this,void 0,void 0,function*(){t=D(t);const s={};t.verifyingContract&&!L(t.verifyingContract,20)&&(s[t.verifyingContract]="0x");const o=O.from(e);o.visit(r,(l,a)=>(l==="address"&&!L(a,20)&&(s[a]="0x"),a));for(const l in s)s[l]=yield n(l);return t.verifyingContract&&s[t.verifyingContract]&&(t.verifyingContract=s[t.verifyingContract]),r=o.visit(r,(l,a)=>l==="address"&&s[a]?s[a]:a),{domain:t,value:r}})}static getPayload(t,e,r){O.hashDomain(t);const n={},s=[];mt.forEach(a=>{const c=t[a];c!=null&&(n[a]=er[a](c),s.push({name:a,type:Pt[a]}))});const o=O.from(e),l=D(e);return l.EIP712Domain?B.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):l.EIP712Domain=s,o.encode(r),{types:l,domain:n,primaryType:o.primaryType,message:o.visit(r,(a,c)=>{if(a.match(/^bytes(\d*)/))return P(x(c));if(a.match(/^u?int/))return y.from(c).toString();switch(a){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return typeof c!="string"&&B.throwArgumentError("invalid string","value",c),c}return B.throwArgumentError("unsupported type","type",a)})}}}const rr="web/5.7.1";var nr=globalThis&&globalThis.__awaiter||function(i,t,e,r){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(d){o(d)}}function a(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(i,t||[])).next())})};function ir(i,t){return nr(this,void 0,void 0,function*(){t==null&&(t={});const e={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(t.skipFetchSetup!==!0&&(e.mode="cors",e.cache="no-cache",e.credentials="same-origin",e.redirect="follow",e.referrer="client"),t.fetchOptions!=null){const o=t.fetchOptions;o.mode&&(e.mode=o.mode),o.cache&&(e.cache=o.cache),o.credentials&&(e.credentials=o.credentials),o.redirect&&(e.redirect=o.redirect),o.referrer&&(e.referrer=o.referrer)}const r=yield fetch(i,e),n=yield r.arrayBuffer(),s={};
1return r.headers.forEach?r.headers.forEach((o,l)=>{s[l.toLowerCase()]=o}):r.headers.keys().forEach(o=>{s[o.toLowerCase()]=r.headers.get(o)}),{headers:s,statusCode:r.status,statusMessage:r.statusText,body:x(new Uint8Array(n))}})}var sr=globalThis&&globalThis.__awaiter||function(i,t,e,r){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(d){o(d)}}function a(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(i,t||[])).next())})};const U=new h(rr);function Ot(i){return new Promise(t=>{setTimeout(t,i)})}function F(i,t){if(i==null)return null;if(typeof i=="string")return i;if(ge(i)){if(t&&(t.split("/")[0]==="text"||t.split(";")[0].trim()==="application/json"))try{return ht(i)}catch{}return P(i)}return i}function or(i){return X(i.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16))))}function lr(i,t,e){const r=typeof i=="object"&&i.throttleLimit!=null?i.throttleLimit:12;U.assertArgument(r>0&&r%1===0,"invalid connection throttle limit","connection.throttleLimit",r);const n=typeof i=="object"?i.throttleCallback:null,s=typeof i=="object"&&typeof i.throttleSlotInterval=="number"?i.throttleSlotInterval:100;U.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof i=="object"?!!i.errorPassThrough:!1,l={};let a=null;const c={method:"GET"};let u=!1,d=2*60*1e3;if(typeof i=="string")a=i;else if(typeof i=="object"){if((i==null||i.url==null)&&U.throwArgumentError("missing URL","connection.url",i),a=i.url,typeof i.timeout=="number"&&i.timeout>0&&(d=i.timeout),i.headers)for(const g in i.headers)l[g.toLowerCase()]={key:g,value:String(i.headers[g])},["if-none-match","if-modified-since"].indexOf(g.toLowerCase())>=0&&(u=!0);if(c.allowGzip=!!i.allowGzip,i.user!=null&&i.password!=null){a.substring(0,6)!=="https:"&&i.allowInsecureAuthentication!==!0&&U.throwError("basic authentication requires a secure https url",h.errors.INVALID_ARGUMENT,{argument:"url",url:a,user:i.user,password:"[REDACTED]"});const g=i.user+":"+i.password;l.authorization={key:"Authorization",value:"Basic "+$t(X(g))}}i.skipFetchSetup!=null&&(c.skipFetchSetup=!!i.skipFetchSetup),i.fetchOptions!=null&&(c.fetchOptions=D(i.fetchOptions))}const w=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),E=a?a.match(w):null;if(E)try{const g={statusCode:200,statusMessage:"OK",headers:{"content-type":E[1]||"text/plain"},body:E[2]?Zt(E[3]):or(E[3])};let m=g.body;return e&&(m=e(g.body,g)),Promise.resolve(m)}catch(g){U.throwError("processing response error",h.errors.SERVER_ERROR,{body:F(E[1],E[2]),error:g,requestBody:null,requestMethod:"GET",url:a})}t&&(c.method="POST",c.body=t,l["content-type"]==null&&(l["content-type"]={key:"Content-Type",value:"application/octet-stream"}),l["content-length"]==null&&(l["content-length"]={key:"Content-Length",value:String(t.length)}));const b={};Object.keys(l).forEach(g=>{const m=l[g];b[m.key]=m.value}),c.headers=b;const N=function(){let g=null;return{promise:new Promise(function(I,v){d&&(g=setTimeout(()=>{g!=null&&(g=null,v(U.makeError("timeout",h.errors.TIMEOUT,{requestBody:F(c.body,b["content-type"]),requestMethod:c.method,timeout:d,url:a})))},d))}),cancel:function(){g!=null&&(clearTimeout(g),g=null)}}}(),R=function(){return sr(this,void 0,void 0,function*(){for(let g=0;g<r;g++){let m=null;try{if(m=yield ir(a,c),g<r){if(m.statusCode===301||m.statusCode===302){const I=m.headers.location||"";if(c.method==="GET"&&I.match(/^https:/)){a=m.headers.location;continue}}else if(m.statusCode===429){let I=!0;if(n&&(I=yield n(g,a)),I){let v=0;const _=m.headers["retry-after"];typeof _=="string"&&_.match(/^[1-9][0-9]*$/)?v=parseInt(_)*1e3:v=s*parseInt(String(Math.random()*Math.pow(2,g))),yield Ot(v);continue}}}}catch(I){m=I.response,m==null&&(N.cancel(),U.throwError("missing response",h.errors.SERVER_ERROR,{requestBody:F(c.body,b["content-type"]),requestMethod:c.method,serverError:I,url:a}))}let C=m.body;if(u&&m.statusCode===304?C=null:!o&&(m.statusCode<200||m.statusCode>=300)&&(N.cancel(),U.throwError("bad response",h.errors.SERVER_ERROR,{status:m.statusCode,headers:m.headers,body:F(C,m.headers?m.headers["content-type"]:null),requestBody:F(c.body,b["content-type"]),requestMethod:c.method,url:a})),e)try{const I=yield e(C,m);return N.cancel(),I}
1catch(I){if(I.throttleRetry&&g<r){let v=!0;if(n&&(v=yield n(g,a)),v){const _=s*parseInt(String(Math.random()*Math.pow(2,g)));yield Ot(_);continue}}N.cancel(),U.throwError("processing response error",h.errors.SERVER_ERROR,{body:F(C,m.headers?m.headers["content-type"]:null),error:I,requestBody:F(c.body,b["content-type"]),requestMethod:c.method,url:a})}return N.cancel(),C}return U.throwError("failed response",h.errors.SERVER_ERROR,{requestBody:F(c.body,b["content-type"]),requestMethod:c.method,url:a})})}();return Promise.race([N.promise,R])}function Nt(i,t,e){let r=(s,o)=>{let l=null;if(s!=null)try{l=JSON.parse(ht(s))}catch(a){U.throwError("invalid JSON",h.errors.SERVER_ERROR,{body:s,error:a})}return e&&(l=e(l,o)),l},n=null;if(t!=null){n=X(t);const s=typeof i=="string"?{url:i}:D(i);s.headers?Object.keys(s.headers).filter(l=>l.toLowerCase()==="content-type").length!==0||(s.headers=D(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},i=s}return lr(i,n,r)}function tt(i,t){return t||(t={}),t=D(t),t.floor==null&&(t.floor=0),t.ceiling==null&&(t.ceiling=1e4),t.interval==null&&(t.interval=250),new Promise(function(e,r){let n=null,s=!1;const o=()=>s?!1:(s=!0,n&&clearTimeout(n),!0);t.timeout&&(n=setTimeout(()=>{o()&&r(new Error("timeout"))},t.timeout));const l=t.retryLimit;let a=0;function c(){return i().then(function(u){if(u!==void 0)o()&&e(u);else if(t.oncePoll)t.oncePoll.once("poll",c);else if(t.onceBlock)t.onceBlock.once("block",c);else if(!s){if(a++,a>l){o()&&r(new Error("retry limit reached"));return}let d=t.interval*parseInt(String(Math.random()*Math.pow(2,a)));d<t.floor&&(d=t.floor),d>t.ceiling&&(d=t.ceiling),setTimeout(c,d)}return null},function(u){o()&&r(u)})}c()})}class ce{constructor(t){k(this,"alphabet",t),k(this,"base",t.length),k(this,"_alphabetMap",{}),k(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=x(t);if(e.length===0)return"";let r=[0];for(let s=0;s<e.length;++s){let o=e[s];for(let l=0;l<r.length;++l)o+=r[l]<<8,r[l]=o%this.base,o=o/this.base|0;for(;o>0;)r.push(o%this.base),o=o/this.base|0}let n="";for(let s=0;e[s]===0&&s<e.length-1;++s)n+=this._leader;for(let s=r.length-1;s>=0;--s)n+=this.alphabet[r[s]];return n}decode(t){if(typeof t!="string")throw new TypeError("Expected String");let e=[];
1if(t.length===0)return new Uint8Array(e);e.push(0);for(let r=0;r<t.length;r++){let n=this._alphabetMap[t[r]];if(n===void 0)throw new Error("Non-base"+this.base+" character");let s=n;for(let o=0;o<e.length;++o)s+=e[o]*this.base,e[o]=s&255,s>>=8;for(;s>0;)e.push(s&255),s>>=8}for(let r=0;t[r]===this._leader&&r<t.length-1;++r)e.push(0);return x(new Uint8Array(e.reverse()))}}new ce("abcdefghijklmnopqrstuvwxyz234567");const bt=new ce("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),ar="networks/5.7.1",Lt=new h(ar);function cr(i){return i&&typeof i.renetwork=="function"}function q(i){const t=function(e,r){r==null&&(r={});const n=[];if(e.InfuraProvider&&r.infura!=="-")try{n.push(new e.InfuraProvider(i,r.infura))}catch{}if(e.EtherscanProvider&&r.etherscan!=="-")try{n.push(new e.EtherscanProvider(i,r.etherscan))}catch{}if(e.AlchemyProvider&&r.alchemy!=="-")try{n.push(new e.AlchemyProvider(i,r.alchemy))}catch{}if(e.PocketProvider&&r.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new e.PocketProvider(i,r.pocket);o.network&&s.indexOf(o.network.name)===-1&&n.push(o)}catch{}}if(e.CloudflareProvider&&r.cloudflare!=="-")try{n.push(new e.CloudflareProvider(i))}catch{}if(e.AnkrProvider&&r.ankr!=="-")try{const s=["ropsten"],o=new e.AnkrProvider(i,r.ankr);o.network&&s.indexOf(o.network.name)===-1&&n.push(o)}catch{}if(n.length===0)return null;if(e.FallbackProvider){let s=1;return r.quorum!=null?s=r.quorum:i==="homestead"&&(s=2),new e.FallbackProvider(n,s)}return n[0]};return t.renetwork=function(e){return q(e)},t}function ct(i,t){const e=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(i,t):null};return e.renetwork=function(r){return ct(i,r)},e}const Dt={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:q("homestead")},St={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:q("ropsten")},Qt={chainId:63,name:"classicMordor",_defaultProvider:ct("https://www.ethercluster.com/mordor","classicMordor")},it={unspecified:{chainId:0,name:"unspecified"},homestead:Dt,mainnet:Dt,morden:{chainId:2,name:"morden"},ropsten:St,testnet:St,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:q("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:q("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:q("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:q("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ct("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Qt,classicTestnet:Qt,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ct("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:q("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:q("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function ur(i){if(i==null)return null;if(typeof i=="number"){for(const r in it){const n=it[r];if(n.chainId===i)return{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress||null,_defaultProvider:n._defaultProvider||null}}return{chainId:i,name:"unknown"}}if(typeof i=="string"){const r=it[i];return r==null?null:{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress,_defaultProvider:r._defaultProvider||null}}const t=it[i.name];if(!t)return typeof i.chainId!="number"&&Lt.throwArgumentError("invalid network chainId","network",i),i;i.chainId!==0&&i.chainId!==t.chainId&&Lt.throwArgumentError("network chainId mismatch","network",i);let e=i._defaultProvider||null;return e==null&&t._defaultProvider&&(cr(t._defaultProvider)?e=t._defaultProvider.renetwork(i):e=t._defaultProvider),{name:i.name,chainId:t.chainId,ensAddress:i.ensAddress||t.ensAddress||null,_defaultProvider:e}}
1function Ut(i){return"0x"+ke.sha256().update(x(i)).digest("hex")}const j=new h(ft);class f{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),l=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this),u=d=>this.data(d,!0);return t.transaction={hash:o,type:c,accessList:f.allowNull(this.accessList.bind(this),null),blockHash:f.allowNull(o,null),blockNumber:f.allowNull(a,null),transactionIndex:f.allowNull(a,null),confirmations:f.allowNull(a,null),from:e,gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),gasLimit:r,to:f.allowNull(e,null),value:r,nonce:a,data:s,r:f.allowNull(this.uint256),s:f.allowNull(this.uint256),v:f.allowNull(a),creates:f.allowNull(e,null),raw:f.allowNull(s)},t.transactionRequest={from:f.allowNull(e),nonce:f.allowNull(a),gasLimit:f.allowNull(r),gasPrice:f.allowNull(r),maxPriorityFeePerGas:f.allowNull(r),maxFeePerGas:f.allowNull(r),to:f.allowNull(e),value:f.allowNull(r),data:f.allowNull(u),type:f.allowNull(a),accessList:f.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:f.arrayOf(o),data:s,logIndex:a,blockHash:o},t.receipt={to:f.allowNull(this.address,null),from:f.allowNull(this.address,null),contractAddress:f.allowNull(e,null),transactionIndex:a,root:f.allowNull(l),gasUsed:r,logsBloom:f.allowNull(s),blockHash:o,transactionHash:o,logs:f.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:f.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:f.allowNull(r),status:f.allowNull(a),type:c},t.block={hash:f.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:f.allowNull(l),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:f.allowNull(e),extraData:s,transactions:f.allowNull(f.arrayOf(o)),baseFeePerGas:f.allowNull(r)},t.blockWithTransactions=D(t.block),t.blockWithTransactions.transactions=f.allowNull(f.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:f.allowNull(n,void 0),toBlock:f.allowNull(n,void 0),blockHash:f.allowNull(o,void 0),address:f.allowNull(e,void 0),topics:f.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:f.allowNull(a),blockHash:f.allowNull(o),transactionIndex:a,removed:f.allowNull(this.boolean.bind(this)),address:e,data:f.allowFalsish(s,"0x"),topics:f.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return jt(t||[])}number(t){return t==="0x"?0:y.from(t).toNumber()}type(t){return t==="0x"||t==null?0:y.from(t).toNumber()}bigNumber(t){return y.from(t)}boolean(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t=t.toLowerCase(),t==="true")return!0;if(t==="false")return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return typeof t=="string"&&(!e&&t.substring(0,2)!=="0x"&&(t="0x"+t),L(t))?t.toLowerCase():j.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return lt(t)}callAddress(t){if(!L(t,32))return null;const e=lt(Q(t,12));return e===ve?null:e}contractAddress(t){return me(t)}blockTag(t){if(t==null)return"latest";if(t==="earliest")return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if(typeof t=="number"||L(t))return vt(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return rt(r)!==32?j.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(t==null)return null;const e=y.from(t);try{return e.toNumber()}catch{}return null}uint256(t){if(!L(t))throw new Error("invalid uint256");return H(t,32)}_block(t,e){t.author!=null&&t.miner==null&&(t.miner=t.author);const r=t._difficulty!=null?t._difficulty:t.difficulty,n=f.check(e,t);return n._difficulty=r==null?null:y.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return f.check(this.formats.transactionRequest,t)}
1transactionResponse(t){t.gas!=null&&t.gasLimit==null&&(t.gasLimit=t.gas),t.to&&y.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),t.input!=null&&t.data==null&&(t.data=t.input),t.to==null&&t.creates==null&&(t.creates=this.contractAddress(t)),(t.type===1||t.type===2)&&t.accessList==null&&(t.accessList=[]);const e=f.check(this.formats.transaction,t);if(t.chainId!=null){let r=t.chainId;L(r)&&(r=y.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;r==null&&e.v==null&&(r=t.chainId),L(r)&&(r=y.from(r).toNumber()),typeof r!="number"&&e.v!=null&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),typeof r!="number"&&(r=0),e.chainId=r}return e.blockHash&&e.blockHash.replace(/0/g,"")==="x"&&(e.blockHash=null),e}transaction(t){return pe(t)}receiptLog(t){return f.check(this.formats.receiptLog,t)}receipt(t){const e=f.check(this.formats.receipt,t);if(e.root!=null)if(e.root.length<=4){const r=y.from(e.root).toNumber();r===0||r===1?(e.status!=null&&e.status!==r&&j.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=r,delete e.root):j.throwArgumentError("invalid alt-root-status","value.root",e.root)}else e.root.length!==66&&j.throwArgumentError("invalid root hash","value.root",e.root);return e.status!=null&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map(e=>this.topics(e)):t!=null?this.hash(t,!0):null}filter(t){return f.check(this.formats.filter,t)}filterLog(t){return f.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const s=t[n](e[n]);s!==void 0&&(r[n]=s)}catch(s){throw s.checkKey=n,s.checkValue=e[n],s}return r}static allowNull(t,e){return function(r){return r==null?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach(function(n){r.push(t(n))}),r}}}var A=globalThis&&globalThis.__awaiter||function(i,t,e,r){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(d){o(d)}}function a(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(i,t||[])).next())})};const p=new h(ft),hr=10;function Mt(i){return i==null?"null":(rt(i)!==32&&p.throwArgumentError("invalid topic","topic",i),i.toLowerCase())}function Ht(i){for(i=i.slice();i.length>0&&i[i.length-1]==null;)i.pop();return i.map(t=>{if(Array.isArray(t)){const e={};t.forEach(n=>{e[Mt(n)]=!0});const r=Object.keys(e);return r.sort(),r.join("|")}else return Mt(t)}).join("&")}function fr(i){return i===""?[]:i.split(/&/g).map(t=>{if(t==="")return[];const e=t.split("|").map(r=>r==="null"?null:r);return e.length===1?e[0]:e})}function W(i){if(typeof i=="string"){if(i=i.toLowerCase(),rt(i)===32)return"tx:"+i;if(i.indexOf(":")===-1)return i}else{if(Array.isArray(i))return"filter:*:"+Ht(i);if(ye.isForkEvent(i))throw p.warn("not implemented"),new Error("not implemented");if(i&&typeof i=="object")return"filter:"+(i.address||"*")+":"+Ht(i.topics||[])}throw new Error("invalid event - "+i)}function V(){return new Date().getTime()}function Gt(i){return new Promise(t=>{setTimeout(t,i)})}const dr=["block","network","pending","poll"];class Ar{constructor(t,e,r){k(this,"tag",t),k(this,"listener",e),k(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return t[0]!=="tx"?null:t[1]}get filter(){const t=this.tag.split(":");if(t[0]!=="filter")return null;const e=t[1],r=fr(t[2]),n={};return r.length>0&&(n.topics=r),e&&e!=="*"&&(n.address=e),n}pollable(){return this.tag.indexOf(":")>=0||dr.indexOf(this.tag)>=0}}const gr={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function wt(i){return H(y.from(i).toHexString(),32)}function qt(i){return bt.encode(z([i,Q(Ut(Ut(i)),0,4)]))}const ue=new RegExp("^(ipfs)://(.*)$","i"),Jt=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ue,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ot(i,t){try{return ht(nt(i,t))}catch{}return null}function nt(i,t){if(i==="0x")return null;const e=y.from(Q(i,t,t+32)).toNumber(),r=y.from(Q(i,e,e+32)).toNumber();return Q(i,e+32,e+32+r)}function yt(i){return i.match(/^ipfs:\/\/ipfs\//i)?i=i.substring(12):i.match(/^ipfs:\/\//i)?i=i.substring(7):p.throwArgumentError("unsupported IPFS format","link",i),`https://gateway.ipfs.io/ipfs/${i}`}function Ft(i){const t=x(i);if(t.length>32)throw new Error("internal; should not happen");const e=new Uint8Array(32);return e.set(t,32-t.length),e}function mr(i){if(i.length%32===0)return i;const t=new Uint8Array(Math.ceil(i.length/32)*32);return t.set(i),t}function he(i){const t=[];let e=0;for(let r=0;r<i.length;r++)t.push(null),e+=32;for(let r=0;r<i.length;r++){const n=x(i[r]);
1t[r]=Ft(e),t.push(Ft(n.length)),t.push(mr(n)),e+=32+Math.ceil(n.length/32)*32}return M(t)}class Yt{constructor(t,e,r,n){k(this,"provider",t),k(this,"name",r),k(this,"address",t.formatter.address(e)),k(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(t=>y.from(t).eq(1)).catch(t=>{if(t.code===h.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t})),this._supportsEip2544}_fetch(t,e){return A(this,void 0,void 0,function*(){const r={to:this.address,ccipReadEnabled:!0,data:M([t,st(this.name),e||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=M(["0x9061b923",he([Xe(this.name),r.data])]));try{let s=yield this.provider.call(r);return x(s).length%32===4&&p.throwError("resolver threw error",h.errors.CALL_EXCEPTION,{transaction:r,data:s}),n&&(s=nt(s,0)),s}catch(s){if(s.code===h.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(t,e){return A(this,void 0,void 0,function*(){const r=yield this._fetch(t,e);return r!=null?nt(r,0):null})}_getAddress(t,e){const r=gr[String(t)];if(r==null&&p.throwError(`unsupported coin type: ${t}`,h.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),r.ilk==="eth")return this.provider.formatter.address(e);const n=x(e);if(r.p2pkh!=null){const s=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return qt(z([[r.p2pkh],"0x"+s[2]]))}}if(r.p2sh!=null){const s=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return qt(z([[r.p2sh],"0x"+s[2]]))}}if(r.prefix!=null){const s=n[1];let o=n[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&n.length===2+s&&s>=1&&s<=75){const l=Ct.toWords(n.slice(2));return l.unshift(o),Ct.encode(r.prefix,l)}}return null}getAddress(t){return A(this,void 0,void 0,function*(){if(t==null&&(t=60),t===60)try{const n=yield this._fetch("0x3b3b57de");return n==="0x"||n===Ne?null:this.provider.formatter.callAddress(n)}catch(n){if(n.code===h.errors.CALL_EXCEPTION)return null;throw n}const e=yield this._fetchBytes("0xf1cb7e06",wt(t));if(e==null||e==="0x")return null;const r=this._getAddress(t,e);return r==null&&p.throwError("invalid or unsupported coin data",h.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r})}getAvatar(){return A(this,void 0,void 0,function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(e==null)return null;for(let r=0;r<Jt.length;r++){const n=e.match(Jt[r]);if(n==null)continue;const s=n[1].toLowerCase();switch(s){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:yt(e)};case"erc721":case"erc1155":{const o=s==="erc721"?"0xc87b56dd":"0x0e89341c";t.push({type:s,content:e});const l=this._resolvedAddress||(yield this.getAddress()),a=(n[2]||"").split("/");if(a.length!==2)return null;const c=yield this.provider.formatter.address(a[0]),u=H(y.from(a[1]).toHexString(),32);if(s==="erc721"){const N=this.provider.formatter.callAddress(yield this.provider.call({to:c,data:M(["0x6352211e",u])}));if(l!==N)return null;t.push({type:"owner",content:N})}else if(s==="erc1155"){const N=y.from(yield this.provider.call({to:c,data:M(["0x00fdd58e",H(l,32),u])}));if(N.isZero())return null;t.push({type:"balance",content:N.toString()})}const d={to:this.provider.formatter.address(a[0]),data:M([o,u])};let w=ot(yield this.provider.call(d),0);if(w==null)return null;t.push({type:"metadata-url-base",content:w}),s==="erc1155"&&(w=w.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:w})),w.match(/^ipfs:/i)&&(w=yt(w)),t.push({type:"metadata-url",content:w});const E=yield Nt(w);if(!E)return null;t.push({type:"metadata",content:JSON.stringify(E)});let b=E.image;if(typeof b!="string")return null;if(!b.match(/^(https:\/\/|data:)/i)){if(b.match(ue)==null)return null;t.push({type:"url-ipfs",content:b}),b=yt(b)}return t.push({type:"url",content:b}),{linkage:t,url:b}}}}}catch{}return null})}getContentHash(){return A(this,void 0,void 0,function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(t==null||t==="0x")return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const o=parseInt(e[3],16);if(e[4].length===o*2)return"ipfs://"+bt.encode("0x"+e[1])}const r=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const o=parseInt(r[3],16);if(r[4].length===o*2)return"ipns://"+bt.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===32*2)return"bzz://"+n[1];const s=t.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&s[1].length===34*2){const o={"=":"","+":"-","/":"_"};return"sia://"+$t("0x"+s[1]).replace(/[=+\/]/g,a=>o[a])}return p.throwError("invalid or unsupported content hash data",h.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})})}getText(t){return A(this,void 0,void 0,function*(){let e=X(t);e=z([wt(64),wt(e.length),e]),e.length%32!==0&&(e=z([e,H("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",P(e));return r==null||r==="0x"?null:ht(r)})}}let Et=null,pr=1;class wr extends we{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),k(this,"anyNetwork",t==="any"),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch(e=>{}),this._ready().catch(e=>{});else{const e=$(new.target,"getNetwork")(t);
1e?(k(this,"_network",e),this.emit("network",e,null)):p.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return A(this,void 0,void 0,function*(){if(this._network==null){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch{}t==null&&(t=yield this.detectNetwork()),t||p.throwError("no network detected",h.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=t:k(this,"_network",t),this.emit("network",t,null))}return this._network})}get ready(){return tt(()=>this._ready().then(t=>t,t=>{if(!(t.code===h.errors.NETWORK_ERROR&&t.event==="noNetwork"))throw t}))}static getFormatter(){return Et==null&&(Et=new f),Et}static getNetwork(t){return ur(t??"homestead")}ccipReadFetch(t,e,r){return A(this,void 0,void 0,function*(){if(this.disableCcipRead||r.length===0)return null;const n=t.to.toLowerCase(),s=e.toLowerCase(),o=[];for(let l=0;l<r.length;l++){const a=r[l],c=a.replace("{sender}",n).replace("{data}",s),u=a.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:n}),d=yield Nt({url:c,errorPassThrough:!0},u,(E,b)=>(E.status=b.statusCode,E));if(d.data)return d.data;const w=d.message||"unknown error";if(d.status>=400&&d.status<500)return p.throwError(`response not found during CCIP fetch: ${w}`,h.errors.SERVER_ERROR,{url:a,errorMessage:w});o.push(w)}return p.throwError(`error encountered during CCIP fetch: ${o.map(l=>JSON.stringify(l)).join(", ")}`,h.errors.SERVER_ERROR,{urls:r,errorMessages:o})})}_getInternalBlockNumber(t){return A(this,void 0,void 0,function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const n=this._internalBlockNumber;try{const s=yield n;if(V()-s.respTime<=t)return s.blockNumber;break}catch{if(this._internalBlockNumber===n)break}}const e=V(),r=S({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(n=>null,n=>n)}).then(({blockNumber:n,networkError:s})=>{if(s)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),s;const o=V();return n=y.from(n).toNumber(),n<this._maxInternalBlockNumber&&(n=this._maxInternalBlockNumber),this._maxInternalBlockNumber=n,this._setFastBlockNumber(n),{blockNumber:n,reqTime:e,respTime:o}});return this._internalBlockNumber=r,r.catch(n=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return A(this,void 0,void 0,function*(){const t=pr++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){this.emit("error",n);return}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r===this._lastBlockNumber){this.emit("didPoll",t);return}if(this._emitted.block===-2&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)p.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",p.makeError("network block skew detected",h.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let n=this._emitted.block+1;n<=r;n++)this.emit("block",n);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(n=>{if(n==="block")return;const s=this._emitted[n];s!=="pending"&&r-s>12&&delete this._emitted[n]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=r-1),this._events.forEach(n=>{switch(n.type){case"tx":{const s=n.hash;let o=this.getTransactionReceipt(s).then(l=>(!l||l.blockNumber==null||(this._emitted["t:"+s]=l.blockNumber,this.emit(s,l)),null)).catch(l=>{this.emit("error",l)});e.push(o);break}case"filter":{if(!n._inflight){n._inflight=!0,n._lastBlockNumber===-2&&(n._lastBlockNumber=r-1);const s=n.filter;s.fromBlock=n._lastBlockNumber+1,s.toBlock=r;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const l=this.getLogs(s).then(a=>{n._inflight=!1,a.length!==0&&a.forEach(c=>{c.blockNumber>n._lastBlockNumber&&(n._lastBlockNumber=c.blockNumber),this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit
1(s,c)})}).catch(a=>{this.emit("error",a),n._inflight=!1});e.push(l)}break}}}),this._lastBlockNumber=r,Promise.all(e).then(()=>{this.emit("didPoll",t)}).catch(n=>{this.emit("error",n)})})}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return A(this,void 0,void 0,function*(){return p.throwError("provider does not support network detection",h.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return A(this,void 0,void 0,function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield Gt(0),this._network;const r=p.makeError("underlying network changed",h.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(t=>{this._setFastBlockNumber(t)},t=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(t){t&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if(typeof t!="number"||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const t=V();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(t){this._fastBlockNumber!=null&&t<this._fastBlockNumber||(this._fastQueryDate=V(),(this._fastBlockNumber==null||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return A(this,void 0,void 0,function*(){return this._waitForTransaction(t,e??1,r||0,null)})}_waitForTransaction(t,e,r,n){return A(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(t);return(s?s.confirmations:0)>=e?s:new Promise((o,l)=>{const a=[];let c=!1;const u=function(){return c?!0:(c=!0,a.forEach(w=>{w()}),!1)},d=w=>{w.confirmations<e||u()||o(w)};if(this.on(t,d),a.push(()=>{this.removeListener(t,d)}),n){let w=n.startBlock,E=null;const b=N=>A(this,void 0,void 0,function*(){c||(yield Gt(1e3),this.getTransactionCount(n.from).then(R=>A(this,void 0,void 0,function*(){if(!c){if(R<=n.nonce)w=N;else{{const g=yield this.getTransaction(t);if(g&&g.blockNumber!=null)return}for(E==null&&(E=w-3,E<n.startBlock&&(E=n.startBlock));E<=N;){if(c)return;const g=yield this.getBlockWithTransactions(E);for(let m=0;m<g.transactions.length;m++){const C=g.transactions[m];if(C.hash===t)return;if(C.from===n.from&&C.nonce===n.nonce){if(c)return;const I=yield this.waitForTransaction(C.hash,e);
1if(u())return;let v="replaced";C.data===n.data&&C.to===n.to&&C.value.eq(n.value)?v="repriced":C.data==="0x"&&C.from===C.to&&C.value.isZero()&&(v="cancelled"),l(p.makeError("transaction was replaced",h.errors.TRANSACTION_REPLACED,{cancelled:v==="replaced"||v==="cancelled",reason:v,replacement:this._wrapTransaction(C),hash:t,receipt:I}));return}}E++}}c||this.once("block",b)}}),R=>{c||this.once("block",b)}))});if(c)return;this.once("block",b),a.push(()=>{this.removeListener("block",b)})}if(typeof r=="number"&&r>0){const w=setTimeout(()=>{u()||l(p.makeError("timeout exceeded",h.errors.TIMEOUT,{timeout:r}))},r);w.unref&&w.unref(),a.push(()=>{clearTimeout(w)})}})})}getBlockNumber(){return A(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return A(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return y.from(t)}catch(e){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}})}getBalance(t,e){return A(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield S({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return y.from(n)}catch(s){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:s})}})}getTransactionCount(t,e){return A(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield S({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return y.from(n).toNumber()}catch(s){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:s})}})}getCode(t,e){return A(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield S({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return P(n)}catch(s){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:s})}})}getStorageAt(t,e,r){return A(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield S({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then(o=>vt(o))}),s=yield this.perform("getStorageAt",n);try{return P(s)}catch(o){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:s,error:o})}})}_wrapTransaction(t,e,r){if(e!=null&&rt(e)!==32)throw new Error("invalid response - sendTransaction");const n=t;return e!=null&&t.hash!==e&&p.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(s,o)=>A(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let l;s!==0&&r!=null&&(l={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const a=yield this._waitForTransaction(t.hash,s,o,l);return a==null&&s===0?null:(this._emitted["t:"+t.hash]=a.blockNumber,a.status===0&&p.throwError("transaction failed",h.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:a}),a)}),n}sendTransaction(t){return A(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then(s=>P(s)),r=this.formatter.transaction(t);r.confirmations==null&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,s,n)}catch(s){throw s.transaction=r,s.transactionHash=r.hash,s}})}_getTransactionRequest(t){return A(this,void 0,void 0,function*(){const e=yield t,r={};return["from","to"].forEach(n=>{e[n]!=null&&(r[n]=Promise.resolve(e[n]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(n=>{e[n]!=null&&(r[n]=Promise.resolve(e[n]).then(s=>s?y.from(s):null))}),["type"].forEach(n=>{e[n]!=null&&(r[n]=Promise.resolve(e[n]).then(s=>s??null))}),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach(n=>{e[n]!=null&&(r[n]=Promise.resolve(e[n]).then(s=>s?P(s):null))}),this.formatter.transactionRequest(yield S(r))})}_getFilter(t){return A(this,void 0,void 0,function*(){t=yield t;const e={};return t.address!=null&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach(r=>{t[r]!=null&&(e[r]=t[r])}),["fromBlock","toBlock"].forEach(r=>{t[r]!=null&&(e[r]=this._getBlockTag(t[r]))}),this.formatter.filter(yield S(e))})}_call(t,e,r){return A(this,void 0,void 0,function*(){r>=hr&&p.throwError("CCIP read exceeded maximum redirections",h.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,s=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&e==="latest"&&n!=null&&s.substring(0,10)==="0x556f1830"&&rt(s)%32===4)try{const o=Q(s,4),l=Q(o,0,32);y.from(l).eq(n)||p.throwError("CCIP Read sender did not match",h.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s});const a=[],c=y.from(Q(o,32,64)).toNumber(),u=y.from(Q(o,c,c+32)).toNumber(),d=Q(o,c+32);for(let g=0;g<u;g++){const m=ot(d,g*32);m==null&&p.throwError("CCIP Read contained corrupt URL string",h.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s}),a.push(m)}const w=nt(o,64);
1y.from(Q(o,100,128)).isZero()||p.throwError("CCIP Read callback selector included junk",h.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s});const E=Q(o,96,100),b=nt(o,128),N=yield this.ccipReadFetch(t,w,a);N==null&&p.throwError("CCIP Read disabled or provided no URLs",h.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s});const R={to:n,data:M([E,he([N,b])])};return this._call(R,e,r+1)}catch(o){if(o.code===h.errors.SERVER_ERROR)throw o}try{return P(s)}catch(o){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:s,error:o})}})}call(t,e){return A(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield S({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)})}estimateGas(t){return A(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield S({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return y.from(r)}catch(n){return p.throwError("bad result from backend",h.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:n})}})}_getAddress(t){return A(this,void 0,void 0,function*(){t=yield t,typeof t!="string"&&p.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return e==null&&p.throwError("ENS name not configured",h.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e})}_getBlock(t,e){return A(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(L(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),L(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch{p.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return tt(()=>A(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",n);if(s==null)return n.blockHash!=null&&this._emitted["b:"+n.blockHash]==null||n.blockTag!=null&&r>this._emitted.block?null:void 0;if(e){let o=null;for(let a=0;a<s.transactions.length;a++){const c=s.transactions[a];if(c.blockNumber==null)c.confirmations=0;else if(c.confirmations==null){o==null&&(o=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let u=o-c.blockNumber+1;u<=0&&(u=1),c.confirmations=u}}const l=this.formatter.blockWithTransactions(s);return l.transactions=l.transactions.map(a=>this._wrapTransaction(a)),l}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return A(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return tt(()=>A(this,void 0,void 0,function*(){const r=yield this.perform("getTransaction",e);if(r==null)return this._emitted["t:"+t]==null?null:void 0;const n=this.formatter.transactionResponse(r);if(n.blockNumber==null)n.confirmations=0;else if(n.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(t){return A(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return tt(()=>A(this,void 0,void 0,function*(){const r=yield this.perform("getTransactionReceipt",e);if(r==null)return this._emitted["t:"+t]==null?null:void 0;if(r.blockHash==null)return;const n=this.formatter.receipt(r);if(n.blockNumber==null)n.confirmations=0;else if(n.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;o<=0&&(o=1),n.confirmations=o}return n}),{oncePoll:this})})}getLogs(t){return A(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield S({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach(n=>
1{n.removed==null&&(n.removed=!1)}),f.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return A(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(t){return A(this,void 0,void 0,function*(){if(t=yield t,typeof t=="number"&&t<0){t%1&&p.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)})}getResolver(t){return A(this,void 0,void 0,function*(){let e=t;for(;;){if(e===""||e==="."||t!=="eth"&&e==="eth")return null;const r=yield this._getResolver(e,"getResolver");if(r!=null){const n=new Yt(this,r,t);return e!==t&&!(yield n.supportsWildcard())?null:n}e=e.split(".").slice(1).join(".")}})}_getResolver(t,e){return A(this,void 0,void 0,function*(){e==null&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||p.throwError("network does not support ENS",h.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const n=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+st(t).substring(2)});return this.formatter.callAddress(n)}catch{}return null})}resolveName(t){return A(this,void 0,void 0,function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(r){if(L(t))throw r}typeof t!="string"&&p.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null})}lookupAddress(t){return A(this,void 0,void 0,function*(){t=yield t,t=this.formatter.address(t);const e=t.substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(r==null)return null;const n=ot(yield this.call({to:r,data:"0x691f3431"+st(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n})}getAvatar(t){return A(this,void 0,void 0,function*(){let e=null;if(L(t)){const s=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;e=new Yt(this,o,s);try{const l=yield e.getAvatar();if(l)return l.url}catch(l){if(l.code!==h.errors.CALL_EXCEPTION)throw l}try{const l=ot(yield this.call({to:o,data:"0x691f3431"+st(s).substring(2)}),0);e=yield this.getResolver(l)}catch(l){if(l.code!==h.errors.CALL_EXCEPTION)throw l;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return r==null?null:r.url})}perform(t,e){return p.throwError(t+" not implemented",h.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(t){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(t,e,r){const n=new Ar(W(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],s=W(t);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,e)},0),r=!0,o.once?(n.push(o),!1):!0)),n.forEach(o=>{this._stopEvent(o)}),r}listenerCount(t){if(!t)return this._events.length;let e=W(t);return this._events.filter(r=>r.tag===e).length}listeners(t){if(t==null)return this._events.map(r=>r.listener);let e=W(t);return this._events.filter(r=>r.tag===e).map(r=>r.listener)}off(t,e){if(e==null)return this.removeAllListeners(t);const r=[];let n=!1,s=W(t);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=e||n?!0:(n=!0,r.push(o),!1)),r.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(t){let e=[];
1if(t==null)e=this._events,this._events=[];else{const r=W(t);this._events=this._events.filter(n=>n.tag!==r?!0:(e.push(n),!1))}return e.forEach(r=>{this._stopEvent(r)}),this}}var G=globalThis&&globalThis.__awaiter||function(i,t,e,r){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(d){o(d)}}function a(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(i,t||[])).next())})};const T=new h(ft),yr=["call","estimateGas"];function et(i,t){if(i==null)return null;if(typeof i.message=="string"&&i.message.match("reverted")){const e=L(i.data)?i.data:null;if(!t||e)return{message:i.message,data:e}}if(typeof i=="object"){for(const e in i){const r=et(i[e],t);if(r)return r}return null}if(typeof i=="string")try{return et(JSON.parse(i),t)}catch{}return null}function fe(i,t,e){const r=e.transaction||e.signedTransaction;if(i==="call"){const s=et(t,!0);if(s)return s.data;T.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.errors.CALL_EXCEPTION,{data:"0x",transaction:r,error:t})}if(i==="estimateGas"){let s=et(t.body,!1);s==null&&(s=et(t,!1)),s&&T.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:i,transaction:r,error:t})}let n=t.message;throw t.code===h.errors.SERVER_ERROR&&t.error&&typeof t.error.message=="string"?n=t.error.message:typeof t.body=="string"?n=t.body:typeof t.responseText=="string"&&(n=t.responseText),n=(n||"").toLowerCase(),n.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&T.throwError("insufficient funds for intrinsic transaction cost",h.errors.INSUFFICIENT_FUNDS,{error:t,method:i,transaction:r}),n.match(/nonce (is )?too low/i)&&T.throwError("nonce has already been used",h.errors.NONCE_EXPIRED,{error:t,method:i,transaction:r}),n.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&T.throwError("replacement fee too low",h.errors.REPLACEMENT_UNDERPRICED,{error:t,method:i,transaction:r}),n.match(/only replay-protected/i)&&T.throwError("legacy pre-eip-155 transactions not supported",h.errors.UNSUPPORTED_OPERATION,{error:t,method:i,transaction:r}),yr.indexOf(i)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&T.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:i,transaction:r}),t}function Kt(i){return new Promise(function(t){setTimeout(t,i)})}function Er(i){if(i.error){const t=new Error(i.error.message);throw t.code=i.error.code,t.data=i.error.data,t}return i.result}function Z(i){return i&&i.toLowerCase()}const kt={};class de extends be{constructor(t,e,r){if(super(),t!==kt)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");k(this,"provider",e),r==null&&(r=0),typeof r=="string"?(k(this,"_address",this.provider.formatter.address(r)),k(this,"_index",null)):typeof r=="number"?(k(this,"_index",r),k(this,"_address",null)):T.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return T.throwError("cannot alter JSON-RPC Signer connection",h.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new br(kt,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(t=>(t.length<=this._index&&T.throwError("unknown account #"+this._index,h.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index])))}sendUncheckedTransaction(t){t=D(t);const e=this.getAddress().then(r=>(r&&(r=r.toLowerCase()),r));if(t.gasLimit==null){const r=D(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return t.to!=null&&(t.to=Promise.resolve(t.to).then(r=>G(this,void 0,void 0,function*(){if(r==null)return null;const n=yield this.provider.resolveName(r);return n==null&&T.throwArgumentError("provided ENS name resolves to null","tx.to",r),n}))),S({tx:S(t),sender:e}).then(({tx:r,sender:n})=>{r.from!=null?r.from.toLowerCase()!==n&&T.throwArgumentError("from address mismatch","transaction",t):r.from=n;const s=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&T.throwError("user rejected transaction",h.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),fe("sendTransaction",o,s)))})}signTransaction(t){return T.throwError("signing transactions is unsupported",h.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return G(this,void 0,void 0,function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield tt(()=>G(this,void 0,void 0,function*(){const n=yield this.provider.getTransaction(r);if(n!==null)return this.provider._wrapTransaction(n,r,e)}),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}})}signMessage(t){return G(this,void 0,void 0,function*(){const e=typeof t=="string"?X(t):t,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[P(e),r.toLowerCase()])}catch(n){throw typeof n.message=="string"&&n.message.match(/user denied/i)&&T.throwError("user rejected signing",h.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:t}),n}})}_legacySignMessage(t){return G(this,void 0,void 0,function*(){const e=typeof t=="string"?X(t):t,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),P(e)])}catch(n){throw typeof n.message=="string"&&n.message.match(/user denied/i)&&T.throwError("user rejected signing",h.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:t}),n}})}_signTypedData(t,e,r){return G(this,void 0,void 0,function*(){const n=yield O.resolveNames(t,e,r,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(O.getPayload(n.domain,e,n.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&T.throwError("user rejected signing",h.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:n.domain,types:e,value:n.value}}),o}})}unlock(t){return G(this,void 0,void 0,function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])})}}class br extends de{sendTransaction(t){return this.sendUncheckedTransaction(t).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:r=>this.provider.waitForTransaction(e,r)}))}}const kr={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class vr extends wr{constructor(t,e){let r=e;r==null&&(r=new Promise((n,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{n(o)},o=>{s(o)})},0)})),super(r),t||(t=$(this.constructor,"defaultUrl")()),typeof t=="string"?k(this,"connection",Object.freeze({url:t})):k(this,"connection",Object.freeze(D(t))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return G(this,void 0,void 0,function*(){yield Kt(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch{try{t=yield this.send("net_version",[])}catch{}}if(t!=null){const e=$(this.constructor,"getNetwork");try{return e(y.from(t).toNumber())}catch(r){return T.throwError("could not detect network",h.errors.NETWORK_E
1RROR,{chainId:t,event:"invalidNetwork",serverError:r})}}return T.throwError("could not detect network",h.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(t){return new de(kt,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(t=>t.map(e=>this.formatter.address(e)))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ut(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const s=Nt(this.connection,JSON.stringify(r),Er).then(o=>(this.emit("debug",{action:"response",request:r,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:r,provider:this}),o});return n&&(this._cache[t]=s,setTimeout(()=>{this._cache[t]=null},0)),s}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Z(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Z(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Z(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Z(e.address),H(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[$(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[$(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&e.filter.address!=null&&(e.filter.address=Z(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return G(this,void 0,void 0,function*(){if(t==="call"||t==="estimateGas"){const n=e.transaction;if(n&&n.type!=null&&y.from(n.type).isZero()&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(e=D(e),e.transaction=D(n),delete e.transaction.type)}}const r=this.prepareRequest(t,e);r==null&&T.throwError(t+" not implemented",h.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(n){return fe(t,n,e)}})}_startEvent(t){t.tag==="pending"&&this._startPending(),super._startEvent(t)}_startPending(){if(this._pendingFilter!=null)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then(function(r){function n(){t.send("eth_getFilterChanges",[r]).then(function(s){if(t._pendingFilter!=e)return null;let o=Promise.resolve();return s.forEach(function(l){t._emitted["t:"+l.toLowerCase()]="pending",o=o.then(function(){return t.getTransaction(l).then(function(a){return t.emit("pending",a),null})})}),o.then(function(){return Kt(1e3)})}).then(function(){if(t._pendingFilter!=e){t.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(s=>{})}return n(),r}).catch(r=>{})}_stopEvent(t){t.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=D(kr);if(e)for(const s in e)e[s]&&(r[s]=!0);Ee(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(t[s]==null)return;const o=vt(y.from(t[s]));s==="gasLimit"&&(s="gas"),n[s]=o}),["from","to","data"].forEach(function(s){t[s]!=null&&(n[s]=P(t[s]))}),t.accessList&&(n.accessList=jt(t.accessList)),n}}const zt=new h(ft);let Nr=1;function Xt(i,t){const e="Web3LegacyFetcher";return function(r,n){const s={method:r,params:n,id:Nr++,jsonrpc:"2.0"};return new Promise((o,l)=>{this.emit("debug",{action:"request",fetcher:e,request:ut(s),provider:this}),t(s,(a,c)=>
1{if(a)return this.emit("debug",{action:"response",fetcher:e,error:a,request:s,provider:this}),l(a);if(this.emit("debug",{action:"response",fetcher:e,request:s,response:c,provider:this}),c.error){const u=new Error(c.error.message);return u.code=c.error.code,u.data=c.error.data,l(u)}o(c.result)})})}}function Cr(i){return function(t,e){e==null&&(e=[]);const r={method:t,params:e};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:ut(r),provider:this}),i.request(r).then(n=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,response:n,provider:this}),n),n=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:r,error:n,provider:this}),n})}}class Or extends vr{constructor(t,e){t==null&&zt.throwArgumentError("missing provider","provider",t);let r=null,n=null,s=null;typeof t=="function"?(r="unknown:",n=t):(r=t.host||t.path||"",!r&&t.isMetaMask&&(r="metamask"),s=t,t.request?(r===""&&(r="eip-1193:"),n=Cr(t)):t.sendAsync?n=Xt(t,t.sendAsync.bind(t)):t.send?n=Xt(t,t.send.bind(t)):zt.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),k(this,"jsonRpcFetchFunc",n),k(this,"provider",s)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}export{Or as Web3Provider};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.