2020-03-12 21:14:50 +03:00
|
|
|
"use strict";
|
|
|
|
import { Logger } from "@ethersproject/logger";
|
|
|
|
import { version } from "./_version";
|
2020-04-18 12:14:55 +03:00
|
|
|
let WS = null;
|
|
|
|
try {
|
|
|
|
WS = WebSocket;
|
|
|
|
if (WS == null) {
|
|
|
|
throw new Error("inject please");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (error) {
|
2020-03-12 21:14:50 +03:00
|
|
|
const logger = new Logger(version);
|
|
|
|
WS = function () {
|
|
|
|
logger.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, {
|
|
|
|
operation: "new WebSocket()"
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
2020-11-17 07:07:24 +03:00
|
|
|
//export default WS;
|
|
|
|
//module.exports = WS;
|
|
|
|
export { WS as WebSocket };
|
|
|
|
//# sourceMappingURL=ws.js.map
|