About

Metadata

  • Last updated , by mdunnio
  • License MIT
  • Categories Web Development
  • Maintained by: Michael Dunn <michaelsdunn1@gmail.com>

  • Lottery factor: 0

Links

Installation

Readme

coinbase-pro

Client for Coinbase Pro REST and Websocket APIs.

Here is a list of implemented/unimplemented features:

  • Market Data
  • Private
  • Websocket Feed
  • FIX API

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.