hedgequantx 2.9.189 → 2.9.190

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": "hedgequantx",
3
- "version": "2.9.189",
3
+ "version": "2.9.190",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -14,9 +14,26 @@ const DEBUG = process.env.HQX_DEBUG === '1';
14
14
  * @param {Object} orderData - Order parameters
15
15
  */
16
16
  const placeOrder = async (service, orderData) => {
17
+ // Check connection state
18
+ const connState = service.orderConn?.connectionState;
19
+ const wsState = service.orderConn?.ws?.readyState;
20
+
21
+ if (DEBUG) {
22
+ console.log('[ORDER] Connection check:', {
23
+ hasOrderConn: !!service.orderConn,
24
+ connState,
25
+ wsState,
26
+ hasLoginInfo: !!service.loginInfo
27
+ });
28
+ }
29
+
17
30
  if (!service.orderConn || !service.loginInfo) {
18
31
  return { success: false, error: 'Not connected' };
19
32
  }
33
+
34
+ if (connState !== 'LOGGED_IN') {
35
+ return { success: false, error: `ORDER_PLANT not logged in (state: ${connState})` };
36
+ }
20
37
 
21
38
  // Generate unique user message for tracking
22
39
  const orderTag = `HQX-${Date.now()}`;