Building a Wallet with Moralis APIs


I’m following Moralis tutorial on the Crypto Wallet Video on Youtube. You don’t show the very beginning of the application.

Once I add the URL and API on the main.js file and click on Open Live Server on VS Code, an empty page shows up in my browser with that pops up back and forth empty.

Please help!

Can you post your code please? What do you mean by pop up?

When I click on open live server, a white screen pops up in my browser. I don’t understand since I added the API and URL just like the tutorial says

Hi which video link is this from? I’ve looked at it and there’s a looping issue somewhere but there’s already a lot of code in it. Did it work at all before? Or did you just copy everything?

That video. I didn’t add or change any line of code. The video just shows you the app right away but doesn’t show you how to run it correctly first at the beginning.

If you clone the repo for that tutorial and run it, it will give you the same results. The code in the repo is either missing something or there is a mistake if one of the html files I’m guessing.

Thank you, you’re right it already has issues.

If you comment out the // REDIRECT USER BASED ON STATUS code in main.js you can get to the starting login page. Let me know if you get any further issues.

It works now, however, I’m not able to sign in with my Metamask wallet even though my account is opened. I tried Rinkebym Ropsten and Mainnet networks.

I’m just seeing the dashboard.html and index.html but not able to interact with them. I’m going through the moralis docs. Can’t find a straight solution here to this problem

login = async () => {
await Moralis.Web3.authenticate()
.then(async function (user) {
let _username = document.getElementById(‘user-username’).value;
let _email = document.getElementById(‘user-email’).value;
if(_username != ‘’ || _email != ‘’){
if(_username != ‘’){user.set(“name”, _username);}
if(_email != ‘’){user.set(“email”, _email);}
window.location.href = “dashboard.html”;

if (Moralis.User.current() != null && window.location.href == homepage) {
window.location.href = “dashboard.html”;

logout = async () => {
await Moralis.User.logOut();
window.location.href = “index.html”;

Is the login function assigned to a button on click event? or you could try manually running the function to see if the function is loaded on the page.

Is your JS scripts added into these HTML pages?

Fixed it, it was just the javascript functions that I had to change now in the main.js

Thank you