Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WalletConnect v2 implementation does not support Optional Namespaces. #6703

Open
jxom opened this issue Jun 25, 2023 · 11 comments
Open

WalletConnect v2 implementation does not support Optional Namespaces. #6703

jxom opened this issue Jun 25, 2023 · 11 comments
Labels
Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking team-sdk SDK team type-bug Something isn't working WalletConnect WalletConnect related issue or bug

Comments

@jxom
Copy link

jxom commented Jun 25, 2023

Describe the bug

MetaMask Mobile's WalletConnect v2 implementation does not support Optional Namespaces, thus breaking multichain DApps - users cannot switch network. This was previously working in MM Mobile + WalletConnect v1.

To Reproduce

  1. Head to https://stackblitz.com/edit/vitejs-vite-bhhzgv
  2. Connect
  3. Try switch to Polygon
  4. Error.

Expected behavior

You are able to switch chains.

@jxom jxom added awaiting-metamask PR or issue awaiting feedback from metamask team needs-triage Issues that require triage type-bug Something isn't working labels Jun 25, 2023
@anaamolnar anaamolnar added Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing WalletConnect WalletConnect related issue or bug team-sdk SDK team and removed needs-triage Issues that require triage awaiting-metamask PR or issue awaiting feedback from metamask team labels Jun 27, 2023
@0xWhiteleaf
Copy link

I would like to add more precision.
This bug is due to the fact that Metamask ignores (or misshandle) the optionalChains parameter and therefore does not include these chains in the "allowed" chains of the session.

This is resulting in an error when we try to request chain switch:

error={ "message": "Chain 'eip155:137' not approved. Please use one of the following: eip155:1"}

How the connection is initiated client-side:

await EthereumProvider.init({
  projectId: process.env.TEST_PROJECT_ID,
  chains: [1], // chains added to required namespaces
  optionalChains: [77, 99, 137] // chains added to optional namespaces
  ...
})

@iketw
Copy link

iketw commented Jul 24, 2023

Any updates on this?

@mohandesjiri
Copy link

Any update?
Too many dApps are already broken.

@anaamolnar anaamolnar added Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking and removed Sev1-high An issue that may have caused fund loss or access to wallet in the past & may still be ongoing labels Sep 26, 2023
@mccabe-david
Copy link

I'm still having issues with this. It seems MetaMask is indifferent whether Optional Namespaces are sent in the Proposal Namespace. Further, when the Required Namespace "chains" array length is greater than 1, MetaMask won't even connect...

@mccabe-david
Copy link

Am I crazy or does setting chains undefined when the array length is not 1 make no sense? Like at least fall back on defaultChain if it exists. https://github.com/ElvisKrop/wagmi-dev-references/blob/020fc97e276e8d7fbbb918e840029593fa05e7e9/packages/connectors/src/walletConnect.ts#L304

@mthinh
Copy link

mthinh commented Dec 19, 2023

Im also facing this issue

@siosio34
Copy link

Any updates on this?

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues that have not had activity in the last 90 days label May 16, 2024
Copy link
Contributor

This issue was closed because there has been no follow activity in 7 days. If you feel this was closed in error please provide evidence on the current production app in a new issue or comment in the existing issue to a maintainer. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
@microHoffman
Copy link

I believe this is closed by accident, the issue is still present @gauthierpetetin

@gauthierpetetin
Copy link
Contributor

Thanks for flagging @microHoffman , I'll re-open it.

@github-actions github-actions bot removed the stale Issues that have not had activity in the last 90 days label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sev2-normal An issue that may lead to users misunderstanding some limited risks they are taking team-sdk SDK team type-bug Something isn't working WalletConnect WalletConnect related issue or bug
Projects
Archived in project
Status: To be fixed
Development

No branches or pull requests

11 participants