1.0.6 • Published 6 years ago

old-web3-events v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

This module is made to replace the events of web3 v 1.0 because they don't work yet.

Example:

  const oldWeb3Events = require('old-web3-events')
  const myAbi = require('./myAbi.json')

  // contract
  const myContractAddress = '0x...'
  const myContract = new web3.eth.Contract(myAbi, myContractAddress)

  // overwrite the web3 1.0 events because they don't work yet
  const events = oldWeb3Events({
    abi: myAbi, 
    contractAddress: myContractAddress, 
    provider: 'https://infura.io/apiKey',
    eventNames: ['MyEventNameA', 'MyEventNameB', 'MyEventNameC']
  })
  myContract.events = events
  
  const myEventNameA = myContract.events.MyEventNameA({}, {fromBlock: 0, toBlock: 'latest'})
  myEventNameA.watch((err, event) => {
    console.log(event)
  })
1.0.6

6 years ago

1.0.5

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago