{"_id":"@binance-chain/web3-providers-ws","_rev":"1-b303a302f670f953b52bd2a9036bd9be","name":"@binance-chain/web3-providers-ws","dist-tags":{"latest":"1.6.1"},"versions":{"1.6.1":{"name":"@binance-chain/web3-providers-ws","version":"1.6.1","description":"Module to handle web3 RPC connections over WebSockets.","repository":{"type":"git","url":"https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws"},"license":"LGPL-3.0","engines":{"node":">=8.0.0"},"scripts":{"compile":"tsc -b tsconfig.json","dtslint":"dtslint --localTs ../../node_modules/typescript/lib types"},"types":"types/index.d.ts","main":"lib/index.js","dependencies":{"eventemitter3":"4.0.4","web3-core-helpers":"1.5.2","websocket":"^1.0.32"},"devDependencies":{"dtslint":"^3.4.1","typescript":"^3.9.5"},"publishConfig":{"access":"public"},"gitHead":"3c49beac02dd35e175f8b30e4764c57a81a873dc","_id":"@binance-chain/web3-providers-ws@1.6.1","_nodeVersion":"16.6.1","_npmVersion":"lerna/3.22.1/node@v16.6.1+x64 (darwin)","dist":{"integrity":"sha512-zgdtU6fuNZtX8l0w8ViPHGbJTfhk8dt5xI6ef9RqxoT5W8/7qhLVNKaHO7vpi9LNtrsWRCALqPZ1wV39XDTeOg==","shasum":"995a46775c41ac1db583c88f5b4320e1a0910a9a","tarball":"https://registry.npmjs.org/@binance-chain/web3-providers-ws/-/web3-providers-ws-1.6.1.tgz","fileCount":12,"unpackedSize":32573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhI6hmCRA9TVsSAnZWagAA4yYP/3uRpz7gu6LgknGBbmpr\nOPDX5zb35pM5KddPb2eHSVTBtVx69ICnueHt5JBv2c2jZEbX8IzSeXo8r2eU\nrw1YX5JKYmaCyaj8HK5Wk50GIZ6yb1ol/ijHMKukroarh85ynUlm30a5L3XQ\nCOa9rpa/jxJLIyW9j46WWtH/CedczXTU7gCKBRb/h9RAUCkxAFsSXfoM6+9r\nyaH3ZoWVOmNfo3zYCLx63elGad80aNR9OfRp2sSxmTYUMMTugy4LTH58H0Ml\nhu+c9yAZ8rbzCGIVD7yrHfxMCFLGvvTb7/xI7nVxkT5e3ev6UAcUrZaf2pOI\n+PimuyJy5HCHQoxyQLQmboJ4qcVQDk4EoLqZ714TjI04+2CzSgNKEAHHhEXa\nUj6s7U4hpVP4djF3znEg1SaePo8MjgyGtdaM21ODhfLA2j7n434OupGyc4DD\nOwWqQqGqY7ljrQ7ZQ5yo/3DWcC1BXYVfz67B1uQC7UFTbxAfFt7Ht0b22fvt\n9JtaAyXmo4xYZUyzDdVxtpP+xeGla7dvUbsDwnqljsv82dQalBBRQUS/JKuT\n5R52QjVtl2ymlHPCk20hr/Z1Co94wQYn+69N0deYzsosc7SoZqkpUWahD6iw\nWH+MZZf4Ad5Yw/5SSB6CS+X+gjH2Zgvx+kZMjN2/LSWbvhA08UUAOJo5yGBz\nAv/I\r\n=a9fP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICRGUjvsz6tnH/tt/XfxlOKLlapaLkWMMQOde5/DGw2KAiEA3H3323juZAIkHpE3dNGxw/MqqG13ttXzkPxU6EnBBwM="}]},"_npmUser":{"name":"binance-chain-npm","email":"bit-fe-ci@binance.com"},"directories":{},"maintainers":[{"name":"binance-chain-npm","email":"bit-fe-ci@binance.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web3-providers-ws_1.6.1_1629726822024_0.42085287011763994"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-23T13:53:41.973Z","1.6.1":"2021-08-23T13:53:42.166Z","modified":"2022-04-04T18:52:24.737Z"},"maintainers":[{"name":"binance-chain-npm","email":"bit-fe-ci@binance.com"}],"description":"Module to handle web3 RPC connections over WebSockets.","repository":{"type":"git","url":"https://github.com/ethereum/web3.js/tree/1.x/packages/web3-providers-ws"},"license":"LGPL-3.0","readme":"# web3-providers-ws\n\n[![NPM Package][npm-image]][npm-url] [![Dependency Status][deps-image]][deps-url] [![Dev Dependency Status][deps-dev-image]][deps-dev-url]\n\nThis is a websocket provider sub-package for [web3.js][repo].  \n\nPlease read the [documentation][docs] for more.\n\n## Installation\n\n### Node.js\n\n```bash\nnpm install web3-providers-ws\n```\n\n## Usage\n\n```js\nconst Web3WsProvider = require('web3-providers-ws');\n\nconst options = {\n    timeout: 30000, // ms\n\n    // Useful for credentialed urls, e.g: ws://username:password@localhost:8546\n    headers: {\n      authorization: 'Basic username:password'\n    },\n\n    clientConfig: {\n      // Useful if requests are large\n      maxReceivedFrameSize: 100000000,   // bytes - default: 1MiB\n      maxReceivedMessageSize: 100000000, // bytes - default: 8MiB\n\n      // Useful to keep a connection alive\n      keepalive: true,\n      keepaliveInterval: 60000 // ms\n    },\n\n    // Enable auto reconnection\n    reconnect: {\n        auto: true,\n        delay: 5000, // ms\n        maxAttempts: 5,\n        onTimeout: false\n    }\n};\n\nconst ws = new Web3WsProvider('ws://localhost:8546', options);\n```\n\nAdditional client config options can be found [here](https://github.com/theturtle32/WebSocket-Node/blob/v1.0.31/docs/WebSocketClient.md#client-config-options).\n\n## Types\n\nAll the TypeScript typings are placed in the `types` folder.\n\n[docs]: http://web3js.readthedocs.io/en/1.0/\n[repo]: https://github.com/ethereum/web3.js\n[npm-image]: https://img.shields.io/npm/v/web3-providers-ws.svg\n[npm-url]: https://npmjs.org/package/web3-providers-ws\n[deps-image]: https://david-dm.org/ethereum/web3.js/1.x/status.svg?path=packages/web3-providers-ws\n[deps-url]: https://david-dm.org/ethereum/web3.js/1.x?path=packages/web3-providers-ws\n[deps-dev-image]: https://david-dm.org/ethereum/web3.js/1.x/dev-status.svg?path=packages/web3-providers-ws\n[deps-dev-url]: https://david-dm.org/ethereum/web3.js/1.x?type=dev&path=packages/web3-providers-ws\n","readmeFilename":"README.md"}