@binance/copy-trading 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,249 +1,196 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name2 in all)
4
- __defProp(target, name2, { get: all[name2], enumerable: true });
5
- };
6
-
7
- // src/copy-trading.ts
8
- import {
9
- buildUserAgent,
10
- ConfigurationRestAPI as ConfigurationRestAPI3,
11
- COPY_TRADING_REST_API_PROD_URL
12
- } from "@binance/common";
1
+ import { t as __export } from "./chunk.mjs";
2
+ import { BadRequestError, COPY_TRADING_REST_API_PROD_URL, COPY_TRADING_REST_API_PROD_URL as COPY_TRADING_REST_API_PROD_URL$1, ConfigurationRestAPI, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError, buildUserAgent, sendRequest } from "@binance/common";
13
3
 
14
- // package.json
4
+ //#region package.json
15
5
  var name = "@binance/copy-trading";
16
- var version = "3.0.1";
17
-
18
- // src/rest-api/index.ts
19
- var rest_api_exports = {};
20
- __export(rest_api_exports, {
21
- FutureCopyTradingApi: () => FutureCopyTradingApi,
22
- RestAPI: () => RestAPI
23
- });
6
+ var version = "3.0.2";
24
7
 
25
- // src/rest-api/modules/future-copy-trading-api.ts
26
- import {
27
- sendRequest
28
- } from "@binance/common";
29
- var FutureCopyTradingApiAxiosParamCreator = function(configuration) {
30
- return {
31
- /**
32
- * Get Futures Lead Trader Status
33
- *
34
- * Weight: 20
35
- *
36
- * @summary Get Futures Lead Trader Status(TRADE)
37
- * @param {number | bigint} [recvWindow]
38
- *
39
- * @throws {RequiredError}
40
- */
41
- getFuturesLeadTraderStatus: async (recvWindow) => {
42
- const localVarQueryParameter = {};
43
- if (recvWindow !== void 0 && recvWindow !== null) {
44
- localVarQueryParameter["recvWindow"] = recvWindow;
45
- }
46
- let _timeUnit;
47
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
48
- return {
49
- endpoint: "/sapi/v1/copyTrading/futures/userStatus",
50
- method: "GET",
51
- params: localVarQueryParameter,
52
- timeUnit: _timeUnit
53
- };
54
- },
55
- /**
56
- * Get Futures Lead Trading Symbol Whitelist
57
- *
58
- * Weight: 20
59
- *
60
- * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
61
- * @param {number | bigint} [recvWindow]
62
- *
63
- * @throws {RequiredError}
64
- */
65
- getFuturesLeadTradingSymbolWhitelist: async (recvWindow) => {
66
- const localVarQueryParameter = {};
67
- if (recvWindow !== void 0 && recvWindow !== null) {
68
- localVarQueryParameter["recvWindow"] = recvWindow;
69
- }
70
- let _timeUnit;
71
- if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
72
- return {
73
- endpoint: "/sapi/v1/copyTrading/futures/leadSymbol",
74
- method: "GET",
75
- params: localVarQueryParameter,
76
- timeUnit: _timeUnit
77
- };
78
- }
79
- };
8
+ //#endregion
9
+ //#region src/rest-api/modules/future-copy-trading-api.ts
10
+ /**
11
+ * Binance Copy Trading REST API
12
+ *
13
+ * OpenAPI Specification for the Binance Copy Trading REST API
14
+ *
15
+ * The version of the OpenAPI document: 1.0.0
16
+ *
17
+ *
18
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19
+ * https://openapi-generator.tech
20
+ * Do not edit the class manually.
21
+ */
22
+ /**
23
+ * FutureCopyTradingApi - axios parameter creator
24
+ */
25
+ const FutureCopyTradingApiAxiosParamCreator = function(configuration) {
26
+ return {
27
+ getFuturesLeadTraderStatus: async (recvWindow) => {
28
+ const localVarQueryParameter = {};
29
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
30
+ let _timeUnit;
31
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
32
+ return {
33
+ endpoint: "/sapi/v1/copyTrading/futures/userStatus",
34
+ method: "GET",
35
+ params: localVarQueryParameter,
36
+ timeUnit: _timeUnit
37
+ };
38
+ },
39
+ getFuturesLeadTradingSymbolWhitelist: async (recvWindow) => {
40
+ const localVarQueryParameter = {};
41
+ if (recvWindow !== void 0 && recvWindow !== null) localVarQueryParameter["recvWindow"] = recvWindow;
42
+ let _timeUnit;
43
+ if ("timeUnit" in configuration) _timeUnit = configuration.timeUnit;
44
+ return {
45
+ endpoint: "/sapi/v1/copyTrading/futures/leadSymbol",
46
+ method: "GET",
47
+ params: localVarQueryParameter,
48
+ timeUnit: _timeUnit
49
+ };
50
+ }
51
+ };
80
52
  };
53
+ /**
54
+ * FutureCopyTradingApi - object-oriented interface
55
+ * @class FutureCopyTradingApi
56
+ */
81
57
  var FutureCopyTradingApi = class {
82
- constructor(configuration) {
83
- this.configuration = configuration;
84
- this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);
85
- }
86
- /**
87
- * Get Futures Lead Trader Status
88
- *
89
- * Weight: 20
90
- *
91
- * @summary Get Futures Lead Trader Status(TRADE)
92
- * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
93
- * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
94
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
95
- * @memberof FutureCopyTradingApi
96
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
97
- */
98
- async getFuturesLeadTraderStatus(requestParameters = {}) {
99
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(
100
- requestParameters?.recvWindow
101
- );
102
- return sendRequest(
103
- this.configuration,
104
- localVarAxiosArgs.endpoint,
105
- localVarAxiosArgs.method,
106
- localVarAxiosArgs.params,
107
- localVarAxiosArgs?.timeUnit,
108
- { isSigned: true }
109
- );
110
- }
111
- /**
112
- * Get Futures Lead Trading Symbol Whitelist
113
- *
114
- * Weight: 20
115
- *
116
- * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
117
- * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
118
- * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
119
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
120
- * @memberof FutureCopyTradingApi
121
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
122
- */
123
- async getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
124
- const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(
125
- requestParameters?.recvWindow
126
- );
127
- return sendRequest(
128
- this.configuration,
129
- localVarAxiosArgs.endpoint,
130
- localVarAxiosArgs.method,
131
- localVarAxiosArgs.params,
132
- localVarAxiosArgs?.timeUnit,
133
- { isSigned: true }
134
- );
135
- }
58
+ constructor(configuration) {
59
+ this.configuration = configuration;
60
+ this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);
61
+ }
62
+ /**
63
+ * Get Futures Lead Trader Status
64
+ *
65
+ * Weight: 20
66
+ *
67
+ * @summary Get Futures Lead Trader Status(TRADE)
68
+ * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
69
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
70
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
71
+ * @memberof FutureCopyTradingApi
72
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
73
+ */
74
+ async getFuturesLeadTraderStatus(requestParameters = {}) {
75
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(requestParameters?.recvWindow);
76
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
77
+ }
78
+ /**
79
+ * Get Futures Lead Trading Symbol Whitelist
80
+ *
81
+ * Weight: 20
82
+ *
83
+ * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
84
+ * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
85
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
86
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
87
+ * @memberof FutureCopyTradingApi
88
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
89
+ */
90
+ async getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
91
+ const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(requestParameters?.recvWindow);
92
+ return sendRequest(this.configuration, localVarAxiosArgs.endpoint, localVarAxiosArgs.method, localVarAxiosArgs.params, localVarAxiosArgs?.timeUnit, { isSigned: true });
93
+ }
136
94
  };
