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