Utils
scalus.cardano.onchain.plutus.v3.Utils
object Utils
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Utils.type
Members list
Value members
Concrete methods
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
Optioncontaining the found input, orNoneif 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
In this article