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

public class UTXO extends Object
Represents an Unspent Transaction Output (UTXO) in a blockchain transaction. This class is used to encapsulate the details of a UTXO, which includes the transaction id, raw transaction data, index, and the private key associated with the address at the specified index.

By using Lombok annotations, this class:

  • Generates getter and setter methods.
  • Generates a no-argument constructor.
  • Generates a toString method.
  • Generates equals and hashcode methods based on field values.
  • Sets all fields to private by default.

This class is commonly used when dealing with the inputs required to create a new transaction, where UTXOs from previous transactions are spent.

  • Constructor Details

    • UTXO

      public UTXO(@NonNull @NonNull String txId, @NonNull @NonNull String txRawData, @NonNull @NonNull Integer index, @NonNull @NonNull String privKey)
      Constructs a new UTXO with the given parameters.
      Parameters:
      txId - the id (hash) of the transaction
      txRawData - the full raw (hex) data of the transaction
      index - the index to spend from the transaction
      privKey - the private key of the address of the index