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