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

listPools_ :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [PoolId]
listPools_ :: Project -> Paged -> SortOrder -> m [PoolId]
listPools_ = PoolsAPI (AsClientT m) -> Paged -> SortOrder -> m [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 m) -> Paged -> SortOrder -> m [PoolId])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> Paged
-> SortOrder
-> m [PoolId]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

-- | List registered stake pools.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
listPools' :: MonadBlockfrost m => Paged -> SortOrder -> m [PoolId]
listPools' :: Paged -> SortOrder -> m [PoolId]
listPools' Paged
pg SortOrder
s = (Project -> m [PoolId]) -> m [PoolId]
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (\Project
p -> Project -> Paged -> SortOrder -> m [PoolId]
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> Paged -> SortOrder -> m [PoolId]
listPools_ Project
p Paged
pg SortOrder
s)

-- | List registered stake pools.
listPools :: MonadBlockfrost m => m [PoolId]
listPools :: m [PoolId]
listPools = Paged -> SortOrder -> m [PoolId]
forall (m :: * -> *).
MonadBlockfrost m =>
Paged -> SortOrder -> m [PoolId]
listPools' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

listRetiredPools_ :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [PoolEpoch]
listRetiredPools_ :: Project -> Paged -> SortOrder -> m [PoolEpoch]
listRetiredPools_ = PoolsAPI (AsClientT m) -> Paged -> SortOrder -> m [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 m) -> Paged -> SortOrder -> m [PoolEpoch])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> Paged
-> SortOrder
-> m [PoolEpoch]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

-- | List retired stake pools.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
listRetiredPools' :: MonadBlockfrost m => Paged -> SortOrder -> m [PoolEpoch]
listRetiredPools' :: Paged -> SortOrder -> m [PoolEpoch]
listRetiredPools' Paged
pg SortOrder
s = (Project -> m [PoolEpoch]) -> m [PoolEpoch]
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (\Project
p -> Project -> Paged -> SortOrder -> m [PoolEpoch]
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> Paged -> SortOrder -> m [PoolEpoch]
listRetiredPools_ Project
p Paged
pg SortOrder
s)

-- | List retired stake pools.
listRetiredPools :: MonadBlockfrost m => m [PoolEpoch]
listRetiredPools :: m [PoolEpoch]
listRetiredPools = Paged -> SortOrder -> m [PoolEpoch]
forall (m :: * -> *).
MonadBlockfrost m =>
Paged -> SortOrder -> m [PoolEpoch]
listRetiredPools' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

listRetiringPools_ :: MonadBlockfrost m => Project -> Paged -> SortOrder -> m [PoolEpoch]
listRetiringPools_ :: Project -> Paged -> SortOrder -> m [PoolEpoch]
listRetiringPools_ = PoolsAPI (AsClientT m) -> Paged -> SortOrder -> m [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 m) -> Paged -> SortOrder -> m [PoolEpoch])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> Paged
-> SortOrder
-> m [PoolEpoch]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

-- | List retiring stake pools.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
listRetiringPools' :: MonadBlockfrost m => Paged -> SortOrder -> m [PoolEpoch]
listRetiringPools' :: Paged -> SortOrder -> m [PoolEpoch]
listRetiringPools' Paged
pg SortOrder
s = (Project -> m [PoolEpoch]) -> m [PoolEpoch]
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (\Project
p -> Project -> Paged -> SortOrder -> m [PoolEpoch]
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> Paged -> SortOrder -> m [PoolEpoch]
listRetiringPools_ Project
p Paged
pg SortOrder
s)

-- | List retiring stake pools.
listRetiringPools :: MonadBlockfrost m => m [PoolEpoch]
listRetiringPools :: m [PoolEpoch]
listRetiringPools = Paged -> SortOrder -> m [PoolEpoch]
forall (m :: * -> *).
MonadBlockfrost m =>
Paged -> SortOrder -> m [PoolEpoch]
listRetiringPools' Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPool_ :: MonadBlockfrost m => Project -> PoolId -> m PoolInfo
getPool_ :: Project -> PoolId -> m PoolInfo
getPool_ = PoolsAPI (AsClientT m) -> PoolId -> m PoolInfo
forall route.
PoolsAPI route
-> route
   :- (Summary "Specific stake pool"
       :> (Description "Pool information."
           :> (Capture "pool_id" PoolId :> Get '[JSON] PoolInfo)))
_getPool (PoolsAPI (AsClientT m) -> PoolId -> m PoolInfo)
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> m PoolInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

-- | Get specific stake pool information
getPool :: MonadBlockfrost m => PoolId -> m PoolInfo
getPool :: PoolId -> m PoolInfo
getPool PoolId
p = (Project -> m PoolInfo) -> m PoolInfo
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> PoolId -> m PoolInfo
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolId -> m PoolInfo
`getPool_` PoolId
p)

getPoolHistory_ :: MonadBlockfrost m => Project -> PoolId -> Paged -> SortOrder -> m [PoolHistory]
getPoolHistory_ :: Project -> PoolId -> Paged -> SortOrder -> m [PoolHistory]
getPoolHistory_ = PoolsAPI (AsClientT m)
-> PoolId -> Paged -> SortOrder -> m [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 m)
 -> PoolId -> Paged -> SortOrder -> m [PoolHistory])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> m [PoolHistory]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

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

-- | Get stake pool history
getPoolHistory :: MonadBlockfrost m => PoolId -> m [PoolHistory]
getPoolHistory :: PoolId -> m [PoolHistory]
getPoolHistory PoolId
p = PoolId -> Paged -> SortOrder -> m [PoolHistory]
forall (m :: * -> *).
MonadBlockfrost m =>
PoolId -> Paged -> SortOrder -> m [PoolHistory]
getPoolHistory' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPoolMetadata_ :: MonadBlockfrost m => Project -> PoolId -> m (Maybe PoolMetadata)
getPoolMetadata_ :: Project -> PoolId -> m (Maybe PoolMetadata)
getPoolMetadata_ = PoolsAPI (AsClientT m) -> PoolId -> m (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 m) -> PoolId -> m (Maybe PoolMetadata))
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> m (Maybe PoolMetadata)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

