Skip to main content
5 of 5
deleted 66 characters in body; edited tags
Eric Lee
  • 161
  • 2
  • 8

WalletConnect web3 provider issue with TrustWallet (Multi-coin wallet)

I am using walletconnect/web3-provider to try to connect to trustwallet ios APP. My config on walletconnect is listed below:

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    // provider.networkId = 56;
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It is normally connected to the wallet, but it is not working right. So I check the provider and find out that the chain ID is pointing to "1" instead of the BSC chainID "56". see below: enter image description here

Am I doing anything not correct?

Eric Lee
  • 161
  • 2
  • 8