Search code examples
javascripttrufflemetamasktronweb

How to get the current active account in tronlink using tronweb?


I'm trying to access the current logged in tronlink account to make an authentication using tronlink for my dapp. Using metamask and web3 i can get the current active account on MetaMask using:

const userPublicAddress = web3.eth.coinbase

What's the similar way of doing it with tronweb and tronlink? I havent found about this in the docs.


Solution

  • const publicAddress = tronWeb.defaultAddress.base58