@hardkas/accounts 0.7.1-alpha → 0.7.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.
- package/dist/index.js +7 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -604,7 +604,7 @@ var KaspaSdkKeyGenerator = class {
|
|
|
604
604
|
return await rawLoader();
|
|
605
605
|
} catch (e) {
|
|
606
606
|
throw new Error(
|
|
607
|
-
"Kaspa
|
|
607
|
+
"Kaspa cryptography adapter missing. Real account generation requires WASM execution.\nRun: npm install @kaspa/wallet-wasm\nUse 'hardkas accounts real import' to add accounts manually for now."
|
|
608
608
|
);
|
|
609
609
|
}
|
|
610
610
|
};
|
|
@@ -919,15 +919,19 @@ async function getOrCreateDevAccount(workspaceDir, index, alias) {
|
|
|
919
919
|
}
|
|
920
920
|
const seedString = `${SIMNET_DETERMINISTIC_SEED}-${index}`;
|
|
921
921
|
const privateKeyHex = crypto2.createHash("sha256").update(seedString).digest("hex");
|
|
922
|
-
let
|
|
922
|
+
let sdkModule;
|
|
923
923
|
try {
|
|
924
|
-
|
|
924
|
+
sdkModule = await import(
|
|
925
|
+
/* @vite-ignore */
|
|
926
|
+
"@kaspa/core-lib"
|
|
927
|
+
);
|
|
925
928
|
} catch (e) {
|
|
926
929
|
console.warn(`
|
|
927
930
|
[Warning] Kaspa SDK (@kaspa/core-lib) is not installed in the workspace.
|
|
928
931
|
Could not generate dev account '${alias}'.`);
|
|
929
932
|
return { address: "", privateKey: "", publicKey: "" };
|
|
930
933
|
}
|
|
934
|
+
const sdk = sdkModule.default || sdkModule;
|
|
931
935
|
const privKey = new sdk.PrivateKey(privateKeyHex);
|
|
932
936
|
const pubKey = privKey.toPublicKey();
|
|
933
937
|
const address = pubKey.toAddress("simnet").toString();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hardkas/accounts",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3-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.7.
|
|
21
|
-
"@hardkas/
|
|
22
|
-
"@hardkas/
|
|
23
|
-
"@hardkas/
|
|
20
|
+
"@hardkas/artifacts": "0.7.3-alpha",
|
|
21
|
+
"@hardkas/core": "0.7.3-alpha",
|
|
22
|
+
"@hardkas/config": "0.7.3-alpha",
|
|
23
|
+
"@hardkas/localnet": "0.7.3-alpha"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"tsup": "^8.3.5",
|