Bitx.hs
(Hopefully useful) Haskell bindings to the BitX bitcoin exchange's API.
Install / Use
/learn @tebello-thejane/Bitx.hsREADME
(Hopefully useful) Haskell bindings to the Luno (formerly BitX) cryptocurrency exchange's API.
As a minimal example, to get the current selling price (in South African Rand) of Bitcoin on the Luno exchange, do the following:
import Control.Lens ((^.))
import Network.Bitcoin.BitX (BitXAPIResponse(..), getTicker, CcyPair(..))
import qualified Network.Bitcoin.BitX as BitX
import Data.Text (unpack)
import Network.HTTP.Types.Status (Status(..))
import Network.HTTP.Client (responseStatus)
main :: IO ()
main = do
bitXResponse <- getTicker XBTZAR
case bitXResponse of
ValidResponse tic ->
case tic ^. BitX.ask of
Nothing -> putStrLn "The BTC-ZAR exchange not currently have an ask price..."
Just p -> putStrLn ("1 Bitcoin will set you back ZAR" ++ show p ++ ".")
ErrorResponse err ->
error $ "BitX error received: \"" ++ unpack (err ^. BitX.error) ++ "\""
ExceptionResponse ex ->
error $ "Exception was thrown: \"" ++ show 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,
text, http-client,
lens (or any lens-compatible package, such as
microlens), and finally bitx-bitcoin.
This library is known to work on Windows, but if you wish to use it then you will have to do a bit
more work due to the Network library not building on Windows out of the box. Your best bet might be to just
use Stack.
Related Skills
gh-issues
350.8kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
350.8kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
350.8kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
