bitx-bitcoin: A Haskell library for working with the BitX bitcoin exchange.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Haskell bindings to the BitX REST API, as described here:

Note that since this library interfaces directly with a financial API, great care must be taken in its use. In particular, the author cannot be held accountable for any financial losses as a result of programming error, whether that error is in your code, the code of the author of this library, or BitX's code. This is just common sense.

If you need to make sure that nothing funny happens in the code, apart from reading the source yourself, you should also perform a few test transations with very small denominations, as I will strive to do every time before releasing a new version.

For a very small usage example, see Network.Bitcoin.BitX.Public.

[Skip to Readme]


Change log CHANGES
Dependencies aeson (>=, base (>=4.5 && <5), bytestring (>=, http-conduit (>=2.0.0), network (>=2.0), record (>=, scientific, split (>=, text, time [details]
License LicenseRef-PublicDomain
Author Tebello Thejane
Maintainer Tebello Thejane <>
Category Web, Bitcoin, Finance
Home page
Source repo head: git clone git://
Uploaded by tebello_thejane at 2015-06-10T15:05:24Z




Maintainer's Corner

For package maintainers and hackage trustees

Readme for bitx-bitcoin-

[back to package description]

Build Status Hackage

CC0 1.0 Universal (Public Domain)

(Hopefully useful) Haskell bindings to the BitX bitcoin exchange's API.

As a minimal example, to get the current selling price (in South African Rand) of bitcoin on the BitX exchange, do the following:

{-# LANGUAGE QuasiQuotes #-}

import Record.Lens (view)
import Record (lens)
import Network.Bitcoin.BitX (BitXAPIResponse(..), getTicker, CcyPair(..))
import Data.Text (unpack)
import Network.HTTP.Types.Status (Status(..))
import Network.HTTP.Conduit (responseStatus)

main :: IO ()
main = do
  bitXResponse <- getTicker XBTZAR
  case bitXResponse of
    ValidResponse tic        -> print (view [lens| ask |] tic)
    ErrorResponse err        ->
        error $ "BitX error received: \"" ++ (unpack (view [lens| error |] err)) ++ "\""
    ExceptionResponse ex     ->
        error $ "Exception was thrown: \"" ++ (unpack ex) ++ "\""
    UnparseableResponse resp ->
        error $ "Bad HTTP response; HTTP status code was: \"" ++ (show . statusCode . responseStatus $ resp) ++ "\""

Note that the code snippet above depends on http-types, http-conduit, record, and finally bitx-bitcoin.

Note that this library will not build on Windows currently, due to networking dependencies which have no Windows support.