From 83175c60a8e81d66386b26751503e660048a3885 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 14 Aug 2024 00:01:53 -0600 Subject: [PATCH 1/3] doc: fix getPrivateKey() example (missing async, typo of bytes) --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2f86f66..82c3a1b 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; }, From d492ce2e4ba36e0f72ccfc640016f6b06eeb0130 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 14 Aug 2024 01:21:00 -0600 Subject: [PATCH 2/3] doc: correct misuse of tx.inputs.sort(Tx.sortInputs) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 82c3a1b..2c5ebbf 100644 --- a/README.md +++ b/README.md @@ -491,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 }); From 190611881e7b9670c5dda3219f5f85527c4df593 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 14 Aug 2024 01:21:33 -0600 Subject: [PATCH 3/3] chore(release): bump to v0.18.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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",