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

web3.eth.subscribe("logs", ..) types issue #2583

Closed
Pogooo opened this issue Mar 26, 2019 · 0 comments · Fixed by #2585
Closed

web3.eth.subscribe("logs", ..) types issue #2583

Pogooo opened this issue Mar 26, 2019 · 0 comments · Fixed by #2585
Labels
Types Incorrect or missing types

Comments

@Pogooo
Copy link

Pogooo commented Mar 26, 2019

Description

I cannot subscribe to logs, because of typescript errors.
If I comment out the web3-eth/types' index.d.ts:58-60 rows, it works. Should I set some attribute in the tslint.json?
Also I cannot pass array for the address, but the documentation says It's possible.

Expected behavior

this.web3.eth.subscribe("logs", {
    address: addressesToWatch
}, (error, event: Log) => {
    ...
});

And I've got the event about the specified addresses.

Actual behavior

cannot pass array to the address parameter, only string
also tslint prints: "Argument of type "'logs'" is not assignable to parameter of type '"pendigTransactions'"."

Error Logs

"Argument of type "'logs'" is not assignable to parameter of type '"pendigTransactions'"."
Type 'string[]' is not assignable to type 'string'

Versions

  • web3.js: 1.0.0-beta.50
  • nodejs: 10.11.0
  • ethereum node: geth 1.8.22-stable
@Pogooo Pogooo changed the title this.web3.eth.subscribe("logs", ..) types issue web3.eth.subscribe("logs", ..) types issue Mar 26, 2019
@nivida nivida added the Types Incorrect or missing types label Mar 26, 2019
@nivida nivida mentioned this issue Mar 28, 2019
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Types Incorrect or missing types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants