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());
}
}
}