/**
 * Listen to real-time obligation changes via WebSocket.
 * Decodes + hydrates via {@link KaminoObligation.fromAccountData}.
 */
import { type Address, type Commitment, type Slot } from '@solana/kit';
import { type AccountSubscriptionManager, type ProgramFilter } from './accountSubscriptionManager';
import type { KaminoMarket } from '../classes/market';
import { KaminoObligation } from '../classes/obligation';
import type { SubscriptionHandle } from './subscriptionHandle';
import type { UpdateScheduler } from './wsUpdateScheduler';
export interface ObligationChangeEvent {
    obligation: KaminoObligation;
    address: Address;
    slot: Slot;
}
export type ObligationChangeCallback = (event: ObligationChangeEvent) => void;
export interface ObligationListenerParams {
    manager: AccountSubscriptionManager;
    /** Map (eager) or getter (lazy) for market lookup during hydration.
     *
     *  **Perf contract:** the getter form is invoked ONCE PER WS NOTIFICATION.
     *  Make it cheap — a constant-time read of an already-built map (e.g.
     *  `() => this.markets`) or a memoized value. Do NOT rebuild market
     *  state inside the getter; high-throughput obligation streams would
     *  pay that cost on every event. */
    markets: Map<Address, KaminoMarket> | (() => Map<Address, KaminoMarket>);
    owner: Address;
    onChange: ObligationChangeCallback;
    onError?: (error: unknown) => void;
    programId?: Address;
    commitment?: Commitment;
    /** Default: no throttle — obligations are low-frequency, user-action-driven. */
    throttleMs?: number;
    /** Requires `throttleMs`. */
    scheduler?: UpdateScheduler;
}
export declare function buildObligationFilters(owner: Address): ProgramFilter[];
export declare function listenToObligationChanges(params: ObligationListenerParams): SubscriptionHandle;
//# sourceMappingURL=obligationListener.d.ts.map