Giter Club home page Giter Club logo

bittrex-scala-client's Introduction

Bittrex Scala Client

Build Status

Bittrex Scala Client is Scala library that implements fast, robust, simple and stable http client for Bittrex REST API.

Quick Start

To use Bittrex Scala Client in an existing SBT project with Scala 2.12.4, add the following dependency to your build.sbt:

libraryDependencies += "com.github.taintech" %% "bittrex-client" % "0.2"

Create instance of http client and start hacking:

val bittrexClient = BittrexClient()

For a full example of project you can have a look at this GitHub Repo.

Public API is available without any configuration.

Bittrex Scala Client implements all API methods under official documentation in Bittrex API

Market and Account API

To Use Market and Account APIs you need to create API keys under your account in Bittrex go to Settings -> Manage API Keys. Then create configuration file src/main/resources/application.conf:

bittrex-client {
  host = "bittrex.com"
  port = 443
  api-path = "/api/v1.1"
  account-key = {
    api-key = "<your-api-key>"
    api-secret = "<your-api-secret>"
  }
}

To create orders in bittrex, don't forget to whitelist your IP address in Bittrex Settings.

Under the hood

Bittrex Scala Client mostly reflects all REST calls available from Bittrex API, except few modifications. All avaiable methods are listed in BittrexClient.scala:

trait PublicApi extends RestApi {
  def getMarkets: Future[List[Market]]
  def getCurrencies: Future[List[CurrencyInfo]]
  def getTicker(market: String): Future[Ticker]
  def getMarketSummaries: Future[List[MarketSummary]]
  def getMarketSummary(market: String): Future[List[MarketSummary]]
  def getOrderBook(market: String, orderType: OrderBookType): Future[OrderBook]
  def getMarketHistory(market: String): Future[List[Trade]]
}

trait MarketApi extends RestApi {
  def buyLimit(market: String,
               quantity: BigDecimal,
               rate: BigDecimal): Future[OrderUuid]
  def sellLimit(market: String,
                quantity: BigDecimal,
                rate: BigDecimal): Future[OrderUuid]
  def cancel(orderUuid: OrderUuid): Future[Done]
  def openOrders(market: String): Future[List[OpenOrder]]
}

trait AccountApi extends RestApi {
  def getBalances: Future[List[Balance]]
  def getBalance(currency: String): Future[Balance]
  def getDepositAddress(currency: String): Future[CryptoAddress]
  def accountWithdraw(currency: String,
                      quantity: BigDecimal,
                      address: String,
                      paymentId: Option[String]): Future[OrderUuid]
  def getOrder(orderUuid: OrderUuid): Future[ClosedOrder]
  def getOrderHistory(market: Option[String]): Future[List[OrderHistory]]
  def getWithdrawalHistory(
      currency: Option[String]): Future[List[WithdrawalHistory]]
  def getDepositHistory(currency: Option[String]): Future[List[DepositHistory]]
}

Mainly used dependencies are:

License

MIT

bittrex-scala-client's People

Contributors

taintech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.