xxxxxxxxxx
web3.eth.subscribe('logs', {} ,function(){ });
web3.eth.clearSubscriptions();
xxxxxxxxxx
var subscription = web3.eth.subscribe('logs', {
address: '0x123456..',
topics: ['0x12345...']
}, function(error, result){
if (!error)
console.log(result);
});
// unsubscribes the subscription
subscription.unsubscribe(function(error, success){
if(success)
console.log('Successfully unsubscribed!');
});
xxxxxxxxxx
web3.eth.subscribe('logs', {} ,function(){ });
maadim
digital-pyramid
web3.eth.clearSubscriptions();
xxxxxxxxxx
// In Node.js use: const Web3 = require('web3');
const web3 = new Web3(Web3.givenProvider || "ws://localhost:8545");