Hi there,
I am trying to make the Vanilla JS example work with trust wallet using wallet connect.
Basically I have the vanilla code, at the moment it looks like this:
async function login() {
let user = Moralis.User.current();
console.log(user);
if (!user) {
try {
const user = await Moralis.authenticate({ provider: "walletconnect" });
console.log(user);
/*
Moralis.authenticate({ signingMessage: 'TESZT', provider: 'walletconnect', chainId: 56}).then(function (user) {
console.log(user);
}).catch((err) => {
console.log(err);
});
*/
} catch(error) {
console.log(error)
}
}
}
When running this on localhost I experience the following:
I click the login button. In the console I see the wallet connect hash (wc:839ddb9d-1a81-42e1-aa13-2224ā¦) and the QR code pops up.
I read the QR with trust wallet and I get an alert, that āVanilla boilerplate wants to connect to your walletā. I click connect. After that two things happen: The QR code disappears (meaning the the desktop app knows that I clicked on the button), and trust wallet pops up the signature request confirmation. I click confirm, but after that I see no new information in my console on the desktop. Also I donāt see this wallet as a User in my Moralis server dashboard.
However if I do all of this with Metamask on my phone (so still wallet connect, but with metamask), then everything is the same, except that after signing the message the console on the desktop browser gives me the User details and the User object pops up in my Moralis admin dashboard.
So my buest guess is that somethingās wrong parsing the signed message by Trust Wallet, but since I get no errors whatsoever, I donāt know where to go next.
Any ideas on that?
Thanks,
Zoltan