-- | Account queries

module Blockfrost.Client.Cardano.Accounts
  ( getAccount
  , getAccountRewards
  , getAccountRewards'
  , getAccountHistory
  , getAccountHistory'
  , getAccountDelegations
  , getAccountDelegations'
  , getAccountRegistrations
  , getAccountRegistrations'
  , getAccountWithdrawals
  , getAccountWithdrawals'
  , getAccountMirs
  , getAccountMirs'
  ) where

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

accountsClient :: Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient :: Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient = (((Address
   -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
  :<|> ((Address
         -> Paged
         -> SortOrder
         -> ExceptT
              BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
        :<|> (Address
              -> Paged
              -> SortOrder
              -> ExceptT
                   BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])))
 :<|> (((Address
         -> Paged
         -> SortOrder
         -> ExceptT
              BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
        :<|> (Address
              -> Paged
              -> SortOrder
              -> ExceptT
                   BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]))
       :<|> ((Address
              -> Paged
              -> SortOrder
              -> ExceptT
                   BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
             :<|> (Address
                   -> Paged
                   -> SortOrder
                   -> ExceptT
                        BlockfrostError (ReaderT ClientConfig IO) [AccountMir]))))
-> AccountsAPI (AsClientT BlockfrostClient)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant ((((Address
    -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
   :<|> ((Address
          -> Paged
          -> SortOrder
          -> ExceptT
               BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
         :<|> (Address
               -> Paged
               -> SortOrder
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])))
  :<|> (((Address
          -> Paged
          -> SortOrder
          -> ExceptT
               BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
         :<|> (Address
               -> Paged
               -> SortOrder
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]))
        :<|> ((Address
               -> Paged
               -> SortOrder
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
              :<|> (Address
                    -> Paged
                    -> SortOrder
                    -> ExceptT
                         BlockfrostError (ReaderT ClientConfig IO) [AccountMir]))))
 -> AccountsAPI (AsClientT BlockfrostClient))
-> (Project
    -> ((Address
         -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
        :<|> ((Address
               -> Paged
               -> SortOrder
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
              :<|> (Address
                    -> Paged
                    -> SortOrder
                    -> ExceptT
                         BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])))
       :<|> (((Address
               -> Paged
               -> SortOrder
               -> ExceptT
                    BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
              :<|> (Address
                    -> Paged
                    -> SortOrder
                    -> ExceptT
                         BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]))
             :<|> ((Address
                    -> Paged
                    -> SortOrder
                    -> ExceptT
                         BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
                   :<|> (Address
                         -> Paged
                         -> SortOrder
                         -> ExceptT
                              BlockfrostError (ReaderT ClientConfig IO) [AccountMir]))))
-> Project
-> AccountsAPI (AsClientT BlockfrostClient)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CardanoAPI (AsClientT BlockfrostClient)
-> ((Address
     -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
    :<|> ((Address
           -> Paged
           -> SortOrder
           -> ExceptT
                BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
          :<|> (Address
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])))
   :<|> (((Address
           -> Paged
           -> SortOrder
           -> ExceptT
                BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
          :<|> (Address
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]))
         :<|> ((Address
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
               :<|> (Address
                     -> Paged
                     -> SortOrder
                     -> ExceptT
                          BlockfrostError (ReaderT ClientConfig IO) [AccountMir])))
forall route.
CardanoAPI route
-> route
   :- ("accounts"
       :> (Tag "Cardano \187 Accounts" :> ToServantApi AccountsAPI))
_accounts (CardanoAPI (AsClientT BlockfrostClient)
 -> ((Address
      -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
     :<|> ((Address
            -> Paged
            -> SortOrder
            -> ExceptT
                 BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
           :<|> (Address
                 -> Paged
                 -> SortOrder
                 -> ExceptT
                      BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])))
    :<|> (((Address
            -> Paged
            -> SortOrder
            -> ExceptT
                 BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
           :<|> (Address
                 -> Paged
                 -> SortOrder
                 -> ExceptT
                      BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]))
          :<|> ((Address
                 -> Paged
                 -> SortOrder
                 -> ExceptT
                      BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
                :<|> (Address
                      -> Paged
                      -> SortOrder
                      -> ExceptT
                           BlockfrostError (ReaderT ClientConfig IO) [AccountMir]))))
-> (Project -> CardanoAPI (AsClientT BlockfrostClient))
-> Project
-> ((Address
     -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
    :<|> ((Address
           -> Paged
           -> SortOrder
           -> ExceptT
                BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
          :<|> (Address
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])))
   :<|> (((Address
           -> Paged
           -> SortOrder
           -> ExceptT
                BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
          :<|> (Address
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]))
         :<|> ((Address
                -> Paged
                -> SortOrder
                -> ExceptT
                     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
               :<|> (Address
                     -> Paged
                     -> SortOrder
                     -> ExceptT
                          BlockfrostError (ReaderT ClientConfig IO) [AccountMir])))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> CardanoAPI (AsClientT BlockfrostClient)
cardanoClient

getAccount_ :: Project -> Address -> BlockfrostClient AccountInfo
getAccount_ :: Project
-> Address
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo
getAccount_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo
forall route.
AccountsAPI route
-> route
   :- (Summary "Specific account address"
       :> (Description
             "Obtain information about a specific stake account."
           :> (Capture "stake_address" Address :> Get '[JSON] AccountInfo)))
_account (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about a specific stake account.
getAccount :: Address -> BlockfrostClient AccountInfo
getAccount :: Address
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo
getAccount Address
a = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo)
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project
-> Address
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) AccountInfo
`getAccount_` Address
a)

getAccountRewards_ :: Project -> Address -> Paged -> SortOrder -> BlockfrostClient [AccountReward]
getAccountRewards_ :: Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
getAccountRewards_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
forall route.
AccountsAPI route
-> route
   :- (Summary "Specific reward history"
       :> (Description
             "Obtain information about the reward history of a specific account."
           :> (Capture "stake_address" Address
               :> ("rewards"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AccountReward]))))))
_accountRewards (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about the history of a specific account.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getAccountRewards' :: Address -> Paged -> SortOrder -> BlockfrostClient [AccountReward]
getAccountRewards' :: Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
getAccountRewards' Address
a Paged
pg SortOrder
s = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountReward])
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
getAccountRewards_ Project
p Address
a Paged
pg SortOrder
s)

-- | Obtain information about the history of a specific account.
getAccountRewards :: Address -> BlockfrostClient [AccountReward]
getAccountRewards :: Address
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
getAccountRewards Address
a = Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountReward]
getAccountRewards' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getAccountHistory_ :: Project -> Address -> Paged -> SortOrder -> BlockfrostClient [AccountHistory]
getAccountHistory_ :: Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
getAccountHistory_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
forall route.
AccountsAPI route
-> route
   :- (Summary "Account history"
       :> (Description
             "Obtain information about the history of a specific account."
           :> (Capture "stake_address" Address
               :> ("history"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AccountHistory]))))))
_accountHistory (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about the history of a specific account.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getAccountHistory' :: Address -> Paged -> SortOrder -> BlockfrostClient [AccountHistory]
getAccountHistory' :: Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
getAccountHistory' Address
a Paged
pg SortOrder
s = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountHistory])
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
getAccountHistory_ Project
p Address
a Paged
pg SortOrder
s)

-- | Obtain information about the history of a specific account.
getAccountHistory :: Address -> BlockfrostClient [AccountHistory]
getAccountHistory :: Address
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
getAccountHistory Address
a = Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountHistory]
getAccountHistory' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getAccountDelegations_ :: Project -> Address -> Paged -> SortOrder -> BlockfrostClient [AccountDelegation]
getAccountDelegations_ :: Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
getAccountDelegations_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
forall route.
AccountsAPI route
-> route
   :- (Summary "Account delegation history"
       :> (Description
             "Obtain information about the delegation of a specific account."
           :> (Capture "stake_address" Address
               :> ("delegations"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AccountDelegation]))))))
