0

The following test script requires('web3/lib/web3/event.js');

const SolidityEvent = require('web3/lib/web3/event.js');

function decodeLogs (logs, contract, address) {
 return logs.map(log => {
const event = new SolidityEvent(null, contract.events[log.topics[0]],   address);
return event.decode(log);
});
}

module.exports = {
 decodeLogs,
};

Does anyone know where I can find the library or is the library installed with the web3 download ???

Thanks in advance !!

0

Install truffle and use npm install web3 command to install web3. Refer this article for environment setup.

  • 1
    Thanks, I have the problem sorted now. Correction is to use just 'web3' instead of ('web3/lib/web3/event.js') – conwise17 Aug 16 '18 at 10:26
0

Answer: to require only web3

const SolidityEvent = require('web3');

 function decodeLogs (logs, contract, address) {
 return logs.map(log => {
 const event = new SolidityEvent(null, contract.events[log.topics[0]],      address);
 return event.decode(log);
 });
 }

 module.exports = {
 decodeLogs,
 };

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.