@binance/derivatives-trading-portfolio-margin-pro 1.0.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 ADDED
@@ -0,0 +1,1513 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name2 in all)
8
+ __defProp(target, name2, { get: all[name2], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ BadRequestError: () => import_common5.BadRequestError,
24
+ ConnectorClientError: () => import_common5.ConnectorClientError,
25
+ DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL: () => import_common5.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL,
26
+ DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_TESTNET_URL: () => import_common5.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_TESTNET_URL,
27
+ DerivativesTradingPortfolioMarginPro: () => DerivativesTradingPortfolioMarginPro,
28
+ DerivativesTradingPortfolioMarginProRestAPI: () => rest_api_exports,
29
+ ForbiddenError: () => import_common5.ForbiddenError,
30
+ NetworkError: () => import_common5.NetworkError,
31
+ NotFoundError: () => import_common5.NotFoundError,
32
+ RateLimitBanError: () => import_common5.RateLimitBanError,
33
+ RequiredError: () => import_common5.RequiredError,
34
+ ServerError: () => import_common5.ServerError,
35
+ TooManyRequestsError: () => import_common5.TooManyRequestsError,
36
+ UnauthorizedError: () => import_common5.UnauthorizedError
37
+ });
38
+ module.exports = __toCommonJS(src_exports);
39
+
40
+ // src/derivatives-trading-portfolio-margin-pro.ts
41
+ var import_os = require("os");
42
+ var import_common4 = require("@binance/common");
43
+
44
+ // package.json
45
+ var name = "@binance/derivatives-trading-portfolio-margin-pro";
46
+ var version = "1.0.0";
47
+
48
+ // src/rest-api/index.ts
49
+ var rest_api_exports = {};
50
+ __export(rest_api_exports, {
51
+ AccountApi: () => AccountApi,
52
+ MarketDataApi: () => MarketDataApi,
53
+ RestAPI: () => RestAPI
54
+ });
55
+
56
+ // src/rest-api/modules/account-api.ts
57
+ var import_common = require("@binance/common");
58
+ var AccountApiAxiosParamCreator = function(configuration) {
59
+ return {
60
+ /**
61
+ * BNB transfer can be between Margin Account and USDM Account
62
+ *
63
+ *
64
+ * You can only use this function 2 times per 10 minutes in a rolling manner
65
+ *
66
+ * Weight: 1500
67
+ *
68
+ * @summary BNB transfer(USER_DATA)
69
+ * @param {number} amount
70
+ * @param {string} transferSide "TO_UM","FROM_UM"
71
+ * @param {number} [recvWindow]
72
+ *
73
+ * @throws {RequiredError}
74
+ */
75
+ bnbTransfer: async (amount, transferSide, recvWindow) => {
76
+ (0, import_common.assertParamExists)("bnbTransfer", "amount", amount);
77
+ (0, import_common.assertParamExists)("bnbTransfer", "transferSide", transferSide);
78
+ const localVarQueryParameter = {};
79
+ if (amount !== void 0 && amount !== null) {
80
+ localVarQueryParameter["amount"] = amount;
81
+ }
82
+ if (transferSide !== void 0 && transferSide !== null) {
83
+ localVarQueryParameter["transferSide"] = transferSide;
84
+ }
85
+ if (recvWindow !== void 0 && recvWindow !== null) {
86
+ localVarQueryParameter["recvWindow"] = recvWindow;
87
+ }
88
+ let _timeUnit;
89
+ if ("timeUnit" in configuration)
90
+ _timeUnit = configuration.timeUnit;
91
+ return {
92
+ endpoint: "/sapi/v1/portfolio/bnb-transfer",
93
+ method: "POST",
94
+ params: localVarQueryParameter,
95
+ timeUnit: _timeUnit
96
+ };
97
+ },
98
+ /**
99
+ * Change Auto-repay-futures Status
100
+ *
101
+ * Weight: 1500
102
+ *
103
+ * @summary Change Auto-repay-futures Status(TRADE)
104
+ * @param {string} autoRepay Default: `true`; `false` for turn off the auto-repay futures negative balance function
105
+ * @param {number} [recvWindow]
106
+ *
107
+ * @throws {RequiredError}
108
+ */
109
+ changeAutoRepayFuturesStatus: async (autoRepay, recvWindow) => {
110
+ (0, import_common.assertParamExists)("changeAutoRepayFuturesStatus", "autoRepay", autoRepay);
111
+ const localVarQueryParameter = {};
112
+ if (autoRepay !== void 0 && autoRepay !== null) {
113
+ localVarQueryParameter["autoRepay"] = autoRepay;
114
+ }
115
+ if (recvWindow !== void 0 && recvWindow !== null) {
116
+ localVarQueryParameter["recvWindow"] = recvWindow;
117
+ }
118
+ let _timeUnit;
119
+ if ("timeUnit" in configuration)
120
+ _timeUnit = configuration.timeUnit;
121
+ return {
122
+ endpoint: "/sapi/v1/portfolio/repay-futures-switch",
123
+ method: "POST",
124
+ params: localVarQueryParameter,
125
+ timeUnit: _timeUnit
126
+ };
127
+ },
128
+ /**
129
+ * Transfers all assets from Futures Account to Margin account
130
+ *
131
+ * The BNB would not be collected from UM-PM account to the Portfolio Margin account.
132
+ * You can only use this function 500 times per hour in a rolling manner.
133
+ *
134
+ * Weight: 1500
135
+ *
136
+ * @summary Fund Auto-collection(USER_DATA)
137
+ * @param {number} [recvWindow]
138
+ *
139
+ * @throws {RequiredError}
140
+ */
141
+ fundAutoCollection: async (recvWindow) => {
142
+ const localVarQueryParameter = {};
143
+ if (recvWindow !== void 0 && recvWindow !== null) {
144
+ localVarQueryParameter["recvWindow"] = recvWindow;
145
+ }
146
+ let _timeUnit;
147
+ if ("timeUnit" in configuration)
148
+ _timeUnit = configuration.timeUnit;
149
+ return {
150
+ endpoint: "/sapi/v1/portfolio/auto-collection",
151
+ method: "POST",
152
+ params: localVarQueryParameter,
153
+ timeUnit: _timeUnit
154
+ };
155
+ },
156
+ /**
157
+ * Transfers specific asset from Futures Account to Margin account
158
+ *
159
+ * The BNB transfer is not be supported
160
+ *
161
+ * Weight: 60
162
+ *
163
+ * @summary Fund Collection by Asset(USER_DATA)
164
+ * @param {string} asset
165
+ * @param {number} [recvWindow]
166
+ *
167
+ * @throws {RequiredError}
168
+ */
169
+ fundCollectionByAsset: async (asset, recvWindow) => {
170
+ (0, import_common.assertParamExists)("fundCollectionByAsset", "asset", asset);
171
+ const localVarQueryParameter = {};
172
+ if (asset !== void 0 && asset !== null) {
173
+ localVarQueryParameter["asset"] = asset;
174
+ }
175
+ if (recvWindow !== void 0 && recvWindow !== null) {
176
+ localVarQueryParameter["recvWindow"] = recvWindow;
177
+ }
178
+ let _timeUnit;
179
+ if ("timeUnit" in configuration)
180
+ _timeUnit = configuration.timeUnit;
181
+ return {
182
+ endpoint: "/sapi/v1/portfolio/asset-collection",
183
+ method: "POST",
184
+ params: localVarQueryParameter,
185
+ timeUnit: _timeUnit
186
+ };
187
+ },
188
+ /**
189
+ * Query Auto-repay-futures Status
190
+ *
191
+ * Weight: 30
192
+ *
193
+ * @summary Get Auto-repay-futures Status(USER_DATA)
194
+ * @param {number} [recvWindow]
195
+ *
196
+ * @throws {RequiredError}
197
+ */
198
+ getAutoRepayFuturesStatus: async (recvWindow) => {
199
+ const localVarQueryParameter = {};
200
+ if (recvWindow !== void 0 && recvWindow !== null) {
201
+ localVarQueryParameter["recvWindow"] = recvWindow;
202
+ }
203
+ let _timeUnit;
204
+ if ("timeUnit" in configuration)
205
+ _timeUnit = configuration.timeUnit;
206
+ return {
207
+ endpoint: "/sapi/v1/portfolio/repay-futures-switch",
208
+ method: "GET",
209
+ params: localVarQueryParameter,
210
+ timeUnit: _timeUnit
211
+ };
212
+ },
213
+ /**
214
+ * Query Portfolio Margin Pro account balance
215
+ *
216
+ * Weight: 20
217
+ *
218
+ * @summary Get Portfolio Margin Pro Account Balance(USER_DATA)
219
+ * @param {string} [asset]
220
+ * @param {number} [recvWindow]
221
+ *
222
+ * @throws {RequiredError}
223
+ */
224
+ getPortfolioMarginProAccountBalance: async (asset, recvWindow) => {
225
+ const localVarQueryParameter = {};
226
+ if (asset !== void 0 && asset !== null) {
227
+ localVarQueryParameter["asset"] = asset;
228
+ }
229
+ if (recvWindow !== void 0 && recvWindow !== null) {
230
+ localVarQueryParameter["recvWindow"] = recvWindow;
231
+ }
232
+ let _timeUnit;
233
+ if ("timeUnit" in configuration)
234
+ _timeUnit = configuration.timeUnit;
235
+ return {
236
+ endpoint: "/sapi/v1/portfolio/balance",
237
+ method: "GET",
238
+ params: localVarQueryParameter,
239
+ timeUnit: _timeUnit
240
+ };
241
+ },
242
+ /**
243
+ * Get Portfolio Margin Pro Account Info
244
+ *
245
+ * Weight: 5
246
+ *
247
+ * @summary Get Portfolio Margin Pro Account Info(USER_DATA)
248
+ * @param {number} [recvWindow]
249
+ *
250
+ * @throws {RequiredError}
251
+ */
252
+ getPortfolioMarginProAccountInfo: async (recvWindow) => {
253
+ const localVarQueryParameter = {};
254
+ if (recvWindow !== void 0 && recvWindow !== null) {
255
+ localVarQueryParameter["recvWindow"] = recvWindow;
256
+ }
257
+ let _timeUnit;
258
+ if ("timeUnit" in configuration)
259
+ _timeUnit = configuration.timeUnit;
260
+ return {
261
+ endpoint: "/sapi/v1/portfolio/account",
262
+ method: "GET",
263
+ params: localVarQueryParameter,
264
+ timeUnit: _timeUnit
265
+ };
266
+ },
267
+ /**
268
+ * Get Portfolio Margin Pro SPAN Account Info (For Portfolio Margin Pro SPAN users only)
269
+ *
270
+ * Weight: 5
271
+ *
272
+ * @summary Get Portfolio Margin Pro SPAN Account Info(USER_DATA)
273
+ * @param {number} [recvWindow]
274
+ *
275
+ * @throws {RequiredError}
276
+ */
277
+ getPortfolioMarginProSpanAccountInfo: async (recvWindow) => {
278
+ const localVarQueryParameter = {};
279
+ if (recvWindow !== void 0 && recvWindow !== null) {
280
+ localVarQueryParameter["recvWindow"] = recvWindow;
281
+ }
282
+ let _timeUnit;
283
+ if ("timeUnit" in configuration)
284
+ _timeUnit = configuration.timeUnit;
285
+ return {
286
+ endpoint: "/sapi/v2/portfolio/account",
287
+ method: "GET",
288
+ params: localVarQueryParameter,
289
+ timeUnit: _timeUnit
290
+ };
291
+ },
292
+ /**
293
+ * Mint BFUSD for all types of Portfolio Margin account
294
+ *
295
+ * Weight: 1500
296
+ *
297
+ * @summary Mint BFUSD for Portfolio Margin(TRADE)
298
+ * @param {string} fromAsset `BFUSD` only
299
+ * @param {string} targetAsset `USDT` only
300
+ * @param {number} amount
301
+ * @param {number} [recvWindow]
302
+ *
303
+ * @throws {RequiredError}
304
+ */
305
+ mintBfusdForPortfolioMargin: async (fromAsset, targetAsset, amount, recvWindow) => {
306
+ (0, import_common.assertParamExists)("mintBfusdForPortfolioMargin", "fromAsset", fromAsset);
307
+ (0, import_common.assertParamExists)("mintBfusdForPortfolioMargin", "targetAsset", targetAsset);
308
+ (0, import_common.assertParamExists)("mintBfusdForPortfolioMargin", "amount", amount);
309
+ const localVarQueryParameter = {};
310
+ if (fromAsset !== void 0 && fromAsset !== null) {
311
+ localVarQueryParameter["fromAsset"] = fromAsset;
312
+ }
313
+ if (targetAsset !== void 0 && targetAsset !== null) {
314
+ localVarQueryParameter["targetAsset"] = targetAsset;
315
+ }
316
+ if (amount !== void 0 && amount !== null) {
317
+ localVarQueryParameter["amount"] = amount;
318
+ }
319
+ if (recvWindow !== void 0 && recvWindow !== null) {
320
+ localVarQueryParameter["recvWindow"] = recvWindow;
321
+ }
322
+ let _timeUnit;
323
+ if ("timeUnit" in configuration)
324
+ _timeUnit = configuration.timeUnit;
325
+ return {
326
+ endpoint: "/sapi/v1/portfolio/mint",
327
+ method: "POST",
328
+ params: localVarQueryParameter,
329
+ timeUnit: _timeUnit
330
+ };
331
+ },
332
+ /**
333
+ * Repay Portfolio Margin Pro Bankruptcy Loan
334
+ *
335
+ * Weight: 3000
336
+ *
337
+ * @summary Portfolio Margin Pro Bankruptcy Loan Repay
338
+ * @param {string} [from] SPOT or MARGIN,default SPOT
339
+ * @param {number} [recvWindow]
340
+ *
341
+ * @throws {RequiredError}
342
+ */
343
+ portfolioMarginProBankruptcyLoanRepay: async (from, recvWindow) => {
344
+ const localVarQueryParameter = {};
345
+ if (from !== void 0 && from !== null) {
346
+ localVarQueryParameter["from"] = from;
347
+ }
348
+ if (recvWindow !== void 0 && recvWindow !== null) {
349
+ localVarQueryParameter["recvWindow"] = recvWindow;
350
+ }
351
+ let _timeUnit;
352
+ if ("timeUnit" in configuration)
353
+ _timeUnit = configuration.timeUnit;
354
+ return {
355
+ endpoint: "/sapi/v1/portfolio/repay",
356
+ method: "POST",
357
+ params: localVarQueryParameter,
358
+ timeUnit: _timeUnit
359
+ };
360
+ },
361
+ /**
362
+ * Query Portfolio Margin Pro Bankruptcy Loan Amount
363
+ *
364
+ * If there’s no classic portfolio margin bankruptcy loan, the amount would be 0
365
+ *
366
+ * Weight: 500
367
+ *
368
+ * @summary Query Portfolio Margin Pro Bankruptcy Loan Amount(USER_DATA)
369
+ * @param {number} [recvWindow]
370
+ *
371
+ * @throws {RequiredError}
372
+ */
373
+ queryPortfolioMarginProBankruptcyLoanAmount: async (recvWindow) => {
374
+ const localVarQueryParameter = {};
375
+ if (recvWindow !== void 0 && recvWindow !== null) {
376
+ localVarQueryParameter["recvWindow"] = recvWindow;
377
+ }
378
+ let _timeUnit;
379
+ if ("timeUnit" in configuration)
380
+ _timeUnit = configuration.timeUnit;
381
+ return {
382
+ endpoint: "/sapi/v1/portfolio/pmLoan",
383
+ method: "GET",
384
+ params: localVarQueryParameter,
385
+ timeUnit: _timeUnit
386
+ };
387
+ },
388
+ /**
389
+ * Query repay history of pmloan for portfolio margin pro.
390
+ *
391
+ * `startTime` and `endTime` cannot be longer than 360 days
392
+ * If `startTime` and `endTime` not sent, return records of the last 30 days by default.
393
+ * If `startTime`is sent and `endTime` is not sent, return records of [startTime, startTime+30d].
394
+ * If `startTime` is not sent and `endTime` is sent, return records of [endTime-30d, endTime].
395
+ *
396
+ * Weight: 500
397
+ *
398
+ * @summary Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA)
399
+ * @param {number} [startTime]
400
+ * @param {number} [endTime]
401
+ * @param {number} [current] Currently querying page. Start from 1. Default:1
402
+ * @param {number} [size] Default:10 Max:100
403
+ * @param {number} [recvWindow]
404
+ *
405
+ * @throws {RequiredError}
406
+ */
407
+ queryPortfolioMarginProBankruptcyLoanRepayHistory: async (startTime, endTime, current, size, recvWindow) => {
408
+ const localVarQueryParameter = {};
409
+ if (startTime !== void 0 && startTime !== null) {
410
+ localVarQueryParameter["startTime"] = startTime;
411
+ }
412
+ if (endTime !== void 0 && endTime !== null) {
413
+ localVarQueryParameter["endTime"] = endTime;
414
+ }
415
+ if (current !== void 0 && current !== null) {
416
+ localVarQueryParameter["current"] = current;
417
+ }
418
+ if (size !== void 0 && size !== null) {
419
+ localVarQueryParameter["size"] = size;
420
+ }
421
+ if (recvWindow !== void 0 && recvWindow !== null) {
422
+ localVarQueryParameter["recvWindow"] = recvWindow;
423
+ }
424
+ let _timeUnit;
425
+ if ("timeUnit" in configuration)
426
+ _timeUnit = configuration.timeUnit;
427
+ return {
428
+ endpoint: "/sapi/v1/portfolio/pmLoan-history",
429
+ method: "GET",
430
+ params: localVarQueryParameter,
431
+ timeUnit: _timeUnit
432
+ };
433
+ },
434
+ /**
435
+ * Query interest history of negative balance for portfolio margin.
436
+ *
437
+ * Weight: 50
438
+ *
439
+ * @summary Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA)
440
+ * @param {string} [asset]
441
+ * @param {number} [startTime]
442
+ * @param {number} [endTime]
443
+ * @param {number} [size] Default:10 Max:100
444
+ * @param {number} [recvWindow]
445
+ *
446
+ * @throws {RequiredError}
447
+ */
448
+ queryPortfolioMarginProNegativeBalanceInterestHistory: async (asset, startTime, endTime, size, recvWindow) => {
449
+ const localVarQueryParameter = {};
450
+ if (asset !== void 0 && asset !== null) {
451
+ localVarQueryParameter["asset"] = asset;
452
+ }
453
+ if (startTime !== void 0 && startTime !== null) {
454
+ localVarQueryParameter["startTime"] = startTime;
455
+ }
456
+ if (endTime !== void 0 && endTime !== null) {
457
+ localVarQueryParameter["endTime"] = endTime;
458
+ }
459
+ if (size !== void 0 && size !== null) {
460
+ localVarQueryParameter["size"] = size;
461
+ }
462
+ if (recvWindow !== void 0 && recvWindow !== null) {
463
+ localVarQueryParameter["recvWindow"] = recvWindow;
464
+ }
465
+ let _timeUnit;
466
+ if ("timeUnit" in configuration)
467
+ _timeUnit = configuration.timeUnit;
468
+ return {
469
+ endpoint: "/sapi/v1/portfolio/interest-history",
470
+ method: "GET",
471
+ params: localVarQueryParameter,
472
+ timeUnit: _timeUnit
473
+ };
474
+ },
475
+ /**
476
+ * Redeem BFUSD for all types of Portfolio Margin account
477
+ *
478
+ * Weight: 1500
479
+ *
480
+ * @summary Redeem BFUSD for Portfolio Margin(TRADE)
481
+ * @param {string} fromAsset `BFUSD` only
482
+ * @param {string} targetAsset `USDT` only
483
+ * @param {number} amount
484
+ * @param {number} [recvWindow]
485
+ *
486
+ * @throws {RequiredError}
487
+ */
488
+ redeemBfusdForPortfolioMargin: async (fromAsset, targetAsset, amount, recvWindow) => {
489
+ (0, import_common.assertParamExists)("redeemBfusdForPortfolioMargin", "fromAsset", fromAsset);
490
+ (0, import_common.assertParamExists)("redeemBfusdForPortfolioMargin", "targetAsset", targetAsset);
491
+ (0, import_common.assertParamExists)("redeemBfusdForPortfolioMargin", "amount", amount);
492
+ const localVarQueryParameter = {};
493
+ if (fromAsset !== void 0 && fromAsset !== null) {
494
+ localVarQueryParameter["fromAsset"] = fromAsset;
495
+ }
496
+ if (targetAsset !== void 0 && targetAsset !== null) {
497
+ localVarQueryParameter["targetAsset"] = targetAsset;
498
+ }
499
+ if (amount !== void 0 && amount !== null) {
500
+ localVarQueryParameter["amount"] = amount;
501
+ }
502
+ if (recvWindow !== void 0 && recvWindow !== null) {
503
+ localVarQueryParameter["recvWindow"] = recvWindow;
504
+ }
505
+ let _timeUnit;
506
+ if ("timeUnit" in configuration)
507
+ _timeUnit = configuration.timeUnit;
508
+ return {
509
+ endpoint: "/sapi/v1/portfolio/redeem",
510
+ method: "POST",
511
+ params: localVarQueryParameter,
512
+ timeUnit: _timeUnit
513
+ };
514
+ },
515
+ /**
516
+ * Repay futures Negative Balance
517
+ *
518
+ * Weight: 1500
519
+ *
520
+ * @summary Repay futures Negative Balance(USER_DATA)
521
+ * @param {string} [from] SPOT or MARGIN,default SPOT
522
+ * @param {number} [recvWindow]
523
+ *
524
+ * @throws {RequiredError}
525
+ */
526
+ repayFuturesNegativeBalance: async (from, recvWindow) => {
527
+ const localVarQueryParameter = {};
528
+ if (from !== void 0 && from !== null) {
529
+ localVarQueryParameter["from"] = from;
530
+ }
531
+ if (recvWindow !== void 0 && recvWindow !== null) {
532
+ localVarQueryParameter["recvWindow"] = recvWindow;
533
+ }
534
+ let _timeUnit;
535
+ if ("timeUnit" in configuration)
536
+ _timeUnit = configuration.timeUnit;
537
+ return {
538
+ endpoint: "/sapi/v1/portfolio/repay-futures-negative-balance",
539
+ method: "POST",
540
+ params: localVarQueryParameter,
541
+ timeUnit: _timeUnit
542
+ };
543
+ }
544
+ };
545
+ };
546
+ var AccountApi = class {
547
+ constructor(configuration) {
548
+ this.configuration = configuration;
549
+ this.localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);
550
+ }
551
+ /**
552
+ * BNB transfer can be between Margin Account and USDM Account
553
+ *
554
+ *
555
+ * You can only use this function 2 times per 10 minutes in a rolling manner
556
+ *
557
+ * Weight: 1500
558
+ *
559
+ * @summary BNB transfer(USER_DATA)
560
+ * @param {BnbTransferRequest} requestParameters Request parameters.
561
+ * @returns {Promise<RestApiResponse<BnbTransferResponse>>}
562
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
563
+ * @memberof AccountApi
564
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer Binance API Documentation}
565
+ */
566
+ async bnbTransfer(requestParameters) {
567
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.bnbTransfer(
568
+ requestParameters?.amount,
569
+ requestParameters?.transferSide,
570
+ requestParameters?.recvWindow
571
+ );
572
+ return (0, import_common.sendRequest)(
573
+ this.configuration,
574
+ localVarAxiosArgs.endpoint,
575
+ localVarAxiosArgs.method,
576
+ localVarAxiosArgs.params,
577
+ localVarAxiosArgs?.timeUnit,
578
+ { isSigned: true }
579
+ );
580
+ }
581
+ /**
582
+ * Change Auto-repay-futures Status
583
+ *
584
+ * Weight: 1500
585
+ *
586
+ * @summary Change Auto-repay-futures Status(TRADE)
587
+ * @param {ChangeAutoRepayFuturesStatusRequest} requestParameters Request parameters.
588
+ * @returns {Promise<RestApiResponse<ChangeAutoRepayFuturesStatusResponse>>}
589
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
590
+ * @memberof AccountApi
591
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status Binance API Documentation}
592
+ */
593
+ async changeAutoRepayFuturesStatus(requestParameters) {
594
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoRepayFuturesStatus(
595
+ requestParameters?.autoRepay,
596
+ requestParameters?.recvWindow
597
+ );
598
+ return (0, import_common.sendRequest)(
599
+ this.configuration,
600
+ localVarAxiosArgs.endpoint,
601
+ localVarAxiosArgs.method,
602
+ localVarAxiosArgs.params,
603
+ localVarAxiosArgs?.timeUnit,
604
+ { isSigned: true }
605
+ );
606
+ }
607
+ /**
608
+ * Transfers all assets from Futures Account to Margin account
609
+ *
610
+ * The BNB would not be collected from UM-PM account to the Portfolio Margin account.
611
+ * You can only use this function 500 times per hour in a rolling manner.
612
+ *
613
+ * Weight: 1500
614
+ *
615
+ * @summary Fund Auto-collection(USER_DATA)
616
+ * @param {FundAutoCollectionRequest} requestParameters Request parameters.
617
+ * @returns {Promise<RestApiResponse<FundAutoCollectionResponse>>}
618
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
619
+ * @memberof AccountApi
620
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection Binance API Documentation}
621
+ */
622
+ async fundAutoCollection(requestParameters = {}) {
623
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.fundAutoCollection(
624
+ requestParameters?.recvWindow
625
+ );
626
+ return (0, import_common.sendRequest)(
627
+ this.configuration,
628
+ localVarAxiosArgs.endpoint,
629
+ localVarAxiosArgs.method,
630
+ localVarAxiosArgs.params,
631
+ localVarAxiosArgs?.timeUnit,
632
+ { isSigned: true }
633
+ );
634
+ }
635
+ /**
636
+ * Transfers specific asset from Futures Account to Margin account
637
+ *
638
+ * The BNB transfer is not be supported
639
+ *
640
+ * Weight: 60
641
+ *
642
+ * @summary Fund Collection by Asset(USER_DATA)
643
+ * @param {FundCollectionByAssetRequest} requestParameters Request parameters.
644
+ * @returns {Promise<RestApiResponse<FundCollectionByAssetResponse>>}
645
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
646
+ * @memberof AccountApi
647
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset Binance API Documentation}
648
+ */
649
+ async fundCollectionByAsset(requestParameters) {
650
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.fundCollectionByAsset(
651
+ requestParameters?.asset,
652
+ requestParameters?.recvWindow
653
+ );
654
+ return (0, import_common.sendRequest)(
655
+ this.configuration,
656
+ localVarAxiosArgs.endpoint,
657
+ localVarAxiosArgs.method,
658
+ localVarAxiosArgs.params,
659
+ localVarAxiosArgs?.timeUnit,
660
+ { isSigned: true }
661
+ );
662
+ }
663
+ /**
664
+ * Query Auto-repay-futures Status
665
+ *
666
+ * Weight: 30
667
+ *
668
+ * @summary Get Auto-repay-futures Status(USER_DATA)
669
+ * @param {GetAutoRepayFuturesStatusRequest} requestParameters Request parameters.
670
+ * @returns {Promise<RestApiResponse<GetAutoRepayFuturesStatusResponse>>}
671
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
672
+ * @memberof AccountApi
673
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status Binance API Documentation}
674
+ */
675
+ async getAutoRepayFuturesStatus(requestParameters = {}) {
676
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getAutoRepayFuturesStatus(
677
+ requestParameters?.recvWindow
678
+ );
679
+ return (0, import_common.sendRequest)(
680
+ this.configuration,
681
+ localVarAxiosArgs.endpoint,
682
+ localVarAxiosArgs.method,
683
+ localVarAxiosArgs.params,
684
+ localVarAxiosArgs?.timeUnit,
685
+ { isSigned: true }
686
+ );
687
+ }
688
+ /**
689
+ * Query Portfolio Margin Pro account balance
690
+ *
691
+ * Weight: 20
692
+ *
693
+ * @summary Get Portfolio Margin Pro Account Balance(USER_DATA)
694
+ * @param {GetPortfolioMarginProAccountBalanceRequest} requestParameters Request parameters.
695
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginProAccountBalanceResponse>>}
696
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
697
+ * @memberof AccountApi
698
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info Binance API Documentation}
699
+ */
700
+ async getPortfolioMarginProAccountBalance(requestParameters = {}) {
701
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginProAccountBalance(
702
+ requestParameters?.asset,
703
+ requestParameters?.recvWindow
704
+ );
705
+ return (0, import_common.sendRequest)(
706
+ this.configuration,
707
+ localVarAxiosArgs.endpoint,
708
+ localVarAxiosArgs.method,
709
+ localVarAxiosArgs.params,
710
+ localVarAxiosArgs?.timeUnit,
711
+ { isSigned: true }
712
+ );
713
+ }
714
+ /**
715
+ * Get Portfolio Margin Pro Account Info
716
+ *
717
+ * Weight: 5
718
+ *
719
+ * @summary Get Portfolio Margin Pro Account Info(USER_DATA)
720
+ * @param {GetPortfolioMarginProAccountInfoRequest} requestParameters Request parameters.
721
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginProAccountInfoResponse>>}
722
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
723
+ * @memberof AccountApi
724
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info Binance API Documentation}
725
+ */
726
+ async getPortfolioMarginProAccountInfo(requestParameters = {}) {
727
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginProAccountInfo(
728
+ requestParameters?.recvWindow
729
+ );
730
+ return (0, import_common.sendRequest)(
731
+ this.configuration,
732
+ localVarAxiosArgs.endpoint,
733
+ localVarAxiosArgs.method,
734
+ localVarAxiosArgs.params,
735
+ localVarAxiosArgs?.timeUnit,
736
+ { isSigned: true }
737
+ );
738
+ }
739
+ /**
740
+ * Get Portfolio Margin Pro SPAN Account Info (For Portfolio Margin Pro SPAN users only)
741
+ *
742
+ * Weight: 5
743
+ *
744
+ * @summary Get Portfolio Margin Pro SPAN Account Info(USER_DATA)
745
+ * @param {GetPortfolioMarginProSpanAccountInfoRequest} requestParameters Request parameters.
746
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginProSpanAccountInfoResponse>>}
747
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
748
+ * @memberof AccountApi
749
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2 Binance API Documentation}
750
+ */
751
+ async getPortfolioMarginProSpanAccountInfo(requestParameters = {}) {
752
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginProSpanAccountInfo(
753
+ requestParameters?.recvWindow
754
+ );
755
+ return (0, import_common.sendRequest)(
756
+ this.configuration,
757
+ localVarAxiosArgs.endpoint,
758
+ localVarAxiosArgs.method,
759
+ localVarAxiosArgs.params,
760
+ localVarAxiosArgs?.timeUnit,
761
+ { isSigned: true }
762
+ );
763
+ }
764
+ /**
765
+ * Mint BFUSD for all types of Portfolio Margin account
766
+ *
767
+ * Weight: 1500
768
+ *
769
+ * @summary Mint BFUSD for Portfolio Margin(TRADE)
770
+ * @param {MintBfusdForPortfolioMarginRequest} requestParameters Request parameters.
771
+ * @returns {Promise<RestApiResponse<MintBfusdForPortfolioMarginResponse>>}
772
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
773
+ * @memberof AccountApi
774
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Mint-BFUSD-Portfolio-Margin Binance API Documentation}
775
+ */
776
+ async mintBfusdForPortfolioMargin(requestParameters) {
777
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.mintBfusdForPortfolioMargin(
778
+ requestParameters?.fromAsset,
779
+ requestParameters?.targetAsset,
780
+ requestParameters?.amount,
781
+ requestParameters?.recvWindow
782
+ );
783
+ return (0, import_common.sendRequest)(
784
+ this.configuration,
785
+ localVarAxiosArgs.endpoint,
786
+ localVarAxiosArgs.method,
787
+ localVarAxiosArgs.params,
788
+ localVarAxiosArgs?.timeUnit,
789
+ { isSigned: true }
790
+ );
791
+ }
792
+ /**
793
+ * Repay Portfolio Margin Pro Bankruptcy Loan
794
+ *
795
+ * Weight: 3000
796
+ *
797
+ * @summary Portfolio Margin Pro Bankruptcy Loan Repay
798
+ * @param {PortfolioMarginProBankruptcyLoanRepayRequest} requestParameters Request parameters.
799
+ * @returns {Promise<RestApiResponse<PortfolioMarginProBankruptcyLoanRepayResponse>>}
800
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
801
+ * @memberof AccountApi
802
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay Binance API Documentation}
803
+ */
804
+ async portfolioMarginProBankruptcyLoanRepay(requestParameters = {}) {
805
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.portfolioMarginProBankruptcyLoanRepay(
806
+ requestParameters?.from,
807
+ requestParameters?.recvWindow
808
+ );
809
+ return (0, import_common.sendRequest)(
810
+ this.configuration,
811
+ localVarAxiosArgs.endpoint,
812
+ localVarAxiosArgs.method,
813
+ localVarAxiosArgs.params,
814
+ localVarAxiosArgs?.timeUnit,
815
+ { isSigned: false }
816
+ );
817
+ }
818
+ /**
819
+ * Query Portfolio Margin Pro Bankruptcy Loan Amount
820
+ *
821
+ * If there’s no classic portfolio margin bankruptcy loan, the amount would be 0
822
+ *
823
+ * Weight: 500
824
+ *
825
+ * @summary Query Portfolio Margin Pro Bankruptcy Loan Amount(USER_DATA)
826
+ * @param {QueryPortfolioMarginProBankruptcyLoanAmountRequest} requestParameters Request parameters.
827
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginProBankruptcyLoanAmountResponse>>}
828
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
829
+ * @memberof AccountApi
830
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount Binance API Documentation}
831
+ */
832
+ async queryPortfolioMarginProBankruptcyLoanAmount(requestParameters = {}) {
833
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginProBankruptcyLoanAmount(
834
+ requestParameters?.recvWindow
835
+ );
836
+ return (0, import_common.sendRequest)(
837
+ this.configuration,
838
+ localVarAxiosArgs.endpoint,
839
+ localVarAxiosArgs.method,
840
+ localVarAxiosArgs.params,
841
+ localVarAxiosArgs?.timeUnit,
842
+ { isSigned: true }
843
+ );
844
+ }
845
+ /**
846
+ * Query repay history of pmloan for portfolio margin pro.
847
+ *
848
+ * `startTime` and `endTime` cannot be longer than 360 days
849
+ * If `startTime` and `endTime` not sent, return records of the last 30 days by default.
850
+ * If `startTime`is sent and `endTime` is not sent, return records of [startTime, startTime+30d].
851
+ * If `startTime` is not sent and `endTime` is sent, return records of [endTime-30d, endTime].
852
+ *
853
+ * Weight: 500
854
+ *
855
+ * @summary Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA)
856
+ * @param {QueryPortfolioMarginProBankruptcyLoanRepayHistoryRequest} requestParameters Request parameters.
857
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse>>}
858
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
859
+ * @memberof AccountApi
860
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History Binance API Documentation}
861
+ */
862
+ async queryPortfolioMarginProBankruptcyLoanRepayHistory(requestParameters = {}) {
863
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginProBankruptcyLoanRepayHistory(
864
+ requestParameters?.startTime,
865
+ requestParameters?.endTime,
866
+ requestParameters?.current,
867
+ requestParameters?.size,
868
+ requestParameters?.recvWindow
869
+ );
870
+ return (0, import_common.sendRequest)(
871
+ this.configuration,
872
+ localVarAxiosArgs.endpoint,
873
+ localVarAxiosArgs.method,
874
+ localVarAxiosArgs.params,
875
+ localVarAxiosArgs?.timeUnit,
876
+ { isSigned: true }
877
+ );
878
+ }
879
+ /**
880
+ * Query interest history of negative balance for portfolio margin.
881
+ *
882
+ * Weight: 50
883
+ *
884
+ * @summary Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA)
885
+ * @param {QueryPortfolioMarginProNegativeBalanceInterestHistoryRequest} requestParameters Request parameters.
886
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse>>}
887
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
888
+ * @memberof AccountApi
889
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History Binance API Documentation}
890
+ */
891
+ async queryPortfolioMarginProNegativeBalanceInterestHistory(requestParameters = {}) {
892
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginProNegativeBalanceInterestHistory(
893
+ requestParameters?.asset,
894
+ requestParameters?.startTime,
895
+ requestParameters?.endTime,
896
+ requestParameters?.size,
897
+ requestParameters?.recvWindow
898
+ );
899
+ return (0, import_common.sendRequest)(
900
+ this.configuration,
901
+ localVarAxiosArgs.endpoint,
902
+ localVarAxiosArgs.method,
903
+ localVarAxiosArgs.params,
904
+ localVarAxiosArgs?.timeUnit,
905
+ { isSigned: true }
906
+ );
907
+ }
908
+ /**
909
+ * Redeem BFUSD for all types of Portfolio Margin account
910
+ *
911
+ * Weight: 1500
912
+ *
913
+ * @summary Redeem BFUSD for Portfolio Margin(TRADE)
914
+ * @param {RedeemBfusdForPortfolioMarginRequest} requestParameters Request parameters.
915
+ * @returns {Promise<RestApiResponse<RedeemBfusdForPortfolioMarginResponse>>}
916
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
917
+ * @memberof AccountApi
918
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Redeem-BFUSD-Portfolio-Margin Binance API Documentation}
919
+ */
920
+ async redeemBfusdForPortfolioMargin(requestParameters) {
921
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemBfusdForPortfolioMargin(
922
+ requestParameters?.fromAsset,
923
+ requestParameters?.targetAsset,
924
+ requestParameters?.amount,
925
+ requestParameters?.recvWindow
926
+ );
927
+ return (0, import_common.sendRequest)(
928
+ this.configuration,
929
+ localVarAxiosArgs.endpoint,
930
+ localVarAxiosArgs.method,
931
+ localVarAxiosArgs.params,
932
+ localVarAxiosArgs?.timeUnit,
933
+ { isSigned: true }
934
+ );
935
+ }
936
+ /**
937
+ * Repay futures Negative Balance
938
+ *
939
+ * Weight: 1500
940
+ *
941
+ * @summary Repay futures Negative Balance(USER_DATA)
942
+ * @param {RepayFuturesNegativeBalanceRequest} requestParameters Request parameters.
943
+ * @returns {Promise<RestApiResponse<RepayFuturesNegativeBalanceResponse>>}
944
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
945
+ * @memberof AccountApi
946
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance Binance API Documentation}
947
+ */
948
+ async repayFuturesNegativeBalance(requestParameters = {}) {
949
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.repayFuturesNegativeBalance(
950
+ requestParameters?.from,
951
+ requestParameters?.recvWindow
952
+ );
953
+ return (0, import_common.sendRequest)(
954
+ this.configuration,
955
+ localVarAxiosArgs.endpoint,
956
+ localVarAxiosArgs.method,
957
+ localVarAxiosArgs.params,
958
+ localVarAxiosArgs?.timeUnit,
959
+ { isSigned: true }
960
+ );
961
+ }
962
+ };
963
+
964
+ // src/rest-api/modules/market-data-api.ts
965
+ var import_common2 = require("@binance/common");
966
+ var MarketDataApiAxiosParamCreator = function(configuration) {
967
+ return {
968
+ /**
969
+ * Get Portfolio Margin Asset Leverage
970
+ *
971
+ * Weight: 50
972
+ *
973
+ * @summary Get Portfolio Margin Asset Leverage(USER_DATA)
974
+ *
975
+ * @throws {RequiredError}
976
+ */
977
+ getPortfolioMarginAssetLeverage: async () => {
978
+ const localVarQueryParameter = {};
979
+ let _timeUnit;
980
+ if ("timeUnit" in configuration)
981
+ _timeUnit = configuration.timeUnit;
982
+ return {
983
+ endpoint: "/sapi/v1/portfolio/margin-asset-leverage",
984
+ method: "GET",
985
+ params: localVarQueryParameter,
986
+ timeUnit: _timeUnit
987
+ };
988
+ },
989
+ /**
990
+ * Portfolio Margin Collateral Rate
991
+ *
992
+ * Weight: 50
993
+ *
994
+ * @summary Portfolio Margin Collateral Rate(MARKET_DATA)
995
+ *
996
+ * @throws {RequiredError}
997
+ */
998
+ portfolioMarginCollateralRate: async () => {
999
+ const localVarQueryParameter = {};
1000
+ let _timeUnit;
1001
+ if ("timeUnit" in configuration)
1002
+ _timeUnit = configuration.timeUnit;
1003
+ return {
1004
+ endpoint: "/sapi/v1/portfolio/collateralRate",
1005
+ method: "GET",
1006
+ params: localVarQueryParameter,
1007
+ timeUnit: _timeUnit
1008
+ };
1009
+ },
1010
+ /**
1011
+ * Portfolio Margin PRO Tiered Collateral Rate
1012
+ *
1013
+ * Weight: 50
1014
+ *
1015
+ * @summary Portfolio Margin Pro Tiered Collateral Rate(USER_DATA)
1016
+ * @param {number} [recvWindow]
1017
+ *
1018
+ * @throws {RequiredError}
1019
+ */
1020
+ portfolioMarginProTieredCollateralRate: async (recvWindow) => {
1021
+ const localVarQueryParameter = {};
1022
+ if (recvWindow !== void 0 && recvWindow !== null) {
1023
+ localVarQueryParameter["recvWindow"] = recvWindow;
1024
+ }
1025
+ let _timeUnit;
1026
+ if ("timeUnit" in configuration)
1027
+ _timeUnit = configuration.timeUnit;
1028
+ return {
1029
+ endpoint: "/sapi/v2/portfolio/collateralRate",
1030
+ method: "GET",
1031
+ params: localVarQueryParameter,
1032
+ timeUnit: _timeUnit
1033
+ };
1034
+ },
1035
+ /**
1036
+ * Query Portfolio Margin Asset Index Price
1037
+ *
1038
+ * Weight: 1 if send asset or 50 if not send asset
1039
+ *
1040
+ * @summary Query Portfolio Margin Asset Index Price (MARKET_DATA)
1041
+ * @param {string} [asset]
1042
+ *
1043
+ * @throws {RequiredError}
1044
+ */
1045
+ queryPortfolioMarginAssetIndexPrice: async (asset) => {
1046
+ const localVarQueryParameter = {};
1047
+ if (asset !== void 0 && asset !== null) {
1048
+ localVarQueryParameter["asset"] = asset;
1049
+ }
1050
+ let _timeUnit;
1051
+ if ("timeUnit" in configuration)
1052
+ _timeUnit = configuration.timeUnit;
1053
+ return {
1054
+ endpoint: "/sapi/v1/portfolio/asset-index-price",
1055
+ method: "GET",
1056
+ params: localVarQueryParameter,
1057
+ timeUnit: _timeUnit
1058
+ };
1059
+ }
1060
+ };
1061
+ };
1062
+ var MarketDataApi = class {
1063
+ constructor(configuration) {
1064
+ this.configuration = configuration;
1065
+ this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
1066
+ }
1067
+ /**
1068
+ * Get Portfolio Margin Asset Leverage
1069
+ *
1070
+ * Weight: 50
1071
+ *
1072
+ * @summary Get Portfolio Margin Asset Leverage(USER_DATA)
1073
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginAssetLeverageResponse>>}
1074
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1075
+ * @memberof MarketDataApi
1076
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage Binance API Documentation}
1077
+ */
1078
+ async getPortfolioMarginAssetLeverage() {
1079
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginAssetLeverage();
1080
+ return (0, import_common2.sendRequest)(
1081
+ this.configuration,
1082
+ localVarAxiosArgs.endpoint,
1083
+ localVarAxiosArgs.method,
1084
+ localVarAxiosArgs.params,
1085
+ localVarAxiosArgs?.timeUnit,
1086
+ { isSigned: true }
1087
+ );
1088
+ }
1089
+ /**
1090
+ * Portfolio Margin Collateral Rate
1091
+ *
1092
+ * Weight: 50
1093
+ *
1094
+ * @summary Portfolio Margin Collateral Rate(MARKET_DATA)
1095
+ * @returns {Promise<RestApiResponse<PortfolioMarginCollateralRateResponse>>}
1096
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1097
+ * @memberof MarketDataApi
1098
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate Binance API Documentation}
1099
+ */
1100
+ async portfolioMarginCollateralRate() {
1101
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.portfolioMarginCollateralRate();
1102
+ return (0, import_common2.sendRequest)(
1103
+ this.configuration,
1104
+ localVarAxiosArgs.endpoint,
1105
+ localVarAxiosArgs.method,
1106
+ localVarAxiosArgs.params,
1107
+ localVarAxiosArgs?.timeUnit,
1108
+ { isSigned: false }
1109
+ );
1110
+ }
1111
+ /**
1112
+ * Portfolio Margin PRO Tiered Collateral Rate
1113
+ *
1114
+ * Weight: 50
1115
+ *
1116
+ * @summary Portfolio Margin Pro Tiered Collateral Rate(USER_DATA)
1117
+ * @param {PortfolioMarginProTieredCollateralRateRequest} requestParameters Request parameters.
1118
+ * @returns {Promise<RestApiResponse<PortfolioMarginProTieredCollateralRateResponse>>}
1119
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1120
+ * @memberof MarketDataApi
1121
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate Binance API Documentation}
1122
+ */
1123
+ async portfolioMarginProTieredCollateralRate(requestParameters = {}) {
1124
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.portfolioMarginProTieredCollateralRate(
1125
+ requestParameters?.recvWindow
1126
+ );
1127
+ return (0, import_common2.sendRequest)(
1128
+ this.configuration,
1129
+ localVarAxiosArgs.endpoint,
1130
+ localVarAxiosArgs.method,
1131
+ localVarAxiosArgs.params,
1132
+ localVarAxiosArgs?.timeUnit,
1133
+ { isSigned: true }
1134
+ );
1135
+ }
1136
+ /**
1137
+ * Query Portfolio Margin Asset Index Price
1138
+ *
1139
+ * Weight: 1 if send asset or 50 if not send asset
1140
+ *
1141
+ * @summary Query Portfolio Margin Asset Index Price (MARKET_DATA)
1142
+ * @param {QueryPortfolioMarginAssetIndexPriceRequest} requestParameters Request parameters.
1143
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginAssetIndexPriceResponse>>}
1144
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1145
+ * @memberof MarketDataApi
1146
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Query-Portfolio-Margin-Asset-Index-Price Binance API Documentation}
1147
+ */
1148
+ async queryPortfolioMarginAssetIndexPrice(requestParameters = {}) {
1149
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginAssetIndexPrice(
1150
+ requestParameters?.asset
1151
+ );
1152
+ return (0, import_common2.sendRequest)(
1153
+ this.configuration,
1154
+ localVarAxiosArgs.endpoint,
1155
+ localVarAxiosArgs.method,
1156
+ localVarAxiosArgs.params,
1157
+ localVarAxiosArgs?.timeUnit,
1158
+ { isSigned: false }
1159
+ );
1160
+ }
1161
+ };
1162
+
1163
+ // src/rest-api/rest-api.ts
1164
+ var import_common3 = require("@binance/common");
1165
+ var RestAPI = class {
1166
+ constructor(configuration) {
1167
+ this.configuration = configuration;
1168
+ this.accountApi = new AccountApi(configuration);
1169
+ this.marketDataApi = new MarketDataApi(configuration);
1170
+ }
1171
+ /**
1172
+ * Generic function to send a request.
1173
+ * @param endpoint - The API endpoint to call.
1174
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
1175
+ * @param params - Query parameters for the request.
1176
+ *
1177
+ * @returns A promise resolving to the response data object.
1178
+ */
1179
+ sendRequest(endpoint, method, params = {}) {
1180
+ return (0, import_common3.sendRequest)(this.configuration, endpoint, method, params, void 0);
1181
+ }
1182
+ /**
1183
+ * Generic function to send a signed request.
1184
+ * @param endpoint - The API endpoint to call.
1185
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
1186
+ * @param params - Query parameters for the request.
1187
+ *
1188
+ * @returns A promise resolving to the response data object.
1189
+ */
1190
+ sendSignedRequest(endpoint, method, params = {}) {
1191
+ return (0, import_common3.sendRequest)(this.configuration, endpoint, method, params, void 0, {
1192
+ isSigned: true
1193
+ });
1194
+ }
1195
+ /**
1196
+ * BNB transfer can be between Margin Account and USDM Account
1197
+ *
1198
+ *
1199
+ * You can only use this function 2 times per 10 minutes in a rolling manner
1200
+ *
1201
+ * Weight: 1500
1202
+ *
1203
+ * @summary BNB transfer(USER_DATA)
1204
+ * @param {BnbTransferRequest} requestParameters Request parameters.
1205
+ * @returns {Promise<RestApiResponse<BnbTransferResponse>>}
1206
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1207
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/BNB-transfer Binance API Documentation}
1208
+ */
1209
+ bnbTransfer(requestParameters) {
1210
+ return this.accountApi.bnbTransfer(requestParameters);
1211
+ }
1212
+ /**
1213
+ * Change Auto-repay-futures Status
1214
+ *
1215
+ * Weight: 1500
1216
+ *
1217
+ * @summary Change Auto-repay-futures Status(TRADE)
1218
+ * @param {ChangeAutoRepayFuturesStatusRequest} requestParameters Request parameters.
1219
+ * @returns {Promise<RestApiResponse<ChangeAutoRepayFuturesStatusResponse>>}
1220
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1221
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Change-Auto-repay-futures-Status Binance API Documentation}
1222
+ */
1223
+ changeAutoRepayFuturesStatus(requestParameters) {
1224
+ return this.accountApi.changeAutoRepayFuturesStatus(requestParameters);
1225
+ }
1226
+ /**
1227
+ * Transfers all assets from Futures Account to Margin account
1228
+ *
1229
+ * The BNB would not be collected from UM-PM account to the Portfolio Margin account.
1230
+ * You can only use this function 500 times per hour in a rolling manner.
1231
+ *
1232
+ * Weight: 1500
1233
+ *
1234
+ * @summary Fund Auto-collection(USER_DATA)
1235
+ * @param {FundAutoCollectionRequest} requestParameters Request parameters.
1236
+ * @returns {Promise<RestApiResponse<FundAutoCollectionResponse>>}
1237
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1238
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Auto-collection Binance API Documentation}
1239
+ */
1240
+ fundAutoCollection(requestParameters = {}) {
1241
+ return this.accountApi.fundAutoCollection(requestParameters);
1242
+ }
1243
+ /**
1244
+ * Transfers specific asset from Futures Account to Margin account
1245
+ *
1246
+ * The BNB transfer is not be supported
1247
+ *
1248
+ * Weight: 60
1249
+ *
1250
+ * @summary Fund Collection by Asset(USER_DATA)
1251
+ * @param {FundCollectionByAssetRequest} requestParameters Request parameters.
1252
+ * @returns {Promise<RestApiResponse<FundCollectionByAssetResponse>>}
1253
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1254
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Fund-Collection-by-Asset Binance API Documentation}
1255
+ */
1256
+ fundCollectionByAsset(requestParameters) {
1257
+ return this.accountApi.fundCollectionByAsset(requestParameters);
1258
+ }
1259
+ /**
1260
+ * Query Auto-repay-futures Status
1261
+ *
1262
+ * Weight: 30
1263
+ *
1264
+ * @summary Get Auto-repay-futures Status(USER_DATA)
1265
+ * @param {GetAutoRepayFuturesStatusRequest} requestParameters Request parameters.
1266
+ * @returns {Promise<RestApiResponse<GetAutoRepayFuturesStatusResponse>>}
1267
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1268
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Auto-repay-futures-Status Binance API Documentation}
1269
+ */
1270
+ getAutoRepayFuturesStatus(requestParameters = {}) {
1271
+ return this.accountApi.getAutoRepayFuturesStatus(requestParameters);
1272
+ }
1273
+ /**
1274
+ * Query Portfolio Margin Pro account balance
1275
+ *
1276
+ * Weight: 20
1277
+ *
1278
+ * @summary Get Portfolio Margin Pro Account Balance(USER_DATA)
1279
+ * @param {GetPortfolioMarginProAccountBalanceRequest} requestParameters Request parameters.
1280
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginProAccountBalanceResponse>>}
1281
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1282
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Balance-Info Binance API Documentation}
1283
+ */
1284
+ getPortfolioMarginProAccountBalance(requestParameters = {}) {
1285
+ return this.accountApi.getPortfolioMarginProAccountBalance(requestParameters);
1286
+ }
1287
+ /**
1288
+ * Get Portfolio Margin Pro Account Info
1289
+ *
1290
+ * Weight: 5
1291
+ *
1292
+ * @summary Get Portfolio Margin Pro Account Info(USER_DATA)
1293
+ * @param {GetPortfolioMarginProAccountInfoRequest} requestParameters Request parameters.
1294
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginProAccountInfoResponse>>}
1295
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1296
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info Binance API Documentation}
1297
+ */
1298
+ getPortfolioMarginProAccountInfo(requestParameters = {}) {
1299
+ return this.accountApi.getPortfolioMarginProAccountInfo(requestParameters);
1300
+ }
1301
+ /**
1302
+ * Get Portfolio Margin Pro SPAN Account Info (For Portfolio Margin Pro SPAN users only)
1303
+ *
1304
+ * Weight: 5
1305
+ *
1306
+ * @summary Get Portfolio Margin Pro SPAN Account Info(USER_DATA)
1307
+ * @param {GetPortfolioMarginProSpanAccountInfoRequest} requestParameters Request parameters.
1308
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginProSpanAccountInfoResponse>>}
1309
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1310
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Get-Classic-Portfolio-Margin-Account-Info-V2 Binance API Documentation}
1311
+ */
1312
+ getPortfolioMarginProSpanAccountInfo(requestParameters = {}) {
1313
+ return this.accountApi.getPortfolioMarginProSpanAccountInfo(requestParameters);
1314
+ }
1315
+ /**
1316
+ * Mint BFUSD for all types of Portfolio Margin account
1317
+ *
1318
+ * Weight: 1500
1319
+ *
1320
+ * @summary Mint BFUSD for Portfolio Margin(TRADE)
1321
+ * @param {MintBfusdForPortfolioMarginRequest} requestParameters Request parameters.
1322
+ * @returns {Promise<RestApiResponse<MintBfusdForPortfolioMarginResponse>>}
1323
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1324
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Mint-BFUSD-Portfolio-Margin Binance API Documentation}
1325
+ */
1326
+ mintBfusdForPortfolioMargin(requestParameters) {
1327
+ return this.accountApi.mintBfusdForPortfolioMargin(requestParameters);
1328
+ }
1329
+ /**
1330
+ * Repay Portfolio Margin Pro Bankruptcy Loan
1331
+ *
1332
+ * Weight: 3000
1333
+ *
1334
+ * @summary Portfolio Margin Pro Bankruptcy Loan Repay
1335
+ * @param {PortfolioMarginProBankruptcyLoanRepayRequest} requestParameters Request parameters.
1336
+ * @returns {Promise<RestApiResponse<PortfolioMarginProBankruptcyLoanRepayResponse>>}
1337
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1338
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Classic-Portfolio-Margin-Bankruptcy-Loan-Repay Binance API Documentation}
1339
+ */
1340
+ portfolioMarginProBankruptcyLoanRepay(requestParameters = {}) {
1341
+ return this.accountApi.portfolioMarginProBankruptcyLoanRepay(requestParameters);
1342
+ }
1343
+ /**
1344
+ * Query Portfolio Margin Pro Bankruptcy Loan Amount
1345
+ *
1346
+ * If there’s no classic portfolio margin bankruptcy loan, the amount would be 0
1347
+ *
1348
+ * Weight: 500
1349
+ *
1350
+ * @summary Query Portfolio Margin Pro Bankruptcy Loan Amount(USER_DATA)
1351
+ * @param {QueryPortfolioMarginProBankruptcyLoanAmountRequest} requestParameters Request parameters.
1352
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginProBankruptcyLoanAmountResponse>>}
1353
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1354
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Bankruptcy-Loan-Amount Binance API Documentation}
1355
+ */
1356
+ queryPortfolioMarginProBankruptcyLoanAmount(requestParameters = {}) {
1357
+ return this.accountApi.queryPortfolioMarginProBankruptcyLoanAmount(requestParameters);
1358
+ }
1359
+ /**
1360
+ * Query repay history of pmloan for portfolio margin pro.
1361
+ *
1362
+ * `startTime` and `endTime` cannot be longer than 360 days
1363
+ * If `startTime` and `endTime` not sent, return records of the last 30 days by default.
1364
+ * If `startTime`is sent and `endTime` is not sent, return records of [startTime, startTime+30d].
1365
+ * If `startTime` is not sent and `endTime` is sent, return records of [endTime-30d, endTime].
1366
+ *
1367
+ * Weight: 500
1368
+ *
1369
+ * @summary Query Portfolio Margin Pro Bankruptcy Loan Repay History(USER_DATA)
1370
+ * @param {QueryPortfolioMarginProBankruptcyLoanRepayHistoryRequest} requestParameters Request parameters.
1371
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse>>}
1372
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1373
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Portfolio-Margin-Pro-Bankruptcy-Loan-Repay-History Binance API Documentation}
1374
+ */
1375
+ queryPortfolioMarginProBankruptcyLoanRepayHistory(requestParameters = {}) {
1376
+ return this.accountApi.queryPortfolioMarginProBankruptcyLoanRepayHistory(requestParameters);
1377
+ }
1378
+ /**
1379
+ * Query interest history of negative balance for portfolio margin.
1380
+ *
1381
+ * Weight: 50
1382
+ *
1383
+ * @summary Query Portfolio Margin Pro Negative Balance Interest History(USER_DATA)
1384
+ * @param {QueryPortfolioMarginProNegativeBalanceInterestHistoryRequest} requestParameters Request parameters.
1385
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse>>}
1386
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1387
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Query-Classic-Portfolio-Margin-Negative-Balance-Interest-History Binance API Documentation}
1388
+ */
1389
+ queryPortfolioMarginProNegativeBalanceInterestHistory(requestParameters = {}) {
1390
+ return this.accountApi.queryPortfolioMarginProNegativeBalanceInterestHistory(
1391
+ requestParameters
1392
+ );
1393
+ }
1394
+ /**
1395
+ * Redeem BFUSD for all types of Portfolio Margin account
1396
+ *
1397
+ * Weight: 1500
1398
+ *
1399
+ * @summary Redeem BFUSD for Portfolio Margin(TRADE)
1400
+ * @param {RedeemBfusdForPortfolioMarginRequest} requestParameters Request parameters.
1401
+ * @returns {Promise<RestApiResponse<RedeemBfusdForPortfolioMarginResponse>>}
1402
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1403
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Redeem-BFUSD-Portfolio-Margin Binance API Documentation}
1404
+ */
1405
+ redeemBfusdForPortfolioMargin(requestParameters) {
1406
+ return this.accountApi.redeemBfusdForPortfolioMargin(requestParameters);
1407
+ }
1408
+ /**
1409
+ * Repay futures Negative Balance
1410
+ *
1411
+ * Weight: 1500
1412
+ *
1413
+ * @summary Repay futures Negative Balance(USER_DATA)
1414
+ * @param {RepayFuturesNegativeBalanceRequest} requestParameters Request parameters.
1415
+ * @returns {Promise<RestApiResponse<RepayFuturesNegativeBalanceResponse>>}
1416
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1417
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/account/Repay-futures-Negative-Balance Binance API Documentation}
1418
+ */
1419
+ repayFuturesNegativeBalance(requestParameters = {}) {
1420
+ return this.accountApi.repayFuturesNegativeBalance(requestParameters);
1421
+ }
1422
+ /**
1423
+ * Get Portfolio Margin Asset Leverage
1424
+ *
1425
+ * Weight: 50
1426
+ *
1427
+ * @summary Get Portfolio Margin Asset Leverage(USER_DATA)
1428
+ * @returns {Promise<RestApiResponse<GetPortfolioMarginAssetLeverageResponse>>}
1429
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1430
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Get-Portfolio-Margin-Asset-Leverage Binance API Documentation}
1431
+ */
1432
+ getPortfolioMarginAssetLeverage() {
1433
+ return this.marketDataApi.getPortfolioMarginAssetLeverage();
1434
+ }
1435
+ /**
1436
+ * Portfolio Margin Collateral Rate
1437
+ *
1438
+ * Weight: 50
1439
+ *
1440
+ * @summary Portfolio Margin Collateral Rate(MARKET_DATA)
1441
+ * @returns {Promise<RestApiResponse<PortfolioMarginCollateralRateResponse>>}
1442
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1443
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Classic-Portfolio-Margin-Collateral-Rate Binance API Documentation}
1444
+ */
1445
+ portfolioMarginCollateralRate() {
1446
+ return this.marketDataApi.portfolioMarginCollateralRate();
1447
+ }
1448
+ /**
1449
+ * Portfolio Margin PRO Tiered Collateral Rate
1450
+ *
1451
+ * Weight: 50
1452
+ *
1453
+ * @summary Portfolio Margin Pro Tiered Collateral Rate(USER_DATA)
1454
+ * @param {PortfolioMarginProTieredCollateralRateRequest} requestParameters Request parameters.
1455
+ * @returns {Promise<RestApiResponse<PortfolioMarginProTieredCollateralRateResponse>>}
1456
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1457
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Portfolio-Margin-Pro-Tiered-Collateral-Rate Binance API Documentation}
1458
+ */
1459
+ portfolioMarginProTieredCollateralRate(requestParameters = {}) {
1460
+ return this.marketDataApi.portfolioMarginProTieredCollateralRate(requestParameters);
1461
+ }
1462
+ /**
1463
+ * Query Portfolio Margin Asset Index Price
1464
+ *
1465
+ * Weight: 1 if send asset or 50 if not send asset
1466
+ *
1467
+ * @summary Query Portfolio Margin Asset Index Price (MARKET_DATA)
1468
+ * @param {QueryPortfolioMarginAssetIndexPriceRequest} requestParameters Request parameters.
1469
+ * @returns {Promise<RestApiResponse<QueryPortfolioMarginAssetIndexPriceResponse>>}
1470
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1471
+ * @see {@link https://developers.binance.com/docs/derivatives/portfolio-margin-pro/market-data/Query-Portfolio-Margin-Asset-Index-Price Binance API Documentation}
1472
+ */
1473
+ queryPortfolioMarginAssetIndexPrice(requestParameters = {}) {
1474
+ return this.marketDataApi.queryPortfolioMarginAssetIndexPrice(requestParameters);
1475
+ }
1476
+ };
1477
+
1478
+ // src/derivatives-trading-portfolio-margin-pro.ts
1479
+ var DerivativesTradingPortfolioMarginPro = class {
1480
+ constructor(config) {
1481
+ if (config?.configurationRestAPI) {
1482
+ const configRestAPI = new import_common4.ConfigurationRestAPI(config.configurationRestAPI);
1483
+ configRestAPI.basePath = configRestAPI.basePath || import_common4.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL;
1484
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
1485
+ configRestAPI.baseOptions.headers = {
1486
+ ...configRestAPI.baseOptions.headers || {},
1487
+ "User-Agent": `${name}/${version} (Node.js/${process.version}; ${(0, import_os.platform)()}; ${(0, import_os.arch)()})`
1488
+ };
1489
+ this.restAPI = new RestAPI(configRestAPI);
1490
+ }
1491
+ }
1492
+ };
1493
+
1494
+ // src/index.ts
1495
+ var import_common5 = require("@binance/common");
1496
+ // Annotate the CommonJS export names for ESM import in node:
1497
+ 0 && (module.exports = {
1498
+ BadRequestError,
1499
+ ConnectorClientError,
1500
+ DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL,
1501
+ DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_TESTNET_URL,
1502
+ DerivativesTradingPortfolioMarginPro,
1503
+ DerivativesTradingPortfolioMarginProRestAPI,
1504
+ ForbiddenError,
1505
+ NetworkError,
1506
+ NotFoundError,
1507
+ RateLimitBanError,
1508
+ RequiredError,
1509
+ ServerError,
1510
+ TooManyRequestsError,
1511
+ UnauthorizedError
1512
+ });
1513
+ //# sourceMappingURL=index.js.map