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

module Cardano.CLI.EraBased.Options.Query
  ( pQueryCmds
  , pQueryCmdsTopLevel
  )
where

import           Cardano.Api hiding (QueryInShelleyBasedEra (..))
import qualified Cardano.Api as MemberStatus (MemberStatus (..))
import           Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..))

import           Cardano.CLI.Environment (EnvCli (..))
import           Cardano.CLI.EraBased.Commands.Query
import           Cardano.CLI.EraBased.Options.Common
import           Cardano.CLI.Parser
import           Cardano.CLI.Types.Common
import           Cardano.CLI.Types.Key

import           Data.Foldable
import           GHC.Exts (IsList (..))
import           Options.Applicative hiding (help, str)
import qualified Options.Applicative as Opt

{- HLINT ignore "Use <$>" -}
{- HLINT ignore "Move brackets to avoid $" -}

pQueryCmdsTopLevel :: EnvCli -> Parser (QueryCmds ConwayEra)
pQueryCmdsTopLevel :: EnvCli -> Parser (QueryCmds ConwayEra)
pQueryCmdsTopLevel EnvCli
envCli =
  let parsers :: [Parser (QueryCmds ConwayEra)]
parsers =
        [ EnvCli -> Parser (QueryCmds ConwayEra)
forall era. EnvCli -> Parser (QueryCmds era)
pProtocolParams EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pTip EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pStakePools EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pStakeDistribution EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pStakeAddressInfo EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pUTxO EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pLedgerState EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pProtocolState EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pStakeSnapshot EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pPoolParams EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pLeadershipSchedule EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pKesPeriodInfo EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pPoolState EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
forall era. EnvCli -> Parser (QueryCmds era)
pTxMempool EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pSlotNumber EnvCli
envCli
        , EnvCli -> Parser (QueryCmds ConwayEra)
pQueryLedgerPeerSnapshot EnvCli
envCli
        ]
      i :: InfoMod a
i =
        String -> InfoMod a
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod a) -> String -> InfoMod a
forall a b. (a -> b) -> a -> b
$
          [String] -> String
forall a. Monoid a => [a] -> a
mconcat
            [ String
"Node query commands. Will query the local node whose Unix domain socket is "
            , String
"obtained from the CARDANO_NODE_SOCKET_PATH environment variable."
            ]
   in String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"query" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$ Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info ([Parser (QueryCmds ConwayEra)] -> Parser (QueryCmds ConwayEra)
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum [Parser (QueryCmds ConwayEra)]
parsers) InfoMod (QueryCmds ConwayEra)
forall {a}. InfoMod a
i

pProtocolParams :: EnvCli -> Parser (QueryCmds era)
pProtocolParams :: forall era. EnvCli -> Parser (QueryCmds era)
pProtocolParams EnvCli
envCli =
  String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"protocol-parameters" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (EnvCli -> Parser (QueryCmds era)
forall era. EnvCli -> Parser (QueryCmds era)
pQueryProtocolParametersCmd EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current protocol parameters"

pTip :: EnvCli -> Parser (QueryCmds ConwayEra)
pTip :: EnvCli -> Parser (QueryCmds ConwayEra)
pTip EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"tip" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryTipCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current tip (slot no, hash, block no)"

pStakePools :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakePools :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakePools EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-pools" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakePoolsCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current set of stake pool ids"

pStakeDistribution :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakeDistribution :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakeDistribution EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-distribution" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeDistributionCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current aggregated stake distribution"

pStakeAddressInfo :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakeAddressInfo :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakeAddressInfo EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-address-info" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeAddressInfoCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Get the current delegations and reward accounts filtered by stake address."
          ]

pUTxO :: EnvCli -> Parser (QueryCmds ConwayEra)
pUTxO :: EnvCli -> Parser (QueryCmds ConwayEra)
pUTxO EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"utxo" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryUTxOCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Get a portion of the current UTxO: by tx in, by address or the whole."
          ]

pLedgerState :: EnvCli -> Parser (QueryCmds ConwayEra)
pLedgerState :: EnvCli -> Parser (QueryCmds ConwayEra)
pLedgerState EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"ledger-state" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerStateCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command)"
          ]

pProtocolState :: EnvCli -> Parser (QueryCmds ConwayEra)
pProtocolState :: EnvCli -> Parser (QueryCmds ConwayEra)
pProtocolState EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"protocol-state" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryProtocolStateCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command)"
          ]

pStakeSnapshot :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakeSnapshot :: EnvCli -> Parser (QueryCmds ConwayEra)
pStakeSnapshot EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-snapshot" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeSnapshotCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Obtain the three stake snapshots for a pool, plus the total active stake (advanced command)"
          ]

pPoolParams :: EnvCli -> Parser (QueryCmds ConwayEra)
pPoolParams :: EnvCli -> Parser (QueryCmds ConwayEra)
pPoolParams EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
hiddenSubParser String
"pool-params" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryPoolStateCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"DEPRECATED.  Use query pool-state instead.  Dump the pool parameters "
          , String
"(Ledger.NewEpochState.esLState._delegationState._pState._pParams -- advanced command)"
          ]

pLeadershipSchedule :: EnvCli -> Parser (QueryCmds ConwayEra)
pLeadershipSchedule :: EnvCli -> Parser (QueryCmds ConwayEra)
pLeadershipSchedule EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"leadership-schedule" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pLeadershipScheduleCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the slots the node is expected to mint a block in (advanced command)"

pKesPeriodInfo :: EnvCli -> Parser (QueryCmds ConwayEra)
pKesPeriodInfo :: EnvCli -> Parser (QueryCmds ConwayEra)
pKesPeriodInfo EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"kes-period-info" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pKesPeriodInfoCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Get information about the current KES period and your node's operational certificate."

pPoolState :: EnvCli -> Parser (QueryCmds ConwayEra)
pPoolState :: EnvCli -> Parser (QueryCmds ConwayEra)
pPoolState EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"pool-state" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryPoolStateCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Dump the pool state"

pTxMempool :: EnvCli -> Parser (QueryCmds era)
pTxMempool :: forall era. EnvCli -> Parser (QueryCmds era)
pTxMempool EnvCli
envCli =
  String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"tx-mempool" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (EnvCli -> Parser (QueryCmds era)
forall era. EnvCli -> Parser (QueryCmds era)
pQueryTxMempoolCmd EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Local Mempool info"

pSlotNumber :: EnvCli -> Parser (QueryCmds ConwayEra)
pSlotNumber :: EnvCli -> Parser (QueryCmds ConwayEra)
pSlotNumber EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"slot-number" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQuerySlotNumberCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc String
"Query slot number for UTC timestamp"

pQueryLedgerPeerSnapshot :: EnvCli -> Parser (QueryCmds ConwayEra)
pQueryLedgerPeerSnapshot :: EnvCli -> Parser (QueryCmds ConwayEra)
pQueryLedgerPeerSnapshot EnvCli
envCli =
  String
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a. String -> ParserInfo a -> Parser a
subParser String
"ledger-peer-snapshot" (ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra))
-> ParserInfo (QueryCmds ConwayEra) -> Parser (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
    Parser (QueryCmds ConwayEra)
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra ConwayEra -> EnvCli -> Parser (QueryCmds ConwayEra)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerPeerSnapshotCmd ShelleyBasedEra ConwayEra
ShelleyBasedEraConway EnvCli
envCli) (InfoMod (QueryCmds ConwayEra) -> ParserInfo (QueryCmds ConwayEra))
-> InfoMod (QueryCmds ConwayEra)
-> ParserInfo (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
      String -> InfoMod (QueryCmds ConwayEra)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds ConwayEra))
-> String -> InfoMod (QueryCmds ConwayEra)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Dump the current snapshot of big ledger peers. "
          , String
"These are the largest pools that cumulatively hold "
          , String
"90% of total stake."
          ]

-- \^ TODO use bigLedgerPeerQuota from Ouroboros.Network.PeerSelection.LedgerPeers.Utils
-- which must be re-exposed thru cardano-api

pQueryCmds
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryCmds :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryCmds ShelleyBasedEra era
era EnvCli
envCli =
  String
-> InfoMod (QueryCmds era)
-> [Maybe (Parser (QueryCmds era))]
-> Maybe (Parser (QueryCmds era))
forall a.
String -> InfoMod a -> [Maybe (Parser a)] -> Maybe (Parser a)
subInfoParser
    String
"query"
    ( String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        [String] -> String
forall a. Monoid a => [a] -> a
mconcat
          [ String
"Node query commands. Will query the local node whose Unix domain socket is "
          , String
"obtained from the CARDANO_NODE_SOCKET_PATH environment variable."
          ]
    )
    [ Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"protocol-parameters" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (EnvCli -> Parser (QueryCmds era)
forall era. EnvCli -> Parser (QueryCmds era)
pQueryProtocolParametersCmd EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current protocol parameters"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"tip" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryTipCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current tip (slot no, hash, block no)"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-pools" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakePoolsCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current set of stake pool ids"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-distribution" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeDistributionCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the node's current aggregated stake distribution"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-address-info" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeAddressInfoCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Get the current delegations and reward accounts filtered by stake address."
                ]
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"utxo" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryUTxOCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Get a portion of the current UTxO: by tx in, by address or the whole."
                ]
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"ledger-state" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerStateCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Dump the current ledger state of the node (Ledger.NewEpochState -- advanced command)"
                ]
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"ledger-peer-snapshot" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerPeerSnapshotCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Dump the current snapshot of ledger peers."
                , String
