@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/chunk.mjs +13 -0
- package/dist/index.d.mts +678 -765
- package/dist/index.d.ts +680 -765
- package/dist/index.js +447 -535
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +367 -533
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,551 +1,385 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
4
|
+
//#region package.json
|
|
15
5
|
var name = "@binance/dual-investment";
|
|
16
|
-
var version = "4.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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
-
|
|
392
|
-
|
|
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
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
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
|
-
|
|
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
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
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
|
-
|
|
523
|
-
|
|
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
|