import { Chain } from '../../../sdk/types'; import { BaseBlockHeader, BlockHeader } from './Api/BlockHeaderApi'; import { ChaintracksClientApi, ChaintracksInfoApi, HeaderListener, ReorgListener } from './Api/ChaintracksClientApi'; export interface GoChaintracksServiceClientOptions { /** * Path prefix for the go-chaintracks HTTP API. * Arcade exposes this at `/chaintracks/v2`. */ apiPrefix?: string; fetch?: typeof fetch; /** Timeout for HTTP requests and the initial SSE handshake. */ requestTimeoutMsecs?: number; /** Initial delay before reconnecting a closed or failed SSE stream. */ reconnectWaitMsecs?: number; /** Maximum SSE reconnect delay. */ reconnectWaitMaxMsecs?: number; /** Maximum decoded JSON response size. Default: 1 MiB. */ maxJsonResponseBytes?: number; /** Maximum binary header response size. Default: 32 MiB. */ maxBinaryResponseBytes?: number; /** Maximum size of one incomplete or complete SSE event. Default: 1 MiB. */ maxSseEventBytes?: number; /** Maximum number of deactivated headers accepted in one reorg event. Default: 4096. */ maxReorgHeaders?: number; /** Maximum delay between SSE chunks before reconnecting. Default: 45 seconds. */ streamIdleTimeoutMsecs?: number; } /** * Client for go-chaintracks compatible HTTP services, including Arcade's * `/chaintracks/v2` surface. Unlike the legacy ChaintracksServiceClient, this * can subscribe to tip/reorg SSE streams and therefore drive Monitor block * processing without a local WhatsOnChain polling ingestor. */ export declare class GoChaintracksServiceClient implements ChaintracksClientApi { chain: Chain; /** SSE client; reorg registration is a supported additive capability. */ readonly supportsReorgEvents = true; private static readonly MAX_CONFIGURED_BYTES; private static readonly MAX_SUBSCRIPTIONS; private readonly baseUrl; private readonly fetcher; private readonly requestTimeoutMsecs; private readonly reconnectWaitMsecs; private readonly reconnectWaitMaxMsecs; private readonly maxJsonResponseBytes; private readonly maxBinaryResponseBytes; private readonly maxSseEventBytes; private readonly maxReorgHeaders; private readonly streamIdleTimeoutMsecs; private readonly subscriptions; private nextSubscriptionId; constructor(chain: Chain, serviceUrl: string, options?: GoChaintracksServiceClientOptions); currentHeight(): Promise; isValidRootForHeight(root: string, height: number): Promise; getChain(): Promise; getInfo(): Promise; getPresentHeight(): Promise; getHeaders(height: number, count: number): Promise; findChainTipHeader(): Promise; findChainTipHash(): Promise; findHeaderForHeight(height: number): Promise; findHeaderForBlockHash(hash: string): Promise; addHeader(_header: BaseBlockHeader): Promise; startListening(): Promise; listening(): Promise; isListening(): Promise; isSynchronized(): Promise; subscribeHeaders(listener: HeaderListener): Promise; subscribeReorgs(listener: ReorgListener): Promise; unsubscribe(subscriptionId: string): Promise; private subscribe; private runSseWithReconnect; private waitForReconnect; private runSse; private processSseBuffer; private getJson; private getJsonOrUndefined; private getBinary; private consumeWithTimeout; private readBoundedBody; private readStreamChunk; private abortError; private assertSseSize; private validateHeight; private validateRemoteHeader; private isPlainRecord; private readRecord; private readExactRecord; private readPositiveOption; private validateListener; private parseServiceUrl; private url; private normalizeChain; } //# sourceMappingURL=GoChaintracksServiceClient.d.ts.map