async connectWallet() {
try {
// get injected ethereum from metamask
const { ethereum } = window;
if (!ethereum) {
alert("Ethereum Provider does not exist, get metamask");
return;
}
// request accounts
const accounts = await ethereum.request({
method: "eth_requestAccounts",
});
this.setCurrentAccount(accounts[0]);
} catch (error) {
console.log(error);
}
},
Created
November 9, 2022 12:33
-
-
Save johnexzy/b69197f7b291b17f5142d329a4302e17 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment