String pair = BitfinexUtils.toPairString(limitOrder.getCurrencyPair());
String type = limitOrder.getType().equals(Order.OrderType.BID) ? "buy" : "sell";
String orderType = bitfinexOrderType.toString();
BitfinexNewOrderRequest request;
if (hidden) {
request = new BitfinexNewHiddenOrderRequest(String.valueOf(nextNonce()), pair, limitOrder.getTradableAmount(), limitOrder.getLimitPrice(), "bitfinex", type, orderType);
}
else {
request = new BitfinexNewOrderRequest(String.valueOf(nextNonce()), pair, limitOrder.getTradableAmount(), limitOrder.getLimitPrice(), "bitfinex", type, orderType);
}
try {
BitfinexOrderStatusResponse newOrder = bitfinex.newOrder(apiKey, payloadCreator, signatureCreator, request);
return newOrder;