cardano-api-1.28.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Eras

Description

Cardano eras, sometimes we have to distinguish them.

Synopsis

Eras

data ByronEra Source #

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

Instances

Instances details
HasTypeProxy ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras

Associated Types

data AsType ByronEra Source #

IsCardanoEra ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras

data ShelleyEra Source #

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

Instances

Instances details
HasTypeProxy ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

Associated Types

data AsType ShelleyEra Source #

IsShelleyBasedEra ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AllegraEra Source #

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

Instances

Instances details
HasTypeProxy AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

Associated Types

data AsType AllegraEra Source #

IsShelleyBasedEra AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

data MaryEra Source #

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

Instances

Instances details
HasTypeProxy MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

Associated Types

data AsType MaryEra Source #

IsShelleyBasedEra MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AlonzoEra Source #

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

Instances

Instances details
HasTypeProxy AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

Associated Types

data AsType AlonzoEra Source #

IsShelleyBasedEra AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

data CardanoEra era where Source #

This GADT provides a value-level representation of all the Cardano eras. This enables pattern matching on the era to allow them to be treated in a non-uniform way.

This can be used in combination with the IsCardanoEra class to get access to this value.

In combination this can often enable code that handles all eras, and does so uniformly where possible, and non-uniformly where necessary.

Instances

