export interface WalletConnectConfig { /** Registered app ID from dashboard */ appId: string; /** Filter to specific wallet(s). Omit to show all available */ walletId?: string | string[]; /** Override registry URL. Defaults to CDN-hosted registry.json */ registryUrl?: string; /** Theme */ theme?: 'light' | 'dark'; /** This DApp's own Telegram Mini App URL (t.me//). The wallet opens * it (openWebTelegram) after the user confirms/rejects the connection. */ siteTmaUrl?: string; } export interface WalletMeta { walletId: string; name: string; icon: string; botUsername: string; appName: string; apiUrl: string; description?: string; /** Company/brand shown in the "Powered by" footer (falls back to name). */ company?: string; /** Hex accent color for the connect modal (falls back to the default green). */ accent?: string; /** Flat white sheet with a black/white palette (the accent still colors highlights). */ mono?: boolean; order: number; } export interface WalletInfo { address: string; chain: string; } export interface ConnectSession { sessionToken: string; walletId: string; apiUrl: string; } export interface ConnectResult { wallet: WalletInfo | null; user: { username?: string; avatar?: string; }; session?: ConnectSession; } export interface InitSessionResponse { sessionToken: string; deeplink: string; expiresAt: string; } export interface SendTransactionParams { /** Base64-encoded BOC of the message to send */ msgBoc: string; /** Destination address */ toAddress: string; /** Amount to transfer (nano units) */ amount: string | number; /** Connected wallet address */ wallet_address: string; /** Target network */ network: string; /** Action label/type for the transaction */ action: string; /** Swap input amount to show in the wallet sign popup (display value) */ in_amount?: string; /** Swap output amount to show in the wallet sign popup (display value) */ out_amount?: string; /** Input token symbol (e.g. "$1", "USDT") shown in the wallet sign popup */ fromToken?: string; /** Output token symbol (e.g. "$1", "USDT") shown in the wallet sign popup */ toToken?: string; } export interface SendTransactionResult { txId: string; } export interface WaitForResultOptions { /** Poll interval in ms (default 2000) */ interval?: number; /** Max time to wait in ms before throwing 'Timeout' (default 120000) */ timeout?: number; } export interface TxStatusResult { status: string; msgHash?: string; action?: string; } export interface SessionStatusResponse { status: 'PENDING' | 'CONFIRMED' | 'REJECTED' | 'EXPIRED'; wallet?: WalletInfo | null; user?: { username?: string; avatar?: string; }; } export type WalletConnectEventType = 'connect' | 'disconnect' | 'error' | 'session_expired' | 'pending' | 'resolved'; export type WalletConnectEventCallback = (data?: any) => void;