diff --git a/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java b/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java index d0e3b1c01..632860ac9 100755 --- a/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiAsyncRestClient.java @@ -264,7 +264,8 @@ public interface BinanceApiAsyncRestClient { * @param name description/alias of the address * @param addressTag Secondary address identifier for coins like XRP,XMR etc. */ - void withdraw(String asset, String address, String amount, String name, String addressTag, BinanceApiCallback callback); + void withdraw(String asset, String address, String amount, String name, String addressTag, String withdrawOrderId, + String network, Boolean transactionFeeFlag, BinanceApiCallback callback); /** * Fetch account deposit history. diff --git a/src/main/java/com/binance/api/client/BinanceApiRestClient.java b/src/main/java/com/binance/api/client/BinanceApiRestClient.java index ebe0b9667..23978e377 100755 --- a/src/main/java/com/binance/api/client/BinanceApiRestClient.java +++ b/src/main/java/com/binance/api/client/BinanceApiRestClient.java @@ -270,8 +270,11 @@ public interface BinanceApiRestClient { * @param amount amount to withdraw * @param name description/alias of the address * @param addressTag Secondary address identifier for coins like XRP,XMR etc. + * @param withdrawOrderId client customize id for withdraw order + * @param network the transfer network + * @param transactionFeeFlag When making internal transfer, true for returning the fee to the destination account; false for returning the fee back to the departure account. Default false. */ - WithdrawResult withdraw(String asset, String address, String amount, String name, String addressTag); + WithdrawResult withdraw(String asset, String address, String amount, String name, String addressTag, String withdrawOrderId, String network, Boolean transactionFeeFlag); /** * Conver a list of assets to BNB 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..9a7e11be0 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java @@ -209,8 +209,10 @@ public void getMyTrades(String symbol, BinanceApiCallback> callback) } @Override - public void withdraw(String asset, String address, String amount, String name, String addressTag, BinanceApiCallback callback) { - binanceApiService.withdraw(asset, address, amount, name, addressTag, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) + public void withdraw(String asset, String address, String amount, String name, String addressTag, String withdrawOrderId, + String network, Boolean transactionFeeFlag, BinanceApiCallback callback) { + binanceApiService.withdraw(asset, address, amount, name, addressTag, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, + System.currentTimeMillis(), withdrawOrderId, network, transactionFeeFlag) .enqueue(new BinanceApiCallbackAdapter<>(callback)); } 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..e46931a9a 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java @@ -228,11 +228,11 @@ public List getMyTrades(String symbol, Long fromId) { System.currentTimeMillis()); } - @Override - public WithdrawResult withdraw(String asset, String address, String amount, String name, String addressTag) { - return executeSync(binanceApiService.withdraw(asset, address, amount, name, addressTag, - BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())); - } + @Override + public WithdrawResult withdraw(String asset, String address, String amount, String name, String addressTag, String withdrawOrderId, String network, Boolean transactionFeeFlag) { + return executeSync(binanceApiService.withdraw(asset, address, amount, name, addressTag, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, + System.currentTimeMillis(), withdrawOrderId, network, transactionFeeFlag)); + } @Override public DustTransferResponse dustTranfer(List asset) { 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..4a614cd2c 100755 --- a/src/main/java/com/binance/api/client/impl/BinanceApiService.java +++ b/src/main/java/com/binance/api/client/impl/BinanceApiService.java @@ -153,8 +153,11 @@ Call> getMyTrades(@Query("symbol") String symbol, @Query("limit") In @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) @POST("/wapi/v3/withdraw.html") - Call withdraw(@Query("asset") String asset, @Query("address") String address, @Query("amount") String amount, @Query("name") String name, @Query("addressTag") String addressTag, - @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp); + Call withdraw(@Query("asset") String asset, @Query("address") String address, @Query("amount") String amount, + @Query("name") String name, @Query("addressTag") String addressTag, + @Query("recvWindow") Long recvWindow, @Query("timestamp") Long timestamp, + @Query("withdrawOrderId") String withdrawOrderId, @Query("network") String network, + @Query("transactionFeeFlag") Boolean transactionFeeFlag); @Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER) diff --git a/src/test/java/com/binance/api/examples/AccountEndpointsExample.java b/src/test/java/com/binance/api/examples/AccountEndpointsExample.java index 72fc68c3d..b012d5972 100755 --- a/src/test/java/com/binance/api/examples/AccountEndpointsExample.java +++ b/src/test/java/com/binance/api/examples/AccountEndpointsExample.java @@ -35,6 +35,6 @@ public static void main(String[] args) { System.out.println(client.getDepositAddress("ETH")); // Withdraw - client.withdraw("ETH", "0x123", "0.1", null, null); + client.withdraw("ETH", "0x123", "0.1", null, null, null, null, null); } } diff --git a/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java b/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java index 5ede0526b..33a9cb338 100755 --- a/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java +++ b/src/test/java/com/binance/api/examples/AccountEndpointsExampleAsync.java @@ -26,6 +26,6 @@ public static void main(String[] args) { client.getDepositHistory("ETH", response -> System.out.println(response)); // Withdraw (async) - client.withdraw("ETH", "0x123", "0.1", null, null, response -> {}); + client.withdraw("ETH", "0x123", "0.1", null, null, null, null, null, response -> {}); } }