tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
423 stars 271 forks source link

How to activate an account with this module? #435

Closed ChrisYP closed 11 months ago

ChrisYP commented 11 months ago

Hi there, When I use tronWeb.transactionBuilder.sendTrx( tronWeb.address.toHex(toAddress), amount * 1000 * 1000, tronWeb.defaultAddress.hex ); method to send to an inactive account, I'll get this error: class org.tron.core.exception.ContractValidateException : Validate TransferContract error, no OwnerAccount.

How shoud I activate an account use this API instead of use Chrome extension or some wallet like that? thanks!

start940315 commented 11 months ago

You have to use an existing account to send trx to the account you need to activate. So you need to use the existing private key to instantiate tronweb.

ChrisYP commented 11 months ago

You have to use an existing account to send trx to the account you need to activate. So you need to use the existing private key to instantiate tronweb.

Thanks for your reply. Yes I was using an existing private key but still get this error. I know this is my problem, I will try to find solution, thanks again.