-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell wrapper for the cryptocompare API -- -- Haskell wrapper for the cryptocompare API @package cryptocompare @version 0.0.2 -- | A haskell wrapper for the cryptocompare API, a source of information -- and pricing of different crypto currencies -- --
-- module Main (main) where -- -- import CryptoCompare -- -- main :: IO () -- main = do -- coinList <- fetchCoinList -- either print (print . length) coinList -- either print (print . head) coinList -- priceResp <- fetchCurrentPrice "BTC" ["USD", "EUR", "BTC"] -- print priceResp -- priceHistResp <- fetchDailyPriceHistory "BTC" "USD" 300 -- print priceHistResp -- snapshotResp <- fetchCoinSnapshot "BTC" "USD" -- print snapshotResp --module CryptoCompare -- | Get a list of all of the coins the API is aware of, and high level -- details about those coins -- --
-- do -- coinList <- fetchCoinList -- either print (print . length) coinList -- either print (print . head) coinList --fetchCoinList :: (MonadIO m, MonadCatch m) => m (Either String [CoinDetails]) -- | For a given coin, get the current price -- --
-- do -- priceResp <- fetchCurrentPrice "BTC" ["USD", "EUR", "BTC"] -- print priceResp --fetchCurrentPrice :: (MonadIO m, MonadThrow m, MonadCatch m) => String -> [String] -> m (Either String PriceResponse) -- | For a given coin, get a daily history of the coin's price -- --
-- do -- priceHistResp <- fetchDailyPriceHistory "BTC" "USD" 300 -- print priceHistResp --fetchDailyPriceHistory :: (MonadIO m, MonadThrow m, MonadCatch m) => String -> String -> Integer -> m (Either String PriceHistoryResponse) -- | Fetch details about a particular coin -- --
-- do -- snapshotResp <- fetchCoinSnapshot "BTC" "USD" -- print snapshotResp --fetchCoinSnapshot :: (MonadIO m, MonadThrow m, MonadCatch 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 -> (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 CryptoCompare.ToQueryString CryptoCompare.PriceRequest instance CryptoCompare.ToQueryString CryptoCompare.CoinSnapshotRequest 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 Data.Aeson.Types.FromJSON.FromJSON CryptoCompare.PriceResponse 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.CoinListResponse instance Data.Aeson.Types.FromJSON.FromJSON [CryptoCompare.CoinDetails]