Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ethwatch-client

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethwatch-client

Watch Ethereum/EVM log events in a secure, robust, and scalable way

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Look ma, no RPC!

EthWatch is a decentralized distribution network for EVM smart contract events. It allows apps to listen to events in a scalable and secure way, instead of polling a blockchain node via RPC or other centralized API.

EthWatch is great for oracles, bridges, and other blockchain-adjacent backends, as well as DEXes, DeFi pools, and other dapp frontends that wish to improve UX by displaying chain events in realtime.

EthWatch is currently heavily WIP. It shouldn't be relied on by anything valuable.

Live playground

Check out a live demo here.

Client

This is the JS library that web and node.js-based apps can use to subscribe to smart contract events via EthWatch.

Installation

npm install ethwatch-client

Usage

import { EthWatch } from 'ethwatch-client'

const ethWatch = new EthWatch({
	chain: 'ethereum'
})

ethWatch.watch(contractAddress, abi).then((contract) => {
	contract.on('event', (event) => {
		console.log(event.parsed)
	})
})

Options

The EthWatch constructor options and their default values:

const ethWatch = new EthWatch({
	chain: 'ethereum',	// Name of the chain to connect to
	quorum: 0.5, 	// Between 0 and 1, this is the ratio of seed nodes that must report an event before it's passed to the application
})

Future development

TODO: tests TODO: handle changes in seed node set TODO: ability to wait N block confirmations on top of events TODO: optimize web package size (by only bringing in relevant modules of ethers?)

Keywords

FAQs

Package last updated on 17 Apr 2023

Did you know?

Socket

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.

Install

Related posts

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