Package com.xeiam.xchange

Examples of com.xeiam.xchange.ExchangeException


    try {
      BitfinexCreditResponse[] credits = bitfinex.activeCredits(apiKey, payloadCreator, signatureCreator, new BitfinexActiveCreditsRequest(String.valueOf(nextNonce())));
      return credits;
    } catch (BitfinexException e) {
      throw new ExchangeException(e.getMessage());
    }
  }
View Full Code Here


    try {
      BitfinexActivePositionsResponse[] activePositions =
          bitfinex.activePositions(apiKey, payloadCreator, signatureCreator, new BitfinexNonceOnlyRequest("/v1/positions", String.valueOf(nextNonce())));
      return activePositions;
    } catch (BitfinexException e) {
      throw new ExchangeException(e.getMessage());
    }
  }
View Full Code Here

    CexIOTrade[] trades;

    if (args.length > 0) {
      Object arg0 = args[0];
      if (!(arg0 instanceof Number)) {
        throw new ExchangeException("arg[0] must be a Number used to represent since trade id.");
      }
      else {
        trades = getCexIOTrades(currencyPair, ((Number) arg0).longValue());
      }
    }
View Full Code Here

    CexIOOrder order =
        cexIOAuthenticated.placeOrder(limitOrder.getCurrencyPair().baseSymbol, limitOrder.getCurrencyPair().counterSymbol, exchangeSpecification.getApiKey(), signatureCreator, CexIOUtils.nextNonce(),
            (limitOrder.getType() == BID ? CexIOOrder.Type.buy : CexIOOrder.Type.sell), limitOrder.getLimitPrice(), limitOrder.getTradableAmount());
    if (order.getErrorMessage() != null) {
      throw new ExchangeException(order.getErrorMessage());
    }
    return order;
  }
View Full Code Here

    try {
      HitbtcExecutionReportResponse postHitbtcNewOrder = fillHitbtcExecutionReportResponse(limitOrder);
      return postHitbtcNewOrder.getExecutionReport();
    } catch (HitbtcException e) {
      throw new ExchangeException(e.getMessage());
    }
  }
View Full Code Here

    Integer limitAsks = null;

    if (args.length == 2) {
      Object arg0 = args[0];
      if (!(arg0 instanceof Integer)) {
        throw new ExchangeException("Argument 0 must be an Integer!");
      }
      else {
        limitBids = (Integer) arg0;
      }
      Object arg1 = args[1];
      if (!(arg1 instanceof Integer)) {
        throw new ExchangeException("Argument 1 must be an Integer!");
      }
      else {
        limitAsks = (Integer) arg1;
      }
    }
View Full Code Here

    int limitAsks = 50;

    if (args.length == 2) {
      Object arg0 = args[0];
      if (!(arg0 instanceof Integer)) {
        throw new ExchangeException("Argument 0 must be an Integer!");
      }
      else {
        limitBids = (Integer) arg0;
      }
      Object arg1 = args[1];
      if (!(arg1 instanceof Integer)) {
        throw new ExchangeException("Argument 1 must be an Integer!");
      }
      else {
        limitAsks = (Integer) arg1;
      }
    }
View Full Code Here

  public BitVcAccountInfo getBitVcAccountInfo() throws IOException {

    BitVcAccountInfo rawAccountInfo = bitvc.getAccountInfo(accessKey, nextCreated(), digest);

    if (rawAccountInfo.getMessage() != null) {
      throw new ExchangeException(rawAccountInfo.getMessage());
    }
    else {
      return rawAccountInfo;
    }
  }
View Full Code Here

  }

  private void checkRejected(HitbtcExecutionReport executionReport) {

    if ("rejected".equals(executionReport.getExecReportType()))
      throw new ExchangeException("Order rejected, " + executionReport.getOrderRejectReason());
  }
View Full Code Here

  public CexIOBalanceInfo getCexIOAccountInfo() throws IOException {

    CexIOBalanceInfo info = cexIOAuthenticated.getBalance(exchangeSpecification.getApiKey(), signatureCreator, CexIOUtils.nextNonce());
    if (info.getError() != null) {
      throw new ExchangeException("Error getting balance. " + info.getError());
    }

    return info;
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.ExchangeException

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.