scalus.uplc.Constant
See theConstant companion trait
object Constant
Attributes
Members list
Type members
Classlikes
case class Array(elemType: DefaultUni, value: IndexedSeq[Constant]) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
case class BLS12_381_G1_Element(value: BLS12_381_G1_Element) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
case class BLS12_381_G2_Element(value: BLS12_381_G2_Element) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
case class BLS12_381_MlResult(value: BLS12_381_MlResult) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
case class BuiltinValue(value: BuiltinValue) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
case class ByteString(value: ByteString) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object given_LiftValue_BigIntobject given_LiftValue_Booleanobject given_LiftValue_ByteStringobject given_LiftValue_Intobject given_LiftValue_Longobject given_LiftValue_Stringobject given_LiftValue_UnitShow all
case class List(elemType: DefaultUni, value: List[Constant]) extends Constant
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Constantclass Objecttrait Matchableclass AnyShow all
object given_LiftValue_BigInt extends LiftValue[BigInt]
Attributes
- Supertypes
- Self type
object given_LiftValue_Boolean extends LiftValue[Boolean]
Attributes
- Supertypes
- Self type
object given_LiftValue_ByteString extends LiftValue[ByteString]
Attributes
- Supertypes
- Self type
object given_LiftValue_Int extends LiftValue[Int]
Attributes
- Supertypes
- Self type
-
given_LiftValue_Int.type
object given_LiftValue_Long extends LiftValue[Long]
Attributes
- Supertypes
- Self type
-
given_LiftValue_Long.type
object given_LiftValue_String extends LiftValue[String]
Attributes
- Supertypes
- Self type
object given_LiftValue_Unit extends LiftValue[Unit]
Attributes
- Supertypes
- Self type
-
given_LiftValue_Unit.type
Inherited and Abstract types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Givens
Givens
Extensions
Extensions
extension [A](c: A)
Extension method to convert a Scala value to a UPLC Constant.
Extension method to convert a Scala value to a UPLC Constant.
Provides a convenient syntax for lifting Scala values into the Plutus constant representation. The conversion is type-safe and requires an implicit LiftValue instance for the value type.
Supported types include:
- Numeric types: BigInt, Int, Long
- builtin.ByteString
- java.lang.String
- Boolean
- Unit
- scalus.builtin.Data and its subtypes
- Collections: Seq (requires element type to have LiftValue)
- Tuples: pairs of values with LiftValue instances
Type parameters
- A
-
the type of the value to convert, must have an implicit LiftValue instance
Attributes
- Returns
-
a Constant representing the lifted value
- See also
-
LiftValue for defining custom value conversions
- Example
-
import scalus.uplc.Constant.* val intConst = 42.asConstant // Integer(42) val strConst = "hello".asConstant // String("hello") val listConst = Seq(1, 2, 3).asConstant // List(Integer, List(Integer(1), Integer(2), Integer(3)))
In this article