{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Cardano.Api.Query.Expr
  ( queryAccountState
  , queryChainBlockNo
  , queryChainPoint
  , queryConstitution
  , queryCurrentEpochState
  , queryCurrentEra
  , queryDebugLedgerState
  , queryEpoch
  , queryConstitutionHash
  , queryEraHistory
  , queryGenesisParameters
  , queryPoolDistribution
  , queryPoolState
  , queryProtocolParameters
  , queryProtocolParametersUpdate
  , queryProtocolState
  , queryStakeAddresses
  , queryStakeDelegDeposits
  , queryStakeDistribution
  , queryStakePoolParameters
  , queryStakePools
  , queryStakeSnapshot
  , querySystemStart
  , queryUtxo
  , L.MemberStatus (..)
  , L.CommitteeMembersState (..)
  , queryCommitteeMembersState
  , queryDRepStakeDistribution
  , querySPOStakeDistribution
  , queryDRepState
  , queryGovState
  , queryStakeVoteDelegatees
  )
where

import           Cardano.Api.Address
import           Cardano.Api.Block
import           Cardano.Api.Certificate
import           Cardano.Api.Eon.BabbageEraOnwards
import           Cardano.Api.Eon.Convert
import           Cardano.Api.Eon.ConwayEraOnwards
import           Cardano.Api.Eon.ShelleyBasedEra
import           Cardano.Api.Eras
import           Cardano.Api.GenesisParameters
import           Cardano.Api.IPC
import           Cardano.Api.IPC.Monad
import           Cardano.Api.Keys.Shelley
import           Cardano.Api.NetworkId
import           Cardano.Api.ProtocolParameters
import           Cardano.Api.Query
import qualified Cardano.Api.ReexposeLedger as Ledger

import qualified Cardano.Ledger.Api as L
import qualified Cardano.Ledger.Api.State.Query as L
import qualified Cardano.Ledger.CertState as L
import qualified Cardano.Ledger.Coin as L
import           Cardano.Ledger.Core (EraCrypto)
import qualified Cardano.Ledger.Credential as L
import qualified Cardano.Ledger.Keys as L
import           Cardano.Ledger.SafeHash
import qualified Cardano.Ledger.Shelley.LedgerState as L
import           Cardano.Slotting.Slot
import           Ouroboros.Consensus.HardFork.Combinator.AcrossEras as Consensus

import           Data.Map (Map)
import           Data.Set (Set)
import qualified Data.Set as S

queryChainBlockNo
  :: ()
  => LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (WithOrigin BlockNo))
queryChainBlockNo :: forall block point r.
LocalStateQueryExpr
  block
  point
  QueryInMode
  r
  IO
  (Either UnsupportedNtcVersionError (WithOrigin BlockNo))
queryChainBlockNo =
  QueryInMode (WithOrigin BlockNo)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (WithOrigin BlockNo))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr QueryInMode (WithOrigin BlockNo)
QueryChainBlockNo

queryChainPoint
  :: ()
  => LocalStateQueryExpr block point QueryInMode r IO (Either UnsupportedNtcVersionError ChainPoint)
queryChainPoint :: forall block point r.
LocalStateQueryExpr
  block
  point
  QueryInMode
  r
  IO
  (Either UnsupportedNtcVersionError ChainPoint)
queryChainPoint =
  QueryInMode ChainPoint
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError ChainPoint)
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr QueryInMode ChainPoint
QueryChainPoint

queryCurrentEra
  :: ()
  => LocalStateQueryExpr block point QueryInMode r IO (Either UnsupportedNtcVersionError AnyCardanoEra)
queryCurrentEra :: forall block point r.
LocalStateQueryExpr
  block
  point
  QueryInMode
  r
  IO
  (Either UnsupportedNtcVersionError AnyCardanoEra)
queryCurrentEra =
  QueryInMode AnyCardanoEra
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError AnyCardanoEra)
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr QueryInMode AnyCardanoEra
QueryCurrentEra

queryCurrentEpochState
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (SerialisedCurrentEpochState era)))
queryCurrentEpochState :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedCurrentEpochState era)))
queryCurrentEpochState ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (SerialisedCurrentEpochState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedCurrentEpochState era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (SerialisedCurrentEpochState era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (SerialisedCurrentEpochState era))))
-> QueryInMode
     (Either EraMismatch (SerialisedCurrentEpochState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedCurrentEpochState era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (SerialisedCurrentEpochState era)
-> QueryInMode
     (Either EraMismatch (SerialisedCurrentEpochState era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (SerialisedCurrentEpochState era)
 -> QueryInMode
      (Either EraMismatch (SerialisedCurrentEpochState era)))
-> QueryInEra era (SerialisedCurrentEpochState era)
-> QueryInMode
     (Either EraMismatch (SerialisedCurrentEpochState era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (SerialisedCurrentEpochState era)
-> QueryInEra era (SerialisedCurrentEpochState era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (SerialisedCurrentEpochState era)
forall era.
QueryInShelleyBasedEra era (SerialisedCurrentEpochState era)
QueryCurrentEpochState

queryEpoch
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch EpochNo))
queryEpoch :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (Either EraMismatch EpochNo))
queryEpoch ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch EpochNo)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (Either EraMismatch EpochNo))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch EpochNo)
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch EpochNo)))
-> QueryInMode (Either EraMismatch EpochNo)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (Either EraMismatch EpochNo))
forall a b. (a -> b) -> a -> b
$ QueryInEra era EpochNo -> QueryInMode (Either EraMismatch EpochNo)
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era EpochNo
 -> QueryInMode (Either EraMismatch EpochNo))
-> QueryInEra era EpochNo
-> QueryInMode (Either EraMismatch EpochNo)
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era EpochNo -> QueryInEra era EpochNo
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era EpochNo
forall era. QueryInShelleyBasedEra era EpochNo
QueryEpoch

