import { ProductConfig } from './types.js'; /** * Byte-budget guards for dotNS text-record writes. * * This module ships a conservative default with a `BULLETIN_TEXT_BUDGET` env override so * publishers can probe larger payloads when the on-chain cap is raised. */ declare const DEFAULT_TEXT_RECORD_BUDGET_BYTES = 1024; /** * Fixed-length stand-in for a Bulletin CID in the pre-upload size preflight. * * The encoded length depends on the multihash code's varint width: * sha-256 (0x12, 1-byte varint) → CIDv1(raw, …) base32 = 59 chars * blake2b-256 (0xb220, 3-byte varint) → CIDv1(raw, …) base32 = 62 chars */ declare const PLACEHOLDER_CID = "bafk2bzacecjiwibwnfb6fl6rd26a5lrokoutx4lxut6pgw6mmtkqg4comxrae"; /** Resolved text-record byte budget, from `BULLETIN_TEXT_BUDGET` or the default. */ declare function getTextRecordBudgetBytes(): number; interface BudgetCheck { ok: boolean; key: string; bytes: number; budget: number; } /** Check a single serialised value against the budget, in UTF-8 bytes. */ declare function assertWithinBudget(key: string, serialized: string, budget: number): BudgetCheck; interface PessimisticSizeReport { ok: boolean; budget: number; checks: BudgetCheck[]; } /** * Pre-upload size check for every text record the publish flow will write. * * Composes each manifest with `PLACEHOLDER_CID` substituted for the real * Bulletin CIDs (which aren't known until Step 4 of the publish flow) and * verifies the serialised JSON fits within `budget`. Lets the publisher * abort cleanly before any chain writes when a config would otherwise * trip the dotNS wire-level cap. */ declare function pessimisticSizePreflight(config: ProductConfig, budget?: number): PessimisticSizeReport; export { type BudgetCheck, DEFAULT_TEXT_RECORD_BUDGET_BYTES, PLACEHOLDER_CID, type PessimisticSizeReport, assertWithinBudget, getTextRecordBudgetBytes, pessimisticSizePreflight };