Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events Guide #6741

Closed
mconnelly8 opened this issue Jan 22, 2024 · 2 comments
Closed

Events Guide #6741

mconnelly8 opened this issue Jan 22, 2024 · 2 comments
Assignees
Labels
4.x 4.0 related Documentation Relates to project wiki or documentation Good First Issue Great to learn the internals of web3.js

Comments

@mconnelly8
Copy link

2024 H1 Action Items: Expand web3.js documentation with 5 guides explaining common usage and/or best practices

@mconnelly8 mconnelly8 added 4.x 4.0 related Documentation Relates to project wiki or documentation labels Jan 22, 2024
@SantiagoDevRel
Copy link
Member

References:

  • Change this introduction section for Mastering events subcriptions and include sample codes for every supported subscriptions
  • add a sample code to subscribe to a smart contract events using the contract instance (with comments and more organized)
import {Web3} from "web3";
  
const web3 = new Web3("provider");

const contract = new web3.eth.Contract(abi, address);

const subscription = contract.events.RandomNo()
subscription.on("data", console.log);

@SantiagoDevRel SantiagoDevRel added the Good First Issue Great to learn the internals of web3.js label Jan 28, 2024
@Yazi27
Copy link

Yazi27 commented Apr 10, 2024

Also, chaining .on's does not work anymore as stated on the 1.2.0 docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Documentation Relates to project wiki or documentation Good First Issue Great to learn the internals of web3.js
Projects
None yet
Development

No branches or pull requests

3 participants