tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
388 stars 259 forks source link

How can I get a public key? #489

Closed doob9p closed 3 months ago

doob9p commented 4 months ago

I've read all the documents and there's no way to get a public key using a private key or a mnemonic. Is it possible to transfer coins while the user only has a private key?

start940315 commented 4 months ago

Did you mean get the address of the account? You can use tronWeb.address.fromPrivateKey.

doob9p commented 4 months ago

Did you mean get the address of the account? You can use tronWeb.address.fromPrivateKey.

tronWeb.address.fromPrivateKey The code returns the wallet address. All I want is to return the public key as a factor for the private key.

start940315 commented 4 months ago

If you have mnemonic, you can use TronWeb.fromMnemonic to get the public key.

Spyder15 commented 3 months ago

you can go with tronWeb.address.fromPrivateKey