perp-cli 0.7.5 → 0.7.7
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/dist/commands/agent.js +5 -5
- package/dist/commands/risk.js +13 -1
- package/dist/index.js +10 -6
- package/package.json +1 -1
package/dist/commands/agent.js
CHANGED
|
@@ -79,7 +79,7 @@ export function registerAgentCommands(program, getAdapter, isJson) {
|
|
|
79
79
|
schemaVersion: "2.0",
|
|
80
80
|
cliVersion: _pkg.version,
|
|
81
81
|
generatedAt: new Date().toISOString(),
|
|
82
|
-
exchanges: ["pacifica", "hyperliquid", "lighter"],
|
|
82
|
+
exchanges: ["pacifica", "hyperliquid", "lighter", "aster"],
|
|
83
83
|
errorCodes: errorCodeDocs,
|
|
84
84
|
commands: program.commands
|
|
85
85
|
.filter(c => c.name() !== "help")
|
|
@@ -102,7 +102,7 @@ export function registerAgentCommands(program, getAdapter, isJson) {
|
|
|
102
102
|
schemaVersion: "2.0",
|
|
103
103
|
cliVersion: _pkg.version,
|
|
104
104
|
generatedAt: new Date().toISOString(),
|
|
105
|
-
exchanges: ["pacifica", "hyperliquid", "lighter"],
|
|
105
|
+
exchanges: ["pacifica", "hyperliquid", "lighter", "aster"],
|
|
106
106
|
errorCodes: errorCodeDocs,
|
|
107
107
|
commands: program.commands
|
|
108
108
|
.filter(c => c.name() !== "help" && c.name() !== "schema")
|
|
@@ -118,8 +118,8 @@ export function registerAgentCommands(program, getAdapter, isJson) {
|
|
|
118
118
|
printJson(jsonOk({
|
|
119
119
|
name: "perp-cli",
|
|
120
120
|
version: _pkg.version,
|
|
121
|
-
description: "Multi-DEX Perpetual Futures CLI (Pacifica, Hyperliquid, Lighter) with HIP-3 deployed dex support",
|
|
122
|
-
exchanges: ["pacifica", "hyperliquid", "lighter"],
|
|
121
|
+
description: "Multi-DEX Perpetual Futures CLI (Pacifica, Hyperliquid, Lighter, Aster) with HIP-3 deployed dex support",
|
|
122
|
+
exchanges: ["pacifica", "hyperliquid", "lighter", "aster"],
|
|
123
123
|
capabilities: [
|
|
124
124
|
{
|
|
125
125
|
category: "market_data",
|
|
@@ -250,7 +250,7 @@ export function registerAgentCommands(program, getAdapter, isJson) {
|
|
|
250
250
|
],
|
|
251
251
|
notes: [
|
|
252
252
|
"Always use --json flag for machine-readable output",
|
|
253
|
-
"Use -e <exchange> to switch between pacifica, hyperliquid, lighter",
|
|
253
|
+
"Use -e <exchange> to switch between pacifica, hyperliquid, lighter, aster",
|
|
254
254
|
"Use --dex <name> for HIP-3 deployed perp dexes on Hyperliquid",
|
|
255
255
|
"Use -n testnet for testnet mode",
|
|
256
256
|
"Use --client-id or --auto-id on trade commands for retry safety",
|
package/dist/commands/risk.js
CHANGED
|
@@ -4,10 +4,21 @@ import { loadRiskLimits, saveRiskLimits, assessRisk, getLiquidationDistances } f
|
|
|
4
4
|
import { pingPacifica, pingHyperliquid, pingLighter } from "../shared-api.js";
|
|
5
5
|
/** Run health check and return results + render. Exported for use by status --health. */
|
|
6
6
|
export async function runHealthCheck(isJson) {
|
|
7
|
-
const
|
|
7
|
+
const pingAster = async () => {
|
|
8
|
+
const start = Date.now();
|
|
9
|
+
try {
|
|
10
|
+
const res = await fetch("https://fapi.asterdex.com/fapi/v1/time");
|
|
11
|
+
return { ok: res.ok, latencyMs: Date.now() - start, status: res.status };
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return { ok: false, latencyMs: Date.now() - start, status: 0 };
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const [pacPing, hlPing, ltPing, astPing] = await Promise.all([
|
|
8
18
|
pingPacifica(),
|
|
9
19
|
pingHyperliquid(),
|
|
10
20
|
pingLighter(),
|
|
21
|
+
pingAster(),
|
|
11
22
|
]);
|
|
12
23
|
const toPingResult = (name, p) => ({
|
|
13
24
|
exchange: name,
|
|
@@ -19,6 +30,7 @@ export async function runHealthCheck(isJson) {
|
|
|
19
30
|
toPingResult("pacifica", pacPing),
|
|
20
31
|
toPingResult("hyperliquid", hlPing),
|
|
21
32
|
toPingResult("lighter", ltPing),
|
|
33
|
+
toPingResult("aster", astPing),
|
|
22
34
|
];
|
|
23
35
|
const allOk = checks.every(c => c.status === "ok");
|
|
24
36
|
if (isJson()) {
|
package/dist/index.js
CHANGED
|
@@ -632,13 +632,17 @@ if (rawArgs.length === 0 || (!hasSubcommand && !rawArgs.includes("-h") && !rawAr
|
|
|
632
632
|
process.env.LIGHTER_PRIVATE_KEY);
|
|
633
633
|
// ── ASCII banner ──
|
|
634
634
|
const banner = [
|
|
635
|
-
|
|
636
|
-
chalk.cyan("
|
|
637
|
-
chalk.cyan("
|
|
638
|
-
chalk.cyan("
|
|
639
|
-
chalk.cyan("
|
|
635
|
+
"",
|
|
636
|
+
chalk.cyan(" ██████╗ ███████╗██████╗ ██████╗ ██████╗██╗ ██╗"),
|
|
637
|
+
chalk.cyan(" ██╔══██╗██╔════╝██╔══██╗██╔══██╗ ██╔════╝██║ ██║"),
|
|
638
|
+
chalk.cyan(" ██████╔╝█████╗ ██████╔╝██████╔╝ ██║ ██║ ██║"),
|
|
639
|
+
chalk.cyan(" ██╔═══╝ ██╔══╝ ██╔══██╗██╔═══╝ ██║ ██║ ██║"),
|
|
640
|
+
chalk.cyan(" ██║ ███████╗██║ ██║██║ ╚██████╗███████╗██║"),
|
|
641
|
+
chalk.cyan(" ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝╚═╝"),
|
|
642
|
+
"",
|
|
643
|
+
chalk.gray(` 4 exchanges · 19 strategies · v${_pkg.version}`),
|
|
640
644
|
];
|
|
641
|
-
console.log(
|
|
645
|
+
console.log(banner.join("\n"));
|
|
642
646
|
if (!status.hasWallets && !hasEnvKey && !settings.defaultExchange) {
|
|
643
647
|
// Fresh install — onboarding
|
|
644
648
|
console.log(chalk.yellow.bold("\n ⚡ Get started:\n"));
|