Skip to content

Commit

Permalink
v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aisling-2 committed Oct 17, 2023
1 parent bad259d commit 921bbbf
Show file tree
Hide file tree
Showing 41 changed files with 38 additions and 1,530 deletions.
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
# Changelog

## 3.1.0 - 2023-10-17

### Added
- Allow custom timestamp when sending a signed request for both REST API and WebSocket API.

### Removed
- Deleted some deprecated Lending endpoints (within Savings):
- `GET /sapi/v1/lending/daily/product/list`
- `GET /sapi/v1/lending/daily/userLeftQuota`
- `POST /sapi/v1/lending/daily/purchase`
- `GET /sapi/v1/lending/daily/userRedemptionQuota`
- `POST /sapi/v1/lending/daily/redeem`
- `GET /sapi/v1/lending/daily/token/position`
- `GET /sapi/v1/lending/union/account`
- `GET /sapi/v1/lending/union/purchaseRecord`
- `GET /sapi/v1/lending/union/redemptionRecord`
- `GET /sapi/v1/lending/union/interestHistory`

- Deleted deprecated Futures cross collateral endpoints:
- `GET /sapi/v1/futures/loan/borrow/history`
- `GET /sapi/v1/futures/loan/repay/history`
- `GET /sapi/v2/futures/loan/wallet`
- `GET /sapi/v1/futures/loan/adjustCollateral/history`
- `GET /sapi/v1/futures/loan/liquidationHistory`
- `GET /sapi/v1/futures/loan/interestHistory`

- Deleted WebSocketStreamClient's `allBookTickerStream` (`!bookTicker`).

### Changed
- Upgraded `org.json` dependency to version `20231013`.

## 3.0.0 - 2023-09-28

### Changed
- Upgraded `org.bouncycastle:bcprov-jdk18on` dependency to version `1.74`.


## 3.0.0rc3 - 2023-06-27

