PageSourceSearch

https://dex.guru/static/js/6285.6b614488.js

js dex.guru collected 2026-10-02 11:00:37 UTC 19,826 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdexguru=self.webpackChunkdexguru||[]).push([[6285],{77107:(t,e,r)=>{r.d(e,{Mb:()=>d,Gp:()=>g});var n=r(789),s=r(82895),o=r(80928),i=r(89263),a=r(99138),l=r(22521),c=r(78663),u=r(43883);const h=new c.Logger(u.i);class d{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),i=this.hex.bind(this),l=this.number.bind(this),c=this.type.bind(this);return t.transaction={hash:o,type:c,accessList:d.allowNull(this.accessList.bind(this),null),blockHash:d.allowNull(o,null),blockNumber:d.allowNull(l,null),transactionIndex:d.allowNull(l,null),confirmations:d.allowNull(l,null),from:e,gasPrice:d.allowNull(r),maxPriorityFeePerGas:d.allowNull(r),maxFeePerGas:d.allowNull(r),gasLimit:r,to:d.allowNull(e,null),value:r,nonce:l,data:s,r:d.allowNull(this.uint256),s:d.allowNull(this.uint256),v:d.allowNull(l),creates:d.allowNull(e,null),raw:d.allowNull(s)},t.transactionRequest={from:d.allowNull(e),nonce:d.allowNull(l),gasLimit:d.allowNull(r),gasPrice:d.allowNull(r),maxPriorityFeePerGas:d.allowNull(r),maxFeePerGas:d.allowNull(r),to:d.allowNull(e),value:d.allowNull(r),data:d.allowNull((t=>this.data(t,!0))),type:d.allowNull(l),accessList:d.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:e,topics:d.arrayOf(o),data:s,logIndex:l,blockHash:o},t.receipt={to:d.allowNull(this.address,null),from:d.allowNull(this.address,null),contractAddress:d.allowNull(e,null),transactionIndex:l,root:d.allowNull(i),gasUsed:r,logsBloom:d.allowNull(s),blockHash:o,transactionHash:o,logs:d.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:d.allowNull(l,null),cumulativeGasUsed:r,effectiveGasPrice:d.allowNull(r),status:d.allowNull(l),type:c},t.block={hash:d.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:d.allowNull(i),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:d.allowNull(e),extraData:s,transactions:d.allowNull(d.arrayOf(o)),baseFeePerGas:d.allowNull(r)},t.blockWithTransactions=(0,a.shallowCopy)(t.block),t.blockWithTransactions.transactions=d.allowNull(d.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:d.allowNull(n,void 0),toBlock:d.allowNull(n,void 0),blockHash:d.allowNull(o,void 0),address:d.allowNull(e,void 0),topics:d.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:d.allowNull(l),blockHash:d.allowNull(o),transactionIndex:l,removed:d.allowNull(this.boolean.bind(this)),address:e,data:d.allowFalsish(s,"0x"),topics:d.arrayOf(o),transactionHash:o,logIndex:l},t}accessList(t){return(0,l.accessListify)(t||[])}number(t){return"0x"===t?0:s.O$.from(t).toNumber()}type(t){return"0x"===t||null==t?0:s.O$.from(t).toNumber()}bigNumber(t){return s.O$.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),(0,o.isHexString)(t))?t.toLowerCase():h.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(0,n.getAddress)(t)}callAddress(t){if(!(0,o.isHexString)(t,32))return null;const e=(0,n.getAddress)((0,o.hexDataSlice)(t,12));return e===i.d?null:e}contractAddress(t){return(0,n.getContractAddress)(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"===typeof t||(0,o.isHexString)(t))return(0,o.hexValue)(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==(0,o.hexDataLength)(r)?h.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=s.O$.from(t);try{return e.toNumber()}catch(r){}return null}uint256(t){if(!(0,o.isHexString)(t))throw new Error("invalid uint256");return(0,o.hexZeroPad)(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=d.check(e,t);return n._difficulty=null==r?null:s.O$.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return d.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&s.O$.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=d.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;(0,o.isHexString)(r)&&(r=s.O$.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),(0,o.isHexString)(r)&&(r=s.O$.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(0,l.parse)(t)}receiptLog(t){return d.check(this.formats.receiptLog,t)}receipt(t){const e=d.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=s.O$.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&h.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):h.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&h.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 d.check(this.formats.filter,t)}filterLog(t){return d.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const s in t)try{const n=t[s](e[s]);void 0!==n&&(r[s]=n)}catch(n){throw n.checkKey=s,n.checkValue=e[s],n}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 g(t){return function(t){return t&&"function"===typeof t.isCommunityResource}(t)&&t.isCommunityResource()}},14880:(t,e,r)=>{r.d(e,{c:()=>O});var n=r(99138),s=r(78663),o=r(43883),i=r(33853),a=r(82895),l=r(80928),c=r(56510),u=r(22172),h=r(22521),d=r(99610),g=r(81209),f=function(t,e,r,n){return new(r||(r=Promise))((function(s,o){function i(t){try{l(n.next(t))}catch(e){o(e)}}function a(t){try{l(n.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,a)}l((n=n.apply(t,e||[])).next())}))};const m=new s.Logger(o.i),p=["call","estimateGas"];function w(t,e){if(null==t)return null;if("string"===typeof t.message&&t.message.match("reverted")){const r=(0,l.isHexString)(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"===typeof t){for(const r in t){const n=w(t[r],e);if(n)return n}return null}if("string"===typeof t)try{return w(JSON.parse(t),e)}catch(r){}return null}function y(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=w(e,!0);if(t)return t.data;m.throwError("missing revert data in call exception; Transaction reverted without a reason string",s.Logger.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=w(e.body,!1);null==r&&(r=w(e,!1)),r&&m.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",s.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let o=e.message;throw e.code===s.Logger.errors.SERVER_ERROR&&e.error&&"string"===typeof e.error.message?o=e.error.message:"string"===typeof e.body?o=e.body:"string"===typeof e.responseText&&(o=e.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&m.throwError("insufficient funds for intrinsic transaction cost",s.Logger.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),o.match(/nonce (is )?too low/i)&&m.throwError("nonce has already been used",s.Logger.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&m.throwError("replacement fee too low",s.Logger.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),o.match(/only replay-protected/i)&&m.throwError("legacy pre-eip-155 transactions not supported",s.Logger.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),p.indexOf(t)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&m.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",s.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function N(t){return new Promise((function(e){setTimeout(e,t)}))}function v(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 _(t){return t?t.toLowerCase():t}const b={};class k extends i.E{constructor(t,e,r){if(super(),t!==b)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,n.defineReadOnly)(this,"provider",e),null==r&&(r=0),"string"===typeof r?((0,n.defineReadOnly)(this,"_address",this.provider.formatter.address(r)),(0,n.defineReadOnly)(this,"_index",null)):"number"===typeof r?((0,n.defineReadOnly)(this,"_index",r),(0,n.defineReadOnly)(this,"_address",null)):m.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return m.throwError("cannot alter JSON-RPC Signer connection",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new E(b,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&&m.throwError("unknown account #"+this._index,s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=(0,n.shallowCopy)(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=(0,n.shallowCopy)(t);
1r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>f(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&m.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),(0,n.resolveProperties)({tx:(0,n.resolveProperties)(t),sender:e}).then((e=>{let{tx:r,sender:n}=e;null!=r.from?r.from.toLowerCase()!==n&&m.throwArgumentError("from address mismatch","transaction",t):r.from=n;const o=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[o]).then((t=>t),(t=>("string"===typeof t.message&&t.message.match(/user denied/i)&&m.throwError("user rejected transaction",s.Logger.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:r}),y("sendTransaction",t,o))))}))}signTransaction(t){return m.throwError("signing transactions is unsupported",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return f(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(0,d.$l)((()=>f(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(n){throw n.transactionHash=r,n}}))}signMessage(t){return f(this,void 0,void 0,(function*(){const e="string"===typeof t?(0,u.Y0)(t):t,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,l.hexlify)(e),r.toLowerCase()])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&m.throwError("user rejected signing",s.Logger.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:t}),n}}))}_legacySignMessage(t){return f(this,void 0,void 0,(function*(){const e="string"===typeof t?(0,u.Y0)(t):t,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,l.hexlify)(e)])}catch(n){throw"string"===typeof n.message&&n.message.match(/user denied/i)&&m.throwError("user rejected signing",s.Logger.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:t}),n}}))}_signTypedData(t,e,r){return f(this,void 0,void 0,(function*(){const n=yield c.E.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(c.E.getPayload(n.domain,e,n.value))])}catch(i){throw"string"===typeof i.message&&i.message.match(/user denied/i)&&m.throwError("user rejected signing",s.Logger.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:e,value:n.value}}),i}}))}unlock(t){return f(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class E extends k{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 x={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class T extends g.Zk{constructor(t,e){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=(0,n.getStatic)(this.constructor,"defaultUrl")()),"string"===typeof t?(0,n.defineReadOnly)(this,"connection",Object.freeze({url:t})):(0,n.defineReadOnly)(this,"connection",Object.freeze((0,n.shallowCopy)(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 f(this,void 0,void 0,(function*(){yield N(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(e){}}if(null!=t){const r=(0,n.getStatic)(this.constructor,"getNetwork");try{return r(a.O$.from(t).toNumber())}catch(e){return m.throwError("could not detect network",s.Logger.errors.NETWORK_E
1RROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return m.throwError("could not detect network",s.Logger.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new k(b,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:(0,n.deepCopy)(r),provider:this});const s=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(s&&this._cache[t])return this._cache[t];const o=(0,d.rd)(this.connection,JSON.stringify(r),v).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 s&&(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",[_(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[_(e.address),e.blockTag]];case"getCode":return["eth_getCode",[_(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[_(e.address),(0,l.hexZeroPad)(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[(0,n.getStatic)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,n.getStatic)(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=_(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return f(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&a.O$.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=(0,n.shallowCopy)(e)).transaction=(0,n.shallowCopy)(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&m.throwError(t+" not implemented",s.Logger.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(o){return y(t,o,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 N(1e3)}))}
1)).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=(0,n.shallowCopy)(x);if(e)for(const n in e)e[n]&&(r[n]=!0);(0,n.checkProperties)(t,r);const s={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=(0,l.hexValue)(a.O$.from(t[e]));"gasLimit"===e&&(e="gas"),s[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(s[e]=(0,l.hexlify)(t[e]))})),t.accessList&&(s.accessList=(0,h.accessListify)(t.accessList)),s}}var L=function(t,e,r,n){return new(r||(r=Promise))((function(s,o){function i(t){try{l(n.next(t))}catch(e){o(e)}}function a(t){try{l(n.throw(t))}catch(e){o(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(i,a)}l((n=n.apply(t,e||[])).next())}))};const P=new s.Logger(o.i);class O extends T{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return L(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||P.throwError("no network detected",s.Logger.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,n.defineReadOnly)(this,"_network",e),this.emit("network",e,null))),e}))}}}}]);

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.