@btc-vision/transaction
Version:
OPNet transaction library allows you to create and sign transactions for the OPNet network.
30 lines (29 loc) • 1.29 kB
TypeScript
import { Network } from '@btc-vision/bitcoin';
export declare enum AddressTypes {
P2PKH = "P2PKH",
P2OP = "P2OP",
P2SH_OR_P2SH_P2WPKH = "P2SH_OR_P2SH-P2WPKH",
P2PK = "P2PK",
P2TR = "P2TR",
P2WPKH = "P2WPKH",
P2WSH = "P2WSH",
P2WDA = "P2WDA"
}
export interface ValidatedP2WDAAddress {
readonly isValid: boolean;
readonly isPotentiallyP2WDA: boolean;
readonly isDefinitelyP2WDA: boolean;
readonly publicKey?: Buffer;
readonly error?: string;
}
export declare class AddressVerificator {
static isValidP2TRAddress(inAddress: string, network: Network): boolean;
static isP2WPKHAddress(inAddress: string, network: Network): boolean;
static isP2WDAWitnessScript(witnessScript: Buffer): boolean;
static isP2PKHOrP2SH(addy: string, network: Network): boolean;
static isValidPublicKey(input: string, network: Network): boolean;
static requireRedeemScript(addy: string, network: Network): boolean;
static detectAddressType(addy: string, network: Network): AddressTypes | null;
static detectAddressTypeWithWitnessScript(addy: string, network: Network, witnessScript?: Buffer): AddressTypes | null;
static validateP2WDAAddress(address: string, network: Network, witnessScript?: Buffer): ValidatedP2WDAAddress;
}