@node-dlc/bitcoin
Version:
62 lines (61 loc) • 1.83 kB
TypeScript
/// <reference types="node" />
import { StreamReader } from '@node-dlc/bufio';
import { ICloneable } from './ICloneable';
import { TimeLockMode } from './TimeLockMode';
/**
* Specifies the absolute lock time for a transaction referred in the
* reference implementation as nLocktime. An absolute locktime is only
* active when its value is less than 0xffff_ffff and at least one
* transaction input has a non-0xffff_ffff nSequence.
*/
export declare class LockTime implements ICloneable<LockTime> {
/**
* Parses a locktime from a reader
* @param reader
*/
static parse(reader: StreamReader): LockTime;
/**
* Creates an nLockTime of zero which enforces finality for the
* transaction.
*/
static zero(): LockTime;
/**
* Gets or sets the value of the timelock. The value must be less than
* the maximum allowed value of 0xffff_ffff. When set to the max
* value, the locktime is disabled.
*/
get value(): number;
set value(val: number);
private _value;
/**
* Creates a new locktime instance
* @param value defaults to 0xffff_ffff
*/
constructor(value?: number);
/**
* True when a non-default is configured. This flag has no
* knowledge if the locktime is fully enabled with the requirement
* that at least one tx input has an nSequence value that non-default.
*/
get isEnabled(): boolean;
/**
* Gets the type of lock time: Block or Time based
*/
get type(): TimeLockMode;
/**
* Returns the string value
*/
toString(): string;
/**
* Returns the JSON serialized value
*/
toJSON(): number;
/**
* Serializes the locktime into a Buffer
*/
serialize(): Buffer;
/**
* Clone via deep copy
*/
clone(): LockTime;
}