queryDebugLedgerState
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (SerialisedDebugLedgerState era)))
queryDebugLedgerState :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedDebugLedgerState era)))
queryDebugLedgerState ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (SerialisedDebugLedgerState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedDebugLedgerState era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (SerialisedDebugLedgerState era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (SerialisedDebugLedgerState era))))
-> QueryInMode
     (Either EraMismatch (SerialisedDebugLedgerState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedDebugLedgerState era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (SerialisedDebugLedgerState era)
-> QueryInMode
     (Either EraMismatch (SerialisedDebugLedgerState era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (SerialisedDebugLedgerState era)
 -> QueryInMode
      (Either EraMismatch (SerialisedDebugLedgerState era)))
-> QueryInEra era (SerialisedDebugLedgerState era)
-> QueryInMode
     (Either EraMismatch (SerialisedDebugLedgerState era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (SerialisedDebugLedgerState era)
-> QueryInEra era (SerialisedDebugLedgerState era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (SerialisedDebugLedgerState era)
forall era.
QueryInShelleyBasedEra era (SerialisedDebugLedgerState era)
QueryDebugLedgerState

queryEraHistory
  :: ()
  => LocalStateQueryExpr block point QueryInMode r IO (Either UnsupportedNtcVersionError EraHistory)
queryEraHistory :: forall block point r.
LocalStateQueryExpr
  block
  point
  QueryInMode
  r
  IO
  (Either UnsupportedNtcVersionError EraHistory)
queryEraHistory =
  QueryInMode EraHistory
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError EraHistory)
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr QueryInMode EraHistory
QueryEraHistory

queryGenesisParameters
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (GenesisParameters ShelleyEra)))
queryGenesisParameters :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (GenesisParameters ShelleyEra)))
queryGenesisParameters ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (GenesisParameters ShelleyEra))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (GenesisParameters ShelleyEra)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (GenesisParameters ShelleyEra))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (GenesisParameters ShelleyEra))))
-> QueryInMode (Either EraMismatch (GenesisParameters ShelleyEra))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (GenesisParameters ShelleyEra)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (GenesisParameters ShelleyEra)
-> QueryInMode (Either EraMismatch (GenesisParameters ShelleyEra))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (GenesisParameters ShelleyEra)
 -> QueryInMode (Either EraMismatch (GenesisParameters ShelleyEra)))
-> QueryInEra era (GenesisParameters ShelleyEra)
-> QueryInMode (Either EraMismatch (GenesisParameters ShelleyEra))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (GenesisParameters ShelleyEra)
-> QueryInEra era (GenesisParameters ShelleyEra)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (GenesisParameters ShelleyEra)
forall era.
QueryInShelleyBasedEra era (GenesisParameters ShelleyEra)
QueryGenesisParameters

queryPoolDistribution
  :: ()
  => BabbageEraOnwards era
  -> Maybe (Set PoolId)
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (SerialisedPoolDistribution era)))
queryPoolDistribution :: forall era block point r.
BabbageEraOnwards era
-> Maybe (Set PoolId)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedPoolDistribution era)))
queryPoolDistribution BabbageEraOnwards era
era Maybe (Set PoolId)
mPoolIds = do
  let sbe :: ShelleyBasedEra era
sbe = BabbageEraOnwards era -> ShelleyBasedEra era
forall era. BabbageEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert BabbageEraOnwards era
era
  QueryInMode (Either EraMismatch (SerialisedPoolDistribution era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedPoolDistribution era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (SerialisedPoolDistribution era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (SerialisedPoolDistribution era))))
-> QueryInMode
     (Either EraMismatch (SerialisedPoolDistribution era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedPoolDistribution era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (SerialisedPoolDistribution era)
-> QueryInMode
     (Either EraMismatch (SerialisedPoolDistribution era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (SerialisedPoolDistribution era)
 -> QueryInMode
      (Either EraMismatch (SerialisedPoolDistribution era)))
-> QueryInEra era (SerialisedPoolDistribution era)
-> QueryInMode
     (Either EraMismatch (SerialisedPoolDistribution era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (SerialisedPoolDistribution era)
-> QueryInEra era (SerialisedPoolDistribution era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (SerialisedPoolDistribution era)
 -> QueryInEra era (SerialisedPoolDistribution era))
-> QueryInShelleyBasedEra era (SerialisedPoolDistribution era)
-> QueryInEra era (SerialisedPoolDistribution era)
forall a b. (a -> b) -> a -> b
$ Maybe (Set PoolId)
-> QueryInShelleyBasedEra era (SerialisedPoolDistribution era)
forall era.
Maybe (Set PoolId)
-> QueryInShelleyBasedEra era (SerialisedPoolDistribution era)
QueryPoolDistribution Maybe (Set PoolId)
mPoolIds

queryPoolState
  :: ()
  => BabbageEraOnwards era
  -> Maybe (Set PoolId)
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (SerialisedPoolState era)))
queryPoolState :: forall era block point r.
BabbageEraOnwards era
-> Maybe (Set PoolId)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedPoolState era)))
queryPoolState BabbageEraOnwards era
era Maybe (Set PoolId)
mPoolIds = do
  let sbe :: ShelleyBasedEra era
sbe = BabbageEraOnwards era -> ShelleyBasedEra era
forall era. BabbageEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert BabbageEraOnwards era
era
  QueryInMode (Either EraMismatch (SerialisedPoolState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedPoolState era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (SerialisedPoolState era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (SerialisedPoolState era))))
