cardano/datum

This module contains code for extracting data from a potential inline datum found in either an input or output.

Functions

input_datum(possible_input: Input) -> Data

Find the datum data on an input or error. The data is assumed to be an inline datum.

expect datum: Datum = datum.input_datum(this_input)

input_datum_by_hash(
  possible_input: Input,
  datums: Dict<Hash<Blake2b_256, Data>, Data>,
) -> Data

Find the datum data on a input by the datum hash or error. The data is assumed to be embedded data and must be referenced by its hash.

expect datum: Datum = datum.input_datum_by_hash(this_input, these_datums)

output_datum(possible_output: Output) -> Data

Find the datum data on an output or error. The data is assumed to be an inline datum.

expect datum: Datum = datum.output_datum(that_output)

output_datum_by_hash(
  possible_output: Output,
  datums: Dict<Hash<Blake2b_256, Data>, Data>,
) -> Data

Find the datum data on an output or error. The data is assumed to be embedded.

expect datum: Datum = datum.output_datum_by_hash(that_output, these_datums)
Search Document