-- | Network queries

module Blockfrost.Client.Cardano.Network
  ( getNetworkInfo
  ) where

import Blockfrost.API
import Blockfrost.Client.Types
import Blockfrost.Types


networkClient :: MonadBlockfrost m => Project -> NetworkAPI (AsClientT m)
networkClient :: forall (m :: * -> *).
MonadBlockfrost m =>
Project -> NetworkAPI (AsClientT m)
networkClient = forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall route.
CardanoAPI route
-> route
   :- ("network"
       :> (Tag "Cardano \187 Network" :> ToServantApi NetworkAPI))
_network forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *).
MonadBlockfrost m =>
Project -> CardanoAPI (AsClientT m)
cardanoClient

getNetworkInfo_ :: MonadBlockfrost m => Project -> m Network
getNetworkInfo_ :: forall (m :: * -> *). MonadBlockfrost m => Project -> m Network
getNetworkInfo_ = forall route.
NetworkAPI route
-> route
   :- (Summary "Network information"
       :> (Description "Return detailed network information."
           :> Get '[JSON] Network))
_networkInfo forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *).
MonadBlockfrost m =>
Project -> NetworkAPI (AsClientT m)
networkClient

-- | Get detailed network information.
getNetworkInfo :: MonadBlockfrost m => m Network
getNetworkInfo :: forall (m :: * -> *). MonadBlockfrost m => m Network
getNetworkInfo = forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go forall (m :: * -> *). MonadBlockfrost m => Project -> m Network
getNetworkInfo_