-> QueryInMode (Either EraMismatch (SerialisedPoolState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedPoolState era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (SerialisedPoolState era)
-> QueryInMode (Either EraMismatch (SerialisedPoolState era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (SerialisedPoolState era)
 -> QueryInMode (Either EraMismatch (SerialisedPoolState era)))
-> QueryInEra era (SerialisedPoolState era)
-> QueryInMode (Either EraMismatch (SerialisedPoolState era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (SerialisedPoolState era)
-> QueryInEra era (SerialisedPoolState era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (SerialisedPoolState era)
 -> QueryInEra era (SerialisedPoolState era))
-> QueryInShelleyBasedEra era (SerialisedPoolState era)
-> QueryInEra era (SerialisedPoolState era)
forall a b. (a -> b) -> a -> b
$ Maybe (Set PoolId)
-> QueryInShelleyBasedEra era (SerialisedPoolState era)
forall era.
Maybe (Set PoolId)
-> QueryInShelleyBasedEra era (SerialisedPoolState era)
QueryPoolState Maybe (Set PoolId)
mPoolIds

queryProtocolParameters
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (Ledger.PParams (ShelleyLedgerEra era))))
queryProtocolParameters :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (PParams (ShelleyLedgerEra era))))
queryProtocolParameters ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (PParams (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (PParams (ShelleyLedgerEra era))))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (PParams (ShelleyLedgerEra era)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (PParams (ShelleyLedgerEra era)))))
-> QueryInMode
     (Either EraMismatch (PParams (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (PParams (ShelleyLedgerEra era))))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (PParams (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (PParams (ShelleyLedgerEra era)))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (PParams (ShelleyLedgerEra era))
 -> QueryInMode
      (Either EraMismatch (PParams (ShelleyLedgerEra era))))
-> QueryInEra era (PParams (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (PParams (ShelleyLedgerEra era)))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (PParams (ShelleyLedgerEra era))
-> QueryInEra era (PParams (ShelleyLedgerEra era))
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (PParams (ShelleyLedgerEra era))
forall era.
QueryInShelleyBasedEra era (PParams (ShelleyLedgerEra era))
QueryProtocolParameters

queryConstitutionHash
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      ( Either
          UnsupportedNtcVersionError
          (Either EraMismatch (SafeHash (EraCrypto (ShelleyLedgerEra era)) L.AnchorData))
      )
queryConstitutionHash :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
queryConstitutionHash ShelleyBasedEra era
sbe =
  ((Either
   UnsupportedNtcVersionError
   (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
 -> Either
      UnsupportedNtcVersionError
      (Either
         EraMismatch
         (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
forall a b.
(a -> b)
-> LocalStateQueryExpr block point QueryInMode r IO a
-> LocalStateQueryExpr block point QueryInMode r IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Either
    UnsupportedNtcVersionError
    (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
  -> Either
       UnsupportedNtcVersionError
       (Either
          EraMismatch
          (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch
            (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))))
-> ((Constitution (ShelleyLedgerEra era)
     -> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
    -> Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
    -> Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch
            (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
-> (Constitution (ShelleyLedgerEra era)
    -> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Either EraMismatch (Constitution (ShelleyLedgerEra era))
 -> Either
      EraMismatch
      (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))
-> Either
     UnsupportedNtcVersionError
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
-> Either
     UnsupportedNtcVersionError
     (Either
        EraMismatch
        (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))
forall a b.
(a -> b)
-> Either UnsupportedNtcVersionError a
-> Either UnsupportedNtcVersionError b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Either EraMismatch (Constitution (ShelleyLedgerEra era))
  -> Either
       EraMismatch
       (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))
 -> Either
      UnsupportedNtcVersionError
      (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
 -> Either
      UnsupportedNtcVersionError
      (Either
         EraMismatch
         (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
-> ((Constitution (ShelleyLedgerEra era)
     -> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
    -> Either EraMismatch (Constitution (ShelleyLedgerEra era))
    -> Either
         EraMismatch
         (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))
-> (Constitution (ShelleyLedgerEra era)
    -> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
-> Either
     UnsupportedNtcVersionError
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
-> Either
     UnsupportedNtcVersionError
     (Either
        EraMismatch
        (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Constitution (ShelleyLedgerEra era)
 -> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
-> Either EraMismatch (Constitution (ShelleyLedgerEra era))
-> Either
     EraMismatch
     (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
forall a b.
(a -> b) -> Either EraMismatch a -> Either EraMismatch b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap) (Anchor (EraCrypto (ShelleyLedgerEra era))
-> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData
forall c. Anchor c -> SafeHash c AnchorData
L.anchorDataHash (Anchor (EraCrypto (ShelleyLedgerEra era))
 -> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)
-> (Constitution (ShelleyLedgerEra era)
    -> Anchor (EraCrypto (ShelleyLedgerEra era)))
-> Constitution (ShelleyLedgerEra era)
-> SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Constitution (ShelleyLedgerEra era)
-> Anchor (EraCrypto (ShelleyLedgerEra era))
forall era. Constitution era -> Anchor (EraCrypto era)
L.constitutionAnchor) (LocalStateQueryExpr
   block
   point
   QueryInMode
   r
   IO
   (Either
      UnsupportedNtcVersionError
      (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch
            (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData))))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (SafeHash (EraCrypto (ShelleyLedgerEra era)) AnchorData)))
forall a b. (a -> b) -> a -> b
$
    QueryInMode
  (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Constitution (ShelleyLedgerEra era)))))
-> QueryInMode
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
forall a b. (a -> b) -> a -> b
$
      QueryInEra era (Constitution (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Constitution (ShelleyLedgerEra era))
 -> QueryInMode
      (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
-> QueryInEra era (Constitution (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
forall a b. (a -> b) -> a -> b
$
        ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Constitution (ShelleyLedgerEra era))
-> QueryInEra era (Constitution (ShelleyLedgerEra era))
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (Constitution (ShelleyLedgerEra era))
forall era.
QueryInShelleyBasedEra era (Constitution (ShelleyLedgerEra era))
QueryConstitution

queryProtocolParametersUpdate
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      ( Either
          UnsupportedNtcVersionError
          (Either EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))
      )
queryProtocolParametersUpdate :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate)))
queryProtocolParametersUpdate ShelleyBasedEra era
sbe =
  QueryInMode
  (Either
     EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either
      EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))))
-> QueryInMode
     (Either
        EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map (Hash GenesisKey) ProtocolParametersUpdate)
-> QueryInMode
     (Either
        EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map (Hash GenesisKey) ProtocolParametersUpdate)
 -> QueryInMode
      (Either
         EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate)))
-> QueryInEra era (Map (Hash GenesisKey) ProtocolParametersUpdate)
-> QueryInMode
     (Either
        EraMismatch (Map (Hash GenesisKey) ProtocolParametersUpdate))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra
     era (Map (Hash GenesisKey) ProtocolParametersUpdate)
-> QueryInEra era (Map (Hash GenesisKey) ProtocolParametersUpdate)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra
  era (Map (Hash GenesisKey) ProtocolParametersUpdate)
forall era.
QueryInShelleyBasedEra
  era (Map (Hash GenesisKey) ProtocolParametersUpdate)
QueryProtocolParametersUpdate

queryProtocolState
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (ProtocolState era)))
queryProtocolState :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (ProtocolState era)))
queryProtocolState ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (ProtocolState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (ProtocolState era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (ProtocolState era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (ProtocolState era))))
-> QueryInMode (Either EraMismatch (ProtocolState era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (ProtocolState era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (ProtocolState era)
-> QueryInMode (Either EraMismatch (ProtocolState era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (ProtocolState era)
 -> QueryInMode (Either EraMismatch (ProtocolState era)))
-> QueryInEra era (ProtocolState era)
-> QueryInMode (Either EraMismatch (ProtocolState era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (ProtocolState era)
-> QueryInEra era (ProtocolState era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (ProtocolState era)
forall era. QueryInShelleyBasedEra era (ProtocolState era)
QueryProtocolState

queryStakeAddresses
  :: ()
  => ShelleyBasedEra era
  -> Set StakeCredential
  -> NetworkId
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      ( Either
          UnsupportedNtcVersionError
          (Either EraMismatch (Map StakeAddress L.Coin, Map StakeAddress PoolId))
      )
queryStakeAddresses :: forall era block point r.
ShelleyBasedEra era
-> Set StakeCredential
-> NetworkId
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId)))
queryStakeAddresses ShelleyBasedEra era
sbe Set StakeCredential
stakeCredentials NetworkId
networkId =
  QueryInMode
  (Either
     EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either
      EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId))))
-> QueryInMode
     (Either
        EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map StakeAddress Coin, Map StakeAddress PoolId)
-> QueryInMode
     (Either
        EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map StakeAddress Coin, Map StakeAddress PoolId)
 -> QueryInMode
      (Either
         EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId)))
