web3-stream-provider
Advanced tools
Weekly downloads
Readme
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)
}
FAQs
Utility for creating an Ethereum web3 provider that forwards payloads through a stream.
The npm package web3-stream-provider receives a total of 951 weekly downloads. As such, web3-stream-provider popularity was classified as not popular.
We found that web3-stream-provider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.