WalletConnect v1.0 will be officially deprecated on March 1, 2023 .
(https://medium.com/walletconnect/walletconnect-v1-0-sunset-notice-and-migration-schedule-8af9d3720d2e)
Moralis documentation still didn’t provide tutorial how to easily set up Moralis auth for every possible wallet using WalletConnect V2.
(https://docs.moralis.io/authentication-api/how-to-sign-in-with-walletconnect)
One of the key changes is in modalConnectors struct from @web3modal/ethereum
import {
EthereumClient,
modalConnectors,
walletConnectProvider,
} from "@web3modal/ethereum";
//modalConnectors
(alias) function modalConnectors({ appName, chains, version, projectId }: ModalConnectorsOpts): (WalletConnectConnector | InjectedConnector | CoinbaseWalletConnector)[]
import modalConnectors
Now you can’t pass the connector as described in Moralis docs:
function SignIn() {
const { connectAsync } = useConnect({
connector: new WalletConnectConnector({ options: { qrcode: true } }),
});
Because even wagmi WalletConnectProvider is for V1, and there is completely new UniversalProvider for V2 (check wagmi /docs/connectors/walletConnect).
First of all I advise the developers to add this info to the docs and make changes asap.
What’s best way to solve this now to implement Moralis authentication wrapped in wagmi using WalletConnect V2?