import { Telemetry, TelemetryConfig } from '@bsv/sdk'; export type WABClientErrorCode = 'WAB_INVALID_CONFIGURATION' | 'WAB_INVALID_REQUEST' | 'WAB_NETWORK_ERROR' | 'WAB_TIMEOUT' | 'WAB_HTTP_ERROR' | 'WAB_ENDPOINT_MISMATCH' | 'WAB_REQUEST_TOO_LARGE' | 'WAB_RESPONSE_TOO_LARGE' | 'WAB_INVALID_RESPONSE'; export interface WABClientErrorOptions { cause?: unknown; correlationId?: string; operation?: string; route?: string; endpointMarkerPresent?: boolean; responseCorrelationMatched?: boolean; } /** * A privacy-safe WAB transport failure. Response bodies and request payloads * are deliberately excluded from the error. */ export declare class WABClientError extends Error { readonly code: WABClientErrorCode; readonly retryable: boolean; readonly status?: number | undefined; constructor(code: WABClientErrorCode, message: string, retryable: boolean, status?: number | undefined, options?: WABClientErrorOptions); readonly correlationId?: string; readonly operation?: string; readonly route?: string; readonly endpointMarkerPresent?: boolean; readonly responseCorrelationMatched?: boolean; } export interface WABTransportOptions { /** Injectable fetch implementation for React Native, tests, and custom runtimes. */ fetch?: typeof fetch; /** Hard wall-clock request timeout. Defaults to 10 seconds. */ timeoutMs?: number; /** Maximum encoded JSON request size. Defaults to 1 MiB. */ maxRequestBytes?: number; /** Maximum accepted JSON response size. Defaults to 1 MiB. */ maxResponseBytes?: number; /** Optional privacy-bounded telemetry integration. */ telemetry?: TelemetryConfig; } export interface WABRequestOptions { method?: 'GET' | 'POST'; body?: unknown; operation: string; correlationId?: string; } /** * Centralized, bounded transport used by every WAB client operation. * * Only fixed endpoint metadata is reported. Request bodies and response bodies * never cross the telemetry boundary. */ export declare class WABTransport { readonly serverUrl: string; readonly serverOrigin: string; readonly telemetry: Telemetry; private readonly fetcher; private readonly timeout; private readonly requestLimit; private readonly responseLimit; constructor(serverUrl: string, options?: WABTransportOptions); createCorrelationId(): string; request(path: string, options: WABRequestOptions): Promise; private bodyFor; private startTimer; private fetch; private checkResponse; private readText; private parse; private read; private readBuffer; private readStream; private sizeError; private stopBody; private stopReader; private report; } //# sourceMappingURL=WABTransport.d.ts.map