@hardkas/accounts 0.6.0-alpha → 0.7.0-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/index.d.ts CHANGED
@@ -265,6 +265,7 @@ declare function importRealDevAccount(store: RealAccountStore, account: {
265
265
  readonly address: string;
266
266
  readonly publicKey?: string;
267
267
  readonly privateKey?: string;
268
+ readonly keystoreRef?: string;
268
269
  }): RealAccountStore;
269
270
  declare function removeRealDevAccount(store: RealAccountStore, name: string): RealAccountStore;
270
271
  declare function getRealDevAccount(store: RealAccountStore, name: string): RealDevAccount | null;
package/dist/index.js CHANGED
@@ -23,8 +23,9 @@ import fs from "fs";
23
23
  import path from "path";
24
24
  import { writeFileAtomicSync } from "@hardkas/core";
25
25
  import { HARDKAS_VERSION, ARTIFACT_SCHEMAS, ARTIFACT_VERSION } from "@hardkas/artifacts";
26
- function getDefaultRealAccountsPath(cwd = process.cwd()) {
27
- return path.join(cwd, ".hardkas", "accounts.real.json");
26
+ function getDefaultRealAccountsPath(cwd) {
27
+ const root = cwd ?? process.cwd();
28
+ return path.join(root, ".hardkas", "accounts.real.json");
28
29
  }
29
30
  function createEmptyRealAccountStore() {
30
31
  return {
@@ -208,6 +209,9 @@ function listHardkasAccounts(config) {
208
209
  }
209
210
  const keystoreDir = path2.join(process.cwd(), ".hardkas", "keystore");
210
211
  if (fs2.existsSync(keystoreDir)) {
212
+ if (!config || !config.cwd) {
213
+ throw new Error("Workspace root/cwd is required for hermetic keystore path resolution");
214
+ }
211
215
  const files = fs2.readdirSync(keystoreDir);
212
216
  for (const file of files) {
213
217
  if (file.endsWith(".json")) {
@@ -393,7 +397,10 @@ var KaspaWasmPrivateKeySigner = class {
393
397
  if (!u.outpoint.transactionId || u.outpoint.index === void 0) {
394
398
  throw new Error(`UTXO is missing transactionId or index. Re-run tx plan.`);
395
399
  }
396
- const spk = u.scriptPublicKey || "mock-script";
400
+ const spk = u.scriptPublicKey;
401
+ if (!spk) {
402
+ throw new Error("UTXO is missing scriptPublicKey. Real signing flows must never fabricate cryptographic state.");
403
+ }
397
404
  return new sdk.UtxoEntry(
398
405
  BigInt(u.amountSompi),
399
406
  spk,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardkas/accounts",
3
- "version": "0.6.0-alpha",
3
+ "version": "0.7.0-alpha",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "hash-wasm": "^4.12.0",
20
- "@hardkas/artifacts": "0.6.0-alpha",
21
- "@hardkas/config": "0.6.0-alpha",
22
- "@hardkas/localnet": "0.6.0-alpha",
23
- "@hardkas/core": "0.6.0-alpha"
20
+ "@hardkas/artifacts": "0.7.0-alpha",
21
+ "@hardkas/localnet": "0.7.0-alpha",
22
+ "@hardkas/config": "0.7.0-alpha",
23
+ "@hardkas/core": "0.7.0-alpha"
24
24
  },
25
25
  "devDependencies": {
26
26
  "tsup": "^8.3.5",