-
Notifications
You must be signed in to change notification settings - Fork 622
Update wallet endpoints #397
base: master
Are you sure you want to change the base?
Changes from 9 commits
48eb1f4
726fe31
c30872c
4dce039
338a121
3d2c8a8
06f7f46
8e09893
bbd4dae
8a9085a
32a62bf
14f98a9
7935a73
ad29066
da68260
cd92728
7ccae65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,9 @@ | |
|
||
import com.binance.api.client.domain.account.*; | ||
import com.binance.api.client.domain.account.request.*; | ||
import com.binance.api.client.domain.general.ExchangeInfo; | ||
import com.binance.api.client.domain.general.Asset; | ||
import com.binance.api.client.domain.market.AggTrade; | ||
import com.binance.api.client.domain.market.BookTicker; | ||
import com.binance.api.client.domain.market.Candlestick; | ||
import com.binance.api.client.domain.market.CandlestickInterval; | ||
import com.binance.api.client.domain.market.OrderBook; | ||
import com.binance.api.client.domain.market.TickerPrice; | ||
import com.binance.api.client.domain.market.TickerStatistics; | ||
import com.binance.api.client.domain.general.ExchangeInfo; | ||
import com.binance.api.client.domain.market.*; | ||
|
||
import java.util.List; | ||
|
||
|
@@ -265,13 +259,14 @@ public interface BinanceApiRestClient { | |
* | ||
* Enable Withdrawals option has to be active in the API settings. | ||
* | ||
* @param asset asset symbol to withdraw | ||
* @param coin asset symbol to withdraw | ||
* @param address address to withdraw to | ||
* @param amount amount to withdraw | ||
* @param name description/alias of the address | ||
* @param addressTag Secondary address identifier for coins like XRP,XMR etc. | ||
*/ | ||
WithdrawResult withdraw(String asset, String address, String amount, String name, String addressTag); | ||
WithdrawResult withdraw(String coin, String clientOrderId, String network, String address, String amount, | ||
String name, String addressTag, Boolean feeFlag); | ||
|
||
/** | ||
* Conver a list of assets to BNB | ||
|
@@ -284,14 +279,30 @@ public interface BinanceApiRestClient { | |
* | ||
* @return deposit history, containing a list of deposits | ||
*/ | ||
DepositHistory getDepositHistory(String asset); | ||
List<Deposit> getDepositHistory(String coin); | ||
|
||
/** | ||
* Fetch account deposit history. | ||
* | ||
* @return deposit history, containing a list of deposits | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Param description missing |
||
*/ | ||
List<Deposit> getDepositHistory(String coin, int status, Long startTime, Long endTime, | ||
int offset, int limit); | ||
|
||
/** | ||
* Fetch account withdraw history. | ||
* | ||
* @return withdraw history, containing a list of withdrawals | ||
*/ | ||
WithdrawHistory getWithdrawHistory(String asset); | ||
List<Withdraw> getWithdrawHistory(String coin); | ||
|
||
/** | ||
* Fetch account withdraw history. | ||
* | ||
* @return withdraw history, containing a list of withdrawals | ||
*/ | ||
List<Withdraw> getWithdrawHistory(String coin, int status, Long startTime, Long endTime, | ||
int offset, int limit); | ||
|
||
/** | ||
* Fetch sub-account transfer history. | ||
|
@@ -301,11 +312,12 @@ public interface BinanceApiRestClient { | |
List<SubAccountTransfer> getSubAccountTransfers(); | ||
|
||
/** | ||
* Fetch deposit address. | ||
* | ||
* @return deposit address for a given asset. | ||
* Fetch deposit address supported network. | ||
* @param asset coin property | ||
* @param network network property | ||
* @return deposit address for given network and asset | ||
*/ | ||
DepositAddress getDepositAddress(String asset); | ||
DepositAddress getDepositAddress(String asset, String network); | ||
|
||
// User stream endpoints | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,7 @@ | |
import com.binance.api.client.BinanceApiCallback; | ||
import com.binance.api.client.config.BinanceApiConfig; | ||
import com.binance.api.client.constant.BinanceApiConstants; | ||
import com.binance.api.client.domain.account.Account; | ||
import com.binance.api.client.domain.account.DepositAddress; | ||
import com.binance.api.client.domain.account.DepositHistory; | ||
import com.binance.api.client.domain.account.NewOrder; | ||
import com.binance.api.client.domain.account.NewOrderResponse; | ||
import com.binance.api.client.domain.account.Order; | ||
import com.binance.api.client.domain.account.Trade; | ||
import com.binance.api.client.domain.account.TradeHistoryItem; | ||
import com.binance.api.client.domain.account.WithdrawHistory; | ||
import com.binance.api.client.domain.account.WithdrawResult; | ||
import com.binance.api.client.domain.account.*; | ||
import com.binance.api.client.domain.account.request.AllOrdersRequest; | ||
import com.binance.api.client.domain.account.request.CancelOrderRequest; | ||
import com.binance.api.client.domain.account.request.CancelOrderResponse; | ||
|
@@ -209,26 +200,47 @@ 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 coin, String clientOrderId, String network, String address, String addressTag, | ||
String amount, Boolean feeFlag, String name, BinanceApiCallback<WithdrawResult> callback) { | ||
binanceApiService.withdraw(coin, clientOrderId, network, address, addressTag, amount, feeFlag, name, | ||
BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
.enqueue(new BinanceApiCallbackAdapter<>(callback)); | ||
} | ||
|
||
|
||
@Override | ||
public void getDepositHistory(String coin, BinanceApiCallback<List<Deposit>> callback) { | ||
binanceApiService.getDepositHistory(coin, 0, null, null, 0, 1000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The second parameter uses 0 (status) which will result in getting only those deposits, which status is 0 = pending. One should use null instead to get all deposits. For that you should update BinanceApiService interface and use Integer for status field in order to provide null value. |
||
BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
.enqueue(new BinanceApiCallbackAdapter<>(callback)); | ||
} | ||
|
||
@Override | ||
public void getDepositHistory(String asset, BinanceApiCallback<DepositHistory> callback) { | ||
binanceApiService.getDepositHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
public void getDepositHistory(String coin, int status, Long startTime, Long endTime, | ||
int offset, int limit, BinanceApiCallback<List<Deposit>> callback) { | ||
binanceApiService.getDepositHistory(coin, status, startTime, endTime, offset, limit, | ||
BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
.enqueue(new BinanceApiCallbackAdapter<>(callback)); | ||
} | ||
|
||
@Override | ||
public void getWithdrawHistory(String asset, BinanceApiCallback<WithdrawHistory> callback) { | ||
binanceApiService.getWithdrawHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
public void getWithdrawHistory(String coin, BinanceApiCallback<List<Withdraw>> callback) { | ||
binanceApiService.getWithdrawHistory(coin, 0, null, null, 0, 1000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing as with deposit history. Additionally the new withdrawOrderId is missing. Would be nice to have this in the branch. https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data |
||
BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
.enqueue(new BinanceApiCallbackAdapter<>(callback)); | ||
} | ||
|
||
@Override | ||
public void getWithdrawHistory(String coin, int status, Long startTime, Long endTime, | ||
int offset, int limit, BinanceApiCallback<List<Withdraw>> callback) { | ||
binanceApiService.getWithdrawHistory(coin, status, startTime, endTime, offset, limit, | ||
BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
.enqueue(new BinanceApiCallbackAdapter<>(callback)); | ||
} | ||
|
||
@Override | ||
public void getDepositAddress(String asset, BinanceApiCallback<DepositAddress> callback) { | ||
binanceApiService.getDepositAddress(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
public void getDepositAddress(String asset, String network, BinanceApiCallback<DepositAddress> callback) { | ||
binanceApiService.getDepositAddress(asset, network, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()) | ||
.enqueue(new BinanceApiCallbackAdapter<>(callback)); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all params documented