kaiesh / connect-web3-wallets

Helpful JS libs to connect various self-custody web3 wallets
GNU General Public License v3.0
8 stars 5 forks source link

Is INFURA id needed or not for BSC? #1

Closed php4fan closed 2 years ago

php4fan commented 2 years ago

First of all thank you so much for this much-needed repository, it's really amazing (and it's surprising that nothing like this is provided out-of-the-box by WalletConnect and the other libraries involved - but I digress).

In your stackexchange answer https://ethereum.stackexchange.com/questions/101587/can-i-implement-walletconnect-with-vanilla-javascript you said (actually in a comment within the example code):

//An infura ID, or custom ETH node is required for Ethereum, for Binance Smart Chain you can just use their public endpoint

but then in sample.js there is:

KV.set_infuraID(YOUR_INFURA_ID);

and I don't see any mention of how to set things up for BSC without that. I tried simply removing that line, but then WalletConnect simply doesn't show up as an option under "connect your wallet" (on mobile, no option shows up at all).

kaiesh commented 2 years ago

Oh this is a good point - the logic to display WalletConnect is incorrect!

The wallet connection option should continue to be permitted in so long as the chainId is not set to the ETH network(s). So instead the option should be presented, and throw an error when initialised to an incompatible network.

I'll make this change and push!

kaiesh commented 2 years ago

@php4fan please check out the commit 95fe53 and let me know if it does what you were looking for.

kaiesh commented 2 years ago

Main branch and CDN updated with patch