Skip to content

Utxo

Extends: RefCounted

Description

This class is used for representing Cardano's UTxOs, specifically their identifying attributes (TX hash and output index) but also other useful information such as the Address, [MultiAsset] value and datum information ([UtxoDatumInfo]) which can be very useful in TX tracking and building

This class is used for representing Cardano's UTxOs, specifically their identifying attributes (TX hash and output index) but also other useful information such as the Address, [MultiAsset] value and datum information ([UtxoDatumInfo]) which can be very useful in TX tracking and building

Method Descriptions

_init

func _init(utxo: _Utxo) -> Utxo

WARNING: This is for internal use. Use the [method create] method to safely construct a [Utxo].

tx_hash

func tx_hash() -> TransactionHash

Get the TransactionHash.

datum_info

func datum_info() -> UtxoDatumInfo

Get any datum information contained in this output.

datum

func datum() -> PlutusData

output_index

func output_index() -> int

Get the index of this specific output in the transaction that produced it.

address

func address() -> Address

Get the Address that locks this output.

coin

func coin() -> BigInt

Get the amount of Lovelace locked in this output.

assets

func assets() -> MultiAsset

Get all the assets (and respective quantities) locked in this output.

to_out_ref_string

func to_out_ref_string() -> String

to_script_source

func to_script_source() -> PlutusScriptSource

create (static)

func create(tx_hash: String, output_index: int, address: String, coin: String, assets: Dictionary, datum_info: UtxoDatumInfo, script_ref: PlutusScript) -> CreateResult

Construct a Utxo and other ancillary information.

Sub-classes

CreateResult

Property Descriptions

value

var value: Utxo
  • Getter: @value_getter

WARNING: This function may fail! First match on tag or call is_ok.

error

var error: String
  • Getter: @error_getter

WARNING: This function may fail! First match on tag or call is_err.

Method Descriptions

_init

func _init(results: ArrayResult) -> CreateResult