-- | Get stake pool metadata
getPoolMetadata :: MonadBlockfrost m => PoolId -> m (Maybe PoolMetadata)
getPoolMetadata :: PoolId -> m (Maybe PoolMetadata)
getPoolMetadata PoolId
p = (Project -> m (Maybe PoolMetadata)) -> m (Maybe PoolMetadata)
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> PoolId -> m (Maybe PoolMetadata)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolId -> m (Maybe PoolMetadata)
`getPoolMetadata_` PoolId
p)

getPoolRelays_ :: MonadBlockfrost m => Project -> PoolId -> m [PoolRelay]
getPoolRelays_ :: Project -> PoolId -> m [PoolRelay]
getPoolRelays_ = PoolsAPI (AsClientT m) -> PoolId -> m [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 m) -> PoolId -> m [PoolRelay])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> m [PoolRelay]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

-- | Get stake pool relays
getPoolRelays :: MonadBlockfrost m => PoolId -> m [PoolRelay]
getPoolRelays :: PoolId -> m [PoolRelay]
getPoolRelays PoolId
p = (Project -> m [PoolRelay]) -> m [PoolRelay]
forall (m :: * -> *) a.
MonadBlockfrost m =>
(Project -> m a) -> m a
go (Project -> PoolId -> m [PoolRelay]
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolId -> m [PoolRelay]
`getPoolRelays_` PoolId
p)

getPoolDelegators_ :: MonadBlockfrost m => Project -> PoolId -> Paged -> SortOrder -> m [PoolDelegator]
getPoolDelegators_ :: Project -> PoolId -> Paged -> SortOrder -> m [PoolDelegator]
getPoolDelegators_ = PoolsAPI (AsClientT m)
-> PoolId -> Paged -> SortOrder -> m [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 m)
 -> PoolId -> Paged -> SortOrder -> m [PoolDelegator])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> m [PoolDelegator]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

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

-- | Get stake pool delegators
getPoolDelegators :: MonadBlockfrost m => PoolId -> m [PoolDelegator]
getPoolDelegators :: PoolId -> m [PoolDelegator]
getPoolDelegators PoolId
p = PoolId -> Paged -> SortOrder -> m [PoolDelegator]
forall (m :: * -> *).
MonadBlockfrost m =>
PoolId -> Paged -> SortOrder -> m [PoolDelegator]
getPoolDelegators' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPoolBlocks_ :: MonadBlockfrost m => Project -> PoolId -> Paged -> SortOrder -> m [BlockHash]
getPoolBlocks_ :: Project -> PoolId -> Paged -> SortOrder -> m [BlockHash]
getPoolBlocks_ = PoolsAPI (AsClientT m)
-> PoolId -> Paged -> SortOrder -> m [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 m)
 -> PoolId -> Paged -> SortOrder -> m [BlockHash])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> m [BlockHash]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

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

-- | Get stake pool blocks
getPoolBlocks :: MonadBlockfrost m => PoolId -> m [BlockHash]
getPoolBlocks :: PoolId -> m [BlockHash]
getPoolBlocks PoolId
p = PoolId -> Paged -> SortOrder -> m [BlockHash]
forall (m :: * -> *).
MonadBlockfrost m =>
PoolId -> Paged -> SortOrder -> m [BlockHash]
getPoolBlocks' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getPoolUpdates_ :: MonadBlockfrost m => Project -> PoolId -> Paged -> SortOrder -> m [PoolUpdate]
getPoolUpdates_ :: Project -> PoolId -> Paged -> SortOrder -> m [PoolUpdate]
getPoolUpdates_ = PoolsAPI (AsClientT m)
-> PoolId -> Paged -> SortOrder -> m [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 m)
 -> PoolId -> Paged -> SortOrder -> m [PoolUpdate])
-> (Project -> PoolsAPI (AsClientT m))
-> Project
-> PoolId
-> Paged
-> SortOrder
-> m [PoolUpdate]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> PoolsAPI (AsClientT m)
forall (m :: * -> *).
MonadBlockfrost m =>
Project -> PoolsAPI (AsClientT m)
poolsClient

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

-- | Get stake pool updates
getPoolUpdates :: MonadBlockfrost m => PoolId -> m [PoolUpdate]
getPoolUpdates :: PoolId -> m [PoolUpdate]
getPoolUpdates PoolId
p = PoolId -> Paged -> SortOrder -> m [PoolUpdate]
forall (m :: * -> *).
MonadBlockfrost m =>
PoolId -> Paged -> SortOrder -> m [PoolUpdate]
getPoolUpdates' PoolId
p Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def