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

Use StaticJsonRpcProvider or InfuraProvider to avoid eth_ChainId calls. #397

Closed
jhirn opened this issue Nov 17, 2021 · 1 comment
Closed

Comments

@jhirn
Copy link

jhirn commented Nov 17, 2021

Hello again.

With my site having just gone live, I'm noticing a ton of ethChianId calls in Infura. According to ethers-io/ethers.js#901, a solution would be to use ethers.providers.InfuraProvider and not the ethers.providers.JsonRpcProvider. I understand there is also a StaticJsonRpcProvider as well.

Unfortunately I'm not 100% sure how to go about this and what side-effects, if any, I may face by doing so. Opening an issue to get some conversation around how to do this or why it might not be as simple as it seems.

Thank you!

@mj426382
Copy link
Contributor

mj426382 commented Jun 8, 2022

In the newest useDapp version, we use StaticJsonRpcProvider instead of not static one and you can also pass your provider that reads the chain state.

@mj426382 mj426382 closed this as completed Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants