cardano-api-1.28.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Query

Description

Queries from local clients to the node.

Synopsis

Queries

data QueryInMode mode result where Source #

Constructors

QueryCurrentEraConsensusModeIsMultiEra mode → QueryInMode mode AnyCardanoEra 
QueryInEraEraInMode era mode → QueryInEra era result → QueryInMode mode (Either EraMismatch result) 
QueryEraHistoryConsensusModeIsMultiEra mode → QueryInMode mode (EraHistory mode) 
QuerySystemStartQueryInMode mode SystemStart 

Instances

Instances details
Show (QueryInMode mode result) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

showsPrecIntQueryInMode mode result → ShowS #

showQueryInMode mode result → String #

showList ∷ [QueryInMode mode result] → ShowS #

data QueryInEra era result where Source #

Constructors

QueryByronUpdateStateQueryInEra ByronEra ByronUpdateState 
QueryInShelleyBasedEraShelleyBasedEra era → QueryInShelleyBasedEra era result → QueryInEra era result 

Instances

Instances details
Show (QueryInEra era result) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

showsPrecIntQueryInEra era result → ShowS #

showQueryInEra era result → String #

showList ∷ [QueryInEra era result] → ShowS #

data QueryUTxOFilter Source #

Getting the whole UTxO is obviously not efficient since the result can be huge. Filtering by address is also not efficient because it requires a linear search.

The QueryUTxOFilterByTxIn is efficient since it fits with the structure of the UTxO (which is indexed by TxIn).

Constructors

QueryUTxOWhole

O(n) time and space for utxo size n

QueryUTxOByAddress (Set AddressAny)

O(n) time, O(m) space for utxo size n, and address set size m

QueryUTxOByTxIn (Set TxIn)

O(m log n) time, O(m) space for utxo size n, and address set size m

Instances

Instances details
Eq QueryUTxOFilter Source # 
Instance details

Defined in Cardano.Api.Query

Show QueryUTxOFilter Source # 
Instance details

Defined in Cardano.Api.Query

newtype UTxO era Source #

Constructors

UTxO (Map TxIn (TxOut era)) 

Instances

Instances details
Eq (UTxO era) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

(==)UTxO era → UTxO era → Bool #

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

Show (UTxO era) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

showsPrecIntUTxO era → ShowS #

showUTxO era → String #

showList ∷ [UTxO era] → ShowS #

IsCardanoEra era ⇒ ToJSON (UTxO era) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

toJSONUTxO era → Value #

toEncodingUTxO era → Encoding #

toJSONList ∷ [UTxO era] → Value #

toEncodingList ∷ [UTxO era] → Encoding #

data UTxOInAnyEra where Source #

Constructors

UTxOInAnyEraCardanoEra era → UTxO era → UTxOInAnyEra 

Instances

Instances details
Show UTxOInAnyEra Source # 
Instance details

Defined in Cardano.Api.Query

Internal conversion functions

toConsensusQuery ∷ ∀ mode block result. ConsensusBlockForMode mode ~ block ⇒ QueryInMode mode result → Some (Query block) Source #

fromConsensusQueryResult ∷ ∀ mode block result result'. ConsensusBlockForMode mode ~ block ⇒ QueryInMode mode result → Query block result' → result' → result Source #

Wrapper types used in queries

newtype SerialisedDebugLedgerState era Source #

Constructors

SerialisedDebugLedgerState (Serialised (NewEpochState (ShelleyLedgerEra era))) 

newtype ProtocolState era Source #

Constructors

ProtocolState (Serialised (ChainDepState (Crypto (ShelleyLedgerEra era)))) 

data DebugLedgerState era where Source #

Constructors

DebugLedgerStateShelleyLedgerEra era ~ ledgerera ⇒ NewEpochState ledgerera → DebugLedgerState era 

Instances

Instances details
(IsShelleyBasedEra era, ShelleyLedgerEra era ~ ledgerera, ShelleyBasedEra ledgerera, ToJSON (PParams ledgerera), ToJSON (PParamsDelta ledgerera), ToJSON (TxOut ledgerera)) ⇒ ToJSON (DebugLedgerState era) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

toJSONDebugLedgerState era → Value #

toEncodingDebugLedgerState era → Encoding #

toJSONList ∷ [DebugLedgerState era] → Value #

toEncodingList ∷ [DebugLedgerState era] → Encoding #

(Typeable era, TransLedgerState FromCBOR (ShelleyLedgerEra era)) ⇒ FromCBOR (DebugLedgerState era) Source # 
Instance details

Defined in Cardano.Api.Query

Methods

fromCBOR ∷ Decoder s (DebugLedgerState era) #

labelProxy (DebugLedgerState era) → Text #

data EraHistory mode where Source #

Constructors

EraHistoryConsensusBlockForMode mode ~ HardForkBlock xs ⇒ ConsensusMode mode → Interpreter xs → EraHistory mode 

newtype SystemStart #

Constructors

SystemStart 

Instances

Instances details
Eq SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Show SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Generic SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Associated Types

type Rep SystemStartTypeType #

NoThunks SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Methods

noThunks ∷ Context → SystemStartIO (Maybe ThunkInfo)

wNoThunks ∷ Context → SystemStartIO (Maybe ThunkInfo)

showTypeOfProxy SystemStartString

FromCBOR SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Methods

fromCBOR ∷ Decoder s SystemStart #

labelProxy SystemStartText #

ToCBOR SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Methods

toCBORSystemStart → Encoding #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy SystemStart → Size #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [SystemStart] → Size #

Serialise SystemStart 
Instance details

Defined in Cardano.Slotting.Time

Methods

encodeSystemStart → Encoding

decode ∷ Decoder s SystemStart

encodeList ∷ [SystemStart] → Encoding

decodeList ∷ Decoder s [SystemStart]

type Rep SystemStart 
Instance details

Defined in Cardano.Slotting.Time

type Rep SystemStart = D1 ('MetaData "SystemStart" "Cardano.Slotting.Time" "cardano-slotting-0.1.0.0-74adb84e94ce7d7d929bce32b4990d7b16792c13a0fe2771677cf567ba68fab0" 'True) (C1 ('MetaCons "SystemStart" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSystemStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime)))

newtype SlotsInEpoch Source #

Constructors

SlotsInEpoch Word64 

slotToEpochSlotNoEraHistory mode → Either PastHorizonException (EpochNo, SlotsInEpoch, SlotsToEpochEnd) Source #

data family LedgerState blk #

Instances

Instances details
Isomorphic LedgerState 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

Methods

project ∷ NoHardForks blk ⇒ LedgerState (HardForkBlock '[blk]) → LedgerState blk

inject ∷ NoHardForks blk ⇒ LedgerState blk → LedgerState (HardForkBlock '[blk])

CanHardFork xs ⇒ Eq (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Methods

(==)LedgerState (HardForkBlock xs) → LedgerState (HardForkBlock xs) → Bool #

(/=)LedgerState (HardForkBlock xs) → LedgerState (HardForkBlock xs) → Bool #

CanHardFork xs ⇒ Show (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Methods

showsPrecIntLedgerState (HardForkBlock xs) → ShowS #

showLedgerState (HardForkBlock xs) → String #

showList ∷ [LedgerState (HardForkBlock xs)] → ShowS #

CanHardFork xs ⇒ NoThunks (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

Methods

noThunks ∷ Context → LedgerState (HardForkBlock xs) → IO (Maybe ThunkInfo)

wNoThunks ∷ Context → LedgerState (HardForkBlock xs) → IO (Maybe ThunkInfo)

showTypeOfProxy (LedgerState (HardForkBlock xs)) → String

Isomorphic (Ticked :.: LedgerState) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Embed.Unary

Methods

project ∷ NoHardForks blk ⇒ (Ticked :.: LedgerState) (HardForkBlock '[blk]) → (Ticked :.: LedgerState) blk

inject ∷ NoHardForks blk ⇒ (Ticked :.: LedgerState) blk → (Ticked :.: LedgerState) (HardForkBlock '[blk])

data LedgerState ByronBlock 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data LedgerState ByronBlock = ByronLedgerState {}
type TranslationError era (LedgerState :.: ShelleyBlock) 
Instance details

Defined in Ouroboros.Consensus.Shelley.ShelleyHFC

type TranslationError era (LedgerState :.: ShelleyBlock) = Void
type Rep (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (LedgerState ByronBlock) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-2204f90bee600ef1bc25153b2e50e7929500eda0d182b4b56dc3e41bd44c2138" 'False) (C1 ('MetaCons "ByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "byronLedgerTipBlockNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin BlockNo)) :*: (S1 ('MetaSel ('Just "byronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "byronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronTransition))))
type Rep (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (LedgerState (ShelleyBlock era)) = D1 ('MetaData "LedgerState" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-7e2e0a83095219a150738e67b0e4eefcdaa0fcf4c25a0f06bd4460fdb7be6ea2" 'False) (C1 ('MetaCons "ShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "shelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "shelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)) :*: S1 ('MetaSel ('Just "shelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ShelleyTransition))))
type Rep (Ticked (LedgerState ByronBlock)) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type Rep (Ticked (LedgerState ByronBlock)) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Byron.Ledger.Ledger" "ouroboros-consensus-byron-0.1.0.0-2204f90bee600ef1bc25153b2e50e7929500eda0d182b4b56dc3e41bd44c2138" 'False) (C1 ('MetaCons "TickedByronLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedByronLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainValidationState) :*: S1 ('MetaSel ('Just "untickedByronLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ByronTransition)))
type Rep (Ticked (LedgerState (HardForkBlock xs))) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type Rep (Ticked (LedgerState (HardForkBlock xs))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.HardFork.Combinator.Ledger" "ouroboros-consensus-0.1.0.0-6827ecd4bbf3098c66dc9a8eb16305b687dc683f8a85497fc5cf05d0e4fc8477" 'False) (C1 ('MetaCons "TickedHardForkLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "tickedHardForkLedgerStateTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TransitionInfo) :*: S1 ('MetaSel ('Just "tickedHardForkLedgerStatePerEra") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (HardForkState (Ticked :.: LedgerState) xs))))
type Rep (Ticked (LedgerState (ShelleyBlock era))) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type Rep (Ticked (LedgerState (ShelleyBlock era))) = D1 ('MetaData "Ticked" "Ouroboros.Consensus.Shelley.Ledger.Ledger" "ouroboros-consensus-shelley-0.1.0.0-7e2e0a83095219a150738e67b0e4eefcdaa0fcf4c25a0f06bd4460fdb7be6ea2" 'False) (C1 ('MetaCons "TickedShelleyLedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "untickedShelleyLedgerTip") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (WithOrigin (ShelleyTip era))) :*: (S1 ('MetaSel ('Just "tickedShelleyLedgerTransition") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 ShelleyTransition) :*: S1 ('MetaSel ('Just "tickedShelleyLedgerState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NewEpochState era)))))
type HeaderHash (LedgerState blk) 
Instance details

Defined in Ouroboros.Consensus.Ledger.Basics

type HeaderHash (LedgerState blk) = HeaderHash blk
type LedgerErr (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerErr (LedgerState ByronBlock) = ChainValidationError
type LedgerErr (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

type LedgerErr (LedgerState (HardForkBlock xs)) = HardForkLedgerError xs
type LedgerErr (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type LedgerErr (LedgerState (ShelleyBlock era)) = ShelleyLedgerError era
type LedgerCfg (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

type LedgerCfg (LedgerState ByronBlock) = Config
type LedgerCfg (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

type LedgerCfg (LedgerState (HardForkBlock xs)) = HardForkLedgerConfig xs
type LedgerCfg (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

type LedgerCfg (LedgerState (ShelleyBlock era)) = ShelleyLedgerConfig era
newtype LedgerState (HardForkBlock xs) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Basics

newtype LedgerState (HardForkBlock xs) = HardForkLedgerState {}
data LedgerState (ShelleyBlock era) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

data LedgerState (ShelleyBlock era) = ShelleyLedgerState {}
data Ticked (LedgerState ByronBlock) 
Instance details

Defined in Ouroboros.Consensus.Byron.Ledger.Ledger

data Ticked (LedgerState ByronBlock) = TickedByronLedgerState {}
data Ticked (LedgerState (HardForkBlock xs)) 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Ledger

data Ticked (LedgerState (HardForkBlock xs)) = TickedHardForkLedgerState {}
data Ticked (LedgerState (ShelleyBlock era)) 
Instance details

Defined in Ouroboros.Consensus.Shelley.Ledger.Ledger

data Ticked (LedgerState (ShelleyBlock era)) = TickedShelleyLedgerState {}

getProgressSlotNoEraHistory mode → Either PastHorizonException (RelativeTime, SlotLength) Source #

Internal conversion functions

toLedgerUTxOShelleyLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ ShelleyBasedEra era → UTxO era → UTxO ledgerera Source #

fromLedgerUTxOShelleyLedgerEra era ~ ledgerera ⇒ Crypto ledgerera ~ StandardCrypto ⇒ ShelleyBasedEra era → UTxO ledgerera → UTxO era Source #