liqwid-plutarch-extra-3.21.1: A collection of Plutarch extras from Liqwid Labs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Plutarch.Extra.Time

Synopsis

Documentation

data PFullyBoundedTimeRange (s :: S) Source #

Represent a fully bounded time range.

Note: PFullyBoundedTimeRange doesn't need a Haskell-level equivalent because it is only used in scripts, and does not go in datums. It is also Scott-encoded.

Since: 3.3.0

Constructors

PFullyBoundedTimeRange 

Fields

Instances

Instances details
PEq PFullyBoundedTimeRange Source #

Since: 3.3.0

Instance details

Defined in Plutarch.Extra.Time

DerivePlutusType PFullyBoundedTimeRange Source #

Since: 3.3.0

Instance details

Defined in Plutarch.Extra.Time

PlutusType PFullyBoundedTimeRange Source # 
Instance details

Defined in Plutarch.Extra.Time

Methods

pcon' :: forall (s :: S). PFullyBoundedTimeRange s -> Term s (PInner PFullyBoundedTimeRange) Source #

pmatch' :: forall (s :: S) (b :: PType). Term s (PInner PFullyBoundedTimeRange) -> (PFullyBoundedTimeRange s -> Term s b) -> Term s b Source #

Generic (PFullyBoundedTimeRange s) Source # 
Instance details

Defined in Plutarch.Extra.Time

Associated Types

type Rep (PFullyBoundedTimeRange s) :: Type -> Type Source #

type DPTStrat PFullyBoundedTimeRange Source # 
Instance details

Defined in Plutarch.Extra.Time

type PContravariant' PFullyBoundedTimeRange Source # 
Instance details

Defined in Plutarch.Extra.Time

type PCovariant' PFullyBoundedTimeRange Source # 
Instance details

Defined in Plutarch.Extra.Time

type PInner PFullyBoundedTimeRange Source #

Since: 3.3.0

Instance details

Defined in Plutarch.Extra.Time

type PVariant' PFullyBoundedTimeRange Source # 
Instance details

Defined in Plutarch.Extra.Time

type Rep (PFullyBoundedTimeRange s) Source #

Since: 3.3.0

Instance details

Defined in Plutarch.Extra.Time

type Rep (PFullyBoundedTimeRange s) = D1 ('MetaData "PFullyBoundedTimeRange" "Plutarch.Extra.Time" "liqwid-plutarch-extra-3.21.1-KPadsMN5oqEA2Ctxwq6qig" 'False) (C1 ('MetaCons "PFullyBoundedTimeRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PPOSIXTime)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Term s PPOSIXTime))))

pgetFullyBoundedTimeRange :: forall (s :: S). Term s (PPOSIXTimeRange :--> PMaybe PFullyBoundedTimeRange) Source #

Get the current time, given a PPOSIXTimeRange.

If it's impossible to get a full-bounded time (for example, either end of the PPOSIXTimeRange is an infinity), then we return PNothing.

Since: 3.3.0

fullyBoundedTimeRangeFromValidRange :: forall r (s :: S). HasField "validRange" r (Term s PPOSIXTimeRange) => r -> Term s (PMaybe PFullyBoundedTimeRange) Source #

Calculate the current time by providing the validRange field, which typically comes from PTxInfo.

Since: 3.3.0

passertFullyBoundedTimeRange :: forall (s :: S). Term s (PString :--> (PPOSIXTimeRange :--> PFullyBoundedTimeRange)) Source #

Calculate the current time, and error out with the given message if we can't get it.

Since: 3.3.0

pisWithinTimeRange :: forall (s :: S). Term s (PPOSIXTime :--> (PFullyBoundedTimeRange :--> PBool)) Source #

Retutn PTrue if a PPOSIXTime is in the current time range.

Since: 3.3.0

pisTimeRangeWithin :: forall (s :: S). Term s (PPOSIXTime :--> (PPOSIXTime :--> (PFullyBoundedTimeRange :--> PBool))) Source #

Return PTrue if current time is within the given time range.

Note that the first argument is the lower bound of said time range, and the second is the upper bound.

Since: 3.3.0

ptimeRangeDuration :: forall (s :: S). Term s (PFullyBoundedTimeRange :--> PPOSIXTime) Source #

Return the duration of current time.

Since: 3.14.1