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

Safe Wallet and Wallet Connect Not Working With Multiple Chains Configured #3027

Closed
1 task done
murtrax opened this issue Sep 20, 2023 · 5 comments · Fixed by #3276
Closed
1 task done

Safe Wallet and Wallet Connect Not Working With Multiple Chains Configured #3027

murtrax opened this issue Sep 20, 2023 · 5 comments · Fixed by #3276

Comments

@murtrax
Copy link

murtrax commented Sep 20, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

1.4.2

Current Behavior

I have a numerous list of chains that I have configured with my Wagmi below. If I wish to connect to Goerli via wallet connect through gnosis safe wallet. If goerli is not the first chain in the list, wallet connect will not form a connection to the safe app.

Instead giving the following error

Error: Connection refused: This Safe Account is in Goerli but the Wallet Connect session proposal is not valid because it contains: 1) A required chain different than Goerli 2) Does not include Goerli between the optional chains 3) No EVM compatible chain is included

[
mainnetConfig,
goerli,
arbitrum,
arbitrumGoerli,
avalanche,
bsc,
bscTestnet,
fantom,
polygon,
sepolia,
cronos,
etc,
etcTestnet,
heco,
kava,
kavaTestnet,
pulseChain,
velas,
baseMainnet,
]

new WalletConnectConnector({
chains,
options: {
showQrModal: true,
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_KEY,
},
}),

Error in my localhost env

Screenshot 2023-09-20 at 6 31 56 PM

Screenshot 2023-09-20 at 6 32 09 PM

Error in Safe App Console Log

Screenshot 2023-09-20 at 6 31 51 PM

Expected Behavior

It should work with wallet connect connecting to safe, no matter how many chains are configured within my Wagmi Config and irrelevant of the order. Have seen similar posts to this, but none of them detail a true solution. Any info or solution on this would be greatly greatly appreciated.

Steps To Reproduce

No response

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

No response

Anything else?

No response

@murtrax murtrax changed the title Safe Wallet and WalletConnectConnector Not Working With Multiple Chains Configured Safe Wallet and Wallet Connect Not Working With Multiple Chains Configured Sep 21, 2023
@oxSaturn
Copy link
Contributor

A similar issue reported before wevm/references#469, and a fix for that wevm/references#470

@jacob-abe
Copy link

jacob-abe commented Oct 6, 2023

@oxSaturn How I worked against this is, we have multiple chains on our app. But the chain is dependent on the slug in our case. So depending on the slug, I set a single chain in the chains in the wagmi config for the walletconnect connector. Feels like this needs some attention as its being complained about in multiple places!

@dzek69
Copy link

dzek69 commented Oct 6, 2023

@oxSaturn the fix got rejected.

A lot of wallets seems to be affected, from what I know this issue is causing Trust Wallet and Ledger to not connect to any network that is not first on the list of chains passed to WalletConnectConnector.

I'm thinking about any workaround, but I see none, except asking user to select the network first in my app UI and then use the wallet with correct network selected when connecting

if anyone has a solution or even workaround that'd be great

@meri-maki
Copy link

+1 Seeing the same behavior with UniSwap wallet as well

Copy link
Contributor

github-actions bot commented Jan 5, 2024

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants