Hello, if I connect to website via MetaMask, I know that my wallet can be displayed by JavaScript.
Which request would I use for sending a account value to server? I think the server will probably be running NodeJs.
const ethereumButton = document.querySelector('.enableEthereumButton');
const showAccount = document.querySelector('.showAccount');
ethereumButton.addEventListener('click', () => {
getAccount();
});
async function getAccount() {
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const account = accounts[0];
showAccount.innerHTML = account;
}
Thank you