-- | Cardano Network endpoints

{-# OPTIONS_HADDOCK hide #-}

module Blockfrost.API.Cardano.Network
  where

import Servant.API
import Servant.API.Generic

import Blockfrost.Types.Cardano.Network

data NetworkAPI route =
  NetworkAPI
    {
      forall route.
NetworkAPI route
-> route
   :- (Summary "Network information"
       :> (Description "Return detailed network information."
           :> Get '[JSON] Network))
_networkInfo
        :: route
        :- Summary "Network information"
        :> Description "Return detailed network information."
        :> Get '[JSON] Network
    , forall route.
NetworkAPI route
-> route
   :- (Summary "Query summary of blockchain eras"
       :> (Description
             "Returns start and end of each era along with parameters that can vary between hard forks."
           :> ("eras" :> Get '[JSON] [NetworkEraSummary])))
_networkEras
        :: route
        :- Summary "Query summary of blockchain eras"
        :> Description "Returns start and end of each era along with parameters that can vary between hard forks."
        :> "eras"
        :> Get '[JSON] [NetworkEraSummary]
    } deriving (forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall route x. Rep (NetworkAPI route) x -> NetworkAPI route
forall route x. NetworkAPI route -> Rep (NetworkAPI route) x
$cto :: forall route x. Rep (NetworkAPI route) x -> NetworkAPI route
$cfrom :: forall route x. NetworkAPI route -> Rep (NetworkAPI route) x
Generic)