Wallet Connect configuration with Binance smart chain not working

Viewed 2048

I'm trying to link BSC chain with wallet connect in my react DAPP.

  const walletConnectProvider = await new WalletConnectProvider({
    rpc: {
     56: "https://bsc-dataseed.binance.org",
    },
  });

  await walletConnectProvider.enable();

  console.log("walletConnectProvider", walletConnectProvider);

  if (walletConnectProvider.connected) {
     setAddr(walletConnectProvider.accounts[0]);
  }

After trying to get connection with trust wallet. I'm getting this error:

Unhandled Rejection (Error): unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION, version=providers/5.4.1)

This is the console of walletConnectProvider

While reviewing i identified that the chainid is still 1 and rpcurl is pointing to infura.

Please help me out in this issue. Thanks

1 Answers

Hi :) try to do something like this:

infuraId: "your_infura_id",
pollingInterval: 15000,
qrcode: true,
qrcodeModalOptions: {
  mobileLinks: [
    "trust",
  ]
},
chainId: integer number with chain id like in rpc (56 for example),
rpc: your rpc object here
Related