/** * Pluggable storage interface for the trading module. * * Default: better-sqlite3 (Node). Falls back to in-memory if unavailable (Bun, Deno, edge). * Users can pass their own implementation via TraderConfig.storage. */ import type { StoredCredentials, MarketMeta, OrderHistoryRow, HistoryParams } from './types.js'; export interface TradingStorage { getCredentials(walletAddress: string): StoredCredentials | null; upsertCredentials(creds: StoredCredentials): void; deleteCredentials(walletAddress: string): void; getAllCredentials(): StoredCredentials[]; getMarketMeta(tokenId: string): MarketMeta | null; upsertMarketMeta(meta: MarketMeta): void; insertOrder(order: Omit): number; updateOrderStatus(id: number, status: string, orderId?: string, errorMsg?: string, responseJson?: string, feeData?: { feeAmountRaw?: string; escrowOrderId?: string; feeEscrowTxHash?: string; }): void; getOrderHistory(wallet: string, params?: HistoryParams): OrderHistoryRow[]; close(): void; } /** * In-memory storage backend. Works in any runtime (Bun, Deno, Node, edge). * No persistence — data is lost when the process exits. */ export declare class InMemoryStorage implements TradingStorage { private credentials; private meta; private orders; private nextId; getCredentials(walletAddress: string): StoredCredentials | null; upsertCredentials(creds: StoredCredentials): void; deleteCredentials(walletAddress: string): void; getAllCredentials(): StoredCredentials[]; getMarketMeta(tokenId: string): MarketMeta | null; upsertMarketMeta(meta: MarketMeta): void; insertOrder(order: Omit): number; updateOrderStatus(id: number, status: string, orderId?: string, errorMsg?: string, responseJson?: string, feeData?: { feeAmountRaw?: string; escrowOrderId?: string; feeEscrowTxHash?: string; }): void; getOrderHistory(wallet: string, params?: HistoryParams): OrderHistoryRow[]; close(): void; } //# sourceMappingURL=storage.d.ts.map