binance 3.0.0-beta.1 → 3.0.0-beta.3

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.
@@ -454,7 +454,6 @@ export interface FuturesAccountPosition {
454
454
  maxNotional: numberInString;
455
455
  positionSide: PositionSide;
456
456
  positionAmt: numberInString;
457
- crossUnPnl: numberInString;
458
457
  notional: numberInString;
459
458
  isolatedWallet: numberInString;
460
459
  updateTime: number;
@@ -60,6 +60,7 @@ export interface WsAPIWsKeyTopicMap {
60
60
  [WS_KEY_MAP.usdmWSAPI]: WsAPIOperation;
61
61
  [WS_KEY_MAP.usdmWSAPITestnet]: WsAPIOperation;
62
62
  }
63
+ export type WsAPIFuturesWsKey = typeof WS_KEY_MAP.usdmWSAPI | typeof WS_KEY_MAP.usdmWSAPITestnet;
63
64
  /**
64
65
  * Request parameters expected per operation.
65
66
  *
@@ -68,7 +69,7 @@ export interface WsAPIWsKeyTopicMap {
68
69
  *
69
70
  * Make sure to add new topics to WS_API_Operations and the response param map too.
70
71
  */
71
- export interface WsAPITopicRequestParamMap {
72
+ export interface WsAPITopicRequestParamMap<TWSKey = WsKey> {
72
73
  SUBSCRIBE: never;
73
74
  UNSUBSCRIBE: never;
74
75
  LIST_SUBSCRIPTIONS: never;
@@ -128,7 +129,7 @@ export interface WsAPITopicRequestParamMap {
128
129
  * Trading requests & parameters:
129
130
  * https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/trading-requests
130
131
  */
131
- 'order.place': (NewSpotOrderParams | NewFuturesOrderParams) & {
132
+ 'order.place': (TWSKey extends WsAPIFuturesWsKey ? NewFuturesOrderParams : NewSpotOrderParams) & {
132
133
  timestamp?: number;
133
134
  };
134
135
  'orderList.place': any;
@@ -99,7 +99,7 @@ export declare class WebsocketClient extends BaseWebsocketClient<WsKey, WsReques
99
99
  * order. Only send parameters for the request body. Everything else is automatically handled.
100
100
  * @returns Promise - tries to resolve with async WS API response. Rejects if disconnected or exception is seen in async WS API response
101
101
  */
102
- sendWSAPIRequest<TWSKey extends keyof WsAPIWsKeyTopicMap, TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], TWSParams extends Exact<WsAPITopicRequestParamMap[TWSOperation]>>(wsKey: TWSKey, operation: TWSOperation, ...params: TWSParams extends undefined | void | never ? [] : [TWSParams]): Promise<WsAPIOperationResponseMap[TWSOperation]>;
102
+ sendWSAPIRequest<TWSKey extends keyof WsAPIWsKeyTopicMap, TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], TWSParams extends Exact<WsAPITopicRequestParamMap<TWSKey>[TWSOperation]>>(wsKey: TWSKey, operation: TWSOperation, ...params: TWSParams extends undefined | void | never ? [] : [TWSParams]): Promise<WsAPIOperationResponseMap[TWSOperation]>;
103
103
  /**
104
104
  *
105
105
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "binance",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & end-to-end tests.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",