@binance/margin-trading 13.0.6 → 13.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ let __binance_common = require("@binance/common");
14
14
 
15
15
  //#region package.json
16
16
  var name = "@binance/margin-trading";
17
- var version = "13.0.6";
17
+ var version = "13.1.0";
18
18
 
19
19
  //#endregion
20
20
  //#region src/rest-api/modules/account-api.ts
@@ -247,7 +247,7 @@ var AccountApi = class {
247
247
  * Security Type: USER_DATA
248
248
  *
249
249
  * Notes:
250
- * - The margin level need higher than the initial risk ratio of adjusted leverage, the initial risk ratio of 3x is 1.5 , the initial risk ratio of 5x is 1.25; The detail conditions on how to switch between Cross Margin Classic and Cross Margin Pro can refer to [the FAQ](https://www.binance.com/en/support/faq/how-to-activate-the-cross-margin-pro-mode-on-binance-e27786da05e743a694b8c625b3bc475d).
250
+ * - The margin level need higher than the initial risk ratio of adjusted leverage, the initial risk ratio of 3x is 1.5 , the initial risk ratio of 5x is 1.25; The detail conditions on how to switch between Cross Margin Classic and Cross Margin Pro can refer to the FAQ.
251
251
  *
252
252
  * @summary Adjust cross margin max leverage (USER_DATA)
253
253
  * @param {AdjustCrossMarginMaxLeverageRequest} requestParameters Request parameters.
@@ -799,7 +799,7 @@ var BorrowRepayApi = class {
799
799
  *
800
800
  * Notes:
801
801
  * - If isolatedSymbol is not sent, crossed margin data will be sent.
802
- * - `borrowLimit` is also available from [https://www.binance.com/en/margin-fee](https://www.binance.com/en/margin-fee)
802
+ * - `borrowLimit` is also available from https://www.binance.com/en/margin-fee
803
803
  *
804
804
  * @summary Query Max Borrow (USER_DATA)
805
805
  * @param {QueryMaxBorrowRequest} requestParameters Request parameters.
@@ -1908,6 +1908,23 @@ const TradeApiAxiosParamCreator = function(configuration) {
1908
1908
  timeUnit: _timeUnit
1909
1909
  };
1910
1910
  },
1911
+ queryMarginAccountsOpenOtootocoOrderLists: async (symbol, recvWindow) => {
1912
+ const localVarQueryParameter = {};
1913
+ const localVarBodyParameter = {};
1914
+ const localVarHeaderParameter = {};
1915
+ if (symbol !== void 0 && symbol !== null) localVarQueryParameter["symbol"] = symbol;
1916
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
1917
+ let _timeUnit;
1918
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
1919
+ return {
1920
+ endpoint: "/sapi/v1/margin/oto/openOrderList",
1921
+ method: "GET",
1922
+ queryParams: localVarQueryParameter,
1923
+ bodyParams: localVarBodyParameter,
1924
+ headerParams: localVarHeaderParameter,
1925
+ timeUnit: _timeUnit
1926
+ };
1927
+ },
1911
1928
  queryMarginAccountsOrder: async (symbol, isIsolated, orderId, origClientOrderId, recvWindow) => {
1912
1929
  (0, __binance_common.assertParamExists)("queryMarginAccountsOrder", "symbol", symbol);
1913
1930
  const localVarQueryParameter = {};
@@ -2041,12 +2058,12 @@ var TradeApi = class {
2041
2058
  /**
2042
2059
  * **Eligibility**
2043
2060
  *
2044
- * - Binance Margin offers low-latency trading through a [special key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), available exclusively to users with VIP level 7 or higher.
2061
+ * - Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
2045
2062
  * - If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
2046
2063
  * - All new Margin Special Key users are required to read, understand, and agree to the Margin Special Key Supplemental Product Terms at the master account level before creating a Margin Special Key.
2047
2064
  * - Once signed at the master account level, the agreement applies to all sub-accounts. The master account and all sub-accounts (Cross Margin Classic and Portfolio Margin Pro) are authorized to create a Margin Special Key and are subject to the LiquidationLoan policy.
2048
2065
  *
2049
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
2066
+ * For more information, please refer to FAQ.
2050
2067
  *
2051
2068
  **Supported Products:**
2052
2069
  *
@@ -2064,7 +2081,7 @@ var TradeApi = class {
2064
2081
  * HMAC
2065
2082
  * RSA
2066
2083
  *
2067
- * We recommend to **use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) .
2084
+ * We recommend to **use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .
2068
2085
  *
2069
2086
  **How to use the Margin Special Key**
2070
2087
  * - Use the below `sapi` endpoint to create your margin special API Key.
@@ -2072,7 +2089,7 @@ var TradeApi = class {
2072
2089
  * - For accessing the Isolated Margin account(s), pass the relevant `symbol` parameter in the API Key creation request.
2073
2090
  * - Use the generated API Key (and Secret key, if applicable) to perform margin trading and listenKey generation via **Spot** REST API (`https://api.binance.com/api/v3/*`) endpoints.
2074
2091
  *
2075
- * Read [REST API](/products/spot/rest-api#signed-trade-and-user_data-endpoint-security) or [WebSocket API](/products/spot/web-socket-api#request-security) documentation to learn how to use different API keys
2092
+ * Read REST API or WebSocket API documentation to learn how to use different API keys
2076
2093
  *
2077
2094
  * You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
2078
2095
  *
@@ -2164,7 +2181,7 @@ var TradeApi = class {
2164
2181
  * 2. All pre-execution margin checks (including Open-order-loss calculation) will revert to standard mode.
2165
2182
  * 3. A cooldown period (default: 24 hours) will be enforced, during which the account will not be permitted to create new Margin Special API Keys.
2166
2183
  *
2167
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
2184
+ * For more information, please refer to FAQ.
2168
2185
  *
2169
2186
  **Preconditions:**
2170
2187
  *
@@ -2427,7 +2444,6 @@ var TradeApi = class {
2427
2444
  /**
2428
2445
  * Post a new OTOCO order for margin account:
2429
2446
  *
2430
- *
2431
2447
  * - An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list
2432
2448
  * comprised of 3 orders.
2433
2449
  *
@@ -2437,7 +2453,7 @@ var TradeApi = class {
2437
2453
  * - OTOCO has 2 pending orders (pending above and pending below), forming
2438
2454
  * an OCO pair. The pending orders are only placed on the order book when
2439
2455
  * the working order gets **fully filled**.
2440
- * - The rules of the pending above and pending below follow the same rules as the [Order List OCO](https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oco).
2456
+ * - The rules of the pending above and pending below follow the same rules as the Order List OCO.
2441
2457
  * - OTOCOs add **3 orders** against the unfilled order count,
2442
2458
  * `EXCHANGE_MAX_NUM_ORDERS` filter, and `MAX_NUM_ORDERS` filter.
2443
2459
  *
@@ -2650,6 +2666,30 @@ var TradeApi = class {
2650
2666
  return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
2651
2667
  }
2652
2668
  /**
2669
+ * Retrieves all open OTO / OTOCO order lists of the margin account.
2670
+ *
2671
+ *
2672
+ * Notes:
2673
+ * - The returned list contains order lists whose `listOrderStatus` is `EXECUTING`, i.e. at least one order of the list is still open (`NEW` / `PARTIALLY_FILLED`).
2674
+ * - For OTO, the `orders` array contains 2 orders: the working order and the pending order.
2675
+ * - For OTOCO, the `orders` array contains 3 orders: the working order and the two pending orders (pending above / pending below).
2676
+ *
2677
+ * Weight(UID): 10
2678
+ *
2679
+ * Security Type: USER_DATA
2680
+ *
2681
+ * @summary Query Margin Account\'s Open OTO/OTOCO Order Lists (USER_DATA)
2682
+ * @param {QueryMarginAccountsOpenOtootocoOrderListsRequest} requestParameters Request parameters.
2683
+ * @returns {Promise<RestApiResponse<QueryMarginAccountsOpenOtootocoOrderListsResponse>>}
2684
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2685
+ * @memberof TradeApi
2686
+ * @see {@link https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-otootoco-order-lists Binance API Documentation}
2687
+ */
2688
+ async queryMarginAccountsOpenOtootocoOrderLists(requestParameters = {}) {
2689
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryMarginAccountsOpenOtootocoOrderLists(requestParameters?.symbol, requestParameters?.recvWindow);
2690
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
2691
+ }
2692
+ /**
2653
2693
  * Query Margin Account's Order
2654
2694
  *
2655
2695
  * Weight(IP): 10
@@ -3389,7 +3429,7 @@ var RestAPI = class {
3389
3429
  * Security Type: USER_DATA
3390
3430
  *
3391
3431
  * Notes:
3392
- * - The margin level need higher than the initial risk ratio of adjusted leverage, the initial risk ratio of 3x is 1.5 , the initial risk ratio of 5x is 1.25; The detail conditions on how to switch between Cross Margin Classic and Cross Margin Pro can refer to [the FAQ](https://www.binance.com/en/support/faq/how-to-activate-the-cross-margin-pro-mode-on-binance-e27786da05e743a694b8c625b3bc475d).
3432
+ * - The margin level need higher than the initial risk ratio of adjusted leverage, the initial risk ratio of 3x is 1.5 , the initial risk ratio of 5x is 1.25; The detail conditions on how to switch between Cross Margin Classic and Cross Margin Pro can refer to the FAQ.
3393
3433
  *
3394
3434
  * @summary Adjust cross margin max leverage (USER_DATA)
3395
3435
  * @param {AdjustCrossMarginMaxLeverageRequest} requestParameters Request parameters.
@@ -3743,7 +3783,7 @@ var RestAPI = class {
3743
3783
  *
3744
3784
  * Notes:
3745
3785
  * - If isolatedSymbol is not sent, crossed margin data will be sent.
3746
- * - `borrowLimit` is also available from [https://www.binance.com/en/margin-fee](https://www.binance.com/en/margin-fee)
3786
+ * - `borrowLimit` is also available from https://www.binance.com/en/margin-fee
3747
3787
  *
3748
3788
  * @summary Query Max Borrow (USER_DATA)
3749
3789
  * @param {QueryMaxBorrowRequest} requestParameters Request parameters.
@@ -3990,12 +4030,12 @@ var RestAPI = class {
3990
4030
  /**
3991
4031
  * **Eligibility**
3992
4032
  *
3993
- * - Binance Margin offers low-latency trading through a [special key](https://www.binance.com/en/support/faq/frequently-asked-questions-on-margin-special-api-key-3208663e900d4d2e9fec4140e1832f4e), available exclusively to users with VIP level 7 or higher.
4033
+ * - Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
3994
4034
  * - If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
3995
4035
  * - All new Margin Special Key users are required to read, understand, and agree to the Margin Special Key Supplemental Product Terms at the master account level before creating a Margin Special Key.
3996
4036
  * - Once signed at the master account level, the agreement applies to all sub-accounts. The master account and all sub-accounts (Cross Margin Classic and Portfolio Margin Pro) are authorized to create a Margin Special Key and are subject to the LiquidationLoan policy.
3997
4037
  *
3998
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
4038
+ * For more information, please refer to FAQ.
3999
4039
  *
4000
4040
  **Supported Products:**
4001
4041
  *
@@ -4013,7 +4053,7 @@ var RestAPI = class {
4013
4053
  * HMAC
4014
4054
  * RSA
4015
4055
  *
4016
- * We recommend to **use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below [FAQ](https://www.binance.com/en/support/faq/how-to-generate-an-rsa-key-pair-to-send-api-requests-on-binance-2b79728f331e43079b27440d9d15c5db) .
4056
+ * We recommend to **use Ed25519 API keys** as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .
4017
4057
  *
4018
4058
  **How to use the Margin Special Key**
4019
4059
  * - Use the below `sapi` endpoint to create your margin special API Key.
@@ -4021,7 +4061,7 @@ var RestAPI = class {
4021
4061
  * - For accessing the Isolated Margin account(s), pass the relevant `symbol` parameter in the API Key creation request.
4022
4062
  * - Use the generated API Key (and Secret key, if applicable) to perform margin trading and listenKey generation via **Spot** REST API (`https://api.binance.com/api/v3/*`) endpoints.
4023
4063
  *
4024
- * Read [REST API](/products/spot/rest-api#signed-trade-and-user_data-endpoint-security) or [WebSocket API](/products/spot/web-socket-api#request-security) documentation to learn how to use different API keys
4064
+ * Read REST API or WebSocket API documentation to learn how to use different API keys
4025
4065
  *
4026
4066
  * You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
4027
4067
  *
@@ -4110,7 +4150,7 @@ var RestAPI = class {
4110
4150
  * 2. All pre-execution margin checks (including Open-order-loss calculation) will revert to standard mode.
4111
4151
  * 3. A cooldown period (default: 24 hours) will be enforced, during which the account will not be permitted to create new Margin Special API Keys.
4112
4152
  *
4113
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
4153
+ * For more information, please refer to FAQ.
4114
4154
  *
4115
4155
  **Preconditions:**
4116
4156
  *
@@ -4362,7 +4402,6 @@ var RestAPI = class {
4362
4402
  /**
4363
4403
  * Post a new OTOCO order for margin account:
4364
4404
  *
4365
- *
4366
4405
  * - An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list
4367
4406
  * comprised of 3 orders.
4368
4407
  *
@@ -4372,7 +4411,7 @@ var RestAPI = class {
4372
4411
  * - OTOCO has 2 pending orders (pending above and pending below), forming
4373
4412
  * an OCO pair. The pending orders are only placed on the order book when
4374
4413
  * the working order gets **fully filled**.
4375
- * - The rules of the pending above and pending below follow the same rules as the [Order List OCO](https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#margin-account-new-oco).
4414
+ * - The rules of the pending above and pending below follow the same rules as the Order List OCO.
4376
4415
  * - OTOCOs add **3 orders** against the unfilled order count,
4377
4416
  * `EXCHANGE_MAX_NUM_ORDERS` filter, and `MAX_NUM_ORDERS` filter.
4378
4417
  *
@@ -4575,6 +4614,29 @@ var RestAPI = class {
4575
4614
  return this.tradeApi.queryMarginAccountsOpenOrders(requestParameters);
4576
4615
  }
4577
4616
  /**
4617
+ * Retrieves all open OTO / OTOCO order lists of the margin account.
4618
+ *
4619
+ *
4620
+ * Notes:
4621
+ * - The returned list contains order lists whose `listOrderStatus` is `EXECUTING`, i.e. at least one order of the list is still open (`NEW` / `PARTIALLY_FILLED`).
4622
+ * - For OTO, the `orders` array contains 2 orders: the working order and the pending order.
4623
+ * - For OTOCO, the `orders` array contains 3 orders: the working order and the two pending orders (pending above / pending below).
4624
+ *
4625
+ * Weight(UID): 10
4626
+ *
4627
+ * Security Type: USER_DATA
4628
+ *
4629
+ * @summary Query Margin Account\'s Open OTO/OTOCO Order Lists (USER_DATA)
4630
+ * @param {QueryMarginAccountsOpenOtootocoOrderListsRequest} requestParameters Request parameters.
4631
+ *
4632
+ * @returns {Promise<RestApiResponse<QueryMarginAccountsOpenOtootocoOrderListsResponse>>}
4633
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
4634
+ * @see {@link https://developers.binance.com/en/docs/catalog/core-trading-margin-trading/api/rest-api/trade#query-margin-accounts-open-otootoco-order-lists Binance API Documentation}
4635
+ */
4636
+ queryMarginAccountsOpenOtootocoOrderLists(requestParameters = {}) {
4637
+ return this.tradeApi.queryMarginAccountsOpenOtootocoOrderLists(requestParameters);
4638
+ }
4639
+ /**
4578
4640
  * Query Margin Account's Order
4579
4641
  *
4580
4642
  * Weight(IP): 10