export type V3Order = 'asc' | 'desc'; export type V3PositionStatus = 'open' | 'closed' | 'redeemable' | 'redeemed' | 'all'; export type V3WalletPnlPeriod = '1d' | '7d' | '30d' | '1y' | 'all'; export type V3PnlEventGroup = 'hour' | 'day' | 'week' | 'month'; export interface V3PageParams { limit?: number; offset?: number; } export interface V3ListEnvelope { rows_returned: number; has_more: boolean; offset: number; limit: number; elapsed_ms: number; } export interface V3GenericListResponse extends V3ListEnvelope { data: T[]; } export interface V3TradesResponse extends V3ListEnvelope { trades: T[]; grouped_by?: string; address?: string; } export interface V3PositionsResponse extends V3ListEnvelope { positions: T[]; address?: string; } export interface V3LeaderboardResponse extends V3ListEnvelope { leaderboard: V3LeaderboardRow[]; } export interface V3BuildersResponse extends V3ListEnvelope { builders: V3Builder[]; } export interface V3TagsResponse extends V3ListEnvelope { tags: V3Tag[]; } export interface V3WalletBatchResponse extends V3ListEnvelope { wallets: V3WalletSummary[]; } export interface V3Stats { [key: string]: unknown; elapsed_ms?: number; } export interface V3WalletSummary { address: string; net_realized_pnl?: number; gross_profit?: number; gross_loss?: number; unrealized_pnl?: number; total_pnl?: number; wins?: number; losses?: number; position_count?: number; open_positions?: number; total_volume?: number; [key: string]: unknown; } export interface V3WalletPnl extends V3WalletSummary { period?: string; include_unrealized?: boolean; } export interface V3PnlEventBucket { bucket: number; realized_pnl: number; cumulative_pnl: number; gross_profit: number; gross_loss: number; wins: number; losses: number; events: number; } export interface V3WalletPnlEventsResponse { address: string; granularity: V3PnlEventGroup; after: number; before: number; total_realized_pnl: number; total_events: number; total_wins: number; total_losses: number; bucket_count: number; buckets: V3PnlEventBucket[]; source: string; elapsed_ms: number; partial?: boolean; } export interface V3Trade { id: string; maker: string; taker: string; maker_asset_id: string; taker_asset_id: string; maker_amount: number; taker_amount: number; fee: number; token_id?: string; asset?: string; amount?: number; amount_usd?: number; price: number; size: number; timestamp: string; transaction_hash: string; order_hash: string | null; builder: string | null; builder_code?: string | null; builder_name?: string | null; builder_logo?: string | null; builder_verified?: boolean | null; side: number | null; role: string | null; direction: string | null; market: string | null; slug: string | null; outcome: string | null; outcome_index: number | null; image: string | null; condition_id: string | null; [key: string]: unknown; } export interface V3GroupedOrderTrade { order_hash: string; fill_count: number; avg_price: number; total_amount_usd?: number; total_usd: number; total_shares: number; total_fee?: number; total_maker_amount?: number; total_taker_amount?: number; first_fill_at: number; last_fill_at: number; timestamp?: string; tx_hashes: string[]; market: string | null; slug: string | null; outcome: string | null; outcome_index?: number | null; image?: string | null; condition_id: string | null; direction?: string | null; role?: string | null; side?: number | null; maker?: string; taker?: string; [key: string]: unknown; } export interface V3Position { wallet?: string; token_id: string; size: number; avg_price: number; realized_pnl: number; unrealized_pnl?: number; total_pnl?: number; current_price?: number | null; total_bought: number; initial_value?: number; redeemable_payout?: number; resolved?: boolean; price_source?: string | null; status?: V3PositionStatus | string; market?: string | null; slug?: string | null; outcome?: string | null; outcome_index?: number | null; opposite_asset?: string | null; image?: string | null; condition_id?: string | null; event_slug?: string | null; neg_risk?: boolean | null; market_status?: string | null; tag_slugs?: string[] | null; last_trade_at?: string | number | null; resolved_at?: string | number | null; winning_outcome_index?: number | null; won?: boolean | null; [key: string]: unknown; } export interface V3MarketPosition { user: string; token_id?: string; amount: string; avg_price: string; realized_pnl: string; total_bought: string; [key: string]: unknown; } export interface V3MarketSearchRow { condition_id: string; question: string; slug: string; category: string | null; volume_all_time: string; active: boolean; closed: boolean; winning_outcome_index: number | null; tag_slugs: string[] | null; [key: string]: unknown; } export interface V3MarketMetadata { condition_id: string; question: string; slug: string; outcomes: string[]; token_ids: string[]; token_outcomes: string[]; active: boolean; closed: boolean; neg_risk: boolean; volume_all_time: string; liquidity: string; end_date: string | null; event_slug: string | null; event_title: string | null; category: string | null; tag_slugs: string[] | null; winning_outcome_index: number | null; [key: string]: unknown; } export interface V3Condition { id?: string; condition_id?: string; position_ids?: string[]; payout_numerators?: Array; payout_denominator?: string | number; question?: string | null; slug?: string | null; outcomes?: string[]; active?: boolean; closed?: boolean; neg_risk?: boolean; event_slug?: string | null; event_title?: string | null; category?: string | null; liquidity?: string; volume?: string; tags?: string[] | null; winning_outcome_index?: number | null; [key: string]: unknown; } export interface V3TokenInfo { token_id: string; price?: number | null; resolved?: boolean; source?: string | null; updated_at?: string | null; question?: string | null; slug?: string | null; condition_id?: string | null; outcome?: string | null; outcome_index?: number | null; category?: string | null; tag_slugs?: string[] | null; [key: string]: unknown; } export interface V3MarketPrice { token_id: string; price: number | null; resolved?: boolean; source?: string | null; updated_at?: string | null; elapsed_ms?: number; [key: string]: unknown; } export interface V3FeeEvent { id: string; timestamp: string; receiver?: string; amount: string; transaction_hash: string; [key: string]: unknown; } export interface V3ResolutionEvent { condition_id: string; payout_numerators: string[] | number[]; payout_denominator: string; resolved_at: string; created_at: string; question: string | null; slug: string | null; outcomes: string[] | null; category: string | null; [key: string]: unknown; } export interface V3WalletActivityEvent { event_type: 'split' | 'merge' | 'nrc' | 'redemption' | string; id: string; timestamp: string; ref_id: string; amount: string; extra?: string | null; [key: string]: unknown; } export interface V3LeaderboardRow { rank: number; wallet: string; net_realized_pnl: number; gross_profit: number; gross_loss: number; unrealized_pnl: number; total_pnl: number; wins: number; losses: number; position_count: number; open_positions: number; total_volume: number; [key: string]: unknown; } export interface V3Tag { tag: string; slug?: string; markets?: number; [key: string]: unknown; } export interface V3Builder { builder: string; builder_code?: string; builder_name?: string | null; builder_logo?: string | null; builder_verified?: boolean | null; fill_count?: number; first_fill?: string; last_fill?: string; rank?: number; total_fees?: string; total_maker_volume?: string; total_taker_volume?: string; unique_makers?: number; unique_takers?: number; [key: string]: unknown; } export interface V3BuilderTradesResponse extends V3TradesResponse { builder: string; builder_code?: string; builder_name?: string | null; builder_logo?: string | null; builder_verified?: boolean | null; } export interface V3PolymarketUsernameAvailableResponse { username: string; available: boolean; source: 'polymarket' | string; } export interface V3PolymarketUsernameChallengeRequest { address: string; username: string; action?: 'set_username'; } export interface V3PolymarketSiweFields { domain: string; address: string; statement: string; uri: string; version: string; chainId: number; nonce: string; issuedAt: string; expirationTime: string; } export interface V3PolymarketUsernameChallengeResponse { challenge_id: string; address: string; username: string; action: 'set_username' | string; expires_at: string; polymarket: { signature_type: 'personal_sign'; message: string; fields: V3PolymarketSiweFields; [key: string]: unknown; }; consent: { signature_type: 'typed_data_v4'; domain: Record; types: Record; primaryType: string; message: Record; [key: string]: unknown; }; derived: { deposit_wallet: string; safe_address: string; safe_deployed: boolean; [key: string]: unknown; }; } export interface V3PolymarketUsernameCompleteRequest { challenge_id: string; address: string; username: string; polymarket_signature: string; consent_signature: string; } export interface V3PolymarketUsernameCompleteResponse { status: 'success' | string; action: 'set_username' | string; username: string; address: string; deposit_wallet: string; safe_address: string; gamma_user_id: string | null; gamma_profile_id: string | null; created_profile: boolean; changed_username: boolean; profile_url: string; [key: string]: unknown; } export interface V3PolymarketProfile { address: string; proxy_wallet: string | null; username: string | null; pseudonym: string | null; display_username_public: boolean | null; profile_image: string | null; x_username: string | null; verified_badge: boolean | null; source: 'polymarket' | string; [key: string]: unknown; } export interface V3TradesParams extends V3PageParams { after?: number; before?: number; tokenId?: string; builder?: string; minAmount?: number; order?: V3Order; groupBy?: 'order_hash'; } export interface V3WalletTradesParams extends Omit { side?: 'maker' | 'taker' | 'both'; conditionId?: string; marketSlug?: string; sortBy?: 'order_hash'; groupBy?: 'user_trade' | 'transaction_hash' | 'order_hash'; } export interface V3BuilderTradesParams extends V3TradesParams { conditionId?: string; marketSlug?: string; eventSlug?: string; side?: 'buy' | 'sell'; category?: string; tagSlug?: string; } export interface V3PositionsParams extends V3PageParams { status?: V3PositionStatus; sort?: 'realized_pnl' | 'amount' | 'volume' | 'total_bought' | 'avg_price' | 'recent' | 'pnl' | 'size'; order?: V3Order; tokenId?: string; conditionId?: string; marketSlug?: string; minSize?: number; } export interface V3WalletPnlParams { period?: V3WalletPnlPeriod; after?: number; before?: number; includeUnrealized?: boolean; } export interface V3WalletPnlEventsParams extends V3PageParams { period?: Exclude; after?: number; before?: number; group?: V3PnlEventGroup; } export interface V3MarketSearchParams extends V3PageParams { query: string; } export interface V3MarketScopedParams extends V3PageParams { after?: number; before?: number; sort?: string; status?: string; } export interface V3LeaderboardParams extends V3PageParams { sort?: 'total' | 'realized' | 'profit' | 'volume' | 'wins'; tags?: string | string[]; } export interface V3TagsParams extends V3PageParams { q?: string; } export interface V3BuildersParams extends V3PageParams { sort?: 'fills' | 'volume' | 'fees' | 'makers' | 'takers'; } export interface V3WalletBatchBody { addresses: string[]; period?: V3WalletPnlPeriod; include_unrealized?: boolean; } //# sourceMappingURL=v3.d.ts.map