///
import { BigNumber } from "@mainsail/utils";
import { Mutable } from "../../utils.js";
import { Transaction, TransactionData, TransactionJson } from "./transactions.js";
export interface BlockVerification {
readonly verified: boolean;
readonly errors: string[];
readonly containsMultiSignatures: boolean;
}
export type BlockHeader = Exclude;
export interface Block {
readonly data: BlockData;
readonly header: BlockHeader;
readonly serialized: string;
readonly transactions: Transaction[];
}
export interface BlockData {
readonly id: string;
readonly timestamp: number;
readonly version: number;
readonly height: number;
readonly round: number;
readonly previousBlock: string;
readonly numberOfTransactions: number;
readonly totalAmount: BigNumber;
readonly totalFee: BigNumber;
readonly reward: BigNumber;
readonly payloadLength: number;
readonly payloadHash: string;
readonly generatorPublicKey: string;
readonly transactions: TransactionData[];
}
export interface BlockJson {
readonly id: string;
readonly timestamp: number;
readonly version: number;
readonly height: number;
readonly round: number;
readonly previousBlock: string;
readonly numberOfTransactions: number;
readonly totalAmount: string;
readonly totalFee: string;
readonly reward: string;
readonly payloadLength: number;
readonly payloadHash: string;
readonly generatorPublicKey: string;
readonly serialized?: string;
readonly transactions: TransactionJson[];
}
export type BlockDataSerializable = Omit;
export interface BlockFactory {
make(data: Mutable, transactions: Transaction[]): Promise;
fromHex(hex: string): Promise;
fromBytes(buff: Buffer): Promise;
fromJson(json: BlockJson): Promise;
fromData(data: BlockData): Promise;
}
export interface BlockSerializer {
headerSize(): number;
totalSize(block: BlockDataSerializable): number;
serializeHeader(block: BlockDataSerializable): Promise;
serializeWithTransactions(block: BlockDataSerializable): Promise;
}
export interface BlockWithTransactions {
data: BlockData;
transactions: Transaction[];
}
export interface BlockDeserializer {
deserializeHeader(serialized: Buffer): Promise;
deserializeWithTransactions(serialized: Buffer): Promise;
}
export interface BlockVerifier {
verify(block: Block): Promise;
}
//# sourceMappingURL=block.d.ts.map