dawsbot / dawsbot/essential-eth
getNetwork allow optional chainId and network name
- Dominant language
- TypeScript
- Stars
- 310
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
[The function already exists](https://github.com/Earnifi/essential-eth/blob/13ff58c68f3602c2f172e47f3ce118bd298872f5/src/providers/BaseProvider.ts#L41) 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/types/#providers-Networkish)
https://docs.ethers.io/v5/api/providers/#providers--networks
```js
// By Chain Name
getNetwork("homestead");
// {
// chainId: 1,
// ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
// name: 'homestead'
// }
// By Chain ID
getNetwork(1);
// {
// chainId: 1,
// ensAddress: '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
// name: 'homestead'
// }
```
Contributor guide
Assessment
This issue has not been assessed yet.