import { BatchResultEntry } from './batchAttribution'; export interface BatchPollByProviderOptions { /** Items to poll for this provider, e.g. `DepositToPoll[]`. */ items: TItem[]; /** Extract the canonical txid for each item. Helper lowercases it. */ getTxid: (item: TItem) => string; /** * Per-chunk RPC call. Receives lowercased txids; returns the batch * envelope. Caller wraps `rpcClient.batchGet*Status({ pegin_txids })`. */ batchCall: (txids: string[]) => Promise<{ results: ReadonlyArray>; }>; /** * Handle a per-item envelope. Exactly one of `result` / `error` is * populated (validator invariant). Caller decides UI state, logging, * etc. Not invoked for txids surfaced via {@link onDuplicate}. * * Note: `envelope.pegin_txid` is the lowercased txid the helper * sent in the request, not whatever case/encoding the server echoed. */ onItem: (item: TItem, envelope: BatchResultEntry) => void; /** Server omitted this item from the response. */ onMissing: (item: TItem) => void; /** Server returned this item more than once. Caller picks UI state. */ onDuplicate: (item: TItem) => void; /** * Optional aggregate signal for an entire chunk where the server * returned duplicates. Fires once per chunk (only if `count > 0`) * AFTER all per-item `onDuplicate` dispatches. Caller typically logs * the count alongside the provider name. */ onDuplicateBatch?: (count: number) => void; /** * The whole chunk's RPC call failed (transport or response * validation). Receives the chunk and the error. Caller decides how * to project that onto per-item state. */ onWholeBatchError: (chunk: TItem[], error: unknown) => void; /** * Server returned txids that were not in the request. Caller * typically logs the count for observability — there's no recovery * action since the original request items are unaffected. Optional; * defaults to no-op. */ onUnexpected?: (echoedTxids: string[]) => void; /** * Maximum items per RPC call. Defaults to {@link VP_BATCH_MAX_SIZE}. * Exposed for tests so chunking can be exercised without 50+ * fixtures. */ batchSize?: number; } export declare function batchPollByProvider(options: BatchPollByProviderOptions): Promise; //# sourceMappingURL=batchPoll.d.ts.map