hedgequantx 1.8.45 → 1.8.47

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": "1.8.45",
3
+ "version": "1.8.47",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -43,7 +43,7 @@ const dashboardMenu = async (service) => {
43
43
  console.log(makeLine(propfirmText, 'center'));
44
44
  }
45
45
 
46
- // Stats bar
46
+ // Stats bar with yellow icons
47
47
  const statsInfo = getCachedStats();
48
48
  if (statsInfo) {
49
49
  console.log(chalk.cyan('╠' + '═'.repeat(W) + '╣'));
@@ -60,15 +60,17 @@ const dashboardMenu = async (service) => {
60
60
  pnlDisplay = '--';
61
61
  }
62
62
 
63
- const statsPlain = `Connections: ${statsInfo.connections} Accounts: ${statsInfo.accounts} Balance: ${balStr} P&L: ${pnlDisplay}`;
63
+ // Yellow icons: for each stat
64
+ const icon = chalk.yellow('✔ ');
65
+ const statsPlain = `✔ Connections: ${statsInfo.connections} ✔ Accounts: ${statsInfo.accounts} ✔ Balance: ${balStr} ✔ P&L: ${pnlDisplay}`;
64
66
  const statsLeftPad = Math.floor((W - statsPlain.length) / 2);
65
67
  const statsRightPad = W - statsPlain.length - statsLeftPad;
66
68
 
67
69
  console.log(chalk.cyan('║') + ' '.repeat(statsLeftPad) +
68
- chalk.white(`Connections: ${statsInfo.connections}`) + ' ' +
69
- chalk.white(`Accounts: ${statsInfo.accounts}`) + ' ' +
70
- chalk.white('Balance: ') + balColor(balStr) + ' ' +
71
- chalk.white('P&L: ') + pnlColor(pnlDisplay) +
70
+ icon + chalk.white(`Connections: ${statsInfo.connections}`) + ' ' +
71
+ icon + chalk.white(`Accounts: ${statsInfo.accounts}`) + ' ' +
72
+ icon + chalk.white('Balance: ') + balColor(balStr) + ' ' +
73
+ icon + chalk.white('P&L: ') + pnlColor(pnlDisplay) +
72
74
  ' '.repeat(Math.max(0, statsRightPad)) + chalk.cyan('║'));
73
75
  }
74
76
 
@@ -119,59 +121,83 @@ const handleUpdate = async () => {
119
121
  currentVersion = require('../../package.json').version || 'unknown';
120
122
  } catch (e) {}
121
123
 
124
+ console.log(chalk.cyan(`\n Current version: v${currentVersion}`));
122
125
  spinner = ora({ text: 'Checking for updates...', color: 'yellow' }).start();
123
126
 
124
127
  let latestVersion;
125
128
  try {
126
- latestVersion = execSync('npm view hedgequantx version 2>/dev/null', {
127
- stdio: 'pipe', timeout: 15000, encoding: 'utf8'
129
+ latestVersion = execSync('npm view hedgequantx version', {
130
+ stdio: ['pipe', 'pipe', 'pipe'],
131
+ timeout: 30000,
132
+ encoding: 'utf8'
128
133
  }).trim();
129
134
 
130
135
  if (!latestVersion || !/^\d+\.\d+\.\d+/.test(latestVersion)) {
131
- throw new Error('Invalid version');
136
+ throw new Error('Invalid version format');
132
137
  }
133
138
  } catch (e) {
134
139
  spinner.fail('Cannot reach npm registry');
140
+ console.log(chalk.gray(` Error: ${e.message}`));
141
+ console.log(chalk.yellow(' Try manually: npm install -g hedgequantx@latest'));
135
142
  await prompts.waitForEnter();
136
143
  return;
137
144
  }
138
145
 
146
+ spinner.succeed(`Latest version: v${latestVersion}`);
147
+
139
148
  if (currentVersion === latestVersion) {
140
- spinner.succeed(`Already up to date! (v${currentVersion})`);
141
- await new Promise(r => setTimeout(r, 2000));
149
+ console.log(chalk.green(' Already up to date!'));
150
+ await prompts.waitForEnter();
142
151
  return;
143
152
  }
144
153
 
145
- spinner.text = `Updating v${currentVersion} → v${latestVersion}...`;
154
+ console.log(chalk.yellow(` Update available: v${currentVersion} → v${latestVersion}`));
155
+ spinner = ora({ text: 'Installing update...', color: 'yellow' }).start();
146
156
 
147
157
  try {
148
- execSync('npm install -g hedgequantx@latest 2>/dev/null', {
149
- stdio: 'pipe', timeout: 120000, encoding: 'utf8'
158
+ // Try with sudo first on Unix systems
159
+ const isWindows = process.platform === 'win32';
160
+ const cmd = isWindows
161
+ ? 'npm install -g hedgequantx@latest'
162
+ : 'npm install -g hedgequantx@latest';
163
+
164
+ execSync(cmd, {
165
+ stdio: ['pipe', 'pipe', 'pipe'],
166
+ timeout: 180000,
167
+ encoding: 'utf8'
150
168
  });
151
169
  } catch (e) {
152
- spinner.fail('Update failed');
153
- console.log(chalk.yellow(' Try: npm install -g hedgequantx@latest'));
170
+ spinner.fail('Update failed - permission denied?');
171
+ console.log(chalk.gray(` Error: ${e.message}`));
172
+ console.log(chalk.yellow(' Try manually with sudo:'));
173
+ console.log(chalk.white(' sudo npm install -g hedgequantx@latest'));
154
174
  await prompts.waitForEnter();
155
175
  return;
156
176
  }
157
177
 
158
- spinner.succeed(`Updated: v${currentVersion} v${latestVersion}`);
159
- console.log(chalk.cyan(' Restarting...'));
178
+ spinner.succeed(`Updated to v${latestVersion}!`);
179
+ console.log(chalk.cyan(' Restarting HQX...'));
160
180
 
161
- await new Promise(r => setTimeout(r, 2000));
181
+ await new Promise(r => setTimeout(r, 1500));
162
182
 
163
183
  try {
164
- const child = spawn('hedgequantx', [], { stdio: 'inherit', detached: true, shell: true });
184
+ const child = spawn('hqx', [], {
185
+ stdio: 'inherit',
186
+ detached: true,
187
+ shell: true
188
+ });
165
189
  child.unref();
166
190
  process.exit(0);
167
191
  } catch (e) {
168
- console.log(chalk.yellow(' Please run: hedgequantx'));
192
+ console.log(chalk.yellow('\n Please restart HQX manually:'));
193
+ console.log(chalk.white(' hqx'));
169
194
  await prompts.waitForEnter();
170
195
  }
171
196
 
172
197
  } catch (error) {
173
198
  if (spinner) spinner.fail('Update error');
174
- console.log(chalk.yellow(' Try: npm install -g hedgequantx@latest'));
199
+ console.log(chalk.gray(` Error: ${error.message}`));
200
+ console.log(chalk.yellow(' Try manually: npm install -g hedgequantx@latest'));
175
201
  await prompts.waitForEnter();
176
202
  }
177
203
  };