Skip to content

Commit 0c197cb

Browse files
committed
3.4.0 release
1 parent ece786c commit 0c197cb

File tree

76 files changed

+917
-2292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+917
-2292
lines changed

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Changelog
22

3+
## 3.4.0 - 2024-10-01
4+
### Added
5+
- New Margin endpoints:
6+
- `POST /sapi/v1/margin/borrow-repay`
7+
- `GET /sapi/v1/margin/borrow-repay`
8+
9+
### Changed
10+
- Updated `CryptoLoans` v1 to v2:
11+
- `POST /sapi/v1/loan/flexible/borrow` to `POST /sapi/v2/loan/flexible/borrow`
12+
- `GET /sapi/v1/loan/flexible/ongoing/orders` to `GET /sapi/v2/loan/flexible/ongoing/orders`
13+
- `GET /sapi/v1/loan/flexible/borrow/history` to `GET /sapi/v2/loan/flexible/borrow/history`
14+
- `POST /sapi/v1/loan/flexible/repay` to `POST /sapi/v2/loan/flexible/repay`
15+
- `GET /sapi/v1/loan/flexible/repay/history` to `GET /sapi/v2/loan/flexible/repay/history`
16+
- `POST /sapi/v1/loan/flexible/adjust/ltv` to `POST /sapi/v2/loan/flexible/adjust/ltv`
17+
- `GET /sapi/v1/loan/flexible/ltv/adjustment/history` to `GET /sapi/v2/loan/flexible/ltv/adjustment/history`
18+
- `GET /sapi/v1/loan/flexible/loanable/data` to `GET /sapi/v2/loan/flexible/loanable/data`
19+
- `GET /sapi/v1/loan/flexible/collateral/data` to `GET /sapi/v2/loan/flexible/collateral/data`
20+
- Added parameter `isolatedSymbol` to endpoint `GET /sapi/v1/margin/transfer`
21+
- Added parameter `asset` to endpoint `GET /sapi/v1/margin/allAssets`
22+
- Added parameter `symbol` to endpoints `GET /sapi/v1/margin/allPairs` and `GET /sapi/v1/margin/isolated/allPairs`
23+
24+
### Removed
25+
- Deprecated Futures endpoints:
26+
- `POST /sapi/v1/futures/transfer`
27+
- `GET /sapi/v1/futures/transfer`
28+
- `GET /sapi/v1/futures/histDataLink`
29+
30+
- BLVT endpoints:
31+
- `GET /sapi/v1/blvt/tokenInfo`
32+
- `POST /sapi/v1/blvt/subscribe`
33+
- `GET /sapi/v1/blvt/subscribe/record`
34+
- `POST /sapi/v1/blvt/redeem`
35+
- `GET /sapi/v1/blvt/redeem/record`
36+
- `GET /sapi/v1/blvt/userLimit`
37+
38+
- Deprecated Trade endpoint: `POST /api/v3/order/oco`
39+
40+
- Wallet endpoints:
41+
- `POST /sapi/v1/asset/convert-transfer`
42+
- `GET /sapi/v1/asset/convert-transfer/queryByPage`
43+
- `GET /sapi/v1/capital/contract/convertible-coins`
44+
- `POST /sapi/v1/capital/contract/convertible-coins`
45+
346
## 3.3.0 - 2024-06-19
447
### Changed
548
- Upgraded dependencies

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Additionally, it includes test cases and examples.
1919

2020
## Getting Started
2121
### Maven
22-
Copy and paste the following dependency snippet into your `pom.xml` file, replacing `LATEST_VERSION`` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available:
22+
Copy and paste the following dependency snippet into your `pom.xml` file, replacing `LATEST_VERSION` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available:
2323
```
2424
<dependency>
2525
<groupId>io.github.binance</groupId>
@@ -30,11 +30,17 @@ Copy and paste the following dependency snippet into your `pom.xml` file, replac
3030
Next, install the dependency by executing `mvn install` in the directory where your `pom.xml` is located.
3131

