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.

getNetwork allow optional chainId and network name

See original GitHub issue

The function already exists in essential-eth, but it does not accept any params. The params should be optional and introduce a new type Networkish

https://docs.ethers.io/v5/api/providers/#providers--networks

// By Chain Name
getNetwork("homestead");
// {
//   chainId: 1,
//   ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
//   name: 'homestead'
// }

// By Chain ID
getNetwork(1);
// {
//   chainId: 1,
//   ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
//   name: 'homestead'
// }

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
iadnanmalikcommented, May 7, 2022

Yea, sorry @dawsbot I got super busy in other stuff. Unassign me for now, and I’ll come back after a while!

1reaction
iadnanmalikcommented, Apr 27, 2022

Sure will try that!

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Providers - Ethers.js
Create a new EtherscanProvider connected to network with the optional apiKey. ... for a common network name, a number for a common chain...
Read more >
Network ID and chain ID - Hyperledger Besu
Besu sets the chain ID (and by default the network ID) automatically, using either the --genesis-file option or when specifying a network ......
Read more >
Network Management — Brownie 1.19.2 documentation
Live networks with the same chain ID share local data about contract deployments. See chainid.network for a list of chain IDs. The following...
Read more >
How to use the ethers.ethers.providers function in ethers - Snyk
fromMnemonic(mnemonic, cfPath).connect(ethprovider); const network = await ethprovider.getNetwork(); let store; if (urls.pisaUrl(network.chainId)) { store ...
Read more >
use chainId instead of network name · Issue #26 - GitHub
currently it looks like this: it would be better if chainId's are used here instead of network names. Because if a wallet wants...
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