-> QueryInEra era (Map StakeAddress Coin, Map StakeAddress PoolId)
-> QueryInMode
     (Either
        EraMismatch (Map StakeAddress Coin, Map StakeAddress PoolId))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra
     era (Map StakeAddress Coin, Map StakeAddress PoolId)
-> QueryInEra era (Map StakeAddress Coin, Map StakeAddress PoolId)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra
   era (Map StakeAddress Coin, Map StakeAddress PoolId)
 -> QueryInEra era (Map StakeAddress Coin, Map StakeAddress PoolId))
-> QueryInShelleyBasedEra
     era (Map StakeAddress Coin, Map StakeAddress PoolId)
-> QueryInEra era (Map StakeAddress Coin, Map StakeAddress PoolId)
forall a b. (a -> b) -> a -> b
$ Set StakeCredential
-> NetworkId
-> QueryInShelleyBasedEra
     era (Map StakeAddress Coin, Map StakeAddress PoolId)
forall era.
Set StakeCredential
-> NetworkId
-> QueryInShelleyBasedEra
     era (Map StakeAddress Coin, Map StakeAddress PoolId)
QueryStakeAddresses Set StakeCredential
stakeCredentials NetworkId
networkId

queryStakeDelegDeposits
  :: BabbageEraOnwards era
  -> Set StakeCredential
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either Consensus.EraMismatch (Map StakeCredential L.Coin)))
queryStakeDelegDeposits :: forall era block point r.
BabbageEraOnwards era
-> Set StakeCredential
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential Coin)))
queryStakeDelegDeposits BabbageEraOnwards era
era Set StakeCredential
stakeCreds
  | Set StakeCredential -> Bool
forall a. Set a -> Bool
S.null Set StakeCredential
stakeCreds = Either
  UnsupportedNtcVersionError
  (Either EraMismatch (Map StakeCredential Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential Coin)))
forall a. a -> LocalStateQueryExpr block point QueryInMode r IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either
   UnsupportedNtcVersionError
   (Either EraMismatch (Map StakeCredential Coin))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map StakeCredential Coin))))
-> (Either EraMismatch (Map StakeCredential Coin)
    -> Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map StakeCredential Coin)))
-> Either EraMismatch (Map StakeCredential Coin)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential Coin)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Either EraMismatch (Map StakeCredential Coin)
-> Either
     UnsupportedNtcVersionError
     (Either EraMismatch (Map StakeCredential Coin))
forall a. a -> Either UnsupportedNtcVersionError a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either EraMismatch (Map StakeCredential Coin)
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map StakeCredential Coin))))
-> Either EraMismatch (Map StakeCredential Coin)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential Coin)))
forall a b. (a -> b) -> a -> b
$ Map StakeCredential Coin
-> Either EraMismatch (Map StakeCredential Coin)
forall a. a -> Either EraMismatch a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Map StakeCredential Coin
forall a. Monoid a => a
mempty
  | Bool
otherwise = do
      let sbe :: ShelleyBasedEra era
sbe = BabbageEraOnwards era -> ShelleyBasedEra era
forall era. BabbageEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert BabbageEraOnwards era
era
      QueryInMode (Either EraMismatch (Map StakeCredential Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential Coin)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (Map StakeCredential Coin))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map StakeCredential Coin))))
-> QueryInMode (Either EraMismatch (Map StakeCredential Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential Coin)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map StakeCredential Coin)
-> QueryInMode (Either EraMismatch (Map StakeCredential Coin))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map StakeCredential Coin)
 -> QueryInMode (Either EraMismatch (Map StakeCredential Coin)))
-> (QueryInShelleyBasedEra era (Map StakeCredential Coin)
    -> QueryInEra era (Map StakeCredential Coin))
-> QueryInShelleyBasedEra era (Map StakeCredential Coin)
-> QueryInMode (Either EraMismatch (Map StakeCredential Coin))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Map StakeCredential Coin)
-> QueryInEra era (Map StakeCredential Coin)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (Map StakeCredential Coin)
 -> QueryInMode (Either EraMismatch (Map StakeCredential Coin)))
-> QueryInShelleyBasedEra era (Map StakeCredential Coin)
-> QueryInMode (Either EraMismatch (Map StakeCredential Coin))
forall a b. (a -> b) -> a -> b
$ Set StakeCredential
-> QueryInShelleyBasedEra era (Map StakeCredential Coin)
forall era.
Set StakeCredential
-> QueryInShelleyBasedEra era (Map StakeCredential Coin)
QueryStakeDelegDeposits Set StakeCredential
stakeCreds

queryStakeDistribution
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (Map (Hash StakePoolKey) Rational)))
queryStakeDistribution :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId Rational)))
queryStakeDistribution ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (Map PoolId Rational))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId Rational)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (Map PoolId Rational))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map PoolId Rational))))
-> QueryInMode (Either EraMismatch (Map PoolId Rational))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId Rational)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map PoolId Rational)
-> QueryInMode (Either EraMismatch (Map PoolId Rational))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map PoolId Rational)
 -> QueryInMode (Either EraMismatch (Map PoolId Rational)))
