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
TypeError: Cannot read property 'on' of undefined, can't access event from nodejs #958
Comments
I cannot reproduce this. |
@jdkanani here is a full code: https://gist.github.com/stiv-yakovenko/26994bbe32457bb69ef7694e98a5e7cf Hopefully it can help you to reproduce this. I am on test-net. |
The problem seems to be with setProvider, which doesn't propagate down the provider. i will fix it. And yes, event s are now under the |
@frozeman Why not use direct methods/events - Apart from that, how one can get parsed log from raw log object from contract object? Example: |
@jdkanani the reason to put it under a separate property is that you can define any name on your contract object, which could interfere with native functions like For contract raw logs you should have the |
@frozeman Makes sense. Thanks. For log related, when you do getTransactionReceipt, you receipt with logs (having Currently, I am using this (little hack): var transferEvent = ct.events.Transfer();
var result = transferEvent.options.subscription.outputFormatter(receipt.logs[0]); // receipt object from server or `getTransactionReceipt` get method
console.log(result.returnValues._to, result.returnValues._from, result.returnValues._value); Is there any other way to do so? Like - |
This is my source code in nodejs:
But I get this crash:
contract.Evt is undefined for me, contract is defined and contains contract.events.Evt.
How can I fix this?
The text was updated successfully, but these errors were encountered: