@digicat/ethereum-contract-watcher
This package can observe contracts on a
web3.js-compatible
Ethereum network, providing callbacks for when events
are emitted. Requires Node.js 8.6 or newer.
Usage
const ContractWatcher = require('@digicat/ethereum-contract-watcher')
const watcher = new ContractWatcher({
ethereumNode: 'http://localhost:8545',
onError (err, token) {
},
onEvent (event, token) {
},
wrapWeb3Error (err) {
return err
}
})
watcher.add({
abi: […],
address: '0xef3b47f7e4865c72565f448cc162945ea5bcdc1e'
fromBlock: 'latest',
token: {
an: {
arbitrary: 'object'
}s
}
})
watcher.stop()