Skip to content

Commit

Permalink
[therock] added implementation for user trade history
Browse files Browse the repository at this point in the history
  • Loading branch information
andre77 committed Oct 27, 2016
1 parent 90b6972 commit 906d1ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ TheRockOrder showOrder(@PathParam("fund_id") TheRock.Pair currencyPair, @PathPar
@Path("funds/{fund_id}/trades")
TheRockUserTrades trades(@PathParam("fund_id") TheRock.Pair currencyPair, @HeaderParam(X_TRT_KEY) String publicKey,
@HeaderParam(X_TRT_SIGN) TheRockDigest signer, @HeaderParam(X_TRT_NONCE) SynchronizedValueFactory<Long> nonceFactory
, @QueryParam("trade_id") Long sinceTradeId, @QueryParam("after") Date after, @QueryParam("before") Date before)
, @QueryParam("trade_id") Long sinceTradeId, @QueryParam("after") Date after, @QueryParam("before") Date before
, @QueryParam("per_page") int perPage)
throws TheRockException, IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException
Long sinceTradeId = null; // get all trades starting from a specific trade_id
if (params instanceof TradeHistoryParamsIdSpan) {
TradeHistoryParamsIdSpan trId = (TradeHistoryParamsIdSpan) params;
sinceTradeId = Long.valueOf(trId.getStartId());
try {
sinceTradeId = Long.valueOf(trId.getStartId());
} catch (Throwable ignored) {}
}
Date after = null;
Date before = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public TheRockUserTrades getTheRockUserTrades(CurrencyPair currencyPair, Long si
try {

return theRockAuthenticated.trades(new TheRock.Pair(currencyPair), exchange.getExchangeSpecification().getApiKey(),
signatureCreator, exchange.getNonceFactory(), sinceTradeId, after, before);
signatureCreator, exchange.getNonceFactory(), sinceTradeId, after, before, 200);
} catch (Throwable e) {
throw new ExchangeException(e);
}
Expand Down

0 comments on commit 906d1ea

Please sign in to comment.