137
95
 
138
- // src/rest-api/rest-api.ts
139
- import { sendRequest as sendRequest2 } from "@binance/common";
96
+ //#endregion
97
+ //#region src/rest-api/rest-api.ts
98
+ /**
99
+ * Binance Copy Trading REST API
100
+ *
101
+ * OpenAPI Specification for the Binance Copy Trading REST API
102
+ *
103
+ * The version of the OpenAPI document: 1.0.0
104
+ *
105
+ *
106
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
107
+ * https://openapi-generator.tech
108
+ * Do not edit the class manually.
109
+ */
140
110
  var RestAPI = class {
141
- constructor(configuration) {
142
- this.configuration = configuration;
143
- this.futureCopyTradingApi = new FutureCopyTradingApi(configuration);
144
- }
145
- /**
146
- * Generic function to send a request.
147
- * @param endpoint - The API endpoint to call.
148
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
149
- * @param params - Query parameters for the request.
150
- *
151
- * @returns A promise resolving to the response data object.
152
- */
153
- sendRequest(endpoint, method, params = {}) {
154
- return sendRequest2(this.configuration, endpoint, method, params, void 0);
155
- }
156
- /**
157
- * Generic function to send a signed request.
158
- * @param endpoint - The API endpoint to call.
159
- * @param method - HTTP method to use (GET, POST, DELETE, etc.).
160
- * @param params - Query parameters for the request.
161
- *
162
- * @returns A promise resolving to the response data object.
163
- */
164
- sendSignedRequest(endpoint, method, params = {}) {
165
- return sendRequest2(this.configuration, endpoint, method, params, void 0, {
166
- isSigned: true
167
- });
168
- }
169
- /**
170
- * Get Futures Lead Trader Status
171
- *
172
- * Weight: 20
173
- *
174
- * @summary Get Futures Lead Trader Status(TRADE)
175
- * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
176
- *
177
- * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
178
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
179
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
180
- */
181
- getFuturesLeadTraderStatus(requestParameters = {}) {
182
- return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);
183
- }
184
- /**
185
- * Get Futures Lead Trading Symbol Whitelist
186
- *
187
- * Weight: 20
188
- *
189
- * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
190
- * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
191
- *
192
- * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
193
- * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
194
- * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
195
- */
196
- getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
197
- return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);
198
- }
111
+ constructor(configuration) {
112
+ this.configuration = configuration;
113
+ this.futureCopyTradingApi = new FutureCopyTradingApi(configuration);
114
+ }
115
+ /**
116
+ * Generic function to send a request.
117
+ * @param endpoint - The API endpoint to call.
118
+ * @param method - HTTP method to use (GET, POST, DELETE, etc.).
119
+ * @param params - Query parameters for the request.
120
+ *
121
+ * @returns A promise resolving to the response data object.
122
+ */
123
+ sendRequest(endpoint, method, params = {}) {
124
+ return sendRequest(this.configuration, endpoint, method, params, void 0);
125
+ }
126
+ /**
127
+ * Generic function to send a signed 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
+ sendSignedRequest(endpoint, method, params = {}) {
135
+ return sendRequest(this.configuration, endpoint, method, params, void 0, { isSigned: true });
136
+ }
137
+ /**
138
+ * Get Futures Lead Trader Status
139
+ *
140
+ * Weight: 20
141
+ *
142
+ * @summary Get Futures Lead Trader Status(TRADE)
143
+ * @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
144
+ *
145
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
146
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
147
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
148
+ */
149
+ getFuturesLeadTraderStatus(requestParameters = {}) {
150
+ return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);
151
+ }
152
+ /**
153
+ * Get Futures Lead Trading Symbol Whitelist
154
+ *
155
+ * Weight: 20
156
+ *
157
+ * @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
158
+ * @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
159
+ *
160
+ * @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
161
+ * @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
162
+ * @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
163
+ */
164
+ getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
165
+ return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);
166
+ }
199
167
  };
