/**
 * @file Validator-DA boundary + transcript-blob encoding.
 * @module sdk/typescript/compute-channel/da
 *
 * The miner publishes the full per-turn transcript as one Ephemeral blob so a
 * challenger can fetch the contested leaf's preimage. On-chain only the
 * {@link DataRef} is stored. {@link DaSink}/{@link DaSource} are the wire
 * boundary the real `services/da-validator` (PR #45) implements; an in-memory
 * backend is provided for tests and the devnet e2e. Encoding matches the Rust
 * SDK's `TranscriptBlob` byte-for-byte.
 */
import { TranscriptLeafVersion, type Hash } from "./transcript.js";
/** Off-chain mirror of pallet_da_registry::RetentionClass. */
export declare enum RetentionClass {
    Ephemeral = "Ephemeral",
    Leased = "Leased"
}
/** v1 DA backend id (PROVIDER_SOVEREIGN_VALIDATORS). */
export declare const PROVIDER_SOVEREIGN_VALIDATORS = 0;
/** Runtime-mirrored session DA allocation limits; not a retention extension. */
export declare const MAX_SESSION_ACTIVATION_BYTES = 65536;
export declare const SESSION_TRANSCRIPT_HEADER_BYTES = 40;
export declare const SESSION_TRANSCRIPT_TURN_MAX_BYTES = 351;
/** Off-chain mirror of pallet_da_registry::DataRef. */
export interface DataRef {
    commitment: Hash;
    providerId: number;
    retention: RetentionClass;
}
/** One per-turn record persisted to DA (leaf preimage + enclave signature). */
export interface TurnRecord {
    leafVersion: TranscriptLeafVersion;
    turnIndex: number;
    hIn: Hash;
    hOut: Hash;
    gN: bigint;
    decodePolicyHash?: Hash;
    /** #871 V3 token-id commitment (`transcript::hIds`). Present ⇒ a V3-signed
     * turn; the blob upgrades to the V3 wire format so the challenger can
     * reconstruct the V3 leaf. */
    hIds?: Hash;
    /** #871 V3 per-turn TOPLOC activation-commitment hash. All-zero when the turn
     * was not TOPLOC-sampled (only meaningful alongside `hIds`). */
    toplocCommitmentHash?: Hash;
    minerRecvMs: bigint;
    minerDoneMs: bigint;
    latencyMs: bigint;
    enclaveSig: Uint8Array;
    agentAck?: TurnAckRecord;
}
export interface TurnAckRecord {
    agentSendMs: bigint;
    agentRecvMs: bigint;
    agentSig: Uint8Array;
}
/** The full session transcript blob published to validator DA. */
export declare class TranscriptBlob {
    readonly channelId: Hash;
    readonly turns: TurnRecord[];
    constructor(channelId: Hash, turns: TurnRecord[]);
    /** Deterministic canonical encoding (length-prefixed, little-endian). */
    encode(): Uint8Array;
    /** Parse the canonical encoding (used by a challenger after `fetch`). */
    static decode(bytes: Uint8Array): TranscriptBlob | null;
    /** Content commitment = blake2_256(encode()). */
    commitment(): Hash;
}
/** Publish side of validator DA (miner). */
export interface DaSink {
    publishEphemeral(bytes: Uint8Array): Promise<DataRef>;
}
/** Retrieval side (challenger / auditor). */
export interface DaSource {
    fetch(commitment: Hash): Promise<Uint8Array>;
}
/** In-memory DA backend for tests and the devnet e2e. */
export declare class InMemoryDa implements DaSink, DaSource {
    private store;
    /** Optional wall-clock for retention/prune tests (ms). */
    private publishedAt;
    private nowMs;
    constructor(nowMs?: () => number);
    publishEphemeral(bytes: Uint8Array): Promise<DataRef>;
    fetch(commitment: Hash): Promise<Uint8Array>;
    /** Drop blobs older than `retentionMs` (simulates challenge-window expiry). */
    pruneExpired(retentionMs: number): number;
    /** Force-drop one commitment (miner-local outage / unrecoverable tests). */
    drop(commitment: Hash): boolean;
    has(commitment: Hash): boolean;
}
/**
 * Legacy whole-blob HTTP transport for isolated devnet/test consumers. It does
 * not register blobs, establish assigned-provider custody, or prove retention;
 * production workers use registered SessionDa publication and RS retrieval.
 *
 * HTTP validator-DA transport (#751): publishes TOPLOC activation blobs to the
 * sovereign-validators DA endpoint so a challenger can fetch and re-prefill-check
 * the exact evidence. Mirrors the devnet `services/da-validator` wire shape
 * (`POST /shard/{commitment}/0` with `{ orig_len, shard_hex }`) and always tags
 * the ref Ephemeral — the retention TOPLOC activation evidence requires
 * (see `publishEphemeralWithRetry`). Retrieval accepts only complete index-zero
 * blobs matching the requested content commitment; erasure shards require a
 * separate reconstruction client.
 */
export declare class HttpValidatorDa implements DaSink, DaSource {
    private readonly baseUrl;
    constructor(baseUrl: string);
    publishEphemeral(bytes: Uint8Array): Promise<DataRef>;
    fetch(commitment: Hash): Promise<Uint8Array>;
}
//# sourceMappingURL=da.d.ts.map