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.1 to 1.2.2

types/index.d.ts

36

package.json
{
"name": "web3-providers-ws",
"version": "1.2.1",
"description": "Module to handle web3 RPC connections over WebSockets.",
"repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws",
"license": "LGPL-3.0",
"engines": {
"node": ">=8.0.0"
},
"main": "src/index.js",
"dependencies": {
"underscore": "1.9.1",
"web3-core-helpers": "1.2.1",
"websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis"
}
"name": "web3-providers-ws",
"version": "1.2.2",
"description": "Module to handle web3 RPC connections over WebSockets.",
"repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws",
"license": "LGPL-3.0",
"engines": {
"node": ">=8.0.0"
},
"scripts": {
"dtslint": "dtslint types --onlyTestTsNext"
},
"types": "types/index.d.ts",
"main": "src/index.js",
"dependencies": {
"underscore": "1.9.1",
"web3-core-helpers": "1.2.2",
"websocket": "github:web3-js/WebSocket-Node#polyfill/globalThis"
},
"devDependencies": {
"definitelytyped-header-parser": "^1.0.1",
"dtslint": "0.4.2"
}
}

@@ -5,3 +5,3 @@ # web3-providers-ws

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

@@ -28,3 +28,2 @@

## Usage

@@ -36,8 +35,14 @@

var options = { timeout: 30000, headers: {authorization: 'Basic username:password'} } // set a custom timeout at 30 seconds, and credentials (you can also add the credentials to the URL: ws://username:password@localhost:8546)
var options = {
timeout: 30000,
headers: { authorization: 'Basic username:password' }
}; // set a custom timeout at 30 seconds, and credentials (you can also add the credentials to the URL: ws://username:password@localhost:8546)
var ws = new Web3WsProvider('ws://localhost:8546', options);
```
## Types
All the typescript typings are placed in the types folder.
[docs]: http://web3js.readthedocs.io/en/1.0/
[repo]: https://github.com/ethereum/web3.js

@@ -407,2 +407,12 @@ /*

/**
* Returns the desired boolean.
*
* @method supportsSubscriptions
* @returns {boolean}
*/
WebsocketProvider.prototype.supportsSubscriptions = function () {
return true;
};
module.exports = WebsocketProvider;
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