type Web3Chain = 'ethereum' | 'solana' | 'polygon' | 'arbitrum' | 'base'; /** * Client-safe session metadata. Does NOT contain the JWT. * Use ServerSession (from @stacknet/userutils/server) for server-side code that needs the JWT. */ interface Session { id: string; app_identity_id: string; global_identity_commitment: string; expires_at: number; created_at: number; stack_id?: string; signed_by: string[]; user_id?: string; address?: string; chain?: Web3Chain; auth_method?: string; } /** Minimal public session info (safe for client-side, no JWT) */ interface PublicSession { userId: string; address?: string; chain?: Web3Chain; expiresAt: number; planId?: string; authMethod?: string; /** * The user's affiliate / invite code. Always present post-auth (issued * lazily on first session), so consumer apps can render a share link. * Format: 8-char base62 (excluding visually-ambiguous chars). */ joinCode?: string; } interface MPCNode { id: string; name: string; endpoint: string; status: 'online' | 'offline' | 'syncing'; public_key_share: string; last_heartbeat: number; load: number; version: string; } interface APIResponse { success: boolean; data?: T; error?: { code: string; message: string; }; } interface NetworkStatus { total_nodes: number; online_nodes: number; current_leader: string; consensus_health: string; last_block_time: number; network_version: string; } export type { APIResponse as A, MPCNode as M, NetworkStatus as N, PublicSession as P, Session as S, Web3Chain as W };