WalletConnect and BSC

Hi!

Great work on the walletconnect integration. I am trying to make use of this over BSC and am unsure how to specify the chainId. Web3 works great on metamask as the chain is set in the wallet, but for a wallet like trust wallet it isn’t. I think therefore we need to have a way to specify the chain, either in the instantiation of the walletconnect web3 object or on subsequent contract calls.

At the moment if I connect using walletconnect it assumes at ethereum connection and eth as the platform token. I’m looking for someway to default this to BSC and have the signing flow match that required for BSC and its Amino implementation. (https://docs.binance.org/guides/concepts/walletconnect.html).

Thank you!

I have the same issue, currently.

@keyoke I think currently the only way is to create your own custom Walletconnect provider until the Moralis solves this on their end. I will try to get into that today I think. But if anyone has some snippets to share, that would be helpful :slight_smile:

Hi @pasevin, I wondered the same thing too. Sounds like fun!! I wondered at first if we would need to handle all the message flow stuff from the binance article I linked above, but on reflection I don’t think we do. That’s the wallets job. So it’s a case of letting the connection know this is BSC and not eth. One thought I had was to dig through the code on somewhere like pancakeswap and see how that implemented. I won’t get time for a while though alas. Production release of my dapps in seven days! :grin: :grimacing:

Hey @pasevin @keyoke

Take a look at:

https://docs.moralis.io/moralis-server/users/crypto-login#specify-the-chain-id

Amazing @Yomoo! And so I know I’m not going crazy, that part is new, right? I scoured that doc and am hoping I didn’t just miss it :grinning:. Also, I did try that parameter in the call on the chance it would work. But maybe I capitalised both I and D in Id :rofl:. Thank you team moralis!

Nice, thanks for a quick update! I will try tomorrow, and come back.

1 Like

@keyoke @pasevin

It’s an update.
Let me know how it will work :slight_smile:

1 Like

@Yomoo Phew! Was wondering how I could have missed it :).

Thank you, will test later today! :man_mechanic:

2 Likes

Hey, the npm update not out yet? I still see 0.0.33.

1 Like

Hey @pasevin

Excuse me, at that time, the update had not yet been released.
In 5 minutes you can update.

Happy BUIDLing :man_mechanic:

1 Like

Thanks, I was getting confused :))

1 Like

Alright, we’re back in business! Can confirm v0.0.34 fixed this issue.

3 Likes