use of org.knowm.xchange.bibox.BiboxException in project XChange by knowm.
the class BiboxAccountServiceRaw method getBiboxAccountInfo.
public List<BiboxAsset> getBiboxAccountInfo() {
try {
BiboxSingleResponse<BiboxAssetsResult> response = bibox.assets(ASSETS_CMD.json(), apiKey, signatureCreator);
throwErrors(response);
return response.get().getResult().getAssets_list();
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
use of org.knowm.xchange.bibox.BiboxException in project XChange by knowm.
the class BiboxMarketDataServiceRaw method getBiboxOrderBook.
public BiboxOrderBook getBiboxOrderBook(CurrencyPair currencyPair, Integer depth) throws IOException {
try {
BiboxResponse<BiboxOrderBook> response = bibox.orderBook(DEPTH_CMD, BiboxAdapters.toBiboxPair(currencyPair), depth);
throwErrors(response);
return response.getResult();
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
use of org.knowm.xchange.bibox.BiboxException in project XChange by knowm.
the class BiboxMarketDataServiceRaw method getBiboxTicker.
public BiboxTicker getBiboxTicker(CurrencyPair currencyPair) throws IOException {
try {
BiboxResponse<BiboxTicker> response = bibox.mdata(TICKER_CMD, toBiboxPair(currencyPair));
throwErrors(response);
return response.getResult();
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
use of org.knowm.xchange.bibox.BiboxException 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.BiboxException in project XChange by knowm.
the class BiboxTradeServiceRaw method getBiboxOrderHistory.
public BiboxOrders getBiboxOrderHistory() {
try {
BiboxOrderPendingListCommandBody body = new BiboxOrderPendingListCommandBody(1, // wonder if this actually works
Integer.MAX_VALUE);
BiboxOrderHistoryCommand cmd = new BiboxOrderHistoryCommand(body);
BiboxSingleResponse<BiboxOrders> response = bibox.orderPendingList(BiboxCommands.of(cmd).json(), apiKey, signatureCreator);
throwErrors(response);
return response.get().getResult();
} catch (BiboxException e) {
throw new ExchangeException(e.getMessage());
}
}
Aggregations