
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
@drizzle-utils/new-block-stream
Advanced tools
A tool for creating a stream of new block data.
A tool for creating a stream of new block data.
Install via npm:
npm install @drizzle-utils/new-block-stream
Usage example (taken from @drizzle-utils/new-block-stream/example.js
)
const Web3 = require("web3");
const createNewBlock$ = require("@drizzle-utils/new-block-stream");
const web3 = new Web3("ws://127.0.0.1:9545");
const { observable, cleanup } = createNewBlock$({
web3,
pollingInterval: 200, // only used if non-WebsocketProvider
});
// log out new blocks
observable.subscribe(block => console.log(block));
// stop listening to new blocks and end the stream
cleanup();
Note that listening to new blocks might skip blocks if polling is being used and the pollingInterval
is longer than the rate in which new blocks are being produced.
Creates an RxJS observable that will monitor the blockchain for new blocks. Supports both Web3 subscriptions and polling.
options
- Object
web3
- Object
: A Web3 instancepollingInterval
(only used for non-WebsocketProvider) - Number
: The rate in milliseconds at which the stream should poll for new blocks.Object
observable
: An RxJS observable.cleanup
: A function for cleaning up listeners and completing/ending the streams created.subscription
: This is only returned if the provider passed-in is a WebsocketProvider. This is a reference to the underlying Web3 subscription object.FAQs
A tool for creating a stream of new block data.
We found that @drizzle-utils/new-block-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.