import { Contract, Provider } from 'ethers'; import { ContractPairInfo, PairInfo, PairsBackendReturn } from '../types'; /** * RPC module for caching and managing trading pair information */ export declare class PairsCache { private provider; private pairStorageContract; private pairsCache?; private pairNameToIndexMap?; constructor(provider: Provider, pairStorageContract: Contract); /** * Get all trading pairs from blockchain (with caching) * @param forceRefresh - Force refresh from blockchain * @returns Map of pair index to PairInfo */ getPairsInfo(forceRefresh?: boolean): Promise>; getPairBackend(index: number): Promise; getPairInfoNameFromIndex: (index: number) => Promise<{ from: string; to: string; }>; getOtherPairInfoFromIndex: (index: number) => Promise; /** * Get pair information from socket API * @returns Pair information from API */ getPairInfoFromSocket(): Promise; /** * Get pair index from pair name * @param pairName - Pair name (e.g., "BTC/USD") * @returns Pair index or undefined if not found */ getPairIndex(pairName: string): Promise; /** * Get pair name from index * @param pairIndex - Pair index * @returns Pair name or undefined if not found */ getPairName(pairIndex: number): Promise; /** * Get all unique group indexes * @returns Array of group indexes */ getGroupIndexes(): Promise; /** * Get all pairs in a specific group * @param groupIndex - Group index * @returns Array of pair indexes in the group */ getPairsInGroup(groupIndex: number): Promise; /** * Get pair info by index * @param pairIndex - Pair index * @returns PairInfo or undefined */ getPairByIndex(pairIndex: number): Promise; /** * Clear the cache */ clearCache(): void; }