@cheny56/node-client 1.0.9 → 1.0.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.
- package/package.json +1 -1
- package/src/wallet.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cheny56/node-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Client library for Quorum blockchain with Post-Quantum Cryptography (PQC) and Zero-Knowledge Proof (ZK) support",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
package/src/wallet.js
CHANGED
|
@@ -68,9 +68,12 @@ class PQCWallet {
|
|
|
68
68
|
this.publicKey = publicKey instanceof Uint8Array ? publicKey : new Uint8Array(publicKey);
|
|
69
69
|
} else {
|
|
70
70
|
// Generate new key pair using dilithium-crystals
|
|
71
|
-
// dilithium-crystals
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
// dilithium-crystals uses keygen() which returns { publicKey, secretKey }
|
|
72
|
+
if (!dilithium.keygen) {
|
|
73
|
+
throw new Error('dilithium-crystals does not expose keygen method. Please check the package API.');
|
|
74
|
+
}
|
|
75
|
+
const keyPair = dilithium.keygen();
|
|
76
|
+
this.secretKey = keyPair.secretKey;
|
|
74
77
|
this.publicKey = keyPair.publicKey;
|
|
75
78
|
}
|
|
76
79
|
this.address = derivePQCAddress(this.publicKey);
|