UNPKG

charms-js

Version:

TypeScript SDK for decoding Bitcoin transactions containing Charms data

10 lines (9 loc) 447 B
/** * Extracts a Bitcoin address from an output script. * Supports all standard output types including P2PKH, P2SH, P2WPKH, P2WSH, and P2TR (Taproot). * * @param scriptBuf - The scriptPubKey as a Buffer * @param network - Target network ('mainnet' or 'testnet4') * @returns The decoded address string, or empty string if decoding fails */ export declare function extractAddress(scriptBuf: Buffer, network?: 'mainnet' | 'testnet4'): string;