/** * @fileoverview WorkUnitSerializer — JSON round-trip serialization for * IWorkUnit and IWorkResult payloads. * * Provides serialize/parse functions for transmitting work units and results * over HTTP as JSON strings. All required fields are validated on parse with * descriptive error messages indicating which field is invalid or missing. * * @see Design: Proof of Useful Work Rate Limiting — WorkUnitSerializer * @see Requirements 15.1–15.6 */ import { IWorkResult, IWorkUnit } from '../interfaces/pouw'; /** * Serialize an IWorkUnit to a JSON string. * * Since `inputData` is already base64-encoded (it's a string), this is a * straightforward JSON.stringify. The function exists as a named entry point * to pair with `parseWorkUnit` and to keep the serialization contract explicit. */ export declare function serializeWorkUnit(workUnit: IWorkUnit): string; /** * Parse a JSON string into an IWorkUnit, validating all required fields. * * @throws {TranslatableBrightChainError} with a descriptive message if the JSON is malformed or * any required field is missing or has the wrong type. */ export declare function parseWorkUnit(json: string): IWorkUnit; /** * Serialize an IWorkResult to a JSON string. */ export declare function serializeWorkResult(workResult: IWorkResult): string; /** * Parse a JSON string into an IWorkResult, validating all required fields. * * @throws {TranslatableBrightChainError} with a descriptive message if the JSON is malformed or * any required field is missing or has the wrong type. */ export declare function parseWorkResult(json: string): IWorkResult; //# sourceMappingURL=workUnitSerializer.d.ts.map