Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 539 Bytes

read.md

File metadata and controls

24 lines (17 loc) · 539 Bytes
  1. first we will create the function to sign in to metamask for the sign in button

// creating the connect function

async function connect (){ if( typeof window.ethereum != undefined){ // now put the if part under try and catch

    try{
        console.log("connecting");
        await ethereum.request({method: 'eth_request_Accounts'})

    }
    catch(e){
      console.log(e);
    }

}
else{
  document.getElementById("login_button").innerHTML = "Please install metamask"
}

}