-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added initial WebSocketProvider (#141).
- Loading branch information
Showing
10 changed files
with
367 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"author": "Richard Moore <[email protected]>", | ||
"browser": { | ||
"./ipc-provider": "./lib/browser-ipc-provider.js", | ||
"ws": "./lib/browser-ws.js", | ||
"net": "./lib/browser-net.js" | ||
}, | ||
"dependencies": { | ||
|
@@ -19,7 +20,8 @@ | |
"@ethersproject/rlp": ">=5.0.0-beta.126", | ||
"@ethersproject/strings": ">=5.0.0-beta.130", | ||
"@ethersproject/transactions": ">=5.0.0-beta.128", | ||
"@ethersproject/web": ">=5.0.0-beta.129" | ||
"@ethersproject/web": ">=5.0.0-beta.129", | ||
"ws": "7.2.3" | ||
}, | ||
"description": "Ethereum Providers for ethers.", | ||
"devDependencies": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use strict"; | ||
|
||
import { Logger } from "@ethersproject/logger"; | ||
import { version } from "./_version"; | ||
|
||
let WS = (WebSocket as any); | ||
|
||
if (WS == null) { | ||
const logger = new Logger(version); | ||
WS = function() { | ||
logger.throwError("WebSockets not supported in this environment", Logger.errors.UNSUPPORTED_OPERATION, { | ||
operation: "new WebSocket()" | ||
}); | ||
} | ||
} | ||
|
||
module.exports = WS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.