{"id":17159844,"url":"https://github.com/unhappychoice/bitmex-servant","last_synced_at":"2026-05-19T19:04:01.715Z","repository":{"id":144845965,"uuid":"195965076","full_name":"unhappychoice/bitmex-servant","owner":"unhappychoice","description":"Generated API definition by https://www.bitmex.com/api/explorer/swagger.json","archived":false,"fork":false,"pushed_at":"2019-07-22T12:17:44.000Z","size":57,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T19:49:25.669Z","etag":null,"topics":["api","bitcoin","bitmex","haskell","servant","swagger"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unhappychoice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-09T08:21:11.000Z","updated_at":"2024-12-25T23:42:54.000Z","dependencies_parsed_at":"2023-05-30T03:30:50.961Z","dependency_job_id":null,"html_url":"https://github.com/unhappychoice/bitmex-servant","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fbitmex-servant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fbitmex-servant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fbitmex-servant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unhappychoice%2Fbitmex-servant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unhappychoice","download_url":"https://codeload.github.com/unhappychoice/bitmex-servant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294768,"owners_count":20591900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bitcoin","bitmex","haskell","servant","swagger"],"created_at":"2024-10-14T22:15:16.956Z","updated_at":"2026-05-19T19:04:01.681Z","avatar_url":"https://github.com/unhappychoice.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto-Generated Swagger Bindings to `BitMEX`\n\nThe library in `lib` provides auto-generated-from-Swagger bindings to the BitMEX API.\n\n## Installation\n\nInstallation follows the standard approach to installing Stack-based projects.\n\n1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README).\n2. Run `stack install` to install this package.\n\n## Main Interface\n\nThe main interface to this library is in the `BitMEX.API` module, which exports the BitMEXBackend type. The BitMEXBackend\ntype can be used to create and define servers and clients for the API.\n\n## Creating a Client\n\nA client can be created via the `createBitMEXClient` function, which, if provided with a hostname and a port, will generate\na client that can be used to access the API if it is being served at that hostname / port combination. For example, if\n`localhost:8080` is serving the BitMEX API, you can write:\n\n```haskell\n{-# LANGUAGE RecordWildCards #-}\n\nimport BitMEX.API\n\nmain :: IO ()\nmain = do\n  BitMEXBackend{..} \u003c- createBitMEXClient (ServerConfig \"localhost\" 8080)\n  -- Any BitMEX API call can go here.\n  return ()\n```\n\n## Creating a Server\n\nIn order to create a server, you must use the `runBitMEXServer` function. However, you unlike the client, in which case you *got* a `BitMEXBackend`\nfrom the library, you must instead *provide* a `BitMEXBackend`. For example, if you have defined handler functions for all the\nfunctions in `BitMEX.Handlers`, you can write:\n\n```haskell\n{-# LANGUAGE RecordWildCards #-}\n\nimport BitMEX.API\n\n-- A module you wrote yourself, containing all handlers needed for the BitMEXBackend type.\nimport BitMEX.Handlers\n\n-- Run a BitMEX server on localhost:8080\nmain :: IO ()\nmain = do\n  let server = BitMEXBackend{..}\n  runBitMEXServer (ServerConfig \"localhost\" 8080) server\n```\n\nYou could use `optparse-applicative` or a similar library to read the host and port from command-line arguments:\n```\n{-# LANGUAGE RecordWildCards #-}\n\nmodule Main (main) where\n\nimport BitMEX.API (runBitMEXServer, BitMEXBackend(..), ServerConfig(..))\n\nimport Control.Applicative ((\u003c$\u003e), (\u003c*\u003e))\nimport Options.Applicative (execParser, option, str, auto, long, metavar, help)\n\nmain :: IO ()\nmain = do\n  config \u003c- parseArguments\n  runBitMEXServer config BitMEXBackend{}\n\n-- | Parse host and port from the command line arguments.\nparseArguments :: IO ServerConfig\nparseArguments =\n  execParser $\n    ServerConfig\n      \u003c$\u003e option str  (long \"host\" \u003c\u003e metavar \"HOST\" \u003c\u003e help \"Host to serve on\")\n      \u003c*\u003e option auto (long \"port\" \u003c\u003e metavar \"PORT\" \u003c\u003e help \"Port to serve on\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funhappychoice%2Fbitmex-servant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funhappychoice%2Fbitmex-servant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funhappychoice%2Fbitmex-servant/lists"}