Utils

scalus.cardano.onchain.plutus.v3.Utils
object Utils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Utils.type

Members list

Value members

Concrete methods

def findInput(inputs: List[TxInInfo], outRef: TxOutRef): Option[TxInInfo]

Finds an input in the list of inputs by its out reference.

Finds an input in the list of inputs by its out reference.

Value parameters

inputs

The list of inputs to search in.

outRef

The output reference to find.

Attributes

Returns

An Option containing the found input, or None if not found.

Calculates the total amount of ADA (Lovelace) from a list of transaction inputs.

Calculates the total amount of ADA (Lovelace) from a list of transaction inputs.

Value parameters

inputs

the list of transaction inputs to sum

Attributes

Returns

the total Lovelace amount from all resolved inputs

Example
val inputs = List(TxInInfo(...), TxInInfo(...))
val totalAda = Utils.getAdaFromInputs(inputs)
// Returns the sum of Lovelace from all resolved input outputs
// Returns BigInt(0) if the list is empty

Calculates the total amount of ADA (Lovelace) from a list of transaction outputs.

Calculates the total amount of ADA (Lovelace) from a list of transaction outputs.

Value parameters

outputs

the list of transaction outputs to sum

Attributes

Returns

the total Lovelace amount from all outputs

Example
val outputs = List(TxOut(...), TxOut(...))
val totalAda = Utils.getAdaFromOutputs(outputs)
// Returns the sum of Lovelace from all outputs
// Returns BigInt(0) if the list is empty

Concrete fields

lazy val sirDeps: List[SIRModuleWithDeps]
lazy val sirModule: Module