cardano-api
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Internal.Experimental.Eras

Description

This module defines the protocol versions corresponding to the eras in the Cardano blockchain.

Synopsis

Documentation

data BabbageEra Source #

A type used as a tag to distinguish the Babbage era.

Instances

Instances details
IsAllegraBasedEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.AllegraEraOnwards

IsAlonzoBasedEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.AlonzoEraOnwards

IsBabbageBasedEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.BabbageEraOnwards

IsMaryBasedEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.MaryEraOnwards

IsShelleyBasedEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.ShelleyBasedEra

IsCardanoEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

IsEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

HasTypeProxy BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

Associated Types

data AsType BabbageEra 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

HasScriptLanguageInEra PlutusScriptV1 BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

HasScriptLanguageInEra PlutusScriptV2 BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

ToAlonzoScript PlutusScriptV1 BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

ToAlonzoScript PlutusScriptV2 BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

data AsType BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

data ConwayEra Source #

A type used as a tag to distinguish the Conway era.

Instances

Instances details
IsAllegraBasedEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.AllegraEraOnwards

IsAlonzoBasedEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.AlonzoEraOnwards

IsBabbageBasedEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.BabbageEraOnwards

IsConwayBasedEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.ConwayEraOnwards

IsMaryBasedEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.MaryEraOnwards

IsShelleyBasedEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eon.ShelleyBasedEra

IsCardanoEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

IsEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

HasTypeProxy ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

Associated Types

data AsType ConwayEra 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

HasScriptLanguageInEra PlutusScriptV1 ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

HasScriptLanguageInEra PlutusScriptV2 ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

HasScriptLanguageInEra PlutusScriptV3 ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

ToAlonzoScript PlutusScriptV1 ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

ToAlonzoScript PlutusScriptV2 ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

ToAlonzoScript PlutusScriptV3 ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Script

data AsType ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Eras.Core

data Era era where Source #

Represents the latest Cardano blockchain eras, including the one currently on mainnet and the upcoming one.

After a hard fork takes place, the era on mainnet before the hard fork is deprecated and, after a deprecation period, removed from cardano-api. During the deprecation period, cardano-api users should update their codebase to the new mainnet era.

Constructors

BabbageEra :: Era BabbageEra

The currently active era on the Cardano mainnet.

ConwayEra :: Era ConwayEra

The upcoming era in development.

Instances

Instances details
Eon Era Source #

A temporary compatibility instance for easier conversion between the experimental and old APIs.

Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

inEonForEra :: a -> (Era era -> a) -> CardanoEra era -> a Source #

TestEquality Era Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

testEquality :: Era a -> Era b -> Maybe (a :~: b) Source #

Convert BabbageEraOnwards Era Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

convert :: BabbageEraOnwards era -> Era era Source #

Convert Era BabbageEraOnwards Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

convert :: Era era -> BabbageEraOnwards era Source #

Convert Era ShelleyBasedEra Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

convert :: Era era -> ShelleyBasedEra era Source #

Convert Era CardanoEra Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

convert :: Era era -> CardanoEra era Source #

