question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JsonRpcProvider.connection not documented

See original GitHub issue

Unless I’m going crazy, JsonRpcProvider.connection is the only public API for obtaining the URL which the provider is connected to … but it’s not documented:

IIUC, it returns either an object like { url: "https://..." }, or the ConnectionInfo object which was passed into the constructor.

And while I’m here, I note that the ConnectionInfo type is documented under API > Utilities > Web Utilities, which seems like an very odd and counter-intuitive place to put it:

https://docs.ethers.io/v5/api/utils/web/#ConnectionInfo

I doubt anyone would be able to easily find that via the navbar alone.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Jan 31, 2022

I can’t do anything about Hardhat, you would have to discuss that with them.

But I’ll update the ethers docs. 😃

0reactions
aspierscommented, Feb 6, 2022

Great thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsonRpcProvider - ethers
Connect to a JSON-RPC HTTP API using the URL or ConnectionInfo urlOrConnectionInfo connected to the networkish network. If urlOrConnectionInfo is not ...
Read more >
How to connect to custom Provider using ethers?
In the documentation here it says to use JsonRpcProvider instead of Web3Provider . // When using the JSON-RPC API, the network will be ......
Read more >
How to connect to Ethereum network with ethers.js - QuickNode
1. When someone thinks of developing a dApp the first tool that comes to their mind is web3.js which is ... 2. First,...
Read more >
How to add JWT token in JsonRpcProvider url header when ...
StaticJsonRpcProvider is needed for connecting to JWT enabled Besu network. Here is the working code: connection.url = GLOBAL.
Read more >
JsonRpcProvider class - ethers library - Dart API - Pub.dev
The hash code for this object. read-onlyinherited. impl → _JsonRpcProviderImpl: Internal JS Object, should not be used directly.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found