use of org.knowm.xchange.bibox.dto.BiboxCommand in project XChange by knowm.
the class BiboxMarketDataServiceRaw method getBiboxOrderBooks.
public List<BiboxOrderBook> getBiboxOrderBooks(Integer depth, Collection<CurrencyPair> currencyPairs) {
try {
List<BiboxCommand<?>> allCommands = currencyPairs.stream().distinct().filter(Objects::nonNull).map(BiboxAdapters::toBiboxPair).map(pair -> new BiboxOrderBookCommand(pair, depth)).collect(Collectors.toList());
BiboxMultipleResponses<BiboxOrderBook> response = bibox.orderBooks(BiboxCommands.of(allCommands).json());
throwErrors(response);
return response.getResult().stream().map(BiboxResponse::getResult).collect(Collectors.toList());
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
use of org.knowm.xchange.bibox.dto.BiboxCommand in project XChange by knowm.
the class BiboxTradeServiceRaw method cancelBiboxOrders.
public void cancelBiboxOrders(List<String> orderIds) {
try {
List<BiboxCommand<?>> cmds = orderIds.stream().map(BiboxCancelTradeCommand::new).collect(Collectors.toList());
BiboxMultipleResponses<String> response = bibox.cancelTrades(BiboxCommands.of(cmds).json(), apiKey, signatureCreator);
throwErrors(response);
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
Aggregations