1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8604],{64146:function(e,t,r){r.d(t,{CH:function(){return P}});var n=r(61184),i=r(8198),o=r(81556),s=r(48088),a=r(19485),l=r(2593),c=r(16441),h=r(6881),d=r(83875),u=r(1581);var f=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};const g=new u.Logger("contracts/5.7.0");function m(e,t){return f(this,void 0,void 0,(function*(){const r=yield t;"string"!==typeof r&&g.throwArgumentError("invalid address or ENS name","name",r);try{return(0,a.getAddress)(r)}catch(i){}e||g.throwError("a provider or signer is needed to resolve ENS names",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&g.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function p(e,t,r){return f(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>p(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield m(e,t):"tuple"===r.type?yield p(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>p(e,t,r.arrayChildren)))):Promise.reject(g.makeError("invalid value for array",u.Logger.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function v(e,t,r){return f(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"===typeof r[r.length-1]&&(n=(0,h.shallowCopy)(r.pop())),g.checkArgumentCount(r.length,t.input
1s.length,"passed to contract"),e.signer?n.from?n.from=(0,h.resolveProperties)({override:m(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>f(this,void 0,void 0,(function*(){return(0,a.getAddress)(e.signer)!==e.override&&g.throwError("Contract with a Signer cannot override from",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=m(e.provider,n.from));const i=yield(0,h.resolveProperties)({args:p(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,h.resolveProperties)(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},v=i.overrides;if(null!=v.nonce&&(s.nonce=l.O$.from(v.nonce).toNumber()),null!=v.gasLimit&&(s.gasLimit=l.O$.from(v.gasLimit)),null!=v.gasPrice&&(s.gasPrice=l.O$.from(v.gasPrice)),null!=v.maxFeePerGas&&(s.maxFeePerGas=l.O$.from(v.maxFeePerGas)),null!=v.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=l.O$.from(v.maxPriorityFeePerGas)),null!=v.from&&(s.from=v.from),null!=v.type&&(s.type=v.type),null!=v.accessList&&(s.accessList=(0,d.accessListify)(v.accessList)),null==s.gasLimit&&null!=t.gas){let e=21e3;const r=(0,c.arrayify)(o);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);s.gasLimit=l.O$.from(t.gas).add(e)}if(v.value){const e=l.O$.from(v.value);e.isZero()||t.payable||g.throwError("non-payable method cannot override value",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),s.value=e}v.customData&&(s.customData=(0,h.shallowCopy)(v.customData)),v.ccipReadEnabled&&(s.ccipReadEnabled=!!v.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const y=Object.keys(n).filter((e=>null!=n[e]));return y.length&&g.throwError(`cannot override ${y.map((e=>JSON.stringify(e))).join(",")}`,u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:y}),s}))}function y(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=(0,h.deepCopy)(r),i=null;try{i=e.interface.parseLog(r)}catch(o){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function w(e,t,r){const n=e.signer||e.provider;return function(...i){return f(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"===typeof i[i.length-1]){const e=(0,h.shallowCopy)(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const s=yield v(e,t,i),a=yield n.call(s,o);try{let n=e.interface.decodeFunctionResult(t,a);return r&&1===t.outputs.length&&(n=n[0]),n}catch(l){throw l.code===u.Logger.errors.CALL_EXCEPTION&&(l.address=e.address,l.args=i,l.transaction=s),l}}))}}function _(e,t,r){return t.constant?w(e,t,r):function(e,t){return function(...r){return f(this,void 0,void 0,(function*(){e.signer||g.throwError("sending a transaction requires a signer",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield v(e,t,r),i=yield e.signer.sendTransaction(n);return y(e,i),i}))}}(e,t)}function b(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class k{constructor(e,t){(0,h.defineReadOnly)(this,"tag",e),(0,h.defineReadOnly)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class E extends k{constructor(){super("error",null)}}class N extends k{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&g.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(b(i),i),(0,h.defineReadOnly)(this,"address",e),(0,h.defineReadOnly)(this,"interface",t),(0,h.defineReadOnly)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=(0,n.BR)(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class R extends k{constructor(e,t){super("*",{address:e}),(0,h.defineReadOnly)(this,"address",e),(0,h.defineReadOnly)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(t){}}}class P extends class{constructor(e,t,r){(0,h.defineReadOnly)(this,"interface",(0,h.getStatic)(new.target,"getInterface")(t)),null==r?((0,h.defineReadOnly)(this,"provider",null),(0,h.defineReadOnly)(this,"signer",null)):s.E.isSigner(r)?((0,h.defineReadOnly)(this,"provider",r.provider||null),(0,h.defineReadOnly)(this,"signer",r)):o.zt.isProvider(r)?((0,h.defineReadOnly)(this,"provider",r),(0,h.defineReadOnly)(this,"signer",null)):g.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,h.defineReadOnly)(this,"callStatic",{}),(0,h.defineReadOnly)(this,"estimateGas",{}),(0,h.defineReadOnly)(this,"functions",{}),(0,h.defineReadOnly)(this,"populateTransaction",{}),(0,h.defineReadOnly)(this,"filters",{});{const e={};
1Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];(0,h.defineReadOnly)(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?(0,h.defineReadOnly)(this.filters,t,this.filters[r[0]]):g.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if((0,h.defineReadOnly)(this,"_runningEvents",{}),(0,h.defineReadOnly)(this,"_wrappedEmits",{}),null==e&&g.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,h.defineReadOnly)(this,"address",e),this.provider)(0,h.defineReadOnly)(this,"resolvedAddress",m(this.provider,e));else try{(0,h.defineReadOnly)(this,"resolvedAddress",Promise.resolve((0,a.getAddress)(e)))}catch(l){g.throwError("provider is required to use ENS name as contract address",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])g.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&(0,h.defineReadOnly)(this,e,_(this,t,!0)),null==this.functions[e]&&(0,h.defineReadOnly)(this.functions,e,_(this,t,!1)),null==this.callStatic[e]&&(0,h.defineReadOnly)(this.callStatic,e,w(this,t,!0)),null==this.populateTransaction[e]&&(0,h.defineReadOnly)(this.populateTransaction,e,function(e,t){return function(...r){return v(e,t,r)}}(this,t)),null==this.estimateGas[e]&&(0,h.defineReadOnly)(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return f(this,void 0,void 0,(function*(){r||g.throwError("estimate require a provider or signer",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield v(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&(0,h.defineReadOnly)(this,e,this[r])}catch(i){}null==this.functions[e]&&(0,h.defineReadOnly)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,h.defineReadOnly)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,h.defineReadOnly)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,h.defineReadOnly)(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return(0,a.getContractAddress)(e)}static getInterface(e){return i.vU.isInterface(e)?e:new i.vU(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&g.throwError("contract not deployed",u.Logger.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||g.throwError("sending a transactions require a signer",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=(0,h.shallowCopy)(e||{});return["from","to"].forEach((function(e){null!=t[e]&&g.throwError("cannot override "+e,u.Logger.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"===typeof e&&(e=new s.b(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,h.defineReadOnly)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return i.Hk.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"===typeof e){if("error"===e)return this._normalizeRunningEvent(new E);if("event"===e)return this._normalizeRunningEvent(new k("event",null));if("*"===e)return this._normalizeRunningEvent(new R(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new N(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!==typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new N(this.address,this.interface,r,e.topics))}catch(t){}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new k(b(r),r))}return this._normalizeRunningEvent(new R(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=(0,h.deepCopy)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||g.throwError("events require a provider or a signer with a provider",u.
vendor: 4,124 bytes, line 1
1Logger.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(i){n.decodeError=i.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=(0,h.shallowCopy)(n.filter);return"string"===typeof t&&(0,c.isHexString)(t,32)?(null!=r&&g.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}{}},85739:function(e,t,r){r.d(t,{r:function(){return fe}});var n=r(48088),i=r(2593),o=r(16441),s=r(67827),a=r(6881),l=r(29251),c=r(83875),h=r(37707),d=r(1581);const u="providers/5.7.2";var f=r(81556),g=r(59567),m=r(57727),p=r(57218),v=r(27586);const y=new d.Logger("networks/5.7.1");function w(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(i){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(i){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(i){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const i=new t.PocketProvider(e,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(i){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(i){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(i){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return w(e)},t}function _(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return _(e,t)},r}const b={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:w("homestead")},k={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:w("ropsten")},E={chainId:63,name:"classicMordor",_defaultProvider:_("https://www.ethercluster.com/mordor","classicMordor")},N={unspecified:{chainId:0,name:"unspecified"},homestead:b,mainnet:b,morden:{chainId:2,name:"morden"},ropsten:k,testnet:k,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:w("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:w("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:w("goerli")}
1,kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:w("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:_("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:E,classicTestnet:E,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:_("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:w("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:w("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var R=r(2006),P=r(92882),x=r.n(P),T=r(19485);const O=new d.Logger(u);class L{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),l=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:L.allowNull(this.accessList.bind(this),null),blockHash:L.allowNull(o,null),blockNumber:L.allowNull(l,null),transactionIndex:L.allowNull(l,null),confirmations:L.allowNull(l,null),from:t,gasPrice:L.allowNull(r),maxPriorityFeePerGas:L.allowNull(r),maxFeePerGas:L.allowNull(r),gasLimit:r,to:L.allowNull(t,null),value:r,nonce:l,data:i,r:L.allowNull(this.uint256),s:L.allowNull(this.uint256),v:L.allowNull(l),creates:L.allowNull(t,null),raw:L.allowNull(i)},e.transactionRequest={from:L.allowNull(t),nonce:L.allowNull(l),gasLimit:L.allowNull(r),gasPrice:L.allowNull(r),maxPriorityFeePerGas:L.allowNull(r),maxFeePerGas:L.allowNull(r),to:L.allowNull(t),value:L.allowNull(r),data:L.allowNull((e=>this.data(e,!0))),type:L.allowNull(l),accessList:L.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:t,topics:L.arrayOf(o),data:i,logIndex:l,blockHash:o},e.receipt={to:L.allowNull(this.address,null),from:L.allowNull(this.address,null),contractAddress:L.allowNull(t,null),transactionIndex:l,root:L.allowNull(s),gasUsed:r,logsBloom:L.allowNull(i),blockHash:o,transactionHash:o,logs:L.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:L.allowNull(l,null),cumulativeGasUsed:r,effectiveGasPrice:L.allowNull(r),status:L.allowNull(l),type:c},e.block={hash:L.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:L.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:L.allowNull(t),extraData:i,transactions:L.allowNull(L.arrayOf(o)),baseFeePerGas:L.allowNull(r)},e.blockWithTransactions=(0,a.shallowCopy)(e.block),e.blockWithTransactions.transactions=L.allowNull(L.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:L.allowNull(n,void 0),toBlock:L.allowNull(n,void 0),blockHash:L.allowNull(o,void 0),address:L.allowNull(t,void 0),topics:L.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:L.allowNull(l),blockHash:L.allowNull(o),transactionIndex:l,removed:L.allowNull(this.boolean.bind(this)),address:t,data:L.allowFalsish(i,"0x"),topics:L.arrayOf(o),transactionHash:o,logIndex:l},e}accessList(e){return(0,c.accessListify)(e||[])}number(e){return"0x"===e?0:i.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:i.O$.from(e).toNumber()}bigNumber(e){return i.O$.from(e)}boolean(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,o.isHexString)(e))?e.toLowerCase():O.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return(0,T.getAddress)(e)}callAddress(e){if(!(0,o.isHexString)(e,32))return null;const t=(0,T.getAddress)((0,o.hexDataSlice)(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return(0,T.getContractAddress)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||(0,o.isHexString)(e))return(0,o.hexValue)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==(0,o.hexDataLength)(r)?O.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=i.O$.from(e);try{return t.toNumber()}catch(r){}return null}uint256(e){if(!(0,o.isHexString)(e))throw new Error("invalid uint256");return(0,o.hexZeroPad)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=L.check(t,e);return n._difficulty=null==r?null:i.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return L.check(this.formats.transactionRequest,e)}
1transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&i.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=L.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,o.isHexString)(r)&&(r=i.O$.from(r).toNumber()),"number"!==typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!==typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,c.parse)(e)}receiptLog(e){return L.check(this.formats.receiptLog,e)}receipt(e){const t=L.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=i.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&O.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):O.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&O.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return L.check(this.formats.filter,e)}filterLog(e){return L.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const i in e)try{const n=e[i](t[i]);void 0!==n&&(r[i]=n)}catch(n){throw n.checkKey=i,n.checkValue=t[i],n}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var A=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};const I=new d.Logger(u);function C(e){return null==e?"null":(32!==(0,o.hexDataLength)(e)&&I.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function B(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[C(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return C(e)})).join("&")}function S(e){if("string"===typeof e){if(e=e.toLowerCase(),32===(0,o.hexDataLength)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+B(e);if(f.Sg.isForkEvent(e))throw I.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+B(e.topics||[])}throw new Error("invalid event - "+e)}function D(){return(new Date).getTime()}function F(e){return new Promise((t=>{setTimeout(t,e)}))}const U=["block","network","pending","poll"];class ${constructor(e,t,r){(0,a.defineReadOnly)(this,"tag",e),(0,a.defineReadOnly)(this,"listener",t),(0,a.defineReadOnly)(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 e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||U.indexOf(this.tag)>=0}}const 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"}
1,61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function G(e){return(0,o.hexZeroPad)(i.O$.from(e).toHexString(),32)}function j(e){return m.Base58.encode((0,o.concat)([e,(0,o.hexDataSlice)((0,R.JQ)((0,R.JQ)(e)),0,4)]))}const M=new RegExp("^(ipfs)://(.*)$","i"),Z=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),M,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function q(e,t){try{return(0,l.ZN)(V(e,t))}catch(r){}return null}function V(e,t){if("0x"===e)return null;const r=i.O$.from((0,o.hexDataSlice)(e,t,t+32)).toNumber(),n=i.O$.from((0,o.hexDataSlice)(e,r,r+32)).toNumber();return(0,o.hexDataSlice)(e,r+32,r+32+n)}function W(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):I.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function J(e){const t=(0,o.arrayify)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function z(e){if(e.length%32===0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function X(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const i=(0,o.arrayify)(e[n]);t[n]=J(r),t.push(J(i.length)),t.push(z(i)),r+=32+32*Math.ceil(i.length/32)}return(0,o.hexConcat)(t)}class K{constructor(e,t,r,n){(0,a.defineReadOnly)(this,"provider",e),(0,a.defineReadOnly)(this,"name",r),(0,a.defineReadOnly)(this,"address",e.formatter.address(t)),(0,a.defineReadOnly)(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>i.O$.from(e).eq(1))).catch((e=>{if(e.code===d.Logger.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return A(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:(0,o.hexConcat)([e,(0,v.VM)(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=(0,o.hexConcat)(["0x9061b923",X([(0,v.Kn)(this.name),r.data])]));try{let e=yield this.provider.call(r);return(0,o.arrayify)(e).length%32===4&&I.throwError("resolver threw error",d.Logger.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=V(e,0)),e}catch(i){if(i.code===d.Logger.errors.CALL_EXCEPTION)return null;throw i}}))}_fetchBytes(e,t){return A(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?V(r,0):null}))}_getAddress(e,t){const r=H[String(e)];if(null==r&&I.throwError(`unsupported coin type: ${e}`,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=(0,o.arrayify)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return j((0,o.concat)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return j((0,o.concat)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=x().toWords(n.slice(2));return e.unshift(t),x().encode(r.prefix,e)}}return null}getAddress(e){return A(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===p.R?null:this.provider.formatter.callAddress(e)}catch(n){if(n.code===d.Logger.errors.CALL_EXCEPTION)return null;throw n}const t=yield this._fetchBytes("0xf1cb7e06",G(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&I.throwError("invalid or unsupported coin data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return A(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<Z.length;r++){const n=t.match(Z[r]);if(null==n)continue;const s=n[1].toLowerCase();switch(s){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:W(t)};case"erc721":case"erc1155":{const r="erc721"===s?"0xc87b56dd":"0x0e89341c";e.push({type:s,content:t});const a=this._resolvedAddress||(yield this.getAddress()),l=(n[2]||"").split("/");if(2!==l.length)return null;const c=yield this.provider.formatter.address(l[0]),d=(0,o.hexZeroPad)(i.O$.from(l[1]).toHexString(),32);if("erc721"===s){const t=this.provider.formatter.callAddress(yield this.provider.call({to:c,data:(0,o.hexConcat)(["0x6352211e",d])}));if(a!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===s){const t=i.O$.from(yield this.provider.call({to:c,data:(0,o.hexConcat)(["0x00fdd58e",(0,o.hexZeroPad)(a,32),d])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(l[0]),data:(0,o.hexConcat)([r,d])};let f=q(yield this.provider.call(u),0);if(null==f)return null;e.push({type:"metadata-url-base",content:f}),"erc1155"===s&&(f=f.replace("{id}",d.substring(2)),e.push({type:"metadata-url-expanded",content:f})),f.match(/^ipfs:/i)&&(f=W(f)),e.push({type:"metadata-url",content:f});const g=yield(0,h.fetchJson)(f);if(!g)return null;e.push({type:"metadata",content:JSON.stringify(g)});let m=g.image;if("string"!==typeof m)return null;if(m.match(/^(https:\/\/|data:)/i));else{if(null==m.match(M))return null;e.push({type:"url-ipfs",content:m}),m=W(m)}return e.push({type:"url",content:m}),{linkage:e,url:m}}}}}catch(t){}return null}))}getContentHash(){return A(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+m.Base58.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+m.Base58.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=e.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+(0,g.c)("0x"+i[1]).replace(/[=+\/]/g,(t=>e[t]))}return I.throwError("invalid or unsupported content hash data",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return A(this,void 0,void 0,(function*(){let t=(0,l.Y0)(e);t=(0,o.concat)([G(64),G(t.length),t]),t.length%32!==0&&(t=(0,o.concat)([t,(0,o.hexZeroPad)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",(0,o.hexlify)(t));return null==r||"0x"===r?null:(0,l.ZN)(r)}))}}let Q=null,Y=1;class ee extends f.zt{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,a.defineReadOnly)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=(0,a.getStatic)(new.target,"getNetwork")(e);
1t?((0,a.defineReadOnly)(this,"_network",t),this.emit("network",t,null)):I.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return A(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||I.throwError("no network detected",d.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:(0,a.defineReadOnly)(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return(0,h.poll)((()=>this._ready().then((e=>e),(e=>{if(e.code!==d.Logger.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Q&&(Q=new L),Q}static getNetwork(e){return function(e){if(null==e)return null;if("number"===typeof e){for(const t in N){const r=N[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){const t=N[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=N[e.name];if(!t)return"number"!==typeof e.chainId&&y.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&y.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"===typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return A(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",i),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),l=yield(0,h.fetchJson)({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(l.data)return l.data;const c=l.message||"unknown error";if(l.status>=400&&l.status<500)return I.throwError(`response not found during CCIP fetch: ${c}`,d.Logger.errors.SERVER_ERROR,{url:t,errorMessage:c});o.push(c)}return I.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,d.Logger.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return A(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(D()-r.respTime<=e)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===t)break}}const t=D(),r=(0,a.resolveProperties)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=D();return(e=i.O$.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:o}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return A(this,void 0,void 0,(function*(){const e=Y++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){return void this.emit("error",n)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)I.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",I.makeError("network block skew detected",d.Logger.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block}
vendor: 7,131 bytes, line 1
1)),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return A(this,void 0,void 0,(function*(){return I.throwError("provider does not support network detection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return A(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield F(0),this._network;const r=I.makeError("underlying network changed",d.Logger.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!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))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=D();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=D(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return A(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return A(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const s=[];let a=!1;const l=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},c=e=>{e.confirmations<t||l()||i(e)};if(this.on(e,c),s.push((()=>{this.removeListener(e,c)})),n){let r=n.startBlock,i=null;const c=s=>A(this,void 0,void 0,(function*(){a||(yield F(1e3),this.getTransactionCount(n.from).then((h=>A(this,void 0,void 0,(function*(){if(!a){if(h<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(l())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(I.makeError("transaction was replaced",d.Logger.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}i++}}a||this.once("block",c)}}))),(e=>{a||this.once("block",c)})))}));if(a)return;this.once("block",c),s.push((()=>{this.removeListener("block",c)}))}if("number"===typeof r&&r>0){const e=setTimeout((()=>{l()||o(I.makeError("timeout exceeded",d.Logger.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return A(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return i.O$.from(e)}catch(t){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,a.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return i.O$.from(n)}catch(o){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:o})}}))}getTransactionCount(e,t){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,a.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return i.O$.from(n).toNumber()}catch(o){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:o})}}))}getCode(e,t){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,a.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,o.hexlify)(n)}catch(i){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:i})}}))}getStorageAt(e,t,r){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield(0,a.resolveProperties)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Prom
1ise.resolve(t).then((e=>(0,o.hexValue)(e)))}),i=yield this.perform("getStorageAt",n);try{return(0,o.hexlify)(i)}catch(s){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:s})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,o.hexDataLength)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&I.throwError("Transaction hash mismatch from Provider.sendTransaction.",d.Logger.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>A(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&I.throwError("transaction failed",d.Logger.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>(0,o.hexlify)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(i){throw i.transaction=r,i.transactionHash=r.hash,i}}))}_getTransactionRequest(e){return A(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?i.O$.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?(0,o.hexlify)(e):null)))})),this.formatter.transactionRequest(yield(0,a.resolveProperties)(r))}))}_getFilter(e){return A(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield(0,a.resolveProperties)(t))}))}_call(e,t,r){return A(this,void 0,void 0,(function*(){r>=10&&I.throwError("CCIP read exceeded maximum redirections",d.Logger.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,s=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===s.substring(0,10)&&(0,o.hexDataLength)(s)%32===4)try{const a=(0,o.hexDataSlice)(s,4),l=(0,o.hexDataSlice)(a,0,32);i.O$.from(l).eq(n)||I.throwError("CCIP Read sender did not match",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],h=i.O$.from((0,o.hexDataSlice)(a,32,64)).toNumber(),u=i.O$.from((0,o.hexDataSlice)(a,h,h+32)).toNumber(),f=(0,o.hexDataSlice)(a,h+32);for(let t=0;t<u;t++){const r=q(f,32*t);null==r&&I.throwError("CCIP Read contained corrupt URL string",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),c.push(r)}const g=V(a,64);i.O$.from((0,o.hexDataSlice)(a,100,128)).isZero()||I.throwError("CCIP Read callback selector included junk",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const m=(0,o.hexDataSlice)(a,96,100),p=V(a,128),v=yield this.ccipReadFetch(e,g,c);null==v&&I.throwError("CCIP Read disabled or provided no URLs",d.Logger.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const y={to:n,data:(0,o.hexConcat)([m,X([v,p])])};return this._call(y,t,r+1)}catch(a){if(a.code===d.Logger.errors.SERVER_ERROR)throw a}try{return(0,o.hexlify)(s)}catch(a){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:s,error:a})}}))}call(e,t){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield(0,a.resolveProperties)({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.cci
1pReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,a.resolveProperties)({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return i.O$.from(r)}catch(n){return I.throwError("bad result from backend",d.Logger.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:n})}}))}_getAddress(e){return A(this,void 0,void 0,(function*(){"string"!==typeof(e=yield e)&&I.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&I.throwError("ENS name not configured",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return A(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if((0,o.isHexString)(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),(0,o.isHexString)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(i){I.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return(0,h.poll)((()=>A(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;n<e.transactions.length;n++){const r=e.transactions[n];if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return A(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,h.poll)((()=>A(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return A(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return(0,h.poll)((()=>A(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?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 e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return A(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield(0,a.resolveProperties)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),L.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return A(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return A(this,void 0,void 0,(function*(){if("number"===typeof(e=yield e)&&e<0){e%1&&I.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return A(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new K(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return A(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||I.throwError("network does not support ENS",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+(0,v.VM)(e).substring(2)});return this.formatter.callAddress(t)}catch(n){}return null}))}resolveName(e){return A(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(r){if((0,o.isHexString)(e))throw r}"string"!==typeof e&&I.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return A(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=q(yield this.call({to:r,data:"0x691f3431"+(0,v.VM)(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return A(this,void 0,void 0,(function*(){let t=null;if((0,o.isHexString)(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(r,"getAvatar");if(!i)return null;t=new K(this,i,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(n){if(n.code!==d.Logger.errors.CALL_EXCEPTION)throw n}try{const e=q(yield this.call({to:i,data:"0x691f3431"+(0,v.VM)(r).substring(2)}),0);t=yield this.getResolver(e)}catch(n){if(n.code!==d.Logger.errors.CALL_EXCEPTION)throw n;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return I.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENT
1ED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new $(S(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=S(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=S(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=S(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=S(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=S(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var te=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(t){o(t)}}function a(e){try{l(n.throw(e))}catch(t){o(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))};const re=new d.Logger(u),ne=["call","estimateGas"];function ie(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){const r=(0,o.isHexString)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===typeof e){for(const r in e){const n=ie(e[r],t);if(n)return n}return null}if("string"===typeof e)try{return ie(JSON.parse(e),t)}catch(r){}return null}function oe(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=ie(t,!0);if(e)return e.data;re.throwError("missing revert data in call exception; Transaction reverted without a reason string",d.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=ie(t.body,!1);null==r&&(r=ie(t,!1)),r&&re.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===d.Logger.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?i=t.error.message:"string"===typeof t.body?i=t.body:"string"===typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&re.throwError("insufficient funds for intrinsic transaction cost",d.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&re.throwError("nonce has already been used",d.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&re.throwError("replacement fee too low",d.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&re.throwError("legacy pre-eip-155 transactions not supported",d.Logger.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),ne.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&re.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",d.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function se(e){return new Promise((function(t){setTimeout(t,e)}))}function ae(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function le(e){return e?e.toLowerCase():e}const ce={};class he extends n.E{constructor(e,t,r){if(super(),e!==ce)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,a.defineReadOnly)(this,"provider",t),null==r&&(r=0),"string"===typeof r?((0,a.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,a.defineReadOnly)(this,"_index",null)):"number"===typeof r?((0,a.defineReadOnly)(this,"_index",r),(0,a.defineReadOnly)(this,"_address",null)):re.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return re.throwError("cannot alter JSON-RPC Signer connection",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new de(ce,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&re.throwError("unknown account #"+this._index,d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=(0,a.shallowCopy)(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));
1if(null==e.gasLimit){const r=(0,a.shallowCopy)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>te(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&re.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),(0,a.resolveProperties)({tx:(0,a.resolveProperties)(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&re.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"===typeof e.message&&e.message.match(/user denied/i)&&re.throwError("user rejected transaction",d.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),oe("sendTransaction",e,n))))}))}signTransaction(e){return re.throwError("signing transactions is unsupported",d.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return te(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield(0,h.poll)((()=>te(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}}))}signMessage(e){return te(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,l.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,o.hexlify)(t),r.toLowerCase()])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&re.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),n}}))}_legacySignMessage(e){return te(this,void 0,void 0,(function*(){const t="string"===typeof e?(0,l.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,o.hexlify)(t)])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&re.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),n}}))}_signTypedData(e,t,r){return te(this,void 0,void 0,(function*(){const n=yield s.E.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(s.E.getPayload(n.domain,t,n.value))])}catch(o){throw"string"===typeof o.message&&o.message.match(/user denied/i)&&re.throwError("user rejected signing",d.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),o}}))}unlock(e){return te(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class de extends he{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const ue={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class fe extends ee{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=(0,a.getStatic)(this.constructor,"defaultUrl")()),"string"===typeof e?(0,a.defineReadOnly)(this,"connection",Object.freeze({url:e})):(0,a.defineReadOnly)(this,"connection",Object.freeze((0,a.shallowCopy)(e))),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 te(this,void 0,void 0,(function*(){yield se(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){const r=(0,a.getStatic)(this.constructor,"getNetwork");try{return r(i.O$.from(e).toNumber())}catch(t){return re.throwError("could not detect network",d.Logger.errors.NETWORK_E
1RROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return re.throwError("could not detect network",d.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new he(ce,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,a.deepCopy)(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=(0,h.fetchJson)(this.connection,JSON.stringify(r),ae).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[le(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[le(t.address),t.blockTag]];case"getCode":return["eth_getCode",[le(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[le(t.address),(0,o.hexZeroPad)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,a.getStatic)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=le(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return te(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&i.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,a.shallowCopy)(t)).transaction=(0,a.shallowCopy)(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&re.throwError(e+" not implemented",d.Logger.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(n){return oe(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return se(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=(0,a.shallowCopy)(ue);if(t)for(const i in t)t[i]&&(r[i]=!0);(0,a.checkProperties)(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=(0,o.hexValue)(i.O$.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=(0,o.hexlify)(e[t]))})),e.accessList&&(n.accessList=(0,c.accessListify)(e.accessList)),n}}},67720:function(e,t,r){var n=r(63366),i=r(87462),o=r(67294),s=r(90512),a=r(58510),l=r(2101),c=r(90948),h=r(71657),d=r(35097),u=r(85893);const f=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],g=(0,c.ZP)("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})((({theme:e,ownerState:t})=>(0,i.Z)({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:(0,l.Fq)(e.palette.divider,.08)},"inset"===t.variant&&{marginLeft:72},"middle"===t.variant&&"horizontal"===t.orientation&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},"middle"===t.variant&&"vertical"===t.orientation&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},"vertical"===t.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"})),(({ownerState:e})=>(0,i.Z)({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}})),(({theme:e,ownerState:t})=>(0,i.Z)({},t.children&&"vertical"!==t.orientation&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`}})),(({theme:e,ownerState:t})=>(0,i.Z)({},t.children&&"vertical"===t.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`}})),(({ownerState:e})=>(0,i.Z)({},"right"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}}))),m=(0,c.ZP)("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})((({theme:e,ownerState:t})=>(0,i.Z)({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},"vertical"===t.orientation&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}))),p=o.forwardRef((function(e,t){const r=(0,h.Z)({props:e,name:"MuiDivider"}),{absolute:o=!1,children:l,className:c,component:p=(l?"div":"hr"),flexItem:v=!1,light:y=!1,orientation:w="horizontal",role:_=("hr"!==p?"separator":void 0),textAlign:b="center",variant:k="fullWidth"}=r,E=(0,n.Z)(r,f),N=(0,i.Z)({},r,{absolute:o,component:p,flexItem:v,light:y,orientation:w,role:_,textAlign:b,variant:k}),R=(e=>{const{absolute:t,children:r,classes:n,flexItem:i,light:o,orientation:s,textAlign:l,variant:c}=e,h={root:["root",t&&"absolute",c,o&&"light","vertical"===s&&"vertical",i&&"flexItem",r&&"withChildren",r&&"vertical"===s&&"withChildrenVertical","right"===l&&"vertical"!==s&&"textAlignRight","left"===l&&"vertical"!==s&&"textAlignLeft"],wrapper:["wrapper","vertical"===s&&"wrapperVertical"]};return(0,a.Z)(h,d.V,n)})(N);return(0,u.jsx)(g,(0,i.Z)({as:p,className:(0,s.Z)(R.root,c),role:_,ref:t,ownerState:N},E,{children:l?(0,u.jsx)(m,{className:R.wrapper,ownerState:N,children:l}):null}))}));p.muiSkipListHighlight=!0,t.Z=p},35097:function(e,t,r){r.d(t,{V:function(){return o}});var n=r(1977),i=r(8027);function o(e){return(0,i.ZP)("MuiDivider",e)}const s=(0,n.Z)("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);t.Z=s}
1,92882:function(e){for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<t.length;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function s(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(t=o(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=o(t)^31&i}return t}function a(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var l=e.slice(0,a),c=e.slice(a+1);if(c.length<6)return"Data too short";var h=s(l);if("string"===typeof h)return h;for(var d=[],u=0;u<c.length;++u){var f=c.charAt(u),g=r[f];if(void 0===g)return"Unknown character "+f;h=o(h)^g,u+6>=c.length||d.push(g)}return 1!==h?"Invalid checksum for "+e:{prefix:l,words:d}}function l(e,t,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],l=0;l<e.length;++l)for(i=i<<t|e[l],o+=t;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=t)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}e.exports={decodeUnsafe:function(){var e=a.apply(null,arguments);if("object"===typeof e)return e},decode:function(e){var t=a.apply(null,arguments);if("object"===typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=s(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var a=e+"1",l=0;l<r.length;++l){var c=r[l];if(c>>5!==0)throw new Error("Non 5-bit word");i=o(i)^c,a+=t.charAt(c)}for(l=0;l<6;++l)i=o(i);for(i^=1,l=0;l<6;++l){a+=t.charAt(i>>5*(5-l)&31)}return a},toWordsUnsafe:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}}}]); 2//# sourceMappingURL=8604-c0ef66258352e998.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.