byreal-test 1.3.0 → 1.3.2
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 +1 -1
- package/src/setup.js +14 -6
- package/src/swap-runner.js +1 -0
package/package.json
CHANGED
package/src/setup.js
CHANGED
|
@@ -89,14 +89,22 @@ async function runSetup() {
|
|
|
89
89
|
fs.chmodSync(keypairPath, 0o600);
|
|
90
90
|
console.log(chalk.green(` ✓ Keypair saved to ${keypairPath}`));
|
|
91
91
|
|
|
92
|
-
// set wallet
|
|
92
|
+
// set wallet — try new API (v0.2+) first, fall back to old API (v0.1.x)
|
|
93
|
+
let walletOk = false;
|
|
93
94
|
try {
|
|
94
|
-
execSync(`byreal-cli wallet set ${
|
|
95
|
-
|
|
96
|
-
} catch
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
execSync(`byreal-cli wallet set --private-key ${raw}`, { encoding: 'utf8', stdio: 'pipe' });
|
|
96
|
+
walletOk = true;
|
|
97
|
+
} catch {
|
|
98
|
+
// old API: pass keypair file path
|
|
99
|
+
try {
|
|
100
|
+
execSync(`byreal-cli wallet set ${keypairPath}`, { encoding: 'utf8', stdio: 'pipe' });
|
|
101
|
+
walletOk = true;
|
|
102
|
+
} catch (err2) {
|
|
103
|
+
console.error(chalk.red(` ✗ byreal-cli wallet set failed: ${err2.stderr || err2.message}`));
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
99
106
|
}
|
|
107
|
+
if (walletOk) console.log(chalk.green(' ✓ byreal-cli wallet configured'));
|
|
100
108
|
|
|
101
109
|
// confirm address
|
|
102
110
|
try {
|
package/src/swap-runner.js
CHANGED
|
@@ -10,6 +10,7 @@ const SWAP_AMOUNT = '1';
|
|
|
10
10
|
const EXCLUDED_SYMBOLS = new Set([
|
|
11
11
|
'SOL', 'bbSOL', 'USDT', 'USD1', 'CRCLx', 'NVDAx',
|
|
12
12
|
'XAUt0', 'METAx', 'AMZNx', 'COINx', 'APPLx', 'MCDx',
|
|
13
|
+
'GOOGLx', 'TSLAx',
|
|
13
14
|
]);
|
|
14
15
|
|
|
15
16
|
// ─── lark notify ─────────────────────────────────────────────────────────────
|