1

I am using an example from the WalletConnect documentation:

public async connectWalletConnect() {
    //  Create WalletConnect Provider
    const provider = new WalletConnectProvider({
      infuraId: '5234234fdsfewr34234324fdfs',
    });
    //  Enable session (triggers QR Code modal)
    await provider.enable();
    this.web3 = new Web3(provider);
  }

But I got this error inside new Web3(provider)

Argument of type 'WalletConnectProvider' is not assignable to parameter of type 'provider'.
  Type 'WalletConnectProvider' is not assignable to type 'string'.

Help, please)

1

This issue is due to typescripts typechecking, one hack to bypass it is to typecast provder as <any>provider in this.web3 = new Web3(<any>provider)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.