-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Haskell wrapper for the cryptocompare API
--   
--   Haskell wrapper for the cryptocompare API, a source of information and
--   pricing of different crypto-currencies.
@package cryptocompare
@version 0.1.1


-- | A haskell wrapper for the cryptocompare API, a source of information
--   and pricing of different crypto currencies
--   
--   <pre>
--   module Main (main) where
--   
--   import CryptoCompare
--   
--   main :: IO ()
--   main = do
--     coinList &lt;- fetchCoinList
--     either print (print . length) coinList
--     either print (print . head) coinList
--     priceResp &lt;- fetchCurrentPrice "BTC" ["USD", "EUR", "BTC"]
--     print priceResp
--     priceHistResp &lt;- fetchDailyPriceHistory "BTC" "USD" 300
--     print priceHistResp
--     snapshotResp &lt;- fetchCoinSnapshot "BTC" "USD"
--     print snapshotResp
--   </pre>
module CryptoCompare

-- | Get a list of all of the coins the API is aware of, and high level
--   details about those coins
--   
--   <pre>
--   do
--     coinList &lt;- fetchCoinList
--     either print (print . length) coinList
--     either print (print . head) coinList
--   </pre>
fetchCoinList :: (MonadIO m) => m (Either String [CoinDetails])

-- | For a given coin, get the current price
--   
--   <pre>
--   do
--     priceResp &lt;- fetchCurrentPrice "BTC" ["USD", "EUR", "BTC"]
--     print priceResp
--   </pre>
fetchCurrentPrice :: MonadIO m => String -> [String] -> m (Either String PriceResponse)

-- | For a given coin, get a daily history of the coin's price
--   
--   <pre>
--   do
--     priceHistResp &lt;- fetchDailyPriceHistory "BTC" "USD" 300
--     print priceHistResp
--   </pre>
fetchDailyPriceHistory :: (MonadIO m) => String -> String -> Integer -> m (Either String PriceHistoryResponse)

-- | Fetch details about a particular coin
--   
--   <pre>
--   do
--    snapshotResp &lt;- fetchCoinSnapshot "BTC" "USD"
--    print snapshotResp
--   </pre>
fetchCoinSnapshot :: MonadIO m => String -> String -> m (Either String CoinSnapshot)

-- | High level information about each coin.
data CoinDetails
CoinDetails :: String -> String -> String -> Maybe String -> String -> String -> String -> String -> String -> String -> CoinDetails
[_key] :: CoinDetails -> String
[id] :: CoinDetails -> String
[url] :: CoinDetails -> String
[imageUrl] :: CoinDetails -> Maybe String
[name] :: CoinDetails -> String
[coinName] :: CoinDetails -> String
[fullName] :: CoinDetails -> String
[algorithm] :: CoinDetails -> String
[proofType] :: CoinDetails -> String
[sortOrder] :: CoinDetails -> String

-- | API response container for daily price history
data PriceHistoryResponse
PriceHistoryResponse :: [PriceHistoryResponseData] -> Maybe Integer -> Maybe Integer -> PriceHistoryResponse

-- | the actual response, list of price entries
[responseData] :: PriceHistoryResponse -> [PriceHistoryResponseData]

-- | latest price returned
[timeTo] :: PriceHistoryResponse -> Maybe Integer

-- | earliest price returned
[timeFrom] :: PriceHistoryResponse -> Maybe Integer

-- | Data for a particular snapshot of a coin's daily price
data PriceHistoryResponseData
PriceHistoryResponseData :: Float -> Float -> Float -> Float -> Float -> Float -> Float -> PriceHistoryResponseData
[time] :: PriceHistoryResponseData -> Float
[open] :: PriceHistoryResponseData -> Float
[high] :: PriceHistoryResponseData -> Float
[low] :: PriceHistoryResponseData -> Float
[close] :: PriceHistoryResponseData -> Float
[volumefrom] :: PriceHistoryResponseData -> Float
[volumeto] :: PriceHistoryResponseData -> Float

-- | High level data about a particular coin
data CoinSnapshot
CoinSnapshot :: String -> String -> Integer -> Float -> Float -> Float -> AggregatedSnapshot -> CoinSnapshot
[snapshotAlgorithm] :: CoinSnapshot -> String
[snapshotProofType] :: CoinSnapshot -> String
[blockNumber] :: CoinSnapshot -> Integer
[netHashesPerSecond] :: CoinSnapshot -> Float
[totalCoinsMined] :: CoinSnapshot -> Float
[blockReward] :: CoinSnapshot -> Float
[aggregatedSnapshotData] :: CoinSnapshot -> AggregatedSnapshot

-- | Aggregated data about a particular coin
data AggregatedSnapshot
AggregatedSnapshot :: String -> String -> String -> String -> Float -> Integer -> Float -> Float -> String -> Float -> Float -> Float -> Float -> Float -> String -> AggregatedSnapshot
[market] :: AggregatedSnapshot -> String
[fromSymbol] :: AggregatedSnapshot -> String
[toSymbol] :: AggregatedSnapshot -> String
[flags] :: AggregatedSnapshot -> String
[price] :: AggregatedSnapshot -> Float
[lastUpdate] :: AggregatedSnapshot -> Integer
[lastVolume] :: AggregatedSnapshot -> Float
[lastVolumeto] :: AggregatedSnapshot -> Float
[lastTradeId] :: AggregatedSnapshot -> String
[volume24Hour] :: AggregatedSnapshot -> Float
[volume24HourTo] :: AggregatedSnapshot -> Float
[open24Hour] :: AggregatedSnapshot -> Float
[high24Hour] :: AggregatedSnapshot -> Float
[low24Hour] :: AggregatedSnapshot -> Float
[lastMarket] :: AggregatedSnapshot -> String

-- | contains pairs of prices: crypto symbol -&gt; (regular currency
--   symbol, price)
newtype PriceResponse
PriceResponse :: (Map String Float) -> PriceResponse
instance GHC.Generics.Generic CryptoCompare.PriceHistoryResponse
instance GHC.Show.Show CryptoCompare.PriceHistoryResponse
instance GHC.Generics.Generic CryptoCompare.PriceHistoryResponseData
instance GHC.Show.Show CryptoCompare.PriceHistoryResponseData
instance GHC.Generics.Generic CryptoCompare.PriceResponse
instance GHC.Show.Show CryptoCompare.PriceResponse
instance GHC.Show.Show CryptoCompare.CoinSnapshotResponse
instance GHC.Show.Show CryptoCompare.CoinSnapshot
instance GHC.Show.Show CryptoCompare.AggregatedSnapshot
instance GHC.Generics.Generic CryptoCompare.CoinListResponse
instance GHC.Show.Show CryptoCompare.CoinListResponse
instance GHC.Generics.Generic CryptoCompare.CoinDetails
instance GHC.Show.Show CryptoCompare.CoinDetails
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.PriceHistoryResponse
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.PriceHistoryResponseData
instance CryptoCompare.ToQueryString CryptoCompare.PriceHistoryRequest
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.PriceResponse
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.CoinSnapshotResponse
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.CoinSnapshot
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.AggregatedSnapshot
instance CryptoCompare.ToQueryString CryptoCompare.CoinSnapshotRequest
instance CryptoCompare.ToQueryString CryptoCompare.PriceRequest
instance Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.CoinListResponse
instance Data.Aeson.Types.FromJSON.FromJSON [CryptoCompare.CoinDetails]
