Greetings.
I tried following the steps explained here
https://docs.moralis.io/moralis-server/users/crypto-login#walletconnect
so that wallet connect can be used as a provider
React is being used for the front end
hereās my package.json file
ā@walletconnect/web3-providerā: ā^1.6.5ā,
āreact-moralisā: ā^0.2.1ā,
āmoralisā: ā^0.0.37ā,
Hereās the code where Iām authenticating and then enabling web3
await this.props.authenticate({ provider: "walletconnect", chainId: 56}).then(async () => {
if (!this.props.authError) {
this.props.enableWeb3({ provider: "walletconnect", chainId: 56}).then(async () => {
I can confirm that this is working as in the QR code modal is poping up authentication is possible everything works as expected besides being able to specify the network.
Once the user has been authenticated and web3 has been enabled iām doing a quick check
using this ->
let chainIdHex = this.props.Moralis.Web3.activeWeb3Provider.web3.currentProvider.chainId;
console.log(chainIdHex);
Which returns 1
I also checked what i had as properties in the web3 object using console.log and the rpcās are there
1: "https://speedy-nodes-nyc.moralis.io/WalletConnect/eth/mainnet"
3: "https://speedy-nodes-nyc.moralis.io/WalletConnect/eth/ropsten"
4: "https://speedy-nodes-nyc.moralis.io/WalletConnect/eth/rinkeby"
5: "https://speedy-nodes-nyc.moralis.io/WalletConnect/eth/goerli"
42: "https://speedy-nodes-nyc.moralis.io/WalletConnect/eth/kovan"
56: "https://speedy-nodes-nyc.moralis.io/WalletConnect/bsc/mainnet"
97: "https://speedy-nodes-nyc.moralis.io/WalletConnect/bsc/testnet"
137: "https://speedy-nodes-nyc.moralis.io/WalletConnect/polygon/mainnet"
80001: "https://speedy-nodes-nyc.moralis.io/WalletConnect/polygon/mumbai"
However instead of using chainId 56 for bsc mainnet which was passed as option on both methods
the web3 provider is using chainId 1.
What am I missing ?
Thanks in advance and lots of regards.