Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testnet decode #28

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dashkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -1288,10 +1288,12 @@ var DashKeys = ("object" === typeof module && exports) || {};

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

return privBytes;
Expand Down Expand Up @@ -1343,7 +1345,7 @@ if ("object" === typeof module) {

/**
* @typedef DecodeOpts
* @prop {Boolean} validate - throw if check fails, true by default
* @prop {Boolean} [validate] - throw if check fails, true by default
* @prop {Array<VERSION|Number>} [versions]
* @prop {VERSION|Number} [version]
*/
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashkeys",
"version": "1.1.4",
"version": "1.1.5",
"description": "Generate, validate, create, and convert WIFs and PayAddress.",
"main": "dashkeys.js",
"browser": {
Expand Down
Loading