@solard/sdk 0.2.29 → 0.2.33

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,44 +1,45 @@
1
- import { describe, expect, test } from "bun:test";
2
- import { readFileSync } from "node:fs";
3
- import { join } from "node:path";
4
-
5
- const client = readFileSync(join(import.meta.dir, "client.ts"), "utf8");
6
- const live = readFileSync(join(import.meta.dir, "live.ts"), "utf8");
7
- const index = readFileSync(join(import.meta.dir, "index.ts"), "utf8");
8
- const core = readFileSync(
9
- join(import.meta.dir, "../../core/src/core/solard.ts"),
10
- "utf8",
11
- );
12
-
13
- describe("operator api", () => {
14
- test("uses one object-form trade api", () => {
15
- expect(client).toContain("input: SolardBuyInput");
16
- expect(client).toContain("input: SolardSellInput");
17
- expect(client).toContain("waitForConfirmation?: boolean");
18
- expect(client).toContain("exportPrivateKey");
19
- expect(client).toContain("getTransaction(");
20
- });
21
-
22
- test("uses one dynamic live trade listener api", () => {
23
- expect(index).toContain("listenTrades");
24
- expect(index).not.toContain("subscribeTrades");
25
- expect(live).toContain("onTrade(callback)");
26
- expect(live).toContain("add: (tokens)");
27
- expect(live).toContain("remove: (tokens)");
28
- });
29
-
30
- test("persists the signed signature before safe rebroadcast", () => {
31
- expect(core).toContain("const signature = signedPlanSignature(plan)");
32
- expect(core).toContain(
33
- "waitForSignatureSeen(this.connection(), signature)",
34
- );
35
- expect(core).toContain("await broadcast(true)");
36
- expect(core).toContain("cacheParsedTransaction");
37
- });
38
-
39
- test("default trades settle inside Solard rather than leaking submitted state", () => {
40
- expect(client).toContain("core.executeTradePlan(");
41
- expect(core).toContain("async settleSubmission(");
42
- expect(core).toContain("submission.plan.lastValidBlockHeight");
43
- });
44
- });
1
+ import { describe, expect, test } from "bun:test";
2
+ import { readFileSync } from "node:fs";
3
+ import { join } from "node:path";
4
+
5
+ const client = readFileSync(join(import.meta.dir, "client.ts"), "utf8");
6
+ const live = readFileSync(join(import.meta.dir, "live.ts"), "utf8");
7
+ const index = readFileSync(join(import.meta.dir, "index.ts"), "utf8");
8
+ const core = readFileSync(
9
+ join(import.meta.dir, "../../core/src/core/solard.ts"),
10
+ "utf8",
11
+ );
12
+
13
+ describe("operator api", () => {
14
+ test("uses one object-form trade api", () => {
15
+ expect(client).toContain("input: SolardBuyInput");
16
+ expect(client).toContain("input: SolardSellInput");
17
+ expect(client).toContain("SolardTradeExecutionOptions = TradeExecutionOptions");
18
+ expect(client).toContain("exportPrivateKey");
19
+ expect(client).toContain("getTransaction(");
20
+ });
21
+
22
+ test("uses one dynamic live trade listener api", () => {
23
+ expect(index).toContain("listenTrades");
24
+ expect(index).not.toContain("subscribeTrades");
25
+ expect(live).toContain("onTrade(callback)");
26
+ expect(live).toContain("add: (tokens)");
27
+ expect(live).toContain("remove: (tokens)");
28
+ });
29
+
30
+ test("persists the signed signature before safe rebroadcast", () => {
31
+ expect(core).toContain("const signature = signedPlanSignature(plan)");
32
+ expect(core).toContain(
33
+ "waitForSignatureSeen(this.connection(), signature)",
34
+ );
35
+ expect(core).toContain("await broadcast(true)");
36
+ expect(core).toContain("cacheParsedTransaction");
37
+ });
38
+
39
+ test("default trades settle inside Solard rather than leaking submitted state", () => {
40
+ expect(client).toContain("core.buy(");
41
+ expect(client).toContain("core.sell(");
42
+ expect(core).toContain("async settleSubmission(");
43
+ expect(core).toContain("submission.plan.lastValidBlockHeight");
44
+ });
45
+ });