{"version":3,"sources":["webpack:///./node_modules/web3-providers-http/lib/index.js","webpack:///./node_modules/web3-providers-ipc/lib/index.js","webpack:///./node_modules/web3-providers-ws/lib/index.js","webpack:///./node_modules/web3-providers-ws/lib/helpers.js"],"names":["errors","XHR2","XMLHttpRequest","http","https","HttpProvider","host","options","this","withCredentials","timeout","headers","agent","connected","keepAlive","substring","httpsAgent","Agent","httpAgent","prototype","_prepareRequest","request","agents","baseUrl","nodejsSet","open","setRequestHeader","forEach","header","name","value","send","payload","callback","_this","onreadystatechange","readyState","result","responseText","error","JSON","parse","e","InvalidResponse","ontimeout","ConnectionTimeout","stringify","InvalidConnection","disconnect","supportsSubscriptions","module","exports","oboe","IpcProvider","path","net","responseCallbacks","notificationCallbacks","connection","connect","addDefaultEvents","id","Array","isArray","load","method","indexOf","constructor","done","on","data","_parseResponse","toString","_timeout","returnValues","replace","split","lastChunk","clearTimeout","lastChunkTimeout","setTimeout","push","_addResponseCallback","key","hasOwnProperty","reconnect","writable","write","type","Error","once","removeListener","cb","index","splice","removeAllListeners","reset","EventEmitter","helpers","Ws","w3cwebsocket","WebsocketProvider","url","call","_customTimeout","protocol","reconnectOptions","Object","assign","auto","delay","maxAttempts","onTimeout","clientConfig","requestOptions","DATA","CLOSE","ERROR","CONNECT","RECONNECT","requestQueue","Map","responseQueue","reconnectAttempts","reconnecting","parsedURL","parseURL","username","password","authorization","btoa","auth","defineProperty","get","OPEN","enumerable","create","_addSocketListeners","_onMessage","emit","has","delete","_onConnect","size","_onClose","event","includes","code","wasClean","ConnectionNotOpenError","_removeSocketListeners","addEventListener","bind","removeEventListener","CONNECTING","set","clear","reason","close","PendingRequestsOnReconnectingError","MaxAttemptsReachedOnReconnectingError","isRN","navigator","product","_btoa","isNode","str","Buffer","from","URL","newURL","globalThis","self"],"mappings":"uGAuBA,IAAIA,EAAS,EAAQ,QAAqBA,OACtCC,EAAO,EAAQ,QAAgBC,eAC/BC,EAAO,EAAQ,QACfC,EAAQ,EAAQ,QAIhB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SAAUI,GAChB,OAAO,IAAImE,IAAInE,IAGvBpD,EAAOC,QAAU,CACb2E,SAAU5B,EACVgC,KAAMkC,K","file":"js/chunk-vendors~ab5ee495.3ae5952c.js","sourcesContent":["/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea\n * Fabian Vogelsteller \n * @date 2015\n */\nvar errors = require('web3-core-helpers').errors;\nvar XHR2 = require('xhr2-cookies').XMLHttpRequest; // jshint ignore: line\nvar http = require('http');\nvar https = require('https');\n/**\n * HttpProvider should be used to send rpc calls over http\n */\nvar HttpProvider = function HttpProvider(host, options) {\n options = options || {};\n this.withCredentials = options.withCredentials || false;\n this.timeout = options.timeout || 0;\n this.headers = options.headers;\n this.agent = options.agent;\n this.connected = false;\n // keepAlive is true unless explicitly set to false\n const keepAlive = options.keepAlive !== false;\n this.host = host || 'http://localhost:8545';\n if (!this.agent) {\n if (this.host.substring(0, 5) === \"https\") {\n this.httpsAgent = new https.Agent({ keepAlive });\n }\n else {\n this.httpAgent = new http.Agent({ keepAlive });\n }\n }\n};\nHttpProvider.prototype._prepareRequest = function () {\n var request;\n // the current runtime is a browser\n if (typeof XMLHttpRequest !== 'undefined') {\n request = new XMLHttpRequest();\n }\n else {\n request = new XHR2();\n var agents = { httpsAgent: this.httpsAgent, httpAgent: this.httpAgent, baseUrl: this.baseUrl };\n if (this.agent) {\n agents.httpsAgent = this.agent.https;\n agents.httpAgent = this.agent.http;\n agents.baseUrl = this.agent.baseUrl;\n }\n request.nodejsSet(agents);\n }\n request.open('POST', this.host, true);\n request.setRequestHeader('Content-Type', 'application/json');\n request.timeout = this.timeout;\n request.withCredentials = this.withCredentials;\n if (this.headers) {\n this.headers.forEach(function (header) {\n request.setRequestHeader(header.name, header.value);\n });\n }\n return request;\n};\n/**\n * Should be used to make async request\n *\n * @method send\n * @param {Object} payload\n * @param {Function} callback triggered on end with (err, result)\n */\nHttpProvider.prototype.send = function (payload, callback) {\n var _this = this;\n var request = this._prepareRequest();\n request.onreadystatechange = function () {\n if (request.readyState === 4 && request.timeout !== 1) {\n var result = request.responseText;\n var error = null;\n try {\n result = JSON.parse(result);\n }\n catch (e) {\n error = errors.InvalidResponse(request.responseText);\n }\n _this.connected = true;\n callback(error, result);\n }\n };\n request.ontimeout = function () {\n _this.connected = false;\n callback(errors.ConnectionTimeout(this.timeout));\n };\n try {\n request.send(JSON.stringify(payload));\n }\n catch (error) {\n this.connected = false;\n callback(errors.InvalidConnection(this.host));\n }\n};\nHttpProvider.prototype.disconnect = function () {\n //NO OP\n};\n/**\n * Returns the desired boolean.\n *\n * @method supportsSubscriptions\n * @returns {boolean}\n */\nHttpProvider.prototype.supportsSubscriptions = function () {\n return false;\n};\nmodule.exports = HttpProvider;\n","/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js. If not, see .\n*/\n/** @file index.js\n * @authors:\n * Fabian Vogelsteller \n * @date 2017\n */\n\"use strict\";\nvar errors = require('web3-core-helpers').errors;\nvar oboe = require('oboe');\nvar IpcProvider = function IpcProvider(path, net) {\n var _this = this;\n this.responseCallbacks = {};\n this.notificationCallbacks = [];\n this.path = path;\n this.connected = false;\n this.connection = net.connect({ path: this.path });\n this.addDefaultEvents();\n // LISTEN FOR CONNECTION RESPONSES\n var callback = function (result) {\n /*jshint maxcomplexity: 6 */\n var id = null;\n // get the id which matches the returned id\n if (Array.isArray(result)) {\n result.forEach(function (load) {\n if (_this.responseCallbacks[load.id])\n id = load.id;\n });\n }\n else {\n id = result.id;\n }\n // notification\n if (!id && result.method.indexOf('_subscription') !== -1) {\n _this.notificationCallbacks.forEach(function (callback) {\n if (typeof callback === 'function')\n callback(result);\n });\n // fire the callback\n }\n else if (_this.responseCallbacks[id]) {\n _this.responseCallbacks[id](null, result);\n delete _this.responseCallbacks[id];\n }\n };\n // use oboe.js for Sockets\n if (net.constructor.name === 'Socket') {\n oboe(this.connection)\n .done(callback);\n }\n else {\n this.connection.on('data', function (data) {\n _this._parseResponse(data.toString()).forEach(callback);\n });\n }\n};\n/**\nWill add the error and end event to timeout existing calls\n\n@method addDefaultEvents\n*/\nIpcProvider.prototype.addDefaultEvents = function () {\n var _this = this;\n this.connection.on('connect', function () {\n _this.connected = true;\n });\n this.connection.on('close', function () {\n _this.connected = false;\n });\n this.connection.on('error', function () {\n _this._timeout();\n });\n this.connection.on('end', function () {\n _this._timeout();\n });\n this.connection.on('timeout', function () {\n _this._timeout();\n });\n};\n/**\n Will parse the response and make an array out of it.\n\n NOTE, this exists for backwards compatibility reasons.\n\n @method _parseResponse\n @param {String} data\n */\nIpcProvider.prototype._parseResponse = function (data) {\n var _this = this, returnValues = [];\n // DE-CHUNKER\n var dechunkedData = data\n .replace(/\\}[\\n\\r]?\\{/g, '}|--|{') // }{\n .replace(/\\}\\][\\n\\r]?\\[\\{/g, '}]|--|[{') // }][{\n .replace(/\\}[\\n\\r]?\\[\\{/g, '}|--|[{') // }[{\n .replace(/\\}\\][\\n\\r]?\\{/g, '}]|--|{') // }]{\n .split('|--|');\n dechunkedData.forEach(function (data) {\n // prepend the last chunk\n if (_this.lastChunk)\n data = _this.lastChunk + data;\n var result = null;\n try {\n result = JSON.parse(data);\n }\n catch (e) {\n _this.lastChunk = data;\n // start timeout to cancel all requests\n clearTimeout(_this.lastChunkTimeout);\n _this.lastChunkTimeout = setTimeout(function () {\n _this._timeout();\n throw errors.InvalidResponse(data);\n }, 1000 * 15);\n return;\n }\n // cancel timeout and set chunk to null\n clearTimeout(_this.lastChunkTimeout);\n _this.lastChunk = null;\n if (result)\n returnValues.push(result);\n });\n return returnValues;\n};\n/**\nGet the adds a callback to the responseCallbacks object,\nwhich will be called if a response matching the response Id will arrive.\n\n@method _addResponseCallback\n*/\nIpcProvider.prototype._addResponseCallback = function (payload, callback) {\n var id = payload.id || payload[0].id;\n var method = payload.method || payload[0].method;\n this.responseCallbacks[id] = callback;\n this.responseCallbacks[id].method = method;\n};\n/**\nTimeout all requests when the end/error event is fired\n\n@method _timeout\n*/\nIpcProvider.prototype._timeout = function () {\n for (var key in this.responseCallbacks) {\n if (this.responseCallbacks.hasOwnProperty(key)) {\n this.responseCallbacks[key](errors.InvalidConnection('on IPC'));\n delete this.responseCallbacks[key];\n }\n }\n};\n/**\n Try to reconnect\n\n @method reconnect\n */\nIpcProvider.prototype.reconnect = function () {\n this.connection.connect({ path: this.path });\n};\nIpcProvider.prototype.send = function (payload, callback) {\n // try reconnect, when connection is gone\n if (!this.connection.writable)\n this.connection.connect({ path: this.path });\n this.connection.write(JSON.stringify(payload));\n this._addResponseCallback(payload, callback);\n};\n/**\nSubscribes to provider events.provider\n\n@method on\n@param {String} type 'notification', 'connect', 'error', 'end' or 'data'\n@param {Function} callback the callback to call\n*/\nIpcProvider.prototype.on = function (type, callback) {\n if (typeof callback !== 'function')\n throw new Error('The second parameter callback must be a function.');\n switch (type) {\n case 'data':\n this.notificationCallbacks.push(callback);\n break;\n // adds error, end, timeout, connect\n default:\n this.connection.on(type, callback);\n break;\n }\n};\n/**\n Subscribes to provider events.provider\n\n @method on\n @param {String} type 'connect', 'error', 'end' or 'data'\n @param {Function} callback the callback to call\n */\nIpcProvider.prototype.once = function (type, callback) {\n if (typeof callback !== 'function')\n throw new Error('The second parameter callback must be a function.');\n this.connection.once(type, callback);\n};\n/**\nRemoves event listener\n\n@method removeListener\n@param {String} type 'data', 'connect', 'error', 'end' or 'data'\n@param {Function} callback the callback to call\n*/\nIpcProvider.prototype.removeListener = function (type, callback) {\n var _this = this;\n switch (type) {\n case 'data':\n this.notificationCallbacks.forEach(function (cb, index) {\n if (cb === callback)\n _this.notificationCallbacks.splice(index, 1);\n });\n break;\n default:\n this.connection.removeListener(type, callback);\n break;\n }\n};\n/**\nRemoves all event listeners\n\n@method removeAllListeners\n@param {String} type 'data', 'connect', 'error', 'end' or 'data'\n*/\nIpcProvider.prototype.removeAllListeners = function (type) {\n switch (type) {\n case 'data':\n this.notificationCallbacks = [];\n break;\n default:\n this.connection.removeAllListeners(type);\n break;\n }\n};\n/**\nResets the providers, clears all callbacks\n\n@method reset\n*/\nIpcProvider.prototype.reset = function () {\n this._timeout();\n this.notificationCallbacks = [];\n this.connection.removeAllListeners('error');\n this.connection.removeAllListeners('end');\n this.connection.removeAllListeners('timeout');\n this.addDefaultEvents();\n};\n/**\n * Returns the desired boolean.\n *\n * @method supportsSubscriptions\n * @returns {boolean}\n */\nIpcProvider.prototype.supportsSubscriptions = function () {\n return true;\n};\nmodule.exports = IpcProvider;\n","/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js. If not, see .\n */\n/**\n * @file WebsocketProvider.js\n * @authors: Samuel Furter , Fabian Vogelsteller \n * @date 2019\n */\n'use strict';\nvar EventEmitter = require('eventemitter3');\nvar helpers = require('./helpers.js');\nvar errors = require('web3-core-helpers').errors;\nvar Ws = require('websocket').w3cwebsocket;\n/**\n * @param {string} url\n * @param {Object} options\n *\n * @constructor\n */\nvar WebsocketProvider = function WebsocketProvider(url, options) {\n EventEmitter.call(this);\n options = options || {};\n this.url = url;\n this._customTimeout = options.timeout || 1000 * 15;\n this.headers = options.headers || {};\n this.protocol = options.protocol || undefined;\n this.reconnectOptions = Object.assign({\n auto: false,\n delay: 5000,\n maxAttempts: false,\n onTimeout: false\n }, options.reconnect);\n this.clientConfig = options.clientConfig || undefined; // Allow a custom client configuration\n this.requestOptions = options.requestOptions || undefined; // Allow a custom request options (https://github.com/theturtle32/WebSocket-Node/blob/master/docs/WebSocketClient.md#connectrequesturl-requestedprotocols-origin-headers-requestoptions)\n this.DATA = 'data';\n this.CLOSE = 'close';\n this.ERROR = 'error';\n this.CONNECT = 'connect';\n this.RECONNECT = 'reconnect';\n this.connection = null;\n this.requestQueue = new Map();\n this.responseQueue = new Map();\n this.reconnectAttempts = 0;\n this.reconnecting = false;\n // The w3cwebsocket implementation does not support Basic Auth\n // username/password in the URL. So generate the basic auth header, and\n // pass through with any additional headers supplied in constructor\n var parsedURL = helpers.parseURL(url);\n if (parsedURL.username && parsedURL.password) {\n this.headers.authorization = 'Basic ' + helpers.btoa(parsedURL.username + ':' + parsedURL.password);\n }\n // When all node core implementations that do not have the\n // WHATWG compatible URL parser go out of service this line can be removed.\n if (parsedURL.auth) {\n this.headers.authorization = 'Basic ' + helpers.btoa(parsedURL.auth);\n }\n // make property `connected` which will return the current connection status\n Object.defineProperty(this, 'connected', {\n get: function () {\n return this.connection && this.connection.readyState === this.connection.OPEN;\n },\n enumerable: true\n });\n this.connect();\n};\n// Inherit from EventEmitter\nWebsocketProvider.prototype = Object.create(EventEmitter.prototype);\nWebsocketProvider.prototype.constructor = WebsocketProvider;\n/**\n * Connects to the configured node\n *\n * @method connect\n *\n * @returns {void}\n */\nWebsocketProvider.prototype.connect = function () {\n this.connection = new Ws(this.url, this.protocol, undefined, this.headers, this.requestOptions, this.clientConfig);\n this._addSocketListeners();\n};\n/**\n * Listener for the `data` event of the underlying WebSocket object\n *\n * @method _onMessage\n *\n * @returns {void}\n */\nWebsocketProvider.prototype._onMessage = function (e) {\n var _this = this;\n this._parseResponse((typeof e.data === 'string') ? e.data : '').forEach(function (result) {\n if (result.method && result.method.indexOf('_subscription') !== -1) {\n _this.emit(_this.DATA, result);\n return;\n }\n var id = result.id;\n // get the id which matches the returned id\n if (Array.isArray(result)) {\n id = result[0].id;\n }\n if (_this.responseQueue.has(id)) {\n if (_this.responseQueue.get(id).callback !== undefined) {\n _this.responseQueue.get(id).callback(false, result);\n }\n _this.responseQueue.delete(id);\n }\n });\n};\n/**\n * Listener for the `open` event of the underlying WebSocket object\n *\n * @method _onConnect\n *\n * @returns {void}\n */\nWebsocketProvider.prototype._onConnect = function () {\n this.emit(this.CONNECT);\n this.reconnectAttempts = 0;\n this.reconnecting = false;\n if (this.requestQueue.size > 0) {\n var _this = this;\n this.requestQueue.forEach(function (request, key) {\n _this.send(request.payload, request.callback);\n _this.requestQueue.delete(key);\n });\n }\n};\n/**\n * Listener for the `close` event of the underlying WebSocket object\n *\n * @method _onClose\n *\n * @returns {void}\n */\nWebsocketProvider.prototype._onClose = function (event) {\n var _this = this;\n if (this.reconnectOptions.auto && (![1000, 1001].includes(event.code) || event.wasClean === false)) {\n this.reconnect();\n return;\n }\n this.emit(this.CLOSE, event);\n if (this.requestQueue.size > 0) {\n this.requestQueue.forEach(function (request, key) {\n request.callback(errors.ConnectionNotOpenError(event));\n _this.requestQueue.delete(key);\n });\n }\n if (this.responseQueue.size > 0) {\n this.responseQueue.forEach(function (request, key) {\n request.callback(errors.InvalidConnection('on WS', event));\n _this.responseQueue.delete(key);\n });\n }\n this._removeSocketListeners();\n this.removeAllListeners();\n};\n/**\n * Will add the required socket listeners\n *\n * @method _addSocketListeners\n *\n * @returns {void}\n */\nWebsocketProvider.prototype._addSocketListeners = function () {\n this.connection.addEventListener('message', this._onMessage.bind(this));\n this.connection.addEventListener('open', this._onConnect.bind(this));\n this.connection.addEventListener('close', this._onClose.bind(this));\n};\n/**\n * Will remove all socket listeners\n *\n * @method _removeSocketListeners\n *\n * @returns {void}\n */\nWebsocketProvider.prototype._removeSocketListeners = function () {\n this.connection.removeEventListener('message', this._onMessage);\n this.connection.removeEventListener('open', this._onConnect);\n this.connection.removeEventListener('close', this._onClose);\n};\n/**\n * Will parse the response and make an array out of it.\n *\n * @method _parseResponse\n *\n * @param {String} data\n *\n * @returns {Array}\n */\nWebsocketProvider.prototype._parseResponse = function (data) {\n var _this = this, returnValues = [];\n // DE-CHUNKER\n var dechunkedData = data\n .replace(/\\}[\\n\\r]?\\{/g, '}|--|{') // }{\n .replace(/\\}\\][\\n\\r]?\\[\\{/g, '}]|--|[{') // }][{\n .replace(/\\}[\\n\\r]?\\[\\{/g, '}|--|[{') // }[{\n .replace(/\\}\\][\\n\\r]?\\{/g, '}]|--|{') // }]{\n .split('|--|');\n dechunkedData.forEach(function (data) {\n // prepend the last chunk\n if (_this.lastChunk)\n data = _this.lastChunk + data;\n var result = null;\n try {\n result = JSON.parse(data);\n }\n catch (e) {\n _this.lastChunk = data;\n // start timeout to cancel all requests\n clearTimeout(_this.lastChunkTimeout);\n _this.lastChunkTimeout = setTimeout(function () {\n if (_this.reconnectOptions.auto && _this.reconnectOptions.onTimeout) {\n _this.reconnect();\n return;\n }\n _this.emit(_this.ERROR, errors.ConnectionTimeout(_this._customTimeout));\n if (_this.requestQueue.size > 0) {\n _this.requestQueue.forEach(function (request, key) {\n request.callback(errors.ConnectionTimeout(_this._customTimeout));\n _this.requestQueue.delete(key);\n });\n }\n }, _this._customTimeout);\n return;\n }\n // cancel timeout and set chunk to null\n clearTimeout(_this.lastChunkTimeout);\n _this.lastChunk = null;\n if (result)\n returnValues.push(result);\n });\n return returnValues;\n};\n/**\n * Does check if the provider is connecting and will add it to the queue or will send it directly\n *\n * @method send\n *\n * @param {Object} payload\n * @param {Function} callback\n *\n * @returns {void}\n */\nWebsocketProvider.prototype.send = function (payload, callback) {\n var _this = this;\n var id = payload.id;\n var request = { payload: payload, callback: callback };\n if (Array.isArray(payload)) {\n id = payload[0].id;\n }\n if (this.connection.readyState === this.connection.CONNECTING || this.reconnecting) {\n this.requestQueue.set(id, request);\n return;\n }\n if (this.connection.readyState !== this.connection.OPEN) {\n this.requestQueue.delete(id);\n this.emit(this.ERROR, errors.ConnectionNotOpenError());\n request.callback(errors.ConnectionNotOpenError());\n return;\n }\n this.responseQueue.set(id, request);\n this.requestQueue.delete(id);\n try {\n this.connection.send(JSON.stringify(request.payload));\n }\n catch (error) {\n request.callback(error);\n _this.responseQueue.delete(id);\n }\n};\n/**\n * Resets the providers, clears all callbacks\n *\n * @method reset\n *\n * @returns {void}\n */\nWebsocketProvider.prototype.reset = function () {\n this.responseQueue.clear();\n this.requestQueue.clear();\n this.removeAllListeners();\n this._removeSocketListeners();\n this._addSocketListeners();\n};\n/**\n * Closes the current connection with the given code and reason arguments\n *\n * @method disconnect\n *\n * @param {number} code\n * @param {string} reason\n *\n * @returns {void}\n */\nWebsocketProvider.prototype.disconnect = function (code, reason) {\n this._removeSocketListeners();\n this.connection.close(code || 1000, reason);\n};\n/**\n * Returns the desired boolean.\n *\n * @method supportsSubscriptions\n *\n * @returns {boolean}\n */\nWebsocketProvider.prototype.supportsSubscriptions = function () {\n return true;\n};\n/**\n * Removes the listeners and reconnects to the socket.\n *\n * @method reconnect\n *\n * @returns {void}\n */\nWebsocketProvider.prototype.reconnect = function () {\n var _this = this;\n this.reconnecting = true;\n if (this.responseQueue.size > 0) {\n this.responseQueue.forEach(function (request, key) {\n request.callback(errors.PendingRequestsOnReconnectingError());\n _this.responseQueue.delete(key);\n });\n }\n if (!this.reconnectOptions.maxAttempts ||\n this.reconnectAttempts < this.reconnectOptions.maxAttempts) {\n setTimeout(function () {\n _this.reconnectAttempts++;\n _this._removeSocketListeners();\n _this.emit(_this.RECONNECT, _this.reconnectAttempts);\n _this.connect();\n }, this.reconnectOptions.delay);\n return;\n }\n this.emit(this.ERROR, errors.MaxAttemptsReachedOnReconnectingError());\n this.reconnecting = false;\n if (this.requestQueue.size > 0) {\n this.requestQueue.forEach(function (request, key) {\n request.callback(errors.MaxAttemptsReachedOnReconnectingError());\n _this.requestQueue.delete(key);\n });\n }\n};\nmodule.exports = WebsocketProvider;\n","var isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';\nvar isRN = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';\nvar _btoa = null;\nvar helpers = null;\nif (isNode || isRN) {\n _btoa = function (str) {\n return Buffer.from(str).toString('base64');\n };\n var url = require('url');\n if (url.URL) {\n // Use the new Node 6+ API for parsing URLs that supports username/password\n var newURL = url.URL;\n helpers = function (url) {\n return new newURL(url);\n };\n }\n else {\n // Web3 supports Node.js 5, so fall back to the legacy URL API if necessary\n helpers = require('url').parse;\n }\n}\nelse {\n _btoa = btoa.bind(typeof globalThis === 'object' ? globalThis : self);\n helpers = function (url) {\n return new URL(url);\n };\n}\nmodule.exports = {\n parseURL: helpers,\n btoa: _btoa\n};\n"],"sourceRoot":""}