200
168
 
201
- // src/copy-trading.ts
169
+ //#endregion
170
+ //#region src/rest-api/index.ts
171
+ var rest_api_exports = /* @__PURE__ */ __export({
172
+ FutureCopyTradingApi: () => FutureCopyTradingApi,
173
+ RestAPI: () => RestAPI
174
+ });
175
+
176
+ //#endregion
177
+ //#region src/copy-trading.ts
202
178
  var CopyTrading = class {
203
- constructor(config) {
204
- const userAgent = buildUserAgent(name, version);
205
- if (config?.configurationRestAPI) {
206
- const configRestAPI = new ConfigurationRestAPI3(
207
- config.configurationRestAPI
208
- );
209
- configRestAPI.basePath = configRestAPI.basePath || COPY_TRADING_REST_API_PROD_URL;
210
- configRestAPI.baseOptions = configRestAPI.baseOptions || {};
211
- configRestAPI.baseOptions.headers = {
212
- ...configRestAPI.baseOptions.headers || {},
213
- "User-Agent": userAgent
214
- };
215
- this.restAPI = new RestAPI(configRestAPI);
216
- }
217
- }
179
+ constructor(config) {
180
+ const userAgent = buildUserAgent(name, version);
181
+ if (config?.configurationRestAPI) {
182
+ const configRestAPI = new ConfigurationRestAPI(config.configurationRestAPI);
183
+ configRestAPI.basePath = configRestAPI.basePath || COPY_TRADING_REST_API_PROD_URL$1;
184
+ configRestAPI.baseOptions = configRestAPI.baseOptions || {};
185
+ configRestAPI.baseOptions.headers = {
186
+ ...configRestAPI.baseOptions.headers || {},
187
+ "User-Agent": userAgent
188
+ };
189
+ this.restAPI = new RestAPI(configRestAPI);
190
+ }
191
+ }
218
192
  };
