hedgequantx 2.9.225 → 2.9.226
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
package/src/app.js
CHANGED
|
@@ -78,10 +78,17 @@ function createDaemonProxyService(client, propfirm, credentials = null) {
|
|
|
78
78
|
// Return credentials for algo trading market data connection
|
|
79
79
|
if (!storedCredentials) return null;
|
|
80
80
|
const { RITHMIC_ENDPOINTS } = require('./services/rithmic');
|
|
81
|
+
const { getPropFirm } = require('./config/propfirms');
|
|
82
|
+
|
|
83
|
+
// Get the proper rithmicSystem from propfirm config
|
|
84
|
+
const propfirmKey = propfirm?.key || 'apex_rithmic';
|
|
85
|
+
const propfirmConfig = getPropFirm(propfirmKey);
|
|
86
|
+
const systemName = propfirmConfig?.rithmicSystem || propfirm?.rithmicSystem || propfirm?.name || 'Apex';
|
|
87
|
+
|
|
81
88
|
return {
|
|
82
89
|
userId: storedCredentials.username,
|
|
83
90
|
password: storedCredentials.password,
|
|
84
|
-
systemName
|
|
91
|
+
systemName,
|
|
85
92
|
gateway: RITHMIC_ENDPOINTS?.CHICAGO || 'wss://rprotocol.rithmic.com:443',
|
|
86
93
|
};
|
|
87
94
|
},
|
|
@@ -54,9 +54,14 @@ function createHandlers(daemon) {
|
|
|
54
54
|
const result = await daemon.rithmic.login(username, password);
|
|
55
55
|
|
|
56
56
|
if (result.success) {
|
|
57
|
+
// Get rithmicSystem from config
|
|
58
|
+
const { getPropFirm } = require('../../config/propfirms');
|
|
59
|
+
const propfirmConfig = getPropFirm(propfirmKey);
|
|
60
|
+
|
|
57
61
|
daemon.propfirm = {
|
|
58
62
|
key: propfirmKey,
|
|
59
63
|
name: daemon.rithmic.propfirm.name,
|
|
64
|
+
rithmicSystem: propfirmConfig?.rithmicSystem || daemon.rithmic.propfirm.systemName || 'Apex',
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
// Save credentials for auto-reconnect
|
|
@@ -72,6 +77,7 @@ function createHandlers(daemon) {
|
|
|
72
77
|
type: 'rithmic',
|
|
73
78
|
propfirm: daemon.propfirm.name,
|
|
74
79
|
propfirmKey,
|
|
80
|
+
rithmicSystem: daemon.propfirm.rithmicSystem,
|
|
75
81
|
credentials: { username, password },
|
|
76
82
|
accounts: daemon.rithmic.accounts,
|
|
77
83
|
}]);
|
|
@@ -116,9 +122,14 @@ function createHandlers(daemon) {
|
|
|
116
122
|
);
|
|
117
123
|
|
|
118
124
|
if (result.success) {
|
|
125
|
+
// Get rithmicSystem from config or session
|
|
126
|
+
const { getPropFirm } = require('../../config/propfirms');
|
|
127
|
+
const propfirmConfig = getPropFirm(propfirmKey);
|
|
128
|
+
|
|
119
129
|
daemon.propfirm = {
|
|
120
130
|
key: propfirmKey,
|
|
121
131
|
name: daemon.rithmic.propfirm.name,
|
|
132
|
+
rithmicSystem: propfirmConfig?.rithmicSystem || rithmicSession.rithmicSystem || daemon.rithmic.propfirm.systemName || 'Apex',
|
|
122
133
|
};
|
|
123
134
|
|
|
124
135
|
// Save credentials for auto-reconnect
|
|
@@ -299,6 +310,13 @@ function createHandlers(daemon) {
|
|
|
299
310
|
|
|
300
311
|
// Return credentials for algo trading market data
|
|
301
312
|
const { RITHMIC_ENDPOINTS } = require('../rithmic');
|
|
313
|
+
const { getPropFirm } = require('../../config/propfirms');
|
|
314
|
+
|
|
315
|
+
// Get proper rithmicSystem from config
|
|
316
|
+
const propfirmKey = rithmicSession.propfirmKey || daemon.propfirm?.key || 'apex_rithmic';
|
|
317
|
+
const propfirmConfig = getPropFirm(propfirmKey);
|
|
318
|
+
const systemName = propfirmConfig?.rithmicSystem || daemon.propfirm?.name || rithmicSession.propfirm || 'Apex';
|
|
319
|
+
|
|
302
320
|
daemon._send(socket, createMessage(MSG_TYPE.CREDENTIALS, {
|
|
303
321
|
success: true,
|
|
304
322
|
credentials: {
|
|
@@ -308,9 +326,10 @@ function createHandlers(daemon) {
|
|
|
308
326
|
rithmicCredentials: {
|
|
309
327
|
userId: rithmicSession.credentials.username,
|
|
310
328
|
password: rithmicSession.credentials.password,
|
|
311
|
-
systemName
|
|
329
|
+
systemName,
|
|
312
330
|
gateway: RITHMIC_ENDPOINTS?.CHICAGO || 'wss://rprotocol.rithmic.com:443',
|
|
313
331
|
},
|
|
332
|
+
propfirmKey,
|
|
314
333
|
}, id));
|
|
315
334
|
}
|
|
316
335
|
|
|
@@ -335,10 +335,16 @@ class DaemonProxyService extends EventEmitter {
|
|
|
335
335
|
// For daemon mode, return stored credentials
|
|
336
336
|
if (this.credentials && this.propfirmKey) {
|
|
337
337
|
const { RITHMIC_ENDPOINTS } = require('../rithmic');
|
|
338
|
+
const { getPropFirm } = require('../../config/propfirms');
|
|
339
|
+
|
|
340
|
+
// Get proper rithmicSystem from config
|
|
341
|
+
const propfirmConfig = getPropFirm(this.propfirmKey);
|
|
342
|
+
const systemName = propfirmConfig?.rithmicSystem || this.propfirm?.rithmicSystem || 'Apex';
|
|
343
|
+
|
|
338
344
|
return {
|
|
339
345
|
userId: this.credentials.username,
|
|
340
346
|
password: this.credentials.password,
|
|
341
|
-
systemName
|
|
347
|
+
systemName,
|
|
342
348
|
gateway: RITHMIC_ENDPOINTS?.CHICAGO || 'wss://rprotocol.rithmic.com:443',
|
|
343
349
|
};
|
|
344
350
|
}
|