G3root/nextjs-dapp-starter-ts

[Bug]: `Say it!!` doesn't work on wallet connect

shunkakinoki opened this issue · 0 comments

Context / Background / How This Idea Came To Fruition

Hi @G3root
This repo is very awesome. Thank you for your work!
Just wanted to see if i can improve upon this.

Problem / Opportunity

Wanted to implement walletconnect but came up with some issues

Proposed Solution / How It Can Be Improved

Is there anyway we can implement wallet connect on the below?

    async function fetchStore() {
      if (hasEthereum) {
        const provider = new ethers.providers.Web3Provider(
          window.ethereum as any
        );
        const storageContract = Storage__factory.connect(
          contractAddress,
          provider
        );
        try {
          const data = await storageContract.retrieve();
          setCurrentStore(data);
        } catch (err) {
          console.log("EfetchStorerror: ", err);
        }
      }
    }

Testing the changes

n/a

Additional Information

No response