Skip to content

sgns::GeniusUTXO

Immutable-style UTXO value object containing ownership, token, amount, and outpoint metadata.

#include <GeniusUTXO.hpp>

Public Functions

Name
GeniusUTXO()
Constructs an empty UTXO placeholder.
GeniusUTXO(const base::Hash256 & hash, uint32_t previous_index, uint64_t amount, TokenID token_id)
Constructs a UTXO without an owner address.
GeniusUTXO(const base::Hash256 & hash, uint32_t previous_index, uint64_t amount, TokenID token_id, std::string owner_address)
Constructs a fully specified UTXO.
void SetOwnerAddress(std::string owner_address)
Sets the owner address associated with this UTXO.
const std::string & GetOwnerAddress() const
Returns the owner address associated with this UTXO.
OutPoint GetOutPoint() const
Returns the full outpoint descriptor.
base::Hash256 GetTxID() const
Returns the originating transaction id.
uint32_t GetOutputIdx() const
Returns the output index within the originating transaction.
uint64_t GetAmount() const
Returns the unencrypted amount represented by the UTXO.
TokenID GetTokenID() const
Returns the token identifier associated with the UTXO.

Public Functions Documentation

function GeniusUTXO

inline GeniusUTXO()

Constructs an empty UTXO placeholder.

The placeholder has a default outpoint, zero amount, default token identifier, and no owner address.

function GeniusUTXO

inline GeniusUTXO(
    const base::Hash256 & hash,
    uint32_t previous_index,
    uint64_t amount,
    TokenID token_id
)

Constructs a UTXO without an owner address.

Parameters:

  • hash Hash of the transaction that produced this output.
  • previous_index Output index within the producing transaction.
  • amount Amount carried by the output.
  • token_id Token identifier carried by the output.

function GeniusUTXO

inline GeniusUTXO(
    const base::Hash256 & hash,
    uint32_t previous_index,
    uint64_t amount,
    TokenID token_id,
    std::string owner_address
)

Constructs a fully specified UTXO.

Parameters:

  • hash Hash of the transaction that produced this output.
  • previous_index Output index within the producing transaction.
  • amount Amount carried by the output.
  • token_id Token identifier carried by the output.
  • owner_address Address that owns or can spend the output.

function SetOwnerAddress

inline void SetOwnerAddress(
    std::string owner_address
)

Sets the owner address associated with this UTXO.

Parameters:

  • owner_address Address that owns or can spend the output.

function GetOwnerAddress

inline const std::string & GetOwnerAddress() const

Returns the owner address associated with this UTXO.

Return: Address that owns or can spend the output; empty when not set.

function GetOutPoint

inline OutPoint GetOutPoint() const

Returns the full outpoint descriptor.

Return: Outpoint containing the producing transaction hash and output index.

function GetTxID

inline base::Hash256 GetTxID() const

Returns the originating transaction id.

Return: Hash of the transaction that produced this output.

function GetOutputIdx

inline uint32_t GetOutputIdx() const

Returns the output index within the originating transaction.

Return: Output index within the producing transaction.

function GetAmount

inline uint64_t GetAmount() const

Returns the unencrypted amount represented by the UTXO.

Return: Amount carried by the output.

function GetTokenID

inline TokenID GetTokenID() const

Returns the token identifier associated with the UTXO.

Return: Token identifier carried by the output.


Updated on 2026-06-05 at 17:22:18 -0700