219
193
 
220
- // src/index.ts
221
- import {
222
- COPY_TRADING_REST_API_PROD_URL as COPY_TRADING_REST_API_PROD_URL2,
223
- ConnectorClientError,
224
- RequiredError,
225
- UnauthorizedError,
226
- ForbiddenError,
227
- TooManyRequestsError,
228
- RateLimitBanError,
229
- ServerError,
230
- NetworkError,
231
- NotFoundError,
232
- BadRequestError
233
- } from "@binance/common";
234
- export {
235
- BadRequestError,
236
- COPY_TRADING_REST_API_PROD_URL2 as COPY_TRADING_REST_API_PROD_URL,
237
- ConnectorClientError,
238
- CopyTrading,
239
- rest_api_exports as CopyTradingRestAPI,
240
- ForbiddenError,
241
- NetworkError,
242
- NotFoundError,
243
- RateLimitBanError,
244
- RequiredError,
245
- ServerError,
246
- TooManyRequestsError,
247
- UnauthorizedError
248
- };
194
+ //#endregion
195
+ export { BadRequestError, COPY_TRADING_REST_API_PROD_URL, ConfigurationCopyTrading, ConnectorClientError, CopyTrading, rest_api_exports as CopyTradingRestAPI, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError };
249
196
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../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","../src/index.ts"],"sourcesContent":["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","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"],"mappings":";;;;;;;AAA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;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,YAAY,eAAe,MAAM,OAAO;AAE9C,QAAI,QAAQ,sBAAsB;AAC9B,YAAM,gBAAgB,IAAIC;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;;;AK9BA;AAAA,EACI,kCAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;","names":["ConfigurationRestAPI","sendRequest","sendRequest","ConfigurationRestAPI","COPY_TRADING_REST_API_PROD_URL"]}
1
+ {"version":3,"file":"index.mjs","names":["localVarQueryParameter: Record<string, unknown>","_timeUnit: TimeUnit | undefined","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.2\",\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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SAAO,KAAK,qBAAqB,qCAAqC,kBAAkB;;;;;;;;;;;;;AE1FhG,IAAa,cAAb,MAAyB;CAGrB,YAAY,QAAkC;EAC1C,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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@binance/copy-trading",
3
3
  "description": "Official Binance Copy Trading Connector - A lightweight library that provides a convenient interface to Binance's Copy Trading REST API.",
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "prepublishOnly": "npm run build",
16
- "build": "npm run clean && tsup",
16
+ "build": "npm run clean && tsdown",
17
17
  "typecheck": "tsc --noEmit",
18
18
  "clean": "rm -rf dist",
19
19
  "test": "npx jest --maxWorkers=4 --bail",
@@ -50,12 +50,12 @@
50
50
  "prettier": "^3.3.3",
51
51
  "ts-jest": "^29.1.1",
52
52
  "ts-node": "^10.9.1",
53
- "tsup": "^8.4.0",
53
+ "tsdown": "^0.16.5",
54
54
  "typescript": "^5.7.2",
55
55
  "typescript-eslint": "^8.24.0"
56
56
  },
57
57
  "dependencies": {
58
- "@binance/common": "2.0.0",
58
+ "@binance/common": "2.0.1",
59
59
  "axios": "^1.7.4"
60
60
  }
61
61
  }