Skip to content

fix: validate WC session covers all chains before reuse#43

Merged
pyramation merged 2 commits intohyperweb-io:mainfrom
2wheeh:fix/multichain-wc
Apr 8, 2026
Merged

fix: validate WC session covers all chains before reuse#43
pyramation merged 2 commits intohyperweb-io:mainfrom
2wheeh:fix/multichain-wc

Conversation

@2wheeh
Copy link
Copy Markdown
Contributor

@2wheeh 2wheeh commented Apr 8, 2026

Description

When a WalletConnect session already existed, connect() returned early without validating whether the session covered all required chains.

if (this.provider.session) {
  return Promise.resolve(); // no chain validation                                 
}

If the chain configuration changed after the initial connection (e.g., adding a new chain), the stale session didn't include the new chain's namespace, causing signing requests to fail.

Since the session was never disconnected, subsequent reconnect attempts kept reusing the same stale session, locking the wallet into an error state.

Changes

  • Compute the required chain list (cosmos/eip155/solana) before checking the session
  • Reuse the existing session only if its namespaces cover all required chains
  • If any chain is missing, disconnect() the stale session and create a new one

@pyramation pyramation merged commit b436ce6 into hyperweb-io:main Apr 8, 2026
2 checks passed
@2wheeh 2wheeh deleted the fix/multichain-wc branch April 8, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants