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