@binance/copy-trading 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE +21 -0
- package/README.md +199 -0
- package/dist/index.d.mts +402 -0
- package/dist/index.d.ts +402 -0
- package/dist/index.js +264 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +245 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { RestApiResponse, ConfigurationRestAPI } from '@binance/common';
|
|
2
|
+
export { BadRequestError, COPY_TRADING_REST_API_PROD_URL, COPY_TRADING_REST_API_TESTNET_URL, ConnectorClientError, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError } from '@binance/common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Binance Public Copy Trading REST API
|
|
6
|
+
*
|
|
7
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
8
|
+
*
|
|
9
|
+
* The version of the OpenAPI document: 1.0.0
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
13
|
+
* https://openapi-generator.tech
|
|
14
|
+
* Do not edit the class manually.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface BadRequest
|
|
20
|
+
*/
|
|
21
|
+
interface BadRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof BadRequest
|
|
26
|
+
*/
|
|
27
|
+
code: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof BadRequest
|
|
32
|
+
*/
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Binance Public Copy Trading REST API
|
|
38
|
+
*
|
|
39
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
40
|
+
*
|
|
41
|
+
* The version of the OpenAPI document: 1.0.0
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
45
|
+
* https://openapi-generator.tech
|
|
46
|
+
* Do not edit the class manually.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @export
|
|
51
|
+
* @interface GetFuturesLeadTraderStatusResponseData
|
|
52
|
+
*/
|
|
53
|
+
interface GetFuturesLeadTraderStatusResponseData {
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
* @memberof GetFuturesLeadTraderStatusResponseData
|
|
58
|
+
*/
|
|
59
|
+
isLeadTrader?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {number}
|
|
63
|
+
* @memberof GetFuturesLeadTraderStatusResponseData
|
|
64
|
+
*/
|
|
65
|
+
time?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Binance Public Copy Trading REST API
|
|
70
|
+
*
|
|
71
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
72
|
+
*
|
|
73
|
+
* The version of the OpenAPI document: 1.0.0
|
|
74
|
+
*
|
|
75
|
+
*
|
|
76
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
77
|
+
* https://openapi-generator.tech
|
|
78
|
+
* Do not edit the class manually.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @export
|
|
84
|
+
* @interface GetFuturesLeadTraderStatusResponse
|
|
85
|
+
*/
|
|
86
|
+
interface GetFuturesLeadTraderStatusResponse {
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @type {string}
|
|
90
|
+
* @memberof GetFuturesLeadTraderStatusResponse
|
|
91
|
+
*/
|
|
92
|
+
code?: string;
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @type {string}
|
|
96
|
+
* @memberof GetFuturesLeadTraderStatusResponse
|
|
97
|
+
*/
|
|
98
|
+
message?: string;
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @type {GetFuturesLeadTraderStatusResponseData}
|
|
102
|
+
* @memberof GetFuturesLeadTraderStatusResponse
|
|
103
|
+
*/
|
|
104
|
+
data?: GetFuturesLeadTraderStatusResponseData;
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
* @type {boolean}
|
|
108
|
+
* @memberof GetFuturesLeadTraderStatusResponse
|
|
109
|
+
*/
|
|
110
|
+
success?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Binance Public Copy Trading REST API
|
|
115
|
+
*
|
|
116
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
117
|
+
*
|
|
118
|
+
* The version of the OpenAPI document: 1.0.0
|
|
119
|
+
*
|
|
120
|
+
*
|
|
121
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
122
|
+
* https://openapi-generator.tech
|
|
123
|
+
* Do not edit the class manually.
|
|
124
|
+
*/
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* @export
|
|
128
|
+
* @interface GetFuturesLeadTradingSymbolWhitelistResponseDataInner
|
|
129
|
+
*/
|
|
130
|
+
interface GetFuturesLeadTradingSymbolWhitelistResponseDataInner {
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* @type {string}
|
|
134
|
+
* @memberof GetFuturesLeadTradingSymbolWhitelistResponseDataInner
|
|
135
|
+
*/
|
|
136
|
+
symbol?: string;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @type {string}
|
|
140
|
+
* @memberof GetFuturesLeadTradingSymbolWhitelistResponseDataInner
|
|
141
|
+
*/
|
|
142
|
+
baseAsset?: string;
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
* @type {string}
|
|
146
|
+
* @memberof GetFuturesLeadTradingSymbolWhitelistResponseDataInner
|
|
147
|
+
*/
|
|
148
|
+
quoteAsset?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Binance Public Copy Trading REST API
|
|
153
|
+
*
|
|
154
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
155
|
+
*
|
|
156
|
+
* The version of the OpenAPI document: 1.0.0
|
|
157
|
+
*
|
|
158
|
+
*
|
|
159
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
160
|
+
* https://openapi-generator.tech
|
|
161
|
+
* Do not edit the class manually.
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
*
|
|
166
|
+
* @export
|
|
167
|
+
* @interface GetFuturesLeadTradingSymbolWhitelistResponse
|
|
168
|
+
*/
|
|
169
|
+
interface GetFuturesLeadTradingSymbolWhitelistResponse {
|
|
170
|
+
/**
|
|
171
|
+
*
|
|
172
|
+
* @type {string}
|
|
173
|
+
* @memberof GetFuturesLeadTradingSymbolWhitelistResponse
|
|
174
|
+
*/
|
|
175
|
+
code?: string;
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* @type {string}
|
|
179
|
+
* @memberof GetFuturesLeadTradingSymbolWhitelistResponse
|
|
180
|
+
*/
|
|
181
|
+
message?: string;
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
* @type {Array<GetFuturesLeadTradingSymbolWhitelistResponseDataInner>}
|
|
185
|
+
* @memberof GetFuturesLeadTradingSymbolWhitelistResponse
|
|
186
|
+
*/
|
|
187
|
+
data?: Array<GetFuturesLeadTradingSymbolWhitelistResponseDataInner>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Binance Public Copy Trading REST API
|
|
192
|
+
*
|
|
193
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
194
|
+
*
|
|
195
|
+
* The version of the OpenAPI document: 1.0.0
|
|
196
|
+
*
|
|
197
|
+
*
|
|
198
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
199
|
+
* https://openapi-generator.tech
|
|
200
|
+
* Do not edit the class manually.
|
|
201
|
+
*/
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* FutureCopyTradingApi - interface
|
|
205
|
+
* @interface FutureCopyTradingApi
|
|
206
|
+
*/
|
|
207
|
+
interface FutureCopyTradingApiInterface {
|
|
208
|
+
/**
|
|
209
|
+
* Get Futures Lead Trader Status
|
|
210
|
+
*
|
|
211
|
+
* Weight: 20
|
|
212
|
+
*
|
|
213
|
+
* @summary Get Futures Lead Trader Status(TRADE)
|
|
214
|
+
* @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
|
|
215
|
+
*
|
|
216
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
217
|
+
* @memberof FutureCopyTradingApiInterface
|
|
218
|
+
*/
|
|
219
|
+
getFuturesLeadTraderStatus(requestParameters?: GetFuturesLeadTraderStatusRequest): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>;
|
|
220
|
+
/**
|
|
221
|
+
* Get Futures Lead Trading Symbol Whitelist
|
|
222
|
+
*
|
|
223
|
+
* Weight: 20
|
|
224
|
+
*
|
|
225
|
+
* @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
|
|
226
|
+
* @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
|
|
227
|
+
*
|
|
228
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
229
|
+
* @memberof FutureCopyTradingApiInterface
|
|
230
|
+
*/
|
|
231
|
+
getFuturesLeadTradingSymbolWhitelist(requestParameters?: GetFuturesLeadTradingSymbolWhitelistRequest): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Request parameters for getFuturesLeadTraderStatus operation in FutureCopyTradingApi.
|
|
235
|
+
* @interface GetFuturesLeadTraderStatusRequest
|
|
236
|
+
*/
|
|
237
|
+
interface GetFuturesLeadTraderStatusRequest {
|
|
238
|
+
/**
|
|
239
|
+
*
|
|
240
|
+
* @type {number}
|
|
241
|
+
* @memberof FutureCopyTradingApiGetFuturesLeadTraderStatus
|
|
242
|
+
*/
|
|
243
|
+
readonly recvWindow?: number;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Request parameters for getFuturesLeadTradingSymbolWhitelist operation in FutureCopyTradingApi.
|
|
247
|
+
* @interface GetFuturesLeadTradingSymbolWhitelistRequest
|
|
248
|
+
*/
|
|
249
|
+
interface GetFuturesLeadTradingSymbolWhitelistRequest {
|
|
250
|
+
/**
|
|
251
|
+
*
|
|
252
|
+
* @type {number}
|
|
253
|
+
* @memberof FutureCopyTradingApiGetFuturesLeadTradingSymbolWhitelist
|
|
254
|
+
*/
|
|
255
|
+
readonly recvWindow?: number;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* FutureCopyTradingApi - object-oriented interface
|
|
259
|
+
* @class FutureCopyTradingApi
|
|
260
|
+
*/
|
|
261
|
+
declare class FutureCopyTradingApi implements FutureCopyTradingApiInterface {
|
|
262
|
+
private readonly configuration;
|
|
263
|
+
private localVarAxiosParamCreator;
|
|
264
|
+
constructor(configuration: ConfigurationRestAPI);
|
|
265
|
+
/**
|
|
266
|
+
* Get Futures Lead Trader Status
|
|
267
|
+
*
|
|
268
|
+
* Weight: 20
|
|
269
|
+
*
|
|
270
|
+
* @summary Get Futures Lead Trader Status(TRADE)
|
|
271
|
+
* @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
|
|
272
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
|
|
273
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
274
|
+
* @memberof FutureCopyTradingApi
|
|
275
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
|
|
276
|
+
*/
|
|
277
|
+
getFuturesLeadTraderStatus(requestParameters?: GetFuturesLeadTraderStatusRequest): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>;
|
|
278
|
+
/**
|
|
279
|
+
* Get Futures Lead Trading Symbol Whitelist
|
|
280
|
+
*
|
|
281
|
+
* Weight: 20
|
|
282
|
+
*
|
|
283
|
+
* @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
|
|
284
|
+
* @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
|
|
285
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
|
|
286
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
287
|
+
* @memberof FutureCopyTradingApi
|
|
288
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
|
|
289
|
+
*/
|
|
290
|
+
getFuturesLeadTradingSymbolWhitelist(requestParameters?: GetFuturesLeadTradingSymbolWhitelistRequest): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Binance Public Copy Trading REST API
|
|
295
|
+
*
|
|
296
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
297
|
+
*
|
|
298
|
+
* The version of the OpenAPI document: 1.0.0
|
|
299
|
+
*
|
|
300
|
+
*
|
|
301
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
302
|
+
* https://openapi-generator.tech
|
|
303
|
+
* Do not edit the class manually.
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
declare class RestAPI {
|
|
307
|
+
private configuration;
|
|
308
|
+
private futureCopyTradingApi;
|
|
309
|
+
constructor(configuration: ConfigurationRestAPI);
|
|
310
|
+
/**
|
|
311
|
+
* Generic function to send a request.
|
|
312
|
+
* @param endpoint - The API endpoint to call.
|
|
313
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
314
|
+
* @param params - Query parameters for the request.
|
|
315
|
+
*
|
|
316
|
+
* @returns A promise resolving to the response data object.
|
|
317
|
+
*/
|
|
318
|
+
sendRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
319
|
+
/**
|
|
320
|
+
* Generic function to send a signed request.
|
|
321
|
+
* @param endpoint - The API endpoint to call.
|
|
322
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
323
|
+
* @param params - Query parameters for the request.
|
|
324
|
+
*
|
|
325
|
+
* @returns A promise resolving to the response data object.
|
|
326
|
+
*/
|
|
327
|
+
sendSignedRequest<T>(endpoint: string, method: 'GET' | 'POST' | 'DELETE' | 'PUT' | 'PATCH', params?: Record<string, unknown>): Promise<RestApiResponse<T>>;
|
|
328
|
+
/**
|
|
329
|
+
* Get Futures Lead Trader Status
|
|
330
|
+
*
|
|
331
|
+
* Weight: 20
|
|
332
|
+
*
|
|
333
|
+
* @summary Get Futures Lead Trader Status(TRADE)
|
|
334
|
+
* @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
|
|
335
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
|
|
336
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
337
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
|
|
338
|
+
*/
|
|
339
|
+
getFuturesLeadTraderStatus(requestParameters?: GetFuturesLeadTraderStatusRequest): Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>;
|
|
340
|
+
/**
|
|
341
|
+
* Get Futures Lead Trading Symbol Whitelist
|
|
342
|
+
*
|
|
343
|
+
* Weight: 20
|
|
344
|
+
*
|
|
345
|
+
* @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
|
|
346
|
+
* @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
|
|
347
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
|
|
348
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
349
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
|
|
350
|
+
*/
|
|
351
|
+
getFuturesLeadTradingSymbolWhitelist(requestParameters?: GetFuturesLeadTradingSymbolWhitelistRequest): Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Binance Public Copy Trading REST API
|
|
356
|
+
*
|
|
357
|
+
* OpenAPI Specification for the Binance Public Copy Trading REST API
|
|
358
|
+
*
|
|
359
|
+
* The version of the OpenAPI document: 1.0.0
|
|
360
|
+
*
|
|
361
|
+
*
|
|
362
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
363
|
+
* https://openapi-generator.tech
|
|
364
|
+
* Do not edit the class manually.
|
|
365
|
+
*/
|
|
366
|
+
|
|
367
|
+
type index_BadRequest = BadRequest;
|
|
368
|
+
type index_FutureCopyTradingApi = FutureCopyTradingApi;
|
|
369
|
+
declare const index_FutureCopyTradingApi: typeof FutureCopyTradingApi;
|
|
370
|
+
type index_FutureCopyTradingApiInterface = FutureCopyTradingApiInterface;
|
|
371
|
+
type index_GetFuturesLeadTraderStatusRequest = GetFuturesLeadTraderStatusRequest;
|
|
372
|
+
type index_GetFuturesLeadTraderStatusResponse = GetFuturesLeadTraderStatusResponse;
|
|
373
|
+
type index_GetFuturesLeadTraderStatusResponseData = GetFuturesLeadTraderStatusResponseData;
|
|
374
|
+
type index_GetFuturesLeadTradingSymbolWhitelistRequest = GetFuturesLeadTradingSymbolWhitelistRequest;
|
|
375
|
+
type index_GetFuturesLeadTradingSymbolWhitelistResponse = GetFuturesLeadTradingSymbolWhitelistResponse;
|
|
376
|
+
type index_GetFuturesLeadTradingSymbolWhitelistResponseDataInner = GetFuturesLeadTradingSymbolWhitelistResponseDataInner;
|
|
377
|
+
type index_RestAPI = RestAPI;
|
|
378
|
+
declare const index_RestAPI: typeof RestAPI;
|
|
379
|
+
declare namespace index {
|
|
380
|
+
export {
|
|
381
|
+
index_BadRequest as BadRequest,
|
|
382
|
+
index_FutureCopyTradingApi as FutureCopyTradingApi,
|
|
383
|
+
index_FutureCopyTradingApiInterface as FutureCopyTradingApiInterface,
|
|
384
|
+
index_GetFuturesLeadTraderStatusRequest as GetFuturesLeadTraderStatusRequest,
|
|
385
|
+
index_GetFuturesLeadTraderStatusResponse as GetFuturesLeadTraderStatusResponse,
|
|
386
|
+
index_GetFuturesLeadTraderStatusResponseData as GetFuturesLeadTraderStatusResponseData,
|
|
387
|
+
index_GetFuturesLeadTradingSymbolWhitelistRequest as GetFuturesLeadTradingSymbolWhitelistRequest,
|
|
388
|
+
index_GetFuturesLeadTradingSymbolWhitelistResponse as GetFuturesLeadTradingSymbolWhitelistResponse,
|
|
389
|
+
index_GetFuturesLeadTradingSymbolWhitelistResponseDataInner as GetFuturesLeadTradingSymbolWhitelistResponseDataInner,
|
|
390
|
+
index_RestAPI as RestAPI,
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
interface ConfigurationCopyTrading {
|
|
395
|
+
configurationRestAPI?: ConfigurationRestAPI;
|
|
396
|
+
}
|
|
397
|
+
declare class CopyTrading {
|
|
398
|
+
restAPI: RestAPI;
|
|
399
|
+
constructor(config: ConfigurationCopyTrading);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export { ConfigurationCopyTrading, CopyTrading, index as CopyTradingRestAPI };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
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 });
|
|
9
|
+
};
|
|
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
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
BadRequestError: () => import_common4.BadRequestError,
|
|
24
|
+
COPY_TRADING_REST_API_PROD_URL: () => import_common4.COPY_TRADING_REST_API_PROD_URL,
|
|
25
|
+
COPY_TRADING_REST_API_TESTNET_URL: () => import_common4.COPY_TRADING_REST_API_TESTNET_URL,
|
|
26
|
+
ConnectorClientError: () => import_common4.ConnectorClientError,
|
|
27
|
+
CopyTrading: () => CopyTrading,
|
|
28
|
+
CopyTradingRestAPI: () => rest_api_exports,
|
|
29
|
+
ForbiddenError: () => import_common4.ForbiddenError,
|
|
30
|
+
NetworkError: () => import_common4.NetworkError,
|
|
31
|
+
NotFoundError: () => import_common4.NotFoundError,
|
|
32
|
+
RateLimitBanError: () => import_common4.RateLimitBanError,
|
|
33
|
+
RequiredError: () => import_common4.RequiredError,
|
|
34
|
+
ServerError: () => import_common4.ServerError,
|
|
35
|
+
TooManyRequestsError: () => import_common4.TooManyRequestsError,
|
|
36
|
+
UnauthorizedError: () => import_common4.UnauthorizedError
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(src_exports);
|
|
39
|
+
|
|
40
|
+
// src/copy-trading.ts
|
|
41
|
+
var import_os = require("os");
|
|
42
|
+
var import_common3 = require("@binance/common");
|
|
43
|
+
|
|
44
|
+
// package.json
|
|
45
|
+
var name = "@binance/copy-trading";
|
|
46
|
+
var version = "1.0.0";
|
|
47
|
+
|
|
48
|
+
// src/rest-api/index.ts
|
|
49
|
+
var rest_api_exports = {};
|
|
50
|
+
__export(rest_api_exports, {
|
|
51
|
+
FutureCopyTradingApi: () => FutureCopyTradingApi,
|
|
52
|
+
RestAPI: () => RestAPI
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// src/rest-api/modules/future-copy-trading-api.ts
|
|
56
|
+
var import_common = require("@binance/common");
|
|
57
|
+
var FutureCopyTradingApiAxiosParamCreator = function(configuration) {
|
|
58
|
+
return {
|
|
59
|
+
/**
|
|
60
|
+
* Get Futures Lead Trader Status
|
|
61
|
+
*
|
|
62
|
+
* Weight: 20
|
|
63
|
+
*
|
|
64
|
+
* @summary Get Futures Lead Trader Status(TRADE)
|
|
65
|
+
* @param {number} [recvWindow]
|
|
66
|
+
*
|
|
67
|
+
* @throws {RequiredError}
|
|
68
|
+
*/
|
|
69
|
+
getFuturesLeadTraderStatus: async (recvWindow) => {
|
|
70
|
+
const localVarQueryParameter = {};
|
|
71
|
+
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
72
|
+
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
73
|
+
}
|
|
74
|
+
let _timeUnit;
|
|
75
|
+
if ("timeUnit" in configuration)
|
|
76
|
+
_timeUnit = configuration.timeUnit;
|
|
77
|
+
return {
|
|
78
|
+
endpoint: "/sapi/v1/copyTrading/futures/userStatus",
|
|
79
|
+
method: "GET",
|
|
80
|
+
params: localVarQueryParameter,
|
|
81
|
+
timeUnit: _timeUnit
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Get Futures Lead Trading Symbol Whitelist
|
|
86
|
+
*
|
|
87
|
+
* Weight: 20
|
|
88
|
+
*
|
|
89
|
+
* @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
|
|
90
|
+
* @param {number} [recvWindow]
|
|
91
|
+
*
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
*/
|
|
94
|
+
getFuturesLeadTradingSymbolWhitelist: async (recvWindow) => {
|
|
95
|
+
const localVarQueryParameter = {};
|
|
96
|
+
if (recvWindow !== void 0 && recvWindow !== null) {
|
|
97
|
+
localVarQueryParameter["recvWindow"] = recvWindow;
|
|
98
|
+
}
|
|
99
|
+
let _timeUnit;
|
|
100
|
+
if ("timeUnit" in configuration)
|
|
101
|
+
_timeUnit = configuration.timeUnit;
|
|
102
|
+
return {
|
|
103
|
+
endpoint: "/sapi/v1/copyTrading/futures/leadSymbol",
|
|
104
|
+
method: "GET",
|
|
105
|
+
params: localVarQueryParameter,
|
|
106
|
+
timeUnit: _timeUnit
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
var FutureCopyTradingApi = class {
|
|
112
|
+
constructor(configuration) {
|
|
113
|
+
this.configuration = configuration;
|
|
114
|
+
this.localVarAxiosParamCreator = FutureCopyTradingApiAxiosParamCreator(configuration);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get Futures Lead Trader Status
|
|
118
|
+
*
|
|
119
|
+
* Weight: 20
|
|
120
|
+
*
|
|
121
|
+
* @summary Get Futures Lead Trader Status(TRADE)
|
|
122
|
+
* @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
|
|
123
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
|
|
124
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
125
|
+
* @memberof FutureCopyTradingApi
|
|
126
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
|
|
127
|
+
*/
|
|
128
|
+
async getFuturesLeadTraderStatus(requestParameters = {}) {
|
|
129
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTraderStatus(
|
|
130
|
+
requestParameters?.recvWindow
|
|
131
|
+
);
|
|
132
|
+
return (0, import_common.sendRequest)(
|
|
133
|
+
this.configuration,
|
|
134
|
+
localVarAxiosArgs.endpoint,
|
|
135
|
+
localVarAxiosArgs.method,
|
|
136
|
+
localVarAxiosArgs.params,
|
|
137
|
+
localVarAxiosArgs?.timeUnit,
|
|
138
|
+
{ isSigned: true }
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get Futures Lead Trading Symbol Whitelist
|
|
143
|
+
*
|
|
144
|
+
* Weight: 20
|
|
145
|
+
*
|
|
146
|
+
* @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
|
|
147
|
+
* @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
|
|
148
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
|
|
149
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
150
|
+
* @memberof FutureCopyTradingApi
|
|
151
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
|
|
152
|
+
*/
|
|
153
|
+
async getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
|
|
154
|
+
const localVarAxiosArgs = await this.localVarAxiosParamCreator.getFuturesLeadTradingSymbolWhitelist(
|
|
155
|
+
requestParameters?.recvWindow
|
|
156
|
+
);
|
|
157
|
+
return (0, import_common.sendRequest)(
|
|
158
|
+
this.configuration,
|
|
159
|
+
localVarAxiosArgs.endpoint,
|
|
160
|
+
localVarAxiosArgs.method,
|
|
161
|
+
localVarAxiosArgs.params,
|
|
162
|
+
localVarAxiosArgs?.timeUnit,
|
|
163
|
+
{ isSigned: true }
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// src/rest-api/rest-api.ts
|
|
169
|
+
var import_common2 = require("@binance/common");
|
|
170
|
+
var RestAPI = class {
|
|
171
|
+
constructor(configuration) {
|
|
172
|
+
this.configuration = configuration;
|
|
173
|
+
this.futureCopyTradingApi = new FutureCopyTradingApi(configuration);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Generic function to send a request.
|
|
177
|
+
* @param endpoint - The API endpoint to call.
|
|
178
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
179
|
+
* @param params - Query parameters for the request.
|
|
180
|
+
*
|
|
181
|
+
* @returns A promise resolving to the response data object.
|
|
182
|
+
*/
|
|
183
|
+
sendRequest(endpoint, method, params = {}) {
|
|
184
|
+
return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Generic function to send a signed request.
|
|
188
|
+
* @param endpoint - The API endpoint to call.
|
|
189
|
+
* @param method - HTTP method to use (GET, POST, DELETE, etc.).
|
|
190
|
+
* @param params - Query parameters for the request.
|
|
191
|
+
*
|
|
192
|
+
* @returns A promise resolving to the response data object.
|
|
193
|
+
*/
|
|
194
|
+
sendSignedRequest(endpoint, method, params = {}) {
|
|
195
|
+
return (0, import_common2.sendRequest)(this.configuration, endpoint, method, params, void 0, {
|
|
196
|
+
isSigned: true
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get Futures Lead Trader Status
|
|
201
|
+
*
|
|
202
|
+
* Weight: 20
|
|
203
|
+
*
|
|
204
|
+
* @summary Get Futures Lead Trader Status(TRADE)
|
|
205
|
+
* @param {GetFuturesLeadTraderStatusRequest} requestParameters Request parameters.
|
|
206
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTraderStatusResponse>>}
|
|
207
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
208
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trader-Status Binance API Documentation}
|
|
209
|
+
*/
|
|
210
|
+
getFuturesLeadTraderStatus(requestParameters = {}) {
|
|
211
|
+
return this.futureCopyTradingApi.getFuturesLeadTraderStatus(requestParameters);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Get Futures Lead Trading Symbol Whitelist
|
|
215
|
+
*
|
|
216
|
+
* Weight: 20
|
|
217
|
+
*
|
|
218
|
+
* @summary Get Futures Lead Trading Symbol Whitelist(USER_DATA)
|
|
219
|
+
* @param {GetFuturesLeadTradingSymbolWhitelistRequest} requestParameters Request parameters.
|
|
220
|
+
* @returns {Promise<RestApiResponse<GetFuturesLeadTradingSymbolWhitelistResponse>>}
|
|
221
|
+
* @throws {RequiredError | ConnectorClientError | UnauthorizedError | ForbiddenError | TooManyRequestsError | RateLimitBanError | ServerError | NotFoundError | NetworkError | BadRequestError}
|
|
222
|
+
* @see {@link https://developers.binance.com/docs/copy_trading/future-copy-trading/Get-Futures-Lead-Trading-Symbol-Whitelist Binance API Documentation}
|
|
223
|
+
*/
|
|
224
|
+
getFuturesLeadTradingSymbolWhitelist(requestParameters = {}) {
|
|
225
|
+
return this.futureCopyTradingApi.getFuturesLeadTradingSymbolWhitelist(requestParameters);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
// src/copy-trading.ts
|
|
230
|
+
var CopyTrading = class {
|
|
231
|
+
constructor(config) {
|
|
232
|
+
if (config?.configurationRestAPI) {
|
|
233
|
+
const configRestAPI = new import_common3.ConfigurationRestAPI(config.configurationRestAPI);
|
|
234
|
+
configRestAPI.basePath = configRestAPI.basePath || import_common3.COPY_TRADING_REST_API_PROD_URL;
|
|
235
|
+
configRestAPI.baseOptions = configRestAPI.baseOptions || {};
|
|
236
|
+
configRestAPI.baseOptions.headers = {
|
|
237
|
+
...configRestAPI.baseOptions.headers || {},
|
|
238
|
+
"User-Agent": `${name}/${version} (Node.js/${process.version}; ${(0, import_os.platform)()}; ${(0, import_os.arch)()})`
|
|
239
|
+
};
|
|
240
|
+
this.restAPI = new RestAPI(configRestAPI);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// src/index.ts
|
|
246
|
+
var import_common4 = require("@binance/common");
|
|
247
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
248
|
+
0 && (module.exports = {
|
|
249
|
+
BadRequestError,
|
|
250
|
+
COPY_TRADING_REST_API_PROD_URL,
|
|
251
|
+
COPY_TRADING_REST_API_TESTNET_URL,
|
|
252
|
+
ConnectorClientError,
|
|
253
|
+
CopyTrading,
|
|
254
|
+
CopyTradingRestAPI,
|
|
255
|
+
ForbiddenError,
|
|
256
|
+
NetworkError,
|
|
257
|
+
NotFoundError,
|
|
258
|
+
RateLimitBanError,
|
|
259
|
+
RequiredError,
|
|
260
|
+
ServerError,
|
|
261
|
+
TooManyRequestsError,
|
|
262
|
+
UnauthorizedError
|
|
263
|
+
});
|
|
264
|
+
//# sourceMappingURL=index.js.map
|