package utxo
- Alphabetic
- Public
- All
Type Members
-
case class
Append[IV <: SType](input: Value[SCollection[IV]], col2: Value[SCollection[IV]]) extends Value[SCollection[IV]] with Transformer[SCollection[IV], SCollection[IV]] with Product with Serializable
Puts the elements of other collection
col2
after the elements ofinput
collection (concatenation of two collections). -
trait
BooleanTransformer[IV <: SType] extends Value[SBoolean.type] with Transformer[SCollection[IV], SBoolean.type]
Transforms a collection of values to a boolean (see Exists, ForAll).
- trait BooleanTransformerCompanion extends ValueCompanion
-
case class
ByIndex[V <: SType](input: Value[SCollection[V]], index: Value[SInt.type], default: Option[Value[V]] = None) extends Value[V] with Transformer[SCollection[V], V] with NotReadyValue[V] with Product with Serializable
The element of the collection or default value.
The element of the collection or default value. If an index is out of bounds (
i < 0 || i >= length
) thendefault
value is returned.- V
the type of elements
- input
the zero-based indexed collection
- index
the index of the requested element (zero-based)
- returns
the element at the given index or
default
value if index is out or bounds
- Exceptions thrown
ArrayIndexOutOfBoundsException
ifindex < 0
orlength <= index
- trait Deserialize[V <: SType] extends Value[V] with NotReadyValue[V]
-
case class
DeserializeContext[V <: SType](id: Byte, tpe: V) extends Value[V] with Deserialize[V] with Product with Serializable
This ErgoTree operation work as macros (i.e.
This ErgoTree operation work as macros (i.e. executed before ErgoTree reduction) and allows to inline arbitrary expression at the point where it is used in ErgoTree.
This operation is executed before ErgoTree reduction as the following: 1) the context variable
id
is checked to have type Coll[Byte], if not, then this node remains in the ErgoTree which means the reduction will fail later. 2) the bytes collection is deserialized toexpr: Value[V]
using ValueSerializer.deserialize 3)this
node is replaced with the deserializedexpr
This step are performed for each DeserializeContext node via single traverse of ErgoTree. The resulting ErgoTree is passed to reduction.
NOTE, the original
Coll[Byte]
from context variables is available asgetVar[Coll[Byte]](id)
- id
identifier of the context variable
- tpe
expected type of the deserialized script (i.e. expected type of
expr
).
-
case class
DeserializeRegister[V <: SType](reg: RegisterId, tpe: V, default: Option[Value[V]] = None) extends Value[V] with Deserialize[V] with Product with Serializable
Extract register of SELF box as Coll[Byte], deserialize it into Value and inline into executing script.
Extract register of SELF box as Coll[Byte], deserialize it into Value and inline into executing script. NOTE: it only applicable to SELF box
-
case class
Exists[IV <: SType](input: Value[SCollection[IV]], condition: Value[SFunc]) extends Value[SBoolean.type] with BooleanTransformer[IV] with Product with Serializable
Tests whether a predicate holds for at least one element of this collection.
Tests whether a predicate holds for at least one element of this collection.
- input
the collection to be tested
- condition
the predicate used to test elements.
- returns
true
if the givencondition
is satisfied by at least one element of this collection, otherwisefalse
- sealed trait Extract[V <: SType] extends Value[V] with Transformer[SBox.type, V]
-
case class
ExtractAmount(input: Value[SBox.type]) extends Value[SLong.type] with Extract[SLong.type] with NotReadyValueLong with Product with Serializable
Extracts the monetary value, in Ergo tokens (NanoErg unit of measure) from input Box.
-
case class
ExtractBytes(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extracts serialized bytes of this box's content, including proposition bytes.
-
case class
ExtractBytesWithNoRef(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extracts serialized bytes of this box's content, excluding transactionId and index of output.
-
case class
ExtractCreationInfo(input: Value[SBox.type]) extends Value[STuple] with Extract[STuple] with NotReadyValue[STuple] with Product with Serializable
Tuple of height when block got included into the blockchain and transaction identifier with box index in the transaction outputs serialized to the byte array.
Tuple of height when block got included into the blockchain and transaction identifier with box index in the transaction outputs serialized to the byte array.
- input
box
-
case class
ExtractId(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extracts Blake2b256 hash of this box's content, basically equals to
blake2b256(bytes)
-
case class
ExtractRegisterAs[V <: SType](input: Value[SBox.type], registerId: RegisterId, tpe: SOption[V]) extends Value[SOption[V]] with Extract[SOption[V]] with NotReadyValue[SOption[V]] with Product with Serializable
See Box.getReg()
-
case class
ExtractScriptBytes(input: Value[SBox.type]) extends Value[SByteArray] with Extract[SByteArray] with NotReadyValueByteArray with Product with Serializable
Extract serialized bytes of guarding script.
Extract serialized bytes of guarding script. As a reminder, the script should be evaluated to true in order to open this box. (aka spend it in a transaction).
-
case class
Filter[IV <: SType](input: Value[SCollection[IV]], condition: Value[SFunc]) extends Value[SCollection[IV]] with Transformer[SCollection[IV], SCollection[IV]] with Product with Serializable
Selects all elements of
input
collection which satisfy the condition.Selects all elements of
input
collection which satisfy the condition.- input
the collection to be filtered
- condition
the predicate used to test elements.
- returns
a new collection consisting of all elements of this collection that satisfy the given
condition
. The order of the elements is preserved.
-
case class
Fold[IV <: SType, OV <: SType](input: Value[SCollection[IV]], zero: Value[OV], foldOp: Value[SFunc]) extends Value[OV] with Transformer[SCollection[IV], OV] with Product with Serializable
Applies a binary function to a start value and all elements of this collection, going left to right.
Applies a binary function to a start value and all elements of this collection, going left to right.
- OV
the result type of the binary operator.
- input
the collection to iterate
- zero
the start value.
- foldOp
the binary function.
- returns
the result of inserting
foldOp
between consecutive elements of this collection, going left to right with the start valuezero
on the left:foldOp(...foldOp(zero, x_1), x_2, ..., x_n)
where
x_1, ..., x_n
are the elements of this collection. Returnszero
if this collection is empty.
-
case class
ForAll[IV <: SType](input: Value[SCollection[IV]], condition: Value[SFunc]) extends Value[SBoolean.type] with BooleanTransformer[IV] with Product with Serializable
Tests whether a predicate holds for all elements of this collection.
Tests whether a predicate holds for all elements of this collection.
- input
the collection to be tested
- condition
the predicate used to test elements.
- returns
true
if this collection is empty or the givencondition
holds for all elements of this collection, otherwisefalse
.
-
case class
GetVar[V <: SType](varId: Byte, tpe: SOption[V]) extends Value[SOption[V]] with NotReadyValue[SOption[V]] with Product with Serializable
See sigma.Context.getVar() for detailed description.
-
case class
MapCollection[IV <: SType, OV <: SType](input: Value[SCollection[IV]], mapper: Value[SFunc]) extends Value[SCollection[OV]] with Transformer[SCollection[IV], SCollection[OV]] with Product with Serializable
Builds a new collection by applying a function to all elements of this collection.
Builds a new collection by applying a function to all elements of this collection.
- IV
the element type of the input collection.
- OV
the element type of the returned collection.
- input
the collection to be mapped
- mapper
the function to apply to each element.
- returns
a new collection of type
Coll[OV]
resulting from applying the given functionmapper
to each element of this collection and collecting the results.
-
case class
OptionGet[V <: SType](input: Value[SOption[V]]) extends Value[V] with Transformer[SOption[V], V] with Product with Serializable
Returns the option's value.
Returns the option's value.
- Exceptions thrown
java.util.NoSuchElementException
if the option is empty.- Note
The option must be nonempty.
-
case class
OptionGetOrElse[V <: SType](input: Value[SOption[V]], default: Value[V]) extends Value[V] with Transformer[SOption[V], V] with Product with Serializable
Returns the option's value if the option is nonempty, otherwise return the result of evaluating
default
.Returns the option's value if the option is nonempty, otherwise return the result of evaluating
default
. NOTE: thedefault
is evaluated even if the option contains the value i.e. not lazily.- default
the default expression.
-
case class
OptionIsDefined[V <: SType](input: Value[SOption[V]]) extends Value[SBoolean.type] with Transformer[SOption[V], SBoolean.type] with Product with Serializable
Returns false if the option is None, true otherwise.
-
case class
SelectField(input: Value[STuple], fieldIndex: Byte) extends Value[SType] with Transformer[STuple, SType] with NotReadyValue[SType] with Product with Serializable
Select tuple field by its 1-based index.
Select tuple field by its 1-based index. E.g. input._1 is transformed to SelectField(input, 1)
-
case class
SigmaPropBytes(input: Value[SSigmaProp.type]) extends Value[SByteArray] with Transformer[SSigmaProp.type, SByteArray] with NotReadyValue[SByteArray] with Product with Serializable
Extract serialized bytes of a SigmaProp value
-
case class
SigmaPropIsProven(input: Value[SSigmaProp.type]) extends Value[SBoolean.type] with Transformer[SSigmaProp.type, SBoolean.type] with NotReadyValueBoolean with Product with Serializable
Represents execution of Sigma protocol that validates the given input SigmaProp.
- trait SimpleTransformerCompanion extends ValueCompanion
-
case class
SizeOf[V <: SType](input: Value[SCollection[V]]) extends Value[SInt.type] with Transformer[SCollection[V], SInt.type] with NotReadyValueInt with Product with Serializable
The length of the collection (aka size).
-
case class
Slice[IV <: SType](input: Value[SCollection[IV]], from: Value[SInt.type], until: Value[SInt.type]) extends Value[SCollection[IV]] with Transformer[SCollection[IV], SCollection[IV]] with Product with Serializable
Selects an interval of elements.
Selects an interval of elements. The returned collection is made up of all elements
x
which satisfy the invariant:from <= indexOf(x) < until
- from
the lowest index to include from this collection.
- until
the lowest index to EXCLUDE from this collection.
-
trait
Transformer[IV <: SType, OV <: SType] extends Value[OV] with NotReadyValue[OV]
Every operation is a transformer of some kind.
Every operation is a transformer of some kind. This trait is used merely to simplify implementation and avoid copy-paste.
Value Members
- object Append extends ValueCompanion with Serializable
- object ByIndex extends FixedCostValueCompanion with Serializable
- object ComplexityTable
- object ComplexityTableStat
- object DeserializeContext extends ValueCompanion with Serializable
- object DeserializeRegister extends ValueCompanion with Serializable
- object Exists extends BooleanTransformerCompanion with Serializable
- object ExtractAmount extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object ExtractBytes extends SimpleTransformerCompanion with Serializable
- object ExtractBytesWithNoRef extends SimpleTransformerCompanion with Serializable
- object ExtractCreationInfo extends SimpleTransformerCompanion with Serializable
- object ExtractId extends SimpleTransformerCompanion with Serializable
- object ExtractRegisterAs extends FixedCostValueCompanion with Serializable
- object ExtractScriptBytes extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object Filter extends ValueCompanion with Serializable
- object Fold extends ValueCompanion with Serializable
- object ForAll extends BooleanTransformerCompanion with Serializable
- object GetVar extends FixedCostValueCompanion with Serializable
- object MapCollection extends ValueCompanion with Serializable
- object OptionGet extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object OptionGetOrElse extends ValueCompanion with FixedCostValueCompanion with Serializable
- object OptionIsDefined extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object SelectField extends FixedCostValueCompanion with Serializable
- object SigmaPropBytes extends PerItemCostValueCompanion with Serializable
- object SigmaPropIsProven extends ValueCompanion with Serializable
- object SizeOf extends SimpleTransformerCompanion with FixedCostValueCompanion with Serializable
- object Slice extends ValueCompanion with Serializable