{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module CoinbasePro.Unauthenticated
( products
, aggregateOrderBook
, fullOrderBook
, trades
, candles
, stats
, currencies
, time
) where
import Data.Time.Clock (UTCTime)
import Servant.Client (ClientM)
import CoinbasePro.Headers (userAgent)
import CoinbasePro.MarketData.AggregateOrderBook (AggregateOrderBook)
import CoinbasePro.MarketData.FullOrderBook (FullOrderBook)
import CoinbasePro.MarketData.Types (AggregateBookLevel (..),
CBTime,
FullBookLevel (..),
Product, Trade)
import CoinbasePro.Types (Candle,
CandleGranularity,
Currency, ProductId,
TwentyFourHourStats)
import qualified CoinbasePro.Unauthenticated.API as API
products :: ClientM [Product]
products = API.products userAgent
aggregateOrderBook :: ProductId -> Maybe AggregateBookLevel -> ClientM AggregateOrderBook
aggregateOrderBook prid agg = API.aggregateOrderBook prid agg userAgent
fullOrderBook :: ProductId -> ClientM FullOrderBook
fullOrderBook prid = API.fullOrderBook prid (Just FullBookLevel) userAgent
trades :: ProductId -> ClientM [Trade]
trades prid = API.trades prid userAgent
candles :: ProductId -> Maybe UTCTime -> Maybe UTCTime -> CandleGranularity -> ClientM [Candle]
candles prid start end cg = API.candles prid start end cg userAgent
stats :: ProductId -> ClientM TwentyFourHourStats
stats prid = API.stats prid userAgent
currencies :: ClientM [Currency]
currencies = API.currencies userAgent
time :: ClientM CBTime
time = API.time userAgent