Get the address of the connected wallet as a string. #2707
Answered
by
zemse
andreitoma8
asked this question in
Q&A
-
Noob here with a noobish question: How can I get the address of the connected wallet as a String? I tried using "const address = signer.getAddress()" but it seems it returns an object. |
Beta Was this translation helpful? Give feedback.
Answered by
zemse
Mar 8, 2022
Replies: 1 comment 1 reply
-
Hey @andreitoma8, await signer.getAddress()
// or
signer.getAddress().then((addr) => {
console.log(addr)
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
andreitoma8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @andreitoma8,
signer.getAddress()
returns a Promise object. In order to see the resolved value you can use ES8 await syntax or ES6 dot then syntax.