bcc-api-1.99.0
Safe HaskellNone
LanguageHaskell2010

Bcc.Api.Eras

Description

Bcc eras, sometimes we have to distinguish them.

Synopsis

Eras

data ColeEra Source #

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

Instances

Instances details
HasTypeProxy ColeEra Source # 
Instance details

Defined in Bcc.Api.Eras

Associated Types

data AsType ColeEra Source #

IsBccEra ColeEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType ColeEra Source # 
Instance details

Defined in Bcc.Api.Eras

data SophieEra Source #

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

Instances

Instances details
HasTypeProxy SophieEra Source # 
Instance details

Defined in Bcc.Api.Eras

Associated Types

data AsType SophieEra Source #

IsSophieBasedEra SophieEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra SophieEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType SophieEra Source # 
Instance details

Defined in Bcc.Api.Eras

data EvieEra Source #

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

Instances

Instances details
HasTypeProxy EvieEra Source # 
Instance details

Defined in Bcc.Api.Eras

Associated Types

data AsType EvieEra Source #

IsSophieBasedEra EvieEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra EvieEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType EvieEra Source # 
Instance details

Defined in Bcc.Api.Eras

data JenEra Source #

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

Instances

Instances details
HasTypeProxy JenEra Source # 
Instance details

Defined in Bcc.Api.Eras

Associated Types

data AsType JenEra Source #

IsSophieBasedEra JenEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra JenEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType JenEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AurumEra Source #

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

Instances

Instances details
HasTypeProxy AurumEra Source # 
Instance details

Defined in Bcc.Api.Eras

Associated Types

data AsType AurumEra Source #

IsSophieBasedEra AurumEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra AurumEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType AurumEra Source # 
Instance details

Defined in Bcc.Api.Eras

data BccEra era where Source #

This GADT provides a value-level representation of all the Bcc 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 IsBccEra 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 (BccEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

(==)BccEra era → BccEra era → Bool Source #

(/=)BccEra era → BccEra era → Bool Source #

Ord (BccEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

compareBccEra era → BccEra era → Ordering Source #

(<)BccEra era → BccEra era → Bool Source #

(<=)BccEra era → BccEra era → Bool Source #

(>)BccEra era → BccEra era → Bool Source #

(>=)BccEra era → BccEra era → Bool Source #

maxBccEra era → BccEra era → BccEra era Source #

minBccEra era → BccEra era → BccEra era Source #

Show (BccEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

showsPrecIntBccEra era → ShowS Source #

showBccEra era → String Source #

showList ∷ [BccEra era] → ShowS Source #

ToJSON (BccEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

toJSONBccEra era → Value #

toEncodingBccEra era → Encoding #

toJSONList ∷ [BccEra era] → Value #

toEncodingList ∷ [BccEra era] → Encoding #

TestEquality BccEra Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

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

class HasTypeProxy era ⇒ IsBccEra era where Source #

The class of Bcc eras. This allows uniform handling of all Bcc eras, but also non-uniform by making case distinctions on the BccEra constructors, or the BccEraStyle constructors via bccEraStyle.

Methods

bccEraBccEra era Source #

Instances

Instances details
IsBccEra AurumEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra JenEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra EvieEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra SophieEra Source # 
Instance details

Defined in Bcc.Api.Eras

IsBccEra ColeEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AnyBccEra where Source #

Constructors

AnyBccEraIsBccEra era ⇒ BccEra era → AnyBccEra 

Instances

Instances details
Eq AnyBccEra Source # 
Instance details

Defined in Bcc.Api.Eras

Show AnyBccEra Source # 
Instance details

Defined in Bcc.Api.Eras

ToJSON AnyBccEra Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

toJSONAnyBccEra → Value #

toEncodingAnyBccEra → Encoding #

toJSONList ∷ [AnyBccEra] → Value #

toEncodingList ∷ [AnyBccEra] → Encoding #

anyBccEraBccEra era → AnyBccEra Source #

Like the AnyBccEra constructor but does not demand a IsBccEra class constraint.

data InAnyBccEra thing where Source #

This pairs up some era-dependent type with a BccEra 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

InAnyBccEraIsBccEra era ⇒ BccEra era → thing era → InAnyBccEra thing 

Deprecated aliases

type Cole = ColeEra Source #

Deprecated: Use ColeEra or ColeAddr as appropriate

type Sophie = SophieEra Source #

Deprecated: Use SophieEra or SophieAddr as appropriate

type Evie = EvieEra Source #

Deprecated: Use EvieEra instead

type Jen = JenEra Source #

Deprecated: Use JenEra instead

Sophie-based eras

data SophieBasedEra era where Source #

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

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

Instances

Instances details
Eq (SophieBasedEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

Ord (SophieBasedEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

Show (SophieBasedEra era) Source # 
Instance details

Defined in Bcc.Api.Eras

class IsBccEra era ⇒ IsSophieBasedEra era where Source #

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

data InAnySophieBasedEra thing where Source #

This pairs up some era-dependent type with a SophieBasedEra 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

InAnySophieBasedEraIsSophieBasedEra era ⇒ SophieBasedEra era → thing era → InAnySophieBasedEra thing 

sophieBasedToBccEraSophieBasedEra era → BccEra era Source #

Converts a SophieBasedEra to the broader BccEra.

Mapping to era types from the Sophie ledger library

type family SophieLedgerEra era where ... Source #

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

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

Equations

SophieLedgerEra SophieEra = StandardSophie 
SophieLedgerEra EvieEra = StandardEvie 
SophieLedgerEra JenEra = StandardJen 
SophieLedgerEra AurumEra = StandardAurum 

Bcc eras, as Cole vs Sophie-based

data BccEraStyle era where Source #

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

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

Instances

Instances details
Eq (BccEraStyle era) Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

(==)BccEraStyle era → BccEraStyle era → Bool Source #

(/=)BccEraStyle era → BccEraStyle era → Bool Source #

Ord (BccEraStyle era) Source # 
Instance details

Defined in Bcc.Api.Eras

Methods

compareBccEraStyle era → BccEraStyle era → Ordering Source #

(<)BccEraStyle era → BccEraStyle era → Bool Source #

(<=)BccEraStyle era → BccEraStyle era → Bool Source #

(>)BccEraStyle era → BccEraStyle era → Bool Source #

(>=)BccEraStyle era → BccEraStyle era → Bool Source #

maxBccEraStyle era → BccEraStyle era → BccEraStyle era Source #

minBccEraStyle era → BccEraStyle era → BccEraStyle era Source #

Show (BccEraStyle era) Source # 
Instance details

Defined in Bcc.Api.Eras

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 AurumEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType JenEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType EvieEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType SophieEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType ColeEra Source # 
Instance details

Defined in Bcc.Api.Eras

data AsType TextEnvelope Source # 
Instance details

Defined in Bcc.Api.SerialiseTextEnvelope

data AsType TxMetadata Source # 
Instance details

Defined in Bcc.Api.TxMetadata

data AsType StakePoolKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType VestedDelegateExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType VestedDelegateKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType VestedExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType VestedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisVestedDelegateExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisVestedDelegateKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisVestedExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisVestedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType VestedUTxOKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisUTxOKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisDelegateExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisDelegateKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType GenesisKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType StakeExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType StakeKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType PaymentExtendedKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType PaymentKey Source # 
Instance details

Defined in Bcc.Api.KeysSophie

data AsType ScriptData Source # 
Instance details

Defined in Bcc.Api.ScriptData

data AsType ScriptHash Source # 
Instance details

Defined in Bcc.Api.Script

data AsType ScriptInAnyLang Source # 
Instance details

Defined in Bcc.Api.Script

data AsType ZerepochScriptV1 Source # 
Instance details

Defined in Bcc.Api.Script

data AsType SimpleScriptV2 Source # 
Instance details

Defined in Bcc.Api.Script

data AsType SimpleScriptV1 Source # 
Instance details

Defined in Bcc.Api.Script

data AsType ColeKeyLegacy Source # 
Instance details

Defined in Bcc.Api.KeysCole

data AsType ColeKey Source # 
Instance details

Defined in Bcc.Api.KeysCole

data AsType ColeVote Source # 
Instance details

Defined in Bcc.Api.SpecialCole

data AsType ColeUpdateProposal Source # 
Instance details

Defined in Bcc.Api.SpecialCole

data AsType VrfKey Source # 
Instance details

Defined in Bcc.Api.KeysOptimum

data AsType KesKey Source # 
Instance details

Defined in Bcc.Api.KeysOptimum

data AsType StakePoolMetadata Source # 
Instance details

Defined in Bcc.Api.StakePoolMetadata

data AsType StakeAddress Source # 
Instance details

Defined in Bcc.Api.Address

data AsType AddressAny Source # 
Instance details

Defined in Bcc.Api.Address

data AsType SophieAddr Source # 
Instance details

Defined in Bcc.Api.Address

data AsType ColeAddr Source # 
Instance details

Defined in Bcc.Api.Address

data AsType AssetName Source # 
Instance details

Defined in Bcc.Api.Value

data AsType PolicyId Source # 
Instance details

Defined in Bcc.Api.Value

data AsType UpdateProposal Source # 
Instance details

Defined in Bcc.Api.ProtocolParameters

data AsType OptimumNonce Source # 
Instance details

Defined in Bcc.Api.ProtocolParameters

data AsType Certificate Source # 
Instance details

Defined in Bcc.Api.Certificate

data AsType TxId Source # 
Instance details

Defined in Bcc.Api.TxBody

data AsType BlockHeader Source # 
Instance details

Defined in Bcc.Api.Block

data AsType OperationalCertificateIssueCounter Source # 
Instance details

Defined in Bcc.Api.OperationalCertificate

data AsType OperationalCertificate Source # 
Instance details

Defined in Bcc.Api.OperationalCertificate

data AsType (Hash a) Source # 
Instance details

Defined in Bcc.Api.Hash

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

Defined in Bcc.Api.Key

data AsType (SigningKey a) Source # 
Instance details

Defined in Bcc.Api.Key

data AsType (ZerepochScript lang) Source # 
Instance details

Defined in Bcc.Api.Script

data AsType (SimpleScript lang) Source # 
Instance details

Defined in Bcc.Api.Script

data AsType (ScriptInEra era) Source # 
Instance details

Defined in Bcc.Api.Script

data AsType (Script lang) Source # 
Instance details

Defined in Bcc.Api.Script

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

Defined in Bcc.Api.Address

data AsType (Address addrtype) Source # 
Instance details

Defined in Bcc.Api.Address

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

Defined in Bcc.Api.TxBody

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

Defined in Bcc.Api.Tx

data AsType (Tx era) Source # 
Instance details

Defined in Bcc.Api.Tx

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