diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c09c5a0..c8634d7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## 3.4.0 - 2024-10-02 +### Added +- New Margin endpoints: + - `POST /sapi/v1/margin/borrow-repay` + - `GET /sapi/v1/margin/borrow-repay` + +### Changed +- Updated `CryptoLoans` v1 to v2: + - `POST /sapi/v1/loan/flexible/borrow` to `POST /sapi/v2/loan/flexible/borrow` + - `GET /sapi/v1/loan/flexible/ongoing/orders` to `GET /sapi/v2/loan/flexible/ongoing/orders` + - `GET /sapi/v1/loan/flexible/borrow/history` to `GET /sapi/v2/loan/flexible/borrow/history` + - `POST /sapi/v1/loan/flexible/repay` to `POST /sapi/v2/loan/flexible/repay` + - `GET /sapi/v1/loan/flexible/repay/history` to `GET /sapi/v2/loan/flexible/repay/history` + - `POST /sapi/v1/loan/flexible/adjust/ltv` to `POST /sapi/v2/loan/flexible/adjust/ltv` + - `GET /sapi/v1/loan/flexible/ltv/adjustment/history` to `GET /sapi/v2/loan/flexible/ltv/adjustment/history` + - `GET /sapi/v1/loan/flexible/loanable/data` to `GET /sapi/v2/loan/flexible/loanable/data` + - `GET /sapi/v1/loan/flexible/collateral/data` to `GET /sapi/v2/loan/flexible/collateral/data` +- Added parameter `isolatedSymbol` to endpoint `GET /sapi/v1/margin/transfer` +- Added parameter `asset` to endpoint `GET /sapi/v1/margin/allAssets` +- Added parameter `symbol` to endpoints `GET /sapi/v1/margin/allPairs` and `GET /sapi/v1/margin/isolated/allPairs` + +### Removed +- Deprecated Futures endpoints: + - `POST /sapi/v1/futures/transfer` + - `GET /sapi/v1/futures/transfer` + - `GET /sapi/v1/futures/histDataLink` + +- BLVT endpoints: + - `GET /sapi/v1/blvt/tokenInfo` + - `POST /sapi/v1/blvt/subscribe` + - `GET /sapi/v1/blvt/subscribe/record` + - `POST /sapi/v1/blvt/redeem` + - `GET /sapi/v1/blvt/redeem/record` + - `GET /sapi/v1/blvt/userLimit` + +- Deprecated Trade endpoint: `POST /api/v3/order/oco` + +- Wallet endpoints: + - `POST /sapi/v1/asset/convert-transfer` + - `GET /sapi/v1/asset/convert-transfer/queryByPage` + - `GET /sapi/v1/capital/contract/convertible-coins` + - `POST /sapi/v1/capital/contract/convertible-coins` + ## 3.3.0 - 2024-06-19 ### Changed - Upgraded dependencies diff --git a/README.md b/README.md index bf80e2ed..86b0ca3a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ Additionally, it includes test cases and examples. [https://www.javadoc.io/doc/io.github.binance/binance-connector-java/latest/index.html](https://www.javadoc.io/doc/io.github.binance/binance-connector-java/latest/index.html) ## Getting Started -Copy and paste the following dependency snippet into your `pom.xml` file, replacing `LATEST_VERSION`` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available: +### Maven +Copy and paste the following dependency snippet into your `pom.xml` file, replacing `LATEST_VERSION` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available: ``` io.github.binance @@ -28,6 +29,18 @@ Copy and paste the following dependency snippet into your `pom.xml` file, replac ``` Next, install the dependency by executing `mvn install` in the directory where your `pom.xml` is located. +### Gradle +Copy and paste the following dependency snippet into your `build.gradle` file, replacing `LATEST_VERSION` with the most [recent version](https://mvnrepository.com/artifact/io.github.binance/binance-connector-java) available: +``` +implementation 'io.github.binance:binance-connector-java:LATEST_VERSION' +``` + +Make sure to add the Jitpack repository to the `repositories` section of your `build.gradle` file: +``` +maven { url 'https://jitpack.io' } +``` +Next, install the dependency by executing `gradle dependencies` in the directory where your `build.gradle` is located. + ## Examples The examples are located under **src/test/java/examples**. Before running any of it, `PrivateConfig.java` must be set up correctly with `API_KEY` and` SECRET_KEY` or `PRIVATE_KEY_PATH` (if using RSA Keys). diff --git a/pom.xml b/pom.xml index 367df3d9..d48044ec 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.binance binance-connector-java - 3.3.0 + 3.4.0 jar ${project.groupId}:${project.artifactId} lightweight connector to API diff --git a/src/main/java/com/binance/connector/client/SpotClient.java b/src/main/java/com/binance/connector/client/SpotClient.java index 508e49d7..2582aa63 100644 --- a/src/main/java/com/binance/connector/client/SpotClient.java +++ b/src/main/java/com/binance/connector/client/SpotClient.java @@ -1,12 +1,10 @@ package com.binance.connector.client; import com.binance.connector.client.impl.spot.AutoInvest; -import com.binance.connector.client.impl.spot.Blvt; import com.binance.connector.client.impl.spot.C2C; import com.binance.connector.client.impl.spot.Convert; import com.binance.connector.client.impl.spot.CryptoLoans; import com.binance.connector.client.impl.spot.Fiat; -import com.binance.connector.client.impl.spot.Futures; import com.binance.connector.client.impl.spot.GiftCard; import com.binance.connector.client.impl.spot.Margin; import com.binance.connector.client.impl.spot.Market; @@ -31,12 +29,10 @@ public interface SpotClient { void setProxy(ProxyAuth proxy); void unsetProxy(); AutoInvest createAutoInvest(); - Blvt createBlvt(); C2C createC2C(); Convert createConvert(); CryptoLoans createCryptoLoans(); Fiat createFiat(); - Futures createFutures(); GiftCard createGiftCard(); Market createMarket(); Margin createMargin(); diff --git a/src/main/java/com/binance/connector/client/impl/SpotClientImpl.java b/src/main/java/com/binance/connector/client/impl/SpotClientImpl.java index 78cff007..713a9c6f 100644 --- a/src/main/java/com/binance/connector/client/impl/SpotClientImpl.java +++ b/src/main/java/com/binance/connector/client/impl/SpotClientImpl.java @@ -3,12 +3,10 @@ import com.binance.connector.client.SpotClient; import com.binance.connector.client.enums.DefaultUrls; import com.binance.connector.client.impl.spot.AutoInvest; -import com.binance.connector.client.impl.spot.Blvt; import com.binance.connector.client.impl.spot.C2C; import com.binance.connector.client.impl.spot.Convert; import com.binance.connector.client.impl.spot.CryptoLoans; import com.binance.connector.client.impl.spot.Fiat; -import com.binance.connector.client.impl.spot.Futures; import com.binance.connector.client.impl.spot.GiftCard; import com.binance.connector.client.impl.spot.Margin; import com.binance.connector.client.impl.spot.Market; @@ -83,11 +81,6 @@ public AutoInvest createAutoInvest() { return new AutoInvest(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); } - @Override - public Blvt createBlvt() { - return new Blvt(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); - } - @Override public C2C createC2C() { return new C2C(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); @@ -108,11 +101,6 @@ public Fiat createFiat() { return new Fiat(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); } - @Override - public Futures createFutures() { - return new Futures(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); - } - @Override public GiftCard createGiftCard() { return new GiftCard(baseUrl, apiKey, signatureGenerator, showLimitUsage, proxy); } diff --git a/src/main/java/com/binance/connector/client/impl/WebSocketStreamClientImpl.java b/src/main/java/com/binance/connector/client/impl/WebSocketStreamClientImpl.java index d7587ced..cdcb94f0 100644 --- a/src/main/java/com/binance/connector/client/impl/WebSocketStreamClientImpl.java +++ b/src/main/java/com/binance/connector/client/impl/WebSocketStreamClientImpl.java @@ -28,8 +28,8 @@ /** *

WebSocket Streams

