@hardkas/accounts 0.11.2-alpha → 0.11.4-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.
@@ -0,0 +1,5 @@
1
+ declare function parseWasmTxToRpc(wasmTxStr: string, signedTx?: any, inputOverrides?: Record<number, {
2
+ signatureScript: string;
3
+ }>, plan?: any): any;
4
+
5
+ export { parseWasmTxToRpc };
@@ -0,0 +1,6 @@
1
+ import {
2
+ parseWasmTxToRpc
3
+ } from "../chunk-WRRHW2WO.js";
4
+ export {
5
+ parseWasmTxToRpc
6
+ };
@@ -0,0 +1,6 @@
1
+ import {
2
+ KeystoreManager
3
+ } from "./chunk-YLG2NIAU.js";
4
+ export {
5
+ KeystoreManager
6
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ describeAccount,
3
+ listHardkasAccounts,
4
+ resolveHardkasAccount,
5
+ resolveHardkasAccountAddress
6
+ } from "./chunk-ILASLDZU.js";
7
+ export {
8
+ describeAccount,
9
+ listHardkasAccounts,
10
+ resolveHardkasAccount,
11
+ resolveHardkasAccountAddress
12
+ };
@@ -2,7 +2,7 @@ import {
2
2
  detectCapabilities,
3
3
  getKaspaSigningBackendStatus,
4
4
  loadKaspaWasm
5
- } from "./chunk-7QKDZQBR.js";
5
+ } from "./chunk-6DPO5V3N.js";
6
6
  export {
7
7
  detectCapabilities,
8
8
  getKaspaSigningBackendStatus,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardkas/accounts",
3
- "version": "0.11.2-alpha",
3
+ "version": "0.11.4-alpha",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -9,6 +9,11 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "import": "./dist/index.js",
11
11
  "default": "./dist/index.js"
12
+ },
13
+ "./internal/wasm-rpc-serialization.js": {
14
+ "types": "./dist/internal/wasm-rpc-serialization.d.ts",
15
+ "import": "./dist/internal/wasm-rpc-serialization.js",
16
+ "default": "./dist/internal/wasm-rpc-serialization.js"
12
17
  }
13
18
  },
14
19
  "files": [
@@ -19,11 +24,11 @@
19
24
  "dependencies": {
20
25
  "hash-wasm": "^4.12.0",
21
26
  "kaspa-wasm": "0.13.0",
22
- "@hardkas/artifacts": "0.11.2-alpha",
23
- "@hardkas/config": "0.11.2-alpha",
24
- "@hardkas/core": "0.11.2-alpha",
25
- "@hardkas/tx-builder": "0.11.2-alpha",
26
- "@hardkas/localnet": "0.11.2-alpha"
27
+ "@hardkas/tx-builder": "0.11.4-alpha",
28
+ "@hardkas/artifacts": "0.11.4-alpha",
29
+ "@hardkas/config": "0.11.4-alpha",
30
+ "@hardkas/core": "0.11.4-alpha",
31
+ "@hardkas/localnet": "0.11.4-alpha"
27
32
  },
28
33
  "devDependencies": {
29
34
  "tsup": "^8.3.5",
@@ -41,9 +46,12 @@
41
46
  "url": "https://github.com/KasLabDevs/HardKas/issues"
42
47
  },
43
48
  "homepage": "https://github.com/KasLabDevs/HardKas/tree/main/packages/accounts#readme",
49
+ "publishConfig": {
50
+ "access": "public"
51
+ },
44
52
  "scripts": {
45
- "build": "tsup src/index.ts --format esm --dts --clean --external kaspa-wasm",
46
- "dev": "tsup src/index.ts --format esm --watch --dts --external kaspa-wasm",
53
+ "build": "tsup src/index.ts src/internal/wasm-rpc-serialization.ts --format esm --dts --clean --external kaspa-wasm",
54
+ "dev": "tsup src/index.ts src/internal/wasm-rpc-serialization.ts --format esm --watch --dts --external kaspa-wasm",
47
55
  "test": "vitest run",
48
56
  "typecheck": "tsc --noEmit"
49
57
  }
@@ -1,46 +0,0 @@
1
- // src/signer-backend.ts
2
- async function loadKaspaWasm() {
3
- try {
4
- return await import("kaspa-wasm");
5
- } catch (error) {
6
- const err = new Error(
7
- "SIGNER_BACKEND_UNAVAILABLE: Official Kaspa WASM backend is required to sign transactions.\nInstall it via: npm install kaspa-wasm"
8
- );
9
- err.code = "SIGNER_BACKEND_UNAVAILABLE";
10
- throw err;
11
- }
12
- }
13
- function detectCapabilities(sdk) {
14
- let v1 = false;
15
- if (sdk.createTransaction && sdk.createTransaction.length >= 8) {
16
- v1 = true;
17
- }
18
- if (sdk.createV1Transaction || sdk.Transaction && sdk.Transaction.prototype && sdk.Transaction.prototype.computeBudget) {
19
- v1 = true;
20
- }
21
- return { transactionV1Signing: v1 };
22
- }
23
- async function getKaspaSigningBackendStatus() {
24
- try {
25
- const sdk = await loadKaspaWasm();
26
- return {
27
- available: true,
28
- name: "Kaspa WASM SDK",
29
- version: sdk.version || "unknown",
30
- capabilities: detectCapabilities(sdk)
31
- };
32
- } catch (error) {
33
- return {
34
- available: false,
35
- name: "None",
36
- error: error instanceof Error ? error.message : String(error),
37
- capabilities: { transactionV1Signing: false }
38
- };
39
- }
40
- }
41
-
42
- export {
43
- loadKaspaWasm,
44
- detectCapabilities,
45
- getKaspaSigningBackendStatus
46
- };