Skip to content

fix(namespaces): use caipNetworkId directly in createNamespaces#5666

Open
Khizr97 wants to merge 1 commit into
chore/khizr-fixes-2from
chore/khizr-fixes-2-REOWN-4474
Open

fix(namespaces): use caipNetworkId directly in createNamespaces#5666
Khizr97 wants to merge 1 commit into
chore/khizr-fixes-2from
chore/khizr-fixes-2-REOWN-4474

Conversation

@Khizr97
Copy link
Copy Markdown
Contributor

@Khizr97 Khizr97 commented May 12, 2026

Summary

  • createNamespaces in both WCNamespaceUtil and WalletConnectUtil was reconstructing the CAIP network ID as `${chainNamespace}:${id}` instead of reading the existing caipNetworkId property on the CaipNetwork object
  • For all standard chains (EVM, Solana, Bitcoin) these happen to be equal, so no existing users were affected
  • For custom chains like Neo3 (id: 1, caipNetworkId: 'neo3:MainNet') or Stellar (caipNetworkId: 'stellar:pubnet'), the wrong chain ID was sent in the WalletConnect namespace, causing wallets to reject or mishandle the session
  • Also fixes rpcMap keys to use the full caipNetworkId instead of the raw id

Test plan

  • Updated rpcMap expectations in existing createNamespaces test to use full CAIP IDs ('eip155:1' instead of '1')
  • Added new test: custom chain with id: 1 and caipNetworkId: 'neo3:MainNet' — verifies chains contain 'neo3:MainNet' not 'neo3:1'
  • 839 controller tests pass
  • 95 appkit-utils tests pass

Closes REOWN-4474

🤖 Generated with Claude Code

Both WCNamespaceUtil and WalletConnectUtil were reconstructing the CAIP
network ID from chainNamespace + id instead of reading the existing
caipNetworkId property. For standard chains these are equivalent, but
for custom chains (Neo3, Stellar, etc.) where id differs from the CAIP-2
chain reference the wrong namespace was sent to wallets over WalletConnect.
Also fixes rpcMap keys to use the full caipNetworkId.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented May 12, 2026

REOWN-4474

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
appkit-demo Ready Ready Preview, Comment May 12, 2026 3:37pm
appkit-gallery Ready Ready Preview, Comment May 12, 2026 3:37pm
appkit-headless-sample-app Ready Ready Preview, Comment May 12, 2026 3:37pm
appkit-laboratory Ready Ready Preview, Comment May 12, 2026 3:37pm
9 Skipped Deployments
Project Deployment Actions Updated (UTC)
appkit-basic-example Ignored Ignored May 12, 2026 3:37pm
appkit-basic-sign-client-example Ignored Ignored May 12, 2026 3:37pm
appkit-basic-up-example Ignored Ignored May 12, 2026 3:37pm
appkit-ethers5-bera Ignored Ignored May 12, 2026 3:37pm
appkit-nansen-demo Ignored Ignored May 12, 2026 3:37pm
appkit-wagmi-cdn-example Ignored Ignored May 12, 2026 3:37pm
ethereum-provider-wagmi-example Ignored Ignored May 12, 2026 3:37pm
next-wagmi-solana-bitcoin-example Ignored Ignored May 12, 2026 3:37pm
vue-wagmi-example Ignored Ignored May 12, 2026 3:37pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 12, 2026

🦋 Changeset detected

Latest commit: be00c23

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit-utils Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-ton Patch
@reown/appkit-adapter-tron Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-ui Patch
@reown/appkit-core Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-wallet-button Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-cdn Patch
@reown/appkit-universal-connector Patch
@reown/appkit-testing Patch
@reown/appkit-common Patch
@reown/appkit-polyfills Patch
@reown/appkit-wallet Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant