walletconnect-monorepo icon indicating copy to clipboard operation
walletconnect-monorepo copied to clipboard

How to enable WalletConnect to directly connect to Binance Smart Chain instead of Ethereum?

Open devturi opened this issue 2 years ago • 3 comments

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?

devturi avatar Jul 01 '22 16:07 devturi

Hello how are you

Horlarhold avatar Jul 17 '22 00:07 Horlarhold

I found a solution here #529

tomisinteazer avatar Aug 11 '22 20:08 tomisinteazer

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 avatar Aug 11 '22 20:08 tomisinteazer

@tomisinteazer Is there an rpc for stellar? Or do you have a solution for stellar chains to work instead of Ethereum?

FosterSOAsare avatar Sep 22 '22 15:09 FosterSOAsare

Is this still an issue?

finessevanes avatar Feb 16 '23 10:02 finessevanes

It is still an issue as far as I can tell

EvanTedesco avatar Mar 05 '23 02:03 EvanTedesco

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 :)

glitch-txs avatar Aug 06 '23 08:08 glitch-txs