hedgequantx 2.6.113 → 2.6.115

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.6.113",
3
+ "version": "2.6.115",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -1044,20 +1044,34 @@ const setupProxyOAuth = async (provider, config) => {
1044
1044
 
1045
1045
  // Use inquirer directly for reliable input on VPS
1046
1046
  const inquirer = require('inquirer');
1047
- const { callbackUrl } = await inquirer.prompt([{
1048
- type: 'input',
1049
- name: 'callbackUrl',
1050
- message: 'Callback URL:',
1051
- prefix: ' '
1052
- }]);
1047
+ let callbackUrl = '';
1048
+ try {
1049
+ const result = await inquirer.prompt([{
1050
+ type: 'input',
1051
+ name: 'callbackUrl',
1052
+ message: 'Callback URL:',
1053
+ prefix: ' '
1054
+ }]);
1055
+ callbackUrl = result.callbackUrl || '';
1056
+ } catch (e) {
1057
+ // Inquirer failed, try readline directly
1058
+ const readline = require('readline');
1059
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
1060
+ callbackUrl = await new Promise(resolve => {
1061
+ rl.question(' Callback URL: ', answer => {
1062
+ rl.close();
1063
+ resolve(answer || '');
1064
+ });
1065
+ });
1066
+ }
1053
1067
 
1054
1068
  if (callbackUrl && callbackUrl.trim()) {
1055
1069
  const submitSpinner = ora({ text: 'Submitting callback...', color: 'cyan' }).start();
1056
1070
  try {
1057
1071
  await proxyManager.submitCallback(callbackUrl.trim(), provider.id);
1058
- submitSpinner.text = 'Verifying authorization...';
1059
- await new Promise(resolve => setTimeout(resolve, 1000));
1060
- await proxyManager.waitForAuth(authState, 10000, () => {});
1072
+ // Callback succeeded - CLIProxyAPI handles the token exchange
1073
+ // No need to poll waitForAuth, the callback endpoint already did everything
1074
+ await new Promise(resolve => setTimeout(resolve, 500));
1061
1075
  authSuccess = true;
1062
1076
  submitSpinner.succeed('Authorization successful!');
1063
1077
  } catch (submitError) {