@binance/margin-trading 4.0.0 → 5.0.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
@@ -5,12 +5,15 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/margin-trading.ts
8
- import { platform, arch } from "os";
9
- import { ConfigurationRestAPI as ConfigurationRestAPI9, MARGIN_TRADING_REST_API_PROD_URL } from "@binance/common";
8
+ import {
9
+ buildUserAgent,
10
+ ConfigurationRestAPI as ConfigurationRestAPI9,
11
+ MARGIN_TRADING_REST_API_PROD_URL
12
+ } from "@binance/common";
10
13
 
11
14
  // package.json
12
15
  var name = "@binance/margin-trading";
13
- var version = "4.0.0";
16
+ var version = "5.0.1";
14
17
 
15
18
  // src/rest-api/index.ts
16
19
  var rest_api_exports = {};
@@ -1291,6 +1294,30 @@ var MarketDataApiAxiosParamCreator = function(configuration) {
1291
1294
  timeUnit: _timeUnit
1292
1295
  };
1293
1296
  },
1297
+ /**
1298
+ * Get the upcoming tokens or symbols listing schedule for Cross Margin and Isolated Margin.
1299
+ *
1300
+ * Weight: 100
1301
+ *
1302
+ * @summary Get list Schedule (MARKET_DATA)
1303
+ * @param {number} [recvWindow] No more than 60000
1304
+ *
1305
+ * @throws {RequiredError}
1306
+ */
1307
+ getListSchedule: async (recvWindow) => {
1308
+ const localVarQueryParameter = {};
1309
+ if (recvWindow !== void 0 && recvWindow !== null) {
1310
+ localVarQueryParameter["recvWindow"] = recvWindow;
1311
+ }
1312
+ let _timeUnit;
1313
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
1314
+ return {
1315
+ endpoint: "/sapi/v1/margin/list-schedule",
1316
+ method: "GET",
1317
+ params: localVarQueryParameter,
1318
+ timeUnit: _timeUnit
1319
+ };
1320
+ },
1294
1321
  /**
1295
1322
  * Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
1296
1323
  *
@@ -1524,6 +1551,31 @@ var MarketDataApi = class {
1524
1551
  { isSigned: false }
1525
1552
  );
1526
1553
  }
1554
+ /**
1555
+ * Get the upcoming tokens or symbols listing schedule for Cross Margin and Isolated Margin.
1556
+ *
1557
+ * Weight: 100
1558
+ *
1559
+ * @summary Get list Schedule (MARKET_DATA)
1560
+ * @param {GetListScheduleRequest} requestParameters Request parameters.
1561
+ * @returns {Promise<RestApiResponse<GetListScheduleResponse>>}
1562
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1563
+ * @memberof MarketDataApi
1564
+ * @see {@link https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule Binance API Documentation}
1565
+ */
1566
+ async getListSchedule(requestParameters = {}) {
1567
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getListSchedule(
1568
+ requestParameters?.recvWindow
1569
+ );
1570
+ return sendRequest3(
1571
+ this.configuration,
1572
+ localVarAxiosArgs.endpoint,
1573
+ localVarAxiosArgs.method,
1574
+ localVarAxiosArgs.params,
1575
+ localVarAxiosArgs?.timeUnit,
1576
+ { isSigned: false }
1577
+ );
1578
+ }
1527
1579
  /**
1528
1580
  * Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
1529
1581
  *
@@ -4859,6 +4911,20 @@ var RestAPI = class {
4859
4911
  getDelistSchedule(requestParameters = {}) {
4860
4912
  return this.marketDataApi.getDelistSchedule(requestParameters);
4861
4913
  }
4914
+ /**
4915
+ * Get the upcoming tokens or symbols listing schedule for Cross Margin and Isolated Margin.
4916
+ *
4917
+ * Weight: 100
4918
+ *
4919
+ * @summary Get list Schedule (MARKET_DATA)
4920
+ * @param {GetListScheduleRequest} requestParameters Request parameters.
4921
+ * @returns {Promise<RestApiResponse<GetListScheduleResponse>>}
4922
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
4923
+ * @see {@link https://developers.binance.com/docs/margin_trading/market-data/Get-list-Schedule Binance API Documentation}
4924
+ */
4925
+ getListSchedule(requestParameters = {}) {
4926
+ return this.marketDataApi.getListSchedule(requestParameters);
4927
+ }
4862
4928
  /**
4863
4929
  * Get isolated margin tier data collection with any tier as https://www.binance.com/en/margin-data
4864
4930
  *
@@ -5500,13 +5566,16 @@ var RestAPI = class {
5500
5566
  // src/margin-trading.ts
5501
5567
  var MarginTrading = class {
5502
5568
  constructor(config) {
5569
+ const userAgent = buildUserAgent(name, version);
5503
5570
  if (config?.configurationRestAPI) {
5504
- const configRestAPI = new ConfigurationRestAPI9(config.configurationRestAPI);
5571
+ const configRestAPI = new ConfigurationRestAPI9(
5572
+ config.configurationRestAPI
5573
+ );
5505
5574
  configRestAPI.basePath = configRestAPI.basePath || MARGIN_TRADING_REST_API_PROD_URL;
5506
5575
  configRestAPI.baseOptions = configRestAPI.baseOptions || {};
5507
5576
  configRestAPI.baseOptions.headers = {
5508
5577
  ...configRestAPI.baseOptions.headers || {},
5509
- "User-Agent": `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`
5578
+ "User-Agent": userAgent
5510
5579
  };
5511
5580
  this.restAPI = new RestAPI(configRestAPI);
5512
5581
  }