coinbase-pro: Client for Coinbase Pro

[ finance, library, mit, program, web ] [ Propose Tags ]

Client for Coinbase Pro REST and Websocket APIs


[Skip to Readme]
Versions [RSS] [faq] 0.5.0.0, 0.6.0.0, 0.7.0.0, 0.7.1.0, 0.7.2.0, 0.8.0.0, 0.9.0.0, 0.9.1.0, 0.9.2.0, 0.9.2.2, 0.9.3.0
Change log changelog.md
Dependencies aeson (>=1.2 && <1.6), aeson-casing (>=0.1 && <0.3), async (>=2.1 && <2.3), base (>=4.7 && <5), binary (==0.8.*), bytestring (==0.10.*), coinbase-pro, containers (>=0.5 && <0.7), cryptonite (>=0.24 && <0.30), exceptions (>=0.4 && <1.0), HsOpenSSL (==0.11.*), http-api-data (>=0.3 && <0.5), http-client (>=0.5 && <0.7), http-client-tls (==0.3.*), http-streams (==0.8.*), http-types (==0.12.*), io-streams (==1.5.*), memory (>=0.14 && <0.16), network (>=2.6 && <3.2), servant (>=0.14 && <0.19), servant-client (>=0.14 && <0.19), servant-client-core (>=0.14 && <0.19), tasty (>=1.2.2), tasty-hunit (>=0.10), text (==1.2.*), time (>=1.8 && <2.0), transformers (==0.5.*), unagi-streams (==0.2.*), unordered-containers (==0.2.*), uuid (==1.3.*), vector (==0.12.*), websockets (==0.12.*), wuss (==1.1.*) [details]
License MIT
Copyright 2021 Michael Dunn <michaelsdunn1@gmail.com>
Author Michael Dunn <michaelsdunn1@gmail.com>
Maintainer Michael Dunn <michaelsdunn1@gmail.com>
Category Web, Finance
Home page https://github.com/mdunnio/coinbase-pro#readme
Bug tracker https://github.com/mdunnio/coinbase-pro/issues
Source repo head: git clone https://github.com/mdunnio/coinbase-pro
Uploaded by mdunnio at 2021-08-29T05:39:57Z
Distributions NixOS:0.9.3.0
Executables test-stream, test-request
Downloads 2402 total (78 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
All reported builds failed as of 2021-08-29 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates


Readme for coinbase-pro-0.9.3.0

[back to package description]

coinbase-pro

Client for Coinbase Pro REST and Websocket APIs.

Here is a list of implemented/unimplemented features:

  • Market Data
    • [x] Products
      • [x] Get Products
      • [x] Get Product Order Book
      • [x] Get Product Ticker
      • [x] Get Trades
      • [x] Get Historic Rates
      • [x] Get 24hr Stats
    • [x] Currencies
      • [x] Get Currencies
    • [x] Time
  • Private
    • [x] Accounts
      • [x] List Accounts
      • [x] Get An Account
      • [x] Get Account History
      • [x] Get Holds
    • [x] Orders
      • [x] Place a New Order
      • [x] Cancel an Order
      • [x] Cancel all
      • [x] List Orders
      • [x] Get an Order
    • [x] Fills
      • [x] List Fills
    • [x] Limits
      • [x] Get Current Exchange Limits
    • [x] Deposits
      • [x] List Deposits
      • [x] Single Deposit
      • [x] Payment Method
      • [x] Coinbase
      • [x] Generate a Crypto Deposit Address
    • [x] Withdrawals
      • [x] List Withdrawals
      • [x] Single Withdrawal
      • [x] Payment Method
      • [x] Coinbase
      • [x] Crypto
      • [x] Fee Estimate
    • [x] Stablecoin Conversions
      • [x] Create Conversion
    • [x] Payment Methods
      • [x] List Payment Methods
    • [x] Coinbase Accounts
      • [x] List Accounts
    • [x] Fees
      • [x] Get Current Fees
    • [x] Reports
      • [x] Create a new report
      • [x] Get report status
    • [x] Profiles
      • [x] List Profiles
      • [x] Get a Profile
      • [x] Create a Profile Transfer
    • [x] User Account
      • [x] Trailing Volume
    • [ ] Margin (Disabled)[https://blog.coinbase.com/coinbase-pro-disables-margin-trading-42f5862f8a66]
    • [x] Oracle
      • [x] Get Oracle
  • Websocket Feed
    • [x] Channels
      • [x] The heartbeat channel
      • [x] The status channel
      • [x] The ticker channel
      • [x] The level2 channel
      • [x] The user channel
      • [x] The matches channel
      • [x] The full channel
  • FIX API
    • [ ] Messages

Request API

Market Data Requests

run Sandbox (trades (ProductId "BTC-USD")) >>= print

Authenticated Private Requests

runDefCbAuthT Sandbox cpc $ do
    fills (Just btcusd) Nothing >>= liftIO . print
  where
    accessKey  = CBAccessKey "<access-key>"
    secretKey  = CBSecretKey "<secret-key>"
    passphrase = CBAccessPassphrase "<passphrase>"
    cpc        = CoinbaseProCredentials accessKey secretKey passphrase

Websocket API

To print out all of the full order book updates for BTC-USD:

main :: IO ()
main = do
    msgs <- subscribeToFeed [ProductId "BTC-USD"] [Ticker] Nothing
    forever $ Streams.read msgs >>= print

Example

Example execs can be found in src/example/

Run Example

To run any of the authenticated endpoints in test-request, the access key, secret key, and passphrase must be provided. See Authenticated Private Requests above.