PageSourceSearch

https://llamaland.io/libs/web3wallet.min.js

js llamaland.io collected 2026-10-09 02:46:28 UTC 31,277 bytes, 1 lines download raw bytes

1!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n,r=e();for(n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(self,function(){return(()=>{"use strict";var r={480:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ChainParameter=void 0,e.ChainParameter=function(){}},860:(t,e)=>{function n(t,e,n,r,i,o){this.name=t,this.method=e,this.role=n,this.confirmCallback=r,this.rejectCallback=i,this.errorCallback=o}Object.defineProperty(e,"__esModule",{value:!0}),e.ContractRequest=void 0,n.prototype.getName=function(){return this.name},n.prototype.getMethod=function(){return this.method},n.prototype.getRole=function(){return this.role},n.prototype.send=function(t){console.debug("Implements the contract ".concat(this.name,".").concat(this.method," by ").concat(t))},n.prototype.handleResponse=function(t,e){t||(this.confirmCallback&&this.confirmCallback(),console.log("Request ".concat(this.name," with method ").concat(this.method," is success")))},n.prototype.handleError=function(t){t.code!=n.CODE_USER_REJECTED_REQUEST?this.errorCallback&&this.errorCallback(t):this.rejectCallback&&this.rejectCallback()},n.CODE_USER_REJECTED_REQUEST=4001,e.ContractRequest=n},414:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventData=void 0,e.EventData=function(t,e){this.contractName=t,this.method=e}},895:function(t,e,n){var r=this&&this.__awaiter||function(t,s,c,a){return new(c=c||Promise)(function(n,e){function r(t){try{o(a.next(t))}catch(t){e(t)}}function i(t){try{o(a.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof c?e:new c(function(t){t(e)})).then(r,i)}o((a=a.apply(t,s||[])).next())})},i=this&&this.__generator||function(r,i){var o,s,c,a={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(c=2&e[0]?s.return:e[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,e[1])).done)return c;switch(s=0,(e=c?[2&e[0],c.value]:e)[0]){case 0:case 1:c=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(c=0<(c=a.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){a.label=e[1];break}if(6===e[0]&&a.label<c[1]){a.label=c[1],c=e;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(e);break}c[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(r,a)}catch(t){e=[6,t],s=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},o=(Object.defineProperty(e,"__esModule",{value:!0}),e.EventRecovery=void 0,n(414));function s(t){this.sender=t,this.eventList=new Array}s.prototype.registerEvent=function(t,e){for(var n=0;n<this.eventList.length;n++){var r=this.eventList[n];if(r.contractName==t&&r.method==e)return}var i=new o.EventData(t,e);this.eventList.push(i)},s.prototype.recover=function(t){if(this.blockNumber){for(var e={fromBlock:this.blockNumber,toBlock:"latest"},n=0;n<this.eventList.length;n++){var r=this.eventList[n];this.sender.getPastEvents(r.contractName,r.method,e,t)}this.blockNumber=void 0}},s.prototype.hold=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,(e=this).sender.getBlockNumber()];case 1:return e.blockNumber=t.sent(),[2]}})})},e.EventRecovery=s},676:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},556:(t,e)=>{function n(){}function r(){}function i(){}Object.defineProperty(e,"__esModule",{value:!0}),e.Web3Role=e.ReceiverErrorCode=e.Web3Event=void 0,n.DETECT_PROVIDER="DETECT_PROVIDER",n.CHANGE_CHAIN="CHANGE_CHAIN",n.CHANGE_ACCOUNT="CHANGE_ACCOUNT",n.ERROR_REQUESTED_ACCOUNT="ERROR_REQUESTED_ACCOUNT",n.HANDLE_EVENT="HANDLE_EVENT",n.RECEIVER_CONNECTED="RECEIVER_CONNECTED",n.RECEIVER_ERROR="RECEIVER_ERROR",n.RECEIVER_CLOSE="RECEIVER_CLOSE",n.RECEIVER_RECONNECT="RECEIVER_RECONNECT",n.HANDLE_ERROR="HANDLE_ERROR",e.Web3Event=n,r.MaxAttemptsReachedOnReconnectingError="Maximum number of reconnect attempts reached!",e.ReceiverErrorCode=r,i.Sender="Sender",i.Receiver="Receiver",e.Web3Role=i},868:function(t,e,n){var c=this&&this.__awaiter||function(t,s,c,a){return new(c=c||Promise)(function(n,e){function r(t){try{o(a.next(t))}catch(t){e(t)}}function i(t){try{o(a.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof c?e:new c(function(t){t(e)})).then(r,i)}o((a=a.apply(t,s||[])).next())})},a=this&&this.__generator||function(r,i){var o,s,c,a={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(c=2&e[0]?s.return:e[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,e[1])).done)return c;switch(s=0,(e=c?[2&e[0],c.value]:e)[0]){case 0:case 1:c=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(c=0<(c=a.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){a.label=e[1];break}if(6===e[0]&&a.label<c[1]){a.label=c[1],c=e;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(e);break}c[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(r,a)}catch(t){e=[6,t],s=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}
1,r=(Object.defineProperty(e,"__esModule",{value:!0}),e.PollingEventManager=void 0,n(178)),i=n(556);function o(t,e){this.adapter=t,this.listener=e,this.pollingMap=new r.TSMap}o.prototype.startPollingEvent=function(e,n,r){var i=this;void 0===r&&(r=5e3),this.stopPollingEvent(n),this.adapter.getBlockNumber().then(function(t){i.pollingEvent(e,n,t,r)})},o.prototype.stopPollingEvent=function(t){var e=this.pollingMap.get(t);return!!e&&(clearTimeout(e),this.pollingMap.delete(t),!0)},o.prototype.pollingEvent=function(n,r,i,o){var s=this,t={fromBlock:i,toBlock:"latest"};this.adapter.getPastEvents(n,r,t,function(t,e){t||(s.handleAllEvents(e),0<e.length&&(i=e[e.length-1].blockNumber+1));t=setTimeout(function(){return c(s,void 0,void 0,function(){return a(this,function(t){return this.pollingEvent(n,r,i,o),[2]})})},o);s.pollingMap.set(r,t)})},o.prototype.handleAllEvents=function(t){var e=this;t&&t.forEach(function(t){e.listener.on(i.Web3Event.HANDLE_EVENT,t)})},e.PollingEventManager=o},289:function(t,e,n){var r=this&&this.__awaiter||function(t,s,c,a){return new(c=c||Promise)(function(n,e){function r(t){try{o(a.next(t))}catch(t){e(t)}}function i(t){try{o(a.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof c?e:new c(function(t){t(e)})).then(r,i)}o((a=a.apply(t,s||[])).next())})},i=this&&this.__generator||function(r,i){var o,s,c,a={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(c=2&e[0]?s.return:e[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,e[1])).done)return c;switch(s=0,(e=c?[2&e[0],c.value]:e)[0]){case 0:case 1:c=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(c=0<(c=a.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){a.label=e[1];break}if(6===e[0]&&a.label<c[1]){a.label=c[1],c=e;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(e);break}c[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(r,a)}catch(t){e=[6,t],s=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},o=(Object.defineProperty(e,"__esModule",{value:!0}),e.Web3Wallet=void 0,n(556)),s=n(645);function c(t,e){this.sender=t,this.receiver=e,this.MAX_ERROR_COUNT=1,this.MAX_RETRY_COUNT=0,this.roleContractMap=new s.TSMap,this.roleAdapterMap=new s.TSMap,this.roleAdapterMap.set(o.Web3Role.Sender,t),this.roleAdapterMap.set(o.Web3Role.Receiver,e),this.errorCount=0,this.retryCount=0,this.reconnectCount=0,this.handleAdapterEvents()}c.prototype.setChainParameter=function(t){this.chainParam=t},c.prototype.connect=function(){return r(this,void 0,void 0,function(){var e,n,r;return i(this,function(t){switch(t.label){case 0:if(!this.chainParam)throw new Error("Chain parameter is not exist");return this.initListener(),this.sender.detectProvider()&&this.receiver.detectProvider()?[4,this.sender.isLogin()]:[2,c.PROVIDER_NOT_EXIST];case 1:return(e=!t.sent())?[3,3]:[4,this.receiver.isLogin()];case 2:e=!t.sent(),t.label=3;case 3:return e&&this.dispatchEvent(c.NOT_CONNECTED),n=this.chainParam.rpcUrls,this.sender.checkRPCUrl(n)&&this.receiver.checkRPCUrl(n)?[4,this.sender.requestChain()]:[2,c.NOT_SET_WS_RPC_URLS];case 4:return n=t.sent(),[4,this.checkChainId(n)];case 5:return t.sent(),[4,this.sender.isConnected()];case 6:return(r=!t.sent())?[3,8]:[4,this.receiver.isConnected()];case 7:r=!t.sent(),t.label=8;case 8:return r?[2,c.ACCOUNTS_NOT_EXIST]:(this.initWeb3(),[2,c.CONNECTED])}})})},c.prototype.initListener=function(){var n=this;this.roleAdapterMap.forEach(function(t,e){t.setListener(n)})},c.prototype.initWeb3=function(){var n=this;this.changeRPCUrl(),this.roleAdapterMap.forEach(function(t,e){t.setRPCUrl(n.curRPCUrl),t.initWeb3()})},c.prototype.checkChainId=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e===this.chainParam.chainId?[2]:[4,this.sender.switchChain(this.chainParam.chainId).catch(this.onCatchSwitchChain.bind(this))];case 1:return t.sent(),[2]}})})},c.prototype.onCatchSwitchChain=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return 4902!==e.code?[2]:[4,this.sender.addChain(this.chainParam)];case 1:return t.sent(),[2]}})})},c.prototype.setContract=function(t,e,n){this.createContract(t,e,n,o.Web3Role.Sender),this.createContract(t,e,n,o.Web3Role.Receiver)},c.prototype.createContract=function(t,e,n,r){var i=this.roleAdapterMap.get(r),o=(o=this.roleContractMap.get(r))||new s.TSMap,i=i.createContract(e,n,r);if(!i)throw new Error("Failed creating: ".concat(t,", role: ").concat(r));o.set(t,i),this.roleContractMap.set(r,o)},c.prototype.getContract=function(t,e){e=this.roleContractMap.get(e);if(e)return e.get(t)},c.prototype.getAccounts=function(){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.sender.getAccounts()];case 1:return[2,t.sent()]}})})},c.prototype.isConnected=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.sender.getAccounts()];case 1:return[2,(e=t.sent())&&0<e.length]}})})},c.prototype.setListener=function(t){this.listener=t},c.prototype.on=function(t,e){var n=this.eventMap.get(t);n?n(e):console.warn("event ".concat(t," not define"))},c.prototype.dispatchEvent=function(t,e){this.listener&&this.listener.on(t,e)},c.prototype.getBalance=function(n){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.sender.getBalance(n)];case 1:return[2,void 0===(e=t.sent())?"0":e]}})})},c.prototype.getBlockNumber=function(){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.sender.getBlockNumber()];case 1:return[2,t.sent()]}})})},c.prototype.getTransaction=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.sender.getTransaction(e)];case 1:return[2,t.sent()]}})})},c.prototype.getTransactionReceipt=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.sender.getTransactionReceipt(e)
1];case 1:return[2,t.sent()]}})})},c.prototype.registerEvent=function(t,e,n){void 0===n&&(n={});t=this.getContract(t,o.Web3Role.Receiver);return!!t&&(this.roleAdapterMap.get(o.Web3Role.Receiver).registerEvent(t,e,n),!0)},c.prototype.handleEvent=function(t){var e=t.event;this.dispatchEvent(e,t)},c.prototype.handleError=function(t){this.dispatchEvent(c.EV_RESPONSE_ERROR,t)},c.prototype.registerAllEvents=function(t,e){return this.registerEvent(t,"allEvents",e=void 0===e?{}:e)},c.prototype.getPastEvents=function(t,e,n,r){t=this.getContract(t,o.Web3Role.Receiver);return!!t&&(this.roleAdapterMap.get(o.Web3Role.Receiver).getPastEvents(t,e,n,r),!0)},c.prototype.send=function(t){var e=t.getRole(),n=t.getName(),n=this.getContract(n,e);return!!n&&(t.send(n),!0)},c.prototype.handleAdapterEvents=function(){this.eventMap=new s.TSMap,this.eventMap.set(o.Web3Event.RECEIVER_CONNECTED,this.onReceiverConnect.bind(this)),this.eventMap.set(o.Web3Event.RECEIVER_ERROR,this.onReceiverError.bind(this)),this.eventMap.set(o.Web3Event.RECEIVER_CLOSE,this.onReceiverClose.bind(this)),this.eventMap.set(o.Web3Event.HANDLE_EVENT,this.handleEvent.bind(this)),this.eventMap.set(o.Web3Event.HANDLE_ERROR,this.handleError.bind(this)),this.eventMap.set(o.Web3Event.CHANGE_CHAIN,this.onChangeChain.bind(this)),this.eventMap.set(o.Web3Event.CHANGE_ACCOUNT,this.onChangeAccount.bind(this)),this.eventMap.set(o.Web3Event.RECEIVER_RECONNECT,this.onReceiverReconnect.bind(this))},c.prototype.onReceiverConnect=function(){this.errorCount=0,this.retryCount=0;var e,t=this.roleContractMap.get(o.Web3Role.Receiver),t=(t&&(e=this.roleAdapterMap.get(o.Web3Role.Receiver).getProvider(),t.forEach(function(t){t.setProvider(e)})),0<this.reconnectCount);this.dispatchEvent(c.RECEIVER_CONNECTED,t),this.reconnectCount=0},c.prototype.onReceiverError=function(t){this.errorCount++;var e=this.roleAdapterMap.get(o.Web3Role.Receiver);this.isFatalError(t)?(this.reconnectCount=0,this.changeRPCUrl(),e.setRPCUrl(this.curRPCUrl),e.initWeb3(),this.errorCount=0):this.errorCount>=this.MAX_ERROR_COUNT&&(e.disconnect(),this.errorCount=0)},c.prototype.isFatalError=function(t){return!(!t||!t.message)&&t.message==o.ReceiverErrorCode.MaxAttemptsReachedOnReconnectingError},c.prototype.onReceiverClose=function(){var t=this.roleAdapterMap.get(o.Web3Role.Receiver);this.retryCount++,this.retryCount>=this.MAX_RETRY_COUNT?(this.changeRPCUrl(),t.setRPCUrl(this.curRPCUrl),t.initWeb3(),this.retryCount=0):t.connect(),this.dispatchEvent(c.RECEIVER_CONNECTING)},c.prototype.onReceiverReconnect=function(t){this.reconnectCount=t,this.dispatchEvent(c.RECEIVER_CONNECTING,t)},c.prototype.getWSUrls=function(){if(this.chainParam.rpcUrls)return this.chainParam.rpcUrls.filter(function(t){return-1<t.indexOf("wss")})},c.prototype.changeRPCUrl=function(){var t,e=this.getWSUrls();!e||e.length<1||(t=(t=e.indexOf(this.curRPCUrl))==e.length-1?0:++t,this.curRPCUrl=t>=e.length?e[0]:e[t])},c.prototype.onChangeChain=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return this.dispatchEvent(c.CHANGE_CHAIN,e),[4,this.checkChainId(e)];case 1:return t.sent(),[2]}})})},c.prototype.onChangeAccount=function(t){this.dispatchEvent(c.CHANGE_ACCOUNT,t)},c.prototype.watchBalance=function(t,e,n,r){var i=this;return!!this.watchInterval||(this.watchInterval=setInterval(function(){i.getBalance(t).then(function(t){r(t)})},e),this.watchTimeout=setTimeout(function(){i.clearWatchInterval(),i.watchTimeout=void 0},n),!1)},c.prototype.stopWatchBalance=function(){this.clearWatchInterval(),this.watchTimeout&&(clearTimeout(this.watchTimeout),this.watchTimeout=void 0)},c.prototype.clearWatchInterval=function(){this.watchInterval&&(clearInterval(this.watchInterval),this.watchInterval=void 0)},c.CONNECTED="CONNECTED",c.NOT_CONNECTED="NOT_CONNECTED",c.PROVIDER_NOT_EXIST="PROVIDER_NOT_EXIST",c.ACCOUNTS_NOT_EXIST="ACCOUNTS_NOT_EXIST",c.NOT_SET_WS_RPC_URLS="NOT_SET_WS_RPC_URLS",c.EV_WEB3_ERROR="EV_WEB3_ERROR",c.EV_RESPONSE_ERROR="EV_RESPONSE_ERROR",c.RECEIVER_CONNECTED="RECEIVER_CONNECTED",c.RECEIVER_CONNECTING="RECEIVER_CONNECTING",c.CHANGE_CHAIN=o.Web3Event.CHANGE_CHAIN,c.CHANGE_ACCOUNT=o.Web3Event.CHANGE_ACCOUNT,e.Web3Wallet=c},109:function(u,t,e){var o=this&&this.__awaiter||function(t,s,c,a){return new(c=c||Promise)(function(n,e){function r(t){try{o(a.next(t))}catch(t){e(t)}}function i(t){try{o(a.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof c?e:new c(function(t){t(e)})).then(r,i)}o((a=a.apply(t,s||[])).next())})},s=this&&this.__generator||function(r,i){var o,s,c,a={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(c=2&e[0]?s.return:e[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,e[1])).done)return c;switch(s=0,(e=c?[2&e[0],c.value]:e)[0]){case 0:case 1:c=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(c=0<(c=a.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){a.label=e[1];break}if(6===e[0]&&a.label<c[1]){a.label=c[1],c=e;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(e);break}c[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(r,a)}catch(t){e=[6,t],s=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}
1,n=(Object.defineProperty(t,"__esModule",{value:!0}),t.MetaMask=void 0,e(556)),r=e(868),i=window.Web3,c=window.ethereum;function a(){}a.prototype.detectProvider=function(){return c},a.prototype.initWeb3=function(){c.on("accountsChanged",this.on.bind(this,n.Web3Event.CHANGE_ACCOUNT)),c.on("chainChanged",this.on.bind(this,n.Web3Event.CHANGE_CHAIN)),this.web3=new i(c),this.pollingEventManager=new r.PollingEventManager(this,this.listener)},a.prototype.requestAccounts=function(){return o(this,void 0,void 0,function(){var e=this;return s(this,function(t){return[2,c.request({method:"eth_requestAccounts"}).then(function(t){return e.on(n.Web3Event.CHANGE_ACCOUNT,t),t}).catch(function(t){return t})]})})},a.prototype.setListener=function(t){this.listener=t},a.prototype.on=function(t,e){this.listener&&this.listener.on.call(this.listener,t,e)},a.prototype.requestChain=function(){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,c.request({method:"eth_chainId"})];case 1:return[2,t.sent()]}})})},a.prototype.getAccounts=function(){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,c.request({method:"eth_accounts"})];case 1:return[2,t.sent()]}})})},a.prototype.switchChain=function(i){return new Promise(function(n,r){return o(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,c.request({method:"wallet_switchEthereumChain",params:[{chainId:i}]})];case 1:return e=t.sent(),n(e),[3,3];case 2:return e=t.sent(),r(e),[3,3];case 3:return[2]}})})})},a.prototype.addChain=function(i){return new Promise(function(n,r){return o(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,c.request({method:"wallet_addEthereumChain",params:[i]})];case 1:return e=t.sent(),n(e),[3,3];case 2:return e=t.sent(),r(e),[3,3];case 3:return[2]}})})})},a.prototype.createContract=function(t,e,n){return new this.web3.eth.Contract(t,e)},a.prototype.getBalance=function(e){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getBalance(e)];case 1:return[2,t.sent()]}})})},a.prototype.getBlockNumber=function(){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getBlockNumber()];case 1:return[2,t.sent()]}})})},a.prototype.getTransaction=function(e){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getTransaction(e)];case 1:return[2,t.sent()]}})})},a.prototype.getTransactionReceipt=function(e){return o(this,void 0,void 0,function(){return s(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getTransactionReceipt(e)];case 1:return[2,t.sent()]}})})},a.prototype.setRPCUrl=function(t){},a.prototype.connect=function(){},a.prototype.disconnect=function(){},a.prototype.getProvider=function(){if(this.web3)return this.web3.currentProvider},a.prototype.getPastEvents=function(t,e,n,r){t.getPastEvents(e,n,r)},a.prototype.registerEvent=function(t,e,n){this.pollingEventManager.startPollingEvent(t,e,5e3|n.interval)},a.prototype.checkRPCUrl=function(t){return!0},a.prototype.isConnected=function(){return o(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return[4,this.requestAccounts()];case 1:return[2,(e=t.sent())&&0<e.length]}})})},a.prototype.isLogin=function(){return o(this,void 0,void 0,function(){var e;return s(this,function(t){switch(t.label){case 0:return[4,this.getAccounts()];case 1:return[2,(e=t.sent())&&0<e.length]}})})},t.MetaMask=a},687:function(t,e,n){var r=this&&this.__awaiter||function(t,s,c,a){return new(c=c||Promise)(function(n,e){function r(t){try{o(a.next(t))}catch(t){e(t)}}function i(t){try{o(a.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof c?e:new c(function(t){t(e)})).then(r,i)}o((a=a.apply(t,s||[])).next())})},i=this&&this.__generator||function(r,i){var o,s,c,a={label:0,sent:function(){if(1&c[0])throw c[1];return c[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(n){return function(t){var e=[n,t];if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,s&&(c=2&e[0]?s.return:e[0]?s.throw||((c=s.return)&&c.call(s),0):s.next)&&!(c=c.call(s,e[1])).done)return c;switch(s=0,(e=c?[2&e[0],c.value]:e)[0]){case 0:case 1:c=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(c=0<(c=a.trys).length&&c[c.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!c||e[1]>c[0]&&e[1]<c[3])){a.label=e[1];break}if(6===e[0]&&a.label<c[1]){a.label=c[1],c=e;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(e);break}c[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(r,a)}catch(t){e=[6,t],s=0}finally{o=c=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}
1,o=(Object.defineProperty(e,"__esModule",{value:!0}),e.WebsocketProvider=void 0,n(556)),s=window.Web3;function c(t){this.option=t}c.prototype.detectProvider=function(){return!0},c.prototype.initWeb3=function(){this.unregisterProviderEvent(),this.provider=new s.providers.WebsocketProvider(this.rpcUrl,this.option),this.web3=new s(this.provider),this.registerProviderEvent()},c.prototype.registerProviderEvent=function(){var t=this.getProvider();t&&(t.on("connect",this.onReceiverConnect.bind(this)),t.on("error",this.onReceiverError.bind(this)),t.on("close",this.onReceiverClose.bind(this)),t.on("reconnect",this.onReceiverReconnect.bind(this)))},c.prototype.unregisterProviderEvent=function(){var t=this.getProvider();t&&(t.off("connect",this.onReceiverConnect.bind(this)),t.off("error",this.onReceiverError.bind(this)),t.off("close",this.onReceiverClose.bind(this)),t.off("reconnect",this.onReceiverReconnect.bind(this)))},c.prototype.onReceiverConnect=function(){this.on(o.Web3Event.RECEIVER_CONNECTED)},c.prototype.onReceiverError=function(t){console.error("Receiver error",t),this.on(o.Web3Event.RECEIVER_ERROR,t)},c.prototype.onReceiverClose=function(t){console.error("Receiver close",t),this.on(o.Web3Event.RECEIVER_CLOSE,t)},c.prototype.onReceiverReconnect=function(t){console.warn("Receiver reconnect",t),this.on(o.Web3Event.RECEIVER_RECONNECT,t)},c.prototype.requestAccounts=function(){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getAccounts()];case 1:return[2,t.sent()]}})})},c.prototype.setListener=function(t){this.listener=t},c.prototype.on=function(t,e){this.listener&&this.listener.on.call(this.listener,t,e)},c.prototype.requestChain=function(){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getChainId()];case 1:return[2,t.sent()]}})})},c.prototype.getAccounts=function(){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getAccounts()];case 1:return[2,t.sent()]}})})},c.prototype.switchChain=function(t){},c.prototype.addChain=function(t){},c.prototype.createContract=function(t,e,n){return new this.web3.eth.Contract(t,e)},c.prototype.getBalance=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getBalance(e)];case 1:return[2,t.sent()]}})})},c.prototype.getBlockNumber=function(){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getBlockNumber()];case 1:return[2,t.sent()]}})})},c.prototype.getTransaction=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getTransaction(e)];case 1:return[2,t.sent()]}})})},c.prototype.getTransactionReceipt=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,this.web3.eth.getTransactionReceipt(e)];case 1:return[2,t.sent()]}})})},c.prototype.setRPCUrl=function(t){this.rpcUrl=t},c.prototype.connect=function(){var t=this.getProvider();t&&(t.connect(),this.registerProviderEvent())},c.prototype.disconnect=function(){var t=this.getProvider();t&&(t.connected&&t.disconnect(),this.unregisterProviderEvent())},c.prototype.getProvider=function(){return this.provider},c.prototype.getPastEvents=function(t,e,n,r){t.getPastEvents(e,n,r)},c.prototype.handelEvent=function(t,e){t?this.on(o.Web3Event.HANDLE_ERROR,t):this.on(o.Web3Event.HANDLE_EVENT,e)},c.prototype.registerEvent=function(t,e,n){t.events[e](n,this.handelEvent.bind(this))},c.prototype.checkRPCUrl=function(t){if(!t)return!1;t=t.filter(function(t){return-1<t.indexOf("wss")});return t&&0<t.length},c.prototype.isConnected=function(){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,!0]})})},c.prototype.isLogin=function(){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,!0]})})},e.WebsocketProvider=c},579:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){t[r=void 0===r?n:r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};
1Object.defineProperty(e,"__esModule",{value:!0}),i(n(109),e),i(n(687),e)},56:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){t[r=void 0===r?n:r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(579),e),i(n(178),e),i(n(480),e),i(n(860),e),i(n(414),e),i(n(895),e),i(n(676),e),i(n(556),e),i(n(868),e),i(n(289),e)},645:(t,e)=>{function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){var n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(function(t,e){n.set(t[0],t[1])})}Object.defineProperty(e,"__esModule",{value:!0}),e.TSMap=void 0,s.prototype.fromJSON=function(e,n){function r(t){return null!==t&&"object"===o(t)&&n?(new s).fromJSON(t,!0):Array.isArray(t)&&n?t.map(r):t}var i=this;return Object.keys(e).forEach(function(t){e.hasOwnProperty(t)&&i.set(t,r(e[t]))}),i},s.prototype.toJSON=function(){function e(t){return t instanceof s?t.toJSON():Array.isArray(t)?t.map(e):t}var n={},r=this;return r.keys().forEach(function(t){n[String(t)]=e(r.get(t))}),n},s.prototype.entries=function(){var e=this;return[].slice.call(this.keys().map(function(t){return[t,e.get(t)]}))},s.prototype.keys=function(){return[].slice.call(this._keys)},s.prototype.values=function(){return[].slice.call(this._values)},s.prototype.has=function(t){return-1<this._keys.indexOf(t)},s.prototype.get=function(t){t=this._keys.indexOf(t);return-1<t?this._values[t]:void 0},s.prototype.deepGet=function(t){return t&&t.length?function t(e,n){return null==e?null:n.length?t(e instanceof s?e.get(n[0]):e[n[0]],n.slice(1)):e}(this.get(t[0]),t.slice(1)):null},s.prototype.set=function(t,e){var n=this,r=this._keys.indexOf(t);return-1<r?n._values[r]=e:(n._keys.push(t),n._values.push(e),n.length=n._values.length),this},s.prototype.sortedSet=function(t,e,n,r){var i=this._keys.length,n=n||0,r=void 0!==r?r:i-1;if(0==i)return this._keys.push(t),this._values.push(e),this;if(t==this._keys[n])return this._values.splice(n,0,e),this;if(t==this._keys[r])return this._values.splice(r,0,e),this;if(t>this._keys[r])return this._keys.splice(r+1,0,t),this._values.splice(r+1,0,e),this;if(t<this._keys[n])return this._values.splice(n,0,e),this._keys.splice(n,0,t),this;if(r<=n)return this;i=n+Math.floor((r-n)/2);return t<this._keys[i]?this.sortedSet(t,e,n,i-1):t>this._keys[i]?this.sortedSet(t,e,i+1,r):this},s.prototype.size=function(){return this.length},s.prototype.clear=function(){return this._keys.length=this.length=this._values.length=0,this},s.prototype.delete=function(t){var e=this,t=e._keys.indexOf(t);return-1<t&&(e._keys.splice(t,1),e._values.splice(t,1),e.length=e._keys.length,!0)},s.prototype.forEach=function(n){var r=this;this._keys.forEach(function(t,e){n(r.get(t),t,e)})},s.prototype.map=function(n){var r=this;return this.keys().map(function(t,e){return n(r.get(t),t,e)})},s.prototype.filter=function(n){var r=this;return r._keys.forEach(function(t,e){!1===n(r.get(t),t,e)&&r.delete(t)}),this},s.prototype.clone=function(){return new s(this.entries())},e.TSMap=s},178:function(t,e,n){var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){t[r=void 0===r?n:r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(645),e)}},i={};return function t(e){var n=i[e];if(void 0!==n)return n.exports;n=i[e]={exports:{}};return r[e].call(n.exports,n,n.exports,t),n.exports}(56)})()});

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.