Moralis connectorType and connector returns undefined

I am checking connectorType after walletconnect, but every time it returns undefined.

async function walletConect() {
    
    user = Moralis.User.current();
    if (!user) {
     user = await Moralis.authenticate({ 
            provider: "walletconnect", 
            chainId: 56,
            // signingMessage: "Welcome" 
        }).then(function (user) {
          })
          .catch(function (error) {
            console.log(error);
        });
    web3 = await Moralis.enableWeb3({ provider: "walletconnect", chainId: 56 });

    const connectorType =  Moralis.Web3.connectorType;
    if(connectorType === 'injected'){
    console.log(Moralis.Web3.connectorType)
    }

    const connector = Moralis.Web3.connector;
    console.log(connector)
    }   
}

What version of the moralis SDK do you use?
Do you have at least v1.0.0 installed?

I just ran your code and got a console.log with the walletConnect connector

I am using 0.0.184 Version Because I can’t solve this problem [Missing @walletconnect/web3-provider], I am using only javascript and HTML.

Ah, ok. connector and connectorType were only introduced in v1.0.

So you might need to find another way to do what you need, or wait until we resolve the walletconnect provider issue.

1 Like