Package com.xeiam.xchange.bittrex.v1

Examples of com.xeiam.xchange.bittrex.v1.BittrexUtils


  }

  public ArrayList<BittrexTicker> getBittrexTickers() throws IOException {

    BittrexTickersResponse response = bittrex.getTickers();

    if (response.isSuccess()) {
      return response.getTickers();
    }
    else {
      throw new ExchangeException(response.getMessage());
    }

  }
View Full Code Here


    }
  }

  public BittrexTrade[] getBittrexTrades(String pair, int count) throws IOException {

    BittrexTradesResponse response = bittrex.getTrades(pair, count);

    if (response.getSuccess()) {

      BittrexTrade[] bittrexTrades = response.getTrades();
      return bittrexTrades;
    }
    else {
      throw new ExchangeException(response.getMessage());
    }
  }
View Full Code Here

    }
  }

  public boolean cancelBittrexLimitOrder(String uuid) throws IOException {

    BittrexCancelOrderResponse response = bittrex.cancel(apiKey, signatureCreator, String.valueOf(nextNonce()), uuid);

    if (response.getSuccess()) {
      return true;
    }
    else {
      throw new ExchangeException(response.getMessage());
    }

  }
View Full Code Here

  }

  public List<BittrexOpenOrder> getBittrexOpenOrders() throws IOException {

    BittrexOpenOrdersResponse response = bittrex.openorders(apiKey, signatureCreator, String.valueOf(nextNonce()));

    if (response.getSuccess()) {
      return response.getBittrexOpenOrders();
    }
    else {
      throw new ExchangeException(response.getMessage());
    }

  }
View Full Code Here

  }

  public List<BittrexUserTrade> getBittrexTradeHistory() throws IOException {

    BittrexTradeHistoryResponse response = bittrex.getorderhistory(apiKey, signatureCreator, String.valueOf(nextNonce()));

    if (response.getSuccess()) {
      return response.getResult();
    }
    else {
      throw new ExchangeException(response.getMessage());
    }
  }
View Full Code Here

    String pair = BittrexUtils.toPairString(marketOrder.getCurrencyPair());

    if (marketOrder.getType() == OrderType.BID) {

      BittrexTradeResponse response = bittrex.buymarket(apiKey, signatureCreator, String.valueOf(nextNonce()), pair, marketOrder.getTradableAmount().toPlainString());

      if (response.getSuccess()) {
        return response.getResult().getUuid();
      }
      else {
        throw new ExchangeException(response.getMessage());
      }

    }
    else {

      BittrexTradeResponse response = bittrex.sellmarket(apiKey, signatureCreator, String.valueOf(nextNonce()), pair, marketOrder.getTradableAmount().toPlainString());

      if (response.getSuccess()) {
        return response.getResult().getUuid();
      }
      else {
        throw new ExchangeException(response.getMessage());
      }

    }
  }
View Full Code Here

  public String placeBittrexLimitOrder(LimitOrder limitOrder) throws IOException {

    String pair = BittrexUtils.toPairString(limitOrder.getCurrencyPair());

    if (limitOrder.getType() == OrderType.BID) {
      BittrexTradeResponse response =
          bittrex.buylimit(apiKey, signatureCreator, String.valueOf(nextNonce()), pair, limitOrder.getTradableAmount().toPlainString(), limitOrder.getLimitPrice().toPlainString());

      if (response.getSuccess()) {
        return response.getResult().getUuid();
      }
      else {
        throw new ExchangeException(response.getMessage());
      }

    }
    else {
      BittrexTradeResponse response =
          bittrex.selllimit(apiKey, signatureCreator, String.valueOf(nextNonce()), pair, limitOrder.getTradableAmount().toPlainString(), limitOrder.getLimitPrice().toPlainString());

      if (response.getSuccess()) {
        return response.getResult().getUuid();
      }
      else {
        throw new ExchangeException(response.getMessage());
      }
    }
  }
View Full Code Here

  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BittrexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BittrexAccountService(exchangeSpecification);
    this.pollingTradeService = new BittrexTradeService(exchangeSpecification);
  }
View Full Code Here

  @Override
  public void applySpecification(ExchangeSpecification exchangeSpecification) {

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BittrexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BittrexAccountService(exchangeSpecification);
    this.pollingTradeService = new BittrexTradeService(exchangeSpecification);
  }
View Full Code Here

    super.applySpecification(exchangeSpecification);

    this.pollingMarketDataService = new BittrexMarketDataService(exchangeSpecification);
    this.pollingAccountService = new BittrexAccountService(exchangeSpecification);
    this.pollingTradeService = new BittrexTradeService(exchangeSpecification);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.bittrex.v1.BittrexUtils

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.