hedgequantx 2.9.78 → 2.9.80

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.78",
3
+ "version": "2.9.80",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -13,8 +13,6 @@
13
13
  'use strict';
14
14
 
15
15
  const chalk = require('chalk');
16
- // Force colors to be enabled for log messages
17
- chalk.level = 3;
18
16
  const {
19
17
  LONG_BIAS_MESSAGES,
20
18
  SHORT_BIAS_MESSAGES,
@@ -101,13 +101,50 @@ const rithmicMenu = async () => {
101
101
  await new Promise(r => setTimeout(r, 1500));
102
102
  return service;
103
103
  } else {
104
- spinner.fail((result.error || 'AUTHENTICATION FAILED').toUpperCase());
105
- await new Promise(r => setTimeout(r, 2000));
104
+ // Detailed error messages for common Rithmic issues
105
+ const err = (result.error || '').toLowerCase();
106
+ let msg = (result.error || 'AUTHENTICATION FAILED').toUpperCase();
107
+ let help = '';
108
+
109
+ if (err.includes('permission denied')) {
110
+ msg = 'PERMISSION DENIED';
111
+ help = 'Session active elsewhere. Wait 5 min or close R|Trader/other apps.';
112
+ } else if (err.includes('timeout')) {
113
+ msg = 'CONNECTION TIMEOUT';
114
+ help = 'Rithmic server not responding. Check internet connection.';
115
+ } else if (err.includes('invalid') && err.includes('system')) {
116
+ msg = 'INVALID SYSTEM';
117
+ help = 'Wrong propfirm. Verify your account type.';
118
+ } else if (err.includes('password') || err.includes('credential')) {
119
+ msg = 'INVALID CREDENTIALS';
120
+ help = 'Check username and password.';
121
+ }
122
+
123
+ spinner.fail(msg);
124
+ if (help) console.log(chalk.yellow(` → ${help}`));
125
+ await new Promise(r => setTimeout(r, 3000));
106
126
  return null;
107
127
  }
108
128
  } catch (error) {
109
- spinner.fail(`CONNECTION ERROR: ${error.message.toUpperCase()}`);
110
- await new Promise(r => setTimeout(r, 2000));
129
+ // Handle network/connection exceptions
130
+ const err = (error.message || '').toLowerCase();
131
+ let msg = `CONNECTION ERROR: ${error.message.toUpperCase()}`;
132
+ let help = '';
133
+
134
+ if (err.includes('enotfound') || err.includes('getaddrinfo')) {
135
+ msg = 'DNS ERROR - SERVER NOT FOUND';
136
+ help = 'No internet or Rithmic server down.';
137
+ } else if (err.includes('econnrefused')) {
138
+ msg = 'CONNECTION REFUSED';
139
+ help = 'Rithmic server rejected. Try again later.';
140
+ } else if (err.includes('timeout') || err.includes('etimedout')) {
141
+ msg = 'CONNECTION TIMEOUT';
142
+ help = 'Server not responding. Check firewall.';
143
+ }
144
+
145
+ spinner.fail(msg);
146
+ if (help) console.log(chalk.yellow(` → ${help}`));
147
+ await new Promise(r => setTimeout(r, 3000));
111
148
  return null;
112
149
  }
113
150
  };
@@ -124,7 +124,7 @@ class RithmicConnection extends EventEmitter {
124
124
  appVersion: this.config.appVersion || '1.0.0',
125
125
  systemName: this.config.systemName,
126
126
  infraType: INFRA_TYPE[infraType],
127
- macAddr: [getMacAddress()],
127
+ macAddr: ['00:00:00:00:00:00'],
128
128
  osVersion: os.release(),
129
129
  osPlatform: os.platform(),
130
130
  });
@@ -42,8 +42,8 @@ const PROPFIRM_CONFIGS = {
42
42
  lucidtrading: { name: 'Lucid Trading', systemName: RITHMIC_SYSTEMS.LUCID_TRADING, gateway: RITHMIC_ENDPOINTS.CHICAGO },
43
43
  thrivetrading: { name: 'Thrive Trading', systemName: RITHMIC_SYSTEMS.THRIVE_TRADING, gateway: RITHMIC_ENDPOINTS.CHICAGO },
44
44
  legendstrading: { name: 'Legends Trading', systemName: RITHMIC_SYSTEMS.LEGENDS_TRADING, gateway: RITHMIC_ENDPOINTS.CHICAGO },
45
- // Rithmic Paper Trading - uses dedicated PAPER endpoint
46
- rithmic_paper: { name: 'Rithmic Paper Trading', systemName: RITHMIC_SYSTEMS.PAPER, gateway: RITHMIC_ENDPOINTS.PAPER },
45
+ // Rithmic Paper Trading - uses CHICAGO endpoint (PAPER endpoint deprecated)
46
+ rithmic_paper: { name: 'Rithmic Paper Trading', systemName: RITHMIC_SYSTEMS.PAPER, gateway: RITHMIC_ENDPOINTS.CHICAGO },
47
47
  };
48
48
 
49
49
  /**