@binance/simple-earn 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2305 @@
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/simple-earn.ts
8
+ import { platform, arch } from "os";
9
+ import { ConfigurationRestAPI as ConfigurationRestAPI5, SIMPLE_EARN_REST_API_PROD_URL } from "@binance/common";
10
+
11
+ // package.json
12
+ var name = "@binance/simple-earn";
13
+ var version = "1.0.0";
14
+
15
+ // src/rest-api/index.ts
16
+ var rest_api_exports = {};
17
+ __export(rest_api_exports, {
18
+ AccountApi: () => AccountApi,
19
+ EarnApi: () => EarnApi,
20
+ HistoryApi: () => HistoryApi,
21
+ RestAPI: () => RestAPI
22
+ });
23
+
24
+ // src/rest-api/modules/account-api.ts
25
+ import {
26
+ assertParamExists,
27
+ sendRequest
28
+ } from "@binance/common";
29
+ var AccountApiAxiosParamCreator = function(configuration) {
30
+ return {
31
+ /**
32
+ * Get Flexible Personal Left Quota
33
+ *
34
+ * Weight: 150
35
+ *
36
+ * @summary Get Flexible Personal Left Quota(USER_DATA)
37
+ * @param {string} productId
38
+ * @param {number} [recvWindow]
39
+ *
40
+ * @throws {RequiredError}
41
+ */
42
+ getFlexiblePersonalLeftQuota: async (productId, recvWindow) => {
43
+ assertParamExists("getFlexiblePersonalLeftQuota", "productId", productId);
44
+ const localVarQueryParameter = {};
45
+ if (productId !== void 0 && productId !== null) {
46
+ localVarQueryParameter["productId"] = productId;
47
+ }
48
+ if (recvWindow !== void 0 && recvWindow !== null) {
49
+ localVarQueryParameter["recvWindow"] = recvWindow;
50
+ }
51
+ let _timeUnit;
52
+ if ("timeUnit" in configuration)
53
+ _timeUnit = configuration.timeUnit;
54
+ return {
55
+ endpoint: "/sapi/v1/simple-earn/flexible/personalLeftQuota",
56
+ method: "GET",
57
+ params: localVarQueryParameter,
58
+ timeUnit: _timeUnit
59
+ };
60
+ },
61
+ /**
62
+ * Get Flexible Product Position
63
+ *
64
+ * Weight: 150
65
+ *
66
+ * @summary Get Flexible Product Position(USER_DATA)
67
+ * @param {string} [asset]
68
+ * @param {string} [productId]
69
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
70
+ * @param {number} [size] Default:10, Max:100
71
+ * @param {number} [recvWindow]
72
+ *
73
+ * @throws {RequiredError}
74
+ */
75
+ getFlexibleProductPosition: async (asset, productId, current, size, recvWindow) => {
76
+ const localVarQueryParameter = {};
77
+ if (asset !== void 0 && asset !== null) {
78
+ localVarQueryParameter["asset"] = asset;
79
+ }
80
+ if (productId !== void 0 && productId !== null) {
81
+ localVarQueryParameter["productId"] = productId;
82
+ }
83
+ if (current !== void 0 && current !== null) {
84
+ localVarQueryParameter["current"] = current;
85
+ }
86
+ if (size !== void 0 && size !== null) {
87
+ localVarQueryParameter["size"] = size;
88
+ }
89
+ if (recvWindow !== void 0 && recvWindow !== null) {
90
+ localVarQueryParameter["recvWindow"] = recvWindow;
91
+ }
92
+ let _timeUnit;
93
+ if ("timeUnit" in configuration)
94
+ _timeUnit = configuration.timeUnit;
95
+ return {
96
+ endpoint: "/sapi/v1/simple-earn/flexible/position",
97
+ method: "GET",
98
+ params: localVarQueryParameter,
99
+ timeUnit: _timeUnit
100
+ };
101
+ },
102
+ /**
103
+ * Get Locked Personal Left Quota
104
+ *
105
+ * Weight: 150
106
+ *
107
+ * @summary Get Locked Personal Left Quota(USER_DATA)
108
+ * @param {string} projectId
109
+ * @param {number} [recvWindow]
110
+ *
111
+ * @throws {RequiredError}
112
+ */
113
+ getLockedPersonalLeftQuota: async (projectId, recvWindow) => {
114
+ assertParamExists("getLockedPersonalLeftQuota", "projectId", projectId);
115
+ const localVarQueryParameter = {};
116
+ if (projectId !== void 0 && projectId !== null) {
117
+ localVarQueryParameter["projectId"] = projectId;
118
+ }
119
+ if (recvWindow !== void 0 && recvWindow !== null) {
120
+ localVarQueryParameter["recvWindow"] = recvWindow;
121
+ }
122
+ let _timeUnit;
123
+ if ("timeUnit" in configuration)
124
+ _timeUnit = configuration.timeUnit;
125
+ return {
126
+ endpoint: "/sapi/v1/simple-earn/locked/personalLeftQuota",
127
+ method: "GET",
128
+ params: localVarQueryParameter,
129
+ timeUnit: _timeUnit
130
+ };
131
+ },
132
+ /**
133
+ * Get Locked Product Position
134
+ *
135
+ * Weight: 150
136
+ *
137
+ * @summary Get Locked Product Position
138
+ * @param {string} [asset]
139
+ * @param {number} [positionId]
140
+ * @param {string} [projectId]
141
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
142
+ * @param {number} [size] Default:10, Max:100
143
+ * @param {number} [recvWindow]
144
+ *
145
+ * @throws {RequiredError}
146
+ */
147
+ getLockedProductPosition: async (asset, positionId, projectId, current, size, recvWindow) => {
148
+ const localVarQueryParameter = {};
149
+ if (asset !== void 0 && asset !== null) {
150
+ localVarQueryParameter["asset"] = asset;
151
+ }
152
+ if (positionId !== void 0 && positionId !== null) {
153
+ localVarQueryParameter["positionId"] = positionId;
154
+ }
155
+ if (projectId !== void 0 && projectId !== null) {
156
+ localVarQueryParameter["projectId"] = projectId;
157
+ }
158
+ if (current !== void 0 && current !== null) {
159
+ localVarQueryParameter["current"] = current;
160
+ }
161
+ if (size !== void 0 && size !== null) {
162
+ localVarQueryParameter["size"] = size;
163
+ }
164
+ if (recvWindow !== void 0 && recvWindow !== null) {
165
+ localVarQueryParameter["recvWindow"] = recvWindow;
166
+ }
167
+ let _timeUnit;
168
+ if ("timeUnit" in configuration)
169
+ _timeUnit = configuration.timeUnit;
170
+ return {
171
+ endpoint: "/sapi/v1/simple-earn/locked/position",
172
+ method: "GET",
173
+ params: localVarQueryParameter,
174
+ timeUnit: _timeUnit
175
+ };
176
+ },
177
+ /**
178
+ * Get available Simple Earn flexible product list
179
+ *
180
+ * Weight: 150
181
+ *
182
+ * @summary Get Simple Earn Flexible Product List(USER_DATA)
183
+ * @param {string} [asset]
184
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
185
+ * @param {number} [size] Default:10, Max:100
186
+ * @param {number} [recvWindow]
187
+ *
188
+ * @throws {RequiredError}
189
+ */
190
+ getSimpleEarnFlexibleProductList: async (asset, current, size, recvWindow) => {
191
+ const localVarQueryParameter = {};
192
+ if (asset !== void 0 && asset !== null) {
193
+ localVarQueryParameter["asset"] = asset;
194
+ }
195
+ if (current !== void 0 && current !== null) {
196
+ localVarQueryParameter["current"] = current;
197
+ }
198
+ if (size !== void 0 && size !== null) {
199
+ localVarQueryParameter["size"] = size;
200
+ }
201
+ if (recvWindow !== void 0 && recvWindow !== null) {
202
+ localVarQueryParameter["recvWindow"] = recvWindow;
203
+ }
204
+ let _timeUnit;
205
+ if ("timeUnit" in configuration)
206
+ _timeUnit = configuration.timeUnit;
207
+ return {
208
+ endpoint: "/sapi/v1/simple-earn/flexible/list",
209
+ method: "GET",
210
+ params: localVarQueryParameter,
211
+ timeUnit: _timeUnit
212
+ };
213
+ },
214
+ /**
215
+ * Get Simple Earn Locked Product List
216
+ *
217
+ * Get available Simple Earn locked product list
218
+ *
219
+ * Weight: 150
220
+ *
221
+ * @summary Get Simple Earn Locked Product List(USER_DATA)
222
+ * @param {string} [asset]
223
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
224
+ * @param {number} [size] Default:10, Max:100
225
+ * @param {number} [recvWindow]
226
+ *
227
+ * @throws {RequiredError}
228
+ */
229
+ getSimpleEarnLockedProductList: async (asset, current, size, recvWindow) => {
230
+ const localVarQueryParameter = {};
231
+ if (asset !== void 0 && asset !== null) {
232
+ localVarQueryParameter["asset"] = asset;
233
+ }
234
+ if (current !== void 0 && current !== null) {
235
+ localVarQueryParameter["current"] = current;
236
+ }
237
+ if (size !== void 0 && size !== null) {
238
+ localVarQueryParameter["size"] = size;
239
+ }
240
+ if (recvWindow !== void 0 && recvWindow !== null) {
241
+ localVarQueryParameter["recvWindow"] = recvWindow;
242
+ }
243
+ let _timeUnit;
244
+ if ("timeUnit" in configuration)
245
+ _timeUnit = configuration.timeUnit;
246
+ return {
247
+ endpoint: "/sapi/v1/simple-earn/locked/list",
248
+ method: "GET",
249
+ params: localVarQueryParameter,
250
+ timeUnit: _timeUnit
251
+ };
252
+ },
253
+ /**
254
+ * Simple Account query
255
+ *
256
+ * Weight: 150
257
+ *
258
+ * @summary Simple Account(USER_DATA)
259
+ * @param {number} [recvWindow]
260
+ *
261
+ * @throws {RequiredError}
262
+ */
263
+ simpleAccount: async (recvWindow) => {
264
+ const localVarQueryParameter = {};
265
+ if (recvWindow !== void 0 && recvWindow !== null) {
266
+ localVarQueryParameter["recvWindow"] = recvWindow;
267
+ }
268
+ let _timeUnit;
269
+ if ("timeUnit" in configuration)
270
+ _timeUnit = configuration.timeUnit;
271
+ return {
272
+ endpoint: "/sapi/v1/simple-earn/account",
273
+ method: "GET",
274
+ params: localVarQueryParameter,
275
+ timeUnit: _timeUnit
276
+ };
277
+ }
278
+ };
279
+ };
280
+ var AccountApi = class {
281
+ constructor(configuration) {
282
+ this.configuration = configuration;
283
+ this.localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration);
284
+ }
285
+ /**
286
+ * Get Flexible Personal Left Quota
287
+ *
288
+ * Weight: 150
289
+ *
290
+ * @summary Get Flexible Personal Left Quota(USER_DATA)
291
+ * @param {GetFlexiblePersonalLeftQuotaRequest} requestParameters Request parameters.
292
+ * @returns {Promise<RestApiResponse<GetFlexiblePersonalLeftQuotaResponse>>}
293
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
294
+ * @memberof AccountApi
295
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Personal-Left-Quota Binance API Documentation}
296
+ */
297
+ async getFlexiblePersonalLeftQuota(requestParameters) {
298
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexiblePersonalLeftQuota(
299
+ requestParameters?.productId,
300
+ requestParameters?.recvWindow
301
+ );
302
+ return sendRequest(
303
+ this.configuration,
304
+ localVarAxiosArgs.endpoint,
305
+ localVarAxiosArgs.method,
306
+ localVarAxiosArgs.params,
307
+ localVarAxiosArgs?.timeUnit,
308
+ { isSigned: true }
309
+ );
310
+ }
311
+ /**
312
+ * Get Flexible Product Position
313
+ *
314
+ * Weight: 150
315
+ *
316
+ * @summary Get Flexible Product Position(USER_DATA)
317
+ * @param {GetFlexibleProductPositionRequest} requestParameters Request parameters.
318
+ * @returns {Promise<RestApiResponse<GetFlexibleProductPositionResponse>>}
319
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
320
+ * @memberof AccountApi
321
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Product-Position Binance API Documentation}
322
+ */
323
+ async getFlexibleProductPosition(requestParameters = {}) {
324
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleProductPosition(
325
+ requestParameters?.asset,
326
+ requestParameters?.productId,
327
+ requestParameters?.current,
328
+ requestParameters?.size,
329
+ requestParameters?.recvWindow
330
+ );
331
+ return sendRequest(
332
+ this.configuration,
333
+ localVarAxiosArgs.endpoint,
334
+ localVarAxiosArgs.method,
335
+ localVarAxiosArgs.params,
336
+ localVarAxiosArgs?.timeUnit,
337
+ { isSigned: true }
338
+ );
339
+ }
340
+ /**
341
+ * Get Locked Personal Left Quota
342
+ *
343
+ * Weight: 150
344
+ *
345
+ * @summary Get Locked Personal Left Quota(USER_DATA)
346
+ * @param {GetLockedPersonalLeftQuotaRequest} requestParameters Request parameters.
347
+ * @returns {Promise<RestApiResponse<GetLockedPersonalLeftQuotaResponse>>}
348
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
349
+ * @memberof AccountApi
350
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Locked-Personal-Left-Quota Binance API Documentation}
351
+ */
352
+ async getLockedPersonalLeftQuota(requestParameters) {
353
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLockedPersonalLeftQuota(
354
+ requestParameters?.projectId,
355
+ requestParameters?.recvWindow
356
+ );
357
+ return sendRequest(
358
+ this.configuration,
359
+ localVarAxiosArgs.endpoint,
360
+ localVarAxiosArgs.method,
361
+ localVarAxiosArgs.params,
362
+ localVarAxiosArgs?.timeUnit,
363
+ { isSigned: true }
364
+ );
365
+ }
366
+ /**
367
+ * Get Locked Product Position
368
+ *
369
+ * Weight: 150
370
+ *
371
+ * @summary Get Locked Product Position
372
+ * @param {GetLockedProductPositionRequest} requestParameters Request parameters.
373
+ * @returns {Promise<RestApiResponse<GetLockedProductPositionResponse>>}
374
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
375
+ * @memberof AccountApi
376
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Locked-Product-Position Binance API Documentation}
377
+ */
378
+ async getLockedProductPosition(requestParameters = {}) {
379
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLockedProductPosition(
380
+ requestParameters?.asset,
381
+ requestParameters?.positionId,
382
+ requestParameters?.projectId,
383
+ requestParameters?.current,
384
+ requestParameters?.size,
385
+ requestParameters?.recvWindow
386
+ );
387
+ return sendRequest(
388
+ this.configuration,
389
+ localVarAxiosArgs.endpoint,
390
+ localVarAxiosArgs.method,
391
+ localVarAxiosArgs.params,
392
+ localVarAxiosArgs?.timeUnit,
393
+ { isSigned: false }
394
+ );
395
+ }
396
+ /**
397
+ * Get available Simple Earn flexible product list
398
+ *
399
+ * Weight: 150
400
+ *
401
+ * @summary Get Simple Earn Flexible Product List(USER_DATA)
402
+ * @param {GetSimpleEarnFlexibleProductListRequest} requestParameters Request parameters.
403
+ * @returns {Promise<RestApiResponse<GetSimpleEarnFlexibleProductListResponse>>}
404
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
405
+ * @memberof AccountApi
406
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Flexible-Product-List Binance API Documentation}
407
+ */
408
+ async getSimpleEarnFlexibleProductList(requestParameters = {}) {
409
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSimpleEarnFlexibleProductList(
410
+ requestParameters?.asset,
411
+ requestParameters?.current,
412
+ requestParameters?.size,
413
+ requestParameters?.recvWindow
414
+ );
415
+ return sendRequest(
416
+ this.configuration,
417
+ localVarAxiosArgs.endpoint,
418
+ localVarAxiosArgs.method,
419
+ localVarAxiosArgs.params,
420
+ localVarAxiosArgs?.timeUnit,
421
+ { isSigned: true }
422
+ );
423
+ }
424
+ /**
425
+ * Get Simple Earn Locked Product List
426
+ *
427
+ * Get available Simple Earn locked product list
428
+ *
429
+ * Weight: 150
430
+ *
431
+ * @summary Get Simple Earn Locked Product List(USER_DATA)
432
+ * @param {GetSimpleEarnLockedProductListRequest} requestParameters Request parameters.
433
+ * @returns {Promise<RestApiResponse<GetSimpleEarnLockedProductListResponse>>}
434
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
435
+ * @memberof AccountApi
436
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Locked-Product-List Binance API Documentation}
437
+ */
438
+ async getSimpleEarnLockedProductList(requestParameters = {}) {
439
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getSimpleEarnLockedProductList(
440
+ requestParameters?.asset,
441
+ requestParameters?.current,
442
+ requestParameters?.size,
443
+ requestParameters?.recvWindow
444
+ );
445
+ return sendRequest(
446
+ this.configuration,
447
+ localVarAxiosArgs.endpoint,
448
+ localVarAxiosArgs.method,
449
+ localVarAxiosArgs.params,
450
+ localVarAxiosArgs?.timeUnit,
451
+ { isSigned: true }
452
+ );
453
+ }
454
+ /**
455
+ * Simple Account query
456
+ *
457
+ * Weight: 150
458
+ *
459
+ * @summary Simple Account(USER_DATA)
460
+ * @param {SimpleAccountRequest} requestParameters Request parameters.
461
+ * @returns {Promise<RestApiResponse<SimpleAccountResponse>>}
462
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
463
+ * @memberof AccountApi
464
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Simple-Account Binance API Documentation}
465
+ */
466
+ async simpleAccount(requestParameters = {}) {
467
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.simpleAccount(
468
+ requestParameters?.recvWindow
469
+ );
470
+ return sendRequest(
471
+ this.configuration,
472
+ localVarAxiosArgs.endpoint,
473
+ localVarAxiosArgs.method,
474
+ localVarAxiosArgs.params,
475
+ localVarAxiosArgs?.timeUnit,
476
+ { isSigned: true }
477
+ );
478
+ }
479
+ };
480
+
481
+ // src/rest-api/modules/earn-api.ts
482
+ import {
483
+ assertParamExists as assertParamExists2,
484
+ sendRequest as sendRequest2
485
+ } from "@binance/common";
486
+ var EarnApiAxiosParamCreator = function(configuration) {
487
+ return {
488
+ /**
489
+ * Get Flexible Subscription Preview
490
+ *
491
+ * Weight: 150
492
+ *
493
+ * @summary Get Flexible Subscription Preview(USER_DATA)
494
+ * @param {string} productId
495
+ * @param {number} amount
496
+ * @param {number} [recvWindow]
497
+ *
498
+ * @throws {RequiredError}
499
+ */
500
+ getFlexibleSubscriptionPreview: async (productId, amount, recvWindow) => {
501
+ assertParamExists2("getFlexibleSubscriptionPreview", "productId", productId);
502
+ assertParamExists2("getFlexibleSubscriptionPreview", "amount", amount);
503
+ const localVarQueryParameter = {};
504
+ if (productId !== void 0 && productId !== null) {
505
+ localVarQueryParameter["productId"] = productId;
506
+ }
507
+ if (amount !== void 0 && amount !== null) {
508
+ localVarQueryParameter["amount"] = amount;
509
+ }
510
+ if (recvWindow !== void 0 && recvWindow !== null) {
511
+ localVarQueryParameter["recvWindow"] = recvWindow;
512
+ }
513
+ let _timeUnit;
514
+ if ("timeUnit" in configuration)
515
+ _timeUnit = configuration.timeUnit;
516
+ return {
517
+ endpoint: "/sapi/v1/simple-earn/flexible/subscriptionPreview",
518
+ method: "GET",
519
+ params: localVarQueryParameter,
520
+ timeUnit: _timeUnit
521
+ };
522
+ },
523
+ /**
524
+ * Get Locked Subscription Preview
525
+ *
526
+ * Weight: 150
527
+ *
528
+ * @summary Get Locked Subscription Preview(USER_DATA)
529
+ * @param {string} projectId
530
+ * @param {number} amount
531
+ * @param {boolean} [autoSubscribe] true or false, default true.
532
+ * @param {number} [recvWindow]
533
+ *
534
+ * @throws {RequiredError}
535
+ */
536
+ getLockedSubscriptionPreview: async (projectId, amount, autoSubscribe, recvWindow) => {
537
+ assertParamExists2("getLockedSubscriptionPreview", "projectId", projectId);
538
+ assertParamExists2("getLockedSubscriptionPreview", "amount", amount);
539
+ const localVarQueryParameter = {};
540
+ if (projectId !== void 0 && projectId !== null) {
541
+ localVarQueryParameter["projectId"] = projectId;
542
+ }
543
+ if (amount !== void 0 && amount !== null) {
544
+ localVarQueryParameter["amount"] = amount;
545
+ }
546
+ if (autoSubscribe !== void 0 && autoSubscribe !== null) {
547
+ localVarQueryParameter["autoSubscribe"] = autoSubscribe;
548
+ }
549
+ if (recvWindow !== void 0 && recvWindow !== null) {
550
+ localVarQueryParameter["recvWindow"] = recvWindow;
551
+ }
552
+ let _timeUnit;
553
+ if ("timeUnit" in configuration)
554
+ _timeUnit = configuration.timeUnit;
555
+ return {
556
+ endpoint: "/sapi/v1/simple-earn/locked/subscriptionPreview",
557
+ method: "GET",
558
+ params: localVarQueryParameter,
559
+ timeUnit: _timeUnit
560
+ };
561
+ },
562
+ /**
563
+ * Redeem Flexible Product
564
+ *
565
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
566
+ *
567
+ * Weight: 1
568
+ *
569
+ * @summary Redeem Flexible Product(TRADE)
570
+ * @param {string} productId
571
+ * @param {boolean} [redeemAll] true or false, default to false
572
+ * @param {number} [amount] if redeemAll is false, amount is mandatory
573
+ * @param {string} [destAccount] `SPOT`,`FUND`, default `SPOT`
574
+ * @param {number} [recvWindow]
575
+ *
576
+ * @throws {RequiredError}
577
+ */
578
+ redeemFlexibleProduct: async (productId, redeemAll, amount, destAccount, recvWindow) => {
579
+ assertParamExists2("redeemFlexibleProduct", "productId", productId);
580
+ const localVarQueryParameter = {};
581
+ if (productId !== void 0 && productId !== null) {
582
+ localVarQueryParameter["productId"] = productId;
583
+ }
584
+ if (redeemAll !== void 0 && redeemAll !== null) {
585
+ localVarQueryParameter["redeemAll"] = redeemAll;
586
+ }
587
+ if (amount !== void 0 && amount !== null) {
588
+ localVarQueryParameter["amount"] = amount;
589
+ }
590
+ if (destAccount !== void 0 && destAccount !== null) {
591
+ localVarQueryParameter["destAccount"] = destAccount;
592
+ }
593
+ if (recvWindow !== void 0 && recvWindow !== null) {
594
+ localVarQueryParameter["recvWindow"] = recvWindow;
595
+ }
596
+ let _timeUnit;
597
+ if ("timeUnit" in configuration)
598
+ _timeUnit = configuration.timeUnit;
599
+ return {
600
+ endpoint: "/sapi/v1/simple-earn/flexible/redeem",
601
+ method: "POST",
602
+ params: localVarQueryParameter,
603
+ timeUnit: _timeUnit
604
+ };
605
+ },
606
+ /**
607
+ * Redeem Locked Product
608
+ *
609
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
610
+ *
611
+ * Weight: 1/3s per account
612
+ *
613
+ * @summary Redeem Locked Product(TRADE)
614
+ * @param {string} positionId
615
+ * @param {number} [recvWindow]
616
+ *
617
+ * @throws {RequiredError}
618
+ */
619
+ redeemLockedProduct: async (positionId, recvWindow) => {
620
+ assertParamExists2("redeemLockedProduct", "positionId", positionId);
621
+ const localVarQueryParameter = {};
622
+ if (positionId !== void 0 && positionId !== null) {
623
+ localVarQueryParameter["positionId"] = positionId;
624
+ }
625
+ if (recvWindow !== void 0 && recvWindow !== null) {
626
+ localVarQueryParameter["recvWindow"] = recvWindow;
627
+ }
628
+ let _timeUnit;
629
+ if ("timeUnit" in configuration)
630
+ _timeUnit = configuration.timeUnit;
631
+ return {
632
+ endpoint: "/sapi/v1/simple-earn/locked/redeem",
633
+ method: "POST",
634
+ params: localVarQueryParameter,
635
+ timeUnit: _timeUnit
636
+ };
637
+ },
638
+ /**
639
+ * Set Flexible Auto Subscribe
640
+ *
641
+ * Weight: 150
642
+ *
643
+ * @summary Set Flexible Auto Subscribe(USER_DATA)
644
+ * @param {string} productId
645
+ * @param {boolean} autoSubscribe true or false
646
+ * @param {number} [recvWindow]
647
+ *
648
+ * @throws {RequiredError}
649
+ */
650
+ setFlexibleAutoSubscribe: async (productId, autoSubscribe, recvWindow) => {
651
+ assertParamExists2("setFlexibleAutoSubscribe", "productId", productId);
652
+ assertParamExists2("setFlexibleAutoSubscribe", "autoSubscribe", autoSubscribe);
653
+ const localVarQueryParameter = {};
654
+ if (productId !== void 0 && productId !== null) {
655
+ localVarQueryParameter["productId"] = productId;
656
+ }
657
+ if (autoSubscribe !== void 0 && autoSubscribe !== null) {
658
+ localVarQueryParameter["autoSubscribe"] = autoSubscribe;
659
+ }
660
+ if (recvWindow !== void 0 && recvWindow !== null) {
661
+ localVarQueryParameter["recvWindow"] = recvWindow;
662
+ }
663
+ let _timeUnit;
664
+ if ("timeUnit" in configuration)
665
+ _timeUnit = configuration.timeUnit;
666
+ return {
667
+ endpoint: "/sapi/v1/simple-earn/flexible/setAutoSubscribe",
668
+ method: "POST",
669
+ params: localVarQueryParameter,
670
+ timeUnit: _timeUnit
671
+ };
672
+ },
673
+ /**
674
+ * Set locked auto subscribe
675
+ *
676
+ * Weight: 150
677
+ *
678
+ * @summary Set Locked Auto Subscribe(USER_DATA)
679
+ * @param {string} positionId
680
+ * @param {boolean} autoSubscribe true or false
681
+ * @param {number} [recvWindow]
682
+ *
683
+ * @throws {RequiredError}
684
+ */
685
+ setLockedAutoSubscribe: async (positionId, autoSubscribe, recvWindow) => {
686
+ assertParamExists2("setLockedAutoSubscribe", "positionId", positionId);
687
+ assertParamExists2("setLockedAutoSubscribe", "autoSubscribe", autoSubscribe);
688
+ const localVarQueryParameter = {};
689
+ if (positionId !== void 0 && positionId !== null) {
690
+ localVarQueryParameter["positionId"] = positionId;
691
+ }
692
+ if (autoSubscribe !== void 0 && autoSubscribe !== null) {
693
+ localVarQueryParameter["autoSubscribe"] = autoSubscribe;
694
+ }
695
+ if (recvWindow !== void 0 && recvWindow !== null) {
696
+ localVarQueryParameter["recvWindow"] = recvWindow;
697
+ }
698
+ let _timeUnit;
699
+ if ("timeUnit" in configuration)
700
+ _timeUnit = configuration.timeUnit;
701
+ return {
702
+ endpoint: "/sapi/v1/simple-earn/locked/setAutoSubscribe",
703
+ method: "POST",
704
+ params: localVarQueryParameter,
705
+ timeUnit: _timeUnit
706
+ };
707
+ },
708
+ /**
709
+ * Set redeem option for Locked product
710
+ *
711
+ * Weight: 50
712
+ *
713
+ * @summary Set Locked Product Redeem Option(USER_DATA)
714
+ * @param {string} positionId
715
+ * @param {string} redeemTo `SPOT`,'FLEXIBLE'
716
+ * @param {number} [recvWindow]
717
+ *
718
+ * @throws {RequiredError}
719
+ */
720
+ setLockedProductRedeemOption: async (positionId, redeemTo, recvWindow) => {
721
+ assertParamExists2("setLockedProductRedeemOption", "positionId", positionId);
722
+ assertParamExists2("setLockedProductRedeemOption", "redeemTo", redeemTo);
723
+ const localVarQueryParameter = {};
724
+ if (positionId !== void 0 && positionId !== null) {
725
+ localVarQueryParameter["positionId"] = positionId;
726
+ }
727
+ if (redeemTo !== void 0 && redeemTo !== null) {
728
+ localVarQueryParameter["redeemTo"] = redeemTo;
729
+ }
730
+ if (recvWindow !== void 0 && recvWindow !== null) {
731
+ localVarQueryParameter["recvWindow"] = recvWindow;
732
+ }
733
+ let _timeUnit;
734
+ if ("timeUnit" in configuration)
735
+ _timeUnit = configuration.timeUnit;
736
+ return {
737
+ endpoint: "/sapi/v1/simple-earn/locked/setRedeemOption",
738
+ method: "POST",
739
+ params: localVarQueryParameter,
740
+ timeUnit: _timeUnit
741
+ };
742
+ },
743
+ /**
744
+ * Subscribe Flexible Product
745
+ *
746
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
747
+ *
748
+ * Weight: 1
749
+ *
750
+ * @summary Subscribe Flexible Product(TRADE)
751
+ * @param {string} productId
752
+ * @param {number} amount
753
+ * @param {boolean} [autoSubscribe] true or false, default true.
754
+ * @param {string} [sourceAccount] `SPOT`,`FUND`,`ALL`, default `SPOT`
755
+ * @param {number} [recvWindow]
756
+ *
757
+ * @throws {RequiredError}
758
+ */
759
+ subscribeFlexibleProduct: async (productId, amount, autoSubscribe, sourceAccount, recvWindow) => {
760
+ assertParamExists2("subscribeFlexibleProduct", "productId", productId);
761
+ assertParamExists2("subscribeFlexibleProduct", "amount", amount);
762
+ const localVarQueryParameter = {};
763
+ if (productId !== void 0 && productId !== null) {
764
+ localVarQueryParameter["productId"] = productId;
765
+ }
766
+ if (amount !== void 0 && amount !== null) {
767
+ localVarQueryParameter["amount"] = amount;
768
+ }
769
+ if (autoSubscribe !== void 0 && autoSubscribe !== null) {
770
+ localVarQueryParameter["autoSubscribe"] = autoSubscribe;
771
+ }
772
+ if (sourceAccount !== void 0 && sourceAccount !== null) {
773
+ localVarQueryParameter["sourceAccount"] = sourceAccount;
774
+ }
775
+ if (recvWindow !== void 0 && recvWindow !== null) {
776
+ localVarQueryParameter["recvWindow"] = recvWindow;
777
+ }
778
+ let _timeUnit;
779
+ if ("timeUnit" in configuration)
780
+ _timeUnit = configuration.timeUnit;
781
+ return {
782
+ endpoint: "/sapi/v1/simple-earn/flexible/subscribe",
783
+ method: "POST",
784
+ params: localVarQueryParameter,
785
+ timeUnit: _timeUnit
786
+ };
787
+ },
788
+ /**
789
+ * Subscribe Locked Product
790
+ *
791
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
792
+ *
793
+ * Weight: 1
794
+ *
795
+ * @summary Subscribe Locked Product(TRADE)
796
+ * @param {string} projectId
797
+ * @param {number} amount
798
+ * @param {boolean} [autoSubscribe] true or false, default true.
799
+ * @param {string} [sourceAccount] `SPOT`,`FUND`,`ALL`, default `SPOT`
800
+ * @param {string} [redeemTo] `SPOT`,`FLEXIBLE`, default `FLEXIBLE`
801
+ * @param {number} [recvWindow]
802
+ *
803
+ * @throws {RequiredError}
804
+ */
805
+ subscribeLockedProduct: async (projectId, amount, autoSubscribe, sourceAccount, redeemTo, recvWindow) => {
806
+ assertParamExists2("subscribeLockedProduct", "projectId", projectId);
807
+ assertParamExists2("subscribeLockedProduct", "amount", amount);
808
+ const localVarQueryParameter = {};
809
+ if (projectId !== void 0 && projectId !== null) {
810
+ localVarQueryParameter["projectId"] = projectId;
811
+ }
812
+ if (amount !== void 0 && amount !== null) {
813
+ localVarQueryParameter["amount"] = amount;
814
+ }
815
+ if (autoSubscribe !== void 0 && autoSubscribe !== null) {
816
+ localVarQueryParameter["autoSubscribe"] = autoSubscribe;
817
+ }
818
+ if (sourceAccount !== void 0 && sourceAccount !== null) {
819
+ localVarQueryParameter["sourceAccount"] = sourceAccount;
820
+ }
821
+ if (redeemTo !== void 0 && redeemTo !== null) {
822
+ localVarQueryParameter["redeemTo"] = redeemTo;
823
+ }
824
+ if (recvWindow !== void 0 && recvWindow !== null) {
825
+ localVarQueryParameter["recvWindow"] = recvWindow;
826
+ }
827
+ let _timeUnit;
828
+ if ("timeUnit" in configuration)
829
+ _timeUnit = configuration.timeUnit;
830
+ return {
831
+ endpoint: "/sapi/v1/simple-earn/locked/subscribe",
832
+ method: "POST",
833
+ params: localVarQueryParameter,
834
+ timeUnit: _timeUnit
835
+ };
836
+ }
837
+ };
838
+ };
839
+ var EarnApi = class {
840
+ constructor(configuration) {
841
+ this.configuration = configuration;
842
+ this.localVarAxiosParamCreator = EarnApiAxiosParamCreator(configuration);
843
+ }
844
+ /**
845
+ * Get Flexible Subscription Preview
846
+ *
847
+ * Weight: 150
848
+ *
849
+ * @summary Get Flexible Subscription Preview(USER_DATA)
850
+ * @param {GetFlexibleSubscriptionPreviewRequest} requestParameters Request parameters.
851
+ * @returns {Promise<RestApiResponse<GetFlexibleSubscriptionPreviewResponse>>}
852
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
853
+ * @memberof EarnApi
854
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Get-Flexible-Subscription-Preview Binance API Documentation}
855
+ */
856
+ async getFlexibleSubscriptionPreview(requestParameters) {
857
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleSubscriptionPreview(
858
+ requestParameters?.productId,
859
+ requestParameters?.amount,
860
+ requestParameters?.recvWindow
861
+ );
862
+ return sendRequest2(
863
+ this.configuration,
864
+ localVarAxiosArgs.endpoint,
865
+ localVarAxiosArgs.method,
866
+ localVarAxiosArgs.params,
867
+ localVarAxiosArgs?.timeUnit,
868
+ { isSigned: true }
869
+ );
870
+ }
871
+ /**
872
+ * Get Locked Subscription Preview
873
+ *
874
+ * Weight: 150
875
+ *
876
+ * @summary Get Locked Subscription Preview(USER_DATA)
877
+ * @param {GetLockedSubscriptionPreviewRequest} requestParameters Request parameters.
878
+ * @returns {Promise<RestApiResponse<GetLockedSubscriptionPreviewResponse>>}
879
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
880
+ * @memberof EarnApi
881
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Get-Locked-Subscription-Preview Binance API Documentation}
882
+ */
883
+ async getLockedSubscriptionPreview(requestParameters) {
884
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLockedSubscriptionPreview(
885
+ requestParameters?.projectId,
886
+ requestParameters?.amount,
887
+ requestParameters?.autoSubscribe,
888
+ requestParameters?.recvWindow
889
+ );
890
+ return sendRequest2(
891
+ this.configuration,
892
+ localVarAxiosArgs.endpoint,
893
+ localVarAxiosArgs.method,
894
+ localVarAxiosArgs.params,
895
+ localVarAxiosArgs?.timeUnit,
896
+ { isSigned: true }
897
+ );
898
+ }
899
+ /**
900
+ * Redeem Flexible Product
901
+ *
902
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
903
+ *
904
+ * Weight: 1
905
+ *
906
+ * @summary Redeem Flexible Product(TRADE)
907
+ * @param {RedeemFlexibleProductRequest} requestParameters Request parameters.
908
+ * @returns {Promise<RestApiResponse<RedeemFlexibleProductResponse>>}
909
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
910
+ * @memberof EarnApi
911
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Redeem-Flexible-Product Binance API Documentation}
912
+ */
913
+ async redeemFlexibleProduct(requestParameters) {
914
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemFlexibleProduct(
915
+ requestParameters?.productId,
916
+ requestParameters?.redeemAll,
917
+ requestParameters?.amount,
918
+ requestParameters?.destAccount,
919
+ requestParameters?.recvWindow
920
+ );
921
+ return sendRequest2(
922
+ this.configuration,
923
+ localVarAxiosArgs.endpoint,
924
+ localVarAxiosArgs.method,
925
+ localVarAxiosArgs.params,
926
+ localVarAxiosArgs?.timeUnit,
927
+ { isSigned: true }
928
+ );
929
+ }
930
+ /**
931
+ * Redeem Locked Product
932
+ *
933
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
934
+ *
935
+ * Weight: 1/3s per account
936
+ *
937
+ * @summary Redeem Locked Product(TRADE)
938
+ * @param {RedeemLockedProductRequest} requestParameters Request parameters.
939
+ * @returns {Promise<RestApiResponse<RedeemLockedProductResponse>>}
940
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
941
+ * @memberof EarnApi
942
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Redeem-Locked-Product Binance API Documentation}
943
+ */
944
+ async redeemLockedProduct(requestParameters) {
945
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.redeemLockedProduct(
946
+ requestParameters?.positionId,
947
+ requestParameters?.recvWindow
948
+ );
949
+ return sendRequest2(
950
+ this.configuration,
951
+ localVarAxiosArgs.endpoint,
952
+ localVarAxiosArgs.method,
953
+ localVarAxiosArgs.params,
954
+ localVarAxiosArgs?.timeUnit,
955
+ { isSigned: true }
956
+ );
957
+ }
958
+ /**
959
+ * Set Flexible Auto Subscribe
960
+ *
961
+ * Weight: 150
962
+ *
963
+ * @summary Set Flexible Auto Subscribe(USER_DATA)
964
+ * @param {SetFlexibleAutoSubscribeRequest} requestParameters Request parameters.
965
+ * @returns {Promise<RestApiResponse<SetFlexibleAutoSubscribeResponse>>}
966
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
967
+ * @memberof EarnApi
968
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Set-Flexible-Auto-Subscribe Binance API Documentation}
969
+ */
970
+ async setFlexibleAutoSubscribe(requestParameters) {
971
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.setFlexibleAutoSubscribe(
972
+ requestParameters?.productId,
973
+ requestParameters?.autoSubscribe,
974
+ requestParameters?.recvWindow
975
+ );
976
+ return sendRequest2(
977
+ this.configuration,
978
+ localVarAxiosArgs.endpoint,
979
+ localVarAxiosArgs.method,
980
+ localVarAxiosArgs.params,
981
+ localVarAxiosArgs?.timeUnit,
982
+ { isSigned: true }
983
+ );
984
+ }
985
+ /**
986
+ * Set locked auto subscribe
987
+ *
988
+ * Weight: 150
989
+ *
990
+ * @summary Set Locked Auto Subscribe(USER_DATA)
991
+ * @param {SetLockedAutoSubscribeRequest} requestParameters Request parameters.
992
+ * @returns {Promise<RestApiResponse<SetLockedAutoSubscribeResponse>>}
993
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
994
+ * @memberof EarnApi
995
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Auto-Subscribe Binance API Documentation}
996
+ */
997
+ async setLockedAutoSubscribe(requestParameters) {
998
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.setLockedAutoSubscribe(
999
+ requestParameters?.positionId,
1000
+ requestParameters?.autoSubscribe,
1001
+ requestParameters?.recvWindow
1002
+ );
1003
+ return sendRequest2(
1004
+ this.configuration,
1005
+ localVarAxiosArgs.endpoint,
1006
+ localVarAxiosArgs.method,
1007
+ localVarAxiosArgs.params,
1008
+ localVarAxiosArgs?.timeUnit,
1009
+ { isSigned: true }
1010
+ );
1011
+ }
1012
+ /**
1013
+ * Set redeem option for Locked product
1014
+ *
1015
+ * Weight: 50
1016
+ *
1017
+ * @summary Set Locked Product Redeem Option(USER_DATA)
1018
+ * @param {SetLockedProductRedeemOptionRequest} requestParameters Request parameters.
1019
+ * @returns {Promise<RestApiResponse<SetLockedProductRedeemOptionResponse>>}
1020
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1021
+ * @memberof EarnApi
1022
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Redeem-Option Binance API Documentation}
1023
+ */
1024
+ async setLockedProductRedeemOption(requestParameters) {
1025
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.setLockedProductRedeemOption(
1026
+ requestParameters?.positionId,
1027
+ requestParameters?.redeemTo,
1028
+ requestParameters?.recvWindow
1029
+ );
1030
+ return sendRequest2(
1031
+ this.configuration,
1032
+ localVarAxiosArgs.endpoint,
1033
+ localVarAxiosArgs.method,
1034
+ localVarAxiosArgs.params,
1035
+ localVarAxiosArgs?.timeUnit,
1036
+ { isSigned: true }
1037
+ );
1038
+ }
1039
+ /**
1040
+ * Subscribe Flexible Product
1041
+ *
1042
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1043
+ *
1044
+ * Weight: 1
1045
+ *
1046
+ * @summary Subscribe Flexible Product(TRADE)
1047
+ * @param {SubscribeFlexibleProductRequest} requestParameters Request parameters.
1048
+ * @returns {Promise<RestApiResponse<SubscribeFlexibleProductResponse>>}
1049
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1050
+ * @memberof EarnApi
1051
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Subscribe-Flexible-Product Binance API Documentation}
1052
+ */
1053
+ async subscribeFlexibleProduct(requestParameters) {
1054
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.subscribeFlexibleProduct(
1055
+ requestParameters?.productId,
1056
+ requestParameters?.amount,
1057
+ requestParameters?.autoSubscribe,
1058
+ requestParameters?.sourceAccount,
1059
+ requestParameters?.recvWindow
1060
+ );
1061
+ return sendRequest2(
1062
+ this.configuration,
1063
+ localVarAxiosArgs.endpoint,
1064
+ localVarAxiosArgs.method,
1065
+ localVarAxiosArgs.params,
1066
+ localVarAxiosArgs?.timeUnit,
1067
+ { isSigned: true }
1068
+ );
1069
+ }
1070
+ /**
1071
+ * Subscribe Locked Product
1072
+ *
1073
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1074
+ *
1075
+ * Weight: 1
1076
+ *
1077
+ * @summary Subscribe Locked Product(TRADE)
1078
+ * @param {SubscribeLockedProductRequest} requestParameters Request parameters.
1079
+ * @returns {Promise<RestApiResponse<SubscribeLockedProductResponse>>}
1080
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1081
+ * @memberof EarnApi
1082
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Subscribe-Locked-Product Binance API Documentation}
1083
+ */
1084
+ async subscribeLockedProduct(requestParameters) {
1085
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.subscribeLockedProduct(
1086
+ requestParameters?.projectId,
1087
+ requestParameters?.amount,
1088
+ requestParameters?.autoSubscribe,
1089
+ requestParameters?.sourceAccount,
1090
+ requestParameters?.redeemTo,
1091
+ requestParameters?.recvWindow
1092
+ );
1093
+ return sendRequest2(
1094
+ this.configuration,
1095
+ localVarAxiosArgs.endpoint,
1096
+ localVarAxiosArgs.method,
1097
+ localVarAxiosArgs.params,
1098
+ localVarAxiosArgs?.timeUnit,
1099
+ { isSigned: true }
1100
+ );
1101
+ }
1102
+ };
1103
+
1104
+ // src/rest-api/modules/history-api.ts
1105
+ import {
1106
+ assertParamExists as assertParamExists3,
1107
+ sendRequest as sendRequest3
1108
+ } from "@binance/common";
1109
+ var HistoryApiAxiosParamCreator = function(configuration) {
1110
+ return {
1111
+ /**
1112
+ * Get Collateral Record
1113
+ *
1114
+ * The time between `startTime` and `endTime` cannot be longer than 30 days.
1115
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1116
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1117
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1118
+ *
1119
+ * Weight: 1
1120
+ *
1121
+ * @summary Get Collateral Record(USER_DATA)
1122
+ * @param {string} [productId]
1123
+ * @param {number} [startTime]
1124
+ * @param {number} [endTime]
1125
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1126
+ * @param {number} [size] Default:10, Max:100
1127
+ * @param {number} [recvWindow]
1128
+ *
1129
+ * @throws {RequiredError}
1130
+ */
1131
+ getCollateralRecord: async (productId, startTime, endTime, current, size, recvWindow) => {
1132
+ const localVarQueryParameter = {};
1133
+ if (productId !== void 0 && productId !== null) {
1134
+ localVarQueryParameter["productId"] = productId;
1135
+ }
1136
+ if (startTime !== void 0 && startTime !== null) {
1137
+ localVarQueryParameter["startTime"] = startTime;
1138
+ }
1139
+ if (endTime !== void 0 && endTime !== null) {
1140
+ localVarQueryParameter["endTime"] = endTime;
1141
+ }
1142
+ if (current !== void 0 && current !== null) {
1143
+ localVarQueryParameter["current"] = current;
1144
+ }
1145
+ if (size !== void 0 && size !== null) {
1146
+ localVarQueryParameter["size"] = size;
1147
+ }
1148
+ if (recvWindow !== void 0 && recvWindow !== null) {
1149
+ localVarQueryParameter["recvWindow"] = recvWindow;
1150
+ }
1151
+ let _timeUnit;
1152
+ if ("timeUnit" in configuration)
1153
+ _timeUnit = configuration.timeUnit;
1154
+ return {
1155
+ endpoint: "/sapi/v1/simple-earn/flexible/history/collateralRecord",
1156
+ method: "GET",
1157
+ params: localVarQueryParameter,
1158
+ timeUnit: _timeUnit
1159
+ };
1160
+ },
1161
+ /**
1162
+ * Get Flexible Redemption Record
1163
+ *
1164
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1165
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1166
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1167
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1168
+ *
1169
+ * Weight: 150
1170
+ *
1171
+ * @summary Get Flexible Redemption Record(USER_DATA)
1172
+ * @param {string} [productId]
1173
+ * @param {string} [redeemId]
1174
+ * @param {string} [asset]
1175
+ * @param {number} [startTime]
1176
+ * @param {number} [endTime]
1177
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1178
+ * @param {number} [size] Default:10, Max:100
1179
+ *
1180
+ * @throws {RequiredError}
1181
+ */
1182
+ getFlexibleRedemptionRecord: async (productId, redeemId, asset, startTime, endTime, current, size) => {
1183
+ const localVarQueryParameter = {};
1184
+ if (productId !== void 0 && productId !== null) {
1185
+ localVarQueryParameter["productId"] = productId;
1186
+ }
1187
+ if (redeemId !== void 0 && redeemId !== null) {
1188
+ localVarQueryParameter["redeemId"] = redeemId;
1189
+ }
1190
+ if (asset !== void 0 && asset !== null) {
1191
+ localVarQueryParameter["asset"] = asset;
1192
+ }
1193
+ if (startTime !== void 0 && startTime !== null) {
1194
+ localVarQueryParameter["startTime"] = startTime;
1195
+ }
1196
+ if (endTime !== void 0 && endTime !== null) {
1197
+ localVarQueryParameter["endTime"] = endTime;
1198
+ }
1199
+ if (current !== void 0 && current !== null) {
1200
+ localVarQueryParameter["current"] = current;
1201
+ }
1202
+ if (size !== void 0 && size !== null) {
1203
+ localVarQueryParameter["size"] = size;
1204
+ }
1205
+ let _timeUnit;
1206
+ if ("timeUnit" in configuration)
1207
+ _timeUnit = configuration.timeUnit;
1208
+ return {
1209
+ endpoint: "/sapi/v1/simple-earn/flexible/history/redemptionRecord",
1210
+ method: "GET",
1211
+ params: localVarQueryParameter,
1212
+ timeUnit: _timeUnit
1213
+ };
1214
+ },
1215
+ /**
1216
+ * Get Flexible Rewards History
1217
+ *
1218
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1219
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1220
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1221
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1222
+ *
1223
+ * Weight: 150
1224
+ *
1225
+ * @summary Get Flexible Rewards History(USER_DATA)
1226
+ * @param {string} type `Bonus` - Bonus tiered APR, `REALTIME` Real-time APR, `REWARDS` Historical rewards,`ALL`(set to default)
1227
+ * @param {string} [productId]
1228
+ * @param {string} [asset]
1229
+ * @param {number} [startTime]
1230
+ * @param {number} [endTime]
1231
+ *
1232
+ * @throws {RequiredError}
1233
+ */
1234
+ getFlexibleRewardsHistory: async (type, productId, asset, startTime, endTime) => {
1235
+ assertParamExists3("getFlexibleRewardsHistory", "type", type);
1236
+ const localVarQueryParameter = {};
1237
+ if (productId !== void 0 && productId !== null) {
1238
+ localVarQueryParameter["productId"] = productId;
1239
+ }
1240
+ if (asset !== void 0 && asset !== null) {
1241
+ localVarQueryParameter["asset"] = asset;
1242
+ }
1243
+ if (startTime !== void 0 && startTime !== null) {
1244
+ localVarQueryParameter["startTime"] = startTime;
1245
+ }
1246
+ if (endTime !== void 0 && endTime !== null) {
1247
+ localVarQueryParameter["endTime"] = endTime;
1248
+ }
1249
+ if (type !== void 0 && type !== null) {
1250
+ localVarQueryParameter["type"] = type;
1251
+ }
1252
+ let _timeUnit;
1253
+ if ("timeUnit" in configuration)
1254
+ _timeUnit = configuration.timeUnit;
1255
+ return {
1256
+ endpoint: "/sapi/v1/simple-earn/flexible/history/rewardsRecord",
1257
+ method: "GET",
1258
+ params: localVarQueryParameter,
1259
+ timeUnit: _timeUnit
1260
+ };
1261
+ },
1262
+ /**
1263
+ * Get Flexible Subscription Record
1264
+ *
1265
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1266
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1267
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1268
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1269
+ *
1270
+ * Weight: 150
1271
+ *
1272
+ * @summary Get Flexible Subscription Record(USER_DATA)
1273
+ * @param {string} [productId]
1274
+ * @param {string} [purchaseId]
1275
+ * @param {string} [asset]
1276
+ * @param {number} [startTime]
1277
+ * @param {number} [endTime]
1278
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1279
+ * @param {number} [size] Default:10, Max:100
1280
+ * @param {number} [recvWindow]
1281
+ *
1282
+ * @throws {RequiredError}
1283
+ */
1284
+ getFlexibleSubscriptionRecord: async (productId, purchaseId, asset, startTime, endTime, current, size, recvWindow) => {
1285
+ const localVarQueryParameter = {};
1286
+ if (productId !== void 0 && productId !== null) {
1287
+ localVarQueryParameter["productId"] = productId;
1288
+ }
1289
+ if (purchaseId !== void 0 && purchaseId !== null) {
1290
+ localVarQueryParameter["purchaseId"] = purchaseId;
1291
+ }
1292
+ if (asset !== void 0 && asset !== null) {
1293
+ localVarQueryParameter["asset"] = asset;
1294
+ }
1295
+ if (startTime !== void 0 && startTime !== null) {
1296
+ localVarQueryParameter["startTime"] = startTime;
1297
+ }
1298
+ if (endTime !== void 0 && endTime !== null) {
1299
+ localVarQueryParameter["endTime"] = endTime;
1300
+ }
1301
+ if (current !== void 0 && current !== null) {
1302
+ localVarQueryParameter["current"] = current;
1303
+ }
1304
+ if (size !== void 0 && size !== null) {
1305
+ localVarQueryParameter["size"] = size;
1306
+ }
1307
+ if (recvWindow !== void 0 && recvWindow !== null) {
1308
+ localVarQueryParameter["recvWindow"] = recvWindow;
1309
+ }
1310
+ let _timeUnit;
1311
+ if ("timeUnit" in configuration)
1312
+ _timeUnit = configuration.timeUnit;
1313
+ return {
1314
+ endpoint: "/sapi/v1/simple-earn/flexible/history/subscriptionRecord",
1315
+ method: "GET",
1316
+ params: localVarQueryParameter,
1317
+ timeUnit: _timeUnit
1318
+ };
1319
+ },
1320
+ /**
1321
+ * Get Locked Redemption Record
1322
+ *
1323
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1324
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1325
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1326
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1327
+ *
1328
+ * Weight: 150
1329
+ *
1330
+ * @summary Get Locked Redemption Record(USER_DATA)
1331
+ * @param {number} [positionId]
1332
+ * @param {string} [redeemId]
1333
+ * @param {string} [asset]
1334
+ * @param {number} [startTime]
1335
+ * @param {number} [endTime]
1336
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1337
+ * @param {number} [size] Default:10, Max:100
1338
+ * @param {number} [recvWindow]
1339
+ *
1340
+ * @throws {RequiredError}
1341
+ */
1342
+ getLockedRedemptionRecord: async (positionId, redeemId, asset, startTime, endTime, current, size, recvWindow) => {
1343
+ const localVarQueryParameter = {};
1344
+ if (positionId !== void 0 && positionId !== null) {
1345
+ localVarQueryParameter["positionId"] = positionId;
1346
+ }
1347
+ if (redeemId !== void 0 && redeemId !== null) {
1348
+ localVarQueryParameter["redeemId"] = redeemId;
1349
+ }
1350
+ if (asset !== void 0 && asset !== null) {
1351
+ localVarQueryParameter["asset"] = asset;
1352
+ }
1353
+ if (startTime !== void 0 && startTime !== null) {
1354
+ localVarQueryParameter["startTime"] = startTime;
1355
+ }
1356
+ if (endTime !== void 0 && endTime !== null) {
1357
+ localVarQueryParameter["endTime"] = endTime;
1358
+ }
1359
+ if (current !== void 0 && current !== null) {
1360
+ localVarQueryParameter["current"] = current;
1361
+ }
1362
+ if (size !== void 0 && size !== null) {
1363
+ localVarQueryParameter["size"] = size;
1364
+ }
1365
+ if (recvWindow !== void 0 && recvWindow !== null) {
1366
+ localVarQueryParameter["recvWindow"] = recvWindow;
1367
+ }
1368
+ let _timeUnit;
1369
+ if ("timeUnit" in configuration)
1370
+ _timeUnit = configuration.timeUnit;
1371
+ return {
1372
+ endpoint: "/sapi/v1/simple-earn/locked/history/redemptionRecord",
1373
+ method: "GET",
1374
+ params: localVarQueryParameter,
1375
+ timeUnit: _timeUnit
1376
+ };
1377
+ },
1378
+ /**
1379
+ * Get Locked Rewards History
1380
+ *
1381
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1382
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1383
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1384
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1385
+ *
1386
+ * Weight: 150
1387
+ *
1388
+ * @summary Get Locked Rewards History(USER_DATA)
1389
+ * @param {number} [positionId]
1390
+ * @param {string} [asset]
1391
+ * @param {number} [startTime]
1392
+ * @param {number} [endTime]
1393
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1394
+ * @param {number} [size] Default:10, Max:100
1395
+ * @param {number} [recvWindow]
1396
+ *
1397
+ * @throws {RequiredError}
1398
+ */
1399
+ getLockedRewardsHistory: async (positionId, asset, startTime, endTime, current, size, recvWindow) => {
1400
+ const localVarQueryParameter = {};
1401
+ if (positionId !== void 0 && positionId !== null) {
1402
+ localVarQueryParameter["positionId"] = positionId;
1403
+ }
1404
+ if (asset !== void 0 && asset !== null) {
1405
+ localVarQueryParameter["asset"] = asset;
1406
+ }
1407
+ if (startTime !== void 0 && startTime !== null) {
1408
+ localVarQueryParameter["startTime"] = startTime;
1409
+ }
1410
+ if (endTime !== void 0 && endTime !== null) {
1411
+ localVarQueryParameter["endTime"] = endTime;
1412
+ }
1413
+ if (current !== void 0 && current !== null) {
1414
+ localVarQueryParameter["current"] = current;
1415
+ }
1416
+ if (size !== void 0 && size !== null) {
1417
+ localVarQueryParameter["size"] = size;
1418
+ }
1419
+ if (recvWindow !== void 0 && recvWindow !== null) {
1420
+ localVarQueryParameter["recvWindow"] = recvWindow;
1421
+ }
1422
+ let _timeUnit;
1423
+ if ("timeUnit" in configuration)
1424
+ _timeUnit = configuration.timeUnit;
1425
+ return {
1426
+ endpoint: "/sapi/v1/simple-earn/locked/history/rewardsRecord",
1427
+ method: "GET",
1428
+ params: localVarQueryParameter,
1429
+ timeUnit: _timeUnit
1430
+ };
1431
+ },
1432
+ /**
1433
+ * Get Locked Subscription Record
1434
+ *
1435
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1436
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1437
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1438
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1439
+ *
1440
+ * Weight: 150
1441
+ *
1442
+ * @summary Get Locked Subscription Record(USER_DATA)
1443
+ * @param {string} [purchaseId]
1444
+ * @param {string} [asset]
1445
+ * @param {number} [startTime]
1446
+ * @param {number} [endTime]
1447
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1448
+ * @param {number} [size] Default:10, Max:100
1449
+ * @param {number} [recvWindow]
1450
+ *
1451
+ * @throws {RequiredError}
1452
+ */
1453
+ getLockedSubscriptionRecord: async (purchaseId, asset, startTime, endTime, current, size, recvWindow) => {
1454
+ const localVarQueryParameter = {};
1455
+ if (purchaseId !== void 0 && purchaseId !== null) {
1456
+ localVarQueryParameter["purchaseId"] = purchaseId;
1457
+ }
1458
+ if (asset !== void 0 && asset !== null) {
1459
+ localVarQueryParameter["asset"] = asset;
1460
+ }
1461
+ if (startTime !== void 0 && startTime !== null) {
1462
+ localVarQueryParameter["startTime"] = startTime;
1463
+ }
1464
+ if (endTime !== void 0 && endTime !== null) {
1465
+ localVarQueryParameter["endTime"] = endTime;
1466
+ }
1467
+ if (current !== void 0 && current !== null) {
1468
+ localVarQueryParameter["current"] = current;
1469
+ }
1470
+ if (size !== void 0 && size !== null) {
1471
+ localVarQueryParameter["size"] = size;
1472
+ }
1473
+ if (recvWindow !== void 0 && recvWindow !== null) {
1474
+ localVarQueryParameter["recvWindow"] = recvWindow;
1475
+ }
1476
+ let _timeUnit;
1477
+ if ("timeUnit" in configuration)
1478
+ _timeUnit = configuration.timeUnit;
1479
+ return {
1480
+ endpoint: "/sapi/v1/simple-earn/locked/history/subscriptionRecord",
1481
+ method: "GET",
1482
+ params: localVarQueryParameter,
1483
+ timeUnit: _timeUnit
1484
+ };
1485
+ },
1486
+ /**
1487
+ * Get Rate History
1488
+ *
1489
+ * The time between startTime and endTime cannot be longer than 1 year.
1490
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1491
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1492
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1493
+ *
1494
+ * Weight: 150
1495
+ *
1496
+ * @summary Get Rate History(USER_DATA)
1497
+ * @param {string} productId
1498
+ * @param {string} [aprPeriod] "DAY","YEAR",default"DAY"
1499
+ * @param {number} [startTime]
1500
+ * @param {number} [endTime]
1501
+ * @param {number} [current] Currently querying the page. Start from 1. Default:1
1502
+ * @param {number} [size] Default:10, Max:100
1503
+ * @param {number} [recvWindow]
1504
+ *
1505
+ * @throws {RequiredError}
1506
+ */
1507
+ getRateHistory: async (productId, aprPeriod, startTime, endTime, current, size, recvWindow) => {
1508
+ assertParamExists3("getRateHistory", "productId", productId);
1509
+ const localVarQueryParameter = {};
1510
+ if (productId !== void 0 && productId !== null) {
1511
+ localVarQueryParameter["productId"] = productId;
1512
+ }
1513
+ if (aprPeriod !== void 0 && aprPeriod !== null) {
1514
+ localVarQueryParameter["aprPeriod"] = aprPeriod;
1515
+ }
1516
+ if (startTime !== void 0 && startTime !== null) {
1517
+ localVarQueryParameter["startTime"] = startTime;
1518
+ }
1519
+ if (endTime !== void 0 && endTime !== null) {
1520
+ localVarQueryParameter["endTime"] = endTime;
1521
+ }
1522
+ if (current !== void 0 && current !== null) {
1523
+ localVarQueryParameter["current"] = current;
1524
+ }
1525
+ if (size !== void 0 && size !== null) {
1526
+ localVarQueryParameter["size"] = size;
1527
+ }
1528
+ if (recvWindow !== void 0 && recvWindow !== null) {
1529
+ localVarQueryParameter["recvWindow"] = recvWindow;
1530
+ }
1531
+ let _timeUnit;
1532
+ if ("timeUnit" in configuration)
1533
+ _timeUnit = configuration.timeUnit;
1534
+ return {
1535
+ endpoint: "/sapi/v1/simple-earn/flexible/history/rateHistory",
1536
+ method: "GET",
1537
+ params: localVarQueryParameter,
1538
+ timeUnit: _timeUnit
1539
+ };
1540
+ }
1541
+ };
1542
+ };
1543
+ var HistoryApi = class {
1544
+ constructor(configuration) {
1545
+ this.configuration = configuration;
1546
+ this.localVarAxiosParamCreator = HistoryApiAxiosParamCreator(configuration);
1547
+ }
1548
+ /**
1549
+ * Get Collateral Record
1550
+ *
1551
+ * The time between `startTime` and `endTime` cannot be longer than 30 days.
1552
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1553
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1554
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1555
+ *
1556
+ * Weight: 1
1557
+ *
1558
+ * @summary Get Collateral Record(USER_DATA)
1559
+ * @param {GetCollateralRecordRequest} requestParameters Request parameters.
1560
+ * @returns {Promise<RestApiResponse<GetCollateralRecordResponse>>}
1561
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1562
+ * @memberof HistoryApi
1563
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Collateral-Record Binance API Documentation}
1564
+ */
1565
+ async getCollateralRecord(requestParameters = {}) {
1566
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getCollateralRecord(
1567
+ requestParameters?.productId,
1568
+ requestParameters?.startTime,
1569
+ requestParameters?.endTime,
1570
+ requestParameters?.current,
1571
+ requestParameters?.size,
1572
+ requestParameters?.recvWindow
1573
+ );
1574
+ return sendRequest3(
1575
+ this.configuration,
1576
+ localVarAxiosArgs.endpoint,
1577
+ localVarAxiosArgs.method,
1578
+ localVarAxiosArgs.params,
1579
+ localVarAxiosArgs?.timeUnit,
1580
+ { isSigned: true }
1581
+ );
1582
+ }
1583
+ /**
1584
+ * Get Flexible Redemption Record
1585
+ *
1586
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1587
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1588
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1589
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1590
+ *
1591
+ * Weight: 150
1592
+ *
1593
+ * @summary Get Flexible Redemption Record(USER_DATA)
1594
+ * @param {GetFlexibleRedemptionRecordRequest} requestParameters Request parameters.
1595
+ * @returns {Promise<RestApiResponse<GetFlexibleRedemptionRecordResponse>>}
1596
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1597
+ * @memberof HistoryApi
1598
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Redemption-Record Binance API Documentation}
1599
+ */
1600
+ async getFlexibleRedemptionRecord(requestParameters = {}) {
1601
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleRedemptionRecord(
1602
+ requestParameters?.productId,
1603
+ requestParameters?.redeemId,
1604
+ requestParameters?.asset,
1605
+ requestParameters?.startTime,
1606
+ requestParameters?.endTime,
1607
+ requestParameters?.current,
1608
+ requestParameters?.size
1609
+ );
1610
+ return sendRequest3(
1611
+ this.configuration,
1612
+ localVarAxiosArgs.endpoint,
1613
+ localVarAxiosArgs.method,
1614
+ localVarAxiosArgs.params,
1615
+ localVarAxiosArgs?.timeUnit,
1616
+ { isSigned: true }
1617
+ );
1618
+ }
1619
+ /**
1620
+ * Get Flexible Rewards History
1621
+ *
1622
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1623
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1624
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1625
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1626
+ *
1627
+ * Weight: 150
1628
+ *
1629
+ * @summary Get Flexible Rewards History(USER_DATA)
1630
+ * @param {GetFlexibleRewardsHistoryRequest} requestParameters Request parameters.
1631
+ * @returns {Promise<RestApiResponse<GetFlexibleRewardsHistoryResponse>>}
1632
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1633
+ * @memberof HistoryApi
1634
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Rewards-History Binance API Documentation}
1635
+ */
1636
+ async getFlexibleRewardsHistory(requestParameters) {
1637
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleRewardsHistory(
1638
+ requestParameters?.type,
1639
+ requestParameters?.productId,
1640
+ requestParameters?.asset,
1641
+ requestParameters?.startTime,
1642
+ requestParameters?.endTime
1643
+ );
1644
+ return sendRequest3(
1645
+ this.configuration,
1646
+ localVarAxiosArgs.endpoint,
1647
+ localVarAxiosArgs.method,
1648
+ localVarAxiosArgs.params,
1649
+ localVarAxiosArgs?.timeUnit,
1650
+ { isSigned: true }
1651
+ );
1652
+ }
1653
+ /**
1654
+ * Get Flexible Subscription Record
1655
+ *
1656
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1657
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1658
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1659
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1660
+ *
1661
+ * Weight: 150
1662
+ *
1663
+ * @summary Get Flexible Subscription Record(USER_DATA)
1664
+ * @param {GetFlexibleSubscriptionRecordRequest} requestParameters Request parameters.
1665
+ * @returns {Promise<RestApiResponse<GetFlexibleSubscriptionRecordResponse>>}
1666
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1667
+ * @memberof HistoryApi
1668
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Subscription-Record Binance API Documentation}
1669
+ */
1670
+ async getFlexibleSubscriptionRecord(requestParameters = {}) {
1671
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFlexibleSubscriptionRecord(
1672
+ requestParameters?.productId,
1673
+ requestParameters?.purchaseId,
1674
+ requestParameters?.asset,
1675
+ requestParameters?.startTime,
1676
+ requestParameters?.endTime,
1677
+ requestParameters?.current,
1678
+ requestParameters?.size,
1679
+ requestParameters?.recvWindow
1680
+ );
1681
+ return sendRequest3(
1682
+ this.configuration,
1683
+ localVarAxiosArgs.endpoint,
1684
+ localVarAxiosArgs.method,
1685
+ localVarAxiosArgs.params,
1686
+ localVarAxiosArgs?.timeUnit,
1687
+ { isSigned: true }
1688
+ );
1689
+ }
1690
+ /**
1691
+ * Get Locked Redemption Record
1692
+ *
1693
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1694
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1695
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1696
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1697
+ *
1698
+ * Weight: 150
1699
+ *
1700
+ * @summary Get Locked Redemption Record(USER_DATA)
1701
+ * @param {GetLockedRedemptionRecordRequest} requestParameters Request parameters.
1702
+ * @returns {Promise<RestApiResponse<GetLockedRedemptionRecordResponse>>}
1703
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1704
+ * @memberof HistoryApi
1705
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Locked-Redemption-Record Binance API Documentation}
1706
+ */
1707
+ async getLockedRedemptionRecord(requestParameters = {}) {
1708
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLockedRedemptionRecord(
1709
+ requestParameters?.positionId,
1710
+ requestParameters?.redeemId,
1711
+ requestParameters?.asset,
1712
+ requestParameters?.startTime,
1713
+ requestParameters?.endTime,
1714
+ requestParameters?.current,
1715
+ requestParameters?.size,
1716
+ requestParameters?.recvWindow
1717
+ );
1718
+ return sendRequest3(
1719
+ this.configuration,
1720
+ localVarAxiosArgs.endpoint,
1721
+ localVarAxiosArgs.method,
1722
+ localVarAxiosArgs.params,
1723
+ localVarAxiosArgs?.timeUnit,
1724
+ { isSigned: true }
1725
+ );
1726
+ }
1727
+ /**
1728
+ * Get Locked Rewards History
1729
+ *
1730
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1731
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1732
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1733
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1734
+ *
1735
+ * Weight: 150
1736
+ *
1737
+ * @summary Get Locked Rewards History(USER_DATA)
1738
+ * @param {GetLockedRewardsHistoryRequest} requestParameters Request parameters.
1739
+ * @returns {Promise<RestApiResponse<GetLockedRewardsHistoryResponse>>}
1740
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1741
+ * @memberof HistoryApi
1742
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Locked-Rewards-History Binance API Documentation}
1743
+ */
1744
+ async getLockedRewardsHistory(requestParameters = {}) {
1745
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLockedRewardsHistory(
1746
+ requestParameters?.positionId,
1747
+ requestParameters?.asset,
1748
+ requestParameters?.startTime,
1749
+ requestParameters?.endTime,
1750
+ requestParameters?.current,
1751
+ requestParameters?.size,
1752
+ requestParameters?.recvWindow
1753
+ );
1754
+ return sendRequest3(
1755
+ this.configuration,
1756
+ localVarAxiosArgs.endpoint,
1757
+ localVarAxiosArgs.method,
1758
+ localVarAxiosArgs.params,
1759
+ localVarAxiosArgs?.timeUnit,
1760
+ { isSigned: true }
1761
+ );
1762
+ }
1763
+ /**
1764
+ * Get Locked Subscription Record
1765
+ *
1766
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
1767
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1768
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1769
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1770
+ *
1771
+ * Weight: 150
1772
+ *
1773
+ * @summary Get Locked Subscription Record(USER_DATA)
1774
+ * @param {GetLockedSubscriptionRecordRequest} requestParameters Request parameters.
1775
+ * @returns {Promise<RestApiResponse<GetLockedSubscriptionRecordResponse>>}
1776
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1777
+ * @memberof HistoryApi
1778
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Locked-Subscription-Record Binance API Documentation}
1779
+ */
1780
+ async getLockedSubscriptionRecord(requestParameters = {}) {
1781
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getLockedSubscriptionRecord(
1782
+ requestParameters?.purchaseId,
1783
+ requestParameters?.asset,
1784
+ requestParameters?.startTime,
1785
+ requestParameters?.endTime,
1786
+ requestParameters?.current,
1787
+ requestParameters?.size,
1788
+ requestParameters?.recvWindow
1789
+ );
1790
+ return sendRequest3(
1791
+ this.configuration,
1792
+ localVarAxiosArgs.endpoint,
1793
+ localVarAxiosArgs.method,
1794
+ localVarAxiosArgs.params,
1795
+ localVarAxiosArgs?.timeUnit,
1796
+ { isSigned: true }
1797
+ );
1798
+ }
1799
+ /**
1800
+ * Get Rate History
1801
+ *
1802
+ * The time between startTime and endTime cannot be longer than 1 year.
1803
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1804
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1805
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1806
+ *
1807
+ * Weight: 150
1808
+ *
1809
+ * @summary Get Rate History(USER_DATA)
1810
+ * @param {GetRateHistoryRequest} requestParameters Request parameters.
1811
+ * @returns {Promise<RestApiResponse<GetRateHistoryResponse>>}
1812
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1813
+ * @memberof HistoryApi
1814
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Rate-History Binance API Documentation}
1815
+ */
1816
+ async getRateHistory(requestParameters) {
1817
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getRateHistory(
1818
+ requestParameters?.productId,
1819
+ requestParameters?.aprPeriod,
1820
+ requestParameters?.startTime,
1821
+ requestParameters?.endTime,
1822
+ requestParameters?.current,
1823
+ requestParameters?.size,
1824
+ requestParameters?.recvWindow
1825
+ );
1826
+ return sendRequest3(
1827
+ this.configuration,
1828
+ localVarAxiosArgs.endpoint,
1829
+ localVarAxiosArgs.method,
1830
+ localVarAxiosArgs.params,
1831
+ localVarAxiosArgs?.timeUnit,
1832
+ { isSigned: true }
1833
+ );
1834
+ }
1835
+ };
1836
+
1837
+ // src/rest-api/rest-api.ts
1838
+ import { sendRequest as sendRequest4 } from "@binance/common";
1839
+ var RestAPI = class {
1840
+ constructor(configuration) {
1841
+ this.configuration = configuration;
1842
+ this.accountApi = new AccountApi(configuration);
1843
+ this.earnApi = new EarnApi(configuration);
1844
+ this.historyApi = new HistoryApi(configuration);
1845
+ }
1846
+ /**
1847
+ * Generic function to send a request.
1848
+ * @param endpoint - The API endpoint to call.
1849
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
1850
+ * @param params - Query parameters for the request.
1851
+ *
1852
+ * @returns A promise resolving to the response data object.
1853
+ */
1854
+ sendRequest(endpoint, method, params = {}) {
1855
+ return sendRequest4(this.configuration, endpoint, method, params, void 0);
1856
+ }
1857
+ /**
1858
+ * Generic function to send a signed request.
1859
+ * @param endpoint - The API endpoint to call.
1860
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
1861
+ * @param params - Query parameters for the request.
1862
+ *
1863
+ * @returns A promise resolving to the response data object.
1864
+ */
1865
+ sendSignedRequest(endpoint, method, params = {}) {
1866
+ return sendRequest4(this.configuration, endpoint, method, params, void 0, {
1867
+ isSigned: true
1868
+ });
1869
+ }
1870
+ /**
1871
+ * Get Flexible Personal Left Quota
1872
+ *
1873
+ * Weight: 150
1874
+ *
1875
+ * @summary Get Flexible Personal Left Quota(USER_DATA)
1876
+ * @param {GetFlexiblePersonalLeftQuotaRequest} requestParameters Request parameters.
1877
+ * @returns {Promise<RestApiResponse<GetFlexiblePersonalLeftQuotaResponse>>}
1878
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1879
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Personal-Left-Quota Binance API Documentation}
1880
+ */
1881
+ getFlexiblePersonalLeftQuota(requestParameters) {
1882
+ return this.accountApi.getFlexiblePersonalLeftQuota(requestParameters);
1883
+ }
1884
+ /**
1885
+ * Get Flexible Product Position
1886
+ *
1887
+ * Weight: 150
1888
+ *
1889
+ * @summary Get Flexible Product Position(USER_DATA)
1890
+ * @param {GetFlexibleProductPositionRequest} requestParameters Request parameters.
1891
+ * @returns {Promise<RestApiResponse<GetFlexibleProductPositionResponse>>}
1892
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1893
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Flexible-Product-Position Binance API Documentation}
1894
+ */
1895
+ getFlexibleProductPosition(requestParameters = {}) {
1896
+ return this.accountApi.getFlexibleProductPosition(requestParameters);
1897
+ }
1898
+ /**
1899
+ * Get Locked Personal Left Quota
1900
+ *
1901
+ * Weight: 150
1902
+ *
1903
+ * @summary Get Locked Personal Left Quota(USER_DATA)
1904
+ * @param {GetLockedPersonalLeftQuotaRequest} requestParameters Request parameters.
1905
+ * @returns {Promise<RestApiResponse<GetLockedPersonalLeftQuotaResponse>>}
1906
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1907
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Locked-Personal-Left-Quota Binance API Documentation}
1908
+ */
1909
+ getLockedPersonalLeftQuota(requestParameters) {
1910
+ return this.accountApi.getLockedPersonalLeftQuota(requestParameters);
1911
+ }
1912
+ /**
1913
+ * Get Locked Product Position
1914
+ *
1915
+ * Weight: 150
1916
+ *
1917
+ * @summary Get Locked Product Position
1918
+ * @param {GetLockedProductPositionRequest} requestParameters Request parameters.
1919
+ * @returns {Promise<RestApiResponse<GetLockedProductPositionResponse>>}
1920
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1921
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Locked-Product-Position Binance API Documentation}
1922
+ */
1923
+ getLockedProductPosition(requestParameters = {}) {
1924
+ return this.accountApi.getLockedProductPosition(requestParameters);
1925
+ }
1926
+ /**
1927
+ * Get available Simple Earn flexible product list
1928
+ *
1929
+ * Weight: 150
1930
+ *
1931
+ * @summary Get Simple Earn Flexible Product List(USER_DATA)
1932
+ * @param {GetSimpleEarnFlexibleProductListRequest} requestParameters Request parameters.
1933
+ * @returns {Promise<RestApiResponse<GetSimpleEarnFlexibleProductListResponse>>}
1934
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1935
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Flexible-Product-List Binance API Documentation}
1936
+ */
1937
+ getSimpleEarnFlexibleProductList(requestParameters = {}) {
1938
+ return this.accountApi.getSimpleEarnFlexibleProductList(requestParameters);
1939
+ }
1940
+ /**
1941
+ * Get Simple Earn Locked Product List
1942
+ *
1943
+ * Get available Simple Earn locked product list
1944
+ *
1945
+ * Weight: 150
1946
+ *
1947
+ * @summary Get Simple Earn Locked Product List(USER_DATA)
1948
+ * @param {GetSimpleEarnLockedProductListRequest} requestParameters Request parameters.
1949
+ * @returns {Promise<RestApiResponse<GetSimpleEarnLockedProductListResponse>>}
1950
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1951
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Get-Simple-Earn-Locked-Product-List Binance API Documentation}
1952
+ */
1953
+ getSimpleEarnLockedProductList(requestParameters = {}) {
1954
+ return this.accountApi.getSimpleEarnLockedProductList(requestParameters);
1955
+ }
1956
+ /**
1957
+ * Simple Account query
1958
+ *
1959
+ * Weight: 150
1960
+ *
1961
+ * @summary Simple Account(USER_DATA)
1962
+ * @param {SimpleAccountRequest} requestParameters Request parameters.
1963
+ * @returns {Promise<RestApiResponse<SimpleAccountResponse>>}
1964
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1965
+ * @see {@link https://developers.binance.com/docs/simple_earn/account/Simple-Account Binance API Documentation}
1966
+ */
1967
+ simpleAccount(requestParameters = {}) {
1968
+ return this.accountApi.simpleAccount(requestParameters);
1969
+ }
1970
+ /**
1971
+ * Get Flexible Subscription Preview
1972
+ *
1973
+ * Weight: 150
1974
+ *
1975
+ * @summary Get Flexible Subscription Preview(USER_DATA)
1976
+ * @param {GetFlexibleSubscriptionPreviewRequest} requestParameters Request parameters.
1977
+ * @returns {Promise<RestApiResponse<GetFlexibleSubscriptionPreviewResponse>>}
1978
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1979
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Get-Flexible-Subscription-Preview Binance API Documentation}
1980
+ */
1981
+ getFlexibleSubscriptionPreview(requestParameters) {
1982
+ return this.earnApi.getFlexibleSubscriptionPreview(requestParameters);
1983
+ }
1984
+ /**
1985
+ * Get Locked Subscription Preview
1986
+ *
1987
+ * Weight: 150
1988
+ *
1989
+ * @summary Get Locked Subscription Preview(USER_DATA)
1990
+ * @param {GetLockedSubscriptionPreviewRequest} requestParameters Request parameters.
1991
+ * @returns {Promise<RestApiResponse<GetLockedSubscriptionPreviewResponse>>}
1992
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
1993
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Get-Locked-Subscription-Preview Binance API Documentation}
1994
+ */
1995
+ getLockedSubscriptionPreview(requestParameters) {
1996
+ return this.earnApi.getLockedSubscriptionPreview(requestParameters);
1997
+ }
1998
+ /**
1999
+ * Redeem Flexible Product
2000
+ *
2001
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
2002
+ *
2003
+ * Weight: 1
2004
+ *
2005
+ * @summary Redeem Flexible Product(TRADE)
2006
+ * @param {RedeemFlexibleProductRequest} requestParameters Request parameters.
2007
+ * @returns {Promise<RestApiResponse<RedeemFlexibleProductResponse>>}
2008
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2009
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Redeem-Flexible-Product Binance API Documentation}
2010
+ */
2011
+ redeemFlexibleProduct(requestParameters) {
2012
+ return this.earnApi.redeemFlexibleProduct(requestParameters);
2013
+ }
2014
+ /**
2015
+ * Redeem Locked Product
2016
+ *
2017
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
2018
+ *
2019
+ * Weight: 1/3s per account
2020
+ *
2021
+ * @summary Redeem Locked Product(TRADE)
2022
+ * @param {RedeemLockedProductRequest} requestParameters Request parameters.
2023
+ * @returns {Promise<RestApiResponse<RedeemLockedProductResponse>>}
2024
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2025
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Redeem-Locked-Product Binance API Documentation}
2026
+ */
2027
+ redeemLockedProduct(requestParameters) {
2028
+ return this.earnApi.redeemLockedProduct(requestParameters);
2029
+ }
2030
+ /**
2031
+ * Set Flexible Auto Subscribe
2032
+ *
2033
+ * Weight: 150
2034
+ *
2035
+ * @summary Set Flexible Auto Subscribe(USER_DATA)
2036
+ * @param {SetFlexibleAutoSubscribeRequest} requestParameters Request parameters.
2037
+ * @returns {Promise<RestApiResponse<SetFlexibleAutoSubscribeResponse>>}
2038
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2039
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Set-Flexible-Auto-Subscribe Binance API Documentation}
2040
+ */
2041
+ setFlexibleAutoSubscribe(requestParameters) {
2042
+ return this.earnApi.setFlexibleAutoSubscribe(requestParameters);
2043
+ }
2044
+ /**
2045
+ * Set locked auto subscribe
2046
+ *
2047
+ * Weight: 150
2048
+ *
2049
+ * @summary Set Locked Auto Subscribe(USER_DATA)
2050
+ * @param {SetLockedAutoSubscribeRequest} requestParameters Request parameters.
2051
+ * @returns {Promise<RestApiResponse<SetLockedAutoSubscribeResponse>>}
2052
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2053
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Auto-Subscribe Binance API Documentation}
2054
+ */
2055
+ setLockedAutoSubscribe(requestParameters) {
2056
+ return this.earnApi.setLockedAutoSubscribe(requestParameters);
2057
+ }
2058
+ /**
2059
+ * Set redeem option for Locked product
2060
+ *
2061
+ * Weight: 50
2062
+ *
2063
+ * @summary Set Locked Product Redeem Option(USER_DATA)
2064
+ * @param {SetLockedProductRedeemOptionRequest} requestParameters Request parameters.
2065
+ * @returns {Promise<RestApiResponse<SetLockedProductRedeemOptionResponse>>}
2066
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2067
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Set-Locked-Redeem-Option Binance API Documentation}
2068
+ */
2069
+ setLockedProductRedeemOption(requestParameters) {
2070
+ return this.earnApi.setLockedProductRedeemOption(requestParameters);
2071
+ }
2072
+ /**
2073
+ * Subscribe Flexible Product
2074
+ *
2075
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
2076
+ *
2077
+ * Weight: 1
2078
+ *
2079
+ * @summary Subscribe Flexible Product(TRADE)
2080
+ * @param {SubscribeFlexibleProductRequest} requestParameters Request parameters.
2081
+ * @returns {Promise<RestApiResponse<SubscribeFlexibleProductResponse>>}
2082
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2083
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Subscribe-Flexible-Product Binance API Documentation}
2084
+ */
2085
+ subscribeFlexibleProduct(requestParameters) {
2086
+ return this.earnApi.subscribeFlexibleProduct(requestParameters);
2087
+ }
2088
+ /**
2089
+ * Subscribe Locked Product
2090
+ *
2091
+ * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
2092
+ *
2093
+ * Weight: 1
2094
+ *
2095
+ * @summary Subscribe Locked Product(TRADE)
2096
+ * @param {SubscribeLockedProductRequest} requestParameters Request parameters.
2097
+ * @returns {Promise<RestApiResponse<SubscribeLockedProductResponse>>}
2098
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2099
+ * @see {@link https://developers.binance.com/docs/simple_earn/earn/Subscribe-Locked-Product Binance API Documentation}
2100
+ */
2101
+ subscribeLockedProduct(requestParameters) {
2102
+ return this.earnApi.subscribeLockedProduct(requestParameters);
2103
+ }
2104
+ /**
2105
+ * Get Collateral Record
2106
+ *
2107
+ * The time between `startTime` and `endTime` cannot be longer than 30 days.
2108
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2109
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2110
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2111
+ *
2112
+ * Weight: 1
2113
+ *
2114
+ * @summary Get Collateral Record(USER_DATA)
2115
+ * @param {GetCollateralRecordRequest} requestParameters Request parameters.
2116
+ * @returns {Promise<RestApiResponse<GetCollateralRecordResponse>>}
2117
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2118
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Collateral-Record Binance API Documentation}
2119
+ */
2120
+ getCollateralRecord(requestParameters = {}) {
2121
+ return this.historyApi.getCollateralRecord(requestParameters);
2122
+ }
2123
+ /**
2124
+ * Get Flexible Redemption Record
2125
+ *
2126
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
2127
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2128
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2129
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2130
+ *
2131
+ * Weight: 150
2132
+ *
2133
+ * @summary Get Flexible Redemption Record(USER_DATA)
2134
+ * @param {GetFlexibleRedemptionRecordRequest} requestParameters Request parameters.
2135
+ * @returns {Promise<RestApiResponse<GetFlexibleRedemptionRecordResponse>>}
2136
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2137
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Redemption-Record Binance API Documentation}
2138
+ */
2139
+ getFlexibleRedemptionRecord(requestParameters = {}) {
2140
+ return this.historyApi.getFlexibleRedemptionRecord(requestParameters);
2141
+ }
2142
+ /**
2143
+ * Get Flexible Rewards History
2144
+ *
2145
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
2146
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2147
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2148
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2149
+ *
2150
+ * Weight: 150
2151
+ *
2152
+ * @summary Get Flexible Rewards History(USER_DATA)
2153
+ * @param {GetFlexibleRewardsHistoryRequest} requestParameters Request parameters.
2154
+ * @returns {Promise<RestApiResponse<GetFlexibleRewardsHistoryResponse>>}
2155
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2156
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Rewards-History Binance API Documentation}
2157
+ */
2158
+ getFlexibleRewardsHistory(requestParameters) {
2159
+ return this.historyApi.getFlexibleRewardsHistory(requestParameters);
2160
+ }
2161
+ /**
2162
+ * Get Flexible Subscription Record
2163
+ *
2164
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
2165
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2166
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2167
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2168
+ *
2169
+ * Weight: 150
2170
+ *
2171
+ * @summary Get Flexible Subscription Record(USER_DATA)
2172
+ * @param {GetFlexibleSubscriptionRecordRequest} requestParameters Request parameters.
2173
+ * @returns {Promise<RestApiResponse<GetFlexibleSubscriptionRecordResponse>>}
2174
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2175
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Flexible-Subscription-Record Binance API Documentation}
2176
+ */
2177
+ getFlexibleSubscriptionRecord(requestParameters = {}) {
2178
+ return this.historyApi.getFlexibleSubscriptionRecord(requestParameters);
2179
+ }
2180
+ /**
2181
+ * Get Locked Redemption Record
2182
+ *
2183
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
2184
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2185
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2186
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2187
+ *
2188
+ * Weight: 150
2189
+ *
2190
+ * @summary Get Locked Redemption Record(USER_DATA)
2191
+ * @param {GetLockedRedemptionRecordRequest} requestParameters Request parameters.
2192
+ * @returns {Promise<RestApiResponse<GetLockedRedemptionRecordResponse>>}
2193
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2194
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Locked-Redemption-Record Binance API Documentation}
2195
+ */
2196
+ getLockedRedemptionRecord(requestParameters = {}) {
2197
+ return this.historyApi.getLockedRedemptionRecord(requestParameters);
2198
+ }
2199
+ /**
2200
+ * Get Locked Rewards History
2201
+ *
2202
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
2203
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2204
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2205
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2206
+ *
2207
+ * Weight: 150
2208
+ *
2209
+ * @summary Get Locked Rewards History(USER_DATA)
2210
+ * @param {GetLockedRewardsHistoryRequest} requestParameters Request parameters.
2211
+ * @returns {Promise<RestApiResponse<GetLockedRewardsHistoryResponse>>}
2212
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2213
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Locked-Rewards-History Binance API Documentation}
2214
+ */
2215
+ getLockedRewardsHistory(requestParameters = {}) {
2216
+ return this.historyApi.getLockedRewardsHistory(requestParameters);
2217
+ }
2218
+ /**
2219
+ * Get Locked Subscription Record
2220
+ *
2221
+ * The time between `startTime` and `endTime` cannot be longer than 3 months.
2222
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2223
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2224
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2225
+ *
2226
+ * Weight: 150
2227
+ *
2228
+ * @summary Get Locked Subscription Record(USER_DATA)
2229
+ * @param {GetLockedSubscriptionRecordRequest} requestParameters Request parameters.
2230
+ * @returns {Promise<RestApiResponse<GetLockedSubscriptionRecordResponse>>}
2231
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2232
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Locked-Subscription-Record Binance API Documentation}
2233
+ */
2234
+ getLockedSubscriptionRecord(requestParameters = {}) {
2235
+ return this.historyApi.getLockedSubscriptionRecord(requestParameters);
2236
+ }
2237
+ /**
2238
+ * Get Rate History
2239
+ *
2240
+ * The time between startTime and endTime cannot be longer than 1 year.
2241
+ * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
2242
+ * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
2243
+ * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
2244
+ *
2245
+ * Weight: 150
2246
+ *
2247
+ * @summary Get Rate History(USER_DATA)
2248
+ * @param {GetRateHistoryRequest} requestParameters Request parameters.
2249
+ * @returns {Promise<RestApiResponse<GetRateHistoryResponse>>}
2250
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
2251
+ * @see {@link https://developers.binance.com/docs/simple_earn/history/Get-Rate-History Binance API Documentation}
2252
+ */
2253
+ getRateHistory(requestParameters) {
2254
+ return this.historyApi.getRateHistory(requestParameters);
2255
+ }
2256
+ };
2257
+
2258
+ // src/simple-earn.ts
2259
+ var SimpleEarn = class {
2260
+ constructor(config) {
2261
+ if (config?.configurationRestAPI) {
2262
+ const configRestAPI = new ConfigurationRestAPI5(config.configurationRestAPI);
2263
+ configRestAPI.basePath = configRestAPI.basePath || SIMPLE_EARN_REST_API_PROD_URL;
2264
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
2265
+ configRestAPI.baseOptions.headers = {
2266
+ ...configRestAPI.baseOptions.headers || {},
2267
+ "User-Agent": `${name}/${version} (Node.js/${process.version}; ${platform()}; ${arch()})`
2268
+ };
2269
+ this.restAPI = new RestAPI(configRestAPI);
2270
+ }
2271
+ }
2272
+ };
2273
+
2274
+ // src/index.ts
2275
+ import {
2276
+ SIMPLE_EARN_REST_API_PROD_URL as SIMPLE_EARN_REST_API_PROD_URL2,
2277
+ SIMPLE_EARN_REST_API_TESTNET_URL,
2278
+ ConnectorClientError,
2279
+ RequiredError,
2280
+ UnauthorizedError,
2281
+ ForbiddenError,
2282
+ TooManyRequestsError,
2283
+ RateLimitBanError,
2284
+ ServerError,
2285
+ NetworkError,
2286
+ NotFoundError,
2287
+ BadRequestError
2288
+ } from "@binance/common";
2289
+ export {
2290
+ BadRequestError,
2291
+ ConnectorClientError,
2292
+ ForbiddenError,
2293
+ NetworkError,
2294
+ NotFoundError,
2295
+ RateLimitBanError,
2296
+ RequiredError,
2297
+ SIMPLE_EARN_REST_API_PROD_URL2 as SIMPLE_EARN_REST_API_PROD_URL,
2298
+ SIMPLE_EARN_REST_API_TESTNET_URL,
2299
+ ServerError,
2300
+ SimpleEarn,
2301
+ rest_api_exports as SimpleEarnRestAPI,
2302
+ TooManyRequestsError,
2303
+ UnauthorizedError
2304
+ };
2305
+ //# sourceMappingURL=index.mjs.map