-
Notifications
You must be signed in to change notification settings - Fork 714
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
Two issues: walletconnect and metamask mobile #4275
Comments
Hi @siosio34, thanks for the report, we'll try to contact MetaMask and suggest these fixes |
Other than that, walletconnect provides a better user experience. Thank you to the walletconnect team for creating and maintaining this product. |
Hi @siosio34 just wanted to give a heads up we've been working together with MetaMask to address the most relevant issues and a new release with a UX improvement around chain switching and else are coming eventually. |
@glitch-txs thank you I’m so excited for tonight that I can’t sleep 0_< |
@glitch-txs |
Hey @siosio34 the new MetaMask version should be released early next month with these fixed 👍 |
I think what you said is included in https://github.com/MetaMask/metamask-mobile/releases/tag/v7.21.0. Is this correct? |
Mmm I think not, @ganchoradkov do you remember which one is the PR for the MetaMask update? |
The issue likely revolves around connection or integration problems between WalletConnect and MetaMask, such as: WalletConnect not initializing properly with MetaMask. Proposed Solution: Problem: Users often experience session disconnects after some idle time. const provider = new WalletConnectProvider({
rpc: { 1: 'https://mainnet.infura.io/v3/INFURA_PROJECT_ID' }
});
// Check if there is an existing session
if (provider.connector.connected) {
await provider.enable();
}
Problem: When MetaMask fails to connect, users see a generic error message like "Connection failed." provider.on("error", (error) => {
if (error.message.includes("MetaMask")) {
alert("MetaMask connection failed. Please try reconnecting.");
} else {
alert("Connection failed. Check your network or wallet.");
}
});
Problem: WalletConnect supports multi-chain connections, but MetaMask might not handle chain switching smoothly. async function switchChain(chainId) {
try {
await provider.request({
method: "wallet_switchEthereumChain",
params: [{ chainId }],
});
} catch (error) {
if (error.code === 4902) {
// If the chain is not added, add it to MetaMask
await provider.request({
method: "wallet_addEthereumChain",
params: [{ chainId }],
});
} else {
alert("Please switch the network manually in MetaMask.");
}
}
} 4.Testing & Debugging MetaMask + WalletConnect Interactions: Test the interactions by attempting the following: |
Describe the bug
Hello, I am using WalletConnect and Metamask Mobile and have the following two issues.
First, Switchchain does not work properly. When you send a Switchchain request and see the chain request window on MetaMask Mobile, if you reject it, the request will not be completed, and even if you accept it, the chain change within the mobile does not work properly, so you have to change the chain within MetaMask Mobile and then process the request.
Second, when sending a sign request while connected to a chain other than Ethereum (ex polygon), there was an issue where the chain was unnecessarily requested to be changed to Ethereum.
These two issues were so critical that we had no choice but to give up on introducing WalletConnect. Is there any progress on these two issues?
Links to related issues are below.
MetaMask/metamask-mobile#8380
MetaMask/metamask-mobile#7206
MetaMask/metamask-mobile#7023
SDK Version (if relevant)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: