Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Added missing withdraw parameters withdrawOrderId, network, transactionFeeFlag #303

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<WithdrawResult> callback);
void withdraw(String asset, String address, String amount, String name, String addressTag, String withdrawOrderId,
String network, Boolean transactionFeeFlag, BinanceApiCallback<WithdrawResult> callback);

/**
* Fetch account deposit history.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,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);

/**
* Fetch account deposit history.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ public void getMyTrades(String symbol, BinanceApiCallback<List<Trade>> callback)
}

@Override
public void withdraw(String asset, String address, String amount, String name, String addressTag, BinanceApiCallback<WithdrawResult> 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<WithdrawResult> callback) {
binanceApiService.withdraw(asset, address, amount, name, addressTag, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
System.currentTimeMillis(), withdrawOrderId, network, transactionFeeFlag)
.enqueue(new BinanceApiCallbackAdapter<>(callback));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ public List<Trade> getMyTrades(String symbol) {
}

@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()));
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ Call<List<Trade>> getMyTrades(@Query("symbol") String symbol, @Query("limit") In

@Headers(BinanceApiConstants.ENDPOINT_SECURITY_TYPE_SIGNED_HEADER)
@POST("/wapi/v3/withdraw.html")
Call<WithdrawResult> 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<WithdrawResult> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {});
}
}