You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stringpassword = "123456";
StringtoAddress = "33sXfhCBPyHqeVsVthmyYonCBshw5XJZn9";
intchangeIdx = 0;
longamount = 1000L;
longfee = 555L;
//utxos needs to go to the node or external api to getArrayList<BitcoinTransaction.UTXO> utxos = newArrayList();
BitcoinTransactionbitcoinTransaction = newBitcoinTransaction(
toAddress,
changeIdx,
amount,
fee,
utxos
);
Walletwallet = WalletManager.findWalletByAddress(ChainType.BITCOIN, "33sXfhCBPyHqeVsVthmyYonCBshw5XJZn9");
TxSignResulttxSignResult = bitcoinTransaction.signTransaction(
String.valueOf(ChainId.BITCOIN_MAINNET),
password,
wallet
);
System.out.println(txSignResult);
TRON
Stringfrom = "TJRabPrwbZy45sbavfcjinPJC18kjpRTv8";
Stringto = "TF17BgPaZYbz8oxbjhriubPDsA7ArKoLX3";
longamount = 1;
Stringpassword = "123456";
Walletwallet = WalletManager.findWalletByAddress(ChainType.BITCOIN, "TJRabPrwbZy45sbavfcjinPJC18kjpRTv8");
TronTransactiontransaction = newTronTransaction(from, to, amount);
//Offline signature, it is not recommended to sign and broadcast togetherTxSignResulttxSignResult = transaction.signTransaction(String.valueOf(ChainId.BITCOIN_MAINNET), password, wallet);
System.out.println(txSignResult);
Note: This is just a functional component of a digital currency! ! ! It is only for learning and does not provide complete blockchain business functions
About
The core components of the blockchain wallet backend, support a variety of blockchain address generation and offline signatures