2019-01-04 10:33:02 +01:00
|
|
|
/// <reference types="node" />
|
|
|
|
import { Transaction } from './transaction';
|
|
|
|
export declare class Block {
|
|
|
|
version: number;
|
|
|
|
prevHash?: Buffer;
|
|
|
|
merkleRoot?: Buffer;
|
|
|
|
timestamp: number;
|
|
|
|
witnessCommit?: Buffer;
|
|
|
|
bits: number;
|
|
|
|
nonce: number;
|
|
|
|
transactions?: Array<Transaction>;
|
|
|
|
constructor();
|
|
|
|
static fromBuffer(buffer: Buffer): Block;
|
|
|
|
static fromHex(hex: string): Block;
|
|
|
|
static calculateTarget(bits: number): Buffer;
|
|
|
|
static calculateMerkleRoot(transactions: Array<Transaction>, forWitness?: boolean): Buffer;
|
2019-01-17 09:10:52 +01:00
|
|
|
getWitnessCommit(): Buffer | null;
|
2019-01-04 10:33:02 +01:00
|
|
|
hasWitnessCommit(): boolean;
|
2019-01-17 09:10:52 +01:00
|
|
|
hasWitness(): boolean;
|
2019-01-04 10:33:02 +01:00
|
|
|
byteLength(headersOnly: boolean): number;
|
|
|
|
getHash(): Buffer;
|
|
|
|
getId(): string;
|
|
|
|
getUTCDate(): Date;
|
|
|
|
toBuffer(headersOnly: boolean): Buffer;
|
|
|
|
toHex(headersOnly: boolean): string;
|
2019-01-17 09:01:15 +01:00
|
|
|
checkTxRoots(): boolean;
|
2019-01-04 10:33:02 +01:00
|
|
|
checkMerkleRoot(): boolean;
|
2019-01-17 09:01:15 +01:00
|
|
|
__checkMerkleRoot(): boolean;
|
|
|
|
__checkWitnessCommit(): boolean;
|
2019-01-04 10:33:02 +01:00
|
|
|
checkProofOfWork(): boolean;
|
|
|
|
}
|