@binance/crypto-loan 8.0.3 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +73 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -2285,20 +2285,22 @@ declare class RestAPI {
|
|
|
2285
2285
|
* Generic function to send a request.
|
|
2286
2286
|
* @param endpoint - The API endpoint to call.
|
|
2287
2287
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
2288
|
-
* @param
|
|
2288
|
+
* @param queryParams - Query parameters for the request.
|
|
2289
|
+
* @param bodyParams - Body parameters for the request.
|
|
2289
2290
|
*
|
|
2290
2291
|
* @returns A promise resolving to the response data object.
|
|
2291
2292
|
*/
|
|
2292
|
-
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
2293
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
2293
2294
|
/**
|
|
2294
2295
|
* Generic function to send a signed request.
|
|
2295
2296
|
* @param endpoint - The API endpoint to call.
|
|
2296
2297
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
2297
|
-
* @param
|
|
2298
|
+
* @param queryParams - Query parameters for the request.
|
|
2299
|
+
* @param bodyParams - Body parameters for the request.
|
|
2298
2300
|
*
|
|
2299
2301
|
* @returns A promise resolving to the response data object.
|
|
2300
2302
|
*/
|
|
2301
|
-
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
2303
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
2302
2304
|
/**
|
|
2303
2305
|
*
|
|
2304
2306
|
* Weight: 6000
|
package/dist/index.d.ts
CHANGED
|
@@ -2287,20 +2287,22 @@ declare class RestAPI {
|
|
|
2287
2287
|
* Generic function to send a request.
|
|
2288
2288
|
* @param endpoint - The API endpoint to call.
|
|
2289
2289
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
2290
|
-
* @param
|
|
2290
|
+
* @param queryParams - Query parameters for the request.
|
|
2291
|
+
* @param bodyParams - Body parameters for the request.
|
|
2291
2292
|
*
|
|
2292
2293
|
* @returns A promise resolving to the response data object.
|
|
2293
2294
|
*/
|
|
2294
|
-
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
2295
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
2295
2296
|
/**
|
|
2296
2297
|
* Generic function to send a signed request.
|
|
2297
2298
|
* @param endpoint - The API endpoint to call.
|
|
2298
2299
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
2299
|
-
* @param
|
|
2300
|
+
* @param queryParams - Query parameters for the request.
|
|
2301
|
+
* @param bodyParams - Body parameters for the request.
|
|
2300
2302
|
*
|
|
2301
2303
|
* @returns A promise resolving to the response data object.
|
|
2302
2304
|
*/
|
|
2303
|
-
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
2305
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
2304
2306
|
/**
|
|
2305
2307
|
*
|
|
2306
2308
|
* Weight: 6000
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ let __binance_common = require("@binance/common");
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "@binance/crypto-loan";
|
|
17
|
-
var version = "8.0
|
|
17
|
+
var version = "8.1.0";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/rest-api/modules/flexible-rate-api.ts
|
|
@@ -39,6 +39,7 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
39
39
|
(0, __binance_common.assertParamExists)("checkCollateralRepayRate", "loanCoin", loanCoin);
|
|
40
40
|
(0, __binance_common.assertParamExists)("checkCollateralRepayRate", "collateralCoin", collateralCoin);
|
|
41
41
|
const localVarQueryParameter = {};
|
|
42
|
+
const localVarBodyParameter = {};
|
|
42
43
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
43
44
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
44
45
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
@@ -47,7 +48,8 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
47
48
|
return {
|
|
48
49
|
endpoint: "/sapi/v2/loan/flexible/repay/rate",
|
|
49
50
|
method: "GET",
|
|
50
|
-
|
|
51
|
+
queryParams: localVarQueryParameter,
|
|
52
|
+
bodyParams: localVarBodyParameter,
|
|
51
53
|
timeUnit: _timeUnit
|
|
52
54
|
};
|
|
53
55
|
},
|
|
@@ -57,6 +59,7 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
57
59
|
(0, __binance_common.assertParamExists)("flexibleLoanAdjustLtv", "adjustmentAmount", adjustmentAmount);
|
|
58
60
|
(0, __binance_common.assertParamExists)("flexibleLoanAdjustLtv", "direction", direction);
|
|
59
61
|
const localVarQueryParameter = {};
|
|
62
|
+
const localVarBodyParameter = {};
|
|
60
63
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
61
64
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
62
65
|
if (adjustmentAmount !== void 0 && adjustmentAmount !== null) localVarQueryParameter["adjustmentAmount"] = adjustmentAmount;
|
|
@@ -67,7 +70,8 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
67
70
|
return {
|
|
68
71
|
endpoint: "/sapi/v2/loan/flexible/adjust/ltv",
|
|
69
72
|
method: "POST",
|
|
70
|
-
|
|
73
|
+
queryParams: localVarQueryParameter,
|
|
74
|
+
bodyParams: localVarBodyParameter,
|
|
71
75
|
timeUnit: _timeUnit
|
|
72
76
|
};
|
|
73
77
|
},
|
|
@@ -75,6 +79,7 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
75
79
|
(0, __binance_common.assertParamExists)("flexibleLoanBorrow", "loanCoin", loanCoin);
|
|
76
80
|
(0, __binance_common.assertParamExists)("flexibleLoanBorrow", "collateralCoin", collateralCoin);
|
|
77
81
|
const localVarQueryParameter = {};
|
|
82
|
+
const localVarBodyParameter = {};
|
|
78
83
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
79
84
|
if (loanAmount !== void 0 && loanAmount !== null) localVarQueryParameter["loanAmount"] = loanAmount;
|
|
80
85
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
@@ -85,7 +90,8 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
85
90
|
return {
|
|
86
91
|
endpoint: "/sapi/v2/loan/flexible/borrow",
|
|
87
92
|
method: "POST",
|
|
88
|
-
|
|
93
|
+
queryParams: localVarQueryParameter,
|
|
94
|
+
bodyParams: localVarBodyParameter,
|
|
89
95
|
timeUnit: _timeUnit
|
|
90
96
|
};
|
|
91
97
|
},
|
|
@@ -94,6 +100,7 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
94
100
|
(0, __binance_common.assertParamExists)("flexibleLoanRepay", "collateralCoin", collateralCoin);
|
|
95
101
|
(0, __binance_common.assertParamExists)("flexibleLoanRepay", "repayAmount", repayAmount);
|
|
96
102
|
const localVarQueryParameter = {};
|
|
103
|
+
const localVarBodyParameter = {};
|
|
97
104
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
98
105
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
99
106
|
if (repayAmount !== void 0 && repayAmount !== null) localVarQueryParameter["repayAmount"] = repayAmount;
|
|
@@ -106,12 +113,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
106
113
|
return {
|
|
107
114
|
endpoint: "/sapi/v2/loan/flexible/repay",
|
|
108
115
|
method: "POST",
|
|
109
|
-
|
|
116
|
+
queryParams: localVarQueryParameter,
|
|
117
|
+
bodyParams: localVarBodyParameter,
|
|
110
118
|
timeUnit: _timeUnit
|
|
111
119
|
};
|
|
112
120
|
},
|
|
113
121
|
getFlexibleLoanAssetsData: async (loanCoin, recvWindow) => {
|
|
114
122
|
const localVarQueryParameter = {};
|
|
123
|
+
const localVarBodyParameter = {};
|
|
115
124
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
116
125
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
117
126
|
let _timeUnit;
|
|
@@ -119,12 +128,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
119
128
|
return {
|
|
120
129
|
endpoint: "/sapi/v2/loan/flexible/loanable/data",
|
|
121
130
|
method: "GET",
|
|
122
|
-
|
|
131
|
+
queryParams: localVarQueryParameter,
|
|
132
|
+
bodyParams: localVarBodyParameter,
|
|
123
133
|
timeUnit: _timeUnit
|
|
124
134
|
};
|
|
125
135
|
},
|
|
126
136
|
getFlexibleLoanBorrowHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
127
137
|
const localVarQueryParameter = {};
|
|
138
|
+
const localVarBodyParameter = {};
|
|
128
139
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
129
140
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
130
141
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
@@ -137,12 +148,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
137
148
|
return {
|
|
138
149
|
endpoint: "/sapi/v2/loan/flexible/borrow/history",
|
|
139
150
|
method: "GET",
|
|
140
|
-
|
|
151
|
+
queryParams: localVarQueryParameter,
|
|
152
|
+
bodyParams: localVarBodyParameter,
|
|
141
153
|
timeUnit: _timeUnit
|
|
142
154
|
};
|
|
143
155
|
},
|
|
144
156
|
getFlexibleLoanCollateralAssetsData: async (collateralCoin, recvWindow) => {
|
|
145
157
|
const localVarQueryParameter = {};
|
|
158
|
+
const localVarBodyParameter = {};
|
|
146
159
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
147
160
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
148
161
|
let _timeUnit;
|
|
@@ -150,12 +163,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
150
163
|
return {
|
|
151
164
|
endpoint: "/sapi/v2/loan/flexible/collateral/data",
|
|
152
165
|
method: "GET",
|
|
153
|
-
|
|
166
|
+
queryParams: localVarQueryParameter,
|
|
167
|
+
bodyParams: localVarBodyParameter,
|
|
154
168
|
timeUnit: _timeUnit
|
|
155
169
|
};
|
|
156
170
|
},
|
|
157
171
|
getFlexibleLoanLiquidationHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
158
172
|
const localVarQueryParameter = {};
|
|
173
|
+
const localVarBodyParameter = {};
|
|
159
174
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
160
175
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
161
176
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
@@ -168,12 +183,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
168
183
|
return {
|
|
169
184
|
endpoint: "/sapi/v2/loan/flexible/liquidation/history",
|
|
170
185
|
method: "GET",
|
|
171
|
-
|
|
186
|
+
queryParams: localVarQueryParameter,
|
|
187
|
+
bodyParams: localVarBodyParameter,
|
|
172
188
|
timeUnit: _timeUnit
|
|
173
189
|
};
|
|
174
190
|
},
|
|
175
191
|
getFlexibleLoanLtvAdjustmentHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
176
192
|
const localVarQueryParameter = {};
|
|
193
|
+
const localVarBodyParameter = {};
|
|
177
194
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
178
195
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
179
196
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
@@ -186,12 +203,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
186
203
|
return {
|
|
187
204
|
endpoint: "/sapi/v2/loan/flexible/ltv/adjustment/history",
|
|
188
205
|
method: "GET",
|
|
189
|
-
|
|
206
|
+
queryParams: localVarQueryParameter,
|
|
207
|
+
bodyParams: localVarBodyParameter,
|
|
190
208
|
timeUnit: _timeUnit
|
|
191
209
|
};
|
|
192
210
|
},
|
|
193
211
|
getFlexibleLoanOngoingOrders: async (loanCoin, collateralCoin, current, limit, recvWindow) => {
|
|
194
212
|
const localVarQueryParameter = {};
|
|
213
|
+
const localVarBodyParameter = {};
|
|
195
214
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
196
215
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
197
216
|
if (current !== void 0 && current !== null) localVarQueryParameter["current"] = current;
|
|
@@ -202,12 +221,14 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
202
221
|
return {
|
|
203
222
|
endpoint: "/sapi/v2/loan/flexible/ongoing/orders",
|
|
204
223
|
method: "GET",
|
|
205
|
-
|
|
224
|
+
queryParams: localVarQueryParameter,
|
|
225
|
+
bodyParams: localVarBodyParameter,
|
|
206
226
|
timeUnit: _timeUnit
|
|
207
227
|
};
|
|
208
228
|
},
|
|
209
229
|
getFlexibleLoanRepaymentHistory: async (loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
210
230
|
const localVarQueryParameter = {};
|
|
231
|
+
const localVarBodyParameter = {};
|
|
211
232
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
212
233
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
213
234
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
@@ -220,7 +241,8 @@ const FlexibleRateApiAxiosParamCreator = function(configuration) {
|
|
|
220
241
|
return {
|
|
221
242
|
endpoint: "/sapi/v2/loan/flexible/repay/history",
|
|
222
243
|
method: "GET",
|
|
223
|
-
|
|
244
|
+
queryParams: localVarQueryParameter,
|
|
245
|
+
bodyParams: localVarBodyParameter,
|
|
224
246
|
timeUnit: _timeUnit
|
|
225
247
|
};
|
|
226
248
|
}
|
|
@@ -248,7 +270,7 @@ var FlexibleRateApi = class {
|
|
|
248
270
|
*/
|
|
249
271
|
async checkCollateralRepayRate(requestParameters) {
|
|
250
272
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkCollateralRepayRate(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.recvWindow);
|
|
251
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
273
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
252
274
|
}
|
|
253
275
|
/**
|
|
254
276
|
* Flexible Loan Adjust LTV
|
|
@@ -266,7 +288,7 @@ var FlexibleRateApi = class {
|
|
|
266
288
|
*/
|
|
267
289
|
async flexibleLoanAdjustLtv(requestParameters) {
|
|
268
290
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanAdjustLtv(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.adjustmentAmount, requestParameters?.direction, requestParameters?.recvWindow);
|
|
269
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
291
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
270
292
|
}
|
|
271
293
|
/**
|
|
272
294
|
* Borrow Flexible Loan
|
|
@@ -286,7 +308,7 @@ var FlexibleRateApi = class {
|
|
|
286
308
|
*/
|
|
287
309
|
async flexibleLoanBorrow(requestParameters) {
|
|
288
310
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanBorrow(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.loanAmount, requestParameters?.collateralAmount, requestParameters?.recvWindow);
|
|
289
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
311
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
290
312
|
}
|
|
291
313
|
/**
|
|
292
314
|
* Flexible Loan Repay
|
|
@@ -305,7 +327,7 @@ var FlexibleRateApi = class {
|
|
|
305
327
|
*/
|
|
306
328
|
async flexibleLoanRepay(requestParameters) {
|
|
307
329
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.flexibleLoanRepay(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.repayAmount, requestParameters?.collateralReturn, requestParameters?.fullRepayment, requestParameters?.repaymentType, requestParameters?.recvWindow);
|
|
308
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
330
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
309
331
|
}
|
|
310
332
|
/**
|
|
311
333
|
* Get interest rate and borrow limit of flexible loanable assets. The borrow limit is shown in USD value.
|
|
@@ -321,7 +343,7 @@ var FlexibleRateApi = class {
|
|
|
321
343
|
*/
|
|
322
344
|
async getFlexibleLoanAssetsData(requestParameters = {}) {
|
|
323
345
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanAssetsData(requestParameters?.loanCoin, requestParameters?.recvWindow);
|
|
324
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
346
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
325
347
|
}
|
|
326
348
|
/**
|
|
327
349
|
* Get Flexible Loan Borrow History
|
|
@@ -340,7 +362,7 @@ var FlexibleRateApi = class {
|
|
|
340
362
|
*/
|
|
341
363
|
async getFlexibleLoanBorrowHistory(requestParameters = {}) {
|
|
342
364
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanBorrowHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
343
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
365
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
344
366
|
}
|
|
345
367
|
/**
|
|
346
368
|
* Get LTV information and collateral limit of flexible loan's collateral assets. The collateral limit is shown in USD value.
|
|
@@ -356,7 +378,7 @@ var FlexibleRateApi = class {
|
|
|
356
378
|
*/
|
|
357
379
|
async getFlexibleLoanCollateralAssetsData(requestParameters = {}) {
|
|
358
380
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanCollateralAssetsData(requestParameters?.collateralCoin, requestParameters?.recvWindow);
|
|
359
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
381
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
360
382
|
}
|
|
361
383
|
/**
|
|
362
384
|
*
|
|
@@ -371,7 +393,7 @@ var FlexibleRateApi = class {
|
|
|
371
393
|
*/
|
|
372
394
|
async getFlexibleLoanLiquidationHistory(requestParameters = {}) {
|
|
373
395
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanLiquidationHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
374
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
396
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
375
397
|
}
|
|
376
398
|
/**
|
|
377
399
|
* Get Flexible Loan LTV Adjustment History
|
|
@@ -390,7 +412,7 @@ var FlexibleRateApi = class {
|
|
|
390
412
|
*/
|
|
391
413
|
async getFlexibleLoanLtvAdjustmentHistory(requestParameters = {}) {
|
|
392
414
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanLtvAdjustmentHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
393
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
415
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
394
416
|
}
|
|
395
417
|
/**
|
|
396
418
|
* Get Flexible Loan Ongoing Orders
|
|
@@ -406,7 +428,7 @@ var FlexibleRateApi = class {
|
|
|
406
428
|
*/
|
|
407
429
|
async getFlexibleLoanOngoingOrders(requestParameters = {}) {
|
|
408
430
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanOngoingOrders(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
409
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
431
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
410
432
|
}
|
|
411
433
|
/**
|
|
412
434
|
* Get Flexible Loan Repayment History
|
|
@@ -425,7 +447,7 @@ var FlexibleRateApi = class {
|
|
|
425
447
|
*/
|
|
426
448
|
async getFlexibleLoanRepaymentHistory(requestParameters = {}) {
|
|
427
449
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleLoanRepaymentHistory(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
428
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
450
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
429
451
|
}
|
|
430
452
|
};
|
|
431
453
|
|
|
@@ -453,6 +475,7 @@ const StableRateApiAxiosParamCreator = function(configuration) {
|
|
|
453
475
|
(0, __binance_common.assertParamExists)("checkCollateralRepayRateStableRate", "collateralCoin", collateralCoin);
|
|
454
476
|
(0, __binance_common.assertParamExists)("checkCollateralRepayRateStableRate", "repayAmount", repayAmount);
|
|
455
477
|
const localVarQueryParameter = {};
|
|
478
|
+
const localVarBodyParameter = {};
|
|
456
479
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
457
480
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
458
481
|
if (repayAmount !== void 0 && repayAmount !== null) localVarQueryParameter["repayAmount"] = repayAmount;
|
|
@@ -462,12 +485,14 @@ const StableRateApiAxiosParamCreator = function(configuration) {
|
|
|
462
485
|
return {
|
|
463
486
|
endpoint: "/sapi/v1/loan/repay/collateral/rate",
|
|
464
487
|
method: "GET",
|
|
465
|
-
|
|
488
|
+
queryParams: localVarQueryParameter,
|
|
489
|
+
bodyParams: localVarBodyParameter,
|
|
466
490
|
timeUnit: _timeUnit
|
|
467
491
|
};
|
|
468
492
|
},
|
|
469
493
|
getCryptoLoansIncomeHistory: async (asset, type, startTime, endTime, limit, recvWindow) => {
|
|
470
494
|
const localVarQueryParameter = {};
|
|
495
|
+
const localVarBodyParameter = {};
|
|
471
496
|
if (asset !== void 0 && asset !== null) localVarQueryParameter["asset"] = asset;
|
|
472
497
|
if (type !== void 0 && type !== null) localVarQueryParameter["type"] = type;
|
|
473
498
|
if (startTime !== void 0 && startTime !== null) localVarQueryParameter["startTime"] = startTime;
|
|
@@ -479,12 +504,14 @@ const StableRateApiAxiosParamCreator = function(configuration) {
|
|
|
479
504
|
return {
|
|
480
505
|
endpoint: "/sapi/v1/loan/income",
|
|
481
506
|
method: "GET",
|
|
482
|
-
|
|
507
|
+
queryParams: localVarQueryParameter,
|
|
508
|
+
bodyParams: localVarBodyParameter,
|
|
483
509
|
timeUnit: _timeUnit
|
|
484
510
|
};
|
|
485
511
|
},
|
|
486
512
|
getLoanBorrowHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
487
513
|
const localVarQueryParameter = {};
|
|
514
|
+
const localVarBodyParameter = {};
|
|
488
515
|
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
489
516
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
490
517
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
@@ -498,12 +525,14 @@ const StableRateApiAxiosParamCreator = function(configuration) {
|
|
|
498
525
|
return {
|
|
499
526
|
endpoint: "/sapi/v1/loan/borrow/history",
|
|
500
527
|
method: "GET",
|
|
501
|
-
|
|
528
|
+
queryParams: localVarQueryParameter,
|
|
529
|
+
bodyParams: localVarBodyParameter,
|
|
502
530
|
timeUnit: _timeUnit
|
|
503
531
|
};
|
|
504
532
|
},
|
|
505
533
|
getLoanLtvAdjustmentHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
506
534
|
const localVarQueryParameter = {};
|
|
535
|
+
const localVarBodyParameter = {};
|
|
507
536
|
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
508
537
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
509
538
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
@@ -517,12 +546,14 @@ const StableRateApiAxiosParamCreator = function(configuration) {
|
|
|
517
546
|
return {
|
|
518
547
|
endpoint: "/sapi/v1/loan/ltv/adjustment/history",
|
|
519
548
|
method: "GET",
|
|
520
|
-
|
|
549
|
+
queryParams: localVarQueryParameter,
|
|
550
|
+
bodyParams: localVarBodyParameter,
|
|
521
551
|
timeUnit: _timeUnit
|
|
522
552
|
};
|
|
523
553
|
},
|
|
524
554
|
getLoanRepaymentHistory: async (orderId, loanCoin, collateralCoin, startTime, endTime, current, limit, recvWindow) => {
|
|
525
555
|
const localVarQueryParameter = {};
|
|
556
|
+
const localVarBodyParameter = {};
|
|
526
557
|
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
527
558
|
if (loanCoin !== void 0 && loanCoin !== null) localVarQueryParameter["loanCoin"] = loanCoin;
|
|
528
559
|
if (collateralCoin !== void 0 && collateralCoin !== null) localVarQueryParameter["collateralCoin"] = collateralCoin;
|
|
@@ -536,7 +567,8 @@ const StableRateApiAxiosParamCreator = function(configuration) {
|
|
|
536
567
|
return {
|
|
537
568
|
endpoint: "/sapi/v1/loan/repay/history",
|
|
538
569
|
method: "GET",
|
|
539
|
-
|
|
570
|
+
queryParams: localVarQueryParameter,
|
|
571
|
+
bodyParams: localVarBodyParameter,
|
|
540
572
|
timeUnit: _timeUnit
|
|
541
573
|
};
|
|
542
574
|
}
|
|
@@ -565,7 +597,7 @@ var StableRateApi = class {
|
|
|
565
597
|
*/
|
|
566
598
|
async checkCollateralRepayRateStableRate(requestParameters) {
|
|
567
599
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkCollateralRepayRateStableRate(requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.repayAmount, requestParameters?.recvWindow);
|
|
568
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
600
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
569
601
|
}
|
|
570
602
|
/**
|
|
571
603
|
* Get Crypto Loans Income History
|
|
@@ -584,7 +616,7 @@ var StableRateApi = class {
|
|
|
584
616
|
*/
|
|
585
617
|
async getCryptoLoansIncomeHistory(requestParameters = {}) {
|
|
586
618
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCryptoLoansIncomeHistory(requestParameters?.asset, requestParameters?.type, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.limit, requestParameters?.recvWindow);
|
|
587
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
619
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
588
620
|
}
|
|
589
621
|
/**
|
|
590
622
|
* Get Loan Borrow History
|
|
@@ -603,7 +635,7 @@ var StableRateApi = class {
|
|
|
603
635
|
*/
|
|
604
636
|
async getLoanBorrowHistory(requestParameters = {}) {
|
|
605
637
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanBorrowHistory(requestParameters?.orderId, requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
606
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
638
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
607
639
|
}
|
|
608
640
|
/**
|
|
609
641
|
* Get Loan LTV Adjustment History
|
|
@@ -622,7 +654,7 @@ var StableRateApi = class {
|
|
|
622
654
|
*/
|
|
623
655
|
async getLoanLtvAdjustmentHistory(requestParameters = {}) {
|
|
624
656
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanLtvAdjustmentHistory(requestParameters?.orderId, requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
625
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
657
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
626
658
|
}
|
|
627
659
|
/**
|
|
628
660
|
* Get Loan Repayment History
|
|
@@ -641,7 +673,7 @@ var StableRateApi = class {
|
|
|
641
673
|
*/
|
|
642
674
|
async getLoanRepaymentHistory(requestParameters = {}) {
|
|
643
675
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLoanRepaymentHistory(requestParameters?.orderId, requestParameters?.loanCoin, requestParameters?.collateralCoin, requestParameters?.startTime, requestParameters?.endTime, requestParameters?.current, requestParameters?.limit, requestParameters?.recvWindow);
|
|
644
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
676
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
645
677
|
}
|
|
646
678
|
};
|
|
647
679
|
|
|
@@ -669,23 +701,25 @@ var RestAPI = class {
|
|
|
669
701
|
* Generic function to send a request.
|
|
670
702
|
* @param endpoint - The API endpoint to call.
|
|
671
703
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
672
|
-
* @param
|
|
704
|
+
* @param queryParams - Query parameters for the request.
|
|
705
|
+
* @param bodyParams - Body parameters for the request.
|
|
673
706
|
*
|
|
674
707
|
* @returns A promise resolving to the response data object.
|
|
675
708
|
*/
|
|
676
|
-
sendRequest(endpoint, method,
|
|
677
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method,
|
|
709
|
+
sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
710
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
|
|
678
711
|
}
|
|
679
712
|
/**
|
|
680
713
|
* Generic function to send a signed request.
|
|
681
714
|
* @param endpoint - The API endpoint to call.
|
|
682
715
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
683
|
-
* @param
|
|
716
|
+
* @param queryParams - Query parameters for the request.
|
|
717
|
+
* @param bodyParams - Body parameters for the request.
|
|
684
718
|
*
|
|
685
719
|
* @returns A promise resolving to the response data object.
|
|
686
720
|
*/
|
|
687
|
-
sendSignedRequest(endpoint, method,
|
|
688
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method,
|
|
721
|
+
sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
722
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
|
|
689
723
|
}
|
|
690
724
|
/**
|
|
691
725
|
*
|