java.lang.Object
com.barbantfintech.tools.common.cryptojdk.tx.TxReceiver

public class TxReceiver extends Object
Represents a recipient of a cryptocurrency transaction. This class is used in the context of Bitcoin transactions to specify the address and amount of coins to be sent to a receiver.

Usage Example in Bitcoin Transactions:


 TxReceiver[] txReceivers = {
     new TxReceiver("bitcoinAddress1", new BigDecimal("0.05")),
     new TxReceiver("bitcoinAddress2", new BigDecimal("0.10"))
 };

 CryptoJDK.Transaction.Bitcoin.sign(coin, network, utxos, txReceivers);
 

This class is utilized in the following scenarios:

  • To specify the recipient addresses of a Bitcoin transaction.
  • To ensure the amount specified for each recipient is correctly formatted and within valid scale limits.
  • To add outputs to a Bitcoin transaction, specifying the address and amount for each TxReceiver.
  • Constructor Details

    • TxReceiver

      public TxReceiver(@NonNull @NonNull String address, @NonNull @NonNull BigDecimal amount)
      Constructs a new TxReceiver with the specified address and amount.
      Parameters:
      address - the address of the receiver
      amount - the absolute value in full units to be sent to the receiver