/bittrex-java-client

Java client for the bittrex.com v1.1 API

Primary LanguageJavaMIT LicenseMIT

Build Status

bittrex-java-client

Java client for the bittrex.com api. It uses the api version 1.1.

ApiSpec: https://bittrex.com/home/api

Warning! This library is fairly young and not considered stable. Use it with caution ... especially the market api.

Getting started with Maven

  1. Clone this repository
  2. Execute 'mvn install' to build the library and install it to your local maven repo
  3. Add the following dependency to your pom.xml
    <dependency>
        <groupId>de.elbatya.cryptocoins</groupId>
        <artifactId>bittrex-client</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

Examples

List all markets without credentials

    // Create a BittrexClient
    BittrexClient bittrexClient = new BittrexClient(); 

    // Perform a getMarkets request on the public api
    ApiResult<List<Market>> apiResult = bittrexClient.getPublicApi().getMarkets();
    
    // Unwrap the results
    List<Market> markets = apiResult.unwrap();

List all your open orders using credentials

    // Ceate ApiCredentials with ApiKey and Secret from bittrex.com
    ApiCredentials credentials = new ApiCredentials( 
      "YourApiKeyFromBittrex.com", 
      "YourApiKeySecretFromBittrex.com" 
    ); 
    
    // Create a BittrexClient with the ApiCredentials
    BittrexClient bittrexClient = new BittrexClient(credentials); 

    // Perform a getOpenOrders request on the market api    
    ApiResult<List<OpenOrder>> apiResult = bittrexClient.getMarketApi().getOpenOrders();
    
    // Unwrap the results
    List<OpenOrder> openOrders = apiResult.unwrap();

How to get credentials for the non-public Bittrex api

  1. Create an account at bittrex.com
  2. Enable Two-Factor-Authentication in your account settings
  3. Create an api key with the required permissions in your account settings
  4. Use the api key and secret like shown in the examples
  5. Read https://bittrex.com/home/api for more infos

Implementation Status

Public Api

  • /public/getmarkets
  • /public/getcurrencies
  • /public/getticker
  • /public/getmarketsummaries
  • /public/getmarketsummary
  • /public/getorderbook
  • /public/getmarkethistory

Market Api (Credentials required)

  • /market/buylimit
  • /market/selllimit
  • /market/cancel
  • /market/getopenorders

Account Api (Credentials required)

  • /account/getbalances
  • /account/getbalance
  • /account/getdepositaddress
  • /account/withdraw
  • /account/getorder
  • /account/getorderhistory
  • /account/getwithdrawalhistory
  • /account/getdeposithistory

Stability

  • Public Api - Basic Unit Tests
  • Market Api - Basic Unit Tests
  • Account Api - Basic Unit Tests
  • Public Api - Advanced Unit Tests
  • Market Api - Advanced Unit Tests
  • Account Api - Advanced Unit Tests
  • Public Api - Tested with production backend
  • Market Api - Tested with production backend
  • Account Api - Tested with production backend
  • Used in low budget / low risk real world applications
  • Used in real world applications

Do you like this library?