Skip to content

Chain switch is not reflected in address and balance #774

@mahnunchik

Description

@mahnunchik

I'm experiencing an issue with a dApp when connecting via WalletConnect to a wallet that uses different addresses for different chains.

Example of approved namespaces from the connected WalletConnect session:

{
    "eip155": {
        "chains": [
            "eip155:42161",
            "eip155:1",
            "eip155:8453",
            "eip155:137"
        ],
        "methods": [...],
        "events": [...],
        "accounts": [
            "eip155:42161:0xAd8eDE8697aF92AF31Fe66EDAD9A52A74F74464E",
            "eip155:1:0xB6bB59b3aC844e8e4A98A281D57E3E0628bcb471",
            "eip155:8453:0x750b363f6FBD64Ae2c8671972a97e928c8a0fD34",
            "eip155:137:0x9492A87Fc4c112Fe10123B1D3Aa6fBa5e14F1479"
        ]
    }
}

As you can see, each chain uses a different address.

Steps to reproduce:

  1. Open https://coin.space/wallet/ or any other wallet that uses different addresses for different chains
  2. Connect the dApp to the wallet using WalletConnect
  3. Switch the chain in the dApp interface

Expected behavior:
The address should change and the balance should update based on the selected chain.

Actual behavior:
The address stays the same as it was for the previous chain.

The root cause is in the WalletConnect library: WalletConnect/walletconnect-monorepo#5706 A fix has been prepared but hasn't been merged yet.

The same issue occurs in other dApps as well:

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