Wallet Connect V2 Error Connecting to OTHER chain

Does the Wallet Connect add-on support “other” chains (i.e. Polkadot/Substrate based chains). I’m getting Error: Unsupported chain namespace: other when trying to init web3 Wallet Connect add-on as per the docs here.

  • SDK Version:
    @walletconnect/modal”: “^2.6.2”,
    @walletconnect/sign-client”: “^2.10.2”,
    @web3auth/base”: “^7.3.1”,
    @web3auth/no-modal”: “^7.3.1”,
    @web3auth/openlogin-adapter”: “^7.3.1”,
    @web3auth/wallet-connect-v2-adapter”: “^8.0.1”,
  • Platform: nextJS 13.4.19
  • Browser Console Screenshots:
    Screenshot 2024-03-06 at 12.08.36 AM

I had to use a workaround because I’m working in nextJS and SSR was causing an issue with Wallet Connect it seems so hence if (typeof window !== "undefined") inside the useEffect hook. If there is a better way to do this please advise.

Below is my web3 init code

useEffect(() => {
    const init = async () => {
      if (typeof window !== "undefined") {
        const { WalletConnectModal } = require("@walletconnect/modal");
        const {
          WalletConnectV2Adapter,
          getWalletConnectV2Settings,
        } = require("@web3auth/wallet-connect-v2-adapter");

        const defaultWcSettings = await getWalletConnectV2Settings(
          CHAIN_NAMESPACES.OTHER,
          ["0x1"],
          "*projectID*",
        );
        const walletConnectModal = new WalletConnectModal({
          projectId: "*projectID*",
        });
        const walletConnectV2Adapter = new WalletConnectV2Adapter({
          adapterSettings: {
            qrcodeModal: walletConnectModal,
            ...defaultWcSettings.adapterSettings,
          },
          loginSettings: { ...defaultWcSettings.loginSettings },
        });
        if (web3WalletConnect) {
          web3WalletConnect.configureAdapter(walletConnectV2Adapter);
        }
        setIsReady(true);
      }
    };
    init();
  }, [web3WalletConnect]);

chain config code:

export const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.OTHER,
  chainId: "0x1",
  rpcTarget: "https://rpc.polkadot.io/",
  displayName: "Polkadot Mainnet",
  blockExplorer: "https://explorer.polkascan.io/",
  ticker: "DOT",
  tickerName: "Polkadot",
};

note: I tried connecting without calling getWalletConnectV2Settings but then I get a chain mismatch because it defaults to EIP155

Thank you

welcome @rob :slight_smile:

Your issue has been forwarded to our Dev team and we will get back with further updates.

hi @rob,

would you mind updating all the web3auth libraries to v8 and try again?

@web3auth/base”: “^8.0.0”,
@web3auth/no-modal”: “^8.0.1”,
@web3auth/openlogin-adapter”: “^8.0.1”,

Sorry to inform that Wallet Connect v2 Adapter only supports CHAIN_NAMESPACES.EIP155

Ahh, okay thanks @TomTom for the update. Your team might want to update to the docs to let other devs know it’s not supported on other chains.

Thanks for the suggestion, I will report it !