plutus-ledger-0.1.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Ledger.TimeSlot

Synopsis

Documentation

data SlotConfig Source #

Datatype to configure the length (ms) of one slot and the beginning of the first slot.

Constructors

SlotConfig 

Fields

Instances

Instances details
Eq SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Show SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Generic SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Associated Types

type Rep SlotConfig :: Type -> Type Source #

NFData SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Methods

rnf :: SlotConfig -> () Source #

ToJSON SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

FromJSON SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Default SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

ToSchema SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Serialise SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Pretty SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Lift DefaultUni SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

Typeable DefaultUni SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

type Rep SlotConfig Source # 
Instance details

Defined in Ledger.TimeSlot

type Rep SlotConfig = D1 ('MetaData "SlotConfig" "Ledger.TimeSlot" "plutus-ledger-0.1.0.0-BAhdPNOPbMF52ZvZJtxBkz" 'False) (C1 ('MetaCons "SlotConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "scSlotLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "scSlotZeroTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime)))

data SlotConversionError Source #

Constructors

SlotOutOfRange 

Instances

Instances details
Eq SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

Show SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

Generic SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

Associated Types

type Rep SlotConversionError :: Type -> Type Source #

ToJSON SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

FromJSON SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

Pretty SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

type Rep SlotConversionError Source # 
Instance details

Defined in Ledger.TimeSlot

type Rep SlotConversionError = D1 ('MetaData "SlotConversionError" "Ledger.TimeSlot" "plutus-ledger-0.1.0.0-BAhdPNOPbMF52ZvZJtxBkz" 'False) (C1 ('MetaCons "SlotOutOfRange" 'PrefixI 'True) (S1 ('MetaSel ('Just "requestedSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Slot) :*: S1 ('MetaSel ('Just "horizon") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Slot, POSIXTime))))

slotRangeToPOSIXTimeRange :: SlotConfig -> SlotRange -> POSIXTimeRange Source #

Convert a SlotRange to a POSIXTimeRange given a SlotConfig. The resulting POSIXTimeRange refers to the starting time of the lower bound of the SlotRange and the ending time of the upper bound of the SlotRange.

slotToPOSIXTimeRange :: SlotConfig -> Slot -> POSIXTimeRange Source #

Convert a Slot to a POSIXTimeRange given a SlotConfig. Each Slot can be represented by an interval of time.

posixTimeRangeToContainedSlotRange :: SlotConfig -> POSIXTimeRange -> SlotRange Source #

Convert a POSIXTimeRange to SlotRange given a SlotConfig. This gives the biggest slot range that is entirely contained by the given time range.

currentSlot :: SlotConfig -> IO Slot Source #

Get the current slot number