shentufoundation/shentu

WalletConnect incompatible chain ID

Opened this issue · 0 comments

Summary of the Bug

shentu-2.2 chain ID is not compatible with WalletConnect.
It can't be added as a chain in WalletConnect's SignClient, as it doesn't follow CAIP-2 chain reference standard.

As a result, you can't connect with that chain.
I believe, exact wallet behaviour varies depending on specific wallet (whether they handle that error or not), but in case of Leap Cosmos wallet, for example, it causes infinite loading.

Steps to Reproduce

It's kinda tricky, because I tried it with custom closed-source WalletConnect+cosmos integration, but these steps must show the issue:

  • Sign up a WalletConnect account here: https://cloud.walletconnect.com/sign-up
  • Create a projectID
  • Clone this repo: https://github.com/WalletConnect/web-examples/tree/main/advanced/dapps/react-dapp-v2-cosmos-provider
  • Create .env.local file in /advanced/dapps/react-dapp-v2-cosmos-provider subdir and setup the env with your project ID:
    NEXT_PUBLIC_PROJECT_ID=...
    NEXT_PUBLIC_RELAY_URL=wss://relay.walletconnect.com
  • Add your chain info in ./src/chains/cosmos.ts (in CosmosChainData AND CosmosMetadata) and chain Id in./src/constants/default.ts (in DEFAULT_MAIN_CHAINS)
  • Run it and try to connect reading the QR code with your mobile wallet (again, tested with Leap).
  • ???
  • ?????
  • ???okay it's infinite loading

Expected behaviour

Connects smoothly 🤌


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged