@hardkas/accounts 0.12.0-rc.1 → 0.12.0-rc.10

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.
@@ -2,7 +2,8 @@ import {
2
2
  LazyAccountAuthorizer,
3
3
  PrivateKeyAuthorizer,
4
4
  StaticSignatureScriptAuthorizer
5
- } from "./chunk-YJL7P33W.js";
5
+ } from "./chunk-5WYALW6N.js";
6
+ import "./chunk-MCKGQKYU.js";
6
7
  export {
7
8
  LazyAccountAuthorizer,
8
9
  PrivateKeyAuthorizer,
@@ -231,15 +231,39 @@ function resolveHardkasAccount(options) {
231
231
  }
232
232
  function listHardkasAccounts(config) {
233
233
  const accounts = /* @__PURE__ */ new Map();
234
+ let targetMode = "localnet";
235
+ const execConfig = config?.execution;
236
+ if (execConfig) {
237
+ if (execConfig.mode) {
238
+ targetMode = execConfig.mode;
239
+ } else if (execConfig.default) {
240
+ const targetName = execConfig.default;
241
+ const target = execConfig.targets?.[targetName];
242
+ if (target?.mode) {
243
+ targetMode = target.mode;
244
+ } else if (targetName === "simulator") {
245
+ targetMode = "simulator";
246
+ }
247
+ }
248
+ }
234
249
  const detAccounts = createDeterministicAccounts();
235
250
  for (const det of detAccounts) {
236
- accounts.set(det.name, {
237
- name: det.name,
238
- kind: "synthetic",
239
- executionMode: "simulator",
240
- address: det.address,
241
- evmAddress: det.evmAddress
242
- });
251
+ if (targetMode === "simulator") {
252
+ accounts.set(det.name, {
253
+ name: det.name,
254
+ kind: "synthetic",
255
+ executionMode: "simulator",
256
+ address: det.address,
257
+ evmAddress: det.evmAddress
258
+ });
259
+ } else {
260
+ accounts.set(det.name, {
261
+ name: det.name,
262
+ kind: "kaspa",
263
+ network: "simnet",
264
+ address: det.address
265
+ });
266
+ }
243
267
  }
244
268
  const workspaceRoot = config?.cwd || process.cwd();
245
269
  const devAccountsDir = path2.join(workspaceRoot, ".hardkas", "dev-accounts");
@@ -63,7 +63,7 @@ var LazyAccountAuthorizer = class {
63
63
  accountName;
64
64
  workspaceRoot;
65
65
  async authorize(context) {
66
- const { resolveHardkasAccount } = await import("./resolve-GHZEED5L.js");
66
+ const { resolveHardkasAccount } = await import("./resolve-LNOAVBLS.js");
67
67
  const account = await resolveHardkasAccount({
68
68
  nameOrAddress: this.accountName,
69
69
  config: { cwd: this.workspaceRoot }
@@ -74,8 +74,8 @@ var LazyAccountAuthorizer = class {
74
74
  }
75
75
  if (!pkValue && account.keystorePath) {
76
76
  try {
77
- const { KeystoreManager } = await import("./keystore-CMWEKGBF.js");
78
- const { DEV_ACCOUNTS_PASSWORD } = await import("./dev-accounts-B6ZVTPCW.js");
77
+ const { KeystoreManager } = await import("./keystore-2KRHVGCM.js");
78
+ const { DEV_ACCOUNTS_PASSWORD } = await import("./dev-accounts-IIHQSSO2.js");
79
79
  const keystore = await KeystoreManager.loadEncryptedKeystore(account.keystorePath);
80
80
  const unlock = await KeystoreManager.decryptEncryptedKeystore(keystore, DEV_ACCOUNTS_PASSWORD);
81
81
  if (unlock.success && unlock.payload) {
@@ -0,0 +1,15 @@
1
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
+ }) : x)(function(x) {
5
+ if (typeof require !== "undefined") return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+ var __commonJS = (cb, mod) => function __require2() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+
12
+ export {
13
+ __require,
14
+ __commonJS
15
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-R5P3WIWR.js";
4
4
  import {
5
5
  resolveHardkasAccount
6
- } from "./chunk-TRVIQTIO.js";
6
+ } from "./chunk-23LEGEIY.js";
7
7
  import {
8
8
  loadKaspaWasm
9
9
  } from "./chunk-6DPO5V3N.js";
@@ -28,7 +28,7 @@ var KaspaWasmPrivateKeySigner = class {
28
28
  async signTxPlan(input) {
29
29
  const plan = input.planArtifact;
30
30
  const sdk = await loadKaspaWasm(this.options.wasmConfig);
31
- const { detectCapabilities } = await import("./signer-backend-W3LNCQA3.js");
31
+ const { detectCapabilities } = await import("./signer-backend-X3FD3XMB.js");
32
32
  const capabilities = detectCapabilities(sdk);
33
33
  if (plan.computeBudget !== void 0 || plan.outputs.some((o) => o.covenant)) {
34
34
  if (!capabilities.transactionV1Signing) {
@@ -55,8 +55,8 @@ var KaspaWasmPrivateKeySigner = class {
55
55
  }
56
56
  if (!pkValue && account.keystorePath) {
57
57
  try {
58
- const KeystoreManager2 = (await import("./keystore-CMWEKGBF.js")).KeystoreManager;
59
- const DEV_ACCOUNTS_PASSWORD2 = (await import("./dev-accounts-B6ZVTPCW.js")).DEV_ACCOUNTS_PASSWORD;
58
+ const KeystoreManager2 = (await import("./keystore-2KRHVGCM.js")).KeystoreManager;
59
+ const DEV_ACCOUNTS_PASSWORD2 = (await import("./dev-accounts-IIHQSSO2.js")).DEV_ACCOUNTS_PASSWORD;
60
60
  const keystore = await KeystoreManager2.loadEncryptedKeystore(account.keystorePath);
61
61
  const unlock = await KeystoreManager2.decryptEncryptedKeystore(keystore, DEV_ACCOUNTS_PASSWORD2);
62
62
  if (unlock.success && unlock.payload) {
@@ -76,7 +76,7 @@ var KaspaWasmPrivateKeySigner = class {
76
76
  throw err;
77
77
  }
78
78
  const expectedAddress = new sdk.PrivateKey(pkValue).toKeypair().toAddress(plan.networkId || "simnet").toString();
79
- const { PrivateKeyAuthorizer } = await import("./authorizers-OVWWAL5J.js");
79
+ const { PrivateKeyAuthorizer } = await import("./authorizers-NEWT33BI.js");
80
80
  const sourceInputs = plan.inputs || plan.selectedUtxos || [];
81
81
  for (let i = 0; i < numInputs; i++) {
82
82
  if (!authorizers[i]) {
@@ -341,7 +341,7 @@ async function getOrCreateDevAccount(workspaceDir, index, alias) {
341
341
  try {
342
342
  sdkModule = await import(
343
343
  /* @vite-ignore */
344
- "@kaspa/core-lib"
344
+ "./core-lib-2VZIZ7XT.js"
345
345
  );
346
346
  } catch (e) {
347
347
  console.warn(`