3232
### Gradle
33-
Copy and paste the following dependency snippet into your `build.gradle` file, replacing `LATEST_VERSION`` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available:
33+
Copy and paste the following dependency snippet into your `build.gradle` file, replacing `LATEST_VERSION` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available:
3434
```
3535
implementation 'io.github.binance:binance-connector-java:LATEST_VERSION'
3636
```
37+
38+
Make sure to add the Jitpack repository to the `repositories` section of your `build.gradle` file:
39+
```
40+
maven { url 'https://jitpack.io' }
41+
```
3742
Next, install the dependency by executing `gradle dependencies` in the directory where your `build.gradle` is located.
43+
3844
## Examples
3945
The examples are located under **src/test/java/examples**. Before running any of it, `PrivateConfig.java` must be set up correctly with `API_KEY` and` SECRET_KEY` or `PRIVATE_KEY_PATH` (if using RSA Keys).
4046

src/main/java/com/binance/connector/client/SpotClient.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package com.binance.connector.client;
22

33
import com.binance.connector.client.impl.spot.AutoInvest;
4-
import com.binance.connector.client.impl.spot.Blvt;
54
import com.binance.connector.client.impl.spot.C2C;
65
import com.binance.connector.client.impl.spot.Convert;
76
import com.binance.connector.client.impl.spot.CryptoLoans;
87
import com.binance.connector.client.impl.spot.Fiat;
9-
import com.binance.connector.client.impl.spot.Futures;
108
import com.binance.connector.client.impl.spot.GiftCard;
119
import com.binance.connector.client.impl.spot.Margin;
1210
import com.binance.connector.client.impl.spot.Market;
@@ -31,12 +29,10 @@ public interface SpotClient {
3129
void setProxy(ProxyAuth proxy);
3230
void unsetProxy();
3331
AutoInvest createAutoInvest();
34-
Blvt createBlvt();
3532
C2C createC2C();
3633
Convert createConvert();
3734
CryptoLoans createCryptoLoans();
3835
Fiat createFiat();
39-
Futures createFutures();
4036
GiftCard createGiftCard();
4137
Market createMarket();
4238
Margin createMargin();

src/main/java/com/binance/connector/client/impl/SpotClientImpl.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import com.binance.connector.client.SpotClient;
44
import com.binance.connector.client.enums.DefaultUrls;
55
import com.binance.connector.client.impl.spot.AutoInvest;
6-
import com.binance.connector.client.impl.spot.Blvt;
76
import com.binance.connector.client.impl.spot.C2C;
87
import com.binance.connector.client.impl.spot.Convert;
98
import com.binance.connector.client.impl.spot.CryptoLoans;
109
import com.binance.connector.client.impl.spot.Fiat;
11-
import com.binance.connector.client.impl.spot.Futures;
1210
import com.binance.connector.client.impl.spot.GiftCard;
1311
import com.binance.connector.client.impl.spot.Margin;
1412
import com.binance.connector.client.impl.spot.Market;
@@ -83,11 +81,6 @@ public AutoInvest createAutoInvest() {
8381
return new AutoInvest(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy);
8482
}
8583

86-
@Override
87-
public Blvt createBlvt() {
88-
return new Blvt(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy);
89-
}
90-
9184
@Override
9285
public C2C createC2C() {
9386
return new C2C(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy);
@@ -108,11 +101,6 @@ public Fiat createFiat() {
108101
return new Fiat(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy);
109102
}
110103

111-
@Override
112-
public Futures createFutures() {
113-
return new Futures(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy);
114-
}
115-
116104
@Override
117105
public GiftCard createGiftCard() {
118106
return new GiftCard(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); }

src/main/java/com/binance/connector/client/impl/WebSocketStreamClientImpl.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
/**
2929
* <h2>WebSocket Streams</h2>
3030
* All stream endpoints under the
31-
* <a href="https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams">WebSocket Market Streams</a> and
32-
* <a href="https://binance-docs.github.io/apidocs/spot/en/#user-data-streams">User Data Streams</a>
31+
* <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams">WebSocket Market Streams</a> and
32+
* <a href="https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream">User Data Streams</a>
3333
* section of the API documentation will be implemented in this class.
3434
* <br>
3535
* Response will be returned as callback.
@@ -61,8 +61,8 @@ public WebSocketStreamClientImpl(String baseUrl) {
6161
*
6262
* @param symbol Name of the trading pair
6363
* @return int - Connection ID
64-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams">
65-
* https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams</a>
64+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#aggregate-trade-streams">
65+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#aggregate-trade-streams</a>
6666
*/
6767
@Override
6868
public int aggTradeStream(String symbol, WebSocketMessageCallback callback) {
@@ -96,8 +96,8 @@ public int aggTradeStream(String symbol, WebSocketOpenCallback onOpenCallback, W
9696
*
9797
* @param symbol Name of the trading pair
9898
* @return int - Connection ID
99-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#trade-streams">
100-
* https://binance-docs.github.io/apidocs/spot/en/#trade-streams</a>
99+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#trade-streams">
100+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#trade-streams</a>
101101
*/
102102
@Override
103103
public int tradeStream(String symbol, WebSocketMessageCallback callback) {
@@ -132,8 +132,8 @@ public int tradeStream(String symbol, WebSocketOpenCallback onOpenCallback, WebS
132132
* @param symbol Name of the trading pair
133133
* @param interval Time interval for kline/candlestick
134134
* @return int - Connection ID
135-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams">
136-
* https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams</a>
135+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#klinecandlestick-streams-for-utc">
136+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#klinecandlestick-streams-for-utc</a>
137137
*/
138138
@Override
139139
public int klineStream(String symbol, String interval, WebSocketMessageCallback callback) {
@@ -169,8 +169,8 @@ public int klineStream(String symbol, String interval, WebSocketOpenCallback onO
169169
*
170170
* @param symbol Name of the trading pair
171171
* @return int - Connection ID
172-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream">
173-
* https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream</a>
172+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream">
173+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream</a>
174174
*/
175175
@Override
176176
public int miniTickerStream(String symbol, WebSocketMessageCallback callback) {
@@ -205,8 +205,8 @@ public int miniTickerStream(String symbol, WebSocketOpenCallback onOpenCallback,
205205
* Update Speed: Real-time
206206
*
207207
* @return int - Connection ID
208-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream">
209-
* https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream</a>
208+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream">
209+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream</a>
210210
*/
211211
@Override
212212
public int allMiniTickerStream(WebSocketMessageCallback callback) {
@@ -238,8 +238,8 @@ public int allMiniTickerStream(WebSocketOpenCallback onOpenCallback, WebSocketMe
238238
*
239239
* @param symbol Name of the trading pair
240240
* @return int - Connection ID
241-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams">
242-
* https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams</a>
241+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-ticker-streams">
242+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-ticker-streams</a>
243243
*/
244244
@Override
245245
public int symbolTicker(String symbol, WebSocketMessageCallback callback) {
@@ -274,8 +274,8 @@ public int symbolTicker(String symbol, WebSocketOpenCallback onOpenCallback, Web
274274
* Update Speed: Real-time
275275
*
276276
* @return int - Connection ID
277-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream">
278-
* https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream</a>
277+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-tickers-stream">
278+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-tickers-stream</a>
279279
*/
280280
@Override
281281
public int allTickerStream(WebSocketMessageCallback callback) {
@@ -307,8 +307,8 @@ public int allTickerStream(WebSocketOpenCallback onOpenCallback, WebSocketMessag
307307
* @param symbol Name of the trading pair
308308
* @param windowSize Window Sizes: 1h,4h
309309
* @return int - Connection ID
310-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams">
311-
* https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams</a>
310+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-rolling-window-statistics-streams">
311+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-rolling-window-statistics-streams</a>
312312
*/
313313
public int rollingWindowTicker(String symbol, String windowSize, WebSocketMessageCallback callback) {
314314
ParameterChecker.checkParameterType(symbol, String.class, "symbol");
@@ -358,8 +358,8 @@ public int rollingWindowTicker(String symbol, String windowSize, WebSocketOpenCa
358358
*
359359
* @param windowSize Window Sizes: 1h,4h
360360
* @return int - Connection ID
361-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams">
362-
* https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams</a>
361+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-rolling-window-statistics-streams">
362+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-rolling-window-statistics-streams</a>
363363
*/
364364
@Override
365365
public int allRollingWindowTicker(String windowSize, WebSocketMessageCallback callback) {
@@ -400,8 +400,8 @@ public int allRollingWindowTicker(String windowSize, WebSocketOpenCallback onOpe
400400
*
401401
* @param symbol Name of the trading pair
402402
* @return int - Connection ID
403-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams">
404-
* https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams</a>
403+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-book-ticker-streams">
404+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-book-ticker-streams</a>
405405
*/
406406
@Override
407407
public int bookTicker(String symbol, WebSocketMessageCallback callback) {
@@ -437,8 +437,8 @@ public int bookTicker(String symbol, WebSocketOpenCallback onOpenCallback, WebSo
437437
* @param levels Valid are 5, 10, or 20
438438
* @param speed 1000ms or 100ms
439439
* @return int - Connection ID
440-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams">
441-
* https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams</a>
440+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams">
441+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams</a>
442442
*/
443443
@Override
444444
public int partialDepthStream(String symbol, int levels, int speed, WebSocketMessageCallback callback) {
@@ -475,8 +475,8 @@ public int partialDepthStream(String symbol, int levels, int speed, WebSocketOpe
475475
* @param symbol Name of the trading pair
476476
* @param speed 1000ms or 100ms
477477
* @return int - Connection ID
478-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream">
479-
* https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream</a>
478+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream">
479+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream</a>
480480
*/
481481
@Override
482482
public int diffDepthStream(String symbol, int speed, WebSocketMessageCallback callback) {
@@ -506,10 +506,10 @@ public int diffDepthStream(String symbol, int speed, WebSocketOpenCallback onOpe
506506
* User Data Streams are accessed at /ws/&lt;listenKey&gt;
507507
*
508508
* @param listenKey listen key obtained from this
509-
* <a href="https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot">endpoint</a>
509+
* <a href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api#user-data-stream-endpoints">endpoint</a>
510510
* @return int - Connection ID
511-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#user-data-streams">
512-
* https://binance-docs.github.io/apidocs/spot/en/#user-data-streams</a>
511+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api#start-user-data-stream-user_stream">
512+
* https://developers.binance.com/docs/binance-spot-api-docs/rest-api#start-user-data-stream-user_stream</a>
513513
*/
514514
@Override
515515
public int listenUserStream(String listenKey, WebSocketMessageCallback callback) {
@@ -520,7 +520,7 @@ public int listenUserStream(String listenKey, WebSocketMessageCallback callback)
520520
* Same as {@link #listenUserStream(String, WebSocketMessageCallback)} plus accepts callbacks for all major websocket connection events.
521521
*
522522
* @param listenKey listen key obtained from this
523-
* <a href="https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot">endpoint</a>
523+
* <a href="https://developers.binance.com/docs/binance-spot-api-docs/rest-api#user-data-stream-endpoints">endpoint</a>
524524
* @param onOpenCallback Callback for when the websocket connection is opened
525525
* @param onMessageCallback Callback for when a message is received
526526
* @param onClosingCallback Callback for when the websocket connection is closing
@@ -538,8 +538,8 @@ public int listenUserStream(String listenKey, WebSocketOpenCallback onOpenCallba
538538
*
539539
* @param streams ArrayList of stream names to be combined <br>
540540
* @return int - Connection ID
541-
* @see <a href="https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams">
542-
* https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams</a>
541+
* @see <a href="https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams">
542+
* https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams</a>
543543
*/
544544
@Override
545545
public int combineStreams(ArrayList<String> streams, WebSocketMessageCallback callback) {

0 commit comments

Comments
 (0)