Hell, everybody.
I am having issues with migrating from Wallet Connect V1 to V2.
I have a package registry called Reusable Component Library which all of my dApps are using as one of my components is the Wallet Connect button.
I am using enableWeb3 and so far the code responsible for the connect wallet button looks like this:
export const ConnectOptions = ({ onClose }: Closeable) => {
const { theme, isWhiteLabel } = useCitadelContext();
const { account, enableWeb3 } = useMoralis();
const providers = [
{
content: "Metamask",
url: "https://cdn.protoverse.ai/assets/common/metamask-icon.svg",
provider: "metamask",
},
{
content: "Wallet Connect",
url: "https://cdn.protoverse.ai/assets/common/walletconnect-icon.svg",
provider: "walletconnect",
},
];
I have followed this: https://github.com/MoralisWeb3/Moralis-JS-SDK-v1/tree/main/demos/walletconnect-v2 and created this version of the code:
export const ConnectOptions = ({ onClose }: Closeable) => {
const { theme, isWhiteLabel } = useCitadelContext();
const { account, enableWeb3 } = useMoralis();
const providers = [
{
content: "Metamask",
url: "https://cdn.protoverse.ai/assets/common/metamask-icon.svg",
provider: "metamask",
},
{
content: "Wallet Connect",
url: "https://cdn.protoverse.ai/assets/common/walletconnect-icon.svg",
provider: "walletconnect",
onClick: () => {
enableWeb3({
provider: 'walletconnect',
projectId: 'c1b4d01d68cdb162f08d96f772c70d7e',
qrModalOptions: { themeMode: 'light' },
});
}
}
,
];
Sadly it is not working, because currently when I click on Wallet Conenct at my dApp nothing happens. MetaMask is still working fine.
Can you suggest me a solution?
Best regards,
Mike//