MetaMask / MetaMask/metamask-extension
Multichain: Make getCurrentChainId Selector Contextual
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
### What is this about?
At present the `getCurrentChainId` function within the extension always returns the globally selected chainId from the `NetworkPicker`. We need to update this function to return the chainId of the dapp/page context that lives on the `state.metamask.domains` object. In the case that the user is not connected to a dapp, we can return the globally selected chainId, which is also still required for legacy dapps.
### Scenario
_No response_
### Design
_No response_
### Technical Details
_No response_
### Threat Modeling Framework
_No response_
### Acceptance Criteria
_No response_
### Stakeholder review needed before the work gets merged
- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)
### References
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.