@binance/crypto-loan 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,1641 +1,977 @@
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/crypto-loan.ts
8
- import {
9
- buildUserAgent,
10
- ConfigurationRestAPI as ConfigurationRestAPI4,
11
- CRYPTO_LOAN_REST_API_PROD_URL
12
- } from "@binance/common";
1
+ import { t as __export } from "./chunk.mjs";
2
+ import { BadRequestError, CRYPTO_LOAN_REST_API_PROD_URL, CRYPTO_LOAN_REST_API_PROD_URL as CRYPTO_LOAN_REST_API_PROD_URL$1, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError, assertParamExists, buildUserAgent, sendRequest } from "@binance/common";
13
3
 
14
- // package.json
4
+ //#region package.json
15
5
  var name = "@binance/crypto-loan";
16
- var version = "8.0.0";
17
-
18
- // src/rest-api/index.ts
19
- var rest_api_exports = {};
20
- __export(rest_api_exports, {
21
- FlexibleRateApi: () => FlexibleRateApi,
22
- RestAPI: () => RestAPI,
23
- StableRateApi: () => StableRateApi
24
- });
6
+ var version = "8.0.2";
25
7
 
26
- // src/rest-api/modules/flexible-rate-api.ts
27
- import {
28
- assertParamExists,
29
- sendRequest
30
- } from "@binance/common";
31
- var FlexibleRateApiAxiosParamCreator = function(configuration) {
32
- return {
33
- /**
34
- *
35
- * Weight: 6000
36
- *
37
- * @summary Check Collateral Repay Rate (USER_DATA)
38
- * @param {string} loanCoin
39
- * @param {string} collateralCoin
40
- * @param {number} [recvWindow]
41
- *
42
- * @throws {RequiredError}
43
- */
44
- checkCollateralRepayRate: async (loanCoin, collateralCoin, recvWindow) => {
45
- assertParamExists("checkCollateralRepayRate", "loanCoin", loanCoin);
46
- assertParamExists("checkCollateralRepayRate", "collateralCoin", collateralCoin);
47
- const localVarQueryParameter = {};
48
- if (loanCoin !== void 0 && loanCoin !== null) {
49
- localVarQueryParameter["loanCoin"] = loanCoin;
50
- }
51
- if (collateralCoin !== void 0 && collateralCoin !== null) {
52
- localVarQueryParameter["collateralCoin"] = collateralCoin;
53
- }
54
- if (recvWindow !== void 0 && recvWindow !== null) {
55
- localVarQueryParameter["recvWindow"] = recvWindow;
56
- }
57
- let _timeUnit;
58
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
59
- return {
60
- endpoint: "/sapi/v2/loan/flexible/repay/rate",
61
- method: "GET",
62
- params: localVarQueryParameter,
63
- timeUnit: _timeUnit
64
- };
65
- },
66
- /**
67
- * Flexible Loan Adjust LTV
68
- *
69
- * API Key needs Spot & Margin Trading permission for this endpoint
70
- *
71
- * Weight: 6000
72
- *
73
- * @summary Flexible Loan Adjust LTV(TRADE)
74
- * @param {string} loanCoin
75
- * @param {string} collateralCoin
76
- * @param {number} adjustmentAmount
77
- * @param {string} direction "ADDITIONAL", "REDUCED"
78
- * @param {number} [recvWindow]
79
- *
80
- * @throws {RequiredError}
81
- */
82
- flexibleLoanAdjustLtv: async (loanCoin, collateralCoin, adjustmentAmount, direction, recvWindow) => {
83
- assertParamExists("flexibleLoanAdjustLtv", "loanCoin", loanCoin);
84
- assertParamExists("flexibleLoanAdjustLtv", "collateralCoin", collateralCoin);
85
- assertParamExists("flexibleLoanAdjustLtv", "adjustmentAmount", adjustmentAmount);
86
- assertParamExists("flexibleLoanAdjustLtv", "direction", direction);
87
- const localVarQueryParameter = {};
88
- if (loanCoin !== void 0 && loanCoin !== null) {
89
- localVarQueryParameter["loanCoin"] = loanCoin;
90
- }
91
- if (collateralCoin !== void 0 && collateralCoin !== null) {
92
- localVarQueryParameter["collateralCoin"] = collateralCoin;
93
- }
94
- if (adjustmentAmount !== void 0 && adjustmentAmount !== null) {
95
- localVarQueryParameter["adjustmentAmount"] = adjustmentAmount;
96
- }
97
- if (direction !== void 0 && direction !== null) {
98
- localVarQueryParameter["direction"] = direction;
99
- }
100
- if (recvWindow !== void 0 && recvWindow !== null) {
101
- localVarQueryParameter["recvWindow"] = recvWindow;
102
- }
103
- let _timeUnit;
104
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
105
- return {
106
- endpoint: "/sapi/v2/loan/flexible/adjust/ltv",
107
- method: "POST",
108
- params: localVarQueryParameter,
109
- timeUnit: _timeUnit
110
- };
111
- },
112
- /**
113
- * Borrow Flexible Loan
114
- *
115
- *
116
- * Only available for master account
117
- * You can customize LTV by entering loanAmount and collateralAmount.
118
- *
119
- * Weight: 6000
120
- *
121
- * @summary Flexible Loan Borrow(TRADE)
122
- * @param {string} loanCoin
123
- * @param {string} collateralCoin
124
- * @param {number} [loanAmount] Mandatory when collateralAmount is empty
125
- * @param {number} [collateralAmount] Mandatory when loanAmount is empty
126
- * @param {number} [recvWindow]
127
- *
128
- * @throws {RequiredError}
129
- */
130
- flexibleLoanBorrow: async (loanCoin, collateralCoin, loanAmount, collateralAmount, recvWindow) => {
131
- assertParamExists("flexibleLoanBorrow", "loanCoin", loanCoin);
132
- assertParamExists("flexibleLoanBorrow", "collateralCoin", collateralCoin);
133
- const localVarQueryParameter = {};
134
- if (loanCoin !== void 0 && loanCoin !== null) {
135
- localVarQueryParameter["loanCoin"] = loanCoin;
136
- }
137
- if (loanAmount !== void 0 && loanAmount !== null) {
138
- localVarQueryParameter["loanAmount"] = loanAmount;
139
- }
140
- if (collateralCoin !== void 0 && collateralCoin !== null) {
141
- localVarQueryParameter["collateralCoin"] = collateralCoin;
142
- }
143
- if (collateralAmount !== void 0 && collateralAmount !== null) {
144
- localVarQueryParameter["collateralAmount"] = collateralAmount;
145
- }
146
- if (recvWindow !== void 0 && recvWindow !== null) {
147
- localVarQueryParameter["recvWindow"] = recvWindow;
148
- }
149
- let _timeUnit;
150
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
151
- return {
152
- endpoint: "/sapi/v2/loan/flexible/borrow",
153
- method: "POST",
154
- params: localVarQueryParameter,
155
- timeUnit: _timeUnit
156
- };
157
- },
158
- /**
159
- * Flexible Loan Repay
160
- *
161
- *
162
- * repayAmount is mandatory even fullRepayment = FALSE
163
- *
164
- * Weight: 6000
165
- *
166
- * @summary Flexible Loan Repay(TRADE)
167
- * @param {string} loanCoin
168
- * @param {string} collateralCoin
169
- * @param {number} repayAmount repay amount of loanCoin
170
- * @param {boolean} [collateralReturn] Default: TRUE. TRUE: Return extra collateral to spot account; FALSE: Keep extra collateral in the order, and lower LTV.
171
- * @param {boolean} [fullRepayment] Default: FALSE. TRUE: Full repayment; FALSE: Partial repayment, based on loanAmount
172
- * @param {number} [repaymentType] Default: 1. 1: Repayment with loan asset; 2: Repayment with collateral
173
- * @param {number} [recvWindow]
174
- *
175
- * @throws {RequiredError}
176
- */
177
- flexibleLoanRepay: async (loanCoin, collateralCoin, repayAmount, collateralReturn, fullRepayment, repaymentType, recvWindow) => {
178
- assertParamExists("flexibleLoanRepay", "loanCoin", loanCoin);
179
- assertParamExists("flexibleLoanRepay", "collateralCoin", collateralCoin);
180
- assertParamExists("flexibleLoanRepay", "repayAmount", repayAmount);
181
- const localVarQueryParameter = {};
182
- if (loanCoin !== void 0 && loanCoin !== null) {
183
- localVarQueryParameter["loanCoin"] = loanCoin;
184
- }
185
- if (collateralCoin !== void 0 && collateralCoin !== null) {
186
- localVarQueryParameter["collateralCoin"] = collateralCoin;
187
- }
188
- if (repayAmount !== void 0 && repayAmount !== null) {
189
- localVarQueryParameter["repayAmount"] = repayAmount;
190
- }
191
- if (collateralReturn !== void 0 && collateralReturn !== null) {
192
- localVarQueryParameter["collateralReturn"] = collateralReturn;
193
- }
194
- if (fullRepayment !== void 0 && fullRepayment !== null) {
195
- localVarQueryParameter["fullRepayment"] = fullRepayment;
196
- }
197
- if (repaymentType !== void 0 && repaymentType !== null) {
198
- localVarQueryParameter["repaymentType"] = repaymentType;
199
- }
200
- if (recvWindow !== void 0 && recvWindow !== null) {
201
- localVarQueryParameter["recvWindow"] = recvWindow;
202
- }
203
- let _timeUnit;
204
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
205
- return {
206
- endpoint: "/sapi/v2/loan/flexible/repay",
207
- method: "POST",
208
- params: localVarQueryParameter,
209
- timeUnit: _timeUnit
210
- };
211
- },
212
- /**
213
- * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
214
- *
215
- * Weight: 400
216
- *
217
- * @summary Get Flexible Loan Assets Data(USER_DATA)
218
- * @param {string} [loanCoin]
219
- * @param {number} [recvWindow]
220
- *
221
- * @throws {RequiredError}
222
- */
223
- getFlexibleLoanAssetsData: async (loanCoin, recvWindow) => {
224
- const localVarQueryParameter = {};
225
- if (loanCoin !== void 0 && loanCoin !== null) {
226
- localVarQueryParameter["loanCoin"] = loanCoin;
227
- }
228
- if (recvWindow !== void 0 && recvWindow !== null) {
229
- localVarQueryParameter["recvWindow"] = recvWindow;
230
- }
231
- let _timeUnit;
232
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
233
- return {
234
- endpoint: "/sapi/v2/loan/flexible/loanable/data",
235
- method: "GET",
236
- params: localVarQueryParameter,
237
- timeUnit: _timeUnit
238
- };
239
- },
240
- /**
241
- * Get Flexible Loan Borrow History
242
- *
243
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
244
- * The max interval between startTime and endTime is 180 days.
245
- *
246
- * Weight: 400
247
- *
248
- * @summary Get Flexible Loan Borrow History(USER_DATA)
249
- * @param {string} [loanCoin]
250
- * @param {string} [collateralCoin]
251
- * @param {number} [startTime]
252
- * @param {number} [endTime]
253
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
254
- * @param {number} [limit] Default: 10; max: 100
255
- * @param {number} [recvWindow]
256
- *
257
- * @throws {RequiredError}
258
- */
259
- getFlexibleLoanBorrowHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
260
- const localVarQueryParameter = {};
261
- if (loanCoin !== void 0 && loanCoin !== null) {
262
- localVarQueryParameter["loanCoin"] = loanCoin;
263
- }
264
- if (collateralCoin !== void 0 && collateralCoin !== null) {
265
- localVarQueryParameter["collateralCoin"] = collateralCoin;
266
- }
267
- if (startTime !== void 0 && startTime !== null) {
268
- localVarQueryParameter["startTime"] = startTime;
269
- }
270
- if (endTime !== void 0 && endTime !== null) {
271
- localVarQueryParameter["endTime"] = endTime;
272
- }
273
- if (current !== void 0 && current !== null) {
274
- localVarQueryParameter["current"] = current;
275
- }
276
- if (limit !== void 0 && limit !== null) {
277
- localVarQueryParameter["limit"] = limit;
278
- }
279
- if (recvWindow !== void 0 && recvWindow !== null) {
280
- localVarQueryParameter["recvWindow"] = recvWindow;
281
- }
282
- let _timeUnit;
283
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
284
- return {
285
- endpoint: "/sapi/v2/loan/flexible/borrow/history",
286
- method: "GET",
287
- params: localVarQueryParameter,
288
- timeUnit: _timeUnit
289
- };
290
- },
291
- /**
292
- * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
293
- *
294
- * Weight: 400
295
- *
296
- * @summary Get Flexible Loan Collateral Assets Data(USER_DATA)
297
- * @param {string} [collateralCoin]
298
- * @param {number} [recvWindow]
299
- *
300
- * @throws {RequiredError}
301
- */
302
- getFlexibleLoanCollateralAssetsData: async (collateralCoin, recvWindow) => {
303
- const localVarQueryParameter = {};
304
- if (collateralCoin !== void 0 && collateralCoin !== null) {
305
- localVarQueryParameter["collateralCoin"] = collateralCoin;
306
- }
307
- if (recvWindow !== void 0 && recvWindow !== null) {
308
- localVarQueryParameter["recvWindow"] = recvWindow;
309
- }
310
- let _timeUnit;
311
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
312
- return {
313
- endpoint: "/sapi/v2/loan/flexible/collateral/data",
314
- method: "GET",
315
- params: localVarQueryParameter,
316
- timeUnit: _timeUnit
317
- };
318
- },
319
- /**
320
- *
321
- * Weight: 400
322
- *
323
- * @summary Get Flexible Loan Liquidation History (USER_DATA)
324
- * @param {string} [loanCoin]
325
- * @param {string} [collateralCoin]
326
- * @param {number} [startTime]
327
- * @param {number} [endTime]
328
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
329
- * @param {number} [limit] Default: 10; max: 100
330
- * @param {number} [recvWindow]
331
- *
332
- * @throws {RequiredError}
333
- */
334
- getFlexibleLoanLiquidationHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
335
- const localVarQueryParameter = {};
336
- if (loanCoin !== void 0 && loanCoin !== null) {
337
- localVarQueryParameter["loanCoin"] = loanCoin;
338
- }
339
- if (collateralCoin !== void 0 && collateralCoin !== null) {
340
- localVarQueryParameter["collateralCoin"] = collateralCoin;
341
- }
342
- if (startTime !== void 0 && startTime !== null) {
343
- localVarQueryParameter["startTime"] = startTime;
344
- }
345
- if (endTime !== void 0 && endTime !== null) {
346
- localVarQueryParameter["endTime"] = endTime;
347
- }
348
- if (current !== void 0 && current !== null) {
349
- localVarQueryParameter["current"] = current;
350
- }
351
- if (limit !== void 0 && limit !== null) {
352
- localVarQueryParameter["limit"] = limit;
353
- }
354
- if (recvWindow !== void 0 && recvWindow !== null) {
355
- localVarQueryParameter["recvWindow"] = recvWindow;
356
- }
357
- let _timeUnit;
358
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
359
- return {
360
- endpoint: "/sapi/v2/loan/flexible/liquidation/history",
361
- method: "GET",
362
- params: localVarQueryParameter,
363
- timeUnit: _timeUnit
364
- };
365
- },
366
- /**
367
- * Get Flexible Loan LTV Adjustment History
368
- *
369
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
370
- * The max interval between startTime and endTime is 180 days.
371
- *
372
- * Weight: 400
373
- *
374
- * @summary Get Flexible Loan LTV Adjustment History(USER_DATA)
375
- * @param {string} [loanCoin]
376
- * @param {string} [collateralCoin]
377
- * @param {number} [startTime]
378
- * @param {number} [endTime]
379
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
380
- * @param {number} [limit] Default: 10; max: 100
381
- * @param {number} [recvWindow]
382
- *
383
- * @throws {RequiredError}
384
- */
385
- getFlexibleLoanLtvAdjustmentHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
386
- const localVarQueryParameter = {};
387
- if (loanCoin !== void 0 && loanCoin !== null) {
388
- localVarQueryParameter["loanCoin"] = loanCoin;
389
- }
390
- if (collateralCoin !== void 0 && collateralCoin !== null) {
391
- localVarQueryParameter["collateralCoin"] = collateralCoin;
392
- }
393
- if (startTime !== void 0 && startTime !== null) {
394
- localVarQueryParameter["startTime"] = startTime;
395
- }
396
- if (endTime !== void 0 && endTime !== null) {
397
- localVarQueryParameter["endTime"] = endTime;
398
- }
399
- if (current !== void 0 && current !== null) {
400
- localVarQueryParameter["current"] = current;
401
- }
402
- if (limit !== void 0 && limit !== null) {
403
- localVarQueryParameter["limit"] = limit;
404
- }
405
- if (recvWindow !== void 0 && recvWindow !== null) {
406
- localVarQueryParameter["recvWindow"] = recvWindow;
407
- }
408
- let _timeUnit;
409
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
410
- return {
411
- endpoint: "/sapi/v2/loan/flexible/ltv/adjustment/history",
412
- method: "GET",
413
- params: localVarQueryParameter,
414
- timeUnit: _timeUnit
415
- };
416
- },
417
- /**
418
- * Get Flexible Loan Ongoing Orders
419
- *
420
- * Weight: 300
421
- *
422
- * @summary Get Flexible Loan Ongoing Orders(USER_DATA)
423
- * @param {string} [loanCoin]
424
- * @param {string} [collateralCoin]
425
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
426
- * @param {number} [limit] Default: 10; max: 100
427
- * @param {number} [recvWindow]
428
- *
429
- * @throws {RequiredError}
430
- */
431
- getFlexibleLoanOngoingOrders: async (loanCoin, collateralCoin, current, limit, recvWindow) => {
432
- const localVarQueryParameter = {};
433
- if (loanCoin !== void 0 && loanCoin !== null) {
434
- localVarQueryParameter["loanCoin"] = loanCoin;
435
- }
436
- if (collateralCoin !== void 0 && collateralCoin !== null) {
437
- localVarQueryParameter["collateralCoin"] = collateralCoin;
438
- }
439
- if (current !== void 0 && current !== null) {
440
- localVarQueryParameter["current"] = current;
441
- }
442
- if (limit !== void 0 && limit !== null) {
443
- localVarQueryParameter["limit"] = limit;
444
- }
445
- if (recvWindow !== void 0 && recvWindow !== null) {
446
- localVarQueryParameter["recvWindow"] = recvWindow;
447
- }
448
- let _timeUnit;
449
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
450
- return {
451
- endpoint: "/sapi/v2/loan/flexible/ongoing/orders",
452
- method: "GET",
453
- params: localVarQueryParameter,
454
- timeUnit: _timeUnit
455
- };
456
- },
457
- /**
458
- * Get Flexible Loan Repayment History
459
- *
460
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
461
- * The max interval between startTime and endTime is 180 days.
462
- *
463
- * Weight: 400
464
- *
465
- * @summary Get Flexible Loan Repayment History(USER_DATA)
466
- * @param {string} [loanCoin]
467
- * @param {string} [collateralCoin]
468
- * @param {number} [startTime]
469
- * @param {number} [endTime]
470
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
471
- * @param {number} [limit] Default: 10; max: 100
472
- * @param {number} [recvWindow]
473
- *
474
- * @throws {RequiredError}
475
- */
476
- getFlexibleLoanRepaymentHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
477
- const localVarQueryParameter = {};
478
- if (loanCoin !== void 0 && loanCoin !== null) {
479
- localVarQueryParameter["loanCoin"] = loanCoin;
480
- }
481
- if (collateralCoin !== void 0 && collateralCoin !== null) {
482
- localVarQueryParameter["collateralCoin"] = collateralCoin;
483
- }
484
- if (startTime !== void 0 && startTime !== null) {
485
- localVarQueryParameter["startTime"] = startTime;
486
- }
487
- if (endTime !== void 0 && endTime !== null) {
488
- localVarQueryParameter["endTime"] = endTime;
489
- }
490
- if (current !== void 0 && current !== null) {
491
- localVarQueryParameter["current"] = current;
492
- }
493
- if (limit !== void 0 && limit !== null) {
494
- localVarQueryParameter["limit"] = limit;
495
- }
496
- if (recvWindow !== void 0 && recvWindow !== null) {
497
- localVarQueryParameter["recvWindow"] = recvWindow;
498
- }
499
- let _timeUnit;
500
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
501
- return {
502
- endpoint: "/sapi/v2/loan/flexible/repay/history",
503
- method: "GET",
504
- params: localVarQueryParameter,
505
- timeUnit: _timeUnit
506
- };
507
- }
508
- };
8
+ //#endregion
9
+ //#region src/rest-api/modules/flexible-rate-api.ts
10
+ /**
11
+ * Binance Crypto Loan REST API
12
+ *
13
+ * OpenAPI Specification for the Binance Crypto Loan REST API
14
+ *
15
+ * The version of the OpenAPI document: 1.0.0
16
+ *
17
+ *
18
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19
+ * https://openapi-generator.tech
20
+ * Do not edit the class manually.
21
+ */
22
+ /**
23
+ * FlexibleRateApi - axios parameter creator
24
+ */
25
+ const FlexibleRateApiAxiosParamCreator = function(configuration) {
26
+ return {
27
+ checkCollateralRepayRate: async (loanCoin, collateralCoin, recvWindow) => {
28
+ assertParamExists("checkCollateralRepayRate", "loanCoin", loanCoin);
29
+ assertParamExists("checkCollateralRepayRate", "collateralCoin", collateralCoin);
30
+ const localVarQueryParameter = {};
31
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
32
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
33
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
34
+ let _timeUnit;
35
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
36
+ return {
37
+ endpoint: "/sapi/v2/loan/flexible/repay/rate",
38
+ method: "GET",
39
+ params: localVarQueryParameter,
40
+ timeUnit: _timeUnit
41
+ };
42
+ },
43
+ flexibleLoanAdjustLtv: async (loanCoin, collateralCoin, adjustmentAmount, direction, recvWindow) => {
44
+ assertParamExists("flexibleLoanAdjustLtv", "loanCoin", loanCoin);
45
+ assertParamExists("flexibleLoanAdjustLtv", "collateralCoin", collateralCoin);
46
+ assertParamExists("flexibleLoanAdjustLtv", "adjustmentAmount", adjustmentAmount);
47
+ assertParamExists("flexibleLoanAdjustLtv", "direction", direction);
48
+ const localVarQueryParameter = {};
49
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
50
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
51
+ if (adjustmentAmount !== void 0 && adjustmentAmount !== null) localVarQueryParameter["adjustmentAmount"] = adjustmentAmount;
52
+ if (direction !== void 0 && direction !== null) localVarQueryParameter["direction"] = direction;
53
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
54
+ let _timeUnit;
55
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
56
+ return {
57
+ endpoint: "/sapi/v2/loan/flexible/adjust/ltv",
58
+ method: "POST",
59
+ params: localVarQueryParameter,
60
+ timeUnit: _timeUnit
61
+ };
62
+ },
63
+ flexibleLoanBorrow: async (loanCoin, collateralCoin, loanAmount, collateralAmount, recvWindow) => {
64
+ assertParamExists("flexibleLoanBorrow", "loanCoin", loanCoin);
65
+ assertParamExists("flexibleLoanBorrow", "collateralCoin", collateralCoin);
66
+ const localVarQueryParameter = {};
67
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
68
+ if (loanAmount !== void 0 && loanAmount !== null) localVarQueryParameter["loanAmount"] = loanAmount;
69
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
70
+ if (collateralAmount !== void 0 && collateralAmount !== null) localVarQueryParameter["collateralAmount"] = collateralAmount;
71
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
72
+ let _timeUnit;
73
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
74
+ return {
75
+ endpoint: "/sapi/v2/loan/flexible/borrow",
76
+ method: "POST",
77
+ params: localVarQueryParameter,
78
+ timeUnit: _timeUnit
79
+ };
80
+ },
81
+ flexibleLoanRepay: async (loanCoin, collateralCoin, repayAmount, collateralReturn, fullRepayment, repaymentType, recvWindow) => {
82
+ assertParamExists("flexibleLoanRepay", "loanCoin", loanCoin);
83
+ assertParamExists("flexibleLoanRepay", "collateralCoin", collateralCoin);
84
+ assertParamExists("flexibleLoanRepay", "repayAmount", repayAmount);
85
+ const localVarQueryParameter = {};
86
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
87
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
88
+ if (repayAmount !== void 0 && repayAmount !== null) localVarQueryParameter["repayAmount"] = repayAmount;
89
+ if (collateralReturn !== void 0 && collateralReturn !== null) localVarQueryParameter["collateralReturn"] = collateralReturn;
90
+ if (fullRepayment !== void 0 && fullRepayment !== null) localVarQueryParameter["fullRepayment"] = fullRepayment;
91
+ if (repaymentType !== void 0 && repaymentType !== null) localVarQueryParameter["repaymentType"] = repaymentType;
92
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
93
+ let _timeUnit;
94
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
95
+ return {
96
+ endpoint: "/sapi/v2/loan/flexible/repay",
97
+ method: "POST",
98
+ params: localVarQueryParameter,
99
+ timeUnit: _timeUnit
100
+ };
101
+ },
102
+ getFlexibleLoanAssetsData: async (loanCoin, recvWindow) => {
103
+ const localVarQueryParameter = {};
104
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
105
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
106
+ let _timeUnit;
107
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
108
+ return {
109
+ endpoint: "/sapi/v2/loan/flexible/loanable/data",
110
+ method: "GET",
111
+ params: localVarQueryParameter,
112
+ timeUnit: _timeUnit
113
+ };
114
+ },
115
+ getFlexibleLoanBorrowHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
116
+ const localVarQueryParameter = {};
117
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
118
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
119
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
120
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
121
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
122
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
123
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
124
+ let _timeUnit;
125
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
126
+ return {
127
+ endpoint: "/sapi/v2/loan/flexible/borrow/history",
128
+ method: "GET",
129
+ params: localVarQueryParameter,
130
+ timeUnit: _timeUnit
131
+ };
132
+ },
133
+ getFlexibleLoanCollateralAssetsData: async (collateralCoin, recvWindow) => {
134
+ const localVarQueryParameter = {};
135
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
136
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
137
+ let _timeUnit;
138
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
139
+ return {
140
+ endpoint: "/sapi/v2/loan/flexible/collateral/data",
141
+ method: "GET",
142
+ params: localVarQueryParameter,
143
+ timeUnit: _timeUnit
144
+ };
145
+ },
146
+ getFlexibleLoanLiquidationHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
147
+ const localVarQueryParameter = {};
148
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
149
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
150
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
151
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
152
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
153
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
154
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
155
+ let _timeUnit;
156
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
157
+ return {
158
+ endpoint: "/sapi/v2/loan/flexible/liquidation/history",
159
+ method: "GET",
160
+ params: localVarQueryParameter,
161
+ timeUnit: _timeUnit
162
+ };
163
+ },
164
+ getFlexibleLoanLtvAdjustmentHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
165
+ const localVarQueryParameter = {};
166
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
167
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
168
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
169
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
170
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
171
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
172
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
173
+ let _timeUnit;
174
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
175
+ return {
176
+ endpoint: "/sapi/v2/loan/flexible/ltv/adjustment/history",
177
+ method: "GET",
178
+ params: localVarQueryParameter,
179
+ timeUnit: _timeUnit
180
+ };
181
+ },
182
+ getFlexibleLoanOngoingOrders: async (loanCoin, collateralCoin, current, limit, recvWindow) => {
183
+ const localVarQueryParameter = {};
184
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
185
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
186
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
187
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
188
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
189
+ let _timeUnit;
190
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
191
+ return {
192
+ endpoint: "/sapi/v2/loan/flexible/ongoing/orders",
193
+ method: "GET",
194
+ params: localVarQueryParameter,
195
+ timeUnit: _timeUnit
196
+ };
197
+ },
198
+ getFlexibleLoanRepaymentHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
199
+ const localVarQueryParameter = {};
200
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
201
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
202
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
203
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
204
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
205
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
206
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
207
+ let _timeUnit;
208
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
209
+ return {
210
+ endpoint: "/sapi/v2/loan/flexible/repay/history",
211
+ method: "GET",
212
+ params: localVarQueryParameter,
213
+ timeUnit: _timeUnit
214
+ };
215
+ }
216
+ };
509
217
  };
