const API = "../backend/api";

async function checkUser(wallet){
  const res = await fetch(`${API}/check-user.php`,{
    method:'POST',
    headers:{'Content-Type':'application/json'},
    body:JSON.stringify({wallet})
  });
  return res.json();
}

async function signup(data){
  const res = await fetch(`${API}/signup.php`,{
    method:'POST',
    headers:{'Content-Type':'application/json'},
    body:JSON.stringify(data)
  });
  return res.json();

}
function logout() {
  // Remove wallet from browser
  localStorage.removeItem("wallet");

  // Redirect to connect page
  window.location.href = "../frontend/index.html";
}
