PageSourceSearch

https://zaif-ino.com/js/chunk-vendors~d6b3b356.fda7c5a4.js

js zaif-ino.com collected 2026-10-04 13:29:03 UTC 92,735 bytes, 2 lines download raw bytes

vendor: 14,122 bytes, line 1
1(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-vendors~d6b3b356"],{2606:function(t,e,r){"use strict";r.r(e),r.d(e,"Provider",(function(){return n.b})),r.d(e,"BaseProvider",(function(){return nt})),r.d(e,"Resolver",(function(){return tt})),r.d(e,"UrlJsonRpcProvider",(function(){return Pt})),r.d(e,"FallbackProvider",(function(){return ae})),r.d(e,"AlchemyProvider",(function(){return It})),r.d(e,"AlchemyWebSocketProvider",(function(){return Tt})),r.d(e,"AnkrProvider",(function(){return Ct})),r.d(e,"CloudflareProvider",(function(){return Lt})),r.d(e,"EtherscanProvider",(function(){return Wt})),r.d(e,"InfuraProvider",(function(){return de})),r.d(e,"InfuraWebSocketProvider",(function(){return he})),r.d(e,"JsonRpcProvider",(function(){return kt})),r.d(e,"JsonRpcBatchProvider",(function(){return fe})),r.d(e,"NodesmithProvider",(function(){return me})),r.d(e,"PocketProvider",(function(){return ke})),r.d(e,"StaticJsonRpcProvider",(function(){return Ot})),r.d(e,"Web3Provider",(function(){return _e})),r.d(e,"WebSocketProvider",(function(){return Et})),r.d(e,"IpcProvider",(function(){return ce})),r.d(e,"JsonRpcSigner",(function(){return mt})),r.d(e,"getDefaultProvider",(function(){return Ne})),r.d(e,"getNetwork",(function(){return d})),r.d(e,"isCommunityResource",(function(){return A})),r.d(e,"isCommunityResourcable",(function(){return I})),r.d(e,"showThrottleMessage",(function(){return B})),r.d(e,"Formatter",(function(){return T}));var n=r("edaa"),o=r("ffb2");const s=new o.b("networks/5.6.2");function i(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby"];try{const s=new e.PocketProvider(t,r.pocket);s.network&&-1===o.indexOf(s.network.name)&&n.push(s)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{n.push(new e.AnkrProvider(t,r.ankr))}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===t&&(o=2),new e.FallbackProvider(n,o)}return n[0]};return e.renetwork=function(t){return i(t)},e}function a(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return a(t,e)},r}const c={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:i("homestead")},l={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:i("ropsten")},u={chainId:63,name:"classicMordor",_defaultProvider:a("https://www.ethercluster.com/mordor","classicMordor")},h={unspecified:{chainId:0,name:"unspecified"},homestead:c,mainnet:c,morden:{chainId:2,name:"morden"},ropsten:l,testnet:l,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:i("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:i("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:i("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:a("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:u,classicTestnet:u,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:a("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic"},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"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"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function d(t){if(null==t)return null;if("number"==typeof t){for(const e in h){const r=h[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=h[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=h[t.name];if(!e)return"number"!=typeof t.chainId&&s.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&s.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return null==r&&e._defaultProvider&&(r=function(t){return t&&"function"==typeof t.renetwork}(e._defaultProvider)?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}var f=r("2cf2"),p=r("e36d"),m=r("549e"),b=r("4877"),g=r("0a7f"),k=r("9bda"),w=r("3796"),y=r("5273"),v=r("baf7"),_=r("bf2b"),E=r.n(_);const N="providers/5.6.4";var O=r("3b1c"),P=r("c00b"),j=r("5ac3");const R=new o.b(N);class T{constructor(){R.checkNew(new.target,T),this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),s=this.hash.bind(this),i=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return t.transaction={hash:s,type:c,accessList:T.allowNull(this.accessList.bind(this),null),blockHash:T.allowNull(s,null),blockNumber:T.allowNull(a,null),transactionIndex:T.allowNull(a,null),confirmations:T.allowNull(a,null),from:e,gasPrice:T.allowNull(r),maxPriorityFeePerGas:T.allowNull(r),maxFeePerGas:T.allowNull(r),gasLimit:r,to:T.allowNull(e,null),value:r,nonce:a,data:o,r:T.allowNull(this.uint256),s:T.allowNull(this.uint256),v:T.allowNull(a),creates:T.allowNull(e,null),raw:T.allowNull(o)},t.transactionRequest={from:T.allowNull(e),nonce:T.allowNull(a),gasLimit:T.allowNull(r),gasPrice:T.allowNull(r),maxPriorityFeePerGas:T.allowNull(r),maxFeePerGas:T.allowNull(r),to:T.allowNull(e),value:T.allowNull(r),data:T.allowNull((t=>this.data(t,!0))),type:T.allowNull(a),accessList:T.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:s,address:e,topics:T.arrayOf(s),data:o,logIndex:a,blockHash:s},t.receipt={to:T.allowNull(this.address,null),from:T.allowNull(this.address,null),contractAddress:T.allowNull(e,null),transactionIndex:a,root:T.allowNull(i),gasUsed:r,logsBloom:T.allowNull(o),blockHash:s,transactionHash:s,logs:T.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:T.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:T.allowNull(r),status:T.allowNull(a),type:c},t.block={hash:T.allowNull(s),parentHash:s,number:a,timestamp:a,nonce:T.allowNull(i),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:T.allowNull(e),extraData:o,transactions:T.allowNull(T.arrayOf(s)),baseFeePerGas:T.allowNull(r)},t.blockWithTransactions=Object(k.g)(t.block),t.blockWithTransactions.transactions=T.allowNull(T.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:T.allowNull(n,void 0),toBlock:T.allowNull(n,void 0),blockHash:T.allowNull(s,void 0),address:T.allowNull(e,void 0),topics:T.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:T.allowNull(a),blockHash:T.allowNull(s),transactionIndex:a,removed:T.allowNull(this.boolean.bind(this)),address:e,data:T.allowFalsish(o,"0x"),topics:T.arrayOf(s),transactionHash:s,logIndex:a},t}accessList(t){return Object(j.accessListify)(t||[])}number(t){return"0x"===t?0:p.a.from(t).toNumber()}type(t){return"0x"===t||null==t?0:p.a.from(t).toNumber()}bigNumber(t){return p.a.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),Object(m.l)(t))?t.toLowerCase():R.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 Object(O.a)(t)}callAddress(t){if(!Object(m.l)(t,32))return null;const e=Object(O.a)(Object(m.e)(t,12));return e===P.a?null:e}contractAddress(t){return Object(O.b)(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||Object(m.l)(t))return Object(m.g)(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==Object(m.d)(r)?R.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=p.a.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!Object(m.l)(t))throw new Error("invalid uint256");return Object(m.h)(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=T.check(e,t);return n._difficulty=null==r?null:p.a.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return T.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&p.a.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=T.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;Object(m.l)(r)&&(r=p.a.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),Object(m.l)(r)&&(r=p.a.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return Object(j.parse)(t)}receiptLog(t){return T.check(this.formats.receiptLog,t)}receipt(t){const e=T.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=p.a.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&R.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):R.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&R.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return T.check(this.formats.filter,t)}filterLog(t){return T.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const o=t[n](e[n]);void 0!==o&&(r[n]=o)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?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(e){r.push(t(e))})),r}}}function I(t){return t&&"function"==typeof t.isCommunityResource}function A(t){return I(t)&&t.isCommunityResource()}let x=!1;function B(){x||(x=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded  (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.io/api-keys/"),console.log("=========================="))}var C=function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))};const S=new o.b(N);function L(t){return null==t?"null":(32!==Object(m.d)(t)&&S.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function U(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[L(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return L(t)})).join("&")}function F(t){if("string"==typeof t){if(t=t.toLowerCase(),32===Object(m.d)(t))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+U(t);if(n.a.isForkEvent(t))throw S.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+U(t.topics||[])}throw new Error("invalid event - "+t)}function q(){return(new Date).getTime()}function D(t){return new Promise((e=>{setTimeout(e,t)}))}const K=["block","network","pending","poll"];class G{constructor(t,e,r){Object(k.d)(this,"tag",t),Object(k.d)(this,"listener",e),Object(k.d)(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"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=function(t){return""===t?[]:t.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}))}(t[2]),n={};return r.length>0&&(n.topics=r),e&&"*"!==e&&(n.address=e),n}pollable(){return this.tag.indexOf(":")>=0||K.indexOf(this.tag)>=0}}
1const H={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 M(t){return Object(m.h)(p.a.from(t).toHexString(),32)}function W(t){return f.a.encode(Object(m.b)([t,Object(m.e)(Object(w.c)(Object(w.c)(t)),0,4)]))}const J=new RegExp("^(ipfs)://(.*)$","i"),V=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),J,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function $(t,e){try{return Object(y.h)(X(t,e))}catch(t){}return null}function X(t,e){if("0x"===t)return null;const r=p.a.from(Object(m.e)(t,e,e+32)).toNumber(),n=p.a.from(Object(m.e)(t,r,r+32)).toNumber();return Object(m.e)(t,r+32,r+32+n)}function z(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):S.throwArgumentError("unsupported IPFS format","link",t),"https://gateway.ipfs.io/ipfs/"+t}function Z(t){const e=Object(m.a)(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Q(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Y(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const o=Object(m.a)(t[n]);e[n]=Z(r),e.push(Z(o.length)),e.push(Q(o)),r+=32+32*Math.ceil(o.length/32)}return Object(m.c)(e)}class tt{constructor(t,e,r,n){Object(k.d)(this,"provider",t),Object(k.d)(this,"name",r),Object(k.d)(this,"address",t.formatter.address(e)),Object(k.d)(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>p.a.from(t).eq(1))).catch((t=>{if(t.code===o.b.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return C(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:Object(m.c)([t,Object(g.c)(this.name),e||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=Object(m.c)(["0x9061b923",Y([Object(g.a)(this.name),r.data])]));try{let t=yield this.provider.call(r);return Object(m.a)(t).length%32==4&&S.throwError("resolver threw error",o.b.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=X(t,0)),t}catch(t){if(t.code===o.b.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return C(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?X(r,0):null}))}_getAddress(t,e){const r=H[String(t)];if(null==r&&S.throwError("unsupported coin type: "+t,o.b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=Object(m.a)(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return W(Object(m.b)([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return W(Object(m.b)([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=E.a.toWords(n.slice(2));return t.unshift(e),E.a.encode(r.prefix,t)}}return null}getAddress(t){return C(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||t===b.a?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===o.b.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",M(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&S.throwError("invalid or unsupported coin data",o.b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return C(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;r<V.length;r++){const n=e.match(V[r]);if(null==n)continue;const o=n[1].toLowerCase();switch(o){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:z(e)};case"erc721":case"erc1155":{const r="erc721"===o?"0xc87b56dd":"0x0e89341c";t.push({type:o,content:e});const s=this._resolvedAddress||(yield this.getAddress()),i=(n[2]||"").split("/");if(2!==i.length)return null;const a=yield this.provider.formatter.address(i[0]),c=Object(m.h)(p.a.from(i[1]).toHexString(),32);if("erc721"===o){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:Object(m.c)(["0x6352211e",c])}));if(s!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===o){const e=p.a.from(yield this.provider.call({to:a,data:Object(m.c)(["0x00fdd58e",Object(m.h)(s,32),c])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const l={to:this.provider.formatter.address(i[0]),data:Object(m.c)([r,c])};let u=$(yield this.provider.call(l),0);if(null==u)return null;t.push({type:"metadata-url-base",content:u}),"erc1155"===o&&(u=u.replace("{id}",c.substring(2)),t.push({type:"metadata-url-expanded",content:u})),u.match(/^ipfs:/i)&&(u=z(u)),t.push({type:"metadata-url",content:u});const h=yield Object(v.b)(u);if(!h)return null;t.push({type:"metadata",content:JSON.stringify(h)});let d=h.image;if("string"!=typeof d)return null;if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(J))return null;t.push({type:"url-ipfs",content:d}),d=z(d)}return t.push({type:"url",content:d}),{linkage:t,url:d}}}}}catch(t){}return null}))}getContentHash(){return C(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)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 t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+f.a.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 t=parseInt(r[3],16);if(r[4].length===2*t)return"ipns://"+f.a.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);
1return n&&64===n[1].length?"bzz://"+n[1]:S.throwError("invalid or unsupported content hash data",o.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return C(this,void 0,void 0,(function*(){let e=Object(y.f)(t);e=Object(m.b)([M(64),M(e.length),e]),e.length%32!=0&&(e=Object(m.b)([e,Object(m.h)("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Object(m.i)(e));return null==r||"0x"===r?null:Object(y.h)(r)}))}}let et=null,rt=1;class nt extends n.b{constructor(t){if(S.checkNew(new.target,n.b),super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Object(k.d)(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=Object(k.e)(new.target,"getNetwork")(t);e?(Object(k.d)(this,"_network",e),this.emit("network",e,null)):S.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return C(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||S.throwError("no network detected",o.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:Object(k.d)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return Object(v.c)((()=>this._ready().then((t=>t),(t=>{if(t.code!==o.b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==et&&(et=new T),et}static getNetwork(t){return d(null==t?"homestead":t)}ccipReadFetch(t,e,r){return C(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),s=e.toLowerCase(),i=[];for(let t=0;t<r.length;t++){const e=r[t],a=e.replace("{sender}",n).replace("{data}",s),c=e.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:n}),l=yield Object(v.b)({url:a,errorPassThrough:!0},c,((t,e)=>(t.status=e.statusCode,t)));if(l.data)return l.data;const u=l.message||"unknown error";if(l.status>=400&&l.status<500)return S.throwError("response not found during CCIP fetch: "+u,o.b.errors.SERVER_ERROR,{url:e,errorMessage:u});i.push(u)}return S.throwError("error encountered during CCIP fetch: "+i.map((t=>JSON.stringify(t))).join(", "),o.b.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(t){return C(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(q()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=q(),r=Object(k.f)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=q();return(t=p.a.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:o}}));return this._internalBlockNumber=r,r.catch((t=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return C(this,void 0,void 0,(function*(){const t=rt++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)S.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",S.makeError("network block skew detected",o.b.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;
vendor: 18,302 bytes, line 1
1t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const o=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(o)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return C(this,void 0,void 0,(function*(){return S.throwError("provider does not support network detection",o.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return C(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 D(0),this._network;const r=S.makeError("underlying network changed",o.b.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=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}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("number"!=typeof t||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=q();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=q(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return C(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return C(this,void 0,void 0,(function*(){const s=yield this.getTransactionReceipt(t);return(s?s.confirmations:0)>=e?s:new Promise(((s,i)=>{const a=[];let c=!1;const l=function(){return!!c||(c=!0,a.forEach((t=>{t()})),!1)},u=t=>{t.confirmations<e||l()||s(t)};if(this.on(t,u),a.push((()=>{this.removeListener(t,u)})),n){let r=n.startBlock,s=null;const u=a=>C(this,void 0,void 0,(function*(){c||(yield D(1e3),this.getTransactionCount(n.from).then((h=>C(this,void 0,void 0,(function*(){if(!c){if(h<=n.nonce)r=a;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==s&&(s=r-3,s<n.startBlock&&(s=n.startBlock));s<=a;){if(c)return;const r=yield this.getBlockWithTransactions(s);for(let s=0;s<r.transactions.length;s++){const a=r.transactions[s];if(a.hash===t)return;if(a.from===n.from&&a.nonce===n.nonce){if(c)return;const r=yield this.waitForTransaction(a.hash,e);if(l())return;let s="replaced";return a.data===n.data&&a.to===n.to&&a.value.eq(n.value)?s="repriced":"0x"===a.data&&a.from===a.to&&a.value.isZero()&&(s="cancelled"),void i(S.makeError("transaction was replaced",o.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===s||"cancelled"===s,reason:s,replacement:this._wrapTransaction(a),hash:t,receipt:r}))}}s++}}c||this.once("block",u)}}))),(t=>{c||this.once("block",u)})))}));if(c)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{l()||i(S.makeError("timeout exceeded",o.b.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),a.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return C(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return p.a.from(t)}catch(e){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Object(k.f)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return p.a.from(n)}catch(t){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Object(k.f)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return p.a.from(n).toNumber()}catch(t){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Object(k.f)({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return Object(m.i)(n)}catch(t){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Object(k.f)({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>Object(m.g)(t)))}),s=yield this.perform("getStorageAt",n);try{return Object(m.i)(s)}catch(t){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:s,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==Object(m.d)(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&S.throwError("Transaction hash mismatch from Provider.sendTransaction.",o.b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>C(this,void 0,void 0,(function*(){let s;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(s={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const i=yield this._waitForTransaction(t.hash,e,n,s);return null==i&&0===e?null:(this._emitted["t:"+t.hash]=i.blockNumber,0===i.status&&S.throwError("transaction failed",o.b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:i}),i)})),n}sendTransaction(t){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>Object(m.i)(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return C(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?p.a.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?Object(m.i)(t):null)))})),this.formatter.transactionRequest(yield Object(k.f)(r))}))}_getFilter(t){return C(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield Object(k.f)(e))}))}_call(t,e,r){return C(this,void 0,void 0,(function*(){r>=10&&S.throwError("CCIP read exceeded maximum redirections",o.b.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,s=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===s.substring(0,10)&&Object(m.d)(s)%32==4)try{const i=Object(m.e)(s,4),a=Object(m.e)(i,0,32);p.a.from(a).eq(n)||S.throwError("CCIP Read sender did not match",o.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s});const c=[],l=p.a.from(Object(m.e)(i,32,64)).toNumber(),u=p.a.from(Object(m.e)(i,l,l+32)).toNumber(),h=Object(m.e)(i,l+32);for(let e=0;e<u;e++){const r=$(h,32*e);null==r&&S.throwError("CCIP Read contained corrupt URL string",o.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s}),c.push(r)}const d=X(i,64);p.a.from(Object(m.e)(i,100,128)).isZero()||S.throwError("CCIP Read callback selector included junk",o.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s});const f=Object(m.e)(i,96,100),b=X(i,128),g=yield this.ccipReadFetch(t,d,c);null==g&&S.throwError("CCIP Read disabled or provided no URLs",o.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:s});const k={to:n,data:Object(m.c)([f,Y([g,b])])};return this._call(k,e,r+1)}catch(t){if(t.code===o.b.errors.SERVER_ERROR)throw t}try{return Object(m.i)(s)}catch(r){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:s,error:r})}}))}call(t,e){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Object(k.f)({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 C(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Object(k.f)({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return p.a.from(r)}catch(t){return S.throwError("bad result from backend",o.b.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return C(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&S.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&S.throwError("ENS name not configured",o.b.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return C(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(Object(m.l)(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),Object(m.l)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){S.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return Object(v.c)((()=>C(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;r<t.transactions.length;r++){const n=t.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}}const r=this.formatter.blockWithTransactions(t);return r.transactions=r.transactions.map((t=>this._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return C(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return Object(v.c)((()=>C(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return C(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return Object(v.c)((()=>C(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return C(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Object(k.f)({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),T.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return C(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return C(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&S.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 C(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new tt(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return C(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||S.throwError("network does not support ENS",o.b.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Object(g.c)(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return C(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(Object(m.l)(t))throw e}"string"!=typeof t&&S.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return C(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=$(yield this.call({to:r,data:"0x691f3431"+Object(g.c)(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return C(this,void 0,void 0,(function*(){let e=null;if(Object(m.l)(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new tt(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==o.b.errors.CALL_EXCEPTION)throw t}try{const t=$(yield this.call({to:n,data:"0x691f3431"+Object(g.c)(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==o.b.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return S.throwError(t+" not implemented",o.b.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new G(F(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=[],o=F(t);return this._events=this._events.filter((t=>t.tag!==o||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=F(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=F(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,o=F(t);return this._events=this._events.filter((t=>t.tag!==o||t.listener!=e||!!n||(n=!0,r.push(t),!1))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];
1if(null==t)e=this._events,this._events=[];else{const r=F(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var ot=r("7ca5"),st=r("e108"),it=function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))};const at=new o.b(N),ct=["call","estimateGas"];function lt(t){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")&&Object(m.l)(t.data))return{message:t.message,data:t.data};if("object"==typeof t){for(const e in t){const r=lt(t[e]);if(r)return r}return null}if("string"==typeof t)try{return lt(JSON.parse(t))}catch(t){}return null}function ut(t,e,r){if("call"===t){const t=lt(e);if(t)return t.data;at.throwError("missing revert data in call exception; Transaction reverted without a reason string",o.b.errors.CALL_EXCEPTION,{error:e,data:"0x"})}let n=e.message;e.code===o.b.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?n=e.error.message:"string"==typeof e.body?n=e.body:"string"==typeof e.responseText&&(n=e.responseText),n=(n||"").toLowerCase();const s=r.transaction||r.signedTransaction;throw n.match(/insufficient funds|base fee exceeds gas limit/)&&at.throwError("insufficient funds for intrinsic transaction cost",o.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:s}),n.match(/nonce (is )?too low/)&&at.throwError("nonce has already been used",o.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:s}),n.match(/replacement transaction underpriced/)&&at.throwError("replacement fee too low",o.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:s}),n.match(/only replay-protected/)&&at.throwError("legacy pre-eip-155 transactions not supported",o.b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:s}),ct.indexOf(t)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&at.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",o.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:s}),e}function ht(t){return new Promise((function(e){setTimeout(e,t)}))}function dt(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function ft(t){return t?t.toLowerCase():t}const pt={};class mt extends ot.a{constructor(t,e,r){if(at.checkNew(new.target,mt),super(),t!==pt)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Object(k.d)(this,"provider",e),null==r&&(r=0),"string"==typeof r?(Object(k.d)(this,"_address",this.provider.formatter.address(r)),Object(k.d)(this,"_index",null)):"number"==typeof r?(Object(k.d)(this,"_index",r),Object(k.d)(this,"_address",null)):at.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return at.throwError("cannot alter JSON-RPC Signer connection",o.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new bt(pt,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&&at.throwError("unknown account #"+this._index,o.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=Object(k.g)(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=Object(k.g)(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>it(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&at.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),Object(k.f)({tx:Object(k.f)(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&at.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>ut("sendTransaction",t,n)))}
1))}signTransaction(t){return at.throwError("signing transactions is unsupported",o.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return it(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 Object(v.c)((()=>it(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return it(this,void 0,void 0,(function*(){const e="string"==typeof t?Object(y.f)(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[Object(m.i)(e),r.toLowerCase()])}))}_legacySignMessage(t){return it(this,void 0,void 0,(function*(){const e="string"==typeof t?Object(y.f)(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),Object(m.i)(e)])}))}_signTypedData(t,e,r){return it(this,void 0,void 0,(function*(){const n=yield st.a.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),o=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(st.a.getPayload(n.domain,e,n.value))])}))}unlock(t){return it(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class bt extends mt{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const gt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class kt extends nt{constructor(t,e){at.checkNew(new.target,kt);let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=Object(k.e)(this.constructor,"defaultUrl")()),"string"==typeof t?Object(k.d)(this,"connection",Object.freeze({url:t})):Object(k.d)(this,"connection",Object.freeze(Object(k.g)(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(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 it(this,void 0,void 0,(function*(){yield ht(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=Object(k.e)(this.constructor,"getNetwork");try{return e(p.a.from(t).toNumber())}catch(e){return at.throwError("could not detect network",o.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return at.throwError("could not detect network",o.b.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new mt(pt,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Object(k.c)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const o=Object(v.b)(this.connection,JSON.stringify(r),dt).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=o,setTimeout((()=>{this._cache[t]=null}),0)),o}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[ft(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[ft(e.address),e.blockTag]];case"getCode":return["eth_getCode",[ft(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[ft(e.address),e.position,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",[Object(k.e)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[Object(k.e)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];
1case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=ft(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return it(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&p.a.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=Object(k.g)(e)).transaction=Object(k.g)(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&at.throwError(t+" not implemented",o.b.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return ut(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return ht(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=Object(k.g)(gt);if(e)for(const t in e)e[t]&&(r[t]=!0);Object(k.b)(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=Object(m.g)(t[e]);"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=Object(m.i)(t[e]))})),t.accessList&&(n.accessList=Object(j.accessListify)(t.accessList)),n}}let wt=null;try{if(wt=WebSocket,null==wt)throw new Error("inject please")}catch(t){const e=new o.b(N);wt=function(){e.throwError("WebSockets not supported in this environment",o.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var yt=function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))};const vt=new o.b(N);let _t=1;class Et extends kt{constructor(t,e){"any"===e&&vt.throwError("WebSocketProvider does not support 'any' network yet",o.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof t?t:"_websocket",e),this._pollingInterval=-1,this._wsReady=!1,"string"==typeof t?Object(k.d)(this,"_websocket",new wt(this.connection.url)):Object(k.d)(this,"_websocket",t),Object(k.d)(this,"_requests",{}),Object(k.d)(this,"_subs",{}),Object(k.d)(this,"_subIds",{}),Object(k.d)(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((t=>{this.websocket.send(this._requests[t].payload)}))},this.websocket.onmessage=t=>{const e=t.data,r=JSON.parse(e);if(null!=r.id){const t=String(r.id),n=this._requests[t];if(delete this._requests[t],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let t=null;r.error?(t=new Error(r.error.message||"unknown error"),Object(k.d)(t,"code",r.error.code||null),Object(k.d)(t,"response",e)):t=new Error("unknown error"),n.callback(t,void 0),this.emit("debug",{action:"response",error:t,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const t=this._subs[r.params.subscription];t&&t.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){vt.throwError("cannot reset events block on WebSocketProvider",o.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){vt.throwError("cannot set polling interval on WebSocketProvider",o.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return yt(this,void 0,void 0,(function*(){return null}))}set polling(t){t&&vt.throwError("cannot set polling on WebSocketProvider",o.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){const r=_t++;return new Promise(((n,o)=>{const s=JSON.stringify({method:t,params:e,id:r,jsonrpc:"2.0"});
1this.emit("debug",{action:"request",request:JSON.parse(s),provider:this}),this._requests[String(r)]={callback:function(t,e){return t?o(t):n(e)},payload:s},this._wsReady&&this.websocket.send(s)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,r){return yt(this,void 0,void 0,(function*(){let n=this._subIds[t];null==n&&(n=Promise.all(e).then((t=>this.send("eth_subscribe",t))),this._subIds[t]=n);const o=yield n;this._subs[o]={tag:t,processFunc:r}}))}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],(t=>{const e=p.a.from(t.number).toNumber();this._emitted.block=e,this.emit("block",e)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(t=>{this.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(e=>{null==e.removed&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))}));break;case"tx":{const e=t=>{const e=t.hash;this.getTransactionReceipt(e).then((t=>{t&&this.emit(e,t)}))};e(t),this._subscribe("tx",["newHeads"],(t=>{this._events.filter((t=>"tx"===t.type)).forEach(e)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}_stopEvent(t){let e=t.tag;if("tx"===t.type){if(this._events.filter((t=>"tx"===t.type)).length)return;e="tx"}else if(this.listenerCount(t.event))return;const r=this._subIds[e];r&&(delete this._subIds[e],r.then((t=>{this._subs[t]&&(delete this._subs[t],this.send("eth_unsubscribe",[t]))})))}destroy(){return yt(this,void 0,void 0,(function*(){this.websocket.readyState===wt.CONNECTING&&(yield new Promise((t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}}))),this.websocket.close(1e3)}))}}const Nt=new o.b(N);class Ot extends kt{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||Nt.throwError("no network detected",o.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(Object(k.d)(this,"_network",e),this.emit("network",e,null))),e}))}}class Pt extends Ot{constructor(t,e){Nt.checkAbstract(new.target,Pt),t=Object(k.e)(new.target,"getNetwork")(t),e=Object(k.e)(new.target,"getApiKey")(e);super(Object(k.e)(new.target,"getUrl")(t,e),t),"string"==typeof e?Object(k.d)(this,"apiKey",e):null!=e&&Object.keys(e).forEach((t=>{Object(k.d)(this,t,e[t])}))}_startPending(){Nt.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return Nt.throwError("API provider does not support signing",o.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return Nt.throwError("not implemented; sub-classes must override getUrl",o.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const jt=new o.b(N),Rt="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Tt extends Et{constructor(t,e){const r=new It(t,e);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),Object(k.d)(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===Rt}}class It extends Pt{static getWebSocketProvider(t,e){return new Tt(t,e)}static getApiKey(t){return null==t?Rt:(t&&"string"!=typeof t&&jt.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,e){let r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;
1case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;default:jt.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:(t,r)=>(e===Rt&&B(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===Rt}}const At=new o.b(N),xt="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Bt(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return At.throwArgumentError("unsupported network","name",t)}class Ct extends Pt{isCommunityResource(){return this.apiKey===xt}static getApiKey(t){return null==t?xt:t}static getUrl(t,e){null==e&&(e=xt);const r={allowGzip:!0,url:"https://"+Bt(t.name)+e,throttleCallback:(t,r)=>(e.apiKey===xt&&B(),Promise.resolve(!0))};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}const St=new o.b(N);class Lt extends Pt{static getApiKey(t){return null!=t&&St.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,e){let r=null;if("homestead"===t.name)r="https://cloudflare-eth.com/";else St.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){if("getBlockNumber"===t){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,t,e)}))}}var Ut=function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))};const Ft=new o.b(N);function qt(t){const e={};for(let r in t){if(null==t[r])continue;let n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(m.g)(Object(m.i)(n)):"accessList"===r?"["+Object(j.accessListify)(n).map((t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`)).join(",")+"]":Object(m.i)(n),e[r]=n)}return e}function Dt(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"OK"!=t.message){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function Kt(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function Gt(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}const Ht="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function Mt(t,e,r){if("call"===t&&e.code===o.b.errors.SERVER_ERROR){const t=e.error;if(t&&(t.message.match(/reverted/i)||t.message.match(/VM execution error/i))){let r=t.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),Object(m.l)(r))return r;Ft.throwError("missing revert data in call exception",o.b.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===o.b.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?n=e.error.message:"string"==typeof e.body?n=e.body:"string"==typeof e.responseText&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&Ft.throwError("insufficient funds for intrinsic transaction cost",o.b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Ft.throwError("nonce has already been used",o.b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&Ft.throwError("replacement fee too low",o.b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&Ft.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",o.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class Wt extends nt{constructor(t,e){Ft.checkNew(new.target,Wt),super(t),Object(k.d)(this,"baseUrl",this.getBaseUrl()),Object(k.d)(this,"apiKey",e||Ht)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return Ft.throwArgumentError("unsupported network","network",name)}getUrl(t,e){const r=Object.keys(e).reduce(((t,r)=>{const n=e[r];return null!=n&&(t+=`&${r}=${n}`),t}),""),n=this.apiKey?"&apikey="+this.apiKey:"";return`${this.baseUrl}/api?module=${t}${r}${n}`}getPostUrl(){return this.baseUrl+"/api"}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}fetch(t,e,r){return Ut(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(t,e),o=r?this.getPostData(t,e):null,s="proxy"===t?Kt:Dt;
1this.emit("debug",{action:"request",request:n,provider:this});const i={url:n,throttleSlotInterval:1e3,throttleCallback:(t,e)=>(this.isCommunityResource()&&B(),Promise.resolve(!0))};let a=null;o&&(i.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(o).map((t=>`${t}=${o[t]}`)).join("&"));const c=yield Object(v.b)(i,a,s||Kt);return this.emit("debug",{action:"response",request:n,response:Object(k.c)(c),provider:this}),c}))}detectNetwork(){return Ut(this,void 0,void 0,(function*(){return this.network}))}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return Ut(this,void 0,void 0,(function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});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"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((t=>Mt("sendTransaction",t,e.signedTransaction)));case"getBlock":if(e.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=qt(e.transaction);t.module="proxy",t.action="eth_call";try{return yield this.fetch("proxy",t,!0)}catch(t){return Mt("call",t,e.transaction)}}case"estimateGas":{const t=qt(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return yield this.fetch("proxy",t,!0)}catch(t){return Mt("estimateGas",t,e.transaction)}}case"getLogs":{const t={action:"getLogs"};if(e.filter.fromBlock&&(t.fromBlock=Gt(e.filter.fromBlock)),e.filter.toBlock&&(t.toBlock=Gt(e.filter.toBlock)),e.filter.address&&(t.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&Ft.throwError("unsupported topic count",o.b.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length)){const r=e.filter.topics[0];"string"==typeof r&&66===r.length||Ft.throwError("unsupported topic format",o.b.errors.UNSUPPORTED_OPERATION,{topic0:r}),t.topic0=r}const r=yield this.fetch("logs",t);let n={};for(let t=0;t<r.length;t++){const e=r[t];if(null==e.blockHash){if(null==n[e.blockNumber]){const t=yield this.getBlock(e.blockNumber);t&&(n[e.blockNumber]=t.hash)}e.blockHash=n[e.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,t,e)}))}getHistory(t,e,r){return Ut(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(t),startblock:null==e?0:e,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((t=>{["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);const e=this.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e}))}))}isCommunityResource(){return this.apiKey===Ht}}var Jt=r("5553"),Vt=function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))};const $t=new o.b(N);function Xt(){return(new Date).getTime()}function zt(t){let e=null;for(let r=0;r<t.length;r++){const n=t[r];
1if(null==n)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||null==e.ensAddress&&null==n.ensAddress)||$t.throwArgumentError("provider mismatch","networks",t):e=n}return e}function Zt(t,e){t=t.slice().sort();const r=Math.floor(t.length/2);if(t.length%2)return t[r];const n=t[r-1],o=t[r];return null!=e&&Math.abs(n-o)>e?null:(n+o)/2}function Qt(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(p.a.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((t=>Qt(t))));if("object"==typeof t){const e=Object.keys(t);return e.sort(),"{"+e.map((e=>{let r=t[e];return r="function"==typeof r?"[function]":Qt(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let Yt=1;function te(t){let e=null,r=null,n=new Promise((n=>{e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:t=>(n=n.then(t),n)}}const ee=[o.b.errors.CALL_EXCEPTION,o.b.errors.INSUFFICIENT_FUNDS,o.b.errors.NONCE_EXPIRED,o.b.errors.REPLACEMENT_UNDERPRICED,o.b.errors.UNPREDICTABLE_GAS_LIMIT],re=["address","args","errorArgs","errorSignature","method","transaction"];function ne(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function oe(t,e,r){let n=Qt;switch(e){case"getBlockNumber":return function(e){const r=e.map((t=>t.result));let n=Zt(e.map((t=>t.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){const e=t.map((t=>t.result));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Zt(t.map((t=>t.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=Object(k.g)(t)).confirmations=-1,Qt(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=Object(k.g)(t)).transactions=t.transactions.map((t=>((t=Object(k.g)(t)).confirmations=-1,t))),Qt(t))}:function(t){return null==t?null:Qt(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){const n={};r.forEach((e=>{const r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));const o=Object.keys(n);for(let t=0;t<o.length;t++){const r=n[o[t]];if(r.count>=e)return r.result}}}(n,t.quorum)}function se(t,e){return Vt(this,void 0,void 0,(function*(){const r=t.provider;return null!=r.blockNumber&&r.blockNumber>=e||-1===e?r:Object(v.c)((()=>new Promise(((n,o)=>{setTimeout((function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function ie(t,e,r,n){return Vt(this,void 0,void 0,(function*(){let s=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return s[r]();case"getEtherPrice":if(s.getEtherPrice)return s.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&Object(m.l)(n.blockTag)&&(s=yield se(t,e)),s[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&Object(m.l)(n.blockTag)&&(s=yield se(t,e)),s.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&Object(m.l)(n.blockTag)&&(s=yield se(t,e)),s[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&Object(m.l)(n.blockTag)&&(s=yield se(t,e)),s[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return s[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&Object(m.l)(r.fromBlock)||r.toBlock&&Object(m.l)(r.toBlock))&&(s=yield se(t,e)),s.getLogs(r)}}return $t.throwError("unknown method error",o.b.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class ae extends nt{constructor(t,e){$t.checkNew(new.target,ae),0===t.length&&$t.throwArgumentError("missing providers","providers",t);const r=t.map(((t,e)=>{if(n.b.isProvider(t)){const e=A(t)?2e3:750,r=1;return Object.freeze({provider:t,weight:1,stallTimeout:e,priority:r})}const r=Object(k.g)(t);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=A(t)?2e3:750),null==r.weight&&(r.weight=1);const o=r.weight;return(o%1||o>512||o<1)&&$t.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${e}].weight`,o),Object.freeze(r)})),o=r.reduce(((t,e)=>t+e.weight),0);null==e?e=o/2:e>o&&$t.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);let s=zt(r.map((t=>t.provider.network)));null==s&&(s=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then(t,e)}),0)}))),super(s),Object(k.d)(this,"providerConfigs",Object.freeze(r)),Object(k.d)(this,"quorum",e),this._highestBlockNumber=-1}detectNetwork(){return Vt(this,void 0,void 0,(function*(){return zt(yield Promise.all(this.providerConfigs.map((t=>t.provider.getNetwork()))))}
1))}perform(t,e){return Vt(this,void 0,void 0,(function*(){if("sendTransaction"===t){const t=yield Promise.all(this.providerConfigs.map((t=>t.provider.sendTransaction(e.signedTransaction).then((t=>t.hash),(t=>t)))));for(let e=0;e<t.length;e++){const r=t[e];if("string"==typeof r)return r}throw t[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==t&&(yield this.getBlockNumber());const r=oe(this,t,e),n=Object(Jt.a)(this.providerConfigs.map(k.g));n.sort(((t,e)=>t.priority-e.priority));const s=this._highestBlockNumber;let i=0,a=!0;for(;;){const o=Xt();let c=n.filter((t=>t.runner&&o-t.start<t.stallTimeout)).reduce(((t,e)=>t+e.weight),0);for(;c<this.quorum&&i<n.length;){const r=n[i++],o=Yt++;r.start=Xt(),r.staller=te(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=ie(r,s,t,e).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:ne(r,Xt()),request:{method:t,params:Object(k.c)(e)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:ne(r,Xt()),request:{method:t,params:Object(k.c)(e)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:ne(r,null),request:{method:t,params:Object(k.c)(e)},provider:this}),c+=r.weight}const l=[];n.forEach((t=>{!t.done&&t.runner&&(l.push(t.runner),t.staller&&l.push(t.staller.getPromise()))})),l.length&&(yield Promise.race(l));const u=n.filter((t=>t.done&&null==t.error));if(u.length>=this.quorum){const t=r(u);if(void 0!==t)return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),t;a||(yield te(100).getPromise()),a=!1}const h=n.reduce(((t,e)=>{if(!e.done||null==e.error)return t;const r=e.error.code;return ee.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{});if(Object.keys(h).forEach((t=>{const e=h[t];if(e.weight<this.quorum)return;n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0}));const r=e.error,o={};re.forEach((t=>{null!=r[t]&&(o[t]=r[t])})),$t.throwError(r.reason||r.message,t,o)})),0===n.filter((t=>!t.done)).length)break}return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),$t.throwError("failed to meet quorum",o.b.errors.SERVER_ERROR,{method:t,params:e,results:n.map((t=>ne(t))),provider:this})}))}}const ce=null,le=new o.b(N),ue="84842078b09946638c03157f83405213";class he extends Et{constructor(t,e){const r=new de(t,e),n=r.connection;n.password&&le.throwError("INFURA WebSocket project secrets unsupported",o.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),t),Object(k.d)(this,"apiKey",r.projectId),Object(k.d)(this,"projectId",r.projectId),Object(k.d)(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===ue}}class de extends Pt{static getWebSocketProvider(t,e){return new he(t,e)}static getApiKey(t){const e={apiKey:ue,projectId:ue,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(le.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),le.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:le.throwError("unsupported network",o.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:(t,r)=>(e.projectId===ue&&B(),Promise.resolve(!0))};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}isCommunityResource(){return this.projectId===ue}}class fe extends kt{send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};
1null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},o=new Promise(((t,e)=>{n.resolve=t,n.reject=e}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const t=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const e=t.map((t=>t.request));return this.emit("debug",{action:"requestBatch",request:Object(k.c)(e),provider:this}),Object(v.b)(this.connection,JSON.stringify(e)).then((r=>{this.emit("debug",{action:"response",request:e,response:r,provider:this}),t.forEach(((t,e)=>{const n=r[e];if(n.error){const e=new Error(n.error.message);e.code=n.error.code,e.data=n.error.data,t.reject(e)}else t.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:e,provider:this}),t.forEach((t=>{t.reject(r)}))}))}),10)),o}}const pe=new o.b(N);class me extends Pt{static getApiKey(t){return t&&"string"!=typeof t&&pe.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}static getUrl(t,e){pe.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:pe.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}const be=new o.b(N),ge={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class ke extends Pt{constructor(t,e){if(null==e){const r=Object(k.e)(new.target,"getNetwork")(t);if(r){const t=ge[r.name];t&&(e={applicationId:t,loadBalancer:!0})}null==e&&be.throwError("unsupported network",o.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}super(t,e)}static getApiKey(t){null==t&&be.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",t);const e={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?(be.assertArgument("string"==typeof t.applicationId,"applicationSecretKey requires an applicationId","applicationId",t.applicationId),be.assertArgument("string"==typeof t.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey,e.loadBalancer=!!t.loadBalancer):t.applicationId?(be.assertArgument("string"==typeof t.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",t.applicationId),e.applicationId=t.applicationId,e.loadBalancer=!!t.loadBalancer):be.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:be.throwError("unsupported network",o.b.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n=null;n=e.loadBalancer?`https://${r}/v1/lb/${e.applicationId}`:`https://${r}/v1/${e.applicationId}`;const s={url:n,headers:{}};return null!=e.applicationSecretKey&&(s.user="",s.password=e.applicationSecretKey),s}isCommunityResource(){return this.applicationId===ge[this.network.name]}}const we=new o.b(N);let ye=1;function ve(t,e){const r="Web3LegacyFetcher";return function(t,n){const o={method:t,params:n,id:ye++,jsonrpc:"2.0"};return new Promise(((t,n)=>{this.emit("debug",{action:"request",fetcher:r,request:Object(k.c)(o),provider:this}),e(o,((e,s)=>{if(e)return this.emit("debug",{action:"response",fetcher:r,error:e,request:o,provider:this}),n(e);if(this.emit("debug",{action:"response",fetcher:r,request:o,response:s,provider:this}),s.error){const t=new Error(s.error.message);return t.code=s.error.code,t.data=s.error.data,n(t)}t(s.result)}))}))}}class _e extends kt{constructor(t,e){we.checkNew(new.target,_e),null==t&&we.throwArgumentError("missing provider","provider",t);let r=null,n=null,o=null;"function"==typeof t?(r="unknown:",n=t):(r=t.host||t.path||"",!r&&t.isMetaMask&&(r="metamask"),o=t,t.request?(""===r&&(r="eip-1193:"),n=function(t){return function(e,r){null==r&&(r=[]);const n={method:e,params:r};
1return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Object(k.c)(n),provider:this}),t.request(n).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:t,provider:this}),t}))}}(t)):t.sendAsync?n=ve(0,t.sendAsync.bind(t)):t.send?n=ve(0,t.send.bind(t)):we.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),Object(k.d)(this,"jsonRpcFetchFunc",n),Object(k.d)(this,"provider",o)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const Ee=new o.b(N);function Ne(t,e){if(null==t&&(t="homestead"),"string"==typeof t){const e=t.match(/^(ws|http)s?:/i);if(e)switch(e[1]){case"http":return new kt(t);case"ws":return new Et(t);default:Ee.throwArgumentError("unsupported URL scheme","network",t)}}const r=d(t);return r&&r._defaultProvider||Ee.throwError("unsupported getDefaultProvider network",o.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:ae,AlchemyProvider:It,AnkrProvider:Ct,CloudflareProvider:Lt,EtherscanProvider:Wt,InfuraProvider:de,JsonRpcProvider:kt,NodesmithProvider:me,PocketProvider:ke,Web3Provider:_e,IpcProvider:ce},e)}},4105:function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r("549e"),o=r("3796");function s(t,e,r,s,i){let a;t=Object(n.a)(t),e=Object(n.a)(e);let c=1;const l=new Uint8Array(s),u=new Uint8Array(e.length+4);let h,d;u.set(e);for(let f=1;f<=c;f++){u[e.length]=f>>24&255,u[e.length+1]=f>>16&255,u[e.length+2]=f>>8&255,u[e.length+3]=255&f;let p=Object(n.a)(Object(o.a)(i,t,u));a||(a=p.length,d=new Uint8Array(a),c=Math.ceil(s/a),h=s-(c-1)*a),d.set(p);for(let e=1;e<r;e++){p=Object(n.a)(Object(o.a)(i,t,p));for(let t=0;t<a;t++)d[t]^=p[t]}const m=(f-1)*a,b=f===c?h:a;l.set(Object(n.a)(d).slice(0,b),m)}return Object(n.i)(l)}},5553:function(t,e,r){"use strict";function n(t){for(let e=(t=t.slice()).length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}r.d(e,"a",(function(){return n}))},"6e45":function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return l}));var n=r("549e"),o=r("ffb2"),s=r("ff09");const i=new o.b(s.a);const a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}();let c=a.crypto||a.msCrypto;function l(t){(t<=0||t>1024||t%1||t!=t)&&i.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return c.getRandomValues(e),Object(n.a)(e)}c&&c.getRandomValues||(i.warn("WARNING: Missing strong random number source"),c={getRandomValues:function(t){return i.throwError("no secure random source avaialble",o.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r("c8ba"))},"9bda":function(t,e,r){"use strict";r.d(e,"d",(function(){return s})),r.d(e,"e",(function(){return i})),r.d(e,"f",(function(){return a})),r.d(e,"b",(function(){return c})),r.d(e,"g",(function(){return l})),r.d(e,"c",(function(){return f})),r.d(e,"a",(function(){return p}));var n=r("ffb2");const o=new n.b("properties/5.6.0");function s(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function i(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function a(t){return function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function a(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){t.done?r(t.value):o(t.value).then(i,a)}c((n=n.apply(t,e||[])).next())}))}(this,void 0,void 0,(function*(){const e=Object.keys(t).map((e=>{const r=t[e];return Promise.resolve(r).then((t=>({key:e,value:t})))}));return(yield Promise.all(e)).reduce(((t,e)=>(t[e.key]=e.value,t)),{})}))}function c(t,e){t&&"object"==typeof t||o.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||o.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function l(t){const e={};for(const r in t)e[r]=t[r];return e}const u={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function h(t){if(null==t||u[typeof t])return!0;
1if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++){let n=null;try{n=t[e[r]]}catch(t){continue}if(!h(n))return!1}return!0}return o.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function d(t){if(h(t))return t;if(Array.isArray(t))return Object.freeze(t.map((t=>f(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&s(e,r,f(n))}return e}return o.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function f(t){return d(t)}class p{constructor(t){for(const e in t)this[e]=f(t[e])}}},e165:function(t,e,r){"use strict";r.r(e),r.d(e,"encode",(function(){return l})),r.d(e,"decode",(function(){return d}));var n=r("549e"),o=r("ffb2");const s=new o.b("rlp/5.6.0");function i(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function a(t,e,r){let n=0;for(let o=0;o<r;o++)n=256*n+t[e+o];return n}function c(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(c(t))})),e.length<=55)return e.unshift(192+e.length),e;const r=i(e.length);return r.unshift(247+r.length),r.concat(e)}Object(n.k)(t)||s.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(Object(n.a)(t));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=i(e.length);return r.unshift(183+r.length),r.concat(e)}function l(t){return Object(n.i)(c(t))}function u(t,e,r,n){const i=[];for(;r<e+1+n;){const a=h(t,r);i.push(a.result),r+=a.consumed,r>e+1+n&&s.throwError("child data too short",o.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function h(t,e){if(0===t.length&&s.throwError("data too short",o.b.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&s.throwError("data short segment too short",o.b.errors.BUFFER_OVERRUN,{});const n=a(t,e+1,r);return e+1+r+n>t.length&&s.throwError("data long segment too short",o.b.errors.BUFFER_OVERRUN,{}),u(t,e,e+1+r,r+n)}if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&s.throwError("data array too short",o.b.errors.BUFFER_OVERRUN,{}),u(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&s.throwError("data array too short",o.b.errors.BUFFER_OVERRUN,{});const i=a(t,e+1,r);e+1+r+i>t.length&&s.throwError("data array too short",o.b.errors.BUFFER_OVERRUN,{});return{consumed:1+r+i,result:Object(n.i)(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&s.throwError("data too short",o.b.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:Object(n.i)(t.slice(e+1,e+1+r))}}return{consumed:1,result:Object(n.i)(t[e])}}function d(t){const e=Object(n.a)(t),r=h(e,0);return r.consumed!==e.length&&s.throwArgumentError("invalid rlp data","data",t),r.result}},ff09:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n="random/5.6.0"}}]);
2//# sourceMappingURL=chunk-vendors~d6b3b356.fda7c5a4.js.map

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.