@hackage coinbase-pro0.7.1.0

Client for Coinbase Pro

coinbase-pro

Client for Coinabse Pro REST and Websocket APIS.

Here is a list of implemented/unimplemented features:

  • Market Data
    • Products
      • Get Products
      • Get Product Order Book
      • Get Product Ticker
      • Get Trades
      • Get Historic Rates
      • Get 24hr Stats
    • Currencies
      • Get Currencies
    • Time
  • Private
    • Accounts
      • List Accounts
      • Get An Account
      • Get Account History
      • Get Holds
    • Orders
      • Place a New Order
      • Cancel an Order
      • Cancel all
      • List Orders
      • Get an Order
    • Fills
      • List Fills
    • Deposits
      • Payment Method
      • Coinbase
    • Withdrawals
      • Payment Method
      • Coinbase
      • Crypto
    • Stablecoin Conversions
      • Create Conversion
    • Payment Methods
      • List Payment Methods
    • Fees
      • Get Current Fees
    • Reports
      • Create a new report
      • Get report status
    • User Account
      • Trailing Volume
  • Websocket Feed
    • Channels
      • The heartbeat channel
      • The status channel
      • The ticker channel
      • The level2 channel
      • The user channel
      • The matches channel
      • The full channel
  • FIX API
    • Messages

Request API

Market Data Requests

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

Authenticated Private Requests

runCbAuthT 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]
    forever $ Streams.read msgs >>= print

Example

Example execs can be found in src/example/