@binance/margin-trading 13.0.6 → 13.1.1

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.mjs CHANGED
@@ -3,7 +3,7 @@ import { BadRequestError, ConfigurationRestAPI, ConfigurationWebsocketStreams, C
3
3
 
4
4
  //#region package.json
5
5
  var name = "@binance/margin-trading";
6
- var version = "13.0.6";
6
+ var version = "13.1.1";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rest-api/modules/account-api.ts
@@ -236,7 +236,7 @@ var AccountApi = class {
236
236
  * Security Type: USER_DATA
237
237
  *
238
238
  * Notes:
239
- * - 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).
239
+ * - 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.
240
240
  *
241
241
  * @summary Adjust cross margin max leverage (USER_DATA)
242
242
  * @param {AdjustCrossMarginMaxLeverageRequest} requestParameters Request parameters.
@@ -788,7 +788,7 @@ var BorrowRepayApi = class {
788
788
  *
789
789
  * Notes:
790
790
  * - If isolatedSymbol is not sent, crossed margin data will be sent.
791
- * - `borrowLimit` is also available from [https://www.binance.com/en/margin-fee](https://www.binance.com/en/margin-fee)
791
+ * - `borrowLimit` is also available from https://www.binance.com/en/margin-fee
792
792
  *
793
793
  * @summary Query Max Borrow (USER_DATA)
794
794
  * @param {QueryMaxBorrowRequest} requestParameters Request parameters.
@@ -1897,6 +1897,23 @@ const TradeApiAxiosParamCreator = function(configuration) {
1897
1897
  timeUnit: _timeUnit
1898
1898
  };
1899
1899
  },
1900
+ queryMarginAccountsOpenOtootocoOrderLists: async (symbol, recvWindow) => {
1901
+ const localVarQueryParameter = {};
1902
+ const localVarBodyParameter = {};
1903
+ const localVarHeaderParameter = {};
1904
+ if (symbol !== void 0 && symbol !== null) localVarQueryParameter["symbol"] = symbol;
1905
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
1906
+ let _timeUnit;
1907
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
1908
+ return {
1909
+ endpoint: "/sapi/v1/margin/oto/openOrderList",
1910
+ method: "GET",
1911
+ queryParams: localVarQueryParameter,
1912
+ bodyParams: localVarBodyParameter,
1913
+ headerParams: localVarHeaderParameter,
1914
+ timeUnit: _timeUnit
1915
+ };
1916
+ },
1900
1917
  queryMarginAccountsOrder: async (symbol, isIsolated, orderId, origClientOrderId, recvWindow) => {
1901
1918
  assertParamExists("queryMarginAccountsOrder", "symbol", symbol);
1902
1919
  const localVarQueryParameter = {};
@@ -2030,12 +2047,12 @@ var TradeApi = class {
2030
2047
  /**
2031
2048
  * **Eligibility**
2032
2049
  *
2033
- * - 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.
2050
+ * - Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
2034
2051
  * - If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
2035
2052
  * - 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.
2036
2053
  * - 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.
2037
2054
  *
2038
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
2055
+ * For more information, please refer to FAQ.
2039
2056
  *
2040
2057
  **Supported Products:**
2041
2058
  *
@@ -2053,7 +2070,7 @@ var TradeApi = class {
2053
2070
  * HMAC
2054
2071
  * RSA
2055
2072
  *
2056
- * 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) .
2073
+ * 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 .
2057
2074
  *
2058
2075
  **How to use the Margin Special Key**
2059
2076
  * - Use the below `sapi` endpoint to create your margin special API Key.
@@ -2061,7 +2078,7 @@ var TradeApi = class {
2061
2078
  * - For accessing the Isolated Margin account(s), pass the relevant `symbol` parameter in the API Key creation request.
2062
2079
  * - 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.
2063
2080
  *
2064
- * 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
2081
+ * Read REST API or WebSocket API documentation to learn how to use different API keys
2065
2082
  *
2066
2083
  * You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
2067
2084
  *
@@ -2153,7 +2170,7 @@ var TradeApi = class {
2153
2170
  * 2. All pre-execution margin checks (including Open-order-loss calculation) will revert to standard mode.
2154
2171
  * 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.
2155
2172
  *
2156
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
2173
+ * For more information, please refer to FAQ.
2157
2174
  *
2158
2175
  **Preconditions:**
2159
2176
  *
@@ -2416,7 +2433,6 @@ var TradeApi = class {
2416
2433
  /**
2417
2434
  * Post a new OTOCO order for margin account:
2418
2435
  *
2419
- *
2420
2436
  * - An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list
2421
2437
  * comprised of 3 orders.
2422
2438
  *
@@ -2426,7 +2442,7 @@ var TradeApi = class {
2426
2442
  * - OTOCO has 2 pending orders (pending above and pending below), forming
2427
2443
  * an OCO pair. The pending orders are only placed on the order book when
2428
2444
  * the working order gets **fully filled**.
2429
- * - 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).
2445
+ * - The rules of the pending above and pending below follow the same rules as the Order List OCO.
2430
2446
  * - OTOCOs add **3 orders** against the unfilled order count,
2431
2447
  * `EXCHANGE_MAX_NUM_ORDERS` filter, and `MAX_NUM_ORDERS` filter.
2432
2448
  *
@@ -2639,6 +2655,30 @@ var TradeApi = class {
2639
2655
  return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
2640
2656
  }
2641
2657
  /**
2658
+ * Retrieves all open OTO / OTOCO order lists of the margin account.
2659
+ *
2660
+ *
2661
+ * Notes:
2662
+ * - 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`).
2663
+ * - For OTO, the `orders` array contains 2 orders: the working order and the pending order.
2664
+ * - For OTOCO, the `orders` array contains 3 orders: the working order and the two pending orders (pending above / pending below).
2665
+ *
2666
+ * Weight(UID): 10
2667
+ *
2668
+ * Security Type: USER_DATA
2669
+ *
2670
+ * @summary Query Margin Account\'s Open OTO/OTOCO Order Lists (USER_DATA)
2671
+ * @param {QueryMarginAccountsOpenOtootocoOrderListsRequest} requestParameters Request parameters.
2672
+ * @returns {Promise<RestApiResponse<QueryMarginAccountsOpenOtootocoOrderListsResponse>>}
2673
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2674
+ * @memberof TradeApi
2675
+ * @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}
2676
+ */
2677
+ async queryMarginAccountsOpenOtootocoOrderLists(requestParameters = {}) {
2678
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryMarginAccountsOpenOtootocoOrderLists(requestParameters?.symbol, requestParameters?.recvWindow);
2679
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs.headerParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
2680
+ }
2681
+ /**
2642
2682
  * Query Margin Account's Order
2643
2683
  *
2644
2684
  * Weight(IP): 10
@@ -3378,7 +3418,7 @@ var RestAPI = class {
3378
3418
  * Security Type: USER_DATA
3379
3419
  *
3380
3420
  * Notes:
3381
- * - 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).
3421
+ * - 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.
3382
3422
  *
3383
3423
  * @summary Adjust cross margin max leverage (USER_DATA)
3384
3424
  * @param {AdjustCrossMarginMaxLeverageRequest} requestParameters Request parameters.
@@ -3732,7 +3772,7 @@ var RestAPI = class {
3732
3772
  *
3733
3773
  * Notes:
3734
3774
  * - If isolatedSymbol is not sent, crossed margin data will be sent.
3735
- * - `borrowLimit` is also available from [https://www.binance.com/en/margin-fee](https://www.binance.com/en/margin-fee)
3775
+ * - `borrowLimit` is also available from https://www.binance.com/en/margin-fee
3736
3776
  *
3737
3777
  * @summary Query Max Borrow (USER_DATA)
3738
3778
  * @param {QueryMaxBorrowRequest} requestParameters Request parameters.
@@ -3979,12 +4019,12 @@ var RestAPI = class {
3979
4019
  /**
3980
4020
  * **Eligibility**
3981
4021
  *
3982
- * - 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.
4022
+ * - Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 7 or higher.
3983
4023
  * - If you are VIP level 6 or below, please contact your VIP manager for eligibility criterias.
3984
4024
  * - 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.
3985
4025
  * - 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.
3986
4026
  *
3987
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
4027
+ * For more information, please refer to FAQ.
3988
4028
  *
3989
4029
  **Supported Products:**
3990
4030
  *
@@ -4002,7 +4042,7 @@ var RestAPI = class {
4002
4042
  * HMAC
4003
4043
  * RSA
4004
4044
  *
4005
- * 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) .
4045
+ * 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 .
4006
4046
  *
4007
4047
  **How to use the Margin Special Key**
4008
4048
  * - Use the below `sapi` endpoint to create your margin special API Key.
@@ -4010,7 +4050,7 @@ var RestAPI = class {
4010
4050
  * - For accessing the Isolated Margin account(s), pass the relevant `symbol` parameter in the API Key creation request.
4011
4051
  * - 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.
4012
4052
  *
4013
- * 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
4053
+ * Read REST API or WebSocket API documentation to learn how to use different API keys
4014
4054
  *
4015
4055
  * You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
4016
4056
  *
@@ -4099,7 +4139,7 @@ var RestAPI = class {
4099
4139
  * 2. All pre-execution margin checks (including Open-order-loss calculation) will revert to standard mode.
4100
4140
  * 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.
4101
4141
  *
4102
- * For more information, please refer to [FAQ](https://www.binance.com/en/support/faq/detail/3208663e900d4d2e9fec4140e1832f4e).
4142
+ * For more information, please refer to FAQ.
4103
4143
  *
4104
4144
  **Preconditions:**
4105
4145
  *
@@ -4351,7 +4391,6 @@ var RestAPI = class {
4351
4391
  /**
4352
4392
  * Post a new OTOCO order for margin account:
4353
4393
  *
4354
- *
4355
4394
  * - An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list
4356
4395
  * comprised of 3 orders.
4357
4396
  *
@@ -4361,7 +4400,7 @@ var RestAPI = class {
4361
4400
  * - OTOCO has 2 pending orders (pending above and pending below), forming
4362
4401
  * an OCO pair. The pending orders are only placed on the order book when
4363
4402
  * the working order gets **fully filled**.
4364
- * - 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).
4403
+ * - The rules of the pending above and pending below follow the same rules as the Order List OCO.
4365
4404
  * - OTOCOs add **3 orders** against the unfilled order count,
4366
4405
  * `EXCHANGE_MAX_NUM_ORDERS` filter, and `MAX_NUM_ORDERS` filter.
4367
4406
  *
@@ -4564,6 +4603,29 @@ var RestAPI = class {
4564
4603
  return this.tradeApi.queryMarginAccountsOpenOrders(requestParameters);
4565
4604
  }
4566
4605
  /**
4606
+ * Retrieves all open OTO / OTOCO order lists of the margin account.
4607
+ *
4608
+ *
4609
+ * Notes:
4610
+ * - 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`).
4611
+ * - For OTO, the `orders` array contains 2 orders: the working order and the pending order.
4612
+ * - For OTOCO, the `orders` array contains 3 orders: the working order and the two pending orders (pending above / pending below).
4613
+ *
4614
+ * Weight(UID): 10
4615
+ *
4616
+ * Security Type: USER_DATA
4617
+ *
4618
+ * @summary Query Margin Account\'s Open OTO/OTOCO Order Lists (USER_DATA)
4619
+ * @param {QueryMarginAccountsOpenOtootocoOrderListsRequest} requestParameters Request parameters.
4620
+ *
4621
+ * @returns {Promise<RestApiResponse<QueryMarginAccountsOpenOtootocoOrderListsResponse>>}
4622
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
4623
+ * @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}
4624
+ */
4625
+ queryMarginAccountsOpenOtootocoOrderLists(requestParameters = {}) {
4626
+ return this.tradeApi.queryMarginAccountsOpenOtootocoOrderLists(requestParameters);
4627
+ }
4628
+ /**
4567
4629
  * Query Margin Account's Order
4568
4630
  *
4569
4631
  * Weight(IP): 10