feat: implement WalletConnect v2 multi-chain support and connection health (#227)#330
Merged
Smartdevs17 merged 1 commit intoApr 26, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #227 — adds multi-chain switching and connection health assessment to the existing WalletConnect v2 service layer.
New files
src/services/walletconnect/multiChain.tsbuildMultiChainState(activeChainId)— builds a typedMultiChainStatewith all supported chainsswitchChain(state, targetChainId)— validates the target is supported, returnsChainSwitchResultwith success/error and chain metadatagetActiveChain(state)— resolves full chain definition for the active chainisChainSupported(chainId)— quick boolean checkgetCaipNetworkId(chainId)— returns the CAIP-2 network ID (e.g.eip155:137) for use in WalletConnect protocol messagessrc/services/walletconnect/connectionHealth.tsassessConnectionHealth(session, nowMs?)— classifies a session ashealthy | degraded | disconnected | unknownand lists specific issues (missing_address,missing_chain_id,session_stale)formatConnectionDuration(ms)— human-readable duration (e.g.45s,3m,2h) for UI displaysrc/services/walletconnect/__tests__/multiChain.test.ts— 12 testssrc/services/walletconnect/__tests__/connectionHealth.test.ts— 11 testsAcceptance criteria coverage
switchChain,buildMultiChainState, all 5 EVM chainsassessConnectionHealthwith stale-session detectionassessConnectionHealthreportsdisconnectedfor non-connected statesbuildPairingUri+ newmultiChainstate feeds QR payloadTest plan
jest --testPathPattern=walletconnect— all tests pass