@solard/cli 0.2.21 → 0.2.23
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 +5 -3
- package/src/index.ts +11 -10
- package/src/price-feed-server.architecture.test.ts +21 -0
- package/src/price-feed-server.ts +288 -1446
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solard/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "Command-line interface for the Solard SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
"bun": ">=1.1.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@solard/core": "0.2.21",
|
|
22
21
|
"@solana/web3.js": "^1.98.4",
|
|
22
|
+
"@solard/core": "0.2.23",
|
|
23
|
+
"@solard/sdk": "0.2.23",
|
|
23
24
|
"bs58": "^6.0.0",
|
|
24
25
|
"measure-fn": "5.2.0"
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
|
-
"typecheck": "tsc --noEmit -p ../../tsconfig.json"
|
|
28
|
+
"typecheck": "tsc --noEmit -p ../../tsconfig.json",
|
|
29
|
+
"test": "bun test src"
|
|
28
30
|
}
|
|
29
31
|
}
|
package/src/index.ts
CHANGED
|
@@ -1072,11 +1072,10 @@ async function main() {
|
|
|
1072
1072
|
throw new Error(
|
|
1073
1073
|
"Usage: slrd export <wallet|address> [--json] [--out <path>]",
|
|
1074
1074
|
);
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
: bs58.encode(signer.secretKey);
|
|
1075
|
+
const exported = slrd.exportWalletPrivateKey(
|
|
1076
|
+
ref,
|
|
1077
|
+
flags.has("json") ? "json" : "base58",
|
|
1078
|
+
);
|
|
1080
1079
|
|
|
1081
1080
|
const out = flags.get("out");
|
|
1082
1081
|
if (out && out !== "true") {
|
|
@@ -1084,18 +1083,20 @@ async function main() {
|
|
|
1084
1083
|
const { dirname, resolve } = await import("node:path");
|
|
1085
1084
|
const path = resolve(out);
|
|
1086
1085
|
mkdirSync(dirname(path), { recursive: true });
|
|
1087
|
-
writeFileSync(path, `${
|
|
1086
|
+
writeFileSync(path, `${exported.privateKey}\n`, {
|
|
1087
|
+
mode: 0o600,
|
|
1088
|
+
flag: "wx",
|
|
1089
|
+
});
|
|
1088
1090
|
emit(
|
|
1089
|
-
`${OWL} exported @${
|
|
1091
|
+
`${OWL} exported @${exported.wallet.name ?? "?"} ${exported.wallet.address} -> ${path}\n`,
|
|
1090
1092
|
);
|
|
1091
1093
|
return;
|
|
1092
1094
|
}
|
|
1093
1095
|
|
|
1094
|
-
// Secret to stdout only; metadata to stderr so piping stays clean.
|
|
1095
1096
|
process.stderr.write(
|
|
1096
|
-
`${OWL} @${
|
|
1097
|
+
`${OWL} @${exported.wallet.name ?? "?"} ${exported.wallet.address} (${exported.format === "json" ? "keypair-json" : "base58"})\n`,
|
|
1097
1098
|
);
|
|
1098
|
-
process.stdout.write(`${
|
|
1099
|
+
process.stdout.write(`${exported.privateKey}\n`);
|
|
1099
1100
|
return;
|
|
1100
1101
|
}
|
|
1101
1102
|
if (command === "import") {
|
|
@@ -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
|
+
});
|