BlockTimestamp

org.sigilaris.node.jvm.runtime.block.Model$package.BlockTimestamp

Companion for BlockTimestamp.

Attributes

Source
Model.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def fromEpochMillis(value: Long): Either[String, BlockTimestamp]

Creates a BlockTimestamp from epoch milliseconds, rejecting negative values.

Creates a BlockTimestamp from epoch milliseconds, rejecting negative values.

Value parameters

value

non-negative epoch milliseconds

Attributes

Returns

Right(timestamp) on success, or Left(error) if negative

Source
Model.scala
def fromInstant(value: Instant): Either[String, BlockTimestamp]

Creates a BlockTimestamp from a java.time.Instant.

Creates a BlockTimestamp from a java.time.Instant.

Value parameters

value

the instant to convert

Attributes

Returns

Right(timestamp) on success, or Left(error) on overflow or negative epoch

Source
Model.scala

Creates a BlockTimestamp from epoch milliseconds, throwing on negative input.

Creates a BlockTimestamp from epoch milliseconds, throwing on negative input.

Value parameters

value

non-negative epoch milliseconds

Attributes

Returns

the corresponding block timestamp

Throws
IllegalArgumentException

if the value is negative

Source
Model.scala

Concrete fields

The Unix epoch (0 milliseconds) timestamp.

The Unix epoch (0 milliseconds) timestamp.

Attributes

Source
Model.scala

Givens

Extensions

Extensions

extension (timestamp: BlockTimestamp)
def toEpochMillis: Long

Returns the timestamp as epoch milliseconds.

Returns the timestamp as epoch milliseconds.

Attributes

Source
Model.scala
def toInstant: Instant

Converts the timestamp to a java.time.Instant.

Converts the timestamp to a java.time.Instant.

Attributes

Source
Model.scala