-> QueryInEra era (Map PoolId Rational)
-> QueryInMode (Either EraMismatch (Map PoolId Rational))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Map PoolId Rational)
-> QueryInEra era (Map PoolId Rational)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (Map PoolId Rational)
forall era. QueryInShelleyBasedEra era (Map PoolId Rational)
QueryStakeDistribution

queryStakePoolParameters
  :: ()
  => ShelleyBasedEra era
  -> Set PoolId
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (Map PoolId StakePoolParameters)))
queryStakePoolParameters :: forall era block point r.
ShelleyBasedEra era
-> Set PoolId
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId StakePoolParameters)))
queryStakePoolParameters ShelleyBasedEra era
sbe Set PoolId
poolIds
  | Set PoolId -> Bool
forall a. Set a -> Bool
S.null Set PoolId
poolIds = Either
  UnsupportedNtcVersionError
  (Either EraMismatch (Map PoolId StakePoolParameters))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId StakePoolParameters)))
forall a. a -> LocalStateQueryExpr block point QueryInMode r IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either
   UnsupportedNtcVersionError
   (Either EraMismatch (Map PoolId StakePoolParameters))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map PoolId StakePoolParameters))))
-> (Either EraMismatch (Map PoolId StakePoolParameters)
    -> Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map PoolId StakePoolParameters)))
-> Either EraMismatch (Map PoolId StakePoolParameters)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId StakePoolParameters)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Either EraMismatch (Map PoolId StakePoolParameters)
-> Either
     UnsupportedNtcVersionError
     (Either EraMismatch (Map PoolId StakePoolParameters))
forall a. a -> Either UnsupportedNtcVersionError a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either EraMismatch (Map PoolId StakePoolParameters)
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map PoolId StakePoolParameters))))
-> Either EraMismatch (Map PoolId StakePoolParameters)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId StakePoolParameters)))
forall a b. (a -> b) -> a -> b
$ Map PoolId StakePoolParameters
-> Either EraMismatch (Map PoolId StakePoolParameters)
forall a. a -> Either EraMismatch a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Map PoolId StakePoolParameters
forall a. Monoid a => a
mempty
  | Bool
otherwise =
      QueryInMode (Either EraMismatch (Map PoolId StakePoolParameters))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId StakePoolParameters)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (Map PoolId StakePoolParameters))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map PoolId StakePoolParameters))))
-> QueryInMode
     (Either EraMismatch (Map PoolId StakePoolParameters))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map PoolId StakePoolParameters)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map PoolId StakePoolParameters)
-> QueryInMode
     (Either EraMismatch (Map PoolId StakePoolParameters))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map PoolId StakePoolParameters)
 -> QueryInMode
      (Either EraMismatch (Map PoolId StakePoolParameters)))
-> QueryInEra era (Map PoolId StakePoolParameters)
-> QueryInMode
     (Either EraMismatch (Map PoolId StakePoolParameters))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)
-> QueryInEra era (Map PoolId StakePoolParameters)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)
 -> QueryInEra era (Map PoolId StakePoolParameters))
-> QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)
-> QueryInEra era (Map PoolId StakePoolParameters)
forall a b. (a -> b) -> a -> b
$ Set PoolId
-> QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)
forall era.
Set PoolId
-> QueryInShelleyBasedEra era (Map PoolId StakePoolParameters)
QueryStakePoolParameters Set PoolId
poolIds

queryStakePools
  :: ()
  => ShelleyBasedEra era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (Set PoolId)))
queryStakePools :: forall era block point r.
ShelleyBasedEra era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError (Either EraMismatch (Set PoolId)))
queryStakePools ShelleyBasedEra era
sbe =
  QueryInMode (Either EraMismatch (Set PoolId))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError (Either EraMismatch (Set PoolId)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (Set PoolId))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError (Either EraMismatch (Set PoolId))))
-> QueryInMode (Either EraMismatch (Set PoolId))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError (Either EraMismatch (Set PoolId)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Set PoolId)
-> QueryInMode (Either EraMismatch (Set PoolId))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Set PoolId)
 -> QueryInMode (Either EraMismatch (Set PoolId)))
-> (QueryInShelleyBasedEra era (Set PoolId)
    -> QueryInEra era (Set PoolId))
-> QueryInShelleyBasedEra era (Set PoolId)
-> QueryInMode (Either EraMismatch (Set PoolId))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Set PoolId)
-> QueryInEra era (Set PoolId)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (Set PoolId)
 -> QueryInMode (Either EraMismatch (Set PoolId)))
-> QueryInShelleyBasedEra era (Set PoolId)
-> QueryInMode (Either EraMismatch (Set PoolId))
forall a b. (a -> b) -> a -> b
$ QueryInShelleyBasedEra era (Set PoolId)
forall era. QueryInShelleyBasedEra era (Set PoolId)
QueryStakePools

queryStakeSnapshot
  :: ()
  => BabbageEraOnwards era
  -> Maybe (Set PoolId)
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (SerialisedStakeSnapshots era)))
queryStakeSnapshot :: forall era block point r.
BabbageEraOnwards era
-> Maybe (Set PoolId)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedStakeSnapshots era)))
queryStakeSnapshot BabbageEraOnwards era
era Maybe (Set PoolId)
mPoolIds = do
  let sbe :: ShelleyBasedEra era
sbe = BabbageEraOnwards era -> ShelleyBasedEra era
forall era. BabbageEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert BabbageEraOnwards era
era
  QueryInMode (Either EraMismatch (SerialisedStakeSnapshots era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedStakeSnapshots era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (SerialisedStakeSnapshots era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (SerialisedStakeSnapshots era))))
