@hardkas/accounts 0.12.0-rc.16 → 0.12.0-rc.17

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,7 @@ import {
2
2
  LazyAccountAuthorizer,
3
3
  PrivateKeyAuthorizer,
4
4
  StaticSignatureScriptAuthorizer
5
- } from "./chunk-EKQU22GY.js";
5
+ } from "./chunk-SKS7OJDP.js";
6
6
  export {
7
7
  LazyAccountAuthorizer,
8
8
  PrivateKeyAuthorizer,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-R5P3WIWR.js";
4
4
  import {
5
5
  resolveHardkasAccount
6
- } from "./chunk-AVTGARCA.js";
6
+ } from "./chunk-ZLLSFQAB.js";
7
7
  import {
8
8
  loadKaspaWasm
9
9
  } from "./chunk-6DPO5V3N.js";
@@ -56,7 +56,7 @@ var KaspaWasmPrivateKeySigner = class {
56
56
  if (!pkValue && account.keystorePath) {
57
57
  try {
58
58
  const KeystoreManager2 = (await import("./keystore-CMWEKGBF.js")).KeystoreManager;
59
- const DEV_ACCOUNTS_PASSWORD2 = (await import("./dev-accounts-K5TPW2TH.js")).DEV_ACCOUNTS_PASSWORD;
59
+ const DEV_ACCOUNTS_PASSWORD2 = (await import("./dev-accounts-VK4AUUW2.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-DDHM4SUH.js");
79
+ const { PrivateKeyAuthorizer } = await import("./authorizers-UXI2FDEL.js");
80
80
  const sourceInputs = plan.inputs || plan.selectedUtxos || [];
81
81
  for (let i = 0; i < numInputs; i++) {
82
82
  if (!authorizers[i]) {
@@ -63,7 +63,7 @@ var LazyAccountAuthorizer = class {
63
63
  accountName;
64
64
  workspaceRoot;
65
65
  async authorize(context) {
66
- const { resolveHardkasAccount } = await import("./resolve-5JBZXBNN.js");
66
+ const { resolveHardkasAccount } = await import("./resolve-ZSVFIV4Y.js");
67
67
  const account = await resolveHardkasAccount({
68
68
  nameOrAddress: this.accountName,
69
69
  config: { cwd: this.workspaceRoot }
@@ -75,7 +75,7 @@ var LazyAccountAuthorizer = class {
75
75
  if (!pkValue && account.keystorePath) {
76
76
  try {
77
77
  const { KeystoreManager } = await import("./keystore-CMWEKGBF.js");
78
- const { DEV_ACCOUNTS_PASSWORD } = await import("./dev-accounts-K5TPW2TH.js");
78
+ const { DEV_ACCOUNTS_PASSWORD } = await import("./dev-accounts-VK4AUUW2.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) {
@@ -219,7 +219,7 @@ function resolveHardkasAccount(options) {
219
219
  let alias = nameOrAddress;
220
220
  if (alias === "0") alias = "alice";
221
221
  if (alias === "1") alias = "bob";
222
- const accounts = listHardkasAccounts(config);
222
+ const accounts = listHardkasAccounts(config, options.executionTarget);
223
223
  const found = accounts.find((a) => a.name === alias);
224
224
  if (found) {
225
225
  return found;
@@ -245,24 +245,28 @@ function assertAccountCompatible(account, target) {
245
245
  });
246
246
  }
247
247
  }
248
- function listHardkasAccounts(config) {
248
+ function listHardkasAccounts(config, executionTarget) {
249
249
  const accounts = /* @__PURE__ */ new Map();
250
250
  let targetMode = "localnet";
251
- const execConfig = config?.execution;
252
- if (execConfig) {
253
- if (execConfig.mode) {
254
- targetMode = execConfig.mode;
255
- } else if (execConfig.default) {
256
- const targetName = execConfig.default;
257
- const target = execConfig.targets?.[targetName];
258
- if (target?.mode) {
259
- targetMode = target.mode;
260
- } else if (targetName === "simulator") {
261
- targetMode = "simulator";
251
+ if (executionTarget) {
252
+ targetMode = executionTarget.mode;
253
+ } else {
254
+ const execConfig = config?.execution;
255
+ if (execConfig) {
256
+ if (execConfig.mode) {
257
+ targetMode = execConfig.mode;
258
+ } else if (execConfig.default) {
259
+ const targetName = execConfig.default;
260
+ const target = execConfig.targets?.[targetName];
261
+ if (target?.mode) {
262
+ targetMode = target.mode;
263
+ } else if (targetName === "simulator") {
264
+ targetMode = "simulator";
265
+ }
262
266
  }
267
+ } else if (config?.defaultNetwork === "simulated") {
268
+ targetMode = "simulator";
263
269
  }
264
- } else if (config?.defaultNetwork === "simulated") {
265
- targetMode = "simulator";
266
270
  }
267
271
  const detAccounts = createDeterministicAccounts();
268
272
  for (const det of detAccounts) {
@@ -4,9 +4,9 @@ import {
4
4
  ensureDevAccounts,
5
5
  getOrCreateDevAccount,
6
6
  listDevAccountsSync
7
- } from "./chunk-SYYYAEO7.js";
7
+ } from "./chunk-JEDKKL3A.js";
8
8
  import "./chunk-R5P3WIWR.js";
9
- import "./chunk-AVTGARCA.js";
9
+ import "./chunk-ZLLSFQAB.js";
10
10
  import "./chunk-6DPO5V3N.js";
11
11
  import "./chunk-YLG2NIAU.js";
12
12
  export {
package/dist/index.d.ts CHANGED
@@ -151,10 +151,11 @@ declare class SimulatedSigner implements HardkasSigner {
151
151
  interface ResolveAccountOptions {
152
152
  nameOrAddress: string;
153
153
  config?: HardkasConfig | undefined;
154
+ executionTarget?: _hardkas_core.HardkasExecutionTarget | undefined;
154
155
  }
155
156
  declare function resolveHardkasAccount(options: ResolveAccountOptions): HardkasAccount;
156
157
  declare function assertAccountCompatible(account: HardkasAccount, target: _hardkas_core.HardkasExecutionTarget): void;
157
- declare function listHardkasAccounts(config?: HardkasConfig): HardkasAccount[];
158
+ declare function listHardkasAccounts(config?: HardkasConfig, executionTarget?: _hardkas_core.HardkasExecutionTarget): HardkasAccount[];
158
159
  declare function resolveHardkasAccountAddress(accountOrAddress: string, config?: HardkasConfig, context?: "L1" | "L2"): Promise<string>;
159
160
  declare function describeAccount(account: HardkasAccount): Record<string, unknown>;
160
161
 
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  ensureDevAccounts,
7
7
  getOrCreateDevAccount,
8
8
  listDevAccountsSync
9
- } from "./chunk-SYYYAEO7.js";
9
+ } from "./chunk-JEDKKL3A.js";
10
10
  import "./chunk-R5P3WIWR.js";
11
11
  import {
12
12
  assertAccountCompatible,
@@ -28,7 +28,7 @@ import {
28
28
  validateAccountName,
29
29
  validateAddressNetwork,
30
30
  validateAddressPrefix
31
- } from "./chunk-AVTGARCA.js";
31
+ } from "./chunk-ZLLSFQAB.js";
32
32
  import {
33
33
  detectCapabilities,
34
34
  getKaspaSigningBackendStatus,
@@ -41,7 +41,7 @@ import {
41
41
  LazyAccountAuthorizer,
42
42
  PrivateKeyAuthorizer,
43
43
  StaticSignatureScriptAuthorizer
44
- } from "./chunk-EKQU22GY.js";
44
+ } from "./chunk-SKS7OJDP.js";
45
45
 
46
46
  // src/simulated.ts
47
47
  var SimulatedSigner = class {
@@ -4,7 +4,7 @@ import {
4
4
  listHardkasAccounts,
5
5
  resolveHardkasAccount,
6
6
  resolveHardkasAccountAddress
7
- } from "./chunk-AVTGARCA.js";
7
+ } from "./chunk-ZLLSFQAB.js";
8
8
  export {
9
9
  assertAccountCompatible,
10
10
  describeAccount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardkas/accounts",
3
- "version": "0.12.0-rc.16",
3
+ "version": "0.12.0-rc.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "hash-wasm": "^4.12.0",
26
26
  "kaspa-wasm": "0.13.0",
27
- "@hardkas/artifacts": "0.12.0-rc.16",
28
- "@hardkas/config": "0.12.0-rc.16",
29
- "@hardkas/tx-builder": "0.12.0-rc.16",
30
- "@hardkas/core": "0.12.0-rc.16",
31
- "@hardkas/localnet": "0.12.0-rc.16"
27
+ "@hardkas/artifacts": "0.12.0-rc.17",
28
+ "@hardkas/localnet": "0.12.0-rc.17",
29
+ "@hardkas/core": "0.12.0-rc.17",
30
+ "@hardkas/config": "0.12.0-rc.17",
31
+ "@hardkas/tx-builder": "0.12.0-rc.17"
32
32
  },
33
33
  "devDependencies": {
34
34
  "tsup": "^8.3.5",