-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_executor.js
More file actions
31 lines (28 loc) · 925 Bytes
/
Copy pathtest_executor.js
File metadata and controls
31 lines (28 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const { exec } = require('child_process');
const rpcUrl = "https://api.mainnet-beta.solana.com";
const params = {
command: "get_price",
mint: "So11111111111111111111111111111111111111112",
rpcUrl
}
const child = exec(`python "c:\\Users\\Yella\\.gemini\\antigravity\\playground\\infinite-hypernova\\muscle\\executor.py"`, (err, stdout, stderr) => {
if (err) {
console.log("ERR:", err.message);
return;
}
if (stderr) {
console.log("STDERR:", stderr.trim());
}
try {
const jsonMatch = stdout.match(/\{[\s\S]*\}/);
if (!jsonMatch) {
throw new Error(`Failed to parse executor output: ${stdout}`);
}
const result = JSON.parse(jsonMatch[0]);
console.log("PARSED RESULT:", result);
} catch (e) {
console.error("PARSE ERROR:", e.message);
}
});
child.stdin.write(JSON.stringify(params));
child.stdin.end();