@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/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Binance
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Binance JavaScript Copy Trading Connector
|
|
2
|
+
|
|
3
|
+
[](https://github.com/binance/binance-connector-js/issues)
|
|
4
|
+
[](https://prettier.io/)
|
|
5
|
+
[](https://badge.fury.io/js/@binance%2Fcopy-trading)
|
|
6
|
+
[](https://www.npmjs.com/package/@binance/copy-trading)
|
|
7
|
+

|
|
8
|
+
[](https://snyk.io/test/github/binance/binance-connector-js)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
|
|
11
|
+
This is a client library for the Binance Copy Trading API, enabling developers to interact programmatically with Binance's Copy Trading trading platform. The library provides tools to do automatic lead trading through the REST API:
|
|
12
|
+
|
|
13
|
+
- [REST API](./src/rest-api/rest-api.ts)
|
|
14
|
+
|
|
15
|
+
## Table of Contents
|
|
16
|
+
|
|
17
|
+
- [Supported Features](#supported-features)
|
|
18
|
+
- [Installation](#installation)
|
|
19
|
+
- [Documentation](#documentation)
|
|
20
|
+
- [REST APIs](#rest-apis)
|
|
21
|
+
- [Testing](#testing)
|
|
22
|
+
- [Migration Guide](#migration-guide)
|
|
23
|
+
- [Contributing](#contributing)
|
|
24
|
+
- [Licence](#licence)
|
|
25
|
+
|
|
26
|
+
## Supported Features
|
|
27
|
+
|
|
28
|
+
- REST API Endpoints:
|
|
29
|
+
- `/sapi/v1/copyTrading/*`
|
|
30
|
+
- Inclusion of test cases and examples for quick onboarding.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
To use this library, ensure your environment is running Node.js version **22.12.0** or later. If you're using `nvm` (Node Version Manager), you can set the correct version as follows:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
nvm install 22.12.0
|
|
38
|
+
nvm use 22.12.0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then install the library using `npm`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @binance/copy-trading
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Documentation
|
|
48
|
+
|
|
49
|
+
For detailed information, refer to the [Binance API Documentation](https://developers.binance.com/docs/copy_trading).
|
|
50
|
+
|
|
51
|
+
### REST APIs
|
|
52
|
+
|
|
53
|
+
All REST API endpoints are available through the [`rest-api`](./src/rest-api/rest-api.ts) module. Note that some endpoints require authentication using your Binance API credentials.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { CopyTrading, CopyTradingRestAPI } from '@binance/copy-trading';
|
|
57
|
+
|
|
58
|
+
const configurationRestAPI = {
|
|
59
|
+
apiKey: 'your-api-key',
|
|
60
|
+
apiSecret: 'your-api-secret',
|
|
61
|
+
};
|
|
62
|
+
const client = new CopyTrading({ configurationRestAPI });
|
|
63
|
+
|
|
64
|
+
client.restAPI
|
|
65
|
+
.getFuturesLeadTraderStatus()
|
|
66
|
+
.then((res) => res.data())
|
|
67
|
+
.then((data: CopyTradingRestAPI.GetFuturesLeadTraderStatusResponse) => console.log(data))
|
|
68
|
+
.catch((err) => console.error(err));
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
More examples can be found in the [`examples/rest-api`](./examples/rest-api/) folder.
|
|
72
|
+
|
|
73
|
+
#### Configuration Options
|
|
74
|
+
|
|
75
|
+
The REST API supports the following advanced configuration options:
|
|
76
|
+
|
|
77
|
+
- `timeout`: Timeout for requests in milliseconds (default: 1000 ms).
|
|
78
|
+
- `proxy`: Proxy configuration:
|
|
79
|
+
- `host`: Proxy server hostname.
|
|
80
|
+
- `port`: Proxy server port.
|
|
81
|
+
- `protocol`: Proxy protocol (http or https).
|
|
82
|
+
- `auth`: Proxy authentication credentials:
|
|
83
|
+
- `username`: Proxy username.
|
|
84
|
+
- `password`: Proxy password.
|
|
85
|
+
- `keepAlive`: Enable HTTP keep-alive (default: true).
|
|
86
|
+
- `compression`: Enable response compression (default: true).
|
|
87
|
+
- `retries`: Number of retry attempts for failed requests (default: 3).
|
|
88
|
+
- `backoff`: Delay in milliseconds between retries (default: 1000 ms).
|
|
89
|
+
- `httpsAgent`: Custom HTTPS agent for advanced TLS configuration.
|
|
90
|
+
- `privateKey`: RSA or ED25519 private key for authentication.
|
|
91
|
+
- `privateKeyPassphrase`: Passphrase for the private key, if encrypted.
|
|
92
|
+
|
|
93
|
+
##### Timeout
|
|
94
|
+
|
|
95
|
+
You can configure a timeout for requests in milliseconds. If the request exceeds the specified timeout, it will be aborted. See the [Timeout example](./docs/rest-api/timeout.md) for detailed usage.
|
|
96
|
+
|
|
97
|
+
##### Proxy
|
|
98
|
+
|
|
99
|
+
The REST API supports HTTP/HTTPS proxy configurations. See the [Proxy example](./docs/rest-api/proxy.md) for detailed usage.
|
|
100
|
+
|
|
101
|
+
##### Keep-Alive
|
|
102
|
+
|
|
103
|
+
Enable HTTP keep-alive for persistent connections. See the [Keep-Alive example](./docs/rest-api/keepAlive.md) for detailed usage.
|
|
104
|
+
|
|
105
|
+
##### Compression
|
|
106
|
+
|
|
107
|
+
Enable or disable response compression. See the [Compression example](./docs/rest-api/compression.md) for detailed usage.
|
|
108
|
+
|
|
109
|
+
##### Retries
|
|
110
|
+
|
|
111
|
+
Configure the number of retry attempts and delay in milliseconds between retries for failed requests. See the [Retries example](./docs/rest-api/retries.md) for detailed usage.
|
|
112
|
+
|
|
113
|
+
##### HTTPS Agent
|
|
114
|
+
|
|
115
|
+
Customize the HTTPS agent for advanced TLS configurations. See the [HTTPS Agent example](./docs/rest-api/httpsAgent.md) for detailed usage.
|
|
116
|
+
|
|
117
|
+
##### Key Pair Based Authentication
|
|
118
|
+
|
|
119
|
+
The REST API supports key pair-based authentication for secure communication. You can use `RSA` or `ED25519` keys for signing requests. See the [Key Pair Based Authentication example](./docs/rest-api/key-pair-authentication.md) for detailed usage.
|
|
120
|
+
|
|
121
|
+
##### Certificate Pinning
|
|
122
|
+
|
|
123
|
+
To enhance security, you can use certificate pinning with the `httpsAgent` option in the configuration. This ensures the client only communicates with servers using specific certificates. See the [Certificate Pinning example](./docs/rest-api/certificate-pinning.md) for detailed usage.
|
|
124
|
+
|
|
125
|
+
#### Error Handling
|
|
126
|
+
|
|
127
|
+
The REST API provides detailed error types to help you handle issues effectively:
|
|
128
|
+
|
|
129
|
+
- `ConnectorClientError`: General client error.
|
|
130
|
+
- `RequiredError`: Thrown when a required parameter is missing.
|
|
131
|
+
- `UnauthorizedError`: Indicates missing or invalid authentication credentials.
|
|
132
|
+
- `ForbiddenError`: Access to the requested resource is forbidden.
|
|
133
|
+
- `TooManyRequestsError`: Rate limit exceeded.
|
|
134
|
+
- `RateLimitBanError`: IP address banned for exceeding rate limits.
|
|
135
|
+
- `ServerError`: Internal server error.
|
|
136
|
+
- `NetworkError`: Issues with network connectivity.
|
|
137
|
+
- `NotFoundError`: Resource not found.
|
|
138
|
+
- `BadRequestError`: Invalid request.
|
|
139
|
+
|
|
140
|
+
See the [Error Handling example](./docs/rest-api/error-handling.md) for detailed usage.
|
|
141
|
+
|
|
142
|
+
#### Testnet
|
|
143
|
+
|
|
144
|
+
For testing purposes, `/sapi/v1/copyTrading/*` endpoints can be used in the [Testnet](https://testnet.binance.vision/). Update the `basePath` in your configuration:
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
import {
|
|
148
|
+
CopyTrading,
|
|
149
|
+
CopyTradingRestAPI,
|
|
150
|
+
COPY_TRADING_REST_API_TESTNET_URL,
|
|
151
|
+
} from '@binance/copy-trading';
|
|
152
|
+
|
|
153
|
+
const configurationRestAPI = {
|
|
154
|
+
apiKey: 'your-api-key',
|
|
155
|
+
apiSecret: 'your-api-secret',
|
|
156
|
+
basePath: COPY_TRADING_REST_API_TESTNET_URL,
|
|
157
|
+
};
|
|
158
|
+
const client = new CopyTrading({ configurationRestAPI });
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
If `basePath` is not provided, it defaults to `https://api.binance.com`.
|
|
162
|
+
|
|
163
|
+
## Testing
|
|
164
|
+
|
|
165
|
+
To run the tests:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm install
|
|
169
|
+
|
|
170
|
+
npm run test
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The tests cover:
|
|
174
|
+
|
|
175
|
+
- REST API endpoints
|
|
176
|
+
- Error handling and edge cases
|
|
177
|
+
|
|
178
|
+
## Migration Guide
|
|
179
|
+
|
|
180
|
+
If you are upgrading to the new modularized structure, refer to the [Migration Guide](./docs/migration_guide_copy_trading_connector.md) for detailed steps.
|
|
181
|
+
|
|
182
|
+
## Contributing
|
|
183
|
+
|
|
184
|
+
Contributions are welcome!
|
|
185
|
+
|
|
186
|
+
Since this repository contains auto-generated code, we encourage you to start by opening a GitHub issue to discuss your ideas or suggest improvements. This helps ensure that changes align with the project's goals and auto-generation processes.
|
|
187
|
+
|
|
188
|
+
To contribute:
|
|
189
|
+
|
|
190
|
+
1. Open a GitHub issue describing your suggestion or the bug you've identified.
|
|
191
|
+
2. If it's determined that changes are necessary, the maintainers will merge the changes into the main branch.
|
|
192
|
+
|
|
193
|
+
Please ensure that all tests pass if you're making a direct contribution. Submit a pull request only after discussing and confirming the change.
|
|
194
|
+
|
|
195
|
+
Thank you for your contributions!
|
|
196
|
+
|
|
197
|
+
## Licence
|
|
198
|
+
|
|
199
|
+
This project is licensed under the MIT License. See the [LICENCE](./LICENCE) file for details.
|
package/dist/index.d.mts
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 };
|