SpendScript Taproot output enhancement

This commit is contained in:
tripathyr 2023-08-08 18:33:47 +05:30 committed by GitHub
parent b7d102ec12
commit 5380758775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));