> callback);
@@ -89,16 +90,16 @@ public interface BinanceApiAsyncRestClient {
/**
* Get compressed, aggregate trades. Trades that fill at the time, from the same order, with
* the same price will have the quantity aggregated.
- *
+ *
* If both startTime and endTime are sent, limitshould not
* be sent AND the distance between startTime and endTime must be less than 24 hours.
*
- * @param symbol symbol to aggregate (mandatory)
- * @param fromId ID to get aggregate trades from INCLUSIVE (optional)
- * @param limit Default 500; max 1000 (optional)
+ * @param symbol symbol to aggregate (mandatory)
+ * @param fromId ID to get aggregate trades from INCLUSIVE (optional)
+ * @param limit Default 500; max 1000 (optional)
* @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE (optional).
- * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE (optional).
- * @param callback the callback that handles the response
+ * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE (optional).
+ * @param callback the callback that handles the response
* @return a list of aggregate trades for the given symbol
*/
void getAggTrades(String symbol, String fromId, Integer limit, Long startTime, Long endTime, BinanceApiCallback> callback);
@@ -113,12 +114,12 @@ public interface BinanceApiAsyncRestClient {
/**
* Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
*
- * @param symbol symbol to aggregate (mandatory)
- * @param interval candlestick interval (mandatory)
- * @param limit Default 500; max 1000 (optional)
+ * @param symbol symbol to aggregate (mandatory)
+ * @param interval candlestick interval (mandatory)
+ * @param limit Default 500; max 1000 (optional)
* @param startTime Timestamp in ms to get candlestick bars from INCLUSIVE (optional).
- * @param endTime Timestamp in ms to get candlestick bars until INCLUSIVE (optional).
- * @param callback the callback that handles the response containing a candlestick bar for the given symbol and interval
+ * @param endTime Timestamp in ms to get candlestick bars until INCLUSIVE (optional).
+ * @param callback the callback that handles the response containing a candlestick bar for the given symbol and interval
*/
void getCandlestickBars(String symbol, CandlestickInterval interval, Integer limit, Long startTime, Long endTime, BinanceApiCallback> callback);
@@ -132,32 +133,32 @@ public interface BinanceApiAsyncRestClient {
/**
* Get 24 hour price change statistics (asynchronous).
*
- * @param symbol ticker symbol (e.g. ETHBTC)
+ * @param symbol ticker symbol (e.g. ETHBTC)
* @param callback the callback that handles the response
*/
void get24HrPriceStatistics(String symbol, BinanceApiCallback callback);
-
+
/**
* Get 24 hour price change statistics for all symbols (asynchronous).
- *
+ *
* @param callback the callback that handles the response
*/
- void getAll24HrPriceStatistics(BinanceApiCallback> callback);
+ void getAll24HrPriceStatistics(BinanceApiCallback> callback);
/**
- * Get Latest price for all symbols (asynchronous).
+ * Get the latest price for all symbols (asynchronous).
*
* @param callback the callback that handles the response
*/
void getAllPrices(BinanceApiCallback> callback);
-
+
/**
- * Get latest price for symbol (asynchronous).
- *
- * @param symbol ticker symbol (e.g. ETHBTC)
+ * Get the latest price for symbol (asynchronous).
+ *
+ * @param symbol ticker symbol (e.g. ETHBTC)
* @param callback the callback that handles the response
*/
- void getPrice(String symbol , BinanceApiCallback callback);
+ void getPrice(String symbol, BinanceApiCallback callback);
/**
* Get best price/qty on the order book for all symbols (asynchronous).
@@ -171,7 +172,7 @@ public interface BinanceApiAsyncRestClient {
/**
* Send in a new order (asynchronous)
*
- * @param order the new order to submit.
+ * @param order the new order to submit.
* @param callback the callback that handles the response
*/
void newOrder(NewOrder order, BinanceApiCallback callback);
@@ -179,7 +180,7 @@ public interface BinanceApiAsyncRestClient {
/**
* Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.
*
- * @param order the new TEST order to submit.
+ * @param order the new TEST order to submit.
* @param callback the callback that handles the response
*/
void newOrderTest(NewOrder order, BinanceApiCallback callback);
@@ -188,7 +189,7 @@ public interface BinanceApiAsyncRestClient {
* Check an order's status (asynchronous).
*
* @param orderStatusRequest order status request parameters
- * @param callback the callback that handles the response
+ * @param callback the callback that handles the response
*/
void getOrderStatus(OrderStatusRequest orderStatusRequest, BinanceApiCallback callback);
@@ -196,7 +197,7 @@ public interface BinanceApiAsyncRestClient {
* Cancel an active order (asynchronous).
*
* @param cancelOrderRequest order status request parameters
- * @param callback the callback that handles the response
+ * @param callback the callback that handles the response
*/
void cancelOrder(CancelOrderRequest cancelOrderRequest, BinanceApiCallback callback);
@@ -204,7 +205,7 @@ public interface BinanceApiAsyncRestClient {
* Get all open orders on a symbol (asynchronous).
*
* @param orderRequest order request parameters
- * @param callback the callback that handles the response
+ * @param callback the callback that handles the response
*/
void getOpenOrders(OrderRequest orderRequest, BinanceApiCallback> callback);
@@ -212,7 +213,7 @@ public interface BinanceApiAsyncRestClient {
* Get all account orders; active, canceled, or filled.
*
* @param orderRequest order request parameters
- * @param callback the callback that handles the response
+ * @param callback the callback that handles the response
*/
void getAllOrders(AllOrdersRequest orderRequest, BinanceApiCallback> callback);
@@ -226,12 +227,24 @@ public interface BinanceApiAsyncRestClient {
*/
void getAccount(BinanceApiCallback callback);
+ /**
+ * Get User account information.
+ *
+ * @param asset When specified, include only the given asset. When null, get
+ * balances for all assets
+ * @param needBtcValuation When true, include value in BTC for each asset.
+ * @return A list of all user assets with non-zero balances (or only the one asset,
+ * when specified)
+ */
+ void getUserAssets(String asset, boolean needBtcValuation,
+ BinanceApiCallback> callback);
+
/**
* Get trades for a specific account and symbol.
*
- * @param symbol symbol to get trades from
- * @param limit default 500; max 1000
- * @param fromId TradeId to fetch from. Default gets most recent trades.
+ * @param symbol symbol to get trades from
+ * @param limit default 500; max 1000
+ * @param fromId TradeId to fetch from. Default gets most recent trades.
* @param callback the callback that handles the response with a list of trades
*/
void getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback);
@@ -239,8 +252,8 @@ public interface BinanceApiAsyncRestClient {
/**
* Get trades for a specific account and symbol.
*
- * @param symbol symbol to get trades from
- * @param limit default 500; max 1000
+ * @param symbol symbol to get trades from
+ * @param limit default 500; max 1000
* @param callback the callback that handles the response with a list of trades
*/
void getMyTrades(String symbol, Integer limit, BinanceApiCallback> callback);
@@ -248,44 +261,104 @@ public interface BinanceApiAsyncRestClient {
/**
* Get trades for a specific account and symbol.
*
- * @param symbol symbol to get trades from
+ * @param symbol symbol to get trades from
* @param callback the callback that handles the response with a list of trades
*/
void getMyTrades(String symbol, BinanceApiCallback> callback);
/**
- * Submit a withdraw request.
+ * Submit a withdrawal request.
+ * Withdrawals option has to be active in the API settings.
*
- * Enable Withdrawals option has to be active in the API settings.
- *
- * @param asset 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.
- */
- void withdraw(String asset, String address, String amount, String name, String addressTag, BinanceApiCallback callback);
+ * @param coin asset symbol to withdraw
+ * @param withdrawOrderId client id for withdraw
+ * @param network the network to use for the withdrawal
+ * @param address address to withdraw to
+ * @param addressTag Secondary address identifier for coins like XRP,XMR etc.
+ * @param amount amount to withdraw
+ * @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.
+ * @param name Description of the address. Space in name should be encoded into %20.
+ * @param callback the callback that handles the response with a list of trades
+ */
+ void withdraw(String coin, String withdrawOrderId, String network, String address,
+ String addressTag, String amount, Boolean transactionFeeFlag, String name,
+ BinanceApiCallback callback);
/**
* Fetch account deposit history.
*
+ * @param coin the asset to get the history for
* @param callback the callback that handles the response and returns the deposit history
*/
- void getDepositHistory(String asset, BinanceApiCallback callback);
+ void getDepositHistory(String coin, BinanceApiCallback> callback);
+
+
+ /**
+ * Fetch account deposit history.
+ *
+ * @param coin the asset to get the history for
+ * @param status Status, with the following values:
+ * - 0: pending
+ * - 6: credited but cannot withdraw
+ * - 1: success
+ * @param startTime Start timestamp, including milliseconds. Default: 90 days before current
+ * timestamp
+ * @param endTime End timestamp, including milliseconds. Default: present timestamp
+ * @param offset Default:0
+ * @param limit Default:1000, Max:1000
+ * @param callback the callback that handles the response and returns the deposit history
+ */
+ void getDepositHistory(String coin, Integer status, Long startTime, Long endTime,
+ Integer offset, Integer limit, BinanceApiCallback> callback);
/**
* Fetch account withdraw history.
+ * See https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
+ * Comments from the docs:
+ * Please notice the default startTime and endTime to make sure that time interval is within 0-90 days.
+ * If both startTime and endTime are sent, time between startTime and endTime must be less than 90 days.
+ * If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days.
+ * If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default.
*
- * @param callback the callback that handles the response and returns the withdraw history
+ * @param coin
+ * @param withdrawOrderId
+ * @param status When specified, filter by transaction status:
+ * - 0:Email Sent
+ * - 1:Cancelled
+ * - 2:Awaiting Approval
+ * - 3:Rejected
+ * - 4:Processing
+ * - 5:Failure
+ * - 6:Completed
+ * @param offset
+ * @param limit Default: 1000, Max: 1000
+ * @param startTime Default: 90 days from current timestamp
+ * @param endTime Default: present timestamp
+ * @param callback the callback that handles the response and returns the withdrawal history
+ */
+ void getWithdrawHistory(String coin, String withdrawOrderId, Integer status,
+ Integer offset, Integer limit, Long startTime, Long endTime,
+ BinanceApiCallback> callback);
+
+ /**
+ * Fetch account withdraw history.
+ *
+ * @param coin The coin in the withdrawals
+ * @param callback the callback that handles the response and returns the withdrawal history
*/
- void getWithdrawHistory(String asset, BinanceApiCallback callback);
+ void getWithdrawHistory(String coin,
+ BinanceApiCallback> callback);
/**
* Fetch deposit address.
*
+ * @param asset The asset for which to check the deposit address
+ * @param network The network to use for deposit
* @param callback the callback that handles the response and returns the deposit address
*/
- void getDepositAddress(String asset, BinanceApiCallback callback);
+ void getDepositAddress(String asset, String network, BinanceApiCallback callback);
// User stream endpoints
@@ -300,7 +373,7 @@ public interface BinanceApiAsyncRestClient {
* PING a user data stream to prevent a time out.
*
* @param listenKey listen key that identifies a data stream
- * @param callback the callback that handles the response which contains a listenKey
+ * @param callback the callback that handles the response which contains a listenKey
*/
void keepAliveUserDataStream(String listenKey, BinanceApiCallback callback);
@@ -308,7 +381,7 @@ public interface BinanceApiAsyncRestClient {
* Close out a new user data stream.
*
* @param listenKey listen key that identifies a data stream
- * @param callback the callback that handles the response which contains a listenKey
+ * @param callback the callback that handles the response which contains a listenKey
*/
void closeUserDataStream(String listenKey, BinanceApiCallback callback);
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/BinanceApiCallback.java b/src/main/java/com/binance/api/client/BinanceApiCallback.java
index 3112bd793..d15528ad1 100755
--- a/src/main/java/com/binance/api/client/BinanceApiCallback.java
+++ b/src/main/java/com/binance/api/client/BinanceApiCallback.java
@@ -8,17 +8,18 @@
@FunctionalInterface
public interface BinanceApiCallback {
- /**
- * Called whenever a response comes back from the Binance API.
- *
- * @param response the expected response object
- */
- void onResponse(T response);
+ /**
+ * Called whenever a response comes back from the Binance API.
+ *
+ * @param response the expected response object
+ */
+ void onResponse(T response);
- /**
- * Called whenever an error occurs.
- *
- * @param cause the cause of the failure
- */
- default void onFailure(Throwable cause) {}
+ /**
+ * Called whenever an error occurs.
+ *
+ * @param cause the cause of the failure
+ */
+ default void onFailure(Throwable cause) {
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/BinanceApiClientFactory.java b/src/main/java/com/binance/api/client/BinanceApiClientFactory.java
index 7ba5551bb..8a258caed 100755
--- a/src/main/java/com/binance/api/client/BinanceApiClientFactory.java
+++ b/src/main/java/com/binance/api/client/BinanceApiClientFactory.java
@@ -2,6 +2,7 @@
import com.binance.api.client.impl.*;
import com.binance.api.client.config.BinanceApiConfig;
+import com.binance.api.client.security.ApiCredentials;
import static com.binance.api.client.impl.BinanceApiServiceGenerator.getSharedClient;
/**
@@ -35,16 +36,17 @@ private BinanceApiClientFactory(String apiKey, String secret) {
/**
* Instantiates a new binance api client factory.
*
- * @param apiKey the API key
- * @param secret the Secret
- * @param useTestnet true if endpoint is spot test network URL; false if endpoint is production spot API URL.
+ * @param apiKey the API key
+ * @param secret the Secret
+ * @param useTestnet true if endpoint is spot test network URL; false if endpoint is production spot API URL.
* @param useTestnetStreaming true for spot test network websocket streaming; false for no streaming.
*/
private BinanceApiClientFactory(String apiKey, String secret, boolean useTestnet, boolean useTestnetStreaming) {
- this(apiKey, secret);
- if (useTestnet) {
- BinanceApiConfig.useTestnet = true;
- BinanceApiConfig.useTestnetStreaming = useTestnetStreaming; }
+ this(apiKey, secret);
+ if (useTestnet) {
+ BinanceApiConfig.useTestnet = true;
+ BinanceApiConfig.useTestnetStreaming = useTestnetStreaming;
+ }
}
/**
@@ -52,25 +54,33 @@ private BinanceApiClientFactory(String apiKey, String secret, boolean useTestnet
*
* @param apiKey the API key
* @param secret the Secret
- *
* @return the binance api client factory
*/
public static BinanceApiClientFactory newInstance(String apiKey, String secret) {
return new BinanceApiClientFactory(apiKey, secret);
}
+ /**
+ * Create a new instance.
+ *
+ * @param credentials Credentials - the API key and secret
+ * @return the binance api client factory
+ */
+ public static BinanceApiClientFactory newInstance(ApiCredentials credentials) {
+ return new BinanceApiClientFactory(credentials.getKey(), credentials.getSecret());
+ }
+
/**
* New instance with optional Spot Test Network endpoint.
*
- * @param apiKey the API key
- * @param secret the Secret
- * @param useTestnet true if endpoint is spot test network URL; false if endpoint is production spot API URL.
+ * @param apiKey the API key
+ * @param secret the Secret
+ * @param useTestnet true if endpoint is spot test network URL; false if endpoint is production spot API URL.
* @param useTestnetStreaming true for spot test network websocket streaming; false for no streaming.
- *
* @return the binance api client factory.
*/
- public static BinanceApiClientFactory newInstance(String apiKey, String secret, boolean useTestnet, boolean useTestnetStreaming) {
- return new BinanceApiClientFactory(apiKey, secret, useTestnet, useTestnetStreaming);
+ public static BinanceApiClientFactory newInstance(String apiKey, String secret, boolean useTestnet, boolean useTestnetStreaming) {
+ return new BinanceApiClientFactory(apiKey, secret, useTestnet, useTestnetStreaming);
}
/**
@@ -85,9 +95,8 @@ public static BinanceApiClientFactory newInstance() {
/**
* New instance without authentication and with optional Spot Test Network endpoint.
*
- * @param useTestnet true if endpoint is spot test network URL; false if endpoint is production spot API URL.
+ * @param useTestnet true if endpoint is spot test network URL; false if endpoint is production spot API URL.
* @param useTestnetStreaming true for spot test network websocket streaming; false for no streaming.
- *
* @return the binance api client factory.
*/
public static BinanceApiClientFactory newInstance(boolean useTestnet, boolean useTestnetStreaming) {
@@ -108,31 +117,10 @@ public BinanceApiAsyncRestClient newAsyncRestClient() {
return new BinanceApiAsyncRestClientImpl(apiKey, secret);
}
- /**
- * Creates a new asynchronous/non-blocking Margin REST client.
- */
- public BinanceApiAsyncMarginRestClient newAsyncMarginRestClient() {
- return new BinanceApiAsyncMarginRestClientImpl(apiKey, secret);
- }
-
- /**
- * Creates a new synchronous/blocking Margin REST client.
- */
- public BinanceApiMarginRestClient newMarginRestClient() {
- return new BinanceApiMarginRestClientImpl(apiKey, secret);
- }
-
/**
* Creates a new web socket client used for handling data streams.
*/
public BinanceApiWebSocketClient newWebSocketClient() {
return new BinanceApiWebSocketClientImpl(getSharedClient());
}
-
- /**
- * Creates a new synchronous/blocking Swap REST client.
- */
- public BinanceApiSwapRestClient newSwapRestClient() {
- return new BinanceApiSwapRestClientImpl(apiKey, secret);
- }
}
diff --git a/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java b/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java
deleted file mode 100755
index 6f100a365..000000000
--- a/src/main/java/com/binance/api/client/BinanceApiMarginRestClient.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package com.binance.api.client;
-
-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 java.util.List;
-
-public interface BinanceApiMarginRestClient {
- /**
- * Get current margin account information using default parameters.
- */
- MarginAccount getAccount();
-
- /**
- * Get all open orders on margin account for a symbol.
- *
- * @param orderRequest order request parameters
- */
- List getOpenOrders(OrderRequest orderRequest);
-
- /**
- * Send in a new margin order.
- *
- * @param order the new order to submit.
- * @return a response containing details about the newly placed order.
- */
- MarginNewOrderResponse newOrder(MarginNewOrder order);
-
- /**
- * Cancel an active margin order.
- *
- * @param cancelOrderRequest order status request parameters
- */
- CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest);
-
- /**
- * Check margin order's status.
- * @param orderStatusRequest order status request options/filters
- *
- * @return an order
- */
- Order getOrderStatus(OrderStatusRequest orderStatusRequest);
-
- /**
- * Get margin trades for a specific symbol.
- *
- * @param symbol symbol to get trades from
- * @return a list of trades
- */
- List getMyTrades(String symbol);
-
- // User stream endpoints
-
- /**
- * Start a new user data stream.
- *
- * @return a listen key that can be used with data streams
- */
- String startUserDataStream();
-
- /**
- * PING a user data stream to prevent a time out.
- *
- * @param listenKey listen key that identifies a data stream
- */
- void keepAliveUserDataStream(String listenKey);
-
- /**
- * Execute transfer between spot account and margin account
- * @param asset asset to repay
- * @param amount amount to repay
- * @return transaction id
- */
- MarginTransaction transfer(String asset, String amount, TransferType type);
-
- /**
- * Apply for a loan
- * @param asset asset to repay
- * @param amount amount to repay
- * @return transaction id
- */
- MarginTransaction borrow(String asset, String amount);
-
- /**
- * Query loan record
- * @param asset asset to query
- * @return repay records
- */
- RepayQueryResult queryRepay(String asset, long startTime);
-
- /**
- * Query max borrowable
- * @param asset asset to query
- * @return max borrowable
- */
- MaxBorrowableQueryResult queryMaxBorrowable(String asset);
-
- /**
- * Query loan record
- * @param asset asset to query
- * @param txId the tranId in POST /sapi/v1/margin/repay
- * @return loan records
- */
- RepayQueryResult queryRepay(String asset, String txId);
-
- /**
- * Repay loan for margin account
- * @param asset asset to repay
- * @param amount amount to repay
- * @return transaction id
- */
- MarginTransaction repay(String asset, String amount);
-
- /**
- * Query loan record
- * @param asset asset to query
- * @param txId the tranId in POST /sapi/v1/margin/loan
- * @return loan records
- */
- LoanQueryResult queryLoan(String asset, String txId);
-
-
-}
diff --git a/src/main/java/com/binance/api/client/BinanceApiRestClient.java b/src/main/java/com/binance/api/client/BinanceApiRestClient.java
index ebe0b9667..ba0529a98 100755
--- a/src/main/java/com/binance/api/client/BinanceApiRestClient.java
+++ b/src/main/java/com/binance/api/client/BinanceApiRestClient.java
@@ -39,7 +39,7 @@ public interface BinanceApiRestClient {
ExchangeInfo getExchangeInfo();
/**
- * @return All the supported assets and whether or not they can be withdrawn.
+ * @return All the supported assets and whether they can be withdrawn.
*/
List getAllAssets();
@@ -49,7 +49,7 @@ public interface BinanceApiRestClient {
* Get order book of a symbol.
*
* @param symbol ticker symbol (e.g. ETHBTC)
- * @param limit depth of the order book (max 100)
+ * @param limit depth of the order book (max 100)
*/
OrderBook getOrderBook(String symbol, Integer limit);
@@ -57,7 +57,7 @@ public interface BinanceApiRestClient {
* Get recent trades (up to last 500). Weight: 1
*
* @param symbol ticker symbol (e.g. ETHBTC)
- * @param limit of last trades (Default 500; max 1000.)
+ * @param limit of last trades (Default 500; max 1000.)
*/
List getTrades(String symbol, Integer limit);
@@ -65,7 +65,7 @@ public interface BinanceApiRestClient {
* Get older trades. Weight: 5
*
* @param symbol ticker symbol (e.g. ETHBTC)
- * @param limit of last trades (Default 500; max 1000.)
+ * @param limit of last trades (Default 500; max 1000.)
* @param fromId TradeId to fetch from. Default gets most recent trades.
*/
List getHistoricalTrades(String symbol, Integer limit, Long fromId);
@@ -73,15 +73,15 @@ public interface BinanceApiRestClient {
/**
* Get compressed, aggregate trades. Trades that fill at the time, from the same order, with
* the same price will have the quantity aggregated.
- *
+ *
* If both startTime and endTime are sent, limitshould not
* be sent AND the distance between startTime and endTime must be less than 24 hours.
*
- * @param symbol symbol to aggregate (mandatory)
- * @param fromId ID to get aggregate trades from INCLUSIVE (optional)
- * @param limit Default 500; max 1000 (optional)
+ * @param symbol symbol to aggregate (mandatory)
+ * @param fromId ID to get aggregate trades from INCLUSIVE (optional)
+ * @param limit Default 500; max 1000 (optional)
* @param startTime Timestamp in ms to get aggregate trades from INCLUSIVE (optional).
- * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE (optional).
+ * @param endTime Timestamp in ms to get aggregate trades until INCLUSIVE (optional).
* @return a list of aggregate trades for the given symbol
*/
List getAggTrades(String symbol, String fromId, Integer limit, Long startTime, Long endTime);
@@ -96,11 +96,11 @@ public interface BinanceApiRestClient {
/**
* Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
*
- * @param symbol symbol to aggregate (mandatory)
- * @param interval candlestick interval (mandatory)
- * @param limit Default 500; max 1000 (optional)
+ * @param symbol symbol to aggregate (mandatory)
+ * @param interval candlestick interval (mandatory)
+ * @param limit Default 500; max 1000 (optional)
* @param startTime Timestamp in ms to get candlestick bars from INCLUSIVE (optional).
- * @param endTime Timestamp in ms to get candlestick bars until INCLUSIVE (optional).
+ * @param endTime Timestamp in ms to get candlestick bars until INCLUSIVE (optional).
* @return a candlestick bar for the given symbol and interval
*/
List getCandlestickBars(String symbol, CandlestickInterval interval, Integer limit, Long startTime, Long endTime);
@@ -125,12 +125,12 @@ public interface BinanceApiRestClient {
List getAll24HrPriceStatistics();
/**
- * Get Latest price for all symbols.
+ * Get the latest price for all symbols.
*/
List getAllPrices();
/**
- * Get latest price for symbol.
+ * Get the latest price for symbol.
*
* @param symbol ticker symbol (e.g. ETHBTC)
*/
@@ -160,8 +160,8 @@ public interface BinanceApiRestClient {
/**
* Check an order's status.
- * @param orderStatusRequest order status request options/filters
*
+ * @param orderStatusRequest order status request options/filters
* @return an order
*/
Order getOrderStatus(OrderStatusRequest orderStatusRequest);
@@ -189,15 +189,6 @@ public interface BinanceApiRestClient {
*/
List getAllOrders(AllOrdersRequest orderRequest);
- /**
- * Send in a new OCO;
- *
- * @param oco
- * the OCO to submit
- * @return a response containing details about the newly placed OCO.
- */
- NewOCOResponse newOCO(NewOCO oco);
-
/**
* Cancel an entire Order List
*
@@ -224,28 +215,23 @@ public interface BinanceApiRestClient {
/**
* Get current account information.
*/
- Account getAccount(Long recvWindow, Long timestamp);
-
- /**
- * Get current account information using default parameters.
- */
Account getAccount();
/**
* Get trades for a specific account and symbol.
*
* @param symbol symbol to get trades from
- * @param limit default 500; max 1000
+ * @param limit default 500; max 1000
* @param fromId TradeId to fetch from. Default gets most recent trades.
* @return a list of trades
*/
- List getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp);
+ List getMyTrades(String symbol, Integer limit, Long fromId);
/**
* Get trades for a specific account and symbol.
*
* @param symbol symbol to get trades from
- * @param limit default 500; max 1000
+ * @param limit default 500; max 1000
* @return a list of trades
*/
List getMyTrades(String symbol, Integer limit);
@@ -257,55 +243,112 @@ public interface BinanceApiRestClient {
* @return a list of trades
*/
List getMyTrades(String symbol);
-
+
List getMyTrades(String symbol, Long fromId);
/**
- * Submit a withdraw request.
- *
- * Enable Withdrawals option has to be active in the API settings.
+ * Submit a withdrawal request.
+ * Withdrawals option has to be active in the API settings.
*
- * @param asset 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.
+ * @param coin asset symbol to withdraw
+ * @param withdrawOrderId client id for withdraw
+ * @param network the network to use for the withdrawal
+ * @param address address to withdraw to
+ * @param addressTag Secondary address identifier for coins like XRP,XMR etc.
+ * @param amount amount to withdraw
+ * @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.
+ * @param name Description of the address. Space in name should be encoded into %20.
*/
- WithdrawResult withdraw(String asset, String address, String amount, String name, String addressTag);
+ WithdrawResult withdraw(String coin, String withdrawOrderId, String network, String address, String amount,
+ String name, String addressTag, Boolean transactionFeeFlag);
/**
* Conver a list of assets to BNB
+ *
* @param asset the list of assets to convert
*/
- DustTransferResponse dustTranfer(List asset);
+ DustTransferResponse dustTransfer(List asset);
/**
* Fetch account deposit history.
*
* @return deposit history, containing a list of deposits
*/
- DepositHistory getDepositHistory(String asset);
+ List getDepositHistory(String asset);
/**
- * Fetch account withdraw history.
+ * Fetch account deposit history.
*
+ * @param coin the asset to get the history for
+ * @param status When specified, filter by transaction status:
+ * - 0: pending
+ * - 6: credited but cannot withdraw
+ * - 1: success)
+ * @param startTime Default: 90 days from current timestamp
+ * @param endTime Default: present timestamp
+ * @param offset Default:0
+ * @param limit Default:1000, Max:1000
+ * @return deposit history, containing a list of deposits
+ */
+ List getDepositHistory(String coin, Integer status, Long startTime, Long endTime,
+ Integer offset, Integer limit);
+
+ /**
+ * Fetch account withdraw history.
+ * See https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
+ * Comments from the docs:
+ * Please notice the default startTime and endTime to make sure that time interval is within 0-90 days.
+ * If both startTime and endTime are sent, time between startTime and endTime must be less than 90 days.
+ * If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days.
+ * If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default.
+ *
+ * @param coin
+ * @param withdrawOrderId
+ * @param status When specified, filter by transaction status:
+ * - 0:Email Sent
+ * - 1:Cancelled
+ * - 2:Awaiting Approval
+ * - 3:Rejected
+ * - 4:Processing
+ * - 5:Failure
+ * - 6:Completed
+ * @param offset
+ * @param limit Default: 1000, Max: 1000
+ * @param startTime Default: 90 days from current timestamp
+ * @param endTime Default: present timestamp
* @return withdraw history, containing a list of withdrawals
*/
- WithdrawHistory getWithdrawHistory(String asset);
+ List getWithdrawHistory(String coin, String withdrawOrderId, Integer status,
+ Integer offset, Integer limit, Long startTime, Long endTime);
/**
- * Fetch sub-account transfer history.
+ * Fetch account withdraw history, with default values.
+ * See https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
*
- * @return sub-account transfers
+ * @param coin The coin to look withdrawals for
+ * @return withdraw history, containing a list of withdrawals
*/
- List getSubAccountTransfers();
+ List getWithdrawHistory(String coin);
/**
* Fetch deposit address.
*
+ * @param coin The coin to get the address for
+ * @param network The network to use for deposit
* @return deposit address for a given asset.
*/
- DepositAddress getDepositAddress(String asset);
+ DepositAddress getDepositAddress(String coin, String network);
+
+ /**
+ * Get User account information.
+ *
+ * @param asset When specified, include only the given asset. When null, get
+ * balances for all assets
+ * @param needBtcValuation When true, include value in BTC for each asset.
+ * @return A list of all user assets with non-zero balances (or only the one asset,
+ * when specified)
+ */
+ List getUserAssets(String asset, boolean needBtcValuation);
// User stream endpoints
diff --git a/src/main/java/com/binance/api/client/BinanceApiSwapRestClient.java b/src/main/java/com/binance/api/client/BinanceApiSwapRestClient.java
deleted file mode 100755
index f7baf2c2e..000000000
--- a/src/main/java/com/binance/api/client/BinanceApiSwapRestClient.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package com.binance.api.client;
-
-import com.binance.api.client.domain.SwapRemoveType;
-import com.binance.api.client.domain.account.*;
-import retrofit2.Call;
-import retrofit2.http.Query;
-
-import java.util.List;
-
-public interface BinanceApiSwapRestClient {
-
- /**
- * Get metadata about all swap pools.
- *
- * @return
- */
- List listAllSwapPools();
-
- /**
- * Get liquidity information and user share of a pool.
- *
- * @param poolId
- * @return
- */
- Liquidity getPoolLiquidityInfo(String poolId);
-
- /**
- * Add liquidity to a pool.
- *
- * @param poolId
- * @param asset
- * @param quantity
- * @return
- */
- LiquidityOperationRecord addLiquidity(String poolId,
- String asset,
- String quantity);
-
- /**
- * Remove liquidity from a pool, type include SINGLE and COMBINATION, asset is mandatory for single asset removal
- *
- * @param poolId
- * @param type
- * @param asset
- * @param shareAmount
- * @return
- */
- LiquidityOperationRecord removeLiquidity(String poolId, SwapRemoveType type, List asset, String shareAmount);
-
- /**
- * Get liquidity operation (add/remove) records of a pool
- *
- * @param poolId
- * @param limit
- * @return
- */
- List getPoolLiquidityOperationRecords(
- String poolId,
- Integer limit);
-
- /**
- * Get liquidity operation (add/remove) record.
- *
- * @param operationId
- * @return
- */
- LiquidityOperationRecord getLiquidityOperationRecord(String operationId);
-
- /**
- * Request a quote for swap quote asset (selling asset) for base asset (buying asset), essentially price/exchange rates.
- *
- * @param quoteAsset
- * @param baseAsset
- * @param quoteQty
- * @return
- */
- SwapQuote requestQuote(String quoteAsset,
- String baseAsset,
- String quoteQty);
-
- /**
- * Swap quoteAsset for baseAsset
- *
- * @param quoteAsset
- * @param baseAsset
- * @param quoteQty
- * @return
- */
- SwapRecord swap(String quoteAsset,
- String baseAsset,
- String quoteQty);
-
- SwapHistory getSwapHistory(String swapId);
-}
diff --git a/src/main/java/com/binance/api/client/BinanceApiWebSocketClient.java b/src/main/java/com/binance/api/client/BinanceApiWebSocketClient.java
index bc048d464..c57abeb81 100755
--- a/src/main/java/com/binance/api/client/BinanceApiWebSocketClient.java
+++ b/src/main/java/com/binance/api/client/BinanceApiWebSocketClient.java
@@ -9,82 +9,76 @@
/**
* Binance API data streaming facade, supporting streaming of events through web sockets.
*/
-public interface BinanceApiWebSocketClient extends Closeable {
+public interface BinanceApiWebSocketClient {
- /**
- * Open a new web socket to receive {@link DepthEvent depthEvents} on a callback.
- *
- * @param symbols market (one or coma-separated) symbol(s) to subscribe to
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onDepthEvent(String symbols, BinanceApiCallback callback);
+ /**
+ * Open a new web socket to receive {@link DepthEvent depthEvents} on a callback.
+ *
+ * @param symbols market (one or coma-separated) symbol(s) to subscribe to
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onDepthEvent(String symbols, BinanceApiCallback callback);
- /**
- * Open a new web socket to receive {@link CandlestickEvent candlestickEvents} on a callback.
- *
- * @param symbols market (one or coma-separated) symbol(s) to subscribe to
- * @param interval the interval of the candles tick events required
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onCandlestickEvent(String symbols, CandlestickInterval interval, BinanceApiCallback callback);
+ /**
+ * Open a new web socket to receive {@link CandlestickEvent candlestickEvents} on a callback.
+ *
+ * @param symbols market (one or coma-separated) symbol(s) to subscribe to
+ * @param interval the interval of the candles tick events required
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onCandlestickEvent(String symbols, CandlestickInterval interval, BinanceApiCallback callback);
- /**
- * Open a new web socket to receive {@link AggTradeEvent aggTradeEvents} on a callback.
- *
- * @param symbols market (one or coma-separated) symbol(s) to subscribe to
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onAggTradeEvent(String symbols, BinanceApiCallback callback);
+ /**
+ * Open a new web socket to receive {@link AggTradeEvent aggTradeEvents} on a callback.
+ *
+ * @param symbols market (one or coma-separated) symbol(s) to subscribe to
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onAggTradeEvent(String symbols, BinanceApiCallback callback);
- /**
- * Open a new web socket to receive {@link UserDataUpdateEvent userDataUpdateEvents} on a callback.
- *
- * @param listenKey the listen key to subscribe to.
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onUserDataUpdateEvent(String listenKey, BinanceApiCallback callback);
+ /**
+ * Open a new web socket to receive {@link UserDataUpdateEvent userDataUpdateEvents} on a callback.
+ *
+ * @param listenKey the listen key to subscribe to.
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onUserDataUpdateEvent(String listenKey, BinanceApiCallback callback);
- /**
- * Open a new web socket to receive {@link TickerEvent tickerEvents} on a callback.
- *
- * @param symbols market (one or coma-separated) symbol(s) to subscribe to
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onTickerEvent(String symbols, BinanceApiCallback callback);
+ /**
+ * Open a new web socket to receive {@link TickerEvent tickerEvents} on a callback.
+ *
+ * @param symbols market (one or coma-separated) symbol(s) to subscribe to
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onTickerEvent(String symbols, BinanceApiCallback callback);
- /**
- * Open a new web socket to receive {@link List allMarketTickersEvents} on a callback.
- *
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onAllMarketTickersEvent(BinanceApiCallback> callback);
+ /**
+ * Open a new web socket to receive {@link List allMarketTickersEvents} on a callback.
+ *
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onAllMarketTickersEvent(BinanceApiCallback> callback);
- /**
- * Open a new web socket to receive {@link BookTickerEvent bookTickerEvents} on a callback.
- *
- * @param symbols market (one or coma-separated) symbol(s) to subscribe to
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onBookTickerEvent(String symbols, BinanceApiCallback callback);
+ /**
+ * Open a new web socket to receive {@link BookTickerEvent bookTickerEvents} on a callback.
+ *
+ * @param symbols market (one or coma-separated) symbol(s) to subscribe to
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onBookTickerEvent(String symbols, BinanceApiCallback callback);
- /**
- * Open a new web socket to receive {@link TickerEvent allBookTickersEvents} on a callback.
- *
- * @param callback the callback to call on new events
- * @return a {@link Closeable} that allows the underlying web socket to be closed.
- */
- Closeable onAllBookTickersEvent(BinanceApiCallback callback);
-
- /**
- * @deprecated This method is no longer functional. Please use the returned {@link Closeable} from any of the other methods to close the web socket.
- */
- @Deprecated
- void close();
+ /**
+ * Open a new web socket to receive {@link TickerEvent allBookTickersEvents} on a callback.
+ *
+ * @param callback the callback to call on new events
+ * @return a {@link Closeable} that allows the underlying web socket to be closed.
+ */
+ Closeable onAllBookTickersEvent(BinanceApiCallback callback);
}
diff --git a/src/main/java/com/binance/api/client/config/BinanceApiConfig.java b/src/main/java/com/binance/api/client/config/BinanceApiConfig.java
index f4875297b..63010b943 100755
--- a/src/main/java/com/binance/api/client/config/BinanceApiConfig.java
+++ b/src/main/java/com/binance/api/client/config/BinanceApiConfig.java
@@ -5,78 +5,78 @@
*/
public class BinanceApiConfig {
- /**
- * Base domain for URLs.
- */
- private static String BASE_DOMAIN = "binance.com";
+ /**
+ * Base domain for URLs.
+ */
+ private static String BASE_DOMAIN = "binance.com";
- /**
- * Spot Test Network URL.
- */
- private static final String TESTNET_DOMAIN = "testnet.binance.vision";
+ /**
+ * Spot Test Network URL.
+ */
+ private static final String TESTNET_DOMAIN = "testnet.binance.vision";
- /**
- * Binance Spot Test Network option:
- * true if endpoint is spot test network URL; false if endpoint is production spot API URL.
- */
- public static boolean useTestnet;
+ /**
+ * Binance Spot Test Network option:
+ * true if endpoint is spot test network URL; false if endpoint is production spot API URL.
+ */
+ public static boolean useTestnet;
- /**
- * Binance Spot Test Network option:
- * true for websocket streaming; false for no streaming.
- */
- public static boolean useTestnetStreaming;
+ /**
+ * Binance Spot Test Network option:
+ * true for websocket streaming; false for no streaming.
+ */
+ public static boolean useTestnetStreaming;
- /**
- * Set the URL base domain name (e.g., binance.com).
- *
- * @param baseDomain Base domain name
- */
- public static void setBaseDomain(final String baseDomain) {
- BASE_DOMAIN = baseDomain;
- }
+ /**
+ * Set the URL base domain name (e.g., binance.com).
+ *
+ * @param baseDomain Base domain name
+ */
+ public static void setBaseDomain(final String baseDomain) {
+ BASE_DOMAIN = baseDomain;
+ }
- /**
- * Get the URL base domain name (e.g., binance.com).
- *
- * @return The base domain for URLs
- */
- public static String getBaseDomain() {
- return BASE_DOMAIN;
- }
+ /**
+ * Get the URL base domain name (e.g., binance.com).
+ *
+ * @return The base domain for URLs
+ */
+ public static String getBaseDomain() {
+ return BASE_DOMAIN;
+ }
- /**
- * REST API base URL.
- */
- public static String getApiBaseUrl() {
- return String.format("https://api.%s", getBaseDomain());
- }
+ /**
+ * REST API base URL.
+ */
+ public static String getApiBaseUrl() {
+ return String.format("https://api.%s", getBaseDomain());
+ }
- /**
- * Streaming API base URL.
- */
- public static String getStreamApiBaseUrl() {
- return String.format("wss://stream.%s:9443/ws", getBaseDomain());
- }
+ /**
+ * Streaming API base URL.
+ */
+ public static String getStreamApiBaseUrl() {
+ return String.format("wss://stream.%s:9443/ws", getBaseDomain());
+ }
- /**
- * Asset info base URL.
- */
- public static String getAssetInfoApiBaseUrl() {
- return String.format("https://%s/", getBaseDomain());
- }
+ /**
+ * Asset info base URL.
+ */
+ public static String getAssetInfoApiBaseUrl() {
+ return String.format("https://%s/", getBaseDomain());
+ }
- /**
- * Spot Test Network API base URL.
- */
- public static String getTestNetBaseUrl() {
- return String.format("https://%s", TESTNET_DOMAIN);
- }
+ /**
+ * Spot Test Network API base URL.
+ */
+ public static String getTestNetBaseUrl() {
+ return String.format("https://%s", TESTNET_DOMAIN);
+ }
- /**
- * Streaming Spot Test Network base URL.
- */
- public static String getStreamTestNetBaseUrl() {
- return String.format("wss://%s/ws", TESTNET_DOMAIN);
- }
+ /**
+ * Streaming Spot Test Network base URL.
+ */
+ public static String getStreamTestNetBaseUrl() {
+ return String.format("wss://%s/ws", TESTNET_DOMAIN);
+ }
}
diff --git a/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java b/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java
index 8e84256d7..fa0ffe5b0 100755
--- a/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java
+++ b/src/main/java/com/binance/api/client/constant/BinanceApiConstants.java
@@ -37,7 +37,7 @@ public class BinanceApiConstants {
/**
* Default ToStringStyle used by toString methods.
* Override this to change the output format of the overridden toString methods.
- * - Example ToStringStyle.JSON_STYLE
+ * - Example ToStringStyle.JSON_STYLE
*/
public static ToStringStyle TO_STRING_BUILDER_STYLE = ToStringStyle.SHORT_PREFIX_STYLE;
}
diff --git a/src/main/java/com/binance/api/client/constant/Util.java b/src/main/java/com/binance/api/client/constant/Util.java
index dae7916f1..7ac268ec3 100755
--- a/src/main/java/com/binance/api/client/constant/Util.java
+++ b/src/main/java/com/binance/api/client/constant/Util.java
@@ -1,33 +1,96 @@
package com.binance.api.client.constant;
-
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
/**
- * Utility class
+ * Utility class.
*/
public final class Util {
- /**
- * List of fiat currencies.
- */
- public static final List FIAT_CURRENCY = Collections.unmodifiableList(Arrays.asList("USDT", "BUSD", "PAX", "TUSD", "USDC", "NGN", "RUB", "USDS", "TRY"));
+ /**
+ * List of fiat currencies.
+ */
+ private static final Set FIAT_CURRENCIES = new HashSet<>(
+ Arrays.asList("EUR", "USDT", "BUSD", "PAX", "TUSD", "USDC", "NGN", "RUB", "USDS", "TRY")
+ );
+
+ /**
+ * List of assets which are present on Binance but are not traded.
+ */
+ private static final Set NON_TRADED_ASSETS = new HashSet<>(
+ Arrays.asList("DON", "NFT", "ETHW")
+ );
+
+ // All currencies placed in Earnings account are assigned this prefix
+ private static final String EARNINGS_CURRENCY_PREFIX = "LD";
+
+ public static final String BTC_TICKER = "BTC";
- public static final String BTC_TICKER = "BTC";
+ private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
- private Util() {
+ private Util() {
+ }
+ /**
+ * Check if the asset is fiat currency.
+ *
+ * @return True if it is a fiat currency (USD, EUR, etc), false when it isn't
+ */
+ public static boolean isFiatCurrency(String symbol) {
+ return FIAT_CURRENCIES.contains(symbol);
+ }
+
+
+ /**
+ * Check if the asset is a currency deposited in an Earnings account.
+ *
+ * @return True if it is an earnings currency, false when it isn't
+ */
+ public static boolean isEarningsCurrency(String asset) {
+ return asset != null && asset.startsWith(EARNINGS_CURRENCY_PREFIX);
+ }
+
+ /**
+ * Convert an earnings asset symbol to normal currency symbol.
+ *
+ * @param asset The earnings asset symbol
+ * @return The regular asset (coin) symbol
+ */
+ public static String earningSymbolToCoin(String asset) {
+ if (!isEarningsCurrency(asset)) {
+ throw new IllegalArgumentException(asset + " is not an asset in earnings account");
}
+ return asset.substring(2);
+ }
+
+ /**
+ * Check if the given asset is traded on the exchange (some tokens are not, such as DON).
+ *
+ * @param asset The asset to check
+ * @return True if it is traded, false if it is not.
+ */
+ public static boolean isTraded(String asset) {
+ return !NON_TRADED_ASSETS.contains(asset);
+ }
- /**
- * Check if the ticker is fiat currency.
- */
- public static boolean isFiatCurrency(String symbol) {
- for (String fiat : FIAT_CURRENCY) {
- if (symbol.equals(fiat)) return true;
- }
- return false;
+ /**
+ * Convert a timestamp string in the format "yyyy-MM-dd hh:mm:ss" (such as "2022-12-20 20:48:22")
+ * to a unix timestamp, with milliseconds.
+ *
+ * @param timeString The timestamp string
+ * @return Unix timestamp, with milliseconds
+ */
+ public static long getTimestampFor(String timeString) {
+ try {
+ Date parsedDate = dateFormat.parse(timeString);
+ return parsedDate.getTime();
+ } catch (ParseException e) {
+ throw new RuntimeException("Invalid time string: " + timeString);
}
+ }
}
diff --git a/src/main/java/com/binance/api/client/domain/ContingencyType.java b/src/main/java/com/binance/api/client/domain/ContingencyType.java
index f6393a6b4..5b430faab 100755
--- a/src/main/java/com/binance/api/client/domain/ContingencyType.java
+++ b/src/main/java/com/binance/api/client/domain/ContingencyType.java
@@ -4,5 +4,5 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public enum ContingencyType {
- OCO
+ OCO
}
diff --git a/src/main/java/com/binance/api/client/domain/LiquidityOperationRecordStatus.java b/src/main/java/com/binance/api/client/domain/LiquidityOperationRecordStatus.java
deleted file mode 100755
index 2574a38e3..000000000
--- a/src/main/java/com/binance/api/client/domain/LiquidityOperationRecordStatus.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.binance.api.client.domain;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonValue;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public enum LiquidityOperationRecordStatus {
- PENDING,
- SUCCESS,
- FAILED;
-
- @JsonValue
- public int toValue() {
- return ordinal();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/LoanStatus.java b/src/main/java/com/binance/api/client/domain/LoanStatus.java
deleted file mode 100755
index 802e9981b..000000000
--- a/src/main/java/com/binance/api/client/domain/LoanStatus.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.binance.api.client.domain;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-/**
- * Status of a submitted order.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public enum LoanStatus {
- PENDING, CONFIRMED, FAILED
-}
diff --git a/src/main/java/com/binance/api/client/domain/OCOOrderStatus.java b/src/main/java/com/binance/api/client/domain/OCOOrderStatus.java
index 61888fa52..b983f480d 100755
--- a/src/main/java/com/binance/api/client/domain/OCOOrderStatus.java
+++ b/src/main/java/com/binance/api/client/domain/OCOOrderStatus.java
@@ -4,7 +4,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public enum OCOOrderStatus {
- EXECUTING,
- ALL_DONE,
- REJECT
+ EXECUTING,
+ ALL_DONE,
+ REJECT
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/OCOStatus.java b/src/main/java/com/binance/api/client/domain/OCOStatus.java
index 59c0bd0c9..89eca612c 100755
--- a/src/main/java/com/binance/api/client/domain/OCOStatus.java
+++ b/src/main/java/com/binance/api/client/domain/OCOStatus.java
@@ -4,7 +4,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public enum OCOStatus {
- RESPONSE,
- EXEC_STARTED,
- ALL_DONE
+ RESPONSE,
+ EXEC_STARTED,
+ ALL_DONE
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/SwapRemoveType.java b/src/main/java/com/binance/api/client/domain/SwapRemoveType.java
deleted file mode 100755
index 64db76453..000000000
--- a/src/main/java/com/binance/api/client/domain/SwapRemoveType.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.binance.api.client.domain;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public enum SwapRemoveType {
- SINGLE, COMBINATION
-}
diff --git a/src/main/java/com/binance/api/client/domain/TimeInForce.java b/src/main/java/com/binance/api/client/domain/TimeInForce.java
index 83043ce7f..3bc63590f 100755
--- a/src/main/java/com/binance/api/client/domain/TimeInForce.java
+++ b/src/main/java/com/binance/api/client/domain/TimeInForce.java
@@ -4,7 +4,7 @@
/**
* Time in force to indicate how long an order will remain active before it is executed or expires.
- *
+ *
* GTC (Good-Til-Canceled) orders are effective until they are executed or canceled.
* IOC (Immediate or Cancel) orders fills all or part of an order immediately and cancels the remaining part of the order.
* FOK (Fill or Kill) orders fills all in its entirety, otherwise, the entire order will be cancelled.
diff --git a/src/main/java/com/binance/api/client/domain/TransferType.java b/src/main/java/com/binance/api/client/domain/TransferType.java
deleted file mode 100755
index 7d39d18a7..000000000
--- a/src/main/java/com/binance/api/client/domain/TransferType.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.binance.api.client.domain;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-/**
- * Status of a submitted order.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public enum TransferType {
- SPOT_TO_MARGIN("1"), MARGIN_TO_SPOT("2");
-
- private String value;
-
- TransferType(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/Account.java b/src/main/java/com/binance/api/client/domain/account/Account.java
index 4356bfccb..95835efdb 100755
--- a/src/main/java/com/binance/api/client/domain/account/Account.java
+++ b/src/main/java/com/binance/api/client/domain/account/Account.java
@@ -33,17 +33,17 @@ public class Account {
private int sellerCommission;
/**
- * Whether or not this account can trade.
+ * Whether this account can trade.
*/
private boolean canTrade;
/**
- * Whether or not it is possible to withdraw from this account.
+ * Whether it is possible to withdraw from this account.
*/
private boolean canWithdraw;
/**
- * Whether or not it is possible to deposit into this account.
+ * Whether it is possible to deposit into this account.
*/
private boolean canDeposit;
diff --git a/src/main/java/com/binance/api/client/domain/account/AssetBalance.java b/src/main/java/com/binance/api/client/domain/account/AssetBalance.java
index 1d75d6307..694cfdf4d 100755
--- a/src/main/java/com/binance/api/client/domain/account/AssetBalance.java
+++ b/src/main/java/com/binance/api/client/domain/account/AssetBalance.java
@@ -39,6 +39,30 @@ public String getFree() {
return free;
}
+ /**
+ * Get free amount as a floating point number.
+ *
+ * @return The free amount
+ * @throws NumberFormatException if the free amount is not a valid number
+ */
+ public Double getFreeAsNumber() {
+ return Double.parseDouble(free);
+ }
+
+ /**
+ * Get locked amount as a floating point number.
+ *
+ * @return The locked amount
+ * @throws NumberFormatException if the locked amount is not a valid number
+ */
+ public Double getLockedAsNumber() {
+ return Double.parseDouble(locked);
+ }
+
+ public Double getTotalAmount() {
+ return getFreeAsNumber() + getLockedAsNumber();
+ }
+
public void setFree(String free) {
this.free = free;
}
diff --git a/src/main/java/com/binance/api/client/domain/account/CrossMarginAssets.java b/src/main/java/com/binance/api/client/domain/account/CrossMarginAssets.java
deleted file mode 100755
index 33c5fd906..000000000
--- a/src/main/java/com/binance/api/client/domain/account/CrossMarginAssets.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class CrossMarginAssets {
-
- public String assetFullName;
- public String assetName;
- public boolean isBorrowable;
- public boolean isMortgageable;
- public String userMinBorrow;
- public String userMinRepay;
-
- public String getAssetFullName() {
- return assetFullName;
- }
-
- public void setAssetFullName(String assetFullName) {
- this.assetFullName = assetFullName;
- }
-
- public String getAssetName() {
- return assetName;
- }
-
- public void setAssetName(String assetName) {
- this.assetName = assetName;
- }
-
- public boolean isBorrowable() {
- return isBorrowable;
- }
-
- public void setBorrowable(boolean borrowable) {
- isBorrowable = borrowable;
- }
-
- public boolean isMortgageable() {
- return isMortgageable;
- }
-
- public void setMortgageable(boolean mortgageable) {
- isMortgageable = mortgageable;
- }
-
- public String getUserMinBorrow() {
- return userMinBorrow;
- }
-
- public void setUserMinBorrow(String userMinBorrow) {
- this.userMinBorrow = userMinBorrow;
- }
-
- public String getUserMinRepay() {
- return userMinRepay;
- }
-
- public void setUserMinRepay(String userMinRepay) {
- this.userMinRepay = userMinRepay;
- }
-
- @Override
- public String toString() {
- return "CrossMarginAssets{" +
- "assetFullName='" + assetFullName + '\'' +
- ", assetName='" + assetName + '\'' +
- ", isBorrowable=" + isBorrowable +
- ", isMortgageable=" + isMortgageable +
- ", userMinBorrow='" + userMinBorrow + '\'' +
- ", userMinRepay='" + userMinRepay + '\'' +
- '}';
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/DepositHistory.java b/src/main/java/com/binance/api/client/domain/account/DepositHistory.java
deleted file mode 100755
index fc8d814e8..000000000
--- a/src/main/java/com/binance/api/client/domain/account/DepositHistory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import java.util.List;
-
-/**
- * History of account deposits.
- *
- * @see Deposit
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class DepositHistory {
-
- @JsonProperty("depositList")
- private List depositList;
-
- private boolean success;
-
- private String msg;
-
- public String getMsg() {
- return msg;
- }
-
- public void setMsg(String msg) {
- this.msg = msg;
- }
-
- public List getDepositList() {
- return depositList;
- }
-
- public void setDepositList(List depositList) {
- this.depositList = depositList;
- }
-
- public boolean isSuccess() {
- return success;
- }
-
- public void setSuccess(boolean success) {
- this.success = success;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("depositList", depositList)
- .append("success", success)
- .append("msg", msg)
- .toString();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/DustTransferResponse.java b/src/main/java/com/binance/api/client/domain/account/DustTransferResponse.java
index a585d2f01..56c3e8356 100755
--- a/src/main/java/com/binance/api/client/domain/account/DustTransferResponse.java
+++ b/src/main/java/com/binance/api/client/domain/account/DustTransferResponse.java
@@ -10,43 +10,43 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class DustTransferResponse {
- private String totalServiceCharge;
+ private String totalServiceCharge;
- private String totalTransfered;
+ private String totalTransfered;
- private List transferResult;
+ private List transferResult;
- public String getTotalServiceCharge() {
- return totalServiceCharge;
- }
+ public String getTotalServiceCharge() {
+ return totalServiceCharge;
+ }
- public void setTotalServiceCharge(String totalServiceCharge) {
- this.totalServiceCharge = totalServiceCharge;
- }
+ public void setTotalServiceCharge(String totalServiceCharge) {
+ this.totalServiceCharge = totalServiceCharge;
+ }
- public String getTotalTransfered() {
- return totalTransfered;
- }
+ public String getTotalTransfered() {
+ return totalTransfered;
+ }
- public void setTotalTransfered(String totalTransfered) {
- this.totalTransfered = totalTransfered;
- }
+ public void setTotalTransfered(String totalTransfered) {
+ this.totalTransfered = totalTransfered;
+ }
- public List getTransferResult() {
- return transferResult;
- }
+ public List getTransferResult() {
+ return transferResult;
+ }
- public void setTransferResult(List transferResult) {
- this.transferResult = transferResult;
- }
+ public void setTransferResult(List transferResult) {
+ this.transferResult = transferResult;
+ }
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("totalServiceCharge", totalServiceCharge)
- .append("totalTransfered", totalTransfered)
- .append("transferResult", transferResult)
- .toString();
- }
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
+ .append("totalServiceCharge", totalServiceCharge)
+ .append("totalTransfered", totalTransfered)
+ .append("transferResult", transferResult)
+ .toString();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/ExtendedAssetBalance.java b/src/main/java/com/binance/api/client/domain/account/ExtendedAssetBalance.java
new file mode 100644
index 000000000..678145401
--- /dev/null
+++ b/src/main/java/com/binance/api/client/domain/account/ExtendedAssetBalance.java
@@ -0,0 +1,62 @@
+package com.binance.api.client.domain.account;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * Asset balance with extra information. Used in some endpoints, for example
+ * User Asset: https://binance-docs.github.io/apidocs/spot/en/#user-asset-user_data
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ExtendedAssetBalance extends AssetBalance {
+ private String freeze;
+ private String withdrawing;
+ private String ipoable;
+ private String btcValuation;
+
+ public String getFreeze() {
+ return freeze;
+ }
+
+ public void setFreeze(String freeze) {
+ this.freeze = freeze;
+ }
+
+ public String getWithdrawing() {
+ return withdrawing;
+ }
+
+ public void setWithdrawing(String withdrawing) {
+ this.withdrawing = withdrawing;
+ }
+
+ public String getIpoable() {
+ return ipoable;
+ }
+
+ public void setIpoable(String ipoable) {
+ this.ipoable = ipoable;
+ }
+
+ /**
+ * Get the asset value in BTC, according to current prices.
+ *
+ * @return BTC-value of the asset
+ */
+ public String getBtcValuation() {
+ return btcValuation;
+ }
+
+ public void setBtcValuation(String btcValuation) {
+ this.btcValuation = btcValuation;
+ }
+
+ /**
+ * Get the BTC value, as a floating point number.
+ *
+ * @return The BTC value of the asset
+ * @throws NumberFormatException when the value is not a number
+ */
+ public double getBtcValuationAsNumber() {
+ return Double.parseDouble(btcValuation);
+ }
+}
diff --git a/src/main/java/com/binance/api/client/domain/account/Liquidity.java b/src/main/java/com/binance/api/client/domain/account/Liquidity.java
index 83eee88a3..74c085b11 100755
--- a/src/main/java/com/binance/api/client/domain/account/Liquidity.java
+++ b/src/main/java/com/binance/api/client/domain/account/Liquidity.java
@@ -4,99 +4,99 @@
public class Liquidity {
- private String poolId;
- private String poolName;
- private Long updateTime;
- private Map liquidity;
- private Share share;
-
- public String getPoolId() {
- return poolId;
+ private String poolId;
+ private String poolName;
+ private Long updateTime;
+ private Map liquidity;
+ private Share share;
+
+ public String getPoolId() {
+ return poolId;
+ }
+
+ public void setPoolId(String poolId) {
+ this.poolId = poolId;
+ }
+
+ public String getPoolName() {
+ return poolName;
+ }
+
+ public void setPoolName(String poolName) {
+ this.poolName = poolName;
+ }
+
+ public Long getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Long updateTime) {
+ this.updateTime = updateTime;
+ }
+
+ public Map getLiquidity() {
+ return liquidity;
+ }
+
+ public void setLiquidity(Map liquidity) {
+ this.liquidity = liquidity;
+ }
+
+ public Share getShare() {
+ return share;
+ }
+
+ public void setShare(Share share) {
+ this.share = share;
+ }
+
+ public static class Share {
+ private double shareAmount;
+ private double sharePercentage;
+ private Map asset;
+
+ public double getShareAmount() {
+ return shareAmount;
}
- public void setPoolId(String poolId) {
- this.poolId = poolId;
+ public void setShareAmount(double shareAmount) {
+ this.shareAmount = shareAmount;
}
- public String getPoolName() {
- return poolName;
+ public double getSharePercentage() {
+ return sharePercentage;
}
- public void setPoolName(String poolName) {
- this.poolName = poolName;
+ public void setSharePercentage(double sharePercentage) {
+ this.sharePercentage = sharePercentage;
}
- public Long getUpdateTime() {
- return updateTime;
+ public Map getAsset() {
+ return asset;
}
- public void setUpdateTime(Long updateTime) {
- this.updateTime = updateTime;
- }
-
- public Map getLiquidity() {
- return liquidity;
- }
-
- public void setLiquidity(Map liquidity) {
- this.liquidity = liquidity;
- }
-
- public Share getShare() {
- return share;
- }
-
- public void setShare(Share share) {
- this.share = share;
- }
-
- public static class Share {
- private double shareAmount;
- private double sharePercentage;
- private Map asset;
-
- public double getShareAmount() {
- return shareAmount;
- }
-
- public void setShareAmount(double shareAmount) {
- this.shareAmount = shareAmount;
- }
-
- public double getSharePercentage() {
- return sharePercentage;
- }
-
- public void setSharePercentage(double sharePercentage) {
- this.sharePercentage = sharePercentage;
- }
-
- public Map getAsset() {
- return asset;
- }
-
- public void setAsset(Map asset) {
- this.asset = asset;
- }
-
- @Override
- public String toString() {
- return "Share{" +
- "shareAmount=" + shareAmount +
- ", sharePercentage=" + sharePercentage +
- ", asset=" + asset +
- '}';
- }
+ public void setAsset(Map asset) {
+ this.asset = asset;
}
@Override
public String toString() {
- return "Liquidity{" +
- "poolId=" + poolId +
- ", poolName='" + poolName + '\'' +
- ", updateTime=" + updateTime +
- ", liquidity=" + liquidity +
- ", share=" + share +
- '}';
+ return "Share{" +
+ "shareAmount=" + shareAmount +
+ ", sharePercentage=" + sharePercentage +
+ ", asset=" + asset +
+ '}';
}
+ }
+
+ @Override
+ public String toString() {
+ return "Liquidity{" +
+ "poolId=" + poolId +
+ ", poolName='" + poolName + '\'' +
+ ", updateTime=" + updateTime +
+ ", liquidity=" + liquidity +
+ ", share=" + share +
+ '}';
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/LiquidityOperationRecord.java b/src/main/java/com/binance/api/client/domain/account/LiquidityOperationRecord.java
deleted file mode 100755
index 2ce393f1c..000000000
--- a/src/main/java/com/binance/api/client/domain/account/LiquidityOperationRecord.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.domain.LiquidityOperationRecordStatus;
-
-public class LiquidityOperationRecord {
-
- private String poolId;
- private String operationId;
- private String updateTime;
- private String operation;
- private String shareAmount;
- private String poolName;
- private LiquidityOperationRecordStatus status;
-
- public String getPoolId() {
- return poolId;
- }
-
- public void setPoolId(String poolId) {
- this.poolId = poolId;
- }
-
- public String getUpdateTime() {
- return updateTime;
- }
-
- public void setUpdateTime(String updateTime) {
- this.updateTime = updateTime;
- }
-
- public String getOperation() {
- return operation;
- }
-
- public void setOperation(String operation) {
- this.operation = operation;
- }
-
- public String getShareAmount() {
- return shareAmount;
- }
-
- public void setShareAmount(String shareAmount) {
- this.shareAmount = shareAmount;
- }
-
- public String getPoolName() {
- return poolName;
- }
-
- public void setPoolName(String poolName) {
- this.poolName = poolName;
- }
-
- public LiquidityOperationRecordStatus getStatus() {
- return status;
- }
-
- public void setStatus(LiquidityOperationRecordStatus status) {
- this.status = status;
- }
-
- public String getOperationId() {
- return operationId;
- }
-
- public void setOperationId(String operationId) {
- this.operationId = operationId;
- }
-
- @Override
- public String toString() {
- return "LiquidityOperationRecord{" +
- "poolId='" + poolId + '\'' +
- ", operationId='" + operationId + '\'' +
- ", updateTime='" + updateTime + '\'' +
- ", operation='" + operation + '\'' +
- ", shareAmount='" + shareAmount + '\'' +
- ", poolName='" + poolName + '\'' +
- ", status='" + status + '\'' +
- '}';
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/Loan.java b/src/main/java/com/binance/api/client/domain/account/Loan.java
deleted file mode 100755
index 96389c269..000000000
--- a/src/main/java/com/binance/api/client/domain/account/Loan.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.domain.LoanStatus;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-/**
- * Represents an executed trade history item.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class Loan {
-
- private String asset;
- private String principal;
- private long timestamp;
- private LoanStatus status;
-
- public String getAsset() {
- return asset;
- }
-
- public void setAsset(String asset) {
- this.asset = asset;
- }
-
- public String getPrincipal() {
- return principal;
- }
-
- public void setPrincipal(String principal) {
- this.principal = principal;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- public LoanStatus getStatus() {
- return status;
- }
-
- public void setStatus(LoanStatus status) {
- this.status = status;
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/LoanQueryResult.java b/src/main/java/com/binance/api/client/domain/account/LoanQueryResult.java
deleted file mode 100755
index 46a696531..000000000
--- a/src/main/java/com/binance/api/client/domain/account/LoanQueryResult.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-import java.util.List;
-
-/**
- * History of account withdrawals.
- *
- * @see Withdraw
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class LoanQueryResult {
-
- private int total;
- private List rows;
-
- public int getTotal() {
- return total;
- }
-
- public void setTotal(int total) {
- this.total = total;
- }
-
- public List getRows() {
- return rows;
- }
-
- public void setRows(List rows) {
- this.rows = rows;
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/MarginAccount.java b/src/main/java/com/binance/api/client/domain/account/MarginAccount.java
deleted file mode 100755
index 86bd64f27..000000000
--- a/src/main/java/com/binance/api/client/domain/account/MarginAccount.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import java.util.List;
-
-/**
- * Account information.
- */
-@JsonIgnoreProperties
-public class MarginAccount {
-
- private boolean borrowEnabled;
-
- private String marginLevel;
-
- private String totalAssetOfBtc;
-
- private String totalLiabilityOfBtc;
-
- private String totalNetAssetOfBtc;
-
- private boolean tradeEnabled;
-
- private boolean transferEnabled;
-
- private List userAssets;
-
- public boolean isBorrowEnabled() {
- return borrowEnabled;
- }
-
- public void setBorrowEnabled(boolean borrowEnabled) {
- this.borrowEnabled = borrowEnabled;
- }
-
- public String getMarginLevel() {
- return marginLevel;
- }
-
- public void setMarginLevel(String marginLevel) {
- this.marginLevel = marginLevel;
- }
-
- public String getTotalAssetOfBtc() {
- return totalAssetOfBtc;
- }
-
- public void setTotalAssetOfBtc(String totalAssetOfBtc) {
- this.totalAssetOfBtc = totalAssetOfBtc;
- }
-
- public String getTotalLiabilityOfBtc() {
- return totalLiabilityOfBtc;
- }
-
- public void setTotalLiabilityOfBtc(String totalLiabilityOfBtc) {
- this.totalLiabilityOfBtc = totalLiabilityOfBtc;
- }
-
- public String getTotalNetAssetOfBtc() {
- return totalNetAssetOfBtc;
- }
-
- public void setTotalNetAssetOfBtc(String totalNetAssetOfBtc) {
- this.totalNetAssetOfBtc = totalNetAssetOfBtc;
- }
-
- public boolean isTradeEnabled() {
- return tradeEnabled;
- }
-
- public void setTradeEnabled(boolean tradeEnabled) {
- this.tradeEnabled = tradeEnabled;
- }
-
- public boolean isTransferEnabled() {
- return transferEnabled;
- }
-
- public void setTransferEnabled(boolean transferEnabled) {
- this.transferEnabled = transferEnabled;
- }
-
- public List getUserAssets() {
- return userAssets;
- }
-
- public void setUserAssets(List userAssets) {
- this.userAssets = userAssets;
- }
-
- /**
- * Returns the asset balance for a given symbol.
- *
- * @param symbol asset symbol to obtain the balances from
- * @return an asset balance for the given symbol which can be 0 in case the symbol has no balance in the account
- */
- public MarginAssetBalance getAssetBalance(final String symbol) {
- return userAssets.stream()
- .filter(marginAssetBalance -> marginAssetBalance.getAsset().equals(symbol))
- .findFirst()
- .orElse(MarginAssetBalance.of(symbol));
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("borrowEnabled", borrowEnabled)
- .append("marginLevel", marginLevel)
- .append("totalAssetOfBtc", totalAssetOfBtc)
- .append("totalLiabilityOfBtc", totalLiabilityOfBtc)
- .append("totalNetAssetOfBtc", totalNetAssetOfBtc)
- .append("tradeEnabled", tradeEnabled)
- .append("transferEnabled", transferEnabled)
- .append("userAssets", userAssets)
- .toString();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/MarginAssetBalance.java b/src/main/java/com/binance/api/client/domain/account/MarginAssetBalance.java
deleted file mode 100755
index db949e851..000000000
--- a/src/main/java/com/binance/api/client/domain/account/MarginAssetBalance.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * An asset balance in an Account.
- *
- * @see Account
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MarginAssetBalance {
-
- public static MarginAssetBalance of(final String asset) {
- final MarginAssetBalance marginAssetBalance = new MarginAssetBalance();
-
- marginAssetBalance.setAsset(asset);
-
- return marginAssetBalance;
- }
-
- /**
- * Asset symbol.
- */
- private String asset;
-
- private String borrowed = "0";
-
- /**
- * Available balance.
- */
- private String free = "0";
-
- private String interest = "0";
-
- /**
- * Locked by open orders.
- */
- private String locked = "0";
-
- private String netAsset = "0";
-
- public String getAsset() {
- return asset;
- }
-
- public void setAsset(String asset) {
- this.asset = asset;
- }
-
- public String getBorrowed() {
- return borrowed;
- }
-
- public void setBorrowed(String borrowed) {
- this.borrowed = borrowed;
- }
-
- public String getFree() {
- return free;
- }
-
- public void setFree(String free) {
- this.free = free;
- }
-
- public String getInterest() {
- return interest;
- }
-
- public void setInterest(String interest) {
- this.interest = interest;
- }
-
- public String getLocked() {
- return locked;
- }
-
- public void setLocked(String locked) {
- this.locked = locked;
- }
-
- public String getNetAsset() {
- return netAsset;
- }
-
- public void setNetAsset(String netAsset) {
- this.netAsset = netAsset;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("asset", asset)
- .append("borrowed", borrowed)
- .append("free", free)
- .append("interest", interest)
- .append("locked", locked)
- .append("netAsset", netAsset)
- .toString();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/MarginNewOrder.java b/src/main/java/com/binance/api/client/domain/account/MarginNewOrder.java
deleted file mode 100755
index 74dd71d0b..000000000
--- a/src/main/java/com/binance/api/client/domain/account/MarginNewOrder.java
+++ /dev/null
@@ -1,289 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.binance.api.client.domain.OrderSide;
-import com.binance.api.client.domain.OrderType;
-import com.binance.api.client.domain.TimeInForce;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * A trade order to enter or exit a position.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MarginNewOrder {
-
- /**
- * Symbol to place the order on.
- */
- private String symbol;
-
- /**
- * Buy/Sell order side.
- */
- private OrderSide side;
-
- /**
- * Type of order.
- */
- private OrderType type;
-
- /**
- * Time in force to indicate how long will the order remain active.
- */
- private TimeInForce timeInForce;
-
- /**
- * Quantity.
- */
- private String quantity;
-
- /**
- * Quote quantity.
- */
- private String quoteOrderQty;
-
- /**
- * Price.
- */
- private String price;
-
- /**
- * A unique id for the order. Automatically generated if not sent.
- */
- private String newClientOrderId;
-
- /**
- * Used with stop orders.
- */
- private String stopPrice;
-
- /**
- * Used with iceberg orders.
- */
- private String icebergQty;
-
- /**
- * Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
- */
- private NewOrderResponseType newOrderRespType;
-
- /**
- * Set the margin order side-effect. NO_SIDE_EFFECT, MARGIN_BUY, AUTO_REPAY; default: NO_SIDE_EFFECT.
- */
- private SideEffectType sideEffectType;
-
- /**
- * Receiving window.
- */
- private Long recvWindow;
-
- /**
- * Order timestamp.
- */
- private long timestamp;
-
- /**
- * Creates a new order with all required parameters.
- */
- public MarginNewOrder(String symbol, OrderSide side, OrderType type, TimeInForce timeInForce, String quantity) {
- this.symbol = symbol;
- this.side = side;
- this.type = type;
- this.timeInForce = timeInForce;
- this.quantity = quantity;
- this.newOrderRespType = NewOrderResponseType.RESULT;
- this.timestamp = System.currentTimeMillis();
- this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
- }
-
- /**
- * Creates a new order with all required parameters plus price, which is optional for MARKET orders.
- */
- public MarginNewOrder(String symbol, OrderSide side, OrderType type, TimeInForce timeInForce, String quantity, String price) {
- this(symbol, side, type, timeInForce, quantity);
- this.price = price;
- }
-
- public String getSymbol() {
- return symbol;
- }
-
- public MarginNewOrder symbol(String symbol) {
- this.symbol = symbol;
- return this;
- }
-
- public OrderSide getSide() {
- return side;
- }
-
- public MarginNewOrder side(OrderSide side) {
- this.side = side;
- return this;
- }
-
- public OrderType getType() {
- return type;
- }
-
- public MarginNewOrder type(OrderType type) {
- this.type = type;
- return this;
- }
-
- public TimeInForce getTimeInForce() {
- return timeInForce;
- }
-
- public MarginNewOrder timeInForce(TimeInForce timeInForce) {
- this.timeInForce = timeInForce;
- return this;
- }
-
- public String getQuantity() {
- return quantity;
- }
-
- public MarginNewOrder quantity(String quantity) {
- this.quantity = quantity;
- return this;
- }
-
- public String getQuoteOrderQty() {
- return quoteOrderQty;
- }
-
- public MarginNewOrder quoteOrderQty(String quoteOrderQty) {
- this.quoteOrderQty = quoteOrderQty;
- return this;
- }
-
- public String getPrice() {
- return price;
- }
-
- public MarginNewOrder price(String price) {
- this.price = price;
- return this;
- }
-
- public String getNewClientOrderId() {
- return newClientOrderId;
- }
-
- public MarginNewOrder newClientOrderId(String newClientOrderId) {
- this.newClientOrderId = newClientOrderId;
- return this;
- }
-
- public String getStopPrice() {
- return stopPrice;
- }
-
- public MarginNewOrder stopPrice(String stopPrice) {
- this.stopPrice = stopPrice;
- return this;
- }
-
- public String getIcebergQty() {
- return icebergQty;
- }
-
- public MarginNewOrder icebergQty(String icebergQty) {
- this.icebergQty = icebergQty;
- return this;
- }
-
- public NewOrderResponseType getNewOrderRespType() {
- return newOrderRespType;
- }
-
- public MarginNewOrder newOrderRespType(NewOrderResponseType newOrderRespType) {
- this.newOrderRespType = newOrderRespType;
- return this;
- }
-
- public SideEffectType getSideEffectType() {
- return sideEffectType;
- }
-
- public MarginNewOrder sideEffectType(SideEffectType sideEffectType) {
- this.sideEffectType = sideEffectType;
- return this;
- }
-
- public Long getRecvWindow() {
- return recvWindow;
- }
-
- public MarginNewOrder recvWindow(Long recvWindow) {
- this.recvWindow = recvWindow;
- return this;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public MarginNewOrder timestamp(long timestamp) {
- this.timestamp = timestamp;
- return this;
- }
-
- /**
- * Places a MARKET buy order for the given quantity.
- *
- * @return a new order which is pre-configured with MARKET as the order type and BUY as the order side.
- */
- public static MarginNewOrder marketBuy(String symbol, String quantity) {
- return new MarginNewOrder(symbol, OrderSide.BUY, OrderType.MARKET, null, quantity);
- }
-
- /**
- * Places a MARKET sell order for the given quantity.
- *
- * @return a new order which is pre-configured with MARKET as the order type and SELL as the order side.
- */
- public static MarginNewOrder marketSell(String symbol, String quantity) {
- return new MarginNewOrder(symbol, OrderSide.SELL, OrderType.MARKET, null, quantity);
- }
-
- /**
- * Places a LIMIT buy order for the given quantity and price.
- *
- * @return a new order which is pre-configured with LIMIT as the order type and BUY as the order side.
- */
- public static MarginNewOrder limitBuy(String symbol, TimeInForce timeInForce, String quantity, String price) {
- return new MarginNewOrder(symbol, OrderSide.BUY, OrderType.LIMIT, timeInForce, quantity, price);
- }
-
- /**
- * Places a LIMIT sell order for the given quantity and price.
- *
- * @return a new order which is pre-configured with LIMIT as the order type and SELL as the order side.
- */
- public static MarginNewOrder limitSell(String symbol, TimeInForce timeInForce, String quantity, String price) {
- return new MarginNewOrder(symbol, OrderSide.SELL, OrderType.LIMIT, timeInForce, quantity, price);
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("symbol", symbol)
- .append("side", side)
- .append("type", type)
- .append("timeInForce", timeInForce)
- .append("quantity", quantity)
- .append("quoteOrderQty", quoteOrderQty)
- .append("price", price)
- .append("newClientOrderId", newClientOrderId)
- .append("stopPrice", stopPrice)
- .append("icebergQty", icebergQty)
- .append("newOrderRespType", newOrderRespType)
- .append("sideEffectType", sideEffectType)
- .append("recvWindow", recvWindow)
- .append("timestamp", timestamp)
- .toString();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/MarginNewOrderResponse.java b/src/main/java/com/binance/api/client/domain/account/MarginNewOrderResponse.java
deleted file mode 100755
index 0d65d82ea..000000000
--- a/src/main/java/com/binance/api/client/domain/account/MarginNewOrderResponse.java
+++ /dev/null
@@ -1,210 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.binance.api.client.domain.OrderSide;
-import com.binance.api.client.domain.OrderStatus;
-import com.binance.api.client.domain.OrderType;
-import com.binance.api.client.domain.TimeInForce;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-/**
- * Response returned when placing a new order on the system.
- *
- * @see NewOrder for the request
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MarginNewOrderResponse {
-
- /**
- * Order symbol.
- */
- private String symbol;
-
- /**
- * Order id.
- */
- private Long orderId;
-
- /**
- * This will be either a generated one, or the newClientOrderId parameter
- * which was passed when creating the new order.
- */
- private String clientOrderId;
-
- private String price;
-
- private String origQty;
-
- private String executedQty;
-
- private String cummulativeQuoteQty;
-
- private OrderStatus status;
-
- private TimeInForce timeInForce;
-
- private OrderType type;
-
- private String marginBuyBorrowAmount;
-
- private String marginBuyBorrowAsset;
-
- private OrderSide side;
-
- // @JsonSetter(nulls = Nulls.AS_EMPTY)
- private List fills;
-
- /**
- * Transact time for this order.
- */
- private Long transactTime;
-
- public String getSymbol() {
- return symbol;
- }
-
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
-
- public Long getOrderId() {
- return orderId;
- }
-
- public void setOrderId(Long orderId) {
- this.orderId = orderId;
- }
-
- public String getClientOrderId() {
- return clientOrderId;
- }
-
- public void setClientOrderId(String clientOrderId) {
- this.clientOrderId = clientOrderId;
- }
-
- public Long getTransactTime() {
- return transactTime;
- }
-
- public void setTransactTime(Long transactTime) {
- this.transactTime = transactTime;
- }
-
- public String getPrice() {
- return price;
- }
-
- public void setPrice(String price) {
- this.price = price;
- }
-
- public String getOrigQty() {
- return origQty;
- }
-
- public void setOrigQty(String origQty) {
- this.origQty = origQty;
- }
-
- public String getExecutedQty() {
- return executedQty;
- }
-
- public void setExecutedQty(String executedQty) {
- this.executedQty = executedQty;
- }
-
- public String getCummulativeQuoteQty() {
- return cummulativeQuoteQty;
- }
-
- public void setCummulativeQuoteQty(String cummulativeQuoteQty) {
- this.cummulativeQuoteQty = cummulativeQuoteQty;
- }
-
- public OrderStatus getStatus() {
- return status;
- }
-
- public void setStatus(OrderStatus status) {
- this.status = status;
- }
-
- public TimeInForce getTimeInForce() {
- return timeInForce;
- }
-
- public void setTimeInForce(TimeInForce timeInForce) {
- this.timeInForce = timeInForce;
- }
-
- public OrderType getType() {
- return type;
- }
-
- public void setType(OrderType type) {
- this.type = type;
- }
-
- public String getMarginBuyBorrowAmount() {
- return marginBuyBorrowAmount;
- }
-
- public void setMarginBuyBorrowAmount(String marginBuyBorrowAmount) {
- this.marginBuyBorrowAmount = marginBuyBorrowAmount;
- }
-
- public String getMarginBuyBorrowAsset() {
- return marginBuyBorrowAsset;
- }
-
- public void setMarginBuyBorrowAsset(String marginBuyBorrowAsset) {
- this.marginBuyBorrowAsset = marginBuyBorrowAsset;
- }
-
- public OrderSide getSide() {
- return side;
- }
-
- public void setSide(OrderSide side) {
- this.side = side;
- }
-
- public List getFills() {
- return fills;
- }
-
- public void setFills(List fills) {
- this.fills = fills;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("symbol", symbol)
- .append("orderId", orderId)
- .append("clientOrderId", clientOrderId)
- .append("transactTime", transactTime)
- .append("price", price)
- .append("origQty", origQty)
- .append("executedQty", executedQty)
- .append("status", status)
- .append("timeInForce", timeInForce)
- .append("type", type)
- .append("marginBuyBorrowAmount", marginBuyBorrowAmount)
- .append("marginBuyBorrowAsset", marginBuyBorrowAsset)
- .append("side", side)
- .append("fills", Optional.ofNullable(fills).orElse(Collections.emptyList())
- .stream()
- .map(Object::toString)
- .collect(Collectors.joining(", ")))
- .toString();
- }
-}
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
deleted file mode 100755
index f08995f1d..000000000
--- a/src/main/java/com/binance/api/client/domain/account/MarginTransaction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * MarginTransaction information.
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class MarginTransaction {
-
- private String tranId;
-
- public String getTranId() {
- return tranId;
- }
-
- public void setTranId(String tranId) {
- this.tranId = tranId;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("transactionId", tranId)
- .toString();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/MaxBorrowableQueryResult.java b/src/main/java/com/binance/api/client/domain/account/MaxBorrowableQueryResult.java
index 8a50fdea4..58ce289bc 100755
--- a/src/main/java/com/binance/api/client/domain/account/MaxBorrowableQueryResult.java
+++ b/src/main/java/com/binance/api/client/domain/account/MaxBorrowableQueryResult.java
@@ -25,7 +25,7 @@ public void setAmount(String amount) {
@Override
public String toString() {
return "MaxBorrowQueryResult{" +
- "amount='" + amount + '\'' +
- '}';
+ "amount='" + amount + '\'' +
+ '}';
}
}
diff --git a/src/main/java/com/binance/api/client/domain/account/NewOCO.java b/src/main/java/com/binance/api/client/domain/account/NewOCO.java
deleted file mode 100755
index 9ee106b15..000000000
--- a/src/main/java/com/binance/api/client/domain/account/NewOCO.java
+++ /dev/null
@@ -1,241 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.binance.api.client.domain.OrderSide;
-import com.binance.api.client.domain.TimeInForce;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class NewOCO {
-
- /**
- * Symbol to place the order on.
- */
- private String symbol;
-
- /**
- * A unique Id for the entire orderList
- */
- private String listClientOrderId;
-
- /**
- * Buy/Sell order side.
- */
- private OrderSide side;
-
- /**
- * Quantity.
- */
- private String quantity;
-
- /**
- * A unique Id for the limit order
- */
- private String limitClientOrderId;
-
- /**
- * Price.
- */
- private String price;
-
- /**
- * Used to make the LIMIT_MAKER leg an iceberg order.
- */
- private String limitIcebergQty;
-
- /**
- * A unique Id for the stop loss/stop loss limit leg
- */
- private String stopClientOrderId;
-
- /**
- * Stop Price.
- */
- private String stopPrice;
-
- /**
- * If provided, stopLimitTimeInForce is required.
- */
- private String stopLimitPrice;
-
- /**
- * Used with STOP_LOSS_LIMIT leg to make an iceberg order.
- */
- private String stopIcebergQty;
-
- /**
- * Valid values are GTC/FOK/IOC
- */
- private TimeInForce stopLimitTimeInForce;
-
- /**
- * Set the response JSON. ACK, RESULT, or FULL; default: RESULT.
- */
- private NewOrderResponseType newOrderRespType;
-
- /**
- * Receiving window.
- */
- private Long recvWindow;
-
- /**
- * Order timestamp.
- */
- private long timestamp;
-
- /**
- * Creates a new OCO with all required parameters.
- */
- public NewOCO(String symbol, OrderSide side, String quantity, String price, String stopPrice) {
- this.symbol = symbol;
- this.side = side;
- this.quantity = quantity;
- this.price = price;
- this.stopPrice = stopPrice;
- this.timestamp = System.currentTimeMillis();
- this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
- }
-
- public String getSymbol() {
- return symbol;
- }
-
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
-
- public String getListClientOrderId() {
- return listClientOrderId;
- }
-
- public void setListClientOrderId(String listClientOrderId) {
- this.listClientOrderId = listClientOrderId;
- }
-
- public OrderSide getSide() {
- return side;
- }
-
- public void setSide(OrderSide side) {
- this.side = side;
- }
-
- public String getQuantity() {
- return quantity;
- }
-
- public void setQuantity(String quantity) {
- this.quantity = quantity;
- }
-
- public String getLimitClientOrderId() {
- return limitClientOrderId;
- }
-
- public void setLimitClientOrderId(String limitClientOrderId) {
- this.limitClientOrderId = limitClientOrderId;
- }
-
- public String getPrice() {
- return price;
- }
-
- public void setPrice(String price) {
- this.price = price;
- }
-
- public String getLimitIcebergQty() {
- return limitIcebergQty;
- }
-
- public void setLimitIcebergQty(String limitIcebergQty) {
- this.limitIcebergQty = limitIcebergQty;
- }
-
- public String getStopClientOrderId() {
- return stopClientOrderId;
- }
-
- public void setStopClientOrderId(String stopClientOrderId) {
- this.stopClientOrderId = stopClientOrderId;
- }
-
- public String getStopPrice() {
- return stopPrice;
- }
-
- public void setStopPrice(String stopPrice) {
- this.stopPrice = stopPrice;
- }
-
- public String getStopLimitPrice() {
- return stopLimitPrice;
- }
-
- public void setStopLimitPrice(String stopLimitPrice) {
- this.stopLimitPrice = stopLimitPrice;
- }
-
- public String getStopIcebergQty() {
- return stopIcebergQty;
- }
-
- public void setStopIcebergQty(String stopIcebergQty) {
- this.stopIcebergQty = stopIcebergQty;
- }
-
- public TimeInForce getStopLimitTimeInForce() {
- return stopLimitTimeInForce;
- }
-
- public void setStopLimitTimeInForce(TimeInForce stopLimitTimeInForce) {
- this.stopLimitTimeInForce = stopLimitTimeInForce;
- }
-
- public NewOrderResponseType getNewOrderRespType() {
- return newOrderRespType;
- }
-
- public void setNewOrderRespType(NewOrderResponseType newOrderRespType) {
- this.newOrderRespType = newOrderRespType;
- }
-
- public Long getRecvWindow() {
- return recvWindow;
- }
-
- public void setRecvWindow(Long recvWindow) {
- this.recvWindow = recvWindow;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE).append("symbol", symbol)
- .append("listClientOrderId", listClientOrderId)
- .append("side", side)
- .append("quantity", quantity)
- .append("limitClientOrderId", limitClientOrderId)
- .append("price", price)
- .append("limitIcebergQty", limitIcebergQty)
- .append("stopClientOrderId", stopClientOrderId)
- .append("stopPrice", stopPrice)
- .append("stopLimitPrice", stopLimitPrice)
- .append("stopIcebergQty", stopIcebergQty)
- .append("stopLimitTimeInForce", stopLimitTimeInForce)
- .append("newOrderRespType", newOrderRespType)
- .append("recvWindow", recvWindow)
- .append("timestamp", timestamp)
- .toString();
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/NewOCOResponse.java b/src/main/java/com/binance/api/client/domain/account/NewOCOResponse.java
index b22580827..45a183680 100755
--- a/src/main/java/com/binance/api/client/domain/account/NewOCOResponse.java
+++ b/src/main/java/com/binance/api/client/domain/account/NewOCOResponse.java
@@ -10,79 +10,79 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class NewOCOResponse extends OrderList {
- private Long orderListId;
- private ContingencyType contingencyType;
- private OCOStatus listStatusType;
- private OCOOrderStatus listOrderStatus;
- private String listClientOrderId;
- private Long transactionTime;
- private String symbol;
- private List orderReports;
-
- // Getters
- public Long getOrderListId() {
- return this.orderListId;
- }
-
- public ContingencyType getContingencyType() {
- return this.contingencyType;
- }
-
- public OCOStatus getListStatusType() {
- return this.listStatusType;
- }
-
- public OCOOrderStatus getListOrderStatus() {
- return this.listOrderStatus;
- }
-
- public String getListClientOrderId() {
- return this.listClientOrderId;
- }
-
- public Long getTransactionTime() {
- return this.transactionTime;
- }
-
- public String getSymbol() {
- return this.symbol;
- }
-
- public List getOrderReports() {
- return orderReports;
- }
-
- // Setter
- public void setOrderListId(Long orderListId) {
- this.orderListId = orderListId;
- }
-
- public void setContingencyType(ContingencyType contingencyType) {
- this.contingencyType = contingencyType;
- }
-
- public void setListStatusType(OCOStatus listStatusType) {
- this.listStatusType = listStatusType;
- }
-
- public void setListOrderStatus(OCOOrderStatus listOrderStatus) {
- this.listOrderStatus = listOrderStatus;
- }
-
- public void setListClientOrderId(String listClientOrderId) {
- this.listClientOrderId = listClientOrderId;
- }
-
- public void setTransactionTime(Long transactionTime) {
- this.transactionTime = transactionTime;
- }
-
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
-
- public void setOrderReports(List orderReports) {
- this.orderReports = orderReports;
- }
+ private Long orderListId;
+ private ContingencyType contingencyType;
+ private OCOStatus listStatusType;
+ private OCOOrderStatus listOrderStatus;
+ private String listClientOrderId;
+ private Long transactionTime;
+ private String symbol;
+ private List orderReports;
+
+ // Getters
+ public Long getOrderListId() {
+ return this.orderListId;
+ }
+
+ public ContingencyType getContingencyType() {
+ return this.contingencyType;
+ }
+
+ public OCOStatus getListStatusType() {
+ return this.listStatusType;
+ }
+
+ public OCOOrderStatus getListOrderStatus() {
+ return this.listOrderStatus;
+ }
+
+ public String getListClientOrderId() {
+ return this.listClientOrderId;
+ }
+
+ public Long getTransactionTime() {
+ return this.transactionTime;
+ }
+
+ public String getSymbol() {
+ return this.symbol;
+ }
+
+ public List getOrderReports() {
+ return orderReports;
+ }
+
+ // Setter
+ public void setOrderListId(Long orderListId) {
+ this.orderListId = orderListId;
+ }
+
+ public void setContingencyType(ContingencyType contingencyType) {
+ this.contingencyType = contingencyType;
+ }
+
+ public void setListStatusType(OCOStatus listStatusType) {
+ this.listStatusType = listStatusType;
+ }
+
+ public void setListOrderStatus(OCOOrderStatus listOrderStatus) {
+ this.listOrderStatus = listOrderStatus;
+ }
+
+ public void setListClientOrderId(String listClientOrderId) {
+ this.listClientOrderId = listClientOrderId;
+ }
+
+ public void setTransactionTime(Long transactionTime) {
+ this.transactionTime = transactionTime;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public void setOrderReports(List orderReports) {
+ this.orderReports = orderReports;
+ }
}
diff --git a/src/main/java/com/binance/api/client/domain/account/NewOrder.java b/src/main/java/com/binance/api/client/domain/account/NewOrder.java
index 6c592219a..607e163bc 100755
--- a/src/main/java/com/binance/api/client/domain/account/NewOrder.java
+++ b/src/main/java/com/binance/api/client/domain/account/NewOrder.java
@@ -270,20 +270,20 @@ public static NewOrder limitSell(String symbol, TimeInForce timeInForce, String
@Override
public String toString() {
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("symbol", symbol)
- .append("side", side)
- .append("type", type)
- .append("timeInForce", timeInForce)
- .append("quantity", quantity)
- .append("quoteOrderQty", quoteOrderQty)
- .append("price", price)
- .append("newClientOrderId", newClientOrderId)
- .append("stopPrice", stopPrice)
- .append("stopLimitPrice", stopLimitPrice)
- .append("icebergQty", icebergQty)
- .append("newOrderRespType", newOrderRespType)
- .append("recvWindow", recvWindow)
- .append("timestamp", timestamp)
- .toString();
+ .append("symbol", symbol)
+ .append("side", side)
+ .append("type", type)
+ .append("timeInForce", timeInForce)
+ .append("quantity", quantity)
+ .append("quoteOrderQty", quoteOrderQty)
+ .append("price", price)
+ .append("newClientOrderId", newClientOrderId)
+ .append("stopPrice", stopPrice)
+ .append("stopLimitPrice", stopLimitPrice)
+ .append("icebergQty", icebergQty)
+ .append("newOrderRespType", newOrderRespType)
+ .append("recvWindow", recvWindow)
+ .append("timestamp", timestamp)
+ .toString();
}
}
diff --git a/src/main/java/com/binance/api/client/domain/account/NewOrderResponseType.java b/src/main/java/com/binance/api/client/domain/account/NewOrderResponseType.java
index fe1d00e55..b1a7fe924 100755
--- a/src/main/java/com/binance/api/client/domain/account/NewOrderResponseType.java
+++ b/src/main/java/com/binance/api/client/domain/account/NewOrderResponseType.java
@@ -4,12 +4,13 @@
/**
* Desired response type of NewOrder requests.
+ *
* @see NewOrderResponse
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public enum NewOrderResponseType {
- ACK,
- RESULT,
- FULL
+ ACK,
+ RESULT,
+ FULL
}
diff --git a/src/main/java/com/binance/api/client/domain/account/Order.java b/src/main/java/com/binance/api/client/domain/account/Order.java
index 881efd6dc..bcae3c189 100755
--- a/src/main/java/com/binance/api/client/domain/account/Order.java
+++ b/src/main/java/com/binance/api/client/domain/account/Order.java
@@ -253,24 +253,24 @@ public void setOrigQuoteOrderQty(String origQuoteOrderQty) {
@Override
public String toString() {
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("symbol", symbol)
- .append("orderId", orderId)
- .append("clientOrderId", clientOrderId)
- .append("price", price)
- .append("origQty", origQty)
- .append("executedQty", executedQty)
- .append("status", status)
- .append("timeInForce", timeInForce)
- .append("type", type)
- .append("side", side)
- .append("stopPrice", stopPrice)
- .append("stopLimitPrice", stopLimitPrice)
- .append("icebergQty", icebergQty)
- .append("time", time)
- .append("cummulativeQuoteQty", cummulativeQuoteQty)
- .append("updateTime", updateTime)
- .append("isWorking", working)
- .append("origQuoteOrderQty", origQuoteOrderQty)
- .toString();
+ .append("symbol", symbol)
+ .append("orderId", orderId)
+ .append("clientOrderId", clientOrderId)
+ .append("price", price)
+ .append("origQty", origQty)
+ .append("executedQty", executedQty)
+ .append("status", status)
+ .append("timeInForce", timeInForce)
+ .append("type", type)
+ .append("side", side)
+ .append("stopPrice", stopPrice)
+ .append("stopLimitPrice", stopLimitPrice)
+ .append("icebergQty", icebergQty)
+ .append("time", time)
+ .append("cummulativeQuoteQty", cummulativeQuoteQty)
+ .append("updateTime", updateTime)
+ .append("isWorking", working)
+ .append("origQuoteOrderQty", origQuoteOrderQty)
+ .toString();
}
}
diff --git a/src/main/java/com/binance/api/client/domain/account/OrderList.java b/src/main/java/com/binance/api/client/domain/account/OrderList.java
index 2ee3674d0..7a70f1040 100755
--- a/src/main/java/com/binance/api/client/domain/account/OrderList.java
+++ b/src/main/java/com/binance/api/client/domain/account/OrderList.java
@@ -13,101 +13,101 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderList {
- /**
- * Order id.
- */
- private Long orderListId;
+ /**
+ * Order id.
+ */
+ private Long orderListId;
- private ContingencyType contingencyType;
+ private ContingencyType contingencyType;
- private OCOStatus listStatusType;
+ private OCOStatus listStatusType;
- private OCOOrderStatus listOrderStatus;
+ private OCOOrderStatus listOrderStatus;
- private String listClientOrderId;
+ private String listClientOrderId;
- private Long transactionTime;
+ private Long transactionTime;
- private String symbol;
+ private String symbol;
- private List orders;
+ private List orders;
- public Long getOrderListId() {
- return orderListId;
- }
+ public Long getOrderListId() {
+ return orderListId;
+ }
- public void setOrderListId(Long orderListId) {
- this.orderListId = orderListId;
- }
+ public void setOrderListId(Long orderListId) {
+ this.orderListId = orderListId;
+ }
- public ContingencyType getContingencyType() {
- return contingencyType;
- }
+ public ContingencyType getContingencyType() {
+ return contingencyType;
+ }
- public void setContingencyType(ContingencyType contingencyType) {
- this.contingencyType = contingencyType;
- }
+ public void setContingencyType(ContingencyType contingencyType) {
+ this.contingencyType = contingencyType;
+ }
- public OCOStatus getListStatusType() {
- return listStatusType;
- }
+ public OCOStatus getListStatusType() {
+ return listStatusType;
+ }
- public void setListStatusType(OCOStatus listStatusType) {
- this.listStatusType = listStatusType;
- }
+ public void setListStatusType(OCOStatus listStatusType) {
+ this.listStatusType = listStatusType;
+ }
- public OCOOrderStatus getListOrderStatus() {
- return listOrderStatus;
- }
+ public OCOOrderStatus getListOrderStatus() {
+ return listOrderStatus;
+ }
- public void setListOrderStatus(OCOOrderStatus listOrderStatus) {
- this.listOrderStatus = listOrderStatus;
- }
+ public void setListOrderStatus(OCOOrderStatus listOrderStatus) {
+ this.listOrderStatus = listOrderStatus;
+ }
- public String getListClientOrderId() {
- return listClientOrderId;
- }
+ public String getListClientOrderId() {
+ return listClientOrderId;
+ }
- public void setListClientOrderId(String listClientOrderId) {
- this.listClientOrderId = listClientOrderId;
- }
+ public void setListClientOrderId(String listClientOrderId) {
+ this.listClientOrderId = listClientOrderId;
+ }
- public Long getTransactionTime() {
- return transactionTime;
- }
+ public Long getTransactionTime() {
+ return transactionTime;
+ }
- public void setTransactionTime(Long transactionTime) {
- this.transactionTime = transactionTime;
- }
+ public void setTransactionTime(Long transactionTime) {
+ this.transactionTime = transactionTime;
+ }
- public String getSymbol() {
- return symbol;
- }
+ public String getSymbol() {
+ return symbol;
+ }
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
- public List getOrders() {
- return orders;
- }
+ public List getOrders() {
+ return orders;
+ }
- public void setOrders(List orders) {
- this.orders = orders;
- }
+ public void setOrders(List orders) {
+ this.orders = orders;
+ }
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("orderListId", orderListId)
- .append("contingencyType", contingencyType)
- .append("listStatusType", listStatusType)
- .append("listOrderStatus", listOrderStatus)
- .append("listClientOrderId", listClientOrderId)
- .append("transactionTime", transactionTime)
- .append("symbol", symbol)
- .append("orders", orders)
- .toString();
- }
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
+ .append("orderListId", orderListId)
+ .append("contingencyType", contingencyType)
+ .append("listStatusType", listStatusType)
+ .append("listOrderStatus", listOrderStatus)
+ .append("listClientOrderId", listClientOrderId)
+ .append("transactionTime", transactionTime)
+ .append("symbol", symbol)
+ .append("orders", orders)
+ .toString();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/OrderReport.java b/src/main/java/com/binance/api/client/domain/account/OrderReport.java
index 041876861..dffe00503 100755
--- a/src/main/java/com/binance/api/client/domain/account/OrderReport.java
+++ b/src/main/java/com/binance/api/client/domain/account/OrderReport.java
@@ -9,164 +9,164 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderReport {
- /**
- * Order symbol.
- */
- private String symbol;
+ /**
+ * Order symbol.
+ */
+ private String symbol;
- /**
- * Order id.
- */
- private Long orderId;
+ /**
+ * Order id.
+ */
+ private Long orderId;
- private Long orderListId;
+ private Long orderListId;
- /**
- * This will be either a generated one, or the newClientOrderId parameter
- * which was passed when creating the new order.
- */
- private String clientOrderId;
+ /**
+ * This will be either a generated one, or the newClientOrderId parameter
+ * which was passed when creating the new order.
+ */
+ private String clientOrderId;
- private String origClientOrderId;
+ private String origClientOrderId;
- private Long transactTime;
+ private Long transactTime;
- private String price;
+ private String price;
- private String origQty;
+ private String origQty;
- private String executedQty;
+ private String executedQty;
- private String cummulativeQuoteQty;
+ private String cummulativeQuoteQty;
- private OrderStatus status;
+ private OrderStatus status;
- private TimeInForce timeInForce;
+ private TimeInForce timeInForce;
- private OrderType type;
+ private OrderType type;
- private OrderSide side;
+ private OrderSide side;
- private String stopPrice;
+ private String stopPrice;
- public String getSymbol() {
- return symbol;
- }
+ public String getSymbol() {
+ return symbol;
+ }
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
- public Long getOrderId() {
- return orderId;
- }
+ public Long getOrderId() {
+ return orderId;
+ }
- public void setOrderId(Long orderId) {
- this.orderId = orderId;
- }
+ public void setOrderId(Long orderId) {
+ this.orderId = orderId;
+ }
- public Long getOrderListId() {
- return orderListId;
- }
+ public Long getOrderListId() {
+ return orderListId;
+ }
- public void setOrderListId(Long orderListId) {
- this.orderListId = orderListId;
- }
+ public void setOrderListId(Long orderListId) {
+ this.orderListId = orderListId;
+ }
- public String getClientOrderId() {
- return clientOrderId;
- }
+ public String getClientOrderId() {
+ return clientOrderId;
+ }
- public void setClientOrderId(String clientOrderId) {
- this.clientOrderId = clientOrderId;
- }
+ public void setClientOrderId(String clientOrderId) {
+ this.clientOrderId = clientOrderId;
+ }
- public String getOrigClientOrderId() {
- return origClientOrderId;
- }
+ public String getOrigClientOrderId() {
+ return origClientOrderId;
+ }
- public void setOrigClientOrderId(String origClientOrderId) {
- this.origClientOrderId = origClientOrderId;
- }
+ public void setOrigClientOrderId(String origClientOrderId) {
+ this.origClientOrderId = origClientOrderId;
+ }
- public Long getTransactTime() {
- return transactTime;
- }
+ public Long getTransactTime() {
+ return transactTime;
+ }
- public void setTransactTime(Long transactTime) {
- this.transactTime = transactTime;
- }
+ public void setTransactTime(Long transactTime) {
+ this.transactTime = transactTime;
+ }
- public String getPrice() {
- return price;
- }
+ public String getPrice() {
+ return price;
+ }
- public void setPrice(String price) {
- this.price = price;
- }
+ public void setPrice(String price) {
+ this.price = price;
+ }
- public String getOrigQty() {
- return origQty;
- }
+ public String getOrigQty() {
+ return origQty;
+ }
- public void setOrigQty(String origQty) {
- this.origQty = origQty;
- }
+ public void setOrigQty(String origQty) {
+ this.origQty = origQty;
+ }
- public String getExecutedQty() {
- return executedQty;
- }
+ public String getExecutedQty() {
+ return executedQty;
+ }
- public void setExecutedQty(String executedQty) {
- this.executedQty = executedQty;
- }
+ public void setExecutedQty(String executedQty) {
+ this.executedQty = executedQty;
+ }
- public String getCummulativeQuoteQty() {
- return cummulativeQuoteQty;
- }
+ public String getCummulativeQuoteQty() {
+ return cummulativeQuoteQty;
+ }
- public void setCummulativeQuoteQty(String cummulativeQuoteQty) {
- this.cummulativeQuoteQty = cummulativeQuoteQty;
- }
+ public void setCummulativeQuoteQty(String cummulativeQuoteQty) {
+ this.cummulativeQuoteQty = cummulativeQuoteQty;
+ }
- public OrderStatus getStatus() {
- return status;
- }
+ public OrderStatus getStatus() {
+ return status;
+ }
- public void setStatus(OrderStatus status) {
- this.status = status;
- }
+ public void setStatus(OrderStatus status) {
+ this.status = status;
+ }
- public TimeInForce getTimeInForce() {
- return timeInForce;
- }
+ public TimeInForce getTimeInForce() {
+ return timeInForce;
+ }
- public void setTimeInForce(TimeInForce timeInForce) {
- this.timeInForce = timeInForce;
- }
+ public void setTimeInForce(TimeInForce timeInForce) {
+ this.timeInForce = timeInForce;
+ }
- public OrderType getType() {
- return type;
- }
+ public OrderType getType() {
+ return type;
+ }
- public void setType(OrderType type) {
- this.type = type;
- }
+ public void setType(OrderType type) {
+ this.type = type;
+ }
- public OrderSide getSide() {
- return side;
- }
+ public OrderSide getSide() {
+ return side;
+ }
- public void setSide(OrderSide side) {
- this.side = side;
- }
+ public void setSide(OrderSide side) {
+ this.side = side;
+ }
- public String getStopPrice() {
- return stopPrice;
- }
+ public String getStopPrice() {
+ return stopPrice;
+ }
- public void setStopPrice(String stopPrice) {
- this.stopPrice = stopPrice;
- }
+ public void setStopPrice(String stopPrice) {
+ this.stopPrice = stopPrice;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/Pool.java b/src/main/java/com/binance/api/client/domain/account/Pool.java
index 413d301f2..2b6e72986 100755
--- a/src/main/java/com/binance/api/client/domain/account/Pool.java
+++ b/src/main/java/com/binance/api/client/domain/account/Pool.java
@@ -4,40 +4,40 @@
public class Pool {
- private String poolId;
- private String poolName;
- private List assets;
-
- public String getPoolId() {
- return poolId;
- }
-
- public void setPoolId(String poolId) {
- this.poolId = poolId;
- }
-
- public List getAssets() {
- return assets;
- }
-
- public void setAssets(List assets) {
- this.assets = assets;
- }
-
- public String getPoolName() {
- return poolName;
- }
-
- public void setPoolName(String poolName) {
- this.poolName = poolName;
- }
-
- @Override
- public String toString() {
- return "Pool{" +
- "poolId='" + poolId + '\'' +
- ", poolName='" + poolName + '\'' +
- ", assets=" + assets +
- '}';
- }
+ private String poolId;
+ private String poolName;
+ private List assets;
+
+ public String getPoolId() {
+ return poolId;
+ }
+
+ public void setPoolId(String poolId) {
+ this.poolId = poolId;
+ }
+
+ public List getAssets() {
+ return assets;
+ }
+
+ public void setAssets(List assets) {
+ this.assets = assets;
+ }
+
+ public String getPoolName() {
+ return poolName;
+ }
+
+ public void setPoolName(String poolName) {
+ this.poolName = poolName;
+ }
+
+ @Override
+ public String toString() {
+ return "Pool{" +
+ "poolId='" + poolId + '\'' +
+ ", poolName='" + poolName + '\'' +
+ ", assets=" + assets +
+ '}';
+ }
}
diff --git a/src/main/java/com/binance/api/client/domain/account/Repay.java b/src/main/java/com/binance/api/client/domain/account/Repay.java
deleted file mode 100755
index 22f3e7b0e..000000000
--- a/src/main/java/com/binance/api/client/domain/account/Repay.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.domain.LoanStatus;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class Repay {
-
- private String amount;
- private String asset;
- private String interest;
- private String principal;
- LoanStatus status;
- private long timestamp;
- private String txId;
-
- public String getAmount() {
- return amount;
- }
-
- public void setAmount(String amount) {
- this.amount = amount;
- }
-
- public String getAsset() {
- return asset;
- }
-
- public void setAsset(String asset) {
- this.asset = asset;
- }
-
- public String getInterest() {
- return interest;
- }
-
- public void setInterest(String interest) {
- this.interest = interest;
- }
-
- public String getPrincipal() {
- return principal;
- }
-
- public void setPrincipal(String principal) {
- this.principal = principal;
- }
-
- public LoanStatus getStatus() {
- return status;
- }
-
- public void setStatus(LoanStatus status) {
- this.status = status;
- }
-
- public long getTimestamp() {
- return timestamp;
- }
-
- public void setTimestamp(long timestamp) {
- this.timestamp = timestamp;
- }
-
- public String getTxId() {
- return txId;
- }
-
- public void setTxId(String txId) {
- this.txId = txId;
- }
-
- @Override
- public String toString() {
- return "Repay{" +
- "amount='" + amount + '\'' +
- ", asset='" + asset + '\'' +
- ", interest='" + interest + '\'' +
- ", principal='" + principal + '\'' +
- ", status=" + status +
- ", timestamp=" + timestamp +
- ", txId='" + txId + '\'' +
- '}';
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/RepayQueryResult.java b/src/main/java/com/binance/api/client/domain/account/RepayQueryResult.java
deleted file mode 100755
index 4221e9df5..000000000
--- a/src/main/java/com/binance/api/client/domain/account/RepayQueryResult.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-import java.util.List;
-
-/**
- * History of account withdrawals.
- *
- * @see Withdraw
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class RepayQueryResult {
-
- private int total;
- private List rows;
-
- public int getTotal() {
- return total;
- }
-
- public void setTotal(int total) {
- this.total = total;
- }
-
- public List getRows() {
- return rows;
- }
-
- public void setRows(List rows) {
- this.rows = rows;
- }
-
- @Override
- public String toString() {
- return "RepayQueryResult{" +
- "total=" + total +
- ", rows=" + rows +
- '}';
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/SideEffectType.java b/src/main/java/com/binance/api/client/domain/account/SideEffectType.java
deleted file mode 100755
index 940490e16..000000000
--- a/src/main/java/com/binance/api/client/domain/account/SideEffectType.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-/**
- * Desired side-effect for margin orders:
- * NO_SIDE_EFFECT for normal trade order;
- * MARGIN_BUY for margin trade order;
- * AUTO_REPAY for making auto repayment after order filled
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public enum SideEffectType {
- NO_SIDE_EFFECT,
- MARGIN_BUY,
- AUTO_REPAY
-}
-
diff --git a/src/main/java/com/binance/api/client/domain/account/SubAccountTransfer.java b/src/main/java/com/binance/api/client/domain/account/SubAccountTransfer.java
deleted file mode 100755
index 69b7d70cf..000000000
--- a/src/main/java/com/binance/api/client/domain/account/SubAccountTransfer.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class SubAccountTransfer {
-
- /**
- * Counter party name
- */
- private String counterParty;
-
- /**
- * Counter party email
- */
- private String email;
-
- /**
- * Transfer in or transfer out
- */
- private Integer type; // 1 for transfer in, 2 for transfer out
-
- /**
- * Transfer asset
- */
- private String asset;
-
- /**
- * Quantity of transfer asset
- */
- private String qty;
-
- /**
- * Type of from account
- */
- private String fromAccountType;
-
- /**
- * Type of to account
- */
- private String toAccountType;
-
- /**
- * Transfer status
- */
- private String status;
-
- /**
- * Transfer ID
- */
- private Long tranId;
-
- /**
- * Transfer time
- */
- private Long time;
-
- // Setter
- public void setCounterParty(String counterParty) {
- this.counterParty = counterParty;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public void setType(Integer type) {
- this.type = type;
- }
-
- public void setAsset(String asset) {
- this.asset = asset;
- }
-
- public void setQty(String qty) {
- this.qty = qty;
- }
-
- public void setFromAccountType(String fromAccountType) { this.fromAccountType = fromAccountType; }
-
- public void setToAccountType(String toAccountType) { this.toAccountType = toAccountType; }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public void setTranId(Long tranId) {
- this.tranId = tranId;
- }
-
- public void setTime(Long time) {
- this.time = time;
- }
-
- // Getter
- public String getCounterParty() {
- return this.counterParty;
- }
-
- public String getEmail() {
- return this.email;
- }
-
- public Integer getType() {
- return this.type;
- }
-
- public String getAsset() {
- return this.asset;
- }
-
- public String getQty() {
- return this.qty;
- }
-
- public String getFromAccountType() { return this.fromAccountType; }
-
- public String getToAccountType() { return this.toAccountType; }
-
- public String getStatus() {
- return this.status;
- }
-
- public Long getTranId() {
- return this.tranId;
- }
-
- public Long getTime() {
- return this.time;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("counterParty", this.counterParty)
- .append("email", this.email)
- .append("type", this.type)
- .append("asset", this.asset)
- .append("qty", this.qty)
- .append("fromAccountType", this.fromAccountType)
- .append("toAccountType", this.toAccountType)
- .append("status", this.status)
- .append("tranId", this.tranId)
- .append("time", this.time)
- .toString();
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/SwapHistory.java b/src/main/java/com/binance/api/client/domain/account/SwapHistory.java
deleted file mode 100755
index b4c7c785c..000000000
--- a/src/main/java/com/binance/api/client/domain/account/SwapHistory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.binance.api.client.domain.account;
-
-public class SwapHistory {
-
- private String quoteQty;
- private Long swapTime;
- private String swapId;
- private String price;
- private String fee;
- private String baseQty;
- private String baseAsset;
- private String quoteAsset;
- private SwapStatus status;
-
- public String getQuoteQty() {
- return quoteQty;
- }
-
- public void setQuoteQty(String quoteQty) {
- this.quoteQty = quoteQty;
- }
-
- public Long getSwapTime() {
- return swapTime;
- }
-
- public void setSwapTime(Long swapTime) {
- this.swapTime = swapTime;
- }
-
- public String getSwapId() {
- return swapId;
- }
-
- public void setSwapId(String swapId) {
- this.swapId = swapId;
- }
-
- public String getPrice() {
- return price;
- }
-
- public void setPrice(String price) {
- this.price = price;
- }
-
- public String getFee() {
- return fee;
- }
-
- public void setFee(String fee) {
- this.fee = fee;
- }
-
- public String getBaseQty() {
- return baseQty;
- }
-
- public void setBaseQty(String baseQty) {
- this.baseQty = baseQty;
- }
-
- public String getBaseAsset() {
- return baseAsset;
- }
-
- public void setBaseAsset(String baseAsset) {
- this.baseAsset = baseAsset;
- }
-
- public String getQuoteAsset() {
- return quoteAsset;
- }
-
- public void setQuoteAsset(String quoteAsset) {
- this.quoteAsset = quoteAsset;
- }
-
- public SwapStatus getStatus() {
- return status;
- }
-
- public void setStatus(SwapStatus status) {
- this.status = status;
- }
-
- @Override
- public String toString() {
- return "SwapHistory{" +
- "quoteQty='" + quoteQty + '\'' +
- ", swapTime=" + swapTime +
- ", swapId='" + swapId + '\'' +
- ", price='" + price + '\'' +
- ", fee='" + fee + '\'' +
- ", baseQty='" + baseQty + '\'' +
- ", baseAsset='" + baseAsset + '\'' +
- ", quoteAsset='" + quoteAsset + '\'' +
- ", status='" + status + '\'' +
- '}';
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/SwapQuote.java b/src/main/java/com/binance/api/client/domain/account/SwapQuote.java
deleted file mode 100755
index c776750f8..000000000
--- a/src/main/java/com/binance/api/client/domain/account/SwapQuote.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.binance.api.client.domain.account;
-
-public class SwapQuote {
- private String quoteQty;
- private String price;
- private String fee;
- private String baseQty;
- private String baseAsset;
- private String slippage;
- private String quoteAsset;
-
- public String getQuoteQty() {
- return quoteQty;
- }
-
- public void setQuoteQty(String quoteQty) {
- this.quoteQty = quoteQty;
- }
-
- public String getPrice() {
- return price;
- }
-
- public void setPrice(String price) {
- this.price = price;
- }
-
- public String getFee() {
- return fee;
- }
-
- public void setFee(String fee) {
- this.fee = fee;
- }
-
- public String getBaseQty() {
- return baseQty;
- }
-
- public void setBaseQty(String baseQty) {
- this.baseQty = baseQty;
- }
-
- public String getBaseAsset() {
- return baseAsset;
- }
-
- public void setBaseAsset(String baseAsset) {
- this.baseAsset = baseAsset;
- }
-
- public String getSlippage() {
- return slippage;
- }
-
- public void setSlippage(String slippage) {
- this.slippage = slippage;
- }
-
- public String getQuoteAsset() {
- return quoteAsset;
- }
-
- public void setQuoteAsset(String quoteAsset) {
- this.quoteAsset = quoteAsset;
- }
-
- @Override
- public String toString() {
- return "SwapQuote{" +
- "quoteQty='" + quoteQty + '\'' +
- ", price='" + price + '\'' +
- ", fee='" + fee + '\'' +
- ", baseQty='" + baseQty + '\'' +
- ", baseAsset='" + baseAsset + '\'' +
- ", slippage='" + slippage + '\'' +
- ", quoteAsset='" + quoteAsset + '\'' +
- '}';
- }
-}
-
diff --git a/src/main/java/com/binance/api/client/domain/account/SwapRecord.java b/src/main/java/com/binance/api/client/domain/account/SwapRecord.java
deleted file mode 100755
index 085af3068..000000000
--- a/src/main/java/com/binance/api/client/domain/account/SwapRecord.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.binance.api.client.domain.account;
-
-public class SwapRecord {
-
- private String swapId;
-
- public String getSwapId() {
- return swapId;
- }
-
- public void setSwapId(String swapId) {
- this.swapId = swapId;
- }
-
- @Override
- public String toString() {
- return "SwapRecord{" +
- "swapId='" + swapId + '\'' +
- '}';
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/SwapStatus.java b/src/main/java/com/binance/api/client/domain/account/SwapStatus.java
deleted file mode 100755
index b1a0dc9eb..000000000
--- a/src/main/java/com/binance/api/client/domain/account/SwapStatus.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonValue;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-public enum SwapStatus {
- PENDING,
- SUCCESS,
- FAILED;
-
- @JsonValue
- public int toValue() {
- return ordinal();
- }
-}
-
-
diff --git a/src/main/java/com/binance/api/client/domain/account/TradeHistoryItem.java b/src/main/java/com/binance/api/client/domain/account/TradeHistoryItem.java
index babc10760..e7b5ec268 100755
--- a/src/main/java/com/binance/api/client/domain/account/TradeHistoryItem.java
+++ b/src/main/java/com/binance/api/client/domain/account/TradeHistoryItem.java
@@ -10,95 +10,95 @@
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class TradeHistoryItem {
- /**
- * Trade id.
- */
- private long id;
-
- /**
- * Price.
- */
- private String price;
-
- /**
- * Quantity.
- */
- private String qty;
-
- /**
- * Trade execution time.
- */
- private long time;
-
- /**
- * Is buyer maker ?
- */
- @JsonProperty("isBuyerMaker")
- private boolean isBuyerMaker;
-
- /**
- * Is best match ?
- */
- @JsonProperty("isBestMatch")
- private boolean isBestMatch;
-
- public long getId() {
- return id;
- }
-
- public void setId(long id) {
- this.id = id;
- }
-
- public String getPrice() {
- return price;
- }
-
- public void setPrice(String price) {
- this.price = price;
- }
-
- public String getQty() {
- return qty;
- }
-
- public void setQty(String qty) {
- this.qty = qty;
- }
-
- public long getTime() {
- return time;
- }
-
- public void setTime(long time) {
- this.time = time;
- }
-
- public boolean isBuyerMaker() {
- return isBuyerMaker;
- }
-
- public void setBuyerMaker(boolean buyerMaker) {
- isBuyerMaker = buyerMaker;
- }
-
- public boolean isBestMatch() {
- return isBestMatch;
- }
-
- public void setBestMatch(boolean bestMatch) {
- isBestMatch = bestMatch;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("id", id)
- .append("price", price)
- .append("qty", qty)
- .append("time", time)
- .append("isBuyerMaker", isBuyerMaker)
- .append("isBestMatch", isBestMatch)
- .toString();
- }
+ /**
+ * Trade id.
+ */
+ private long id;
+
+ /**
+ * Price.
+ */
+ private String price;
+
+ /**
+ * Quantity.
+ */
+ private String qty;
+
+ /**
+ * Trade execution time.
+ */
+ private long time;
+
+ /**
+ * Is buyer maker ?
+ */
+ @JsonProperty("isBuyerMaker")
+ private boolean isBuyerMaker;
+
+ /**
+ * Is best match ?
+ */
+ @JsonProperty("isBestMatch")
+ private boolean isBestMatch;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
+
+ public String getQty() {
+ return qty;
+ }
+
+ public void setQty(String qty) {
+ this.qty = qty;
+ }
+
+ public long getTime() {
+ return time;
+ }
+
+ public void setTime(long time) {
+ this.time = time;
+ }
+
+ public boolean isBuyerMaker() {
+ return isBuyerMaker;
+ }
+
+ public void setBuyerMaker(boolean buyerMaker) {
+ isBuyerMaker = buyerMaker;
+ }
+
+ public boolean isBestMatch() {
+ return isBestMatch;
+ }
+
+ public void setBestMatch(boolean bestMatch) {
+ isBestMatch = bestMatch;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
+ .append("id", id)
+ .append("price", price)
+ .append("qty", qty)
+ .append("time", time)
+ .append("isBuyerMaker", isBuyerMaker)
+ .append("isBestMatch", isBestMatch)
+ .toString();
+ }
}
diff --git a/src/main/java/com/binance/api/client/domain/account/TransferResult.java b/src/main/java/com/binance/api/client/domain/account/TransferResult.java
index a07f12c56..e678b2999 100755
--- a/src/main/java/com/binance/api/client/domain/account/TransferResult.java
+++ b/src/main/java/com/binance/api/client/domain/account/TransferResult.java
@@ -11,81 +11,80 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class TransferResult {
- private String amount;
+ private String amount;
- private String fromAsset;
+ private String fromAsset;
- /**
- * Order timestamp.
- */
- private long operateTime;
+ /**
+ * Order timestamp.
+ */
+ private long operateTime;
- private String serviceChargeAmount;
+ private String serviceChargeAmount;
- private long tranId;
+ private long tranId;
- private String transferedAmount;
+ private String transferedAmount;
+ public String getAmount() {
+ return amount;
+ }
- public String getAmount() {
- return amount;
- }
+ public void setAmount(String amount) {
+ this.amount = amount;
+ }
- public void setAmount(String amount) {
- this.amount = amount;
- }
+ public String getFromAsset() {
+ return fromAsset;
+ }
- public String getFromAsset() {
- return fromAsset;
- }
+ public void setFromAsset(String fromAsset) {
+ this.fromAsset = fromAsset;
+ }
- public void setFromAsset(String fromAsset) {
- this.fromAsset = fromAsset;
- }
+ public long getOperateTime() {
+ return operateTime;
+ }
- public long getOperateTime() {
- return operateTime;
- }
+ public void setOperateTime(long operateTime) {
+ this.operateTime = operateTime;
+ }
- public void setOperateTime(long operateTime) {
- this.operateTime = operateTime;
- }
+ public String getServiceChargeAmount() {
+ return serviceChargeAmount;
+ }
- public String getServiceChargeAmount() {
- return serviceChargeAmount;
- }
+ public void setServiceChargeAmount(String serviceChargeAmount) {
+ this.serviceChargeAmount = serviceChargeAmount;
+ }
- public void setServiceChargeAmount(String serviceChargeAmount) {
- this.serviceChargeAmount = serviceChargeAmount;
- }
+ public long getTranId() {
+ return tranId;
+ }
- public long getTranId() {
- return tranId;
- }
+ public void setTranId(long tranId) {
+ this.tranId = tranId;
+ }
- public void setTranId(long tranId) {
- this.tranId = tranId;
- }
+ public String getTransferedAmount() {
+ return transferedAmount;
+ }
- public String getTransferedAmount() {
- return transferedAmount;
- }
+ public void setTransferedAmount(String transferedAmount) {
+ this.transferedAmount = transferedAmount;
+ }
- public void setTransferedAmount(String transferedAmount) {
- this.transferedAmount = transferedAmount;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("amount", amount)
- .append("fromAsset", fromAsset)
- .append("operateTime", operateTime)
- .append("serviceChargeAmount", serviceChargeAmount)
- .append("tranId", tranId)
- .append("transderedAmount", transferedAmount)
- .toString();
- }
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
+ .append("amount", amount)
+ .append("fromAsset", fromAsset)
+ .append("operateTime", operateTime)
+ .append("serviceChargeAmount", serviceChargeAmount)
+ .append("tranId", tranId)
+ .append("transderedAmount", transferedAmount)
+ .toString();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/Withdraw.java b/src/main/java/com/binance/api/client/domain/account/Withdraw.java
index 69635ee99..53b6c2bec 100755
--- a/src/main/java/com/binance/api/client/domain/account/Withdraw.java
+++ b/src/main/java/com/binance/api/client/domain/account/Withdraw.java
@@ -5,7 +5,7 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
- * A withdraw that was done to a Binance account.
+ * A withdrawal from a Binance account.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class Withdraw {
@@ -23,12 +23,10 @@ public class Withdraw {
/**
* Symbol.
*/
- private String asset;
+ private String coin;
private String applyTime;
- private String successTime;
-
/**
* Transaction id.
*/
@@ -60,12 +58,12 @@ public void setAddress(String address) {
this.address = address;
}
- public String getAsset() {
- return asset;
+ public String getCoin() {
+ return coin;
}
- public void setAsset(String asset) {
- this.asset = asset;
+ public void setCoin(String coin) {
+ this.coin = coin;
}
public String getApplyTime() {
@@ -76,14 +74,6 @@ public void setApplyTime(String applyTime) {
this.applyTime = applyTime;
}
- public String getSuccessTime() {
- return successTime;
- }
-
- public void setSuccessTime(String successTime) {
- this.successTime = successTime;
- }
-
public String getTxId() {
return txId;
}
@@ -113,9 +103,8 @@ public String toString() {
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
.append("amount", amount)
.append("address", address)
- .append("asset", asset)
+ .append("coin", coin)
.append("applyTime", applyTime)
- .append("successTime", successTime)
.append("txId", txId)
.append("id", id)
.append("status", status)
diff --git a/src/main/java/com/binance/api/client/domain/account/WithdrawHistory.java b/src/main/java/com/binance/api/client/domain/account/WithdrawHistory.java
deleted file mode 100755
index df57f89a5..000000000
--- a/src/main/java/com/binance/api/client/domain/account/WithdrawHistory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.binance.api.client.domain.account;
-
-import com.binance.api.client.constant.BinanceApiConstants;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-import java.util.List;
-
-/**
- * History of account withdrawals.
- *
- * @see Withdraw
- */
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class WithdrawHistory {
-
- private List withdrawList;
-
- private boolean success;
-
- public List getWithdrawList() {
- return withdrawList;
- }
-
- public void setWithdrawList(List withdrawList) {
- this.withdrawList = withdrawList;
- }
-
- public boolean isSuccess() {
- return success;
- }
-
- public void setSuccess(boolean success) {
- this.success = success;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("withdrawList", withdrawList)
- .append("success", success)
- .toString();
- }
-}
diff --git a/src/main/java/com/binance/api/client/domain/account/WithdrawResult.java b/src/main/java/com/binance/api/client/domain/account/WithdrawResult.java
index b9ebded80..7f9881a1b 100755
--- a/src/main/java/com/binance/api/client/domain/account/WithdrawResult.java
+++ b/src/main/java/com/binance/api/client/domain/account/WithdrawResult.java
@@ -5,58 +5,58 @@
import org.apache.commons.lang3.builder.ToStringStyle;
/**
- * A withdraw result that was done to a Binance account.
+ * A withdrawal result that was done to a Binance account.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class WithdrawResult {
- /**
- * Withdraw message.
- */
- private String msg;
-
- /**
- * Withdraw success.
- */
- private boolean success;
-
- /**
- * Withdraw id.
- */
- private String id;
-
- public String getMsg() {
- return msg;
- }
-
- public void setMsg(String msg) {
- this.msg = msg;
- }
-
- public boolean isSuccess() {
- return success;
- }
-
- public void setSuccess(boolean success) {
- this.success = success;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
- .append("msg", msg)
- .append("success", success)
- .append("id", id)
- .toString();
- }
+ /**
+ * Withdraw message.
+ */
+ private String msg;
+
+ /**
+ * Withdraw success.
+ */
+ private boolean success;
+
+ /**
+ * Withdraw id.
+ */
+ private String id;
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ public boolean isSuccess() {
+ return success;
+ }
+
+ public void setSuccess(boolean success) {
+ this.success = success;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+ .append("msg", msg)
+ .append("success", success)
+ .append("id", id)
+ .toString();
+ }
}
diff --git a/src/main/java/com/binance/api/client/domain/account/request/AllOrderListRequest.java b/src/main/java/com/binance/api/client/domain/account/request/AllOrderListRequest.java
index 6d7be4740..d5ad35a29 100755
--- a/src/main/java/com/binance/api/client/domain/account/request/AllOrderListRequest.java
+++ b/src/main/java/com/binance/api/client/domain/account/request/AllOrderListRequest.java
@@ -6,72 +6,72 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class AllOrderListRequest {
- private static final Integer DEFAULT_LIMIT = 500;
+ private static final Integer DEFAULT_LIMIT = 500;
- private Long fromId;
+ private Long fromId;
- private Long startTime;
+ private Long startTime;
- private Long endTime;
+ private Long endTime;
- private Integer limit;
+ private Integer limit;
- private Long recvWindow;
+ private Long recvWindow;
- private Long timestamp;
+ private Long timestamp;
- public AllOrderListRequest() {
- this.limit = DEFAULT_LIMIT;
- this.timestamp = System.currentTimeMillis();
- this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
- }
+ public AllOrderListRequest() {
+ this.limit = DEFAULT_LIMIT;
+ this.timestamp = System.currentTimeMillis();
+ this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
+ }
- public Long getFromId() {
- return fromId;
- }
+ public Long getFromId() {
+ return fromId;
+ }
- public void setFromId(Long fromId) {
- this.fromId = fromId;
- }
+ public void setFromId(Long fromId) {
+ this.fromId = fromId;
+ }
- public Long getStartTime() {
- return startTime;
- }
+ public Long getStartTime() {
+ return startTime;
+ }
- public void setStartTime(Long startTime) {
- this.startTime = startTime;
- }
+ public void setStartTime(Long startTime) {
+ this.startTime = startTime;
+ }
- public Long getEndTime() {
- return endTime;
- }
+ public Long getEndTime() {
+ return endTime;
+ }
- public void setEndTime(Long endTime) {
- this.endTime = endTime;
- }
+ public void setEndTime(Long endTime) {
+ this.endTime = endTime;
+ }
- public Integer getLimit() {
- return limit;
- }
+ public Integer getLimit() {
+ return limit;
+ }
- public void setLimit(Integer limit) {
- this.limit = limit;
- }
+ public void setLimit(Integer limit) {
+ this.limit = limit;
+ }
- public Long getRecvWindow() {
- return recvWindow;
- }
+ public Long getRecvWindow() {
+ return recvWindow;
+ }
- public void setRecvWindow(Long recvWindow) {
- this.recvWindow = recvWindow;
- }
+ public void setRecvWindow(Long recvWindow) {
+ this.recvWindow = recvWindow;
+ }
- public Long getTimestamp() {
- return timestamp;
- }
+ public Long getTimestamp() {
+ return timestamp;
+ }
- public void setTimestamp(Long timestamp) {
- this.timestamp = timestamp;
- }
+ public void setTimestamp(Long timestamp) {
+ this.timestamp = timestamp;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/request/CancelOrderListRequest.java b/src/main/java/com/binance/api/client/domain/account/request/CancelOrderListRequest.java
index 07d057ba3..5adf29f64 100755
--- a/src/main/java/com/binance/api/client/domain/account/request/CancelOrderListRequest.java
+++ b/src/main/java/com/binance/api/client/domain/account/request/CancelOrderListRequest.java
@@ -6,78 +6,78 @@
public class CancelOrderListRequest {
- private String symbol;
+ private String symbol;
- private Long orderListId;
+ private Long orderListId;
- private String listClientOrderId;
+ private String listClientOrderId;
- /**
- * Used to uniquely identify this cancel. Automatically generated by default
- */
- private String newClientOrderId;
+ /**
+ * Used to uniquely identify this cancel. Automatically generated by default
+ */
+ private String newClientOrderId;
- private Long recvWindow;
+ private Long recvWindow;
- private Long timestamp;
+ private Long timestamp;
- public CancelOrderListRequest(String symbol) {
- this.symbol = symbol;
- this.timestamp = System.currentTimeMillis();
- this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
- }
+ public CancelOrderListRequest(String symbol) {
+ this.symbol = symbol;
+ this.timestamp = System.currentTimeMillis();
+ this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
+ }
- public String getSymbol() {
- return symbol;
- }
+ public String getSymbol() {
+ return symbol;
+ }
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
- public Long getOrderListId() {
- return orderListId;
- }
+ public Long getOrderListId() {
+ return orderListId;
+ }
- public void setOrderListId(Long orderListId) {
- this.orderListId = orderListId;
- }
+ public void setOrderListId(Long orderListId) {
+ this.orderListId = orderListId;
+ }
- public String getListClientOrderId() {
- return listClientOrderId;
- }
+ public String getListClientOrderId() {
+ return listClientOrderId;
+ }
- public void setListClientOrderId(String listClientOrderId) {
- this.listClientOrderId = listClientOrderId;
- }
+ public void setListClientOrderId(String listClientOrderId) {
+ this.listClientOrderId = listClientOrderId;
+ }
- public String getNewClientOrderId() {
- return newClientOrderId;
- }
+ public String getNewClientOrderId() {
+ return newClientOrderId;
+ }
- public void setNewClientOrderId(String newClientOrderId) {
- this.newClientOrderId = newClientOrderId;
- }
+ public void setNewClientOrderId(String newClientOrderId) {
+ this.newClientOrderId = newClientOrderId;
+ }
- public Long getRecvWindow() {
- return recvWindow;
- }
+ public Long getRecvWindow() {
+ return recvWindow;
+ }
- public void setRecvWindow(Long recvWindow) {
- this.recvWindow = recvWindow;
- }
+ public void setRecvWindow(Long recvWindow) {
+ this.recvWindow = recvWindow;
+ }
- public Long getTimestamp() {
- return timestamp;
- }
+ public Long getTimestamp() {
+ return timestamp;
+ }
- public void setTimestamp(Long timestamp) {
- this.timestamp = timestamp;
- }
+ public void setTimestamp(Long timestamp) {
+ this.timestamp = timestamp;
+ }
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE).append("symbol", symbol).append("orderListId", orderListId).append("listClientOrderId", listClientOrderId).append("newClientOrderId", newClientOrderId).append("recvWindow", recvWindow).append("timestamp", timestamp).toString();
- }
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE).append("symbol", symbol).append("orderListId", orderListId).append("listClientOrderId", listClientOrderId).append("newClientOrderId", newClientOrderId).append("recvWindow", recvWindow).append("timestamp", timestamp).toString();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/request/CancelOrderResponse.java b/src/main/java/com/binance/api/client/domain/account/request/CancelOrderResponse.java
index 20fc07912..ec76125a8 100755
--- a/src/main/java/com/binance/api/client/domain/account/request/CancelOrderResponse.java
+++ b/src/main/java/com/binance/api/client/domain/account/request/CancelOrderResponse.java
@@ -80,10 +80,10 @@ public CancelOrderResponse setClientOrderId(String clientOrderId) {
@Override
public String toString() {
return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("symbol", symbol)
- .append("origClientOrderId", origClientOrderId)
- .append("orderId", orderId)
- .append("clientOrderId", clientOrderId)
- .toString();
+ .append("symbol", symbol)
+ .append("origClientOrderId", origClientOrderId)
+ .append("orderId", orderId)
+ .append("clientOrderId", clientOrderId)
+ .toString();
}
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/account/request/OrderListStatusRequest.java b/src/main/java/com/binance/api/client/domain/account/request/OrderListStatusRequest.java
index 648bf708b..cbe987b73 100755
--- a/src/main/java/com/binance/api/client/domain/account/request/OrderListStatusRequest.java
+++ b/src/main/java/com/binance/api/client/domain/account/request/OrderListStatusRequest.java
@@ -6,50 +6,50 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderListStatusRequest {
- private Long orderListId;
+ private Long orderListId;
- private String origClientOrderId;
+ private String origClientOrderId;
- private Long recvWindow;
+ private Long recvWindow;
- private Long timestamp;
+ private Long timestamp;
- public OrderListStatusRequest(Long orderListId) {
- this.orderListId = orderListId;
- this.timestamp = System.currentTimeMillis();
- this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
- }
+ public OrderListStatusRequest(Long orderListId) {
+ this.orderListId = orderListId;
+ this.timestamp = System.currentTimeMillis();
+ this.recvWindow = BinanceApiConstants.DEFAULT_RECEIVING_WINDOW;
+ }
- public Long getOrderListId() {
- return orderListId;
- }
+ public Long getOrderListId() {
+ return orderListId;
+ }
- public void setOrderListId(Long orderListId) {
- this.orderListId = orderListId;
- }
+ public void setOrderListId(Long orderListId) {
+ this.orderListId = orderListId;
+ }
- public String getOrigClientOrderId() {
- return origClientOrderId;
- }
+ public String getOrigClientOrderId() {
+ return origClientOrderId;
+ }
- public void setOrigClientOrderId(String origClientOrderId) {
- this.origClientOrderId = origClientOrderId;
- }
+ public void setOrigClientOrderId(String origClientOrderId) {
+ this.origClientOrderId = origClientOrderId;
+ }
- public Long getRecvWindow() {
- return recvWindow;
- }
+ public Long getRecvWindow() {
+ return recvWindow;
+ }
- public void setRecvWindow(Long recvWindow) {
- this.recvWindow = recvWindow;
- }
+ public void setRecvWindow(Long recvWindow) {
+ this.recvWindow = recvWindow;
+ }
- public Long getTimestamp() {
- return timestamp;
- }
+ public Long getTimestamp() {
+ return timestamp;
+ }
- public void setTimestamp(Long timestamp) {
- this.timestamp = timestamp;
- }
+ public void setTimestamp(Long timestamp) {
+ this.timestamp = timestamp;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/event/AccountUpdateEvent.java b/src/main/java/com/binance/api/client/domain/event/AccountUpdateEvent.java
index e5a28c6e8..7c14e723e 100755
--- a/src/main/java/com/binance/api/client/domain/event/AccountUpdateEvent.java
+++ b/src/main/java/com/binance/api/client/domain/event/AccountUpdateEvent.java
@@ -11,7 +11,7 @@
/**
* Account update event which will reflect the current position/balances of the account.
- *
+ *
* This event is embedded as part of a user data update event.
*
* @see UserDataUpdateEvent
diff --git a/src/main/java/com/binance/api/client/domain/event/AssetBalanceDeserializer.java b/src/main/java/com/binance/api/client/domain/event/AssetBalanceDeserializer.java
index f8953a4c6..83a95740b 100755
--- a/src/main/java/com/binance/api/client/domain/event/AssetBalanceDeserializer.java
+++ b/src/main/java/com/binance/api/client/domain/event/AssetBalanceDeserializer.java
@@ -10,8 +10,9 @@
import java.io.IOException;
/**
- * Custom deserializer for an AssetBalance, since the streaming API returns an object in the format {"a":"symbol","f":"free","l":"locked"},
- * which is different than the format used in the REST API.
+ * Custom deserializer for an AssetBalance, since the streaming API returns an object in
+ * the format {"a":"symbol","f":"free","l":"locked"},
+ * which is different from the format used in the REST API.
*/
public class AssetBalanceDeserializer extends JsonDeserializer {
diff --git a/src/main/java/com/binance/api/client/domain/event/BookTickerEvent.java b/src/main/java/com/binance/api/client/domain/event/BookTickerEvent.java
index d3612194f..8ce05a888 100755
--- a/src/main/java/com/binance/api/client/domain/event/BookTickerEvent.java
+++ b/src/main/java/com/binance/api/client/domain/event/BookTickerEvent.java
@@ -12,101 +12,101 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class BookTickerEvent {
- @JsonProperty("u")
- private long updateId;
-
- @JsonProperty("s")
- private String symbol;
-
- @JsonProperty("b")
- private String bidPrice;
-
- @JsonProperty("B")
- private String bidQuantity;
-
- @JsonProperty("a")
- private String askPrice;
-
- @JsonProperty("A")
- private String askQuantity;
-
- public BookTickerEvent() {
- super();
- }
-
- public BookTickerEvent(long updateId, String symbol, String bidPrice, String bidQuantity, String askPrice,
- String askQuantity) {
- super();
- this.updateId = updateId;
- this.symbol = symbol;
- this.bidPrice = bidPrice;
- this.bidQuantity = bidQuantity;
- this.askPrice = askPrice;
- this.askQuantity = askQuantity;
- }
-
- public BookTickerEvent(String symbol, String bidPrice, String bidQuantity, String askPrice, String askQuantity) {
- super();
- this.symbol = symbol;
- this.bidPrice = bidPrice;
- this.bidQuantity = bidQuantity;
- this.askPrice = askPrice;
- this.askQuantity = askQuantity;
- }
-
- public long getUpdateId() {
- return updateId;
- }
-
- public void setUpdateId(long updateId) {
- this.updateId = updateId;
- }
-
- public String getSymbol() {
- return symbol;
- }
-
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
-
- public String getBidPrice() {
- return bidPrice;
- }
-
- public void setBidPrice(String bidPrice) {
- this.bidPrice = bidPrice;
- }
-
- public String getBidQuantity() {
- return bidQuantity;
- }
-
- public void setBidQuantity(String bidQuantity) {
- this.bidQuantity = bidQuantity;
- }
-
- public String getAskPrice() {
- return askPrice;
- }
-
- public void setAskPrice(String askPrice) {
- this.askPrice = askPrice;
- }
-
- public String getAskQuantity() {
- return askQuantity;
- }
-
- public void setAskQuantity(String askQuantity) {
- this.askQuantity = askQuantity;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE).append("eventType", "BookTicker")
- .append("updateId", updateId).append("symbol", symbol).append("bidPrice", bidPrice)
- .append("bidQuantity", bidQuantity).append("askPrice", askPrice).append("askQuantity", askQuantity)
- .toString();
- }
+ @JsonProperty("u")
+ private long updateId;
+
+ @JsonProperty("s")
+ private String symbol;
+
+ @JsonProperty("b")
+ private String bidPrice;
+
+ @JsonProperty("B")
+ private String bidQuantity;
+
+ @JsonProperty("a")
+ private String askPrice;
+
+ @JsonProperty("A")
+ private String askQuantity;
+
+ public BookTickerEvent() {
+ super();
+ }
+
+ public BookTickerEvent(long updateId, String symbol, String bidPrice, String bidQuantity, String askPrice,
+ String askQuantity) {
+ super();
+ this.updateId = updateId;
+ this.symbol = symbol;
+ this.bidPrice = bidPrice;
+ this.bidQuantity = bidQuantity;
+ this.askPrice = askPrice;
+ this.askQuantity = askQuantity;
+ }
+
+ public BookTickerEvent(String symbol, String bidPrice, String bidQuantity, String askPrice, String askQuantity) {
+ super();
+ this.symbol = symbol;
+ this.bidPrice = bidPrice;
+ this.bidQuantity = bidQuantity;
+ this.askPrice = askPrice;
+ this.askQuantity = askQuantity;
+ }
+
+ public long getUpdateId() {
+ return updateId;
+ }
+
+ public void setUpdateId(long updateId) {
+ this.updateId = updateId;
+ }
+
+ public String getSymbol() {
+ return symbol;
+ }
+
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
+
+ public String getBidPrice() {
+ return bidPrice;
+ }
+
+ public void setBidPrice(String bidPrice) {
+ this.bidPrice = bidPrice;
+ }
+
+ public String getBidQuantity() {
+ return bidQuantity;
+ }
+
+ public void setBidQuantity(String bidQuantity) {
+ this.bidQuantity = bidQuantity;
+ }
+
+ public String getAskPrice() {
+ return askPrice;
+ }
+
+ public void setAskPrice(String askPrice) {
+ this.askPrice = askPrice;
+ }
+
+ public String getAskQuantity() {
+ return askQuantity;
+ }
+
+ public void setAskQuantity(String askQuantity) {
+ this.askQuantity = askQuantity;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE).append("eventType", "BookTicker")
+ .append("updateId", updateId).append("symbol", symbol).append("bidPrice", bidPrice)
+ .append("bidQuantity", bidQuantity).append("askPrice", askPrice).append("askQuantity", askQuantity)
+ .toString();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/binance/api/client/domain/event/CandlestickEventSerializer.java b/src/main/java/com/binance/api/client/domain/event/CandlestickEventSerializer.java
index 2ceb99956..e4a022997 100755
--- a/src/main/java/com/binance/api/client/domain/event/CandlestickEventSerializer.java
+++ b/src/main/java/com/binance/api/client/domain/event/CandlestickEventSerializer.java
@@ -16,12 +16,12 @@ public class CandlestickEventSerializer extends JsonSerializer
@Override
public void serialize(CandlestickEvent candlestickEvent, JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeStartObject();
-
+
// Write header
gen.writeStringField("e", candlestickEvent.getEventType());
gen.writeNumberField("E", candlestickEvent.getEventTime());
gen.writeStringField("s", candlestickEvent.getSymbol());
-
+
// Write candlestick data
gen.writeObjectFieldStart("k");
gen.writeNumberField("t", candlestickEvent.getOpenTime());
diff --git a/src/main/java/com/binance/api/client/domain/event/TickerEvent.java b/src/main/java/com/binance/api/client/domain/event/TickerEvent.java
index c0c7e97f1..fa89287dd 100755
--- a/src/main/java/com/binance/api/client/domain/event/TickerEvent.java
+++ b/src/main/java/com/binance/api/client/domain/event/TickerEvent.java
@@ -11,285 +11,285 @@
@JsonIgnoreProperties(ignoreUnknown = true)
public class TickerEvent {
- @JsonProperty("e")
- private String eventType;
+ @JsonProperty("e")
+ private String eventType;
- @JsonProperty("E")
- private long eventTime;
+ @JsonProperty("E")
+ private long eventTime;
- @JsonProperty("s")
- private String symbol;
+ @JsonProperty("s")
+ private String symbol;
- @JsonProperty("p")
- private String priceChange;
+ @JsonProperty("p")
+ private String priceChange;
- @JsonProperty("P")
- private String priceChangePercent;
+ @JsonProperty("P")
+ private String priceChangePercent;
- @JsonProperty("w")
- private String weightedAveragePrice;
+ @JsonProperty("w")
+ private String weightedAveragePrice;
- @JsonProperty("x")
- private String previousDaysClosePrice;
+ @JsonProperty("x")
+ private String previousDaysClosePrice;
- @JsonProperty("c")
- private String currentDaysClosePrice;
+ @JsonProperty("c")
+ private String currentDaysClosePrice;
- @JsonProperty("Q")
- private String closeTradesQuantity;
+ @JsonProperty("Q")
+ private String closeTradesQuantity;
- @JsonProperty("b")
- private String bestBidPrice;
+ @JsonProperty("b")
+ private String bestBidPrice;
- @JsonProperty("B")
- private String bestBidQuantity;
+ @JsonProperty("B")
+ private String bestBidQuantity;
- @JsonProperty("a")
- private String bestAskPrice;
+ @JsonProperty("a")
+ private String bestAskPrice;
- @JsonProperty("A")
- private String bestAskQuantity;
+ @JsonProperty("A")
+ private String bestAskQuantity;
- @JsonProperty("o")
- private String openPrice;
+ @JsonProperty("o")
+ private String openPrice;
- @JsonProperty("h")
- private String highPrice;
+ @JsonProperty("h")
+ private String highPrice;
- @JsonProperty("l")
- private String lowPrice;
+ @JsonProperty("l")
+ private String lowPrice;
- @JsonProperty("v")
- private String totalTradedBaseAssetVolume;
+ @JsonProperty("v")
+ private String totalTradedBaseAssetVolume;
- @JsonProperty("q")
- private String totalTradedQuoteAssetVolume;
+ @JsonProperty("q")
+ private String totalTradedQuoteAssetVolume;
- @JsonProperty("O")
- private long statisticsOpenTime;
+ @JsonProperty("O")
+ private long statisticsOpenTime;
- @JsonProperty("C")
- private long statisticsCloseTime;
+ @JsonProperty("C")
+ private long statisticsCloseTime;
- @JsonProperty("F")
- private long firstTradeId;
+ @JsonProperty("F")
+ private long firstTradeId;
- @JsonProperty("L")
- private long lastTradeId;
+ @JsonProperty("L")
+ private long lastTradeId;
- @JsonProperty("n")
- private long totalNumberOfTrades;
+ @JsonProperty("n")
+ private long totalNumberOfTrades;
- public String getEventType() {
- return eventType;
- }
+ public String getEventType() {
+ return eventType;
+ }
- public void setEventType(String eventType) {
- this.eventType = eventType;
- }
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
- public long getEventTime() {
- return eventTime;
- }
+ public long getEventTime() {
+ return eventTime;
+ }
- public void setEventTime(long eventTime) {
- this.eventTime = eventTime;
- }
+ public void setEventTime(long eventTime) {
+ this.eventTime = eventTime;
+ }
- public String getSymbol() {
- return symbol;
- }
+ public String getSymbol() {
+ return symbol;
+ }
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
- public String getPriceChange() {
- return priceChange;
- }
+ public String getPriceChange() {
+ return priceChange;
+ }
- public void setPriceChange(String priceChange) {
- this.priceChange = priceChange;
- }
+ public void setPriceChange(String priceChange) {
+ this.priceChange = priceChange;
+ }
- public String getPriceChangePercent() {
- return priceChangePercent;
- }
+ public String getPriceChangePercent() {
+ return priceChangePercent;
+ }
- public void setPriceChangePercent(String priceChangePercent) {
- this.priceChangePercent = priceChangePercent;
- }
+ public void setPriceChangePercent(String priceChangePercent) {
+ this.priceChangePercent = priceChangePercent;
+ }
- public String getWeightedAveragePrice() {
- return weightedAveragePrice;
- }
+ public String getWeightedAveragePrice() {
+ return weightedAveragePrice;
+ }
- public void setWeightedAveragePrice(String weightedAveragePrice) {
- this.weightedAveragePrice = weightedAveragePrice;
- }
+ public void setWeightedAveragePrice(String weightedAveragePrice) {
+ this.weightedAveragePrice = weightedAveragePrice;
+ }
- public String getPreviousDaysClosePrice() {
- return previousDaysClosePrice;
- }
+ public String getPreviousDaysClosePrice() {
+ return previousDaysClosePrice;
+ }
- public void setPreviousDaysClosePrice(String previousDaysClosePrice) {
- this.previousDaysClosePrice = previousDaysClosePrice;
- }
+ public void setPreviousDaysClosePrice(String previousDaysClosePrice) {
+ this.previousDaysClosePrice = previousDaysClosePrice;
+ }
- public String getCurrentDaysClosePrice() {
- return currentDaysClosePrice;
- }
+ public String getCurrentDaysClosePrice() {
+ return currentDaysClosePrice;
+ }
- public void setCurrentDaysClosePrice(String currentDaysClosePrice) {
- this.currentDaysClosePrice = currentDaysClosePrice;
- }
+ public void setCurrentDaysClosePrice(String currentDaysClosePrice) {
+ this.currentDaysClosePrice = currentDaysClosePrice;
+ }
- public String getCloseTradesQuantity() {
- return closeTradesQuantity;
- }
+ public String getCloseTradesQuantity() {
+ return closeTradesQuantity;
+ }
- public void setCloseTradesQuantity(String closeTradesQuantity) {
- this.closeTradesQuantity = closeTradesQuantity;
- }
+ public void setCloseTradesQuantity(String closeTradesQuantity) {
+ this.closeTradesQuantity = closeTradesQuantity;
+ }
- public String getBestBidPrice() {
- return bestBidPrice;
- }
+ public String getBestBidPrice() {
+ return bestBidPrice;
+ }
- public void setBestBidPrice(String bestBidPrice) {
- this.bestBidPrice = bestBidPrice;
- }
+ public void setBestBidPrice(String bestBidPrice) {
+ this.bestBidPrice = bestBidPrice;
+ }
- public String getBestBidQuantity() {
- return bestBidQuantity;
- }
+ public String getBestBidQuantity() {
+ return bestBidQuantity;
+ }
- public void setBestBidQuantity(String bestBidQuantity) {
- this.bestBidQuantity = bestBidQuantity;
- }
+ public void setBestBidQuantity(String bestBidQuantity) {
+ this.bestBidQuantity = bestBidQuantity;
+ }
- public String getBestAskPrice() {
- return bestAskPrice;
- }
-
- public void setBestAskPrice(String bestAskPrice) {
- this.bestAskPrice = bestAskPrice;
- }
-
- public String getBestAskQuantity() {
- return bestAskQuantity;
- }
-
- public void setBestAskQuantity(String bestAskQuantity) {
- this.bestAskQuantity = bestAskQuantity;
- }
-
- public String getOpenPrice() {
- return openPrice;
- }
-
- public void setOpenPrice(String openPrice) {
- this.openPrice = openPrice;
- }
-
- public String getHighPrice() {
- return highPrice;
- }
-
- public void setHighPrice(String highPrice) {
- this.highPrice = highPrice;
- }
-
- public String getLowPrice() {
- return lowPrice;
- }
-
- public void setLowPrice(String lowPrice) {
- this.lowPrice = lowPrice;
- }
-
- public String getTotalTradedBaseAssetVolume() {
- return totalTradedBaseAssetVolume;
- }
-
- public void setTotalTradedBaseAssetVolume(String totalTradedBaseAssetVolume) {
- this.totalTradedBaseAssetVolume = totalTradedBaseAssetVolume;
- }
-
- public String getTotalTradedQuoteAssetVolume() {
- return totalTradedQuoteAssetVolume;
- }
-
- public void setTotalTradedQuoteAssetVolume(String totalTradedQuoteAssetVolume) {
- this.totalTradedQuoteAssetVolume = totalTradedQuoteAssetVolume;
- }
-
- public long getStatisticsOpenTime() {
- return statisticsOpenTime;
- }
-
- public void setStatisticsOpenTime(long statisticsOpenTime) {
- this.statisticsOpenTime = statisticsOpenTime;
- }
-
- public long getStatisticsCloseTime() {
- return statisticsCloseTime;
- }
-
- public void setStatisticsCloseTime(long statisticsCloseTime) {
- this.statisticsCloseTime = statisticsCloseTime;
- }
-
- public long getFirstTradeId() {
- return firstTradeId;
- }
-
- public void setFirstTradeId(long firstTradeId) {
- this.firstTradeId = firstTradeId;
- }
-
- public long getLastTradeId() {
- return lastTradeId;
- }
-
- public void setLastTradeId(long lastTradeId) {
- this.lastTradeId = lastTradeId;
- }
-
- public long getTotalNumberOfTrades() {
- return totalNumberOfTrades;
- }
-
- public void setTotalNumberOfTrades(long totalNumberOfTrades) {
- this.totalNumberOfTrades = totalNumberOfTrades;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("eventType", eventType)
- .append("eventTime", eventTime)
- .append("symbol", symbol)
- .append("priceChange", priceChange)
- .append("priceChangePercent", priceChangePercent)
- .append("weightedAveragePrice", weightedAveragePrice)
- .append("previousDaysClosePrice", previousDaysClosePrice)
- .append("currentDaysClosePrice", currentDaysClosePrice)
- .append("closeTradesQuantity", closeTradesQuantity)
- .append("bestBidPrice", bestBidPrice)
- .append("bestBidQuantity", bestBidQuantity)
- .append("bestAskPrice", bestAskPrice)
- .append("bestAskQuantity", bestAskQuantity)
- .append("openPrice", openPrice)
- .append("highPrice", highPrice)
- .append("lowPrice", lowPrice)
- .append("totalTradedBaseAssetVolume", totalTradedBaseAssetVolume)
- .append("totalTradedQuoteAssetVolume", totalTradedQuoteAssetVolume)
- .append("statisticsOpenTime", statisticsOpenTime)
- .append("statisticsCloseTime", statisticsCloseTime)
- .append("firstTradeId", firstTradeId)
- .append("lastTradeId", lastTradeId)
- .append("totalNumberOfTrades", totalNumberOfTrades)
- .toString();
- }
+ public String getBestAskPrice() {
+ return bestAskPrice;
+ }
+
+ public void setBestAskPrice(String bestAskPrice) {
+ this.bestAskPrice = bestAskPrice;
+ }
+
+ public String getBestAskQuantity() {
+ return bestAskQuantity;
+ }
+
+ public void setBestAskQuantity(String bestAskQuantity) {
+ this.bestAskQuantity = bestAskQuantity;
+ }
+
+ public String getOpenPrice() {
+ return openPrice;
+ }
+
+ public void setOpenPrice(String openPrice) {
+ this.openPrice = openPrice;
+ }
+
+ public String getHighPrice() {
+ return highPrice;
+ }
+
+ public void setHighPrice(String highPrice) {
+ this.highPrice = highPrice;
+ }
+
+ public String getLowPrice() {
+ return lowPrice;
+ }
+
+ public void setLowPrice(String lowPrice) {
+ this.lowPrice = lowPrice;
+ }
+
+ public String getTotalTradedBaseAssetVolume() {
+ return totalTradedBaseAssetVolume;
+ }
+
+ public void setTotalTradedBaseAssetVolume(String totalTradedBaseAssetVolume) {
+ this.totalTradedBaseAssetVolume = totalTradedBaseAssetVolume;
+ }
+
+ public String getTotalTradedQuoteAssetVolume() {
+ return totalTradedQuoteAssetVolume;
+ }
+
+ public void setTotalTradedQuoteAssetVolume(String totalTradedQuoteAssetVolume) {
+ this.totalTradedQuoteAssetVolume = totalTradedQuoteAssetVolume;
+ }
+
+ public long getStatisticsOpenTime() {
+ return statisticsOpenTime;
+ }
+
+ public void setStatisticsOpenTime(long statisticsOpenTime) {
+ this.statisticsOpenTime = statisticsOpenTime;
+ }
+
+ public long getStatisticsCloseTime() {
+ return statisticsCloseTime;
+ }
+
+ public void setStatisticsCloseTime(long statisticsCloseTime) {
+ this.statisticsCloseTime = statisticsCloseTime;
+ }
+
+ public long getFirstTradeId() {
+ return firstTradeId;
+ }
+
+ public void setFirstTradeId(long firstTradeId) {
+ this.firstTradeId = firstTradeId;
+ }
+
+ public long getLastTradeId() {
+ return lastTradeId;
+ }
+
+ public void setLastTradeId(long lastTradeId) {
+ this.lastTradeId = lastTradeId;
+ }
+
+ public long getTotalNumberOfTrades() {
+ return totalNumberOfTrades;
+ }
+
+ public void setTotalNumberOfTrades(long totalNumberOfTrades) {
+ this.totalNumberOfTrades = totalNumberOfTrades;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
+ .append("eventType", eventType)
+ .append("eventTime", eventTime)
+ .append("symbol", symbol)
+ .append("priceChange", priceChange)
+ .append("priceChangePercent", priceChangePercent)
+ .append("weightedAveragePrice", weightedAveragePrice)
+ .append("previousDaysClosePrice", previousDaysClosePrice)
+ .append("currentDaysClosePrice", currentDaysClosePrice)
+ .append("closeTradesQuantity", closeTradesQuantity)
+ .append("bestBidPrice", bestBidPrice)
+ .append("bestBidQuantity", bestBidQuantity)
+ .append("bestAskPrice", bestAskPrice)
+ .append("bestAskQuantity", bestAskQuantity)
+ .append("openPrice", openPrice)
+ .append("highPrice", highPrice)
+ .append("lowPrice", lowPrice)
+ .append("totalTradedBaseAssetVolume", totalTradedBaseAssetVolume)
+ .append("totalTradedQuoteAssetVolume", totalTradedQuoteAssetVolume)
+ .append("statisticsOpenTime", statisticsOpenTime)
+ .append("statisticsCloseTime", statisticsCloseTime)
+ .append("firstTradeId", firstTradeId)
+ .append("lastTradeId", lastTradeId)
+ .append("totalNumberOfTrades", totalNumberOfTrades)
+ .toString();
+ }
}
diff --git a/src/main/java/com/binance/api/client/domain/event/UserDataUpdateEvent.java b/src/main/java/com/binance/api/client/domain/event/UserDataUpdateEvent.java
index 062565790..4164b2de0 100755
--- a/src/main/java/com/binance/api/client/domain/event/UserDataUpdateEvent.java
+++ b/src/main/java/com/binance/api/client/domain/event/UserDataUpdateEvent.java
@@ -94,11 +94,17 @@ public String toString() {
}
public enum UserDataUpdateEventType {
- /** Corresponds to "outboundAccountPosition" events. */
+ /**
+ * Corresponds to "outboundAccountPosition" events.
+ */
ACCOUNT_POSITION_UPDATE("outboundAccountPosition"),
- /** Corresponds to "balanceUpdate" events. */
+ /**
+ * Corresponds to "balanceUpdate" events.
+ */
BALANCE_UPDATE("balanceUpdate"),
- /** Corresponds to "executionReport" events. */
+ /**
+ * Corresponds to "executionReport" events.
+ */
ORDER_TRADE_UPDATE("executionReport"),
;
diff --git a/src/main/java/com/binance/api/client/domain/general/Asset.java b/src/main/java/com/binance/api/client/domain/general/Asset.java
index 715190f31..133d97b06 100755
--- a/src/main/java/com/binance/api/client/domain/general/Asset.java
+++ b/src/main/java/com/binance/api/client/domain/general/Asset.java
@@ -8,116 +8,116 @@
/**
* An asset Binance supports.
*/
- @JsonIgnoreProperties(ignoreUnknown = true)
- public class Asset {
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Asset {
- @JsonProperty("id")
- private String id;
+ @JsonProperty("id")
+ private String id;
- @JsonProperty("assetCode")
- private String assetCode;
+ @JsonProperty("assetCode")
+ private String assetCode;
- @JsonProperty("assetName")
- private String assetName;
-
- @JsonProperty("unit")
- private String unit;
-
- @JsonProperty("transactionFee")
- private String transactionFee;
-
- @JsonProperty("commissionRate")
- private String commissionRate;
-
- @JsonProperty("freeAuditWithdrawAmt")
- private String freeAuditWithdrawAmount;
-
- @JsonProperty("freeUserChargeAmount")
- private String freeUserChargeAmount;
-
- @JsonProperty("minProductWithdraw")
- private String minProductWithdraw;
-
- @JsonProperty("withdrawIntegerMultiple")
- private String withdrawIntegerMultiple;
-
- @JsonProperty("confirmTimes")
- private long confirmTimes;
-
- @JsonProperty("enableWithdraw")
- private boolean enableWithdraw;
-
- @JsonProperty("isLegalMoney")
- private boolean isLegalMoney;
-
- public String getId() {
- return id;
- }
-
- public String getAssetCode() {
- return assetCode;
- }
-
- public String getAssetName() {
- return assetName;
- }
-
- public String getUnit() {
- return unit;
- }
-
- public String getTransactionFee() {
- return transactionFee;
- }
-
- public String getCommissionRate() {
- return commissionRate;
- }
-
- public String getFreeAuditWithdrawAmount() {
- return freeAuditWithdrawAmount;
- }
-
- public String getFreeUserChargeAmount() {
- return freeUserChargeAmount;
- }
-
- public String minProductWithdraw() {
- return minProductWithdraw;
- }
-
- public String getWithdrawIntegerMultiple() {
- return withdrawIntegerMultiple;
- }
-
- public long getConfirmTimes() {
- return confirmTimes;
- }
-
- public boolean canWithraw() {
- return enableWithdraw;
- }
-
- public boolean isLegalMoney() {
- return isLegalMoney;
- }
-
- @Override
- public String toString() {
- return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
- .append("id", id)
- .append("assetCode", assetCode)
- .append("assetName", assetName)
- .append("unit", unit)
- .append("transactionFee", transactionFee)
- .append("commissionRate", commissionRate)
- .append("freeAuditWithdrawAmount", freeAuditWithdrawAmount)
- .append("freeUserChargeAmount", freeUserChargeAmount)
- .append("minProductWithdraw", minProductWithdraw)
- .append("withdrawIntegerMultiple", withdrawIntegerMultiple)
- .append("confirmTimes", confirmTimes)
- .append("enableWithdraw", enableWithdraw)
- .append("isLegalMoney", isLegalMoney)
- .toString();
- }
- }
+ @JsonProperty("assetName")
+ private String assetName;
+
+ @JsonProperty("unit")
+ private String unit;
+
+ @JsonProperty("transactionFee")
+ private String transactionFee;
+
+ @JsonProperty("commissionRate")
+ private String commissionRate;
+
+ @JsonProperty("freeAuditWithdrawAmt")
+ private String freeAuditWithdrawAmount;
+
+ @JsonProperty("freeUserChargeAmount")
+ private String freeUserChargeAmount;
+
+ @JsonProperty("minProductWithdraw")
+ private String minProductWithdraw;
+
+ @JsonProperty("withdrawIntegerMultiple")
+ private String withdrawIntegerMultiple;
+
+ @JsonProperty("confirmTimes")
+ private long confirmTimes;
+
+ @JsonProperty("enableWithdraw")
+ private boolean enableWithdraw;
+
+ @JsonProperty("isLegalMoney")
+ private boolean isLegalMoney;
+
+ public String getId() {
+ return id;
+ }
+
+ public String getAssetCode() {
+ return assetCode;
+ }
+
+ public String getAssetName() {
+ return assetName;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public String getTransactionFee() {
+ return transactionFee;
+ }
+
+ public String getCommissionRate() {
+ return commissionRate;
+ }
+
+ public String getFreeAuditWithdrawAmount() {
+ return freeAuditWithdrawAmount;
+ }
+
+ public String getFreeUserChargeAmount() {
+ return freeUserChargeAmount;
+ }
+
+ public String minProductWithdraw() {
+ return minProductWithdraw;
+ }
+
+ public String getWithdrawIntegerMultiple() {
+ return withdrawIntegerMultiple;
+ }
+
+ public long getConfirmTimes() {
+ return confirmTimes;
+ }
+
+ public boolean canWithraw() {
+ return enableWithdraw;
+ }
+
+ public boolean isLegalMoney() {
+ return isLegalMoney;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this, BinanceApiConstants.TO_STRING_BUILDER_STYLE)
+ .append("id", id)
+ .append("assetCode", assetCode)
+ .append("assetName", assetName)
+ .append("unit", unit)
+ .append("transactionFee", transactionFee)
+ .append("commissionRate", commissionRate)
+ .append("freeAuditWithdrawAmount", freeAuditWithdrawAmount)
+ .append("freeUserChargeAmount", freeUserChargeAmount)
+ .append("minProductWithdraw", minProductWithdraw)
+ .append("withdrawIntegerMultiple", withdrawIntegerMultiple)
+ .append("confirmTimes", confirmTimes)
+ .append("enableWithdraw", enableWithdraw)
+ .append("isLegalMoney", isLegalMoney)
+ .toString();
+ }
+}
diff --git a/src/main/java/com/binance/api/client/domain/general/ExchangeFilter.java b/src/main/java/com/binance/api/client/domain/general/ExchangeFilter.java
index e367deaef..ce92e392d 100755
--- a/src/main/java/com/binance/api/client/domain/general/ExchangeFilter.java
+++ b/src/main/java/com/binance/api/client/domain/general/ExchangeFilter.java
@@ -6,9 +6,9 @@
/**
* Exchange Filters define trading rules an exchange.
- *
+ *
* The MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on the exchange. Note that both "algo" orders and normal orders are counted for this filter.
- *
+ *
* The MAX_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange. "Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
diff --git a/src/main/java/com/binance/api/client/domain/general/ExchangeInfo.java b/src/main/java/com/binance/api/client/domain/general/ExchangeInfo.java
index b12c1d20c..b2047032c 100755
--- a/src/main/java/com/binance/api/client/domain/general/ExchangeInfo.java
+++ b/src/main/java/com/binance/api/client/domain/general/ExchangeInfo.java
@@ -9,7 +9,7 @@
/**
* Current exchange trading rules and symbol information.
- * https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md
+ * https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ExchangeInfo {
diff --git a/src/main/java/com/binance/api/client/domain/general/SymbolFilter.java b/src/main/java/com/binance/api/client/domain/general/SymbolFilter.java
index e6a8b98c8..6b3e48e87 100755
--- a/src/main/java/com/binance/api/client/domain/general/SymbolFilter.java
+++ b/src/main/java/com/binance/api/client/domain/general/SymbolFilter.java
@@ -4,15 +4,15 @@
/**
* Filters define trading rules on a symbol or an exchange. Filters come in two forms: symbol filters and exchange filters.
- *
+ *
* The PRICE_FILTER defines the price rules for a symbol.
- *
+ *
* The LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for a symbol.
- *
+ *
* The MIN_NOTIONAL filter defines the minimum notional value allowed for an order on a symbol. An order's notional value is the price * quantity.
- *
+ *
* The MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on a symbol. Note that both "algo" orders and normal orders are counted for this filter.
- *
+ *
* The MAX_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol. "Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
diff --git a/src/main/java/com/binance/api/client/domain/market/OrderBookEntrySerializer.java b/src/main/java/com/binance/api/client/domain/market/OrderBookEntrySerializer.java
index 132f8914a..b17ba9b83 100755
--- a/src/main/java/com/binance/api/client/domain/market/OrderBookEntrySerializer.java
+++ b/src/main/java/com/binance/api/client/domain/market/OrderBookEntrySerializer.java
@@ -12,7 +12,7 @@
public class OrderBookEntrySerializer extends JsonSerializer {
@Override
- public void serialize(OrderBookEntry orderBookEntry, JsonGenerator gen, SerializerProvider serializers) throws IOException {
+ public void serialize(OrderBookEntry orderBookEntry, JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeStartArray();
gen.writeString(orderBookEntry.getPrice());
gen.writeString(orderBookEntry.getQty());
diff --git a/src/main/java/com/binance/api/client/domain/market/TickerStatistics.java b/src/main/java/com/binance/api/client/domain/market/TickerStatistics.java
index 7cd3a08ca..b8b721e38 100755
--- a/src/main/java/com/binance/api/client/domain/market/TickerStatistics.java
+++ b/src/main/java/com/binance/api/client/domain/market/TickerStatistics.java
@@ -222,13 +222,13 @@ public long getCount() {
public void setCount(long count) {
this.count = count;
}
-
+
public String getSymbol() {
- return symbol;
+ return symbol;
}
public void setSymbol(String symbol) {
- this.symbol = symbol;
+ this.symbol = symbol;
}
@Override
diff --git a/src/main/java/com/binance/api/client/exception/BinanceApiException.java b/src/main/java/com/binance/api/client/exception/BinanceApiException.java
index 80430fd8d..7cbe556cb 100755
--- a/src/main/java/com/binance/api/client/exception/BinanceApiException.java
+++ b/src/main/java/com/binance/api/client/exception/BinanceApiException.java
@@ -7,8 +7,8 @@
*/
public class BinanceApiException extends RuntimeException {
- private static final long serialVersionUID = 3788669840036201041L;
-/**
+ private static final long serialVersionUID = 3788669840036201041L;
+ /**
* Error response object returned by Binance API.
*/
private BinanceApiError error;
@@ -51,7 +51,7 @@ public BinanceApiException(Throwable cause) {
* Instantiates a new binance api exception.
*
* @param message the message
- * @param cause the cause
+ * @param cause the cause
*/
public BinanceApiException(String message, Throwable cause) {
super(message, cause);
diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java
deleted file mode 100755
index d3e5c22f6..000000000
--- a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncMarginRestClientImpl.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package com.binance.api.client.impl;
-
-import com.binance.api.client.BinanceApiAsyncMarginRestClient;
-import com.binance.api.client.BinanceApiCallback;
-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.event.ListenKey;
-
-import java.util.List;
-
-import static com.binance.api.client.impl.BinanceApiServiceGenerator.createService;
-
-/**
- * Implementation of Binance's Margin REST API using Retrofit with asynchronous/non-blocking method calls.
- */
-public class BinanceApiAsyncMarginRestClientImpl implements BinanceApiAsyncMarginRestClient {
-
- private final BinanceApiService binanceApiService;
-
- public BinanceApiAsyncMarginRestClientImpl(String apiKey, String secret) {
- binanceApiService = createService(BinanceApiService.class, apiKey, secret);
- }
-
- // Margin Account endpoints
-
- @Override
- public void getAccount(Long recvWindow, Long timestamp, BinanceApiCallback callback) {
- binanceApiService.getMarginAccount(recvWindow, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void getAccount(BinanceApiCallback callback) {
- long timestamp = System.currentTimeMillis();
- binanceApiService.getMarginAccount(BinanceApiConstants.DEFAULT_MARGIN_RECEIVING_WINDOW, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void getOpenOrders(OrderRequest orderRequest, BinanceApiCallback> callback) {
- binanceApiService.getOpenMarginOrders(orderRequest.getSymbol(), orderRequest.getRecvWindow(),
- orderRequest.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void newOrder(MarginNewOrder order, BinanceApiCallback callback) {
- binanceApiService.newMarginOrder(order.getSymbol(), order.getSide(), order.getType(), order.getTimeInForce(),
- order.getQuantity(), order.getPrice(), order.getNewClientOrderId(), order.getStopPrice(), order.getIcebergQty(),
- order.getNewOrderRespType(), order.getSideEffectType(), order.getRecvWindow(), order.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void cancelOrder(CancelOrderRequest cancelOrderRequest, BinanceApiCallback callback) {
- binanceApiService.cancelMarginOrder(cancelOrderRequest.getSymbol(),
- cancelOrderRequest.getOrderId(), cancelOrderRequest.getOrigClientOrderId(), cancelOrderRequest.getNewClientOrderId(),
- cancelOrderRequest.getRecvWindow(), cancelOrderRequest.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void getOrderStatus(OrderStatusRequest orderStatusRequest, BinanceApiCallback callback) {
- binanceApiService.getMarginOrderStatus(orderStatusRequest.getSymbol(),
- orderStatusRequest.getOrderId(), orderStatusRequest.getOrigClientOrderId(),
- orderStatusRequest.getRecvWindow(), orderStatusRequest.getTimestamp()).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void getMyTrades(String symbol, BinanceApiCallback> callback) {
- binanceApiService.getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- // user stream endpoints
-
- @Override
- public void startUserDataStream(BinanceApiCallback callback) {
- binanceApiService.startMarginUserDataStream().enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void keepAliveUserDataStream(String listenKey, BinanceApiCallback callback) {
- binanceApiService.keepAliveMarginUserDataStream(listenKey).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void transfer(String asset, String amount, TransferType type, BinanceApiCallback callback) {
- long timestamp = System.currentTimeMillis();
- binanceApiService.transfer(asset, amount, type.getValue(), BinanceApiConstants.DEFAULT_MARGIN_RECEIVING_WINDOW, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void borrow(String asset, String amount, BinanceApiCallback callback) {
- long timestamp = System.currentTimeMillis();
- binanceApiService.borrow(asset, amount, BinanceApiConstants.DEFAULT_MARGIN_RECEIVING_WINDOW, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-
- @Override
- public void repay(String asset, String amount, BinanceApiCallback callback) {
- long timestamp = System.currentTimeMillis();
- binanceApiService.repay(asset, amount, BinanceApiConstants.DEFAULT_MARGIN_RECEIVING_WINDOW, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
- }
-}
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..48e982e2d 100755
--- a/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java
+++ b/src/main/java/com/binance/api/client/impl/BinanceApiAsyncRestClientImpl.java
@@ -5,14 +5,15 @@
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.Deposit;
import com.binance.api.client.domain.account.DepositAddress;
-import com.binance.api.client.domain.account.DepositHistory;
+import com.binance.api.client.domain.account.ExtendedAssetBalance;
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.Withdraw;
import com.binance.api.client.domain.account.WithdrawResult;
import com.binance.api.client.domain.account.request.AllOrdersRequest;
import com.binance.api.client.domain.account.request.CancelOrderRequest;
@@ -30,6 +31,7 @@
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 retrofit2.Call;
import java.util.List;
@@ -122,7 +124,7 @@ public void getAllPrices(BinanceApiCallback> callback) {
}
@Override
- public void getPrice(String symbol , BinanceApiCallback callback) {
+ public void getPrice(String symbol, BinanceApiCallback callback) {
binanceApiService.getLatestPrice(symbol).enqueue(new BinanceApiCallbackAdapter<>(callback));
}
@@ -193,6 +195,19 @@ public void getAccount(BinanceApiCallback callback) {
binanceApiService.getAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
}
+ @Override
+ public void getUserAssets(String asset, boolean needBtcValuation,
+ BinanceApiCallback> callback) {
+ long timestamp = System.currentTimeMillis();
+ Call> call = binanceApiService.getUserAssets(
+ asset,
+ needBtcValuation,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
+ timestamp
+ );
+ call.enqueue(new BinanceApiCallbackAdapter<>(callback));
+ }
+
@Override
public void getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp, BinanceApiCallback> callback) {
binanceApiService.getMyTrades(symbol, limit, fromId, recvWindow, timestamp).enqueue(new BinanceApiCallbackAdapter<>(callback));
@@ -209,29 +224,51 @@ 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 coin, String withdrawOrderId, String network, String address, String addressTag,
+ String amount, Boolean transactionFeeFlag, String name, BinanceApiCallback callback) {
+ binanceApiService.withdraw(coin, withdrawOrderId, network, address, addressTag, amount, transactionFeeFlag, name,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())
.enqueue(new BinanceApiCallbackAdapter<>(callback));
}
@Override
- public void getDepositHistory(String asset, BinanceApiCallback callback) {
- binanceApiService.getDepositHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())
+ public void getDepositHistory(String coin, Integer status, Long startTime, Long endTime,
+ Integer offset, Integer limit,
+ BinanceApiCallback> 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 callback) {
- binanceApiService.getWithdrawHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())
- .enqueue(new BinanceApiCallbackAdapter<>(callback));
+ public void getDepositHistory(String coin, BinanceApiCallback> callback) {
+ getDepositHistory(coin, null, null, null, null, null, callback);
+ }
+
+ @Override
+ public void getWithdrawHistory(String coin, String withdrawOrderId, Integer status,
+ Integer offset, Integer limit, Long startTime, Long endTime,
+ BinanceApiCallback> callback) {
+ Call> call = binanceApiService.getWithdrawHistory(coin, withdrawOrderId,
+ status, offset, limit, startTime, endTime, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
+ System.currentTimeMillis());
+ call.enqueue(new BinanceApiCallbackAdapter<>(callback));
+ }
+
+ @Override
+ public void getWithdrawHistory(String coin, BinanceApiCallback> callback) {
+ getWithdrawHistory(coin, null, null, null, null, null, null, callback);
}
@Override
- public void getDepositAddress(String asset, BinanceApiCallback callback) {
- binanceApiService.getDepositAddress(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())
+ public void getDepositAddress(String asset, String network,
+ BinanceApiCallback callback) {
+ binanceApiService.getDepositAddress(asset, network,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis())
.enqueue(new BinanceApiCallbackAdapter<>(callback));
}
+
// User stream endpoints
@Override
diff --git a/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java b/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java
deleted file mode 100755
index 959fa2a5f..000000000
--- a/src/main/java/com/binance/api/client/impl/BinanceApiMarginRestClientImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package com.binance.api.client.impl;
-
-import com.binance.api.client.BinanceApiMarginRestClient;
-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 java.util.List;
-
-import static com.binance.api.client.impl.BinanceApiServiceGenerator.createService;
-import static com.binance.api.client.impl.BinanceApiServiceGenerator.executeSync;
-
-/**
- * Implementation of Binance's Margin REST API using Retrofit with asynchronous/non-blocking method calls.
- */
-public class BinanceApiMarginRestClientImpl implements BinanceApiMarginRestClient {
-
- private final BinanceApiService binanceApiService;
-
- public BinanceApiMarginRestClientImpl(String apiKey, String secret) {
- binanceApiService = createService(BinanceApiService.class, apiKey, secret);
- }
-
- @Override
- public MarginAccount getAccount() {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.getMarginAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp));
- }
-
- @Override
- public List getOpenOrders(OrderRequest orderRequest) {
- return executeSync(binanceApiService.getOpenMarginOrders(orderRequest.getSymbol(), orderRequest.getRecvWindow(),
- orderRequest.getTimestamp()));
- }
-
- @Override
- public MarginNewOrderResponse newOrder(MarginNewOrder order) {
- return executeSync(binanceApiService.newMarginOrder(order.getSymbol(), order.getSide(), order.getType(),
- order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(), order.getStopPrice(),
- order.getIcebergQty(), order.getNewOrderRespType(), order.getSideEffectType(), order.getRecvWindow(), order.getTimestamp()));
- }
-
- @Override
- public CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest) {
- return executeSync(binanceApiService.cancelMarginOrder(cancelOrderRequest.getSymbol(),
- cancelOrderRequest.getOrderId(), cancelOrderRequest.getOrigClientOrderId(), cancelOrderRequest.getNewClientOrderId(),
- cancelOrderRequest.getRecvWindow(), cancelOrderRequest.getTimestamp()));
- }
-
- @Override
- public Order getOrderStatus(OrderStatusRequest orderStatusRequest) {
- return executeSync(binanceApiService.getMarginOrderStatus(orderStatusRequest.getSymbol(),
- orderStatusRequest.getOrderId(), orderStatusRequest.getOrigClientOrderId(),
- orderStatusRequest.getRecvWindow(), orderStatusRequest.getTimestamp()));
- }
-
- @Override
- public List getMyTrades(String symbol) {
- return executeSync(binanceApiService.getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
- }
-
- // user stream endpoints
-
- @Override
- public String startUserDataStream() {
- return executeSync(binanceApiService.startMarginUserDataStream()).toString();
- }
-
- @Override
- public void keepAliveUserDataStream(String listenKey) {
- executeSync(binanceApiService.keepAliveMarginUserDataStream(listenKey));
- }
-
- @Override
- public MarginTransaction transfer(String asset, String amount, TransferType type) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.transfer(asset, amount, type.getValue(), BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp));
- }
-
- @Override
- public MarginTransaction borrow(String asset, String amount) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.borrow(asset, amount, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp));
- }
-
- @Override
- public LoanQueryResult queryLoan(String asset, String txId) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.queryLoan(asset, txId, timestamp));
- }
-
- @Override
- public RepayQueryResult queryRepay(String asset, String txId) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.queryRepay(asset, txId, timestamp));
- }
-
- @Override
- public RepayQueryResult queryRepay(String asset, long startTime) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.queryRepay(asset, startTime, timestamp));
- }
-
- @Override
- public MaxBorrowableQueryResult queryMaxBorrowable(String asset) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.queryMaxBorrowable(asset, timestamp));
- }
-
- @Override
- public MarginTransaction repay(String asset, String amount) {
- long timestamp = System.currentTimeMillis();
- return executeSync(binanceApiService.repay(asset, amount, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, timestamp));
- }
-}
\ No newline at end of file
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..a66e1d355 100755
--- a/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java
+++ b/src/main/java/com/binance/api/client/impl/BinanceApiRestClientImpl.java
@@ -21,261 +21,268 @@
*/
public class BinanceApiRestClientImpl implements BinanceApiRestClient {
- private final BinanceApiService binanceApiService;
-
- public BinanceApiRestClientImpl(String apiKey, String secret) {
- binanceApiService = createService(BinanceApiService.class, apiKey, secret);
- }
-
- // General endpoints
-
- @Override
- public void ping() {
- executeSync(binanceApiService.ping());
- }
-
- @Override
- public Long getServerTime() {
- return executeSync(binanceApiService.getServerTime()).getServerTime();
- }
-
- @Override
- public ExchangeInfo getExchangeInfo() {
- return executeSync(binanceApiService.getExchangeInfo());
- }
-
- @Override
- public List getAllAssets() {
- return executeSync(binanceApiService
- .getAllAssets(BinanceApiConfig.getAssetInfoApiBaseUrl() + "assetWithdraw/getAllAsset.html"));
- }
-
- // Market Data endpoints
-
- @Override
- public OrderBook getOrderBook(String symbol, Integer limit) {
- return executeSync(binanceApiService.getOrderBook(symbol, limit));
- }
-
- @Override
- public List getTrades(String symbol, Integer limit) {
- return executeSync(binanceApiService.getTrades(symbol, limit));
- }
-
- @Override
- public List getHistoricalTrades(String symbol, Integer limit, Long fromId) {
- return executeSync(binanceApiService.getHistoricalTrades(symbol, limit, fromId));
- }
-
- @Override
- public List getAggTrades(String symbol, String fromId, Integer limit, Long startTime, Long endTime) {
- return executeSync(binanceApiService.getAggTrades(symbol, fromId, limit, startTime, endTime));
- }
-
- @Override
- public List getAggTrades(String symbol) {
- return getAggTrades(symbol, null, null, null, null);
- }
-
- @Override
- public List getCandlestickBars(String symbol, CandlestickInterval interval, Integer limit,
- Long startTime, Long endTime) {
- return executeSync(
- binanceApiService.getCandlestickBars(symbol, interval.getIntervalId(), limit, startTime, endTime));
- }
-
- @Override
- public List getCandlestickBars(String symbol, CandlestickInterval interval) {
- return getCandlestickBars(symbol, interval, null, null, null);
- }
-
- @Override
- public TickerStatistics get24HrPriceStatistics(String symbol) {
- return executeSync(binanceApiService.get24HrPriceStatistics(symbol));
- }
-
- @Override
- public List getAll24HrPriceStatistics() {
- return executeSync(binanceApiService.getAll24HrPriceStatistics());
- }
-
- @Override
- public TickerPrice getPrice(String symbol) {
- return executeSync(binanceApiService.getLatestPrice(symbol));
- }
-
- @Override
- public List getAllPrices() {
- return executeSync(binanceApiService.getLatestPrices());
- }
-
- @Override
- public List getBookTickers() {
- return executeSync(binanceApiService.getBookTickers());
- }
-
- @Override
- public NewOrderResponse newOrder(NewOrder order) {
- final Call call;
- if (order.getQuoteOrderQty() == null) {
- call = binanceApiService.newOrder(order.getSymbol(), order.getSide(), order.getType(),
- order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(),
- order.getStopPrice(), order.getIcebergQty(), order.getNewOrderRespType(), order.getRecvWindow(),
- order.getTimestamp());
- } else {
- call = binanceApiService.newOrderQuoteQty(order.getSymbol(), order.getSide(), order.getType(),
- order.getTimeInForce(), order.getQuoteOrderQty(), order.getPrice(), order.getNewClientOrderId(),
- order.getStopPrice(), order.getIcebergQty(), order.getNewOrderRespType(), order.getRecvWindow(),
- order.getTimestamp());
- }
- return executeSync(call);
- }
-
- @Override
- public void newOrderTest(NewOrder order) {
- executeSync(binanceApiService.newOrderTest(order.getSymbol(), order.getSide(), order.getType(),
- order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(),
- order.getStopPrice(), order.getIcebergQty(), order.getNewOrderRespType(), order.getRecvWindow(),
- order.getTimestamp()));
- }
-
- // Account endpoints
-
- @Override
- public Order getOrderStatus(OrderStatusRequest orderStatusRequest) {
- return executeSync(binanceApiService.getOrderStatus(orderStatusRequest.getSymbol(),
- orderStatusRequest.getOrderId(), orderStatusRequest.getOrigClientOrderId(),
- orderStatusRequest.getRecvWindow(), orderStatusRequest.getTimestamp()));
- }
-
- @Override
- public CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest) {
- return executeSync(
- binanceApiService.cancelOrder(cancelOrderRequest.getSymbol(), cancelOrderRequest.getOrderId(),
- cancelOrderRequest.getOrigClientOrderId(), cancelOrderRequest.getNewClientOrderId(),
- cancelOrderRequest.getRecvWindow(), cancelOrderRequest.getTimestamp()));
- }
-
- @Override
- public List getOpenOrders(OrderRequest orderRequest) {
- return executeSync(binanceApiService.getOpenOrders(orderRequest.getSymbol(), orderRequest.getRecvWindow(),
- orderRequest.getTimestamp()));
- }
-
- @Override
- public List getAllOrders(AllOrdersRequest orderRequest) {
- return executeSync(binanceApiService.getAllOrders(orderRequest.getSymbol(), orderRequest.getOrderId(),
- orderRequest.getLimit(), orderRequest.getRecvWindow(), orderRequest.getTimestamp()));
- }
-
- @Override
- public NewOCOResponse newOCO(NewOCO oco) {
- return executeSync(binanceApiService.newOCO(oco.getSymbol(), oco.getListClientOrderId(), oco.getSide(),
- oco.getQuantity(), oco.getLimitClientOrderId(), oco.getPrice(), oco.getLimitIcebergQty(),
- oco.getStopClientOrderId(), oco.getStopPrice(), oco.getStopLimitPrice(), oco.getStopIcebergQty(),
- oco.getStopLimitTimeInForce(), oco.getNewOrderRespType(), oco.getRecvWindow(), oco.getTimestamp()));
- }
-
- @Override
- public CancelOrderListResponse cancelOrderList(CancelOrderListRequest cancelOrderListRequest) {
- return executeSync(binanceApiService.cancelOrderList(cancelOrderListRequest.getSymbol(), cancelOrderListRequest.getOrderListId(),
- cancelOrderListRequest.getListClientOrderId(), cancelOrderListRequest.getNewClientOrderId(),
- cancelOrderListRequest.getRecvWindow(), cancelOrderListRequest.getTimestamp()));
- }
-
- @Override
- public OrderList getOrderListStatus(OrderListStatusRequest orderListStatusRequest) {
- return executeSync(binanceApiService.getOrderListStatus(orderListStatusRequest.getOrderListId(), orderListStatusRequest.getOrigClientOrderId(),
- orderListStatusRequest.getRecvWindow(), orderListStatusRequest.getTimestamp()));
- }
-
- @Override
- public List getAllOrderList(AllOrderListRequest allOrderListRequest) {
- return executeSync(binanceApiService.getAllOrderList(allOrderListRequest.getFromId(), allOrderListRequest.getStartTime(),
- allOrderListRequest.getEndTime(), allOrderListRequest.getLimit(), allOrderListRequest.getRecvWindow(), allOrderListRequest.getTimestamp()));
- }
-
- @Override
- public Account getAccount(Long recvWindow, Long timestamp) {
- return executeSync(binanceApiService.getAccount(recvWindow, timestamp));
- }
-
- @Override
- public Account getAccount() {
- return getAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis());
- }
-
- @Override
- public List getMyTrades(String symbol, Integer limit, Long fromId, Long recvWindow, Long timestamp) {
- return executeSync(binanceApiService.getMyTrades(symbol, limit, fromId, recvWindow, timestamp));
- }
-
- @Override
- public List getMyTrades(String symbol, Integer limit) {
- return getMyTrades(symbol, limit, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
- System.currentTimeMillis());
- }
-
- @Override
- public List getMyTrades(String symbol) {
- return getMyTrades(symbol, null, null, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
- System.currentTimeMillis());
- }
-
- @Override
- public List getMyTrades(String symbol, Long fromId) {
- return getMyTrades(symbol, null, fromId, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
- 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 DustTransferResponse dustTranfer(List asset) {
- return executeSync(binanceApiService.dustTransfer(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
- }
-
- @Override
- public DepositHistory getDepositHistory(String asset) {
- return executeSync(binanceApiService.getDepositHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
- System.currentTimeMillis()));
- }
-
- @Override
- public WithdrawHistory getWithdrawHistory(String asset) {
- return executeSync(binanceApiService.getWithdrawHistory(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
- System.currentTimeMillis()));
- }
-
- @Override
- public List getSubAccountTransfers() {
- return executeSync(binanceApiService.getSubAccountTransfers(System.currentTimeMillis()));
- }
-
- @Override
- public DepositAddress getDepositAddress(String asset) {
- return executeSync(binanceApiService.getDepositAddress(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
- System.currentTimeMillis()));
- }
-
- // User stream endpoints
-
- @Override
- public String startUserDataStream() {
- return executeSync(binanceApiService.startUserDataStream()).toString();
- }
-
- @Override
- public void keepAliveUserDataStream(String listenKey) {
- executeSync(binanceApiService.keepAliveUserDataStream(listenKey));
- }
-
- @Override
- public void closeUserDataStream(String listenKey) {
- executeSync(binanceApiService.closeAliveUserDataStream(listenKey));
- }
+ private final BinanceApiService binanceApiService;
+
+ public BinanceApiRestClientImpl(String apiKey, String secret) {
+ binanceApiService = createService(BinanceApiService.class, apiKey, secret);
+ }
+
+ // General endpoints
+
+ @Override
+ public void ping() {
+ executeSync(binanceApiService.ping());
+ }
+
+ @Override
+ public Long getServerTime() {
+ return executeSync(binanceApiService.getServerTime()).getServerTime();
+ }
+
+ @Override
+ public ExchangeInfo getExchangeInfo() {
+ return executeSync(binanceApiService.getExchangeInfo());
+ }
+
+ @Override
+ public List getAllAssets() {
+ return executeSync(binanceApiService
+ .getAllAssets(BinanceApiConfig.getAssetInfoApiBaseUrl() + "assetWithdraw/getAllAsset.html"));
+ }
+
+ // Market Data endpoints
+
+ @Override
+ public OrderBook getOrderBook(String symbol, Integer limit) {
+ return executeSync(binanceApiService.getOrderBook(symbol, limit));
+ }
+
+ @Override
+ public List getTrades(String symbol, Integer limit) {
+ return executeSync(binanceApiService.getTrades(symbol, limit));
+ }
+
+ @Override
+ public List getHistoricalTrades(String symbol, Integer limit, Long fromId) {
+ return executeSync(binanceApiService.getHistoricalTrades(symbol, limit, fromId));
+ }
+
+ @Override
+ public List getAggTrades(String symbol, String fromId, Integer limit, Long startTime, Long endTime) {
+ return executeSync(binanceApiService.getAggTrades(symbol, fromId, limit, startTime, endTime));
+ }
+
+ @Override
+ public List getAggTrades(String symbol) {
+ return getAggTrades(symbol, null, null, null, null);
+ }
+
+ @Override
+ public List getCandlestickBars(String symbol, CandlestickInterval interval, Integer limit,
+ Long startTime, Long endTime) {
+ return executeSync(
+ binanceApiService.getCandlestickBars(symbol, interval.getIntervalId(), limit, startTime, endTime));
+ }
+
+ @Override
+ public List getCandlestickBars(String symbol, CandlestickInterval interval) {
+ return getCandlestickBars(symbol, interval, null, null, null);
+ }
+
+ @Override
+ public TickerStatistics get24HrPriceStatistics(String symbol) {
+ return executeSync(binanceApiService.get24HrPriceStatistics(symbol));
+ }
+
+ @Override
+ public List getAll24HrPriceStatistics() {
+ return executeSync(binanceApiService.getAll24HrPriceStatistics());
+ }
+
+ @Override
+ public TickerPrice getPrice(String symbol) {
+ return executeSync(binanceApiService.getLatestPrice(symbol));
+ }
+
+ @Override
+ public List getAllPrices() {
+ return executeSync(binanceApiService.getLatestPrices());
+ }
+
+ @Override
+ public List getBookTickers() {
+ return executeSync(binanceApiService.getBookTickers());
+ }
+
+ @Override
+ public NewOrderResponse newOrder(NewOrder order) {
+ final Call call;
+ if (order.getQuoteOrderQty() == null) {
+ call = binanceApiService.newOrder(order.getSymbol(), order.getSide(), order.getType(),
+ order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(),
+ order.getStopPrice(), order.getIcebergQty(), order.getNewOrderRespType(), order.getRecvWindow(),
+ order.getTimestamp());
+ } else {
+ call = binanceApiService.newOrderQuoteQty(order.getSymbol(), order.getSide(), order.getType(),
+ order.getTimeInForce(), order.getQuoteOrderQty(), order.getPrice(), order.getNewClientOrderId(),
+ order.getStopPrice(), order.getIcebergQty(), order.getNewOrderRespType(), order.getRecvWindow(),
+ order.getTimestamp());
+ }
+ return executeSync(call);
+ }
+
+ @Override
+ public void newOrderTest(NewOrder order) {
+ executeSync(binanceApiService.newOrderTest(order.getSymbol(), order.getSide(), order.getType(),
+ order.getTimeInForce(), order.getQuantity(), order.getPrice(), order.getNewClientOrderId(),
+ order.getStopPrice(), order.getIcebergQty(), order.getNewOrderRespType(), order.getRecvWindow(),
+ order.getTimestamp()));
+ }
+
+ // Account endpoints
+
+ @Override
+ public Order getOrderStatus(OrderStatusRequest orderStatusRequest) {
+ return executeSync(binanceApiService.getOrderStatus(orderStatusRequest.getSymbol(),
+ orderStatusRequest.getOrderId(), orderStatusRequest.getOrigClientOrderId(),
+ orderStatusRequest.getRecvWindow(), orderStatusRequest.getTimestamp()));
+ }
+
+ @Override
+ public CancelOrderResponse cancelOrder(CancelOrderRequest cancelOrderRequest) {
+ return executeSync(
+ binanceApiService.cancelOrder(cancelOrderRequest.getSymbol(), cancelOrderRequest.getOrderId(),
+ cancelOrderRequest.getOrigClientOrderId(), cancelOrderRequest.getNewClientOrderId(),
+ cancelOrderRequest.getRecvWindow(), cancelOrderRequest.getTimestamp()));
+ }
+
+ @Override
+ public List getOpenOrders(OrderRequest orderRequest) {
+ return executeSync(binanceApiService.getOpenOrders(orderRequest.getSymbol(), orderRequest.getRecvWindow(),
+ orderRequest.getTimestamp()));
+ }
+
+ @Override
+ public List getAllOrders(AllOrdersRequest orderRequest) {
+ return executeSync(binanceApiService.getAllOrders(orderRequest.getSymbol(), orderRequest.getOrderId(),
+ orderRequest.getLimit(), orderRequest.getRecvWindow(), orderRequest.getTimestamp()));
+ }
+
+ @Override
+ public CancelOrderListResponse cancelOrderList(CancelOrderListRequest cancelOrderListRequest) {
+ return executeSync(binanceApiService.cancelOrderList(cancelOrderListRequest.getSymbol(), cancelOrderListRequest.getOrderListId(),
+ cancelOrderListRequest.getListClientOrderId(), cancelOrderListRequest.getNewClientOrderId(),
+ cancelOrderListRequest.getRecvWindow(), cancelOrderListRequest.getTimestamp()));
+ }
+
+ @Override
+ public OrderList getOrderListStatus(OrderListStatusRequest orderListStatusRequest) {
+ return executeSync(binanceApiService.getOrderListStatus(orderListStatusRequest.getOrderListId(), orderListStatusRequest.getOrigClientOrderId(),
+ orderListStatusRequest.getRecvWindow(), orderListStatusRequest.getTimestamp()));
+ }
+
+ @Override
+ public List getAllOrderList(AllOrderListRequest allOrderListRequest) {
+ return executeSync(binanceApiService.getAllOrderList(allOrderListRequest.getFromId(), allOrderListRequest.getStartTime(),
+ allOrderListRequest.getEndTime(), allOrderListRequest.getLimit(), allOrderListRequest.getRecvWindow(), allOrderListRequest.getTimestamp()));
+ }
+
+ @Override
+ public Account getAccount() {
+ return executeSync(binanceApiService.getAccount(BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
+ System.currentTimeMillis()));
+ }
+
+ @Override
+ public List getMyTrades(String symbol, Integer limit, Long fromId) {
+ return executeSync(binanceApiService.getMyTrades(symbol, limit, fromId,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
+ }
+
+ @Override
+ public List getMyTrades(String symbol, Integer limit) {
+ return getMyTrades(symbol, limit, null);
+ }
+
+ @Override
+ public List getMyTrades(String symbol) {
+ return getMyTrades(symbol, null, null);
+ }
+
+ @Override
+ public List getMyTrades(String symbol, Long fromId) {
+ return getMyTrades(symbol, null, fromId);
+ }
+
+ @Override
+ public WithdrawResult withdraw(String coin, String withdrawOrderId, String network,
+ String address, String amount, String name, String addressTag,
+ Boolean transactionFeeFlag) {
+ return executeSync(binanceApiService.withdraw(coin, withdrawOrderId, network, address,
+ addressTag, amount, transactionFeeFlag, name,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
+ }
+
+ @Override
+ public DustTransferResponse dustTransfer(List asset) {
+ return executeSync(binanceApiService.dustTransfer(asset, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
+ }
+
+ @Override
+ public List getDepositHistory(String coin) {
+ return getDepositHistory(coin, null, null, null, null, null);
+ }
+
+ @Override
+ public List getDepositHistory(String coin, Integer status, Long startTime, Long endTime,
+ Integer offset, Integer limit) {
+ return executeSync(binanceApiService.getDepositHistory(coin, status, startTime, endTime,
+ offset, limit,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
+ }
+
+ @Override
+ public List getWithdrawHistory(String coin, String withdrawOrderId, Integer status,
+ Integer offset, Integer limit,
+ Long startTime, Long endTime) {
+ return executeSync(binanceApiService.getWithdrawHistory(coin, withdrawOrderId, status, offset,
+ limit, startTime, endTime, BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
+ System.currentTimeMillis()));
+ }
+
+ @Override
+ public List getWithdrawHistory(String coin) {
+ return getWithdrawHistory(coin, null, null, null, null, null, null);
+ }
+
+ @Override
+ public DepositAddress getDepositAddress(String coin, String network) {
+ return executeSync(binanceApiService.getDepositAddress(coin, network,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW, System.currentTimeMillis()));
+ }
+
+ @Override
+ public List getUserAssets(String asset, boolean needBtcValuation) {
+ return executeSync(binanceApiService.getUserAssets(asset, needBtcValuation,
+ BinanceApiConstants.DEFAULT_RECEIVING_WINDOW,
+ System.currentTimeMillis())
+ );
+ }
+
+ // User stream endpoints
+
+ @Override
+ public String startUserDataStream() {
+ return executeSync(binanceApiService.startUserDataStream()).toString();
+ }
+
+ @Override
+ public void keepAliveUserDataStream(String listenKey) {
+ executeSync(binanceApiService.keepAliveUserDataStream(listenKey));
+ }
+
+ @Override
+ public void closeUserDataStream(String listenKey) {
+ executeSync(binanceApiService.closeAliveUserDataStream(listenKey));
+ }
}
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..894555d72 100755
--- a/src/main/java/com/binance/api/client/impl/BinanceApiService.java
+++ b/src/main/java/com/binance/api/client/impl/BinanceApiService.java
@@ -3,7 +3,6 @@
import com.binance.api.client.constant.BinanceApiConstants;
import com.binance.api.client.domain.OrderSide;
import com.binance.api.client.domain.OrderType;
-import com.binance.api.client.domain.SwapRemoveType;
import com.binance.api.client.domain.TimeInForce;
import com.binance.api.client.domain.account.*;
import com.binance.api.client.domain.account.request.CancelOrderListResponse;
@@ -23,312 +22,247 @@
*/
public interface BinanceApiService {
- // General endpoints
+ // General endpoints
- @GET("/api/v1/ping")
- Call ping();
+ @GET("/api/v1/ping")
+ Call ping();
- @GET("/api/v1/time")
- Call getServerTime();
+ @GET("/api/v1/time")
+ Call getServerTime();
- @GET("/api/v3/exchangeInfo")
- Call getExchangeInfo();
+ @GET("/api/v3/exchangeInfo")
+ Call getExchangeInfo();
- @GET
- Call> getAllAssets(@Url String url);
+ @GET
+ Call> getAllAssets(@Url String url);
- // Market data endpoints
+ // Market data endpoints
- @GET("/api/v1/depth")
- Call getOrderBook(@Query("symbol") String symbol, @Query("limit") Integer limit);
+ @GET("/api/v1/depth")
+ Call getOrderBook(@Query("symbol") String symbol, @Query("limit") Integer limit);
- @GET("/api/v1/trades")
- Call