### Added
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.binance</groupId>
<artifactId>binance-connector-java</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>lightweight connector to API</description>
Expand Down Expand Up @@ -172,7 +172,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<version>20231013</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public interface WebSocketStreamClient {
int allRollingWindowTicker(String windowSize, WebSocketOpenCallback onOpenCallback, WebSocketMessageCallback onMessageCallback, WebSocketClosingCallback onClosingCallback, WebSocketClosedCallback onClosedCallback, WebSocketFailureCallback onFailureCallback);
int bookTicker(String symbol, WebSocketMessageCallback callback);
int bookTicker(String symbol, WebSocketOpenCallback onOpenCallback, WebSocketMessageCallback onMessageCallback, WebSocketClosingCallback onClosingCallback, WebSocketClosedCallback onClosedCallback, WebSocketFailureCallback onFailureCallback);
int allBookTickerStream(WebSocketMessageCallback callback);
int allBookTickerStream(WebSocketOpenCallback onOpenCallback, WebSocketMessageCallback onMessageCallback, WebSocketClosingCallback onClosingCallback, WebSocketClosedCallback onClosedCallback, WebSocketFailureCallback onFailureCallback);
int partialDepthStream(String symbol, int levels, int speed, WebSocketMessageCallback callback);
int partialDepthStream(String symbol, int levels, int speed, WebSocketOpenCallback onOpenCallback, WebSocketMessageCallback onMessageCallback, WebSocketClosingCallback onClosingCallback, WebSocketClosedCallback onClosedCallback, WebSocketFailureCallback onFailureCallback);
int diffDepthStream(String symbol, int speed, WebSocketMessageCallback callback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,37 +426,6 @@ public int bookTicker(String symbol, WebSocketOpenCallback onOpenCallback, WebSo
return createConnection(onOpenCallback, onMessageCallback, onClosingCallback, onClosedCallback, onFailureCallback, request);
}

/**
* Pushes any update to the best bid or ask's price or quantity in real-time for all symbols.
* <br><br>
* !bookTicker
* <br><br>
* Update Speed: Real-time
*
* @return int - Connection ID
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream">
* https://binance-docs.github.io/apidocs/spot/en/#all-book-tickers-stream</a>
*/
@Override
public int allBookTickerStream(WebSocketMessageCallback callback) {
return allBookTickerStream(noopOpenCallback, callback, noopClosingCallback, noopClosedCallback, noopFailureCallback);
}

/**
* Same as {@link #allBookTickerStream(WebSocketMessageCallback)} plus accepts callbacks for all major websocket connection events.
*
* @param onOpenCallback Callback for when the websocket connection is opened
* @param onMessageCallback Callback for when a message is received
* @param onClosingCallback Callback for when the websocket connection is closing
* @param onFailureCallback Callback for when an error occurs
* @return int - Connection ID
*/
@Override
public int allBookTickerStream(WebSocketOpenCallback onOpenCallback, WebSocketMessageCallback onMessageCallback, WebSocketClosingCallback onClosingCallback, WebSocketClosedCallback onClosedCallback, WebSocketFailureCallback onFailureCallback) {
Request request = RequestBuilder.buildWebSocketRequest(String.format("%s/ws/!bookTicker", baseUrl));
return createConnection(onOpenCallback, onMessageCallback, onClosingCallback, onClosedCallback, onFailureCallback, request);
}

/**
* Top bids and asks, Valid are 5, 10, or 20.
* <br><br>
Expand Down
125 changes: 0 additions & 125 deletions src/main/java/com/binance/connector/client/impl/spot/Futures.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,129 +84,4 @@ public String futuresTransferHistory(Map<String, Object> parameters) {
ParameterChecker.checkParameter(parameters, "startTime", Long.class);
return requestHandler.sendSignedRequest(baseUrl, FUTURES_TRANSFER, parameters, HttpMethod.GET, showLimitUsage);
}

private final String BORROW_HISTORY = "/sapi/v1/futures/loan/borrow/history";
/**
* GET /sapi/v1/futures/loan/borrow/history
* <br>
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
* <br><br>
* coin -- optional/string <br>
* startTime -- optional/long <br>
* endTime -- optional/long <br>
* limit -- optional/long -- default 500, max 1000 <br>
* recvWindow -- optional/long <br>
* @return String
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-borrow-history-user_data">
* https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-borrow-history-user_data</a>
*/
public String borrowHistory(Map<String, Object> parameters) {
return requestHandler.sendSignedRequest(baseUrl, BORROW_HISTORY, parameters, HttpMethod.GET, showLimitUsage);
}

private final String REPAY_HISTORY = "/sapi/v1/futures/loan/repay/history";
/**
* GET /sapi/v1/futures/loan/repay/history
* <br>
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
* <br><br>
* coin -- optional/string <br>
* startTime -- optional/long <br>
* endTime -- optional/long <br>
* limit -- optional/long -- default 500, max 1000 <br>
* recvWindow -- optional/long <br>
* @return String
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-repayment-history-user_data">
* https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-repayment-history-user_data</a>
*/
public String repayHistory(Map<String, Object> parameters) {
return requestHandler.sendSignedRequest(baseUrl, REPAY_HISTORY, parameters, HttpMethod.GET, showLimitUsage);
}

private final String WALLET = "/sapi/v2/futures/loan/wallet";
/**
* GET /sapi/v2/futures/loan/wallet
* <br>
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
* <br><br>
* recvWindow -- optional/long <br>
* @return String
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-wallet-user_data">
* https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-wallet-user_data</a>
*/
public String loanWallet(Map<String, Object> parameters) {
return requestHandler.sendSignedRequest(baseUrl, WALLET, parameters, HttpMethod.GET, showLimitUsage);
}

private final String ADJUST_COLLATERAL_HISTORY = "/sapi/v1/futures/loan/adjustCollateral/history";
/**
* GET /sapi/v1/futures/loan/adjustCollateral/history
* <br>
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
* <br><br>
* loanCoin -- optional/string <br>
* collateralCoin -- optional/string <br>
* startTime -- optional/long <br>
* endTime -- optional/long <br>
* limit -- optional/long -- default 500, max 1000 <br>
* recvWindow -- optional/long <br>
* @return String
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#adjust-cross-collateral-ltv-history-user_data">
* https://binance-docs.github.io/apidocs/spot/en/#adjust-cross-collateral-ltv-history-user_data</a>
*/
public String adjustCollateralHistory(Map<String, Object> parameters) {
return requestHandler.sendSignedRequest(baseUrl, ADJUST_COLLATERAL_HISTORY, parameters, HttpMethod.GET, showLimitUsage);
}

private final String LIQUIDATION_HISTORY = "/sapi/v1/futures/loan/liquidationHistory";
/**
* GET /sapi/v1/futures/loan/liquidationHistory
* <br>
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
* <br><br>
* loanCoin -- optional/string <br>
* collateralCoin -- optional/string <br>
* startTime -- optional/long <br>
* endTime -- optional/long <br>
* limit -- optional/long -- default 500, max 1000 <br>
* recvWindow -- optional/long <br>
* @return String
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-liquidation-history-user_data">
* https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-liquidation-history-user_data</a>
*/
public String liquidationHistory(Map<String, Object> parameters) {
return requestHandler.sendSignedRequest(baseUrl, LIQUIDATION_HISTORY, parameters, HttpMethod.GET, showLimitUsage);
}

private final String INTEREST_HISTORY = "/sapi/v1/futures/loan/interestHistory";
/**
* GET /sapi/v1/futures/loan/interestHistory
* <br>
* @param
* parameters Map of String,Object pair
* where String is the name of the parameter and Object is the value of the parameter
* <br><br>
* collateralCoin -- optional/string <br>
* startTime -- optional/long <br>
* endTime -- optional/long <br>
* current -- optional/long -- Currently querying page. Start from 1. Default:1 <br>
* limit -- optional/long -- default 500, max 1000 <br>
* recvWindow -- optional/long <br>
* @return String
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-interest-history-user_data">
* https://binance-docs.github.io/apidocs/spot/en/#cross-collateral-interest-history-user_data</a>
*/
public String interestHistory(Map<String, Object> parameters) {
return requestHandler.sendSignedRequest(baseUrl, INTEREST_HISTORY, parameters, HttpMethod.GET, showLimitUsage);
}
}
Loading

0 comments on commit 921bbbf

Please sign in to comment.