{-# LANGUAGE DataKinds #-}
{-# LANGUAGE LambdaCase #-}

module Cardano.CLI.EraBased.Commands.Address
  ( AddressCmds (..)
  , renderAddressCmds
  )
where

import           Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..))

import           Cardano.CLI.Types.Common
import           Cardano.CLI.Types.Key

import           Prelude

import           Data.Text (Text)

data AddressCmds era
  = AddressKeyGen
      KeyOutputFormat
      AddressKeyType
      (VerificationKeyFile Out)
      (SigningKeyFile Out)
  | AddressKeyHash
      VerificationKeyTextOrFile
      (Maybe (File () Out))
  | AddressBuild
      PaymentVerifier
      (Maybe StakeIdentifier)
      NetworkId
      (Maybe (File () Out))
  | AddressInfo
      Text
      (Maybe (File () Out))
  deriving Int -> AddressCmds era -> ShowS
[AddressCmds era] -> ShowS
AddressCmds era -> String
(Int -> AddressCmds era -> ShowS)
-> (AddressCmds era -> String)
-> ([AddressCmds era] -> ShowS)
-> Show (AddressCmds era)
forall era. Int -> AddressCmds era -> ShowS
forall era. [AddressCmds era] -> ShowS
forall era. AddressCmds era -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall era. Int -> AddressCmds era -> ShowS
showsPrec :: Int -> AddressCmds era -> ShowS
$cshow :: forall era. AddressCmds era -> String
show :: AddressCmds era -> String
$cshowList :: forall era. [AddressCmds era] -> ShowS
showList :: [AddressCmds era] -> ShowS
Show

renderAddressCmds :: AddressCmds era -> Text
renderAddressCmds :: forall era. AddressCmds era -> Text
renderAddressCmds = \case
  AddressKeyGen{} -> Text
"address key-gen"
  AddressKeyHash{} -> Text
"address key-hash"
  AddressBuild{} -> Text
"address build"
  AddressInfo{} -> Text
"address info"