"These are the largest pools that cumulatively hold "
                , String
"90% of total stake."
                ]
    , -- \^ TODO use bigLedgerPeerQuota from Ouroboros.Network.PeerSelection.LedgerPeers.Utils
      -- which must be re-exposed thru cardano-api
      Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"protocol-state" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryProtocolStateCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Dump the current protocol state of the node (Ledger.ChainDepState -- advanced command)"
                ]
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"stake-snapshot" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeSnapshotCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"Obtain the three stake snapshots for a pool, plus the total active stake (advanced command)"
                ]
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
hiddenSubParser String
"pool-params" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryPoolStateCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
              [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                [ String
"DEPRECATED.  Use query pool-state instead.  Dump the pool parameters "
                , String
"(Ledger.NewEpochState.esLState._delegationState._pState._pParams -- advanced command)"
                ]
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"leadership-schedule" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pLeadershipScheduleCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the slots the node is expected to mint a block in (advanced command)"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"kes-period-info" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pKesPeriodInfoCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get information about the current KES period and your node's operational certificate."
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"pool-state" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryPoolStateCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Dump the pool state"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"tx-mempool" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (EnvCli -> Parser (QueryCmds era)
forall era. EnvCli -> Parser (QueryCmds era)
pQueryTxMempoolCmd EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Local Mempool info"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
        String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"slot-number" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQuerySlotNumberCmd ShelleyBasedEra era
era EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Query slot number for UTC timestamp"
    , Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
Just
        (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> (InfoMod (QueryCmds era) -> Parser (QueryCmds era))
-> InfoMod (QueryCmds era)
-> Maybe (Parser (QueryCmds era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"ref-script-size"
        (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era)
-> Parser (QueryCmds era)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryRefScriptSizeCmd ShelleyBasedEra era
era EnvCli
envCli)
        (InfoMod (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> InfoMod (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$ String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Calculate the reference input scripts size in bytes for provided transaction inputs."
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryGetConstitutionCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryGetGovStateCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryDRepStateCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryDRepStakeDistributionCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQuerySPOStakeDistributionCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryGetCommitteeStateCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryTreasuryValueCmd ShelleyBasedEra era
era EnvCli
envCli
    , ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryProposalsCmd ShelleyBasedEra era
era EnvCli
envCli
    ]

pQueryProtocolParametersCmd :: EnvCli -> Parser (QueryCmds era)
pQueryProtocolParametersCmd :: forall era. EnvCli -> Parser (QueryCmds era)
pQueryProtocolParametersCmd EnvCli
envCli =
  (QueryProtocolParametersCmdArgs -> QueryCmds era)
-> Parser QueryProtocolParametersCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryProtocolParametersCmdArgs -> QueryCmds era
forall era. QueryProtocolParametersCmdArgs -> QueryCmds era
QueryProtocolParametersCmd (Parser QueryProtocolParametersCmdArgs -> Parser (QueryCmds era))
-> Parser QueryProtocolParametersCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    SocketPath
-> ConsensusModeParams
-> NetworkId
-> Maybe (File () 'Out)
-> QueryProtocolParametersCmdArgs
QueryProtocolParametersCmdArgs
      (SocketPath
 -> ConsensusModeParams
 -> NetworkId
 -> Maybe (File () 'Out)
 -> QueryProtocolParametersCmdArgs)
-> Parser SocketPath
-> Parser
     (ConsensusModeParams
      -> NetworkId
      -> Maybe (File () 'Out)
      -> QueryProtocolParametersCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> EnvCli -> Parser SocketPath
pSocketPath EnvCli
envCli
      Parser
  (ConsensusModeParams
   -> NetworkId
   -> Maybe (File () 'Out)
   -> QueryProtocolParametersCmdArgs)
-> Parser ConsensusModeParams
-> Parser
     (NetworkId
      -> Maybe (File () 'Out) -> QueryProtocolParametersCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ConsensusModeParams
pConsensusModeParams
      Parser
  (NetworkId
   -> Maybe (File () 'Out) -> QueryProtocolParametersCmdArgs)
-> Parser NetworkId
-> Parser (Maybe (File () 'Out) -> QueryProtocolParametersCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> EnvCli -> Parser NetworkId
pNetworkId EnvCli
envCli
      Parser (Maybe (File () 'Out) -> QueryProtocolParametersCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryProtocolParametersCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryTipCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryTipCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryTipCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryTipCmdArgs -> QueryCmds era)
-> Parser QueryTipCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryTipCmdArgs -> QueryCmds era
forall era. QueryTipCmdArgs -> QueryCmds era
QueryTipCmd (Parser QueryTipCmdArgs -> Parser (QueryCmds era))
-> Parser QueryTipCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons -> Maybe (File () 'Out) -> QueryTipCmdArgs
QueryTipCmdArgs
      (QueryCommons -> Maybe (File () 'Out) -> QueryTipCmdArgs)
-> Parser QueryCommons
-> Parser (Maybe (File () 'Out) -> QueryTipCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser (Maybe (File () 'Out) -> QueryTipCmdArgs)
-> Parser (Maybe (File () 'Out)) -> Parser QueryTipCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryUTxOCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryUTxOCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryUTxOCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryUTxOCmdArgs -> QueryCmds era)
-> Parser QueryUTxOCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryUTxOCmdArgs -> QueryCmds era
forall era. QueryUTxOCmdArgs -> QueryCmds era
QueryUTxOCmd (Parser QueryUTxOCmdArgs -> Parser (QueryCmds era))
-> Parser QueryUTxOCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> QueryUTxOFilter
-> Maybe OutputFormatJsonOrText
-> Maybe (File () 'Out)
-> QueryUTxOCmdArgs
QueryUTxOCmdArgs
      (QueryCommons
 -> QueryUTxOFilter
 -> Maybe OutputFormatJsonOrText
 -> Maybe (File () 'Out)
 -> QueryUTxOCmdArgs)
-> Parser QueryCommons
-> Parser
     (QueryUTxOFilter
      -> Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out)
      -> QueryUTxOCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (QueryUTxOFilter
   -> Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out)
   -> QueryUTxOCmdArgs)
-> Parser QueryUTxOFilter
-> Parser
     (Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out) -> QueryUTxOCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser QueryUTxOFilter
pQueryUTxOFilter
      Parser
  (Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out) -> QueryUTxOCmdArgs)
-> Parser (Maybe OutputFormatJsonOrText)
-> Parser (Maybe (File () 'Out) -> QueryUTxOCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Parser OutputFormatJsonOrText
 -> Parser (Maybe OutputFormatJsonOrText))
-> Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall a b. (a -> b) -> a -> b
$ String -> Parser OutputFormatJsonOrText
pOutputFormatJsonOrText String
"utxo")
      Parser (Maybe (File () 'Out) -> QueryUTxOCmdArgs)
-> Parser (Maybe (File () 'Out)) -> Parser QueryUTxOCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryStakePoolsCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakePoolsCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakePoolsCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryStakePoolsCmdArgs -> QueryCmds era)
-> Parser QueryStakePoolsCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryStakePoolsCmdArgs -> QueryCmds era
forall era. QueryStakePoolsCmdArgs -> QueryCmds era
QueryStakePoolsCmd (Parser QueryStakePoolsCmdArgs -> Parser (QueryCmds era))
-> Parser QueryStakePoolsCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> Maybe OutputFormatJsonOrText
-> Maybe (File () 'Out)
-> QueryStakePoolsCmdArgs
QueryStakePoolsCmdArgs
      (QueryCommons
 -> Maybe OutputFormatJsonOrText
 -> Maybe (File () 'Out)
 -> QueryStakePoolsCmdArgs)
-> Parser QueryCommons
-> Parser
     (Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out) -> QueryStakePoolsCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out) -> QueryStakePoolsCmdArgs)
-> Parser (Maybe OutputFormatJsonOrText)
-> Parser (Maybe (File () 'Out) -> QueryStakePoolsCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Parser OutputFormatJsonOrText
 -> Parser (Maybe OutputFormatJsonOrText))
-> Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall a b. (a -> b) -> a -> b
$ String -> Parser OutputFormatJsonOrText
pOutputFormatJsonOrText String
"stake-pools")
      Parser (Maybe (File () 'Out) -> QueryStakePoolsCmdArgs)
-> Parser (Maybe (File () 'Out)) -> Parser QueryStakePoolsCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryStakeDistributionCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeDistributionCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeDistributionCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryStakeDistributionCmdArgs -> QueryCmds era)
-> Parser QueryStakeDistributionCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryStakeDistributionCmdArgs -> QueryCmds era
forall era. QueryStakeDistributionCmdArgs -> QueryCmds era
QueryStakeDistributionCmd (Parser QueryStakeDistributionCmdArgs -> Parser (QueryCmds era))
-> Parser QueryStakeDistributionCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> Maybe OutputFormatJsonOrText
-> Maybe (File () 'Out)
-> QueryStakeDistributionCmdArgs
QueryStakeDistributionCmdArgs
      (QueryCommons
 -> Maybe OutputFormatJsonOrText
 -> Maybe (File () 'Out)
 -> QueryStakeDistributionCmdArgs)
-> Parser QueryCommons
-> Parser
     (Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out) -> QueryStakeDistributionCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out) -> QueryStakeDistributionCmdArgs)
-> Parser (Maybe OutputFormatJsonOrText)
-> Parser (Maybe (File () 'Out) -> QueryStakeDistributionCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Parser OutputFormatJsonOrText
 -> Parser (Maybe OutputFormatJsonOrText))
-> Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall a b. (a -> b) -> a -> b
$ String -> Parser OutputFormatJsonOrText
pOutputFormatJsonOrText String
"stake-distribution")
      Parser (Maybe (File () 'Out) -> QueryStakeDistributionCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryStakeDistributionCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryStakeAddressInfoCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeAddressInfoCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeAddressInfoCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryStakeAddressInfoCmdArgs -> QueryCmds era)
-> Parser QueryStakeAddressInfoCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryStakeAddressInfoCmdArgs -> QueryCmds era
forall era. QueryStakeAddressInfoCmdArgs -> QueryCmds era
QueryStakeAddressInfoCmd (Parser QueryStakeAddressInfoCmdArgs -> Parser (QueryCmds era))
-> Parser QueryStakeAddressInfoCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> StakeAddress
-> Maybe (File () 'Out)
-> QueryStakeAddressInfoCmdArgs
QueryStakeAddressInfoCmdArgs
      (QueryCommons
 -> StakeAddress
 -> Maybe (File () 'Out)
 -> QueryStakeAddressInfoCmdArgs)
-> Parser QueryCommons
-> Parser
     (StakeAddress
      -> Maybe (File () 'Out) -> QueryStakeAddressInfoCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (StakeAddress
   -> Maybe (File () 'Out) -> QueryStakeAddressInfoCmdArgs)
-> Parser StakeAddress
-> Parser (Maybe (File () 'Out) -> QueryStakeAddressInfoCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser StakeAddress
pFilterByStakeAddress
      Parser (Maybe (File () 'Out) -> QueryStakeAddressInfoCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryStakeAddressInfoCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryLedgerStateCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerStateCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerStateCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryLedgerStateCmdArgs -> QueryCmds era)
-> Parser QueryLedgerStateCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryLedgerStateCmdArgs -> QueryCmds era
forall era. QueryLedgerStateCmdArgs -> QueryCmds era
QueryLedgerStateCmd (Parser QueryLedgerStateCmdArgs -> Parser (QueryCmds era))
-> Parser QueryLedgerStateCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons -> Maybe (File () 'Out) -> QueryLedgerStateCmdArgs
QueryLedgerStateCmdArgs
      (QueryCommons -> Maybe (File () 'Out) -> QueryLedgerStateCmdArgs)
-> Parser QueryCommons
-> Parser (Maybe (File () 'Out) -> QueryLedgerStateCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser (Maybe (File () 'Out) -> QueryLedgerStateCmdArgs)
-> Parser (Maybe (File () 'Out)) -> Parser QueryLedgerStateCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryLedgerPeerSnapshotCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerPeerSnapshotCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryLedgerPeerSnapshotCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryLedgerPeerSnapshotCmdArgs -> QueryCmds era)
-> Parser QueryLedgerPeerSnapshotCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryLedgerPeerSnapshotCmdArgs -> QueryCmds era
forall era. QueryLedgerPeerSnapshotCmdArgs -> QueryCmds era
QueryLedgerPeerSnapshotCmd (Parser QueryLedgerPeerSnapshotCmdArgs -> Parser (QueryCmds era))
-> Parser QueryLedgerPeerSnapshotCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> Maybe (File () 'Out) -> QueryLedgerPeerSnapshotCmdArgs
QueryLedgerPeerSnapshotCmdArgs
      (QueryCommons
 -> Maybe (File () 'Out) -> QueryLedgerPeerSnapshotCmdArgs)
-> Parser QueryCommons
-> Parser (Maybe (File () 'Out) -> QueryLedgerPeerSnapshotCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser (Maybe (File () 'Out) -> QueryLedgerPeerSnapshotCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryLedgerPeerSnapshotCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryProtocolStateCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryProtocolStateCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryProtocolStateCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryProtocolStateCmdArgs -> QueryCmds era)
-> Parser QueryProtocolStateCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryProtocolStateCmdArgs -> QueryCmds era
forall era. QueryProtocolStateCmdArgs -> QueryCmds era
QueryProtocolStateCmd (Parser QueryProtocolStateCmdArgs -> Parser (QueryCmds era))
-> Parser QueryProtocolStateCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons -> Maybe (File () 'Out) -> QueryProtocolStateCmdArgs
QueryProtocolStateCmdArgs
      (QueryCommons -> Maybe (File () 'Out) -> QueryProtocolStateCmdArgs)
-> Parser QueryCommons
-> Parser (Maybe (File () 'Out) -> QueryProtocolStateCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser (Maybe (File () 'Out) -> QueryProtocolStateCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryProtocolStateCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pAllStakePoolsOrSome :: Parser (AllOrOnly (Hash StakePoolKey))
pAllStakePoolsOrSome :: Parser (AllOrOnly (Hash StakePoolKey))
pAllStakePoolsOrSome = Parser (AllOrOnly (Hash StakePoolKey))
pAll Parser (AllOrOnly (Hash StakePoolKey))
-> Parser (AllOrOnly (Hash StakePoolKey))
-> Parser (AllOrOnly (Hash StakePoolKey))
forall a. Parser a -> Parser a -> Parser a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Parser (AllOrOnly (Hash StakePoolKey))
pOnly
 where
  pAll :: Parser (AllOrOnly (Hash StakePoolKey))
  pAll :: Parser (AllOrOnly (Hash StakePoolKey))
pAll =
    AllOrOnly (Hash StakePoolKey)
-> Mod FlagFields (AllOrOnly (Hash StakePoolKey))
-> Parser (AllOrOnly (Hash StakePoolKey))
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' AllOrOnly (Hash StakePoolKey)
forall a. AllOrOnly a
All (Mod FlagFields (AllOrOnly (Hash StakePoolKey))
 -> Parser (AllOrOnly (Hash StakePoolKey)))
-> Mod FlagFields (AllOrOnly (Hash StakePoolKey))
-> Parser (AllOrOnly (Hash StakePoolKey))
forall a b. (a -> b) -> a -> b
$
      [Mod FlagFields (AllOrOnly (Hash StakePoolKey))]
-> Mod FlagFields (AllOrOnly (Hash StakePoolKey))
forall a. Monoid a => [a] -> a
mconcat
        [ String -> Mod FlagFields (AllOrOnly (Hash StakePoolKey))
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"all-stake-pools"
        , String -> Mod FlagFields (AllOrOnly (Hash StakePoolKey))
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Query for all stake pools"
        ]
  pOnly :: Parser (AllOrOnly (Hash StakePoolKey))
  pOnly :: Parser (AllOrOnly (Hash StakePoolKey))
pOnly = [Hash StakePoolKey] -> AllOrOnly (Hash StakePoolKey)
forall a. [a] -> AllOrOnly a
Only ([Hash StakePoolKey] -> AllOrOnly (Hash StakePoolKey))
-> Parser [Hash StakePoolKey]
-> Parser (AllOrOnly (Hash StakePoolKey))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (Hash StakePoolKey) -> Parser [Hash StakePoolKey]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some (Maybe String -> Parser (Hash StakePoolKey)
pStakePoolVerificationKeyHash Maybe String
forall a. Maybe a
Nothing)

pQueryStakeSnapshotCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeSnapshotCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryStakeSnapshotCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryStakeSnapshotCmdArgs -> QueryCmds era)
-> Parser QueryStakeSnapshotCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryStakeSnapshotCmdArgs -> QueryCmds era
forall era. QueryStakeSnapshotCmdArgs -> QueryCmds era
QueryStakeSnapshotCmd (Parser QueryStakeSnapshotCmdArgs -> Parser (QueryCmds era))
-> Parser QueryStakeSnapshotCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> AllOrOnly (Hash StakePoolKey)
-> Maybe (File () 'Out)
-> QueryStakeSnapshotCmdArgs
QueryStakeSnapshotCmdArgs
      (QueryCommons
 -> AllOrOnly (Hash StakePoolKey)
 -> Maybe (File () 'Out)
 -> QueryStakeSnapshotCmdArgs)
-> Parser QueryCommons
-> Parser
     (AllOrOnly (Hash StakePoolKey)
      -> Maybe (File () 'Out) -> QueryStakeSnapshotCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (AllOrOnly (Hash StakePoolKey)
   -> Maybe (File () 'Out) -> QueryStakeSnapshotCmdArgs)
-> Parser (AllOrOnly (Hash StakePoolKey))
-> Parser (Maybe (File () 'Out) -> QueryStakeSnapshotCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AllOrOnly (Hash StakePoolKey))
pAllStakePoolsOrSome
      Parser (Maybe (File () 'Out) -> QueryStakeSnapshotCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryStakeSnapshotCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryPoolStateCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryPoolStateCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryPoolStateCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryPoolStateCmdArgs -> QueryCmds era)
-> Parser QueryPoolStateCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryPoolStateCmdArgs -> QueryCmds era
forall era. QueryPoolStateCmdArgs -> QueryCmds era
QueryPoolStateCmd (Parser QueryPoolStateCmdArgs -> Parser (QueryCmds era))
-> Parser QueryPoolStateCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> AllOrOnly (Hash StakePoolKey)
-> Maybe (File () 'Out)
-> QueryPoolStateCmdArgs
QueryPoolStateCmdArgs
      (QueryCommons
 -> AllOrOnly (Hash StakePoolKey)
 -> Maybe (File () 'Out)
 -> QueryPoolStateCmdArgs)
-> Parser QueryCommons
-> Parser
     (AllOrOnly (Hash StakePoolKey)
      -> Maybe (File () 'Out) -> QueryPoolStateCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (AllOrOnly (Hash StakePoolKey)
   -> Maybe (File () 'Out) -> QueryPoolStateCmdArgs)
-> Parser (AllOrOnly (Hash StakePoolKey))
-> Parser (Maybe (File () 'Out) -> QueryPoolStateCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AllOrOnly (Hash StakePoolKey))
pAllStakePoolsOrSome
      Parser (Maybe (File () 'Out) -> QueryPoolStateCmdArgs)
-> Parser (Maybe (File () 'Out)) -> Parser QueryPoolStateCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryTxMempoolCmd :: EnvCli -> Parser (QueryCmds era)
pQueryTxMempoolCmd :: forall era. EnvCli -> Parser (QueryCmds era)
pQueryTxMempoolCmd EnvCli
envCli =
  (QueryTxMempoolCmdArgs -> QueryCmds era)
-> Parser QueryTxMempoolCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryTxMempoolCmdArgs -> QueryCmds era
forall era. QueryTxMempoolCmdArgs -> QueryCmds era
QueryTxMempoolCmd (Parser QueryTxMempoolCmdArgs -> Parser (QueryCmds era))
-> Parser QueryTxMempoolCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    SocketPath
-> ConsensusModeParams
-> NetworkId
-> TxMempoolQuery
-> Maybe (File () 'Out)
-> QueryTxMempoolCmdArgs
QueryTxMempoolCmdArgs
      (SocketPath
 -> ConsensusModeParams
 -> NetworkId
 -> TxMempoolQuery
 -> Maybe (File () 'Out)
 -> QueryTxMempoolCmdArgs)
-> Parser SocketPath
-> Parser
     (ConsensusModeParams
      -> NetworkId
      -> TxMempoolQuery
      -> Maybe (File () 'Out)
      -> QueryTxMempoolCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> EnvCli -> Parser SocketPath
pSocketPath EnvCli
envCli
      Parser
  (ConsensusModeParams
   -> NetworkId
   -> TxMempoolQuery
   -> Maybe (File () 'Out)
   -> QueryTxMempoolCmdArgs)
-> Parser ConsensusModeParams
-> Parser
     (NetworkId
      -> TxMempoolQuery -> Maybe (File () 'Out) -> QueryTxMempoolCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ConsensusModeParams
pConsensusModeParams
      Parser
  (NetworkId
   -> TxMempoolQuery -> Maybe (File () 'Out) -> QueryTxMempoolCmdArgs)
-> Parser NetworkId
-> Parser
     (TxMempoolQuery -> Maybe (File () 'Out) -> QueryTxMempoolCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> EnvCli -> Parser NetworkId
pNetworkId EnvCli
envCli
      Parser
  (TxMempoolQuery -> Maybe (File () 'Out) -> QueryTxMempoolCmdArgs)
-> Parser TxMempoolQuery
-> Parser (Maybe (File () 'Out) -> QueryTxMempoolCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser TxMempoolQuery
pTxMempoolQuery
      Parser (Maybe (File () 'Out) -> QueryTxMempoolCmdArgs)
-> Parser (Maybe (File () 'Out)) -> Parser QueryTxMempoolCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile
 where
  pTxMempoolQuery :: Parser TxMempoolQuery
  pTxMempoolQuery :: Parser TxMempoolQuery
pTxMempoolQuery =
    [Parser TxMempoolQuery] -> Parser TxMempoolQuery
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
      [ String -> ParserInfo TxMempoolQuery -> Parser TxMempoolQuery
forall a. String -> ParserInfo a -> Parser a
subParser String
"info" (ParserInfo TxMempoolQuery -> Parser TxMempoolQuery)
-> ParserInfo TxMempoolQuery -> Parser TxMempoolQuery
forall a b. (a -> b) -> a -> b
$
          Parser TxMempoolQuery
-> InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (TxMempoolQuery -> Parser TxMempoolQuery
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure TxMempoolQuery
TxMempoolQueryInfo) (InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery)
-> InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod TxMempoolQuery
forall a. String -> InfoMod a
Opt.progDesc String
"Ask the node about the current mempool's capacity and sizes"
      , String -> ParserInfo TxMempoolQuery -> Parser TxMempoolQuery
forall a. String -> ParserInfo a -> Parser a
subParser String
"next-tx" (ParserInfo TxMempoolQuery -> Parser TxMempoolQuery)
-> ParserInfo TxMempoolQuery -> Parser TxMempoolQuery
forall a b. (a -> b) -> a -> b
$
          Parser TxMempoolQuery
-> InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (TxMempoolQuery -> Parser TxMempoolQuery
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure TxMempoolQuery
TxMempoolQueryNextTx) (InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery)
-> InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod TxMempoolQuery
forall a. String -> InfoMod a
Opt.progDesc String
"Requests the next transaction from the mempool's current list"
      , String -> ParserInfo TxMempoolQuery -> Parser TxMempoolQuery
forall a. String -> ParserInfo a -> Parser a
subParser String
"tx-exists" (ParserInfo TxMempoolQuery -> Parser TxMempoolQuery)
-> ParserInfo TxMempoolQuery -> Parser TxMempoolQuery
forall a b. (a -> b) -> a -> b
$
          Parser TxMempoolQuery
-> InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (TxId -> TxMempoolQuery
TxMempoolQueryTxExists (TxId -> TxMempoolQuery) -> Parser TxId -> Parser TxMempoolQuery
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ReadM TxId -> Mod ArgumentFields TxId -> Parser TxId
forall a. ReadM a -> Mod ArgumentFields a -> Parser a
argument ReadM TxId
forall s. IsString s => ReadM s
Opt.str (String -> Mod ArgumentFields TxId
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
metavar String
"TX_ID")) (InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery)
-> InfoMod TxMempoolQuery -> ParserInfo TxMempoolQuery
forall a b. (a -> b) -> a -> b
$
            String -> InfoMod TxMempoolQuery
forall a. String -> InfoMod a
Opt.progDesc String
"Query if a particular transaction exists in the mempool"
      ]

pLeadershipScheduleCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pLeadershipScheduleCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pLeadershipScheduleCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryLeadershipScheduleCmdArgs -> QueryCmds era)
-> Parser QueryLeadershipScheduleCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryLeadershipScheduleCmdArgs -> QueryCmds era
forall era. QueryLeadershipScheduleCmdArgs -> QueryCmds era
QueryLeadershipScheduleCmd (Parser QueryLeadershipScheduleCmdArgs -> Parser (QueryCmds era))
-> Parser QueryLeadershipScheduleCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> GenesisFile
-> VerificationKeyOrHashOrFile StakePoolKey
-> SigningKeyFile 'In
-> EpochLeadershipSchedule
-> Maybe OutputFormatJsonOrText
-> Maybe (File () 'Out)
-> QueryLeadershipScheduleCmdArgs
QueryLeadershipScheduleCmdArgs
      (QueryCommons
 -> GenesisFile
 -> VerificationKeyOrHashOrFile StakePoolKey
 -> SigningKeyFile 'In
 -> EpochLeadershipSchedule
 -> Maybe OutputFormatJsonOrText
 -> Maybe (File () 'Out)
 -> QueryLeadershipScheduleCmdArgs)
-> Parser QueryCommons
-> Parser
     (GenesisFile
      -> VerificationKeyOrHashOrFile StakePoolKey
      -> SigningKeyFile 'In
      -> EpochLeadershipSchedule
      -> Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out)
      -> QueryLeadershipScheduleCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (GenesisFile
   -> VerificationKeyOrHashOrFile StakePoolKey
   -> SigningKeyFile 'In
   -> EpochLeadershipSchedule
   -> Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out)
   -> QueryLeadershipScheduleCmdArgs)
-> Parser GenesisFile
-> Parser
     (VerificationKeyOrHashOrFile StakePoolKey
      -> SigningKeyFile 'In
      -> EpochLeadershipSchedule
      -> Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out)
      -> QueryLeadershipScheduleCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> String -> Parser GenesisFile
pGenesisFile String
"Shelley genesis filepath"
      Parser
  (VerificationKeyOrHashOrFile StakePoolKey
   -> SigningKeyFile 'In
   -> EpochLeadershipSchedule
   -> Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out)
   -> QueryLeadershipScheduleCmdArgs)
-> Parser (VerificationKeyOrHashOrFile StakePoolKey)
-> Parser
     (SigningKeyFile 'In
      -> EpochLeadershipSchedule
      -> Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out)
      -> QueryLeadershipScheduleCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe String -> Parser (VerificationKeyOrHashOrFile StakePoolKey)
pStakePoolVerificationKeyOrHashOrFile Maybe String
forall a. Maybe a
Nothing
      Parser
  (SigningKeyFile 'In
   -> EpochLeadershipSchedule
   -> Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out)
   -> QueryLeadershipScheduleCmdArgs)
-> Parser (SigningKeyFile 'In)
-> Parser
     (EpochLeadershipSchedule
      -> Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out)
      -> QueryLeadershipScheduleCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (SigningKeyFile 'In)
pVrfSigningKeyFile
      Parser
  (EpochLeadershipSchedule
   -> Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out)
   -> QueryLeadershipScheduleCmdArgs)
-> Parser EpochLeadershipSchedule
-> Parser
     (Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out) -> QueryLeadershipScheduleCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser EpochLeadershipSchedule
pWhichLeadershipSchedule
      Parser
  (Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out) -> QueryLeadershipScheduleCmdArgs)
-> Parser (Maybe OutputFormatJsonOrText)
-> Parser (Maybe (File () 'Out) -> QueryLeadershipScheduleCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Parser OutputFormatJsonOrText
 -> Parser (Maybe OutputFormatJsonOrText))
-> Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall a b. (a -> b) -> a -> b
$ String -> Parser OutputFormatJsonOrText
pOutputFormatJsonOrText String
"leadership-schedule")
      Parser (Maybe (File () 'Out) -> QueryLeadershipScheduleCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryLeadershipScheduleCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pKesPeriodInfoCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pKesPeriodInfoCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pKesPeriodInfoCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryKesPeriodInfoCmdArgs -> QueryCmds era)
-> Parser QueryKesPeriodInfoCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryKesPeriodInfoCmdArgs -> QueryCmds era
forall era. QueryKesPeriodInfoCmdArgs -> QueryCmds era
QueryKesPeriodInfoCmd (Parser QueryKesPeriodInfoCmdArgs -> Parser (QueryCmds era))
-> Parser QueryKesPeriodInfoCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> File () 'In -> Maybe (File () 'Out) -> QueryKesPeriodInfoCmdArgs
QueryKesPeriodInfoCmdArgs
      (QueryCommons
 -> File () 'In
 -> Maybe (File () 'Out)
 -> QueryKesPeriodInfoCmdArgs)
-> Parser QueryCommons
-> Parser
     (File () 'In -> Maybe (File () 'Out) -> QueryKesPeriodInfoCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (File () 'In -> Maybe (File () 'Out) -> QueryKesPeriodInfoCmdArgs)
-> Parser (File () 'In)
-> Parser (Maybe (File () 'Out) -> QueryKesPeriodInfoCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (File () 'In)
forall (direction :: FileDirection). Parser (File () direction)
pOperationalCertificateFile
      Parser (Maybe (File () 'Out) -> QueryKesPeriodInfoCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryKesPeriodInfoCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQuerySlotNumberCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQuerySlotNumberCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQuerySlotNumberCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QuerySlotNumberCmdArgs -> QueryCmds era)
-> Parser QuerySlotNumberCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QuerySlotNumberCmdArgs -> QueryCmds era
forall era. QuerySlotNumberCmdArgs -> QueryCmds era
QuerySlotNumberCmd (Parser QuerySlotNumberCmdArgs -> Parser (QueryCmds era))
-> Parser QuerySlotNumberCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons -> UTCTime -> QuerySlotNumberCmdArgs
QuerySlotNumberCmdArgs
      (QueryCommons -> UTCTime -> QuerySlotNumberCmdArgs)
-> Parser QueryCommons
-> Parser (UTCTime -> QuerySlotNumberCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser (UTCTime -> QuerySlotNumberCmdArgs)
-> Parser UTCTime -> Parser QuerySlotNumberCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser UTCTime
pUtcTimestamp
 where
  pUtcTimestamp :: Parser UTCTime
pUtcTimestamp =
    String -> UTCTime
convertTime
      (String -> UTCTime) -> Parser String -> Parser UTCTime
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Mod ArgumentFields String -> Parser String
forall s. IsString s => Mod ArgumentFields s -> Parser s
Opt.strArgument (Mod ArgumentFields String -> Parser String)
-> ([Mod ArgumentFields String] -> Mod ArgumentFields String)
-> [Mod ArgumentFields String]
-> Parser String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Mod ArgumentFields String] -> Mod ArgumentFields String
forall a. Monoid a => [a] -> a
mconcat)
        [ String -> Mod ArgumentFields String
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"TIMESTAMP"
        , String -> Mod ArgumentFields String
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"UTC timestamp in YYYY-MM-DDThh:mm:ssZ format"
        ]

pQueryRefScriptSizeCmd :: ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryRefScriptSizeCmd :: forall era. ShelleyBasedEra era -> EnvCli -> Parser (QueryCmds era)
pQueryRefScriptSizeCmd ShelleyBasedEra era
era EnvCli
envCli =
  (QueryRefScriptSizeCmdArgs -> QueryCmds era)
-> Parser QueryRefScriptSizeCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap QueryRefScriptSizeCmdArgs -> QueryCmds era
forall era. QueryRefScriptSizeCmdArgs -> QueryCmds era
QueryRefScriptSizeCmd (Parser QueryRefScriptSizeCmdArgs -> Parser (QueryCmds era))
-> Parser QueryRefScriptSizeCmdArgs -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
    QueryCommons
-> Set TxIn
-> Maybe OutputFormatJsonOrText
-> Maybe (File () 'Out)
-> QueryRefScriptSizeCmdArgs
QueryRefScriptSizeCmdArgs
      (QueryCommons
 -> Set TxIn
 -> Maybe OutputFormatJsonOrText
 -> Maybe (File () 'Out)
 -> QueryRefScriptSizeCmdArgs)
-> Parser QueryCommons
-> Parser
     (Set TxIn
      -> Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out)
      -> QueryRefScriptSizeCmdArgs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (Set TxIn
   -> Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out)
   -> QueryRefScriptSizeCmdArgs)
-> Parser (Set TxIn)
-> Parser
     (Maybe OutputFormatJsonOrText
      -> Maybe (File () 'Out) -> QueryRefScriptSizeCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ([Item (Set TxIn)] -> Set TxIn
[TxIn] -> Set TxIn
forall l. IsList l => [Item l] -> l
fromList ([TxIn] -> Set TxIn) -> Parser [TxIn] -> Parser (Set TxIn)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser TxIn -> Parser [TxIn]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
some Parser TxIn
pByTxIn)
      Parser
  (Maybe OutputFormatJsonOrText
   -> Maybe (File () 'Out) -> QueryRefScriptSizeCmdArgs)
-> Parser (Maybe OutputFormatJsonOrText)
-> Parser (Maybe (File () 'Out) -> QueryRefScriptSizeCmdArgs)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> (Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional (Parser OutputFormatJsonOrText
 -> Parser (Maybe OutputFormatJsonOrText))
-> Parser OutputFormatJsonOrText
-> Parser (Maybe OutputFormatJsonOrText)
forall a b. (a -> b) -> a -> b
$ String -> Parser OutputFormatJsonOrText
pOutputFormatJsonOrText String
"reference inputs")
      Parser (Maybe (File () 'Out) -> QueryRefScriptSizeCmdArgs)
-> Parser (Maybe (File () 'Out))
-> Parser QueryRefScriptSizeCmdArgs
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile
 where
  pByTxIn :: Parser TxIn
  pByTxIn :: Parser TxIn
pByTxIn =
    ReadM TxIn -> Mod OptionFields TxIn -> Parser TxIn
forall a. ReadM a -> Mod OptionFields a -> Parser a
Opt.option (Parser TxIn -> ReadM TxIn
forall a. Parser a -> ReadM a
readerFromParsecParser Parser TxIn
parseTxIn) (Mod OptionFields TxIn -> Parser TxIn)
-> Mod OptionFields TxIn -> Parser TxIn
forall a b. (a -> b) -> a -> b
$
      [Mod OptionFields TxIn] -> Mod OptionFields TxIn
forall a. Monoid a => [a] -> a
mconcat
        [ String -> Mod OptionFields TxIn
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"tx-in"
        , String -> Mod OptionFields TxIn
forall (f :: * -> *) a. HasMetavar f => String -> Mod f a
Opt.metavar String
"TX-IN"
        , String -> Mod OptionFields TxIn
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Transaction input (TxId#TxIx)."
        ]

pQueryGetConstitutionCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryGetConstitutionCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryGetConstitutionCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"constitution" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryNoArgCmdArgs era -> QueryCmds era
forall era. QueryNoArgCmdArgs era -> QueryCmds era
QueryConstitutionCmd (QueryNoArgCmdArgs era -> QueryCmds era)
-> Parser (QueryNoArgCmdArgs era) -> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era -> EnvCli -> Parser (QueryNoArgCmdArgs era)
forall era.
ConwayEraOnwards era -> EnvCli -> Parser (QueryNoArgCmdArgs era)
pQueryNoArgCmdArgs ConwayEraOnwards era
w EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the constitution"

pQueryGetGovStateCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryGetGovStateCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryGetGovStateCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"gov-state" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryNoArgCmdArgs era -> QueryCmds era
forall era. QueryNoArgCmdArgs era -> QueryCmds era
QueryGovStateCmd (QueryNoArgCmdArgs era -> QueryCmds era)
-> Parser (QueryNoArgCmdArgs era) -> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era -> EnvCli -> Parser (QueryNoArgCmdArgs era)
forall era.
ConwayEraOnwards era -> EnvCli -> Parser (QueryNoArgCmdArgs era)
pQueryNoArgCmdArgs ConwayEraOnwards era
w EnvCli
envCli) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the governance state"

-- TODO Conway: DRep State and DRep Stake Distribution parsers use DRep keys to obtain DRep credentials. This only
-- makes use of 'KeyHashObj' constructor of 'Credential kr c'. Should we also support here 'ScriptHashObj'?
-- What about 'DRep c' - this means that only 'KeyHash' constructor is in use here: should also
-- 'DRepAlwaysAbstain' and 'DRepAlwaysNoConfidence' be supported here?

pQueryDRepStateCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryDRepStateCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryDRepStateCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"drep-state" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryDRepStateCmdArgs era -> QueryCmds era
forall era. QueryDRepStateCmdArgs era -> QueryCmds era
QueryDRepStateCmd (QueryDRepStateCmdArgs era -> QueryCmds era)
-> Parser (QueryDRepStateCmdArgs era) -> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era -> Parser (QueryDRepStateCmdArgs era)
forall era.
ConwayEraOnwards era -> Parser (QueryDRepStateCmdArgs era)
pQueryDRepStateCmdArgs ConwayEraOnwards era
w) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the DRep state."
 where
  pQueryDRepStateCmdArgs :: ConwayEraOnwards era -> Parser (QueryDRepStateCmdArgs era)
  pQueryDRepStateCmdArgs :: forall era.
ConwayEraOnwards era -> Parser (QueryDRepStateCmdArgs era)
pQueryDRepStateCmdArgs ConwayEraOnwards era
w =
    ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly DRepHashSource
-> IncludeStake
-> Maybe (File () 'Out)
-> QueryDRepStateCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly DRepHashSource
-> IncludeStake
-> Maybe (File () 'Out)
-> QueryDRepStateCmdArgs era
QueryDRepStateCmdArgs ConwayEraOnwards era
w
      (QueryCommons
 -> AllOrOnly DRepHashSource
 -> IncludeStake
 -> Maybe (File () 'Out)
 -> QueryDRepStateCmdArgs era)
-> Parser QueryCommons
-> Parser
     (AllOrOnly DRepHashSource
      -> IncludeStake
      -> Maybe (File () 'Out)
      -> QueryDRepStateCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (AllOrOnly DRepHashSource
   -> IncludeStake
   -> Maybe (File () 'Out)
   -> QueryDRepStateCmdArgs era)
-> Parser (AllOrOnly DRepHashSource)
-> Parser
     (IncludeStake -> Maybe (File () 'Out) -> QueryDRepStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AllOrOnly DRepHashSource)
pAllOrOnlyDRepHashSource
      Parser
  (IncludeStake -> Maybe (File () 'Out) -> QueryDRepStateCmdArgs era)
-> Parser IncludeStake
-> Parser (Maybe (File () 'Out) -> QueryDRepStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> IncludeStake
-> IncludeStake
-> Mod FlagFields IncludeStake
-> Parser IncludeStake
forall a. a -> a -> Mod FlagFields a -> Parser a
Opt.flag
        IncludeStake
NoStake
        IncludeStake
WithStake
        ( [Mod FlagFields IncludeStake] -> Mod FlagFields IncludeStake
forall a. Monoid a => [a] -> a
mconcat
            [ String -> Mod FlagFields IncludeStake
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"include-stake"
            , String -> Mod FlagFields IncludeStake
forall (f :: * -> *) a. String -> Mod f a
Opt.help (String -> Mod FlagFields IncludeStake)
-> String -> Mod FlagFields IncludeStake
forall a b. (a -> b) -> a -> b
$
                [String] -> String
forall a. Monoid a => [a] -> a
mconcat
                  [ String
"Also return the stake associated with each DRep. "
                  , String
"The result is the same as with \"drep-stake-distribution\"; "
                  , String
"this is a convenience option to obtain all information concerning a DRep at once. "
                  , String
"This is a potentially expensive query, so it's OFF by default."
                  ]
            ]
        )
      Parser (Maybe (File () 'Out) -> QueryDRepStateCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (QueryDRepStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryDRepStakeDistributionCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryDRepStakeDistributionCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryDRepStakeDistributionCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"drep-stake-distribution" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryDRepStakeDistributionCmdArgs era -> QueryCmds era
forall era. QueryDRepStakeDistributionCmdArgs era -> QueryCmds era
QueryDRepStakeDistributionCmd (QueryDRepStakeDistributionCmdArgs era -> QueryCmds era)
-> Parser (QueryDRepStakeDistributionCmdArgs era)
-> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era
-> Parser (QueryDRepStakeDistributionCmdArgs era)
forall era.
ConwayEraOnwards era
-> Parser (QueryDRepStakeDistributionCmdArgs era)
pQueryDRepStakeDistributionCmdArgs ConwayEraOnwards era
w) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the DRep stake distribution."
 where
  pQueryDRepStakeDistributionCmdArgs
    :: ConwayEraOnwards era -> Parser (QueryDRepStakeDistributionCmdArgs era)
  pQueryDRepStakeDistributionCmdArgs :: forall era.
ConwayEraOnwards era
-> Parser (QueryDRepStakeDistributionCmdArgs era)
pQueryDRepStakeDistributionCmdArgs ConwayEraOnwards era
w =
    ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly DRepHashSource
-> Maybe (File () 'Out)
-> QueryDRepStakeDistributionCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly DRepHashSource
-> Maybe (File () 'Out)
-> QueryDRepStakeDistributionCmdArgs era
QueryDRepStakeDistributionCmdArgs ConwayEraOnwards era
w
      (QueryCommons
 -> AllOrOnly DRepHashSource
 -> Maybe (File () 'Out)
 -> QueryDRepStakeDistributionCmdArgs era)
-> Parser QueryCommons
-> Parser
     (AllOrOnly DRepHashSource
      -> Maybe (File () 'Out) -> QueryDRepStakeDistributionCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (AllOrOnly DRepHashSource
   -> Maybe (File () 'Out) -> QueryDRepStakeDistributionCmdArgs era)
-> Parser (AllOrOnly DRepHashSource)
-> Parser
     (Maybe (File () 'Out) -> QueryDRepStakeDistributionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AllOrOnly DRepHashSource)
pAllOrOnlyDRepHashSource
      Parser
  (Maybe (File () 'Out) -> QueryDRepStakeDistributionCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (QueryDRepStakeDistributionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryProposalsCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryProposalsCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryProposalsCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"proposals" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryProposalsCmdArgs era -> QueryCmds era
forall era. QueryProposalsCmdArgs era -> QueryCmds era
QueryProposalsCmd (QueryProposalsCmdArgs era -> QueryCmds era)
-> Parser (QueryProposalsCmdArgs era) -> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era -> Parser (QueryProposalsCmdArgs era)
forall era.
ConwayEraOnwards era -> Parser (QueryProposalsCmdArgs era)
pQueryProposalsCmdArgs ConwayEraOnwards era
w) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc (String -> InfoMod (QueryCmds era))
-> String -> InfoMod (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
          [String] -> String
forall a. Monoid a => [a] -> a
mconcat
            [ String
"Get the governance proposals that are eligible for ratification. "
            , String
"Proposals submitted during the current epoch are excluded, as they cannot be ratified until the next epoch. "
            ]
 where
  pQueryProposalsCmdArgs :: ConwayEraOnwards era -> Parser (QueryProposalsCmdArgs era)
  pQueryProposalsCmdArgs :: forall era.
ConwayEraOnwards era -> Parser (QueryProposalsCmdArgs era)
pQueryProposalsCmdArgs ConwayEraOnwards era
w =
    ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly (GovActionId StandardCrypto)
-> Maybe (File () 'Out)
-> QueryProposalsCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly (GovActionId StandardCrypto)
-> Maybe (File () 'Out)
-> QueryProposalsCmdArgs era
QueryProposalsCmdArgs ConwayEraOnwards era
w
      (QueryCommons
 -> AllOrOnly (GovActionId StandardCrypto)
 -> Maybe (File () 'Out)
 -> QueryProposalsCmdArgs era)
-> Parser QueryCommons
-> Parser
     (AllOrOnly (GovActionId StandardCrypto)
      -> Maybe (File () 'Out) -> QueryProposalsCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons (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
w) EnvCli
envCli
      Parser
  (AllOrOnly (GovActionId StandardCrypto)
   -> Maybe (File () 'Out) -> QueryProposalsCmdArgs era)
-> Parser (AllOrOnly (GovActionId StandardCrypto))
-> Parser (Maybe (File () 'Out) -> QueryProposalsCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ConwayEraOnwards era
-> Parser (AllOrOnly (GovActionId StandardCrypto))
forall era.
ConwayEraOnwards era
-> Parser (AllOrOnly (GovActionId StandardCrypto))
pAllOrOnlyGovActionIds ConwayEraOnwards era
w
      Parser (Maybe (File () 'Out) -> QueryProposalsCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (QueryProposalsCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (File () 'Out) -> Parser (Maybe (File () 'Out))
forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
optional Parser (File () 'Out)
forall content. Parser (File content 'Out)
pOutputFile

pQuerySPOStakeDistributionCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQuerySPOStakeDistributionCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQuerySPOStakeDistributionCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"spo-stake-distribution" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QuerySPOStakeDistributionCmdArgs era -> QueryCmds era
forall era. QuerySPOStakeDistributionCmdArgs era -> QueryCmds era
QuerySPOStakeDistributionCmd (QuerySPOStakeDistributionCmdArgs era -> QueryCmds era)
-> Parser (QuerySPOStakeDistributionCmdArgs era)
-> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era
-> Parser (QuerySPOStakeDistributionCmdArgs era)
forall era.
ConwayEraOnwards era
-> Parser (QuerySPOStakeDistributionCmdArgs era)
pQuerySPOStakeDistributionCmdArgs ConwayEraOnwards era
w) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the SPO stake distribution."
 where
  pQuerySPOStakeDistributionCmdArgs
    :: ConwayEraOnwards era -> Parser (QuerySPOStakeDistributionCmdArgs era)
  pQuerySPOStakeDistributionCmdArgs :: forall era.
ConwayEraOnwards era
-> Parser (QuerySPOStakeDistributionCmdArgs era)
pQuerySPOStakeDistributionCmdArgs ConwayEraOnwards era
w =
    ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly SPOHashSource
-> Maybe (File () 'Out)
-> QuerySPOStakeDistributionCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons
-> AllOrOnly SPOHashSource
-> Maybe (File () 'Out)
-> QuerySPOStakeDistributionCmdArgs era
QuerySPOStakeDistributionCmdArgs ConwayEraOnwards era
w
      (QueryCommons
 -> AllOrOnly SPOHashSource
 -> Maybe (File () 'Out)
 -> QuerySPOStakeDistributionCmdArgs era)
-> Parser QueryCommons
-> Parser
     (AllOrOnly SPOHashSource
      -> Maybe (File () 'Out) -> QuerySPOStakeDistributionCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  (AllOrOnly SPOHashSource
   -> Maybe (File () 'Out) -> QuerySPOStakeDistributionCmdArgs era)
-> Parser (AllOrOnly SPOHashSource)
-> Parser
     (Maybe (File () 'Out) -> QuerySPOStakeDistributionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (AllOrOnly SPOHashSource)
pAllOrOnlySPOHashSource
      Parser
  (Maybe (File () 'Out) -> QuerySPOStakeDistributionCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (QuerySPOStakeDistributionCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryGetCommitteeStateCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryGetCommitteeStateCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryGetCommitteeStateCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"committee-state" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryCommitteeMembersStateCmdArgs era -> QueryCmds era
forall era. QueryCommitteeMembersStateCmdArgs era -> QueryCmds era
QueryCommitteeMembersStateCmd (QueryCommitteeMembersStateCmdArgs era -> QueryCmds era)
-> Parser (QueryCommitteeMembersStateCmdArgs era)
-> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era
-> Parser (QueryCommitteeMembersStateCmdArgs era)
forall era.
ConwayEraOnwards era
-> Parser (QueryCommitteeMembersStateCmdArgs era)
pQueryCommitteeMembersStateArgs ConwayEraOnwards era
w) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the committee state"
 where
  pQueryCommitteeMembersStateArgs
    :: ConwayEraOnwards era -> Parser (QueryCommitteeMembersStateCmdArgs era)
  pQueryCommitteeMembersStateArgs :: forall era.
ConwayEraOnwards era
-> Parser (QueryCommitteeMembersStateCmdArgs era)
pQueryCommitteeMembersStateArgs ConwayEraOnwards era
w =
    ConwayEraOnwards era
-> QueryCommons
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
-> [MemberStatus]
-> Maybe (File () 'Out)
-> QueryCommitteeMembersStateCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
-> [MemberStatus]
-> Maybe (File () 'Out)
-> QueryCommitteeMembersStateCmdArgs era
QueryCommitteeMembersStateCmdArgs ConwayEraOnwards era
w
      (QueryCommons
 -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
 -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
 -> [MemberStatus]
 -> Maybe (File () 'Out)
 -> QueryCommitteeMembersStateCmdArgs era)
-> Parser QueryCommons
-> Parser
     ([VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
      -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
      -> [MemberStatus]
      -> Maybe (File () 'Out)
      -> QueryCommitteeMembersStateCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser
  ([VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
   -> [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
   -> [MemberStatus]
   -> Maybe (File () 'Out)
   -> QueryCommitteeMembersStateCmdArgs era)
-> Parser
     [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
-> Parser
     ([VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
      -> [MemberStatus]
      -> Maybe (File () 'Out)
      -> QueryCommitteeMembersStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
-> Parser
     [VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
many Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
pCommitteeColdVerificationKeyOrHashOrFileOrScriptHash
      Parser
  ([VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
   -> [MemberStatus]
   -> Maybe (File () 'Out)
   -> QueryCommitteeMembersStateCmdArgs era)
-> Parser [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
-> Parser
     ([MemberStatus]
      -> Maybe (File () 'Out) -> QueryCommitteeMembersStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
-> Parser [VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
many Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
pCommitteeHotKeyOrHashOrFileOrScriptHash
      Parser
  ([MemberStatus]
   -> Maybe (File () 'Out) -> QueryCommitteeMembersStateCmdArgs era)
-> Parser [MemberStatus]
-> Parser
     (Maybe (File () 'Out) -> QueryCommitteeMembersStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser MemberStatus -> Parser [MemberStatus]
forall a. Parser a -> Parser [a]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
many Parser MemberStatus
pMemberStatus
      Parser
  (Maybe (File () 'Out) -> QueryCommitteeMembersStateCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (QueryCommitteeMembersStateCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

  pCommitteeColdVerificationKeyOrHashOrFileOrScriptHash
    :: Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
  pCommitteeColdVerificationKeyOrHashOrFileOrScriptHash :: Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
pCommitteeColdVerificationKeyOrHashOrFileOrScriptHash =
    [Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)]
-> Parser
     (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
      [ VerificationKeyOrHashOrFile CommitteeColdKey
-> VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey
forall keyrole.
VerificationKeyOrHashOrFile keyrole
-> VerificationKeyOrHashOrFileOrScriptHash keyrole
VkhfshKeyHashFile (VerificationKeyOrHashOrFile CommitteeColdKey
 -> VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
-> Parser (VerificationKeyOrHashOrFile CommitteeColdKey)
-> Parser
     (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (VerificationKeyOrHashOrFile CommitteeColdKey)
pCommitteeColdVerificationKeyOrHashOrFile
      , ScriptHash
-> VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey
forall keyrole.
ScriptHash -> VerificationKeyOrHashOrFileOrScriptHash keyrole
VkhfshScriptHash
          (ScriptHash
 -> VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
-> Parser ScriptHash
-> Parser
     (VerificationKeyOrHashOrFileOrScriptHash CommitteeColdKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> String -> Parser ScriptHash
pScriptHash
            String
"cold-script-hash"
            String
"Cold Native or Plutus script file hash (hex-encoded). Obtain it with \"cardano-cli hash script ...\"."
      ]

  pCommitteeHotKeyOrHashOrFileOrScriptHash
    :: Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
  pCommitteeHotKeyOrHashOrFileOrScriptHash :: Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
pCommitteeHotKeyOrHashOrFileOrScriptHash =
    [Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)]
-> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
      [ VerificationKeyOrHashOrFile CommitteeHotKey
-> VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey
forall keyrole.
VerificationKeyOrHashOrFile keyrole
-> VerificationKeyOrHashOrFileOrScriptHash keyrole
VkhfshKeyHashFile (VerificationKeyOrHashOrFile CommitteeHotKey
 -> VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
-> Parser (VerificationKeyOrHashOrFile CommitteeHotKey)
-> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Parser (VerificationKeyOrHashOrFile CommitteeHotKey)
pCommitteeHotKeyOrHashOrFile
      , ScriptHash
-> VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey
forall keyrole.
ScriptHash -> VerificationKeyOrHashOrFileOrScriptHash keyrole
VkhfshScriptHash
          (ScriptHash
 -> VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
-> Parser ScriptHash
-> Parser (VerificationKeyOrHashOrFileOrScriptHash CommitteeHotKey)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> String -> String -> Parser ScriptHash
pScriptHash
            String
"hot-script-hash"
            String
"Hot Native or Plutus script file hash (hex-encoded). Obtain it with \"cardano-cli hash script ...\"."
      ]

  pMemberStatus :: Parser MemberStatus
  pMemberStatus :: Parser MemberStatus
pMemberStatus =
    [Parser MemberStatus] -> Parser MemberStatus
forall (t :: * -> *) (f :: * -> *) a.
(Foldable t, Alternative f) =>
t (f a) -> f a
asum
      [ MemberStatus -> Mod FlagFields MemberStatus -> Parser MemberStatus
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' MemberStatus
MemberStatus.Active (Mod FlagFields MemberStatus -> Parser MemberStatus)
-> Mod FlagFields MemberStatus -> Parser MemberStatus
forall a b. (a -> b) -> a -> b
$
          [Mod FlagFields MemberStatus] -> Mod FlagFields MemberStatus
forall a. Monoid a => [a] -> a
mconcat
            [ String -> Mod FlagFields MemberStatus
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"active"
            , String -> Mod FlagFields MemberStatus
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Active committee members (members whose vote will count during ratification)"
            ]
      , MemberStatus -> Mod FlagFields MemberStatus -> Parser MemberStatus
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' MemberStatus
MemberStatus.Expired (Mod FlagFields MemberStatus -> Parser MemberStatus)
-> Mod FlagFields MemberStatus -> Parser MemberStatus
forall a b. (a -> b) -> a -> b
$
          [Mod FlagFields MemberStatus] -> Mod FlagFields MemberStatus
forall a. Monoid a => [a] -> a
mconcat
            [ String -> Mod FlagFields MemberStatus
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"expired"
            , String -> Mod FlagFields MemberStatus
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Expired committee members"
            ]
      , MemberStatus -> Mod FlagFields MemberStatus -> Parser MemberStatus
forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' MemberStatus
MemberStatus.Unrecognized (Mod FlagFields MemberStatus -> Parser MemberStatus)
-> Mod FlagFields MemberStatus -> Parser MemberStatus
forall a b. (a -> b) -> a -> b
$
          [Mod FlagFields MemberStatus] -> Mod FlagFields MemberStatus
forall a. Monoid a => [a] -> a
mconcat
            [ String -> Mod FlagFields MemberStatus
forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"unrecognized"
            , String -> Mod FlagFields MemberStatus
forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Unrecognized committe members: a hot credential for an unknown cold credential"
            ]
      ]

pQueryTreasuryValueCmd
  :: ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Maybe (Parser (QueryCmds era))
pQueryTreasuryValueCmd :: forall era.
ShelleyBasedEra era -> EnvCli -> Maybe (Parser (QueryCmds era))
pQueryTreasuryValueCmd ShelleyBasedEra era
era EnvCli
envCli = do
  ConwayEraOnwards era
w <- ShelleyBasedEra era -> Maybe (ConwayEraOnwards era)
forall (eon :: * -> *) era.
Eon eon =>
ShelleyBasedEra era -> Maybe (eon era)
forShelleyBasedEraMaybeEon ShelleyBasedEra era
era
  Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era)))
-> Parser (QueryCmds era) -> Maybe (Parser (QueryCmds era))
forall a b. (a -> b) -> a -> b
$
    String -> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a. String -> ParserInfo a -> Parser a
subParser String
"treasury" (ParserInfo (QueryCmds era) -> Parser (QueryCmds era))
-> ParserInfo (QueryCmds era) -> Parser (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
      Parser (QueryCmds era)
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a. Parser a -> InfoMod a -> ParserInfo a
Opt.info (QueryTreasuryValueCmdArgs era -> QueryCmds era
forall era. QueryTreasuryValueCmdArgs era -> QueryCmds era
QueryTreasuryValueCmd (QueryTreasuryValueCmdArgs era -> QueryCmds era)
-> Parser (QueryTreasuryValueCmdArgs era) -> Parser (QueryCmds era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ConwayEraOnwards era -> Parser (QueryTreasuryValueCmdArgs era)
forall era.
ConwayEraOnwards era -> Parser (QueryTreasuryValueCmdArgs era)
pQueryTreasuryValueArgs ConwayEraOnwards era
w) (InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era))
-> InfoMod (QueryCmds era) -> ParserInfo (QueryCmds era)
forall a b. (a -> b) -> a -> b
$
        String -> InfoMod (QueryCmds era)
forall a. String -> InfoMod a
Opt.progDesc String
"Get the treasury value"
 where
  pQueryTreasuryValueArgs
    :: ConwayEraOnwards era -> Parser (QueryTreasuryValueCmdArgs era)
  pQueryTreasuryValueArgs :: forall era.
ConwayEraOnwards era -> Parser (QueryTreasuryValueCmdArgs era)
pQueryTreasuryValueArgs ConwayEraOnwards era
w =
    ConwayEraOnwards era
-> QueryCommons
-> Maybe (File () 'Out)
-> QueryTreasuryValueCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons
-> Maybe (File () 'Out)
-> QueryTreasuryValueCmdArgs era
QueryTreasuryValueCmdArgs ConwayEraOnwards era
w
      (QueryCommons
 -> Maybe (File () 'Out) -> QueryTreasuryValueCmdArgs era)
-> Parser QueryCommons
-> Parser (Maybe (File () 'Out) -> QueryTreasuryValueCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
era EnvCli
envCli
      Parser (Maybe (File () 'Out) -> QueryTreasuryValueCmdArgs era)
-> Parser (Maybe (File () 'Out))
-> Parser (QueryTreasuryValueCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryNoArgCmdArgs
  :: forall era
   . ()
  => ConwayEraOnwards era
  -> EnvCli
  -> Parser (QueryNoArgCmdArgs era)
pQueryNoArgCmdArgs :: forall era.
ConwayEraOnwards era -> EnvCli -> Parser (QueryNoArgCmdArgs era)
pQueryNoArgCmdArgs ConwayEraOnwards era
w EnvCli
envCli =
  ConwayEraOnwards era
-> QueryCommons -> Maybe (File () 'Out) -> QueryNoArgCmdArgs era
forall era.
ConwayEraOnwards era
-> QueryCommons -> Maybe (File () 'Out) -> QueryNoArgCmdArgs era
QueryNoArgCmdArgs ConwayEraOnwards era
w
    (QueryCommons -> Maybe (File () 'Out) -> QueryNoArgCmdArgs era)
-> Parser QueryCommons
-> Parser (Maybe (File () 'Out) -> QueryNoArgCmdArgs era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons (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
w) EnvCli
envCli
    Parser (Maybe (File () 'Out) -> QueryNoArgCmdArgs era)
-> Parser (Maybe (File () 'Out)) -> Parser (QueryNoArgCmdArgs era)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser (Maybe (File () 'Out))
forall content. Parser (Maybe (File content 'Out))
pMaybeOutputFile

pQueryCommons
  :: forall era
   . ()
  => ShelleyBasedEra era
  -> EnvCli
  -> Parser QueryCommons
pQueryCommons :: forall era. ShelleyBasedEra era -> EnvCli -> Parser QueryCommons
pQueryCommons ShelleyBasedEra era
w EnvCli
envCli =
  SocketPath
-> ConsensusModeParams
-> NetworkId
-> Target ChainPoint
-> QueryCommons
QueryCommons
    (SocketPath
 -> ConsensusModeParams
 -> NetworkId
 -> Target ChainPoint
 -> QueryCommons)
-> Parser SocketPath
-> Parser
     (ConsensusModeParams
      -> NetworkId -> Target ChainPoint -> QueryCommons)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> EnvCli -> Parser SocketPath
pSocketPath EnvCli
envCli
    Parser
  (ConsensusModeParams
   -> NetworkId -> Target ChainPoint -> QueryCommons)
-> Parser ConsensusModeParams
-> Parser (NetworkId -> Target ChainPoint -> QueryCommons)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Parser ConsensusModeParams
pConsensusModeParams
    Parser (NetworkId -> Target ChainPoint -> QueryCommons)
-> Parser NetworkId -> Parser (Target ChainPoint -> QueryCommons)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> EnvCli -> Parser NetworkId
pNetworkId EnvCli
envCli
    Parser (Target ChainPoint -> QueryCommons)
-> Parser (Target ChainPoint) -> Parser QueryCommons
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> ShelleyBasedEra era -> Parser (Target ChainPoint)
forall era. ShelleyBasedEra era -> Parser (Target ChainPoint)
pTarget ShelleyBasedEra era
w