Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

web3-stream-provider

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Issues
File Explorer

Advanced tools

web3-stream-provider

Utility for creating an Ethereum web3 provider that forwards payloads through a stream.

    4.0.0latest
    GitHub

Version published
Maintainers
1
Weekly downloads
1,091
decreased by-7.54%

Weekly downloads

Readme

Source

web3-stream-provider

Utility for creating an Ethereum web3 provider that forwards payloads through a stream. Only works for async payloads.

For connecting to a remote eth rpc handler

const StreamProvider = require('web3-stream-provider') var streamProvider = new StreamProvider() var web3 = new Web3(streamProvider) streamProvider.pipe(remoteRpcHandler).pipe(streamProvider)

For handling incoming rpc payloads

const handleRequestsFromStream = require('web3-stream-provider/handler') handleRequestsFromStream(remoteStream, provider, /* optional */ onRequest, onResponse) function onRequest(request){ // can modify the request if needed console.log(arguments) } function onResponse(err, request, response){ console.log(arguments) }

Keywords

FAQs

Last updated on 24 Aug 2019

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc