import { Context, Effect, Layer, Stream, SubscriptionRef } from "effect"; import type { Address, Block, Hash, Hex, Log } from "viem"; import type { ClientNotFoundError } from "../core/index.js"; import { PublicClientService } from "../core/index.js"; import type { SubscriptionDroppedError, SubscriptionNotSupportedError } from "./errors.js"; export type SubscriptionRetryConfig = { readonly baseDelay?: number; readonly maxDelay?: number; readonly jitter?: boolean; }; export type SubscriptionConnectionState = { status: "connecting"; } | { status: "connected"; } | { status: "retrying"; error: SubscriptionDroppedError; }; export type RetryingSubscriptionStream = { readonly stateRef: SubscriptionRef.SubscriptionRef; readonly stream: Stream.Stream; }; export type SubscriptionServiceShape = { readonly watchBlocks: (params: { chainId: number; includeTransactions?: boolean; pollingInterval?: number; }) => Effect.Effect, ClientNotFoundError>; readonly watchLogs: (params: { chainId: number; address?: Address | Address[]; topics?: (Hex | Hex[] | null)[]; pollingInterval?: number; }) => Effect.Effect, ClientNotFoundError>; readonly watchPendingTransactions: (params: { chainId: number; pollingInterval?: number; }) => Effect.Effect, SubscriptionNotSupportedError | ClientNotFoundError>; readonly watchBlocksRetrying: (params: { chainId: number; includeTransactions?: boolean; pollingInterval?: number; retry?: SubscriptionRetryConfig; }) => Effect.Effect, ClientNotFoundError>; readonly watchLogsRetrying: (params: { chainId: number; address?: Address | Address[]; topics?: (Hex | Hex[] | null)[]; pollingInterval?: number; retry?: SubscriptionRetryConfig; }) => Effect.Effect, ClientNotFoundError>; readonly watchPendingTransactionsRetrying: (params: { chainId: number; pollingInterval?: number; retry?: SubscriptionRetryConfig; }) => Effect.Effect, SubscriptionNotSupportedError | ClientNotFoundError>; readonly hasWebSocket: (chainId: number) => Effect.Effect; }; declare const SubscriptionService_base: Context.TagClass; export declare class SubscriptionService extends SubscriptionService_base { } export declare const SubscriptionServiceLive: Layer.Layer; export {}; //# sourceMappingURL=service.d.ts.map