Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
How to get a list of accounts from the new MetaMask ethereum API?

MetaMask recently changed how they inject their API and no longer expose the window.web3 object.

MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3

Uncaught TypeError: web3.eth is undefined

How to get a list of accounts from the new MetaMask ethereum API?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use the window.ethereum object injected by MetaMask or other wallets.

if (typeof window.ethereum !== 'undefined') {
  // connects to MetaMask
  const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
} else {
  // tell the user to install an `ethereum` provider extension
}

This uses the new API calling an asynchronous Ethereum request on the provider. It accepts most of the Ethereum APIs and is pretty generic in the implementation.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda