Class UTXO
java.lang.Object
com.barbantfintech.tools.common.cryptojdk.tx.UTXO
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 Summary
Constructors -
Method Summary
-
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 transactiontxRawData
- the full raw (hex) data of the transactionindex
- the index to spend from the transactionprivKey
- the private key of the address of the index
-