Skip to content

Commit d62535a

Browse files
committed
fix: use the correct decode function with testnet checks
1 parent 3b89bca commit d62535a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dashkeys.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,10 +1288,12 @@ var DashKeys = ("object" === typeof module && exports) || {};
12881288

12891289
/**
12901290
* @param {String} wif - Base58Check-encoded Private Key
1291+
* @param {DecodeOpts} [opts]
12911292
* @returns {Promise<Uint8Array>} - private key (no magic byte or checksum)
12921293
*/
12931294
_DashKeys.wifToPrivKey = async function (wif, opts) {
1294-
let wifParts = await dash58check.decode(wif, opts);
1295+
let wifParts = await _DashKeys.decode(wif, opts);
1296+
//@ts-ignore - wifParts does have privateKey
12951297
let privBytes = Utils.hexToBytes(wifParts.privateKey);
12961298

12971299
return privBytes;
@@ -1343,7 +1345,7 @@ if ("object" === typeof module) {
13431345

13441346
/**
13451347
* @typedef DecodeOpts
1346-
* @prop {Boolean} validate - throw if check fails, true by default
1348+
* @prop {Boolean} [validate] - throw if check fails, true by default
13471349
* @prop {Array<VERSION|Number>} [versions]
13481350
* @prop {VERSION|Number} [version]
13491351
*/

0 commit comments

Comments
 (0)