ToJSON (Era era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

toJSON :: Era era -> Value

toEncoding :: Era era -> Encoding

toJSONList :: [Era era] -> Value

toEncodingList :: [Era era] -> Encoding

omitField :: Era era -> Bool

Show (Era era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

showsPrec :: Int -> Era era -> ShowS Source #

show :: Era era -> String Source #

showList :: [Era era] -> ShowS Source #

Eq (Era era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

(==) :: Era era -> Era era -> Bool Source #

(/=) :: Era era -> Era era -> Bool Source #

Pretty (Era era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

pretty :: Era era -> Doc ann #

prettyList :: [Era era] -> Doc ann #

FromJSON (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

parseJSON :: Value -> Parser (Some Era)

parseJSONList :: Value -> Parser [Some Era]

omittedField :: Maybe (Some Era)

ToJSON (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

toJSON :: Some Era -> Value

toEncoding :: Some Era -> Encoding

toJSONList :: [Some Era] -> Value

toEncodingList :: [Some Era] -> Encoding

omitField :: Some Era -> Bool

Bounded (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Enum (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Show (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Eq (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

(==) :: Some Era -> Some Era -> Bool Source #

(/=) :: Some Era -> Some Era -> Bool Source #

Ord (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Pretty (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

pretty :: Some Era -> Doc ann #

prettyList :: [Some Era] -> Doc ann #

class IsEra era where Source #

Type class interface for the Era type.

Methods

useEra :: Era era Source #

Instances

Instances details
IsEra BabbageEra Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

IsEra ConwayEra Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

data Some (f :: k -> Type) where Source #

An existential wrapper for types of kind k -> Type. It can hold any era, for example, Some Era. The era witness can be brought back into scope, for example, using this pattern:

anyEra = Some ConwayEra
-- then later in the code
Some era <- pure anyEra
obtainCommonConstraints era foo

Constructors

Some :: forall {k} (f :: k -> Type) (a :: k). (Typeable a, Typeable (f a)) => f a -> Some f 

Instances

Instances details
FromJSON (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

parseJSON :: Value -> Parser (Some Era)

parseJSONList :: Value -> Parser [Some Era]

omittedField :: Maybe (Some Era)

ToJSON (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

toJSON :: Some Era -> Value

toEncoding :: Some Era -> Encoding

toJSONList :: [Some Era] -> Value

toEncodingList :: [Some Era] -> Encoding

omitField :: Some Era -> Bool

Bounded (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Enum (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Show (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Eq (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

(==) :: Some Era -> Some Era -> Bool Source #

(/=) :: Some Era -> Some Era -> Bool Source #

Ord (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Pretty (Some Era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

pretty :: Some Era -> Doc ann #

prettyList :: [Some Era] -> Doc ann #

class Inject t s where Source #

Methods

inject :: t -> s Source #

Instances

Instances details
Inject Coin DeltaCoin 
Instance details

Defined in Cardano.Ledger.Coin

Inject a a 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

inject :: a -> a Source #

Inject Coin (MaryValue c) 
Instance details

Defined in Cardano.Ledger.Mary.Value

Methods

inject :: Coin -> MaryValue c Source #

Inject (AlonzoContextError era) (BabbageContextError era) 
Instance details

Defined in Cardano.Ledger.Babbage.TxInfo

Inject (AlonzoContextError era) (ConwayContextError era) 
Instance details

Defined in Cardano.Ledger.Conway.TxInfo

Inject (BabbageContextError era) (ConwayContextError era) 
Instance details

Defined in Cardano.Ledger.Conway.TxInfo

type family LedgerEra era = (r :: Type) | r -> era where ... Source #

Users typically interact with the latest features on the mainnet or experiment with features from the upcoming era. Therefore, protocol versions are limited to the current mainnet era and the next (upcoming) era.

newtype DeprecatedEra era Source #

Constructors

DeprecatedEra (ShelleyBasedEra era) 

Instances

Instances details
Show (DeprecatedEra era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Pretty (DeprecatedEra era) Source # 
Instance details

Defined in Cardano.Api.Internal.Experimental.Eras

Methods

pretty :: DeprecatedEra era -> Doc ann #

prettyList :: [DeprecatedEra era] -> Doc ann #

eraToSbe :: Era era -> ShelleyBasedEra era Source #

Deprecated: Use convert instead.

How to deprecate an era:

  1. Add the DEPRECATED pragma to the era type tag and constructor at the same time:
{-# DEPRECATED BabbageEra "BabbageEra no longer supported, use ConwayEra" #-}
data BabbageEra
  1. Update the Haddock documentation for the constructor of the deprecated era, mentioning the deprecation.
data Era era where
  {-# DEPRECATED BabbageEra "BabbageEra no longer supported, use ConwayEra" #-}
  BabbageEra :: Era BabbageEra
  -- | The era currently active on Cardano's mainnet.
  ConwayEra :: Era ConwayEra
  1. Add a new IsEra instance and update the deprecated era instance to produce a compile-time error:
instance TypeError ('Text "IsEra BabbageEra: Deprecated. Update to ConwayEra") => IsEra BabbageEra where
  useEra = error "unreachable"

instance IsEra ConwayEra where
  useEra = ConwayEra

babbageEraOnwardsToEra :: BabbageEraOnwards era -> Era era Source #

Deprecated: Use convert instead.

eraToBabbageEraOnwards :: Era era -> BabbageEraOnwards era Source #

Deprecated: Use convert instead.