REF: taproot wallet to TS

This commit is contained in:
abhishandy 2024-03-05 20:40:13 -05:00 committed by Overtorment
parent 4816ff3190
commit 8951ae81ea

View file

@ -12,7 +12,7 @@ export class TaprootWallet extends SegwitBech32Wallet {
* @param scriptPubKey * @param scriptPubKey
* @returns {boolean|string} Either bech32 address or false * @returns {boolean|string} Either bech32 address or false
*/ */
static scriptPubKeyToAddress(scriptPubKey) { static scriptPubKeyToAddress(scriptPubKey: string) {
try { try {
const publicKey = Buffer.from(scriptPubKey, 'hex'); const publicKey = Buffer.from(scriptPubKey, 'hex');
return bitcoin.address.fromOutputScript(publicKey, bitcoin.networks.bitcoin); return bitcoin.address.fromOutputScript(publicKey, bitcoin.networks.bitcoin);