@solard/cli 0.2.19 → 0.2.21
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 +3 -3
- package/src/index.ts +685 -146
- package/src/launch-watch-command.ts +379 -0
- package/src/price-feed-client.ts +168 -0
- package/src/price-feed-protocol.ts +51 -0
- package/src/price-feed-server.ts +1653 -0
- package/src/pump-watch-command.ts +11 -0
- package/src/reclaim-command.ts +335 -0
- package/src/research-history-cache.ts +331 -0
- package/src/strategy-backtest-command.ts +740 -0
- package/src/token-history-command.ts +183 -30
- package/src/trade-strategy-command.ts +1237 -0
- package/src/tx-stream.test.ts +38 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
const source = readFileSync(join(import.meta.dir, "index.ts"), "utf8");
|
|
6
|
+
|
|
7
|
+
describe("tx stream CLI", () => {
|
|
8
|
+
test("exposes direct terminal wallet streaming", () => {
|
|
9
|
+
expect(source).toContain('command === "tx" && values[0] === "stream"');
|
|
10
|
+
expect(source).toContain("connection.onLogs(");
|
|
11
|
+
expect(source).toContain("connection.getTransaction(");
|
|
12
|
+
expect(source).toContain("Ctrl+C to stop");
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("supports one wallet, csv wallets, finalized, and jsonl", () => {
|
|
16
|
+
expect(source).toContain('flags.get("wallet")');
|
|
17
|
+
expect(source).toContain('csv(flags.get("wallets"))');
|
|
18
|
+
expect(source).toContain('flags.has("finalized")');
|
|
19
|
+
expect(source).toContain('flags.has("jsonl")');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("stream path does not register a persistent watch", () => {
|
|
23
|
+
const start = source.indexOf('command === "tx" && values[0] === "stream"');
|
|
24
|
+
const end = source.indexOf(
|
|
25
|
+
'command === "sol-flow" || (command === "tx" && values[0] === "flow")',
|
|
26
|
+
start,
|
|
27
|
+
);
|
|
28
|
+
const stream = source.slice(start, end);
|
|
29
|
+
expect(stream).not.toContain("watchWallet(");
|
|
30
|
+
expect(stream).not.toContain("watcher.");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("deduplicates signatures across watched wallets", () => {
|
|
34
|
+
expect(source).toContain("seen.has(signature)");
|
|
35
|
+
expect(source).toContain("queued.has(signature)");
|
|
36
|
+
expect(source).toContain("rememberSeen(item.signature)");
|
|
37
|
+
});
|
|
38
|
+
});
|