use of org.knowm.xchange.poloniex.dto.trade.PoloniexOpenOrder in project XChange by knowm.
the class PoloniexTradeService method getOpenOrders.
@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws ExchangeException, IOException {
try {
CurrencyPair currencyPair = null;
if (params instanceof OpenOrdersParamCurrencyPair) {
currencyPair = ((OpenOrdersParamCurrencyPair) params).getCurrencyPair();
}
final Map<String, PoloniexOpenOrder[]> poloniexOpenOrders;
if (currencyPair == null) {
poloniexOpenOrders = returnOpenOrders();
} else {
final PoloniexOpenOrder[] cpOpenOrders = returnOpenOrders(currencyPair);
poloniexOpenOrders = new HashMap<>(1);
poloniexOpenOrders.put(PoloniexUtils.toPairString(currencyPair), cpOpenOrders);
}
return PoloniexAdapters.adaptPoloniexOpenOrders(poloniexOpenOrders);
} catch (PoloniexException e) {
throw PoloniexErrorAdapter.adapt(e);
}
}
Aggregations