@solard/cli 0.2.20 → 0.2.22

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.
@@ -1,8 +1,51 @@
1
- export type {
2
- PriceFeedCommand,
3
- PriceFeedLaunch,
4
- PriceFeedMessage,
5
- PriceFeedPrice,
6
- PriceFeedStatus,
7
- PriceFeedVenue,
8
- } from "@solard/core";
1
+ export type PriceFeedVenue =
2
+ "pump" | "pumpswap" | "raydium-launchlab" | "rpc-fallback";
3
+
4
+ export type PriceFeedLaunch = {
5
+ type: "launch";
6
+ atMs: number;
7
+ signature: string | null;
8
+ slot: number | null;
9
+ mint: string;
10
+ venue: "pump" | "raydium-launchlab";
11
+ decimals: number;
12
+ supplyUi: number;
13
+ quoteMint: string | null;
14
+ pool: string | null;
15
+ name: string | null;
16
+ symbol: string | null;
17
+ isMayhemMode: boolean | null;
18
+ };
19
+
20
+ export type PriceFeedPrice = {
21
+ type: "price";
22
+ atMs: number;
23
+ signature: string | null;
24
+ slot: number | null;
25
+ mint: string;
26
+ venue: PriceFeedVenue;
27
+ priceSol: number | null;
28
+ priceUsd: number | null;
29
+ marketCapUsd: number | null;
30
+ source: string;
31
+ };
32
+
33
+ export type PriceFeedStatus = {
34
+ type: "status";
35
+ atMs: number;
36
+ event: string;
37
+ data?: Record<string, unknown>;
38
+ };
39
+
40
+ export type PriceFeedMessage =
41
+ PriceFeedLaunch | PriceFeedPrice | PriceFeedStatus;
42
+
43
+ export type PriceFeedCommand =
44
+ | {
45
+ op: "subscribe";
46
+ mints?: string[];
47
+ launches?: boolean;
48
+ allPrices?: boolean;
49
+ }
50
+ | { op: "unsubscribe"; mints?: string[] }
51
+ | { op: "ping" };
@@ -0,0 +1,21 @@
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(
6
+ join(import.meta.dir, "price-feed-server.ts"),
7
+ "utf8",
8
+ );
9
+
10
+ describe("price feed application boundary", () => {
11
+ test("consumes sdk subscriptions instead of protocol internals", () => {
12
+ expect(source).toContain("subscribeLaunches");
13
+ expect(source).toContain("subscribeTrades");
14
+ expect(source).toContain('from "@solard/sdk"');
15
+ expect(source).not.toContain('from "@solard/core"');
16
+ expect(source).not.toMatch(
17
+ /PUMP_(?:CREATE|TRADE)_EVENT|PUMPSWAP_(?:BUY|SELL|CREATE)_EVENT|LAUNCHLAB_(?:CREATE|TRADE)_EVENT/,
18
+ );
19
+ expect(source).not.toMatch(/logsSubscribe|onLogs\(/);
20
+ });
21
+ });