Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web3-providers-ws

Package Overview
Dependencies
Maintainers
2
Versions
454
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-providers-ws - npm Package Compare versions

Comparing version 1.2.9 to 1.2.10-rc.0

12

package.json
{
"name": "web3-providers-ws",
"version": "1.2.9",
"version": "1.2.10-rc.0",
"description": "Module to handle web3 RPC connections over WebSockets.",

@@ -11,3 +11,3 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws",

"scripts": {
"dtslint": "dtslint --localTs node_modules/typescript/lib types"
"dtslint": "dtslint --localTs ../../node_modules/typescript/lib types"
},

@@ -17,5 +17,5 @@ "types": "types/index.d.ts",

"dependencies": {
"eventemitter3": "^4.0.0",
"eventemitter3": "4.0.4",
"underscore": "1.9.1",
"web3-core-helpers": "1.2.9",
"web3-core-helpers": "1.2.10-rc.0",
"websocket": "^1.0.31"

@@ -25,5 +25,5 @@ },

"dtslint": "^3.4.1",
"typescript": "latest"
"typescript": "^3.9.5"
},
"gitHead": "0e7ee3325437f73f4bace6c2df06aefafd72c716"
"gitHead": "ef81e78b2eed69dd386e0d2cb9bd22d8af998c34"
}

@@ -5,6 +5,4 @@ # web3-providers-ws

This is a sub-package of [web3.js][repo].
This is a websocket provider sub-package for [web3.js][repo].
This is a websocket provider for [web3.js][repo].
Please read the [documentation][docs] for more.

@@ -20,20 +18,8 @@

### In the Browser
Build running the following in the [web3.js][repo] repository:
```bash
npm run-script build-all
```
Then include `dist/web3-providers-ws.js` in your html file.
This will expose the `Web3WsProvider` object on the window object.
## Usage
```js
// in node.js
var Web3WsProvider = require('web3-providers-ws');
const Web3WsProvider = require('web3-providers-ws');
var options = {
const options = {
timeout: 30000, // ms

@@ -65,3 +51,3 @@

var ws = new Web3WsProvider('ws://localhost:8546', options);
const ws = new Web3WsProvider('ws://localhost:8546', options);
```

@@ -68,0 +54,0 @@

@@ -133,3 +133,5 @@ /*

if (_this.responseQueue.has(id)) {
_this.responseQueue.get(id).callback(false, result);
if(_this.responseQueue.get(id).callback !== undefined) {
_this.responseQueue.get(id).callback(false, result);
}
_this.responseQueue.delete(id);

@@ -136,0 +138,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc