@binance/copy-trading 3.0.1 → 3.0.3

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.js CHANGED
@@ -1,264 +1,279 @@
1
- "use strict";
1
+ //#region rolldown:runtime
2
2
  var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name2 in all)
8
- __defProp(target, name2, { get: all[name2], enumerable: true });
3
+ var __export = (all) => {
4
+ let target = {};
5
+ for (var name$1 in all) __defProp(target, name$1, {
6
+ get: all[name$1],
7
+ enumerable: true
8
+ });
9
+ return target;
9
10
  };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
11
 
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- BadRequestError: () => import_common4.BadRequestError,
24
- COPY_TRADING_REST_API_PROD_URL: () => import_common4.COPY_TRADING_REST_API_PROD_URL,
25
- ConnectorClientError: () => import_common4.ConnectorClientError,
26
- CopyTrading: () => CopyTrading,
27
- CopyTradingRestAPI: () => rest_api_exports,
28
- ForbiddenError: () => import_common4.ForbiddenError,
29
- NetworkError: () => import_common4.NetworkError,
30
- NotFoundError: () => import_common4.NotFoundError,
31
- RateLimitBanError: () => import_common4.RateLimitBanError,
32
- RequiredError: () => import_common4.RequiredError,
33
- ServerError: () => import_common4.ServerError,
34
- TooManyRequestsError: () => import_common4.TooManyRequestsError,
35
- UnauthorizedError: () => import_common4.UnauthorizedError
36
- });
37
- module.exports = __toCommonJS(index_exports);
12
+ //#endregion
13
+ let __binance_common = require("@binance/common");
38
14
 
39
- // src/copy-trading.ts
40
- var import_common3 = require("@binance/common");
41
-
42
- // package.json
15
+ //#region package.json
43
16
  var name = "@binance/copy-trading";
44
- var version = "3.0.1";
17
+ var version = "3.0.3";
18
+
19
+ //#endregion
20
+ //#region src/rest-api/modules/future-copy-trading-api.ts
21
+ /**
22
+ * Binance Copy Trading REST API
23
+ *
24
+ * OpenAPI Specification for the Binance Copy Trading REST API
25
+ *
26
+ * The version of the OpenAPI document: 1.0.0
27
+ *
28
+ *
29
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
30
+ * https://openapi-generator.tech
31
+ * Do not edit the class manually.
32
+ */
33
+ /**
34
+ * FutureCopyTradingApi - axios parameter creator
35
+ */
36
+ const FutureCopyTradingApiAxiosParamCreator = function(configuration) {
37
+ return {
38
+ getFuturesLeadTraderStatus: async (recvWindow) => {
39
+ const localVarQueryParameter = {};
40
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
41
+ let _timeUnit;
42
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
43
+ return {
44
+ endpoint: "/sapi/v1/copyTrading/futures/userStatus",
45
+ method: "GET",
46
+ params: localVarQueryParameter,
47
+ timeUnit: _timeUnit
48
+ };
49
+ },
50
+ getFuturesLeadTradingSymbolWhitelist: async (recvWindow) => {
51
+ const localVarQueryParameter = {};
52
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
53
+ let _timeUnit;
54
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
55
+ return {
56
+ endpoint: "/sapi/v1/copyTrading/futures/leadSymbol",
57
+ method: "GET",
58
+ params: localVarQueryParameter,
59
+ timeUnit: _timeUnit
60
+ };
61
+ }
62
+ };
63
+ };
64
+ /**
65
+ * FutureCopyTradingApi - object-oriented interface
66
+ * @class FutureCopyTradingApi
67
+ */
68
+ var FutureCopyTradingApi = class {
69
+ constructor(configuration) {
70
+ this.configuration = configuration;
71
+ this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);
72
+ }
73
+ /**
74
+ * Get Futures Lead Trader Status
75
+ *
76
+ * Weight: 20
77
+ *
78
+ * @summary Get Futures Lead Trader Status(TRADE)
79
+ * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
80
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
81
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
82
+ * @memberof FutureCopyTradingApi
83
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
84
+ */
85
+ async getFuturesLeadTraderStatus(requestParameters = {}) {
86
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(requestParameters?.recvWindow);
87
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
88
+ }
89
+ /**
90
+ * Get Futures Lead Trading Symbol Whitelist
91
+ *
92
+ * Weight: 20
93
+ *
94
+ * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
95
+ * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
96
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
97
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
98
+ * @memberof FutureCopyTradingApi
99
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
100
+ */
101
+ async getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
102
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(requestParameters?.recvWindow);
103
+ return (0, __binance_common.sendRequest)(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
104
+ }
105
+ };
106
+
107
+ //#endregion
108
+ //#region src/rest-api/rest-api.ts
109
+ /**
110
+ * Binance Copy Trading REST API
111
+ *
112
+ * OpenAPI Specification for the Binance Copy Trading REST API
113
+ *
114
+ * The version of the OpenAPI document: 1.0.0
115
+ *
116
+ *
117
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
118
+ * https://openapi-generator.tech
119
+ * Do not edit the class manually.
120
+ */
121
+ var RestAPI = class {
122
+ constructor(configuration) {
123
+ this.configuration = configuration;
124
+ this.futureCopyTradingApi = new FutureCopyTradingApi(configuration);
125
+ }
126
+ /**
127
+ * Generic function to send a request.
128
+ * @param endpoint - The API endpoint to call.
129
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
130
+ * @param params - Query parameters for the request.
131
+ *
132
+ * @returns A promise resolving to the response data object.
133
+ */
134
+ sendRequest(endpoint, method, params = {}) {
135
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0);
136
+ }
137
+ /**
138
+ * Generic function to send a signed request.
139
+ * @param endpoint - The API endpoint to call.
140
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
141
+ * @param params - Query parameters for the request.
142
+ *
143
+ * @returns A promise resolving to the response data object.
144
+ */
145
+ sendSignedRequest(endpoint, method, params = {}) {
146
+ return (0, __binance_common.sendRequest)(this.configuration, endpoint, method, params, void 0, { isSigned: true });
147
+ }
148
+ /**
149
+ * Get Futures Lead Trader Status
150
+ *
151
+ * Weight: 20
152
+ *
153
+ * @summary Get Futures Lead Trader Status(TRADE)
154
+ * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
155
+ *
156
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
157
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
158
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
159
+ */
160
+ getFuturesLeadTraderStatus(requestParameters = {}) {
161
+ return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);
162
+ }
163
+ /**
164
+ * Get Futures Lead Trading Symbol Whitelist
165
+ *
166
+ * Weight: 20
167
+ *
168
+ * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
169
+ * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
170
+ *
171
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
172
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
173
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
174
+ */
175
+ getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
176
+ return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);
177
+ }
178
+ };
45
179
 
46
- // src/rest-api/index.ts
47
- var rest_api_exports = {};
48
- __export(rest_api_exports, {
49
- FutureCopyTradingApi: () => FutureCopyTradingApi,
50
- RestAPI: () => RestAPI
180
+ //#endregion
181
+ //#region src/rest-api/index.ts
182
+ var rest_api_exports = /* @__PURE__ */ __export({
183
+ FutureCopyTradingApi: () => FutureCopyTradingApi,
184
+ RestAPI: () => RestAPI
51
185
  });
52
186
 
53
- // src/rest-api/modules/future-copy-trading-api.ts
54
- var import_common = require("@binance/common");
55
- var FutureCopyTradingApiAxiosParamCreator = function(configuration) {
56
- return {
57
- /**
58
- * Get Futures Lead Trader Status
59
- *
60
- * Weight: 20
61
- *
62
- * @summary Get Futures Lead Trader Status(TRADE)
63
- * @param {number | bigint} [recvWindow]
64
- *
65
- * @throws {RequiredError}
66
- */
67
- getFuturesLeadTraderStatus: async (recvWindow) => {
68
- const localVarQueryParameter = {};
69
- if (recvWindow !== void 0 && recvWindow !== null) {
70
- localVarQueryParameter["recvWindow"] = recvWindow;
71
- }
72
- let _timeUnit;
73
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
74
- return {
75
- endpoint: "/sapi/v1/copyTrading/futures/userStatus",
76
- method: "GET",
77
- params: localVarQueryParameter,
78
- timeUnit: _timeUnit
79
- };
80
- },
81
- /**
82
- * Get Futures Lead Trading Symbol Whitelist
83
- *
84
- * Weight: 20
85
- *
86
- * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
87
- * @param {number | bigint} [recvWindow]
88
- *
89
- * @throws {RequiredError}
90
- */
91
- getFuturesLeadTradingSymbolWhitelist: async (recvWindow) => {
92
- const localVarQueryParameter = {};
93
- if (recvWindow !== void 0 && recvWindow !== null) {
94
- localVarQueryParameter["recvWindow"] = recvWindow;
95
- }
96
- let _timeUnit;
97
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
98
- return {
99
- endpoint: "/sapi/v1/copyTrading/futures/leadSymbol",
100
- method: "GET",
101
- params: localVarQueryParameter,
102
- timeUnit: _timeUnit
103
- };
104
- }
105
- };
187
+ //#endregion
188
+ //#region src/copy-trading.ts
189
+ var CopyTrading = class {
190
+ constructor(config) {
191
+ const userAgent = (0, __binance_common.buildUserAgent)(name, version);
192
+ if (config?.configurationRestAPI) {
193
+ const configRestAPI = new __binance_common.ConfigurationRestAPI(config.configurationRestAPI);
194
+ configRestAPI.basePath = configRestAPI.basePath || __binance_common.COPY_TRADING_REST_API_PROD_URL;
195
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
196
+ configRestAPI.baseOptions.headers = {
197
+ ...configRestAPI.baseOptions.headers || {},
198
+ "User-Agent": userAgent
199
+ };
200
+ this.restAPI = new RestAPI(configRestAPI);
201
+ }
202
+ }
106
203
  };
107
- var FutureCopyTradingApi = class {
108
- constructor(configuration) {
109
- this.configuration = configuration;
110
- this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);
204
+
205
+ //#endregion
206
+ Object.defineProperty(exports, 'BadRequestError', {
207
+ enumerable: true,
208
+ get: function () {
209
+ return __binance_common.BadRequestError;
111
210
  }
112
- /**
113
- * Get Futures Lead Trader Status
114
- *
115
- * Weight: 20
116
- *
117
- * @summary Get Futures Lead Trader Status(TRADE)
118
- * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
119
- * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
120
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
121
- * @memberof FutureCopyTradingApi
122
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
123
- */
124
- async getFuturesLeadTraderStatus(requestParameters = {}) {
125
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(
126
- requestParameters?.recvWindow
127
- );
128
- return (0, import_common.sendRequest)(
129
- this.configuration,
130
- localVarAxiosArgs.endpoint,
131
- localVarAxiosArgs.method,
132
- localVarAxiosArgs.params,
133
- localVarAxiosArgs?.timeUnit,
134
- { isSigned: true }
135
- );
211
+ });
212
+ Object.defineProperty(exports, 'COPY_TRADING_REST_API_PROD_URL', {
213
+ enumerable: true,
214
+ get: function () {
215
+ return __binance_common.COPY_TRADING_REST_API_PROD_URL;
136
216
  }
137
- /**
138
- * Get Futures Lead Trading Symbol Whitelist
139
- *
140
- * Weight: 20
141
- *
142
- * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
143
- * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
144
- * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
145
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
146
- * @memberof FutureCopyTradingApi
147
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
148
- */
149
- async getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
150
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(
151
- requestParameters?.recvWindow
152
- );
153
- return (0, import_common.sendRequest)(
154
- this.configuration,
155
- localVarAxiosArgs.endpoint,
156
- localVarAxiosArgs.method,
157
- localVarAxiosArgs.params,
158
- localVarAxiosArgs?.timeUnit,
159
- { isSigned: true }
160
- );
217
+ });
218
+ Object.defineProperty(exports, 'ConnectorClientError', {
219
+ enumerable: true,
220
+ get: function () {
221
+ return __binance_common.ConnectorClientError;
161
222
  }
162
- };
163
-
164
- // src/rest-api/rest-api.ts
165
- var import_common2 = require("@binance/common");
166
- var RestAPI = class {
167
- constructor(configuration) {
168
- this.configuration = configuration;
169
- this.futureCopyTradingApi = new FutureCopyTradingApi(configuration);
223
+ });
224
+ exports.CopyTrading = CopyTrading;
225
+ Object.defineProperty(exports, 'CopyTradingRestAPI', {
226
+ enumerable: true,
227
+ get: function () {
228
+ return rest_api_exports;
170
229
  }
171
- /**
172
- * Generic function to send a request.
173
- * @param endpoint - The API endpoint to call.
174
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
175
- * @param params - Query parameters for the request.
176
- *
177
- * @returns A promise resolving to the response data object.
178
- */
179
- sendRequest(endpoint, method, params = {}) {
180
- return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0);
230
+ });
231
+ Object.defineProperty(exports, 'ForbiddenError', {
232
+ enumerable: true,
233
+ get: function () {
234
+ return __binance_common.ForbiddenError;
181
235
  }
182
- /**
183
- * Generic function to send a signed request.
184
- * @param endpoint - The API endpoint to call.
185
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
186
- * @param params - Query parameters for the request.
187
- *
188
- * @returns A promise resolving to the response data object.
189
- */
190
- sendSignedRequest(endpoint, method, params = {}) {
191
- return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0, {
192
- isSigned: true
193
- });
236
+ });
237
+ Object.defineProperty(exports, 'NetworkError', {
238
+ enumerable: true,
239
+ get: function () {
240
+ return __binance_common.NetworkError;
194
241
  }
195
- /**
196
- * Get Futures Lead Trader Status
197
- *
198
- * Weight: 20
199
- *
200
- * @summary Get Futures Lead Trader Status(TRADE)
201
- * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
202
- *
203
- * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
204
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
205
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
206
- */
207
- getFuturesLeadTraderStatus(requestParameters = {}) {
208
- return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);
242
+ });
243
+ Object.defineProperty(exports, 'NotFoundError', {
244
+ enumerable: true,
245
+ get: function () {
246
+ return __binance_common.NotFoundError;
209
247
  }
210
- /**
211
- * Get Futures Lead Trading Symbol Whitelist
212
- *
213
- * Weight: 20
214
- *
215
- * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
216
- * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
217
- *
218
- * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
219
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
220
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
221
- */
222
- getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
223
- return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);
248
+ });
249
+ Object.defineProperty(exports, 'RateLimitBanError', {
250
+ enumerable: true,
251
+ get: function () {
252
+ return __binance_common.RateLimitBanError;
224
253
  }
225
- };
226
-
227
- // src/copy-trading.ts
228
- var CopyTrading = class {
229
- constructor(config) {
230
- const userAgent = (0, import_common3.buildUserAgent)(name, version);
231
- if (config?.configurationRestAPI) {
232
- const configRestAPI = new import_common3.ConfigurationRestAPI(
233
- config.configurationRestAPI
234
- );
235
- configRestAPI.basePath = configRestAPI.basePath || import_common3.COPY_TRADING_REST_API_PROD_URL;
236
- configRestAPI.baseOptions = configRestAPI.baseOptions || {};
237
- configRestAPI.baseOptions.headers = {
238
- ...configRestAPI.baseOptions.headers || {},
239
- "User-Agent": userAgent
240
- };
241
- this.restAPI = new RestAPI(configRestAPI);
242
- }
254
+ });
255
+ Object.defineProperty(exports, 'RequiredError', {
256
+ enumerable: true,
257
+ get: function () {
258
+ return __binance_common.RequiredError;
259
+ }
260
+ });
261
+ Object.defineProperty(exports, 'ServerError', {
262
+ enumerable: true,
263
+ get: function () {
264
+ return __binance_common.ServerError;
265
+ }
266
+ });
267
+ Object.defineProperty(exports, 'TooManyRequestsError', {
268
+ enumerable: true,
269
+ get: function () {
270
+ return __binance_common.TooManyRequestsError;
271
+ }
272
+ });
273
+ Object.defineProperty(exports, 'UnauthorizedError', {
274
+ enumerable: true,
275
+ get: function () {
276
+ return __binance_common.UnauthorizedError;
243
277
  }
244
- };
245
-
246
- // src/index.ts
247
- var import_common4 = require("@binance/common");
248
- // Annotate the CommonJS export names for ESM import in node:
249
- 0 && (module.exports = {
250
- BadRequestError,
251
- COPY_TRADING_REST_API_PROD_URL,
252
- ConnectorClientError,
253
- CopyTrading,
254
- CopyTradingRestAPI,
255
- ForbiddenError,
256
- NetworkError,
257
- NotFoundError,
258
- RateLimitBanError,
259
- RequiredError,
260
- ServerError,
261
- TooManyRequestsError,
262
- UnauthorizedError
263
278
  });
264
279
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/copy-trading.ts","../package.json","../src/rest-api/index.ts","../src/rest-api/modules/future-copy-trading-api.ts","../src/rest-api/rest-api.ts"],"sourcesContent":["export { CopyTrading, ConfigurationCopyTrading } from './copy-trading';\nexport * as CopyTradingRestAPI from './rest-api';\n\nexport {\n COPY_TRADING_REST_API_PROD_URL,\n ConnectorClientError,\n RequiredError,\n UnauthorizedError,\n ForbiddenError,\n TooManyRequestsError,\n RateLimitBanError,\n ServerError,\n NetworkError,\n NotFoundError,\n BadRequestError,\n} from '@binance/common';\n","import {\n buildUserAgent,\n ConfigurationRestAPI,\n COPY_TRADING_REST_API_PROD_URL,\n} from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationCopyTrading {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class CopyTrading {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationCopyTrading) {\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 || COPY_TRADING_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","{\n \"name\": \"@binance/copy-trading\",\n \"description\": \"Official Binance Copy Trading Connector - A lightweight library that provides a convenient interface to Binance's Copy Trading REST API.\",\n \"version\": \"3.0.1\",\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 && tsup\",\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 \"Copy Trading\",\n \"Connector\",\n \"REST\"\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 \"tsup\": \"^8.4.0\",\n \"typescript\": \"^5.7.2\",\n \"typescript-eslint\": \"^8.24.0\"\n },\n \"dependencies\": {\n \"@binance/common\": \"2.0.0\",\n \"axios\": \"^1.7.4\"\n }\n}\n","/**\n * Binance Copy Trading REST API\n *\n * OpenAPI Specification for the Binance Copy Trading 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","/**\n * Binance Copy Trading REST API\n *\n * OpenAPI Specification for the Binance Copy Trading 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 sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n GetFuturesLeadTraderStatusResponse,\n GetFuturesLeadTradingSymbolWhitelistResponse,\n} from '../types';\n\n/**\n * FutureCopyTradingApi - axios parameter creator\n */\nconst FutureCopyTradingApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFuturesLeadTraderStatus: 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/copyTrading/futures/userStatus',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFuturesLeadTradingSymbolWhitelist: async (\n recvWindow?: number | bigint\n ): 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/copyTrading/futures/leadSymbol',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FutureCopyTradingApi - interface\n * @interface FutureCopyTradingApi\n */\nexport interface FutureCopyTradingApiInterface {\n /**\n * Get Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApiInterface\n */\n getFuturesLeadTraderStatus(\n requestParameters?: GetFuturesLeadTraderStatusRequest\n ): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>;\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApiInterface\n */\n getFuturesLeadTradingSymbolWhitelist(\n requestParameters?: GetFuturesLeadTradingSymbolWhitelistRequest\n ): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>;\n}\n\n/**\n * Request parameters for getFuturesLeadTraderStatus operation in FutureCopyTradingApi.\n * @interface GetFuturesLeadTraderStatusRequest\n */\nexport interface GetFuturesLeadTraderStatusRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof FutureCopyTradingApiGetFuturesLeadTraderStatus\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getFuturesLeadTradingSymbolWhitelist operation in FutureCopyTradingApi.\n * @interface GetFuturesLeadTradingSymbolWhitelistRequest\n */\nexport interface GetFuturesLeadTradingSymbolWhitelistRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof FutureCopyTradingApiGetFuturesLeadTradingSymbolWhitelist\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * FutureCopyTradingApi - object-oriented interface\n * @class FutureCopyTradingApi\n */\nexport class FutureCopyTradingApi implements FutureCopyTradingApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApi\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}\n */\n public async getFuturesLeadTraderStatus(\n requestParameters: GetFuturesLeadTraderStatusRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(\n requestParameters?.recvWindow\n );\n return sendRequest<GetFuturesLeadTraderStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApi\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}\n */\n public async getFuturesLeadTradingSymbolWhitelist(\n requestParameters: GetFuturesLeadTradingSymbolWhitelistRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(\n requestParameters?.recvWindow\n );\n return sendRequest<GetFuturesLeadTradingSymbolWhitelistResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Copy Trading REST API\n *\n * OpenAPI Specification for the Binance Copy Trading 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 { FutureCopyTradingApi } from './modules/future-copy-trading-api';\n\nimport type {\n GetFuturesLeadTraderStatusRequest,\n GetFuturesLeadTradingSymbolWhitelistRequest,\n} from './modules/future-copy-trading-api';\n\nimport type {\n GetFuturesLeadTraderStatusResponse,\n GetFuturesLeadTradingSymbolWhitelistResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private futureCopyTradingApi: FutureCopyTradingApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.futureCopyTradingApi = new FutureCopyTradingApi(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 Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}\n */\n getFuturesLeadTraderStatus(\n requestParameters: GetFuturesLeadTraderStatusRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>> {\n return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);\n }\n\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}\n */\n getFuturesLeadTradingSymbolWhitelist(\n requestParameters: GetFuturesLeadTradingSymbolWhitelistRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>> {\n return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAIO;;;ACHH,WAAQ;AAER,cAAW;;;ACHf;AAAA;AAAA;AAAA;AAAA;;;ACaA,oBAMO;AASP,IAAM,wCAAwC,SAAU,eAAqC;AACzF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWH,4BAA4B,OAAO,eAAuD;AACtF,YAAM,yBAAkD,CAAC;AAEzD,UAAI,eAAe,UAAa,eAAe,MAAM;AACjD,+BAAuB,YAAY,IAAI;AAAA,MAC3C;AAEA,UAAI;AACJ,UAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,aAAO;AAAA,QACH,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,UAAU;AAAA,MACd;AAAA,IACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,sCAAsC,OAClC,eACuB;AACvB,YAAM,yBAAkD,CAAC;AAEzD,UAAI,eAAe,UAAa,eAAe,MAAM;AACjD,+BAAuB,YAAY,IAAI;AAAA,MAC3C;AAEA,UAAI;AACJ,UAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,aAAO;AAAA,QACH,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,UAAU;AAAA,MACd;AAAA,IACJ;AAAA,EACJ;AACJ;AAmEO,IAAM,uBAAN,MAAoE;AAAA,EAIvE,YAAY,eAAqC;AAC7C,SAAK,gBAAgB;AACrB,SAAK,4BAA4B,sCAAsC,aAAa;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAa,2BACT,oBAAuD,CAAC,GACI;AAC5D,UAAM,oBAAoB,MAAM,KAAK,0BAA0B;AAAA,MAC3D,mBAAmB;AAAA,IACvB;AACA,eAAO;AAAA,MACH,KAAK;AAAA,MACL,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,EAAE,UAAU,KAAK;AAAA,IACrB;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAa,qCACT,oBAAiE,CAAC,GACI;AACtE,UAAM,oBACF,MAAM,KAAK,0BAA0B;AAAA,MACjC,mBAAmB;AAAA,IACvB;AACJ,eAAO;AAAA,MACH,KAAK;AAAA,MACL,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,mBAAmB;AAAA,MACnB,EAAE,UAAU,KAAK;AAAA,IACrB;AAAA,EACJ;AACJ;;;AC9MA,IAAAC,iBAAmE;AAa5D,IAAM,UAAN,MAAc;AAAA,EAIjB,YAAY,eAAqC;AAC7C,SAAK,gBAAgB;AACrB,SAAK,uBAAuB,IAAI,qBAAqB,aAAa;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,YACI,UACA,QACA,SAAkC,CAAC,GACR;AAC3B,eAAO,4BAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,MAAS;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,kBACI,UACA,QACA,SAAkC,CAAC,GACR;AAC3B,eAAO,4BAAe,KAAK,eAAe,UAAU,QAAQ,QAAQ,QAAW;AAAA,MAC3E,UAAU;AAAA,IACd,CAAC;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,2BACI,oBAAuD,CAAC,GACI;AAC5D,WAAO,KAAK,qBAAqB,2BAA2B,iBAAiB;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,qCACI,oBAAiE,CAAC,GACI;AACtE,WAAO,KAAK,qBAAqB,qCAAqC,iBAAiB;AAAA,EAC3F;AACJ;;;AJ5FO,IAAM,cAAN,MAAkB;AAAA,EAGrB,YAAY,QAAkC;AAC1C,UAAM,gBAAY,+BAAe,MAAM,OAAO;AAE9C,QAAI,QAAQ,sBAAsB;AAC9B,YAAM,gBAAgB,IAAI;AAAA,QACtB,OAAO;AAAA,MACX;AAGA,oBAAc,WAAW,cAAc,YAAY;AACnD,oBAAc,cAAc,cAAc,eAAe,CAAC;AAC1D,oBAAc,YAAY,UAAU;AAAA,QAChC,GAAI,cAAc,YAAY,WAAW,CAAC;AAAA,QAC1C,cAAc;AAAA,MAClB;AACA,WAAK,UAAU,IAAI,QAAQ,aAAa;AAAA,IAC5C;AAAA,EACJ;AACJ;;;AD9BA,IAAAC,iBAYO;","names":["import_common","import_common","import_common"]}
1
+ {"version":3,"file":"index.js","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","ConfigurationRestAPI","COPY_TRADING_REST_API_PROD_URL"],"sources":["../package.json","../src/rest-api/modules/future-copy-trading-api.ts","../src/rest-api/rest-api.ts","../src/rest-api/index.ts","../src/copy-trading.ts"],"sourcesContent":["{\n \"name\": \"@binance/copy-trading\",\n \"description\": \"Official Binance Copy Trading Connector - A lightweight library that provides a convenient interface to Binance's Copy Trading REST API.\",\n \"version\": \"3.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 \"Copy Trading\",\n \"Connector\",\n \"REST\"\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 Copy Trading REST API\n *\n * OpenAPI Specification for the Binance Copy Trading 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 sendRequest,\n type RequestArgs,\n} from '@binance/common';\nimport type {\n GetFuturesLeadTraderStatusResponse,\n GetFuturesLeadTradingSymbolWhitelistResponse,\n} from '../types';\n\n/**\n * FutureCopyTradingApi - axios parameter creator\n */\nconst FutureCopyTradingApiAxiosParamCreator = function (configuration: ConfigurationRestAPI) {\n return {\n /**\n * Get Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFuturesLeadTraderStatus: 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/copyTrading/futures/userStatus',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {number | bigint} [recvWindow]\n *\n * @throws {RequiredError}\n */\n getFuturesLeadTradingSymbolWhitelist: async (\n recvWindow?: number | bigint\n ): 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/copyTrading/futures/leadSymbol',\n method: 'GET',\n params: localVarQueryParameter,\n timeUnit: _timeUnit,\n };\n },\n };\n};\n\n/**\n * FutureCopyTradingApi - interface\n * @interface FutureCopyTradingApi\n */\nexport interface FutureCopyTradingApiInterface {\n /**\n * Get Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApiInterface\n */\n getFuturesLeadTraderStatus(\n requestParameters?: GetFuturesLeadTraderStatusRequest\n ): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>;\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.\n *\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApiInterface\n */\n getFuturesLeadTradingSymbolWhitelist(\n requestParameters?: GetFuturesLeadTradingSymbolWhitelistRequest\n ): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>;\n}\n\n/**\n * Request parameters for getFuturesLeadTraderStatus operation in FutureCopyTradingApi.\n * @interface GetFuturesLeadTraderStatusRequest\n */\nexport interface GetFuturesLeadTraderStatusRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof FutureCopyTradingApiGetFuturesLeadTraderStatus\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * Request parameters for getFuturesLeadTradingSymbolWhitelist operation in FutureCopyTradingApi.\n * @interface GetFuturesLeadTradingSymbolWhitelistRequest\n */\nexport interface GetFuturesLeadTradingSymbolWhitelistRequest {\n /**\n *\n * @type {number | bigint}\n * @memberof FutureCopyTradingApiGetFuturesLeadTradingSymbolWhitelist\n */\n readonly recvWindow?: number | bigint;\n}\n\n/**\n * FutureCopyTradingApi - object-oriented interface\n * @class FutureCopyTradingApi\n */\nexport class FutureCopyTradingApi implements FutureCopyTradingApiInterface {\n private readonly configuration: ConfigurationRestAPI;\n private localVarAxiosParamCreator;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);\n }\n\n /**\n * Get Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApi\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}\n */\n public async getFuturesLeadTraderStatus(\n requestParameters: GetFuturesLeadTraderStatusRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>> {\n const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(\n requestParameters?.recvWindow\n );\n return sendRequest<GetFuturesLeadTraderStatusResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.\n * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @memberof FutureCopyTradingApi\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}\n */\n public async getFuturesLeadTradingSymbolWhitelist(\n requestParameters: GetFuturesLeadTradingSymbolWhitelistRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>> {\n const localVarAxiosArgs =\n await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(\n requestParameters?.recvWindow\n );\n return sendRequest<GetFuturesLeadTradingSymbolWhitelistResponse>(\n this.configuration,\n localVarAxiosArgs.endpoint,\n localVarAxiosArgs.method,\n localVarAxiosArgs.params,\n localVarAxiosArgs?.timeUnit,\n { isSigned: true }\n );\n }\n}\n","/**\n * Binance Copy Trading REST API\n *\n * OpenAPI Specification for the Binance Copy Trading 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 { FutureCopyTradingApi } from './modules/future-copy-trading-api';\n\nimport type {\n GetFuturesLeadTraderStatusRequest,\n GetFuturesLeadTradingSymbolWhitelistRequest,\n} from './modules/future-copy-trading-api';\n\nimport type {\n GetFuturesLeadTraderStatusResponse,\n GetFuturesLeadTradingSymbolWhitelistResponse,\n} from './types';\n\nexport class RestAPI {\n private configuration: ConfigurationRestAPI;\n private futureCopyTradingApi: FutureCopyTradingApi;\n\n constructor(configuration: ConfigurationRestAPI) {\n this.configuration = configuration;\n this.futureCopyTradingApi = new FutureCopyTradingApi(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 Futures Lead Trader Status\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trader Status(TRADE)\n * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}\n */\n getFuturesLeadTraderStatus(\n requestParameters: GetFuturesLeadTraderStatusRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>> {\n return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);\n }\n\n /**\n * Get Futures Lead Trading Symbol Whitelist\n *\n * Weight: 20\n *\n * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)\n * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.\n *\n * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}\n * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}\n * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}\n */\n getFuturesLeadTradingSymbolWhitelist(\n requestParameters: GetFuturesLeadTradingSymbolWhitelistRequest = {}\n ): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>> {\n return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);\n }\n}\n","/**\n * Binance Copy Trading REST API\n *\n * OpenAPI Specification for the Binance Copy Trading 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 COPY_TRADING_REST_API_PROD_URL,\n} from '@binance/common';\nimport { name, version } from '../package.json';\nimport { RestAPI } from './rest-api';\n\nexport interface ConfigurationCopyTrading {\n configurationRestAPI?: ConfigurationRestAPI;\n}\n\nexport class CopyTrading {\n public restAPI!: RestAPI;\n\n constructor(config: ConfigurationCopyTrading) {\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 || COPY_TRADING_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;;;;;;;;;;;;;;;;;;;ACyBf,MAAM,wCAAwC,SAAU,eAAqC;AACzF,QAAO;EAWH,4BAA4B,OAAO,eAAuD;GACtF,MAAMA,yBAAkD,EAAE;AAE1D,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;GAG3C,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACb;;EAYL,sCAAsC,OAClC,eACuB;GACvB,MAAMD,yBAAkD,EAAE;AAE1D,OAAI,eAAe,UAAa,eAAe,KAC3C,wBAAuB,gBAAgB;GAG3C,IAAIC;AACJ,OAAI,cAAc,cAAe,aAAY,cAAc;AAE3D,UAAO;IACH,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACb;;EAER;;;;;;AAoEL,IAAa,uBAAb,MAA2E;CAIvE,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,4BAA4B,sCAAsC,cAAc;;;;;;;;;;;;;;CAezF,MAAa,2BACT,oBAAuD,EAAE,EACG;EAC5D,MAAM,oBAAoB,MAAM,KAAK,0BAA0B,2BAC3D,mBAAmB,WACtB;AACD,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,QAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;CAeL,MAAa,qCACT,oBAAiE,EAAE,EACG;EACtE,MAAM,oBACF,MAAM,KAAK,0BAA0B,qCACjC,mBAAmB,WACtB;AACL,2CACI,KAAK,eACL,kBAAkB,UAClB,kBAAkB,QAClB,kBAAkB,QAClB,mBAAmB,UACnB,EAAE,UAAU,MAAM,CACrB;;;;;;;;;;;;;;;;;;AC/LT,IAAa,UAAb,MAAqB;CAIjB,YAAY,eAAqC;AAC7C,OAAK,gBAAgB;AACrB,OAAK,uBAAuB,IAAI,qBAAqB,cAAc;;;;;;;;;;CAWvE,YACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,2CAAsB,KAAK,eAAe,UAAU,QAAQ,QAAQ,OAAU;;;;;;;;;;CAWlF,kBACI,UACA,QACA,SAAkC,EAAE,EACT;AAC3B,2CAAsB,KAAK,eAAe,UAAU,QAAQ,QAAQ,QAAW,EAC3E,UAAU,MACb,CAAC;;;;;;;;;;;;;;CAeN,2BACI,oBAAuD,EAAE,EACG;AAC5D,SAAO,KAAK,qBAAqB,2BAA2B,kBAAkB;;;;;;;;;;;;;;CAelF,qCACI,oBAAiE,EAAE,EACG;AACtE,SAAO,KAAK,qBAAqB,qCAAqC,kBAAkB;;;;;;;;;;;;;AE1FhG,IAAa,cAAb,MAAyB;CAGrB,YAAY,QAAkC;EAC1C,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"}