diff --git a/README.md b/README.md index 2f86f66..2c5ebbf 100644 --- a/README.md +++ b/README.md @@ -152,12 +152,13 @@ toPublicKey(privKeyBytes) ```js let keyUtils = { getPrivateKey: async function (txInput, i) { + let opts = { version: "mainnet" }; let pkhBytes = DashKeys.utils.hexToBytes(txInput.pubKeyHash); - let address = await DashKeys.pkhToAddr(txInput.pubKeyHash); + let address = await DashKeys.pkhToAddr(pkhBytes, opts); let yourKeyData = yourWalletKeyMapGoesHere[address]; - let privKeyBytes = DashKeys.wifToPrivKey(yourKeyData.wif); + let privKeyBytes = await DashKeys.wifToPrivKey(yourKeyData.wif, opts); return privKeyBytes; }, @@ -490,8 +491,8 @@ Tx.createLegacyTx(coins, outputs, changeOutput); * - `txDraft.change.address` MUST be set before signing the transaction * * BIP-69 Secure Sorting must be done AFTER setting each `address` - * - `Tx.sortInputs(txDraft.inputs)` - * - `Tx.sortOutputs(txDraft.outputs)` + * - `txDraft.inputs.sort(Tx.sortInputs)` + * - `txDraft.outputs.sort(Tx.sortOutputs)` */ let txDraft = tx.legacy.draftSingleOutput({ utxos, inputs, output }); diff --git a/package-lock.json b/package-lock.json index 6337532..6195fbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dashtx", - "version": "0.18.2", + "version": "0.18.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dashtx", - "version": "0.18.2", + "version": "0.18.3", "license": "SEE LICENSE IN LICENSE", "bin": { "dashtx-inspect": "bin/inspect.js" diff --git a/package.json b/package.json index 98668eb..fc0d134 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dashtx", - "version": "0.18.2", + "version": "0.18.3", "description": "Create DASH Transactions with Vanilla JS (0 deps, cross-platform)", "main": "dashtx.js", "module": "dashtx.mjs",