binance 2.0.29 → 2.0.30

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.
@@ -6,7 +6,7 @@ export declare type WsRawSpotUserDataEventRaw = WsMessageSpotUserDataExecutionRe
6
6
  export declare type WsMessageSpotUserDataEventFormatted = WsMessageSpotUserDataExecutionReportEventFormatted | WsMessageSpotOutboundAccountPositionFormatted | WsMessageSpotBalanceUpdateFormatted | WsMessageSpotUserDataListStatusEventFormatted;
7
7
  export declare type WsMessageFuturesUserDataEventRaw = WsMessageFuturesUserDataAccountUpdateRaw | WsMessageFuturesUserDataListenKeyExpiredRaw | WsMessageFuturesUserDataMarginCallRaw | WsMessageFuturesUserDataOrderTradeUpdateEventRaw | WsMessageFuturesUserDataAccountConfigUpdateEventRaw;
8
8
  export declare type WsMessageFuturesUserDataEventFormatted = WsMessageFuturesUserDataAccountUpdateFormatted | WsMessageFuturesUserDataListenKeyExpiredFormatted | WsMessageFuturesUserDataMarginCallFormatted | WsMessageFuturesUserDataTradeUpdateEventFormatted | WsMessageFuturesUserDataAccountConfigUpdateEventFormatted;
9
- export declare type WsRawMessage = WsMessageKlineRaw | WsMessageAggTradeRaw | WsMessageTradeRaw | WsMessage24hrMiniTickerRaw | WsMessage24hrMiniTickerRaw[] | WsMessage24hrTickerRaw | WsMessage24hrTickerRaw[] | WsMessageBookTickerEventRaw | WsMessagePartialBookDepthEventRaw | WsRawSpotUserDataEventRaw | WsMessageIndexPriceUpdateEventRaw;
9
+ export declare type WsRawMessage = WsMessageKlineRaw | WsMessageAggTradeRaw | WsMessageTradeRaw | WsMessage24hrMiniTickerRaw | WsMessage24hrMiniTickerRaw[] | WsMessage24hrTickerRaw | WsMessage24hrTickerRaw[] | WsMessageBookTickerEventRaw | WsMessagePartialBookDepthEventRaw | WsRawSpotUserDataEventRaw | WsMessageIndexPriceUpdateEventRaw | WsMessageFuturesUserDataAccountUpdateRaw | WsMessageFuturesUserDataListenKeyExpiredRaw | WsMessageFuturesUserDataMarginCallRaw | WsMessageFuturesUserDataOrderTradeUpdateEventRaw | WsMessageFuturesUserDataAccountConfigUpdateEventRaw;
10
10
  export declare type WsFormattedMessage = WsMessageKlineFormatted | WsMessageAggTradeFormatted | WsMessageTradeFormatted | WsMessage24hrMiniTickerFormatted | WsMessage24hrMiniTickerFormatted[] | WsMessage24hrTickerFormatted | WsMessage24hrTickerFormatted[] | WsMessageBookTickerEventFormatted | WsMessagePartialBookDepthEventFormatted | WsMessageSpotUserDataEventFormatted | WsMessageFuturesUserDataEventFormatted | WsMessageIndexPriceUpdateEventFormatted | WsMessageMarkPriceUpdateEventFormatted | WsMessageMarkPriceUpdateEventFormatted[] | WsMessageForceOrderFormatted;
11
11
  export declare type WsUserDataEvents = WsMessageSpotUserDataEventFormatted | WsMessageFuturesUserDataEventFormatted;
12
12
  interface WsSharedBase {
@@ -1,7 +1,31 @@
1
- import { WsFormattedMessage, WsMessage24hrTickerFormatted, WsMessageFuturesUserDataEventFormatted, WsMessageKlineFormatted, WsMessageMarkPriceUpdateEventFormatted, WsMessageSpotUserDataEventFormatted, WsUserDataEvents } from "..";
1
+ import { WsFormattedMessage, WsMessage24hrMiniTickerRaw, WsMessage24hrTickerFormatted, WsMessageFuturesUserDataAccountConfigUpdateEventRaw, WsMessageFuturesUserDataAccountUpdateRaw, WsMessageFuturesUserDataEventFormatted, WsMessageFuturesUserDataOrderTradeUpdateEventRaw, WsMessageKlineFormatted, WsMessageKlineRaw, WsMessageMarkPriceUpdateEventFormatted, WsMessageSpotUserDataEventFormatted, WsRawMessage, WsUserDataEvents } from "..";
2
2
  export declare function isWsFormattedMarkPriceUpdate(data: WsFormattedMessage): data is WsMessageMarkPriceUpdateEventFormatted[];
3
3
  export declare function isWsFormattedKline(data: WsFormattedMessage): data is WsMessageKlineFormatted;
4
4
  export declare function isWsFormatted24hrTicker(data: WsFormattedMessage): data is WsMessage24hrTickerFormatted;
5
5
  export declare function isWsFormattedUserDataEvent(data: WsFormattedMessage): data is WsUserDataEvents;
6
6
  export declare function isWsFormattedSpotUserDataEvent(data: WsFormattedMessage): data is WsMessageSpotUserDataEventFormatted;
7
7
  export declare function isWsFormattedFuturesUserDataEvent(data: WsFormattedMessage): data is WsMessageFuturesUserDataEventFormatted;
8
+ /**
9
+ * Typeguard to validate all symbol 24hrMiniTicker raw event
10
+ */
11
+ export declare function isAll24hrMiniTickerRaw(data: WsRawMessage): data is WsMessage24hrMiniTickerRaw[];
12
+ /**
13
+ * Typeguard to validate a single 24hrMiniTicker raw event
14
+ */
15
+ export declare function is24hrMiniTickerRaw(data: WsRawMessage): data is WsMessage24hrMiniTickerRaw;
16
+ /**
17
+ * Typeguard to validate a single kline raw event
18
+ */
19
+ export declare function isKlineRaw(data: WsRawMessage): data is WsMessageKlineRaw;
20
+ /**
21
+ * Typeguard to validate a single ORDER_TRADE_UPDATE raw event
22
+ */
23
+ export declare function isOrderTradeUpdateRaw(data: WsRawMessage): data is WsMessageFuturesUserDataOrderTradeUpdateEventRaw;
24
+ /**
25
+ * Typeguard to validate a single ACCOUNT_CONFIG_UPDATE raw event
26
+ */
27
+ export declare function isAccountConfigUpdateRaw(data: WsRawMessage): data is WsMessageFuturesUserDataAccountConfigUpdateEventRaw;
28
+ /**
29
+ * Typeguard to validate a single ACCOUNT_UPDATE raw event
30
+ */
31
+ export declare function isAccountUpdateRaw(data: WsRawMessage): data is WsMessageFuturesUserDataAccountUpdateRaw;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isWsFormattedFuturesUserDataEvent = exports.isWsFormattedSpotUserDataEvent = exports.isWsFormattedUserDataEvent = exports.isWsFormatted24hrTicker = exports.isWsFormattedKline = exports.isWsFormattedMarkPriceUpdate = void 0;
3
+ exports.isAccountUpdateRaw = exports.isAccountConfigUpdateRaw = exports.isOrderTradeUpdateRaw = exports.isKlineRaw = exports.is24hrMiniTickerRaw = exports.isAll24hrMiniTickerRaw = exports.isWsFormattedFuturesUserDataEvent = exports.isWsFormattedSpotUserDataEvent = exports.isWsFormattedUserDataEvent = exports.isWsFormatted24hrTicker = exports.isWsFormattedKline = exports.isWsFormattedMarkPriceUpdate = void 0;
4
4
  /*
5
5
  Use type guards to narrow down types with minimal efforts.
6
6
  */
@@ -30,4 +30,46 @@ function isWsFormattedFuturesUserDataEvent(data) {
30
30
  return isWsFormattedUserDataEvent(data) && data.wsMarket.includes('usdm');
31
31
  }
32
32
  exports.isWsFormattedFuturesUserDataEvent = isWsFormattedFuturesUserDataEvent;
33
+ /**
34
+ * Typeguard to validate all symbol 24hrMiniTicker raw event
35
+ */
36
+ function isAll24hrMiniTickerRaw(data) {
37
+ return Array.isArray(data) && data[0].e === '24hrMiniTicker';
38
+ }
39
+ exports.isAll24hrMiniTickerRaw = isAll24hrMiniTickerRaw;
40
+ /**
41
+ * Typeguard to validate a single 24hrMiniTicker raw event
42
+ */
43
+ function is24hrMiniTickerRaw(data) {
44
+ return !Array.isArray(data) && data.e === '24hrMiniTicker';
45
+ }
46
+ exports.is24hrMiniTickerRaw = is24hrMiniTickerRaw;
47
+ /**
48
+ * Typeguard to validate a single kline raw event
49
+ */
50
+ function isKlineRaw(data) {
51
+ return !Array.isArray(data) && data.e === 'kline';
52
+ }
53
+ exports.isKlineRaw = isKlineRaw;
54
+ /**
55
+ * Typeguard to validate a single ORDER_TRADE_UPDATE raw event
56
+ */
57
+ function isOrderTradeUpdateRaw(data) {
58
+ return !Array.isArray(data) && data.e === 'ORDER_TRADE_UPDATE';
59
+ }
60
+ exports.isOrderTradeUpdateRaw = isOrderTradeUpdateRaw;
61
+ /**
62
+ * Typeguard to validate a single ACCOUNT_CONFIG_UPDATE raw event
63
+ */
64
+ function isAccountConfigUpdateRaw(data) {
65
+ return !Array.isArray(data) && data.e === 'ACCOUNT_CONFIG_UPDATE';
66
+ }
67
+ exports.isAccountConfigUpdateRaw = isAccountConfigUpdateRaw;
68
+ /**
69
+ * Typeguard to validate a single ACCOUNT_UPDATE raw event
70
+ */
71
+ function isAccountUpdateRaw(data) {
72
+ return !Array.isArray(data) && data.e === 'ACCOUNT_UPDATE';
73
+ }
74
+ exports.isAccountUpdateRaw = isAccountUpdateRaw;
33
75
  //# sourceMappingURL=typeGuards.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeGuards.js","sourceRoot":"","sources":["../../src/util/typeGuards.ts"],"names":[],"mappings":";;;AAUA;;EAEE;AAEF,SAAgB,4BAA4B,CAC1C,IAAwB;IAExB,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;WACrB,IAAI,CAAC,MAAM,KAAK,CAAC;WACjB,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,iBAAiB,CAAC;AAC/C,CAAC;AAND,oEAMC;AAED,SAAgB,kBAAkB,CAChC,IAAwB;IAExB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC;AAC5D,CAAC;AAJD,gDAIC;AAED,SAAgB,uBAAuB,CACrC,IAAwB;IAExB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC;AACjE,CAAC;AAJD,0DAIC;AAED,SAAgB,0BAA0B,CACxC,IAAwB;IAExB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AACjE,CAAC;AAJD,gEAIC;AAED,SAAgB,8BAA8B,CAC5C,IAAwB;IAExB,OAAO,0BAA0B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5E,CAAC;AAJD,wEAIC;AAED,SAAgB,iCAAiC,CAC/C,IAAwB;IAExB,OAAO,0BAA0B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,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O,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,gBAAgB,CAAC;AAC/D,CAAC;AAJD,wDAIC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,IAAkB;IAElB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,gBAAgB,CAAC;AAC7D,CAAC;AAJD,kDAIC;AAED;;GAEG;AACH,SAAgB,UAAU,CACxB,IAAkB;IAElB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,OAAO,CAAC;AACpD,CAAC;AAJD,gCAIC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CACnC,IAAkB;IAElB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,oBAAoB,CAAC;AACjE,CAAC;AAJD,sDAIC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CACtC,IAAkB;IAElB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,uBAAuB,CAAC;AACpE,CAAC;AAJD,4DAIC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,IAAkB;IAElB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,gBAAgB,CAAC;AAC7D,CAAC;AAJD,gDAIC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "binance",
3
- "version": "2.0.29",
3
+ "version": "2.0.30",
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",