@binance/dual-investment 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,551 +1,385 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name2 in all)
4
- __defProp(target, name2, { get: all[name2], enumerable: true });
5
- };
6
-
7
- // src/dual-investment.ts
8
- import {
9
- buildUserAgent,
10
- ConfigurationRestAPI as ConfigurationRestAPI4,
11
- DUAL_INVESTMENT_REST_API_PROD_URL
12
- } from "@binance/common";
1
+ import { t as __export } from "./chunk.mjs";
2
+ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, DUAL_INVESTMENT_REST_API_PROD_URL, DUAL_INVESTMENT_REST_API_PROD_URL as DUAL_INVESTMENT_REST_API_PROD_URL$1, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError, assertParamExists, buildUserAgent, sendRequest } from "@binance/common";
13
3
 
14
- // package.json
4
+ //#region package.json
15
5
  var name = "@binance/dual-investment";
16
- var version = "4.0.0";
17
-
18
- // src/rest-api/index.ts
19
- var rest_api_exports = {};
20
- __export(rest_api_exports, {
21
- MarketDataApi: () => MarketDataApi,
22
- RestAPI: () => RestAPI,
23
- TradeApi: () => TradeApi
24
- });
6
+ var version = "4.0.2";
25
7
 
26
- // src/rest-api/modules/market-data-api.ts
27
- import {
28
- assertParamExists,
29
- sendRequest
30
- } from "@binance/common";
31
- var MarketDataApiAxiosParamCreator = function(configuration) {
32
- return {
33
- /**
34
- * Get Dual Investment product list
35
- *
36
- * Weight: 1(IP)
37
- *
38
- * @summary Get Dual Investment product list
39
- * @param {string} optionType Input CALL or PUT
40
- * @param {string} exercisedCoin Target exercised asset, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT
41
- * @param {string} investCoin Asset used for subscribing, e.g.: if you subscribe to a high sell product (call option), you should input: `optionType`:CALL,`exercisedCoin`:USDT,`investCoin`:BNB; if you subscribe to a low buy product (put option), you should input: `optionType`:PUT,`exercisedCoin`:BNB,`investCoin`:USDT
42
- * @param {number} [pageSize] Default: 10, Maximum: 100
43
- * @param {number} [pageIndex] Default: 1
44
- * @param {number} [recvWindow] The value cannot be greater than 60000
45
- *
46
- * @throws {RequiredError}
47
- */
48
- getDualInvestmentProductList: async (optionType, exercisedCoin, investCoin, pageSize, pageIndex, recvWindow) => {
49
- assertParamExists("getDualInvestmentProductList", "optionType", optionType);
50
- assertParamExists("getDualInvestmentProductList", "exercisedCoin", exercisedCoin);
51
- assertParamExists("getDualInvestmentProductList", "investCoin", investCoin);
52
- const localVarQueryParameter = {};
53
- if (optionType !== void 0 && optionType !== null) {
54
- localVarQueryParameter["optionType"] = optionType;
55
- }
56
- if (exercisedCoin !== void 0 && exercisedCoin !== null) {
57
- localVarQueryParameter["exercisedCoin"] = exercisedCoin;
58
- }
59
- if (investCoin !== void 0 && investCoin !== null) {
60
- localVarQueryParameter["investCoin"] = investCoin;
61
- }
62
- if (pageSize !== void 0 && pageSize !== null) {
63
- localVarQueryParameter["pageSize"] = pageSize;
64
- }
65
- if (pageIndex !== void 0 && pageIndex !== null) {
66
- localVarQueryParameter["pageIndex"] = pageIndex;
67
- }
68
- if (recvWindow !== void 0 && recvWindow !== null) {
69
- localVarQueryParameter["recvWindow"] = recvWindow;
70
- }
71
- let _timeUnit;
72
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
73
- return {
74
- endpoint: "/sapi/v1/dci/product/list",
75
- method: "GET",
76
- params: localVarQueryParameter,
77
- timeUnit: _timeUnit
78
- };
79
- }
80
- };
8
+ //#endregion
9
+ //#region src/rest-api/modules/market-data-api.ts
10
+ /**
11
+ * Binance Dual Investment REST API
12
+ *
13
+ * OpenAPI Specification for the Binance Dual Investment REST API
14
+ *
15
+ * The version of the OpenAPI document: 1.0.0
16
+ *
17
+ *
18
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19
+ * https://openapi-generator.tech
20
+ * Do not edit the class manually.
21
+ */
22
+ /**
23
+ * MarketDataApi - axios parameter creator
24
+ */
25
+ const MarketDataApiAxiosParamCreator = function(configuration) {
26
+ return { getDualInvestmentProductList: async (optionType, exercisedCoin, investCoin, pageSize, pageIndex, recvWindow) => {
27
+ assertParamExists("getDualInvestmentProductList", "optionType", optionType);
28
+ assertParamExists("getDualInvestmentProductList", "exercisedCoin", exercisedCoin);
29
+ assertParamExists("getDualInvestmentProductList", "investCoin", investCoin);
30
+ const localVarQueryParameter = {};
31
+ if (optionType !== void 0 && optionType !== null) localVarQueryParameter["optionType"] = optionType;
32
+ if (exercisedCoin !== void 0 && exercisedCoin !== null) localVarQueryParameter["exercisedCoin"] = exercisedCoin;
33
+ if (investCoin !== void 0 && investCoin !== null) localVarQueryParameter["investCoin"] = investCoin;
34
+ if (pageSize !== void 0 && pageSize !== null) localVarQueryParameter["pageSize"] = pageSize;
35
+ if (pageIndex !== void 0 && pageIndex !== null) localVarQueryParameter["pageIndex"] = pageIndex;
36
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
37
+ let _timeUnit;
38
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
39
+ return {
40
+ endpoint: "/sapi/v1/dci/product/list",
41
+ method: "GET",
42
+ params: localVarQueryParameter,
43
+ timeUnit: _timeUnit
44
+ };
45
+ } };
81
46
  };
47
+ /**
48
+ * MarketDataApi - object-oriented interface
49
+ * @class MarketDataApi
50
+ */
82
51
  var MarketDataApi = class {
83
- constructor(configuration) {
84
- this.configuration = configuration;
85
- this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
86
- }
87
- /**
88
- * Get Dual Investment product list
89
- *
90
- * Weight: 1(IP)
91
- *
92
- * @summary Get Dual Investment product list
93
- * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.
94
- * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}
95
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
96
- * @memberof MarketDataApi
97
- * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}
98
- */
99
- async getDualInvestmentProductList(requestParameters) {
100
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(
101
- requestParameters?.optionType,
102
- requestParameters?.exercisedCoin,
103
- requestParameters?.investCoin,
104
- requestParameters?.pageSize,
105
- requestParameters?.pageIndex,
106
- requestParameters?.recvWindow
107
- );
108
- return sendRequest(
109
- this.configuration,
110
- localVarAxiosArgs.endpoint,
111
- localVarAxiosArgs.method,
112
- localVarAxiosArgs.params,
113
- localVarAxiosArgs?.timeUnit,
114
- { isSigned: true }
115
- );
116
- }
52
+ constructor(configuration) {
53
+ this.configuration = configuration;
54
+ this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);
55
+ }
56
+ /**
57
+ * Get Dual Investment product list
58
+ *
59
+ * Weight: 1(IP)
60
+ *
61
+ * @summary Get Dual Investment product list
62
+ * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.
63
+ * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}
64
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
65
+ * @memberof MarketDataApi
66
+ * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}
67
+ */
68
+ async getDualInvestmentProductList(requestParameters) {
69
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(requestParameters?.optionType, requestParameters?.exercisedCoin, requestParameters?.investCoin, requestParameters?.pageSize, requestParameters?.pageIndex, requestParameters?.recvWindow);
70
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
71
+ }
117
72
  };
118
73
 
119
- // src/rest-api/modules/trade-api.ts
120
- import {
121
- assertParamExists as assertParamExists2,
122
- sendRequest as sendRequest2
123
- } from "@binance/common";
124
- var TradeApiAxiosParamCreator = function(configuration) {
125
- return {
126
- /**
127
- * Change Auto-Compound status
128
- *
129
- * Weight: 1(IP)
130
- *
131
- * @summary Change Auto-Compound status(USER_DATA)
132
- * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`
133
- * @param {string} [autoCompoundPlan]
134
- * @param {number} [recvWindow] The value cannot be greater than 60000
135
- *
136
- * @throws {RequiredError}
137
- */
138
- changeAutoCompoundStatus: async (positionId, autoCompoundPlan, recvWindow) => {
139
- assertParamExists2("changeAutoCompoundStatus", "positionId", positionId);
140
- const localVarQueryParameter = {};
141
- if (positionId !== void 0 && positionId !== null) {
142
- localVarQueryParameter["positionId"] = positionId;
143
- }
144
- if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) {
145
- localVarQueryParameter["AutoCompoundPlan"] = autoCompoundPlan;
146
- }
147
- if (recvWindow !== void 0 && recvWindow !== null) {
148
- localVarQueryParameter["recvWindow"] = recvWindow;
149
- }
150
- let _timeUnit;
151
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
152
- return {
153
- endpoint: "/sapi/v1/dci/product/auto_compound/edit-status",
154
- method: "POST",
155
- params: localVarQueryParameter,
156
- timeUnit: _timeUnit
157
- };
158
- },
159
- /**
160
- * Check Dual Investment accounts
161
- *
162
- * Weight: 1(IP)
163
- *
164
- * @summary Check Dual Investment accounts(USER_DATA)
165
- * @param {number} [recvWindow] The value cannot be greater than 60000
166
- *
167
- * @throws {RequiredError}
168
- */
169
- checkDualInvestmentAccounts: async (recvWindow) => {
170
- const localVarQueryParameter = {};
171
- if (recvWindow !== void 0 && recvWindow !== null) {
172
- localVarQueryParameter["recvWindow"] = recvWindow;
173
- }
174
- let _timeUnit;
175
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
176
- return {
177
- endpoint: "/sapi/v1/dci/product/accounts",
178
- method: "GET",
179
- params: localVarQueryParameter,
180
- timeUnit: _timeUnit
181
- };
182
- },
183
- /**
184
- * Get Dual Investment positions (batch)
185
- *
186
- * Weight: 1(IP)
187
- *
188
- * @summary Get Dual Investment positions(USER_DATA)
189
- * @param {string} [status] `PENDING`:Products are purchasing, will give results later;`PURCHASE_SUCCESS`:purchase successfully;`SETTLED`: Products are finish settling;`PURCHASE_FAIL`:fail to purchase;`REFUNDING`:refund ongoing;`REFUND_SUCCESS`:refund to spot account successfully; `SETTLING`:Products are settling. If don't fill this field, will response all the position status.
190
- * @param {number} [pageSize] Default: 10, Maximum: 100
191
- * @param {number} [pageIndex] Default: 1
192
- * @param {number} [recvWindow] The value cannot be greater than 60000
193
- *
194
- * @throws {RequiredError}
195
- */
196
- getDualInvestmentPositions: async (status, pageSize, pageIndex, recvWindow) => {
197
- const localVarQueryParameter = {};
198
- if (status !== void 0 && status !== null) {
199
- localVarQueryParameter["status"] = status;
200
- }
201
- if (pageSize !== void 0 && pageSize !== null) {
202
- localVarQueryParameter["pageSize"] = pageSize;
203
- }
204
- if (pageIndex !== void 0 && pageIndex !== null) {
205
- localVarQueryParameter["pageIndex"] = pageIndex;
206
- }
207
- if (recvWindow !== void 0 && recvWindow !== null) {
208
- localVarQueryParameter["recvWindow"] = recvWindow;
209
- }
210
- let _timeUnit;
211
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
212
- return {
213
- endpoint: "/sapi/v1/dci/product/positions",
214
- method: "GET",
215
- params: localVarQueryParameter,
216
- timeUnit: _timeUnit
217
- };
218
- },
219
- /**
220
- * Subscribe Dual Investment products
221
- *
222
- * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
223
- * Failed. This means System or network errors.
224
- *
225
- * Weight: 1(IP)
226
- *
227
- * @summary Subscribe Dual Investment products(USER_DATA)
228
- * @param {string} id get id from `/sapi/v1/dci/product/list`
229
- * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`
230
- * @param {number} depositAmount the amount for subscribing
231
- * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan
232
- * @param {number} [recvWindow] The value cannot be greater than 60000
233
- *
234
- * @throws {RequiredError}
235
- */
236
- subscribeDualInvestmentProducts: async (id, orderId, depositAmount, autoCompoundPlan, recvWindow) => {
237
- assertParamExists2("subscribeDualInvestmentProducts", "id", id);
238
- assertParamExists2("subscribeDualInvestmentProducts", "orderId", orderId);
239
- assertParamExists2("subscribeDualInvestmentProducts", "depositAmount", depositAmount);
240
- assertParamExists2(
241
- "subscribeDualInvestmentProducts",
242
- "autoCompoundPlan",
243
- autoCompoundPlan
244
- );
245
- const localVarQueryParameter = {};
246
- if (id !== void 0 && id !== null) {
247
- localVarQueryParameter["id"] = id;
248
- }
249
- if (orderId !== void 0 && orderId !== null) {
250
- localVarQueryParameter["orderId"] = orderId;
251
- }
252
- if (depositAmount !== void 0 && depositAmount !== null) {
253
- localVarQueryParameter["depositAmount"] = depositAmount;
254
- }
255
- if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) {
256
- localVarQueryParameter["autoCompoundPlan"] = autoCompoundPlan;
257
- }
258
- if (recvWindow !== void 0 && recvWindow !== null) {
259
- localVarQueryParameter["recvWindow"] = recvWindow;
260
- }
261
- let _timeUnit;
262
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
263
- return {
264
- endpoint: "/sapi/v1/dci/product/subscribe",
265
- method: "POST",
266
- params: localVarQueryParameter,
267
- timeUnit: _timeUnit
268
- };
269
- }
270
- };
74
+ //#endregion
75
+ //#region src/rest-api/modules/trade-api.ts
76
+ /**
77
+ * Binance Dual Investment REST API
78
+ *
79
+ * OpenAPI Specification for the Binance Dual Investment REST API
80
+ *
81
+ * The version of the OpenAPI document: 1.0.0
82
+ *
83
+ *
84
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
85
+ * https://openapi-generator.tech
86
+ * Do not edit the class manually.
87
+ */
88
+ /**
89
+ * TradeApi - axios parameter creator
90
+ */
91
+ const TradeApiAxiosParamCreator = function(configuration) {
92
+ return {
93
+ changeAutoCompoundStatus: async (positionId, autoCompoundPlan, recvWindow) => {
94
+ assertParamExists("changeAutoCompoundStatus", "positionId", positionId);
95
+ const localVarQueryParameter = {};
96
+ if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
97
+ if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) localVarQueryParameter["AutoCompoundPlan"] = autoCompoundPlan;
98
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
99
+ let _timeUnit;
100
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
101
+ return {
102
+ endpoint: "/sapi/v1/dci/product/auto_compound/edit-status",
103
+ method: "POST",
104
+ params: localVarQueryParameter,
105
+ timeUnit: _timeUnit
106
+ };
107
+ },
108
+ checkDualInvestmentAccounts: async (recvWindow) => {
109
+ const localVarQueryParameter = {};
110
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
111
+ let _timeUnit;
112
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
113
+ return {
114
+ endpoint: "/sapi/v1/dci/product/accounts",
115
+ method: "GET",
116
+ params: localVarQueryParameter,
117
+ timeUnit: _timeUnit
118
+ };
119
+ },
120
+ getDualInvestmentPositions: async (status, pageSize, pageIndex, recvWindow) => {
121
+ const localVarQueryParameter = {};
122
+ if (status !== void 0 && status !== null) localVarQueryParameter["status"] = status;
123
+ if (pageSize !== void 0 && pageSize !== null) localVarQueryParameter["pageSize"] = pageSize;
124
+ if (pageIndex !== void 0 && pageIndex !== null) localVarQueryParameter["pageIndex"] = pageIndex;
125
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
126
+ let _timeUnit;
127
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
128
+ return {
129
+ endpoint: "/sapi/v1/dci/product/positions",
130
+ method: "GET",
131
+ params: localVarQueryParameter,
132
+ timeUnit: _timeUnit
133
+ };
134
+ },
135
+ subscribeDualInvestmentProducts: async (id, orderId, depositAmount, autoCompoundPlan, recvWindow) => {
136
+ assertParamExists("subscribeDualInvestmentProducts", "id", id);
137
+ assertParamExists("subscribeDualInvestmentProducts", "orderId", orderId);
138
+ assertParamExists("subscribeDualInvestmentProducts", "depositAmount", depositAmount);
139
+ assertParamExists("subscribeDualInvestmentProducts", "autoCompoundPlan", autoCompoundPlan);
140
+ const localVarQueryParameter = {};
141
+ if (id !== void 0 && id !== null) localVarQueryParameter["id"] = id;
142
+ if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
143
+ if (depositAmount !== void 0 && depositAmount !== null) localVarQueryParameter["depositAmount"] = depositAmount;
144
+ if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) localVarQueryParameter["autoCompoundPlan"] = autoCompoundPlan;
145
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
146
+ let _timeUnit;
147
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
148
+ return {
149
+ endpoint: "/sapi/v1/dci/product/subscribe",
150
+ method: "POST",
151
+ params: localVarQueryParameter,
152
+ timeUnit: _timeUnit
153
+ };
154
+ }
155
+ };
271
156
  };
157
+ /**
158
+ * TradeApi - object-oriented interface
159
+ * @class TradeApi
160
+ */
272
161
  var TradeApi = class {
273
- constructor(configuration) {
274
- this.configuration = configuration;
275
- this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);
276
- }
277
- /**
278
- * Change Auto-Compound status
279
- *
280
- * Weight: 1(IP)
281
- *
282
- * @summary Change Auto-Compound status(USER_DATA)
283
- * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.
284
- * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}
285
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
286
- * @memberof TradeApi
287
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}
288
- */
289
- async changeAutoCompoundStatus(requestParameters) {
290
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(
291
- requestParameters?.positionId,
292
- requestParameters?.autoCompoundPlan,
293
- requestParameters?.recvWindow
294
- );
295
- return sendRequest2(
296
- this.configuration,
297
- localVarAxiosArgs.endpoint,
298
- localVarAxiosArgs.method,
299
- localVarAxiosArgs.params,
300
- localVarAxiosArgs?.timeUnit,
301
- { isSigned: true }
302
- );
303
- }
304
- /**
305
- * Check Dual Investment accounts
306
- *
307
- * Weight: 1(IP)
308
- *
309
- * @summary Check Dual Investment accounts(USER_DATA)
310
- * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.
311
- * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}
312
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
313
- * @memberof TradeApi
314
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}
315
- */
316
- async checkDualInvestmentAccounts(requestParameters = {}) {
317
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(
318
- requestParameters?.recvWindow
319
- );
320
- return sendRequest2(
321
- this.configuration,
322
- localVarAxiosArgs.endpoint,
323
- localVarAxiosArgs.method,
324
- localVarAxiosArgs.params,
325
- localVarAxiosArgs?.timeUnit,
326
- { isSigned: true }
327
- );
328
- }
329
- /**
330
- * Get Dual Investment positions (batch)
331
- *
332
- * Weight: 1(IP)
333
- *
334
- * @summary Get Dual Investment positions(USER_DATA)
335
- * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.
336
- * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}
337
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
338
- * @memberof TradeApi
339
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}
340
- */
341
- async getDualInvestmentPositions(requestParameters = {}) {
342
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(
343
- requestParameters?.status,
344
- requestParameters?.pageSize,
345
- requestParameters?.pageIndex,
346
- requestParameters?.recvWindow
347
- );
348
- return sendRequest2(
349
- this.configuration,
350
- localVarAxiosArgs.endpoint,
351
- localVarAxiosArgs.method,
352
- localVarAxiosArgs.params,
353
- localVarAxiosArgs?.timeUnit,
354
- { isSigned: true }
355
- );
356
- }
357
- /**
358
- * Subscribe Dual Investment products
359
- *
360
- * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
361
- * Failed. This means System or network errors.
362
- *
363
- * Weight: 1(IP)
364
- *
365
- * @summary Subscribe Dual Investment products(USER_DATA)
366
- * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.
367
- * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}
368
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
369
- * @memberof TradeApi
370
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}
371
- */
372
- async subscribeDualInvestmentProducts(requestParameters) {
373
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(
374
- requestParameters?.id,
375
- requestParameters?.orderId,
376
- requestParameters?.depositAmount,
377
- requestParameters?.autoCompoundPlan,
378
- requestParameters?.recvWindow
379
- );
380
- return sendRequest2(
381
- this.configuration,
382
- localVarAxiosArgs.endpoint,
383
- localVarAxiosArgs.method,
384
- localVarAxiosArgs.params,
385
- localVarAxiosArgs?.timeUnit,
386
- { isSigned: true }
387
- );
388
- }
162
+ constructor(configuration) {
163
+ this.configuration = configuration;
164
+ this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);
165
+ }
166
+ /**
167
+ * Change Auto-Compound status
168
+ *
169
+ * Weight: 1(IP)
170
+ *
171
+ * @summary Change Auto-Compound status(USER_DATA)
172
+ * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.
173
+ * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}
174
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
175
+ * @memberof TradeApi
176
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}
177
+ */
178
+ async changeAutoCompoundStatus(requestParameters) {
179
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(requestParameters?.positionId, requestParameters?.autoCompoundPlan, requestParameters?.recvWindow);
180
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
181
+ }
182
+ /**
183
+ * Check Dual Investment accounts
184
+ *
185
+ * Weight: 1(IP)
186
+ *
187
+ * @summary Check Dual Investment accounts(USER_DATA)
188
+ * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.
189
+ * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}
190
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
191
+ * @memberof TradeApi
192
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}
193
+ */
194
+ async checkDualInvestmentAccounts(requestParameters = {}) {
195
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(requestParameters?.recvWindow);
196
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
197
+ }
198
+ /**
199
+ * Get Dual Investment positions (batch)
200
+ *
201
+ * Weight: 1(IP)
202
+ *
203
+ * @summary Get Dual Investment positions(USER_DATA)
204
+ * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.
205
+ * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}
206
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
207
+ * @memberof TradeApi
208
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}
209
+ */
210
+ async getDualInvestmentPositions(requestParameters = {}) {
211
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(requestParameters?.status, requestParameters?.pageSize, requestParameters?.pageIndex, requestParameters?.recvWindow);
212
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
213
+ }
214
+ /**
215
+ * Subscribe Dual Investment products
216
+ *
217
+ * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
218
+ * Failed. This means System or network errors.
219
+ *
220
+ * Weight: 1(IP)
221
+ *
222
+ * @summary Subscribe Dual Investment products(USER_DATA)
223
+ * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.
224
+ * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}
225
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
226
+ * @memberof TradeApi
227
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}
228
+ */
229
+ async subscribeDualInvestmentProducts(requestParameters) {
230
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(requestParameters?.id, requestParameters?.orderId, requestParameters?.depositAmount, requestParameters?.autoCompoundPlan, requestParameters?.recvWindow);
231
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
232
+ }
389
233
  };
390
234
 
391
- // src/rest-api/rest-api.ts
392
- import { sendRequest as sendRequest3 } from "@binance/common";
235
+ //#endregion
236
+ //#region src/rest-api/rest-api.ts
237
+ /**
238
+ * Binance Dual Investment REST API
239
+ *
240
+ * OpenAPI Specification for the Binance Dual Investment REST API
241
+ *
242
+ * The version of the OpenAPI document: 1.0.0
243
+ *
244
+ *
245
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
246
+ * https://openapi-generator.tech
247
+ * Do not edit the class manually.
248
+ */
393
249
  var RestAPI = class {
394
- constructor(configuration) {
395
- this.configuration = configuration;
396
- this.marketDataApi = new MarketDataApi(configuration);
397
- this.tradeApi = new TradeApi(configuration);
398
- }
399
- /**
400
- * Generic function to send a request.
401
- * @param endpoint - The API endpoint to call.
402
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
403
- * @param params - Query parameters for the request.
404
- *
405
- * @returns A promise resolving to the response data object.
406
- */
407
- sendRequest(endpoint, method, params = {}) {
408
- return sendRequest3(this.configuration, endpoint, method, params, void 0);
409
- }
410
- /**
411
- * Generic function to send a signed request.
412
- * @param endpoint - The API endpoint to call.
413
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
414
- * @param params - Query parameters for the request.
415
- *
416
- * @returns A promise resolving to the response data object.
417
- */
418
- sendSignedRequest(endpoint, method, params = {}) {
419
- return sendRequest3(this.configuration, endpoint, method, params, void 0, {
420
- isSigned: true
421
- });
422
- }
423
- /**
424
- * Get Dual Investment product list
425
- *
426
- * Weight: 1(IP)
427
- *
428
- * @summary Get Dual Investment product list
429
- * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.
430
- *
431
- * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}
432
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
433
- * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}
434
- */
435
- getDualInvestmentProductList(requestParameters) {
436
- return this.marketDataApi.getDualInvestmentProductList(requestParameters);
437
- }
438
- /**
439
- * Change Auto-Compound status
440
- *
441
- * Weight: 1(IP)
442
- *
443
- * @summary Change Auto-Compound status(USER_DATA)
444
- * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.
445
- *
446
- * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}
447
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
448
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}
449
- */
450
- changeAutoCompoundStatus(requestParameters) {
451
- return this.tradeApi.changeAutoCompoundStatus(requestParameters);
452
- }
453
- /**
454
- * Check Dual Investment accounts
455
- *
456
- * Weight: 1(IP)
457
- *
458
- * @summary Check Dual Investment accounts(USER_DATA)
459
- * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.
460
- *
461
- * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}
462
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
463
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}
464
- */
465
- checkDualInvestmentAccounts(requestParameters = {}) {
466
- return this.tradeApi.checkDualInvestmentAccounts(requestParameters);
467
- }
468
- /**
469
- * Get Dual Investment positions (batch)
470
- *
471
- * Weight: 1(IP)
472
- *
473
- * @summary Get Dual Investment positions(USER_DATA)
474
- * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.
475
- *
476
- * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}
477
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
478
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}
479
- */
480
- getDualInvestmentPositions(requestParameters = {}) {
481
- return this.tradeApi.getDualInvestmentPositions(requestParameters);
482
- }
483
- /**
484
- * Subscribe Dual Investment products
485
- *
486
- * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
487
- * Failed. This means System or network errors.
488
- *
489
- * Weight: 1(IP)
490
- *
491
- * @summary Subscribe Dual Investment products(USER_DATA)
492
- * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.
493
- *
494
- * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}
495
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
496
- * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}
497
- */
498
- subscribeDualInvestmentProducts(requestParameters) {
499
- return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);
500
- }
250
+ constructor(configuration) {
251
+ this.configuration = configuration;
252
+ this.marketDataApi = new MarketDataApi(configuration);
253
+ this.tradeApi = new TradeApi(configuration);
254
+ }
255
+ /**
256
+ * Generic function to send a request.
257
+ * @param endpoint - The API endpoint to call.
258
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
259
+ * @param params - Query parameters for the request.
260
+ *
261
+ * @returns A promise resolving to the response data object.
262
+ */
263
+ sendRequest(endpoint, method, params = {}) {
264
+ return sendRequest(this.configuration, endpoint, method, params, void 0);
265
+ }
266
+ /**
267
+ * Generic function to send a signed request.
268
+ * @param endpoint - The API endpoint to call.
269
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
270
+ * @param params - Query parameters for the request.
271
+ *
272
+ * @returns A promise resolving to the response data object.
273
+ */
274
+ sendSignedRequest(endpoint, method, params = {}) {
275
+ return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
276
+ }
277
+ /**
278
+ * Get Dual Investment product list
279
+ *
280
+ * Weight: 1(IP)
281
+ *
282
+ * @summary Get Dual Investment product list
283
+ * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.
284
+ *
285
+ * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}
286
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
287
+ * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}
288
+ */
289
+ getDualInvestmentProductList(requestParameters) {
290
+ return this.marketDataApi.getDualInvestmentProductList(requestParameters);
291
+ }
292
+ /**
293
+ * Change Auto-Compound status
294
+ *
295
+ * Weight: 1(IP)
296
+ *
297
+ * @summary Change Auto-Compound status(USER_DATA)
298
+ * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.
299
+ *
300
+ * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}
301
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
302
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}
303
+ */
304
+ changeAutoCompoundStatus(requestParameters) {
305
+ return this.tradeApi.changeAutoCompoundStatus(requestParameters);
306
+ }
307
+ /**
308
+ * Check Dual Investment accounts
309
+ *
310
+ * Weight: 1(IP)
311
+ *
312
+ * @summary Check Dual Investment accounts(USER_DATA)
313
+ * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.
314
+ *
315
+ * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}
316
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
317
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}
318
+ */
319
+ checkDualInvestmentAccounts(requestParameters = {}) {
320
+ return this.tradeApi.checkDualInvestmentAccounts(requestParameters);
321
+ }
322
+ /**
323
+ * Get Dual Investment positions (batch)
324
+ *
325
+ * Weight: 1(IP)
326
+ *
327
+ * @summary Get Dual Investment positions(USER_DATA)
328
+ * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.
329
+ *
330
+ * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}
331
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
332
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}
333
+ */
334
+ getDualInvestmentPositions(requestParameters = {}) {
335
+ return this.tradeApi.getDualInvestmentPositions(requestParameters);
336
+ }
337
+ /**
338
+ * Subscribe Dual Investment products
339
+ *
340
+ * Products are not available. // this means APR changes to lower value, or orders are not unavailable.
341
+ * Failed. This means System or network errors.
342
+ *
343
+ * Weight: 1(IP)
344
+ *
345
+ * @summary Subscribe Dual Investment products(USER_DATA)
346
+ * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.
347
+ *
348
+ * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}
349
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
350
+ * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}
351
+ */
352
+ subscribeDualInvestmentProducts(requestParameters) {
353
+ return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);
354
+ }
501
355
  };
502
356
 
503
- // src/dual-investment.ts
357
+ //#endregion
358
+ //#region src/rest-api/index.ts
359
+ var rest_api_exports = /* @__PURE__ */ __export({
360
+ MarketDataApi: () => MarketDataApi,
361
+ RestAPI: () => RestAPI,
362
+ TradeApi: () => TradeApi
363
+ });
364
+
365
+ //#endregion
366
+ //#region src/dual-investment.ts
504
367
  var DualInvestment = class {
505
- constructor(config) {
506
- const userAgent = buildUserAgent(name, version);
507
- if (config?.configurationRestAPI) {
508
- const configRestAPI = new ConfigurationRestAPI4(
509
- config.configurationRestAPI
510
- );
511
- configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL;
512
- configRestAPI.baseOptions = configRestAPI.baseOptions || {};
513
- configRestAPI.baseOptions.headers = {
514
- ...configRestAPI.baseOptions.headers || {},
515
- "User-Agent": userAgent
516
- };
517
- this.restAPI = new RestAPI(configRestAPI);
518
- }
519
- }
368
+ constructor(config) {
369
+ const userAgent = buildUserAgent(name, version);
370
+ if (config?.configurationRestAPI) {
371
+ const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);
372
+ configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL$1;
373
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
374
+ configRestAPI.baseOptions.headers = {
375
+ ...configRestAPI.baseOptions.headers || {},
376
+ "User-Agent": userAgent
377
+ };
378
+ this.restAPI = new RestAPI(configRestAPI);
379
+ }
380
+ }
520
381
  };
