export type MarketStatus = 'Live' | 'New' | 'WaitingForResult' | 'UnderDispute' | 'UnderAppeal' | 'ClosingSoon' | 'InReview' | 'InEvaluation' | 'Closed' | 'Trading'; export type MarketSortBy = 'Liquidity' | 'Volumn' | 'latest'; export interface GetMarketsParams { limit?: number; offset?: number; sortBy?: MarketSortBy; status?: MarketStatus; creator?: string; apiUrl?: string; } export interface Market { id: string; title: string; totalVolume: string; status: MarketStatus; poolOwnerWalletAddress?: string; contractAddress?: string; } export interface MarketOption { choiceIndex: number; optionName: string; currentPrice: bigint; totalFunds: bigint; totalVotes: bigint; } export interface MarketDetails { id: string; title: string; status: MarketStatus; contractAddress: `0x${string}`; options: MarketOption[]; poolState: number; numberOfOptions: bigint; startTime: bigint; endTime: bigint; oracleEndTime: bigint; allFunds: bigint; allVotes: bigint; totalLiquidity: bigint; winner: bigint; poolFinalized: boolean; isPublic: boolean; baseToken: `0x${string}`; baseTokenDecimals: bigint; poolOwner: `0x${string}`; resolver: `0x${string}`; resolverIsAI: boolean; isDisputed: boolean; isAppealed: boolean; } export interface GetMarketDetailsParams { marketId: string; apiUrl: string; rpcUrl: string; } export interface OptionPrice { choiceIndex: number; optionName: string; currentPrice: bigint; } export type GetMarketPricesParams = GetMarketDetailsParams; export interface OptionVolume { choiceIndex: number; optionName: string; volume: bigint; } export interface MarketVolume { marketId: string; contractAddress: `0x${string}`; totalVolume: bigint; optionVolumes: OptionVolume[]; } export type GetMarketVolumeParams = GetMarketDetailsParams; export interface OptionLiquidity { choiceIndex: number; optionName: string; totalFunds: bigint; firstBuyOrderPrice: bigint; firstSellOrderPrice: bigint; } export interface MarketLiquidity { marketId: string; contractAddress: `0x${string}`; totalLiquidity: bigint; allFunds: bigint; optionLiquidity: OptionLiquidity[]; } export type GetMarketLiquidityParams = GetMarketDetailsParams; export interface GetMarketAddressParams { marketId: string; apiUrl: string; } export interface GetMarketIdParams { marketAddress: `0x${string}`; apiUrl: string; } export interface ProtocolStats { tvl: bigint; totalVolume: bigint; activeMarkets: number; totalMarkets: number; uniqueTraders: number; } export interface GetProtocolStatsParams { apiUrl: string; rpcUrl: string; subgraphUrl?: string; subgraphApiKey?: string; } export interface GetMarketByIdParams { marketId: string; apiUrl?: string; cache?: RequestCache; } export interface GetUserInvestmentsParams { walletAddress: string; accessToken: string; limit?: number; offset?: number; status?: MarketStatus; apiUrl?: string; } export interface UserInvestment { _id: string; poolId: string; walletAddress: string; investment: any[]; totalInvestment: string; pool: Record; [key: string]: any; }