@hardkas/sdk 0.9.1-alpha → 0.9.2-alpha
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/{chunk-V32UCCTZ.js → chunk-IR6EJBJT.js} +1 -1
- package/dist/client.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +18 -18
- package/package.json +13 -13
|
@@ -16,7 +16,7 @@ function createHardkasClient(options = {}) {
|
|
|
16
16
|
} catch (e) {
|
|
17
17
|
return {
|
|
18
18
|
ok: false,
|
|
19
|
-
error: { code: "FETCH_FAILED", message: e.message },
|
|
19
|
+
error: { code: "FETCH_FAILED", message: e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e) },
|
|
20
20
|
warnings: [],
|
|
21
21
|
meta: {
|
|
22
22
|
workspace: "unknown",
|
package/dist/client.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -280,13 +280,13 @@ declare class HardkasLocalnet {
|
|
|
280
280
|
* Initializes the in-memory simulated workspace.
|
|
281
281
|
*
|
|
282
282
|
* Docker Toccata process control remains a CLI/localnet responsibility in
|
|
283
|
-
* 0.9.
|
|
283
|
+
* 0.9.2-alpha; the SDK reports that boundary instead of silently shelling out.
|
|
284
284
|
*/
|
|
285
285
|
start(options?: LocalnetProfileOptions): Promise<LocalnetControlResult>;
|
|
286
286
|
/**
|
|
287
287
|
* Funds a simulated account through the SDK transaction flow.
|
|
288
288
|
*
|
|
289
|
-
* Toccata Docker mining/funding remains CLI-only in 0.9.
|
|
289
|
+
* Toccata Docker mining/funding remains CLI-only in 0.9.2-alpha because it
|
|
290
290
|
* depends on a local stratum/miner companion and host Docker state.
|
|
291
291
|
*/
|
|
292
292
|
fund(identifier: string, options?: LocalnetProfileOptions & {
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createHardkasClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IR6EJBJT.js";
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
import {
|
|
@@ -652,7 +652,7 @@ var HardkasTx = class {
|
|
|
652
652
|
enforceMetadata: false
|
|
653
653
|
});
|
|
654
654
|
} catch (e) {
|
|
655
|
-
if (e.message.includes("PARENT_MISSING")) {
|
|
655
|
+
if ((e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e)).includes("PARENT_MISSING")) {
|
|
656
656
|
throw new Error("parent_plan_unresolved: Missing context plan for simulation.");
|
|
657
657
|
}
|
|
658
658
|
throw e;
|
|
@@ -867,7 +867,7 @@ var HardkasTx = class {
|
|
|
867
867
|
enforceMetadata: false
|
|
868
868
|
});
|
|
869
869
|
} catch (e) {
|
|
870
|
-
if (e.message.includes("PARENT_MISSING")) {
|
|
870
|
+
if ((e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e)).includes("PARENT_MISSING")) {
|
|
871
871
|
throw new Error("parent_plan_unresolved: Missing context plan for simulation.");
|
|
872
872
|
}
|
|
873
873
|
throw e;
|
|
@@ -889,7 +889,7 @@ var HardkasTx = class {
|
|
|
889
889
|
try {
|
|
890
890
|
simResult = await this.simulate(signedArtifact, simOpts);
|
|
891
891
|
} catch (e) {
|
|
892
|
-
if (e.message && e.message.includes("invalid simulated input")) {
|
|
892
|
+
if ((e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e)) && (e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e)).includes("invalid simulated input")) {
|
|
893
893
|
try {
|
|
894
894
|
const { loadSimulatedReceipt, getReceiptPath } = await import("@hardkas/localnet");
|
|
895
895
|
const txIdToLoad = signedArtifact.txId || `simulated-${signedArtifact.sourcePlanId}-tx`;
|
|
@@ -1087,7 +1087,7 @@ var HardkasQuery = class {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
);
|
|
1089
1089
|
} catch (e) {
|
|
1090
|
-
if (e.message?.includes("SQLITE") || e.message?.includes("Cannot read properties")) {
|
|
1090
|
+
if ((e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e))?.includes("SQLITE") || (e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e))?.includes("Cannot read properties")) {
|
|
1091
1091
|
throw new Error(
|
|
1092
1092
|
"Query store database is not configured correctly or corrupted. Try running query.sync({ force: true })."
|
|
1093
1093
|
);
|
|
@@ -1159,7 +1159,7 @@ var HardkasLocalnet = class {
|
|
|
1159
1159
|
* Initializes the in-memory simulated workspace.
|
|
1160
1160
|
*
|
|
1161
1161
|
* Docker Toccata process control remains a CLI/localnet responsibility in
|
|
1162
|
-
* 0.9.
|
|
1162
|
+
* 0.9.2-alpha; the SDK reports that boundary instead of silently shelling out.
|
|
1163
1163
|
*/
|
|
1164
1164
|
async start(options = {}) {
|
|
1165
1165
|
const profile = options.profile || "simulated";
|
|
@@ -1177,13 +1177,13 @@ var HardkasLocalnet = class {
|
|
|
1177
1177
|
schema: HardkasSchemas2.LocalnetControlV1,
|
|
1178
1178
|
profile,
|
|
1179
1179
|
status: "SDK_LOCALNET_CONTROL_UNSUPPORTED",
|
|
1180
|
-
message: "SDK Docker localnet start is not supported in 0.9.
|
|
1180
|
+
message: "SDK Docker localnet start is not supported in 0.9.2-alpha. Use `hardkas localnet start --profile toccata-v2`."
|
|
1181
1181
|
};
|
|
1182
1182
|
}
|
|
1183
1183
|
/**
|
|
1184
1184
|
* Funds a simulated account through the SDK transaction flow.
|
|
1185
1185
|
*
|
|
1186
|
-
* Toccata Docker mining/funding remains CLI-only in 0.9.
|
|
1186
|
+
* Toccata Docker mining/funding remains CLI-only in 0.9.2-alpha because it
|
|
1187
1187
|
* depends on a local stratum/miner companion and host Docker state.
|
|
1188
1188
|
*/
|
|
1189
1189
|
async fund(identifier, options = {}) {
|
|
@@ -1207,7 +1207,7 @@ var HardkasLocalnet = class {
|
|
|
1207
1207
|
profile,
|
|
1208
1208
|
identifier,
|
|
1209
1209
|
status: "SDK_TOCCATA_FUNDING_UNSUPPORTED",
|
|
1210
|
-
message: "SDK Toccata funding is not supported in 0.9.
|
|
1210
|
+
message: "SDK Toccata funding is not supported in 0.9.2-alpha. Use `hardkas localnet fund <account> --profile toccata-v2`."
|
|
1211
1211
|
};
|
|
1212
1212
|
}
|
|
1213
1213
|
/**
|
|
@@ -1548,7 +1548,7 @@ var HardkasReplay = class {
|
|
|
1548
1548
|
}
|
|
1549
1549
|
report = { invariantsOk: determinismOk && contaminationOk };
|
|
1550
1550
|
} catch (e) {
|
|
1551
|
-
verifyErrorMsg = `Workflow Replay failed: ${e.message}`;
|
|
1551
|
+
verifyErrorMsg = `Workflow Replay failed: ${e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e)}`;
|
|
1552
1552
|
lineageOk = false;
|
|
1553
1553
|
determinismOk = false;
|
|
1554
1554
|
}
|
|
@@ -1564,7 +1564,7 @@ var HardkasReplay = class {
|
|
|
1564
1564
|
plan = await readTxPlanArtifact(planPath);
|
|
1565
1565
|
receipt = await readTxReceiptArtifact2(receiptPath);
|
|
1566
1566
|
} catch (err) {
|
|
1567
|
-
verifyErrorMsg = err.message;
|
|
1567
|
+
verifyErrorMsg = err instanceof Error ? err instanceof Error ? err instanceof Error ? err.message : String(err) : String(err) : String(err);
|
|
1568
1568
|
}
|
|
1569
1569
|
if (!verifyErrorMsg && plan && receipt) {
|
|
1570
1570
|
try {
|
|
@@ -1581,7 +1581,7 @@ var HardkasReplay = class {
|
|
|
1581
1581
|
const reportPath = path.join(this.sdk.workspace.artifactsDir, reportFilename);
|
|
1582
1582
|
await writeArtifact2(reportPath, report);
|
|
1583
1583
|
} catch (err) {
|
|
1584
|
-
verifyErrorMsg = `Replay execution failed: ${err.message}`;
|
|
1584
|
+
verifyErrorMsg = `Replay execution failed: ${err instanceof Error ? err instanceof Error ? err instanceof Error ? err.message : String(err) : String(err) : String(err)}`;
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
1587
|
} else {
|
|
@@ -1877,7 +1877,7 @@ var HardkasArtifactsManager = class {
|
|
|
1877
1877
|
return {
|
|
1878
1878
|
valid: false,
|
|
1879
1879
|
reason: "missing_artifact",
|
|
1880
|
-
message: e.message,
|
|
1880
|
+
message: e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e),
|
|
1881
1881
|
artifactId: id
|
|
1882
1882
|
};
|
|
1883
1883
|
}
|
|
@@ -2134,7 +2134,7 @@ var HardkasWorkflow = class {
|
|
|
2134
2134
|
status = "failed";
|
|
2135
2135
|
errorEnvelope = {
|
|
2136
2136
|
code: e.code || "WORKFLOW_STEP_FAILED",
|
|
2137
|
-
message: e.message,
|
|
2137
|
+
message: e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e),
|
|
2138
2138
|
redacted: false
|
|
2139
2139
|
};
|
|
2140
2140
|
artifactSteps.push({
|
|
@@ -2143,7 +2143,7 @@ var HardkasWorkflow = class {
|
|
|
2143
2143
|
startedAt,
|
|
2144
2144
|
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2145
2145
|
// hardkas-determinism-allow: step failed timestamp
|
|
2146
|
-
error: e.message
|
|
2146
|
+
error: e instanceof Error ? e instanceof Error ? e instanceof Error ? e.message : String(e) : String(e) : String(e)
|
|
2147
2147
|
});
|
|
2148
2148
|
break;
|
|
2149
2149
|
}
|
|
@@ -2653,7 +2653,7 @@ var HardkasSilver = class {
|
|
|
2653
2653
|
async deploy(options) {
|
|
2654
2654
|
if (options.mode === "real") {
|
|
2655
2655
|
throw new Error(
|
|
2656
|
-
"SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver deploy` for Docker/RPC execution in 0.9.
|
|
2656
|
+
"SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver deploy` for Docker/RPC execution in 0.9.2-alpha."
|
|
2657
2657
|
);
|
|
2658
2658
|
}
|
|
2659
2659
|
return this.simulateDeploy(options.artifact, options);
|
|
@@ -2713,7 +2713,7 @@ var HardkasSilver = class {
|
|
|
2713
2713
|
async spend(options) {
|
|
2714
2714
|
if (options.mode === "real") {
|
|
2715
2715
|
throw new Error(
|
|
2716
|
-
"SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver spend` for Docker/RPC execution in 0.9.
|
|
2716
|
+
"SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver spend` for Docker/RPC execution in 0.9.2-alpha."
|
|
2717
2717
|
);
|
|
2718
2718
|
}
|
|
2719
2719
|
return this.simulateSpend(
|
|
@@ -3125,7 +3125,7 @@ async function verifyZkProofLocal(targetPath, workspaceRoot = process.cwd()) {
|
|
|
3125
3125
|
issues: [
|
|
3126
3126
|
{
|
|
3127
3127
|
code: "RISC0_VERIFIER_UNAVAILABLE",
|
|
3128
|
-
message: "RISC0 local receipt verification helper is not bundled in 0.9.
|
|
3128
|
+
message: "RISC0 local receipt verification helper is not bundled in 0.9.2-alpha."
|
|
3129
3129
|
},
|
|
3130
3130
|
{
|
|
3131
3131
|
code: "RISC0_LOCAL_VERIFICATION_NOT_IMPLEMENTED",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hardkas/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2-alpha",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@kaspa/core-lib": "^1.6.5",
|
|
27
|
-
"@hardkas/
|
|
28
|
-
"@hardkas/
|
|
29
|
-
"@hardkas/
|
|
30
|
-
"@hardkas/
|
|
31
|
-
"@hardkas/
|
|
32
|
-
"@hardkas/
|
|
33
|
-
"@hardkas/query": "0.9.
|
|
34
|
-
"@hardkas/query
|
|
35
|
-
"@hardkas/simulator": "0.9.
|
|
36
|
-
"@hardkas/
|
|
37
|
-
"@hardkas/
|
|
38
|
-
"@hardkas/wallet-adapter": "0.9.
|
|
27
|
+
"@hardkas/accounts": "0.9.2-alpha",
|
|
28
|
+
"@hardkas/core": "0.9.2-alpha",
|
|
29
|
+
"@hardkas/artifacts": "0.9.2-alpha",
|
|
30
|
+
"@hardkas/l2": "0.9.2-alpha",
|
|
31
|
+
"@hardkas/kaspa-rpc": "0.9.2-alpha",
|
|
32
|
+
"@hardkas/config": "0.9.2-alpha",
|
|
33
|
+
"@hardkas/query-store": "0.9.2-alpha",
|
|
34
|
+
"@hardkas/query": "0.9.2-alpha",
|
|
35
|
+
"@hardkas/simulator": "0.9.2-alpha",
|
|
36
|
+
"@hardkas/tx-builder": "0.9.2-alpha",
|
|
37
|
+
"@hardkas/localnet": "0.9.2-alpha",
|
|
38
|
+
"@hardkas/wallet-adapter": "0.9.2-alpha"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^20.12.7",
|