-- | Pool queries

module Blockfrost.Client.Cardano.Pools
  ( listPools
  , listPools'
  , listRetiredPools
  , listRetiredPools'
  , listRetiringPools
  , listRetiringPools'
  , getPool
  , getPoolHistory
  , getPoolHistory'
  , getPoolMetadata
  , getPoolRelays
  , getPoolDelegators
  , getPoolDelegators'
  , getPoolBlocks
  , getPoolBlocks'
  , getPoolUpdates
  , getPoolUpdates'
  ) where

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

poolsClient :: Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient :: Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient = ((((Paged
    -> SortOrder
    -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
   :<|> (Paged
         -> SortOrder
         -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]))
  :<|> ((Paged
         -> SortOrder
         -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
        :<|> ((PoolId
               -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
              :<|> (PoolId
                    -> Paged
                    -> SortOrder
                    -> ExceptT
                         BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]))))
 :<|> (((PoolId
         -> ExceptT
              BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
        :<|> (PoolId
              -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]))
       :<|> ((PoolId
              -> Paged
              -> SortOrder
              -> ExceptT
                   BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
             :<|> ((PoolId
                    -> Paged
                    -> SortOrder
                    -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
                   :<|> (PoolId
                         -> Paged
                         -> SortOrder
                         -> ExceptT
                              BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate])))))
-> PoolsAPI (AsClientT BlockfrostClient)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (((((Paged
     -> SortOrder
     -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
    :<|> (Paged
          -> SortOrder
          -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]))
   :<|> ((Paged
          -> SortOrder
          -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
         :<|> ((PoolId
                -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
               :<|> (PoolId
                     -> Paged
                     -> SortOrder
                     -> ExceptT
                          BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]))))
  :<|> (((PoolId
          -> ExceptT
               BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
         :<|> (PoolId
               -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]))
        :<|> ((PoolId
               -> Paged
               -> SortOrder
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
              :<|> ((PoolId
                     -> Paged
                     -> SortOrder
                     -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
                    :<|> (PoolId
                          -> Paged
                          -> SortOrder
                          -> ExceptT
                               BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate])))))
 -> PoolsAPI (AsClientT BlockfrostClient))
-> (Project
    -> (((Paged
          -> SortOrder
          -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
         :<|> (Paged
               -> SortOrder
               -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]))
        :<|> ((Paged
               -> SortOrder
               -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
              :<|> ((PoolId
                     -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
                    :<|> (PoolId
                          -> Paged
                          -> SortOrder
                          -> ExceptT
                               BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]))))
       :<|> (((PoolId
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
              :<|> (PoolId
                    -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]))
             :<|> ((PoolId
                    -> Paged
                    -> SortOrder
                    -> ExceptT
                         BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
                   :<|> ((PoolId
                          -> Paged
                          -> SortOrder
                          -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
                         :<|> (PoolId
                               -> Paged
                               -> SortOrder
                               -> ExceptT
                                    BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate])))))
-> Project
-> PoolsAPI (AsClientT BlockfrostClient)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CardanoAPI (AsClientT BlockfrostClient)
-> (((Paged
      -> SortOrder
      -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
     :<|> (Paged
           -> SortOrder
           -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]))
    :<|> ((Paged
           -> SortOrder
           -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
          :<|> ((PoolId
                 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
                :<|> (PoolId
                      -> Paged
                      -> SortOrder
                      -> ExceptT
                           BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]))))
   :<|> (((PoolId
           -> ExceptT
                BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
          :<|> (PoolId
                -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]))
         :<|> ((PoolId
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
               :<|> ((PoolId
                      -> Paged
                      -> SortOrder
                      -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
                     :<|> (PoolId
                           -> Paged
                           -> SortOrder
                           -> ExceptT
                                BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]))))
forall route.
CardanoAPI route
-> route
   :- ("pools" :> (Tag "Cardano \187 Pools" :> ToServantApi PoolsAPI))
_pools (CardanoAPI (AsClientT BlockfrostClient)
 -> (((Paged
       -> SortOrder
       -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
      :<|> (Paged
            -> SortOrder
            -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]))
     :<|> ((Paged
            -> SortOrder
            -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
           :<|> ((PoolId
                  -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
                 :<|> (PoolId
                       -> Paged
                       -> SortOrder
                       -> ExceptT
                            BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]))))
    :<|> (((PoolId
            -> ExceptT
                 BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
           :<|> (PoolId
                 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]))
          :<|> ((PoolId
                 -> Paged
                 -> SortOrder
                 -> ExceptT
                      BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
                :<|> ((PoolId
                       -> Paged
                       -> SortOrder
                       -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
                      :<|> (PoolId
                            -> Paged
                            -> SortOrder
                            -> ExceptT
                                 BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate])))))
-> (Project -> CardanoAPI (AsClientT BlockfrostClient))
-> Project
-> (((Paged
      -> SortOrder
      -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
     :<|> (Paged
           -> SortOrder
           -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]))
    :<|> ((Paged
           -> SortOrder
           -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
          :<|> ((PoolId
                 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
                :<|> (PoolId
                      -> Paged
                      -> SortOrder
                      -> ExceptT
                           BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]))))
   :<|> (((PoolId
           -> ExceptT
                BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
          :<|> (PoolId
                -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]))
         :<|> ((PoolId
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
               :<|> ((PoolId
                      -> Paged
                      -> SortOrder
                      -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
                     :<|> (PoolId
                           -> Paged
                           -> SortOrder
                           -> ExceptT
                                BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]))))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> CardanoAPI (AsClientT BlockfrostClient)
cardanoClient

listPools_ :: Project -> Paged -> SortOrder -> BlockfrostClient [PoolId]
listPools_ :: Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
listPools_ = PoolsAPI (AsClientT BlockfrostClient)
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
forall route.
PoolsAPI route
-> route
   :- (Summary "List of stake pools"
       :> (Description "List of registered stake pools."
           :> (Pagination :> (Sorting :> Get '[JSON] [PoolId]))))
_listPools (PoolsAPI (AsClientT BlockfrostClient)
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | List registered stake pools.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
listPools' :: Paged -> SortOrder -> BlockfrostClient [PoolId]
listPools' :: Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
listPools' Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
listPools_ Project
p Paged
pg SortOrder
s)

-- | List registered stake pools.
listPools :: BlockfrostClient [PoolId]
listPools :: ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
listPools = Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolId]
listPools' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

listRetiredPools_ :: Project -> Paged -> SortOrder -> BlockfrostClient [PoolEpoch]
listRetiredPools_ :: Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiredPools_ = PoolsAPI (AsClientT BlockfrostClient)
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
forall route.
PoolsAPI route
-> route
   :- (Summary "List of retired stake pools"
       :> (Description "List of already retired stake pools."
           :> ("retired"
               :> (Pagination :> (Sorting :> Get '[JSON] [PoolEpoch])))))
_listRetiredPools (PoolsAPI (AsClientT BlockfrostClient)
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | List retired stake pools.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
listRetiredPools' :: Paged -> SortOrder -> BlockfrostClient [PoolEpoch]
listRetiredPools' :: Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiredPools' Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiredPools_ Project
p Paged
pg SortOrder
s)

-- | List retired stake pools.
listRetiredPools :: BlockfrostClient [PoolEpoch]
listRetiredPools :: ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiredPools = Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiredPools' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

listRetiringPools_ :: Project -> Paged -> SortOrder -> BlockfrostClient [PoolEpoch]
listRetiringPools_ :: Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiringPools_ = PoolsAPI (AsClientT BlockfrostClient)
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
forall route.
PoolsAPI route
-> route
   :- (Summary "List of retiring stake pools"
       :> (Description
             "List of stake pools retiring in the upcoming epochs"
           :> ("retiring"
               :> (Pagination :> (Sorting :> Get '[JSON] [PoolEpoch])))))
_listRetiringPools (PoolsAPI (AsClientT BlockfrostClient)
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | List retiring stake pools.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
listRetiringPools' :: Paged -> SortOrder -> BlockfrostClient [PoolEpoch]
listRetiringPools' :: Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiringPools' Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiringPools_ Project
p Paged
pg SortOrder
s)

-- | List retiring stake pools.
listRetiringPools :: BlockfrostClient [PoolEpoch]
listRetiringPools :: ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiringPools = Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolEpoch]
listRetiringPools' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPool_ :: Project -> PoolId -> BlockfrostClient PoolInfo
getPool_ :: Project
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo
getPool_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo
forall route.
PoolsAPI route
-> route
   :- (Summary "Specific stake pool"
       :> (Description "Pool information."
           :> (Capture "pool_id" PoolId :> Get '[JSON] PoolInfo)))
_getPool (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get specific stake pool information
getPool:: PoolId -> BlockfrostClient PoolInfo
getPool :: PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo
getPool PoolId
p = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo)
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) PoolInfo
`getPool_` PoolId
p)

getPoolHistory_ :: Project -> PoolId -> Paged -> SortOrder -> BlockfrostClient [PoolHistory]
getPoolHistory_ :: Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
getPoolHistory_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
forall route.
PoolsAPI route
-> route
   :- (Summary "Stake pool history"
       :> (Description "History of stake pool parameters over epochs."
           :> (Capture "pool_id" PoolId
               :> ("history"
                   :> (Pagination :> (Sorting :> Get '[JSON] [PoolHistory]))))))
_getPoolHistory (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get stake pool history
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getPoolHistory' :: PoolId -> Paged -> SortOrder -> BlockfrostClient [PoolHistory]
getPoolHistory' :: PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
getPoolHistory' PoolId
pid Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
getPoolHistory_ Project
p PoolId
pid Paged
pg SortOrder
s)

-- | Get stake pool history
getPoolHistory :: PoolId -> BlockfrostClient [PoolHistory]
getPoolHistory :: PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
getPoolHistory PoolId
p = PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolHistory]
getPoolHistory' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPoolMetadata_ :: Project -> PoolId -> BlockfrostClient (Maybe PoolMetadata)
getPoolMetadata_ :: Project
-> PoolId
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata)
getPoolMetadata_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata)
forall route.
PoolsAPI route
-> route
   :- (Summary "Stake pool metadata"
       :> (Description "Stake pool registration metadata."
           :> (Capture "pool_id" PoolId
               :> ("metadata" :> Get '[JSON] (Maybe PoolMetadata)))))
_getPoolMetadata (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get stake pool metadata
getPoolMetadata :: PoolId -> BlockfrostClient (Maybe PoolMetadata)
getPoolMetadata :: PoolId
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata)
getPoolMetadata PoolId
p = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata))
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata)
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> PoolId
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) (Maybe PoolMetadata)
`getPoolMetadata_` PoolId
p)

getPoolRelays_ :: Project -> PoolId -> BlockfrostClient [PoolRelay]
getPoolRelays_ :: Project
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]
getPoolRelays_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]
forall route.
PoolsAPI route
-> route
   :- (Summary "Stake pool relays"
       :> (Description "Relays of a stake pool."
           :> (Capture "pool_id" PoolId
               :> ("relays" :> Get '[JSON] [PoolRelay]))))
_getPoolRelays (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get stake pool relays
getPoolRelays :: PoolId -> BlockfrostClient [PoolRelay]
getPoolRelays :: PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]
getPoolRelays PoolId
p = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolRelay]
`getPoolRelays_` PoolId
p)

getPoolDelegators_ :: Project -> PoolId -> Paged -> SortOrder -> BlockfrostClient [PoolDelegator]
getPoolDelegators_ :: Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
getPoolDelegators_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
forall route.
PoolsAPI route
-> route
   :- (Summary "Stake pool delegators"
       :> (Description "List of current stake pools delegators."
           :> (Capture "pool_id" PoolId
               :> ("delegators"
                   :> (Pagination :> (Sorting :> Get '[JSON] [PoolDelegator]))))))
_getPoolDelegators (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> Paged
 -> SortOrder
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get stake pool delegators
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getPoolDelegators' :: PoolId -> Paged -> SortOrder -> BlockfrostClient [PoolDelegator]
getPoolDelegators' :: PoolId
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
getPoolDelegators' PoolId
pid Paged
pg SortOrder
s = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator])
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
getPoolDelegators_ Project
p PoolId
pid Paged
pg SortOrder
s)

-- | Get stake pool delegators
getPoolDelegators :: PoolId -> BlockfrostClient [PoolDelegator]
getPoolDelegators :: PoolId
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
getPoolDelegators PoolId
p = PoolId
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [PoolDelegator]
getPoolDelegators' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPoolBlocks_ :: Project -> PoolId -> Paged -> SortOrder -> BlockfrostClient [BlockHash]
getPoolBlocks_ :: Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
getPoolBlocks_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
forall route.
PoolsAPI route
-> route
   :- (Summary "Stake pool blocks"
       :> (Description "List of stake pool blocks."
           :> (Capture "pool_id" PoolId
               :> ("blocks"
                   :> (Pagination :> (Sorting :> Get '[JSON] [BlockHash]))))))
_getPoolBlocks (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get stake pool blocks
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getPoolBlocks' :: PoolId -> Paged -> SortOrder -> BlockfrostClient [BlockHash]
getPoolBlocks' :: PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
getPoolBlocks' PoolId
pid Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
getPoolBlocks_ Project
p PoolId
pid Paged
pg SortOrder
s)

-- | Get stake pool blocks
getPoolBlocks :: PoolId -> BlockfrostClient [BlockHash]
getPoolBlocks :: PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
getPoolBlocks PoolId
p = PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [BlockHash]
getPoolBlocks' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPoolUpdates_ :: Project -> PoolId -> Paged -> SortOrder -> BlockfrostClient [PoolUpdate]
getPoolUpdates_ :: Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
getPoolUpdates_ = PoolsAPI (AsClientT BlockfrostClient)
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
forall route.
PoolsAPI route
-> route
   :- (Summary "Stake pool updates"
       :> (Description "List of certificate updates to the stake pool."
           :> (Capture "pool_id" PoolId
               :> ("updates"
                   :> (Pagination :> (Sorting :> Get '[JSON] [PoolUpdate]))))))
_getPoolUpdates (PoolsAPI (AsClientT BlockfrostClient)
 -> PoolId
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate])
-> (Project -> PoolsAPI (AsClientT BlockfrostClient))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT BlockfrostClient)
poolsClient

-- | Get stake pool updates
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getPoolUpdates' :: PoolId -> Paged -> SortOrder -> BlockfrostClient [PoolUpdate]
getPoolUpdates' :: PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
getPoolUpdates' PoolId
pid Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
getPoolUpdates_ Project
p PoolId
pid Paged
pg SortOrder
s)

-- | Get stake pool updates
getPoolUpdates :: PoolId -> BlockfrostClient [PoolUpdate]
getPoolUpdates :: PoolId
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
getPoolUpdates PoolId
p = PoolId
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [PoolUpdate]
getPoolUpdates' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def