hedgequantx 2.9.54 → 2.9.56

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.54",
3
+ "version": "2.9.56",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -216,9 +216,10 @@ const decodeProductCodes = (buffer) => {
216
216
  } else if (wireType === 2) {
217
217
  const [val, newOff] = readString(data, offset);
218
218
  offset = newOff;
219
- if (fieldNumber === 110101) result.exchange = val;
220
- if (fieldNumber === 100749) result.productCode = val;
221
- if (fieldNumber === 100003) result.productName = val;
219
+ // Field IDs from response_product_codes.proto
220
+ if (fieldNumber === 110101) result.exchange = val; // exchange
221
+ if (fieldNumber === 110102) result.productCode = val; // product_code (ES, MES, MNQ, etc.)
222
+ if (fieldNumber === 110103) result.productName = val; // product_name
222
223
  } else {
223
224
  break;
224
225
  }
@@ -3,10 +3,40 @@
3
3
  * @module utils/prompts
4
4
  *
5
5
  * Uses native readline for reliable stdin handling
6
+ * Yellow spinner shows activity while waiting for user input
6
7
  */
7
8
 
8
9
  const inquirer = require('inquirer');
9
10
  const readline = require('readline');
11
+ const chalk = require('chalk');
12
+
13
+ // Spinner characters for yellow waiting indicator
14
+ const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
15
+ let spinnerInterval = null;
16
+ let spinnerFrame = 0;
17
+
18
+ /**
19
+ * Start yellow spinner to show we're waiting for user input
20
+ */
21
+ const startSpinner = () => {
22
+ if (spinnerInterval) return;
23
+ spinnerFrame = 0;
24
+ spinnerInterval = setInterval(() => {
25
+ spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES.length;
26
+ process.stdout.write(`\r${chalk.yellow(SPINNER_FRAMES[spinnerFrame])} `);
27
+ }, 80);
28
+ };
29
+
30
+ /**
31
+ * Stop spinner and clear line
32
+ */
33
+ const stopSpinner = () => {
34
+ if (spinnerInterval) {
35
+ clearInterval(spinnerInterval);
36
+ spinnerInterval = null;
37
+ process.stdout.write('\r \r'); // Clear spinner
38
+ }
39
+ };
10
40
 
11
41
  /** @type {readline.Interface|null} */
12
42
  let rl = null;
@@ -79,27 +109,27 @@ const nativePrompt = (message) => {
79
109
  };
80
110
 
81
111
  /**
82
- * Wait for Enter key
112
+ * Wait for Enter key + yellow spinner
83
113
  * @param {string} [message='Press Enter to continue...'] - Message to display
84
114
  * @returns {Promise<void>}
85
115
  */
86
116
  const waitForEnter = async (message = 'Press Enter to continue...') => {
87
- await nativePrompt(message);
117
+ await nativePrompt(`${chalk.yellow('⠋')} ${message}`);
88
118
  };
89
119
 
90
120
  /**
91
- * Text input
121
+ * Text input + yellow spinner
92
122
  * @param {string} message - Prompt message
93
123
  * @param {string} [defaultVal=''] - Default value
94
124
  * @returns {Promise<string>}
95
125
  */
96
126
  const textInput = async (message, defaultVal = '') => {
97
- const value = await nativePrompt(message);
127
+ const value = await nativePrompt(`${chalk.yellow('⠋')} ${message}`);
98
128
  return value || defaultVal;
99
129
  };
100
130
 
101
131
  /**
102
- * Password input (masked)
132
+ * Password input (masked) + yellow spinner
103
133
  * @param {string} message - Prompt message
104
134
  * @returns {Promise<string>}
105
135
  */
@@ -110,7 +140,7 @@ const passwordInput = async (message) => {
110
140
  const { value } = await inquirer.prompt([{
111
141
  type: 'password',
112
142
  name: 'value',
113
- message,
143
+ message: `${chalk.yellow('⠋')} ${message}`,
114
144
  mask: '*',
115
145
  prefix: '',
116
146
  }]);
@@ -119,7 +149,7 @@ const passwordInput = async (message) => {
119
149
  };
120
150
 
121
151
  /**
122
- * Confirm prompt with arrow keys
152
+ * Confirm prompt with arrow keys + yellow spinner
123
153
  * @param {string} message - Prompt message
124
154
  * @param {boolean} [defaultVal=true] - Default value
125
155
  * @returns {Promise<boolean>}
@@ -135,7 +165,7 @@ const confirmPrompt = async (message, defaultVal = true) => {
135
165
  const { value } = await inquirer.prompt([{
136
166
  type: 'list',
137
167
  name: 'value',
138
- message,
168
+ message: `${chalk.yellow('⠋')} ${message}`,
139
169
  choices,
140
170
  prefix: '',
141
171
  loop: false,
@@ -145,7 +175,7 @@ const confirmPrompt = async (message, defaultVal = true) => {
145
175
  };
146
176
 
147
177
  /**
148
- * Number input with validation
178
+ * Number input with validation + yellow spinner
149
179
  * @param {string} message - Prompt message
150
180
  * @param {number} [defaultVal=1] - Default value
151
181
  * @param {number} [min=1] - Minimum value
@@ -159,7 +189,7 @@ const numberInput = async (message, defaultVal = 1, min = 1, max = 1000) => {
159
189
  const { value } = await inquirer.prompt([{
160
190
  type: 'input',
161
191
  name: 'value',
162
- message,
192
+ message: `${chalk.yellow('⠋')} ${message}`,
163
193
  default: String(defaultVal),
164
194
  prefix: '',
165
195
  validate: (v) => {
@@ -175,7 +205,7 @@ const numberInput = async (message, defaultVal = 1, min = 1, max = 1000) => {
175
205
  };
176
206
 
177
207
  /**
178
- * Select from options with arrow keys
208
+ * Select from options with arrow keys + yellow spinner
179
209
  * @param {string} message - Prompt message
180
210
  * @param {Array<{label: string, value: any, disabled?: boolean}>} options - Options
181
211
  * @returns {Promise<any>}
@@ -194,7 +224,7 @@ const selectOption = async (message, options) => {
194
224
  const { value } = await inquirer.prompt([{
195
225
  type: 'list',
196
226
  name: 'value',
197
- message,
227
+ message: `${chalk.yellow('⠋')} ${message}`,
198
228
  choices,
199
229
  prefix: '',
200
230
  loop: false,