-> QueryInMode (Either EraMismatch (SerialisedStakeSnapshots era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (SerialisedStakeSnapshots era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (SerialisedStakeSnapshots era)
-> QueryInMode (Either EraMismatch (SerialisedStakeSnapshots era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (SerialisedStakeSnapshots era)
 -> QueryInMode (Either EraMismatch (SerialisedStakeSnapshots era)))
-> QueryInEra era (SerialisedStakeSnapshots era)
-> QueryInMode (Either EraMismatch (SerialisedStakeSnapshots era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (SerialisedStakeSnapshots era)
-> QueryInEra era (SerialisedStakeSnapshots era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (SerialisedStakeSnapshots era)
 -> QueryInEra era (SerialisedStakeSnapshots era))
-> QueryInShelleyBasedEra era (SerialisedStakeSnapshots era)
-> QueryInEra era (SerialisedStakeSnapshots era)
forall a b. (a -> b) -> a -> b
$ Maybe (Set PoolId)
-> QueryInShelleyBasedEra era (SerialisedStakeSnapshots era)
forall era.
Maybe (Set PoolId)
-> QueryInShelleyBasedEra era (SerialisedStakeSnapshots era)
QueryStakeSnapshot Maybe (Set PoolId)
mPoolIds

querySystemStart
  :: ()
  => LocalStateQueryExpr block point QueryInMode r IO (Either UnsupportedNtcVersionError SystemStart)
querySystemStart :: forall block point r.
LocalStateQueryExpr
  block
  point
  QueryInMode
  r
  IO
  (Either UnsupportedNtcVersionError SystemStart)
querySystemStart =
  QueryInMode SystemStart
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError SystemStart)
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr QueryInMode SystemStart
QuerySystemStart

queryUtxo
  :: ()
  => ShelleyBasedEra era
  -> QueryUTxOFilter
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (UTxO era)))
queryUtxo :: forall era block point r.
ShelleyBasedEra era
-> QueryUTxOFilter
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (Either EraMismatch (UTxO era)))
queryUtxo ShelleyBasedEra era
sbe QueryUTxOFilter
utxoFilter =
  QueryInMode (Either EraMismatch (UTxO era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (Either EraMismatch (UTxO era)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (UTxO era))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError (Either EraMismatch (UTxO era))))
-> QueryInMode (Either EraMismatch (UTxO era))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either UnsupportedNtcVersionError (Either EraMismatch (UTxO era)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (UTxO era)
-> QueryInMode (Either EraMismatch (UTxO era))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (UTxO era)
 -> QueryInMode (Either EraMismatch (UTxO era)))
-> QueryInEra era (UTxO era)
-> QueryInMode (Either EraMismatch (UTxO era))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (UTxO era)
-> QueryInEra era (UTxO era)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (UTxO era)
 -> QueryInEra era (UTxO era))
-> QueryInShelleyBasedEra era (UTxO era)
-> QueryInEra era (UTxO era)
forall a b. (a -> b) -> a -> b
$ QueryUTxOFilter -> QueryInShelleyBasedEra era (UTxO era)
forall era.
QueryUTxOFilter -> QueryInShelleyBasedEra era (UTxO era)
QueryUTxO QueryUTxOFilter
utxoFilter

queryConstitution
  :: ()
  => ConwayEraOnwards era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (L.Constitution (ShelleyLedgerEra era))))
queryConstitution :: forall era block point r.
ConwayEraOnwards era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
queryConstitution ConwayEraOnwards era
era = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode
  (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Constitution (ShelleyLedgerEra era)))))
-> QueryInMode
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Constitution (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Constitution (ShelleyLedgerEra era))
 -> QueryInMode
      (Either EraMismatch (Constitution (ShelleyLedgerEra era))))
-> QueryInEra era (Constitution (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (Constitution (ShelleyLedgerEra era)))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Constitution (ShelleyLedgerEra era))
-> QueryInEra era (Constitution (ShelleyLedgerEra era))
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (Constitution (ShelleyLedgerEra era))
forall era.
QueryInShelleyBasedEra era (Constitution (ShelleyLedgerEra era))
QueryConstitution

queryGovState
  :: ()
  => ConwayEraOnwards era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (L.GovState (ShelleyLedgerEra era))))
queryGovState :: forall era block point r.
ConwayEraOnwards era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (GovState (ShelleyLedgerEra era))))
queryGovState ConwayEraOnwards era
era = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode (Either EraMismatch (GovState (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (GovState (ShelleyLedgerEra era))))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (GovState (ShelleyLedgerEra era)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (GovState (ShelleyLedgerEra era)))))
-> QueryInMode
     (Either EraMismatch (GovState (ShelleyLedgerEra era)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (GovState (ShelleyLedgerEra era))))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (GovState (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (GovState (ShelleyLedgerEra era)))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (GovState (ShelleyLedgerEra era))
 -> QueryInMode
      (Either EraMismatch (GovState (ShelleyLedgerEra era))))
-> QueryInEra era (GovState (ShelleyLedgerEra era))
-> QueryInMode
     (Either EraMismatch (GovState (ShelleyLedgerEra era)))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (GovState (ShelleyLedgerEra era))
-> QueryInEra era (GovState (ShelleyLedgerEra era))
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe QueryInShelleyBasedEra era (GovState (ShelleyLedgerEra era))
forall era.
QueryInShelleyBasedEra era (GovState (ShelleyLedgerEra era))
QueryGovState

queryDRepState
  :: ConwayEraOnwards era
  -> Set (L.Credential L.DRepRole L.StandardCrypto)
  -- ^ An empty credentials set means that states for all DReps will be returned
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      ( Either
          UnsupportedNtcVersionError
          (Either EraMismatch (Map (L.Credential L.DRepRole L.StandardCrypto) (L.DRepState L.StandardCrypto)))
      )
queryDRepState :: forall era block point r.
ConwayEraOnwards era
-> Set (Credential 'DRepRole StandardCrypto)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (Map
              (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))))
