{-# LANGUAGE DataKinds #-}
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 :: ClientM [Product]
products = CBRequest [Product]
API.products UserAgent
userAgent
aggregateOrderBook :: ProductId -> Maybe AggregateBookLevel -> ClientM AggregateOrderBook
aggregateOrderBook :: ProductId -> Maybe AggregateBookLevel -> ClientM AggregateOrderBook
aggregateOrderBook ProductId
prid Maybe AggregateBookLevel
agg = ProductId
-> Maybe AggregateBookLevel -> CBRequest AggregateOrderBook
API.aggregateOrderBook ProductId
prid Maybe AggregateBookLevel
agg UserAgent
userAgent
fullOrderBook :: ProductId -> ClientM FullOrderBook
fullOrderBook :: ProductId -> ClientM FullOrderBook
fullOrderBook ProductId
prid = ProductId -> Maybe FullBookLevel -> CBRequest FullOrderBook
API.fullOrderBook ProductId
prid (FullBookLevel -> Maybe FullBookLevel
forall a. a -> Maybe a
Just FullBookLevel
FullBookLevel) UserAgent
userAgent
trades :: ProductId -> ClientM [Trade]
trades :: ProductId -> ClientM [Trade]
trades ProductId
prid = ProductId -> CBRequest [Trade]
API.trades ProductId
prid UserAgent
userAgent
candles :: ProductId -> Maybe UTCTime -> Maybe UTCTime -> CandleGranularity -> ClientM [Candle]
candles :: ProductId
-> Maybe UTCTime
-> Maybe UTCTime
-> CandleGranularity
-> ClientM [Candle]
candles ProductId
prid Maybe UTCTime
start Maybe UTCTime
end CandleGranularity
cg = ProductId
-> Maybe UTCTime
-> Maybe UTCTime
-> CandleGranularity
-> CBRequest [Candle]
API.candles ProductId
prid Maybe UTCTime
start Maybe UTCTime
end CandleGranularity
cg UserAgent
userAgent
stats :: ProductId -> ClientM TwentyFourHourStats
stats :: ProductId -> ClientM TwentyFourHourStats
stats ProductId
prid = ProductId -> CBRequest TwentyFourHourStats
API.stats ProductId
prid UserAgent
userAgent
currencies :: ClientM [Currency]
currencies :: ClientM [Currency]
currencies = CBRequest [Currency]
API.currencies UserAgent
userAgent
time :: ClientM CBTime
time :: ClientM CBTime
time = CBRequest CBTime
API.time UserAgent
userAgent