import type { StorageBackend } from './storage.js'; import type { TradeRow, SettlementRow, BackfillStateRow, WatchlistSnapshotRow, QueryOptions, PositionSummary, CacheStats, EntityType } from './types.js'; import type { SettlementEvent } from '../types/events.js'; import type { LeaderboardMetric, LeaderboardQuery } from './views.js'; export declare class SqliteBackend implements StorageBackend { private db; private readonly dbPath; private _stmts; constructor(dbPath: string); open(): void; close(): void; private stmt; upsertSettlement(event: SettlementEvent): void; upsertTrade(trade: TradeRow): void; upsertTrades(trades: TradeRow[]): void; upsertPositions(wallet: string, positions: Record[]): void; upsertOnchainPositions(wallet: string, positions: Array<{ token_id: string; size: number; avg_price: number; realized_pnl: number; total_bought: number; }>): void; walletTrades(wallet: string, opts?: QueryOptions): TradeRow[]; walletPositions(wallet: string): PositionSummary[]; multiWalletPositions(wallets: string[]): Record; marketTrades(conditionId: string, opts?: QueryOptions): TradeRow[]; marketPositions(conditionId: string): PositionSummary[]; tokenTrades(tokenId: string, opts?: QueryOptions): TradeRow[]; walletSettlements(wallet: string, opts?: QueryOptions): SettlementRow[]; tradeByTxHash(txHash: string): TradeRow[]; getBackfillState(entityType: EntityType, entityId: string): BackfillStateRow | null; getPendingBackfills(): BackfillStateRow[]; resetStaleInProgress(): number; setBackfillState(state: BackfillStateRow): void; updateBackfillProgress(entityType: EntityType, entityId: string, offset: number, fetched: number): void; completeBackfill(entityType: EntityType, entityId: string): void; failBackfill(entityType: EntityType, entityId: string, error: string): void; getWatchlistSnapshot(): WatchlistSnapshotRow[]; setWatchlistSnapshot(entries: WatchlistSnapshotRow[]): void; prune(maxAgeSeconds: number): number; purgeEntity(type: EntityType, id: string): number; analyze(): void; stats(): CacheStats; watchlistSummaryRows(): Array<{ wallet: string; label: string; position_count: number; total_pnl: number; total_value: number; last_active: number | null; }>; walletDashboardData(wallet: string): { positions: PositionSummary[]; recent_trades: TradeRow[]; }; leaderboardRows(metric: LeaderboardMetric): Array<{ wallet: string; label: string; value: number; }>; marketOverviewData(conditionId: string): { market_title: string; positions: PositionSummary[]; total_volume: number; unique_wallets: number; }; composableLeaderboard(query: LeaderboardQuery): Array<{ wallet: string; label: string; metrics: Record; }>; walletTokenIds(wallet: string): string[]; walletTokenTrades(wallet: string, tokenId: string): TradeRow[]; private _queryWhere; } //# sourceMappingURL=sqlite-backend.d.ts.map