WalletToolsLTC implements IWalletTools { @Override public String getWalletAddressFromPrivateKey(String privateKey, String cryptoCurrency) { DumpedPrivateKey dp = DumpedPrivateKey.fromBase58(MainNetParams.get(),privateKey); return (Address.fromKey(MainNetParams.get(),dp.getKey(), Script.ScriptType.P2PKH)) +""; }  @Override String generateSeedMnemonicSeparatedBySpaces(); MasterPrivateKeyLTC getMasterPrivateKey(String seedMnemonicSeparatedBySpaces, String password, String cryptoCurrency, int standard); @Override MasterPrivateKeyLTC getMasterPrivateKey(String prv, String cryptoCurrency, int standard); @Override String getWalletAddress(IMasterPrivateKey master, String cryptoCurrency, int accountIndex, int chainIndex, int index); @Override String getWalletAddressFromAccountPUB(String accountPUB, String cryptoCurrency, int chainIndex, int index); @Override String getWalletPrivateKey(IMasterPrivateKey master, String cryptoCurrency, int accountIndex, int chainIndex, int index); @Override String getAccountPUB(IMasterPrivateKey master, String cryptoCurrency, int accountIndex); @Override String getWalletAddressFromPrivateKey(String privateKey, String cryptoCurrency); boolean isAddressValid(String address, String cryptoCurrency); @Override ISignature sign(String privateKey, byte[] hashToSign, String cryptoCurrency); @Override Classification classify(String input, String cryptoCurrencyHint); @Override Classification classify(String input); @Override Set<String> supportedCryptoCurrencies(); String generateWalletPrivateKeyWithPrefix(String prefix, String cryptoCurrency); static final int XPUB; static final int XPRV; static final int YPUB; static final int YPRV; }
@Test public void getWalletAddressFromPrivateKey() { String walletAddressFromPrv = walletToolsLTC.getWalletAddressFromPrivateKey(walletToolsLTC.getWalletPrivateKey(masterPrivateKey, "LTC", 0, 2, 3), "LTC"); Assert.assertEquals("LTxvErfUMbp7zc2wc79GM8YpvJQEzVH4vA", walletAddressFromPrv); }