binance 2.0.40 → 2.1.1

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/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # binance
2
+
2
3
  [![Tests](https://circleci.com/gh/tiagosiebler/binance.svg?style=shield)](https://circleci.com/gh/tiagosiebler/binance)
3
4
  [![npm version](https://img.shields.io/npm/v/binance)][1] [![npm size](https://img.shields.io/bundlephobia/min/binance/latest)][1] [![npm downloads](https://img.shields.io/npm/dt/binance)][1]
4
5
  [![last commit](https://img.shields.io/github/last-commit/tiagosiebler/binance)][1]
@@ -7,6 +8,7 @@
7
8
  [1]: https://www.npmjs.com/package/binance
8
9
 
9
10
  Node.js connector for the Binance APIs and WebSockets, with TypeScript & browser support.
11
+
10
12
  - Heavy integration testing with real API calls to support implementation stability.
11
13
  - Support REST APIs for Binance Spot, Margin, Isolated Margin & USDM Futures.
12
14
  - Automatically manage latency related authentication issues.
@@ -24,18 +26,23 @@ Node.js connector for the Binance APIs and WebSockets, with TypeScript & browser
24
26
  - Proxy support via axios integration.
25
27
 
26
28
  ## Installation
29
+
27
30
  `npm install binance --save`
28
31
 
29
32
  ## Examples
33
+
30
34
  Refer to the [examples](./examples) folder for implementation demos.
31
35
 
32
36
  ## Issues & Discussion
37
+
33
38
  - Issues? Check the [issues tab](https://github.com/tiagosiebler/binance/issues).
34
39
  - Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram.
35
40
  - Questions about Binance APIs & WebSockets? Ask in the official [Binance API](https://t.me/binance_api_english) group on telegram.
36
41
 
37
42
  ## Related projects
43
+
38
44
  Check out my related projects:
45
+
39
46
  - Try my connectors:
40
47
  - [ftx-api](https://www.npmjs.com/package/ftx-api)
41
48
  - [bybit-api](https://www.npmjs.com/package/bybit-api)
@@ -46,11 +53,15 @@ Check out my related projects:
46
53
  - [awesome-crypto-examples](https://github.com/tiagosiebler/awesome-crypto-examples)
47
54
 
48
55
  ## Documentation
56
+
49
57
  Most methods accept JS objects. These can be populated using parameters specified by Binance's API documentation.
58
+
50
59
  - [Binance API Documentation](https://binance-docs.github.io/apidocs/)
51
60
 
52
61
  ## Structure
62
+
53
63
  This project uses typescript. Resources are stored in 3 key structures:
64
+
54
65
  - [src](./src) - the whole connector written in typescript
55
66
  - [lib](./lib) - the javascript version of the project (compiled from typescript). This should not be edited directly, as it will be overwritten with each release.
56
67
  - [dist](./dist) - the packed bundle of the project for use in browser environments.
@@ -58,19 +69,24 @@ This project uses typescript. Resources are stored in 3 key structures:
58
69
  ---
59
70
 
60
71
  # Usage
72
+
61
73
  Create API credentials at Binance
74
+
62
75
  - [Livenet](https://www.binance.com/en/support/faq/360002502072?ref=IVRLUZJO)
63
76
 
64
77
  ## REST API Clients
65
78
 
66
79
  There are several REST API modules as there are some differences in each API group.
80
+
67
81
  1. `MainClient` for most APIs, including: spot, margin, isolated margin, mining, BLVT, BSwap, Fiat & sub-account management.
68
82
  2. `USDMClient` for USD-M futures APIs.
83
+ 3. `CoinMClient` for COIN-M futures APIs.
69
84
 
70
- COIN-M and Vanilla Options connectors are not yet available, though contributions are welcome!
85
+ Vanilla Options connectors are not yet available, though contributions are welcome!
71
86
 
72
87
  ### REST Spot/Margin/etc
73
- Start by importing the spot client. API credentials are optiona, though an error is thrown when attempting any private API calls without credentials.
88
+
89
+ Start by importing the spot client. API credentials are optional, though an error is thrown when attempting any private API calls without credentials.
74
90
 
75
91
  ```javascript
76
92
  const { MainClient } = require('binance');
@@ -83,27 +99,30 @@ const client = new MainClient({
83
99
  api_secret: API_SECRET,
84
100
  });
85
101
 
86
- client.getAccountTradeList({ symbol: 'BTCUSDT' })
87
- .then(result => {
88
- console.log("getAccountTradeList result: ", result);
102
+ client
103
+ .getAccountTradeList({ symbol: 'BTCUSDT' })
104
+ .then((result) => {
105
+ console.log('getAccountTradeList result: ', result);
89
106
  })
90
- .catch(err => {
91
- console.error("getAccountTradeList error: ", err);
107
+ .catch((err) => {
108
+ console.error('getAccountTradeList error: ', err);
92
109
  });
93
110
 
94
- client.getExchangeInfo()
95
- .then(result => {
96
- console.log("getExchangeInfo inverse result: ", result);
111
+ client
112
+ .getExchangeInfo()
113
+ .then((result) => {
114
+ console.log('getExchangeInfo inverse result: ', result);
97
115
  })
98
- .catch(err => {
99
- console.error("getExchangeInfo inverse error: ", err);
116
+ .catch((err) => {
117
+ console.error('getExchangeInfo inverse error: ', err);
100
118
  });
101
119
  ```
102
120
 
103
121
  See [spot-client.ts](./src/main-client.ts) for further information.
104
122
 
105
123
  ### REST USD-M Futures
106
- Start by importing the spot client. API credentials are optiona, though an error is thrown when attempting any private API calls without credentials.
124
+
125
+ Start by importing the usd-m client. API credentials are optional, though an error is thrown when attempting any private API calls without credentials.
107
126
 
108
127
  ```javascript
109
128
  const { USDMClient } = require('binance');
@@ -116,26 +135,56 @@ const client = new USDMClient({
116
135
  api_secret: API_SECRET,
117
136
  });
118
137
 
119
- client.getBalance()
120
- .then(result => {
121
- console.log("getBalance result: ", result);
138
+ client
139
+ .getBalance()
140
+ .then((result) => {
141
+ console.log('getBalance result: ', result);
122
142
  })
123
- .catch(err => {
124
- console.error("getBalance error: ", err);
143
+ .catch((err) => {
144
+ console.error('getBalance error: ', err);
125
145
  });
126
146
 
127
- client.get24hrChangeStatististics()
128
- .then(result => {
129
- console.log("get24hrChangeStatististics inverse futures result: ", result);
147
+ client
148
+ .get24hrChangeStatististics()
149
+ .then((result) => {
150
+ console.log('get24hrChangeStatististics inverse futures result: ', result);
130
151
  })
131
- .catch(err => {
132
- console.error("get24hrChangeStatististics inverse futures error: ", err);
152
+ .catch((err) => {
153
+ console.error('get24hrChangeStatististics inverse futures error: ', err);
133
154
  });
134
155
  ```
135
156
 
136
157
  See [usdm-client.ts](./src/usdm-client.ts) for further information.
137
158
 
159
+ ### REST COIN-M Futures
160
+
161
+ Start by importing the coin-m client. API credentials are optional, though an error is thrown when attempting any private API calls without credentials.
162
+
163
+ ```javascript
164
+ const { CoinMClient } = require('binance');
165
+
166
+ const API_KEY = 'xxx';
167
+ const API_SECRET = 'yyy';
168
+
169
+ const client = new CoinMClient({
170
+ api_key: API_KEY,
171
+ api_secret: API_SECRET,
172
+ });
173
+
174
+ client
175
+ .getSymbolOrderBookTicker()
176
+ .then((result) => {
177
+ console.log('getSymbolOrderBookTicker result: ', result);
178
+ })
179
+ .catch((err) => {
180
+ console.error('getSymbolOrderBookTicker error: ', err);
181
+ });
182
+ ```
183
+
184
+ See [coinm-client.ts](./src/coinm-client.ts) for further information.
185
+
138
186
  ## WebSockets
187
+
139
188
  All websockets are accessible via the shared `WebsocketClient`. As before, API credentials are optional unless the user data stream is required.
140
189
 
141
190
  ```javascript
@@ -150,13 +199,16 @@ const logger = {
150
199
  silly: (...params) => {},
151
200
  };
152
201
 
153
- const wsClient = new WebsocketClient({
154
- api_key: key,
155
- api_secret: secret,
156
- beautify: true,
157
- // Disable ping/pong ws heartbeat mechanism (not recommended)
158
- // disableHeartbeat: true
159
- }, logger);
202
+ const wsClient = new WebsocketClient(
203
+ {
204
+ api_key: key,
205
+ api_secret: secret,
206
+ beautify: true,
207
+ // Disable ping/pong ws heartbeat mechanism (not recommended)
208
+ // disableHeartbeat: true
209
+ },
210
+ logger
211
+ );
160
212
 
161
213
  // receive raw events
162
214
  wsClient.on('message', (data) => {
@@ -180,17 +232,17 @@ wsClient.on('reply', (data) => {
180
232
 
181
233
  // receive notification when a ws connection is reconnecting automatically
182
234
  wsClient.on('reconnecting', (data) => {
183
- console.log('ws automatically reconnecting.... ', data?.wsKey );
235
+ console.log('ws automatically reconnecting.... ', data?.wsKey);
184
236
  });
185
237
 
186
238
  // receive notification that a reconnection completed successfully (e.g use REST to check for missing data)
187
239
  wsClient.on('reconnected', (data) => {
188
- console.log('ws has reconnected ', data?.wsKey );
240
+ console.log('ws has reconnected ', data?.wsKey);
189
241
  });
190
242
 
191
243
  // Recommended: receive error events (e.g. first reconnection failed)
192
244
  wsClient.on('error', (data) => {
193
- console.log('ws saw error ', data?.wsKey );
245
+ console.log('ws saw error ', data?.wsKey);
194
246
  });
195
247
 
196
248
  // Call methods to subcribe to as many websockets as you want.
@@ -220,7 +272,6 @@ wsClient.subscribeUsdFuturesUserDataStream();
220
272
 
221
273
  // optionally directly open a connection to a URL. Not recommended for production use.
222
274
  // const ws4 = wsClient.connectToWsUrl(`wss://stream.binance.com:9443/ws/${listenKey}`, 'customDirectWsConnection1');
223
-
224
275
  ```
225
276
 
226
277
  See [websocket-client.ts](./src/websocket-client.ts) for further information. Also see [ws-userdata.ts](./examples/ws-userdata.ts) for user data examples.
@@ -228,6 +279,7 @@ See [websocket-client.ts](./src/websocket-client.ts) for further information. Al
228
279
  ---
229
280
 
230
281
  ## Customise Logging
282
+
231
283
  Pass a custom logger which supports the log methods `silly`, `debug`, `notice`, `info`, `warning` and `error`, or override methods from the default logger as desired.
232
284
 
233
285
  ```javascript
@@ -246,7 +298,9 @@ const ws = new WebsocketClient(
246
298
  ```
247
299
 
248
300
  ## Browser Usage
301
+
249
302
  Build a bundle using webpack:
303
+
250
304
  - `npm install`
251
305
  - `npm build`
252
306
  - `npm pack`
@@ -258,15 +312,20 @@ However, note that browser usage will lead to CORS errors due to Binance.
258
312
  ---
259
313
 
260
314
  ## Contributions & Thanks
315
+
261
316
  ### Donations
317
+
262
318
  #### tiagosiebler
319
+
263
320
  If you found this project interesting or useful, do consider [sponsoring me](https://github.com/sponsors/tiagosiebler) on github or registering with my [referral link](https://accounts.binance.com/en/register?ref=IVRLUZJO). Thank you!
264
321
 
265
322
  Or buy me a coffee using any of these:
323
+
266
324
  - BTC: `1C6GWZL1XW3jrjpPTS863XtZiXL1aTK7Jk`
267
325
  - ETH (ERC20): `0xd773d8e6a50758e1ada699bb6c4f98bb4abf82da`
268
326
 
269
327
  ### Contributions & Pull Requests
328
+
270
329
  Contributions are encouraged, I will review any incoming pull requests. See the issues tab for todo items.
271
330
 
272
331
  ## Stargazers
@@ -0,0 +1,18 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { CoinMAccountTradeParams, CoinMOpenInterest, CoinMPositionTrade, CoinMSymbolOrderBookTicker, PositionRisk, SymbolOrPair } from './types/coin';
3
+ import BaseRestClient from './util/BaseRestClient';
4
+ import { RestClientOptions } from './util/requestUtils';
5
+ export declare class CoinMClient extends BaseRestClient {
6
+ private clientId;
7
+ constructor(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig);
8
+ /**
9
+ * Abstraction required by each client to aid with time sync / drift handling
10
+ */
11
+ getServerTime(): Promise<number>;
12
+ getSymbolOrderBookTicker(params?: SymbolOrPair): Promise<CoinMSymbolOrderBookTicker[]>;
13
+ getOpenInterest(params: {
14
+ symbol: string;
15
+ }): Promise<CoinMOpenInterest>;
16
+ getPositions(): Promise<PositionRisk[]>;
17
+ getAccountTrades(params: CoinMAccountTradeParams): Promise<CoinMPositionTrade[]>;
18
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CoinMClient = void 0;
16
+ const BaseRestClient_1 = __importDefault(require("./util/BaseRestClient"));
17
+ const requestUtils_1 = require("./util/requestUtils");
18
+ class CoinMClient extends BaseRestClient_1.default {
19
+ constructor(restClientOptions = {}, requestOptions = {}) {
20
+ const clientId = 'coinm';
21
+ super(clientId, restClientOptions, requestOptions);
22
+ this.clientId = clientId;
23
+ return this;
24
+ }
25
+ /**
26
+ * Abstraction required by each client to aid with time sync / drift handling
27
+ */
28
+ getServerTime() {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ return this.get(requestUtils_1.getServerTimeEndpoint(this.clientId)).then((response) => response.serverTime);
31
+ });
32
+ }
33
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#change-log
34
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#general-info
35
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#testnet
36
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#general-api-information
37
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#limits
38
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#endpoint-security-type
39
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#signed-trade-and-user_data-endpoint-security
40
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#public-endpoints-info
41
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#filters
42
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#market-data-endpoints
43
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#test-connectivity
44
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#check-server-time
45
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#exchange-information
46
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#order-book
47
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#recent-trades-list
48
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#old-trades-lookup-market_data
49
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#compressed-aggregate-trades-list
50
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
51
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#get-funding-rate-history-of-perpetual-futures
52
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-data
53
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#continuous-contract-kline-candlestick-data
54
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#index-price-kline-candlestick-data
55
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-data
56
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#24hr-ticker-price-change-statistics
57
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#symbol-price-ticker
58
+ getSymbolOrderBookTicker(params) {
59
+ return this.get('dapi/v1/ticker/bookTicker', params).then((e) => requestUtils_1.asArray(e));
60
+ }
61
+ getOpenInterest(params) {
62
+ return this.get('dapi/v1/openInterest', params);
63
+ }
64
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#open-interest-statistics
65
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#top-trader-long-short-ratio-accounts
66
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#top-trader-long-short-ratio-positions
67
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#long-short-ratio
68
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#taker-buy-sell-volume
69
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#basis
70
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#websocket-market-streams
71
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#live-subscribing-unsubscribing-to-streams
72
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#aggregate-trade-streams
73
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#index-price-stream
74
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#mark-price-stream
75
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#mark-price-of-all-symbols-of-a-pair
76
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#kline-candlestick-streams
77
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#continuous-contract-kline-candlestick-streams
78
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#index-kline-candlestick-streams
79
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#mark-price-kline-candlestick-streams
80
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-mini-ticker-stream
81
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#all-market-mini-tickers-stream
82
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-ticker-streams
83
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#all-market-tickers-streams
84
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#individual-symbol-book-ticker-streams
85
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#all-book-tickers-stream
86
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#liquidation-order-streams
87
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#all-market-liquidation-order-streams
88
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#partial-book-depth-streams
89
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#diff-book-depth-streams
90
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#how-to-manage-a-local-order-book-correctly
91
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#account-trades-endpoints
92
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#new-future-account-transfer
93
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#get-future-account-transaction-history-list
94
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#change-position-mode-trade
95
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#get-current-position-mode-user_data
96
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#new-order-trade
97
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#modify-order-trade
98
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#place-multiple-orders-trade
99
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#modify-multiple-orders-trade
100
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#get-order-modify-history-user_data
101
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#query-order-user_data
102
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#cancel-order-trade
103
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#cancel-all-open-orders-trade
104
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#cancel-multiple-orders-trade
105
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#auto-cancel-all-open-orders-trade
106
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#query-current-open-order-user_data
107
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#current-all-open-orders-user_data
108
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#all-orders-user_data
109
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#futures-account-balance-user_data
110
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data
111
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#change-initial-leverage-trade
112
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#change-margin-type-trade
113
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#modify-isolated-position-margin-trade
114
+ //TODO - https://binance-docs.github.io/apidocs/delivery/en/#get-position-margin-change-history-trade
115
+ getPositions() {
116
+ return this.getPrivate('dapi/v1/positionRisk');
117
+ }
118
+ getAccountTrades(params) {
119
+ return this.getPrivate('dapi/v1/userTrades', params);
120
+ }
121
+ }
122
+ exports.CoinMClient = CoinMClient;
123
+ //# sourceMappingURL=coinm-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coinm-client.js","sourceRoot":"","sources":["../src/coinm-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAUA,2EAAmD;AACnD,sDAI6B;AAE7B,MAAa,WAAY,SAAQ,wBAAc;IAG7C,YACE,oBAAuC,EAAE,EACzC,iBAAqC,EAAE;QAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC;QACzB,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,cAAc,CAAC,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F;IAC7F,uFAAuF;IACvF,kGAAkG;IAClG,oFAAoF;IACpF,sFAAsF;IACtF,iGAAiG;IACjG,uFAAuF;IACvF,oFAAoF;IACpF,uGAAuG;IACvG,qFAAqF;IACrF,wFAAwF;IACxF,wGAAwG;IACxG,uFAAuF;IACvF,gGAAgG;IAChG,4EAA4E;IAC5E,+EAA+E;IAC/E,wFAAwF;IACxF,yFAAyF;IACzF,+FAA+F;IAC/F,kFAAkF;IAClF,+EAA+E;IAC/E,yFAAyF;IACzF,yFAAyF;IACzF,8FAA8F;IAC9F,+FAA+F;IAC/F,8FAA8F;IAC9F,iFAAiF;IACjF,8FAA8F;IAC9F,0FAA0F;IAC1F,0FAA0F;IAC1F,qFAAqF;IACrF,kGAAkG;IAClG,qGAAqG;IAErG,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;IAED,gBAAgB,CACd,MAA+B;QAE/B,OAAO,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CAuBF;AAhJD,kCAgJC"}
package/lib/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  export * from './';
2
- export * from './main-client';
3
- export * from './usdm-client';
4
- export * from './websocket-client';
2
+ export * from './coinm-client';
5
3
  export * from './logger';
4
+ export * from './main-client';
5
+ export * from './types/coin';
6
6
  export * from './types/futures';
7
7
  export * from './types/shared';
8
8
  export * from './types/spot';
9
9
  export * from './types/websockets';
10
+ export * from './usdm-client';
10
11
  export * from './util/requestUtils';
11
- export * from './util/WsStore';
12
12
  export * from './util/typeGuards';
13
+ export * from './util/WsStore';
14
+ export * from './websocket-client';
package/lib/index.js CHANGED
@@ -11,15 +11,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./"), exports);
14
- __exportStar(require("./main-client"), exports);
15
- __exportStar(require("./usdm-client"), exports);
16
- __exportStar(require("./websocket-client"), exports);
14
+ __exportStar(require("./coinm-client"), exports);
17
15
  __exportStar(require("./logger"), exports);
16
+ __exportStar(require("./main-client"), exports);
17
+ __exportStar(require("./types/coin"), exports);
18
18
  __exportStar(require("./types/futures"), exports);
19
19
  __exportStar(require("./types/shared"), exports);
20
20
  __exportStar(require("./types/spot"), exports);
21
21
  __exportStar(require("./types/websockets"), exports);
22
+ __exportStar(require("./usdm-client"), exports);
22
23
  __exportStar(require("./util/requestUtils"), exports);
23
- __exportStar(require("./util/WsStore"), exports);
24
24
  __exportStar(require("./util/typeGuards"), exports);
25
+ __exportStar(require("./util/WsStore"), exports);
26
+ __exportStar(require("./websocket-client"), exports);
25
27
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmB;AACnB,gDAA8B;AAC9B,gDAA8B;AAC9B,qDAAmC;AACnC,2CAAyB;AAEzB,kDAAgC;AAChC,iDAA+B;AAC/B,+CAA6B;AAC7B,qDAAmC;AAEnC,sDAAoC;AACpC,iDAA+B;AAC/B,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmB;AACnB,iDAA+B;AAC/B,2CAAyB;AACzB,gDAA8B;AAC9B,+CAA6B;AAC7B,kDAAgC;AAChC,iDAA+B;AAC/B,+CAA6B;AAC7B,qDAAmC;AACnC,gDAA8B;AAC9B,sDAAoC;AACpC,oDAAkC;AAClC,iDAA+B;AAC/B,qDAAmC"}
@@ -0,0 +1,79 @@
1
+ import { FuturesContractType, PositionSide } from './futures';
2
+ import { numberInString, OrderSide } from './shared';
3
+ export interface PositionRisk {
4
+ symbol: string;
5
+ positionAmt: numberInString;
6
+ entryPrice: numberInString;
7
+ markPrice: numberInString;
8
+ unRealizedProfit: numberInString;
9
+ liquidationPrice: numberInString;
10
+ leverage: numberInString;
11
+ maxQty: numberInString;
12
+ marginType: string;
13
+ isolatedMargin: numberInString;
14
+ isAutoAddMargin: boolean;
15
+ positionSide: PositionSide;
16
+ updateTime: number;
17
+ }
18
+ export interface CoinMOpenInterest {
19
+ symbol: string;
20
+ pair: string;
21
+ openInterest: numberInString;
22
+ contractType: FuturesContractType;
23
+ time: number;
24
+ }
25
+ export declare type SymbolOrPair = {
26
+ pair: string;
27
+ symbol?: never;
28
+ } | {
29
+ pair?: never;
30
+ symbol: string;
31
+ };
32
+ export interface CoinMSymbolOrderBookTicker {
33
+ symbol: string;
34
+ pair: string;
35
+ bidPrice: numberInString;
36
+ bidQty: numberInString;
37
+ askPrice: numberInString;
38
+ askQty: numberInString;
39
+ time: number;
40
+ }
41
+ export interface CoinMPaginatedRequest {
42
+ fromId?: number;
43
+ startTime?: number;
44
+ endTime?: number;
45
+ limit?: number;
46
+ }
47
+ export interface CoinMAccountTradeParamsWithPair extends CoinMPaginatedRequest {
48
+ pair: string;
49
+ symbol?: never;
50
+ fromId?: never;
51
+ }
52
+ export interface CoinMAccountTradeParamsWithSymbol extends CoinMPaginatedRequest {
53
+ symbol: string;
54
+ pair?: never;
55
+ }
56
+ export interface CoinMAccountTradeParamsWithFromId extends CoinMPaginatedRequest {
57
+ fromId: number;
58
+ startTime?: never;
59
+ endTime?: never;
60
+ }
61
+ export declare type CoinMAccountTradeParams = CoinMAccountTradeParamsWithSymbol | CoinMAccountTradeParamsWithPair | CoinMAccountTradeParamsWithFromId;
62
+ export interface CoinMPositionTrade {
63
+ symbol: string;
64
+ id: number;
65
+ orderId: number;
66
+ pair: string;
67
+ side: OrderSide;
68
+ price: numberInString;
69
+ qty: numberInString;
70
+ realizedPnl: numberInString;
71
+ marginAsset: string;
72
+ baseQty: numberInString;
73
+ commission: numberInString;
74
+ commissionAsset: string;
75
+ time: number;
76
+ positionSide: PositionSide;
77
+ buyer: boolean;
78
+ maker: boolean;
79
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=coin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coin.js","sourceRoot":"","sources":["../../src/types/coin.ts"],"names":[],"mappings":""}
@@ -406,6 +406,8 @@ export interface FuturesPosition {
406
406
  markPrice: numberInString;
407
407
  maxNotionalValue: numberInString;
408
408
  positionAmt: numberInString;
409
+ notional: numberInString;
410
+ isolatedWallet: numberInString;
409
411
  symbol: string;
410
412
  unRealizedProfit: numberInString;
411
413
  positionSide: PositionSide;
@@ -47,4 +47,5 @@ interface WsContext {
47
47
  export declare function getContextFromWsKey(wsKey: WsKey): WsContext;
48
48
  export declare function getWsKeyWithContext(market: WsMarket, streamName: string, symbol?: string | undefined, listenKey?: string | undefined, ...otherParams: (string | boolean)[]): WsKey;
49
49
  export declare function appendEventMarket(wsMsg: any, wsKey: WsKey): void;
50
+ export declare function asArray<T>(el: T[] | T): T[];
50
51
  export {};
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.appendEventMarket = exports.getWsKeyWithContext = exports.getContextFromWsKey = exports.appendEventIfMissing = exports.logInvalidOrderId = exports.isWsPong = exports.isPublicEndpoint = exports.getRestBaseUrl = exports.getServerTimeEndpoint = exports.getRequestSignature = exports.serialiseParams = exports.generateNewOrderId = exports.getOrderIdPrefix = void 0;
12
+ exports.asArray = exports.appendEventMarket = exports.getWsKeyWithContext = exports.getContextFromWsKey = exports.appendEventIfMissing = exports.logInvalidOrderId = exports.isWsPong = exports.isPublicEndpoint = exports.getRestBaseUrl = exports.getServerTimeEndpoint = exports.getRequestSignature = exports.serialiseParams = exports.generateNewOrderId = exports.getOrderIdPrefix = void 0;
13
13
  const node_support_1 = require("./node-support");
14
14
  const nanoid_1 = require("nanoid");
15
15
  function getOrderIdPrefix(network) {
@@ -183,4 +183,8 @@ function appendEventMarket(wsMsg, wsKey) {
183
183
  wsMsg.wsKey = wsKey;
184
184
  }
185
185
  exports.appendEventMarket = appendEventMarket;
186
+ function asArray(el) {
187
+ return Array.isArray(el) ? el : [el];
188
+ }
189
+ exports.asArray = asArray;
186
190
  //# sourceMappingURL=requestUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestUtils.js","sourceRoot":"","sources":["../../src/util/requestUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,iDAA6C;AAC7C,mCAAgC;AAqChC,SAAgB,gBAAgB,CAAC,OAA0B;IACzD,QAAQ,OAAO,EAAE;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb;YACE,OAAO,UAAU,CAAC;QAEpB,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,UAAU,CAAC;QAEpB,KAAK,UAAU,CAAC;QAChB,KAAK,cAAc;YACjB,OAAO,EAAE,CAAC;KACb;AACH,CAAC;AAnBD,4CAmBC;AAED,SAAgB,kBAAkB,CAAC,OAA0B;IAE3D,MAAM,EAAE,GAAG,eAAM,CAAC,EAAE,CAAC,CAAC;IACtB,MAAM,UAAU,GAAG,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAEzD,OAAO,UAAU,CAAC;AACpB,CAAC;AAND,gDAMC;AAED,SAAgB,eAAe,CAAC,SAAiB,EAAE,EAAE,iBAAiB,GAAG,KAAK,EAAE,eAAwB,KAAK;IAC3G,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;SACvB,GAAG,CAAC,GAAG,CAAC,EAAE;QACT,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,iBAAiB,KAAK,IAAI,IAAI,OAAO,KAA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EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAA;IAC7C,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;AACtB,CAAC;AAJD,8CAIC;AAED,SAAgB,OAAO,CAAI,EAAW;IACpC,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC;AAFD,0BAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "binance",
3
- "version": "2.0.40",
3
+ "version": "2.1.1",
4
4
  "description": "Node.js connector for Binance's REST APIs and WebSockets, with TypeScript & integration tests.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",