import { HttpClient } from '@bsv/sdk'; import { ChaintracksDownloadOptions, ChaintracksFetchApi } from '../Api/ChaintracksFetchApi'; export interface ChaintracksFetchOptions { /** Number of retries after the initial request. Defaults to three. */ maxRetries?: number; /** Deadline covering connection, headers, and response body. */ timeoutMsecs?: number; /** Maximum materialized response size for binary and JSON requests. */ maxResponseBytes?: number; retryMsecs?: number; maxRetryMsecs?: number; /** Testable jitter source in the inclusive range 0..1. */ random?: () => number; /** Fetch implementation for operator-configured sources. */ fetch?: typeof fetch; /** Public-network fetch implementation; injectable for deterministic tests. */ publicNetworkFetch?: typeof fetch; } export declare class ChaintracksFetchError extends Error { readonly url: string; readonly status: number; readonly statusText: string; readonly retryAfterMsecs?: number | undefined; constructor(message: string, url: string, status: number, statusText: string, retryAfterMsecs?: number | undefined); get retryable(): boolean; } /** * Bounded fetch implementation shared by ChainTracks sources. * * Retry policy lives here so callers never multiply attempts. Every attempt * has a deadline that remains active while the response body is consumed, and * every materialized response has an explicit byte ceiling. */ export declare class ChaintracksFetch implements ChaintracksFetchApi { httpClient: HttpClient; private readonly maxRetries; private readonly timeoutMsecs; private readonly maxResponseBytes; private readonly retryMsecs; private readonly maxRetryMsecs; private readonly random; private readonly fetcher; private readonly publicNetworkFetch; constructor(options?: ChaintracksFetchOptions); download(url: string, maxResponseBytes?: number, options?: ChaintracksDownloadOptions): Promise; fetchJson(url: string): Promise; private requestBytes; private requestAttempt; private readResponseBytes; private readStreamChunk; private responseTooLarge; private retryWaitMsecs; pathJoin(baseUrl: string, subpath: string): string; } //# sourceMappingURL=ChaintracksFetch.d.ts.map