Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!