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

326
Views
I can't get data from Ethers.js signer.getAddress() function

I can't get the value from the signer.getAddress() function on Ethers.js. When I try to use "alert" or "console.log" it is fine but I want to display directly on the page. It says; "object Promise".

Here is the my code:

import "./App.css";
import { ethers } from "ethers";

function App() {
  const provider = new ethers.providers.Web3Provider(window.ethereum, "any");
  const signer = provider.getSigner();

  async function connectMetamask() {
    await provider.send("eth_requestAccounts", []);
  }

  async function myAddress() {
    await signer.getAddress();
  }

  return (
    <div className="general">
      <div className="web3-loader">
        <button className="button1" onClick={connectMetamask}>
          Connect Metamask
        </button>
      </div>
      <br></br>
      <div className="input-area">
        <label>{"Your address is: " + myAddress()} </label>
        <br></br>
        <label>Recipient address:</label>
        <input
          type="text"
          placeholder="Receiver address"
          className="input2"
        ></input>
        <br></br>
        <label>Amount:</label>
        <input
          type="text"
          placeholder="Amount of ETH"
          className="input3"
        ></input>
      </div>
    </div>
  );
}

export default App;

about 4 years ago · Juan Pablo Isaza
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!