Skip to content
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

Better Log features (comparible to web3) #12

Open
1 task done
SilentCicero opened this issue Dec 5, 2017 · 0 comments
Open
1 task done

Better Log features (comparible to web3) #12

SilentCicero opened this issue Dec 5, 2017 · 0 comments

Comments

@SilentCicero
Copy link
Member

SilentCicero commented Dec 5, 2017

Issue Type

  • Feature

Description

We want to be able to grab logs like web3. Just a getLogs kind of method, but with topic filtering:

Currently one has to do something like this:

eth.getLogs({
   address: 'CONTRACT_ADDRESS',
   topics: [`0x${Eth.keccak256(`${abi[0].name}(${abi[0].inputs.map(v => v.type).join(',')})`)}`],
})
.then(console.log);

We can bind that into that contract object like so:

contractObject.filterName.getLogs with the contract address and topic array predefined/filled.

we can also pre-define the topic name output as so:

contractObject.fitlerName.topic which will produce the sha3 hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant