/** @type {PubKeyHashToAddress} */
_DashKeys.pkhToAddr = async function (shaRipeBytes, opts) {
let pubKeyHash = Utils.bytesToHex(shaRipeBytes);
let version = opts?.version;
switch (version) {
case null:
/* fallsthrough */
case undefined:
break;
case "testnet":
version = DASH_PKH_TESTNET;
break;
default:
throw new Error('bad version');
}
/** @type {PrivateKeyToWif} */
_DashKeys.privKeyToWif = async function (privBytes, opts) {
let privateKey = Utils.bytesToHex(privBytes);
let version = opts?.version;
switch (version) {
case null:
/* fallsthrough */
case undefined:
break;
case "testnet":
version = DASH_PRIV_KEY_TESTNET;
break;
default:
throw new Error('bad version');
}
My small test case should:
Resources