/** * @fileoverview LedgerEntrySerializer — deterministic binary serialization * for blockchain ledger entries. * * Binary format (hashable content): * sequenceNumber uint32 BE (4 bytes) * timestamp uint64 BE (8 bytes, ms since epoch) * hasPreviousHash uint8 (0x00 = null, 0x01 = present) * previousHash 0 | 64 (SHA3-512 bytes, present when flag = 0x01) * pubKeyLength uint32 BE (4 bytes) * signerPublicKey variable * payloadLength uint32 BE (4 bytes) * payload variable * * Full serialized entry: * magic 4 bytes 0x4C454447 ("LEDG") * version 2 bytes 0x0001 * hashableContent variable * entryHash 64 bytes SHA3-512 * signature 64 bytes SECP256k1 * * @see Design: Block Chain Ledger — LedgerEntrySerializer * @see Requirements 2.1–2.7, 9.1, 9.3 */ import { ILedgerEntry } from '../interfaces/ledger/ledgerEntry'; import { ChecksumService } from '../services/checksum.service'; import { Checksum } from '../types/checksum'; /** * Deterministic binary serializer / deserializer for ledger entries. * * All multi-byte integers use big-endian byte order. * Only Uint8Array is used — no Node.js Buffer dependency. */ export declare class LedgerEntrySerializer { private readonly checksumService; constructor(checksumService: ChecksumService); /** * Serialize the hashable portion of an entry (everything except entryHash * and signature). The output is the input to SHA3-512 for entryHash * computation. */ serializeForHashing(entry: Omit): Uint8Array; /** * Serialize a complete ledger entry including magic, version, hashable * content, entryHash, and signature. */ serialize(entry: ILedgerEntry): Uint8Array; /** * Deserialize a Uint8Array back into an ILedgerEntry. * * Validates magic bytes, version, minimum size, and field lengths. * Throws LedgerSerializationError on any invalid input. */ deserialize(data: Uint8Array): ILedgerEntry; /** * Compute the entryHash for a partial entry (without entryHash and * signature) by hashing the serializeForHashing() output with SHA3-512. */ computeEntryHash(entry: Omit): Checksum; /** * Ensure there are at least `needed` bytes remaining from `offset`. * Throws FieldOverflow if not. */ private ensureRemaining; } //# sourceMappingURL=ledgerEntrySerializer.d.ts.map