From 538075877501a4b11f90c0c52a1a855320eaa45a Mon Sep 17 00:00:00 2001 From: tripathyr Date: Tue, 8 Aug 2023 18:33:47 +0530 Subject: [PATCH] SpendScript Taproot output enhancement --- scripts/lib.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/lib.js b/scripts/lib.js index 7823282..042c730 100644 --- a/scripts/lib.js +++ b/scripts/lib.js @@ -7965,6 +7965,13 @@ r.spendToScript = function (address) { var addr = coinjs.addressDecode(address); var s = coinjs.script(); + + //Adding Taproot output writing + if (addr.type == "bech32m") { + s.writeBytes(Crypto.util.hexToBytes(addr.outstring)); + return s; + } + if (addr.type == "bech32" || addr.type == "multisigBech32") { s.writeOp(0); s.writeBytes(Crypto.util.hexToBytes(addr.redeemscript));