quantumcoin 7.0.5 → 7.0.6

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.
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "..": {
20
20
  "name": "quantumcoin",
21
- "version": "7.0.4",
21
+ "version": "7.0.6",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "quantum-coin-js-sdk": "1.0.31",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quantumcoin",
3
- "version": "7.0.5",
3
+ "version": "7.0.6",
4
4
  "description": "QuantumCoin SDK - a complete SDK for dapps",
5
5
  "main": "index.js",
6
6
  "types": "src/index.d.ts",
@@ -387,8 +387,19 @@ class Wallet extends BaseWallet {
387
387
  const pubBytes = typeof publicKey === "string" ? hexToBytes(publicKey) : arrayify(publicKey);
388
388
  assertArgument(privBytes.length > 0, "privateKey must not be empty", "privateKey", privateKey);
389
389
  assertArgument(pubBytes.length > 0, "publicKey must not be empty", "publicKey", publicKey);
390
- const key = new SigningKey(privBytes, pubBytes);
391
- return new Wallet(key, provider || null);
390
+
391
+ const privArr = _bytesToNumberArray(privBytes);
392
+ const pubArr = _bytesToNumberArray(pubBytes);
393
+ const addr = qcsdk.addressFromPublicKey(pubArr);
394
+ if (typeof addr !== "string") throw makeError("addressFromPublicKey failed", "UNKNOWN_ERROR", {});
395
+
396
+ const qcWallet = new qcsdk.Wallet(addr, privArr, pubArr);
397
+ const verified = qcsdk.verifyWallet(qcWallet);
398
+ if (verified !== true) {
399
+ throw makeError("verifyWallet failed: the provided key pair is invalid", "INVALID_ARGUMENT", { verified });
400
+ }
401
+
402
+ return Wallet._fromQcWallet(qcWallet, provider || null);
392
403
  }
393
404
 
394
405
  /**