cryptobot-types 1.1.2 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cryptobot-types",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "types": "types/index.d.ts",
6
6
  "registry": "https://registry.npmjs.org/",
package/types/okx.d.ts CHANGED
@@ -126,6 +126,45 @@ export interface OrderUpdateData {
126
126
  msg: string;
127
127
  }
128
128
 
129
+ export interface BalanceAndPositionUpdateData {
130
+ pTime: string;
131
+ eventType:
132
+ | "snapshot"
133
+ | "delivered"
134
+ | "exercised"
135
+ | "transferred"
136
+ | "filled"
137
+ | "liquidation"
138
+ | "claw_back"
139
+ | "adl"
140
+ | "funding_fee"
141
+ | "adjust_margin"
142
+ | "set_leverage"
143
+ | "interest_deduction";
144
+ balData: {
145
+ ccy: string;
146
+ cashBal: string;
147
+ uTIme: string;
148
+ };
149
+ posData: {
150
+ posId: string;
151
+ tradeId: string;
152
+ instId: string;
153
+ instType: string;
154
+ mgnMode: string;
155
+ posSide: string;
156
+ pos: string;
157
+ ccy: string;
158
+ posCcy: string;
159
+ avgPx: string;
160
+ uTime: string;
161
+ };
162
+ trades: {
163
+ instId: string;
164
+ tradeId: string;
165
+ }[];
166
+ }
167
+
129
168
  export type TickerUpdateEvent = Omit<WsDataEvent, "data"> & {
130
169
  data: TickerUpdateData[];
131
170
  wsKey: string;
@@ -140,3 +179,8 @@ export type OrderUpdateEvent = Omit<WsDataEvent, "data"> & {
140
179
  data: OrderUpdateData[];
141
180
  wsKey: string;
142
181
  };
182
+
183
+ export type BalanceAndPositionUpdateEvent = Omit<WsDataEvent, "data"> & {
184
+ data: BalanceAndPositionUpdateData[];
185
+ wsKey: string;
186
+ };
@@ -1,3 +1,5 @@
1
+ import { PositionSide } from "okx-api";
2
+
1
3
  interface BasePosition {
2
4
  symbol: string;
3
5
  type: "long" | "short";
@@ -19,6 +21,7 @@ interface OptionalPositionInfo {
19
21
  export interface Position extends BasePosition, OptionalPositionInfo {
20
22
  unrealizedPnlUSD: number;
21
23
  unrealizedPnlPcnt: number;
24
+ posSide: PositionSide;
22
25
  }
23
26
 
24
27
  export interface ClosedPosition extends BasePosition, OptionalPositionInfo {