-- | Nut.link client functions

module Blockfrost.Client.NutLink
  ( nutlinkAddressTickers
  , nutlinkAddressTickers'
  , nutlinkListAddress
  , nutlinkListAddressTickers
  , nutlinkListAddressTickers'
  , nutlinkTickers
  , nutlinkTickers'
  ) where

import Blockfrost.API
import Blockfrost.Client.Types
import Blockfrost.Types
import Data.Text (Text)

nutlinkListAddress_ :: Project -> Address-> BlockfrostClient NutlinkAddress
nutlinkListAddress_ :: Project -> Address -> BlockfrostClient NutlinkAddress
nutlinkListAddress_ = NutLinkAPI (AsClientT BlockfrostClient)
-> Address -> BlockfrostClient NutlinkAddress
forall route.
NutLinkAPI route
-> route
   :- (Summary "List metadata about specific address"
       :> (Description "List metadata about specific address"
           :> (Capture "address" Address :> Get '[JSON] NutlinkAddress)))
_address (NutLinkAPI (AsClientT BlockfrostClient)
 -> Address -> BlockfrostClient NutlinkAddress)
-> (Project -> NutLinkAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> BlockfrostClient NutlinkAddress
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> NutLinkAPI (AsClientT BlockfrostClient)
nutLinkClient

-- | List metadata about specific address
nutlinkListAddress :: Address -> BlockfrostClient NutlinkAddress
nutlinkListAddress :: Address -> BlockfrostClient NutlinkAddress
nutlinkListAddress Address
a = (Project -> BlockfrostClient NutlinkAddress)
-> BlockfrostClient NutlinkAddress
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (Project -> Address -> BlockfrostClient NutlinkAddress
`nutlinkListAddress_` Address
a)

nutlinkListAddressTickers_ :: Project -> Address -> Paged -> SortOrder -> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers_ :: Project
-> Address
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers_ = NutLinkAPI (AsClientT BlockfrostClient)
-> Address
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkAddressTicker]
forall route.
NutLinkAPI route
-> route
   :- (Summary "List tickers for a specific metadata oracle"
       :> (Description "List tickers for a specific metadata oracle"
           :> (Capture "address" Address
               :> ("tickers"
                   :> (Pagination
                       :> (Sorting :> Get '[JSON] [NutlinkAddressTicker]))))))
_listAddressTickers (NutLinkAPI (AsClientT BlockfrostClient)
 -> Address
 -> Paged
 -> SortOrder
 -> BlockfrostClient [NutlinkAddressTicker])
-> (Project -> NutLinkAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkAddressTicker]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> NutLinkAPI (AsClientT BlockfrostClient)
nutLinkClient

-- | List tickers for a specific metadata oracle
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
nutlinkListAddressTickers' :: Address -> Paged -> SortOrder -> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers' :: Address
-> Paged -> SortOrder -> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers' Address
a Paged
pg SortOrder
s = (Project -> BlockfrostClient [NutlinkAddressTicker])
-> BlockfrostClient [NutlinkAddressTicker]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers_ Project
p Address
a Paged
pg SortOrder
s)

-- | List tickers for a specific metadata oracle
nutlinkListAddressTickers :: Address -> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers :: Address -> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers Address
a = Address
-> Paged -> SortOrder -> BlockfrostClient [NutlinkAddressTicker]
nutlinkListAddressTickers' Address
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

nutlinkAddressTickers_ :: Project -> Address -> Text -> Paged -> SortOrder -> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers_ :: Project
-> Address
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers_ = NutLinkAPI (AsClientT BlockfrostClient)
-> Address
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkTicker]
forall route.
NutLinkAPI route
-> route
   :- (Summary "List of records of a specific ticker"
       :> (Description "List of records of a specific ticker"
           :> (Capture "address" Address
               :> ("tickers"
                   :> (Capture "ticker" Text
                       :> (Pagination :> (Sorting :> Get '[JSON] [NutlinkTicker])))))))
_addressTickers (NutLinkAPI (AsClientT BlockfrostClient)
 -> Address
 -> Text
 -> Paged
 -> SortOrder
 -> BlockfrostClient [NutlinkTicker])
-> (Project -> NutLinkAPI (AsClientT BlockfrostClient))
-> Project
-> Address
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkTicker]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> NutLinkAPI (AsClientT BlockfrostClient)
nutLinkClient

-- | List of records of a specific ticker
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
nutlinkAddressTickers' :: Address -> Text -> Paged -> SortOrder -> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers' :: Address
-> Text -> Paged -> SortOrder -> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers' Address
a Text
t Paged
pg SortOrder
s = (Project -> BlockfrostClient [NutlinkTicker])
-> BlockfrostClient [NutlinkTicker]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Address
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers_ Project
p Address
a Text
t Paged
pg SortOrder
s)

-- | List of records of a specific ticker
nutlinkAddressTickers :: Address -> Text -> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers :: Address -> Text -> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers Address
a Text
t = Address
-> Text -> Paged -> SortOrder -> BlockfrostClient [NutlinkTicker]
nutlinkAddressTickers' Address
a Text
t Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def

nutlinkTickers_ :: Project -> Text -> Paged -> SortOrder -> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers_ :: Project
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers_ = NutLinkAPI (AsClientT BlockfrostClient)
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [(Address, NutlinkTicker)]
forall route.
NutLinkAPI route
-> route
   :- (Summary "List of records of a specific ticker"
       :> (Description "List of records of a specific ticker"
           :> ("tickers"
               :> (Capture "ticker" Text
                   :> (Pagination
                       :> (Sorting :> Get '[JSON] [(Address, NutlinkTicker)]))))))
_tickers (NutLinkAPI (AsClientT BlockfrostClient)
 -> Text
 -> Paged
 -> SortOrder
 -> BlockfrostClient [(Address, NutlinkTicker)])
-> (Project -> NutLinkAPI (AsClientT BlockfrostClient))
-> Project
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [(Address, NutlinkTicker)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Project -> NutLinkAPI (AsClientT BlockfrostClient)
nutLinkClient

-- | List of records of a specific ticker
-- Allows custom paging and ordering using @Paged@ and @SortOrder@.
nutlinkTickers' :: Text -> Paged -> SortOrder -> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers' :: Text
-> Paged
-> SortOrder
-> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers' Text
a Paged
pg SortOrder
s = (Project -> BlockfrostClient [(Address, NutlinkTicker)])
-> BlockfrostClient [(Address, NutlinkTicker)]
forall a. (Project -> BlockfrostClient a) -> BlockfrostClient a
go (\Project
p -> Project
-> Text
-> Paged
-> SortOrder
-> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers_ Project
p Text
a Paged
pg SortOrder
s)

-- | List of records of a specific ticker
nutlinkTickers :: Text -> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers :: Text -> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers Text
a = Text
-> Paged
-> SortOrder
-> BlockfrostClient [(Address, NutlinkTicker)]
nutlinkTickers' Text
a Paged
forall a. Default a => a
def SortOrder
forall a. Default a => a
def