2019-01-04 10:33:02 +01:00
|
|
|
import { Transaction } from './transaction';
|
|
|
|
export declare class Block {
|
2019-03-07 03:47:00 +01:00
|
|
|
static fromBuffer(buffer: Buffer): Block;
|
|
|
|
static fromHex(hex: string): Block;
|
|
|
|
static calculateTarget(bits: number): Buffer;
|
|
|
|
static calculateMerkleRoot(transactions: Transaction[], forWitness?: boolean): Buffer;
|
2019-01-04 10:33:02 +01:00
|
|
|
version: number;
|
|
|
|
prevHash?: Buffer;
|
|
|
|
merkleRoot?: Buffer;
|
|
|
|
timestamp: number;
|
|
|
|
witnessCommit?: Buffer;
|
|
|
|
bits: number;
|
|
|
|
nonce: number;
|
2019-03-07 03:47:00 +01:00
|
|
|
transactions?: Transaction[];
|
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-09-07 06:42:03 +02:00
|
|
|
byteLength(headersOnly?: boolean): number;
|
2019-01-04 10:33:02 +01:00
|
|
|
getHash(): Buffer;
|
|
|
|
getId(): string;
|
|
|
|
getUTCDate(): Date;
|
2019-09-07 06:42:03 +02:00
|
|
|
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
|
|
|
checkProofOfWork(): boolean;
|
2019-03-07 03:47:00 +01:00
|
|
|
private __checkMerkleRoot;
|
|
|
|
private __checkWitnessCommit;
|
2019-01-04 10:33:02 +01:00
|
|
|
}
|