@hardkas/sdk 0.9.1-alpha → 0.9.3-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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createHardkasClient
3
- } from "./chunk-V32UCCTZ.js";
3
+ } from "./chunk-IR6EJBJT.js";
4
4
  export {
5
5
  createHardkasClient
6
6
  };
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.1-alpha; the SDK reports that boundary instead of silently shelling out.
283
+ * 0.9.3-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.1-alpha because it
289
+ * Toccata Docker mining/funding remains CLI-only in 0.9.3-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 & {
@@ -545,6 +545,9 @@ interface SilverCompareReport {
545
545
  notes: SilverCompareEntry[];
546
546
  expectedKnownLimitations: ["PARTIAL_VM_SIMULATION"];
547
547
  }
548
+ declare const SilverScript: {
549
+ builder(): never;
550
+ };
548
551
  declare class HardkasSilver {
549
552
  private sdk;
550
553
  readonly simulate: {
@@ -925,4 +928,4 @@ declare class Hardkas {
925
928
  enforcePolicy(action: "network" | "mainnet" | "external-wallet" | "mutation", context?: string): void;
926
929
  }
927
930
 
928
- export { type CorpusIssue, type CorpusVerifyResult, Hardkas, HardkasAccounts, HardkasArtifactsManager, type HardkasCapabilities, HardkasCapabilitiesApi, HardkasCorpus, HardkasL2, HardkasLineage, HardkasLocalnet, type HardkasOptions, HardkasProgrammability, HardkasQuery, HardkasReplay, HardkasSilver, HardkasTx, HardkasVprogs, HardkasWorkspace, HardkasZk, type ProgrammabilityAppPlan, type ProgrammabilityCapabilitiesResult, type ProgrammabilityClaims, type ProgrammabilityCorpusReport, type ProgrammabilityInspectResult, type ProgrammabilityKind, type ProgrammabilityVerifyResult, type SilverCompareMode, type SilverCompareOptions, type SilverCompareReport, type SilverCompileOptions, type SilverDeployPlanOptions, type SilverSdkArtifactResult, type SilverSdkWriteOptions, type SilverSpendPlanOptions, type TaskArgs, type TaskContext, type VprogsCapabilitiesResult, type VprogsClaims, type VprogsInspectResult, type VprogsStatusResult, type ZkCapabilities, type ZkCorpusVerifyResult, type ZkIssue, type ZkProofInspectResult, type ZkProofSystem, type ZkProofVerifyResult, createHardkasCapabilities, createProgrammabilityCapabilities, createVprogsCapabilities, createVprogsStatus, createZkCapabilities, defineTask, inspectVprogsArtifact, inspectZkProof, programmabilityClaims, verifyToccataCorpus, verifyZkCorpus, verifyZkProofLocal };
931
+ export { type CorpusIssue, type CorpusVerifyResult, Hardkas, HardkasAccounts, HardkasArtifactsManager, type HardkasCapabilities, HardkasCapabilitiesApi, HardkasCorpus, HardkasL2, HardkasLineage, HardkasLocalnet, type HardkasOptions, HardkasProgrammability, HardkasQuery, HardkasReplay, HardkasSilver, HardkasTx, HardkasVprogs, HardkasWorkspace, HardkasZk, type ProgrammabilityAppPlan, type ProgrammabilityCapabilitiesResult, type ProgrammabilityClaims, type ProgrammabilityCorpusReport, type ProgrammabilityInspectResult, type ProgrammabilityKind, type ProgrammabilityVerifyResult, type SilverCompareMode, type SilverCompareOptions, type SilverCompareReport, type SilverCompileOptions, type SilverDeployPlanOptions, SilverScript, type SilverSdkArtifactResult, type SilverSdkWriteOptions, type SilverSpendPlanOptions, type TaskArgs, type TaskContext, type VprogsCapabilitiesResult, type VprogsClaims, type VprogsInspectResult, type VprogsStatusResult, type ZkCapabilities, type ZkCorpusVerifyResult, type ZkIssue, type ZkProofInspectResult, type ZkProofSystem, type ZkProofVerifyResult, createHardkasCapabilities, createProgrammabilityCapabilities, createVprogsCapabilities, createVprogsStatus, createZkCapabilities, defineTask, inspectVprogsArtifact, inspectZkProof, programmabilityClaims, verifyToccataCorpus, verifyZkCorpus, verifyZkProofLocal };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createHardkasClient
3
- } from "./chunk-V32UCCTZ.js";
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.1-alpha; the SDK reports that boundary instead of silently shelling out.
1162
+ * 0.9.3-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.1-alpha. Use `hardkas localnet start --profile toccata-v2`."
1180
+ message: "SDK Docker localnet start is not supported in 0.9.3-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.1-alpha because it
1186
+ * Toccata Docker mining/funding remains CLI-only in 0.9.3-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.1-alpha. Use `hardkas localnet fund <account> --profile toccata-v2`."
1210
+ message: "SDK Toccata funding is not supported in 0.9.3-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
  }
@@ -2564,6 +2564,13 @@ import {
2564
2564
  simulateSilverSpend
2565
2565
  } from "@hardkas/simulator";
2566
2566
  import { HardkasSchemas as HardkasSchemas6 } from "@hardkas/artifacts";
2567
+ var SilverScript = {
2568
+ builder() {
2569
+ throw new Error(
2570
+ "SILVERSCRIPT_MAINNET_NOT_ENABLED: SilverScript builder is experimental and requires simnet capability checks in 0.9.3-alpha."
2571
+ );
2572
+ }
2573
+ };
2567
2574
  var HardkasSilver = class {
2568
2575
  constructor(sdk) {
2569
2576
  this.sdk = sdk;
@@ -2653,7 +2660,7 @@ var HardkasSilver = class {
2653
2660
  async deploy(options) {
2654
2661
  if (options.mode === "real") {
2655
2662
  throw new Error(
2656
- "SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver deploy` for Docker/RPC execution in 0.9.1-alpha."
2663
+ "SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver deploy` for Docker/RPC execution in 0.9.3-alpha."
2657
2664
  );
2658
2665
  }
2659
2666
  return this.simulateDeploy(options.artifact, options);
@@ -2713,7 +2720,7 @@ var HardkasSilver = class {
2713
2720
  async spend(options) {
2714
2721
  if (options.mode === "real") {
2715
2722
  throw new Error(
2716
- "SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver spend` for Docker/RPC execution in 0.9.1-alpha."
2723
+ "SDK_SILVER_REAL_LIFECYCLE_UNSUPPORTED: use `hardkas silver spend` for Docker/RPC execution in 0.9.3-alpha."
2717
2724
  );
2718
2725
  }
2719
2726
  return this.simulateSpend(
@@ -3125,7 +3132,7 @@ async function verifyZkProofLocal(targetPath, workspaceRoot = process.cwd()) {
3125
3132
  issues: [
3126
3133
  {
3127
3134
  code: "RISC0_VERIFIER_UNAVAILABLE",
3128
- message: "RISC0 local receipt verification helper is not bundled in 0.9.1-alpha."
3135
+ message: "RISC0 local receipt verification helper is not bundled in 0.9.3-alpha."
3129
3136
  },
3130
3137
  {
3131
3138
  code: "RISC0_LOCAL_VERIFICATION_NOT_IMPLEMENTED",
@@ -4161,6 +4168,7 @@ export {
4161
4168
  HardkasWorkspace,
4162
4169
  HardkasZk,
4163
4170
  SOMPI_PER_KAS,
4171
+ SilverScript,
4164
4172
  buildPaymentPlan2 as buildPaymentPlan,
4165
4173
  createHardkasCapabilities,
4166
4174
  createHardkasClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardkas/sdk",
3
- "version": "0.9.1-alpha",
3
+ "version": "0.9.3-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/artifacts": "0.9.1-alpha",
28
- "@hardkas/accounts": "0.9.1-alpha",
29
- "@hardkas/kaspa-rpc": "0.9.1-alpha",
30
- "@hardkas/config": "0.9.1-alpha",
31
- "@hardkas/core": "0.9.1-alpha",
32
- "@hardkas/l2": "0.9.1-alpha",
33
- "@hardkas/query": "0.9.1-alpha",
34
- "@hardkas/query-store": "0.9.1-alpha",
35
- "@hardkas/simulator": "0.9.1-alpha",
36
- "@hardkas/localnet": "0.9.1-alpha",
37
- "@hardkas/tx-builder": "0.9.1-alpha",
38
- "@hardkas/wallet-adapter": "0.9.1-alpha"
27
+ "@hardkas/accounts": "0.9.3-alpha",
28
+ "@hardkas/artifacts": "0.9.3-alpha",
29
+ "@hardkas/kaspa-rpc": "0.9.3-alpha",
30
+ "@hardkas/core": "0.9.3-alpha",
31
+ "@hardkas/config": "0.9.3-alpha",
32
+ "@hardkas/localnet": "0.9.3-alpha",
33
+ "@hardkas/query": "0.9.3-alpha",
34
+ "@hardkas/query-store": "0.9.3-alpha",
35
+ "@hardkas/simulator": "0.9.3-alpha",
36
+ "@hardkas/l2": "0.9.3-alpha",
37
+ "@hardkas/tx-builder": "0.9.3-alpha",
38
+ "@hardkas/wallet-adapter": "0.9.3-alpha"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.12.7",