question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binance Smart Chain (BSC) Error!

See original GitHub issue

Hello, I am trying to use walletConnect to connect to BSC. I am giving the params as:

 package: WalletConnectProvider,
        options: {
          rpc: {
            56: 'https://bsc-dataseed1.defibit.io/'
          },
          chainId: 56,
        }
      }

I am getting error:

index.ts:74 POST https://mainnet.infura.io/v3/ 401 Screenshot 2021-03-04 at 18 07 35

When adding the infuraId i am getting chainId 1 in provider network settings. Since I am using the provider to connect to a smart contracts in that network, I cannot connect because the chainId is wrong.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
atropos0902commented, May 18, 2021

@djmbritt @danielmedvec I just set the provider options like this.

const providerOptions = {
  walletconnect: {
    package: WalletConnectProvider,
    options: {
      rpc: {
         56: 'https://bsc-dataseed.binance.org/'
      },
      network: 'binance',
    }
  }
};

and then

const web3Modal = new Web3Modal({
  cacheProvider: true, // optional
  providerOptions // required
});

const provider = await web3Modal.connect();
const web3 = new Web3(provider);

Make sure you are using the latest version of web3modal package.

4reactions
phanthai12commented, Apr 3, 2021

Try it:

const web3Modal = new Web3Modal({
    network: "binance", // replace mainnet to binance
    cacheProvider: true, // optional
    providerOptions, // required
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the problem with Binance Smart Chain (BSC)? - BitKan
According to Binance, the reason for BSC's overflow is due to a "huge interest in projects building on it." In fact, one of...
Read more >
Binance's BNB Smart Chain halts after $100 million exploit ...
An exploit on a cross-chain bridge, BSC Token Hub, resulted in extra BNB. We have asked all validators to temporarily suspend BSC. The...
Read more >
BSC is a lost cause · Issue #553 · bnb-chain/bsc - GitHub
As someone else already wrote, the root cause of the problem is that you mindlessly increased the blocksize and reduced the blocktime without...
Read more >
Troubleshooting Metamask Binance Smart Chain
Welcome to this post, we are going to look at the most common errors that happen in the binance Smart chain with Metamask...
Read more >
Error Binance Smart Chain ? True / Error Address of Network ...
It sounds like you may have incorrectly configured Binance Smart Chain. I'd recommend first trying to remove the BSC network from your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found