queryDRepState ConwayEraOnwards era
era Set (Credential 'DRepRole StandardCrypto)
drepCreds = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode
  (Either
     EraMismatch
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (Map
              (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either
      EraMismatch
      (Map
         (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch
            (Map
               (Credential 'DRepRole StandardCrypto)
               (DRepState StandardCrypto)))))
-> QueryInMode
     (Either
        EraMismatch
        (Map
           (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch
           (Map
              (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))))
forall a b. (a -> b) -> a -> b
$ QueryInEra
  era
  (Map
     (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
-> QueryInMode
     (Either
        EraMismatch
        (Map
           (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra
   era
   (Map
      (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
 -> QueryInMode
      (Either
         EraMismatch
         (Map
            (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))))
-> QueryInEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
-> QueryInMode
     (Either
        EraMismatch
        (Map
           (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
-> QueryInEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra
   era
   (Map
      (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
 -> QueryInEra
      era
      (Map
         (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto)))
-> QueryInShelleyBasedEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
-> QueryInEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
forall a b. (a -> b) -> a -> b
$ Set (Credential 'DRepRole StandardCrypto)
-> QueryInShelleyBasedEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
forall era.
Set (Credential 'DRepRole StandardCrypto)
-> QueryInShelleyBasedEra
     era
     (Map
        (Credential 'DRepRole StandardCrypto) (DRepState StandardCrypto))
QueryDRepState Set (Credential 'DRepRole StandardCrypto)
drepCreds

queryDRepStakeDistribution
  :: ConwayEraOnwards era
  -> Set (L.DRep L.StandardCrypto)
  -- ^ An empty DRep set means that distributions for all DReps will be returned
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (Map (L.DRep L.StandardCrypto) L.Coin)))
queryDRepStakeDistribution :: forall era block point r.
ConwayEraOnwards era
-> Set (DRep StandardCrypto)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map (DRep StandardCrypto) Coin)))
queryDRepStakeDistribution ConwayEraOnwards era
era Set (DRep StandardCrypto)
dreps = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode (Either EraMismatch (Map (DRep StandardCrypto) Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map (DRep StandardCrypto) Coin)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch (Map (DRep StandardCrypto) Coin))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map (DRep StandardCrypto) Coin))))
-> QueryInMode
     (Either EraMismatch (Map (DRep StandardCrypto) Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map (DRep StandardCrypto) Coin)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map (DRep StandardCrypto) Coin)
-> QueryInMode
     (Either EraMismatch (Map (DRep StandardCrypto) Coin))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map (DRep StandardCrypto) Coin)
 -> QueryInMode
      (Either EraMismatch (Map (DRep StandardCrypto) Coin)))
-> QueryInEra era (Map (DRep StandardCrypto) Coin)
-> QueryInMode
     (Either EraMismatch (Map (DRep StandardCrypto) Coin))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra era (Map (DRep StandardCrypto) Coin)
-> QueryInEra era (Map (DRep StandardCrypto) Coin)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra era (Map (DRep StandardCrypto) Coin)
 -> QueryInEra era (Map (DRep StandardCrypto) Coin))
-> QueryInShelleyBasedEra era (Map (DRep StandardCrypto) Coin)
-> QueryInEra era (Map (DRep StandardCrypto) Coin)
forall a b. (a -> b) -> a -> b
$ Set (DRep StandardCrypto)
-> QueryInShelleyBasedEra era (Map (DRep StandardCrypto) Coin)
forall era.
Set (DRep StandardCrypto)
-> QueryInShelleyBasedEra era (Map (DRep StandardCrypto) Coin)
QueryDRepStakeDistr Set (DRep StandardCrypto)
dreps

querySPOStakeDistribution
  :: ConwayEraOnwards era
  -> Set (L.KeyHash 'L.StakePool L.StandardCrypto)
  -- ^ An empty SPO key hash set means that distributions for all SPOs will be returned
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      ( Either
          UnsupportedNtcVersionError
          (Either EraMismatch (Map (L.KeyHash 'L.StakePool L.StandardCrypto) L.Coin))
      )
querySPOStakeDistribution :: forall era block point r.
ConwayEraOnwards era
-> Set (KeyHash 'StakePool StandardCrypto)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin)))
querySPOStakeDistribution ConwayEraOnwards era
era Set (KeyHash 'StakePool StandardCrypto)
spos = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode
  (Either EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either
            EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin))))
-> QueryInMode
     (Either EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either
           EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin)))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map (KeyHash 'StakePool StandardCrypto) Coin)
-> QueryInMode
     (Either EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map (KeyHash 'StakePool StandardCrypto) Coin)
 -> QueryInMode
      (Either
         EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin)))
-> QueryInEra era (Map (KeyHash 'StakePool StandardCrypto) Coin)
-> QueryInMode
     (Either EraMismatch (Map (KeyHash 'StakePool StandardCrypto) Coin))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra
     era (Map (KeyHash 'StakePool StandardCrypto) Coin)
-> QueryInEra era (Map (KeyHash 'StakePool StandardCrypto) Coin)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra
   era (Map (KeyHash 'StakePool StandardCrypto) Coin)
 -> QueryInEra era (Map (KeyHash 'StakePool StandardCrypto) Coin))
-> QueryInShelleyBasedEra
     era (Map (KeyHash 'StakePool StandardCrypto) Coin)
-> QueryInEra era (Map (KeyHash 'StakePool StandardCrypto) Coin)
forall a b. (a -> b) -> a -> b
$ Set (KeyHash 'StakePool StandardCrypto)
-> QueryInShelleyBasedEra
     era (Map (KeyHash 'StakePool StandardCrypto) Coin)
forall era.
Set (KeyHash 'StakePool StandardCrypto)
-> QueryInShelleyBasedEra
     era (Map (KeyHash 'StakePool StandardCrypto) Coin)
QuerySPOStakeDistr Set (KeyHash 'StakePool StandardCrypto)
spos

-- | Returns info about committee members filtered by: cold credentials, hot credentials and statuses.
-- If empty sets are passed as filters, then no filtering is done.
queryCommitteeMembersState
  :: ConwayEraOnwards era
  -> Set (L.Credential L.ColdCommitteeRole L.StandardCrypto)
  -> Set (L.Credential L.HotCommitteeRole L.StandardCrypto)
  -> Set L.MemberStatus
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch (L.CommitteeMembersState L.StandardCrypto)))
queryCommitteeMembersState :: forall era block point r.
ConwayEraOnwards era
-> Set (Credential 'ColdCommitteeRole StandardCrypto)
-> Set (Credential 'HotCommitteeRole StandardCrypto)
-> Set MemberStatus
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (CommitteeMembersState StandardCrypto)))
queryCommitteeMembersState ConwayEraOnwards era
era Set (Credential 'ColdCommitteeRole StandardCrypto)
coldCreds Set (Credential 'HotCommitteeRole StandardCrypto)
hotCreds Set MemberStatus
statuses = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode
  (Either EraMismatch (CommitteeMembersState StandardCrypto))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (CommitteeMembersState StandardCrypto)))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either EraMismatch (CommitteeMembersState StandardCrypto))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (CommitteeMembersState StandardCrypto))))
-> QueryInMode
     (Either EraMismatch (CommitteeMembersState StandardCrypto))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (CommitteeMembersState StandardCrypto)))
forall a b. (a -> b) -> a -> b
$
    QueryInEra era (CommitteeMembersState StandardCrypto)
-> QueryInMode
     (Either EraMismatch (CommitteeMembersState StandardCrypto))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (CommitteeMembersState StandardCrypto)
 -> QueryInMode
      (Either EraMismatch (CommitteeMembersState StandardCrypto)))
-> QueryInEra era (CommitteeMembersState StandardCrypto)
-> QueryInMode
     (Either EraMismatch (CommitteeMembersState StandardCrypto))
forall a b. (a -> b) -> a -> b
$
      ShelleyBasedEra era
-> QueryInShelleyBasedEra
     era (CommitteeMembersState StandardCrypto)
-> QueryInEra era (CommitteeMembersState StandardCrypto)
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (Set (Credential 'ColdCommitteeRole StandardCrypto)
-> Set (Credential 'HotCommitteeRole StandardCrypto)
-> Set MemberStatus
-> QueryInShelleyBasedEra
     era (CommitteeMembersState StandardCrypto)
forall era.
Set (Credential 'ColdCommitteeRole StandardCrypto)
-> Set (Credential 'HotCommitteeRole StandardCrypto)
-> Set MemberStatus
-> QueryInShelleyBasedEra
     era (CommitteeMembersState StandardCrypto)
QueryCommitteeMembersState Set (Credential 'ColdCommitteeRole StandardCrypto)
coldCreds Set (Credential 'HotCommitteeRole StandardCrypto)
hotCreds Set MemberStatus
statuses)

queryStakeVoteDelegatees
  :: ConwayEraOnwards era
  -> Set StakeCredential
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      ( Either
          UnsupportedNtcVersionError
          (Either EraMismatch (Map StakeCredential (L.DRep L.StandardCrypto)))
      )
queryStakeVoteDelegatees :: forall era block point r.
ConwayEraOnwards era
-> Set StakeCredential
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential (DRep StandardCrypto))))
queryStakeVoteDelegatees ConwayEraOnwards era
era Set StakeCredential
stakeCredentials = do
  let sbe :: ShelleyBasedEra era
sbe = ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
era
  QueryInMode
  (Either EraMismatch (Map StakeCredential (DRep StandardCrypto)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential (DRep StandardCrypto))))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode
   (Either EraMismatch (Map StakeCredential (DRep StandardCrypto)))
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError
         (Either EraMismatch (Map StakeCredential (DRep StandardCrypto)))))
-> QueryInMode
     (Either EraMismatch (Map StakeCredential (DRep StandardCrypto)))
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError
        (Either EraMismatch (Map StakeCredential (DRep StandardCrypto))))
forall a b. (a -> b) -> a -> b
$ QueryInEra era (Map StakeCredential (DRep StandardCrypto))
-> QueryInMode
     (Either EraMismatch (Map StakeCredential (DRep StandardCrypto)))
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era (Map StakeCredential (DRep StandardCrypto))
 -> QueryInMode
      (Either EraMismatch (Map StakeCredential (DRep StandardCrypto))))
-> QueryInEra era (Map StakeCredential (DRep StandardCrypto))
-> QueryInMode
     (Either EraMismatch (Map StakeCredential (DRep StandardCrypto)))
forall a b. (a -> b) -> a -> b
$ ShelleyBasedEra era
-> QueryInShelleyBasedEra
     era (Map StakeCredential (DRep StandardCrypto))
-> QueryInEra era (Map StakeCredential (DRep StandardCrypto))
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra ShelleyBasedEra era
sbe (QueryInShelleyBasedEra
   era (Map StakeCredential (DRep StandardCrypto))
 -> QueryInEra era (Map StakeCredential (DRep StandardCrypto)))
-> QueryInShelleyBasedEra
     era (Map StakeCredential (DRep StandardCrypto))
-> QueryInEra era (Map StakeCredential (DRep StandardCrypto))
forall a b. (a -> b) -> a -> b
$ Set StakeCredential
-> QueryInShelleyBasedEra
     era (Map StakeCredential (DRep StandardCrypto))
forall era.
Set StakeCredential
-> QueryInShelleyBasedEra
     era (Map StakeCredential (DRep StandardCrypto))
QueryStakeVoteDelegatees Set StakeCredential
stakeCredentials

queryAccountState
  :: ConwayEraOnwards era
  -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either UnsupportedNtcVersionError (Either EraMismatch L.AccountState))
queryAccountState :: forall era block point r.
ConwayEraOnwards era
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError (Either EraMismatch AccountState))
queryAccountState ConwayEraOnwards era
cOnwards =
  QueryInMode (Either EraMismatch AccountState)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError (Either EraMismatch AccountState))
forall a block point r.
QueryInMode a
-> LocalStateQueryExpr
     block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
queryExpr (QueryInMode (Either EraMismatch AccountState)
 -> LocalStateQueryExpr
      block
      point
      QueryInMode
      r
      IO
      (Either
         UnsupportedNtcVersionError (Either EraMismatch AccountState)))
-> QueryInMode (Either EraMismatch AccountState)
-> LocalStateQueryExpr
     block
     point
     QueryInMode
     r
     IO
     (Either
        UnsupportedNtcVersionError (Either EraMismatch AccountState))
forall a b. (a -> b) -> a -> b
$
    QueryInEra era AccountState
-> QueryInMode (Either EraMismatch AccountState)
forall era result1.
QueryInEra era result1 -> QueryInMode (Either EraMismatch result1)
QueryInEra (QueryInEra era AccountState
 -> QueryInMode (Either EraMismatch AccountState))
-> (QueryInShelleyBasedEra era AccountState
    -> QueryInEra era AccountState)
-> QueryInShelleyBasedEra era AccountState
-> QueryInMode (Either EraMismatch AccountState)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ShelleyBasedEra era
-> QueryInShelleyBasedEra era AccountState
-> QueryInEra era AccountState
forall era result.
ShelleyBasedEra era
-> QueryInShelleyBasedEra era result -> QueryInEra era result
QueryInShelleyBasedEra (ConwayEraOnwards era -> ShelleyBasedEra era
forall era. ConwayEraOnwards era -> ShelleyBasedEra era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert ConwayEraOnwards era
cOnwards) (QueryInShelleyBasedEra era AccountState
 -> QueryInMode (Either EraMismatch AccountState))
-> QueryInShelleyBasedEra era AccountState
-> QueryInMode (Either EraMismatch AccountState)
forall a b. (a -> b) -> a -> b
$
      QueryInShelleyBasedEra era AccountState
forall era. QueryInShelleyBasedEra era AccountState
QueryAccountState