@binance/dual-investment 4.0.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +29 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -749,20 +749,22 @@ declare class RestAPI {
|
|
|
749
749
|
* Generic function to send a request.
|
|
750
750
|
* @param endpoint - The API endpoint to call.
|
|
751
751
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
752
|
-
* @param
|
|
752
|
+
* @param queryParams - Query parameters for the request.
|
|
753
|
+
* @param bodyParams - Body parameters for the request.
|
|
753
754
|
*
|
|
754
755
|
* @returns A promise resolving to the response data object.
|
|
755
756
|
*/
|
|
756
|
-
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
757
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
757
758
|
/**
|
|
758
759
|
* Generic function to send a signed request.
|
|
759
760
|
* @param endpoint - The API endpoint to call.
|
|
760
761
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
761
|
-
* @param
|
|
762
|
+
* @param queryParams - Query parameters for the request.
|
|
763
|
+
* @param bodyParams - Body parameters for the request.
|
|
762
764
|
*
|
|
763
765
|
* @returns A promise resolving to the response data object.
|
|
764
766
|
*/
|
|
765
|
-
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
767
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
766
768
|
/**
|
|
767
769
|
* Get Dual Investment product list
|
|
768
770
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -751,20 +751,22 @@ declare class RestAPI {
|
|
|
751
751
|
* Generic function to send a request.
|
|
752
752
|
* @param endpoint - The API endpoint to call.
|
|
753
753
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
754
|
-
* @param
|
|
754
|
+
* @param queryParams - Query parameters for the request.
|
|
755
|
+
* @param bodyParams - Body parameters for the request.
|
|
755
756
|
*
|
|
756
757
|
* @returns A promise resolving to the response data object.
|
|
757
758
|
*/
|
|
758
|
-
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
759
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
759
760
|
/**
|
|
760
761
|
* Generic function to send a signed request.
|
|
761
762
|
* @param endpoint - The API endpoint to call.
|
|
762
763
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
763
|
-
* @param
|
|
764
|
+
* @param queryParams - Query parameters for the request.
|
|
765
|
+
* @param bodyParams - Body parameters for the request.
|
|
764
766
|
*
|
|
765
767
|
* @returns A promise resolving to the response data object.
|
|
766
768
|
*/
|
|
767
|
-
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',
|
|
769
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', queryParams?: Record<string, unknown>, bodyParams?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
768
770
|
/**
|
|
769
771
|
* Get Dual Investment product list
|
|
770
772
|
*
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ let __binance_common = require("@binance/common");
|
|
|
14
14
|
|
|
15
15
|
//#region package.json
|
|
16
16
|
var name = "@binance/dual-investment";
|
|
17
|
-
var version = "4.0
|
|
17
|
+
var version = "4.1.0";
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/rest-api/modules/market-data-api.ts
|
|
@@ -39,6 +39,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
|
39
39
|
(0, __binance_common.assertParamExists)("getDualInvestmentProductList", "exercisedCoin", exercisedCoin);
|
|
40
40
|
(0, __binance_common.assertParamExists)("getDualInvestmentProductList", "investCoin", investCoin);
|
|
41
41
|
const localVarQueryParameter = {};
|
|
42
|
+
const localVarBodyParameter = {};
|
|
42
43
|
if (optionType !== void 0 && optionType !== null) localVarQueryParameter["optionType"] = optionType;
|
|
43
44
|
if (exercisedCoin !== void 0 && exercisedCoin !== null) localVarQueryParameter["exercisedCoin"] = exercisedCoin;
|
|
44
45
|
if (investCoin !== void 0 && investCoin !== null) localVarQueryParameter["investCoin"] = investCoin;
|
|
@@ -50,7 +51,8 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
|
50
51
|
return {
|
|
51
52
|
endpoint: "/sapi/v1/dci/product/list",
|
|
52
53
|
method: "GET",
|
|
53
|
-
|
|
54
|
+
queryParams: localVarQueryParameter,
|
|
55
|
+
bodyParams: localVarBodyParameter,
|
|
54
56
|
timeUnit: _timeUnit
|
|
55
57
|
};
|
|
56
58
|
} };
|
|
@@ -78,7 +80,7 @@ var MarketDataApi = class {
|
|
|
78
80
|
*/
|
|
79
81
|
async getDualInvestmentProductList(requestParameters) {
|
|
80
82
|
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.
|
|
83
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
82
84
|
}
|
|
83
85
|
};
|
|
84
86
|
|
|
@@ -104,6 +106,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
104
106
|
changeAutoCompoundStatus: async (positionId, autoCompoundPlan, recvWindow) => {
|
|
105
107
|
(0, __binance_common.assertParamExists)("changeAutoCompoundStatus", "positionId", positionId);
|
|
106
108
|
const localVarQueryParameter = {};
|
|
109
|
+
const localVarBodyParameter = {};
|
|
107
110
|
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
|
|
108
111
|
if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) localVarQueryParameter["AutoCompoundPlan"] = autoCompoundPlan;
|
|
109
112
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
@@ -112,24 +115,28 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
112
115
|
return {
|
|
113
116
|
endpoint: "/sapi/v1/dci/product/auto_compound/edit-status",
|
|
114
117
|
method: "POST",
|
|
115
|
-
|
|
118
|
+
queryParams: localVarQueryParameter,
|
|
119
|
+
bodyParams: localVarBodyParameter,
|
|
116
120
|
timeUnit: _timeUnit
|
|
117
121
|
};
|
|
118
122
|
},
|
|
119
123
|
checkDualInvestmentAccounts: async (recvWindow) => {
|
|
120
124
|
const localVarQueryParameter = {};
|
|
125
|
+
const localVarBodyParameter = {};
|
|
121
126
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
122
127
|
let _timeUnit;
|
|
123
128
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
124
129
|
return {
|
|
125
130
|
endpoint: "/sapi/v1/dci/product/accounts",
|
|
126
131
|
method: "GET",
|
|
127
|
-
|
|
132
|
+
queryParams: localVarQueryParameter,
|
|
133
|
+
bodyParams: localVarBodyParameter,
|
|
128
134
|
timeUnit: _timeUnit
|
|
129
135
|
};
|
|
130
136
|
},
|
|
131
137
|
getDualInvestmentPositions: async (status, pageSize, pageIndex, recvWindow) => {
|
|
132
138
|
const localVarQueryParameter = {};
|
|
139
|
+
const localVarBodyParameter = {};
|
|
133
140
|
if (status !== void 0 && status !== null) localVarQueryParameter["status"] = status;
|
|
134
141
|
if (pageSize !== void 0 && pageSize !== null) localVarQueryParameter["pageSize"] = pageSize;
|
|
135
142
|
if (pageIndex !== void 0 && pageIndex !== null) localVarQueryParameter["pageIndex"] = pageIndex;
|
|
@@ -139,7 +146,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
139
146
|
return {
|
|
140
147
|
endpoint: "/sapi/v1/dci/product/positions",
|
|
141
148
|
method: "GET",
|
|
142
|
-
|
|
149
|
+
queryParams: localVarQueryParameter,
|
|
150
|
+
bodyParams: localVarBodyParameter,
|
|
143
151
|
timeUnit: _timeUnit
|
|
144
152
|
};
|
|
145
153
|
},
|
|
@@ -149,6 +157,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
149
157
|
(0, __binance_common.assertParamExists)("subscribeDualInvestmentProducts", "depositAmount", depositAmount);
|
|
150
158
|
(0, __binance_common.assertParamExists)("subscribeDualInvestmentProducts", "autoCompoundPlan", autoCompoundPlan);
|
|
151
159
|
const localVarQueryParameter = {};
|
|
160
|
+
const localVarBodyParameter = {};
|
|
152
161
|
if (id !== void 0 && id !== null) localVarQueryParameter["id"] = id;
|
|
153
162
|
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
154
163
|
if (depositAmount !== void 0 && depositAmount !== null) localVarQueryParameter["depositAmount"] = depositAmount;
|
|
@@ -159,7 +168,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
159
168
|
return {
|
|
160
169
|
endpoint: "/sapi/v1/dci/product/subscribe",
|
|
161
170
|
method: "POST",
|
|
162
|
-
|
|
171
|
+
queryParams: localVarQueryParameter,
|
|
172
|
+
bodyParams: localVarBodyParameter,
|
|
163
173
|
timeUnit: _timeUnit
|
|
164
174
|
};
|
|
165
175
|
}
|
|
@@ -188,7 +198,7 @@ var TradeApi = class {
|
|
|
188
198
|
*/
|
|
189
199
|
async changeAutoCompoundStatus(requestParameters) {
|
|
190
200
|
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.
|
|
201
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
192
202
|
}
|
|
193
203
|
/**
|
|
194
204
|
* Check Dual Investment accounts
|
|
@@ -204,7 +214,7 @@ var TradeApi = class {
|
|
|
204
214
|
*/
|
|
205
215
|
async checkDualInvestmentAccounts(requestParameters = {}) {
|
|
206
216
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(requestParameters?.recvWindow);
|
|
207
|
-
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
217
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
208
218
|
}
|
|
209
219
|
/**
|
|
210
220
|
* Get Dual Investment positions (batch)
|
|
@@ -220,7 +230,7 @@ var TradeApi = class {
|
|
|
220
230
|
*/
|
|
221
231
|
async getDualInvestmentPositions(requestParameters = {}) {
|
|
222
232
|
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.
|
|
233
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
224
234
|
}
|
|
225
235
|
/**
|
|
226
236
|
* Subscribe Dual Investment products
|
|
@@ -239,7 +249,7 @@ var TradeApi = class {
|
|
|
239
249
|
*/
|
|
240
250
|
async subscribeDualInvestmentProducts(requestParameters) {
|
|
241
251
|
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.
|
|
252
|
+
return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
243
253
|
}
|
|
244
254
|
};
|
|
245
255
|
|
|
@@ -267,23 +277,25 @@ var RestAPI = class {
|
|
|
267
277
|
* Generic function to send a request.
|
|
268
278
|
* @param endpoint - The API endpoint to call.
|
|
269
279
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
270
|
-
* @param
|
|
280
|
+
* @param queryParams - Query parameters for the request.
|
|
281
|
+
* @param bodyParams - Body parameters for the request.
|
|
271
282
|
*
|
|
272
283
|
* @returns A promise resolving to the response data object.
|
|
273
284
|
*/
|
|
274
|
-
sendRequest(endpoint, method,
|
|
275
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method,
|
|
285
|
+
sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
286
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
|
|
276
287
|
}
|
|
277
288
|
/**
|
|
278
289
|
* Generic function to send a signed request.
|
|
279
290
|
* @param endpoint - The API endpoint to call.
|
|
280
291
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
281
|
-
* @param
|
|
292
|
+
* @param queryParams - Query parameters for the request.
|
|
293
|
+
* @param bodyParams - Body parameters for the request.
|
|
282
294
|
*
|
|
283
295
|
* @returns A promise resolving to the response data object.
|
|
284
296
|
*/
|
|
285
|
-
sendSignedRequest(endpoint, method,
|
|
286
|
-
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method,
|
|
297
|
+
sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
298
|
+
return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
|
|
287
299
|
}
|
|
288
300
|
/**
|
|
289
301
|
* Get Dual Investment product list
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","DUAL_INVESTMENT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/dual-investment.ts"],"sourcesContent":["{\n \"name\": \"@binance/dual-investment\",\n \"description\": \"Official Binance Dual Investment Connector - A lightweight library that provides a convenient interface to Binance's Dual Investment REST API.\",\n \"version\": \"4.0.3\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Dual Investment\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.0.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetDualInvestmentProductListResponse } from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {string} optionType Input CALL or PUT\n * @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\n * @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\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentProductList: async (\n optionType: string,\n exercisedCoin: string,\n investCoin: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'optionType' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'optionType', optionType);\n // verify required parameter 'exercisedCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'exercisedCoin', exercisedCoin);\n // verify required parameter 'investCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'investCoin', investCoin);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (optionType !== undefined && optionType !== null) {\n localVarQueryParameter['optionType'] = optionType;\n }\n\n if (exercisedCoin !== undefined && exercisedCoin !== null) {\n localVarQueryParameter['exercisedCoin'] = exercisedCoin;\n }\n\n if (investCoin !== undefined && investCoin !== null) {\n localVarQueryParameter['investCoin'] = investCoin;\n }\n\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/list',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>>;\n}\n\n/**\n * Request parameters for getDualInvestmentProductList operation in MarketDataApi.\n * @interface GetDualInvestmentProductListRequest\n */\nexport interface GetDualInvestmentProductListRequest {\n /**\n * Input CALL or PUT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly optionType: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly exercisedCoin: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly investCoin: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n public async getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(\n requestParameters?.optionType,\n requestParameters?.exercisedCoin,\n requestParameters?.investCoin,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentProductListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`\n * @param {string} [autoCompoundPlan]\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n changeAutoCompoundStatus: async (\n positionId: string,\n autoCompoundPlan?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'positionId' is not null or undefined\n assertParamExists('changeAutoCompoundStatus', 'positionId', positionId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (positionId !== undefined && positionId !== null) {\n localVarQueryParameter['positionId'] = positionId;\n }\n\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['AutoCompoundPlan'] = autoCompoundPlan;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/auto_compound/edit-status',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n checkDualInvestmentAccounts: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/accounts',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @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.\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentPositions: async (\n status?: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (status !== undefined && status !== null) {\n localVarQueryParameter['status'] = status;\n }\n\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/positions',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {string} id get id from `/sapi/v1/dci/product/list`\n * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`\n * @param {number} depositAmount the amount for subscribing\n * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n subscribeDualInvestmentProducts: async (\n id: string,\n orderId: string,\n depositAmount: number,\n autoCompoundPlan: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'id', id);\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'orderId', orderId);\n // verify required parameter 'depositAmount' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'depositAmount', depositAmount);\n // verify required parameter 'autoCompoundPlan' is not null or undefined\n assertParamExists(\n 'subscribeDualInvestmentProducts',\n 'autoCompoundPlan',\n autoCompoundPlan\n );\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (id !== undefined && id !== null) {\n localVarQueryParameter['id'] = id;\n }\n\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n\n if (depositAmount !== undefined && depositAmount !== null) {\n localVarQueryParameter['depositAmount'] = depositAmount;\n }\n\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['autoCompoundPlan'] = autoCompoundPlan;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/subscribe',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>;\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n checkDualInvestmentAccounts(\n requestParameters?: CheckDualInvestmentAccountsRequest\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>;\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getDualInvestmentPositions(\n requestParameters?: GetDualInvestmentPositionsRequest\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>;\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>;\n}\n\n/**\n * Request parameters for changeAutoCompoundStatus operation in TradeApi.\n * @interface ChangeAutoCompoundStatusRequest\n */\nexport interface ChangeAutoCompoundStatusRequest {\n /**\n * Get positionId from `/sapi/v1/dci/product/positions`\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly positionId: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly autoCompoundPlan?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for checkDualInvestmentAccounts operation in TradeApi.\n * @interface CheckDualInvestmentAccountsRequest\n */\nexport interface CheckDualInvestmentAccountsRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiCheckDualInvestmentAccounts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getDualInvestmentPositions operation in TradeApi.\n * @interface GetDualInvestmentPositionsRequest\n */\nexport interface GetDualInvestmentPositionsRequest {\n /**\n * `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.\n * @type {string}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly status?: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for subscribeDualInvestmentProducts operation in TradeApi.\n * @interface SubscribeDualInvestmentProductsRequest\n */\nexport interface SubscribeDualInvestmentProductsRequest {\n /**\n * get id from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly id: string;\n\n /**\n * get orderId from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly orderId: string;\n\n /**\n * the amount for subscribing\n * @type {number}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly depositAmount: number;\n\n /**\n * `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly autoCompoundPlan: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n public async changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(\n requestParameters?.positionId,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<ChangeAutoCompoundStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n public async checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(\n requestParameters?.recvWindow\n );\n return sendRequest<CheckDualInvestmentAccountsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n public async getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(\n requestParameters?.status,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentPositionsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n public async subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(\n requestParameters?.id,\n requestParameters?.orderId,\n requestParameters?.depositAmount,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<SubscribeDualInvestmentProductsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListRequest } from './modules/market-data-api';\nimport type {\n ChangeAutoCompoundStatusRequest,\n CheckDualInvestmentAccountsRequest,\n GetDualInvestmentPositionsRequest,\n SubscribeDualInvestmentProductsRequest,\n} from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListResponse } from './types';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined, {\n isSigned: true,\n });\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n return this.marketDataApi.getDualInvestmentProductList(requestParameters);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n return this.tradeApi.changeAutoCompoundStatus(requestParameters);\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n return this.tradeApi.checkDualInvestmentAccounts(requestParameters);\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n return this.tradeApi.getDualInvestmentPositions(requestParameters);\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import {\n buildUserAgent,\n ConfigurationRestAPI,\n DUAL_INVESTMENT_REST_API_PROD_URL,\n} from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationDualInvestment {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class DualInvestment {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationDualInvestment) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACuBf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO,EAgBH,8BAA8B,OAC1B,YACA,eACA,YACA,UACA,WACA,eACuB;AAEvB,0CAAkB,gCAAgC,cAAc,WAAW;AAE3E,0CAAkB,gCAAgC,iBAAiB,cAAc;AAEjF,0CAAkB,gCAAgC,cAAc,WAAW;EAE3E,MAAMA,yBAAkD,EAAE;AAE1D,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAG3C,MAAI,kBAAkB,UAAa,kBAAkB,KACjD,wBAAuB,mBAAmB;AAG9C,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAG3C,MAAI,aAAa,UAAa,aAAa,KACvC,wBAAuB,cAAc;AAGzC,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAG1C,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,QAAQ;GACR,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,gBAAb,MAA6D;CAIzD,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,+BAA+B,cAAc;;;;;;;;;;;;;;CAelF,MAAa,6BACT,mBAC8D;EAC9D,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,6BAC3D,mBAAmB,YACnB,mBAAmB,eACnB,mBAAmB,YACnB,mBAAmB,UACnB,mBAAmB,WACnB,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,k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Aa,iBAAb,MAA4B;CAGxB,YAAY,QAAqC;EAC7C,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","DUAL_INVESTMENT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/dual-investment.ts"],"sourcesContent":["{\n \"name\": \"@binance/dual-investment\",\n \"description\": \"Official Binance Dual Investment Connector - A lightweight library that provides a convenient interface to Binance's Dual Investment REST API.\",\n \"version\": \"4.1.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Dual Investment\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.1.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetDualInvestmentProductListResponse } from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {string} optionType Input CALL or PUT\n * @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\n * @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\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentProductList: async (\n optionType: string,\n exercisedCoin: string,\n investCoin: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'optionType' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'optionType', optionType);\n // verify required parameter 'exercisedCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'exercisedCoin', exercisedCoin);\n // verify required parameter 'investCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'investCoin', investCoin);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (optionType !== undefined && optionType !== null) {\n localVarQueryParameter['optionType'] = optionType;\n }\n if (exercisedCoin !== undefined && exercisedCoin !== null) {\n localVarQueryParameter['exercisedCoin'] = exercisedCoin;\n }\n if (investCoin !== undefined && investCoin !== null) {\n localVarQueryParameter['investCoin'] = investCoin;\n }\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/list',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>>;\n}\n\n/**\n * Request parameters for getDualInvestmentProductList operation in MarketDataApi.\n * @interface GetDualInvestmentProductListRequest\n */\nexport interface GetDualInvestmentProductListRequest {\n /**\n * Input CALL or PUT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly optionType: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly exercisedCoin: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly investCoin: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n public async getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(\n requestParameters?.optionType,\n requestParameters?.exercisedCoin,\n requestParameters?.investCoin,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentProductListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`\n * @param {string} [autoCompoundPlan]\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n changeAutoCompoundStatus: async (\n positionId: string,\n autoCompoundPlan?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'positionId' is not null or undefined\n assertParamExists('changeAutoCompoundStatus', 'positionId', positionId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (positionId !== undefined && positionId !== null) {\n localVarQueryParameter['positionId'] = positionId;\n }\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['AutoCompoundPlan'] = autoCompoundPlan;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/auto_compound/edit-status',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n checkDualInvestmentAccounts: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/accounts',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @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.\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentPositions: async (\n status?: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (status !== undefined && status !== null) {\n localVarQueryParameter['status'] = status;\n }\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/positions',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {string} id get id from `/sapi/v1/dci/product/list`\n * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`\n * @param {number} depositAmount the amount for subscribing\n * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n subscribeDualInvestmentProducts: async (\n id: string,\n orderId: string,\n depositAmount: number,\n autoCompoundPlan: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'id', id);\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'orderId', orderId);\n // verify required parameter 'depositAmount' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'depositAmount', depositAmount);\n // verify required parameter 'autoCompoundPlan' is not null or undefined\n assertParamExists(\n 'subscribeDualInvestmentProducts',\n 'autoCompoundPlan',\n autoCompoundPlan\n );\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (id !== undefined && id !== null) {\n localVarQueryParameter['id'] = id;\n }\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n if (depositAmount !== undefined && depositAmount !== null) {\n localVarQueryParameter['depositAmount'] = depositAmount;\n }\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['autoCompoundPlan'] = autoCompoundPlan;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/subscribe',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>;\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n checkDualInvestmentAccounts(\n requestParameters?: CheckDualInvestmentAccountsRequest\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>;\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getDualInvestmentPositions(\n requestParameters?: GetDualInvestmentPositionsRequest\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>;\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>;\n}\n\n/**\n * Request parameters for changeAutoCompoundStatus operation in TradeApi.\n * @interface ChangeAutoCompoundStatusRequest\n */\nexport interface ChangeAutoCompoundStatusRequest {\n /**\n * Get positionId from `/sapi/v1/dci/product/positions`\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly positionId: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly autoCompoundPlan?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for checkDualInvestmentAccounts operation in TradeApi.\n * @interface CheckDualInvestmentAccountsRequest\n */\nexport interface CheckDualInvestmentAccountsRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiCheckDualInvestmentAccounts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getDualInvestmentPositions operation in TradeApi.\n * @interface GetDualInvestmentPositionsRequest\n */\nexport interface GetDualInvestmentPositionsRequest {\n /**\n * `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.\n * @type {string}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly status?: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for subscribeDualInvestmentProducts operation in TradeApi.\n * @interface SubscribeDualInvestmentProductsRequest\n */\nexport interface SubscribeDualInvestmentProductsRequest {\n /**\n * get id from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly id: string;\n\n /**\n * get orderId from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly orderId: string;\n\n /**\n * the amount for subscribing\n * @type {number}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly depositAmount: number;\n\n /**\n * `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly autoCompoundPlan: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n public async changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(\n requestParameters?.positionId,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<ChangeAutoCompoundStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n public async checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(\n requestParameters?.recvWindow\n );\n return sendRequest<CheckDualInvestmentAccountsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n public async getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(\n requestParameters?.status,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentPositionsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n public async subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(\n requestParameters?.id,\n requestParameters?.orderId,\n requestParameters?.depositAmount,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<SubscribeDualInvestmentProductsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListRequest } from './modules/market-data-api';\nimport type {\n ChangeAutoCompoundStatusRequest,\n CheckDualInvestmentAccountsRequest,\n GetDualInvestmentPositionsRequest,\n SubscribeDualInvestmentProductsRequest,\n} from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListResponse } from './types';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n return this.marketDataApi.getDualInvestmentProductList(requestParameters);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n return this.tradeApi.changeAutoCompoundStatus(requestParameters);\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n return this.tradeApi.checkDualInvestmentAccounts(requestParameters);\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n return this.tradeApi.getDualInvestmentPositions(requestParameters);\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import {\n buildUserAgent,\n ConfigurationRestAPI,\n DUAL_INVESTMENT_REST_API_PROD_URL,\n} from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationDualInvestment {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class DualInvestment {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationDualInvestment) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACuBf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO,EAgBH,8BAA8B,OAC1B,YACA,eACA,YACA,UACA,WACA,eACuB;AAEvB,0CAAkB,gCAAgC,cAAc,WAAW;AAE3E,0CAAkB,gCAAgC,iBAAiB,cAAc;AAEjF,0CAAkB,gCAAgC,cAAc,WAAW;EAE3E,MAAMA,yBAAkD,EAAE;EAC1D,MAAMC,wBAAiD,EAAE;AAEzD,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAE3C,MAAI,kBAAkB,UAAa,kBAAkB,KACjD,wBAAuB,mBAAmB;AAE9C,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAE3C,MAAI,aAAa,UAAa,aAAa,KACvC,wBAAuB,cAAc;AAEzC,MAAI,cAAc,UAAa,cAAc,KACzC,wBAAuB,eAAe;AAE1C,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;EAG3C,IAAIC;AACJ,MAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,SAAO;GACH,UAAU;GACV,QAAQ;GACR,aAAa;GACb,YAAY;GACZ,UAAU;GACb;IAER;;;;;;AA4EL,IAAa,gBAAb,MAA6D;CAIzD,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,+BAA+B,cAAc;;;;;;;;;;;;;;CAelF,MAAa,6BACT,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AAM,CACrB;;;;;;;;;;;;;;CAeL,6BACI,mBAC8D;AAC9D,SAAO,KAAK,cAAc,6BAA6B,kBAAkB;;;;;;;;;;;;;;CAe7E,yBACI,mBAC0D;AAC1D,SAAO,KAAK,SAAS,yBAAyB,kBAAkB;;;;;;;;;;;;;;CAepE,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,SAAS,4BAA4B,kBAAkB;;;;;;;;;;;;;;CAevE,2BACI,oBAAuD,EAAE,EACG;AAC5D,SAAO,KAAK,SAAS,2BAA2B,kBAAkB;;;;;;;;;;;;;;;;;CAkBtE,gCACI,mBACiE;AACjE,SAAO,KAAK,SAAS,gCAAgC,kBAAkB;;;;;;;;;;;;;;AE7K/E,IAAa,iBAAb,MAA4B;CAGxB,YAAY,QAAqC;EAC7C,MAAM,iDAA2B,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAIC,sCACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { BadRequestError, ConfigurationRestAPI, ConnectorClientError, DUAL_INVES
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@binance/dual-investment";
|
|
6
|
-
var version = "4.0
|
|
6
|
+
var version = "4.1.0";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/rest-api/modules/market-data-api.ts
|
|
@@ -28,6 +28,7 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
|
28
28
|
assertParamExists("getDualInvestmentProductList", "exercisedCoin", exercisedCoin);
|
|
29
29
|
assertParamExists("getDualInvestmentProductList", "investCoin", investCoin);
|
|
30
30
|
const localVarQueryParameter = {};
|
|
31
|
+
const localVarBodyParameter = {};
|
|
31
32
|
if (optionType !== void 0 && optionType !== null) localVarQueryParameter["optionType"] = optionType;
|
|
32
33
|
if (exercisedCoin !== void 0 && exercisedCoin !== null) localVarQueryParameter["exercisedCoin"] = exercisedCoin;
|
|
33
34
|
if (investCoin !== void 0 && investCoin !== null) localVarQueryParameter["investCoin"] = investCoin;
|
|
@@ -39,7 +40,8 @@ const MarketDataApiAxiosParamCreator = function(configuration) {
|
|
|
39
40
|
return {
|
|
40
41
|
endpoint: "/sapi/v1/dci/product/list",
|
|
41
42
|
method: "GET",
|
|
42
|
-
|
|
43
|
+
queryParams: localVarQueryParameter,
|
|
44
|
+
bodyParams: localVarBodyParameter,
|
|
43
45
|
timeUnit: _timeUnit
|
|
44
46
|
};
|
|
45
47
|
} };
|
|
@@ -67,7 +69,7 @@ var MarketDataApi = class {
|
|
|
67
69
|
*/
|
|
68
70
|
async getDualInvestmentProductList(requestParameters) {
|
|
69
71
|
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.
|
|
72
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
75
|
|
|
@@ -93,6 +95,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
93
95
|
changeAutoCompoundStatus: async (positionId, autoCompoundPlan, recvWindow) => {
|
|
94
96
|
assertParamExists("changeAutoCompoundStatus", "positionId", positionId);
|
|
95
97
|
const localVarQueryParameter = {};
|
|
98
|
+
const localVarBodyParameter = {};
|
|
96
99
|
if (positionId !== void 0 && positionId !== null) localVarQueryParameter["positionId"] = positionId;
|
|
97
100
|
if (autoCompoundPlan !== void 0 && autoCompoundPlan !== null) localVarQueryParameter["AutoCompoundPlan"] = autoCompoundPlan;
|
|
98
101
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
@@ -101,24 +104,28 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
101
104
|
return {
|
|
102
105
|
endpoint: "/sapi/v1/dci/product/auto_compound/edit-status",
|
|
103
106
|
method: "POST",
|
|
104
|
-
|
|
107
|
+
queryParams: localVarQueryParameter,
|
|
108
|
+
bodyParams: localVarBodyParameter,
|
|
105
109
|
timeUnit: _timeUnit
|
|
106
110
|
};
|
|
107
111
|
},
|
|
108
112
|
checkDualInvestmentAccounts: async (recvWindow) => {
|
|
109
113
|
const localVarQueryParameter = {};
|
|
114
|
+
const localVarBodyParameter = {};
|
|
110
115
|
if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
|
|
111
116
|
let _timeUnit;
|
|
112
117
|
if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
|
|
113
118
|
return {
|
|
114
119
|
endpoint: "/sapi/v1/dci/product/accounts",
|
|
115
120
|
method: "GET",
|
|
116
|
-
|
|
121
|
+
queryParams: localVarQueryParameter,
|
|
122
|
+
bodyParams: localVarBodyParameter,
|
|
117
123
|
timeUnit: _timeUnit
|
|
118
124
|
};
|
|
119
125
|
},
|
|
120
126
|
getDualInvestmentPositions: async (status, pageSize, pageIndex, recvWindow) => {
|
|
121
127
|
const localVarQueryParameter = {};
|
|
128
|
+
const localVarBodyParameter = {};
|
|
122
129
|
if (status !== void 0 && status !== null) localVarQueryParameter["status"] = status;
|
|
123
130
|
if (pageSize !== void 0 && pageSize !== null) localVarQueryParameter["pageSize"] = pageSize;
|
|
124
131
|
if (pageIndex !== void 0 && pageIndex !== null) localVarQueryParameter["pageIndex"] = pageIndex;
|
|
@@ -128,7 +135,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
128
135
|
return {
|
|
129
136
|
endpoint: "/sapi/v1/dci/product/positions",
|
|
130
137
|
method: "GET",
|
|
131
|
-
|
|
138
|
+
queryParams: localVarQueryParameter,
|
|
139
|
+
bodyParams: localVarBodyParameter,
|
|
132
140
|
timeUnit: _timeUnit
|
|
133
141
|
};
|
|
134
142
|
},
|
|
@@ -138,6 +146,7 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
138
146
|
assertParamExists("subscribeDualInvestmentProducts", "depositAmount", depositAmount);
|
|
139
147
|
assertParamExists("subscribeDualInvestmentProducts", "autoCompoundPlan", autoCompoundPlan);
|
|
140
148
|
const localVarQueryParameter = {};
|
|
149
|
+
const localVarBodyParameter = {};
|
|
141
150
|
if (id !== void 0 && id !== null) localVarQueryParameter["id"] = id;
|
|
142
151
|
if (orderId !== void 0 && orderId !== null) localVarQueryParameter["orderId"] = orderId;
|
|
143
152
|
if (depositAmount !== void 0 && depositAmount !== null) localVarQueryParameter["depositAmount"] = depositAmount;
|
|
@@ -148,7 +157,8 @@ const TradeApiAxiosParamCreator = function(configuration) {
|
|
|
148
157
|
return {
|
|
149
158
|
endpoint: "/sapi/v1/dci/product/subscribe",
|
|
150
159
|
method: "POST",
|
|
151
|
-
|
|
160
|
+
queryParams: localVarQueryParameter,
|
|
161
|
+
bodyParams: localVarBodyParameter,
|
|
152
162
|
timeUnit: _timeUnit
|
|
153
163
|
};
|
|
154
164
|
}
|
|
@@ -177,7 +187,7 @@ var TradeApi = class {
|
|
|
177
187
|
*/
|
|
178
188
|
async changeAutoCompoundStatus(requestParameters) {
|
|
179
189
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(requestParameters?.positionId, requestParameters?.autoCompoundPlan, requestParameters?.recvWindow);
|
|
180
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
190
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
181
191
|
}
|
|
182
192
|
/**
|
|
183
193
|
* Check Dual Investment accounts
|
|
@@ -193,7 +203,7 @@ var TradeApi = class {
|
|
|
193
203
|
*/
|
|
194
204
|
async checkDualInvestmentAccounts(requestParameters = {}) {
|
|
195
205
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(requestParameters?.recvWindow);
|
|
196
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
206
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
197
207
|
}
|
|
198
208
|
/**
|
|
199
209
|
* Get Dual Investment positions (batch)
|
|
@@ -209,7 +219,7 @@ var TradeApi = class {
|
|
|
209
219
|
*/
|
|
210
220
|
async getDualInvestmentPositions(requestParameters = {}) {
|
|
211
221
|
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(requestParameters?.status, requestParameters?.pageSize, requestParameters?.pageIndex, requestParameters?.recvWindow);
|
|
212
|
-
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.
|
|
222
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
213
223
|
}
|
|
214
224
|
/**
|
|
215
225
|
* Subscribe Dual Investment products
|
|
@@ -228,7 +238,7 @@ var TradeApi = class {
|
|
|
228
238
|
*/
|
|
229
239
|
async subscribeDualInvestmentProducts(requestParameters) {
|
|
230
240
|
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.
|
|
241
|
+
return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.queryParams, localVarAxiosArgs.bodyParams, localVarAxiosArgs?.timeUnit, { isSigned: true });
|
|
232
242
|
}
|
|
233
243
|
};
|
|
234
244
|
|
|
@@ -256,23 +266,25 @@ var RestAPI = class {
|
|
|
256
266
|
* Generic function to send a request.
|
|
257
267
|
* @param endpoint - The API endpoint to call.
|
|
258
268
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
259
|
-
* @param
|
|
269
|
+
* @param queryParams - Query parameters for the request.
|
|
270
|
+
* @param bodyParams - Body parameters for the request.
|
|
260
271
|
*
|
|
261
272
|
* @returns A promise resolving to the response data object.
|
|
262
273
|
*/
|
|
263
|
-
sendRequest(endpoint, method,
|
|
264
|
-
return sendRequest(this.configuration, endpoint, method,
|
|
274
|
+
sendRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
275
|
+
return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0);
|
|
265
276
|
}
|
|
266
277
|
/**
|
|
267
278
|
* Generic function to send a signed request.
|
|
268
279
|
* @param endpoint - The API endpoint to call.
|
|
269
280
|
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
270
|
-
* @param
|
|
281
|
+
* @param queryParams - Query parameters for the request.
|
|
282
|
+
* @param bodyParams - Body parameters for the request.
|
|
271
283
|
*
|
|
272
284
|
* @returns A promise resolving to the response data object.
|
|
273
285
|
*/
|
|
274
|
-
sendSignedRequest(endpoint, method,
|
|
275
|
-
return sendRequest(this.configuration, endpoint, method,
|
|
286
|
+
sendSignedRequest(endpoint, method, queryParams = {}, bodyParams = {}) {
|
|
287
|
+
return sendRequest(this.configuration, endpoint, method, queryParams, bodyParams, void 0, { isSigned: true });
|
|
276
288
|
}
|
|
277
289
|
/**
|
|
278
290
|
* Get Dual Investment product list
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","DUAL_INVESTMENT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/dual-investment.ts"],"sourcesContent":["{\n \"name\": \"@binance/dual-investment\",\n \"description\": \"Official Binance Dual Investment Connector - A lightweight library that provides a convenient interface to Binance's Dual Investment REST API.\",\n \"version\": \"4.0.3\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Dual Investment\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.0.1\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetDualInvestmentProductListResponse } from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {string} optionType Input CALL or PUT\n * @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\n * @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\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentProductList: async (\n optionType: string,\n exercisedCoin: string,\n investCoin: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'optionType' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'optionType', optionType);\n // verify required parameter 'exercisedCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'exercisedCoin', exercisedCoin);\n // verify required parameter 'investCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'investCoin', investCoin);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (optionType !== undefined && optionType !== null) {\n localVarQueryParameter['optionType'] = optionType;\n }\n\n if (exercisedCoin !== undefined && exercisedCoin !== null) {\n localVarQueryParameter['exercisedCoin'] = exercisedCoin;\n }\n\n if (investCoin !== undefined && investCoin !== null) {\n localVarQueryParameter['investCoin'] = investCoin;\n }\n\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/list',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>>;\n}\n\n/**\n * Request parameters for getDualInvestmentProductList operation in MarketDataApi.\n * @interface GetDualInvestmentProductListRequest\n */\nexport interface GetDualInvestmentProductListRequest {\n /**\n * Input CALL or PUT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly optionType: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly exercisedCoin: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly investCoin: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n public async getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(\n requestParameters?.optionType,\n requestParameters?.exercisedCoin,\n requestParameters?.investCoin,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentProductListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`\n * @param {string} [autoCompoundPlan]\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n changeAutoCompoundStatus: async (\n positionId: string,\n autoCompoundPlan?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'positionId' is not null or undefined\n assertParamExists('changeAutoCompoundStatus', 'positionId', positionId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (positionId !== undefined && positionId !== null) {\n localVarQueryParameter['positionId'] = positionId;\n }\n\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['AutoCompoundPlan'] = autoCompoundPlan;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/auto_compound/edit-status',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n checkDualInvestmentAccounts: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/accounts',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @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.\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentPositions: async (\n status?: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (status !== undefined && status !== null) {\n localVarQueryParameter['status'] = status;\n }\n\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/positions',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {string} id get id from `/sapi/v1/dci/product/list`\n * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`\n * @param {number} depositAmount the amount for subscribing\n * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n subscribeDualInvestmentProducts: async (\n id: string,\n orderId: string,\n depositAmount: number,\n autoCompoundPlan: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'id', id);\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'orderId', orderId);\n // verify required parameter 'depositAmount' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'depositAmount', depositAmount);\n // verify required parameter 'autoCompoundPlan' is not null or undefined\n assertParamExists(\n 'subscribeDualInvestmentProducts',\n 'autoCompoundPlan',\n autoCompoundPlan\n );\n\n const localVarQueryParameter: Record<string, unknown> = {};\n\n if (id !== undefined && id !== null) {\n localVarQueryParameter['id'] = id;\n }\n\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n\n if (depositAmount !== undefined && depositAmount !== null) {\n localVarQueryParameter['depositAmount'] = depositAmount;\n }\n\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['autoCompoundPlan'] = autoCompoundPlan;\n }\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/subscribe',\n method: 'POST',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>;\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n checkDualInvestmentAccounts(\n requestParameters?: CheckDualInvestmentAccountsRequest\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>;\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getDualInvestmentPositions(\n requestParameters?: GetDualInvestmentPositionsRequest\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>;\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>;\n}\n\n/**\n * Request parameters for changeAutoCompoundStatus operation in TradeApi.\n * @interface ChangeAutoCompoundStatusRequest\n */\nexport interface ChangeAutoCompoundStatusRequest {\n /**\n * Get positionId from `/sapi/v1/dci/product/positions`\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly positionId: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly autoCompoundPlan?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for checkDualInvestmentAccounts operation in TradeApi.\n * @interface CheckDualInvestmentAccountsRequest\n */\nexport interface CheckDualInvestmentAccountsRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiCheckDualInvestmentAccounts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getDualInvestmentPositions operation in TradeApi.\n * @interface GetDualInvestmentPositionsRequest\n */\nexport interface GetDualInvestmentPositionsRequest {\n /**\n * `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.\n * @type {string}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly status?: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for subscribeDualInvestmentProducts operation in TradeApi.\n * @interface SubscribeDualInvestmentProductsRequest\n */\nexport interface SubscribeDualInvestmentProductsRequest {\n /**\n * get id from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly id: string;\n\n /**\n * get orderId from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly orderId: string;\n\n /**\n * the amount for subscribing\n * @type {number}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly depositAmount: number;\n\n /**\n * `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly autoCompoundPlan: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n public async changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(\n requestParameters?.positionId,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<ChangeAutoCompoundStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n public async checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(\n requestParameters?.recvWindow\n );\n return sendRequest<CheckDualInvestmentAccountsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n public async getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(\n requestParameters?.status,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentPositionsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n public async subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(\n requestParameters?.id,\n requestParameters?.orderId,\n requestParameters?.depositAmount,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<SubscribeDualInvestmentProductsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListRequest } from './modules/market-data-api';\nimport type {\n ChangeAutoCompoundStatusRequest,\n CheckDualInvestmentAccountsRequest,\n GetDualInvestmentPositionsRequest,\n SubscribeDualInvestmentProductsRequest,\n} from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListResponse } from './types';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined);\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param params - Query parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n params: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(this.configuration, endpoint, method, params, undefined, {\n isSigned: true,\n });\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n return this.marketDataApi.getDualInvestmentProductList(requestParameters);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n return this.tradeApi.changeAutoCompoundStatus(requestParameters);\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n return this.tradeApi.checkDualInvestmentAccounts(requestParameters);\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n return this.tradeApi.getDualInvestmentPositions(requestParameters);\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import {\n buildUserAgent,\n ConfigurationRestAPI,\n DUAL_INVESTMENT_REST_API_PROD_URL,\n} from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationDualInvestment {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class DualInvestment {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationDualInvestment) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACuBf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO,EAgBH,8BAA8B,OAC1B,YACA,eACA,YACA,UACA,WACA,eACuB;AAEvB,oBAAkB,gCAAgC,cAAc,WAAW;AAE3E,oBAAkB,gCAAgC,iBAAiB,cAAc;AAEjF,oBAAkB,gCAAgC,cAAc,WAAW;EAE3E,MAAMA,yBAAkD,EAAE;AAE1D,MAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;AAG3C,MAAI,kBAAkB,UAAa,kBAAkB,KACjD,wBAAuB,mBAAmB;AAG9C,MAAI,eAAe,UAAa,eA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;;;CAW/C,YACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,SAAO,YAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,OAAU;;;;;;;;;;CAWlF,kBACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,SAAO,YAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,QAAW,EAC3E,UAAU,MACb,CAAC;;;;;;;;;;;;;;CAeN,6BACI,mBAC8D;AAC9D,SAAO,KAAK,cAAc,6BAA6B,kBAAkB;;;;;;;;;;;;;;CAe7E,yBACI,mBAC0D;AAC1D,SAAO,KAAK,SAAS,yBAAyB,kBAAkB;;;;;;;;;;;;;;CAepE,4BACI,oBAAwD,EAAE,EACG;AAC7D,SAAO,KAAK,SAAS,4BAA4B,kBAAkB;;;;;;;;;;;;;;CAevE,2BACI,oBAAuD,EAAE,EACG;AAC5D,SAAO,KAAK,SAAS,2BAA2B,kBAAkB;;;;;;;;;;;;;;;;;CAkBtE,gCACI,mBACiE;AACjE,SAAO,KAAK,SAAS,gCAAgC,kBAAkB;;;;;;;;;;;;;;AE5J/E,IAAa,iBAAb,MAA4B;CAGxB,YAAY,QAAqC;EAC7C,MAAM,YAAY,eAAe,MAAM,QAAQ;AAE/C,MAAI,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","localVarQueryParameter: Record<string, unknown>","localVarBodyParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","DUAL_INVESTMENT_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/market-data-api.ts","../src/rest-api/modules/trade-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/dual-investment.ts"],"sourcesContent":["{\n \"name\": \"@binance/dual-investment\",\n \"description\": \"Official Binance Dual Investment Connector - A lightweight library that provides a convenient interface to Binance's Dual Investment REST API.\",\n \"version\": \"4.1.0\",\n \"main\": \"./dist/index.js\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"require\": \"./dist/index.js\",\n \"import\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"prepublishOnly\": \"npm run build\",\n \"build\": \"npm run clean && tsdown\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\",\n \"test\": \"npx jest --maxWorkers=4 --bail\",\n \"test:watch\": \"npx jest --watch\",\n \"format\": \"npx prettier --ignore-path .prettierignore --write .\",\n \"lint\": \"npx eslint '**/*.ts' --fix\"\n },\n \"keywords\": [\n \"Binance\",\n \"API\",\n \"Dual Investment\",\n \"Connector\",\n \"REST\",\n \"Trading\"\n ],\n \"author\": \"Binance\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/binance/binance-connector-js.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/binance/binance-connector-js/issues\"\n },\n \"homepage\": \"https://github.com/binance/binance-connector-js#readme\",\n \"files\": [\n \"dist\"\n ],\n \"devDependencies\": {\n \"@types/jest\": \"^29.5.4\",\n \"@types/node\": \"^20.17.24\",\n \"eslint\": \"8.57.0\",\n \"jest\": \"^29.6.4\",\n \"json-with-bigint\": \"^3.4.4\",\n \"prettier\": \"^3.3.3\",\n \"ts-jest\": \"^29.1.1\",\n \"ts-node\": \"^10.9.1\",\n \"tsdown\": \"^0.16.5\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.1.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type { GetDualInvestmentProductListResponse } from '../types';\n\n/**\n * MarketDataApi - axios parameter creator\n */\nconst MarketDataApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {string} optionType Input CALL or PUT\n * @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\n * @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\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentProductList: async (\n optionType: string,\n exercisedCoin: string,\n investCoin: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'optionType' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'optionType', optionType);\n // verify required parameter 'exercisedCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'exercisedCoin', exercisedCoin);\n // verify required parameter 'investCoin' is not null or undefined\n assertParamExists('getDualInvestmentProductList', 'investCoin', investCoin);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (optionType !== undefined && optionType !== null) {\n localVarQueryParameter['optionType'] = optionType;\n }\n if (exercisedCoin !== undefined && exercisedCoin !== null) {\n localVarQueryParameter['exercisedCoin'] = exercisedCoin;\n }\n if (investCoin !== undefined && investCoin !== null) {\n localVarQueryParameter['investCoin'] = investCoin;\n }\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/list',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * MarketDataApi - interface\n * @interface MarketDataApi\n */\nexport interface MarketDataApiInterface {\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApiInterface\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>>;\n}\n\n/**\n * Request parameters for getDualInvestmentProductList operation in MarketDataApi.\n * @interface GetDualInvestmentProductListRequest\n */\nexport interface GetDualInvestmentProductListRequest {\n /**\n * Input CALL or PUT\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly optionType: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly exercisedCoin: string;\n\n /**\n * 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\n * @type {string}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly investCoin: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof MarketDataApiGetDualInvestmentProductList\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * MarketDataApi - object-oriented interface\n * @class MarketDataApi\n */\nexport class MarketDataApi implements MarketDataApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = MarketDataApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof MarketDataApi\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n public async getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentProductList(\n requestParameters?.optionType,\n requestParameters?.exercisedCoin,\n requestParameters?.investCoin,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentProductListResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport {\n ConfigurationRestAPI,\n TimeUnit,\n RestApiResponse,\n assertParamExists,\n sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from '../types';\n\n/**\n * TradeApi - axios parameter creator\n */\nconst TradeApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {string} positionId Get positionId from `/sapi/v1/dci/product/positions`\n * @param {string} [autoCompoundPlan]\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n changeAutoCompoundStatus: async (\n positionId: string,\n autoCompoundPlan?: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'positionId' is not null or undefined\n assertParamExists('changeAutoCompoundStatus', 'positionId', positionId);\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (positionId !== undefined && positionId !== null) {\n localVarQueryParameter['positionId'] = positionId;\n }\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['AutoCompoundPlan'] = autoCompoundPlan;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/auto_compound/edit-status',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n checkDualInvestmentAccounts: async (recvWindow?: number | bigint): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/accounts',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @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.\n * @param {number | bigint} [pageSize] Default: 10, Maximum: 100\n * @param {number | bigint} [pageIndex] Default: 1\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n getDualInvestmentPositions: async (\n status?: string,\n pageSize?: number | bigint,\n pageIndex?: number | bigint,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (status !== undefined && status !== null) {\n localVarQueryParameter['status'] = status;\n }\n if (pageSize !== undefined && pageSize !== null) {\n localVarQueryParameter['pageSize'] = pageSize;\n }\n if (pageIndex !== undefined && pageIndex !== null) {\n localVarQueryParameter['pageIndex'] = pageIndex;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/positions',\n method: 'GET',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {string} id get id from `/sapi/v1/dci/product/list`\n * @param {string} orderId get orderId from `/sapi/v1/dci/product/list`\n * @param {number} depositAmount the amount for subscribing\n * @param {string} autoCompoundPlan `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @param {number | bigint} [recvWindow] The value cannot be greater than 60000\n *\n * @throws {RequiredError}\n */\n subscribeDualInvestmentProducts: async (\n id: string,\n orderId: string,\n depositAmount: number,\n autoCompoundPlan: string,\n recvWindow?: number | bigint\n ): Promise<RequestArgs> => {\n // verify required parameter 'id' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'id', id);\n // verify required parameter 'orderId' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'orderId', orderId);\n // verify required parameter 'depositAmount' is not null or undefined\n assertParamExists('subscribeDualInvestmentProducts', 'depositAmount', depositAmount);\n // verify required parameter 'autoCompoundPlan' is not null or undefined\n assertParamExists(\n 'subscribeDualInvestmentProducts',\n 'autoCompoundPlan',\n autoCompoundPlan\n );\n\n const localVarQueryParameter: Record<string, unknown> = {};\n const localVarBodyParameter: Record<string, unknown> = {};\n\n if (id !== undefined && id !== null) {\n localVarQueryParameter['id'] = id;\n }\n if (orderId !== undefined && orderId !== null) {\n localVarQueryParameter['orderId'] = orderId;\n }\n if (depositAmount !== undefined && depositAmount !== null) {\n localVarQueryParameter['depositAmount'] = depositAmount;\n }\n if (autoCompoundPlan !== undefined && autoCompoundPlan !== null) {\n localVarQueryParameter['autoCompoundPlan'] = autoCompoundPlan;\n }\n if (recvWindow !== undefined && recvWindow !== null) {\n localVarQueryParameter['recvWindow'] = recvWindow;\n }\n\n let _timeUnit: TimeUnit | undefined;\n if ('timeUnit' in configuration) _timeUnit = configuration.timeUnit as TimeUnit;\n\n return {\n endpoint: '/sapi/v1/dci/product/subscribe',\n method: 'POST',\n queryParams: localVarQueryParameter,\n bodyParams: localVarBodyParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * TradeApi - interface\n * @interface TradeApi\n */\nexport interface TradeApiInterface {\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>;\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n checkDualInvestmentAccounts(\n requestParameters?: CheckDualInvestmentAccountsRequest\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>;\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n getDualInvestmentPositions(\n requestParameters?: GetDualInvestmentPositionsRequest\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>;\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApiInterface\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>;\n}\n\n/**\n * Request parameters for changeAutoCompoundStatus operation in TradeApi.\n * @interface ChangeAutoCompoundStatusRequest\n */\nexport interface ChangeAutoCompoundStatusRequest {\n /**\n * Get positionId from `/sapi/v1/dci/product/positions`\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly positionId: string;\n\n /**\n *\n * @type {string}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly autoCompoundPlan?: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiChangeAutoCompoundStatus\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for checkDualInvestmentAccounts operation in TradeApi.\n * @interface CheckDualInvestmentAccountsRequest\n */\nexport interface CheckDualInvestmentAccountsRequest {\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiCheckDualInvestmentAccounts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getDualInvestmentPositions operation in TradeApi.\n * @interface GetDualInvestmentPositionsRequest\n */\nexport interface GetDualInvestmentPositionsRequest {\n /**\n * `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.\n * @type {string}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly status?: string;\n\n /**\n * Default: 10, Maximum: 100\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageSize?: number | bigint;\n\n /**\n * Default: 1\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly pageIndex?: number | bigint;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiGetDualInvestmentPositions\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for subscribeDualInvestmentProducts operation in TradeApi.\n * @interface SubscribeDualInvestmentProductsRequest\n */\nexport interface SubscribeDualInvestmentProductsRequest {\n /**\n * get id from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly id: string;\n\n /**\n * get orderId from `/sapi/v1/dci/product/list`\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly orderId: string;\n\n /**\n * the amount for subscribing\n * @type {number}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly depositAmount: number;\n\n /**\n * `NONE`: switch off the plan, `STANDARD`:standard plan,`ADVANCED`:advanced plan\n * @type {string}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly autoCompoundPlan: string;\n\n /**\n * The value cannot be greater than 60000\n * @type {number | bigint}\n * @memberof TradeApiSubscribeDualInvestmentProducts\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * TradeApi - object-oriented interface\n * @class TradeApi\n */\nexport class TradeApi implements TradeApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = TradeApiAxiosParamCreator(configuration);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n public async changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.changeAutoCompoundStatus(\n requestParameters?.positionId,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<ChangeAutoCompoundStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n public async checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.checkDualInvestmentAccounts(\n requestParameters?.recvWindow\n );\n return sendRequest<CheckDualInvestmentAccountsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n public async getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getDualInvestmentPositions(\n requestParameters?.status,\n requestParameters?.pageSize,\n requestParameters?.pageIndex,\n requestParameters?.recvWindow\n );\n return sendRequest<GetDualInvestmentPositionsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof TradeApi\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n public async subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.subscribeDualInvestmentProducts(\n requestParameters?.id,\n requestParameters?.orderId,\n requestParameters?.depositAmount,\n requestParameters?.autoCompoundPlan,\n requestParameters?.recvWindow\n );\n return sendRequest<SubscribeDualInvestmentProductsResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.queryParams,\n localVarAxiosArgs.bodyParams,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { ConfigurationRestAPI, RestApiResponse, sendRequest } from '@binance/common';\nimport { MarketDataApi } from './modules/market-data-api';\nimport { TradeApi } from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListRequest } from './modules/market-data-api';\nimport type {\n ChangeAutoCompoundStatusRequest,\n CheckDualInvestmentAccountsRequest,\n GetDualInvestmentPositionsRequest,\n SubscribeDualInvestmentProductsRequest,\n} from './modules/trade-api';\n\nimport type { GetDualInvestmentProductListResponse } from './types';\nimport type {\n ChangeAutoCompoundStatusResponse,\n CheckDualInvestmentAccountsResponse,\n GetDualInvestmentPositionsResponse,\n SubscribeDualInvestmentProductsResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private marketDataApi: MarketDataApi;\n private tradeApi: TradeApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.marketDataApi = new MarketDataApi(configuration);\n this.tradeApi = new TradeApi(configuration);\n }\n\n /**\n * Generic function to send a request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined\n );\n }\n\n /**\n * Generic function to send a signed request.\n * @param endpoint - The API endpoint to call.\n * @param method - HTTP method to use (GET, POST, DELETE, etc.).\n * @param queryParams - Query parameters for the request.\n * @param bodyParams - Body parameters for the request.\n *\n * @returns A promise resolving to the response data object.\n */\n sendSignedRequest<T>(\n endpoint: string,\n method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH',\n queryParams: Record<string, unknown> = {},\n bodyParams: Record<string, unknown> = {}\n ): Promise<RestApiResponse<T>> {\n return sendRequest<T>(\n this.configuration,\n endpoint,\n method,\n queryParams,\n bodyParams,\n undefined,\n { isSigned: true }\n );\n }\n\n /**\n * Get Dual Investment product list\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment product list\n * @param {GetDualInvestmentProductListRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentProductListResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/market-data/Get-Dual-Investment-product-list Binance API Documentation}\n */\n getDualInvestmentProductList(\n requestParameters: GetDualInvestmentProductListRequest\n ): Promise<RestApiResponse<GetDualInvestmentProductListResponse>> {\n return this.marketDataApi.getDualInvestmentProductList(requestParameters);\n }\n\n /**\n * Change Auto-Compound status\n *\n * Weight: 1(IP)\n *\n * @summary Change Auto-Compound status(USER_DATA)\n * @param {ChangeAutoCompoundStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Change-Auto-Compound-status Binance API Documentation}\n */\n changeAutoCompoundStatus(\n requestParameters: ChangeAutoCompoundStatusRequest\n ): Promise<RestApiResponse<ChangeAutoCompoundStatusResponse>> {\n return this.tradeApi.changeAutoCompoundStatus(requestParameters);\n }\n\n /**\n * Check Dual Investment accounts\n *\n * Weight: 1(IP)\n *\n * @summary Check Dual Investment accounts(USER_DATA)\n * @param {CheckDualInvestmentAccountsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Check-Dual-Investment-accounts Binance API Documentation}\n */\n checkDualInvestmentAccounts(\n requestParameters: CheckDualInvestmentAccountsRequest = {}\n ): Promise<RestApiResponse<CheckDualInvestmentAccountsResponse>> {\n return this.tradeApi.checkDualInvestmentAccounts(requestParameters);\n }\n\n /**\n * Get Dual Investment positions (batch)\n *\n * Weight: 1(IP)\n *\n * @summary Get Dual Investment positions(USER_DATA)\n * @param {GetDualInvestmentPositionsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetDualInvestmentPositionsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Get-Dual-Investment-positions Binance API Documentation}\n */\n getDualInvestmentPositions(\n requestParameters: GetDualInvestmentPositionsRequest = {}\n ): Promise<RestApiResponse<GetDualInvestmentPositionsResponse>> {\n return this.tradeApi.getDualInvestmentPositions(requestParameters);\n }\n\n /**\n * Subscribe Dual Investment products\n *\n * Products are not available. // this means APR changes to lower value, or orders are not unavailable.\n * Failed. This means System or network errors.\n *\n * Weight: 1(IP)\n *\n * @summary Subscribe Dual Investment products(USER_DATA)\n * @param {SubscribeDualInvestmentProductsRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/dual_investment/trade/Subscribe-Dual-Investment-products Binance API Documentation}\n */\n subscribeDualInvestmentProducts(\n requestParameters: SubscribeDualInvestmentProductsRequest\n ): Promise<RestApiResponse<SubscribeDualInvestmentProductsResponse>> {\n return this.tradeApi.subscribeDualInvestmentProducts(requestParameters);\n }\n}\n","/**\n * Binance Dual Investment REST API\n *\n * OpenAPI Specification for the Binance Dual Investment REST API\n *\n * The version of the OpenAPI document: 1.0.0\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nexport * from './types';\nexport * from './modules';\nexport * from './rest-api';\n","import {\n buildUserAgent,\n ConfigurationRestAPI,\n DUAL_INVESTMENT_REST_API_PROD_URL,\n} from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationDualInvestment {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class DualInvestment {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationDualInvestment) {\n const userAgent = buildUserAgent(name, version);\n\n if (config?.configurationRestAPI) {\n const configRestAPI = new ConfigurationRestAPI(\n config.configurationRestAPI\n ) as ConfigurationRestAPI & {\n baseOptions: Record<string, unknown>;\n };\n configRestAPI.basePath = configRestAPI.basePath || DUAL_INVESTMENT_REST_API_PROD_URL;\n configRestAPI.baseOptions = configRestAPI.baseOptions || {};\n configRestAPI.baseOptions.headers = {\n ...(configRestAPI.baseOptions.headers || {}),\n 'User-Agent': userAgent,\n };\n this.restAPI = new RestAPI(configRestAPI);\n }\n }\n}\n"],"mappings":";;;;WACY;cAEG;;;;;;;;;;;;;;;;;;;ACuBf,MAAM,iCAAiC,SAAU,eAAqC;AAClF,QAAO,EAgBH,8BAA8B,OAC1B,YACA,eACA,YACA,UACA,WACA,eACuB;AAEvB,oBAAkB,gCAAgC,cAAc,WAAW;AAE3E,oBAAkB,gCAAgC,iBAAiB,cAAc;AAEjF,oBAAkB,gCAAgC,cAAc,WAAW;EAE3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I,QAAQ,sBAAsB;GAC9B,MAAM,gBAAgB,IAAI,qBACtB,OAAO,qBACV;AAGD,iBAAc,WAAW,cAAc,YAAYC;AACnD,iBAAc,cAAc,cAAc,eAAe,EAAE;AAC3D,iBAAc,YAAY,UAAU;IAChC,GAAI,cAAc,YAAY,WAAW,EAAE;IAC3C,cAAc;IACjB;AACD,QAAK,UAAU,IAAI,QAAQ,cAAc"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@binance/dual-investment",
|
|
3
3
|
"description": "Official Binance Dual Investment Connector - A lightweight library that provides a convenient interface to Binance's Dual Investment REST API.",
|
|
4
|
-
"version": "4.0
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript-eslint": "^8.24.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@binance/common": "2.0
|
|
59
|
+
"@binance/common": "2.1.0",
|
|
60
60
|
"axios": "^1.7.4"
|
|
61
61
|
}
|
|
62
62
|
}
|