_accountDelegations (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about the delegation of a specific account.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getAccountDelegations' :: Address -> Paged -> SortOrder -> BlockfrostClient [AccountDelegation]
getAccountDelegations' :: Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
getAccountDelegations' Address
a Paged
pg SortOrder
s = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation])
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
getAccountDelegations_ Project
p Address
a Paged
pg SortOrder
s)

-- | Obtain information about the delegation of a specific account.
getAccountDelegations :: Address -> BlockfrostClient [AccountDelegation]
getAccountDelegations :: Address
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
getAccountDelegations Address
a = Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountDelegation]
getAccountDelegations' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getAccountRegistrations_ :: Project -> Address -> Paged -> SortOrder -> BlockfrostClient [AccountRegistration]
getAccountRegistrations_ :: Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
getAccountRegistrations_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
forall route.
AccountsAPI route
-> route
   :- (Summary "Account registration history"
       :> (Description
             "Obtain information about the registrations and deregistrations of a specific account."
           :> (Capture "stake_address" Address
               :> ("registrations"
                   :> (Pagination
                       :> (Sorting :> Get '[JSON] [AccountRegistration]))))))
_accountRegistrations (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration])
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about the registrations and deregistrations of a specific account.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getAccountRegistrations' :: Address -> Paged -> SortOrder -> BlockfrostClient [AccountRegistration]
getAccountRegistrations' :: Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
getAccountRegistrations' Address
a Paged
pg SortOrder
s = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration])
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
getAccountRegistrations_ Project
p Address
a Paged
pg SortOrder
s)

-- | Obtain information about the registrations and deregistrations of a specific account.
getAccountRegistrations :: Address -> BlockfrostClient [AccountRegistration]
getAccountRegistrations :: Address
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
getAccountRegistrations Address
a = Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountRegistration]
getAccountRegistrations' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getAccountWithdrawals_ :: Project -> Address -> Paged -> SortOrder ->  BlockfrostClient [AccountWithdrawal]
getAccountWithdrawals_ :: Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
getAccountWithdrawals_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
forall route.
AccountsAPI route
-> route
   :- (Summary "Account withdrawal history"
       :> (Description
             "Obtain information about the withdrawals of a specific account."
           :> (Capture "stake_address" Address
               :> ("withdrawals"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AccountWithdrawal]))))))
