export interface SDKConfig { apiKey: string; gameId: string; environment?: 'development' | 'staging' | 'production'; telemetry?: { enabled?: boolean; flushIntervalMs?: number; maxBatchSize?: number; }; remoteConfig?: { enabled?: boolean; pollIntervalMs?: number; }; } export interface PurchaseItem { _id?: string; type: string; name: string; description: string; price: number; imageUrl?: string; metadata?: Record; } export interface PurchaseCatalog { gameId: string; items: PurchaseItem[]; } export interface Transaction { gameId: string; purchaseId: string; providerTransactionId: string; amount: number; status: 'pending' | 'completed' | 'failed'; affiliateCode?: string; metadata?: Record; createdAt: Date; completedAt?: Date; } export interface PurchaseURLOptions { itemId: string; affiliateCode?: string; redirectUrl?: string; sessionToken: string; /** * If true, do not include the referrer affiliate code automatically */ suppressAffiliateCode?: boolean; } export interface LoginURLOptions { sessionToken: string; gameId: string; redirectUrl?: string; } export interface TipURLOptions { sessionToken: string; gameId: string; amount?: number; redirectUrl?: string; } export interface ApiResponse { success: boolean; data?: T; error?: string; } /** * Options for initializing the Storage API */ export interface StorageOptions { /** The game ID */ gameId: string; /** Optional namespace, defaults to 'default' */ namespace?: string; /** Maximum number of items to cache, defaults to 100 */ cacheSize?: number; /** Cache TTL in milliseconds, defaults to 5 minutes */ cacheTTL?: number; } /** * Storage API for key-value storage with versioning and subscriptions */ export interface StorageAPI { /** * Read a key; returns `null` if unset */ get(key: string, opts?: { namespace?: string; }): Promise<{ value: T | null; version: number; }>; /** * Write a key with optional optimistic version check */ set(key: string, value: T, opts?: { namespace?: string; version?: number; }): Promise<{ version: number; }>; /** * Remove a key (set to null) */ remove(key: string, opts?: { namespace?: string; }): Promise; /** * List all keys in the namespace */ list(opts?: { namespace?: string; }): Promise>; } /** * Options for creating an affiliate link */ export interface AffiliateLinkOptions { /** The game ID */ gameId: string; /** User session identifier */ sessionId: string; /** Deep-link to specific in-game item */ itemId?: string; /** URL to wrap with affiliate tracking */ targetUrl?: string; } /** * Returns a short affiliate URL like `https://oncad.es/AbCdE` */ export type CreateAffiliateLink = (opts: AffiliateLinkOptions) => string; /** * Options for submitting a leaderboard score */ export interface LeaderboardSubmitOptions { gameId: string; boardId: string; sessionId: string; score: number; filterCode?: string; } /** * Row in a leaderboard */ export interface LeaderboardRow { rank: number; sessionId: string; score: number; } /** * Options for fetching leaderboard rows */ export interface LeaderboardFetchOptions { gameId: string; boardId: string; filterCode?: string; limit?: number; offset?: number; } /** * Leaderboards API for submitting and fetching scores */ export interface LeaderboardsAPI { submit(opts: LeaderboardSubmitOptions): Promise; fetch(opts: LeaderboardFetchOptions): Promise; } /** * Wager session information returned by the server */ export interface WagerSession { sessionId: string; gameId: string; playerAId: string; playerBId?: string; tokenAddress: string; amountA: number; amountB?: number; withdrawTime: string; acceptedAt?: string; startedAt?: string; readyToResolve: boolean; playerAScore?: number; playerATimeUsed?: number; playerBScore?: number; playerBTimeUsed?: number; createdAt: string; updatedAt: string; } /** * Options for creating a new wager session */ export interface CreateWagerSessionOptions { /** Optional token contract address; defaults to server's default token */ tokenAddress?: string; } /** * Options for joining an existing wager session */ export interface JoinWagerSessionOptions { playerBId: string; amountB: number; } /** * Options for submitting a score in a wager session */ export interface SubmitScoreOptions { /** Score achieved by the current user in this session */ score: number; /** Time used by the current user in milliseconds */ timeUsed: number; } //# sourceMappingURL=index.d.ts.map