* All stream endpoints under the - * WebSocket Market Streams and - * User Data Streams + * WebSocket Market Streams and + * User Data Streams * section of the API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -61,8 +61,8 @@ public WebSocketStreamClientImpl(String baseUrl) { * * @param symbol Name of the trading pair * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#aggregate-trade-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#aggregate-trade-streams */ @Override public int aggTradeStream(String symbol, WebSocketMessageCallback callback) { @@ -96,8 +96,8 @@ public int aggTradeStream(String symbol, WebSocketOpenCallback onOpenCallback, W * * @param symbol Name of the trading pair * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#trade-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#trade-streams */ @Override public int tradeStream(String symbol, WebSocketMessageCallback callback) { @@ -132,8 +132,8 @@ public int tradeStream(String symbol, WebSocketOpenCallback onOpenCallback, WebS * @param symbol Name of the trading pair * @param interval Time interval for kline/candlestick * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#klinecandlestick-streams-for-utc */ @Override public int klineStream(String symbol, String interval, WebSocketMessageCallback callback) { @@ -169,8 +169,8 @@ public int klineStream(String symbol, String interval, WebSocketOpenCallback onO * * @param symbol Name of the trading pair * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-mini-ticker-stream */ @Override public int miniTickerStream(String symbol, WebSocketMessageCallback callback) { @@ -205,8 +205,8 @@ public int miniTickerStream(String symbol, WebSocketOpenCallback onOpenCallback, * Update Speed: Real-time * * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#all-market-mini-tickers-stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-mini-tickers-stream */ @Override public int allMiniTickerStream(WebSocketMessageCallback callback) { @@ -238,8 +238,8 @@ public int allMiniTickerStream(WebSocketOpenCallback onOpenCallback, WebSocketMe * * @param symbol Name of the trading pair * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-ticker-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-ticker-streams */ @Override public int symbolTicker(String symbol, WebSocketMessageCallback callback) { @@ -274,8 +274,8 @@ public int symbolTicker(String symbol, WebSocketOpenCallback onOpenCallback, Web * Update Speed: Real-time * * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#all-market-tickers-stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-tickers-stream */ @Override public int allTickerStream(WebSocketMessageCallback callback) { @@ -307,8 +307,8 @@ public int allTickerStream(WebSocketOpenCallback onOpenCallback, WebSocketMessag * @param symbol Name of the trading pair * @param windowSize Window Sizes: 1h,4h * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-rolling-window-statistics-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-rolling-window-statistics-streams */ public int rollingWindowTicker(String symbol, String windowSize, WebSocketMessageCallback callback) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -358,8 +358,8 @@ public int rollingWindowTicker(String symbol, String windowSize, WebSocketOpenCa * * @param windowSize Window Sizes: 1h,4h * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#all-market-rolling-window-statistics-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#all-market-rolling-window-statistics-streams */ @Override public int allRollingWindowTicker(String windowSize, WebSocketMessageCallback callback) { @@ -400,8 +400,8 @@ public int allRollingWindowTicker(String windowSize, WebSocketOpenCallback onOpe * * @param symbol Name of the trading pair * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-book-ticker-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#individual-symbol-book-ticker-streams */ @Override public int bookTicker(String symbol, WebSocketMessageCallback callback) { @@ -437,8 +437,8 @@ public int bookTicker(String symbol, WebSocketOpenCallback onOpenCallback, WebSo * @param levels Valid are 5, 10, or 20 * @param speed 1000ms or 100ms * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#partial-book-depth-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#partial-book-depth-streams */ @Override public int partialDepthStream(String symbol, int levels, int speed, WebSocketMessageCallback callback) { @@ -475,8 +475,8 @@ public int partialDepthStream(String symbol, int levels, int speed, WebSocketOpe * @param symbol Name of the trading pair * @param speed 1000ms or 100ms * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#diff-depth-stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#diff-depth-stream */ @Override public int diffDepthStream(String symbol, int speed, WebSocketMessageCallback callback) { @@ -506,10 +506,10 @@ public int diffDepthStream(String symbol, int speed, WebSocketOpenCallback onOpe * User Data Streams are accessed at /ws/<listenKey> * * @param listenKey listen key obtained from this - * endpoint + * endpoint * @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#user-data-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#start-user-data-stream-user_stream */ @Override public int listenUserStream(String listenKey, WebSocketMessageCallback callback) { @@ -520,7 +520,7 @@ public int listenUserStream(String listenKey, WebSocketMessageCallback callback) * Same as {@link #listenUserStream(String, WebSocketMessageCallback)} plus accepts callbacks for all major websocket connection events. * * @param listenKey listen key obtained from this - * endpoint + * endpoint * @param onOpenCallback Callback for when the websocket connection is opened * @param onMessageCallback Callback for when a message is received * @param onClosingCallback Callback for when the websocket connection is closing @@ -538,8 +538,8 @@ public int listenUserStream(String listenKey, WebSocketOpenCallback onOpenCallba * * @param streams ArrayList of stream names to be combined
* @return int - Connection ID - * @see - * https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams */ @Override public int combineStreams(ArrayList streams, WebSocketMessageCallback callback) { diff --git a/src/main/java/com/binance/connector/client/impl/spot/AutoInvest.java b/src/main/java/com/binance/connector/client/impl/spot/AutoInvest.java index 078eb915..b0d05adc 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/AutoInvest.java +++ b/src/main/java/com/binance/connector/client/impl/spot/AutoInvest.java @@ -12,7 +12,7 @@ /** *

Auto-Invest Endpoints

* All endpoints under the - * Auto-Invest Endpoints + * Auto-Invest Endpoints * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -47,8 +47,8 @@ public AutoInvest(String baseUrl, String apiKey, SignatureGenerator signatureGen * current -- optional/long -- Current querying page. Start from 1. Default:1
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-target-asset-list-user_data + * @see + * https://developers.binance.com/docs/auto_invest/market-data/Get-target-asset-list */ public String targetAssetList(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, TARGET_ASSET_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -69,8 +69,8 @@ public String targetAssetList(Map parameters) { * hisRoiType -- mandatory/enum -- FIVE_YEAR,THREE_YEAR,ONE_YEAR,SIX_MONTH,THREE_MONTH,SEVEN_DAY
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-target-asset-roi-data-user_data + * @see + * https://developers.binance.com/docs/auto_invest/market-data/Get-target-asset-ROI-data */ public String targetAssetRoiList(Map parameters) { ParameterChecker.checkParameter(parameters, "targetAsset", String.class); @@ -91,8 +91,8 @@ public String targetAssetRoiList(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-all-source-asset-and-target-asset-user_data + * @see + * https://developers.binance.com/docs/auto_invest/market-data/Query-all-source-asset-and-target-asset */ public String allSourceAndTargetAssets(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ALL_SOURCE_AND_TARGET_ASSETS, parameters, HttpMethod.GET, showLimitUsage); @@ -116,8 +116,8 @@ public String allSourceAndTargetAssets(Map parameters) { * sourceType -- optional/enum -- MAIN_SITE for Binance user,TR for Binance Turkey user
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-source-asset-list-user_data + * @see + * https://developers.binance.com/docs/auto_invest/market-data/Query-source-asset-list */ public String sourceAssetList(Map parameters) { ParameterChecker.checkParameter(parameters, "usageType", String.class); @@ -138,8 +138,8 @@ public String sourceAssetList(Map parameters) { * status -- mandatory/enum -- "ONGOING","PAUSED","REMOVED"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#change-plan-status-trade + * @see + * https://developers.binance.com/docs/auto_invest/trade/Change-Plan-Status */ public String changePlanStatus(Map parameters) { ParameterChecker.checkParameter(parameters, "planId", Long.class); @@ -160,8 +160,8 @@ public String changePlanStatus(Map parameters) { * planType -- mandatory/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-list-of-plans-user_data + * @see + * https://developers.binance.com/docs/auto_invest/market-data/Get-list-of-plans */ public String plansList(Map parameters) { ParameterChecker.checkParameter(parameters, "planType", String.class); @@ -183,8 +183,8 @@ public String plansList(Map parameters) { * requestId -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-holding-details-of-the-plan-user_data + * @see + * https://developers.binance.com/docs/auto_invest/trade/Query-holding-details-of-the-plan */ public String holdingPlan(Map parameters) { return requestHandler.sendPublicRequest(baseUrl, HOLDING_PLAN, parameters, HttpMethod.GET, showLimitUsage); @@ -210,8 +210,8 @@ public String holdingPlan(Map parameters) { * current -- optional/long -- Current querying page. Start from 1. Default:1
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-subscription-transaction-history-user_data + * @see + * https://developers.binance.com/docs/auto_invest/trade/Query-subscription-transaction-history */ public String planSubsHistory(Map parameters) { return requestHandler.sendPublicRequest(baseUrl, PLAN_SUBSCRIPTIONS_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -231,8 +231,8 @@ public String planSubsHistory(Map parameters) { * indexId -- mandatory/long
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-index-details-user_data + * @see + * https://developers.binance.com/docs/auto_invest/market-data/Query-Index-Details */ public String indexInfo(Map parameters) { ParameterChecker.checkParameter(parameters, "indexId", Long.class); @@ -253,8 +253,8 @@ public String indexInfo(Map parameters) { * indexId -- mandatory/long
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-index-linked-plan-position-details-user_data + * @see + * https://developers.binance.com/docs/auto_invest/trade/Query-Index-Linked-Plan-Position-Details */ public String userIndexPlans(Map parameters) { ParameterChecker.checkParameter(parameters, "indexId", Long.class); @@ -286,8 +286,8 @@ public String userIndexPlans(Map parameters) { * details[1].targetAsset=ETH, details[1].percentage=40
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#one-time-transaction-trade + * @see + * https://developers.binance.com/docs/auto_invest/trade/One-Time-Transaction */ public String submitOneTimeTransaction(Map parameters) { ParameterChecker.checkParameter(parameters, "sourceType", String.class); @@ -311,8 +311,8 @@ public String submitOneTimeTransaction(Map parameters) { * requestId -- optional/string -- transactionId and requestId cannot be empty at the same time
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-one-time-transaction-status-user_data + * @see + * https://developers.binance.com/docs/auto_invest/trade/Query-One-Time-Transaction-Status */ public String oneTimeTransactionStatus(Map parameters) { ParameterChecker.checkParameter(parameters, "transactionId", Long.class); @@ -335,8 +335,8 @@ public String oneTimeTransactionStatus(Map parameters) { * redemptionPercentage -- mandatory/long -- user redeem percentage,10/20/100.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#index-linked-plan-redemption-trade + * @see + * https://developers.binance.com/docs/auto_invest/trade/Index-Linked-Plan-Redemption */ public String redeemIndexPlan(Map parameters) { ParameterChecker.checkParameter(parameters, "indexId", Long.class); @@ -366,8 +366,8 @@ public String redeemIndexPlan(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#index-linked-plan-redemption-user_data + * @see + * https://developers.binance.com/docs/auto_invest/trade/Query-Index-Linked-Plan-Redemption */ public String indexPlanRedeemHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "requestId", Long.class); @@ -388,8 +388,8 @@ public String indexPlanRedeemHistory(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#index-linked-plan-rebalance-details-user_data + * @see + * https://developers.binance.com/docs/auto_invest/trade/Index-Linked-Plan-Rebalance-Details */ public String indexPlanRebalanceInfo(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, INDEX_LINKED_PLAN_REBALANCE_DETAILS, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Blvt.java b/src/main/java/com/binance/connector/client/impl/spot/Blvt.java deleted file mode 100644 index 64ad8217..00000000 --- a/src/main/java/com/binance/connector/client/impl/spot/Blvt.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.binance.connector.client.impl.spot; - -import java.util.Map; - -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.utils.ParameterChecker; -import com.binance.connector.client.utils.ProxyAuth; -import com.binance.connector.client.utils.RequestHandler; -import com.binance.connector.client.utils.signaturegenerator.HmacSignatureGenerator; -import com.binance.connector.client.utils.signaturegenerator.SignatureGenerator; - -/** - *

BLVT Endpoints

- * All endpoints under the - * BLVT Endpoint - * section of the API documentation will be implemented in this class. - *
- * Response will be returned in String format. - */ -public class Blvt { - private final String baseUrl; - private final RequestHandler requestHandler; - private final boolean showLimitUsage; - - public Blvt(String baseUrl, String apiKey, String secretKey, boolean showLimitUsage, ProxyAuth proxy) { - this.baseUrl = baseUrl; - this.requestHandler = new RequestHandler(apiKey, new HmacSignatureGenerator(secretKey), proxy); - this.showLimitUsage = showLimitUsage; - } - - public Blvt(String baseUrl, String apiKey, SignatureGenerator signatureGenerator, boolean showLimitUsage, ProxyAuth proxy) { - this.baseUrl = baseUrl; - this.requestHandler = new RequestHandler(apiKey, signatureGenerator, proxy); - this.showLimitUsage = showLimitUsage; - } - - private final String BLVT_INFO = "/sapi/v1/blvt/tokenInfo"; - /** - * GET /sapi/v1/blvt/tokenInfo - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * tokenName -- optional/string -- BTCDOWN, BTCUP
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-blvt-info-market_data - */ - public String blvtInfo(Map parameters) { - return requestHandler.sendApiRequest(baseUrl, BLVT_INFO, parameters, HttpMethod.GET, showLimitUsage); - } - - private final String SUBSCRIBE = "/sapi/v1/blvt/subscribe"; - /** - * POST /sapi/v1/blvt/subscribe - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * tokenName -- mandatory/string -- BTCDOWN, BTCUP
- * cost -- mandatory/decimal -- spot balance
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#subscribe-blvt-user_data - */ - public String subscribe(Map parameters) { - ParameterChecker.checkParameter(parameters, "tokenName", String.class); - ParameterChecker.checkRequiredParameter(parameters, "cost"); - return requestHandler.sendSignedRequest(baseUrl, SUBSCRIBE, parameters, HttpMethod.POST, showLimitUsage); - } - - private final String SUBSCRIPTION_RECORD = "/sapi/v1/blvt/subscribe/record"; - /** - * GET /sapi/v1/blvt/subscribe/record - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * tokenName -- optional/string -- BTCDOWN, BTCUP
- * id -- optional/long
- * startTime -- optional/long
- * endTime -- optional/long
- * limit -- optional/int -- default 1000, max 1000
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-subscription-record-user_data - */ - public String subscriptionRecord(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, SUBSCRIPTION_RECORD, parameters, HttpMethod.GET, showLimitUsage); - } - - private final String REDEEM = "/sapi/v1/blvt/redeem"; - /** - * POST /sapi/v1/blvt/redeem - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * tokenName -- mandatory/string -- BTCDOWN, BTCUP
- * amount -- mandatory/decimal -- spot balance
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#redeem-blvt-user_data - */ - public String redeem(Map parameters) { - ParameterChecker.checkParameter(parameters, "tokenName", String.class); - ParameterChecker.checkRequiredParameter(parameters, "amount"); - return requestHandler.sendSignedRequest(baseUrl, REDEEM, parameters, HttpMethod.POST, showLimitUsage); - } - - private final String REDEEM_RECORD = "/sapi/v1/blvt/redeem/record"; - /** - * GET /sapi/v1/blvt/redeem/record - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * tokenName -- optional/string -- BTCDOWN, BTCUP
- * id -- optional/long
- * startTime -- optional/long
- * endTime -- optional/long
- * limit -- optional/int -- default 1000, max 1000
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-redemption-record-user_data - */ - public String redeemRecord(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, REDEEM_RECORD, parameters, HttpMethod.GET, showLimitUsage); - } - - private final String USER_LIMIT = "/sapi/v1/blvt/userLimit"; - /** - * GET /sapi/v1/blvt/userLimit - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * tokenName -- optional/string -- BTCDOWN, BTCUP
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-blvt-user-limit-info-user_data - */ - public String userLimit(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, USER_LIMIT, parameters, HttpMethod.GET, showLimitUsage); - } -} diff --git a/src/main/java/com/binance/connector/client/impl/spot/C2C.java b/src/main/java/com/binance/connector/client/impl/spot/C2C.java index 9ab13f26..1d210b1c 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/C2C.java +++ b/src/main/java/com/binance/connector/client/impl/spot/C2C.java @@ -12,7 +12,7 @@ /** *

C2C Endpoints

* All endpoints under the - * C2C Endpoint + * C2C Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -49,8 +49,8 @@ public C2C(String baseUrl, String apiKey, SignatureGenerator signatureGenerator, * rows -- optional/int -- default 100, max 500
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-c2c-trade-history-user_data + * @see + * https://developers.binance.com/docs/c2c/rest-api/Get-C2C-Trade-History */ public String listUserOrderHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "tradeType", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Convert.java b/src/main/java/com/binance/connector/client/impl/spot/Convert.java index 64deb3b8..b617839e 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Convert.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Convert.java @@ -12,7 +12,7 @@ /** *

Convert Endpoints

* All endpoints under the - * Convert Endpoint + * Convert Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -47,8 +47,8 @@ public Convert(String baseUrl, String apiKey, SignatureGenerator signatureGenera * limit -- optional/int -- Default 100, Max 1000
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-convert-trade-history-user_data + * @see + * https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History */ public String tradeFlow(Map parameters) { ParameterChecker.checkParameter(parameters, "startTime", Long.class); @@ -67,8 +67,8 @@ public String tradeFlow(Map parameters) { * fromAsset -- optional/string
* toAsset -- optional/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#list-all-convert-pairs + * @see + * https://developers.binance.com/docs/convert/market-data/List-all-convert-pairs */ public String exchangeInfo(Map parameters) { return requestHandler.sendPublicRequest(baseUrl, EXCHANGE_INFO, parameters, HttpMethod.GET, showLimitUsage); @@ -84,8 +84,8 @@ public String exchangeInfo(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-order-quantity-precision-per-asset-user_data + * @see + * https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset */ public String assetQuantityPrecision(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ASSET_QUANTITY_PRECISION, parameters, HttpMethod.GET, showLimitUsage); @@ -107,8 +107,8 @@ public String assetQuantityPrecision(Map parameters) { * validTime -- optional/string -- 10s, 30s, 1m, 2m, default 10s
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#send-quote-request-user_data + * @see + * https://developers.binance.com/docs/convert/trade/Send-quote-request */ public String quoteInquiry(Map parameters) { ParameterChecker.checkParameter(parameters, "fromAsset", String.class); @@ -127,8 +127,8 @@ public String quoteInquiry(Map parameters) { * quoteId -- mandatory/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#accept-quote-trade + * @see + * https://developers.binance.com/docs/convert/trade/Accept-Quote */ public String acceptQuote(Map parameters) { ParameterChecker.checkParameter(parameters, "quoteId", String.class); @@ -147,8 +147,8 @@ public String acceptQuote(Map parameters) { * quoteId -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#order-status-user_data + * @see + * https://developers.binance.com/docs/convert/trade/Order-Status */ public String orderStatus(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ORDER_STATUS, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/CryptoLoans.java b/src/main/java/com/binance/connector/client/impl/spot/CryptoLoans.java index 14797bb3..798b6f74 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/CryptoLoans.java +++ b/src/main/java/com/binance/connector/client/impl/spot/CryptoLoans.java @@ -12,7 +12,7 @@ /** *

Crypto Loans Endpoints

* All endpoints under the - * Crypto Loans Endpoint + * Crypto Loans Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -49,8 +49,8 @@ public CryptoLoans(String baseUrl, String apiKey, SignatureGenerator signatureGe * limit -- optional/int -- default 20, max 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-crypto-loans-income-history-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Get-Crypto-Loans-Income-History */ public String loanIncome(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", String.class); @@ -72,8 +72,8 @@ public String loanIncome(Map parameters) { * collateralAmount -- optional/decimal -- Mandatory when loanAmount is empty
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#borrow-crypto-loan-borrow-trade + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/trade/Crypto-Loan-Borrow */ public String loanBorrow(Map parameters) { ParameterChecker.checkParameter(parameters, "loanCoin", String.class); @@ -81,7 +81,7 @@ public String loanBorrow(Map parameters) { ParameterChecker.checkParameter(parameters, "loanTerm", Integer.class); return requestHandler.sendSignedRequest(baseUrl, LOAN_BORROW, parameters, HttpMethod.POST, showLimitUsage); } - + private final String LOAN_BORROW_HISTORY = "/sapi/v1/loan/borrow/history"; /** * GET /sapi/v1/loan/borrow/history @@ -99,8 +99,8 @@ public String loanBorrow(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#borrow-get-loan-borrow-history-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Borrow-History */ public String loanBorrowHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOAN_BORROW_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -121,8 +121,8 @@ public String loanBorrowHistory(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#borrow-get-loan-ongoing-orders-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Ongoing-Orders */ public String loanOngoingOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOAN_ONGOING_ORDERS, parameters, HttpMethod.GET, showLimitUsage); @@ -142,8 +142,8 @@ public String loanOngoingOrders(Map parameters) { * collateralReturn -- optional/boolean -- Default: TRUE. TRUE: Return extra collateral to spot account; FALSE: Keep extra collateral in the order
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#repay-crypto-loan-repay-trade + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/trade/Crypto-Loan-Repay */ public String loanRepay(Map parameters) { ParameterChecker.checkParameter(parameters, "orderId", Long.class); @@ -168,8 +168,8 @@ public String loanRepay(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#repay-get-loan-repayment-history-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Repayment-History */ public String loanRepayHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOAN_REPAY_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -188,15 +188,15 @@ public String loanRepayHistory(Map parameters) { * direction -- optional/enum -- "ADDITIONAL", "REDUCED"
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#adjust-ltv-crypto-loan-adjust-ltv-trade + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/trade/Crypto-Loan-Adjust-LTV */ public String loanAdjustLTV(Map parameters) { ParameterChecker.checkParameter(parameters, "orderId", Long.class); ParameterChecker.checkRequiredParameter(parameters, "amount"); return requestHandler.sendSignedRequest(baseUrl, LOAN_ADJUST_LTV, parameters, HttpMethod.POST, showLimitUsage); } - + private final String LOAN_ADJUST_LTV_HISTORY = "/sapi/v1/loan/ltv/adjustment/history"; /** * GET /sapi/v1/loan/ltv/adjustment/history @@ -214,8 +214,8 @@ public String loanAdjustLTV(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#adjust-ltv-crypto-loan-adjust-ltv-trade + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-LTV-Adjustment-History */ public String loanAdjustLTVHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOAN_ADJUST_LTV_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -233,8 +233,8 @@ public String loanAdjustLTVHistory(Map parameters) { * vipLevel -- optional/int -- Default: user's VIP level. In case there's specific configuration, send "-1"
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-loanable-assets-data-user_data + * @see + * https://developers.binance.com/docs/vip_loan/market-data/Get-Loanable-Assets-Data */ public String loanAssetsData(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOANABLE_ASSETS_DATA, parameters, HttpMethod.GET, showLimitUsage); @@ -252,8 +252,8 @@ public String loanAssetsData(Map parameters) { * vipLevel -- optional/int -- Default: user's VIP level. In case there's specific configuration, send "-1"
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-collateral-assets-data-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Get-Collateral-Assets-Data */ public String collateralAssetsData(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COLLATERAL_ASSETS_DATA, parameters, HttpMethod.GET, showLimitUsage); @@ -272,8 +272,8 @@ public String collateralAssetsData(Map parameters) { * repayAmount -- mandatory/decimal -- repay amount of loanCoin
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#check-collateral-repay-rate-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Check-Collateral-Repay-Rate */ public String collateralRepayRate(Map parameters) { ParameterChecker.checkParameter(parameters, "loanCoin", String.class); @@ -295,17 +295,17 @@ public String collateralRepayRate(Map parameters) { * marginCall -- mandatory/decimal
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#crypto-loan-customize-margin-call-trade + * @see + * https://developers.binance.com/docs/crypto_loan/stable-rate/trade/Crypto-Loan-Customize-Margin-Call */ public String customizeMarginCall(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "marginCall"); return requestHandler.sendSignedRequest(baseUrl, CUSTOMIZE_MARGIN_CALL, parameters, HttpMethod.POST, showLimitUsage); } - private final String FLEXIBLE_LOAN_BORROW = "/sapi/v1/loan/flexible/borrow"; + private final String FLEXIBLE_LOAN_BORROW_V2 = "/sapi/v2/loan/flexible/borrow"; /** - * POST /sapi/v1/loan/flexible/borrow + * POST /sapi/v2/loan/flexible/borrow *
* @param * parameters Map of String,Object pair @@ -317,18 +317,18 @@ public String customizeMarginCall(Map parameters) { * collateralAmount -- optional/decimal -- Mandatory when loanAmount is empty.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#borrow-flexible-loan-borrow-trade + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/trade */ public String flexibleLoanBorrow(Map parameters) { ParameterChecker.checkParameter(parameters, "loanCoin", String.class); ParameterChecker.checkParameter(parameters, "collateralCoin", String.class); - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_BORROW, parameters, HttpMethod.POST, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_BORROW_V2, parameters, HttpMethod.POST, showLimitUsage); } - private final String FLEXIBLE_LOAN_ONGOING_ORDERS = "/sapi/v1/loan/flexible/ongoing/orders"; + private final String FLEXIBLE_LOAN_ONGOING_ORDERS_V2 = "/sapi/v2/loan/flexible/ongoing/orders"; /** - * GET /sapi/v1/loan/flexible/ongoing/orders + * GET /sapi/v2/loan/flexible/ongoing/orders *
* @param * parameters Map of String,Object pair @@ -340,16 +340,16 @@ public String flexibleLoanBorrow(Map parameters) { * limit -- optional/long -- Default: 10; max: 100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#borrow-get-flexible-loan-ongoing-orders-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Ongoing-Orders */ public String flexibleLoanOngoingOrders(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_ONGOING_ORDERS, parameters, HttpMethod.GET, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_ONGOING_ORDERS_V2, parameters, HttpMethod.GET, showLimitUsage); } - private final String FLEXIBLE_LOAN_BORROW_HISTORY = "/sapi/v1/loan/flexible/borrow/history"; + private final String FLEXIBLE_LOAN_BORROW_HISTORY_V2 = "/sapi/v2/loan/flexible/borrow/history"; /** - * GET /sapi/v1/loan/flexible/borrow/history + * GET /sapi/v2/loan/flexible/borrow/history *
* @param * parameters Map of String,Object pair @@ -363,16 +363,16 @@ public String flexibleLoanOngoingOrders(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#borrow-get-flexible-loan-borrow-history-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Borrow-History */ public String flexibleLoanBorrowHistory(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_BORROW_HISTORY, parameters, HttpMethod.GET, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_BORROW_HISTORY_V2, parameters, HttpMethod.GET, showLimitUsage); } - private final String FLEXIBLE_LOAN_REPAY = "/sapi/v1/loan/flexible/repay"; + private final String FLEXIBLE_LOAN_REPAY_V2 = "/sapi/v2/loan/flexible/repay"; /** - * POST /sapi/v1/loan/flexible/repay + * POST /sapi/v2/loan/flexible/repay *
* @param * parameters Map of String,Object pair @@ -385,19 +385,19 @@ public String flexibleLoanBorrowHistory(Map parameters) { * fullRepayment -- optional/boolean -- Default: FALSE. TRUE: Full repayment; FALSE: Partial repayment, based on loanAmount.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#repay-flexible-loan-repay-trade + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Repay */ public String flexibleLoanRepay(Map parameters) { ParameterChecker.checkParameter(parameters, "loanCoin", String.class); ParameterChecker.checkParameter(parameters, "collateralCoin", String.class); ParameterChecker.checkRequiredParameter(parameters, "repayAmount"); - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_REPAY, parameters, HttpMethod.POST, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_REPAY_V2, parameters, HttpMethod.POST, showLimitUsage); } - private final String FLEXIBLE_LOAN_REPAY_HISTORY = "/sapi/v1/loan/flexible/repay/history"; + private final String FLEXIBLE_LOAN_REPAY_HISTORY_V2 = "/sapi/v2/loan/flexible/repay/history"; /** - * GET /sapi/v1/loan/flexible/repay/history + * GET /sapi/v2/loan/flexible/repay/history *
* @param * parameters Map of String,Object pair @@ -411,16 +411,16 @@ public String flexibleLoanRepay(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#repay-get-flexible-loan-repayment-history-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Repayment-History */ public String flexibleLoanRepayHistory(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_REPAY_HISTORY, parameters, HttpMethod.GET, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_REPAY_HISTORY_V2, parameters, HttpMethod.GET, showLimitUsage); } - private final String FLEXIBLE_LOAN_ADJUST_LTV = "/sapi/v1/loan/flexible/adjust/ltv"; + private final String FLEXIBLE_LOAN_ADJUST_LTV_V2 = "/sapi/v2/loan/flexible/adjust/ltv"; /** - * POST /sapi/v1/loan/flexible/adjust/ltv + * POST /sapi/v2/loan/flexible/adjust/ltv *
* @param * parameters Map of String,Object pair @@ -432,20 +432,20 @@ public String flexibleLoanRepayHistory(Map parameters) { * direction -- mandatory/enum -- "ADDITIONAL", "REDUCED"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#adjust-ltv-flexible-loan-adjust-ltv-trade + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Adjust-LTV */ public String flexibleLoanAdjustLtv(Map parameters) { ParameterChecker.checkParameter(parameters, "loanCoin", String.class); ParameterChecker.checkParameter(parameters, "collateralCoin", String.class); ParameterChecker.checkRequiredParameter(parameters, "adjustmentAmount"); ParameterChecker.checkParameter(parameters, "direction", String.class); - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_ADJUST_LTV, parameters, HttpMethod.POST, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_ADJUST_LTV_V2, parameters, HttpMethod.POST, showLimitUsage); } - private final String FLEXIBLE_LOAN_LTV_ADJUST_HISTORY = "/sapi/v1/loan/flexible/ltv/adjustment/history"; + private final String FLEXIBLE_LOAN_LTV_ADJUST_HISTORY_V2 = "/sapi/v2/loan/flexible/ltv/adjustment/history"; /** - * GET /sapi/v1/loan/flexible/ltv/adjustment/history + * GET /sapi/v2/loan/flexible/ltv/adjustment/history *
* @param * parameters Map of String,Object pair @@ -459,19 +459,19 @@ public String flexibleLoanAdjustLtv(Map parameters) { * limit -- optional/long -- Default: 10; max: 100;
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#adjust-ltv-get-flexible-loan-ltv-adjustment-history-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information */ public String flexibleLoanLtvAdjustHistory(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_LTV_ADJUST_HISTORY, parameters, HttpMethod.GET, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_LTV_ADJUST_HISTORY_V2, parameters, HttpMethod.GET, showLimitUsage); } - private final String FLEXIBLE_LOAN_ASSETS = "/sapi/v1/loan/flexible/loanable/data"; + private final String FLEXIBLE_LOAN_ASSETS_V2 = "/sapi/v2/loan/flexible/loanable/data"; /** * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value. * *

- * GET /sapi/v1/loan/flexible/loanable/data + * GET /sapi/v2/loan/flexible/loanable/data *
* @param * parameters Map of String,Object pair @@ -480,19 +480,19 @@ public String flexibleLoanLtvAdjustHistory(Map parameters) { * loanCoin -- optional/string -- Coin loaned
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-loan-assets-data-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Assets-Data */ public String flexibleLoanAssets(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_ASSETS, parameters, HttpMethod.GET, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_ASSETS_V2, parameters, HttpMethod.GET, showLimitUsage); } - private final String FLEXIBLE_LOAN_COLLATERAL_ASSETS = "/sapi/v1/loan/flexible/collateral/data"; + private final String FLEXIBLE_LOAN_COLLATERAL_ASSETS_V2 = "/sapi/v2/loan/flexible/collateral/data"; /** * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value. * *

- * GET /sapi/v1/loan/flexible/collateral/data + * GET /sapi/v2/loan/flexible/collateral/data *
* @param * parameters Map of String,Object pair @@ -501,10 +501,10 @@ public String flexibleLoanAssets(Map parameters) { * collateralCoin -- optional/string -- Coin used as collateral
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-loan-collateral-assets-data-user_data + * @see + * https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data */ public String flexibleLoanCollateralAssets(Map parameters) { - return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_COLLATERAL_ASSETS, parameters, HttpMethod.GET, showLimitUsage); + return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_LOAN_COLLATERAL_ASSETS_V2, parameters, HttpMethod.GET, showLimitUsage); } } diff --git a/src/main/java/com/binance/connector/client/impl/spot/Fiat.java b/src/main/java/com/binance/connector/client/impl/spot/Fiat.java index 18f72703..b1c4ce21 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Fiat.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Fiat.java @@ -12,7 +12,7 @@ /** *

Fiat Endpoints

* All endpoints under the - * Fiat Endpoint + * Fiat Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -49,8 +49,8 @@ public Fiat(String baseUrl, String apiKey, SignatureGenerator signatureGenerator * rows -- optional/int -- default 100, max 500
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-fiat-deposit-withdraw-history-user_data + * @see + * https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History */ public String orders(Map parameters) { ParameterChecker.checkParameter(parameters, "transactionType", String.class); @@ -72,8 +72,8 @@ public String orders(Map parameters) { * rows -- optional/int -- default 100, max 500
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-fiat-payments-history-user_data + * @see + * https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Payments-History */ public String payments(Map parameters) { ParameterChecker.checkParameter(parameters, "transactionType", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Futures.java b/src/main/java/com/binance/connector/client/impl/spot/Futures.java deleted file mode 100644 index 1c7a3a73..00000000 --- a/src/main/java/com/binance/connector/client/impl/spot/Futures.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.binance.connector.client.impl.spot; - -import java.util.Map; - -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.utils.ParameterChecker; -import com.binance.connector.client.utils.ProxyAuth; -import com.binance.connector.client.utils.RequestHandler; -import com.binance.connector.client.utils.signaturegenerator.HmacSignatureGenerator; -import com.binance.connector.client.utils.signaturegenerator.SignatureGenerator; - -/** - *

Futures Endpoints

- * All endpoints under the - * Futures Endpoint - * section of the API documentation will be implemented in this class. - *
- * Response will be returned in String format. - */ -public class Futures { - private final String baseUrl; - private final RequestHandler requestHandler; - private final boolean showLimitUsage; - - public Futures(String baseUrl, String apiKey, String secretKey, boolean showLimitUsage, ProxyAuth proxy) { - this.baseUrl = baseUrl; - this.requestHandler = new RequestHandler(apiKey, new HmacSignatureGenerator(secretKey), proxy); - this.showLimitUsage = showLimitUsage; - } - - public Futures(String baseUrl, String apiKey, SignatureGenerator signatureGenerator, boolean showLimitUsage, ProxyAuth proxy) { - this.baseUrl = baseUrl; - this.requestHandler = new RequestHandler(apiKey, signatureGenerator, proxy); - this.showLimitUsage = showLimitUsage; - } - - private final String FUTURES_TRANSFER = "/sapi/v1/futures/transfer"; - /** - * Execute transfer between spot account and futures account. - *

- * POST /sapi/v1/futures/transfer - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * asset -- mandatory/string -- The asset being transferred, e.g. USDT
- * amount -- mandatory/decimal -- The amount to be transferred
- * type -- mandatory/int -- 1: transfer from spot account to USDT-M futures account. - * 2: transfer from USDT-M futures account to spot account. - * 3: transfer from spot account to COIN-M futures account. - * 4: transfer from COIN-M futures account to spot account.
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#new-future-account-transfer-user_data - */ - public String futuresTransfer(Map parameters) { - ParameterChecker.checkParameter(parameters, "asset", String.class); - ParameterChecker.checkRequiredParameter(parameters, "amount"); - ParameterChecker.checkParameter(parameters, "type", Integer.class); - return requestHandler.sendSignedRequest(baseUrl, FUTURES_TRANSFER, parameters, HttpMethod.POST, showLimitUsage); - } - - /** - * GET /sapi/v1/futures/transfer - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * asset -- optional/string -- The asset being transferred, e.g. USDT
- * startTime -- mandatory/long
- * endTime -- optional/long
- * current -- optional/long -- Currently querying page. Start from 1. Default:1
- * size -- optional/long -- Default:10 Max:100
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-future-account-transaction-history-list-user_data - */ - public String futuresTransferHistory(Map parameters) { - ParameterChecker.checkParameter(parameters, "asset", String.class); - ParameterChecker.checkParameter(parameters, "startTime", Long.class); - return requestHandler.sendSignedRequest(baseUrl, FUTURES_TRANSFER, parameters, HttpMethod.GET, showLimitUsage); - } - - private final String HISTORICAL_DATA = "/sapi/v1/futures/histDataLink"; - /** - * GET /sapi/v1/futures/histDataLink - * - * - The span between startTime and endTime can't be more than 7 days - * - The downloand link will be valid for 1 day - * - Only VIP user can query this endpoint - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * symbol -- mandatory/string -- symbol name, e.g. BTCUSDT or BTCUSD_PERP
- * dataType -- mandatory/enum -- "T_DEPTH" for ticklevel orderbook data, "S_DEPTH" for orderbook snapshot data
- * startTime -- mandatory/long
- * endTime -- mandatory/long
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-future-ticklevel-orderbook-historical-data-download-link-user_data - */ - public String futuresOrderBookHistory(Map parameters) { - ParameterChecker.checkParameter(parameters, "symbol", String.class); - ParameterChecker.checkParameter(parameters, "dataType", String.class); - ParameterChecker.checkParameter(parameters, "startTime", Long.class); - ParameterChecker.checkParameter(parameters, "endTime", Long.class); - return requestHandler.sendSignedRequest(baseUrl, HISTORICAL_DATA, parameters, HttpMethod.GET, showLimitUsage); - } -} diff --git a/src/main/java/com/binance/connector/client/impl/spot/GiftCard.java b/src/main/java/com/binance/connector/client/impl/spot/GiftCard.java index 93a81a46..ad38eb5d 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/GiftCard.java +++ b/src/main/java/com/binance/connector/client/impl/spot/GiftCard.java @@ -12,7 +12,7 @@ /** *

Gift Card Endpoints

* All endpoints under the - * Gift Card Endpoint + * Gift Card Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -53,8 +53,8 @@ public GiftCard(String baseUrl, String apiKey, SignatureGenerator signatureGener * amount -- mandatory/double -- The amount of the coin
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#create-a-single-token-gift-card-user_data + * @see + * https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card */ public String createCode(Map parameters) { ParameterChecker.checkParameter(parameters, "token", String.class); @@ -82,8 +82,8 @@ public String createCode(Map parameters) { * To protect user data privacy, you may choose to transfer the user id in any desired format (max. 400 characters).
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#redeem-a-binance-gift-card-user_data + * @see + * https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card */ public String redeemCode(Map parameters) { ParameterChecker.checkParameter(parameters, "code", String.class); @@ -105,8 +105,8 @@ public String redeemCode(Map parameters) { * referenceNo -- mandatory/string -- reference number
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#verify-binance-gift-card-by-gift-card-number-user_data + * @see + * https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number */ public String verify(Map parameters) { ParameterChecker.checkParameter(parameters, "referenceNo", String.class); @@ -125,8 +125,8 @@ public String verify(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#fetch-rsa-public-key-user_data + * @see + * https://developers.binance.com/docs/gift_card/market-data/Fetch-RSA-Public-Key */ public String rsaPublicKey(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, RSA_PUB, parameters, HttpMethod.GET, showLimitUsage); @@ -157,8 +157,8 @@ public String rsaPublicKey(Map parameters) { * discount -- optional/double -- The discount rate, example 0.1
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#create-a-dual-token-gift-card-fixed-value-discount-feature-trade + * @see + * https://developers.binance.com/docs/gift_card/market-data/Create-a-dual-token-gift-card */ public String createDualTokensCode(Map parameters) { ParameterChecker.checkParameter(parameters, "baseToken", String.class); @@ -181,8 +181,8 @@ public String createDualTokensCode(Map parameters) { * baseToken -- mandatory/string -- The token you want to pay, example BUSD
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#fetch-token-limit-user_data + * @see + * https://developers.binance.com/docs/gift_card/market-data/Fetch-Token-Limit */ public String tokensLimit(Map parameters) { ParameterChecker.checkParameter(parameters, "baseToken", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Margin.java b/src/main/java/com/binance/connector/client/impl/spot/Margin.java index 3fca4d73..05292aaa 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Margin.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Margin.java @@ -12,7 +12,7 @@ /** *

Margin Endpoints

* All endpoints under the - * Margin Account/Trade Endpoint + * Margin Account/Trade Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -34,28 +34,86 @@ public Margin(String baseUrl, String apiKey, SignatureGenerator signatureGenerat this.showLimitUsage = showLimitUsage; } + private final String BORROW_REPAY = "/sapi/v1/margin/borrow-repay"; + /** + * POST /sapi/v1/margin/borrow-repay + *
+ * @param Map of String,Object pair + * where String is the name of the parameter and Object is the value of the param + *

+ * asset -- mandatory/string
+ * isIsolated -- mandatory/string - TRUE for Isolated Margin, FALSE for Cross Margin, Default FALSE
+ * symbol -- mandatory/string - Only for Isolated margin
+ * amount -- mandatory/string
+ * type -- mandatory/string - BORROW or REPAY
+ * recvWindow -- optional/long -- The value cannot be greater than 60000
+ * @return String + * @see + * https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay + */ + public String borrowRepay(Map parameters) { + ParameterChecker.checkParameter(parameters, "asset", String.class); + ParameterChecker.checkParameter(parameters, "isIsolated", String.class); + ParameterChecker.checkParameter(parameters, "symbol", String.class); + ParameterChecker.checkParameter(parameters, "amount", String.class); + ParameterChecker.checkParameter(parameters, "type", String.class); + return requestHandler.sendSignedRequest(baseUrl, BORROW_REPAY, parameters, HttpMethod.POST, showLimitUsage); + } + + /** + * GET /sapi/v1/margin/borrow-repay + *
+ * @param Map of String,Object pair + * where String is the name of the parameter and Object is the value of the param + *

+ * type -- mandatory/string - BORROW or REPAY
+ * asset -- optional/string
+ * isolatedSymbol -- optional/string - Symbol in Isolated Margin
+ * txId -- optional/long - tranId in POST /sapi/v1/margin/loan
+ * startTime -- optional/long
+ * endTime -- optional/long
+ * current -- optional/long - Current querying page. Start from 1. Default:1
+ * size -- optional/long - Default:10 Max:100
+ * recvWindow -- optional/long -- The value cannot be greater than 60000
+ * @return String + * @see + * https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Borrow-Repay + */ + public String getBorrowRepay(Map parameters) { + ParameterChecker.checkParameter(parameters, "type", String.class); + return requestHandler.sendSignedRequest(baseUrl, BORROW_REPAY, parameters, HttpMethod.GET, showLimitUsage); + } + private final String ALL_ASSETS = "/sapi/v1/margin/allAssets"; /** * GET /sapi/v1/margin/allAssets *
+ * @param Map of String,Object pair + * where String is the name of the parameter and Object is the value of the param + *

+ * asset -- optional/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-all-margin-assets-market_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets */ - public String allAssets() { - return requestHandler.sendApiRequest(baseUrl, ALL_ASSETS, null, HttpMethod.GET, showLimitUsage); + public String allAssets(Map parameters) { + return requestHandler.sendApiRequest(baseUrl, ALL_ASSETS, parameters, HttpMethod.GET, showLimitUsage); } private final String ALL_PAIRS = "/sapi/v1/margin/allPairs"; /** * GET /sapi/v1/margin/allPairs *
+ * @param Map of String,Object pair + * where String is the name of the parameter and Object is the value of the param + *

+ * symbol -- optional/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-all-cross-margin-pairs-market_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs */ - public String allPairs() { - return requestHandler.sendApiRequest(baseUrl, ALL_PAIRS, null, HttpMethod.GET, showLimitUsage); + public String allPairs(Map parameters) { + return requestHandler.sendApiRequest(baseUrl, ALL_PAIRS, parameters, HttpMethod.GET, showLimitUsage); } private final String PRICE_INDEX = "/sapi/v1/margin/priceIndex"; @@ -68,8 +126,8 @@ public String allPairs() { *

* symbol -- mandatory/string * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-priceindex-market_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Query-Margin-PriceIndex */ public String priceIndex(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -103,8 +161,8 @@ public String priceIndex(Map parameters) { * autoRepayAtCancel -- optional/boolean -- Only for when it's a MARGIN_BUY or AUTO_BORROW_REPAY. Default: true (debt generated by the order needs to be repaid after cancellation.)
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#margin-account-new-order-trade + * @see + * https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order */ public String newOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -129,8 +187,8 @@ public String newOrder(Map parameters) { * newClientOrderId -- optional/string -- Used to uniquely identify this cancel. Automatically generated by default.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-order-trade + * @see + * https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order */ public String cancelOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -152,8 +210,8 @@ public String cancelOrder(Map parameters) { * isIsolated -- optional/string -- for isolated margin or not, "TRUE", "FALSE, default "FALSE"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-all-open-orders-on-a-symbol-trade + * @see + * https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders */ public String cancelOpenOrders(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -174,42 +232,17 @@ public String cancelOpenOrders(Map parameters) { * endTime -- optional/long
* current -- optional/long -- Currently querying page. Start from 1. Default:1
* size -- optional/long -- Default:10 Max:100
+ * isolatedSymbol -- optional/string -- Symbol in Isolated Margin
* archived -- optional/string -- Default: false. Set to true for archived data from 6 months ago
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-cross-margin-transfer-history-user_data + * @see + * https://developers.binance.com/docs/margin_trading/transfer/Get-Cross-Margin-Transfer-History */ public String transferHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, TRANSFER_HISTORY, parameters, HttpMethod.GET, showLimitUsage); } - private final String REPAY_RECORD = "/sapi/v1/margin/repay"; - /** - * GET /sapi/v1/margin/repay - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * asset -- mandatory/string
- * isolatedSymbol -- optional/string
- * txId -- optional/long -- the tranId in POST /sapi/v1/margin/loan
- * startTime -- optional/long
- * endTime -- optional/long
- * current -- optional/long -- Currently querying page. Start from 1. Default:1
- * size -- optional/long -- Default:10 Max:100
- * archived -- optional/string -- Default: false. Set to true for archived data from 6 months ago
- * recvWindow -- optional/long -- The value cannot be greater than 60000
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-repay-record-user_data - */ - public String repayRecord(Map parameters) { - ParameterChecker.checkParameter(parameters, "asset", String.class); - return requestHandler.sendSignedRequest(baseUrl, REPAY_RECORD, parameters, HttpMethod.GET, showLimitUsage); - } - private final String INTEREST_HISTORY = "/sapi/v1/margin/interestHistory"; /** * GET /sapi/v1/margin/interestHistory @@ -227,8 +260,8 @@ public String repayRecord(Map parameters) { * archived -- optional/string -- Default: false. Set to true for archived data from 6 months ago
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-interest-history-user_data + * @see + * https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History */ public String interestHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, INTEREST_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -249,8 +282,8 @@ public String interestHistory(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-force-liquidation-record-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record */ public String forceLiquidationRec(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, FORCE_LIQUIDATION_RECORD, parameters, HttpMethod.GET, showLimitUsage); @@ -266,8 +299,8 @@ public String forceLiquidationRec(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-cross-margin-account-details-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details */ public String account(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); @@ -286,8 +319,8 @@ public String account(Map parameters) { * origClientOrderId -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-order-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order */ public String getOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -304,8 +337,8 @@ public String getOrder(Map parameters) { * symbol -- optional/string
* isIsolated -- optional/string -- for isolated margin or not, "TRUE", "FALSE",default "FALSE"
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-orders-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders */ public String getOpenOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, OPEN_ORDERS, parameters, HttpMethod.GET, showLimitUsage); @@ -327,8 +360,8 @@ public String getOpenOrders(Map parameters) { * limit -- optional/int -- Default 500; max 500.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-orders-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders */ public String getAllOrders(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -364,8 +397,8 @@ public String getAllOrders(Map parameters) { * autoRepayAtCancel -- optional/boolean -- Only for when it's a MARGIN_BUY or AUTO_BORROW_REPAY. Default: true (debt generated by the order needs to be repaid after cancellation.)
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#margin-account-new-oco-trade + * @see + * https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-OCO */ public String ocoOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -393,8 +426,8 @@ public String ocoOrder(Map parameters) { * newClientOrderId -- optional/string -- Used to uniquely identify this cancel. Automatically generated by default
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#margin-account-cancel-oco-trade + * @see + * https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-OCO */ public String cancelOcoOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -416,8 +449,8 @@ public String cancelOcoOrder(Map parameters) { * listClientOrderId -- optional/string -- Either orderListId or listClientOrderId must be provided
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-oco-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-OCO */ public String getOcoOrder(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ORDER_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -441,8 +474,8 @@ public String getOcoOrder(Map parameters) { * limit -- optional/int -- Default Value: 500; Max Value: 1000
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-all-oco-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-OCO */ public String getAllOcoOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, GET_ALL_OCO, parameters, HttpMethod.GET, showLimitUsage); @@ -460,8 +493,8 @@ public String getAllOcoOrders(Map parameters) { * isIsolated -- optional/string -- for isolated margin or not, "TRUE", "FALSE", default "FALSE"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-open-oco-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-OCO */ public String getOcoOpenOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, GET_OPEN_OCO, parameters, HttpMethod.GET, showLimitUsage); @@ -483,8 +516,8 @@ public String getOcoOpenOrders(Map parameters) { * limit -- optional/int -- Default Value: 500; Max Value: 1000
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-account-39-s-trade-list-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List */ public String trades(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -503,8 +536,8 @@ public String trades(Map parameters) { * isIsolated -- optional/string -- for isolated margin or not, "TRUE", "FALSE,default "FALSE"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-max-borrow-user_data + * @see + * https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Max-Borrow */ public String maxBorrow(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", String.class); @@ -523,8 +556,8 @@ public String maxBorrow(Map parameters) { * isIsolated -- optional/string -- for isolated margin or not, "TRUE", "FALSE,default "FALSE"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-max-transfer-out-amount-user_data + * @see + * https://developers.binance.com/docs/margin_trading/transfer/Query-Max-Transfer-Out-Amount */ public String maxTransferable(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", String.class); @@ -542,8 +575,8 @@ public String maxTransferable(Map parameters) { * symbols -- optional/string -- Max 5 symbols can be sent; separated by ",". e.g. "BTCUSDT,BNBUSDT,ADAUSDT"
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-account-info-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info */ public String isolatedAccount(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ISOLATED_ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); @@ -559,8 +592,8 @@ public String isolatedAccount(Map parameters) { * symbol -- mandatory/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#disable-isolated-margin-account-trade + * @see + * https://developers.binance.com/docs/margin_trading/account/Disable-Isolated-Margin-Account */ public String disableIsolatedAccount(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -579,8 +612,8 @@ public String disableIsolatedAccount(Map parameters) { * symbol -- mandatory/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#enable-isolated-margin-account-trade + * @see + * https://developers.binance.com/docs/margin_trading/account/Enable-Isolated-Margin-Account */ public String enableIsolatedAccount(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -599,8 +632,8 @@ public String enableIsolatedAccount(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-enabled-isolated-margin-account-limit-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Query-Enabled-Isolated-Margin-Account-Limit */ public String getIsolatedAccountLimit(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ISOLATED_ACCOUNT_LIMIT, parameters, HttpMethod.GET, showLimitUsage); @@ -614,10 +647,11 @@ public String getIsolatedAccountLimit(Map parameters) { * parameters Map of String,Object pair * where String is the name of the parameter and Object is the value of the parameter *

+ * symbol -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-all-isolated-margin-symbol-user_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol */ public String getAllIsolatedSymbols(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ALL_ISOLATED_SYMBOL, parameters, HttpMethod.GET, showLimitUsage); @@ -635,8 +669,8 @@ public String getAllIsolatedSymbols(Map parameters) { * interestBNBBurn -- optional/string -- "true" or "false"; Determines whether to use BNB to pay for margin loan's interest
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#toggle-bnb-burn-on-spot-trade-and-margin-interest-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Toggle-BNB-Burn-On-Spot-Trade-And-Margin-Interest */ public String bnbBurn(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, BNB_BURN, parameters, HttpMethod.POST, showLimitUsage); @@ -651,8 +685,8 @@ public String bnbBurn(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-bnb-burn-status-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Get-BNB-Burn-Status */ public String getBnbBurn(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, BNB_BURN, parameters, HttpMethod.GET, showLimitUsage); @@ -672,8 +706,8 @@ public String getBnbBurn(Map parameters) { * endTime -- optional/long -- Default: present. Maximum range: 3 months.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-interest-rate-history-user_data + * @see + * https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History */ public String interestRateHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", String.class); @@ -694,8 +728,8 @@ public String interestRateHistory(Map parameters) { * coin -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-cross-margin-fee-data-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Fee-Data */ public String crossMarginData(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, CROSS_MARGIN_DATA, parameters, HttpMethod.GET, showLimitUsage); @@ -709,8 +743,8 @@ public String crossMarginData(Map parameters) { * GET /sapi/v1/margin/crossMarginCollateralRatio *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cross-margin-collateral-ratio-market_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Cross-margin-collateral-ratio */ public String crossMarginCollateralRatio() { return requestHandler.sendApiRequest(baseUrl, CROSS_MARGIN_COLLATERAL_RATIO, null, HttpMethod.GET, showLimitUsage); @@ -729,8 +763,8 @@ public String crossMarginCollateralRatio() { *

* maxLeverage -- mandatory/integer -- Can only adjust to 3, 5 or 10. Example: maxLeverage=10 for Cross Margin Pro, maxLeverage = 5 or 3 for Cross Margin Classic
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#adjust-cross-margin-max-leverage-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Adjust-Cross-Margin-Max-Leverage */ public String adjustCrossMarginMaxLeverage(Map parameters) { ParameterChecker.checkParameter(parameters, "maxLeverage", Integer.class); @@ -751,8 +785,8 @@ public String adjustCrossMarginMaxLeverage(Map parameters) { * symbol -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-fee-data-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data */ public String isolatedMarginData(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ISOLATED_MARGIN_DATA, parameters, HttpMethod.GET, showLimitUsage); @@ -772,8 +806,8 @@ public String isolatedMarginData(Map parameters) { * tier -- optional/string -- All margin tier data will be returned if tier is omitted
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-isolated-margin-tier-data-user_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Query-Isolated-Margin-Tier-Data */ public String isolatedMarginTier(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -794,8 +828,8 @@ public String isolatedMarginTier(Map parameters) { * symbol -- optional/string -- isolated symbol, mandatory for isolated margin
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-current-margin-order-count-usage-trade + * @see + * https://developers.binance.com/docs/margin_trading/trade/Query-Current-Margin-Order-Count-Usage */ public String orderRateLimit(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ORDER_RATE_LIMIT, parameters, HttpMethod.GET, showLimitUsage); @@ -814,8 +848,8 @@ public String orderRateLimit(Map parameters) { * type -- mandatory/string -- MARGIN, ISOLATED
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-margin-available-inventory-user_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Query-margin-avaliable-inventory */ public String availableInventory(Map parameters) { ParameterChecker.checkParameter(parameters, "type", String.class); @@ -842,8 +876,8 @@ public String availableInventory(Map parameters) { * limit -- optional/long -- The number of data items returned each time is limited. Default 500; Max 1000.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-cross-or-isolated-margin-capital-flow-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Query-Cross-Isolated-Margin-Capital-Flow */ public String capitalFlow(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, CAPITAL_FLOW, parameters, HttpMethod.GET, showLimitUsage); @@ -862,8 +896,8 @@ public String capitalFlow(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-tokens-or-symbols-delist-schedule-for-cross-margin-and-isolated-margin-market_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Get-Delist-Schedule */ public String delistSchedule(Map parameters) { return requestHandler.sendApiRequest(baseUrl, DELIST_SCHEDULE, parameters, HttpMethod.GET, showLimitUsage); @@ -883,8 +917,8 @@ public String delistSchedule(Map parameters) { * assets -- mandatory/string -- List of assets, separated by commas, up to 20
* isIsolated -- mandatory/boolean -- Whether it's for isolated margin or not: "TRUE", "FALSE"
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-a-future-hourly-interest-rate-user_data + * @see + * https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-a-future-hourly-interest-rate */ public String nextHourlyInterestRate(Map parameters) { ParameterChecker.checkParameter(parameters, "assets", String.class); @@ -905,8 +939,8 @@ public String nextHourlyInterestRate(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-small-liability-exchange-coin-list-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Get-Small-Liability-Exchange-Coin-List */ public String smallLiabilityAssets(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SMALL_LIABILITY_ASSETS, parameters, HttpMethod.GET, showLimitUsage); @@ -926,8 +960,8 @@ public String smallLiabilityAssets(Map parameters) { * assetNames - mandatory/array -- List of asset names. Example: assetNames = BTC,ETH
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#small-liability-exchange-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade/Small-Liability-Exchange */ public String exchangeSmallLiability(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "assetNames"); @@ -951,8 +985,8 @@ public String exchangeSmallLiability(Map parameters) { * endTime -- optional/long -- Default: present timestamp
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-small-liability-exchange-history-user_data + * @see + * https://developers.binance.com/docs/margin_trading/trade/Get-Small-Liability-Exchange-History */ public String smallLiabilityExchangeHistory(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "current"); @@ -968,8 +1002,8 @@ public String smallLiabilityExchangeHistory(Map parameters) { * GET /sapi/v1/margin/leverageBracket *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-liability-coin-leverage-bracket-in-cross-margin-pro-mode-market_data + * @see + * https://developers.binance.com/docs/margin_trading/market-data/Query-Liability-Coin-Leverage-Bracket-in-Cross-Margin-Pro-Mode */ public String leverageBracket() { return requestHandler.sendApiRequest(baseUrl, LEVERAGE_BRACKET, null, HttpMethod.GET, showLimitUsage); @@ -989,8 +1023,8 @@ public String leverageBracket() { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-margin-account-user_data + * @see + * https://developers.binance.com/docs/margin_trading/account/Get-Summary-Of-Margin-Account */ public String tradeCoeff(Map parameters) { return requestHandler.sendApiRequest(baseUrl, TRADE_COEFF, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Market.java b/src/main/java/com/binance/connector/client/impl/spot/Market.java index e92fd43b..f81b8818 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Market.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Market.java @@ -13,7 +13,7 @@ /** *

Market Endpoints

* All endpoints under the - * Market Data Endpoint + * Market Data Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -35,8 +35,8 @@ public Market(String baseUrl, String apiKey, boolean showLimitUsage, ProxyAuth p * GET /api/v3/ping *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#test-connectivity + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-connectivity */ public String ping() { return requestHandler.sendPublicRequest(baseUrl, PING, null, HttpMethod.GET, showLimitUsage); @@ -49,8 +49,8 @@ public String ping() { * GET /api/v3/time *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#check-server-time + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time */ public String time() { return requestHandler.sendPublicRequest(baseUrl, TIME, null, HttpMethod.GET, showLimitUsage); @@ -70,8 +70,8 @@ public String time() { * symbols -- optional/ArrayList
* permissions -- optional/ArrayList -- support single or multiple values (e.g. "SPOT", ["MARGIN","LEVERAGED"])
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#exchange-information + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information */ public String exchangeInfo(Map parameters) { if (parameters.containsKey("symbol") && parameters.containsKey("symbols")) { @@ -106,8 +106,8 @@ public String exchangeInfo(Map parameters) { * limit -- optional/integer -- limit the results * Default 100; max 5000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#order-book + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book */ public String depth(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -127,8 +127,8 @@ public String depth(Map parameters) { * symbol -- mandatory/string
* limit -- optional/integer -- limit the results Default 500; max 1000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#recent-trades-list + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list */ public String trades(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -149,8 +149,8 @@ public String trades(Map parameters) { * limit -- optional/integer -- limit the result Default 500; max 1000
* fromId -- optional/long -- trade id to fetch from. Default gets most recent trades
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#old-trade-lookup + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup * */ public String historicalTrades(Map parameters) { @@ -175,8 +175,8 @@ public String historicalTrades(Map parameters) { * endTime -- optional/long -- Timestamp in ms to get aggregate trades until INCLUSIVE
* limit -- optional/integer -- limit the results Default 500; max 1000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#compressed-aggregate-trades-list + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list */ public String aggTrades(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -201,8 +201,8 @@ public String aggTrades(Map parameters) { * timeZone -- optional/string -- Default:0 (UTC)
* limit -- optional/integer -- limit the results Default 500; max 1000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data */ public String klines(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -228,8 +228,8 @@ public String klines(Map parameters) { * timeZone -- optional/string -- Default:0 (UTC)
* limit -- optional/integer -- limit the results Default 500; max 1000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#uiklines + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#uiklines */ public String uiKlines(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -249,8 +249,8 @@ public String uiKlines(Map parameters) { *

* symbol -- mandatory/string -- the trading pair
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#current-average-price + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-average-price */ public String averagePrice(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -271,8 +271,8 @@ public String averagePrice(Map parameters) { * symbols -- optional/string
* type -- optional/enum -- Supported values: FULL or MINI. If none provided, the default is FULL
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics */ public String ticker24H(Map parameters) { if (parameters.containsKey("symbol") && parameters.containsKey("symbols")) { @@ -299,8 +299,8 @@ public String ticker24H(Map parameters) { * symbol -- optional/string -- the trading pair
* symbols -- optional/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#symbol-price-ticker + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker */ public String tickerSymbol(Map parameters) { if (parameters.containsKey("symbol") && parameters.containsKey("symbols")) { @@ -327,8 +327,8 @@ public String tickerSymbol(Map parameters) { * symbol -- optional/string -- the trading pair
* symbols -- optional/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#symbol-order-book-ticker + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker */ public String bookTicker(Map parameters) { if (parameters.containsKey("symbol") && parameters.containsKey("symbols")) { @@ -359,8 +359,8 @@ public String bookTicker(Map parameters) { * windowSize -- optional/enum -- Defaults to 1d if no parameter provided
* type -- optional/enum -- Supported values: FULL or MINI. If none provided, the default is FULL
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#rolling-window-price-change-statistics + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics */ public String ticker(Map parameters) { if (parameters.containsKey("symbol") && parameters.containsKey("symbols")) { @@ -392,8 +392,8 @@ public String ticker(Map parameters) { * timeZone -- optional/enum -- Default: 0 (UTC)
* type -- optional/enum -- Supported values: FULL or MINI. If none provided, the default is FULL
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#trading-day-ticker + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#trading-day-ticker */ public String tradingDayTicker(Map parameters) { if (parameters.containsKey("symbol") && parameters.containsKey("symbols")) { diff --git a/src/main/java/com/binance/connector/client/impl/spot/Mining.java b/src/main/java/com/binance/connector/client/impl/spot/Mining.java index 754d7328..f2785fd0 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Mining.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Mining.java @@ -12,7 +12,7 @@ /** *

Mining Endpoints

* All endpoints under the - * Mining Endpoint + * Mining Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -44,8 +44,8 @@ public Mining(String baseUrl, String apiKey, SignatureGenerator signatureGenerat *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#acquiring-algorithm-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Acquiring-Algorithm */ public String algorithm(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ALGO, parameters, HttpMethod.GET, showLimitUsage); @@ -61,8 +61,8 @@ public String algorithm(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#acquiring-coinname-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Acquiring-CoinName */ public String coinName(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COIN_NAME, parameters, HttpMethod.GET, showLimitUsage); @@ -81,8 +81,8 @@ public String coinName(Map parameters) { * workerName -- mandatory/string -- Miner's name(required)
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#request-for-detail-miner-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Request-for-Detail-Miner-List */ public String detailMinerList(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); @@ -112,8 +112,8 @@ public String detailMinerList(Map parameters) { * workerStatus -- optional/int -- miners status(default=0)0 all,1 valid,2 invalid,3 failure
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#request-for-miner-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Request-for-Miner-List */ public String minerList(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); @@ -138,8 +138,8 @@ public String minerList(Map parameters) { * pageSize -- optional/int -- Number of pages, minimum 10, maximum 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#earnings-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Earnings-List */ public String earningList(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); @@ -164,8 +164,8 @@ public String earningList(Map parameters) { * pageSize -- optional/int -- Number of pages, minimum 10, maximum 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#extra-bonus-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Extra-Bonus-List */ public String bonusList(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); @@ -185,8 +185,8 @@ public String bonusList(Map parameters) { * pageSize -- optional/int -- Number of pages, minimum 10, maximum 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#hashrate-resale-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Hashrate-Resale-List */ public String hashrateResaleList(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, HASHRATE_RESALE_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -206,8 +206,8 @@ public String hashrateResaleList(Map parameters) { * pageSize -- optional/int -- Number of pages, minimum 10, maximum 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#hashrate-resale-detail-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Hashrate-Resale-Detail */ public String hashrateResaleDetail(Map parameters) { ParameterChecker.checkParameter(parameters, "configId", Integer.class); @@ -231,8 +231,8 @@ public String hashrateResaleDetail(Map parameters) { * hashRate -- mandatory/long -- Resale hashrate h/s must be transferred (BTC is greater than 500000000000 ETH is greater than 500000)
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#hashrate-resale-request-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Hashrate-Resale-Request */ public String hashrateResaleRequest(Map parameters) { ParameterChecker.checkParameter(parameters, "userName", String.class); @@ -256,8 +256,8 @@ public String hashrateResaleRequest(Map parameters) { * userName -- mandatory/string -- Mining Account
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cancel-hashrate-resale-configuration-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Cancel-hashrate-resale-configuration */ public String cancelHashrateResaleConfig(Map parameters) { ParameterChecker.checkParameter(parameters, "configId", Integer.class); @@ -277,8 +277,8 @@ public String cancelHashrateResaleConfig(Map parameters) { * userName -- mandatory/string -- Mining Account
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#statistic-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Statistic-List */ public String statsticsList(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); @@ -298,8 +298,8 @@ public String statsticsList(Map parameters) { * userName -- mandatory/string -- Mining Account
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#account-list-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Account-List */ public String accountList(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); @@ -322,8 +322,8 @@ public String accountList(Map parameters) { * pageSize -- optional/int -- Min 10,Max 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#mining-account-earning-user_data + * @see + * https://developers.binance.com/docs/mining/rest-api/Mining-Account-Earning */ public String accountEarning(Map parameters) { ParameterChecker.checkParameter(parameters, "algo", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/NFT.java b/src/main/java/com/binance/connector/client/impl/spot/NFT.java index 719928e4..6d3ac41f 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/NFT.java +++ b/src/main/java/com/binance/connector/client/impl/spot/NFT.java @@ -12,7 +12,7 @@ /** *

NFT Endpoints

* All endpoints under the - * NFT Endpoint + * NFT Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -50,8 +50,8 @@ public NFT(String baseUrl, String apiKey, SignatureGenerator signatureGenerator, * page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-nft-transaction-history-user_data + * @see + * https://developers.binance.com/docs/nft/rest-api/Get-NFT-Transaction-History */ public String transactionsHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "orderType", Integer.class); @@ -72,8 +72,8 @@ public String transactionsHistory(Map parameters) { * page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-nft-deposit-history-user_data + * @see + * https://developers.binance.com/docs/nft/rest-api/Get-NFT-Deposit-History */ public String depositHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, DEPOSIT, parameters, HttpMethod.GET, showLimitUsage); @@ -93,8 +93,8 @@ public String depositHistory(Map parameters) { * page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-nft-withdraw-history-user_data + * @see + * https://developers.binance.com/docs/nft/rest-api/Get-NFT-Withdraw-History */ public String withdrawHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, WITHDRAW, parameters, HttpMethod.GET, showLimitUsage); @@ -112,8 +112,8 @@ public String withdrawHistory(Map parameters) { * page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-nft-asset-user_data + * @see + * https://developers.binance.com/docs/nft/rest-api/Get-NFT-Asset */ public String getAsset(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, GET_ASSET, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/PortfolioMargin.java b/src/main/java/com/binance/connector/client/impl/spot/PortfolioMargin.java index df28c0c7..d98c0d18 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/PortfolioMargin.java +++ b/src/main/java/com/binance/connector/client/impl/spot/PortfolioMargin.java @@ -12,7 +12,7 @@ /** *

Portfolio Margin Endpoints

* All endpoints under the - * Portfolio Margin Endpoints + * Portfolio Margin Endpoints * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -44,8 +44,8 @@ public PortfolioMargin(String baseUrl, String apiKey, SignatureGenerator signatu *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-classic-portfolio-margin-account-info-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info */ public String getAccount(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); @@ -63,8 +63,8 @@ public String getAccount(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#classic-portfolio-margin-collateral-rate-market_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate */ public String collateralRate(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COLLATERAL_RATE, parameters, HttpMethod.GET, showLimitUsage); @@ -82,8 +82,8 @@ public String collateralRate(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-classic-portfolio-margin-bankruptcy-loan-amount-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount */ public String bankruptcyLoanRecord(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, PM_LOAN, parameters, HttpMethod.GET, showLimitUsage); @@ -102,8 +102,8 @@ public String bankruptcyLoanRecord(Map parameters) { * from -- optional/string -- SPOT or MARGIN,default SPOT
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#classic-portfolio-margin-bankruptcy-loan-repay + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay */ public String repay(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, REPAY, parameters, HttpMethod.POST, showLimitUsage); @@ -126,8 +126,8 @@ public String repay(Map parameters) { * size -- optional/integer -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-classic-portfolio-margin-negative-balance-interest-history-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History */ public String interestHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, INTEREST_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -146,8 +146,8 @@ public String interestHistory(Map parameters) { *

* asset -- optional/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-portfolio-margin-asset-index-price-market_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Query-Portfolio-Margin-Asset-Index-Price */ public String assetIndexPrice(Map parameters) { return requestHandler.sendApiRequest(baseUrl, ASSET_INDEX_PRICE, parameters, HttpMethod.GET, showLimitUsage); @@ -168,8 +168,8 @@ public String assetIndexPrice(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#fund-auto-collection-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection */ public String autoCollection(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, AUTO_COLLECTION, parameters, HttpMethod.POST, showLimitUsage); @@ -190,8 +190,8 @@ public String autoCollection(Map parameters) { * asset -- mandatory/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#fund-collection-by-asset-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset */ public String assetCollection(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", String.class); @@ -213,8 +213,8 @@ public String assetCollection(Map parameters) { * amount -- mandatory/decimal
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#bnb-transfer-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer */ public String bnbTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "transferSide", String.class); @@ -236,8 +236,8 @@ public String bnbTransfer(Map parameters) { * autoRepay -- mandatory/boolean
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#change-auto-repay-futures-status-trade + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status */ public String switchAutoRepayFutures(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "autoRepay"); @@ -257,8 +257,8 @@ public String switchAutoRepayFutures(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-auto-repay-futures-status-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status#http-request */ public String autoRepayFuturesStatus(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, AUTO_REPAY_FUTURES_STATUS, parameters, HttpMethod.GET, showLimitUsage); @@ -277,8 +277,8 @@ public String autoRepayFuturesStatus(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#repay-futures-negative-balance-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance */ public String repayFutures(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, REPAY_FUTURES, parameters, HttpMethod.POST, showLimitUsage); @@ -289,8 +289,8 @@ public String repayFutures(Map parameters) { * GET /sapi/v1/portfolio/margin-asset-leverage *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-portfolio-margin-asset-leverage-user_data + * @see + * https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage */ public String assetLeverage() { return requestHandler.sendSignedRequest(baseUrl, ASSET_LEVERAGE, null, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Rebate.java b/src/main/java/com/binance/connector/client/impl/spot/Rebate.java index 57578019..6d2535b9 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Rebate.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Rebate.java @@ -11,7 +11,7 @@ /** *

Rebate Endpoints

* All endpoints under the - * Rebate Endpoint + * Rebate Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -46,8 +46,8 @@ public Rebate(String baseUrl, String apiKey, SignatureGenerator signatureGenerat * page -- optional/int -- Default 1
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-spot-rebate-history-records-user_data + * @see + * https://developers.binance.com/docs/rebate/rest-api/Get-Spot-Rebate-History-Records */ public String taxQuery(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, TAX_QUERY, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/SimpleEarn.java b/src/main/java/com/binance/connector/client/impl/spot/SimpleEarn.java index 3f698bb2..676a644c 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/SimpleEarn.java +++ b/src/main/java/com/binance/connector/client/impl/spot/SimpleEarn.java @@ -12,7 +12,7 @@ /** *

Simple Earn Endpoints

* All endpoints under the - * Simple Earn Endpoints + * Simple Earn Endpoints * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -49,8 +49,8 @@ public SimpleEarn(String baseUrl, String apiKey, SignatureGenerator signatureGen * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-simple-earn-flexible-product-list-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Flexible-Product-List */ public String flexibleProductList(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_PRODUCT_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -69,8 +69,8 @@ public String flexibleProductList(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-simple-earn-locked-product-list-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Locked-Product-List */ public String lockedProductList(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOCKED_PRODUCT_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -90,8 +90,8 @@ public String lockedProductList(Map parameters) { * sourceAccount -- optional/enum -- SPOT,FUND,ALL, default SPOT
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#subscribe-flexible-product-trade + * @see + * https://developers.binance.com/docs/simple_earn/earn/Subscribe-Flexible-Product */ public String subscribeFlexibleProduct(Map parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); @@ -113,8 +113,8 @@ public String subscribeFlexibleProduct(Map parameters) { * sourceAccount -- optional/enum -- SPOT,FUND,ALL, default SPOT
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#subscribe-locked-product-trade + * @see + * https://developers.binance.com/docs/simple_earn/earn/Subscribe-Locked-Product */ public String subscribeLockedProduct(Map parameters) { ParameterChecker.checkParameter(parameters, "projectId", String.class); @@ -136,8 +136,8 @@ public String subscribeLockedProduct(Map parameters) { * destAccount -- optional/enum -- SPOT,FUND,ALL, default SPOT
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#redeem-flexible-product-trade + * @see + * https://developers.binance.com/docs/simple_earn/earn/Redeem-Flexible-Product */ public String redeemFlexibleProduct(Map parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); @@ -155,8 +155,8 @@ public String redeemFlexibleProduct(Map parameters) { * positionId -- mandatory/string -- 1234
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#redeem-locked-product-trade + * @see + * https://developers.binance.com/docs/simple_earn/earn/Redeem-Locked-Product */ public String redeemLockedProduct(Map parameters) { ParameterChecker.checkParameter(parameters, "positionId", String.class); @@ -177,8 +177,8 @@ public String redeemLockedProduct(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-product-position-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Product-Position */ public String flexibleProductPosition(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_PRODUCT_POSITION, parameters, HttpMethod.GET, showLimitUsage); @@ -199,8 +199,8 @@ public String flexibleProductPosition(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-locked-product-position-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Get-Locked-Product-Position */ public String lockedProductPosition(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOCKED_PRODUCT_POSITION, parameters, HttpMethod.GET, showLimitUsage); @@ -216,8 +216,8 @@ public String lockedProductPosition(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#simple-account-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Simple-Account */ public String simpleAccount(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SIMPLE_ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); @@ -240,8 +240,8 @@ public String simpleAccount(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-subscription-record-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Subscription-Record */ public String flexibleSubscriptionRecord(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_SUBSCRIPTION_RECORD, parameters, HttpMethod.GET, showLimitUsage); @@ -263,8 +263,8 @@ public String flexibleSubscriptionRecord(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-locked-subscription-record-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Locked-Subscription-Record */ public String lockedSubscriptionRecord(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOCKED_SUBSCRIPTION_RECORD, parameters, HttpMethod.GET, showLimitUsage); @@ -286,8 +286,8 @@ public String lockedSubscriptionRecord(Map parameters) { * current -- optional/long -- Current querying page. Start from 1. Default:1
* size -- optional/long -- Default:10 Max:100
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-redemption-record-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Redemption-Record */ public String flexibleRedemptionRecord(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, FLEXIBLE_REDEMPTION_RECORD, parameters, HttpMethod.GET, showLimitUsage); @@ -310,8 +310,8 @@ public String flexibleRedemptionRecord(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-locked-redemption-record-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Locked-Redemption-Record */ public String lockedRedemptionRecord(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOCKED_REDEMPTION_RECORD, parameters, HttpMethod.GET, showLimitUsage); @@ -333,8 +333,8 @@ public String lockedRedemptionRecord(Map parameters) { * current -- optional/long -- Start from 1. Default:1
* size -- optional/long -- Default:10 Max:100
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-rewards-history-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Rewards-History */ public String flexibleRewardsHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "type", String.class); @@ -357,8 +357,8 @@ public String flexibleRewardsHistory(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-locked-rewards-history-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Locked-Rewards-History */ public String lockedRewardsHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOCKED_REWARDS_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -376,8 +376,8 @@ public String lockedRewardsHistory(Map parameters) { * autoSubscribe -- mandatory/boolean -- true or false
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#set-flexible-auto-subscribe-user_data + * @see + * https://developers.binance.com/docs/simple_earn/earn/Set-Flexible-Auto-Subscribe */ public String setFlexibleAutoSubscribe(Map parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); @@ -397,8 +397,8 @@ public String setFlexibleAutoSubscribe(Map parameters) { * autoSubscribe -- mandatory/boolean -- true or false
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#set-locked-auto-subscribe-user_data + * @see + * https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Auto-Subscribe */ public String setLockedAutoSubscribe(Map parameters) { ParameterChecker.checkParameter(parameters, "positionId", String.class); @@ -417,8 +417,8 @@ public String setLockedAutoSubscribe(Map parameters) { * productId -- mandatory/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-personal-left-quota-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Personal-Left-Quota */ public String flexiblePersonalLeftQuota(Map parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); @@ -436,8 +436,8 @@ public String flexiblePersonalLeftQuota(Map parameters) { * projectId -- mandatory/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-locked-personal-left-quota-user_data + * @see + * https://developers.binance.com/docs/simple_earn/account/Get-Locked-Personal-Left-Quota */ public String lockedPersonalLeftQuota(Map parameters) { ParameterChecker.checkParameter(parameters, "projectId", String.class); @@ -456,8 +456,8 @@ public String lockedPersonalLeftQuota(Map parameters) { * amount -- mandatory/decimal
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-flexible-subscription-preview-user_data + * @see + * https://developers.binance.com/docs/simple_earn/earn/Get-Flexible-Subscription-Preview */ public String flexibleSubscriptionPreview(Map parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); @@ -478,8 +478,8 @@ public String flexibleSubscriptionPreview(Map parameters) { * autoSubscribe -- optional/boolean -- true or false, default true.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-locked-subscription-preview-user_data + * @see + * https://developers.binance.com/docs/simple_earn/earn/Get-Locked-Subscription-Preview */ public String lockedSubscriptionPreview(Map parameters) { ParameterChecker.checkParameter(parameters, "projectId", String.class); @@ -502,8 +502,8 @@ public String lockedSubscriptionPreview(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-rate-history-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Rate-History */ public String rateHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "productId", String.class); @@ -525,8 +525,8 @@ public String rateHistory(Map parameters) { * size -- optional/long -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-collateral-record-user_data + * @see + * https://developers.binance.com/docs/simple_earn/history/Get-Collateral-Record */ public String collateralRecord(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COLLATERAL_RECORD, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/SpotAlgo.java b/src/main/java/com/binance/connector/client/impl/spot/SpotAlgo.java index 26bd378c..34f3fa53 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/SpotAlgo.java +++ b/src/main/java/com/binance/connector/client/impl/spot/SpotAlgo.java @@ -12,7 +12,7 @@ /** *

Spot Algo Endpoints

* All endpoints under the - * Spot Algo Endpoints + * Spot Algo Endpoints * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -54,8 +54,8 @@ public SpotAlgo(String baseUrl, String apiKey, SignatureGenerator signatureGener * stpMode -- optional/enum -- The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE * recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#time-weighted-average-price-twap-new-order-trade-2 + * @see + * https://developers.binance.com/docs/algo/spot-algo/Time-Weighted-Average-Price-New-Order */ public String twapOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -79,8 +79,8 @@ public String twapOrder(Map parameters) { * algoId -- mandatory/long
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cancel-algo-order-trade-2 + * @see + * https://developers.binance.com/docs/algo/spot-algo/Cancel-Algo-Order */ public String cancelOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "algoId", Long.class); @@ -100,8 +100,8 @@ public String cancelOrder(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-current-algo-open-orders-user_data-2 + * @see + * https://developers.binance.com/docs/algo/spot-algo/Query-Current-Algo-Open-Orders */ public String getOpenOrders(Map parameters) { return requestHandler.sendPublicRequest(baseUrl, OPEN_ORDERS, parameters, HttpMethod.GET, showLimitUsage); @@ -126,8 +126,8 @@ public String getOpenOrders(Map parameters) { * pageSize -- optional/int -- MIN 1, MAX 100; Default 100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-historical-algo-orders-user_data-2 + * @see + * https://developers.binance.com/docs/algo/spot-algo/Query-Historical-Algo-Orders */ public String getHistoricalOrders(Map parameters) { return requestHandler.sendPublicRequest(baseUrl, HISTORICAL_ORDERS, parameters, HttpMethod.GET, showLimitUsage); @@ -149,8 +149,8 @@ public String getHistoricalOrders(Map parameters) { * pageSize -- optional/int -- MIN 1, MAX 100; Default 100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-sub-orders-user_data-2 + * @see + * https://developers.binance.com/docs/algo/spot-algo/Query-Sub-Orders */ public String getSubOrders(Map parameters) { ParameterChecker.checkParameter(parameters, "algoId", Long.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Staking.java b/src/main/java/com/binance/connector/client/impl/spot/Staking.java index 337501b7..1326316f 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Staking.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Staking.java @@ -12,7 +12,7 @@ /** *

Staking Endpoints

* All endpoints under the - * Staking Endpoint + * Staking Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -48,8 +48,8 @@ public Staking(String baseUrl, String apiKey, SignatureGenerator signatureGenera * amount -- mandatory/decimal -- Amount in ETH, limit 4 decimals
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#subscribe-eth-staking-trade + * @see + * https://developers.binance.com/docs/staking/staking/Subscribe-ETH-Staking */ public String subEthStaking(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "amount"); @@ -71,8 +71,8 @@ public String subEthStaking(Map parameters) { * asset -- optional/string -- "BETH" or "WBETH", default "BETH"
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#redeem-eth-trade + * @see + * https://developers.binance.com/docs/staking/staking/Redeem-ETH */ public String redeemEthStaking(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "amount"); @@ -93,8 +93,8 @@ public String redeemEthStaking(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-eth-staking-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-ETH-staking-history */ public String ethStakingSubHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -114,8 +114,8 @@ public String ethStakingSubHistory(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-eth-redemption-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-ETH-redemption-history */ public String ethStakingRedeemHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_REDEEM_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -135,8 +135,8 @@ public String ethStakingRedeemHistory(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-beth-rewards-distribution-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-ETH-rewards-distribution-history */ public String ethStakingRewardsHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_REWARDS_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -152,8 +152,8 @@ public String ethStakingRewardsHistory(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-current-eth-staking-quota-user_data + * @see + * https://developers.binance.com/docs/staking/account/Get-current-ETH-staking-quota */ public String ethStakingQuota(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_QUOTA, parameters, HttpMethod.GET, showLimitUsage); @@ -173,8 +173,8 @@ public String ethStakingQuota(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-wbeth-rate-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-BETH-Rate-History */ public String ethStakingRateHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_RATE_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -190,8 +190,8 @@ public String ethStakingRateHistory(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#eth-staking-account-v2-user_data + * @see + * https://developers.binance.com/docs/staking/account/ETH-Staking-account */ public String ethStakingAccount(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); @@ -208,8 +208,8 @@ public String ethStakingAccount(Map parameters) { * amount -- mandatory/decimal -- Amount in BETH, limit 4 decimals
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#wrap-beth-trade + * @see + * https://developers.binance.com/docs/staking/staking/Wrap-BETH */ public String wrapEthStakingWbeth(Map parameters) { ParameterChecker.checkRequiredParameter(parameters, "amount"); @@ -230,8 +230,8 @@ public String wrapEthStakingWbeth(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-wbeth-wrap-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-WBETH-wrap-history */ public String ethStakingWbethWrapHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_WBETH_WRAP_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -251,8 +251,8 @@ public String ethStakingWbethWrapHistory(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-wbeth-unwrap-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-WBETH-unwrap-history */ public String ethStakingWbethUnwrapHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_WBETH_UNWRAP_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -272,8 +272,8 @@ public String ethStakingWbethUnwrapHistory(Map parameters) { * size -- optional/long -- Default: 10, Max: 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-wbeth-rewards-history-user_data + * @see + * https://developers.binance.com/docs/staking/history/Get-WBETH-rewards-history */ public String ethStakingWbethRewardHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ETH_STAKING_WBETH_REWARD_HISTORY, parameters, HttpMethod.GET, showLimitUsage); diff --git a/src/main/java/com/binance/connector/client/impl/spot/SubAccount.java b/src/main/java/com/binance/connector/client/impl/spot/SubAccount.java index fe7703d5..33b345de 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/SubAccount.java +++ b/src/main/java/com/binance/connector/client/impl/spot/SubAccount.java @@ -12,7 +12,7 @@ /** *

Sub-Account Endpoints

* All endpoints under the - * Sub-Account Endpoint + * Sub-Account Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -45,8 +45,8 @@ public SubAccount(String baseUrl, String apiKey, SignatureGenerator signatureGen * subAccountString -- mandatory/string -- Please input a string. We will create a virtual email using that string for you to register
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#create-a-virtual-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Create-a-Virtual-Sub-account */ public String createVirtualSubAccount(Map parameters) { ParameterChecker.checkParameter(parameters, "subAccountString", String.class); @@ -67,8 +67,8 @@ public String createVirtualSubAccount(Map parameters) { * limit -- optional/int -- Default value: 1, Max value: 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-list-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Query-Sub-account-List */ public String subAccountList(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, QUERY_SUB_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -90,8 +90,8 @@ public String subAccountList(Map parameters) { * limit -- optional/int -- Default value: 1, Max value: 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-spot-asset-transfer-history-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Asset-Transfer-History */ public String spotTransferHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, QUERY_SPOT_TRANSFER_HIST, parameters, HttpMethod.GET, showLimitUsage); @@ -113,8 +113,8 @@ public String spotTransferHistory(Map parameters) { * limit -- optional/int -- Default value: 1, Max value: 200
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-futures-asset-transfer-history-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Futures-Asset-Transfer-History */ public String getFuturesInternalTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -136,8 +136,8 @@ public String getFuturesInternalTransfer(Map parameters) { * amount -- mandatory/decimal
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#sub-account-futures-asset-transfer-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Futures-Asset-Transfer */ public String futuresInternalTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "fromEmail", String.class); @@ -161,8 +161,8 @@ public String futuresInternalTransfer(Map parameters) { * email -- mandatory/string -- Sub account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-assets-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Assets-V3 */ public String assets(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -184,8 +184,8 @@ public String assets(Map parameters) { * size -- optional/long -- default 10, max 20
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-sub-account-spot-assets-summary-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Assets-Summary */ public String spotAccountSummary(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SPOT_ASSET_SUMMARY, parameters, HttpMethod.GET, showLimitUsage); @@ -206,8 +206,8 @@ public String spotAccountSummary(Map parameters) { * network -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-deposit-address-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-Address */ public String depositAddress(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -234,8 +234,8 @@ public String depositAddress(Map parameters) { * offset -- optional/int -- default:0
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-deposit-history-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-History */ public String depositHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -253,8 +253,8 @@ public String depositHistory(Map parameters) { * email -- optional/string -- Sub account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-sub-account-39-s-status-on-margin-futures-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Get-Sub-accounts-Status-on-Margin-Or-Futures */ public String accountStatus(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SUB_ACC_STATUS, parameters, HttpMethod.GET, showLimitUsage); @@ -271,8 +271,8 @@ public String accountStatus(Map parameters) { * email -- mandatory/string -- Sub account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#enable-margin-for-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Enable-Margin-for-Sub-account */ public String enableMargin(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -290,8 +290,8 @@ public String enableMargin(Map parameters) { * email -- mandatory/string -- Sub account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-margin-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Margin-Account */ public String marginAccount(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -308,8 +308,8 @@ public String marginAccount(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-margin-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Margin-Account */ public String marginAccountSummary(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SUB_ACC_MARGIN_SUMMARY, parameters, HttpMethod.GET, showLimitUsage); @@ -326,8 +326,8 @@ public String marginAccountSummary(Map parameters) { * email -- mandatory/string -- Sub-account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#enable-futures-for-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Enable-Futures-for-Sub-account */ public String enableFutures(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -345,8 +345,8 @@ public String enableFutures(Map parameters) { * email -- mandatory/string -- Sub-account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-futures-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Futures-Account */ public String futuresAccount(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -363,8 +363,8 @@ public String futuresAccount(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-futures-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Futures-Account */ public String futuresAccountSummary(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SUB_ACC_FUTURES_SUMMARY, parameters, HttpMethod.GET, showLimitUsage); @@ -381,8 +381,8 @@ public String futuresAccountSummary(Map parameters) { * email -- mandatory/string -- Sub-Account email
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-futures-position-risk-of-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Get-Futures-Position-Risk-of-Sub-account */ public String futuresPositionRisk(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -405,8 +405,8 @@ public String futuresPositionRisk(Map parameters) { * 3: transfer from subaccount's spot account to its COIN-margined futures account * 4:transfer from subaccount's COIN-margined futures account to its spot account
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#futures-transfer-for-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Futures-Transfer-for-Sub-account */ public String futuresTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -430,8 +430,8 @@ public String futuresTransfer(Map parameters) { * type -- mandatory/int -- 1: transfer from subaccount's spot account to margin account * 2: transfer from subaccount's margin account to its spot account
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#margin-transfer-for-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Margin-Transfer-for-Sub-account */ public String marginTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -454,8 +454,8 @@ public String marginTransfer(Map parameters) { * amount -- mandatory/decimal -- The amount to be transferred
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#transfer-to-sub-account-of-same-master-for-sub-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Sub-account-of-Same-Master */ public String subAccountToSubAccount(Map parameters) { ParameterChecker.checkParameter(parameters, "toEmail", String.class); @@ -476,8 +476,8 @@ public String subAccountToSubAccount(Map parameters) { * amount -- mandatory/decimal -- The amount to be transferred
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#transfer-to-master-for-sub-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Master */ public String subAccountToMaster(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", String.class); @@ -500,8 +500,8 @@ public String subAccountToMaster(Map parameters) { * limit -- optional/int -- Default 500
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#sub-account-transfer-history-for-sub-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Transfer-History */ public String transferHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SUB_TRANSFER_HIST, parameters, HttpMethod.GET, showLimitUsage); @@ -524,8 +524,8 @@ public String transferHistory(Map parameters) { * amount -- mandatory/decimal
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#universal-transfer-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Universal-Transfer */ public String universalTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "fromAccountType", String.class); @@ -551,8 +551,8 @@ public String universalTransfer(Map parameters) { * limit -- optional/int -- Default 500, Max 500
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-universal-transfer-history-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Query-Universal-Transfer-History */ public String queryUniversalTransfer(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, SUB_UNIVERSAL_TRANSFER, parameters, HttpMethod.GET, showLimitUsage); @@ -570,8 +570,8 @@ public String queryUniversalTransfer(Map parameters) { * futuresType -- mandatory/int -- 1:USDT Margined Futures, 2:COIN Margined Futures
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-detail-on-sub-account-39-s-futures-account-v2-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Futures-Account-V2 */ public String futuresAccountV2(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -592,8 +592,8 @@ public String futuresAccountV2(Map parameters) { * limit -- optional/int -- default:10, max:20
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-summary-of-sub-account-39-s-futures-account-v2-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Futures-Account-V2 */ public String futuresAccountSummaryV2(Map parameters) { ParameterChecker.checkParameter(parameters, "futuresType", Integer.class); @@ -612,8 +612,8 @@ public String futuresAccountSummaryV2(Map parameters) { * futuresType -- mandatory/int -- 1:USDT Margined Futures, 2:COIN Margined Futures
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-futures-position-risk-of-sub-account-v2-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Get-Futures-Position-Risk-of-Sub-account-V2 */ public String futuresPositionRiskV2(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -633,8 +633,8 @@ public String futuresPositionRiskV2(Map parameters) { * enableBlvt -- mandatory/boolean -- Only true for now
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#enable-leverage-token-for-sub-account-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/account-management/Enable-Leverage-Token-for-Sub-account */ public String enableLeverageToken(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -654,8 +654,8 @@ public String enableLeverageToken(Map parameters) { * subAccountApiKey -- mandatory/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-ip-restriction-for-a-sub-account-api-key-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/api-management/Get-IP-Restriction-for-a-Sub-account-API-Key */ public String getIpRestriction(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -676,8 +676,8 @@ public String getIpRestriction(Map parameters) { * ipAddress -- optional/string -- Can be added in batches, separated by commas
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#delete-ip-list-for-a-sub-account-api-key-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/api-management/Delete-IP-List-For-a-Sub-account-API-Key */ public String deleteIpList(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -698,8 +698,8 @@ public String deleteIpList(Map parameters) { * amount -- mandatory/decimal
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#deposit-assets-into-the-managed-sub-account-for-investor-master-account + * @see + * https://developers.binance.com/docs/sub_account/managed-sub-account/Deposit-Assets-Into-The-Managed-Sub-account */ public String managedSubDeposit(Map parameters) { ParameterChecker.checkParameter(parameters, "toEmail", String.class); @@ -719,8 +719,8 @@ public String managedSubDeposit(Map parameters) { * email -- mandatory/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-managed-sub-account-asset-details-for-investor-master-account + * @see + * https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Asset-Details */ public String managedSubDetails(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -742,8 +742,8 @@ public String managedSubDetails(Map parameters) { * If a date is not selected, the withdrawal occurs right now
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#withdrawl-assets-from-the-managed-sub-account-for-investor-master-account + * @see + * https://developers.binance.com/docs/sub_account/managed-sub-account/Withdrawl-Assets-From-The-Managed-Sub-account */ public String managedSubWithdraw(Map parameters) { ParameterChecker.checkParameter(parameters, "fromEmail", String.class); @@ -767,8 +767,8 @@ public String managedSubWithdraw(Map parameters) { * limit -- int/long
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-managed-sub-account-snapshot-for-investor-master-account + * @see + * https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Snapshot */ public String managedSubAccountSnapshot(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); @@ -790,8 +790,8 @@ public String managedSubAccountSnapshot(Map parameters) { * ipAddress -- optional/string -- Insert static IP in batch, separated by commas.
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#add-ip-restriction-for-sub-account-api-key-for-master-account + * @see + * https://developers.binance.com/docs/sub_account/api-management/Add-IP-Restriction-for-Sub-Account-API-key */ public String updateIpRestriction(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Trade.java b/src/main/java/com/binance/connector/client/impl/spot/Trade.java index d4a6a769..ed2362e4 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Trade.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Trade.java @@ -12,7 +12,7 @@ /** *

Trade Endpoints

* All endpoints under the - * Spot Account/Trade Endpoint + * Spot Account/Trade Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -48,8 +48,8 @@ public Trade(String baseUrl, String apiKey, SignatureGenerator signatureGenerato * In addition to all parameters accepted by POST /api/v3/order, the following optional parameters are also accepted:
* computeCommissionRates -- optional/boolean -- Default: false
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#test-new-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade */ public String testNewOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -85,8 +85,8 @@ public String testNewOrder(Map parameters) { * selfTradePrevention -- optional/enum -- The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
s * recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#new-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade */ public String newOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -110,8 +110,8 @@ public String newOrder(Map parameters) { * newClientOrderId -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade */ public String cancelOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -132,8 +132,8 @@ public String cancelOrder(Map parameters) { * symbol -- mandatory/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cancel-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade */ public String cancelOpenOrders(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -154,8 +154,8 @@ public String cancelOpenOrders(Map parameters) { * origClientOrderId -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-order-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data */ public String getOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -196,8 +196,8 @@ public String getOrder(Map parameters) { * cancelRestrictions -- optional/enum -- Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED.
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cancel-an-existing-order-and-send-a-new-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade */ public String cancelReplace(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -219,8 +219,8 @@ public String cancelReplace(Map parameters) { * symbol -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#current-open-orders-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data */ public String getOpenOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ALL_OPEN_ORDERS, parameters, HttpMethod.GET, showLimitUsage); @@ -243,57 +243,14 @@ public String getOpenOrders(Map parameters) { * limit -- optional/int
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#all-orders-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data */ public String getOrders(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); return requestHandler.sendSignedRequest(baseUrl, ALL_ORDERS, parameters, HttpMethod.GET, showLimitUsage); } - private final String OCO_ORDER = "/api/v3/order/oco"; - /** - * Send in a new OCO. - *

- * POST /api/v3/order/oco - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * symbol -- mandatory/string
- * listClientOrderId -- optional/string
- * side -- mandatory/enum
- * quantity -- mandatory/decimal
- * limitClientOrderId -- optional/string
- * limitStrategyId -- optional/int
- * limitStrategyType -- optional/int
- * price -- mandatory/decimal
- * limitIcebergQty -- optional/decimal
- * trailingDelta -- optional/long
- * stopClientOrderId -- optional/string
- * stopPrice -- mandatory/decimal
- * stopStrategyId -- optional/int
- * stopStrategyType -- optional/int -- The value cannot be less than 1000000.
- * stopLimitPrice -- optional/decimal -- If provided, stopLimitTimeInForce is required.
- * stopIcebergQty -- optional/decimal
- * stopLimitTimeInForce -- optional/enum
- * newOrderRespType -- optional/enum
- * selfTradePreventionMode -- optional/enum -- The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#new-oco-trade - */ - public String ocoOrder(Map parameters) { - ParameterChecker.checkParameter(parameters, "symbol", String.class); - ParameterChecker.checkParameter(parameters, "side", String.class); - ParameterChecker.checkRequiredParameter(parameters, "quantity"); - ParameterChecker.checkRequiredParameter(parameters, "price"); - ParameterChecker.checkRequiredParameter(parameters, "stopPrice"); - return requestHandler.sendSignedRequest(baseUrl, OCO_ORDER, parameters, HttpMethod.POST, showLimitUsage); - } - private final String OCO_LIST = "/api/v3/orderList"; /** * Cancel an entire Order List. @@ -310,8 +267,8 @@ public String ocoOrder(Map parameters) { * newClientOrderId -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#cancel-oco-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-list-trade */ public String cancelOCO(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -331,8 +288,8 @@ public String cancelOCO(Map parameters) { * origClientOrderId -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-oco-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-lists-user_data */ public String getOCOOrder(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, OCO_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -354,8 +311,8 @@ public String getOCOOrder(Map parameters) { * limit -- optional/int
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-oco-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-all-order-lists-user_data */ public String getOCOOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ALL_OCO_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -371,8 +328,8 @@ public String getOCOOrders(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-open-oco-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-open-order-lists-user_data */ public String getOpenOCOOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ALL_OPEN_OCO_LIST, parameters, HttpMethod.GET, showLimitUsage); @@ -390,8 +347,8 @@ public String getOpenOCOOrders(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#account-information-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data */ public String account(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ACCOUNT_INFO, parameters, HttpMethod.GET, showLimitUsage); @@ -415,8 +372,8 @@ public String account(Map parameters) { * limit -- optional/int
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data */ public String myTrades(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -435,8 +392,8 @@ public String myTrades(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-current-order-count-usage-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-current-order-count-usage-trade */ public String rateLimitOrder(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, RATE_LIMIT, parameters, HttpMethod.GET, showLimitUsage); @@ -467,8 +424,8 @@ public String rateLimitOrder(Map parameters) { * limit -- optional/int -- Default 500; max 1000.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-prevented-matches-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-prevented-matches-user_data */ public String preventedMatches(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -506,8 +463,8 @@ public String preventedMatches(Map parameters) { * orderId -- optional/long -- Order id
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-allocations-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-allocations-user_data */ public String sorAllocations(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -526,8 +483,8 @@ public String sorAllocations(Map parameters) { *

* symbol -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-commission-rates-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-commission-rates-user_data */ public String commission(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -559,8 +516,8 @@ public String commission(Map parameters) { * selfTradePreventionMode -- optional/enum -- The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#new-order-using-sor-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api#new-order-using-sor-trade */ public String sorOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -584,8 +541,8 @@ public String sorOrder(Map parameters) { * In addition to all parameters accepted by POST /api/v3/sor/order, the following optional parameters are also accepted:
* computeCommissionRates -- optional/boolean -- Default: false
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#test-new-order-using-sor-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api#test-new-order-using-sor-trade */ public String testSorOrder(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/UserData.java b/src/main/java/com/binance/connector/client/impl/spot/UserData.java index 8c72a1b0..2e77c514 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/UserData.java +++ b/src/main/java/com/binance/connector/client/impl/spot/UserData.java @@ -9,9 +9,6 @@ /** *

User Data Streams Endpoints

- * All endpoints under the - * User Data Streams - * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. */ @@ -34,8 +31,8 @@ public UserData(String baseUrl, String apiKey, boolean showLimitUsage, ProxyAuth * POST /api/v3/userDataStream *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream#create-a-listenkey-user_stream */ public String createListenKey() { return requestHandler.sendApiRequest(baseUrl, SPOT_LISTEN_KEY, null, HttpMethod.POST, showLimitUsage); @@ -53,8 +50,8 @@ public String createListenKey() { *

* listenKey -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream#pingkeep-alive-a-listenkey-user_stream */ public String extendListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "listenKey", String.class); @@ -72,8 +69,8 @@ public String extendListenKey(Map parameters) { *

* listenKey -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-spot + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/user-data-stream#close-a-listenkey-user_stream */ public String closeListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "listenKey", String.class); @@ -85,8 +82,8 @@ public String closeListenKey(Map parameters) { * POST /sapi/v1/userDataStream *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Margin-User-Data-Stream */ public String createMarginListenKey() { return requestHandler.sendApiRequest(baseUrl, MARGIN_LISTEN_KEY, null, HttpMethod.POST, showLimitUsage); @@ -101,8 +98,8 @@ public String createMarginListenKey() { *

* listenKey -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Margin-User-Data-Stream */ public String extendMarginListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "listenKey", String.class); @@ -118,8 +115,8 @@ public String extendMarginListenKey(Map parameters) { *

* listenKey -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Margin-User-Data-Stream#http-request */ public String closeMarginListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "listenKey", String.class); @@ -136,8 +133,8 @@ public String closeMarginListenKey(Map parameters) { *

* symbol -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-isolated-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade-data-stream/Start-Isolated-Margin-User-Data-Stream */ public String createIsolatedMarginListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -154,8 +151,8 @@ public String createIsolatedMarginListenKey(Map parameters) { * symbol -- mandatory/string
* listenKey -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-isolated-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade-data-stream/Keepalive-Isolated-Margin-User-Data-Stream */ public String extendIsolatedMarginListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); @@ -173,8 +170,8 @@ public String extendIsolatedMarginListenKey(Map parameters) { * symbol -- mandatory/string
* listenKey -- mandatory/string
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#listen-key-isolated-margin + * @see + * https://developers.binance.com/docs/margin_trading/trade-data-stream/Close-Isolated-Margin-User-Data-Stream#http-request */ public String closeIsolatedMarginListenKey(Map parameters) { ParameterChecker.checkParameter(parameters, "symbol", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/VIPLoans.java b/src/main/java/com/binance/connector/client/impl/spot/VIPLoans.java index 44df4af4..86d852fe 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/VIPLoans.java +++ b/src/main/java/com/binance/connector/client/impl/spot/VIPLoans.java @@ -12,7 +12,7 @@ /** *

VIPLoans Endpoints

* All endpoints under the - * VIP Loans Endpoints + * VIP Loans Endpoints * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -53,8 +53,8 @@ public VIPLoans(String baseUrl, String apiKey, SignatureGenerator signatureGener * limit -- optional/long -- Default 10; max 100.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-vip-loan-ongoing-orders-user_data + * @see + * https://developers.binance.com/docs/vip_loan/user-information/Get-VIP-Loan-Ongoing-Orders */ public String ongoingOrders(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ONGOING_ORDERS, parameters, HttpMethod.GET, showLimitUsage); @@ -75,8 +75,8 @@ public String ongoingOrders(Map parameters) { * amount -- mandatory/decimal
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#vip-loan-repay-trade + * @see + * https://developers.binance.com/docs/vip_loan/trade/VIP-Loan-Repay */ public String repay(Map parameters) { ParameterChecker.checkParameter(parameters, "orderId", Long.class); @@ -103,8 +103,8 @@ public String repay(Map parameters) { * limit -- optional/long -- Default 10; max 100.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-vip-loan-repayment-history-user_data + * @see + * https://developers.binance.com/docs/vip_loan/user-information/Get-VIP-Loan-Repayment-History */ public String repaymentHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, REPAYMENT_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -125,8 +125,8 @@ public String repaymentHistory(Map parameters) { * loanTerm -- optional/int -- 30/60 days
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#vip-loan-renew-trade + * @see + * https://developers.binance.com/docs/vip_loan/trade/VIP-Loan-Renew */ public String renew(Map parameters) { ParameterChecker.checkParameter(parameters, "orderId", Long.class); @@ -148,8 +148,8 @@ public String renew(Map parameters) { * collateralAccountId -- optional/long
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#check-locked-value-of-vip-collateral-account-user_data + * @see + * https://developers.binance.com/docs/vip_loan/user-information/Check-Locked-Value-of-VIP-Collateral-Account */ public String collateralAccount(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COLLATERAL_ACCOUNT, parameters, HttpMethod.GET, showLimitUsage); @@ -175,8 +175,8 @@ public String collateralAccount(Map parameters) { * loanTerm -- optional/integer -- Mandatory for fixed rate. Optional for fixed interest rate. Eg: 30/60 days
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#vip-loan-borrow-trade + * @see + * https://developers.binance.com/docs/vip_loan/trade/VIP-Loan-Borrow */ public String borrow(Map parameters) { ParameterChecker.checkParameter(parameters, "loanAccountId", Long.class); @@ -203,8 +203,8 @@ public String borrow(Map parameters) { * vipLevel -- optional/integer -- Defaults to user's vip level
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-loanable-assets-data-user_data + * @see + * https://developers.binance.com/docs/vip_loan/market-data/Get-Loanable-Assets-Data */ public String loanableAssets(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, LOANABLE_ASSETS, parameters, HttpMethod.GET, showLimitUsage); @@ -224,8 +224,8 @@ public String loanableAssets(Map parameters) { * collateralCoin -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-collateral-asset-data-user_data + * @see + * https://developers.binance.com/docs/vip_loan/market-data/Get-Collateral-Asset-Data */ public String collateralAsset(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COLLATERAL_ASSET_DATA, parameters, HttpMethod.GET, showLimitUsage); @@ -246,8 +246,8 @@ public String collateralAsset(Map parameters) { * limit -- optional/long -- Default 10; max 100.
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-application-status-user_data + * @see + * https://developers.binance.com/docs/vip_loan/user-information/Query-Application-Status */ public String orderStatus(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ORDER_STATUS, parameters, HttpMethod.GET, showLimitUsage); @@ -267,8 +267,8 @@ public String orderStatus(Map parameters) { * loanCoin -- mandatory/string -- Max 10 assets, Multiple split by ","
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-borrow-interest-rate-user_data + * @see + * https://developers.binance.com/docs/vip_loan/market-data/Get-Borrow-Interest-Rate */ public String borrowInterestRate(Map parameters) { ParameterChecker.checkParameter(parameters, "loanCoin", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/spot/Wallet.java b/src/main/java/com/binance/connector/client/impl/spot/Wallet.java index c50ed8db..d779f46a 100644 --- a/src/main/java/com/binance/connector/client/impl/spot/Wallet.java +++ b/src/main/java/com/binance/connector/client/impl/spot/Wallet.java @@ -13,7 +13,7 @@ /** *

Wallet Endpoints

* All endpoints under the - * Wallet Endpoint + * Wallet Endpoint * section of the API documentation will be implemented in this class. *
* Response will be returned in String format. @@ -42,8 +42,8 @@ public Wallet(String baseUrl, String apiKey, SignatureGenerator signatureGenerat * GET /sapi/v1/system/status *
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#system-status-system + * @see + * https://developers.binance.com/docs/wallet/others/system-status */ public String systemStatus() { return requestHandler.sendPublicRequest(baseUrl, SYSTEM_STATUS, null, HttpMethod.GET, showLimitUsage); @@ -61,8 +61,8 @@ public String systemStatus() { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#all-coins-39-information-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/all-coins-info */ public String coinInfo(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, COIN_INFO, parameters, HttpMethod.GET, showLimitUsage); @@ -86,8 +86,8 @@ public String coinInfo(Map parameters) { * limit -- optional/int -- min 5, max 30, default 5
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#daily-account-snapshot-user_data + * @see + * https://developers.binance.com/docs/wallet/account/daily-account-snapshoot */ public String accountSnapshot(Map parameters) { ParameterChecker.checkParameter(parameters, "type", String.class); @@ -107,8 +107,8 @@ public String accountSnapshot(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#disable-fast-withdraw-switch-user_data + * @see + * https://developers.binance.com/docs/wallet/account/disable-fast-withdraw-switch */ public String disableFastWithdraw(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, DISABLE_FAST_WITHDRAW, parameters, HttpMethod.POST, showLimitUsage); @@ -127,8 +127,8 @@ public String disableFastWithdraw(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#enable-fast-withdraw-switch-user_data + * @see + * https://developers.binance.com/docs/wallet/account/enable-fast-withdraw-switch */ public String enableFastWithdraw(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ENABLE_FAST_WITHDRAW, parameters, HttpMethod.POST, showLimitUsage); @@ -159,8 +159,8 @@ public String enableFastWithdraw(Map parameters) { * walletType -- optional/int -- The wallet type for withdraw, 0-spot wallet , 1-funding wallet.Default spot wallet
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#withdraw-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/withdraw */ public String withdraw(Map parameters) { ParameterChecker.checkParameter(parameters, "coin", String.class); @@ -190,8 +190,8 @@ public String withdraw(Map parameters) { * limit -- optional/int -- Default:1000, Max:1000
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#deposit-history-supporting-network-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/deposite-history */ public String depositHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, DEPOSIT_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -224,8 +224,8 @@ public String depositHistory(Map parameters) { * limit -- optional/int -- Default:1000, Max:1000
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/withdraw-history */ public String withdrawHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, WITHDRAW_HISTORY, parameters, HttpMethod.GET, showLimitUsage); @@ -249,8 +249,8 @@ public String withdrawHistory(Map parameters) { * amount -- optional/decimal -- mandatory if using LIGHTNING network
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#deposit-address-supporting-network-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/deposite-address */ public String depositAddress(Map parameters) { ParameterChecker.checkParameter(parameters, "coin", String.class); @@ -274,8 +274,8 @@ public String depositAddress(Map parameters) { * network -- optional/string
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#fetch-deposit-address-list-with-network-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/fetch-deposit-address-list-with-network */ public String depositAddresses(Map parameters) { ParameterChecker.checkParameter(parameters, "coin", String.class); @@ -294,8 +294,8 @@ public String depositAddresses(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#account-status-user_data + * @see + * https://developers.binance.com/docs/wallet/account/account-status */ public String accountStatus(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ACCOUNT_STATUS, parameters, HttpMethod.GET, showLimitUsage); @@ -313,8 +313,8 @@ public String accountStatus(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#account-api-trading-status-user_data + * @see + * https://developers.binance.com/docs/wallet/account/account-api-trading-status */ public String apiTradingStatus(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, API_TRADE_STATUS, parameters, HttpMethod.GET, showLimitUsage); @@ -332,8 +332,8 @@ public String apiTradingStatus(Map parameters) { * endTime -- optional/long
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#dustlog-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/dust-log */ public String dustLog(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, DUST_LOG, parameters, HttpMethod.GET, showLimitUsage); @@ -349,8 +349,8 @@ public String dustLog(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-assets-that-can-be-converted-into-bnb-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/assets-can-convert-bnb */ public String bnbConvertableAssets(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, BNB_CONVERTIBLE_ASSETS, parameters, HttpMethod.POST, showLimitUsage); @@ -369,8 +369,8 @@ public String bnbConvertableAssets(Map parameters) { * asset -- mandatory/array -- The asset being converted. For example: asset=BTC&asset=USDT
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#dust-transfer-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/dust-transfer */ public String dustTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "asset", ArrayList.class); @@ -393,8 +393,8 @@ public String dustTransfer(Map parameters) { * limit -- optional/int -- Default 20, max 500
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#asset-dividend-record-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/assets-divided-record */ public String assetDividend(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ASSET_DIVIDEND, parameters, HttpMethod.GET, showLimitUsage); @@ -415,8 +415,8 @@ public String assetDividend(Map parameters) { * asset -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#asset-detail-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/asset-detail */ public String assetDetail(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, ASSET_DETAIL, parameters, HttpMethod.GET, showLimitUsage); @@ -435,8 +435,8 @@ public String assetDetail(Map parameters) { * symbol -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/trade-fee */ public String tradeFee(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, TRADE_FEE, parameters, HttpMethod.GET, showLimitUsage); @@ -459,8 +459,8 @@ public String tradeFee(Map parameters) { * toSymbol -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/user-universal-transfer */ public String universalTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "type", String.class); @@ -485,8 +485,8 @@ public String universalTransfer(Map parameters) { * toSymbol -- optional/string
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-user-universal-transfer-history-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer */ public String queryUniversalTransfer(Map parameters) { ParameterChecker.checkParameter(parameters, "type", String.class); @@ -505,8 +505,8 @@ public String queryUniversalTransfer(Map parameters) { * needBtcValuation -- optional/string -- true or false
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#funding-wallet-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/funding-wallet */ public String fundingWallet(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, FUNDING_WALLET, parameters, HttpMethod.POST, showLimitUsage); @@ -522,8 +522,8 @@ public String fundingWallet(Map parameters) { *

* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-api-key-permission-user_data + * @see + * https://developers.binance.com/docs/wallet/account/api-key-permission */ public String apiPermission(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, API_PERMISSION, parameters, HttpMethod.GET, showLimitUsage); @@ -543,75 +543,13 @@ public String apiPermission(Map parameters) { * needBtcValuation -- optional/boolean -- Whether need btc valuation or not.
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#user-asset-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/user-assets */ public String getUserAsset(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, USER_ASSET, parameters, HttpMethod.POST, showLimitUsage); } - private final String BUSD_CONVERT = "/sapi/v1/asset/convert-transfer"; - /** - * Convert transfer, convert between BUSD and stablecoins. - * - * - If the clientId has been used before, will not do the convert transfer, the original transfer will be returned. - *

- * POST /sapi/v1/asset/convert-transfer - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * clientTranId -- mandatory/string -- The unique user-defined transaction id, min length 20
- * asset -- mandatory/string -- The current asset
- * amount -- mandatory/BigDecimal -- The amount must be positive number
- * targetAsset -- mandatory/string -- Target asset you want to convert
- * accountType -- optional/string -- Only MAIN and CARD, default MAIN
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#busd-convert-trade - */ - public String busdConvert(Map parameters) { - ParameterChecker.checkParameter(parameters, "clientTranId", String.class); - ParameterChecker.checkParameter(parameters, "asset", String.class); - ParameterChecker.checkRequiredParameter(parameters, "amount"); - ParameterChecker.checkParameter(parameters, "targetAsset", String.class); - - return requestHandler.sendSignedRequest(baseUrl, BUSD_CONVERT, parameters, HttpMethod.POST, showLimitUsage); - } - - private final String BUSD_CONVERT_HISTORY = "/sapi/v1/asset/convert-transfer/queryByPage"; - /** - *

- * GET /sapi/v1/asset/convert-transfer/queryByPage - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * - * startTime -- mandatory/long -- inclusive, unit: ms
- * endTime -- mandatory/long -- exclusive, unit: ms
- * tranId -- optional/long -- The transaction id
- * clientTranId -- optional/string -- The unique user-defined transaction id
- * asset -- optional/string -- If not sent or null, deducted asset and target asset are returned.
- * accountType -- optional/string -- MAIN: main account. CARD: funding account. If not sent or null, spot and card wallet will be queried.
- * current -- optional/integer -- current page, default 1, the min value is 1
- * size -- optional/integer -- page size, default 10, the max value is 100
- * recvWindow -- optional/long
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#busd-convert-history-user_data - */ - public String busdConvertHistory(Map parameters) { - ParameterChecker.checkParameter(parameters, "startTime", Long.class); - ParameterChecker.checkParameter(parameters, "endTime", Long.class); - - return requestHandler.sendSignedRequest(baseUrl, BUSD_CONVERT_HISTORY, parameters, HttpMethod.GET, showLimitUsage); - } - - private final String CLOUD_MINING_HISTORY = "/sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage"; /** * The query of Cloud-Mining payment and refund history @@ -632,8 +570,8 @@ public String busdConvertHistory(Map parameters) { * size -- optional/integer -- page size, default 10, the max value is 100
* recvWindow -- optional/long
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#get-cloud-mining-payment-and-refund-history-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/cloud-mining-payment-and-refund-history */ public String cloudMiningHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "startTime", Long.class); @@ -642,43 +580,6 @@ public String cloudMiningHistory(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, CLOUD_MINING_HISTORY, parameters, HttpMethod.GET, showLimitUsage); } - private final String BUSD_AUTO_CONVERT = "/sapi/v1/capital/contract/convertible-coins"; - /** - * Get the stable coins set for auto-conversion to BUSD at deposit/withdrawal moments. - * - *

- * GET /sapi/v1/capital/contract/convertible-coins - *
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-auto-converting-stable-coins-user_data - */ - public String getBusdAutoConvertions() { - return requestHandler.sendSignedRequest(baseUrl, BUSD_AUTO_CONVERT, null, HttpMethod.GET, showLimitUsage); - } - - /** - * Switch on/off the BUSD auto-conversion from/to a specific stable coin. - * - *

- * POST /sapi/v1/capital/contract/convertible-coins - *
- * @param - * parameters Map of String,Object pair - * where String is the name of the parameter and Object is the value of the parameter - *

- * coin -- mandatory/string -- Must be USDC, USDP or TUSD
- * enable -- mandatory/boolean -- true: turn on the auto-conversion. false: turn off the auto-conversion
- * @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#switch-on-off-busd-and-stable-coins-conversion-user_data - */ - public String switchBusdAutoConversion(Map parameters) { - ParameterChecker.checkParameter(parameters, "coin", String.class); - ParameterChecker.checkParameter(parameters, "enable", Boolean.class); - return requestHandler.sendSignedRequest(baseUrl, BUSD_AUTO_CONVERT, parameters, HttpMethod.POST, showLimitUsage); - } - private final String APPLY_ONE_CLICK_ARRIVAL_DEPOSIT = "/sapi/v1/capital/deposit/credit-apply"; /** * Apply deposit credit for expired address (One click arrival) @@ -696,8 +597,8 @@ public String switchBusdAutoConversion(Map parameters) { * subUserId -- optional/long
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#one-click-arrival-deposit-apply-for-expired-address-deposit-user_data + * @see + * https://developers.binance.com/docs/wallet/capital/one-click-arrival-deposite-apply */ public String applyOneClickArrivalDeposit(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, APPLY_ONE_CLICK_ARRIVAL_DEPOSIT, parameters, HttpMethod.POST, showLimitUsage); @@ -716,8 +617,8 @@ public String applyOneClickArrivalDeposit(Map parameters) { *

* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-user-wallet-balance-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/query-user-wallet-balance */ public String walletBalance(Map parameters) { return requestHandler.sendSignedRequest(baseUrl, WALLET_BALANCE, parameters, HttpMethod.GET, showLimitUsage); @@ -745,8 +646,8 @@ public String walletBalance(Map parameters) { * size -- optional/integer -- Default:10 Max:100
* recvWindow -- optional/long -- The value cannot be greater than 60000
* @return String - * @see - * https://binance-docs.github.io/apidocs/spot/en/#query-user-delegation-history-for-master-account-user_data + * @see + * https://developers.binance.com/docs/wallet/asset/query-user-delegation */ public String delegationHistory(Map parameters) { ParameterChecker.checkParameter(parameters, "email", String.class); diff --git a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAccount.java b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAccount.java index 2788dcbe..79ed4ed9 100644 --- a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAccount.java +++ b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAccount.java @@ -9,7 +9,7 @@ /** *

Account Requests

* All requests under the - * Account requests + * Account requests * section of the WebSocket API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -30,8 +30,8 @@ public WebSocketApiAccount(WebSocketApiRequestHandler handler) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-information-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-information-user_data */ public void accountStatus(JSONObject parameters) { this.handler.signedRequest("account.status", parameters); @@ -45,8 +45,8 @@ public void accountStatus(JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-rate-limits-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-order-rate-limits-user_data */ public void accountRateLimitsOrders(JSONObject parameters) { this.handler.signedRequest("account.rateLimits.orders", parameters); @@ -67,8 +67,8 @@ public void accountRateLimitsOrders(JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-order-history-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-order-history-user_data */ public void accountAllOrders(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -91,8 +91,8 @@ public void accountAllOrders(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-oco-history-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api */ public void accountAllOcoOrders(JSONObject parameters) { this.handler.signedRequest("allOrderLists", parameters); @@ -112,8 +112,8 @@ public void accountAllOcoOrders(JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-trade-history-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-trade-history-user_data */ public void accountTradeHistory(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -135,8 +135,8 @@ public void accountTradeHistory(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-prevented-matches-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-prevented-matches-user_data */ public void accountPreventedMatches(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -161,8 +161,8 @@ public void accountPreventedMatches(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-allocations-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-allocations-user_data */ public void accountAllocations(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -179,8 +179,8 @@ public void accountAllocations(String symbol, JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#account-commission-rates-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#account-commission-rates-user_data */ public void accountCommissionRates(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); diff --git a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAuth.java b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAuth.java index e5b3198d..fc4a8f9b 100644 --- a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAuth.java +++ b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiAuth.java @@ -6,7 +6,7 @@ /** *

Authentication requests

* All requests under the - * Authentication requests + * Authentication requests * section of the WebSocket API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -29,8 +29,8 @@ public WebSocketApiAuth(WebSocketApiRequestHandler handler) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#log-in-with-api-key-signed + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#log-in-with-api-key-signed */ public void logon(JSONObject parameters) { this.handler.signedRequest("session.logon", parameters); @@ -44,8 +44,8 @@ public void logon(JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#query-session-status + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-session-status */ public void status(JSONObject parameters) { this.handler.publicRequest("session.status", parameters); @@ -62,8 +62,8 @@ public void status(JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#log-out-of-the-session + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#log-out-of-the-session */ public void logout(JSONObject parameters) { this.handler.publicRequest("session.logout", parameters); diff --git a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiGeneral.java b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiGeneral.java index 5710adca..d7a216f7 100644 --- a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiGeneral.java +++ b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiGeneral.java @@ -8,7 +8,7 @@ /** *

General Requests

* All requests under the - * General requests + * General requests * section of the WebSocket API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -30,8 +30,8 @@ public WebSocketApiGeneral(WebSocketApiRequestHandler handler) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#test-connectivity + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#test-connectivity */ public void ping(JSONObject parameters) { this.handler.publicRequest("ping", parameters); @@ -44,8 +44,8 @@ public void ping(JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#check-server-time + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#check-server-time */ public void serverTime(JSONObject parameters) { this.handler.publicRequest("time", parameters); @@ -57,7 +57,7 @@ public void serverTime(JSONObject parameters) { * Notes:
* Without parameters, exchangeInfo displays all symbols with ["SPOT, "MARGIN", "LEVERAGED"] permissions.
* In order to list all active symbols on the exchange, you need to explicitly request all permissions.
- * Available Permissions + * Available Permissions * * @param parameters JSONObject composed by key-value pairs: *

@@ -66,8 +66,8 @@ public void serverTime(JSONObject parameters) { * permissions -- optional/Array of String
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#exchange-information + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#exchange-information */ public void exchangeInfo(JSONObject parameters) { ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols", "permissions"); diff --git a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiMarket.java b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiMarket.java index c2a5444b..a4491dc5 100644 --- a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiMarket.java +++ b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiMarket.java @@ -9,7 +9,7 @@ /** *

Market Requests

* All requests under the - * Market requests + * Market requests * section of the WebSocket API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -36,8 +36,8 @@ public WebSocketApiMarket(WebSocketApiRequestHandler handler) { * limit -- optional/int -- Default 100; max 5000.
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#order-book + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#order-book */ public void depth(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -54,8 +54,8 @@ public void depth(String symbol, JSONObject parameters) { * limit -- optional/int -- Default 100; max 1000.
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#recent-trades + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#recent-trades */ public void recentTrades(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -76,8 +76,8 @@ public void recentTrades(String symbol, JSONObject parameters) { * limit -- optional/int -- Default 500; max 1000.
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#historical-trades + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#historical-trades */ public void historicalTrades(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -100,8 +100,8 @@ public void historicalTrades(String symbol, JSONObject parameters) { * endTime -- optional/int
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#aggregate-trades + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#aggregate-trades */ public void aggTrades(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -125,8 +125,8 @@ public void aggTrades(String symbol, JSONObject parameters) { * timeZone -- optional/String -- Default: 0 (UTC)
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#klines + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#klines */ public void klines(String symbol, String interval, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -153,8 +153,8 @@ public void klines(String symbol, String interval, JSONObject parameters) { * timeZone -- optional/String -- Default: 0 (UTC)
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#ui-klines + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#ui-klines */ public void uiKlines(String symbol, String interval, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -174,8 +174,8 @@ public void uiKlines(String symbol, String interval, JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#current-average-price + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#current-average-price */ public void avgPrice(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -193,8 +193,8 @@ public void avgPrice(String symbol, JSONObject parameters) { * type -- optional/String -- Ticker type: FULL (default) or MINI
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#24hr-ticker-price-change-statistics + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#24hr-ticker-price-change-statistics */ public void ticker24H(JSONObject parameters) { ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols"); @@ -219,8 +219,8 @@ public void ticker24H(JSONObject parameters) { * windowSize -- optional/int -- Default "1d"
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#rolling-window-price-change-statistics + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#rolling-window-price-change-statistics */ public void ticker(JSONObject parameters) { ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols"); @@ -237,8 +237,8 @@ public void ticker(JSONObject parameters) { * symbols -- optional/Array of String -- Query ticker for multiple symbols
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-price-ticker + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#symbol-price-ticker */ public void tickerPrice(JSONObject parameters) { ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols"); @@ -254,8 +254,8 @@ public void tickerPrice(JSONObject parameters) { * symbols -- optional/Array of String -- Query ticker for multiple symbols
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#symbol-order-book-ticker + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#symbol-order-book-ticker */ public void tickerBook(JSONObject parameters) { ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols"); @@ -275,8 +275,8 @@ public void tickerBook(JSONObject parameters) { * type -- optional/String -- Ticker type: FULL (default) or MINI
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#trading-day-ticker + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#trading-day-ticker */ public void tickerTradingDay(JSONObject parameters) { ParameterChecker.checkOnlyOneOfParameters(parameters, "symbol", "symbols"); diff --git a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiTrade.java b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiTrade.java index 5a3e9be0..92711a4b 100644 --- a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiTrade.java +++ b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiTrade.java @@ -9,7 +9,7 @@ /** *

Trading Requests

* All requests under the - * Trading requests + * Trading requests * section of the WebSocket API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -46,8 +46,8 @@ public WebSocketApiTrade(WebSocketApiRequestHandler handler) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#place-new-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#place-new-order-trade */ public void newOrder(String symbol, String side, String type, JSONObject parameters) { @@ -89,8 +89,8 @@ public void newOrder(String symbol, String side, String type, JSONObject paramet * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#test-new-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#test-new-order-trade */ public void testNewOrder(String symbol, String side, String type, JSONObject parameters) { @@ -118,8 +118,8 @@ public void testNewOrder(String symbol, String side, String type, JSONObject par * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#query-order-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#query-order-user_data */ public void getOrder(String symbol, JSONObject parameters) { ParameterChecker.checkOneOfParametersRequired(parameters, "orderId", "origClientOrderId"); @@ -144,8 +144,8 @@ public void getOrder(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-order-trade */ public void cancelOrder(String symbol, JSONObject parameters) { ParameterChecker.checkOneOfParametersRequired(parameters, "orderId", "origClientOrderId"); @@ -186,8 +186,8 @@ public void cancelOrder(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-and-replace-order-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-and-replace-order-trade */ public void cancelReplaceOrder(String symbol, String cancelReplaceMode, String side, String type, JSONObject parameters) { @@ -214,8 +214,8 @@ public void cancelReplaceOrder(String symbol, String cancelReplaceMode, String s * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-orders-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#current-open-orders-user_data */ public void getOpenOrders(JSONObject parameters) { this.handler.signedRequest("openOrders.status", parameters); @@ -231,8 +231,8 @@ public void getOpenOrders(JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-open-orders-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#cancel-open-orders-trade */ public void cancelAllOpenOrders(String symbol, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -268,8 +268,8 @@ public void cancelAllOpenOrders(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#place-new-oco-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api */ public void newOcoOrder(String symbol, String side, double price, double quantity, JSONObject parameters) { ParameterChecker.checkOneOfParametersRequired(parameters, "stopPrice", "trailingDelta"); @@ -298,8 +298,8 @@ public void newOcoOrder(String symbol, String side, double price, double quantit * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#query-oco-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api */ public void getOcoOrder(JSONObject parameters) { ParameterChecker.checkOneOfParametersRequired(parameters, "origClientOrderId", "orderListId"); @@ -321,8 +321,8 @@ public void getOcoOrder(JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#cancel-oco-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api */ public void cancelOcoOrder(String symbol, JSONObject parameters) { ParameterChecker.checkOneOfParametersRequired(parameters, "listClientOrderId", "orderListId"); @@ -343,8 +343,8 @@ public void cancelOcoOrder(String symbol, JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#current-open-ocos-user_data + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api */ public void getOpenOcoOrders(JSONObject parameters) { this.handler.signedRequest("openOrderLists.status", parameters); @@ -371,8 +371,8 @@ public void getOpenOcoOrders(JSONObject parameters) { * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#place-new-order-using-sor-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#place-new-order-using-sor-trade */ public void newSorOrder(String symbol, String side, String type, double quantity, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); @@ -410,8 +410,8 @@ public void newSorOrder(String symbol, String side, String type, double quantity * recvWindow -- optional/int -- The value cannot be greater than 60000
* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#test-new-order-using-sor-trade + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#test-new-order-using-sor-trade */ public void testNewSorOrder(String symbol, String side, String type, double quantity, JSONObject parameters) { ParameterChecker.checkParameterType(symbol, String.class, "symbol"); diff --git a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiUserDataStream.java b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiUserDataStream.java index c59dee28..3dd5f323 100644 --- a/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiUserDataStream.java +++ b/src/main/java/com/binance/connector/client/impl/websocketapi/WebSocketApiUserDataStream.java @@ -9,7 +9,7 @@ /** *

User Data Stream Requests

* All requests under the - * User Data Stream requests + * User Data Stream requests * section of the WebSocket API documentation will be implemented in this class. *
* Response will be returned as callback. @@ -33,8 +33,8 @@ public WebSocketApiUserDataStream(WebSocketApiRequestHandler handler) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#start-user-data-stream-user_stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#start-user-data-stream-user_stream */ public void userDataStreamStart(JSONObject parameters) { this.handler.apiRequest("userDataStream.start", parameters); @@ -54,8 +54,8 @@ public void userDataStreamStart(JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#ping-user-data-stream-user_stream */ public void userDataStreamPing(String listenKey, JSONObject parameters) { ParameterChecker.checkParameterType(listenKey, String.class, "listenKey"); @@ -71,8 +71,8 @@ public void userDataStreamPing(String listenKey, JSONObject parameters) { *

* requestId -- optional/String or int
* - * @see - * https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream + * @see + * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api#stop-user-data-stream-user_stream */ public void userDataStreamStop(String listenKey, JSONObject parameters) { ParameterChecker.checkParameterType(listenKey, String.class, "listenKey"); diff --git a/src/main/java/com/binance/connector/client/utils/RequestBuilder.java b/src/main/java/com/binance/connector/client/utils/RequestBuilder.java index f0c2ce8c..4d496c47 100644 --- a/src/main/java/com/binance/connector/client/utils/RequestBuilder.java +++ b/src/main/java/com/binance/connector/client/utils/RequestBuilder.java @@ -9,7 +9,7 @@ public final class RequestBuilder { private static final MediaType JSON_TYPE = MediaType.parse("application/json; charset=utf-8"); - private static final String USER_AGENT = "binance-connector-java/3.3.0"; + private static final String USER_AGENT = "binance-connector-java/3.4.0"; private static final String CONTENT_TYPE = "application/x-www-form-urlencoded"; private RequestBuilder() { diff --git a/src/main/java/com/binance/connector/client/utils/UrlBuilder.java b/src/main/java/com/binance/connector/client/utils/UrlBuilder.java index 348b2211..25282345 100644 --- a/src/main/java/com/binance/connector/client/utils/UrlBuilder.java +++ b/src/main/java/com/binance/connector/client/utils/UrlBuilder.java @@ -7,8 +7,10 @@ import java.text.DecimalFormatSymbols; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.stream.Collectors; public final class UrlBuilder { @@ -63,6 +65,9 @@ public static StringBuilder joinQueryParameters(StringBuilder sb, Map parameters = new LinkedHashMap<>(); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createBlvt().blvtInfo(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/blvt/Redeem.java b/src/test/java/examples/spot/blvt/Redeem.java deleted file mode 100644 index b5dee1f1..00000000 --- a/src/test/java/examples/spot/blvt/Redeem.java +++ /dev/null @@ -1,25 +0,0 @@ -package examples.spot.blvt; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class Redeem { - private Redeem() { - } - private static final double amount = 0.01; - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - parameters.put("tokenName", "BTCDOWN"); - parameters.put("amount", amount); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createBlvt().redeem(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/blvt/SubscriptionRecord.java b/src/test/java/examples/spot/blvt/SubscriptionRecord.java deleted file mode 100644 index 4c3e9b84..00000000 --- a/src/test/java/examples/spot/blvt/SubscriptionRecord.java +++ /dev/null @@ -1,22 +0,0 @@ -package examples.spot.blvt; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class SubscriptionRecord { - private SubscriptionRecord() { - } - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createBlvt().subscriptionRecord(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/blvt/UserLimit.java b/src/test/java/examples/spot/blvt/UserLimit.java deleted file mode 100644 index 3c797797..00000000 --- a/src/test/java/examples/spot/blvt/UserLimit.java +++ /dev/null @@ -1,22 +0,0 @@ -package examples.spot.blvt; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class UserLimit { - private UserLimit() { - } - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createBlvt().userLimit(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/futures/FuturesOrderBookHistory.java b/src/test/java/examples/spot/futures/FuturesOrderBookHistory.java deleted file mode 100644 index 502c2612..00000000 --- a/src/test/java/examples/spot/futures/FuturesOrderBookHistory.java +++ /dev/null @@ -1,28 +0,0 @@ -package examples.spot.futures; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class FuturesOrderBookHistory { - private FuturesOrderBookHistory() { - } - private static final Long startTime = 17024585109000L; - private static final Long endTime = 1702458517000L; - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - parameters.put("symbol", "BTCUSDT"); - parameters.put("dataType", "T_DEPTH"); - parameters.put("startTime", startTime); - parameters.put("endTime", endTime); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createFutures().futuresOrderBookHistory(parameters); - System.out.println(result); - } -} \ No newline at end of file diff --git a/src/test/java/examples/spot/futures/FuturesTransfer.java b/src/test/java/examples/spot/futures/FuturesTransfer.java deleted file mode 100644 index 827194a8..00000000 --- a/src/test/java/examples/spot/futures/FuturesTransfer.java +++ /dev/null @@ -1,27 +0,0 @@ -package examples.spot.futures; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class FuturesTransfer { - private FuturesTransfer() { - } - private static final double amount = 0.01; - private static final int type = 2; - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - parameters.put("asset", "USDT"); - parameters.put("amount", amount); - parameters.put("type", type); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createFutures().futuresTransfer(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/futures/FuturesTransferHistory.java b/src/test/java/examples/spot/futures/FuturesTransferHistory.java deleted file mode 100644 index 6920030f..00000000 --- a/src/test/java/examples/spot/futures/FuturesTransferHistory.java +++ /dev/null @@ -1,25 +0,0 @@ -package examples.spot.futures; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class FuturesTransferHistory { - private FuturesTransferHistory() { - } - private static final long startTime = 0L; - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - parameters.put("asset", "USDT"); - parameters.put("startTime", startTime); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createFutures().futuresTransferHistory(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/margin/AllAssets.java b/src/test/java/examples/spot/margin/AllAssets.java index 9ea707d5..9bbcfc5b 100644 --- a/src/test/java/examples/spot/margin/AllAssets.java +++ b/src/test/java/examples/spot/margin/AllAssets.java @@ -1,5 +1,8 @@ package examples.spot.margin; +import java.util.LinkedHashMap; +import java.util.Map; + import com.binance.connector.client.SpotClient; import com.binance.connector.client.impl.SpotClientImpl; @@ -10,8 +13,10 @@ private AllAssets() { } public static void main(String[] args) { + Map parameters = new LinkedHashMap<>(); + SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createMargin().allAssets(); + String result = client.createMargin().allAssets(parameters); System.out.println(result); } } diff --git a/src/test/java/examples/spot/margin/AllPairs.java b/src/test/java/examples/spot/margin/AllPairs.java index 0fdb5d42..bbc063a9 100644 --- a/src/test/java/examples/spot/margin/AllPairs.java +++ b/src/test/java/examples/spot/margin/AllPairs.java @@ -1,5 +1,8 @@ package examples.spot.margin; +import java.util.LinkedHashMap; +import java.util.Map; + import com.binance.connector.client.SpotClient; import com.binance.connector.client.impl.SpotClientImpl; @@ -10,8 +13,10 @@ private AllPairs() { } public static void main(String[] args) { + Map parameters = new LinkedHashMap<>(); + SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createMargin().allPairs(); + String result = client.createMargin().allPairs(parameters); System.out.println(result); } } diff --git a/src/test/java/examples/spot/blvt/Subscribe.java b/src/test/java/examples/spot/margin/BorrowRepay.java similarity index 54% rename from src/test/java/examples/spot/blvt/Subscribe.java rename to src/test/java/examples/spot/margin/BorrowRepay.java index 008a1e55..a3865bcb 100644 --- a/src/test/java/examples/spot/blvt/Subscribe.java +++ b/src/test/java/examples/spot/margin/BorrowRepay.java @@ -1,4 +1,4 @@ -package examples.spot.blvt; +package examples.spot.margin; import java.util.LinkedHashMap; import java.util.Map; @@ -8,18 +8,20 @@ import examples.PrivateConfig; -public final class Subscribe { - private Subscribe() { +public final class BorrowRepay { + private BorrowRepay() { } - private static final double cost = 0.01; public static void main(String[] args) { Map parameters = new LinkedHashMap<>(); - parameters.put("tokenName", "BTCDOWN"); - parameters.put("cost", cost); + parameters.put("asset", "BNB"); + parameters.put("isIsolated", "FALSE"); + parameters.put("symbol", "BNBUSDT"); + parameters.put("amount", "1"); + parameters.put("type", "BORROW"); SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createBlvt().subscribe(parameters); + String result = client.createMargin().borrowRepay(parameters); System.out.println(result); } } diff --git a/src/test/java/examples/spot/blvt/RedeemRecord.java b/src/test/java/examples/spot/margin/GetBorrowRepay.java similarity index 67% rename from src/test/java/examples/spot/blvt/RedeemRecord.java rename to src/test/java/examples/spot/margin/GetBorrowRepay.java index a0bd464d..88d88eae 100644 --- a/src/test/java/examples/spot/blvt/RedeemRecord.java +++ b/src/test/java/examples/spot/margin/GetBorrowRepay.java @@ -1,4 +1,4 @@ -package examples.spot.blvt; +package examples.spot.margin; import java.util.LinkedHashMap; import java.util.Map; @@ -8,15 +8,16 @@ import examples.PrivateConfig; -public final class RedeemRecord { - private RedeemRecord() { +public final class GetBorrowRepay { + private GetBorrowRepay() { } public static void main(String[] args) { Map parameters = new LinkedHashMap<>(); + parameters.put("type", "BORROW"); SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createBlvt().redeemRecord(parameters); + String result = client.createMargin().getBorrowRepay(parameters); System.out.println(result); } } diff --git a/src/test/java/examples/spot/trade/OcoOrder.java b/src/test/java/examples/spot/trade/OcoOrder.java deleted file mode 100644 index 49ce5877..00000000 --- a/src/test/java/examples/spot/trade/OcoOrder.java +++ /dev/null @@ -1,41 +0,0 @@ -package examples.spot.trade; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.exceptions.BinanceClientException; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class OcoOrder { - private OcoOrder() { - } - private static final double quantity = 0.01; - private static final double price = 95000; - private static final double stopPrice = 98000; - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - - SpotClient client = new SpotClientImpl(PrivateConfig.TESTNET_API_KEY, PrivateConfig.TESTNET_SECRET_KEY, PrivateConfig.BASE_URL); - - parameters.put("symbol", "BTCUSDT"); - parameters.put("side", "SELL"); - parameters.put("stopPrice", stopPrice); - parameters.put("quantity", quantity); - parameters.put("price", price); - - try { - String result = client.createTrade().ocoOrder(parameters); - System.out.println(result); - } catch (BinanceConnectorException e) { - System.err.println((String) String.format("fullErrMessage: %s", e.getMessage())); - } catch (BinanceClientException e) { - System.err.println((String) String.format("fullErrMessage: %s \nerrMessage: %s \nerrCode: %d \nHTTPStatusCode: %d", - e.getMessage(), e.getErrMsg(), e.getErrorCode(), e.getHttpStatusCode())); - } - } -} diff --git a/src/test/java/examples/spot/wallet/BusdConvert.java b/src/test/java/examples/spot/wallet/BusdConvert.java deleted file mode 100644 index 791c508c..00000000 --- a/src/test/java/examples/spot/wallet/BusdConvert.java +++ /dev/null @@ -1,30 +0,0 @@ -package examples.spot.wallet; - -import java.math.BigDecimal; -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class BusdConvert { - private BusdConvert() { - } - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - - final BigDecimal amount = new BigDecimal(1); - parameters.put("clientTranId", "118263407119"); - parameters.put("asset", "BUSD"); - parameters.put("amount", amount); - parameters.put("targetAsset", "USDC"); - parameters.put("accountType", "MAIN"); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createWallet().busdConvert(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/wallet/BusdConvertHistory.java b/src/test/java/examples/spot/wallet/BusdConvertHistory.java deleted file mode 100644 index 573372f4..00000000 --- a/src/test/java/examples/spot/wallet/BusdConvertHistory.java +++ /dev/null @@ -1,31 +0,0 @@ -package examples.spot.wallet; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class BusdConvertHistory { - private BusdConvertHistory() { - } - - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - final Long startTime = 118263400000L; - final Long endTime = 118263407119L; - final Integer size = 20; - - parameters.put("startTime", startTime); - parameters.put("endTime", endTime); - parameters.put("asset", "USDC"); - parameters.put("size", size); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createWallet().busdConvertHistory(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/wallet/GetBusdAutoConvertions.java b/src/test/java/examples/spot/wallet/GetBusdAutoConvertions.java deleted file mode 100644 index 519a6aa8..00000000 --- a/src/test/java/examples/spot/wallet/GetBusdAutoConvertions.java +++ /dev/null @@ -1,18 +0,0 @@ -package examples.spot.wallet; - - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class GetBusdAutoConvertions { - private GetBusdAutoConvertions() { - } - - public static void main(String[] args) { - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createWallet().getBusdAutoConvertions(); - System.out.println(result); - } -} diff --git a/src/test/java/examples/spot/wallet/SwitchBusdAutoConversion.java b/src/test/java/examples/spot/wallet/SwitchBusdAutoConversion.java deleted file mode 100644 index ebacdd42..00000000 --- a/src/test/java/examples/spot/wallet/SwitchBusdAutoConversion.java +++ /dev/null @@ -1,24 +0,0 @@ -package examples.spot.wallet; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.impl.SpotClientImpl; - -import examples.PrivateConfig; - -public final class SwitchBusdAutoConversion { - private SwitchBusdAutoConversion() { - } - - public static void main(String[] args) { - Map parameters = new LinkedHashMap<>(); - parameters.put("coin", "USDC"); - parameters.put("enable", false); - - SpotClient client = new SpotClientImpl(PrivateConfig.API_KEY, PrivateConfig.SECRET_KEY); - String result = client.createWallet().switchBusdAutoConversion(parameters); - System.out.println(result); - } -} diff --git a/src/test/java/unit/spot/blvt/TestBlvtInfo.java b/src/test/java/unit/spot/blvt/TestBlvtInfo.java deleted file mode 100644 index 1d0f8550..00000000 --- a/src/test/java/unit/spot/blvt/TestBlvtInfo.java +++ /dev/null @@ -1,42 +0,0 @@ -package unit.spot.blvt; - -import static org.junit.Assert.assertEquals; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestBlvtInfo { - private MockWebServer mockWebServer; - private String baseUrl; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testBlvtInfo() { - String path = "/sapi/v1/blvt/tokenInfo"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createBlvt().blvtInfo(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/blvt/TestRedeemRecord.java b/src/test/java/unit/spot/blvt/TestRedeemRecord.java deleted file mode 100644 index 3a8ad3f4..00000000 --- a/src/test/java/unit/spot/blvt/TestRedeemRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package unit.spot.blvt; - -import static org.junit.Assert.assertEquals; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestRedeemRecord { - private MockWebServer mockWebServer; - private String baseUrl; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testRedeemRecord() { - String path = "/sapi/v1/blvt/redeem/record"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createBlvt().redeemRecord(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/blvt/TestSubscriptionRecord.java b/src/test/java/unit/spot/blvt/TestSubscriptionRecord.java deleted file mode 100644 index d9f7af52..00000000 --- a/src/test/java/unit/spot/blvt/TestSubscriptionRecord.java +++ /dev/null @@ -1,42 +0,0 @@ -package unit.spot.blvt; - -import static org.junit.Assert.assertEquals; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestSubscriptionRecord { - private MockWebServer mockWebServer; - private String baseUrl; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testSubscriptionRecord() { - String path = "/sapi/v1/blvt/subscribe/record"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createBlvt().subscriptionRecord(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/blvt/TestUserLimit.java b/src/test/java/unit/spot/blvt/TestUserLimit.java deleted file mode 100644 index b61d7417..00000000 --- a/src/test/java/unit/spot/blvt/TestUserLimit.java +++ /dev/null @@ -1,42 +0,0 @@ -package unit.spot.blvt; - -import static org.junit.Assert.assertEquals; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestUserLimit { - private MockWebServer mockWebServer; - private String baseUrl; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testUserLimit() { - String path = "/sapi/v1/blvt/userLimit"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createBlvt().userLimit(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAdjustLtv.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAdjustLtv.java index 1d9128f6..5c9f0718 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAdjustLtv.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAdjustLtv.java @@ -32,7 +32,7 @@ public void init() { @Test public void testFlexibleLoanAdjustLtvWithoutParameters() { - String path = "/sapi/v1/loan/flexible/adjust/ltv"; + String path = "/sapi/v2/loan/flexible/adjust/ltv"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); @@ -44,7 +44,7 @@ public void testFlexibleLoanAdjustLtvWithoutParameters() { @Test public void testFlexibleLoanAdjustLtv() { - String path = "/sapi/v1/loan/flexible/adjust/ltv?loanCoin=BUSD&collateralCoin=BNB&adjustmentAmount=5.235&direction=ADDITIONAL"; + String path = "/sapi/v2/loan/flexible/adjust/ltv?loanCoin=BUSD&collateralCoin=BNB&adjustmentAmount=5.235&direction=ADDITIONAL"; Map parameters = new LinkedHashMap<>(); parameters.put("loanCoin", "BUSD"); parameters.put("collateralCoin", "BNB"); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAssets.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAssets.java index 13273041..08c84f0c 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAssets.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanAssets.java @@ -29,7 +29,7 @@ public void init() { @Test public void testFlexibleLoanAssets() { - String path = "/sapi/v1/loan/flexible/loanable/data"; + String path = "/sapi/v2/loan/flexible/loanable/data"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrow.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrow.java index 0fa27475..4b7600af 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrow.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrow.java @@ -31,7 +31,7 @@ public void init() { @Test public void testFlexibleLoanBorrowWithoutParameters() { - String path = "/sapi/v1/loan/flexible/borrow"; + String path = "/sapi/v2/loan/flexible/borrow"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); @@ -43,7 +43,7 @@ public void testFlexibleLoanBorrowWithoutParameters() { @Test public void testFlexibleLoanBorrow() { - String path = "/sapi/v1/loan/flexible/borrow?loanCoin=USDT&collateralCoin=BTC"; + String path = "/sapi/v2/loan/flexible/borrow?loanCoin=USDT&collateralCoin=BTC"; Map parameters = new LinkedHashMap<>(); parameters.put("loanCoin", "USDT"); parameters.put("collateralCoin", "BTC"); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrowHistory.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrowHistory.java index 7b2c7803..78abfe13 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrowHistory.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanBorrowHistory.java @@ -29,7 +29,7 @@ public void init() { @Test public void testFlexibleLoanBorrowHistory() { - String path = "/sapi/v1/loan/flexible/borrow/history"; + String path = "/sapi/v2/loan/flexible/borrow/history"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanCollateralAssets.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanCollateralAssets.java index 9577a913..1b1d9fde 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanCollateralAssets.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanCollateralAssets.java @@ -29,7 +29,7 @@ public void init() { @Test public void testGetFlexibleLoanCollateralAssetsData() { - String path = "/sapi/v1/loan/flexible/collateral/data"; + String path = "/sapi/v2/loan/flexible/collateral/data"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanLtvAdjustHistory.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanLtvAdjustHistory.java index a303ff72..49875f34 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanLtvAdjustHistory.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanLtvAdjustHistory.java @@ -30,7 +30,7 @@ public void init() { @Test public void testFlexibleLoanLtvAdjustHistory() { - String path = "/sapi/v1/loan/flexible/ltv/adjustment/history"; + String path = "/sapi/v2/loan/flexible/ltv/adjustment/history"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanOngoingOrders.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanOngoingOrders.java index 96d54311..07196145 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanOngoingOrders.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanOngoingOrders.java @@ -29,7 +29,7 @@ public void init() { @Test public void testFlexibleLoanOngoingOrders() { - String path = "/sapi/v1/loan/flexible/ongoing/orders?loanCoin=BUSD"; + String path = "/sapi/v2/loan/flexible/ongoing/orders?loanCoin=BUSD"; Map parameters = new LinkedHashMap<>(); parameters.put("loanCoin", "BUSD"); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepay.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepay.java index 3e59d5a8..554062cf 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepay.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepay.java @@ -32,7 +32,7 @@ public void init() { @Test public void testFlexibleLoanRepayWithoutParameters() { - String path = "/sapi/v1/loan/flexible/repay"; + String path = "/sapi/v2/loan/flexible/repay"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); @@ -44,7 +44,7 @@ public void testFlexibleLoanRepayWithoutParameters() { @Test public void testFlexibleLoanRepay() { - String path = "/sapi/v1/loan/flexible/repay?loanCoin=USDT&collateralCoin=BTC&repayAmount=" + repayAmount; + String path = "/sapi/v2/loan/flexible/repay?loanCoin=USDT&collateralCoin=BTC&repayAmount=" + repayAmount; Map parameters = new LinkedHashMap<>(); parameters.put("loanCoin", "USDT"); parameters.put("collateralCoin", "BTC"); diff --git a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepayHistory.java b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepayHistory.java index 30c953dd..cc43ed3c 100644 --- a/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepayHistory.java +++ b/src/test/java/unit/spot/cryptoloans/TestFlexibleLoanRepayHistory.java @@ -29,7 +29,7 @@ public void init() { @Test public void testRepayGetFlexibleLoanRepaymentHistory() { - String path = "/sapi/v1/loan/flexible/repay/history"; + String path = "/sapi/v2/loan/flexible/repay/history"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); diff --git a/src/test/java/unit/spot/futures/TestFuturesOrderBookHistory.java b/src/test/java/unit/spot/futures/TestFuturesOrderBookHistory.java deleted file mode 100644 index 757da24a..00000000 --- a/src/test/java/unit/spot/futures/TestFuturesOrderBookHistory.java +++ /dev/null @@ -1,63 +0,0 @@ -package unit.spot.futures; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestFuturesOrderBookHistory { - private MockWebServer mockWebServer; - private String baseUrl; - - private final Long startTime = 17024585109000L; - private final Long endTime = 1702458517000L; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testTestFuturesOrderBookHistoryWithoutParameters() { - String path = "/sapi/v1/futures/histDataLink"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createFutures().futuresOrderBookHistory(parameters)); - } - - @Test - public void testTestFuturesOrderBookHistory() { - String path = String.format("/sapi/v1/futures/histDataLink?symbol=%s&dataType=%s&startTime=%s&endTime=%s", "BTCUSDT", "T_DEPTH", startTime, endTime); - Map parameters = new LinkedHashMap<>(); - parameters.put("symbol", "BTCUSDT"); - parameters.put("dataType", "T_DEPTH"); - parameters.put("startTime", startTime); - parameters.put("endTime", endTime); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createFutures().futuresOrderBookHistory(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/futures/TestFuturesTransfer.java b/src/test/java/unit/spot/futures/TestFuturesTransfer.java deleted file mode 100644 index ca334399..00000000 --- a/src/test/java/unit/spot/futures/TestFuturesTransfer.java +++ /dev/null @@ -1,62 +0,0 @@ -package unit.spot.futures; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestFuturesTransfer { - private MockWebServer mockWebServer; - private String baseUrl; - - private final double amount = 1; - private final int type = 1; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testFuturesTransferWithoutParameters() { - String path = "/sapi/v1/futures/transfer"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createFutures().futuresTransfer(parameters)); - } - - @Test - public void testFuturesTransfer() { - String path = "/sapi/v1/futures/transfer?asset=USDT&amount=1&type=1"; - Map parameters = new LinkedHashMap<>(); - parameters.put("asset", "USDT"); - parameters.put("amount", amount); - parameters.put("type", type); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createFutures().futuresTransfer(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/futures/TestFuturesTransferHistory.java b/src/test/java/unit/spot/futures/TestFuturesTransferHistory.java deleted file mode 100644 index 9d456e14..00000000 --- a/src/test/java/unit/spot/futures/TestFuturesTransferHistory.java +++ /dev/null @@ -1,60 +0,0 @@ -package unit.spot.futures; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestFuturesTransferHistory { - private MockWebServer mockWebServer; - private String baseUrl; - - private final long startTime = 12345678L; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testFuturesTransferHistoryWithoutParameters() { - String path = "/sapi/v1/futures/transfer"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createFutures().futuresTransferHistory(parameters)); - } - - @Test - public void testFuturesTransferHistory() { - String path = "/sapi/v1/futures/transfer?asset=USDT&startTime=12345678"; - Map parameters = new LinkedHashMap<>(); - parameters.put("asset", "USDT"); - parameters.put("startTime", startTime); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createFutures().futuresTransferHistory(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/margin/TestAllAssets.java b/src/test/java/unit/spot/margin/TestAllAssets.java index b236f429..b356f870 100644 --- a/src/test/java/unit/spot/margin/TestAllAssets.java +++ b/src/test/java/unit/spot/margin/TestAllAssets.java @@ -2,6 +2,9 @@ import static org.junit.Assert.assertEquals; +import java.util.LinkedHashMap; +import java.util.Map; + import org.junit.Before; import org.junit.Test; @@ -27,12 +30,13 @@ public void init() { @Test public void testAllAssets() { String path = "/sapi/v1/margin/allAssets"; + Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); mockWebServer.setDispatcher(dispatcher); SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createMargin().allAssets(); + String result = client.createMargin().allAssets(parameters); assertEquals(MockData.MOCK_RESPONSE, result); } } diff --git a/src/test/java/unit/spot/margin/TestAllPairs.java b/src/test/java/unit/spot/margin/TestAllPairs.java index f0890cf2..3ad41a19 100644 --- a/src/test/java/unit/spot/margin/TestAllPairs.java +++ b/src/test/java/unit/spot/margin/TestAllPairs.java @@ -2,6 +2,9 @@ import static org.junit.Assert.assertEquals; +import java.util.LinkedHashMap; +import java.util.Map; + import org.junit.Before; import org.junit.Test; @@ -27,12 +30,13 @@ public void init() { @Test public void testAllPairs() { String path = "/sapi/v1/margin/allPairs"; + Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); mockWebServer.setDispatcher(dispatcher); SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createMargin().allPairs(); + String result = client.createMargin().allPairs(parameters); assertEquals(MockData.MOCK_RESPONSE, result); } } diff --git a/src/test/java/unit/spot/blvt/TestSubscribe.java b/src/test/java/unit/spot/margin/TestBorrowRepay.java similarity index 74% rename from src/test/java/unit/spot/blvt/TestSubscribe.java rename to src/test/java/unit/spot/margin/TestBorrowRepay.java index a67739ea..52840944 100644 --- a/src/test/java/unit/spot/blvt/TestSubscribe.java +++ b/src/test/java/unit/spot/margin/TestBorrowRepay.java @@ -1,4 +1,4 @@ -package unit.spot.blvt; +package unit.spot.margin; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; @@ -19,41 +19,43 @@ import unit.MockData; import unit.MockWebServerDispatcher; -public class TestSubscribe { +public class TestBorrowRepay { private MockWebServer mockWebServer; private String baseUrl; - private final double cost = 1; - @Before public void init() { this.mockWebServer = new MockWebServer(); this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); } + @Test - public void testSubscribeWithoutParameters() { - String path = "/sapi/v1/blvt/subscribe"; + public void testAdjustCrossMarginMaxLeverageWithoutParameters() { + String path = "/sapi/v1/margin/borrow-repay"; Map parameters = new LinkedHashMap<>(); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); mockWebServer.setDispatcher(dispatcher); SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createBlvt().subscribe(parameters)); + assertThrows(BinanceConnectorException.class, () -> client.createMargin().borrowRepay(parameters)); } @Test - public void testSubscribe() { - String path = "/sapi/v1/blvt/subscribe?tokenName=USDT&cost=1"; + public void testAllAssets() { + String path = "/sapi/v1/margin/borrow-repay"; Map parameters = new LinkedHashMap<>(); - parameters.put("tokenName", "USDT"); - parameters.put("cost", cost); + parameters.put("asset", "BNB"); + parameters.put("isIsolated", "FALSE"); + parameters.put("symbol", "BNBUSDT"); + parameters.put("amount", "1"); + parameters.put("type", "BORROW"); Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); mockWebServer.setDispatcher(dispatcher); SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createBlvt().subscribe(parameters); + String result = client.createMargin().borrowRepay(parameters); assertEquals(MockData.MOCK_RESPONSE, result); } } diff --git a/src/test/java/unit/spot/blvt/TestRedeem.java b/src/test/java/unit/spot/margin/TestGetBorrowRepay.java similarity index 75% rename from src/test/java/unit/spot/blvt/TestRedeem.java rename to src/test/java/unit/spot/margin/TestGetBorrowRepay.java index fee49f7b..1d7cce20 100644 --- a/src/test/java/unit/spot/blvt/TestRedeem.java +++ b/src/test/java/unit/spot/margin/TestGetBorrowRepay.java @@ -1,4 +1,4 @@ -package unit.spot.blvt; +package unit.spot.margin; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThrows; @@ -19,12 +19,10 @@ import unit.MockData; import unit.MockWebServerDispatcher; -public class TestRedeem { +public class TestGetBorrowRepay { private MockWebServer mockWebServer; private String baseUrl; - private final double amount = 1; - @Before public void init() { this.mockWebServer = new MockWebServer(); @@ -32,29 +30,28 @@ public void init() { } @Test - public void testRedeemWithoutParameters() { - String path = "/sapi/v1/blvt/redeem"; + public void testAdjustCrossMarginMaxLeverageWithoutParameters() { + String path = "/sapi/v1/margin/borrow-repay"; Map parameters = new LinkedHashMap<>(); - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); + Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); mockWebServer.setDispatcher(dispatcher); SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createBlvt().redeem(parameters)); + assertThrows(BinanceConnectorException.class, () -> client.createMargin().getBorrowRepay(parameters)); } @Test - public void testRedeem() { - String path = "/sapi/v1/blvt/redeem?tokenName=USDT&amount=1"; + public void testAllAssets() { + String path = "/sapi/v1/margin/borrow-repay"; Map parameters = new LinkedHashMap<>(); - parameters.put("tokenName", "USDT"); - parameters.put("amount", amount); + parameters.put("type", "BORROW"); - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); + Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); mockWebServer.setDispatcher(dispatcher); SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createBlvt().redeem(parameters); + String result = client.createMargin().getBorrowRepay(parameters); assertEquals(MockData.MOCK_RESPONSE, result); } } diff --git a/src/test/java/unit/spot/trade/TestOcoOrder.java b/src/test/java/unit/spot/trade/TestOcoOrder.java deleted file mode 100644 index 02f57c75..00000000 --- a/src/test/java/unit/spot/trade/TestOcoOrder.java +++ /dev/null @@ -1,65 +0,0 @@ -package unit.spot.trade; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestOcoOrder { - private MockWebServer mockWebServer; - private String baseUrl; - - private final int price = 9500; - private final double quantity = 0.01; - private final int stopPrice = 7500; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testOcoOrderWithoutParameters() { - String path = "/api/v3/order/oco"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createTrade().ocoOrder(parameters)); - } - - @Test - public void testOcoOrder() { - String path = "/api/v3/order/oco?symbol=BNBUSDT&side=SELL&price=9500&quantity=0.01&stopPrice=7500"; - Map parameters = new LinkedHashMap<>(); - parameters.put("symbol", "BNBUSDT"); - parameters.put("side", "SELL"); - parameters.put("price", price); - parameters.put("quantity", quantity); - parameters.put("stopPrice", stopPrice); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createTrade().ocoOrder(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/wallet/TestBusdConvert.java b/src/test/java/unit/spot/wallet/TestBusdConvert.java deleted file mode 100644 index 3bbb72db..00000000 --- a/src/test/java/unit/spot/wallet/TestBusdConvert.java +++ /dev/null @@ -1,68 +0,0 @@ -package unit.spot.wallet; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.math.BigDecimal; -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestBusdConvert { - private MockWebServer mockWebServer; - private String baseUrl; - - private final BigDecimal amount = new BigDecimal(1); - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testBusdConverWithoutMandatoryParam() { - String path = "/sapi/v1/asset/convert-transfer"; - Map parameters = new LinkedHashMap<>(); - parameters.put("clientTranId", "118263407119"); - parameters.put("amount", amount); - parameters.put("targetAsset", "USDC"); - parameters.put("accountType", "MAIN"); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createWallet().busdConvert(parameters)); - } - - @Test - public void testBusdConvert() { - String path = "/sapi/v1/asset/convert-transfer"; - Map parameters = new LinkedHashMap<>(); - parameters.put("clientTranId", "118263407119"); - parameters.put("asset", "BUSD"); - parameters.put("amount", amount); - parameters.put("targetAsset", "USDC"); - parameters.put("accountType", "MAIN"); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createWallet().busdConvert(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/wallet/TestBusdConvertHistory.java b/src/test/java/unit/spot/wallet/TestBusdConvertHistory.java deleted file mode 100644 index b85e87b3..00000000 --- a/src/test/java/unit/spot/wallet/TestBusdConvertHistory.java +++ /dev/null @@ -1,84 +0,0 @@ -package unit.spot.wallet; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestBusdConvertHistory { - private MockWebServer mockWebServer; - private String baseUrl; - - private final Integer size = 20; - private final Long startTime = 118263400000L; - private final Long endTime = 118263407119L; - - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testBusdConvertWithWrongParamType() { - String path = "/sapi/v1/asset/convert-transfer/queryByPage"; - Map parameters = new LinkedHashMap<>(); - parameters.put("startTime", "118263400000L"); - parameters.put("endTime", "118263407119L"); - parameters.put("asset", "USDC"); - parameters.put("size", size); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createWallet().busdConvertHistory(parameters)); - } - - @Test - public void testBusdConvertWithoutMandatoryParam() { - String path = "/sapi/v1/asset/convert-transfer/queryByPage"; - Map parameters = new LinkedHashMap<>(); - parameters.put("startTime", startTime); - parameters.put("asset", "USDC"); - parameters.put("size", size); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createWallet().busdConvertHistory(parameters)); - } - - @Test - public void testBusdConvertHistory() { - String path = "/sapi/v1/asset/convert-transfer/queryByPage"; - Map parameters = new LinkedHashMap<>(); - parameters.put("startTime", startTime); - parameters.put("endTime", endTime); - parameters.put("asset", "USDC"); - parameters.put("size", size); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createWallet().busdConvertHistory(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/wallet/TestDustTransfer.java b/src/test/java/unit/spot/wallet/TestDustTransfer.java index b43c2caf..999a4a3a 100644 --- a/src/test/java/unit/spot/wallet/TestDustTransfer.java +++ b/src/test/java/unit/spot/wallet/TestDustTransfer.java @@ -45,7 +45,7 @@ public void testDustTransferWithoutCoin() { @Test public void testDustTransfer() { - String path = String.format("/sapi/v1/asset/dust?asset=%s", UrlBuilder.urlEncode("[CHR, CTSI]")); + String path = String.format("/sapi/v1/asset/dust?asset=%s", UrlBuilder.urlEncode("CHR,CTSI")); Map parameters = new LinkedHashMap<>(); ArrayList assets = new ArrayList<>(); diff --git a/src/test/java/unit/spot/wallet/TestGetBusdAutoConvertions.java b/src/test/java/unit/spot/wallet/TestGetBusdAutoConvertions.java deleted file mode 100644 index c4d264e2..00000000 --- a/src/test/java/unit/spot/wallet/TestGetBusdAutoConvertions.java +++ /dev/null @@ -1,40 +0,0 @@ -package unit.spot.wallet; - -import static org.junit.Assert.assertEquals; - - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestGetBusdAutoConvertions { - private MockWebServer mockWebServer; - private String baseUrl; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - - @Test - public void testGetBusdAutoConvertions() { - String path = "/sapi/v1/capital/contract/convertible-coins"; - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.GET, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createWallet().getBusdAutoConvertions(); - assertEquals(MockData.MOCK_RESPONSE, result); - } -} diff --git a/src/test/java/unit/spot/wallet/TestSwitchBusdAutoConversion.java b/src/test/java/unit/spot/wallet/TestSwitchBusdAutoConversion.java deleted file mode 100644 index 43f0efff..00000000 --- a/src/test/java/unit/spot/wallet/TestSwitchBusdAutoConversion.java +++ /dev/null @@ -1,58 +0,0 @@ -package unit.spot.wallet; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThrows; - -import java.util.LinkedHashMap; -import java.util.Map; - -import org.junit.Before; -import org.junit.Test; - -import com.binance.connector.client.SpotClient; -import com.binance.connector.client.enums.HttpMethod; -import com.binance.connector.client.exceptions.BinanceConnectorException; -import com.binance.connector.client.impl.SpotClientImpl; - -import okhttp3.mockwebserver.Dispatcher; -import okhttp3.mockwebserver.MockWebServer; -import unit.MockData; -import unit.MockWebServerDispatcher; - -public class TestSwitchBusdAutoConversion { - private MockWebServer mockWebServer; - private String baseUrl; - - @Before - public void init() { - this.mockWebServer = new MockWebServer(); - this.baseUrl = mockWebServer.url(MockData.PREFIX).toString(); - } - - @Test - public void testSwitchBusdAutoConversionWithoutParameters() { - String path = "/sapi/v1/capital/contract/convertible-coins"; - Map parameters = new LinkedHashMap<>(); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - assertThrows(BinanceConnectorException.class, () -> client.createWallet().switchBusdAutoConversion(parameters)); - } - - @Test - public void testSwitchBusdAutoConversion() { - String path = "/sapi/v1/capital/contract/convertible-coins?coin=USDC&enable=false"; - Map parameters = new LinkedHashMap<>(); - parameters.put("coin", "USDC"); - parameters.put("enable", false); - - Dispatcher dispatcher = MockWebServerDispatcher.getDispatcher(MockData.PREFIX, path, MockData.MOCK_RESPONSE, HttpMethod.POST, MockData.HTTP_STATUS_OK); - mockWebServer.setDispatcher(dispatcher); - - SpotClient client = new SpotClientImpl(MockData.API_KEY, MockData.SECRET_KEY, baseUrl); - String result = client.createWallet().switchBusdAutoConversion(parameters); - assertEquals(MockData.MOCK_RESPONSE, result); - } -}