walletconnect-monorepo
walletconnect-monorepo copied to clipboard
How to enable WalletConnect to directly connect to Binance Smart Chain instead of Ethereum?
Discussed in https://github.com/WalletConnect/walletconnect-monorepo/discussions/1207
Originally posted by devturi July 1, 2022
I am working on a DAPP which works on Binance Smart Chain. Now, when I scan the qrcode with trust wallet, it shows Ethereum Chain by default and I have to change it manually to Binance Smart Chain from the option. However, this does not look good. Normally on metamask, I can use
await window.ethereum.request({ method: "wallet_addEthereumChain", params: [ { ...networks2[networkName], }, ], }); } catch (err) { console.error(err); // setError(err.message); }
However, on trust wallet, I dont get to change the network once walletConnect connection is established. So, I need to enable BSC before the connection. Can anyone please help?
Hello how are you
I found a solution here #529
try { console.log("Log in with connect wallet") const provider = new WalletConnectProvider({ rpc: { 56: 'https://bsc-dataseed.binance.org/', }, network: 'binance', chainId: 56, }); await provider.enable(); const web3 = new Web3(provider); resolve(web3) } catch { console.log("Install metamask or use wallet connect") }
this was added to make it work directly note on metamask it might still use the ethereum chain by default I hope it helps
the line in question everything must be added to the new WalletconnectProvider instance rpc: { 56: 'https://bsc-dataseed.binance.org/', }, network: 'binance', chainId: 56,
@tomisinteazer Is there an rpc for stellar? Or do you have a solution for stellar chains to work instead of Ethereum?
Is this still an issue?
It is still an issue as far as I can tell
I’m closing this issue because it has been inactive for a few months.
This feature is now available on Web3Modal v2
Please reopen if you still encounter this issue with the latest version :)