Code Monkey home page Code Monkey logo

bittrex's Introduction

bittrex

Hackage Haskell Programming Language BSD3 License Build Status

About

Haskell bindings to the Bittrex cryptocurrency exchange.

Usage

module Main where

import           Bittrex
import           Control.Monad
import           Data.Text     (Text)
import qualified Data.Text.IO  as T

main :: IO ()
main = do
  [api,secret] <- lines <$> readFile "/Users/david/.bittrex"
  let keys = APIKeys api secret

  -- Public Usage
  putStrLn "Markets"
  Right ms <- getMarkets
  forM_ ms (print . marketName)

  putStrLn "Currencies"
  Right cs <- getCurrencies
  mapM_ print cs

  putStrLn "Ticker for BTC-DOGE market"
  t <- getTicker (MarketName BTC_DOGE)
  print t

  putStrLn "Summary of BTC-DOGE market"
  Right t <- getMarketSummary (MarketName BTC_DOGE)
  print t

  putStrLn "Get market summaries"
  Right t <- getMarketSummaries
  print t

  putStrLn "Order book sells for for BTC-DOGE market"
  book <- getOrderBookSells (MarketName BTC_DOGE)
  print book

  putStrLn "Order book buys for for BTC-DOGE market"
  book <- getOrderBookBuys (MarketName BTC_DOGE)
  print book

  putStrLn "Market history for BTC-DOGE"
  Right history <- getMarketHistory (MarketName BTC_DOGE)
  forM_ history print

  -- Market usage
  putStrLn "Retrieve your open orders"
  Right openOrders <- getOpenOrders keys (MarketName BTC_DOGE)
  forM_ openOrders print

  -- Account usage,
  putStrLn "Check your balances (for all currencies)"
  Right balances <- getBalances keys
  forM_ balances print

License

BSD3 © David Johnson

bittrex's People

Contributors

dmjio avatar jonathanlking avatar taktoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bittrex's Issues

Used fixed precision numbers

Consider Data.Decimal or Data.Fixed with 8-digit precision (for BTC), as opposed to Scientific's arbitrary precision.

New markets

New markets have been added to Bittrex, which causes a runtime error to be thrown when parsing the market names. As markets are likely to be added/removed frequently, is the best way to represent them as data type values (requiring package updates)?

Ord instance for Volume

Hi, why is an Ord instance not being derived for all of the types which deal with numbers? Is is it expected that users of this library use StandAloneDeriving, or is there a better way for sorting numbers which are retrieved?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.