_accountWithdrawals (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about the withdrawals of a specific account.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getAccountWithdrawals' :: Address -> Paged -> SortOrder -> BlockfrostClient [AccountWithdrawal]
getAccountWithdrawals' :: Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
getAccountWithdrawals' Address
a Paged
pg SortOrder
s = (Project
 -> ExceptT
      BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal])
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
getAccountWithdrawals_ Project
p Address
a Paged
pg SortOrder
s)

-- | Obtain information about the withdrawals of a specific account.
getAccountWithdrawals :: Address -> BlockfrostClient [AccountWithdrawal]
getAccountWithdrawals :: Address
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
getAccountWithdrawals Address
a = Address
-> Paged
-> SortOrder
-> ExceptT
     BlockfrostError (ReaderT ClientConfig IO) [AccountWithdrawal]
getAccountWithdrawals' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

getAccountMirs_ :: Project -> Address -> Paged -> SortOrder -> BlockfrostClient [AccountMir]
getAccountMirs_ :: Project
-> Address
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
getAccountMirs_ = AccountsAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
forall route.
AccountsAPI route
-> route
   :- (Summary "Account MIR history"
       :> (Description
             "Obtain information about the MIRs of a specific account."
           :> (Capture "stake_address" Address
               :> ("mirs"
                   :> (Pagination :> (Sorting :> Get '[JSON] [AccountMir]))))))
_accountMirs (AccountsAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir])
-> (Project -> AccountsAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> AccountsAPI (AsClientT BlockfrostClient)
accountsClient

-- | Obtain information about the MIRs of a specific account.
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
getAccountMirs' :: Address -> Paged -> SortOrder -> BlockfrostClient [AccountMir]
getAccountMirs' :: Address
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
getAccountMirs' Address
a Paged
pg SortOrder
s = (Project
 -> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir])
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
getAccountMirs_ Project
p Address
a Paged
pg SortOrder
s)

-- | Obtain information about the MIRs of a specific account.
getAccountMirs :: Address -> BlockfrostClient [AccountMir]
getAccountMirs :: Address
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
getAccountMirs Address
a = Address
-> Paged
-> SortOrder
-> ExceptT BlockfrostError (ReaderT ClientConfig IO) [AccountMir]
getAccountMirs' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def