diff --git a/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java b/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java index 6f100a365..f2d67c923 100755 --- a/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java @@ -2,10 +2,7 @@ import com.binance.api.client.domain.TransferType; import com.binance.api.client.domain.account.*; -import com.binance.api.client.domain.account.request.CancelOrderRequest; -import com.binance.api.client.domain.account.request.CancelOrderResponse; -import com.binance.api.client.domain.account.request.OrderRequest; -import com.binance.api.client.domain.account.request.OrderStatusRequest; +import com.binance.api.client.domain.account.request.*; import java.util.List; @@ -15,6 +12,13 @@ public interface BinanceApiMarginRestClient { */ MarginAccount getAccount(); + /** + * Get all orders on margin account. + * + * @param orderRequest order request parameters + */ + List getAllOrders(AllOrdersRequest orderRequest); + /** * Get all open orders on margin account for a symbol. * diff --git a/src/main/java/com/binance/api/client/domain/account/MarginTransaction.java b/src/main/java/com/binance/api/client/domain/account/MarginTransaction.java index f08995f1d..92037ba74 100755 --- a/src/main/java/com/binance/api/client/domain/account/MarginTransaction.java +++ b/src/main/java/com/binance/api/client/domain/account/MarginTransaction.java @@ -10,6 +10,7 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class MarginTransaction { + private String clientTag; private String tranId; public String getTranId() { @@ -20,10 +21,19 @@ public void setTranId(String tranId) { this.tranId = tranId; } + public String getClientTag() { + return clientTag; + } + + public void setClientTag(String clientTag) { + this.clientTag = clientTag; + } + @Override public String toString() { return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE) - .append("transactionId", tranId) - .toString(); + .append("transactionId", tranId) + .append("clientTag", clientTag) + .toString(); } } 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..fbf448d06 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java @@ -4,10 +4,7 @@ import com.binance.api.client.constant.BinanceApiConstants; import com.binance.api.client.domain.TransferType; import com.binance.api.client.domain.account.*; -import com.binance.api.client.domain.account.request.CancelOrderRequest; -import com.binance.api.client.domain.account.request.CancelOrderResponse; -import com.binance.api.client.domain.account.request.OrderRequest; -import com.binance.api.client.domain.account.request.OrderStatusRequest; +import com.binance.api.client.domain.account.request.*; import java.util.List; @@ -58,6 +55,13 @@ public Order getOrderStatus(OrderStatusRequest orderStatusRequest) { orderStatusRequest.getRecvWindow(), orderStatusRequest.getTimestamp())); } + @Override + public List getAllOrders(AllOrdersRequest orderRequest) { + return executeSync(binanceApiService.getAllMarginOrders(orderRequest.getSymbol(), + orderRequest.getOrderId(), orderRequest.getLimit(), + orderRequest.getRecvWindow(), orderRequest.getTimestamp())); + } + @Override public List getMyTrades(String symbol) { return executeSync(binanceApiService.getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); 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..49b1413eb 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiService.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiService.java @@ -261,6 +261,11 @@ Call> getMyMarginTrades(@Query("symbol") String symbol, @Query("limi @PUT("/sapi/v1/userDataStream") Call keepAliveMarginUserDataStream(@Query("listenKey") String listenKey); + @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) + @GET("/sapi/v1/margin/allOrders") + Call> getAllMarginOrders(@Query("symbol") String symbol, @Query("orderId") Long orderId, + @Query("limit") Integer limit, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); + // Binance Liquidity Swap Pool endpoints @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_APIKEY_HEADER)