From 6b2cd1f9cc595e498d7a315025aabe240263c361 Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 21:57:31 +0100 Subject: [PATCH 1/7] Update BinanceApiAsyncMarginRestClientImpl.java Adapt getMyTrades() --- .../api/client/impl/BinanceApiAsyncMarginRestClientImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java index d3e5c22f6..833fc63b2 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java @@ -68,7 +68,7 @@ public void getOrderStatus(OrderStatusRequest orderStatusRequest, BinanceApiCall @Override public void getMyTrades(String symbol, BinanceApiCallback> callback) { - binanceApiService.getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()).enqueue(new BinanceApiCallbackAdapter<>(callback)); + binanceApiService.getMyTrades(symbol, null, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()).enqueue(new BinanceApiCallbackAdapter<>(callback)); } // user stream endpoints From a93f3044dcb242502ea93d18465c23f817fa8d44 Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 21:58:29 +0100 Subject: [PATCH 2/7] Update BinanceApiAsyncRestClientImpl.java Add "orderId" to getMyTrades() --- .../api/client/impl/BinanceApiAsyncRestClientImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java index e6ea387b9..fef25593a 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java @@ -194,18 +194,18 @@ public void getAccount(BinanceApiCallback callback) { } @Override - public void getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback) { - binanceApiService.getMyTrades(symbol, limit, fromId, recvWindow, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback)); + public void getMyTrades(String symbol, Long orderId, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback) { + binanceApiService.getMyTrades(symbol, orderId, limit, fromId, recvWindow, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback)); } @Override public void getMyTrades(String symbol, Integer limit, BinanceApiCallback> callback) { - getMyTrades(symbol, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis(), callback); + getMyTrades(symbol, null, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis(), callback); } @Override public void getMyTrades(String symbol, BinanceApiCallback> callback) { - getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis(), callback); + getMyTrades(symbol, null, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis(), callback); } @Override From 36fe73a9a6e4f7db67f576c4c37474281afa291b Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 21:59:11 +0100 Subject: [PATCH 3/7] Update BinanceApiMarginRestClientImpl.java Adapt getMyTrades() --- .../api/client/impl/BinanceApiMarginRestClientImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java index 959fa2a5f..34a938e4c 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java @@ -60,7 +60,7 @@ public Order getOrderStatus(OrderStatusRequest orderStatusRequest) { @Override public List getMyTrades(String symbol) { - return executeSync(binanceApiService.getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); + return executeSync(binanceApiService.getMyTrades(symbol, null, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); } // user stream endpoints @@ -116,4 +116,4 @@ public MarginTransaction repay(String asset, String amount) { long timestamp = System.currentTimeMillis(); return executeSync(binanceApiService.repay(asset, amount, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp)); } -} \ No newline at end of file +} From b6682da3f053c958515e2fb68ce53bb58f43c545 Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 22:00:04 +0100 Subject: [PATCH 4/7] Update BinanceApiRestClientImpl.java Add "orderId" to getMyTrades() --- .../api/client/impl/BinanceApiRestClientImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java index c80c7a06d..d994e0824 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java @@ -206,25 +206,25 @@ public Account getAccount() { } @Override - public List getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp) { - return executeSync(binanceApiService.getMyTrades(symbol, limit, fromId, recvWindow, timestamp)); + public List getMyTrades(String symbol, Long orderId, Integer limit, Long fromId, Long recvWindow, Long timestamp) { + return executeSync(binanceApiService.getMyTrades(symbol, orderId, limit, fromId, recvWindow, timestamp)); } @Override public List getMyTrades(String symbol, Integer limit) { - return getMyTrades(symbol, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, + return getMyTrades(symbol, null, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()); } @Override public List getMyTrades(String symbol) { - return getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, + return getMyTrades(symbol, null, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()); } @Override public List getMyTrades(String symbol, Long fromId) { - return getMyTrades(symbol, null, fromId, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, + return getMyTrades(symbol, null, null, fromId, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()); } From aa80db073bbfce3f287d843936b7cb046d6fd6c6 Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 22:00:58 +0100 Subject: [PATCH 5/7] Update BinanceApiService.java Add orderId to getMyTrades() --- .../java/com/binance/api/client/impl/BinanceApiService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiService.java b/src/main/java/com/binance/api/client/impl/BinanceApiService.java index 5825f9844..5a35dded2 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiService.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiService.java @@ -148,7 +148,7 @@ Call> getAllOrderList(@Query("fromId") Long fromId, @Query("star @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) @GET("/api/v3/myTrades") - Call> getMyTrades(@Query("symbol") String symbol, @Query("limit") Integer limit, @Query("fromId") Long fromId, + Call> getMyTrades(@Query("symbol") String symbol, @Query("orderId") Long orderId, @Query("limit") Integer limit, @Query("fromId") Long fromId, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) From 2694db0002989ba67ab4d2dce8821b80c1b3843a Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 22:01:56 +0100 Subject: [PATCH 6/7] Update BinanceApiAsyncRestClient.java Add "orderId" to getMyTrades() --- .../binance/api/client/BinanceApiAsyncRestClient.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java b/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java index d0e3b1c01..99b903d51 100755 --- a/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java @@ -227,14 +227,15 @@ public interface BinanceApiAsyncRestClient { void getAccount(BinanceApiCallback callback); /** - * Get trades for a specific account and symbol. - * - * @param symbol symbol to get trades from + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param orderId orderId to get trades from * @param limit default 500; max 1000 * @param fromId TradeId to fetch from. Default gets most recent trades. * @param callback the callback that handles the response with a list of trades */ - void getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback); + void getMyTrades(String symbol, Long orderId, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback); /** * Get trades for a specific account and symbol. @@ -311,4 +312,4 @@ public interface BinanceApiAsyncRestClient { * @param callback the callback that handles the response which contains a listenKey */ void closeUserDataStream(String listenKey, BinanceApiCallback callback); -} \ No newline at end of file +} From 8e176a151fe3a45d9f8e8a59ca338c04072ae191 Mon Sep 17 00:00:00 2001 From: ts-00 <80713300+ts-00@users.noreply.github.com> Date: Mon, 8 Nov 2021 22:03:02 +0100 Subject: [PATCH 7/7] Update BinanceApiRestClient.java Add "orderId" to getMyTrades() --- .../api/client/BinanceApiRestClient.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/binance/api/client/BinanceApiRestClient.java b/src/main/java/com/binance/api/client/BinanceApiRestClient.java index ebe0b9667..f6dc7cd43 100755 --- a/src/main/java/com/binance/api/client/BinanceApiRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiRestClient.java @@ -231,33 +231,41 @@ public interface BinanceApiRestClient { */ Account getAccount(); + /** + * Get trades for a specific account and symbol. + * + * @param symbol symbol to get trades from + * @param orderId orderId to get trades from + * @param limit default 500; max 1000 + * @param fromId TradeId to fetch from. Default gets most recent trades. + * @return a list of trades + */ + List getMyTrades(String symbol, Long orderId, Integer limit, Long fromId, Long recvWindow, Long timestamp); + /** * Get trades for a specific account and symbol. * * @param symbol symbol to get trades from * @param limit default 500; max 1000 - * @param fromId TradeId to fetch from. Default gets most recent trades. * @return a list of trades */ - List getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp); + List getMyTrades(String symbol, Integer limit); /** * Get trades for a specific account and symbol. * * @param symbol symbol to get trades from - * @param limit default 500; max 1000 * @return a list of trades */ - List getMyTrades(String symbol, Integer limit); - + List getMyTrades(String symbol); + /** * Get trades for a specific account and symbol. - * + * * @param symbol symbol to get trades from + * @param fromId TradeId to fetch from. Default gets most recent trades. * @return a list of trades */ - List getMyTrades(String symbol); - List getMyTrades(String symbol, Long fromId); /**