public class TronWallet extends Object
| Constructor and Description |
|---|
TronWallet()
Creates a new instance of TronWallet
|
TronWallet(File file,
String password)
Creates a new instance of TronWallet from a file
|
TronWallet(TronPrivateKey privKey)
Creates a new instance of TronWallet from a private key
|
| Modifier and Type | Method and Description |
|---|---|
TronAddress |
getAddress() |
ECKey |
getKey() |
TronPrivateKey |
getPrivateKey() |
String |
getWalletJson(String password)
Obtains the wallet as JSON.
|
String |
saveToFile(File dest,
String password)
Saves a wallet to a file.
|
void |
writeToFile(File file,
String password)
Writes the wallet to a file.
|
public TronWallet()
public TronWallet(TronPrivateKey privKey)
privKey - The private keypublic TronWallet(File file, String password) throws IOException, CipherException
file - The filepassword - The passwordIOException - If the file read failsCipherException - If the password is wrongpublic ECKey getKey()
public TronPrivateKey getPrivateKey()
public TronAddress getAddress()
public String saveToFile(File dest, String password) throws IOException, CipherException
dest - The destination directorypassword - The password for the wallet.IOException - If the file cannot be written.CipherException - If the password is invalid.public void writeToFile(File file, String password) throws CipherException, IOException
file - The file to write the wallet as JSON.password - The password for the wallet.CipherException - If the password is invalid.IOException - If the file cannot be written.public String getWalletJson(String password) throws CipherException, IOException
password - The password for the wallet.CipherException - If the password is invalid.IOException - If the wallet cannot be serialized.Copyright © 2020. All rights reserved.