218
+ /**
219
+ * FlexibleRateApi - object-oriented interface
220
+ * @class FlexibleRateApi
221
+ */
510
222
  var FlexibleRateApi = class {
511
- constructor(configuration) {
512
- this.configuration = configuration;
513
- this.localVarAxiosParamCreator = FlexibleRateApiAxiosParamCreator(configuration);
514
- }
515
- /**
516
- *
517
- * Weight: 6000
518
- *
519
- * @summary Check Collateral Repay Rate (USER_DATA)
520
- * @param {CheckCollateralRepayRateRequest} requestParameters Request parameters.
521
- * @returns {Promise<RestApiResponse<CheckCollateralRepayRateResponse>>}
522
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
523
- * @memberof FlexibleRateApi
524
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Check-Collateral-Repay-Rate Binance API Documentation}
525
- */
526
- async checkCollateralRepayRate(requestParameters) {
527
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkCollateralRepayRate(
528
- requestParameters?.loanCoin,
529
- requestParameters?.collateralCoin,
530
- requestParameters?.recvWindow
531
- );
532
- return sendRequest(
533
- this.configuration,
534
- localVarAxiosArgs.endpoint,
535
- localVarAxiosArgs.method,
536
- localVarAxiosArgs.params,
537
- localVarAxiosArgs?.timeUnit,
538
- { isSigned: true }
539
- );
540
- }
541
- /**
542
- * Flexible Loan Adjust LTV
543
- *
544
- * API Key needs Spot & Margin Trading permission for this endpoint
545
- *
546
- * Weight: 6000
547
- *
548
- * @summary Flexible Loan Adjust LTV(TRADE)
549
- * @param {FlexibleLoanAdjustLtvRequest} requestParameters Request parameters.
550
- * @returns {Promise<RestApiResponse<FlexibleLoanAdjustLtvResponse>>}
551
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
552
- * @memberof FlexibleRateApi
553
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Adjust-LTV Binance API Documentation}
554
- */
555
- async flexibleLoanAdjustLtv(requestParameters) {
556
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanAdjustLtv(
557
- requestParameters?.loanCoin,
558
- requestParameters?.collateralCoin,
559
- requestParameters?.adjustmentAmount,
560
- requestParameters?.direction,
561
- requestParameters?.recvWindow
562
- );
563
- return sendRequest(
564
- this.configuration,
565
- localVarAxiosArgs.endpoint,
566
- localVarAxiosArgs.method,
567
- localVarAxiosArgs.params,
568
- localVarAxiosArgs?.timeUnit,
569
- { isSigned: true }
570
- );
571
- }
572
- /**
573
- * Borrow Flexible Loan
574
- *
575
- *
576
- * Only available for master account
577
- * You can customize LTV by entering loanAmount and collateralAmount.
578
- *
579
- * Weight: 6000
580
- *
581
- * @summary Flexible Loan Borrow(TRADE)
582
- * @param {FlexibleLoanBorrowRequest} requestParameters Request parameters.
583
- * @returns {Promise<RestApiResponse<FlexibleLoanBorrowResponse>>}
584
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
585
- * @memberof FlexibleRateApi
586
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Borrow Binance API Documentation}
587
- */
588
- async flexibleLoanBorrow(requestParameters) {
589
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanBorrow(
590
- requestParameters?.loanCoin,
591
- requestParameters?.collateralCoin,
592
- requestParameters?.loanAmount,
593
- requestParameters?.collateralAmount,
594
- requestParameters?.recvWindow
595
- );
596
- return sendRequest(
597
- this.configuration,
598
- localVarAxiosArgs.endpoint,
599
- localVarAxiosArgs.method,
600
- localVarAxiosArgs.params,
601
- localVarAxiosArgs?.timeUnit,
602
- { isSigned: true }
603
- );
604
- }
605
- /**
606
- * Flexible Loan Repay
607
- *
608
- *
609
- * repayAmount is mandatory even fullRepayment = FALSE
610
- *
611
- * Weight: 6000
612
- *
613
- * @summary Flexible Loan Repay(TRADE)
614
- * @param {FlexibleLoanRepayRequest} requestParameters Request parameters.
615
- * @returns {Promise<RestApiResponse<FlexibleLoanRepayResponse>>}
616
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
617
- * @memberof FlexibleRateApi
618
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Repay Binance API Documentation}
619
- */
620
- async flexibleLoanRepay(requestParameters) {
621
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanRepay(
622
- requestParameters?.loanCoin,
623
- requestParameters?.collateralCoin,
624
- requestParameters?.repayAmount,
625
- requestParameters?.collateralReturn,
626
- requestParameters?.fullRepayment,
627
- requestParameters?.repaymentType,
628
- requestParameters?.recvWindow
629
- );
630
- return sendRequest(
631
- this.configuration,
632
- localVarAxiosArgs.endpoint,
633
- localVarAxiosArgs.method,
634
- localVarAxiosArgs.params,
635
- localVarAxiosArgs?.timeUnit,
636
- { isSigned: true }
637
- );
638
- }
639
- /**
640
- * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
641
- *
642
- * Weight: 400
643
- *
644
- * @summary Get Flexible Loan Assets Data(USER_DATA)
645
- * @param {GetFlexibleLoanAssetsDataRequest} requestParameters Request parameters.
646
- * @returns {Promise<RestApiResponse<GetFlexibleLoanAssetsDataResponse>>}
647
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
648
- * @memberof FlexibleRateApi
649
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Assets-Data Binance API Documentation}
650
- */
651
- async getFlexibleLoanAssetsData(requestParameters = {}) {
652
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanAssetsData(
653
- requestParameters?.loanCoin,
654
- requestParameters?.recvWindow
655
- );
656
- return sendRequest(
657
- this.configuration,
658
- localVarAxiosArgs.endpoint,
659
- localVarAxiosArgs.method,
660
- localVarAxiosArgs.params,
661
- localVarAxiosArgs?.timeUnit,
662
- { isSigned: true }
663
- );
664
- }
665
- /**
666
- * Get Flexible Loan Borrow History
667
- *
668
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
669
- * The max interval between startTime and endTime is 180 days.
670
- *
671
- * Weight: 400
672
- *
673
- * @summary Get Flexible Loan Borrow History(USER_DATA)
674
- * @param {GetFlexibleLoanBorrowHistoryRequest} requestParameters Request parameters.
675
- * @returns {Promise<RestApiResponse<GetFlexibleLoanBorrowHistoryResponse>>}
676
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
677
- * @memberof FlexibleRateApi
678
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Borrow-History Binance API Documentation}
679
- */
680
- async getFlexibleLoanBorrowHistory(requestParameters = {}) {
681
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanBorrowHistory(
682
- requestParameters?.loanCoin,
683
- requestParameters?.collateralCoin,
684
- requestParameters?.startTime,
685
- requestParameters?.endTime,
686
- requestParameters?.current,
687
- requestParameters?.limit,
688
- requestParameters?.recvWindow
689
- );
690
- return sendRequest(
691
- this.configuration,
692
- localVarAxiosArgs.endpoint,
693
- localVarAxiosArgs.method,
694
- localVarAxiosArgs.params,
695
- localVarAxiosArgs?.timeUnit,
696
- { isSigned: true }
697
- );
698
- }
699
- /**
700
- * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
701
- *
702
- * Weight: 400
703
- *
704
- * @summary Get Flexible Loan Collateral Assets Data(USER_DATA)
705
- * @param {GetFlexibleLoanCollateralAssetsDataRequest} requestParameters Request parameters.
706
- * @returns {Promise<RestApiResponse<GetFlexibleLoanCollateralAssetsDataResponse>>}
707
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
708
- * @memberof FlexibleRateApi
709
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Collateral-Assets-Data Binance API Documentation}
710
- */
711
- async getFlexibleLoanCollateralAssetsData(requestParameters = {}) {
712
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanCollateralAssetsData(
713
- requestParameters?.collateralCoin,
714
- requestParameters?.recvWindow
715
- );
716
- return sendRequest(
717
- this.configuration,
718
- localVarAxiosArgs.endpoint,
719
- localVarAxiosArgs.method,
720
- localVarAxiosArgs.params,
721
- localVarAxiosArgs?.timeUnit,
722
- { isSigned: true }
723
- );
724
- }
725
- /**
726
- *
727
- * Weight: 400
728
- *
729
- * @summary Get Flexible Loan Liquidation History (USER_DATA)
730
- * @param {GetFlexibleLoanLiquidationHistoryRequest} requestParameters Request parameters.
731
- * @returns {Promise<RestApiResponse<GetFlexibleLoanLiquidationHistoryResponse>>}
732
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
733
- * @memberof FlexibleRateApi
734
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Liquidation-History Binance API Documentation}
735
- */
736
- async getFlexibleLoanLiquidationHistory(requestParameters = {}) {
737
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanLiquidationHistory(
738
- requestParameters?.loanCoin,
739
- requestParameters?.collateralCoin,
740
- requestParameters?.startTime,
741
- requestParameters?.endTime,
742
- requestParameters?.current,
743
- requestParameters?.limit,
744
- requestParameters?.recvWindow
745
- );
746
- return sendRequest(
747
- this.configuration,
748
- localVarAxiosArgs.endpoint,
749
- localVarAxiosArgs.method,
750
- localVarAxiosArgs.params,
751
- localVarAxiosArgs?.timeUnit,
752
- { isSigned: true }
753
- );
754
- }
755
- /**
756
- * Get Flexible Loan LTV Adjustment History
757
- *
758
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
759
- * The max interval between startTime and endTime is 180 days.
760
- *
761
- * Weight: 400
762
- *
763
- * @summary Get Flexible Loan LTV Adjustment History(USER_DATA)
764
- * @param {GetFlexibleLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
765
- * @returns {Promise<RestApiResponse<GetFlexibleLoanLtvAdjustmentHistoryResponse>>}
766
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
767
- * @memberof FlexibleRateApi
768
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-LTV-Adjustment-History Binance API Documentation}
769
- */
770
- async getFlexibleLoanLtvAdjustmentHistory(requestParameters = {}) {
771
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanLtvAdjustmentHistory(
772
- requestParameters?.loanCoin,
773
- requestParameters?.collateralCoin,
774
- requestParameters?.startTime,
775
- requestParameters?.endTime,
776
- requestParameters?.current,
777
- requestParameters?.limit,
778
- requestParameters?.recvWindow
779
- );
780
- return sendRequest(
781
- this.configuration,
782
- localVarAxiosArgs.endpoint,
783
- localVarAxiosArgs.method,
784
- localVarAxiosArgs.params,
785
- localVarAxiosArgs?.timeUnit,
786
- { isSigned: true }
787
- );
788
- }
789
- /**
790
- * Get Flexible Loan Ongoing Orders
791
- *
792
- * Weight: 300
793
- *
794
- * @summary Get Flexible Loan Ongoing Orders(USER_DATA)
795
- * @param {GetFlexibleLoanOngoingOrdersRequest} requestParameters Request parameters.
796
- * @returns {Promise<RestApiResponse<GetFlexibleLoanOngoingOrdersResponse>>}
797
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
798
- * @memberof FlexibleRateApi
799
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Ongoing-Orders Binance API Documentation}
800
- */
801
- async getFlexibleLoanOngoingOrders(requestParameters = {}) {
802
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanOngoingOrders(
803
- requestParameters?.loanCoin,
804
- requestParameters?.collateralCoin,
805
- requestParameters?.current,
806
- requestParameters?.limit,
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
- * Get Flexible Loan Repayment History
820
- *
821
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
822
- * The max interval between startTime and endTime is 180 days.
823
- *
824
- * Weight: 400
825
- *
826
- * @summary Get Flexible Loan Repayment History(USER_DATA)
827
- * @param {GetFlexibleLoanRepaymentHistoryRequest} requestParameters Request parameters.
828
- * @returns {Promise<RestApiResponse<GetFlexibleLoanRepaymentHistoryResponse>>}
829
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
830
- * @memberof FlexibleRateApi
831
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Repayment-History Binance API Documentation}
832
- */
833
- async getFlexibleLoanRepaymentHistory(requestParameters = {}) {
834
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanRepaymentHistory(
835
- requestParameters?.loanCoin,
836
- requestParameters?.collateralCoin,
837
- requestParameters?.startTime,
838
- requestParameters?.endTime,
839
- requestParameters?.current,
840
- requestParameters?.limit,
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
- }
223
+ constructor(configuration) {
224
+ this.configuration = configuration;
225
+ this.localVarAxiosParamCreator = FlexibleRateApiAxiosParamCreator(configuration);
226
+ }
227
+ /**
228
+ *
229
+ * Weight: 6000
230
+ *
231
+ * @summary Check Collateral Repay Rate (USER_DATA)
232
+ * @param {CheckCollateralRepayRateRequest} requestParameters Request parameters.
233
+ * @returns {Promise<RestApiResponse<CheckCollateralRepayRateResponse>>}
234
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
235
+ * @memberof FlexibleRateApi
236
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Check-Collateral-Repay-Rate Binance API Documentation}
237
+ */
238
+ async checkCollateralRepayRate(requestParameters) {
239
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkCollateralRepayRate(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.recvWindow);
240
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
241
+ }
242
+ /**
243
+ * Flexible Loan Adjust LTV
244
+ *
245
+ * API Key needs Spot & Margin Trading permission for this endpoint
246
+ *
247
+ * Weight: 6000
248
+ *
249
+ * @summary Flexible Loan Adjust LTV(TRADE)
250
+ * @param {FlexibleLoanAdjustLtvRequest} requestParameters Request parameters.
251
+ * @returns {Promise<RestApiResponse<FlexibleLoanAdjustLtvResponse>>}
252
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
253
+ * @memberof FlexibleRateApi
254
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Adjust-LTV Binance API Documentation}
255
+ */
256
+ async flexibleLoanAdjustLtv(requestParameters) {
257
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanAdjustLtv(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.adjustmentAmount, requestParameters?.direction, requestParameters?.recvWindow);
258
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
259
+ }
260
+ /**
261
+ * Borrow Flexible Loan
262
+ *
263
+ *
264
+ * Only available for master account
265
+ * You can customize LTV by entering loanAmount and collateralAmount.
266
+ *
267
+ * Weight: 6000
268
+ *
269
+ * @summary Flexible Loan Borrow(TRADE)
270
+ * @param {FlexibleLoanBorrowRequest} requestParameters Request parameters.
271
+ * @returns {Promise<RestApiResponse<FlexibleLoanBorrowResponse>>}
272
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
273
+ * @memberof FlexibleRateApi
274
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Borrow Binance API Documentation}
275
+ */
276
+ async flexibleLoanBorrow(requestParameters) {
277
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanBorrow(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.loanAmount, requestParameters?.collateralAmount, requestParameters?.recvWindow);
278
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
279
+ }
280
+ /**
281
+ * Flexible Loan Repay
282
+ *
283
+ *
284
+ * repayAmount is mandatory even fullRepayment = FALSE
285
+ *
286
+ * Weight: 6000
287
+ *
288
+ * @summary Flexible Loan Repay(TRADE)
289
+ * @param {FlexibleLoanRepayRequest} requestParameters Request parameters.
290
+ * @returns {Promise<RestApiResponse<FlexibleLoanRepayResponse>>}
291
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
292
+ * @memberof FlexibleRateApi
293
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Repay Binance API Documentation}
294
+ */
295
+ async flexibleLoanRepay(requestParameters) {
296
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanRepay(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.repayAmount, requestParameters?.collateralReturn, requestParameters?.fullRepayment, requestParameters?.repaymentType, requestParameters?.recvWindow);
297
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
298
+ }
299
+ /**
300
+ * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
301
+ *
302
+ * Weight: 400
303
+ *
304
+ * @summary Get Flexible Loan Assets Data(USER_DATA)
305
+ * @param {GetFlexibleLoanAssetsDataRequest} requestParameters Request parameters.
306
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanAssetsDataResponse>>}
307
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
308
+ * @memberof FlexibleRateApi
309
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Assets-Data Binance API Documentation}
310
+ */
311
+ async getFlexibleLoanAssetsData(requestParameters = {}) {
312
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanAssetsData(requestParameters?.loanCoin, requestParameters?.recvWindow);
313
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
314
+ }
315
+ /**
316
+ * Get Flexible Loan Borrow History
317
+ *
318
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
319
+ * The max interval between startTime and endTime is 180 days.
320
+ *
321
+ * Weight: 400
322
+ *
323
+ * @summary Get Flexible Loan Borrow History(USER_DATA)
324
+ * @param {GetFlexibleLoanBorrowHistoryRequest} requestParameters Request parameters.
325
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanBorrowHistoryResponse>>}
326
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
327
+ * @memberof FlexibleRateApi
328
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Borrow-History Binance API Documentation}
329
+ */
330
+ async getFlexibleLoanBorrowHistory(requestParameters = {}) {
331
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanBorrowHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
332
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
333
+ }
334
+ /**
335
+ * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
336
+ *
337
+ * Weight: 400
338
+ *
339
+ * @summary Get Flexible Loan Collateral Assets Data(USER_DATA)
340
+ * @param {GetFlexibleLoanCollateralAssetsDataRequest} requestParameters Request parameters.
341
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanCollateralAssetsDataResponse>>}
342
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
343
+ * @memberof FlexibleRateApi
344
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Collateral-Assets-Data Binance API Documentation}
345
+ */
346
+ async getFlexibleLoanCollateralAssetsData(requestParameters = {}) {
347
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanCollateralAssetsData(requestParameters?.collateralCoin, requestParameters?.recvWindow);
348
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
349
+ }
350
+ /**
351
+ *
352
+ * Weight: 400
353
+ *
354
+ * @summary Get Flexible Loan Liquidation History (USER_DATA)
355
+ * @param {GetFlexibleLoanLiquidationHistoryRequest} requestParameters Request parameters.
356
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanLiquidationHistoryResponse>>}
357
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
358
+ * @memberof FlexibleRateApi
359
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Liquidation-History Binance API Documentation}
360
+ */
361
+ async getFlexibleLoanLiquidationHistory(requestParameters = {}) {
362
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanLiquidationHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
363
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
364
+ }
365
+ /**
366
+ * Get Flexible Loan LTV Adjustment History
367
+ *
368
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
369
+ * The max interval between startTime and endTime is 180 days.
370
+ *
371
+ * Weight: 400
372
+ *
373
+ * @summary Get Flexible Loan LTV Adjustment History(USER_DATA)
374
+ * @param {GetFlexibleLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
375
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanLtvAdjustmentHistoryResponse>>}
376
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
377
+ * @memberof FlexibleRateApi
378
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-LTV-Adjustment-History Binance API Documentation}
379
+ */
380
+ async getFlexibleLoanLtvAdjustmentHistory(requestParameters = {}) {
381
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanLtvAdjustmentHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
382
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
383
+ }
384
+ /**
385
+ * Get Flexible Loan Ongoing Orders
386
+ *
387
+ * Weight: 300
388
+ *
389
+ * @summary Get Flexible Loan Ongoing Orders(USER_DATA)
390
+ * @param {GetFlexibleLoanOngoingOrdersRequest} requestParameters Request parameters.
391
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanOngoingOrdersResponse>>}
392
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
393
+ * @memberof FlexibleRateApi
394
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Ongoing-Orders Binance API Documentation}
395
+ */
396
+ async getFlexibleLoanOngoingOrders(requestParameters = {}) {
397
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanOngoingOrders(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
398
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
399
+ }
400
+ /**
401
+ * Get Flexible Loan Repayment History
402
+ *
403
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
404
+ * The max interval between startTime and endTime is 180 days.
405
+ *
406
+ * Weight: 400
407
+ *
408
+ * @summary Get Flexible Loan Repayment History(USER_DATA)
409
+ * @param {GetFlexibleLoanRepaymentHistoryRequest} requestParameters Request parameters.
410
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanRepaymentHistoryResponse>>}
411
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
412
+ * @memberof FlexibleRateApi
413
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Repayment-History Binance API Documentation}
414
+ */
415
+ async getFlexibleLoanRepaymentHistory(requestParameters = {}) {
416
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanRepaymentHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
417
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
418
+ }
852
419
  };
853
420
 
854
- // src/rest-api/modules/stable-rate-api.ts
855
- import {
856
- assertParamExists as assertParamExists2,
857
- sendRequest as sendRequest2
858
- } from "@binance/common";
859
- var StableRateApiAxiosParamCreator = function(configuration) {
860
- return {
861
- /**
862
- * Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.
863
- *
864
- * Weight: 6000
865
- *
866
- * @summary Check Collateral Repay Rate(USER_DATA)
867
- * @param {string} loanCoin
868
- * @param {string} collateralCoin
869
- * @param {number} repayAmount repay amount of loanCoin
870
- * @param {number} [recvWindow]
871
- *
872
- * @throws {RequiredError}
873
- */
874
- checkCollateralRepayRateStableRate: async (loanCoin, collateralCoin, repayAmount, recvWindow) => {
875
- assertParamExists2("checkCollateralRepayRateStableRate", "loanCoin", loanCoin);
876
- assertParamExists2(
877
- "checkCollateralRepayRateStableRate",
878
- "collateralCoin",
879
- collateralCoin
880
- );
881
- assertParamExists2("checkCollateralRepayRateStableRate", "repayAmount", repayAmount);
882
- const localVarQueryParameter = {};
883
- if (loanCoin !== void 0 && loanCoin !== null) {
884
- localVarQueryParameter["loanCoin"] = loanCoin;
885
- }
886
- if (collateralCoin !== void 0 && collateralCoin !== null) {
887
- localVarQueryParameter["collateralCoin"] = collateralCoin;
888
- }
889
- if (repayAmount !== void 0 && repayAmount !== null) {
890
- localVarQueryParameter["repayAmount"] = repayAmount;
891
- }
892
- if (recvWindow !== void 0 && recvWindow !== null) {
893
- localVarQueryParameter["recvWindow"] = recvWindow;
894
- }
895
- let _timeUnit;
896
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
897
- return {
898
- endpoint: "/sapi/v1/loan/repay/collateral/rate",
899
- method: "GET",
900
- params: localVarQueryParameter,
901
- timeUnit: _timeUnit
902
- };
903
- },
904
- /**
905
- * Get Crypto Loans Income History
906
- *
907
- * If startTime and endTime are not sent, the recent 7-day data will be returned.
908
- * The max interval between startTime and endTime is 30 days.
909
- *
910
- * Weight: 6000
911
- *
912
- * @summary Get Crypto Loans Income History(USER_DATA)
913
- * @param {string} [asset]
914
- * @param {string} [type] All types will be returned by default. Enum:`borrowIn` ,`collateralSpent`, `repayAmount`, `collateralReturn`(Collateral return after repayment), `addCollateral`, `removeCollateral`, `collateralReturnAfterLiquidation`
915
- * @param {number} [startTime]
916
- * @param {number} [endTime]
917
- * @param {number} [limit] Default: 10; max: 100
918
- * @param {number} [recvWindow]
919
- *
920
- * @throws {RequiredError}
921
- */
922
- getCryptoLoansIncomeHistory: async (asset, type, startTime, endTime, limit, recvWindow) => {
923
- const localVarQueryParameter = {};
924
- if (asset !== void 0 && asset !== null) {
925
- localVarQueryParameter["asset"] = asset;
926
- }
927
- if (type !== void 0 && type !== null) {
928
- localVarQueryParameter["type"] = type;
929
- }
930
- if (startTime !== void 0 && startTime !== null) {
931
- localVarQueryParameter["startTime"] = startTime;
932
- }
933
- if (endTime !== void 0 && endTime !== null) {
934
- localVarQueryParameter["endTime"] = endTime;
935
- }
936
- if (limit !== void 0 && limit !== null) {
937
- localVarQueryParameter["limit"] = limit;
938
- }
939
- if (recvWindow !== void 0 && recvWindow !== null) {
940
- localVarQueryParameter["recvWindow"] = recvWindow;
941
- }
942
- let _timeUnit;
943
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
944
- return {
945
- endpoint: "/sapi/v1/loan/income",
946
- method: "GET",
947
- params: localVarQueryParameter,
948
- timeUnit: _timeUnit
949
- };
950
- },
951
- /**
952
- * Get Loan Borrow History
953
- *
954
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
955
- * The max interval between startTime and endTime is 180 days.
956
- *
957
- * Weight: 400
958
- *
959
- * @summary Get Loan Borrow History(USER_DATA)
960
- * @param {number} [orderId] orderId in `POST /sapi/v1/loan/borrow`
961
- * @param {string} [loanCoin]
962
- * @param {string} [collateralCoin]
963
- * @param {number} [startTime]
964
- * @param {number} [endTime]
965
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
966
- * @param {number} [limit] Default: 10; max: 100
967
- * @param {number} [recvWindow]
968
- *
969
- * @throws {RequiredError}
970
- */
971
- getLoanBorrowHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
972
- const localVarQueryParameter = {};
973
- if (orderId !== void 0 && orderId !== null) {
974
- localVarQueryParameter["orderId"] = orderId;
975
- }
976
- if (loanCoin !== void 0 && loanCoin !== null) {
977
- localVarQueryParameter["loanCoin"] = loanCoin;
978
- }
979
- if (collateralCoin !== void 0 && collateralCoin !== null) {
980
- localVarQueryParameter["collateralCoin"] = collateralCoin;
981
- }
982
- if (startTime !== void 0 && startTime !== null) {
983
- localVarQueryParameter["startTime"] = startTime;
984
- }
985
- if (endTime !== void 0 && endTime !== null) {
986
- localVarQueryParameter["endTime"] = endTime;
987
- }
988
- if (current !== void 0 && current !== null) {
989
- localVarQueryParameter["current"] = current;
990
- }
991
- if (limit !== void 0 && limit !== null) {
992
- localVarQueryParameter["limit"] = limit;
993
- }
994
- if (recvWindow !== void 0 && recvWindow !== null) {
995
- localVarQueryParameter["recvWindow"] = recvWindow;
996
- }
997
- let _timeUnit;
998
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
999
- return {
1000
- endpoint: "/sapi/v1/loan/borrow/history",
1001
- method: "GET",
1002
- params: localVarQueryParameter,
1003
- timeUnit: _timeUnit
1004
- };
1005
- },
1006
- /**
1007
- * Get Loan LTV Adjustment History
1008
- *
1009
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1010
- * The max interval between startTime and endTime is 180 days.
1011
- *
1012
- * Weight: 400
1013
- *
1014
- * @summary Get Loan LTV Adjustment History(USER_DATA)
1015
- * @param {number} [orderId] orderId in `POST /sapi/v1/loan/borrow`
1016
- * @param {string} [loanCoin]
1017
- * @param {string} [collateralCoin]
1018
- * @param {number} [startTime]
1019
- * @param {number} [endTime]
1020
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
1021
- * @param {number} [limit] Default: 10; max: 100
1022
- * @param {number} [recvWindow]
1023
- *
1024
- * @throws {RequiredError}
1025
- */
1026
- getLoanLtvAdjustmentHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
1027
- const localVarQueryParameter = {};
1028
- if (orderId !== void 0 && orderId !== null) {
1029
- localVarQueryParameter["orderId"] = orderId;
1030
- }
1031
- if (loanCoin !== void 0 && loanCoin !== null) {
1032
- localVarQueryParameter["loanCoin"] = loanCoin;
1033
- }
1034
- if (collateralCoin !== void 0 && collateralCoin !== null) {
1035
- localVarQueryParameter["collateralCoin"] = collateralCoin;
1036
- }
1037
- if (startTime !== void 0 && startTime !== null) {
1038
- localVarQueryParameter["startTime"] = startTime;
1039
- }
1040
- if (endTime !== void 0 && endTime !== null) {
1041
- localVarQueryParameter["endTime"] = endTime;
1042
- }
1043
- if (current !== void 0 && current !== null) {
1044
- localVarQueryParameter["current"] = current;
1045
- }
1046
- if (limit !== void 0 && limit !== null) {
1047
- localVarQueryParameter["limit"] = limit;
1048
- }
1049
- if (recvWindow !== void 0 && recvWindow !== null) {
1050
- localVarQueryParameter["recvWindow"] = recvWindow;
1051
- }
1052
- let _timeUnit;
1053
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
1054
- return {
1055
- endpoint: "/sapi/v1/loan/ltv/adjustment/history",
1056
- method: "GET",
1057
- params: localVarQueryParameter,
1058
- timeUnit: _timeUnit
1059
- };
1060
- },
1061
- /**
1062
- * Get Loan Repayment History
1063
- *
1064
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1065
- * The max interval between startTime and endTime is 180 days.
1066
- *
1067
- * Weight: 400
1068
- *
1069
- * @summary Get Loan Repayment History(USER_DATA)
1070
- * @param {number} [orderId] orderId in `POST /sapi/v1/loan/borrow`
1071
- * @param {string} [loanCoin]
1072
- * @param {string} [collateralCoin]
1073
- * @param {number} [startTime]
1074
- * @param {number} [endTime]
1075
- * @param {number} [current] Current querying page. Start from 1; default: 1; max: 1000
1076
- * @param {number} [limit] Default: 10; max: 100
1077
- * @param {number} [recvWindow]
1078
- *
1079
- * @throws {RequiredError}
1080
- */
1081
- getLoanRepaymentHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
1082
- const localVarQueryParameter = {};
1083
- if (orderId !== void 0 && orderId !== null) {
1084
- localVarQueryParameter["orderId"] = orderId;
1085
- }
1086
- if (loanCoin !== void 0 && loanCoin !== null) {
1087
- localVarQueryParameter["loanCoin"] = loanCoin;
1088
- }
1089
- if (collateralCoin !== void 0 && collateralCoin !== null) {
1090
- localVarQueryParameter["collateralCoin"] = collateralCoin;
1091
- }
1092
- if (startTime !== void 0 && startTime !== null) {
1093
- localVarQueryParameter["startTime"] = startTime;
1094
- }
1095
- if (endTime !== void 0 && endTime !== null) {
1096
- localVarQueryParameter["endTime"] = endTime;
1097
- }
1098
- if (current !== void 0 && current !== null) {
1099
- localVarQueryParameter["current"] = current;
1100
- }
1101
- if (limit !== void 0 && limit !== null) {
1102
- localVarQueryParameter["limit"] = limit;
1103
- }
1104
- if (recvWindow !== void 0 && recvWindow !== null) {
1105
- localVarQueryParameter["recvWindow"] = recvWindow;
1106
- }
1107
- let _timeUnit;
1108
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
1109
- return {
1110
- endpoint: "/sapi/v1/loan/repay/history",
1111
- method: "GET",
1112
- params: localVarQueryParameter,
1113
- timeUnit: _timeUnit
1114
- };
1115
- }
1116
- };
421
+ //#endregion
422
+ //#region src/rest-api/modules/stable-rate-api.ts
423
+ /**
424
+ * Binance Crypto Loan REST API
425
+ *
426
+ * OpenAPI Specification for the Binance Crypto Loan REST API
427
+ *
428
+ * The version of the OpenAPI document: 1.0.0
429
+ *
430
+ *
431
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
432
+ * https://openapi-generator.tech
433
+ * Do not edit the class manually.
434
+ */
435
+ /**
436
+ * StableRateApi - axios parameter creator
437
+ */
438
+ const StableRateApiAxiosParamCreator = function(configuration) {
439
+ return {
440
+ checkCollateralRepayRateStableRate: async (loanCoin, collateralCoin, repayAmount, recvWindow) => {
441
+ assertParamExists("checkCollateralRepayRateStableRate", "loanCoin", loanCoin);
442
+ assertParamExists("checkCollateralRepayRateStableRate", "collateralCoin", collateralCoin);
443
+ assertParamExists("checkCollateralRepayRateStableRate", "repayAmount", repayAmount);
444
+ const localVarQueryParameter = {};
445
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
446
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
447
+ if (repayAmount !== void 0 && repayAmount !== null) localVarQueryParameter["repayAmount"] = repayAmount;
448
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
449
+ let _timeUnit;
450
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
451
+ return {
452
+ endpoint: "/sapi/v1/loan/repay/collateral/rate",
453
+ method: "GET",
454
+ params: localVarQueryParameter,
455
+ timeUnit: _timeUnit
456
+ };
457
+ },
458
+ getCryptoLoansIncomeHistory: async (asset, type, startTime, endTime, limit, recvWindow) => {
459
+ const localVarQueryParameter = {};
460
+ if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
461
+ if (type !== void 0 && type !== null) localVarQueryParameter["type"] = type;
462
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
463
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
464
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
465
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
466
+ let _timeUnit;
467
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
468
+ return {
469
+ endpoint: "/sapi/v1/loan/income",
470
+ method: "GET",
471
+ params: localVarQueryParameter,
472
+ timeUnit: _timeUnit
473
+ };
474
+ },
475
+ getLoanBorrowHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
476
+ const localVarQueryParameter = {};
477
+ if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
478
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
479
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
480
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
481
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
482
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
483
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
484
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
485
+ let _timeUnit;
486
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
487
+ return {
488
+ endpoint: "/sapi/v1/loan/borrow/history",
489
+ method: "GET",
490
+ params: localVarQueryParameter,
491
+ timeUnit: _timeUnit
492
+ };
493
+ },
494
+ getLoanLtvAdjustmentHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
495
+ const localVarQueryParameter = {};
496
+ if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
497
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
498
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
499
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
500
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
501
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
502
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
503
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
504
+ let _timeUnit;
505
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
506
+ return {
507
+ endpoint: "/sapi/v1/loan/ltv/adjustment/history",
508
+ method: "GET",
509
+ params: localVarQueryParameter,
510
+ timeUnit: _timeUnit
511
+ };
512
+ },
513
+ getLoanRepaymentHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
514
+ const localVarQueryParameter = {};
515
+ if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
516
+ if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
517
+ if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
518
+ if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
519
+ if (endTime !== void 0 && endTime !== null) localVarQueryParameter["endTime"] = endTime;
520
+ if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
521
+ if (limit !== void 0 && limit !== null) localVarQueryParameter["limit"] = limit;
522
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
523
+ let _timeUnit;
524
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
525
+ return {
526
+ endpoint: "/sapi/v1/loan/repay/history",
527
+ method: "GET",
528
+ params: localVarQueryParameter,
529
+ timeUnit: _timeUnit
530
+ };
531
+ }
532
+ };
1117
533
  };
