Hello Everyone I am trying to setup WalletLink with Moralis but am stuck and not getting any errors so I am unsure what the issue is.
Could you also suggest how to get this working with ‘Ethers’ instead of ‘Web3’?
I am able to click a button to see the WalletLink popup I then scan the QR code which works fine the app lets me authenticate but then nothing happens from with my NextJS app, no errors, no user set, no change in isAuthenticated.
Wallet Link Function:
const loginWalletLink = async () => {
await authenticate({ connector: customEnable });
};
Customer Enable Function:
const customEnable = async () => {
class MoralisWalletLinkProvider {
walletLink = new WalletLink({
appName: "App Name",
appLogoUrl: "APP_LOGO_URL",
darkMode: true,
});
async activate() {
const ethereum = this.walletLink.makeWeb3Provider(
"https://mainnet.infura.io/v3/infura-api-key",
1
);
await ethereum.send("eth_requestAccounts"); //ethereum.enable(); // or ethereum.send('eth_requestAccounts')
this.web3 = new Web3(ethereum);
this.isActivated = true;
return this.web3;
}
}
const web3Provider = new MoralisWalletLinkProvider();
const web3 = await web3Provider.activate();
return web3;
};