Skip to content

UtxoEntry (Class)

An unspent transaction output (UTXO).

Represents a spendable output from a previous transaction. Contains information about the amount, locking script, and block position.

address property

address: Optional[Address]

The address associated with this UTXO, or None if not available.

amount property

amount: int

The amount in sompi (1 KAS = 100,000,000 sompi).

block_daa_score property

block_daa_score: int

The DAA score of the block containing this UTXO.

is_coinbase property

is_coinbase: bool

Whether this UTXO is from a coinbase transaction.

outpoint property

The outpoint identifying this UTXO.

script_public_key property

script_public_key: ScriptPublicKey

The locking script for this UTXO.

__eq__

__eq__(other: UtxoEntry) -> bool

from_dict classmethod

from_dict(dict: dict) -> UtxoEntry

Create a UtxoEntry from a dictionary.

PARAMETER DESCRIPTION
dict

Dictionary containing utxo entry fields with keys: - 'address' (str | None): The address string - 'outpoint' (dict): Transaction outpoint with 'transactionId' and 'index' - 'amount' (int): The UTXO value in sompi - 'scriptPublicKey' (dict): Dict with 'version' (int) and 'script' (str) keys - 'blockDaaScore' (int): Block DAA score - 'isCoinbase' (bool): Whether from coinbase transaction

TYPE: dict

RETURNS DESCRIPTION
UtxoEntry

A new UtxoEntry instance.

TYPE: UtxoEntry

RAISES DESCRIPTION
KeyError

If required keys are missing.

ValueError

If values are invalid.

to_dict

to_dict() -> dict

Get a dictionary representation of the UtxoEntry. Note that this creates a second separate object on the Python heap.

RETURNS DESCRIPTION
dict

the UtxoEntry in dictionary form.

TYPE: dict