@node-dlc/bitcoin
Version:
42 lines (41 loc) • 1.06 kB
TypeScript
/// <reference types="node" />
import { StreamReader } from '@node-dlc/bufio';
import { ICloneable } from './ICloneable';
/**
* Represents segregated witness data. This data is nothing more than a
* buffer.
*/
export declare class Witness implements ICloneable<Witness> {
readonly data: Buffer;
/**
* Parses witness data
* @param reader
*/
static parse(reader: StreamReader): Witness;
/**
* Hex-encoded Witness data. This method interally creates a
* StreamReader and uses the parse function
* @param hex encoded as a string
*/
static fromHex(hex: string): Witness;
constructor(data: Buffer);
/**
* Serializes witness data into a buffer in the format:
*
* [varint] length
* [length] data
*/
serialize(): Buffer;
/**
* Returns the string of a piece of witness data
*/
toString(): string;
/**
* Returns the string of a piece of witness data
*/
toJSON(): string;
/**
* Clone via deep copy
*/
clone(): Witness;
}