Which request is used for sending a const account wallet value to a server?

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', () => {

async function getAccount() {
  const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
  const account = accounts[0];
  showAccount.innerHTML = account;

Thank you

1 Like


You do not need a server - this is a step towards centralization. A smart contract completely replaces the server.


I know but if I would like to work with address due to analytics, is there any way?


Get analytics addresses directly from your contract.
Any interaction with the contract is public.


This topic was automatically closed after 30 days. New replies are no longer allowed.