import type { MulticallRetryFunction } from '../../../../types';
import type { LstWithdrawalRegistryEntry } from '../registry';
import type { LstWithdrawalRequest } from '../types';
/** Composite withdrawal id for protocols where the natural unit is a
 *  `(validator, nonce)` pair (e.g. TruFin TruMATIC), in addition to
 *  the standard `bigint` id used by everything else. */
export type LstWithdrawalKnownId = bigint | {
    validator: string;
    nonce: bigint;
};
/** Per-LST list of caller-known withdrawal IDs, keyed by lowercased
 *  LST share-token address. Caller (frontend / worker-api) captures
 *  these from the withdraw tx receipt at request time and passes the
 *  accumulated list back on subsequent reads.
 *
 *  See `INDEXING_STRATEGIES.md` — "Caller-supplied IDs" section — for
 *  why this is the universal log-free fallback. */
export type LstWithdrawalKnownIds = {
    [lstAddress: string]: LstWithdrawalKnownId[];
};
/**
 * Reader interface for per-user withdrawal-request enumeration.
 *
 * Each reader is responsible for its protocol's enumeration sequence
 * (typically two stages: a `count` / `balanceOf` call to discover how
 * many pending requests exist, then a per-id detail call). Returns a
 * normalised `LstWithdrawalRequest[]` regardless of mechanism.
 *
 * Why a callable function instead of the data-driven `LstReader`
 * shape used elsewhere: withdrawal enumeration is **per-user** and
 * usually **multi-stage** (count depends on user; detail calls depend
 * on count). Inlining the sequencing in each reader is simpler than
 * stage-based pipelining at the orchestrator level.
 *
 * Tolerances: per-reader failures (RPC errors, malformed responses)
 * should NOT throw — return an empty array and log via the
 * orchestrator's debug channel. The vaults-endpoint user model
 * tolerates "we don't know your requests" but not "the entire
 * endpoint failed".
 *
 * `knownIds` is only used by `callerSupplied`-style readers (Mantle,
 * Puffer, TruFin). Readers with on-chain enumeration ignore it.
 */
export interface LstWithdrawalReader {
    fetch: (user: string, multicallRetry: MulticallRetryFunction, chainId: string, entry: LstWithdrawalRegistryEntry, knownIds?: LstWithdrawalKnownId[]) => Promise<LstWithdrawalRequest[]>;
}
/** Safely coerce a multicall return cell to bigint. Mirrors the
 *  pattern used in `vaults/lst/readers/shared.ts`. */
export declare const toBigInt: (v: unknown) => bigint | undefined;
/** Safely coerce to number. Used for counts / indices (uint sizes
 *  that fit in Number range). */
export declare const toNumber: (v: unknown) => number | undefined;
/** Builds the `status` field given `readyAt`/`expiresAt` and the
 *  current time. */
export declare const computeStatus: (readyAt: number, expiresAt?: number, nowSeconds?: number) => "pending" | "claimable" | "expired";
//# sourceMappingURL=shared.d.ts.map