534
+ /**
535
+ * StableRateApi - object-oriented interface
536
+ * @class StableRateApi
537
+ */
1118
538
  var StableRateApi = class {
1119
- constructor(configuration) {
1120
- this.configuration = configuration;
1121
- this.localVarAxiosParamCreator = StableRateApiAxiosParamCreator(configuration);
1122
- }
1123
- /**
1124
- * Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.
1125
- *
1126
- * Weight: 6000
1127
- *
1128
- * @summary Check Collateral Repay Rate(USER_DATA)
1129
- * @param {CheckCollateralRepayRateStableRateRequest} requestParameters Request parameters.
1130
- * @returns {Promise<RestApiResponse<CheckCollateralRepayRateStableRateResponse>>}
1131
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1132
- * @memberof StableRateApi
1133
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Check-Collateral-Repay-Rate Binance API Documentation}
1134
- */
1135
- async checkCollateralRepayRateStableRate(requestParameters) {
1136
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkCollateralRepayRateStableRate(
1137
- requestParameters?.loanCoin,
1138
- requestParameters?.collateralCoin,
1139
- requestParameters?.repayAmount,
1140
- requestParameters?.recvWindow
1141
- );
1142
- return sendRequest2(
1143
- this.configuration,
1144
- localVarAxiosArgs.endpoint,
1145
- localVarAxiosArgs.method,
1146
- localVarAxiosArgs.params,
1147
- localVarAxiosArgs?.timeUnit,
1148
- { isSigned: true }
1149
- );
1150
- }
1151
- /**
1152
- * Get Crypto Loans Income History
1153
- *
1154
- * If startTime and endTime are not sent, the recent 7-day data will be returned.
1155
- * The max interval between startTime and endTime is 30 days.
1156
- *
1157
- * Weight: 6000
1158
- *
1159
- * @summary Get Crypto Loans Income History(USER_DATA)
1160
- * @param {GetCryptoLoansIncomeHistoryRequest} requestParameters Request parameters.
1161
- * @returns {Promise<RestApiResponse<GetCryptoLoansIncomeHistoryResponse>>}
1162
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1163
- * @memberof StableRateApi
1164
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Get-Crypto-Loans-Income-History Binance API Documentation}
1165
- */
1166
- async getCryptoLoansIncomeHistory(requestParameters = {}) {
1167
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCryptoLoansIncomeHistory(
1168
- requestParameters?.asset,
1169
- requestParameters?.type,
1170
- requestParameters?.startTime,
1171
- requestParameters?.endTime,
1172
- requestParameters?.limit,
1173
- requestParameters?.recvWindow
1174
- );
1175
- return sendRequest2(
1176
- this.configuration,
1177
- localVarAxiosArgs.endpoint,
1178
- localVarAxiosArgs.method,
1179
- localVarAxiosArgs.params,
1180
- localVarAxiosArgs?.timeUnit,
1181
- { isSigned: true }
1182
- );
1183
- }
1184
- /**
1185
- * Get Loan Borrow History
1186
- *
1187
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1188
- * The max interval between startTime and endTime is 180 days.
1189
- *
1190
- * Weight: 400
1191
- *
1192
- * @summary Get Loan Borrow History(USER_DATA)
1193
- * @param {GetLoanBorrowHistoryRequest} requestParameters Request parameters.
1194
- * @returns {Promise<RestApiResponse<GetLoanBorrowHistoryResponse>>}
1195
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1196
- * @memberof StableRateApi
1197
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Borrow-History Binance API Documentation}
1198
- */
1199
- async getLoanBorrowHistory(requestParameters = {}) {
1200
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanBorrowHistory(
1201
- requestParameters?.orderId,
1202
- requestParameters?.loanCoin,
1203
- requestParameters?.collateralCoin,
1204
- requestParameters?.startTime,
1205
- requestParameters?.endTime,
1206
- requestParameters?.current,
1207
- requestParameters?.limit,
1208
- requestParameters?.recvWindow
1209
- );
1210
- return sendRequest2(
1211
- this.configuration,
1212
- localVarAxiosArgs.endpoint,
1213
- localVarAxiosArgs.method,
1214
- localVarAxiosArgs.params,
1215
- localVarAxiosArgs?.timeUnit,
1216
- { isSigned: true }
1217
- );
1218
- }
1219
- /**
1220
- * Get Loan LTV Adjustment History
1221
- *
1222
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1223
- * The max interval between startTime and endTime is 180 days.
1224
- *
1225
- * Weight: 400
1226
- *
1227
- * @summary Get Loan LTV Adjustment History(USER_DATA)
1228
- * @param {GetLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
1229
- * @returns {Promise<RestApiResponse<GetLoanLtvAdjustmentHistoryResponse>>}
1230
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1231
- * @memberof StableRateApi
1232
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-LTV-Adjustment-History Binance API Documentation}
1233
- */
1234
- async getLoanLtvAdjustmentHistory(requestParameters = {}) {
1235
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanLtvAdjustmentHistory(
1236
- requestParameters?.orderId,
1237
- requestParameters?.loanCoin,
1238
- requestParameters?.collateralCoin,
1239
- requestParameters?.startTime,
1240
- requestParameters?.endTime,
1241
- requestParameters?.current,
1242
- requestParameters?.limit,
1243
- requestParameters?.recvWindow
1244
- );
1245
- return sendRequest2(
1246
- this.configuration,
1247
- localVarAxiosArgs.endpoint,
1248
- localVarAxiosArgs.method,
1249
- localVarAxiosArgs.params,
1250
- localVarAxiosArgs?.timeUnit,
1251
- { isSigned: true }
1252
- );
1253
- }
1254
- /**
1255
- * Get Loan Repayment History
1256
- *
1257
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1258
- * The max interval between startTime and endTime is 180 days.
1259
- *
1260
- * Weight: 400
1261
- *
1262
- * @summary Get Loan Repayment History(USER_DATA)
1263
- * @param {GetLoanRepaymentHistoryRequest} requestParameters Request parameters.
1264
- * @returns {Promise<RestApiResponse<GetLoanRepaymentHistoryResponse>>}
1265
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1266
- * @memberof StableRateApi
1267
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Repayment-History Binance API Documentation}
1268
- */
1269
- async getLoanRepaymentHistory(requestParameters = {}) {
1270
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanRepaymentHistory(
1271
- requestParameters?.orderId,
1272
- requestParameters?.loanCoin,
1273
- requestParameters?.collateralCoin,
1274
- requestParameters?.startTime,
1275
- requestParameters?.endTime,
1276
- requestParameters?.current,
1277
- requestParameters?.limit,
1278
- requestParameters?.recvWindow
1279
- );
1280
- return sendRequest2(
1281
- this.configuration,
1282
- localVarAxiosArgs.endpoint,
1283
- localVarAxiosArgs.method,
1284
- localVarAxiosArgs.params,
1285
- localVarAxiosArgs?.timeUnit,
1286
- { isSigned: true }
1287
- );
1288
- }
539
+ constructor(configuration) {
540
+ this.configuration = configuration;
541
+ this.localVarAxiosParamCreator = StableRateApiAxiosParamCreator(configuration);
542
+ }
543
+ /**
544
+ * Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.
545
+ *
546
+ * Weight: 6000
547
+ *
548
+ * @summary Check Collateral Repay Rate(USER_DATA)
549
+ * @param {CheckCollateralRepayRateStableRateRequest} requestParameters Request parameters.
550
+ * @returns {Promise<RestApiResponse<CheckCollateralRepayRateStableRateResponse>>}
551
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
552
+ * @memberof StableRateApi
553
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Check-Collateral-Repay-Rate Binance API Documentation}
554
+ */
555
+ async checkCollateralRepayRateStableRate(requestParameters) {
556
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkCollateralRepayRateStableRate(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.repayAmount, requestParameters?.recvWindow);
557
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
558
+ }
559
+ /**
560
+ * Get Crypto Loans Income History
561
+ *
562
+ * If startTime and endTime are not sent, the recent 7-day data will be returned.
563
+ * The max interval between startTime and endTime is 30 days.
564
+ *
565
+ * Weight: 6000
566
+ *
567
+ * @summary Get Crypto Loans Income History(USER_DATA)
568
+ * @param {GetCryptoLoansIncomeHistoryRequest} requestParameters Request parameters.
569
+ * @returns {Promise<RestApiResponse<GetCryptoLoansIncomeHistoryResponse>>}
570
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
571
+ * @memberof StableRateApi
572
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Get-Crypto-Loans-Income-History Binance API Documentation}
573
+ */
574
+ async getCryptoLoansIncomeHistory(requestParameters = {}) {
575
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCryptoLoansIncomeHistory(requestParameters?.asset, requestParameters?.type, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit, requestParameters?.recvWindow);
576
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
577
+ }
578
+ /**
579
+ * Get Loan Borrow History
580
+ *
581
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
582
+ * The max interval between startTime and endTime is 180 days.
583
+ *
584
+ * Weight: 400
585
+ *
586
+ * @summary Get Loan Borrow History(USER_DATA)
587
+ * @param {GetLoanBorrowHistoryRequest} requestParameters Request parameters.
588
+ * @returns {Promise<RestApiResponse<GetLoanBorrowHistoryResponse>>}
589
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
590
+ * @memberof StableRateApi
591
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Borrow-History Binance API Documentation}
592
+ */
593
+ async getLoanBorrowHistory(requestParameters = {}) {
594
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanBorrowHistory(requestParameters?.orderId, requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
595
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
596
+ }
597
+ /**
598
+ * Get Loan LTV Adjustment History
599
+ *
600
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
601
+ * The max interval between startTime and endTime is 180 days.
602
+ *
603
+ * Weight: 400
604
+ *
605
+ * @summary Get Loan LTV Adjustment History(USER_DATA)
606
+ * @param {GetLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
607
+ * @returns {Promise<RestApiResponse<GetLoanLtvAdjustmentHistoryResponse>>}
608
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
609
+ * @memberof StableRateApi
610
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-LTV-Adjustment-History Binance API Documentation}
611
+ */
612
+ async getLoanLtvAdjustmentHistory(requestParameters = {}) {
613
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanLtvAdjustmentHistory(requestParameters?.orderId, requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
614
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
615
+ }
616
+ /**
617
+ * Get Loan Repayment History
618
+ *
619
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
620
+ * The max interval between startTime and endTime is 180 days.
621
+ *
622
+ * Weight: 400
623
+ *
624
+ * @summary Get Loan Repayment History(USER_DATA)
625
+ * @param {GetLoanRepaymentHistoryRequest} requestParameters Request parameters.
626
+ * @returns {Promise<RestApiResponse<GetLoanRepaymentHistoryResponse>>}
627
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
628
+ * @memberof StableRateApi
629
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Repayment-History Binance API Documentation}
630
+ */
631
+ async getLoanRepaymentHistory(requestParameters = {}) {
632
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanRepaymentHistory(requestParameters?.orderId, requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
633
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
634
+ }
1289
635
  };
1290
636
 
1291
- // src/rest-api/rest-api.ts
1292
- import { sendRequest as sendRequest3 } from "@binance/common";
637
+ //#endregion
638
+ //#region src/rest-api/rest-api.ts
639
+ /**
640
+ * Binance Crypto Loan REST API
641
+ *
642
+ * OpenAPI Specification for the Binance Crypto Loan REST API
643
+ *
644
+ * The version of the OpenAPI document: 1.0.0
645
+ *
646
+ *
647
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
648
+ * https://openapi-generator.tech
649
+ * Do not edit the class manually.
650
+ */
1293
651
  var RestAPI = class {
1294
- constructor(configuration) {
1295
- this.configuration = configuration;
1296
- this.flexibleRateApi = new FlexibleRateApi(configuration);
1297
- this.stableRateApi = new StableRateApi(configuration);
1298
- }
1299
- /**
1300
- * Generic function to send a request.
1301
- * @param endpoint - The API endpoint to call.
1302
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
1303
- * @param params - Query parameters for the request.
1304
- *
1305
- * @returns A promise resolving to the response data object.
1306
- */
1307
- sendRequest(endpoint, method, params = {}) {
1308
- return sendRequest3(this.configuration, endpoint, method, params, void 0);
1309
- }
1310
- /**
1311
- * Generic function to send a signed request.
1312
- * @param endpoint - The API endpoint to call.
1313
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
1314
- * @param params - Query parameters for the request.
1315
- *
1316
- * @returns A promise resolving to the response data object.
1317
- */
1318
- sendSignedRequest(endpoint, method, params = {}) {
1319
- return sendRequest3(this.configuration, endpoint, method, params, void 0, {
1320
- isSigned: true
1321
- });
1322
- }
1323
- /**
1324
- *
1325
- * Weight: 6000
1326
- *
1327
- * @summary Check Collateral Repay Rate (USER_DATA)
1328
- * @param {CheckCollateralRepayRateRequest} requestParameters Request parameters.
1329
- *
1330
- * @returns {Promise<RestApiResponse<CheckCollateralRepayRateResponse>>}
1331
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1332
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Check-Collateral-Repay-Rate Binance API Documentation}
1333
- */
1334
- checkCollateralRepayRate(requestParameters) {
1335
- return this.flexibleRateApi.checkCollateralRepayRate(requestParameters);
1336
- }
1337
- /**
1338
- * Flexible Loan Adjust LTV
1339
- *
1340
- * API Key needs Spot & Margin Trading permission for this endpoint
1341
- *
1342
- * Weight: 6000
1343
- *
1344
- * @summary Flexible Loan Adjust LTV(TRADE)
1345
- * @param {FlexibleLoanAdjustLtvRequest} requestParameters Request parameters.
1346
- *
1347
- * @returns {Promise<RestApiResponse<FlexibleLoanAdjustLtvResponse>>}
1348
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1349
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Adjust-LTV Binance API Documentation}
1350
- */
1351
- flexibleLoanAdjustLtv(requestParameters) {
1352
- return this.flexibleRateApi.flexibleLoanAdjustLtv(requestParameters);
1353
- }
1354
- /**
1355
- * Borrow Flexible Loan
1356
- *
1357
- *
1358
- * Only available for master account
1359
- * You can customize LTV by entering loanAmount and collateralAmount.
1360
- *
1361
- * Weight: 6000
1362
- *
1363
- * @summary Flexible Loan Borrow(TRADE)
1364
- * @param {FlexibleLoanBorrowRequest} requestParameters Request parameters.
1365
- *
1366
- * @returns {Promise<RestApiResponse<FlexibleLoanBorrowResponse>>}
1367
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1368
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Borrow Binance API Documentation}
1369
- */
1370
- flexibleLoanBorrow(requestParameters) {
1371
- return this.flexibleRateApi.flexibleLoanBorrow(requestParameters);
1372
- }
1373
- /**
1374
- * Flexible Loan Repay
1375
- *
1376
- *
1377
- * repayAmount is mandatory even fullRepayment = FALSE
1378
- *
1379
- * Weight: 6000
1380
- *
1381
- * @summary Flexible Loan Repay(TRADE)
1382
- * @param {FlexibleLoanRepayRequest} requestParameters Request parameters.
1383
- *
1384
- * @returns {Promise<RestApiResponse<FlexibleLoanRepayResponse>>}
1385
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1386
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Repay Binance API Documentation}
1387
- */
1388
- flexibleLoanRepay(requestParameters) {
1389
- return this.flexibleRateApi.flexibleLoanRepay(requestParameters);
1390
- }
1391
- /**
1392
- * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
1393
- *
1394
- * Weight: 400
1395
- *
1396
- * @summary Get Flexible Loan Assets Data(USER_DATA)
1397
- * @param {GetFlexibleLoanAssetsDataRequest} requestParameters Request parameters.
1398
- *
1399
- * @returns {Promise<RestApiResponse<GetFlexibleLoanAssetsDataResponse>>}
1400
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1401
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Assets-Data Binance API Documentation}
1402
- */
1403
- getFlexibleLoanAssetsData(requestParameters = {}) {
1404
- return this.flexibleRateApi.getFlexibleLoanAssetsData(requestParameters);
1405
- }
1406
- /**
1407
- * Get Flexible Loan Borrow History
1408
- *
1409
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1410
- * The max interval between startTime and endTime is 180 days.
1411
- *
1412
- * Weight: 400
1413
- *
1414
- * @summary Get Flexible Loan Borrow History(USER_DATA)
1415
- * @param {GetFlexibleLoanBorrowHistoryRequest} requestParameters Request parameters.
1416
- *
1417
- * @returns {Promise<RestApiResponse<GetFlexibleLoanBorrowHistoryResponse>>}
1418
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1419
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Borrow-History Binance API Documentation}
1420
- */
1421
- getFlexibleLoanBorrowHistory(requestParameters = {}) {
1422
- return this.flexibleRateApi.getFlexibleLoanBorrowHistory(requestParameters);
1423
- }
1424
- /**
1425
- * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
1426
- *
1427
- * Weight: 400
1428
- *
1429
- * @summary Get Flexible Loan Collateral Assets Data(USER_DATA)
1430
- * @param {GetFlexibleLoanCollateralAssetsDataRequest} requestParameters Request parameters.
1431
- *
1432
- * @returns {Promise<RestApiResponse<GetFlexibleLoanCollateralAssetsDataResponse>>}
1433
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1434
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Collateral-Assets-Data Binance API Documentation}
1435
- */
1436
- getFlexibleLoanCollateralAssetsData(requestParameters = {}) {
1437
- return this.flexibleRateApi.getFlexibleLoanCollateralAssetsData(requestParameters);
1438
- }
1439
- /**
1440
- *
1441
- * Weight: 400
1442
- *
1443
- * @summary Get Flexible Loan Liquidation History (USER_DATA)
1444
- * @param {GetFlexibleLoanLiquidationHistoryRequest} requestParameters Request parameters.
1445
- *
1446
- * @returns {Promise<RestApiResponse<GetFlexibleLoanLiquidationHistoryResponse>>}
1447
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1448
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Liquidation-History Binance API Documentation}
1449
- */
1450
- getFlexibleLoanLiquidationHistory(requestParameters = {}) {
1451
- return this.flexibleRateApi.getFlexibleLoanLiquidationHistory(requestParameters);
1452
- }
1453
- /**
1454
- * Get Flexible Loan LTV Adjustment History
1455
- *
1456
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1457
- * The max interval between startTime and endTime is 180 days.
1458
- *
1459
- * Weight: 400
1460
- *
1461
- * @summary Get Flexible Loan LTV Adjustment History(USER_DATA)
1462
- * @param {GetFlexibleLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
1463
- *
1464
- * @returns {Promise<RestApiResponse<GetFlexibleLoanLtvAdjustmentHistoryResponse>>}
1465
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1466
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-LTV-Adjustment-History Binance API Documentation}
1467
- */
1468
- getFlexibleLoanLtvAdjustmentHistory(requestParameters = {}) {
1469
- return this.flexibleRateApi.getFlexibleLoanLtvAdjustmentHistory(requestParameters);
1470
- }
1471
- /**
1472
- * Get Flexible Loan Ongoing Orders
1473
- *
1474
- * Weight: 300
1475
- *
1476
- * @summary Get Flexible Loan Ongoing Orders(USER_DATA)
1477
- * @param {GetFlexibleLoanOngoingOrdersRequest} requestParameters Request parameters.
1478
- *
1479
- * @returns {Promise<RestApiResponse<GetFlexibleLoanOngoingOrdersResponse>>}
1480
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1481
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Ongoing-Orders Binance API Documentation}
1482
- */
1483
- getFlexibleLoanOngoingOrders(requestParameters = {}) {
1484
- return this.flexibleRateApi.getFlexibleLoanOngoingOrders(requestParameters);
1485
- }
1486
- /**
1487
- * Get Flexible Loan Repayment History
1488
- *
1489
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1490
- * The max interval between startTime and endTime is 180 days.
1491
- *
1492
- * Weight: 400
1493
- *
1494
- * @summary Get Flexible Loan Repayment History(USER_DATA)
1495
- * @param {GetFlexibleLoanRepaymentHistoryRequest} requestParameters Request parameters.
1496
- *
1497
- * @returns {Promise<RestApiResponse<GetFlexibleLoanRepaymentHistoryResponse>>}
1498
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1499
- * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Repayment-History Binance API Documentation}
1500
- */
1501
- getFlexibleLoanRepaymentHistory(requestParameters = {}) {
1502
- return this.flexibleRateApi.getFlexibleLoanRepaymentHistory(requestParameters);
1503
- }
1504
- /**
1505
- * Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.
1506
- *
1507
- * Weight: 6000
1508
- *
1509
- * @summary Check Collateral Repay Rate(USER_DATA)
1510
- * @param {CheckCollateralRepayRateStableRateRequest} requestParameters Request parameters.
1511
- *
1512
- * @returns {Promise<RestApiResponse<CheckCollateralRepayRateStableRateResponse>>}
1513
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1514
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Check-Collateral-Repay-Rate Binance API Documentation}
1515
- */
1516
- checkCollateralRepayRateStableRate(requestParameters) {
1517
- return this.stableRateApi.checkCollateralRepayRateStableRate(requestParameters);
1518
- }
1519
- /**
1520
- * Get Crypto Loans Income History
1521
- *
1522
- * If startTime and endTime are not sent, the recent 7-day data will be returned.
1523
- * The max interval between startTime and endTime is 30 days.
1524
- *
1525
- * Weight: 6000
1526
- *
1527
- * @summary Get Crypto Loans Income History(USER_DATA)
1528
- * @param {GetCryptoLoansIncomeHistoryRequest} requestParameters Request parameters.
1529
- *
1530
- * @returns {Promise<RestApiResponse<GetCryptoLoansIncomeHistoryResponse>>}
1531
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1532
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Get-Crypto-Loans-Income-History Binance API Documentation}
1533
- */
1534
- getCryptoLoansIncomeHistory(requestParameters = {}) {
1535
- return this.stableRateApi.getCryptoLoansIncomeHistory(requestParameters);
1536
- }
1537
- /**
1538
- * Get Loan Borrow History
1539
- *
1540
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1541
- * The max interval between startTime and endTime is 180 days.
1542
- *
1543
- * Weight: 400
1544
- *
1545
- * @summary Get Loan Borrow History(USER_DATA)
1546
- * @param {GetLoanBorrowHistoryRequest} requestParameters Request parameters.
1547
- *
1548
- * @returns {Promise<RestApiResponse<GetLoanBorrowHistoryResponse>>}
1549
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1550
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Borrow-History Binance API Documentation}
1551
- */
1552
- getLoanBorrowHistory(requestParameters = {}) {
1553
- return this.stableRateApi.getLoanBorrowHistory(requestParameters);
1554
- }
1555
- /**
1556
- * Get Loan LTV Adjustment History
1557
- *
1558
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1559
- * The max interval between startTime and endTime is 180 days.
1560
- *
1561
- * Weight: 400
1562
- *
1563
- * @summary Get Loan LTV Adjustment History(USER_DATA)
1564
- * @param {GetLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
1565
- *
1566
- * @returns {Promise<RestApiResponse<GetLoanLtvAdjustmentHistoryResponse>>}
1567
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1568
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-LTV-Adjustment-History Binance API Documentation}
1569
- */
1570
- getLoanLtvAdjustmentHistory(requestParameters = {}) {
1571
- return this.stableRateApi.getLoanLtvAdjustmentHistory(requestParameters);
1572
- }
1573
- /**
1574
- * Get Loan Repayment History
1575
- *
1576
- * If startTime and endTime are not sent, the recent 90-day data will be returned.
1577
- * The max interval between startTime and endTime is 180 days.
1578
- *
1579
- * Weight: 400
1580
- *
1581
- * @summary Get Loan Repayment History(USER_DATA)
1582
- * @param {GetLoanRepaymentHistoryRequest} requestParameters Request parameters.
1583
- *
1584
- * @returns {Promise<RestApiResponse<GetLoanRepaymentHistoryResponse>>}
1585
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1586
- * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Repayment-History Binance API Documentation}
1587
- */
1588
- getLoanRepaymentHistory(requestParameters = {}) {
1589
- return this.stableRateApi.getLoanRepaymentHistory(requestParameters);
1590
- }
652
+ constructor(configuration) {
653
+ this.configuration = configuration;
654
+ this.flexibleRateApi = new FlexibleRateApi(configuration);
655
+ this.stableRateApi = new StableRateApi(configuration);
656
+ }
657
+ /**
658
+ * Generic function to send a request.
659
+ * @param endpoint - The API endpoint to call.
660
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
661
+ * @param params - Query parameters for the request.
662
+ *
663
+ * @returns A promise resolving to the response data object.
664
+ */
665
+ sendRequest(endpoint, method, params = {}) {
666
+ return sendRequest(this.configuration, endpoint, method, params, void 0);
667
+ }
668
+ /**
669
+ * Generic function to send a signed request.
670
+ * @param endpoint - The API endpoint to call.
671
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
672
+ * @param params - Query parameters for the request.
673
+ *
674
+ * @returns A promise resolving to the response data object.
675
+ */
676
+ sendSignedRequest(endpoint, method, params = {}) {
677
+ return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
678
+ }
679
+ /**
680
+ *
681
+ * Weight: 6000
682
+ *
683
+ * @summary Check Collateral Repay Rate (USER_DATA)
684
+ * @param {CheckCollateralRepayRateRequest} requestParameters Request parameters.
685
+ *
686
+ * @returns {Promise<RestApiResponse<CheckCollateralRepayRateResponse>>}
687
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
688
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Check-Collateral-Repay-Rate Binance API Documentation}
689
+ */
690
+ checkCollateralRepayRate(requestParameters) {
691
+ return this.flexibleRateApi.checkCollateralRepayRate(requestParameters);
692
+ }
693
+ /**
694
+ * Flexible Loan Adjust LTV
695
+ *
696
+ * API Key needs Spot & Margin Trading permission for this endpoint
697
+ *
698
+ * Weight: 6000
699
+ *
700
+ * @summary Flexible Loan Adjust LTV(TRADE)
701
+ * @param {FlexibleLoanAdjustLtvRequest} requestParameters Request parameters.
702
+ *
703
+ * @returns {Promise<RestApiResponse<FlexibleLoanAdjustLtvResponse>>}
704
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
705
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Adjust-LTV Binance API Documentation}
706
+ */
707
+ flexibleLoanAdjustLtv(requestParameters) {
708
+ return this.flexibleRateApi.flexibleLoanAdjustLtv(requestParameters);
709
+ }
710
+ /**
711
+ * Borrow Flexible Loan
712
+ *
713
+ *
714
+ * Only available for master account
715
+ * You can customize LTV by entering loanAmount and collateralAmount.
716
+ *
717
+ * Weight: 6000
718
+ *
719
+ * @summary Flexible Loan Borrow(TRADE)
720
+ * @param {FlexibleLoanBorrowRequest} requestParameters Request parameters.
721
+ *
722
+ * @returns {Promise<RestApiResponse<FlexibleLoanBorrowResponse>>}
723
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
724
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Borrow Binance API Documentation}
725
+ */
726
+ flexibleLoanBorrow(requestParameters) {
727
+ return this.flexibleRateApi.flexibleLoanBorrow(requestParameters);
728
+ }
729
+ /**
730
+ * Flexible Loan Repay
731
+ *
732
+ *
733
+ * repayAmount is mandatory even fullRepayment = FALSE
734
+ *
735
+ * Weight: 6000
736
+ *
737
+ * @summary Flexible Loan Repay(TRADE)
738
+ * @param {FlexibleLoanRepayRequest} requestParameters Request parameters.
739
+ *
740
+ * @returns {Promise<RestApiResponse<FlexibleLoanRepayResponse>>}
741
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
742
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/trade/Flexible-Loan-Repay Binance API Documentation}
743
+ */
744
+ flexibleLoanRepay(requestParameters) {
745
+ return this.flexibleRateApi.flexibleLoanRepay(requestParameters);
746
+ }
747
+ /**
748
+ * Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
749
+ *
750
+ * Weight: 400
751
+ *
752
+ * @summary Get Flexible Loan Assets Data(USER_DATA)
753
+ * @param {GetFlexibleLoanAssetsDataRequest} requestParameters Request parameters.
754
+ *
755
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanAssetsDataResponse>>}
756
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
757
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Assets-Data Binance API Documentation}
758
+ */
759
+ getFlexibleLoanAssetsData(requestParameters = {}) {
760
+ return this.flexibleRateApi.getFlexibleLoanAssetsData(requestParameters);
761
+ }
762
+ /**
763
+ * Get Flexible Loan Borrow History
764
+ *
765
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
766
+ * The max interval between startTime and endTime is 180 days.
767
+ *
768
+ * Weight: 400
769
+ *
770
+ * @summary Get Flexible Loan Borrow History(USER_DATA)
771
+ * @param {GetFlexibleLoanBorrowHistoryRequest} requestParameters Request parameters.
772
+ *
773
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanBorrowHistoryResponse>>}
774
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
775
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Borrow-History Binance API Documentation}
776
+ */
777
+ getFlexibleLoanBorrowHistory(requestParameters = {}) {
778
+ return this.flexibleRateApi.getFlexibleLoanBorrowHistory(requestParameters);
779
+ }
780
+ /**
781
+ * Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
782
+ *
783
+ * Weight: 400
784
+ *
785
+ * @summary Get Flexible Loan Collateral Assets Data(USER_DATA)
786
+ * @param {GetFlexibleLoanCollateralAssetsDataRequest} requestParameters Request parameters.
787
+ *
788
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanCollateralAssetsDataResponse>>}
789
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
790
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/market-data/Get-Flexible-Loan-Collateral-Assets-Data Binance API Documentation}
791
+ */
792
+ getFlexibleLoanCollateralAssetsData(requestParameters = {}) {
793
+ return this.flexibleRateApi.getFlexibleLoanCollateralAssetsData(requestParameters);
794
+ }
795
+ /**
796
+ *
797
+ * Weight: 400
798
+ *
799
+ * @summary Get Flexible Loan Liquidation History (USER_DATA)
800
+ * @param {GetFlexibleLoanLiquidationHistoryRequest} requestParameters Request parameters.
801
+ *
802
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanLiquidationHistoryResponse>>}
803
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
804
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Liquidation-History Binance API Documentation}
805
+ */
806
+ getFlexibleLoanLiquidationHistory(requestParameters = {}) {
807
+ return this.flexibleRateApi.getFlexibleLoanLiquidationHistory(requestParameters);
808
+ }
809
+ /**
810
+ * Get Flexible Loan LTV Adjustment History
811
+ *
812
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
813
+ * The max interval between startTime and endTime is 180 days.
814
+ *
815
+ * Weight: 400
816
+ *
817
+ * @summary Get Flexible Loan LTV Adjustment History(USER_DATA)
818
+ * @param {GetFlexibleLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
819
+ *
820
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanLtvAdjustmentHistoryResponse>>}
821
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
822
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-LTV-Adjustment-History Binance API Documentation}
823
+ */
824
+ getFlexibleLoanLtvAdjustmentHistory(requestParameters = {}) {
825
+ return this.flexibleRateApi.getFlexibleLoanLtvAdjustmentHistory(requestParameters);
826
+ }
827
+ /**
828
+ * Get Flexible Loan Ongoing Orders
829
+ *
830
+ * Weight: 300
831
+ *
832
+ * @summary Get Flexible Loan Ongoing Orders(USER_DATA)
833
+ * @param {GetFlexibleLoanOngoingOrdersRequest} requestParameters Request parameters.
834
+ *
835
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanOngoingOrdersResponse>>}
836
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
837
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Ongoing-Orders Binance API Documentation}
838
+ */
839
+ getFlexibleLoanOngoingOrders(requestParameters = {}) {
840
+ return this.flexibleRateApi.getFlexibleLoanOngoingOrders(requestParameters);
841
+ }
842
+ /**
843
+ * Get Flexible Loan Repayment History
844
+ *
845
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
846
+ * The max interval between startTime and endTime is 180 days.
847
+ *
848
+ * Weight: 400
849
+ *
850
+ * @summary Get Flexible Loan Repayment History(USER_DATA)
851
+ * @param {GetFlexibleLoanRepaymentHistoryRequest} requestParameters Request parameters.
852
+ *
853
+ * @returns {Promise<RestApiResponse<GetFlexibleLoanRepaymentHistoryResponse>>}
854
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
855
+ * @see {@link https://developers.binance.com/docs/crypto_loan/flexible-rate/user-information/Get-Flexible-Loan-Repayment-History Binance API Documentation}
856
+ */
857
+ getFlexibleLoanRepaymentHistory(requestParameters = {}) {
858
+ return this.flexibleRateApi.getFlexibleLoanRepaymentHistory(requestParameters);
859
+ }
860
+ /**
861
+ * Get the the rate of collateral coin / loan coin when using collateral repay, the rate will be valid within 8 second.
862
+ *
863
+ * Weight: 6000
864
+ *
865
+ * @summary Check Collateral Repay Rate(USER_DATA)
866
+ * @param {CheckCollateralRepayRateStableRateRequest} requestParameters Request parameters.
867
+ *
868
+ * @returns {Promise<RestApiResponse<CheckCollateralRepayRateStableRateResponse>>}
869
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
870
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Check-Collateral-Repay-Rate Binance API Documentation}
871
+ */
872
+ checkCollateralRepayRateStableRate(requestParameters) {
873
+ return this.stableRateApi.checkCollateralRepayRateStableRate(requestParameters);
874
+ }
875
+ /**
876
+ * Get Crypto Loans Income History
877
+ *
878
+ * If startTime and endTime are not sent, the recent 7-day data will be returned.
879
+ * The max interval between startTime and endTime is 30 days.
880
+ *
881
+ * Weight: 6000
882
+ *
883
+ * @summary Get Crypto Loans Income History(USER_DATA)
884
+ * @param {GetCryptoLoansIncomeHistoryRequest} requestParameters Request parameters.
885
+ *
886
+ * @returns {Promise<RestApiResponse<GetCryptoLoansIncomeHistoryResponse>>}
887
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
888
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Get-Crypto-Loans-Income-History Binance API Documentation}
889
+ */
890
+ getCryptoLoansIncomeHistory(requestParameters = {}) {
891
+ return this.stableRateApi.getCryptoLoansIncomeHistory(requestParameters);
892
+ }
893
+ /**
894
+ * Get Loan Borrow History
895
+ *
896
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
897
+ * The max interval between startTime and endTime is 180 days.
898
+ *
899
+ * Weight: 400
900
+ *
901
+ * @summary Get Loan Borrow History(USER_DATA)
902
+ * @param {GetLoanBorrowHistoryRequest} requestParameters Request parameters.
903
+ *
904
+ * @returns {Promise<RestApiResponse<GetLoanBorrowHistoryResponse>>}
905
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
906
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Borrow-History Binance API Documentation}
907
+ */
908
+ getLoanBorrowHistory(requestParameters = {}) {
909
+ return this.stableRateApi.getLoanBorrowHistory(requestParameters);
910
+ }
911
+ /**
912
+ * Get Loan LTV Adjustment History
913
+ *
914
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
915
+ * The max interval between startTime and endTime is 180 days.
916
+ *
917
+ * Weight: 400
918
+ *
919
+ * @summary Get Loan LTV Adjustment History(USER_DATA)
920
+ * @param {GetLoanLtvAdjustmentHistoryRequest} requestParameters Request parameters.
921
+ *
922
+ * @returns {Promise<RestApiResponse<GetLoanLtvAdjustmentHistoryResponse>>}
923
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
924
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-LTV-Adjustment-History Binance API Documentation}
925
+ */
926
+ getLoanLtvAdjustmentHistory(requestParameters = {}) {
927
+ return this.stableRateApi.getLoanLtvAdjustmentHistory(requestParameters);
928
+ }
929
+ /**
930
+ * Get Loan Repayment History
931
+ *
932
+ * If startTime and endTime are not sent, the recent 90-day data will be returned.
933
+ * The max interval between startTime and endTime is 180 days.
934
+ *
935
+ * Weight: 400
936
+ *
937
+ * @summary Get Loan Repayment History(USER_DATA)
938
+ * @param {GetLoanRepaymentHistoryRequest} requestParameters Request parameters.
939
+ *
940
+ * @returns {Promise<RestApiResponse<GetLoanRepaymentHistoryResponse>>}
941
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
942
+ * @see {@link https://developers.binance.com/docs/crypto_loan/stable-rate/user-information/Get-Loan-Repayment-History Binance API Documentation}
943
+ */
944
+ getLoanRepaymentHistory(requestParameters = {}) {
945
+ return this.stableRateApi.getLoanRepaymentHistory(requestParameters);
946
+ }
1591
947
  };
1592
948
 
1593
- // src/crypto-loan.ts
949
+ //#endregion
950
+ //#region src/rest-api/index.ts
951
+ var rest_api_exports = /* @__PURE__ */ __export({
952
+ FlexibleRateApi: () => FlexibleRateApi,
953
+ RestAPI: () => RestAPI,
954
+ StableRateApi: () => StableRateApi
955
+ });
956
+
957
+ //#endregion
958
+ //#region src/crypto-loan.ts
1594
959
  var CryptoLoan = class {
1595
- constructor(config) {
1596
- const userAgent = buildUserAgent(name, version);
1597
- if (config?.configurationRestAPI) {
1598
- const configRestAPI = new ConfigurationRestAPI4(
1599
- config.configurationRestAPI
1600
- );
1601
- configRestAPI.basePath = configRestAPI.basePath || CRYPTO_LOAN_REST_API_PROD_URL;
1602
- configRestAPI.baseOptions = configRestAPI.baseOptions || {};
1603
- configRestAPI.baseOptions.headers = {
1604
- ...configRestAPI.baseOptions.headers || {},
1605
- "User-Agent": userAgent
1606
- };
1607
- this.restAPI = new RestAPI(configRestAPI);
1608
- }
1609
- }
960
+ constructor(config) {
961
+ const userAgent = buildUserAgent(name, version);
962
+ if (config?.configurationRestAPI) {
963
+ const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);
964
+ configRestAPI.basePath = configRestAPI.basePath || CRYPTO_LOAN_REST_API_PROD_URL$1;
965
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
966
+ configRestAPI.baseOptions.headers = {
967
+ ...configRestAPI.baseOptions.headers || {},
968
+ "User-Agent": userAgent
969
+ };
970
+ this.restAPI = new RestAPI(configRestAPI);
971
+ }
972
+ }
1610
973
  };
1611
974
 
1612
- // src/index.ts
1613
- import {
1614
- CRYPTO_LOAN_REST_API_PROD_URL as CRYPTO_LOAN_REST_API_PROD_URL2,
1615
- ConnectorClientError,
1616
- RequiredError,
1617
- UnauthorizedError,
1618
- ForbiddenError,
1619
- TooManyRequestsError,
1620
- RateLimitBanError,
1621
- ServerError,
1622
- NetworkError,
1623
- NotFoundError,
1624
- BadRequestError
1625
- } from "@binance/common";
1626
- export {
1627
- BadRequestError,
1628
- CRYPTO_LOAN_REST_API_PROD_URL2 as CRYPTO_LOAN_REST_API_PROD_URL,
1629
- ConnectorClientError,
1630
- CryptoLoan,
1631
- rest_api_exports as CryptoLoanRestAPI,
1632
- ForbiddenError,
1633
- NetworkError,
1634
- NotFoundError,
1635
- RateLimitBanError,
1636
- RequiredError,
1637
- ServerError,
1638
- TooManyRequestsError,
1639
- UnauthorizedError
1640
- };
975
+ //#endregion
976
+ export { BadRequestError, CRYPTO_LOAN_REST_API_PROD_URL, ConfigurationCryptoLoan, ConnectorClientError, CryptoLoan, rest_api_exports as CryptoLoanRestAPI, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
1641
977
  //# sourceMappingURL=index.mjs.map