UnshieldedUtxoEntity

data class UnshieldedUtxoEntity(val id: String, val transactionHash: String, val intentHash: String, val outputIndex: Int, val owner: String, val ownerPublicKey: String?, val tokenType: String, val value: String, val ctime: Long, val registeredForDustGeneration: Boolean, val state: UtxoState = UtxoState.AVAILABLE, val spentByLocalTx: Boolean = false)

Room entity for unshielded UTXO storage.

Stores UTXOs (Unspent Transaction Outputs) in local database for balance calculation.

Primary key is composite of transactionHash + outputIndex (unique identifier). Indexed on owner (address) for fast balance queries.

Note: Uses transactionHash for LOCAL primary key. However, the blockchain identifies UTXOs by intentHash + outputNo (used when building transactions).

Constructors

Link copied to clipboard
constructor(id: String, transactionHash: String, intentHash: String, outputIndex: Int, owner: String, ownerPublicKey: String?, tokenType: String, value: String, ctime: Long, registeredForDustGeneration: Boolean, state: UtxoState = UtxoState.AVAILABLE, spentByLocalTx: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val ctime: Long

Creation time (Unix timestamp in seconds).

Link copied to clipboard
val id: String

Unique identifier: "transactionHash:outputIndex"

Link copied to clipboard

Intent hash - used by the BLOCKCHAIN to identify UTXOs. When building transactions for submission, use this (not transactionHash).

Link copied to clipboard

Output index in the transaction.

Link copied to clipboard

Address that owns this UTXO (Bech32m encoded UserAddress). Format: mn_addr_network1...

Link copied to clipboard

Public key of the owner (hex-encoded compressed key, 33 bytes). Required for spending this UTXO (UtxoSpend.owner expects VerifyingKey). Null if UTXO doesn't belong to our wallet.

Link copied to clipboard

Whether this UTXO is registered for dust generation.

Link copied to clipboard
val spentByLocalTx: Boolean = false

Whether this UTXO was marked SPENT by our local transaction.

Link copied to clipboard

UTXO state (AVAILABLE, PENDING, or SPENT).

Link copied to clipboard

Token type (e.g., "DUST").

Link copied to clipboard

Transaction hash that created this UTXO. Used for local storage identifier (primary key).

Link copied to clipboard

Value in smallest unit (stored as string BigInteger).

Functions

Link copied to clipboard
fun toUtxo(): Utxo

Convert entity to domain model.