Skip to main content
1 of 5
Eric Lee
  • 161
  • 2
  • 8

walletConnect with BSC

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP.

I simply install the npm package "@walletconnect/web3-provider". with the following code:

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

It seems to work normally in the beginning because the QR code pops up and I can use my trust wallet to scan and connect it. And then I found out it seems not to able to send transactions with the following error message on the console:

[Error] Failed to load resource: the server responded with a status of 401 ()  https://mainnet.infura.io/v3(v3, line 0)

It will be appreciated if anyone teaches me how to make it work.

Eric Lee
  • 161
  • 2
  • 8