Instances details
Eq (CardanoEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

(==)CardanoEra era → CardanoEra era → Bool #

(/=)CardanoEra era → CardanoEra era → Bool #

Ord (CardanoEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

compareCardanoEra era → CardanoEra era → Ordering #

(<)CardanoEra era → CardanoEra era → Bool #

(<=)CardanoEra era → CardanoEra era → Bool #

(>)CardanoEra era → CardanoEra era → Bool #

(>=)CardanoEra era → CardanoEra era → Bool #

maxCardanoEra era → CardanoEra era → CardanoEra era #

minCardanoEra era → CardanoEra era → CardanoEra era #

Show (CardanoEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

showsPrecIntCardanoEra era → ShowS #

showCardanoEra era → String #

showList ∷ [CardanoEra era] → ShowS #

ToJSON (CardanoEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

toJSONCardanoEra era → Value #

toEncodingCardanoEra era → Encoding #

toJSONList ∷ [CardanoEra era] → Value #

toEncodingList ∷ [CardanoEra era] → Encoding #

TestEquality CardanoEra Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

testEquality ∷ ∀ (a ∷ k) (b ∷ k). CardanoEra a → CardanoEra b → Maybe (a :~: b) #

class HasTypeProxy era ⇒ IsCardanoEra era where Source #

The class of Cardano eras. This allows uniform handling of all Cardano eras, but also non-uniform by making case distinctions on the CardanoEra constructors, or the CardanoEraStyle constructors via cardanoEraStyle.

Methods

cardanoEraCardanoEra era Source #

Instances

Instances details
IsCardanoEra AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

IsCardanoEra ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AnyCardanoEra where Source #

Constructors

AnyCardanoEraIsCardanoEra era ⇒ CardanoEra era → AnyCardanoEra 

Instances

Instances details
Eq AnyCardanoEra Source # 
Instance details

Defined in Cardano.Api.Eras

Show AnyCardanoEra Source # 
Instance details

Defined in Cardano.Api.Eras

ToJSON AnyCardanoEra Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

toJSONAnyCardanoEra → Value #

toEncodingAnyCardanoEra → Encoding #

toJSONList ∷ [AnyCardanoEra] → Value #

toEncodingList ∷ [AnyCardanoEra] → Encoding #

anyCardanoEraCardanoEra era → AnyCardanoEra Source #

Like the AnyCardanoEra constructor but does not demand a IsCardanoEra class constraint.

data InAnyCardanoEra thing where Source #

This pairs up some era-dependent type with a CardanoEra value that tells us what era it is, but hides the era type. This is useful when the era is not statically known, for example when deserialising from a file.

Constructors

InAnyCardanoEraIsCardanoEra era ⇒ CardanoEra era → thing era → InAnyCardanoEra thing 

Deprecated aliases

type Byron = ByronEra Source #

Deprecated: Use ByronEra or ByronAddr as appropriate

type Shelley = ShelleyEra Source #

Deprecated: Use ShelleyEra or ShelleyAddr as appropriate

type Allegra = AllegraEra Source #

Deprecated: Use AllegraEra instead

type Mary = MaryEra Source #

Deprecated: Use MaryEra instead

Shelley-based eras

data ShelleyBasedEra era where Source #

While the Byron and Shelley eras are quite different, there are several eras that are based on Shelley with only minor differences. It is useful to be able to treat the Shelley-based eras in a mostly-uniform way.

Values of this type witness the fact that the era is Shelley-based. This can be used to constrain the era to being a Shelley-based on. It allows non-uniform handling making case distinctions on the constructor.

Instances

Instances details
Eq (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

(==)ShelleyBasedEra era → ShelleyBasedEra era → Bool #

(/=)ShelleyBasedEra era → ShelleyBasedEra era → Bool #

Ord (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Show (ShelleyBasedEra era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

showsPrecIntShelleyBasedEra era → ShowS #

showShelleyBasedEra era → String #

showList ∷ [ShelleyBasedEra era] → ShowS #

class IsCardanoEra era ⇒ IsShelleyBasedEra era where Source #

The class of eras that are based on Shelley. This allows uniform handling of Shelley-based eras, but also non-uniform by making case distinctions on the ShelleyBasedEra constructors.

data InAnyShelleyBasedEra thing where Source #

This pairs up some era-dependent type with a ShelleyBasedEra value that tells us what era it is, but hides the era type. This is useful when the era is not statically known, for example when deserialising from a file.

Constructors

InAnyShelleyBasedEraIsShelleyBasedEra era ⇒ ShelleyBasedEra era → thing era → InAnyShelleyBasedEra thing 

Mapping to era types from the Shelley ledger library

type family ShelleyLedgerEra era where ... Source #

A type family that connects our era type tags to equivalent type tags used in the Shelley ledger library.

This type mapping connect types from this API with types in the Shelley ledger library which allows writing conversion functions in a more generic way.

Equations

ShelleyLedgerEra ShelleyEra = StandardShelley 
ShelleyLedgerEra AllegraEra = StandardAllegra 
ShelleyLedgerEra MaryEra = StandardMary 
ShelleyLedgerEra AlonzoEra = StandardAlonzo 

Cardano eras, as Byron vs Shelley-based

data CardanoEraStyle era where Source #

This is the same essential information as CardanoEra but instead of a flat set of alternative eras, it is factored into the legcy Byron era and the current Shelley-based eras.

This way of factoring the eras is useful because in many cases the major differences are between the Byron and Shelley-based eras, and the Shelley-based eras can often be treated uniformly.

Instances

Instances details
Eq (CardanoEraStyle era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

(==)CardanoEraStyle era → CardanoEraStyle era → Bool #

(/=)CardanoEraStyle era → CardanoEraStyle era → Bool #

Ord (CardanoEraStyle era) Source # 
Instance details

Defined in Cardano.Api.Eras

Show (CardanoEraStyle era) Source # 
Instance details

Defined in Cardano.Api.Eras

Methods

showsPrecIntCardanoEraStyle era → ShowS #

showCardanoEraStyle era → String #

showList ∷ [CardanoEraStyle era] → ShowS #

Data family instances

data family AsType t Source #

A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.

Values of this type are passed to deserialisation functions for example.

Instances

Instances details
data AsType AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType TextEnvelope Source # 
Instance details

Defined in Cardano.Api.SerialiseTextEnvelope

data AsType TxMetadata Source # 
Instance details

Defined in Cardano.Api.TxMetadata

data AsType StakePoolKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisUTxOKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisDelegateExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisDelegateKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType StakeExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType StakeKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType PaymentExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType PaymentKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType ScriptData Source # 
Instance details

Defined in Cardano.Api.ScriptData

data AsType ScriptHash Source # 
Instance details

Defined in Cardano.Api.Script

data AsType ScriptInAnyLang Source # 
Instance details

Defined in Cardano.Api.Script

data AsType PlutusScriptV1 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType SimpleScriptV2 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType SimpleScriptV1 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType ByronKeyLegacy Source # 
Instance details

Defined in Cardano.Api.KeysByron

data AsType ByronKey Source # 
Instance details

Defined in Cardano.Api.KeysByron

data AsType ByronVote Source # 
Instance details

Defined in Cardano.Api.SpecialByron

data AsType ByronUpdateProposal Source # 
Instance details

Defined in Cardano.Api.SpecialByron

data AsType VrfKey Source # 
Instance details

Defined in Cardano.Api.KeysPraos

data AsType KesKey Source # 
Instance details

Defined in Cardano.Api.KeysPraos

data AsType StakePoolMetadata Source # 
Instance details

Defined in Cardano.Api.StakePoolMetadata

data AsType StakeAddress Source # 
Instance details

Defined in Cardano.Api.Address

data AsType AddressAny Source # 
Instance details

Defined in Cardano.Api.Address

data AsType ShelleyAddr Source # 
Instance details

Defined in Cardano.Api.Address

data AsType ByronAddr Source # 
Instance details

Defined in Cardano.Api.Address

data AsType AssetName Source # 
Instance details

Defined in Cardano.Api.Value

data AsType PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

data AsType UpdateProposal Source # 
Instance details

Defined in Cardano.Api.ProtocolParameters

data AsType PraosNonce Source # 
Instance details

Defined in Cardano.Api.ProtocolParameters

data AsType Certificate Source # 
Instance details

Defined in Cardano.Api.Certificate

data AsType TxId Source # 
Instance details

Defined in Cardano.Api.TxBody

data AsType BlockHeader Source # 
Instance details

Defined in Cardano.Api.Block

data AsType OperationalCertificateIssueCounter Source # 
Instance details

Defined in Cardano.Api.OperationalCertificate

data AsType OperationalCertificate Source # 
Instance details

Defined in Cardano.Api.OperationalCertificate

data AsType (Hash a) Source # 
Instance details

Defined in Cardano.Api.Hash

data AsType (Hash a) = AsHash (AsType a)
data AsType (VerificationKey a) Source # 
Instance details

Defined in Cardano.Api.Key

data AsType (SigningKey a) Source # 
Instance details

Defined in Cardano.Api.Key

data AsType (PlutusScript lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (SimpleScript lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (ScriptInEra era) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (Script lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (Script lang) = AsScript (AsType lang)
data AsType (AddressInEra era) Source # 
Instance details

Defined in Cardano.Api.Address

data AsType (Address addrtype) Source # 
Instance details

Defined in Cardano.Api.Address

data AsType (Address addrtype) = AsAddress (AsType addrtype)
data AsType (TxBody era) Source # 
Instance details

Defined in Cardano.Api.TxBody

data AsType (TxBody era) = AsTxBody (AsType era)
data AsType (KeyWitness era) Source # 
Instance details

Defined in Cardano.Api.Tx

data AsType (Tx era) Source # 
Instance details

Defined in Cardano.Api.Tx

data AsType (Tx era) = AsTx (AsType era)