diff --git a/clients/algo/CHANGELOG.md b/clients/algo/CHANGELOG.md index f26956034..6829f672b 100644 --- a/clients/algo/CHANGELOG.md +++ b/clients/algo/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2.2 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 1.2.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/algo/pom.xml b/clients/algo/pom.xml index 2c258e033..01251e4fd 100644 --- a/clients/algo/pom.xml +++ b/clients/algo/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-algo algo - 1.2.1 + 1.2.2 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.4.2 \ No newline at end of file diff --git a/clients/alpha/CHANGELOG.md b/clients/alpha/CHANGELOG.md index 7b6b27370..b9d294822 100644 --- a/clients/alpha/CHANGELOG.md +++ b/clients/alpha/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 1.0.0 - 2026-01-20 - Initial release \ No newline at end of file diff --git a/clients/alpha/pom.xml b/clients/alpha/pom.xml index 175066532..28e3b85cd 100644 --- a/clients/alpha/pom.xml +++ b/clients/alpha/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-alpha alpha - 1.0.0 + 1.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/c2c/CHANGELOG.md b/clients/c2c/CHANGELOG.md index 578971340..83f70de10 100644 --- a/clients/c2c/CHANGELOG.md +++ b/clients/c2c/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 2.0.0 - 2025-12-16 ### Changed (6) diff --git a/clients/c2c/pom.xml b/clients/c2c/pom.xml index fe1cb4ac2..edcb47d08 100644 --- a/clients/c2c/pom.xml +++ b/clients/c2c/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-c2c c2c - 2.0.0 + 2.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.4.2 \ No newline at end of file diff --git a/clients/common/pom.xml b/clients/common/pom.xml index 09cc7efbc..9d8cfa413 100644 --- a/clients/common/pom.xml +++ b/clients/common/pom.xml @@ -5,11 +5,11 @@ io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 binance-common common - 2.4.1 + 2.4.2 jar \ No newline at end of file diff --git a/clients/common/src/main/java/com/binance/connector/client/common/auth/SignatureGeneratorFactory.java b/clients/common/src/main/java/com/binance/connector/client/common/auth/SignatureGeneratorFactory.java index 28e7d2f48..9cccc75a2 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/auth/SignatureGeneratorFactory.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/auth/SignatureGeneratorFactory.java @@ -6,6 +6,7 @@ import com.binance.connector.client.common.sign.PrivateKey; import com.binance.connector.client.common.sign.SignatureGenerator; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -18,7 +19,7 @@ public SignatureGenerator getSignatureGenerator(SignatureConfiguration configura byte[] privateKeyContent; // check if it is the private key content, or path to private key if (hasPrivateKeyHeader(privateKeyConfig)) { - privateKeyContent = privateKeyConfig.getBytes(); + privateKeyContent = privateKeyConfig.getBytes(StandardCharsets.UTF_8); } else { Path path = Paths.get(privateKeyConfig); try { diff --git a/clients/common/src/main/java/com/binance/connector/client/common/sign/HmacSignatureGenerator.java b/clients/common/src/main/java/com/binance/connector/client/common/sign/HmacSignatureGenerator.java index 67f9dd950..acf1c2df1 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/sign/HmacSignatureGenerator.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/sign/HmacSignatureGenerator.java @@ -5,6 +5,8 @@ import org.apache.commons.codec.binary.Hex; import org.bouncycastle.crypto.CryptoException; +import java.nio.charset.StandardCharsets; + public class HmacSignatureGenerator implements SignatureGenerator { private static final String HMAC_SHA256 = "HmacSHA256"; private final String apiSecret; @@ -16,14 +18,14 @@ public HmacSignatureGenerator(String apiSecret) { @Override public byte[] sign(String input) throws CryptoException { - return sign(input.getBytes()); + return sign(input.getBytes(StandardCharsets.UTF_8)); } @Override public byte[] sign(byte[] input) throws CryptoException { byte[] hmacSha256; try { - SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(), HMAC_SHA256); + SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256); Mac mac = Mac.getInstance(HMAC_SHA256); mac.init(secretKeySpec); hmacSha256 = mac.doFinal(input); @@ -35,7 +37,7 @@ public byte[] sign(byte[] input) throws CryptoException { @Override public String signAsString(String input) throws CryptoException { - return signAsString(input.getBytes()); + return signAsString(input.getBytes(StandardCharsets.UTF_8)); } @Override diff --git a/clients/common/src/main/java/com/binance/connector/client/common/sign/PrivateKey.java b/clients/common/src/main/java/com/binance/connector/client/common/sign/PrivateKey.java index 141c2e5ad..ba387411a 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/sign/PrivateKey.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/sign/PrivateKey.java @@ -2,6 +2,7 @@ import com.binance.connector.client.common.ApiException; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.security.Security; import java.security.spec.PKCS8EncodedKeySpec; import java.util.Base64; @@ -62,7 +63,7 @@ public void init(byte[] keyContent, String password) throws ApiException { try { Security.addProvider(new BouncyCastleProvider()); PKCS8EncryptedPrivateKeyInfo pkcs8EncryptedPrivateKeyInfo = - new PKCS8EncryptedPrivateKeyInfo(Base64.getDecoder().decode(s.getBytes())); + new PKCS8EncryptedPrivateKeyInfo(Base64.getDecoder().decode(s.getBytes(StandardCharsets.UTF_8))); // Decrypt encrypted key JcaPEMKeyConverter jcaPEMKeyConverter = new JcaPEMKeyConverter(); InputDecryptorProvider inputDecryptorProvider = @@ -84,17 +85,17 @@ public void init(byte[] keyContent, String password) throws ApiException { } public byte[] sign(String input) throws CryptoException { - return sign(input.getBytes()); + return sign(input.getBytes(StandardCharsets.UTF_8)); } - public byte[] sign(byte[] input) throws CryptoException { + public synchronized byte[] sign(byte[] input) throws CryptoException { signer.update(input, 0, input.length); byte[] generateSignature = signer.generateSignature(); return Base64.getEncoder().encode(generateSignature); } public String signAsString(String input) throws CryptoException { - return signAsString(input.getBytes()); + return signAsString(input.getBytes(StandardCharsets.UTF_8)); } public String signAsString(byte[] input) throws CryptoException { diff --git a/clients/common/src/main/java/com/binance/connector/client/common/websocket/HmacSignatureGenerator.java b/clients/common/src/main/java/com/binance/connector/client/common/websocket/HmacSignatureGenerator.java index 978757d49..047b8da14 100644 --- a/clients/common/src/main/java/com/binance/connector/client/common/websocket/HmacSignatureGenerator.java +++ b/clients/common/src/main/java/com/binance/connector/client/common/websocket/HmacSignatureGenerator.java @@ -4,6 +4,8 @@ import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Hex; +import java.nio.charset.StandardCharsets; + public final class HmacSignatureGenerator { private static final String HMAC_SHA256 = "HmacSHA256"; private final String apiSecret; @@ -16,10 +18,10 @@ public HmacSignatureGenerator(String apiSecret) { public String getSignature(String data) { byte[] hmacSha256; try { - SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(), HMAC_SHA256); + SecretKeySpec secretKeySpec = new SecretKeySpec(apiSecret.getBytes(StandardCharsets.UTF_8), HMAC_SHA256); Mac mac = Mac.getInstance(HMAC_SHA256); mac.init(secretKeySpec); - hmacSha256 = mac.doFinal(data.getBytes()); + hmacSha256 = mac.doFinal(data.getBytes(StandardCharsets.UTF_8)); } catch (Exception e) { throw new RuntimeException("Failed to calculate hmac-sha256", e); } diff --git a/clients/convert/CHANGELOG.md b/clients/convert/CHANGELOG.md index 67a2269e9..fb6021aeb 100644 --- a/clients/convert/CHANGELOG.md +++ b/clients/convert/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`.| + ## 2.0.0 - 2026-02-12 ### Changed (1) diff --git a/clients/convert/pom.xml b/clients/convert/pom.xml index 16ec279d2..cdb78aba8 100644 --- a/clients/convert/pom.xml +++ b/clients/convert/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-convert convert - 2.0.0 + 2.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/copy-trading/CHANGELOG.md b/clients/copy-trading/CHANGELOG.md index f26956034..51ad84c67 100644 --- a/clients/copy-trading/CHANGELOG.md +++ b/clients/copy-trading/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2.2 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`.| + ## 1.2.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/copy-trading/pom.xml b/clients/copy-trading/pom.xml index 7f9e85b70..f58033d6c 100644 --- a/clients/copy-trading/pom.xml +++ b/clients/copy-trading/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-copy-trading copy-trading - 1.2.1 + 1.2.2 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.4.2 \ No newline at end of file diff --git a/clients/crypto-loan/CHANGELOG.md b/clients/crypto-loan/CHANGELOG.md index 00913c67d..1bd6e0e72 100644 --- a/clients/crypto-loan/CHANGELOG.md +++ b/clients/crypto-loan/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 4.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 4.0.0 - 2026-02-12 ### Added (1) diff --git a/clients/crypto-loan/pom.xml b/clients/crypto-loan/pom.xml index 09b98bc25..bdba8ecbb 100644 --- a/clients/crypto-loan/pom.xml +++ b/clients/crypto-loan/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-crypto-loan crypto-loan - 4.0.0 + 4.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/derivatives-trading-coin-futures/CHANGELOG.md b/clients/derivatives-trading-coin-futures/CHANGELOG.md index dbd80f344..fa69f8f8c 100644 --- a/clients/derivatives-trading-coin-futures/CHANGELOG.md +++ b/clients/derivatives-trading-coin-futures/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 7.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 7.0.0 - 2026-03-18 ### Changed (1) diff --git a/clients/derivatives-trading-coin-futures/pom.xml b/clients/derivatives-trading-coin-futures/pom.xml index 796853d8c..e20dbb1ec 100644 --- a/clients/derivatives-trading-coin-futures/pom.xml +++ b/clients/derivatives-trading-coin-futures/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-derivatives-trading-coin-futures derivatives-trading-coin-futures - 7.0.0 + 7.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.4.1 + 2.4.2 \ No newline at end of file diff --git a/clients/derivatives-trading-options/CHANGELOG.md b/clients/derivatives-trading-options/CHANGELOG.md index 53230f778..45046b978 100644 --- a/clients/derivatives-trading-options/CHANGELOG.md +++ b/clients/derivatives-trading-options/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 7.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 6.0.0 - 2026-03-18 ### Changed (1) diff --git a/clients/derivatives-trading-options/pom.xml b/clients/derivatives-trading-options/pom.xml index fb2b5a150..ec681af29 100644 --- a/clients/derivatives-trading-options/pom.xml +++ b/clients/derivatives-trading-options/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-derivatives-trading-options derivatives-trading-options - 7.0.0 + 7.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.4.1 + 2.4.2 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md index 02fb16163..bc24d81b5 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin-pro/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 6.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 6.0.0 - 2026-02-12 ### Added (2) diff --git a/clients/derivatives-trading-portfolio-margin-pro/pom.xml b/clients/derivatives-trading-portfolio-margin-pro/pom.xml index e3f039772..b95f0c724 100644 --- a/clients/derivatives-trading-portfolio-margin-pro/pom.xml +++ b/clients/derivatives-trading-portfolio-margin-pro/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-derivatives-trading-portfolio-margin-pro derivatives-trading-portfolio-margin-pro - 6.0.0 + 6.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md index 553ef9814..c1b86053f 100644 --- a/clients/derivatives-trading-portfolio-margin/CHANGELOG.md +++ b/clients/derivatives-trading-portfolio-margin/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 5.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 5.0.0 - 2026-02-12 ### Changed (2) diff --git a/clients/derivatives-trading-portfolio-margin/pom.xml b/clients/derivatives-trading-portfolio-margin/pom.xml index b7bf783db..c9822cbb9 100644 --- a/clients/derivatives-trading-portfolio-margin/pom.xml +++ b/clients/derivatives-trading-portfolio-margin/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-derivatives-trading-portfolio-margin derivatives-trading-portfolio-margin - 5.0.0 + 5.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/derivatives-trading-usds-futures/CHANGELOG.md b/clients/derivatives-trading-usds-futures/CHANGELOG.md index 684ddb734..88926b849 100644 --- a/clients/derivatives-trading-usds-futures/CHANGELOG.md +++ b/clients/derivatives-trading-usds-futures/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 10.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 10.0.0 - 2026-03-18 ### Changed (5) diff --git a/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md b/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md deleted file mode 100644 index 15aecd5dc..000000000 --- a/clients/derivatives-trading-usds-futures/docs/WebsocketMarketStreamsApi.md +++ /dev/null @@ -1,1268 +0,0 @@ -# WebsocketMarketStreamsApi - -All URIs are relative to *http://localhost* - -| Method | HTTP request | Description | -|------------- | ------------- | -------------| -| [**aggregateTradeStreams**](WebsocketMarketStreamsApi.md#aggregateTradeStreams) | **POST** /<symbol>@aggTrade | Aggregate Trade Streams | -| [**allBookTickersStream**](WebsocketMarketStreamsApi.md#allBookTickersStream) | **POST** /!bookTicker | All Book Tickers Stream | -| [**allMarketLiquidationOrderStreams**](WebsocketMarketStreamsApi.md#allMarketLiquidationOrderStreams) | **POST** /!forceOrder@arr | All Market Liquidation Order Streams | -| [**allMarketMiniTickersStream**](WebsocketMarketStreamsApi.md#allMarketMiniTickersStream) | **POST** /!miniTicker@arr | All Market Mini Tickers Stream | -| [**allMarketTickersStreams**](WebsocketMarketStreamsApi.md#allMarketTickersStreams) | **POST** /!ticker@arr | All Market Tickers Streams | -| [**compositeIndexSymbolInformationStreams**](WebsocketMarketStreamsApi.md#compositeIndexSymbolInformationStreams) | **POST** /<symbol>@compositeIndex | Composite Index Symbol Information Streams | -| [**continuousContractKlineCandlestickStreams**](WebsocketMarketStreamsApi.md#continuousContractKlineCandlestickStreams) | **POST** /<pair>_<contractType>@continuousKline_<interval> | Continuous Contract Kline/Candlestick Streams | -| [**contractInfoStream**](WebsocketMarketStreamsApi.md#contractInfoStream) | **POST** /!contractInfo | Contract Info Stream | -| [**diffBookDepthStreams**](WebsocketMarketStreamsApi.md#diffBookDepthStreams) | **POST** /<symbol>@depth@<updateSpeed> | Diff. Book Depth Streams | -| [**individualSymbolBookTickerStreams**](WebsocketMarketStreamsApi.md#individualSymbolBookTickerStreams) | **POST** /<symbol>@bookTicker | Individual Symbol Book Ticker Streams | -| [**individualSymbolMiniTickerStream**](WebsocketMarketStreamsApi.md#individualSymbolMiniTickerStream) | **POST** /<symbol>@miniTicker | Individual Symbol Mini Ticker Stream | -| [**individualSymbolTickerStreams**](WebsocketMarketStreamsApi.md#individualSymbolTickerStreams) | **POST** /<symbol>@ticker | Individual Symbol Ticker Streams | -| [**klineCandlestickStreams**](WebsocketMarketStreamsApi.md#klineCandlestickStreams) | **POST** /<symbol>@kline_<interval> | Kline/Candlestick Streams | -| [**liquidationOrderStreams**](WebsocketMarketStreamsApi.md#liquidationOrderStreams) | **POST** /<symbol>@forceOrder | Liquidation Order Streams | -| [**markPriceStream**](WebsocketMarketStreamsApi.md#markPriceStream) | **POST** /<symbol>@markPrice@<updateSpeed> | Mark Price Stream | -| [**markPriceStreamForAllMarket**](WebsocketMarketStreamsApi.md#markPriceStreamForAllMarket) | **POST** /!markPrice@arr@<updateSpeed> | Mark Price Stream for All market | -| [**multiAssetsModeAssetIndex**](WebsocketMarketStreamsApi.md#multiAssetsModeAssetIndex) | **POST** /!assetIndex@arr | Multi-Assets Mode Asset Index | -| [**partialBookDepthStreams**](WebsocketMarketStreamsApi.md#partialBookDepthStreams) | **POST** /<symbol>@depth<levels>@<updateSpeed> | Partial Book Depth Streams | -| [**rpiDiffBookDepthStreams**](WebsocketMarketStreamsApi.md#rpiDiffBookDepthStreams) | **POST** /<symbol>@rpiDepth@500ms | RPI Diff. Book Depth Streams | -| [**tradingSessionStream**](WebsocketMarketStreamsApi.md#tradingSessionStream) | **POST** /tradingSession | Trading Session Stream | - - - -# **aggregateTradeStreams** -> AggregateTradeStreamsResponse aggregateTradeStreams(aggregateTradeStreamsRequest) - -Aggregate Trade Streams - -The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds. Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated. Retail Price Improvement(RPI) orders are aggregated into field `q` and without special tags to be distinguished. Update Speed: 100ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - AggregateTradeStreamsRequest aggregateTradeStreamsRequest = new AggregateTradeStreamsRequest(); // AggregateTradeStreamsRequest | - try { - AggregateTradeStreamsResponse result = apiInstance.aggregateTradeStreams(aggregateTradeStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#aggregateTradeStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **aggregateTradeStreamsRequest** | [**AggregateTradeStreamsRequest**](AggregateTradeStreamsRequest.md)| | | - -### Return type - -[**AggregateTradeStreamsResponse**](AggregateTradeStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Aggregate Trade Streams | - | - - -# **allBookTickersStream** -> AllBookTickersStreamResponse allBookTickersStream(allBookTickersStreamRequest) - -All Book Tickers Stream - -Pushes any update to the best bid or ask's price or quantity in real-time for all symbols. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: 5s - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - AllBookTickersStreamRequest allBookTickersStreamRequest = new AllBookTickersStreamRequest(); // AllBookTickersStreamRequest | - try { - AllBookTickersStreamResponse result = apiInstance.allBookTickersStream(allBookTickersStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#allBookTickersStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **allBookTickersStreamRequest** | [**AllBookTickersStreamRequest**](AllBookTickersStreamRequest.md)| | | - -### Return type - -[**AllBookTickersStreamResponse**](AllBookTickersStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | All Book Tickers Stream | - | - - -# **allMarketLiquidationOrderStreams** -> AllMarketLiquidationOrderStreamsResponse allMarketLiquidationOrderStreams(allMarketLiquidationOrderStreamsRequest) - -All Market Liquidation Order Streams - -The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - AllMarketLiquidationOrderStreamsRequest allMarketLiquidationOrderStreamsRequest = new AllMarketLiquidationOrderStreamsRequest(); // AllMarketLiquidationOrderStreamsRequest | - try { - AllMarketLiquidationOrderStreamsResponse result = apiInstance.allMarketLiquidationOrderStreams(allMarketLiquidationOrderStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#allMarketLiquidationOrderStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **allMarketLiquidationOrderStreamsRequest** | [**AllMarketLiquidationOrderStreamsRequest**](AllMarketLiquidationOrderStreamsRequest.md)| | | - -### Return type - -[**AllMarketLiquidationOrderStreamsResponse**](AllMarketLiquidationOrderStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | All Market Liquidation Order Streams | - | - - -# **allMarketMiniTickersStream** -> AllMarketMiniTickersStreamResponse allMarketMiniTickersStream(allMarketMiniTickersStreamRequest) - -All Market Mini Tickers Stream - -24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - AllMarketMiniTickersStreamRequest allMarketMiniTickersStreamRequest = new AllMarketMiniTickersStreamRequest(); // AllMarketMiniTickersStreamRequest | - try { - AllMarketMiniTickersStreamResponse result = apiInstance.allMarketMiniTickersStream(allMarketMiniTickersStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#allMarketMiniTickersStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **allMarketMiniTickersStreamRequest** | [**AllMarketMiniTickersStreamRequest**](AllMarketMiniTickersStreamRequest.md)| | | - -### Return type - -[**AllMarketMiniTickersStreamResponse**](AllMarketMiniTickersStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | All Market Mini Tickers Stream | - | - - -# **allMarketTickersStreams** -> AllMarketTickersStreamsResponse allMarketTickersStreams(allMarketTickersStreamsRequest) - -All Market Tickers Streams - -24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - AllMarketTickersStreamsRequest allMarketTickersStreamsRequest = new AllMarketTickersStreamsRequest(); // AllMarketTickersStreamsRequest | - try { - AllMarketTickersStreamsResponse result = apiInstance.allMarketTickersStreams(allMarketTickersStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#allMarketTickersStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **allMarketTickersStreamsRequest** | [**AllMarketTickersStreamsRequest**](AllMarketTickersStreamsRequest.md)| | | - -### Return type - -[**AllMarketTickersStreamsResponse**](AllMarketTickersStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | All Market Tickers Streams | - | - - -# **compositeIndexSymbolInformationStreams** -> CompositeIndexSymbolInformationStreamsResponse compositeIndexSymbolInformationStreams(compositeIndexSymbolInformationStreamsRequest) - -Composite Index Symbol Information Streams - -Composite index information for index symbols pushed every second. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - CompositeIndexSymbolInformationStreamsRequest compositeIndexSymbolInformationStreamsRequest = new CompositeIndexSymbolInformationStreamsRequest(); // CompositeIndexSymbolInformationStreamsRequest | - try { - CompositeIndexSymbolInformationStreamsResponse result = apiInstance.compositeIndexSymbolInformationStreams(compositeIndexSymbolInformationStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#compositeIndexSymbolInformationStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **compositeIndexSymbolInformationStreamsRequest** | [**CompositeIndexSymbolInformationStreamsRequest**](CompositeIndexSymbolInformationStreamsRequest.md)| | | - -### Return type - -[**CompositeIndexSymbolInformationStreamsResponse**](CompositeIndexSymbolInformationStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Composite Index Symbol Information Streams | - | - - -# **continuousContractKlineCandlestickStreams** -> ContinuousContractKlineCandlestickStreamsResponse continuousContractKlineCandlestickStreams(continuousContractKlineCandlestickStreamsRequest) - -Continuous Contract Kline/Candlestick Streams - - Update Speed: 250ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - ContinuousContractKlineCandlestickStreamsRequest continuousContractKlineCandlestickStreamsRequest = new ContinuousContractKlineCandlestickStreamsRequest(); // ContinuousContractKlineCandlestickStreamsRequest | - try { - ContinuousContractKlineCandlestickStreamsResponse result = apiInstance.continuousContractKlineCandlestickStreams(continuousContractKlineCandlestickStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#continuousContractKlineCandlestickStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **continuousContractKlineCandlestickStreamsRequest** | [**ContinuousContractKlineCandlestickStreamsRequest**](ContinuousContractKlineCandlestickStreamsRequest.md)| | | - -### Return type - -[**ContinuousContractKlineCandlestickStreamsResponse**](ContinuousContractKlineCandlestickStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Continuous Contract Kline/Candlestick Streams | - | - - -# **contractInfoStream** -> ContractInfoStreamResponse contractInfoStream(contractInfoStreamRequest) - -Contract Info Stream - -ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket update). `bks` field only shows up when bracket gets updated. Update Speed: Real-time - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - ContractInfoStreamRequest contractInfoStreamRequest = new ContractInfoStreamRequest(); // ContractInfoStreamRequest | - try { - ContractInfoStreamResponse result = apiInstance.contractInfoStream(contractInfoStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#contractInfoStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **contractInfoStreamRequest** | [**ContractInfoStreamRequest**](ContractInfoStreamRequest.md)| | | - -### Return type - -[**ContractInfoStreamResponse**](ContractInfoStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Contract Info Stream | - | - - -# **diffBookDepthStreams** -> DiffBookDepthStreamsResponse diffBookDepthStreams(diffBookDepthStreamsRequest) - -Diff. Book Depth Streams - -Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if existing) Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: 250ms, 500ms, 100ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = new DiffBookDepthStreamsRequest(); // DiffBookDepthStreamsRequest | - try { - DiffBookDepthStreamsResponse result = apiInstance.diffBookDepthStreams(diffBookDepthStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#diffBookDepthStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **diffBookDepthStreamsRequest** | [**DiffBookDepthStreamsRequest**](DiffBookDepthStreamsRequest.md)| | | - -### Return type - -[**DiffBookDepthStreamsResponse**](DiffBookDepthStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Diff. Book Depth Streams | - | - - -# **individualSymbolBookTickerStreams** -> IndividualSymbolBookTickerStreamsResponse individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest) - -Individual Symbol Book Ticker Streams - -Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: Real-time - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = new IndividualSymbolBookTickerStreamsRequest(); // IndividualSymbolBookTickerStreamsRequest | - try { - IndividualSymbolBookTickerStreamsResponse result = apiInstance.individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#individualSymbolBookTickerStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **individualSymbolBookTickerStreamsRequest** | [**IndividualSymbolBookTickerStreamsRequest**](IndividualSymbolBookTickerStreamsRequest.md)| | | - -### Return type - -[**IndividualSymbolBookTickerStreamsResponse**](IndividualSymbolBookTickerStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Individual Symbol Book Ticker Streams | - | - - -# **individualSymbolMiniTickerStream** -> IndividualSymbolMiniTickerStreamResponse individualSymbolMiniTickerStream(individualSymbolMiniTickerStreamRequest) - -Individual Symbol Mini Ticker Stream - -24hr rolling window mini-ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Update Speed: 2s - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - IndividualSymbolMiniTickerStreamRequest individualSymbolMiniTickerStreamRequest = new IndividualSymbolMiniTickerStreamRequest(); // IndividualSymbolMiniTickerStreamRequest | - try { - IndividualSymbolMiniTickerStreamResponse result = apiInstance.individualSymbolMiniTickerStream(individualSymbolMiniTickerStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#individualSymbolMiniTickerStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **individualSymbolMiniTickerStreamRequest** | [**IndividualSymbolMiniTickerStreamRequest**](IndividualSymbolMiniTickerStreamRequest.md)| | | - -### Return type - -[**IndividualSymbolMiniTickerStreamResponse**](IndividualSymbolMiniTickerStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Individual Symbol Mini Ticker Stream | - | - - -# **individualSymbolTickerStreams** -> IndividualSymbolTickerStreamsResponse individualSymbolTickerStreams(individualSymbolTickerStreamsRequest) - -Individual Symbol Ticker Streams - -24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Update Speed: 2000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - IndividualSymbolTickerStreamsRequest individualSymbolTickerStreamsRequest = new IndividualSymbolTickerStreamsRequest(); // IndividualSymbolTickerStreamsRequest | - try { - IndividualSymbolTickerStreamsResponse result = apiInstance.individualSymbolTickerStreams(individualSymbolTickerStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#individualSymbolTickerStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **individualSymbolTickerStreamsRequest** | [**IndividualSymbolTickerStreamsRequest**](IndividualSymbolTickerStreamsRequest.md)| | | - -### Return type - -[**IndividualSymbolTickerStreamsResponse**](IndividualSymbolTickerStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Individual Symbol Ticker Streams | - | - - -# **klineCandlestickStreams** -> KlineCandlestickStreamsResponse klineCandlestickStreams(klineCandlestickStreamsRequest) - -Kline/Candlestick Streams - -The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing). Update Speed: 250ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest = new KlineCandlestickStreamsRequest(); // KlineCandlestickStreamsRequest | - try { - KlineCandlestickStreamsResponse result = apiInstance.klineCandlestickStreams(klineCandlestickStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#klineCandlestickStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **klineCandlestickStreamsRequest** | [**KlineCandlestickStreamsRequest**](KlineCandlestickStreamsRequest.md)| | | - -### Return type - -[**KlineCandlestickStreamsResponse**](KlineCandlestickStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Kline/Candlestick Streams | - | - - -# **liquidationOrderStreams** -> LiquidationOrderStreamsResponse liquidationOrderStreams(liquidationOrderStreamsRequest) - -Liquidation Order Streams - -The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - LiquidationOrderStreamsRequest liquidationOrderStreamsRequest = new LiquidationOrderStreamsRequest(); // LiquidationOrderStreamsRequest | - try { - LiquidationOrderStreamsResponse result = apiInstance.liquidationOrderStreams(liquidationOrderStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#liquidationOrderStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **liquidationOrderStreamsRequest** | [**LiquidationOrderStreamsRequest**](LiquidationOrderStreamsRequest.md)| | | - -### Return type - -[**LiquidationOrderStreamsResponse**](LiquidationOrderStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Liquidation Order Streams | - | - - -# **markPriceStream** -> MarkPriceStreamResponse markPriceStream(markPriceStreamRequest) - -Mark Price Stream - -Mark price and funding rate for a single symbol pushed every 3 seconds or every second. Update Speed: 3000ms or 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - MarkPriceStreamRequest markPriceStreamRequest = new MarkPriceStreamRequest(); // MarkPriceStreamRequest | - try { - MarkPriceStreamResponse result = apiInstance.markPriceStream(markPriceStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#markPriceStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **markPriceStreamRequest** | [**MarkPriceStreamRequest**](MarkPriceStreamRequest.md)| | | - -### Return type - -[**MarkPriceStreamResponse**](MarkPriceStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Mark Price Stream | - | - - -# **markPriceStreamForAllMarket** -> MarkPriceStreamForAllMarketResponse markPriceStreamForAllMarket(markPriceStreamForAllMarketRequest) - -Mark Price Stream for All market - -Mark price and funding rate for all symbols pushed every 3 seconds or every second. **Note**: TradFi symbols will be pushed through a seperate message. Update Speed: 3000ms or 1000ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - MarkPriceStreamForAllMarketRequest markPriceStreamForAllMarketRequest = new MarkPriceStreamForAllMarketRequest(); // MarkPriceStreamForAllMarketRequest | - try { - MarkPriceStreamForAllMarketResponse result = apiInstance.markPriceStreamForAllMarket(markPriceStreamForAllMarketRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#markPriceStreamForAllMarket"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **markPriceStreamForAllMarketRequest** | [**MarkPriceStreamForAllMarketRequest**](MarkPriceStreamForAllMarketRequest.md)| | | - -### Return type - -[**MarkPriceStreamForAllMarketResponse**](MarkPriceStreamForAllMarketResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Mark Price Stream for All market | - | - - -# **multiAssetsModeAssetIndex** -> MultiAssetsModeAssetIndexResponse multiAssetsModeAssetIndex(multiAssetsModeAssetIndexRequest) - -Multi-Assets Mode Asset Index - -Asset index for multi-assets mode user Update Speed: 1s - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - MultiAssetsModeAssetIndexRequest multiAssetsModeAssetIndexRequest = new MultiAssetsModeAssetIndexRequest(); // MultiAssetsModeAssetIndexRequest | - try { - MultiAssetsModeAssetIndexResponse result = apiInstance.multiAssetsModeAssetIndex(multiAssetsModeAssetIndexRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#multiAssetsModeAssetIndex"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **multiAssetsModeAssetIndexRequest** | [**MultiAssetsModeAssetIndexRequest**](MultiAssetsModeAssetIndexRequest.md)| | | - -### Return type - -[**MultiAssetsModeAssetIndexResponse**](MultiAssetsModeAssetIndexResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Multi-Assets Mode Asset Index | - | - - -# **partialBookDepthStreams** -> PartialBookDepthStreamsResponse partialBookDepthStreams(partialBookDepthStreamsRequest) - -Partial Book Depth Streams - -Top **<levels\\>** bids and asks, Valid **<levels\\>** are 5, 10, or 20. Retail Price Improvement(RPI) orders are not visible and excluded in the response message. Update Speed: 250ms, 500ms or 100ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = new PartialBookDepthStreamsRequest(); // PartialBookDepthStreamsRequest | - try { - PartialBookDepthStreamsResponse result = apiInstance.partialBookDepthStreams(partialBookDepthStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#partialBookDepthStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **partialBookDepthStreamsRequest** | [**PartialBookDepthStreamsRequest**](PartialBookDepthStreamsRequest.md)| | | - -### Return type - -[**PartialBookDepthStreamsResponse**](PartialBookDepthStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Partial Book Depth Streams | - | - - -# **rpiDiffBookDepthStreams** -> RpiDiffBookDepthStreamsResponse rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest) - -RPI Diff. Book Depth Streams - -Bids and asks including RPI orders, pushed every 500 milliseconds RPI(Retail Price Improvement) orders are included and aggreated in the response message. When the quantity of a price level to be updated is equal to 0, it means either all quotations for this price have been filled/canceled, or the quantity of crossed RPI orders for this price are hidden Update Speed: 500ms - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest = new RpiDiffBookDepthStreamsRequest(); // RpiDiffBookDepthStreamsRequest | - try { - RpiDiffBookDepthStreamsResponse result = apiInstance.rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#rpiDiffBookDepthStreams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **rpiDiffBookDepthStreamsRequest** | [**RpiDiffBookDepthStreamsRequest**](RpiDiffBookDepthStreamsRequest.md)| | | - -### Return type - -[**RpiDiffBookDepthStreamsResponse**](RpiDiffBookDepthStreamsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | RPI Diff. Book Depth Streams | - | - - -# **tradingSessionStream** -> TradingSessionStreamResponse tradingSessionStream(tradingSessionStreamRequest) - -Trading Session Stream - -Trading session information for the underlying assets of TradFi Perpetual contracts—covering the U.S. equity market and the commodity market—is updated every second. Trading session information for different underlying markets is pushed in separate messages. Session types for the equity market include \"PRE_MARKET\", \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\", and \"NO_TRADING\". Session types for the commodity market include \"REGULAR\" and \"NO_TRADING\". Update Speed: 1s - -### Example -```java -// Import classes: -import com.binance.connector.client.derivatives_trading_usds_futures.ApiClient; -import com.binance.connector.client.derivatives_trading_usds_futures.ApiException; -import com.binance.connector.client.derivatives_trading_usds_futures.Configuration; -import com.binance.connector.client.derivatives_trading_usds_futures.models.*; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.WebsocketMarketStreamsApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://localhost"); - - WebsocketMarketStreamsApi apiInstance = new WebsocketMarketStreamsApi(defaultClient); - TradingSessionStreamRequest tradingSessionStreamRequest = new TradingSessionStreamRequest(); // TradingSessionStreamRequest | - try { - TradingSessionStreamResponse result = apiInstance.tradingSessionStream(tradingSessionStreamRequest); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling WebsocketMarketStreamsApi#tradingSessionStream"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} -``` - -### Parameters - -| Name | Type | Description | Notes | -|------------- | ------------- | ------------- | -------------| -| **tradingSessionStreamRequest** | [**TradingSessionStreamRequest**](TradingSessionStreamRequest.md)| | | - -### Return type - -[**TradingSessionStreamResponse**](TradingSessionStreamResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -| **200** | Trading Session Stream | - | - diff --git a/clients/derivatives-trading-usds-futures/pom.xml b/clients/derivatives-trading-usds-futures/pom.xml index 87d8d08d6..560a91e2c 100644 --- a/clients/derivatives-trading-usds-futures/pom.xml +++ b/clients/derivatives-trading-usds-futures/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-derivatives-trading-usds-futures derivatives-trading-usds-futures - 10.0.0 + 10.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.4.1 + 2.4.2 \ No newline at end of file diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponseResult.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponseResult.java deleted file mode 100644 index fb1226bbb..000000000 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/rest/model/QueryOrderResponseResult.java +++ /dev/null @@ -1,1070 +0,0 @@ -/* - * Binance Derivatives Trading USDS Futures REST API - * OpenAPI Specification for the Binance Derivatives Trading USDS Futures REST API - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.rest.model; - -import com.binance.connector.client.derivatives_trading_usds_futures.rest.JSON; -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.TypeAdapter; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import jakarta.validation.constraints.*; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashSet; -import java.util.Objects; -import org.hibernate.validator.constraints.*; - -/** QueryOrderResponseResult */ -@jakarta.annotation.Generated( - value = "org.openapitools.codegen.languages.JavaClientCodegen", - comments = "Generator version: 7.12.0") -public class QueryOrderResponseResult { - public static final String SERIALIZED_NAME_AVG_PRICE = "avgPrice"; - - @SerializedName(SERIALIZED_NAME_AVG_PRICE) - @jakarta.annotation.Nullable - private String avgPrice; - - public static final String SERIALIZED_NAME_CLIENT_ORDER_ID = "clientOrderId"; - - @SerializedName(SERIALIZED_NAME_CLIENT_ORDER_ID) - @jakarta.annotation.Nullable - private String clientOrderId; - - public static final String SERIALIZED_NAME_CUM_QUOTE = "cumQuote"; - - @SerializedName(SERIALIZED_NAME_CUM_QUOTE) - @jakarta.annotation.Nullable - private String cumQuote; - - public static final String SERIALIZED_NAME_EXECUTED_QTY = "executedQty"; - - @SerializedName(SERIALIZED_NAME_EXECUTED_QTY) - @jakarta.annotation.Nullable - private String executedQty; - - public static final String SERIALIZED_NAME_ORDER_ID = "orderId"; - - @SerializedName(SERIALIZED_NAME_ORDER_ID) - @jakarta.annotation.Nullable - private Long orderId; - - public static final String SERIALIZED_NAME_ORIG_QTY = "origQty"; - - @SerializedName(SERIALIZED_NAME_ORIG_QTY) - @jakarta.annotation.Nullable - private String origQty; - - public static final String SERIALIZED_NAME_ORIG_TYPE = "origType"; - - @SerializedName(SERIALIZED_NAME_ORIG_TYPE) - @jakarta.annotation.Nullable - private String origType; - - public static final String SERIALIZED_NAME_PRICE = "price"; - - @SerializedName(SERIALIZED_NAME_PRICE) - @jakarta.annotation.Nullable - private String price; - - public static final String SERIALIZED_NAME_REDUCE_ONLY = "reduceOnly"; - - @SerializedName(SERIALIZED_NAME_REDUCE_ONLY) - @jakarta.annotation.Nullable - private Boolean reduceOnly; - - public static final String SERIALIZED_NAME_SIDE = "side"; - - @SerializedName(SERIALIZED_NAME_SIDE) - @jakarta.annotation.Nullable - private String side; - - public static final String SERIALIZED_NAME_POSITION_SIDE = "positionSide"; - - @SerializedName(SERIALIZED_NAME_POSITION_SIDE) - @jakarta.annotation.Nullable - private String positionSide; - - public static final String SERIALIZED_NAME_STATUS = "status"; - - @SerializedName(SERIALIZED_NAME_STATUS) - @jakarta.annotation.Nullable - private String status; - - public static final String SERIALIZED_NAME_STOP_PRICE = "stopPrice"; - - @SerializedName(SERIALIZED_NAME_STOP_PRICE) - @jakarta.annotation.Nullable - private String stopPrice; - - public static final String SERIALIZED_NAME_CLOSE_POSITION = "closePosition"; - - @SerializedName(SERIALIZED_NAME_CLOSE_POSITION) - @jakarta.annotation.Nullable - private Boolean closePosition; - - public static final String SERIALIZED_NAME_SYMBOL = "symbol"; - - @SerializedName(SERIALIZED_NAME_SYMBOL) - @jakarta.annotation.Nullable - private String symbol; - - public static final String SERIALIZED_NAME_TIME = "time"; - - @SerializedName(SERIALIZED_NAME_TIME) - @jakarta.annotation.Nullable - private Long time; - - public static final String SERIALIZED_NAME_TIME_IN_FORCE = "timeInForce"; - - @SerializedName(SERIALIZED_NAME_TIME_IN_FORCE) - @jakarta.annotation.Nullable - private String timeInForce; - - public static final String SERIALIZED_NAME_TYPE = "type"; - - @SerializedName(SERIALIZED_NAME_TYPE) - @jakarta.annotation.Nullable - private String type; - - public static final String SERIALIZED_NAME_ACTIVATE_PRICE = "activatePrice"; - - @SerializedName(SERIALIZED_NAME_ACTIVATE_PRICE) - @jakarta.annotation.Nullable - private String activatePrice; - - public static final String SERIALIZED_NAME_PRICE_RATE = "priceRate"; - - @SerializedName(SERIALIZED_NAME_PRICE_RATE) - @jakarta.annotation.Nullable - private String priceRate; - - public static final String SERIALIZED_NAME_UPDATE_TIME = "updateTime"; - - @SerializedName(SERIALIZED_NAME_UPDATE_TIME) - @jakarta.annotation.Nullable - private Long updateTime; - - public static final String SERIALIZED_NAME_WORKING_TYPE = "workingType"; - - @SerializedName(SERIALIZED_NAME_WORKING_TYPE) - @jakarta.annotation.Nullable - private String workingType; - - public static final String SERIALIZED_NAME_PRICE_PROTECT = "priceProtect"; - - @SerializedName(SERIALIZED_NAME_PRICE_PROTECT) - @jakarta.annotation.Nullable - private Boolean priceProtect; - - public QueryOrderResponseResult() {} - - public QueryOrderResponseResult avgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - return this; - } - - /** - * Get avgPrice - * - * @return avgPrice - */ - @jakarta.annotation.Nullable - public String getAvgPrice() { - return avgPrice; - } - - public void setAvgPrice(@jakarta.annotation.Nullable String avgPrice) { - this.avgPrice = avgPrice; - } - - public QueryOrderResponseResult clientOrderId( - @jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - return this; - } - - /** - * Get clientOrderId - * - * @return clientOrderId - */ - @jakarta.annotation.Nullable - public String getClientOrderId() { - return clientOrderId; - } - - public void setClientOrderId(@jakarta.annotation.Nullable String clientOrderId) { - this.clientOrderId = clientOrderId; - } - - public QueryOrderResponseResult cumQuote(@jakarta.annotation.Nullable String cumQuote) { - this.cumQuote = cumQuote; - return this; - } - - /** - * Get cumQuote - * - * @return cumQuote - */ - @jakarta.annotation.Nullable - public String getCumQuote() { - return cumQuote; - } - - public void setCumQuote(@jakarta.annotation.Nullable String cumQuote) { - this.cumQuote = cumQuote; - } - - public QueryOrderResponseResult executedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - return this; - } - - /** - * Get executedQty - * - * @return executedQty - */ - @jakarta.annotation.Nullable - public String getExecutedQty() { - return executedQty; - } - - public void setExecutedQty(@jakarta.annotation.Nullable String executedQty) { - this.executedQty = executedQty; - } - - public QueryOrderResponseResult orderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - return this; - } - - /** - * Get orderId - * - * @return orderId - */ - @jakarta.annotation.Nullable - public Long getOrderId() { - return orderId; - } - - public void setOrderId(@jakarta.annotation.Nullable Long orderId) { - this.orderId = orderId; - } - - public QueryOrderResponseResult origQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - return this; - } - - /** - * Get origQty - * - * @return origQty - */ - @jakarta.annotation.Nullable - public String getOrigQty() { - return origQty; - } - - public void setOrigQty(@jakarta.annotation.Nullable String origQty) { - this.origQty = origQty; - } - - public QueryOrderResponseResult origType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; - return this; - } - - /** - * Get origType - * - * @return origType - */ - @jakarta.annotation.Nullable - public String getOrigType() { - return origType; - } - - public void setOrigType(@jakarta.annotation.Nullable String origType) { - this.origType = origType; - } - - public QueryOrderResponseResult price(@jakarta.annotation.Nullable String price) { - this.price = price; - return this; - } - - /** - * Get price - * - * @return price - */ - @jakarta.annotation.Nullable - public String getPrice() { - return price; - } - - public void setPrice(@jakarta.annotation.Nullable String price) { - this.price = price; - } - - public QueryOrderResponseResult reduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; - return this; - } - - /** - * Get reduceOnly - * - * @return reduceOnly - */ - @jakarta.annotation.Nullable - public Boolean getReduceOnly() { - return reduceOnly; - } - - public void setReduceOnly(@jakarta.annotation.Nullable Boolean reduceOnly) { - this.reduceOnly = reduceOnly; - } - - public QueryOrderResponseResult side(@jakarta.annotation.Nullable String side) { - this.side = side; - return this; - } - - /** - * Get side - * - * @return side - */ - @jakarta.annotation.Nullable - public String getSide() { - return side; - } - - public void setSide(@jakarta.annotation.Nullable String side) { - this.side = side; - } - - public QueryOrderResponseResult positionSide(@jakarta.annotation.Nullable String positionSide) { - this.positionSide = positionSide; - return this; - } - - /** - * Get positionSide - * - * @return positionSide - */ - @jakarta.annotation.Nullable - public String getPositionSide() { - return positionSide; - } - - public void setPositionSide(@jakarta.annotation.Nullable String positionSide) { - this.positionSide = positionSide; - } - - public QueryOrderResponseResult status(@jakarta.annotation.Nullable String status) { - this.status = status; - return this; - } - - /** - * Get status - * - * @return status - */ - @jakarta.annotation.Nullable - public String getStatus() { - return status; - } - - public void setStatus(@jakarta.annotation.Nullable String status) { - this.status = status; - } - - public QueryOrderResponseResult stopPrice(@jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; - return this; - } - - /** - * Get stopPrice - * - * @return stopPrice - */ - @jakarta.annotation.Nullable - public String getStopPrice() { - return stopPrice; - } - - public void setStopPrice(@jakarta.annotation.Nullable String stopPrice) { - this.stopPrice = stopPrice; - } - - public QueryOrderResponseResult closePosition( - @jakarta.annotation.Nullable Boolean closePosition) { - this.closePosition = closePosition; - return this; - } - - /** - * Get closePosition - * - * @return closePosition - */ - @jakarta.annotation.Nullable - public Boolean getClosePosition() { - return closePosition; - } - - public void setClosePosition(@jakarta.annotation.Nullable Boolean closePosition) { - this.closePosition = closePosition; - } - - public QueryOrderResponseResult symbol(@jakarta.annotation.Nullable String symbol) { - this.symbol = symbol; - return this; - } - - /** - * Get symbol - * - * @return symbol - */ - @jakarta.annotation.Nullable - public String getSymbol() { - return symbol; - } - - public void setSymbol(@jakarta.annotation.Nullable String symbol) { - this.symbol = symbol; - } - - public QueryOrderResponseResult time(@jakarta.annotation.Nullable Long time) { - this.time = time; - return this; - } - - /** - * Get time - * - * @return time - */ - @jakarta.annotation.Nullable - public Long getTime() { - return time; - } - - public void setTime(@jakarta.annotation.Nullable Long time) { - this.time = time; - } - - public QueryOrderResponseResult timeInForce(@jakarta.annotation.Nullable String timeInForce) { - this.timeInForce = timeInForce; - return this; - } - - /** - * Get timeInForce - * - * @return timeInForce - */ - @jakarta.annotation.Nullable - public String getTimeInForce() { - return timeInForce; - } - - public void setTimeInForce(@jakarta.annotation.Nullable String timeInForce) { - this.timeInForce = timeInForce; - } - - public QueryOrderResponseResult type(@jakarta.annotation.Nullable String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type - */ - @jakarta.annotation.Nullable - public String getType() { - return type; - } - - public void setType(@jakarta.annotation.Nullable String type) { - this.type = type; - } - - public QueryOrderResponseResult activatePrice( - @jakarta.annotation.Nullable String activatePrice) { - this.activatePrice = activatePrice; - return this; - } - - /** - * Get activatePrice - * - * @return activatePrice - */ - @jakarta.annotation.Nullable - public String getActivatePrice() { - return activatePrice; - } - - public void setActivatePrice(@jakarta.annotation.Nullable String activatePrice) { - this.activatePrice = activatePrice; - } - - public QueryOrderResponseResult priceRate(@jakarta.annotation.Nullable String priceRate) { - this.priceRate = priceRate; - return this; - } - - /** - * Get priceRate - * - * @return priceRate - */ - @jakarta.annotation.Nullable - public String getPriceRate() { - return priceRate; - } - - public void setPriceRate(@jakarta.annotation.Nullable String priceRate) { - this.priceRate = priceRate; - } - - public QueryOrderResponseResult updateTime(@jakarta.annotation.Nullable Long updateTime) { - this.updateTime = updateTime; - return this; - } - - /** - * Get updateTime - * - * @return updateTime - */ - @jakarta.annotation.Nullable - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(@jakarta.annotation.Nullable Long updateTime) { - this.updateTime = updateTime; - } - - public QueryOrderResponseResult workingType(@jakarta.annotation.Nullable String workingType) { - this.workingType = workingType; - return this; - } - - /** - * Get workingType - * - * @return workingType - */ - @jakarta.annotation.Nullable - public String getWorkingType() { - return workingType; - } - - public void setWorkingType(@jakarta.annotation.Nullable String workingType) { - this.workingType = workingType; - } - - public QueryOrderResponseResult priceProtect( - @jakarta.annotation.Nullable Boolean priceProtect) { - this.priceProtect = priceProtect; - return this; - } - - /** - * Get priceProtect - * - * @return priceProtect - */ - @jakarta.annotation.Nullable - public Boolean getPriceProtect() { - return priceProtect; - } - - public void setPriceProtect(@jakarta.annotation.Nullable Boolean priceProtect) { - this.priceProtect = priceProtect; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QueryOrderResponseResult queryOrderResponseResult = (QueryOrderResponseResult) o; - return Objects.equals(this.avgPrice, queryOrderResponseResult.avgPrice) - && Objects.equals(this.clientOrderId, queryOrderResponseResult.clientOrderId) - && Objects.equals(this.cumQuote, queryOrderResponseResult.cumQuote) - && Objects.equals(this.executedQty, queryOrderResponseResult.executedQty) - && Objects.equals(this.orderId, queryOrderResponseResult.orderId) - && Objects.equals(this.origQty, queryOrderResponseResult.origQty) - && Objects.equals(this.origType, queryOrderResponseResult.origType) - && Objects.equals(this.price, queryOrderResponseResult.price) - && Objects.equals(this.reduceOnly, queryOrderResponseResult.reduceOnly) - && Objects.equals(this.side, queryOrderResponseResult.side) - && Objects.equals(this.positionSide, queryOrderResponseResult.positionSide) - && Objects.equals(this.status, queryOrderResponseResult.status) - && Objects.equals(this.stopPrice, queryOrderResponseResult.stopPrice) - && Objects.equals(this.closePosition, queryOrderResponseResult.closePosition) - && Objects.equals(this.symbol, queryOrderResponseResult.symbol) - && Objects.equals(this.time, queryOrderResponseResult.time) - && Objects.equals(this.timeInForce, queryOrderResponseResult.timeInForce) - && Objects.equals(this.type, queryOrderResponseResult.type) - && Objects.equals(this.activatePrice, queryOrderResponseResult.activatePrice) - && Objects.equals(this.priceRate, queryOrderResponseResult.priceRate) - && Objects.equals(this.updateTime, queryOrderResponseResult.updateTime) - && Objects.equals(this.workingType, queryOrderResponseResult.workingType) - && Objects.equals(this.priceProtect, queryOrderResponseResult.priceProtect); - } - - @Override - public int hashCode() { - return Objects.hash( - avgPrice, - clientOrderId, - cumQuote, - executedQty, - orderId, - origQty, - origType, - price, - reduceOnly, - side, - positionSide, - status, - stopPrice, - closePosition, - symbol, - time, - timeInForce, - type, - activatePrice, - priceRate, - updateTime, - workingType, - priceProtect); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QueryOrderResponseResult {\n"); - sb.append(" avgPrice: ").append(toIndentedString(avgPrice)).append("\n"); - sb.append(" clientOrderId: ").append(toIndentedString(clientOrderId)).append("\n"); - sb.append(" cumQuote: ").append(toIndentedString(cumQuote)).append("\n"); - sb.append(" executedQty: ").append(toIndentedString(executedQty)).append("\n"); - sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n"); - sb.append(" origQty: ").append(toIndentedString(origQty)).append("\n"); - sb.append(" origType: ").append(toIndentedString(origType)).append("\n"); - sb.append(" price: ").append(toIndentedString(price)).append("\n"); - sb.append(" reduceOnly: ").append(toIndentedString(reduceOnly)).append("\n"); - sb.append(" side: ").append(toIndentedString(side)).append("\n"); - sb.append(" positionSide: ").append(toIndentedString(positionSide)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" stopPrice: ").append(toIndentedString(stopPrice)).append("\n"); - sb.append(" closePosition: ").append(toIndentedString(closePosition)).append("\n"); - sb.append(" symbol: ").append(toIndentedString(symbol)).append("\n"); - sb.append(" time: ").append(toIndentedString(time)).append("\n"); - sb.append(" timeInForce: ").append(toIndentedString(timeInForce)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" activatePrice: ").append(toIndentedString(activatePrice)).append("\n"); - sb.append(" priceRate: ").append(toIndentedString(priceRate)).append("\n"); - sb.append(" updateTime: ").append(toIndentedString(updateTime)).append("\n"); - sb.append(" workingType: ").append(toIndentedString(workingType)).append("\n"); - sb.append(" priceProtect: ").append(toIndentedString(priceProtect)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - public String toUrlQueryString() { - StringBuilder sb = new StringBuilder(); - - Object avgPriceValue = getAvgPrice(); - String avgPriceValueAsString = ""; - avgPriceValueAsString = avgPriceValue.toString(); - sb.append("avgPrice=").append(urlEncode(avgPriceValueAsString)).append(""); - Object clientOrderIdValue = getClientOrderId(); - String clientOrderIdValueAsString = ""; - clientOrderIdValueAsString = clientOrderIdValue.toString(); - sb.append("clientOrderId=").append(urlEncode(clientOrderIdValueAsString)).append(""); - Object cumQuoteValue = getCumQuote(); - String cumQuoteValueAsString = ""; - cumQuoteValueAsString = cumQuoteValue.toString(); - sb.append("cumQuote=").append(urlEncode(cumQuoteValueAsString)).append(""); - Object executedQtyValue = getExecutedQty(); - String executedQtyValueAsString = ""; - executedQtyValueAsString = executedQtyValue.toString(); - sb.append("executedQty=").append(urlEncode(executedQtyValueAsString)).append(""); - Object orderIdValue = getOrderId(); - String orderIdValueAsString = ""; - orderIdValueAsString = orderIdValue.toString(); - sb.append("orderId=").append(urlEncode(orderIdValueAsString)).append(""); - Object origQtyValue = getOrigQty(); - String origQtyValueAsString = ""; - origQtyValueAsString = origQtyValue.toString(); - sb.append("origQty=").append(urlEncode(origQtyValueAsString)).append(""); - Object origTypeValue = getOrigType(); - String origTypeValueAsString = ""; - origTypeValueAsString = origTypeValue.toString(); - sb.append("origType=").append(urlEncode(origTypeValueAsString)).append(""); - Object priceValue = getPrice(); - String priceValueAsString = ""; - priceValueAsString = priceValue.toString(); - sb.append("price=").append(urlEncode(priceValueAsString)).append(""); - Object reduceOnlyValue = getReduceOnly(); - String reduceOnlyValueAsString = ""; - reduceOnlyValueAsString = reduceOnlyValue.toString(); - sb.append("reduceOnly=").append(urlEncode(reduceOnlyValueAsString)).append(""); - Object sideValue = getSide(); - String sideValueAsString = ""; - sideValueAsString = sideValue.toString(); - sb.append("side=").append(urlEncode(sideValueAsString)).append(""); - Object positionSideValue = getPositionSide(); - String positionSideValueAsString = ""; - positionSideValueAsString = positionSideValue.toString(); - sb.append("positionSide=").append(urlEncode(positionSideValueAsString)).append(""); - Object statusValue = getStatus(); - String statusValueAsString = ""; - statusValueAsString = statusValue.toString(); - sb.append("status=").append(urlEncode(statusValueAsString)).append(""); - Object stopPriceValue = getStopPrice(); - String stopPriceValueAsString = ""; - stopPriceValueAsString = stopPriceValue.toString(); - sb.append("stopPrice=").append(urlEncode(stopPriceValueAsString)).append(""); - Object closePositionValue = getClosePosition(); - String closePositionValueAsString = ""; - closePositionValueAsString = closePositionValue.toString(); - sb.append("closePosition=").append(urlEncode(closePositionValueAsString)).append(""); - Object symbolValue = getSymbol(); - String symbolValueAsString = ""; - symbolValueAsString = symbolValue.toString(); - sb.append("symbol=").append(urlEncode(symbolValueAsString)).append(""); - Object timeValue = getTime(); - String timeValueAsString = ""; - timeValueAsString = timeValue.toString(); - sb.append("time=").append(urlEncode(timeValueAsString)).append(""); - Object timeInForceValue = getTimeInForce(); - String timeInForceValueAsString = ""; - timeInForceValueAsString = timeInForceValue.toString(); - sb.append("timeInForce=").append(urlEncode(timeInForceValueAsString)).append(""); - Object typeValue = getType(); - String typeValueAsString = ""; - typeValueAsString = typeValue.toString(); - sb.append("type=").append(urlEncode(typeValueAsString)).append(""); - Object activatePriceValue = getActivatePrice(); - String activatePriceValueAsString = ""; - activatePriceValueAsString = activatePriceValue.toString(); - sb.append("activatePrice=").append(urlEncode(activatePriceValueAsString)).append(""); - Object priceRateValue = getPriceRate(); - String priceRateValueAsString = ""; - priceRateValueAsString = priceRateValue.toString(); - sb.append("priceRate=").append(urlEncode(priceRateValueAsString)).append(""); - Object updateTimeValue = getUpdateTime(); - String updateTimeValueAsString = ""; - updateTimeValueAsString = updateTimeValue.toString(); - sb.append("updateTime=").append(urlEncode(updateTimeValueAsString)).append(""); - Object workingTypeValue = getWorkingType(); - String workingTypeValueAsString = ""; - workingTypeValueAsString = workingTypeValue.toString(); - sb.append("workingType=").append(urlEncode(workingTypeValueAsString)).append(""); - Object priceProtectValue = getPriceProtect(); - String priceProtectValueAsString = ""; - priceProtectValueAsString = priceProtectValue.toString(); - sb.append("priceProtect=").append(urlEncode(priceProtectValueAsString)).append(""); - return sb.toString(); - } - - public static String urlEncode(String s) { - try { - return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(StandardCharsets.UTF_8.name() + " is unsupported", e); - } - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first - * line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("avgPrice"); - openapiFields.add("clientOrderId"); - openapiFields.add("cumQuote"); - openapiFields.add("executedQty"); - openapiFields.add("orderId"); - openapiFields.add("origQty"); - openapiFields.add("origType"); - openapiFields.add("price"); - openapiFields.add("reduceOnly"); - openapiFields.add("side"); - openapiFields.add("positionSide"); - openapiFields.add("status"); - openapiFields.add("stopPrice"); - openapiFields.add("closePosition"); - openapiFields.add("symbol"); - openapiFields.add("time"); - openapiFields.add("timeInForce"); - openapiFields.add("type"); - openapiFields.add("activatePrice"); - openapiFields.add("priceRate"); - openapiFields.add("updateTime"); - openapiFields.add("workingType"); - openapiFields.add("priceProtect"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Element and throws an exception if issues found - * - * @param jsonElement JSON Element - * @throws IOException if the JSON Element is invalid with respect to QueryOrderResponseResult - */ - public static void validateJsonElement(JsonElement jsonElement) throws IOException { - if (jsonElement == null) { - if (!QueryOrderResponseResult.openapiRequiredFields - .isEmpty()) { // has required fields but JSON element is null - throw new IllegalArgumentException( - String.format( - "The required field(s) %s in QueryOrderResponseResult is not found" - + " in the empty JSON string", - QueryOrderResponseResult.openapiRequiredFields.toString())); - } - } - JsonObject jsonObj = jsonElement.getAsJsonObject(); - if ((jsonObj.get("avgPrice") != null && !jsonObj.get("avgPrice").isJsonNull()) - && !jsonObj.get("avgPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `avgPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("avgPrice").toString())); - } - if ((jsonObj.get("clientOrderId") != null && !jsonObj.get("clientOrderId").isJsonNull()) - && !jsonObj.get("clientOrderId").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `clientOrderId` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("clientOrderId").toString())); - } - if ((jsonObj.get("cumQuote") != null && !jsonObj.get("cumQuote").isJsonNull()) - && !jsonObj.get("cumQuote").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `cumQuote` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("cumQuote").toString())); - } - if ((jsonObj.get("executedQty") != null && !jsonObj.get("executedQty").isJsonNull()) - && !jsonObj.get("executedQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `executedQty` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("executedQty").toString())); - } - if ((jsonObj.get("origQty") != null && !jsonObj.get("origQty").isJsonNull()) - && !jsonObj.get("origQty").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origQty` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("origQty").toString())); - } - if ((jsonObj.get("origType") != null && !jsonObj.get("origType").isJsonNull()) - && !jsonObj.get("origType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `origType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("origType").toString())); - } - if ((jsonObj.get("price") != null && !jsonObj.get("price").isJsonNull()) - && !jsonObj.get("price").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `price` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("price").toString())); - } - if ((jsonObj.get("side") != null && !jsonObj.get("side").isJsonNull()) - && !jsonObj.get("side").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `side` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("side").toString())); - } - if ((jsonObj.get("positionSide") != null && !jsonObj.get("positionSide").isJsonNull()) - && !jsonObj.get("positionSide").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `positionSide` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("positionSide").toString())); - } - if ((jsonObj.get("status") != null && !jsonObj.get("status").isJsonNull()) - && !jsonObj.get("status").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `status` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("status").toString())); - } - if ((jsonObj.get("stopPrice") != null && !jsonObj.get("stopPrice").isJsonNull()) - && !jsonObj.get("stopPrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `stopPrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("stopPrice").toString())); - } - if ((jsonObj.get("symbol") != null && !jsonObj.get("symbol").isJsonNull()) - && !jsonObj.get("symbol").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `symbol` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("symbol").toString())); - } - if ((jsonObj.get("timeInForce") != null && !jsonObj.get("timeInForce").isJsonNull()) - && !jsonObj.get("timeInForce").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `timeInForce` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("timeInForce").toString())); - } - if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) - && !jsonObj.get("type").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `type` to be a primitive type in the JSON string" - + " but got `%s`", - jsonObj.get("type").toString())); - } - if ((jsonObj.get("activatePrice") != null && !jsonObj.get("activatePrice").isJsonNull()) - && !jsonObj.get("activatePrice").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `activatePrice` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("activatePrice").toString())); - } - if ((jsonObj.get("priceRate") != null && !jsonObj.get("priceRate").isJsonNull()) - && !jsonObj.get("priceRate").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `priceRate` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("priceRate").toString())); - } - if ((jsonObj.get("workingType") != null && !jsonObj.get("workingType").isJsonNull()) - && !jsonObj.get("workingType").isJsonPrimitive()) { - throw new IllegalArgumentException( - String.format( - "Expected the field `workingType` to be a primitive type in the JSON" - + " string but got `%s`", - jsonObj.get("workingType").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!QueryOrderResponseResult.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'QueryOrderResponseResult' and its - // subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter = - gson.getDelegateAdapter(this, TypeToken.get(QueryOrderResponseResult.class)); - - return (TypeAdapter) - new TypeAdapter() { - @Override - public void write(JsonWriter out, QueryOrderResponseResult value) - throws IOException { - JsonElement obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public QueryOrderResponseResult read(JsonReader in) throws IOException { - JsonElement jsonElement = elementAdapter.read(in); - // validateJsonElement(jsonElement); - return thisAdapter.fromJsonTree(jsonElement); - } - }.nullSafe(); - } - } - - /** - * Create an instance of QueryOrderResponseResult given an JSON string - * - * @param jsonString JSON string - * @return An instance of QueryOrderResponseResult - * @throws IOException if the JSON string is invalid with respect to QueryOrderResponseResult - */ - public static QueryOrderResponseResult fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, QueryOrderResponseResult.class); - } - - /** - * Convert an instance of QueryOrderResponseResult to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java b/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java deleted file mode 100644 index 60e2e879f..000000000 --- a/clients/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApi.java +++ /dev/null @@ -1,1891 +0,0 @@ -/* - * Binance Derivatives Trading USDS Futures WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.SystemUtil; -import com.binance.connector.client.common.exception.ConstraintViolationException; -import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionInterface; -import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionPoolWrapper; -import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueue; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.JSON; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketLiquidationOrderStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketLiquidationOrderStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketMiniTickersStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketMiniTickersStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketTickersStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketTickersStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.CompositeIndexSymbolInformationStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.CompositeIndexSymbolInformationStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContinuousContractKlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContinuousContractKlineCandlestickStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContractInfoStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContractInfoStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.DiffBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.DiffBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolMiniTickerStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolMiniTickerStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolTickerStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolTickerStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.KlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.KlineCandlestickStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.LiquidationOrderStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.LiquidationOrderStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamForAllMarketRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamForAllMarketResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamResponse; -import com.google.gson.reflect.TypeToken; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Validation; -import jakarta.validation.Validator; -import jakarta.validation.constraints.*; -import java.util.Collections; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator; - -public class WebsocketMarketStreamsApi { - private static final String USER_AGENT = - String.format( - "binance-derivatives-trading-usds-futures/9.0.0 (Java/%s; %s; %s)", - SystemUtil.getJavaVersion(), SystemUtil.getOs(), SystemUtil.getArch()); - - private StreamConnectionInterface connection; - - public WebsocketMarketStreamsApi() {} - - public WebsocketMarketStreamsApi(WebSocketClientConfiguration configuration) { - this( - configuration.getUsePool() - ? new StreamConnectionPoolWrapper(configuration, JSON.getGson()) - : new StreamConnectionWrapper(configuration, JSON.getGson())); - } - - public WebsocketMarketStreamsApi(StreamConnectionInterface connection) { - connection.setUserAgent(USER_AGENT); - if (!connection.isConnected()) { - connection.connect(); - } - this.connection = connection; - } - - /** - * Aggregate Trade Streams The Aggregate Trade Streams push market trade information that is - * aggregated for fills with same price and taking side every 100 milliseconds. Only market - * trades will be aggregated, which means the insurance fund trades and ADL trades won't be - * aggregated. Retail Price Improvement(RPI) orders are aggregated into field `q` and - * without special tags to be distinguished. Update Speed: 100ms - * - * @param aggregateTradeStreamsRequest (required) - * @return AggregateTradeStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Aggregate Trade Streams -
- * - * @see Aggregate - * Trade Streams Documentation - */ - public StreamBlockingQueueWrapper aggregateTradeStreams( - AggregateTradeStreamsRequest aggregateTradeStreamsRequest) throws ApiException { - StreamBlockingQueue queue = aggregateTradeStreamsRaw(aggregateTradeStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue aggregateTradeStreamsRaw( - AggregateTradeStreamsRequest aggregateTradeStreamsRequest) throws ApiException { - aggregateTradeStreamsValidateBeforeCall(aggregateTradeStreamsRequest); - - String methodName = - "/@aggTrade" - .substring(1) - .replace( - "", - aggregateTradeStreamsRequest.getId() != null - ? aggregateTradeStreamsRequest.getId().toString() - : "") - .replace( - "", - aggregateTradeStreamsRequest.getSymbol() != null - ? aggregateTradeStreamsRequest.getSymbol().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void aggregateTradeStreamsValidateBeforeCall( - AggregateTradeStreamsRequest aggregateTradeStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(aggregateTradeStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * All Book Tickers Stream Pushes any update to the best bid or ask's price or quantity in - * real-time for all symbols. Retail Price Improvement(RPI) orders are not visible and excluded - * in the response message. Update Speed: 5s - * - * @param allBookTickersStreamRequest (required) - * @return AllBookTickersStreamResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 All Book Tickers Stream -
- * - * @see All - * Book Tickers Stream Documentation - */ - public StreamBlockingQueueWrapper allBookTickersStream( - AllBookTickersStreamRequest allBookTickersStreamRequest) throws ApiException { - StreamBlockingQueue queue = allBookTickersStreamRaw(allBookTickersStreamRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue allBookTickersStreamRaw( - AllBookTickersStreamRequest allBookTickersStreamRequest) throws ApiException { - allBookTickersStreamValidateBeforeCall(allBookTickersStreamRequest); - - String methodName = - "/!bookTicker" - .substring(1) - .replace( - "", - allBookTickersStreamRequest.getId() != null - ? allBookTickersStreamRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void allBookTickersStreamValidateBeforeCall( - AllBookTickersStreamRequest allBookTickersStreamRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(allBookTickersStreamRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * All Market Liquidation Order Streams The All Liquidation Order Snapshot Streams push force - * liquidation order information for all symbols in the market. For each symbol,only the latest - * one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens - * in the interval of 1000ms, no stream will be pushed. Update Speed: 1000ms - * - * @param allMarketLiquidationOrderStreamsRequest (required) - * @return AllMarketLiquidationOrderStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 All Market Liquidation Order Streams -
- * - * @see All - * Market Liquidation Order Streams Documentation - */ - public StreamBlockingQueueWrapper - allMarketLiquidationOrderStreams( - AllMarketLiquidationOrderStreamsRequest allMarketLiquidationOrderStreamsRequest) - throws ApiException { - StreamBlockingQueue queue = - allMarketLiquidationOrderStreamsRaw(allMarketLiquidationOrderStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue allMarketLiquidationOrderStreamsRaw( - AllMarketLiquidationOrderStreamsRequest allMarketLiquidationOrderStreamsRequest) - throws ApiException { - allMarketLiquidationOrderStreamsValidateBeforeCall(allMarketLiquidationOrderStreamsRequest); - - String methodName = - "/!forceOrder@arr" - .substring(1) - .replace( - "", - allMarketLiquidationOrderStreamsRequest.getId() != null - ? allMarketLiquidationOrderStreamsRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void allMarketLiquidationOrderStreamsValidateBeforeCall( - AllMarketLiquidationOrderStreamsRequest allMarketLiquidationOrderStreamsRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(allMarketLiquidationOrderStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * All Market Mini Tickers Stream 24hr rolling window mini-ticker statistics for all symbols. - * These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to - * 24hrs before. Note that only tickers that have changed will be present in the array. Update - * Speed: 1000ms - * - * @param allMarketMiniTickersStreamRequest (required) - * @return AllMarketMiniTickersStreamResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 All Market Mini Tickers Stream -
- * - * @see All - * Market Mini Tickers Stream Documentation - */ - public StreamBlockingQueueWrapper - allMarketMiniTickersStream( - AllMarketMiniTickersStreamRequest allMarketMiniTickersStreamRequest) - throws ApiException { - StreamBlockingQueue queue = - allMarketMiniTickersStreamRaw(allMarketMiniTickersStreamRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue allMarketMiniTickersStreamRaw( - AllMarketMiniTickersStreamRequest allMarketMiniTickersStreamRequest) - throws ApiException { - allMarketMiniTickersStreamValidateBeforeCall(allMarketMiniTickersStreamRequest); - - String methodName = - "/!miniTicker@arr" - .substring(1) - .replace( - "", - allMarketMiniTickersStreamRequest.getId() != null - ? allMarketMiniTickersStreamRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void allMarketMiniTickersStreamValidateBeforeCall( - AllMarketMiniTickersStreamRequest allMarketMiniTickersStreamRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(allMarketMiniTickersStreamRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * All Market Tickers Streams 24hr rolling window ticker statistics for all symbols. These are - * NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs - * before. Note that only tickers that have changed will be present in the array. Update Speed: - * 1000ms - * - * @param allMarketTickersStreamsRequest (required) - * @return AllMarketTickersStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 All Market Tickers Streams -
- * - * @see All - * Market Tickers Streams Documentation - */ - public StreamBlockingQueueWrapper allMarketTickersStreams( - AllMarketTickersStreamsRequest allMarketTickersStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - allMarketTickersStreamsRaw(allMarketTickersStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue allMarketTickersStreamsRaw( - AllMarketTickersStreamsRequest allMarketTickersStreamsRequest) throws ApiException { - allMarketTickersStreamsValidateBeforeCall(allMarketTickersStreamsRequest); - - String methodName = - "/!ticker@arr" - .substring(1) - .replace( - "", - allMarketTickersStreamsRequest.getId() != null - ? allMarketTickersStreamsRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void allMarketTickersStreamsValidateBeforeCall( - AllMarketTickersStreamsRequest allMarketTickersStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(allMarketTickersStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Composite Index Symbol Information Streams Composite index information for index symbols - * pushed every second. Update Speed: 1000ms - * - * @param compositeIndexSymbolInformationStreamsRequest (required) - * @return CompositeIndexSymbolInformationStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Composite Index Symbol Information Streams -
- * - * @see Composite - * Index Symbol Information Streams Documentation - */ - public StreamBlockingQueueWrapper - compositeIndexSymbolInformationStreams( - CompositeIndexSymbolInformationStreamsRequest - compositeIndexSymbolInformationStreamsRequest) - throws ApiException { - StreamBlockingQueue queue = - compositeIndexSymbolInformationStreamsRaw( - compositeIndexSymbolInformationStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue compositeIndexSymbolInformationStreamsRaw( - CompositeIndexSymbolInformationStreamsRequest - compositeIndexSymbolInformationStreamsRequest) - throws ApiException { - compositeIndexSymbolInformationStreamsValidateBeforeCall( - compositeIndexSymbolInformationStreamsRequest); - - String methodName = - "/@compositeIndex" - .substring(1) - .replace( - "", - compositeIndexSymbolInformationStreamsRequest.getId() != null - ? compositeIndexSymbolInformationStreamsRequest - .getId() - .toString() - : "") - .replace( - "", - compositeIndexSymbolInformationStreamsRequest.getSymbol() != null - ? compositeIndexSymbolInformationStreamsRequest - .getSymbol() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void compositeIndexSymbolInformationStreamsValidateBeforeCall( - CompositeIndexSymbolInformationStreamsRequest - compositeIndexSymbolInformationStreamsRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(compositeIndexSymbolInformationStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Continuous Contract Kline/Candlestick Streams Update Speed: 250ms - * - * @param continuousContractKlineCandlestickStreamsRequest (required) - * @return ContinuousContractKlineCandlestickStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Continuous Contract Kline/Candlestick Streams -
- * - * @see Continuous - * Contract Kline/Candlestick Streams Documentation - */ - public StreamBlockingQueueWrapper - continuousContractKlineCandlestickStreams( - ContinuousContractKlineCandlestickStreamsRequest - continuousContractKlineCandlestickStreamsRequest) - throws ApiException { - StreamBlockingQueue queue = - continuousContractKlineCandlestickStreamsRaw( - continuousContractKlineCandlestickStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue continuousContractKlineCandlestickStreamsRaw( - ContinuousContractKlineCandlestickStreamsRequest - continuousContractKlineCandlestickStreamsRequest) - throws ApiException { - continuousContractKlineCandlestickStreamsValidateBeforeCall( - continuousContractKlineCandlestickStreamsRequest); - - String methodName = - "/_@continuousKline_" - .substring(1) - .replace( - "", - continuousContractKlineCandlestickStreamsRequest.getId() != null - ? continuousContractKlineCandlestickStreamsRequest - .getId() - .toString() - : "") - .replace( - "", - continuousContractKlineCandlestickStreamsRequest.getPair() != null - ? continuousContractKlineCandlestickStreamsRequest - .getPair() - .toString() - : "") - .replace( - "", - continuousContractKlineCandlestickStreamsRequest.getContractType() - != null - ? continuousContractKlineCandlestickStreamsRequest - .getContractType() - .toString() - : "") - .replace( - "", - continuousContractKlineCandlestickStreamsRequest.getInterval() - != null - ? continuousContractKlineCandlestickStreamsRequest - .getInterval() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void continuousContractKlineCandlestickStreamsValidateBeforeCall( - ContinuousContractKlineCandlestickStreamsRequest - continuousContractKlineCandlestickStreamsRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(continuousContractKlineCandlestickStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Contract Info Stream ContractInfo stream pushes when contract info - * updates(listing/settlement/contract bracket update). `bks` field only shows up when - * bracket gets updated. Update Speed: Real-time - * - * @param contractInfoStreamRequest (required) - * @return ContractInfoStreamResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Contract Info Stream -
- * - * @see Contract - * Info Stream Documentation - */ - public StreamBlockingQueueWrapper contractInfoStream( - ContractInfoStreamRequest contractInfoStreamRequest) throws ApiException { - StreamBlockingQueue queue = contractInfoStreamRaw(contractInfoStreamRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue contractInfoStreamRaw( - ContractInfoStreamRequest contractInfoStreamRequest) throws ApiException { - contractInfoStreamValidateBeforeCall(contractInfoStreamRequest); - - String methodName = - "/!contractInfo" - .substring(1) - .replace( - "", - contractInfoStreamRequest.getId() != null - ? contractInfoStreamRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void contractInfoStreamValidateBeforeCall( - ContractInfoStreamRequest contractInfoStreamRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(contractInfoStreamRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Diff. Book Depth Streams Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 - * milliseconds (if existing) Retail Price Improvement(RPI) orders are not visible and excluded - * in the response message. Update Speed: 250ms, 500ms, 100ms - * - * @param diffBookDepthStreamsRequest (required) - * @return DiffBookDepthStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Diff. Book Depth Streams -
- * - * @see Diff. - * Book Depth Streams Documentation - */ - public StreamBlockingQueueWrapper diffBookDepthStreams( - DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { - StreamBlockingQueue queue = diffBookDepthStreamsRaw(diffBookDepthStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue diffBookDepthStreamsRaw( - DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { - diffBookDepthStreamsValidateBeforeCall(diffBookDepthStreamsRequest); - - String methodName = - "/@depth@" - .substring(1) - .replace( - "", - diffBookDepthStreamsRequest.getId() != null - ? diffBookDepthStreamsRequest.getId().toString() - : "") - .replace( - "", - diffBookDepthStreamsRequest.getSymbol() != null - ? diffBookDepthStreamsRequest.getSymbol().toString() - : "") - .replace( - "", - diffBookDepthStreamsRequest.getUpdateSpeed() != null - ? diffBookDepthStreamsRequest.getUpdateSpeed().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void diffBookDepthStreamsValidateBeforeCall( - DiffBookDepthStreamsRequest diffBookDepthStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(diffBookDepthStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Individual Symbol Book Ticker Streams Pushes any update to the best bid or ask's price or - * quantity in real-time for a specified symbol. Retail Price Improvement(RPI) orders are not - * visible and excluded in the response message. Update Speed: Real-time - * - * @param individualSymbolBookTickerStreamsRequest (required) - * @return IndividualSymbolBookTickerStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Individual Symbol Book Ticker Streams -
- * - * @see Individual - * Symbol Book Ticker Streams Documentation - */ - public StreamBlockingQueueWrapper - individualSymbolBookTickerStreams( - IndividualSymbolBookTickerStreamsRequest - individualSymbolBookTickerStreamsRequest) - throws ApiException { - StreamBlockingQueue queue = - individualSymbolBookTickerStreamsRaw(individualSymbolBookTickerStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue individualSymbolBookTickerStreamsRaw( - IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest) - throws ApiException { - individualSymbolBookTickerStreamsValidateBeforeCall( - individualSymbolBookTickerStreamsRequest); - - String methodName = - "/@bookTicker" - .substring(1) - .replace( - "", - individualSymbolBookTickerStreamsRequest.getId() != null - ? individualSymbolBookTickerStreamsRequest - .getId() - .toString() - : "") - .replace( - "", - individualSymbolBookTickerStreamsRequest.getSymbol() != null - ? individualSymbolBookTickerStreamsRequest - .getSymbol() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void individualSymbolBookTickerStreamsValidateBeforeCall( - IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(individualSymbolBookTickerStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Individual Symbol Mini Ticker Stream 24hr rolling window mini-ticker statistics for a single - * symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from - * requestTime to 24hrs before. Update Speed: 2s - * - * @param individualSymbolMiniTickerStreamRequest (required) - * @return IndividualSymbolMiniTickerStreamResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Individual Symbol Mini Ticker Stream -
- * - * @see Individual - * Symbol Mini Ticker Stream Documentation - */ - public StreamBlockingQueueWrapper - individualSymbolMiniTickerStream( - IndividualSymbolMiniTickerStreamRequest individualSymbolMiniTickerStreamRequest) - throws ApiException { - StreamBlockingQueue queue = - individualSymbolMiniTickerStreamRaw(individualSymbolMiniTickerStreamRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue individualSymbolMiniTickerStreamRaw( - IndividualSymbolMiniTickerStreamRequest individualSymbolMiniTickerStreamRequest) - throws ApiException { - individualSymbolMiniTickerStreamValidateBeforeCall(individualSymbolMiniTickerStreamRequest); - - String methodName = - "/@miniTicker" - .substring(1) - .replace( - "", - individualSymbolMiniTickerStreamRequest.getId() != null - ? individualSymbolMiniTickerStreamRequest.getId().toString() - : "") - .replace( - "", - individualSymbolMiniTickerStreamRequest.getSymbol() != null - ? individualSymbolMiniTickerStreamRequest - .getSymbol() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void individualSymbolMiniTickerStreamValidateBeforeCall( - IndividualSymbolMiniTickerStreamRequest individualSymbolMiniTickerStreamRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(individualSymbolMiniTickerStreamRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Individual Symbol Ticker Streams 24hr rolling window ticker statistics for a single symbol. - * These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to - * 24hrs before. Update Speed: 2000ms - * - * @param individualSymbolTickerStreamsRequest (required) - * @return IndividualSymbolTickerStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Individual Symbol Ticker Streams -
- * - * @see Individual - * Symbol Ticker Streams Documentation - */ - public StreamBlockingQueueWrapper - individualSymbolTickerStreams( - IndividualSymbolTickerStreamsRequest individualSymbolTickerStreamsRequest) - throws ApiException { - StreamBlockingQueue queue = - individualSymbolTickerStreamsRaw(individualSymbolTickerStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue individualSymbolTickerStreamsRaw( - IndividualSymbolTickerStreamsRequest individualSymbolTickerStreamsRequest) - throws ApiException { - individualSymbolTickerStreamsValidateBeforeCall(individualSymbolTickerStreamsRequest); - - String methodName = - "/@ticker" - .substring(1) - .replace( - "", - individualSymbolTickerStreamsRequest.getId() != null - ? individualSymbolTickerStreamsRequest.getId().toString() - : "") - .replace( - "", - individualSymbolTickerStreamsRequest.getSymbol() != null - ? individualSymbolTickerStreamsRequest - .getSymbol() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void individualSymbolTickerStreamsValidateBeforeCall( - IndividualSymbolTickerStreamsRequest individualSymbolTickerStreamsRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(individualSymbolTickerStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Kline/Candlestick Streams The Kline/Candlestick Stream push updates to the current - * klines/candlestick every 250 milliseconds (if existing). Update Speed: 250ms - * - * @param klineCandlestickStreamsRequest (required) - * @return KlineCandlestickStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Kline/Candlestick Streams -
- * - * @see Kline/Candlestick - * Streams Documentation - */ - public StreamBlockingQueueWrapper klineCandlestickStreams( - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - klineCandlestickStreamsRaw(klineCandlestickStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue klineCandlestickStreamsRaw( - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - klineCandlestickStreamsValidateBeforeCall(klineCandlestickStreamsRequest); - - String methodName = - "/@kline_" - .substring(1) - .replace( - "", - klineCandlestickStreamsRequest.getId() != null - ? klineCandlestickStreamsRequest.getId().toString() - : "") - .replace( - "", - klineCandlestickStreamsRequest.getSymbol() != null - ? klineCandlestickStreamsRequest.getSymbol().toString() - : "") - .replace( - "", - klineCandlestickStreamsRequest.getInterval() != null - ? klineCandlestickStreamsRequest.getInterval().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void klineCandlestickStreamsValidateBeforeCall( - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(klineCandlestickStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Liquidation Order Streams The Liquidation Order Snapshot Streams push force liquidation order - * information for specific symbol. For each symbol,only the latest one liquidation order within - * 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, - * no stream will be pushed. Update Speed: 1000ms - * - * @param liquidationOrderStreamsRequest (required) - * @return LiquidationOrderStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Liquidation Order Streams -
- * - * @see Liquidation - * Order Streams Documentation - */ - public StreamBlockingQueueWrapper liquidationOrderStreams( - LiquidationOrderStreamsRequest liquidationOrderStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - liquidationOrderStreamsRaw(liquidationOrderStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue liquidationOrderStreamsRaw( - LiquidationOrderStreamsRequest liquidationOrderStreamsRequest) throws ApiException { - liquidationOrderStreamsValidateBeforeCall(liquidationOrderStreamsRequest); - - String methodName = - "/@forceOrder" - .substring(1) - .replace( - "", - liquidationOrderStreamsRequest.getId() != null - ? liquidationOrderStreamsRequest.getId().toString() - : "") - .replace( - "", - liquidationOrderStreamsRequest.getSymbol() != null - ? liquidationOrderStreamsRequest.getSymbol().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void liquidationOrderStreamsValidateBeforeCall( - LiquidationOrderStreamsRequest liquidationOrderStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(liquidationOrderStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Mark Price Stream Mark price and funding rate for a single symbol pushed every 3 seconds or - * every second. Update Speed: 3000ms or 1000ms - * - * @param markPriceStreamRequest (required) - * @return MarkPriceStreamResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Mark Price Stream -
- * - * @see Mark - * Price Stream Documentation - */ - public StreamBlockingQueueWrapper markPriceStream( - MarkPriceStreamRequest markPriceStreamRequest) throws ApiException { - StreamBlockingQueue queue = markPriceStreamRaw(markPriceStreamRequest); - - TypeToken typeToken = new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue markPriceStreamRaw( - MarkPriceStreamRequest markPriceStreamRequest) throws ApiException { - markPriceStreamValidateBeforeCall(markPriceStreamRequest); - - String methodName = - "/@markPrice@" - .substring(1) - .replace( - "", - markPriceStreamRequest.getId() != null - ? markPriceStreamRequest.getId().toString() - : "") - .replace( - "", - markPriceStreamRequest.getSymbol() != null - ? markPriceStreamRequest.getSymbol().toString() - : "") - .replace( - "", - markPriceStreamRequest.getUpdateSpeed() != null - ? markPriceStreamRequest.getUpdateSpeed().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void markPriceStreamValidateBeforeCall(MarkPriceStreamRequest markPriceStreamRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(markPriceStreamRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Mark Price Stream for All market Mark price and funding rate for all symbols pushed every 3 - * seconds or every second. **Note**: TradFi symbols will be pushed through a seperate message. - * Update Speed: 3000ms or 1000ms - * - * @param markPriceStreamForAllMarketRequest (required) - * @return MarkPriceStreamForAllMarketResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Mark Price Stream for All market -
- * - * @see Mark - * Price Stream for All market Documentation - */ - public StreamBlockingQueueWrapper - markPriceStreamForAllMarket( - MarkPriceStreamForAllMarketRequest markPriceStreamForAllMarketRequest) - throws ApiException { - StreamBlockingQueue queue = - markPriceStreamForAllMarketRaw(markPriceStreamForAllMarketRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue markPriceStreamForAllMarketRaw( - MarkPriceStreamForAllMarketRequest markPriceStreamForAllMarketRequest) - throws ApiException { - markPriceStreamForAllMarketValidateBeforeCall(markPriceStreamForAllMarketRequest); - - String methodName = - "/!markPrice@arr@" - .substring(1) - .replace( - "", - markPriceStreamForAllMarketRequest.getId() != null - ? markPriceStreamForAllMarketRequest.getId().toString() - : "") - .replace( - "", - markPriceStreamForAllMarketRequest.getUpdateSpeed() != null - ? markPriceStreamForAllMarketRequest - .getUpdateSpeed() - .toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void markPriceStreamForAllMarketValidateBeforeCall( - MarkPriceStreamForAllMarketRequest markPriceStreamForAllMarketRequest) - throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(markPriceStreamForAllMarketRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Multi-Assets Mode Asset Index Asset index for multi-assets mode user Update Speed: 1s - * - * @param multiAssetsModeAssetIndexRequest (required) - * @return MultiAssetsModeAssetIndexResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Multi-Assets Mode Asset Index -
- * - * @see Multi-Assets - * Mode Asset Index Documentation - */ - public StreamBlockingQueueWrapper multiAssetsModeAssetIndex( - MultiAssetsModeAssetIndexRequest multiAssetsModeAssetIndexRequest) throws ApiException { - StreamBlockingQueue queue = - multiAssetsModeAssetIndexRaw(multiAssetsModeAssetIndexRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue multiAssetsModeAssetIndexRaw( - MultiAssetsModeAssetIndexRequest multiAssetsModeAssetIndexRequest) throws ApiException { - multiAssetsModeAssetIndexValidateBeforeCall(multiAssetsModeAssetIndexRequest); - - String methodName = - "/!assetIndex@arr" - .substring(1) - .replace( - "", - multiAssetsModeAssetIndexRequest.getId() != null - ? multiAssetsModeAssetIndexRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void multiAssetsModeAssetIndexValidateBeforeCall( - MultiAssetsModeAssetIndexRequest multiAssetsModeAssetIndexRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(multiAssetsModeAssetIndexRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Partial Book Depth Streams Top **<levels\\>** bids and asks, Valid **<levels\\>** - * are 5, 10, or 20. Retail Price Improvement(RPI) orders are not visible and excluded in the - * response message. Update Speed: 250ms, 500ms or 100ms - * - * @param partialBookDepthStreamsRequest (required) - * @return PartialBookDepthStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Partial Book Depth Streams -
- * - * @see Partial - * Book Depth Streams Documentation - */ - public StreamBlockingQueueWrapper partialBookDepthStreams( - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - partialBookDepthStreamsRaw(partialBookDepthStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue partialBookDepthStreamsRaw( - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - partialBookDepthStreamsValidateBeforeCall(partialBookDepthStreamsRequest); - - String methodName = - "/@depth@" - .substring(1) - .replace( - "", - partialBookDepthStreamsRequest.getId() != null - ? partialBookDepthStreamsRequest.getId().toString() - : "") - .replace( - "", - partialBookDepthStreamsRequest.getSymbol() != null - ? partialBookDepthStreamsRequest.getSymbol().toString() - : "") - .replace( - "", - partialBookDepthStreamsRequest.getLevels() != null - ? partialBookDepthStreamsRequest.getLevels().toString() - : "") - .replace( - "", - partialBookDepthStreamsRequest.getUpdateSpeed() != null - ? partialBookDepthStreamsRequest.getUpdateSpeed().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void partialBookDepthStreamsValidateBeforeCall( - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(partialBookDepthStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * RPI Diff. Book Depth Streams Bids and asks including RPI orders, pushed every 500 - * milliseconds RPI(Retail Price Improvement) orders are included and aggreated in the response - * message. When the quantity of a price level to be updated is equal to 0, it means either all - * quotations for this price have been filled/canceled, or the quantity of crossed RPI orders - * for this price are hidden Update Speed: 500ms - * - * @param rpiDiffBookDepthStreamsRequest (required) - * @return RpiDiffBookDepthStreamsResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 RPI Diff. Book Depth Streams -
- * - * @see RPI - * Diff. Book Depth Streams Documentation - */ - public StreamBlockingQueueWrapper rpiDiffBookDepthStreams( - RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { - StreamBlockingQueue queue = - rpiDiffBookDepthStreamsRaw(rpiDiffBookDepthStreamsRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue rpiDiffBookDepthStreamsRaw( - RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { - rpiDiffBookDepthStreamsValidateBeforeCall(rpiDiffBookDepthStreamsRequest); - - String methodName = - "/@rpiDepth@500ms" - .substring(1) - .replace( - "", - rpiDiffBookDepthStreamsRequest.getId() != null - ? rpiDiffBookDepthStreamsRequest.getId().toString() - : "") - .replace( - "", - rpiDiffBookDepthStreamsRequest.getSymbol() != null - ? rpiDiffBookDepthStreamsRequest.getSymbol().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void rpiDiffBookDepthStreamsValidateBeforeCall( - RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(rpiDiffBookDepthStreamsRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - /** - * Trading Session Stream Trading session information for the underlying assets of TradFi - * Perpetual contracts—covering the U.S. equity market and the commodity market—is updated every - * second. Trading session information for different underlying markets is pushed in separate - * messages. Session types for the equity market include \"PRE_MARKET\", - * \"REGULAR\", \"AFTER_MARKET\", \"OVERNIGHT\", and - * \"NO_TRADING\". Session types for the commodity market include - * \"REGULAR\" and \"NO_TRADING\". Update Speed: 1s - * - * @param tradingSessionStreamRequest (required) - * @return TradingSessionStreamResponse - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the - * response body - * @http.response.details - * - * - * - * - *
Response Details
Status Code Description Response Headers
200 Trading Session Stream -
- * - * @see Trading - * Session Stream Documentation - */ - public StreamBlockingQueueWrapper tradingSessionStream( - TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { - StreamBlockingQueue queue = tradingSessionStreamRaw(tradingSessionStreamRequest); - - TypeToken typeToken = - new TypeToken() {}; - - return new StreamBlockingQueueWrapper<>(queue, typeToken); - } - - public StreamBlockingQueue tradingSessionStreamRaw( - TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { - tradingSessionStreamValidateBeforeCall(tradingSessionStreamRequest); - - String methodName = - "/tradingSession" - .substring(1) - .replace( - "", - tradingSessionStreamRequest.getId() != null - ? tradingSessionStreamRequest.getId().toString() - : ""); - if ("@".equals(methodName.substring(methodName.length() - 1))) { - methodName = methodName.substring(0, methodName.length() - 1); - } - - RequestWrapperDTO, Object> requestWrapperDTO = - new RequestWrapperDTO.Builder, Object>() - .id(getRequestID()) - .method("SUBSCRIBE") - .params(Collections.singleton(methodName)) - .build(); - Map> queuesMap = - connection.subscribe(requestWrapperDTO); - return queuesMap.get(methodName); - } - - @SuppressWarnings("rawtypes") - private void tradingSessionStreamValidateBeforeCall( - TradingSessionStreamRequest tradingSessionStreamRequest) throws ApiException { - try { - Validator validator = - Validation.byDefaultProvider() - .configure() - .messageInterpolator(new ParameterMessageInterpolator()) - .buildValidatorFactory() - .getValidator(); - - Set> violations = - validator.validate(tradingSessionStreamRequest); - - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } catch (SecurityException e) { - e.printStackTrace(); - throw new ApiException(e.getMessage()); - } - } - - public String getRequestID() { - return UUID.randomUUID().toString(); - } -} diff --git a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java b/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java deleted file mode 100644 index 5ead8389e..000000000 --- a/clients/derivatives-trading-usds-futures/src/test/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/api/WebsocketMarketStreamsApiTest.java +++ /dev/null @@ -1,776 +0,0 @@ -/* - * Binance Derivatives Trading USDS Futures WebSocket Market Streams - * OpenAPI Specification for the Binance Derivatives Trading USDS Futures WebSocket Market Streams - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.configuration.SignatureConfiguration; -import com.binance.connector.client.common.websocket.adapter.stream.StreamConnectionWrapper; - -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.dtos.RequestWrapperDTO; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketLiquidationOrderStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketLiquidationOrderStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketMiniTickersStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketMiniTickersStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketTickersStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketTickersStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.CompositeIndexSymbolInformationStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.CompositeIndexSymbolInformationStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContinuousContractKlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContinuousContractKlineCandlestickStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContractInfoStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContractInfoStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.DiffBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.DiffBookDepthStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolMiniTickerStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolMiniTickerStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolTickerStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolTickerStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.KlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.KlineCandlestickStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.LiquidationOrderStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.LiquidationOrderStreamsResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamForAllMarketRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamForAllMarketResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexResponse; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsResponse; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Set; -import java.util.concurrent.CompletableFuture; - -import org.eclipse.jetty.websocket.api.RemoteEndpoint; -import org.eclipse.jetty.websocket.api.Session; -import org.eclipse.jetty.websocket.client.WebSocketClient; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import org.skyscreamer.jsonassert.JSONAssert; - -/** API tests for WebsocketMarketStreamsApi */ -public class WebsocketMarketStreamsApiTest { - - private WebsocketMarketStreamsApi api; - private StreamConnectionWrapper connectionSpy; - private Session sessionMock; - - @BeforeEach - public void initApiClient() throws Exception { - URL resource = WebsocketMarketStreamsApi.class.getResource("/test-ed25519-prv-key.pem"); - SignatureConfiguration signatureConfiguration = new SignatureConfiguration(); - signatureConfiguration.setApiKey("apiKey"); - File file = new File(resource.toURI()); - signatureConfiguration.setPrivateKey(file.getAbsolutePath()); - WebSocketClientConfiguration clientConfiguration = new WebSocketClientConfiguration(); - // @TODO: run tests for LOGON as well - clientConfiguration.setAutoLogon(false); - clientConfiguration.setSignatureConfiguration(signatureConfiguration); - clientConfiguration.setUrl("wss://localhost:8080"); - - WebSocketClient webSocketClient = Mockito.mock(WebSocketClient.class); - CompletableFuture sessionCompletableFuture = new CompletableFuture<>(); - Mockito.doReturn(sessionCompletableFuture) - .when(webSocketClient) - .connect(Mockito.any(), Mockito.any(), Mockito.any()); - sessionMock = Mockito.mock(Session.class); - - RemoteEndpoint remoteEndpointMock = Mockito.mock(RemoteEndpoint.class); - Mockito.doReturn(remoteEndpointMock).when(sessionMock).getRemote(); - - sessionCompletableFuture.complete(sessionMock); - StreamConnectionWrapper connectionWrapper = - new StreamConnectionWrapper(clientConfiguration, webSocketClient); - connectionSpy = Mockito.spy(connectionWrapper); - Mockito.doNothing().when(connectionSpy).setUserAgent(Mockito.anyString()); - Mockito.doReturn(1736393892000L).when(connectionSpy).getTimestamp(); - connectionSpy.connect(); - WebsocketMarketStreamsApi accountApi = new WebsocketMarketStreamsApi(connectionSpy); - api = Mockito.spy(accountApi); - Mockito.doReturn("eaf3292c-64b6-4c04-ad4f-4ca2608b42b4").when(api).getRequestID(); - } - - /** - * Aggregate Trade Streams - * - *

The Aggregate Trade Streams push market trade information that is aggregated for fills - * with same price and taking side every 100 milliseconds. Only market trades will be - * aggregated, which means the insurance fund trades and ADL trades won't be aggregated. - * Update Speed: 100ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void aggregateTradeStreamsTest() throws ApiException, URISyntaxException, IOException { - AggregateTradeStreamsRequest aggregateTradeStreamsRequest = - new AggregateTradeStreamsRequest(); - - aggregateTradeStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.aggregateTradeStreams(aggregateTradeStreamsRequest); - ArgumentCaptor, AggregateTradeStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, AggregateTradeStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@aggTrade-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * All Book Tickers Stream - * - *

Pushes any update to the best bid or ask's price or quantity in real-time for all - * symbols. Update Speed: 5s - * - * @throws ApiException if the Api call fails - */ - @Test - public void allBookTickersStreamTest() throws ApiException, URISyntaxException, IOException { - AllBookTickersStreamRequest allBookTickersStreamRequest = new AllBookTickersStreamRequest(); - - StreamBlockingQueueWrapper response = - api.allBookTickersStream(allBookTickersStreamRequest); - ArgumentCaptor, AllBookTickersStreamResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, AllBookTickersStreamResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/!bookTicker-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * All Market Liquidation Order Streams - * - *

The All Liquidation Order Snapshot Streams push force liquidation order information for - * all symbols in the market. For each symbol,only the latest one liquidation order within - * 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, - * no stream will be pushed. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void allMarketLiquidationOrderStreamsTest() - throws ApiException, URISyntaxException, IOException { - AllMarketLiquidationOrderStreamsRequest allMarketLiquidationOrderStreamsRequest = - new AllMarketLiquidationOrderStreamsRequest(); - - StreamBlockingQueueWrapper response = - api.allMarketLiquidationOrderStreams(allMarketLiquidationOrderStreamsRequest); - ArgumentCaptor, AllMarketLiquidationOrderStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, AllMarketLiquidationOrderStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/!forceOrder@arr-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * All Market Mini Tickers Stream - * - *

24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics - * of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only - * tickers that have changed will be present in the array. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void allMarketMiniTickersStreamTest() - throws ApiException, URISyntaxException, IOException { - AllMarketMiniTickersStreamRequest allMarketMiniTickersStreamRequest = - new AllMarketMiniTickersStreamRequest(); - - StreamBlockingQueueWrapper response = - api.allMarketMiniTickersStream(allMarketMiniTickersStreamRequest); - ArgumentCaptor, AllMarketMiniTickersStreamResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, AllMarketMiniTickersStreamResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/!miniTicker@arr-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * All Market Tickers Streams - * - *

24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the - * UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers - * that have changed will be present in the array. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void allMarketTickersStreamsTest() throws ApiException, URISyntaxException, IOException { - AllMarketTickersStreamsRequest allMarketTickersStreamsRequest = - new AllMarketTickersStreamsRequest(); - - StreamBlockingQueueWrapper response = - api.allMarketTickersStreams(allMarketTickersStreamsRequest); - ArgumentCaptor, AllMarketTickersStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, AllMarketTickersStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/!ticker@arr-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Composite Index Symbol Information Streams - * - *

Composite index information for index symbols pushed every second. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void compositeIndexSymbolInformationStreamsTest() - throws ApiException, URISyntaxException, IOException { - CompositeIndexSymbolInformationStreamsRequest - compositeIndexSymbolInformationStreamsRequest = - new CompositeIndexSymbolInformationStreamsRequest(); - - compositeIndexSymbolInformationStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.compositeIndexSymbolInformationStreams( - compositeIndexSymbolInformationStreamsRequest); - ArgumentCaptor< - RequestWrapperDTO< - Set, CompositeIndexSymbolInformationStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, CompositeIndexSymbolInformationStreamsResponse> - requestWrapperDTO = callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@compositeIndex-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Continuous Contract Kline/Candlestick Streams - * - *

Update Speed: 250ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void continuousContractKlineCandlestickStreamsTest() - throws ApiException, URISyntaxException, IOException { - ContinuousContractKlineCandlestickStreamsRequest - continuousContractKlineCandlestickStreamsRequest = - new ContinuousContractKlineCandlestickStreamsRequest(); - - continuousContractKlineCandlestickStreamsRequest.pair("btcusdt"); - continuousContractKlineCandlestickStreamsRequest.contractType("next_quarter"); - continuousContractKlineCandlestickStreamsRequest.interval("1m"); - - StreamBlockingQueueWrapper response = - api.continuousContractKlineCandlestickStreams( - continuousContractKlineCandlestickStreamsRequest); - ArgumentCaptor< - RequestWrapperDTO< - Set, ContinuousContractKlineCandlestickStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, ContinuousContractKlineCandlestickStreamsResponse> - requestWrapperDTO = callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/pair_contractType@continuousKline_interval-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Contract Info Stream - * - *

ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket - * update). `bks` field only shows up when bracket gets updated. Update Speed: - * Real-time - * - * @throws ApiException if the Api call fails - */ - @Test - public void contractInfoStreamTest() throws ApiException, URISyntaxException, IOException { - ContractInfoStreamRequest contractInfoStreamRequest = new ContractInfoStreamRequest(); - - StreamBlockingQueueWrapper response = - api.contractInfoStream(contractInfoStreamRequest); - ArgumentCaptor, ContractInfoStreamResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, ContractInfoStreamResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/!contractInfo-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Diff. Book Depth Streams - * - *

Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if - * existing) Update Speed: 250ms, 500ms, 100ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void diffBookDepthStreamsTest() throws ApiException, URISyntaxException, IOException { - DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = new DiffBookDepthStreamsRequest(); - - diffBookDepthStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.diffBookDepthStreams(diffBookDepthStreamsRequest); - ArgumentCaptor, DiffBookDepthStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, DiffBookDepthStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@depthupdateSpeed-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Individual Symbol Book Ticker Streams - * - *

Pushes any update to the best bid or ask's price or quantity in real-time for a - * specified symbol. Update Speed: Real-time - * - * @throws ApiException if the Api call fails - */ - @Test - public void individualSymbolBookTickerStreamsTest() - throws ApiException, URISyntaxException, IOException { - IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = - new IndividualSymbolBookTickerStreamsRequest(); - - individualSymbolBookTickerStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.individualSymbolBookTickerStreams(individualSymbolBookTickerStreamsRequest); - ArgumentCaptor, IndividualSymbolBookTickerStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, IndividualSymbolBookTickerStreamsResponse> - requestWrapperDTO = callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@bookTicker-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Individual Symbol Mini Ticker Stream - * - *

24hr rolling window mini-ticker statistics for a single symbol. These are NOT the - * statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Update - * Speed: 2s - * - * @throws ApiException if the Api call fails - */ - @Test - public void individualSymbolMiniTickerStreamTest() - throws ApiException, URISyntaxException, IOException { - IndividualSymbolMiniTickerStreamRequest individualSymbolMiniTickerStreamRequest = - new IndividualSymbolMiniTickerStreamRequest(); - - individualSymbolMiniTickerStreamRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.individualSymbolMiniTickerStream(individualSymbolMiniTickerStreamRequest); - ArgumentCaptor, IndividualSymbolMiniTickerStreamResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, IndividualSymbolMiniTickerStreamResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@miniTicker-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Individual Symbol Ticker Streams - * - *

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of - * the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Update Speed: 2000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void individualSymbolTickerStreamsTest() - throws ApiException, URISyntaxException, IOException { - IndividualSymbolTickerStreamsRequest individualSymbolTickerStreamsRequest = - new IndividualSymbolTickerStreamsRequest(); - - individualSymbolTickerStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.individualSymbolTickerStreams(individualSymbolTickerStreamsRequest); - ArgumentCaptor, IndividualSymbolTickerStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, IndividualSymbolTickerStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@ticker-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Kline/Candlestick Streams - * - *

The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 - * milliseconds (if existing). Update Speed: 250ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void klineCandlestickStreamsTest() throws ApiException, URISyntaxException, IOException { - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest = - new KlineCandlestickStreamsRequest(); - - klineCandlestickStreamsRequest.symbol("btcusdt"); - klineCandlestickStreamsRequest.interval("1m"); - - StreamBlockingQueueWrapper response = - api.klineCandlestickStreams(klineCandlestickStreamsRequest); - ArgumentCaptor, KlineCandlestickStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, KlineCandlestickStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@kline_interval-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Liquidation Order Streams - * - *

The Liquidation Order Snapshot Streams push force liquidation order information for - * specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be - * pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will - * be pushed. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void liquidationOrderStreamsTest() throws ApiException, URISyntaxException, IOException { - LiquidationOrderStreamsRequest liquidationOrderStreamsRequest = - new LiquidationOrderStreamsRequest(); - - liquidationOrderStreamsRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.liquidationOrderStreams(liquidationOrderStreamsRequest); - ArgumentCaptor, LiquidationOrderStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, LiquidationOrderStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@forceOrder-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Mark Price Stream - * - *

Mark price and funding rate for a single symbol pushed every 3 seconds or every second. - * Update Speed: 3000ms or 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void markPriceStreamTest() throws ApiException, URISyntaxException, IOException { - MarkPriceStreamRequest markPriceStreamRequest = new MarkPriceStreamRequest(); - - markPriceStreamRequest.symbol("btcusdt"); - - StreamBlockingQueueWrapper response = - api.markPriceStream(markPriceStreamRequest); - ArgumentCaptor, MarkPriceStreamResponse>> callArgumentCaptor = - ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, MarkPriceStreamResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@markPriceupdateSpeed-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Mark Price Stream for All market - * - *

Mark price and funding rate for all symbols pushed every 3 seconds or every second. Update - * Speed: 3000ms or 1000ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void markPriceStreamForAllMarketTest() - throws ApiException, URISyntaxException, IOException { - MarkPriceStreamForAllMarketRequest markPriceStreamForAllMarketRequest = - new MarkPriceStreamForAllMarketRequest(); - - StreamBlockingQueueWrapper response = - api.markPriceStreamForAllMarket(markPriceStreamForAllMarketRequest); - ArgumentCaptor, MarkPriceStreamForAllMarketResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, MarkPriceStreamForAllMarketResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/markPrice@arrupdateSpeed-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Multi-Assets Mode Asset Index - * - *

Asset index for multi-assets mode user Update Speed: 1s - * - * @throws ApiException if the Api call fails - */ - @Test - public void multiAssetsModeAssetIndexTest() - throws ApiException, URISyntaxException, IOException { - MultiAssetsModeAssetIndexRequest multiAssetsModeAssetIndexRequest = - new MultiAssetsModeAssetIndexRequest(); - - StreamBlockingQueueWrapper response = - api.multiAssetsModeAssetIndex(multiAssetsModeAssetIndexRequest); - ArgumentCaptor, MultiAssetsModeAssetIndexResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, MultiAssetsModeAssetIndexResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/!assetIndex@arr-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } - - /** - * Partial Book Depth Streams - * - *

Top **<levels\\>** bids and asks, Valid **<levels\\>** are 5, 10, or 20. - * Update Speed: 250ms, 500ms or 100ms - * - * @throws ApiException if the Api call fails - */ - @Test - public void partialBookDepthStreamsTest() throws ApiException, URISyntaxException, IOException { - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = - new PartialBookDepthStreamsRequest(); - - partialBookDepthStreamsRequest.symbol("btcusdt"); - partialBookDepthStreamsRequest.levels(10L); - partialBookDepthStreamsRequest.setUpdateSpeed("100ms"); - - StreamBlockingQueueWrapper response = - api.partialBookDepthStreams(partialBookDepthStreamsRequest); - ArgumentCaptor, PartialBookDepthStreamsResponse>> - callArgumentCaptor = ArgumentCaptor.forClass(RequestWrapperDTO.class); - Mockito.verify(connectionSpy).innerSend(callArgumentCaptor.capture()); - ArgumentCaptor sendArgumentCaptor = ArgumentCaptor.forClass(String.class); - RemoteEndpoint remote = sessionMock.getRemote(); - Mockito.verify(remote).sendString(sendArgumentCaptor.capture(), Mockito.any()); - RequestWrapperDTO, PartialBookDepthStreamsResponse> requestWrapperDTO = - callArgumentCaptor.getValue(); - Set params = requestWrapperDTO.getParams(); - // TODO: test validations - String sentPayload = sendArgumentCaptor.getValue(); - - URL resource = - WebsocketMarketStreamsApiTest.class.getResource( - "/expected/stream/WebsocketMarketStreamsApi/symbol@depthlevelsupdateSpeed-test.json"); - String expectedJson = Files.readString(Paths.get(resource.toURI())); - JSONAssert.assertEquals(expectedJson, sentPayload, true); - } -} diff --git a/clients/dual-investment/CHANGELOG.md b/clients/dual-investment/CHANGELOG.md index 1992d4dc8..d9ff638f1 100644 --- a/clients/dual-investment/CHANGELOG.md +++ b/clients/dual-investment/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.1.2 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 2.1.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/dual-investment/pom.xml b/clients/dual-investment/pom.xml index 14a7ed535..73b6a0659 100644 --- a/clients/dual-investment/pom.xml +++ b/clients/dual-investment/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-dual-investment dual-investment - 2.1.1 + 2.1.2 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.4.2 \ No newline at end of file diff --git a/clients/fiat/CHANGELOG.md b/clients/fiat/CHANGELOG.md index a1e32e383..c17a9f507 100644 --- a/clients/fiat/CHANGELOG.md +++ b/clients/fiat/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 2.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 2.0.0 - 2025-11-10 ### Added (2) diff --git a/clients/fiat/pom.xml b/clients/fiat/pom.xml index e73d5d54d..bf58389b0 100644 --- a/clients/fiat/pom.xml +++ b/clients/fiat/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-fiat fiat - 2.0.0 + 2.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.4.2 \ No newline at end of file diff --git a/clients/gift-card/CHANGELOG.md b/clients/gift-card/CHANGELOG.md index f26956034..6829f672b 100644 --- a/clients/gift-card/CHANGELOG.md +++ b/clients/gift-card/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2.2 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 1.2.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/gift-card/pom.xml b/clients/gift-card/pom.xml index efb2e612c..c7cb32f20 100644 --- a/clients/gift-card/pom.xml +++ b/clients/gift-card/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-gift-card gift-card - 1.2.1 + 1.2.2 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.4.2 \ No newline at end of file diff --git a/clients/margin-trading/CHANGELOG.md b/clients/margin-trading/CHANGELOG.md index c8ee27288..cd8021ee7 100644 --- a/clients/margin-trading/CHANGELOG.md +++ b/clients/margin-trading/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 6.1.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 6.1.0 - 2026-02-12 ### Added (2) diff --git a/clients/margin-trading/pom.xml b/clients/margin-trading/pom.xml index d9b4e829b..0a6b897c2 100644 --- a/clients/margin-trading/pom.xml +++ b/clients/margin-trading/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-margin-trading margin-trading - 6.1.0 + 6.1.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/mining/CHANGELOG.md b/clients/mining/CHANGELOG.md index b7d6b3285..52b1e513e 100644 --- a/clients/mining/CHANGELOG.md +++ b/clients/mining/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 3.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 3.0.0 - 2026-02-12 ### Changed (2) diff --git a/clients/mining/pom.xml b/clients/mining/pom.xml index ce7b01648..cfb7aef3e 100644 --- a/clients/mining/pom.xml +++ b/clients/mining/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-mining mining - 3.0.0 + 3.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/nft/CHANGELOG.md b/clients/nft/CHANGELOG.md index f26956034..6829f672b 100644 --- a/clients/nft/CHANGELOG.md +++ b/clients/nft/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2.2 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 1.2.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/nft/pom.xml b/clients/nft/pom.xml index edacc7c97..1d1f41d6c 100644 --- a/clients/nft/pom.xml +++ b/clients/nft/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-nft nft - 1.2.1 + 1.2.2 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.4.2 \ No newline at end of file diff --git a/clients/pay/CHANGELOG.md b/clients/pay/CHANGELOG.md index 42f6f64cd..ab7e6578d 100644 --- a/clients/pay/CHANGELOG.md +++ b/clients/pay/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 3.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 3.0.0 - 2025-09-22 ### Changed (1) diff --git a/clients/pay/pom.xml b/clients/pay/pom.xml index d102d8a30..708339281 100644 --- a/clients/pay/pom.xml +++ b/clients/pay/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-pay pay - 3.0.0 + 3.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.1 + 2.4.2 \ No newline at end of file diff --git a/clients/pom.xml b/clients/pom.xml index 5a5d9feb8..83404e479 100644 --- a/clients/pom.xml +++ b/clients/pom.xml @@ -5,7 +5,7 @@ binance-connector-java-clients pom binance-connector-java-clients - 1.1.1 + 1.1.2 https://github.com/binance/binance-connector-java Java connector to Binance APIs @@ -385,12 +385,12 @@ org.bouncycastle bcpkix-jdk18on - 1.80 + 1.84 org.eclipse.jetty.websocket websocket-jetty-client - 11.0.25 + 11.0.26 diff --git a/clients/rebate/CHANGELOG.md b/clients/rebate/CHANGELOG.md index f26956034..6829f672b 100644 --- a/clients/rebate/CHANGELOG.md +++ b/clients/rebate/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 1.2.2 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 1.2.1 - 2025-08-07 - Update `binance/common` module to version `2.0.0`. - Add `Content-Type` header only if there is a body. diff --git a/clients/rebate/pom.xml b/clients/rebate/pom.xml index fb31d10a5..b90540b5b 100644 --- a/clients/rebate/pom.xml +++ b/clients/rebate/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-rebate rebate - 1.2.1 + 1.2.2 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.0.0 + 2.4.2 \ No newline at end of file diff --git a/clients/simple-earn/CHANGELOG.md b/clients/simple-earn/CHANGELOG.md index 549189fd7..312e52960 100644 --- a/clients/simple-earn/CHANGELOG.md +++ b/clients/simple-earn/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 6.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 6.0.0 - 2026-03-18 ### Changed (1) diff --git a/clients/simple-earn/pom.xml b/clients/simple-earn/pom.xml index 82362f180..cd260f670 100644 --- a/clients/simple-earn/pom.xml +++ b/clients/simple-earn/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-simple-earn simple-earn - 6.0.0 + 6.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.4.1 + 2.4.2 \ No newline at end of file diff --git a/clients/spot/CHANGELOG.md b/clients/spot/CHANGELOG.md index 55aa851e8..e1c53d835 100644 --- a/clients/spot/CHANGELOG.md +++ b/clients/spot/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 10.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 10.0.0 - 2026-03-18 ### Added (7) diff --git a/clients/spot/pom.xml b/clients/spot/pom.xml index 7568b2812..105c620d9 100644 --- a/clients/spot/pom.xml +++ b/clients/spot/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-spot spot - 10.0.0 + 10.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.4.1 + 2.4.2 \ No newline at end of file diff --git a/clients/staking/CHANGELOG.md b/clients/staking/CHANGELOG.md index 0496a1045..e13fd3ae1 100644 --- a/clients/staking/CHANGELOG.md +++ b/clients/staking/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 4.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 4.0.0 - 2025-12-16 ### Changed (1) diff --git a/clients/staking/pom.xml b/clients/staking/pom.xml index 6a8c40452..52acd8003 100644 --- a/clients/staking/pom.xml +++ b/clients/staking/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-staking staking - 4.0.0 + 4.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.2.1 + 2.4.2 \ No newline at end of file diff --git a/clients/sub-account/CHANGELOG.md b/clients/sub-account/CHANGELOG.md index d50fdd4b1..b6b212a0e 100644 --- a/clients/sub-account/CHANGELOG.md +++ b/clients/sub-account/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 5.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 5.0.0 - 2026-02-12 ### Changed (2) diff --git a/clients/sub-account/pom.xml b/clients/sub-account/pom.xml index a103fec3a..17aeb0859 100644 --- a/clients/sub-account/pom.xml +++ b/clients/sub-account/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-sub-account sub-account - 5.0.0 + 5.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/vip-loan/CHANGELOG.md b/clients/vip-loan/CHANGELOG.md index 023067cce..4722f3f8f 100644 --- a/clients/vip-loan/CHANGELOG.md +++ b/clients/vip-loan/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 3.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 3.0.0 - 2026-02-12 ### Added (2) diff --git a/clients/vip-loan/pom.xml b/clients/vip-loan/pom.xml index 2a1c71a5e..f1ab48189 100644 --- a/clients/vip-loan/pom.xml +++ b/clients/vip-loan/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-vip-loan vip-loan - 3.0.0 + 3.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/clients/wallet/CHANGELOG.md b/clients/wallet/CHANGELOG.md index 8143c4d99..9e53d51b2 100644 --- a/clients/wallet/CHANGELOG.md +++ b/clients/wallet/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 4.0.1 - 2026-04-30 +- Update `binance/common` module to version `2.4.2`. + ## 4.0.0 - 2026-02-12 ### Added (3) diff --git a/clients/wallet/pom.xml b/clients/wallet/pom.xml index 41b6927e8..22dc53ee3 100644 --- a/clients/wallet/pom.xml +++ b/clients/wallet/pom.xml @@ -5,13 +5,13 @@ 4.0.0 binance-wallet wallet - 4.0.0 + 4.0.1 jar io.github.binance binance-connector-java-clients - 1.1.1 + 1.1.2 @@ -31,7 +31,7 @@ io.github.binance binance-common - 2.3.1 + 2.4.2 \ No newline at end of file diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java deleted file mode 100644 index 7503864fc..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AggregateTradeStreamsExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AggregateTradeStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class AggregateTradeStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Aggregate Trade Streams - * - *

The Aggregate Trade Streams push market trade information that is aggregated for fills - * with same price and taking side every 100 milliseconds. Only market trades will be - * aggregated, which means the insurance fund trades and ADL trades won't be aggregated. - * Retail Price Improvement(RPI) orders are aggregated into field `q` and without - * special tags to be distinguished. Update Speed: 100ms - * - * @throws ApiException if the Api call fails - */ - public void aggregateTradeStreamsExample() throws ApiException, InterruptedException { - AggregateTradeStreamsRequest aggregateTradeStreamsRequest = - new AggregateTradeStreamsRequest(); - aggregateTradeStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().aggregateTradeStreams(aggregateTradeStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java deleted file mode 100644 index db07a0253..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllBookTickersStreamExample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllBookTickersStreamResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class AllBookTickersStreamExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * All Book Tickers Stream - * - *

Pushes any update to the best bid or ask's price or quantity in real-time for all - * symbols. Retail Price Improvement(RPI) orders are not visible and excluded in the response - * message. Update Speed: 5s - * - * @throws ApiException if the Api call fails - */ - public void allBookTickersStreamExample() throws ApiException, InterruptedException { - AllBookTickersStreamRequest allBookTickersStreamRequest = new AllBookTickersStreamRequest(); - StreamBlockingQueueWrapper response = - getApi().allBookTickersStream(allBookTickersStreamRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketLiquidationOrderStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketLiquidationOrderStreamsExample.java deleted file mode 100644 index 9d4240433..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketLiquidationOrderStreamsExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketLiquidationOrderStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketLiquidationOrderStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class AllMarketLiquidationOrderStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * All Market Liquidation Order Streams - * - *

The All Liquidation Order Snapshot Streams push force liquidation order information for - * all symbols in the market. For each symbol,only the latest one liquidation order within - * 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, - * no stream will be pushed. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - public void allMarketLiquidationOrderStreamsExample() - throws ApiException, InterruptedException { - AllMarketLiquidationOrderStreamsRequest allMarketLiquidationOrderStreamsRequest = - new AllMarketLiquidationOrderStreamsRequest(); - StreamBlockingQueueWrapper response = - getApi().allMarketLiquidationOrderStreams(allMarketLiquidationOrderStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketMiniTickersStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketMiniTickersStreamExample.java deleted file mode 100644 index dbc1a5919..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketMiniTickersStreamExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketMiniTickersStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketMiniTickersStreamResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class AllMarketMiniTickersStreamExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * All Market Mini Tickers Stream - * - *

24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics - * of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only - * tickers that have changed will be present in the array. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - public void allMarketMiniTickersStreamExample() throws ApiException, InterruptedException { - AllMarketMiniTickersStreamRequest allMarketMiniTickersStreamRequest = - new AllMarketMiniTickersStreamRequest(); - StreamBlockingQueueWrapper response = - getApi().allMarketMiniTickersStream(allMarketMiniTickersStreamRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketTickersStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketTickersStreamsExample.java deleted file mode 100644 index 8ad54ffd1..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/AllMarketTickersStreamsExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketTickersStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.AllMarketTickersStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class AllMarketTickersStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * All Market Tickers Streams - * - *

24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the - * UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers - * that have changed will be present in the array. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - public void allMarketTickersStreamsExample() throws ApiException, InterruptedException { - AllMarketTickersStreamsRequest allMarketTickersStreamsRequest = - new AllMarketTickersStreamsRequest(); - StreamBlockingQueueWrapper response = - getApi().allMarketTickersStreams(allMarketTickersStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/CompositeIndexSymbolInformationStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/CompositeIndexSymbolInformationStreamsExample.java deleted file mode 100644 index f08e465bc..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/CompositeIndexSymbolInformationStreamsExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.CompositeIndexSymbolInformationStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.CompositeIndexSymbolInformationStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class CompositeIndexSymbolInformationStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Composite Index Symbol Information Streams - * - *

Composite index information for index symbols pushed every second. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - public void compositeIndexSymbolInformationStreamsExample() - throws ApiException, InterruptedException { - CompositeIndexSymbolInformationStreamsRequest - compositeIndexSymbolInformationStreamsRequest = - new CompositeIndexSymbolInformationStreamsRequest(); - compositeIndexSymbolInformationStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().compositeIndexSymbolInformationStreams( - compositeIndexSymbolInformationStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContinuousContractKlineCandlestickStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContinuousContractKlineCandlestickStreamsExample.java deleted file mode 100644 index 96c05a5d2..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContinuousContractKlineCandlestickStreamsExample.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContinuousContractKlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContinuousContractKlineCandlestickStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class ContinuousContractKlineCandlestickStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Continuous Contract Kline/Candlestick Streams - * - *

Update Speed: 250ms - * - * @throws ApiException if the Api call fails - */ - public void continuousContractKlineCandlestickStreamsExample() - throws ApiException, InterruptedException { - ContinuousContractKlineCandlestickStreamsRequest - continuousContractKlineCandlestickStreamsRequest = - new ContinuousContractKlineCandlestickStreamsRequest(); - continuousContractKlineCandlestickStreamsRequest.pair("btcusdt"); - continuousContractKlineCandlestickStreamsRequest.contractType("next_quarter"); - continuousContractKlineCandlestickStreamsRequest.interval("1m"); - StreamBlockingQueueWrapper response = - getApi().continuousContractKlineCandlestickStreams( - continuousContractKlineCandlestickStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContractInfoStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContractInfoStreamExample.java deleted file mode 100644 index f84e86ab6..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/ContractInfoStreamExample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContractInfoStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.ContractInfoStreamResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class ContractInfoStreamExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Contract Info Stream - * - *

ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket - * update). `bks` field only shows up when bracket gets updated. Update Speed: - * Real-time - * - * @throws ApiException if the Api call fails - */ - public void contractInfoStreamExample() throws ApiException, InterruptedException { - ContractInfoStreamRequest contractInfoStreamRequest = new ContractInfoStreamRequest(); - StreamBlockingQueueWrapper response = - getApi().contractInfoStream(contractInfoStreamRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java deleted file mode 100644 index 6d3eedcb9..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/DiffBookDepthStreamsExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.DiffBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.DiffBookDepthStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class DiffBookDepthStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Diff. Book Depth Streams - * - *

Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if - * existing) Retail Price Improvement(RPI) orders are not visible and excluded in the response - * message. Update Speed: 250ms, 500ms, 100ms - * - * @throws ApiException if the Api call fails - */ - public void diffBookDepthStreamsExample() throws ApiException, InterruptedException { - DiffBookDepthStreamsRequest diffBookDepthStreamsRequest = new DiffBookDepthStreamsRequest(); - diffBookDepthStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().diffBookDepthStreams(diffBookDepthStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java deleted file mode 100644 index 249e72cec..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolBookTickerStreamsExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolBookTickerStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolBookTickerStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class IndividualSymbolBookTickerStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Individual Symbol Book Ticker Streams - * - *

Pushes any update to the best bid or ask's price or quantity in real-time for a - * specified symbol. Retail Price Improvement(RPI) orders are not visible and excluded in the - * response message. Update Speed: Real-time - * - * @throws ApiException if the Api call fails - */ - public void individualSymbolBookTickerStreamsExample() - throws ApiException, InterruptedException { - IndividualSymbolBookTickerStreamsRequest individualSymbolBookTickerStreamsRequest = - new IndividualSymbolBookTickerStreamsRequest(); - individualSymbolBookTickerStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().individualSymbolBookTickerStreams( - individualSymbolBookTickerStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolMiniTickerStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolMiniTickerStreamExample.java deleted file mode 100644 index 2784eb80b..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolMiniTickerStreamExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolMiniTickerStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolMiniTickerStreamResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class IndividualSymbolMiniTickerStreamExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Individual Symbol Mini Ticker Stream - * - *

24hr rolling window mini-ticker statistics for a single symbol. These are NOT the - * statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Update - * Speed: 2s - * - * @throws ApiException if the Api call fails - */ - public void individualSymbolMiniTickerStreamExample() - throws ApiException, InterruptedException { - IndividualSymbolMiniTickerStreamRequest individualSymbolMiniTickerStreamRequest = - new IndividualSymbolMiniTickerStreamRequest(); - individualSymbolMiniTickerStreamRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().individualSymbolMiniTickerStream(individualSymbolMiniTickerStreamRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolTickerStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolTickerStreamsExample.java deleted file mode 100644 index 8f44f5275..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/IndividualSymbolTickerStreamsExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolTickerStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.IndividualSymbolTickerStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class IndividualSymbolTickerStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Individual Symbol Ticker Streams - * - *

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of - * the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Update Speed: 2000ms - * - * @throws ApiException if the Api call fails - */ - public void individualSymbolTickerStreamsExample() throws ApiException, InterruptedException { - IndividualSymbolTickerStreamsRequest individualSymbolTickerStreamsRequest = - new IndividualSymbolTickerStreamsRequest(); - individualSymbolTickerStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().individualSymbolTickerStreams(individualSymbolTickerStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java deleted file mode 100644 index 02e6ed93b..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/KlineCandlestickStreamsExample.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.KlineCandlestickStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.KlineCandlestickStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class KlineCandlestickStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Kline/Candlestick Streams - * - *

The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 - * milliseconds (if existing). Update Speed: 250ms - * - * @throws ApiException if the Api call fails - */ - public void klineCandlestickStreamsExample() throws ApiException, InterruptedException { - KlineCandlestickStreamsRequest klineCandlestickStreamsRequest = - new KlineCandlestickStreamsRequest(); - klineCandlestickStreamsRequest.symbol("btcusdt"); - klineCandlestickStreamsRequest.interval("1m"); - StreamBlockingQueueWrapper response = - getApi().klineCandlestickStreams(klineCandlestickStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/LiquidationOrderStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/LiquidationOrderStreamsExample.java deleted file mode 100644 index ec9b64f38..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/LiquidationOrderStreamsExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.LiquidationOrderStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.LiquidationOrderStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class LiquidationOrderStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Liquidation Order Streams - * - *

The Liquidation Order Snapshot Streams push force liquidation order information for - * specific symbol. For each symbol,only the latest one liquidation order within 1000ms will be - * pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will - * be pushed. Update Speed: 1000ms - * - * @throws ApiException if the Api call fails - */ - public void liquidationOrderStreamsExample() throws ApiException, InterruptedException { - LiquidationOrderStreamsRequest liquidationOrderStreamsRequest = - new LiquidationOrderStreamsRequest(); - liquidationOrderStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().liquidationOrderStreams(liquidationOrderStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamExample.java deleted file mode 100644 index d4201ec0c..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamExample.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class MarkPriceStreamExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Mark Price Stream - * - *

Mark price and funding rate for a single symbol pushed every 3 seconds or every second. - * Update Speed: 3000ms or 1000ms - * - * @throws ApiException if the Api call fails - */ - public void markPriceStreamExample() throws ApiException, InterruptedException { - MarkPriceStreamRequest markPriceStreamRequest = new MarkPriceStreamRequest(); - markPriceStreamRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().markPriceStream(markPriceStreamRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java deleted file mode 100644 index e4f421739..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MarkPriceStreamForAllMarketExample.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamForAllMarketRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MarkPriceStreamForAllMarketResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class MarkPriceStreamForAllMarketExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Mark Price Stream for All market - * - *

Mark price and funding rate for all symbols pushed every 3 seconds or every second. - * **Note**: TradFi symbols will be pushed through a seperate message. Update Speed: 3000ms or - * 1000ms - * - * @throws ApiException if the Api call fails - */ - public void markPriceStreamForAllMarketExample() throws ApiException, InterruptedException { - MarkPriceStreamForAllMarketRequest markPriceStreamForAllMarketRequest = - new MarkPriceStreamForAllMarketRequest(); - StreamBlockingQueueWrapper response = - getApi().markPriceStreamForAllMarket(markPriceStreamForAllMarketRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MultiAssetsModeAssetIndexExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MultiAssetsModeAssetIndexExample.java deleted file mode 100644 index 268b1f747..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/MultiAssetsModeAssetIndexExample.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.MultiAssetsModeAssetIndexResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class MultiAssetsModeAssetIndexExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Multi-Assets Mode Asset Index - * - *

Asset index for multi-assets mode user Update Speed: 1s - * - * @throws ApiException if the Api call fails - */ - public void multiAssetsModeAssetIndexExample() throws ApiException, InterruptedException { - MultiAssetsModeAssetIndexRequest multiAssetsModeAssetIndexRequest = - new MultiAssetsModeAssetIndexRequest(); - StreamBlockingQueueWrapper response = - getApi().multiAssetsModeAssetIndex(multiAssetsModeAssetIndexRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java deleted file mode 100644 index 4efdd4328..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/PartialBookDepthStreamsExample.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.PartialBookDepthStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class PartialBookDepthStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Partial Book Depth Streams - * - *

Top **<levels\\>** bids and asks, Valid **<levels\\>** are 5, 10, or 20. - * Retail Price Improvement(RPI) orders are not visible and excluded in the response message. - * Update Speed: 250ms, 500ms or 100ms - * - * @throws ApiException if the Api call fails - */ - public void partialBookDepthStreamsExample() throws ApiException, InterruptedException { - PartialBookDepthStreamsRequest partialBookDepthStreamsRequest = - new PartialBookDepthStreamsRequest(); - partialBookDepthStreamsRequest.symbol("btcusdt"); - partialBookDepthStreamsRequest.levels(10L); - StreamBlockingQueueWrapper response = - getApi().partialBookDepthStreams(partialBookDepthStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java deleted file mode 100644 index 19df770c0..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/RpiDiffBookDepthStreamsExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.RpiDiffBookDepthStreamsResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class RpiDiffBookDepthStreamsExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * RPI Diff. Book Depth Streams - * - *

Bids and asks including RPI orders, pushed every 500 milliseconds RPI(Retail Price - * Improvement) orders are included and aggreated in the response message. When the quantity of - * a price level to be updated is equal to 0, it means either all quotations for this price have - * been filled/canceled, or the quantity of crossed RPI orders for this price are hidden Update - * Speed: 500ms - * - * @throws ApiException if the Api call fails - */ - public void rpiDiffBookDepthStreamsExample() throws ApiException, InterruptedException { - RpiDiffBookDepthStreamsRequest rpiDiffBookDepthStreamsRequest = - new RpiDiffBookDepthStreamsRequest(); - rpiDiffBookDepthStreamsRequest.symbol("btcusdt"); - StreamBlockingQueueWrapper response = - getApi().rpiDiffBookDepthStreams(rpiDiffBookDepthStreamsRequest); - while (true) { - System.out.println(response.take()); - } - } -} diff --git a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java b/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java deleted file mode 100644 index eb0d433b8..000000000 --- a/examples/derivatives-trading-usds-futures/src/main/java/com/binance/connector/client/derivatives_trading_usds_futures/websocket/stream/websocketmarketstreams/TradingSessionStreamExample.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Binance Spot REST API - * OpenAPI Specifications for the Binance Spot REST API API documents: - [Github rest-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md) - [General API information for rest-api on website](https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-api-information) - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.websocketmarketstreams; - -import com.binance.connector.client.common.ApiException; -import com.binance.connector.client.common.websocket.configuration.WebSocketClientConfiguration; -import com.binance.connector.client.common.websocket.service.StreamBlockingQueueWrapper; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.DerivativesTradingUsdsFuturesWebSocketStreamsUtil; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.api.DerivativesTradingUsdsFuturesWebSocketStreams; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamRequest; -import com.binance.connector.client.derivatives_trading_usds_futures.websocket.stream.model.TradingSessionStreamResponse; - -/** API examples for WebsocketMarketStreamsApi */ -public class TradingSessionStreamExample { - private DerivativesTradingUsdsFuturesWebSocketStreams api; - - public DerivativesTradingUsdsFuturesWebSocketStreams getApi() { - if (api == null) { - WebSocketClientConfiguration clientConfiguration = - DerivativesTradingUsdsFuturesWebSocketStreamsUtil.getClientConfiguration(); - api = new DerivativesTradingUsdsFuturesWebSocketStreams(clientConfiguration); - } - return api; - } - - /** - * Trading Session Stream - * - *

Trading session information for the underlying assets of TradFi Perpetual - * contracts—covering the U.S. equity market and the commodity market—is updated every second. - * Trading session information for different underlying markets is pushed in separate messages. - * Session types for the equity market include \"PRE_MARKET\", \"REGULAR\", - * \"AFTER_MARKET\", \"OVERNIGHT\", and \"NO_TRADING\". Session - * types for the commodity market include \"REGULAR\" and \"NO_TRADING\". - * Update Speed: 1s - * - * @throws ApiException if the Api call fails - */ - public void tradingSessionStreamExample() throws ApiException, InterruptedException { - TradingSessionStreamRequest tradingSessionStreamRequest = new TradingSessionStreamRequest(); - StreamBlockingQueueWrapper response = - getApi().tradingSessionStream(tradingSessionStreamRequest); - while (true) { - System.out.println(response.take()); - } - } -}