protected RuntimeException handleHttpError(HttpStatusIOException exception) throws IOException { throw new ExchangeException(exception.getHttpBody(), exception); }
public QuoineProduct[] getQuoineProducts() throws IOException { try { return quoine.getQuoineProducts(); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public QuoineOrderBook getOrderBook(int id) throws IOException { try { return quoine.getOrderBook(id); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } } }
public QuoineTradingAccountInfo[] getQuoineTradingAccountInfo() throws IOException { try { return quoine.getTradingAccountInfo(QUOINE_API_VERSION, signatureCreator, contentType); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public BitcoinAccount[] getQuoineCryptoAccountInfo() throws IOException { try { return quoine.getCryptoAccountInfo(QUOINE_API_VERSION, signatureCreator, contentType); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public QuoineAccountBalance[] getQuoineAccountBalance() throws IOException { try { return quoine.getAllBalance(QUOINE_API_VERSION, signatureCreator, contentType); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public QuoineProduct getQuoineProduct(String currencyPair) throws IOException { try { return quoine.getQuoineProduct(currencyPair); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public FiatAccount[] getQuoineFiatAccountInfo() throws IOException { try { return quoine.getFiatAccountInfo(QUOINE_API_VERSION, signatureCreator, contentType); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
protected RuntimeException handleHttpError(HttpStatusIOException exception) throws IOException { if (exception.getHttpStatusCode() == 304) { return new NonceException(exception.getHttpBody()); } else { throw exception; } }
public BitfinexPublicFundingTrade[] getBitfinexPublicFundingTrades( Currency currency, int limitTrades, long startTimestamp, long endTimestamp, int sort) throws IOException { try { return bitfinex.getPublicFundingTrades( "f" + currency.toString(), limitTrades, startTimestamp, endTimestamp, sort); } catch (HttpStatusIOException e) { throw new BitfinexException(e.getHttpBody()); } } }
public BitfinexPublicTrade[] getBitfinexPublicTrades( CurrencyPair currencyPair, int limitTrades, long startTimestamp, long endTimestamp, int sort) throws IOException { try { return bitfinex.getPublicTrades( "t" + currencyPair.base.toString() + currencyPair.counter.toString(), limitTrades, startTimestamp, endTimestamp, sort); } catch (HttpStatusIOException e) { throw new BitfinexException(e.getHttpBody()); } }
public CoinfloorOrder[] getOpenOrders(CurrencyPair pair) throws IOException { try { return coinfloor.getOpenOrders(normalise(pair.base), normalise(pair.counter)); } catch (HttpStatusIOException e) { if (e.getHttpStatusCode() == HttpURLConnection.HTTP_BAD_REQUEST) { throw new ExchangeException(e.getHttpBody(), e); } else { throw e; } } }
public boolean cancelOrder(CurrencyPair pair, long id) throws IOException { try { return coinfloor.cancelOrder(normalise(pair.base), normalise(pair.counter), id); } catch (HttpStatusIOException e) { if (e.getHttpStatusCode() == HttpURLConnection.HTTP_BAD_REQUEST) { throw new ExchangeException(e.getHttpBody(), e); } else { throw e; } } } }
public CoinfloorOrder placeLimitOrder( CurrencyPair pair, OrderType side, BigDecimal amount, BigDecimal price) throws IOException { Currency base = normalise(pair.base); Currency counter = normalise(pair.counter); try { if (side == OrderType.BID) { return coinfloor.buy(base, counter, amount, price); } else { return coinfloor.sell(base, counter, amount, price); } } catch (HttpStatusIOException e) { if (e.getHttpStatusCode() == HttpURLConnection.HTTP_BAD_REQUEST) { // e.g. if too many decimal places are specified in the quantity field the HTTP body // contains the message: "amount" parameter must not have more than 4 fractional digits throw new ExchangeException(e.getHttpBody(), e); } else { throw e; } } }
public CoinfloorMarketOrderResponse placeMarketOrder( CurrencyPair pair, OrderType side, BigDecimal amount) throws IOException { Currency base = normalise(pair.base); Currency counter = normalise(pair.counter); try { if (side == OrderType.BID) { return coinfloor.buyMarket(base, counter, amount); } else { return coinfloor.sellMarket(base, counter, amount); } } catch (HttpStatusIOException e) { if (e.getHttpStatusCode() == HttpURLConnection.HTTP_BAD_REQUEST) { // e.g. if too many decimal places are specified in the quantity field the HTTP body // contains the message: "quantity" parameter must not have more than 4 fractional digits throw new ExchangeException(e.getHttpBody(), e); } else { throw e; } } }
public CoinfloorUserTransaction[] getUserTransactions( CurrencyPair pair, Integer numberOfTransactions, Long offset, TradeHistoryParamsSorted.Order sort) throws IOException { try { return coinfloor.getUserTransactions( normalise(pair.base), normalise(pair.counter), numberOfTransactions, offset, sort == null ? null : sort.toString()); } catch (HttpStatusIOException e) { if (e.getHttpStatusCode() == HttpURLConnection.HTTP_BAD_REQUEST) { throw new ExchangeException(e.getHttpBody(), e); } else { throw e; } } }
/** * Corresponds to <code>GET /fills</code> * * @return * @throws IOException */ public AbucoinsFills getAbucoinsFills(String afterCursor, Integer limit) throws IOException { try { AbucoinsFills fills = abucoinsAuthenticated.getFills( exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp(), afterCursor, limit); return fills; } catch (HttpStatusIOException initialException) { // in case of error Abucoins returns HTTP status 200 with a single property JSON try { AbucoinsError error = ObjectMapperHelper.readValue(initialException.getHttpBody(), AbucoinsError.class); throw new ExchangeException(error.getMessage()); } catch (IOException finalException) { throw new ExportException( "Response neither expected DTO nor error message", finalException); } } } }
public QuoineProduct getQuoineProduct(String currencyPair) throws IOException { try { return quoine.getQuoineProduct(currencyPair); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public QuoineTradingAccountInfo[] getQuoineTradingAccountInfo() throws IOException { try { return quoine.getTradingAccountInfo(QUOINE_API_VERSION, signatureCreator, contentType); } catch (HttpStatusIOException e) { throw new ExchangeException(e.getHttpBody(), e); } }
public BitfinexPublicFundingTrade[] getBitfinexPublicFundingTrades( Currency currency, int limitTrades, long startTimestamp, long endTimestamp, int sort) throws IOException { try { return bitfinex.getPublicFundingTrades( "f" + currency.toString(), limitTrades, startTimestamp, endTimestamp, sort); } catch (HttpStatusIOException e) { throw new BitfinexException(e.getHttpBody()); } } }