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 provider includes all supported chains in new session proposals #281

Closed
drichar opened this issue Oct 4, 2024 · 0 comments · Fixed by #282
Closed

WalletConnect provider includes all supported chains in new session proposals #281

drichar opened this issue Oct 4, 2024 · 0 comments · Fixed by #282
Labels
bug Something isn't working

Comments

@drichar
Copy link
Collaborator

drichar commented Oct 4, 2024

Bug Description

The WalletConnect provider in @txnlab/use-wallet incorrectly includes all Algorand networks supported by the library (mainnet, testnet, betanet, fnet, etc.) in the requiredNamespaces in new session proposals via the Sign Client's connect method.

Expected Behavior

The WalletConnect session proposal should only include the CAIP-2 chain ID for the currently active network in requiredNamespaces.

Current Behavior

The session proposal includes chain IDs for all supported networks in requiredNamespaces, causing issues with wallets that don't support all of the included networks.

Reproduction

  1. Configure @txnlab/use-wallet to connect to mainnet (network: NetworkId.MAINNET)
  2. Attempt to connect with Edge Wallet using the WalletConnect provider
  3. The app will throw an error since the wallet does not support testnet, betanet, etc

Environment

  • @txnlab/use-wallet version: 3.7.1
  • @walletconnect/sign-client version: 2.16.1

Suggested Solution

Implement a new activeChainId getter in the WalletConnect class that returns the CAIP-2 chain ID for the currently active network. Use this getter when creating the session proposal to ensure only the active network's chain ID is included in requiredNamespaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant