MetaMask / MetaMask/metamask-extension

Multichain: Make getCurrentChainId Selector Contextual

Open
#27,832 0 comments 0 reactions 1 assignee Claimed by @NidhiKJha View on GitHub
multichain-final-boss Remove GNS team-core-extension-ux
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.