scalus.prelude
Members list
Packages
Type members
Classlikes
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Validator, parametrized by Data. Keep
Validator, parametrized by Data. Keep
Needed for compability with solutions which use existing uplc scripts and apply Data as parameter on UPLC level.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
EqCompanion.type
Attributes
- Companion
- object
- Supertypes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Alternative to scala.collection.immutable.SortedMap
in onchain code.
Alternative to scala.collection.immutable.SortedMap
in onchain code.
Type parameters
- A
-
the type of keys, must be an instance of
Ord
- B
-
the type of values
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Types
Value members
Concrete methods
???
can be used for marking methods that remain to be implemented.
???
can be used for marking methods that remain to be implemented.
Attributes
- Throws
-
NotImplementedError
when
???
is invoked.
Fails the onchain evaluation with an ERROR
term and a specific error message.
Fails the onchain evaluation with an ERROR
term and a specific error message.
This is used to indicate a failure in the on-chain logic with a specific error message.
Value parameters
- message
-
The error message to include in the failure.
Attributes
- Throws
-
OnchainError
when invoked off-chain.
Fails the onchain evaluation with an ERROR
term.
Fails the onchain evaluation with an ERROR
term.
This is used to indicate a failure in the on-chain logic without providing a specific error message.
Attributes
- Throws
-
OnchainError
when invoked off-chain.
Fails the onchain evaluation with an ERROR
term indicating an impossible situation.
Fails the onchain evaluation with an ERROR
term indicating an impossible situation.
This is used to indicate an impossible situation in the on-chain logic.
Attributes
- Throws
-
ImpossibleLedgerStateError
when invoked off-chain.
Tests an expression, throwing an RequirementError
if false.
Tests an expression, throwing an RequirementError
if false.
Value parameters
- requirement
-
the expression to test
Attributes
- Throws
-
RequirementError
when invoked off-chain.
- Note
-
we do not use scala.Predef.require because it's not an
inline
method and it's not expanded before Scalus compiler plugin phase. - Example
-
require(value > 1000, "Not enough")
Tests an expression, throwing a RequirementError
if false.
Tests an expression, throwing a RequirementError
if false.
This is used to enforce preconditions in on-chain logic.
Value parameters
- requirement
-
The boolean expression to test.
Attributes
- Throws
-
RequirementError
when invoked off-chain.
- Example
-
require(value > 1000)
Concrete fields
Givens
Givens
Extensions
Extensions
Converts a scala.Seq to a List
.
Converts a scala.Seq to a List
.
This method is only available offchain.
Attributes
- Returns
-
A
List[A]
containing all the elements from this sequence in the same order. - Example
-
scala.Seq.empty[BigInt].asScalus === List.empty[BigInt] val seq: scala.Seq[BigInt] = scala.Seq(BigInt(1), BigInt(2), BigInt(3)) seq.asScalus === Cons(BigInt(1), Cons(BigInt(2), Cons(BigInt(3), Nil)))
Trace the expression only if it evaluates to false
. This is useful to trace an entire evaluation path that led to a final expression being false
.
Trace the expression only if it evaluates to false
. This is useful to trace an entire evaluation path that led to a final expression being false
.
Attributes
- Returns
-
the value of the expression
- Example
-
mustBeAfter.? && mustSpendToken.?
will trace "mustSpendToken ? False" if
mustBeAfter
istrue
andmustSpendToken
isfalse
.