@binance/derivatives-trading-portfolio-margin-pro 11.0.1 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +85 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -45
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1758,20 +1758,22 @@ declare class RestAPI {
|
|
|
1758
1758
|
* Generic function to send a request.
|
|
1759
1759
|
* @param endpoint - The API endpoint to call.
|
|
1760
1760
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
1761
|
-
* @param
|
|
1761
|
+
* @param queryParams - Query parameters for the request.
|
|
1762
|
+
* @param bodyParams - Body parameters for the request.
|
|
1762
1763
|
*
|
|
1763
1764
|
* @returns A promise resolving to the response data object.
|
|
1764
1765
|
*/
|
|
1765
|
-
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
1766
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
1766
1767
|
/**
|
|
1767
1768
|
* Generic function to send a signed request.
|
|
1768
1769
|
* @param endpoint - The API endpoint to call.
|
|
1769
1770
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
1770
|
-
* @param
|
|
1771
|
+
* @param queryParams - Query parameters for the request.
|
|
1772
|
+
* @param bodyParams - Body parameters for the request.
|
|
1771
1773
|
*
|
|
1772
1774
|
* @returns A promise resolving to the response data object.
|
|
1773
1775
|
*/
|
|
1774
|
-
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
1776
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
1775
1777
|
/**
|
|
1776
1778
|
* BNB transfer can be between Margin Account and USDM Account
|
|
1777
1779
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1760,20 +1760,22 @@ declare class RestAPI {
|
|
|
1760
1760
|
* Generic function to send a request.
|
|
1761
1761
|
* @param endpoint - The API endpoint to call.
|
|
1762
1762
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
1763
|
-
* @param
|
|
1763
|
+
* @param queryParams - Query parameters for the request.
|
|
1764
|
+
* @param bodyParams - Body parameters for the request.
|
|
1764
1765
|
*
|
|
1765
1766
|
* @returns A promise resolving to the response data object.
|
|
1766
1767
|
*/
|
|
1767
|
-
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
1768
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
1768
1769
|
/**
|
|
1769
1770
|
* Generic function to send a signed request.
|
|
1770
1771
|
* @param endpoint - The API endpoint to call.
|
|
1771
1772
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
1772
|
-
* @param
|
|
1773
|
+
* @param queryParams - Query parameters for the request.
|
|
1774
|
+
* @param bodyParams - Body parameters for the request.
|
|
1773
1775
|
*
|
|
1774
1776
|
* @returns A promise resolving to the response data object.
|
|
1775
1777
|
*/
|
|
1776
|
-
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
1778
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
1777
1779
|
/**
|
|
1778
1780
|
* BNB transfer can be between Margin Account and USDM Account
|
|
1779
1781
|
*
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ let __binance_common = require("@binance/common");
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "@binance/derivatives-trading-portfolio-margin-pro";
|
|
17
|
-
var version = "11.0
|
|
17
|
+
var version = "11.1.0";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/rest-api/modules/account-api.ts
|
|
@@ -39,6 +39,7 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
39
39
|
(0, __binance_common.assertParamExists)("bnbTransfer", "amount", amount);
|
|
40
40
|
(0, __binance_common.assertParamExists)("bnbTransfer", "transferSide", transferSide);
|
|
41
41
|
const localVarQueryParameter = {};
|
|
42
|
+
const localVarBodyParameter = {};
|
|
42
43
|
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
|
|
43
44
|
if (transferSide !== void 0 && transferSide !== null) localVarQueryParameter["transferSide"] = transferSide;
|
|
44
45
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
@@ -47,13 +48,15 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
47
48
|
return {
|
|
48
49
|
endpoint: "/sapi/v1/portfolio/bnb-transfer",
|
|
49
50
|
method: "POST",
|
|
50
|
-
|
|
51
|
+
queryParams: localVarQueryParameter,
|
|
52
|
+
bodyParams: localVarBodyParameter,
|
|
51
53
|
timeUnit: _timeUnit
|
|
52
54
|
};
|
|
53
55
|
},
|
|
54
56
|
changeAutoRepayFuturesStatus: async (autoRepay, recvWindow) => {
|
|
55
57
|
(0, __binance_common.assertParamExists)("changeAutoRepayFuturesStatus", "autoRepay", autoRepay);
|
|
56
58
|
const localVarQueryParameter = {};
|
|
59
|
+
const localVarBodyParameter = {};
|
|
57
60
|
if (autoRepay !== void 0 && autoRepay !== null) localVarQueryParameter["autoRepay"] = autoRepay;
|
|
58
61
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
59
62
|
let _timeUnit;
|
|
@@ -61,25 +64,29 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
61
64
|
return {
|
|
62
65
|
endpoint: "/sapi/v1/portfolio/repay-futures-switch",
|
|
63
66
|
method: "POST",
|
|
64
|
-
|
|
67
|
+
queryParams: localVarQueryParameter,
|
|
68
|
+
bodyParams: localVarBodyParameter,
|
|
65
69
|
timeUnit: _timeUnit
|
|
66
70
|
};
|
|
67
71
|
},
|
|
68
72
|
fundAutoCollection: async (recvWindow) => {
|
|
69
73
|
const localVarQueryParameter = {};
|
|
74
|
+
const localVarBodyParameter = {};
|
|
70
75
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
71
76
|
let _timeUnit;
|
|
72
77
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
73
78
|
return {
|
|
74
79
|
endpoint: "/sapi/v1/portfolio/auto-collection",
|
|
75
80
|
method: "POST",
|
|
76
|
-
|
|
81
|
+
queryParams: localVarQueryParameter,
|
|
82
|
+
bodyParams: localVarBodyParameter,
|
|
77
83
|
timeUnit: _timeUnit
|
|
78
84
|
};
|
|
79
85
|
},
|
|
80
86
|
fundCollectionByAsset: async (asset, recvWindow) => {
|
|
81
87
|
(0, __binance_common.assertParamExists)("fundCollectionByAsset", "asset", asset);
|
|
82
88
|
const localVarQueryParameter = {};
|
|
89
|
+
const localVarBodyParameter = {};
|
|
83
90
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
84
91
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
85
92
|
let _timeUnit;
|
|
@@ -87,24 +94,28 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
87
94
|
return {
|
|
88
95
|
endpoint: "/sapi/v1/portfolio/asset-collection",
|
|
89
96
|
method: "POST",
|
|
90
|
-
|
|
97
|
+
queryParams: localVarQueryParameter,
|
|
98
|
+
bodyParams: localVarBodyParameter,
|
|
91
99
|
timeUnit: _timeUnit
|
|
92
100
|
};
|
|
93
101
|
},
|
|
94
102
|
getAutoRepayFuturesStatus: async (recvWindow) => {
|
|
95
103
|
const localVarQueryParameter = {};
|
|
104
|
+
const localVarBodyParameter = {};
|
|
96
105
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
97
106
|
let _timeUnit;
|
|
98
107
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
99
108
|
return {
|
|
100
109
|
endpoint: "/sapi/v1/portfolio/repay-futures-switch",
|
|
101
110
|
method: "GET",
|
|
102
|
-
|
|
111
|
+
queryParams: localVarQueryParameter,
|
|
112
|
+
bodyParams: localVarBodyParameter,
|
|
103
113
|
timeUnit: _timeUnit
|
|
104
114
|
};
|
|
105
115
|
},
|
|
106
116
|
getPortfolioMarginProAccountBalance: async (asset, recvWindow) => {
|
|
107
117
|
const localVarQueryParameter = {};
|
|
118
|
+
const localVarBodyParameter = {};
|
|
108
119
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
109
120
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
110
121
|
let _timeUnit;
|
|
@@ -112,31 +123,36 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
112
123
|
return {
|
|
113
124
|
endpoint: "/sapi/v1/portfolio/balance",
|
|
114
125
|
method: "GET",
|
|
115
|
-
|
|
126
|
+
queryParams: localVarQueryParameter,
|
|
127
|
+
bodyParams: localVarBodyParameter,
|
|
116
128
|
timeUnit: _timeUnit
|
|
117
129
|
};
|
|
118
130
|
},
|
|
119
131
|
getPortfolioMarginProAccountInfo: async (recvWindow) => {
|
|
120
132
|
const localVarQueryParameter = {};
|
|
133
|
+
const localVarBodyParameter = {};
|
|
121
134
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
122
135
|
let _timeUnit;
|
|
123
136
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
124
137
|
return {
|
|
125
138
|
endpoint: "/sapi/v1/portfolio/account",
|
|
126
139
|
method: "GET",
|
|
127
|
-
|
|
140
|
+
queryParams: localVarQueryParameter,
|
|
141
|
+
bodyParams: localVarBodyParameter,
|
|
128
142
|
timeUnit: _timeUnit
|
|
129
143
|
};
|
|
130
144
|
},
|
|
131
145
|
getPortfolioMarginProSpanAccountInfo: async (recvWindow) => {
|
|
132
146
|
const localVarQueryParameter = {};
|
|
147
|
+
const localVarBodyParameter = {};
|
|
133
148
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
134
149
|
let _timeUnit;
|
|
135
150
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
136
151
|
return {
|
|
137
152
|
endpoint: "/sapi/v2/portfolio/account",
|
|
138
153
|
method: "GET",
|
|
139
|
-
|
|
154
|
+
queryParams: localVarQueryParameter,
|
|
155
|
+
bodyParams: localVarBodyParameter,
|
|
140
156
|
timeUnit: _timeUnit
|
|
141
157
|
};
|
|
142
158
|
},
|
|
@@ -144,6 +160,7 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
144
160
|
(0, __binance_common.assertParamExists)("getTransferableEarnAssetBalanceForPortfolioMargin", "asset", asset);
|
|
145
161
|
(0, __binance_common.assertParamExists)("getTransferableEarnAssetBalanceForPortfolioMargin", "transferType", transferType);
|
|
146
162
|
const localVarQueryParameter = {};
|
|
163
|
+
const localVarBodyParameter = {};
|
|
147
164
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
148
165
|
if (transferType !== void 0 && transferType !== null) localVarQueryParameter["transferType"] = transferType;
|
|
149
166
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
@@ -152,12 +169,14 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
152
169
|
return {
|
|
153
170
|
endpoint: "/sapi/v1/portfolio/earn-asset-balance",
|
|
154
171
|
method: "GET",
|
|
155
|
-
|
|
172
|
+
queryParams: localVarQueryParameter,
|
|
173
|
+
bodyParams: localVarBodyParameter,
|
|
156
174
|
timeUnit: _timeUnit
|
|
157
175
|
};
|
|
158
176
|
},
|
|
159
177
|
portfolioMarginProBankruptcyLoanRepay: async (from, recvWindow) => {
|
|
160
178
|
const localVarQueryParameter = {};
|
|
179
|
+
const localVarBodyParameter = {};
|
|
161
180
|
if (from !== void 0 && from !== null) localVarQueryParameter["from"] = from;
|
|
162
181
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
163
182
|
let _timeUnit;
|
|
@@ -165,24 +184,28 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
165
184
|
return {
|
|
166
185
|
endpoint: "/sapi/v1/portfolio/repay",
|
|
167
186
|
method: "POST",
|
|
168
|
-
|
|
187
|
+
queryParams: localVarQueryParameter,
|
|
188
|
+
bodyParams: localVarBodyParameter,
|
|
169
189
|
timeUnit: _timeUnit
|
|
170
190
|
};
|
|
171
191
|
},
|
|
172
192
|
queryPortfolioMarginProBankruptcyLoanAmount: async (recvWindow) => {
|
|
173
193
|
const localVarQueryParameter = {};
|
|
194
|
+
const localVarBodyParameter = {};
|
|
174
195
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
175
196
|
let _timeUnit;
|
|
176
197
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
177
198
|
return {
|
|
178
199
|
endpoint: "/sapi/v1/portfolio/pmLoan",
|
|
179
200
|
method: "GET",
|
|
180
|
-
|
|
201
|
+
queryParams: localVarQueryParameter,
|
|
202
|
+
bodyParams: localVarBodyParameter,
|
|
181
203
|
timeUnit: _timeUnit
|
|
182
204
|
};
|
|
183
205
|
},
|
|
184
206
|
queryPortfolioMarginProBankruptcyLoanRepayHistory: async (startTime, endTime, current, size, recvWindow) => {
|
|
185
207
|
const localVarQueryParameter = {};
|
|
208
|
+
const localVarBodyParameter = {};
|
|
186
209
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
187
210
|
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
188
211
|
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
|
|
@@ -193,12 +216,14 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
193
216
|
return {
|
|
194
217
|
endpoint: "/sapi/v1/portfolio/pmloan-history",
|
|
195
218
|
method: "GET",
|
|
196
|
-
|
|
219
|
+
queryParams: localVarQueryParameter,
|
|
220
|
+
bodyParams: localVarBodyParameter,
|
|
197
221
|
timeUnit: _timeUnit
|
|
198
222
|
};
|
|
199
223
|
},
|
|
200
224
|
queryPortfolioMarginProNegativeBalanceInterestHistory: async (asset, startTime, endTime, size, recvWindow) => {
|
|
201
225
|
const localVarQueryParameter = {};
|
|
226
|
+
const localVarBodyParameter = {};
|
|
202
227
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
203
228
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
204
229
|
if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
|
|
@@ -209,12 +234,14 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
209
234
|
return {
|
|
210
235
|
endpoint: "/sapi/v1/portfolio/interest-history",
|
|
211
236
|
method: "GET",
|
|
212
|
-
|
|
237
|
+
queryParams: localVarQueryParameter,
|
|
238
|
+
bodyParams: localVarBodyParameter,
|
|
213
239
|
timeUnit: _timeUnit
|
|
214
240
|
};
|
|
215
241
|
},
|
|
216
242
|
repayFuturesNegativeBalance: async (from, recvWindow) => {
|
|
217
243
|
const localVarQueryParameter = {};
|
|
244
|
+
const localVarBodyParameter = {};
|
|
218
245
|
if (from !== void 0 && from !== null) localVarQueryParameter["from"] = from;
|
|
219
246
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
220
247
|
let _timeUnit;
|
|
@@ -222,7 +249,8 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
222
249
|
return {
|
|
223
250
|
endpoint: "/sapi/v1/portfolio/repay-futures-negative-balance",
|
|
224
251
|
method: "POST",
|
|
225
|
-
|
|
252
|
+
queryParams: localVarQueryParameter,
|
|
253
|
+
bodyParams: localVarBodyParameter,
|
|
226
254
|
timeUnit: _timeUnit
|
|
227
255
|
};
|
|
228
256
|
},
|
|
@@ -231,6 +259,7 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
231
259
|
(0, __binance_common.assertParamExists)("transferLdusdtRwusdForPortfolioMargin", "transferType", transferType);
|
|
232
260
|
(0, __binance_common.assertParamExists)("transferLdusdtRwusdForPortfolioMargin", "amount", amount);
|
|
233
261
|
const localVarQueryParameter = {};
|
|
262
|
+
const localVarBodyParameter = {};
|
|
234
263
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
235
264
|
if (transferType !== void 0 && transferType !== null) localVarQueryParameter["transferType"] = transferType;
|
|
236
265
|
if (amount !== void 0 && amount !== null) localVarQueryParameter["amount"] = amount;
|
|
@@ -240,7 +269,8 @@ const AccountApiAxiosParamCreator = function(configuration) {
|
|
|
240
269
|
return {
|
|
241
270
|
endpoint: "/sapi/v1/portfolio/earn-asset-transfer",
|
|
242
271
|
method: "POST",
|
|
243
|
-
|
|
272
|
+
queryParams: localVarQueryParameter,
|
|
273
|
+
bodyParams: localVarBodyParameter,
|
|
244
274
|
timeUnit: _timeUnit
|
|
245
275
|
};
|
|
246
276
|
}
|
|
@@ -272,7 +302,7 @@ var AccountApi = class {
|
|
|
272
302
|
*/
|
|
273
303
|
async bnbTransfer(requestParameters) {
|
|
274
304
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.bnbTransfer(requestParameters?.amount, requestParameters?.transferSide, requestParameters?.recvWindow);
|
|
275
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
305
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
276
306
|
}
|
|
277
307
|
/**
|
|
278
308
|
* Change Auto-repay-futures Status
|
|
@@ -288,7 +318,7 @@ var AccountApi = class {
|
|
|
288
318
|
*/
|
|
289
319
|
async changeAutoRepayFuturesStatus(requestParameters) {
|
|
290
320
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoRepayFuturesStatus(requestParameters?.autoRepay, requestParameters?.recvWindow);
|
|
291
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
321
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
292
322
|
}
|
|
293
323
|
/**
|
|
294
324
|
* Transfers all assets from Futures Account to Margin account
|
|
@@ -307,7 +337,7 @@ var AccountApi = class {
|
|
|
307
337
|
*/
|
|
308
338
|
async fundAutoCollection(requestParameters = {}) {
|
|
309
339
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fundAutoCollection(requestParameters?.recvWindow);
|
|
310
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
340
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
311
341
|
}
|
|
312
342
|
/**
|
|
313
343
|
* Transfers specific asset from Futures Account to Margin account
|
|
@@ -325,7 +355,7 @@ var AccountApi = class {
|
|
|
325
355
|
*/
|
|
326
356
|
async fundCollectionByAsset(requestParameters) {
|
|
327
357
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.fundCollectionByAsset(requestParameters?.asset, requestParameters?.recvWindow);
|
|
328
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
358
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
329
359
|
}
|
|
330
360
|
/**
|
|
331
361
|
* Query Auto-repay-futures Status
|
|
@@ -341,7 +371,7 @@ var AccountApi = class {
|
|
|
341
371
|
*/
|
|
342
372
|
async getAutoRepayFuturesStatus(requestParameters = {}) {
|
|
343
373
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getAutoRepayFuturesStatus(requestParameters?.recvWindow);
|
|
344
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
374
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
345
375
|
}
|
|
346
376
|
/**
|
|
347
377
|
* Query Portfolio Margin Pro account balance
|
|
@@ -357,7 +387,7 @@ var AccountApi = class {
|
|
|
357
387
|
*/
|
|
358
388
|
async getPortfolioMarginProAccountBalance(requestParameters = {}) {
|
|
359
389
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginProAccountBalance(requestParameters?.asset, requestParameters?.recvWindow);
|
|
360
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
390
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
361
391
|
}
|
|
362
392
|
/**
|
|
363
393
|
* Get Portfolio Margin Pro Account Info
|
|
@@ -373,7 +403,7 @@ var AccountApi = class {
|
|
|
373
403
|
*/
|
|
374
404
|
async getPortfolioMarginProAccountInfo(requestParameters = {}) {
|
|
375
405
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginProAccountInfo(requestParameters?.recvWindow);
|
|
376
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
406
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
377
407
|
}
|
|
378
408
|
/**
|
|
379
409
|
* Get Portfolio Margin Pro SPAN Account Info (For Portfolio Margin Pro SPAN users only)
|
|
@@ -389,7 +419,7 @@ var AccountApi = class {
|
|
|
389
419
|
*/
|
|
390
420
|
async getPortfolioMarginProSpanAccountInfo(requestParameters = {}) {
|
|
391
421
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginProSpanAccountInfo(requestParameters?.recvWindow);
|
|
392
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
422
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
393
423
|
}
|
|
394
424
|
/**
|
|
395
425
|
* Get transferable earn asset balance for all types of Portfolio Margin account
|
|
@@ -405,7 +435,7 @@ var AccountApi = class {
|
|
|
405
435
|
*/
|
|
406
436
|
async getTransferableEarnAssetBalanceForPortfolioMargin(requestParameters) {
|
|
407
437
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getTransferableEarnAssetBalanceForPortfolioMargin(requestParameters?.asset, requestParameters?.transferType, requestParameters?.recvWindow);
|
|
408
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
438
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
409
439
|
}
|
|
410
440
|
/**
|
|
411
441
|
* Repay Portfolio Margin Pro Bankruptcy Loan
|
|
@@ -421,7 +451,7 @@ var AccountApi = class {
|
|
|
421
451
|
*/
|
|
422
452
|
async portfolioMarginProBankruptcyLoanRepay(requestParameters = {}) {
|
|
423
453
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.portfolioMarginProBankruptcyLoanRepay(requestParameters?.from, requestParameters?.recvWindow);
|
|
424
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
454
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
425
455
|
}
|
|
426
456
|
/**
|
|
427
457
|
* Query Portfolio Margin Pro Bankruptcy Loan Amount
|
|
@@ -439,7 +469,7 @@ var AccountApi = class {
|
|
|
439
469
|
*/
|
|
440
470
|
async queryPortfolioMarginProBankruptcyLoanAmount(requestParameters = {}) {
|
|
441
471
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginProBankruptcyLoanAmount(requestParameters?.recvWindow);
|
|
442
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
472
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
443
473
|
}
|
|
444
474
|
/**
|
|
445
475
|
* Query repay history of pmloan for portfolio margin pro.
|
|
@@ -460,7 +490,7 @@ var AccountApi = class {
|
|
|
460
490
|
*/
|
|
461
491
|
async queryPortfolioMarginProBankruptcyLoanRepayHistory(requestParameters = {}) {
|
|
462
492
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginProBankruptcyLoanRepayHistory(requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.size, requestParameters?.recvWindow);
|
|
463
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
493
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
464
494
|
}
|
|
465
495
|
/**
|
|
466
496
|
* Query interest history of negative balance for portfolio margin.
|
|
@@ -476,7 +506,7 @@ var AccountApi = class {
|
|
|
476
506
|
*/
|
|
477
507
|
async queryPortfolioMarginProNegativeBalanceInterestHistory(requestParameters = {}) {
|
|
478
508
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginProNegativeBalanceInterestHistory(requestParameters?.asset, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.size, requestParameters?.recvWindow);
|
|
479
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
509
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
480
510
|
}
|
|
481
511
|
/**
|
|
482
512
|
* Repay futures Negative Balance
|
|
@@ -492,7 +522,7 @@ var AccountApi = class {
|
|
|
492
522
|
*/
|
|
493
523
|
async repayFuturesNegativeBalance(requestParameters = {}) {
|
|
494
524
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.repayFuturesNegativeBalance(requestParameters?.from, requestParameters?.recvWindow);
|
|
495
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
525
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
496
526
|
}
|
|
497
527
|
/**
|
|
498
528
|
* Transfer LDUSDT/RWUSD as collateral for all types of Portfolio Margin account
|
|
@@ -508,7 +538,7 @@ var AccountApi = class {
|
|
|
508
538
|
*/
|
|
509
539
|
async transferLdusdtRwusdForPortfolioMargin(requestParameters) {
|
|
510
540
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.transferLdusdtRwusdForPortfolioMargin(requestParameters?.asset, requestParameters?.transferType, requestParameters?.amount, requestParameters?.recvWindow);
|
|
511
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
541
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
512
542
|
}
|
|
513
543
|
};
|
|
514
544
|
|
|
@@ -533,47 +563,55 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
|
533
563
|
return {
|
|
534
564
|
getPortfolioMarginAssetLeverage: async () => {
|
|
535
565
|
const localVarQueryParameter = {};
|
|
566
|
+
const localVarBodyParameter = {};
|
|
536
567
|
let _timeUnit;
|
|
537
568
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
538
569
|
return {
|
|
539
570
|
endpoint: "/sapi/v1/portfolio/margin-asset-leverage",
|
|
540
571
|
method: "GET",
|
|
541
|
-
|
|
572
|
+
queryParams: localVarQueryParameter,
|
|
573
|
+
bodyParams: localVarBodyParameter,
|
|
542
574
|
timeUnit: _timeUnit
|
|
543
575
|
};
|
|
544
576
|
},
|
|
545
577
|
portfolioMarginCollateralRate: async () => {
|
|
546
578
|
const localVarQueryParameter = {};
|
|
579
|
+
const localVarBodyParameter = {};
|
|
547
580
|
let _timeUnit;
|
|
548
581
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
549
582
|
return {
|
|
550
583
|
endpoint: "/sapi/v1/portfolio/collateralRate",
|
|
551
584
|
method: "GET",
|
|
552
|
-
|
|
585
|
+
queryParams: localVarQueryParameter,
|
|
586
|
+
bodyParams: localVarBodyParameter,
|
|
553
587
|
timeUnit: _timeUnit
|
|
554
588
|
};
|
|
555
589
|
},
|
|
556
590
|
portfolioMarginProTieredCollateralRate: async (recvWindow) => {
|
|
557
591
|
const localVarQueryParameter = {};
|
|
592
|
+
const localVarBodyParameter = {};
|
|
558
593
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
559
594
|
let _timeUnit;
|
|
560
595
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
561
596
|
return {
|
|
562
597
|
endpoint: "/sapi/v2/portfolio/collateralRate",
|
|
563
598
|
method: "GET",
|
|
564
|
-
|
|
599
|
+
queryParams: localVarQueryParameter,
|
|
600
|
+
bodyParams: localVarBodyParameter,
|
|
565
601
|
timeUnit: _timeUnit
|
|
566
602
|
};
|
|
567
603
|
},
|
|
568
604
|
queryPortfolioMarginAssetIndexPrice: async (asset) => {
|
|
569
605
|
const localVarQueryParameter = {};
|
|
606
|
+
const localVarBodyParameter = {};
|
|
570
607
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
571
608
|
let _timeUnit;
|
|
572
609
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
573
610
|
return {
|
|
574
611
|
endpoint: "/sapi/v1/portfolio/asset-index-price",
|
|
575
612
|
method: "GET",
|
|
576
|
-
|
|
613
|
+
queryParams: localVarQueryParameter,
|
|
614
|
+
bodyParams: localVarBodyParameter,
|
|
577
615
|
timeUnit: _timeUnit
|
|
578
616
|
};
|
|
579
617
|
}
|
|
@@ -601,7 +639,7 @@ var MarketDataApi = class {
|
|
|
601
639
|
*/
|
|
602
640
|
async getPortfolioMarginAssetLeverage() {
|
|
603
641
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getPortfolioMarginAssetLeverage();
|
|
604
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
642
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
605
643
|
}
|
|
606
644
|
/**
|
|
607
645
|
* Portfolio Margin Collateral Rate
|
|
@@ -616,7 +654,7 @@ var MarketDataApi = class {
|
|
|
616
654
|
*/
|
|
617
655
|
async portfolioMarginCollateralRate() {
|
|
618
656
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.portfolioMarginCollateralRate();
|
|
619
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
657
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
|
|
620
658
|
}
|
|
621
659
|
/**
|
|
622
660
|
* Portfolio Margin PRO Tiered Collateral Rate
|
|
@@ -632,7 +670,7 @@ var MarketDataApi = class {
|
|
|
632
670
|
*/
|
|
633
671
|
async portfolioMarginProTieredCollateralRate(requestParameters = {}) {
|
|
634
672
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.portfolioMarginProTieredCollateralRate(requestParameters?.recvWindow);
|
|
635
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
673
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
636
674
|
}
|
|
637
675
|
/**
|
|
638
676
|
* Query Portfolio Margin Asset Index Price
|
|
@@ -648,7 +686,7 @@ var MarketDataApi = class {
|
|
|
648
686
|
*/
|
|
649
687
|
async queryPortfolioMarginAssetIndexPrice(requestParameters = {}) {
|
|
650
688
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.queryPortfolioMarginAssetIndexPrice(requestParameters?.asset);
|
|
651
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
689
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: false });
|
|
652
690
|
}
|
|
653
691
|
};
|
|
654
692
|
|
|
@@ -676,23 +714,25 @@ var RestAPI = class {
|
|
|
676
714
|
* Generic function to send a request.
|
|
677
715
|
* @param endpoint - The API endpoint to call.
|
|
678
716
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
679
|
-
* @param
|
|
717
|
+
* @param queryParams - Query parameters for the request.
|
|
718
|
+
* @param bodyParams - Body parameters for the request.
|
|
680
719
|
*
|
|
681
720
|
* @returns A promise resolving to the response data object.
|
|
682
721
|
*/
|
|
683
|
-
sendRequest(endpoint, method,
|
|
684
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method,
|
|
722
|
+
sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
723
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
|
|
685
724
|
}
|
|
686
725
|
/**
|
|
687
726
|
* Generic function to send a signed request.
|
|
688
727
|
* @param endpoint - The API endpoint to call.
|
|
689
728
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
690
|
-
* @param
|
|
729
|
+
* @param queryParams - Query parameters for the request.
|
|
730
|
+
* @param bodyParams - Body parameters for the request.
|
|
691
731
|
*
|
|
692
732
|
* @returns A promise resolving to the response data object.
|
|
693
733
|
*/
|
|
694
|
-
sendSignedRequest(endpoint, method,
|
|
695
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method,
|
|
734
|
+
sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
735
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
|
|
696
736
|
}
|
|
697
737
|
/**
|
|
698
738
|
* BNB transfer can be between Margin Account and USDM Account
|