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

Web3Provider.provider is unavailable #641

Closed
Velenir opened this issue Nov 1, 2019 · 4 comments
Closed

Web3Provider.provider is unavailable #641

Velenir opened this issue Nov 1, 2019 · 4 comments
Labels
enhancement New feature or improvement.

Comments

@Velenir
Copy link

Velenir commented Nov 1, 2019

There's no provider property on Web3Provider instance unlike what the documentation says here and types lead me to believe.

Only _web3Provider which gets assigned here

For that matter just browsing the code I don't think provider is available on JsonRpcProvider, which Web3Provider extends, as it's never passed to its constructor

@ricmoo
Copy link
Member

ricmoo commented Nov 1, 2019

There is definitely no provider property on JsonRpcProvider, as it takes in a path (or URL), only the Web3Provider sub-class should have it.

You are right though, the docs do not match the implementation. I should expose the provider on a Web3Provider. I'll make that change and it will get deployed on the next push, unless you need it sooner.

Also, it's easier to browse the TypeScript source, than it is the generated JavaScript. :)

@ricmoo ricmoo added enhancement New feature or improvement. on-deck This Enhancement or Bug is currently being worked on. labels Nov 1, 2019
@ricmoo
Copy link
Member

ricmoo commented Nov 1, 2019

I've made these changes in both v4 and v5 locally.

@Velenir
Copy link
Author

Velenir commented Nov 1, 2019

I don't know why I went for JS code first :)

No hurry, _web3Provider is perfectly usable till next release

@ricmoo ricmoo removed the on-deck This Enhancement or Bug is currently being worked on. label Nov 24, 2019
@ricmoo
Copy link
Member

ricmoo commented Nov 24, 2019

This has been published to v4.0.40. Let me know if there are any problems!

Thanks! :)

@ricmoo ricmoo closed this as completed Nov 24, 2019
michaeltout pushed a commit to michaeltout/ethers.js that referenced this issue Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement.
Projects
None yet
Development

No branches or pull requests

2 participants