/** * `waitForPending` — Promise that resolves when a tx hash is first * observed in any mempool. Rejects with `WaitForPendingTimeoutError` * if `timeoutBlocks` elapses without observation. * * Surfaces the "submitted but never arrived" failure mode explicitly: * when an RPC accepts a transaction but the tx never appears in any * observed mempool, this helper times out rather than hanging. * * Internally constructs a private ChainSource + TxTracker (or accepts * a `_sourceOverride` for tests) and tears them down before settling. */ import type { PublicClient } from 'viem'; import type { ChainSource } from '@valve-tech/chain-source'; import type { Hash, TxEventSeenInMempool } from './events.js'; export declare class WaitForPendingTimeoutError extends Error { readonly hash: Hash; readonly observedBlocks: number; constructor(hash: Hash, observedBlocks: number); } export interface WaitForPendingOptions { client: PublicClient; hash: Hash; /** * Reject with WaitForPendingTimeoutError if the hash isn't observed * in any mempool within this many block ticks. Default 12. */ timeoutBlocks?: number; /** * Tag emitted events with this chainId. Falls back to * `client.chain?.id`, then `0`. Consumers piping events from multiple * watchers into one stream should set this for unambiguous routing. */ chainId?: number; pollIntervalMs?: number; onError?: (method: string, err: unknown) => void; } /** * @internal * Test-injection seam — same shape as the other helpers' seams. * Not re-exported from index.ts. */ export interface WaitForPendingInternalOptions extends WaitForPendingOptions { _sourceOverride?: ChainSource; } export declare const waitForPending: (options: WaitForPendingOptions) => Promise; //# sourceMappingURL=wait-for-pending.d.ts.map