Skip to content

[bug] WCNamespaceUtil.createNamespaces uses the id property to build the CAIP network ID instead of using the network’s caipNetworkId #5552

@raulduartep

Description

@raulduartep

Link to minimal reproducible example

https://stackblitz.com/edit/github-erhvie8k

Steps to Reproduce

1 - Initialize AppKit using a custom network where the id differs from the reference used in caipNetworkId.

2 - Open the connect modal.

3 - Observe that the generated optional namespace contains a chain built using the network id, instead of the expected caipNetworkId.

Summary

Just for clarification, I am adding support for the Neo3 and Stellar blockchains by building custom AppKit adapters and network definitions.

Both blockchains follow the same network ID conventions already used by their respective WalletConnect SDK implementations.

References:

Currently, WCNamespaceUtil.createNamespaces uses the id to build the CAIP network ID which could cause some inconsistencies when you need to use two networks with the same network id.

For example, in the syncAccounts method of AppKitBaseClient, the find operation relies on the id to locate the corresponding caipNetwork. When two networks share the same id, this lookup may return the wrong network, resulting in incorrect account synchronization and other inconsistencies.

Reference:

let caipNetwork = this.getCaipNetworks().find(

I cannot assign a unique id to each network as a workaround, because WCNamespaceUtil.createNamespaces uses the network id to construct the caipNetworkId.

Proposed Solutions:

Refactor all locations where the id property is used to construct the caipNetworkId, ensuring that the existing caipNetworkId property is used directly instead of being derived from id.

Refactor all lookup operations that rely on the id property (e.g., find operations) to use caipNetworkId as the primary identifier for network resolution.

List of related npm package versions

@reown/appkit
@reown/appkit-controllers

Node.js Version

v22.14.0

Package Manager

npm@11.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions