web3modal-vanilla-js-example icon indicating copy to clipboard operation
web3modal-vanilla-js-example copied to clipboard

ERROR POST https://mainnet.infura.io/v3/ 401 when using BSC

Open PiatKox opened this issue 3 years ago • 4 comments

hello, I have the same problem to configure BSC network as described on github using vanilla JavaScript: https://github.com/Web3Modal/web3modal/issues/295

My js code:

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

  web3Modal = new Web3Modal({
    cacheProvider: false, // optional
    providerOptions, // required
    disableInjectedProvider: false, // optional. For MetaMask / Brave / Opera.
  });

ERROR POST https://mainnet.infura.io/v3/ 401 POST https://mainnet.infura.io/v3/ 401

scripts declaration in html:

<script type="text/javascript" src="https://unpkg.com/web3@latest/dist/web3.min.js%22%3E</script>
<script type="text/javascript" src="https://unpkg.com/web3modal%22%3E</script>
<script type="text/javascript" src="https://unpkg.com/evm-chains%22%3E</script>
<script type="text/javascript" src="https://unpkg.com/@walletconnect/web3-provider%22%3E</script>
<script type="text/javascript" src="./example.js"></script>

PiatKox avatar Nov 16 '21 18:11 PiatKox

Same problem here!

DeastDan avatar Mar 17 '22 15:03 DeastDan

same

Loque18 avatar Apr 21 '22 16:04 Loque18

Same problem, does anyone have a solution!

jakobj13 avatar Apr 25 '22 17:04 jakobj13

same here. A refresh of the page fix this. but not sure why.

hcheng826 avatar Aug 19 '22 02:08 hcheng826