Skip to content

Commit

Permalink
Merge pull request binance-exchange#63 from wiigor/master
Browse files Browse the repository at this point in the history
Fixes binance-exchange#62: Add support for setting newClientOrderId for new orders
  • Loading branch information
joaopsilva authored Feb 2, 2018
2 parents e68d438 + 9ba2c83 commit a8e1755
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ public void getBookTickers(BinanceApiCallback<List<BookTicker>> callback) {
@Override
public void newOrder(NewOrder order, BinanceApiCallback<NewOrderResponse> callback) {
binanceApiService.newOrder(order.getSymbol(), order.getSide(), order.getType(),
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getStopPrice(), order.getIcebergQty(),
order.getRecvWindow(), order.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(), order.getStopPrice(),
order.getIcebergQty(), order.getRecvWindow(), order.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
}

@Override
public void newOrderTest(NewOrder order, BinanceApiCallback<Void> callback) {
binanceApiService.newOrderTest(order.getSymbol(), order.getSide(), order.getType(),
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getStopPrice(), order.getIcebergQty(),
order.getRecvWindow(), order.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(), order.getStopPrice(),
order.getIcebergQty(), order.getRecvWindow(), order.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
}

// Account endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public List<BookTicker> getBookTickers() {
@Override
public NewOrderResponse newOrder(NewOrder order) {
return executeSync(binanceApiService.newOrder(order.getSymbol(), order.getSide(), order.getType(),
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getStopPrice(), order.getIcebergQty(),
order.getRecvWindow(), order.getTimestamp()));
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(), order.getStopPrice(),
order.getIcebergQty(), order.getRecvWindow(), order.getTimestamp()));
}

@Override
public void newOrderTest(NewOrder order) {
executeSync(binanceApiService.newOrderTest(order.getSymbol(), order.getSide(), order.getType(),
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getStopPrice(), order.getIcebergQty(),
order.getRecvWindow(), order.getTimestamp()));
order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(), order.getStopPrice(),
order.getIcebergQty(), order.getRecvWindow(), order.getTimestamp()));
}

// Account endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ Call<List<Candlestick>> getCandlestickBars(@Query("symbol") String symbol, @Quer
@POST("/api/v3/order")
Call<NewOrderResponse> newOrder(@Query("symbol") String symbol, @Query("side") OrderSide side, @Query("type") OrderType type,
@Query("timeInForce") TimeInForce timeInForce, @Query("quantity") String quantity, @Query("price") String price,
@Query("stopPrice") String stopPrice, @Query("icebergQty") String icebergQty,
@Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp);
@Query("newClientOrderId") String newClientOrderId, @Query("stopPrice") String stopPrice,
@Query("icebergQty") String icebergQty, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp);

@Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER)
@POST("/api/v3/order/test")
Call<Void> newOrderTest(@Query("symbol") String symbol, @Query("side") OrderSide side, @Query("type") OrderType type,
@Query("timeInForce") TimeInForce timeInForce, @Query("quantity") String quantity, @Query("price") String price,
@Query("stopPrice") String stopPrice, @Query("icebergQty") String icebergQty,
@Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp);
@Query("newClientOrderId") String newClientOrderId, @Query("stopPrice") String stopPrice,
@Query("icebergQty") String icebergQty, @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp);

@Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER)
@GET("/api/v3/order")
Expand Down

0 comments on commit a8e1755

Please sign in to comment.