521
382
 
522
- // src/index.ts
523
- import {
524
- DUAL_INVESTMENT_REST_API_PROD_URL as DUAL_INVESTMENT_REST_API_PROD_URL2,
525
- ConnectorClientError,
526
- RequiredError,
527
- UnauthorizedError,
528
- ForbiddenError,
529
- TooManyRequestsError,
530
- RateLimitBanError,
531
- ServerError,
532
- NetworkError,
533
- NotFoundError,
534
- BadRequestError
535
- } from "@binance/common";
536
- export {
537
- BadRequestError,
538
- ConnectorClientError,
539
- DUAL_INVESTMENT_REST_API_PROD_URL2 as DUAL_INVESTMENT_REST_API_PROD_URL,
540
- DualInvestment,
541
- rest_api_exports as DualInvestmentRestAPI,
542
- ForbiddenError,
543
- NetworkError,
544
- NotFoundError,
545
- RateLimitBanError,
546
- RequiredError,
547
- ServerError,
548
- TooManyRequestsError,
549
- UnauthorizedError
550
- };
383
+ //#endregion
384
+ export { BadRequestError, ConfigurationDualInvestment, ConnectorClientError, DUAL_INVESTMENT_REST_API_PROD_URL, DualInvestment, rest_api_exports as DualInvestmentRestAPI, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
551
385
  //# sourceMappingURL=index.mjs.map