import * as react_jsx_runtime from 'react/jsx-runtime'; import * as React$1 from 'react'; import { ReactNode, Component, ErrorInfo } from 'react'; import { WalletControllerFindAllResult, WalletControllerCreateResult, WalletControllerSubmitTransactionResult } from 'cilantro-sdk/wallet'; export { WalletControllerFindAllResult, WalletControllerFindOneResult, WalletControllerListSignersResult, WalletControllerSubmitTransactionResult } from 'cilantro-sdk/wallet'; import { createIndexedDBAdapter, SignerInfo } from 'cilantro-sdk/helpers'; export { createIndexedDBAdapter, createLocalStorageAdapter, createMemoryAdapter } from 'cilantro-sdk/helpers'; export { A as AuthGuard, a as AuthGuardClassNames, b as AuthGuardLayout, c as AuthGuardProps } from './AuthGuard-siMJeYPD.js'; import { PublicKey, Transaction, Connection } from '@solana/web3.js'; export { AuthControllerDiscordCallbackResult, AuthControllerLogin200Data, DiscordAuthorizeUrlResponse, DiscordCallbackAndSetAuthParams, GetDiscordAuthorizeUrlParams, SocialLoginDtoProvider, discordCallbackAndSetAuth, getDiscordAuthorizeUrl } from 'cilantro-sdk/auth'; export { TransactionControllerSendRawPasskeyTransactionResult } from 'cilantro-sdk/transactions'; type DeviceKeyStorage = ReturnType; /** Minimal user view; populated from SDK login result data.user when available. */ interface User { username?: string; email?: string; userType?: string; } /** SDK wallet list item type. */ type WalletDataDto$1 = WalletControllerFindAllResult["data"] extends readonly (infer E)[] ? E : WalletControllerFindAllResult["data"] extends (infer E)[] ? E : never; /** Wallet with backward-compat aliases (id, address, active). */ type WalletData = WalletDataDto$1 & { id?: string; address?: string; active?: boolean; }; interface SocialAuthConfig { /** Google OAuth client ID for built-in Google Sign-In. */ googleClientId?: string; /** Discord OAuth client ID (optional; for reference). */ discordClientId?: string; /** Client redirect URI for built-in "Sign in with Discord" (e.g. https://myapp.com/auth/callback). User lands here after Discord login; use setAuthFromFragment() on that page. */ discordRedirectUri?: string; } /** Params for loginWithSocial. Matches cilantro-sdk SocialLoginDto: Google/Apple use id_token, Discord uses access_token. */ type SocialLoginParams = { provider: "google"; id_token: string; } | { provider: "apple"; id_token: string; } | { provider: "discord"; access_token: string; }; interface CilantroConfig { apiKey?: string; baseURL: string; jwt?: string | null; socialAuth?: SocialAuthConfig; } interface CilantroContextValue { config: CilantroConfig; storage: DeviceKeyStorage | null; user: User | null; jwt: string | null; isAuthenticated: boolean; isLoading: boolean; login: (params: { usernameOrEmail: string; password: string; }) => Promise; /** Sign in with Google/Apple (id_token) or Discord (access_token). Matches cilantro-sdk SocialLoginDto. */ loginWithSocial: (params: SocialLoginParams) => Promise; logout: () => void; register: (username: string, email: string, password: string, isActive?: boolean) => Promise; clearSessionDueToAuthError: () => void; wallet: WalletData | null; wallets: WalletData[]; createWallet: (params: { name: string; userId?: string; }) => Promise; selectWallet: (walletId: string) => void; refreshWallets: () => Promise; walletError: string | null; walletsLoading: boolean; } interface CilantroContextProviderProps { children: ReactNode; apiKey?: string; baseURL?: string; storageAdapter?: DeviceKeyStorage | null; jwtStorageKey?: string; walletStorageKey?: string; /** When true, sync JWT to a cookie (same name as jwtStorageKey) for Next.js/middleware. Default: false. */ syncJwtToCookie?: boolean; /** Cookie name for JWT when syncJwtToCookie is true. Default: cilantro_jwt. */ jwtCookieName?: string; onLoginSuccess?: () => void; onLogout?: () => void; onRegisterSuccess?: () => void; onSessionExpired?: () => void; } declare function CilantroContextProvider({ children, apiKey, baseURL, storageAdapter, jwtStorageKey, walletStorageKey, syncJwtToCookie, jwtCookieName, onLoginSuccess, onLogout, onRegisterSuccess, onSessionExpired, }: CilantroContextProviderProps): react_jsx_runtime.JSX.Element; declare function useCilantroContext(): CilantroContextValue; interface CilantroProviderProps { children: ReactNode; /** Platform API key (guide: apiKey). Either apiKey or jwt via login is required for authenticated requests. */ apiKey?: string; /** API base URL (guide: baseURL). Default: https://api.cilantro.gg */ baseURL?: string; /** Storage for device keys - email/phone signers (guide: storageAdapter). Default: IndexedDB in browser. */ storageAdapter?: DeviceKeyStorage | null; /** @deprecated Use apiKey instead. */ platformApiKey?: string; /** @deprecated Use baseURL instead. */ apiUrl?: string; /** localStorage key for JWT (default: cilantro_jwt) */ jwtStorageKey?: string; /** localStorage key for selected wallet id (default: cilantro_selected_wallet_id) */ walletStorageKey?: string; /** When true, sync JWT to a cookie for Next.js/middleware. Default: false. */ syncJwtToCookie?: boolean; /** Cookie name for JWT when syncJwtToCookie is true. Default: cilantro_jwt. */ jwtCookieName?: string; onLoginSuccess?: () => void; onLogout?: () => void; onRegisterSuccess?: () => void; onSessionExpired?: () => void; } declare function CilantroProvider({ children, apiKey: apiKeyProp, baseURL, storageAdapter, platformApiKey, apiUrl, jwtStorageKey, walletStorageKey, syncJwtToCookie, jwtCookieName, onLoginSuccess, onLogout, onRegisterSuccess, onSessionExpired, }: CilantroProviderProps): react_jsx_runtime.JSX.Element; interface CilantroAuthContextType { user: User | null; /** JWT token. Alias for token. */ jwt: string | null; token: string | null; isAuthenticated: boolean; login: (usernameOrEmail: string, password: string) => Promise; loginWithSocial: (params: SocialLoginParams) => Promise; register: (username: string, email: string, password: string, isActive?: boolean) => Promise; logout: () => void; clearSessionDueToAuthError: () => void; isLoading: boolean; } declare function useCilantroAuth(): CilantroAuthContextType; interface WalletContextType { /** Selected wallet. Primary name. */ wallet: WalletData | null; /** @deprecated Use wallet instead. Alias for backward compat. */ selectedWallet: WalletData | null; wallets: WalletData[]; selectWallet: (walletId: string) => void; refreshWallets: () => Promise; isLoading: boolean; error: string | null; } declare function useWallets(): WalletContextType; type WalletDataDto = WalletData; interface UseCilantroConfigResult { config: CilantroConfig; storage: DeviceKeyStorage | null; } declare function useCilantroConfig(): UseCilantroConfigResult; interface UseAuthResult { /** Current user (from JWT payload or login response). */ user: User | null; /** JWT token. Prefer this name. */ jwt: string | null; /** Alias for jwt. Same value. */ token: string | null; isLoading: boolean; isAuthenticated: boolean; login: (params: { usernameOrEmail: string; password: string; }) => Promise; /** Sign in with Google/Apple (id_token) or Discord (access_token). Matches cilantro-sdk SocialLoginDto. */ loginWithSocial: (params: SocialLoginParams) => Promise; /** Register a new user and auto-login. */ register: (username: string, email: string, password: string, isActive?: boolean) => Promise; logout: () => void; /** Clear session when API returns 401/403. Call onSessionExpired. */ clearSessionDueToAuthError: () => void; } declare function useAuth(): UseAuthResult; interface UseReturnUrlOptions { /** Query param name for return URL. Default: "returnUrl" */ param?: string; /** Default path when no returnUrl in URL. Default: "/" */ defaultPath?: string; /** Only allow relative paths (no protocol). Default: true */ allowRelativeOnly?: boolean; } /** * Read returnUrl from URL search params and provide a safe redirect path. * Use with LoginForm/RegisterForm to redirect users back after auth. * * @example * // In LoginForm wrapper - redirect to returnUrl after login * const { returnPath, redirect } = useReturnUrl(); * redirect()} redirectAfterSuccess={returnPath} onRedirect={router.replace} /> */ declare function useReturnUrl(options?: UseReturnUrlOptions): { /** Safe path to redirect to (from URL or defaultPath) */ returnPath: string; /** Redirect to returnPath using window.location (or pass custom fn) */ redirect: (customRedirect?: (path: string) => void) => void; /** Raw value from URL (may be empty) */ rawReturnUrl: string | null; }; interface UseWalletResult { /** Selected wallet. Use this as primary. */ wallet: WalletData | null; wallets: WalletData[]; createWallet: (params: { name: string; userId?: string; }) => Promise; selectWallet: (walletId: string) => void; /** Refresh wallet list from API. */ refreshWallets: () => Promise; isLoading: boolean; /** Error from wallet operations (e.g. fetch failed). */ error: string | null; } declare function useWallet(_walletId?: string): UseWalletResult; /** * Normalized signer shape aligned with SDK SignerDataDto / WalletSignerDataDto. * Uses SDK field names (signerId, signerType, signerPubkey, authId); id is an alias for signerId or WalletSignerDataDto.id. */ interface SignerData extends Omit { id: string; signerId: string; signerType?: string; signerPubkey?: string; signerConfig?: { email?: string; phone?: string; credentialId?: string; }; deviceIdentities?: unknown[]; credentialId?: string; authId?: string; signerCategory?: "onchain" | "authenticationsigner"; [key: string]: unknown; } /** * Normalize a raw signer DTO to SignerData (id, signerId, signerPubkey/publicKey, etc.). * Use at API boundaries when ingesting signer data from the SDK. */ declare function normalizeSigner(signer: Record, category: "onchain" | "authenticationsigner"): SignerData; interface UseSignersOptions { /** Wallet ID to load signers for. If not provided, uses selectedWallet?.id from context (call useWallets() in same component). */ walletId?: string | null; } interface UseSignersResult { signers: SignerData[]; isLoading: boolean; error: string | null; refresh: () => Promise; createEmailSigner: (params: { email: string; }) => Promise; createPhoneSigner: (params: { phone: string; }) => Promise; revokeSigner: (signerId: string) => Promise; } declare function useSigners(walletIdOrOptions?: string | null | UseSignersOptions): UseSignersResult; interface UsePasskeyResult { isSupported: boolean; register: () => Promise<{ signerId: string; isNew: boolean; credentialId?: string; }>; authenticate: (signerId?: string) => Promise<{ signature: string; signerId: string; }>; isLoading: boolean; } declare function usePasskey(walletId: string | undefined): UsePasskeyResult; /** Minimal Solana wallet interface (Phantom, Solflare, etc.) */ interface SolanaWallet { name: string; publicKey: { toString: () => string; } | null; connect: () => Promise<{ publicKey: { toString: () => string; }; }>; disconnect: () => Promise; } declare global { interface Window { solana?: SolanaWallet & { isPhantom?: boolean; }; solflare?: SolanaWallet; } } interface UseExternalWalletResult { wallets: SolanaWallet[]; connectedWallet: SolanaWallet | null; connect: (wallet: SolanaWallet) => Promise; disconnect: () => Promise; } declare function useExternalWallet(): UseExternalWalletResult; type SignerType$2 = "email" | "phone" | "passkey" | "external"; interface SubmitTransactionResult { success: boolean; data: { signature?: string; [key: string]: unknown; }; } interface UseSendTransactionResult { sendSOL: (params: { recipientAddress: string; amountLamports: number; }) => Promise; sendSPL: (params: { mintAddress: string; recipientAddress: string; amount: number; }) => Promise; isPending: boolean; error: string | null; } declare function useSendTransaction(walletId: string | undefined, _signerId?: string, _signerType?: SignerType$2): UseSendTransactionResult; interface LoginFormClassNames { root?: string; header?: string; title?: string; description?: string; form?: string; label?: string; input?: string; submitButton?: string; error?: string; } interface LoginFormProps { className?: string; classNames?: LoginFormClassNames; style?: React.CSSProperties; onSuccess?: () => void; onError?: (error: Error) => void; /** Redirect to this path after successful login. If not set, reads from URL ?returnUrl= (when returnUrlParam provided). */ redirectAfterSuccess?: string; /** Custom redirect function for SPA routers. e.g. (path) => router.replace(path) */ onRedirect?: (path: string) => void; /** Query param to read returnUrl from URL. Default: "returnUrl". Used when redirectAfterSuccess not set. */ returnUrlParam?: string; rememberMe?: boolean; /** Override submit button label */ submitLabel?: string; /** Override title */ title?: string; /** Override description */ description?: string; /** Render "Create account" link (e.g. to switch to register). Shown below submit. */ renderSwitchToRegister?: () => React.ReactNode; /** Enable Google sign-in. Built-in flow is always available, or provide callback. */ onGoogleSignIn?: () => Promise; /** Show Google sign-in using built-in flow (always available). */ enableGoogleSignIn?: boolean; } declare function LoginForm({ className, classNames, style, onSuccess, onError, redirectAfterSuccess, onRedirect, returnUrlParam, submitLabel, title, description, renderSwitchToRegister, onGoogleSignIn, enableGoogleSignIn, }: LoginFormProps): react_jsx_runtime.JSX.Element; type SocialProvider = "google" | "apple" | "discord"; interface SocialLoginButtonsClassNames { root?: string; divider?: string; button?: string; googleButton?: string; appleButton?: string; discordButton?: string; error?: string; } interface SocialLoginButtonsProps { /** Called when user clicks Google. Return the id_token from Google Sign-In. */ onGoogleSignIn?: () => Promise; /** Called when user clicks Apple. Return the id_token from Apple Sign-In. */ onAppleSignIn?: () => Promise; /** Called when user clicks Discord. Return the OAuth access_token from Discord (required by SDK). */ onDiscordSignIn?: () => Promise; /** Called after successful social login (e.g. for redirect). */ onSuccess?: () => void; /** Show Google sign-in. Default: true */ showGoogle?: boolean; /** Show Apple sign-in. Default: false */ showApple?: boolean; /** Show Discord sign-in. Use built-in redirect (set discordRedirectUri in CilantroProvider socialAuth) or provide onDiscordSignIn. Default: false */ showDiscord?: boolean; className?: string; classNames?: SocialLoginButtonsClassNames; /** Optional divider between social and email/password form */ showDivider?: boolean; } /** * Social sign-in buttons (Google, Apple, Discord). Integrates with loginWithSocial. * Matches cilantro-sdk SocialLoginDto: Google/Apple use id_token, Discord uses access_token. */ declare function SocialLoginButtons({ onGoogleSignIn, onAppleSignIn, onDiscordSignIn, onSuccess, showGoogle, showApple, showDiscord, className, classNames, showDivider, }: SocialLoginButtonsProps): react_jsx_runtime.JSX.Element | null; interface RegisterFormClassNames { root?: string; header?: string; title?: string; description?: string; form?: string; label?: string; input?: string; submitButton?: string; error?: string; } interface RegisterFormProps { className?: string; classNames?: RegisterFormClassNames; style?: React.CSSProperties; onSuccess?: () => void; onError?: (error: Error) => void; /** Redirect to this path after successful registration. If not set, reads from URL ?returnUrl= */ redirectAfterSuccess?: string; /** Custom redirect function for SPA routers */ onRedirect?: (path: string) => void; /** Query param to read returnUrl from URL. Default: "returnUrl" */ returnUrlParam?: string; /** Override submit button label */ submitLabel?: string; /** Override title */ title?: string; /** Override description */ description?: string; /** Render "Already have an account?" link to switch to login */ renderSwitchToLogin?: () => React.ReactNode; } declare function RegisterForm({ className, classNames, style, onSuccess, onError, redirectAfterSuccess, onRedirect, returnUrlParam, submitLabel, title, description, renderSwitchToLogin, }: RegisterFormProps): react_jsx_runtime.JSX.Element; interface LogoutButtonProps { onLogout?: () => void; /** Redirect to this path after logout (e.g. "/login") */ redirectAfterLogout?: string; /** Custom redirect for SPA routers. e.g. (path) => router.replace(path) */ onRedirect?: (path: string) => void; confirmBeforeLogout?: boolean; className?: string; children?: ReactNode; } declare function LogoutButton({ onLogout, redirectAfterLogout, onRedirect, confirmBeforeLogout, className, children, }: LogoutButtonProps): react_jsx_runtime.JSX.Element; interface AuthShellClassNames { root?: string; inner?: string; logo?: string; } interface AuthShellProps { children: ReactNode; /** Optional logo/brand (e.g. or ) */ logo?: ReactNode; /** Max width of the auth card area. Default: "sm" (24rem) */ maxWidth?: "sm" | "md" | "lg"; className?: string; classNames?: AuthShellClassNames; } /** * Full-page centered layout for auth screens (login, register). * Provides a polished, accessible UX with consistent spacing and optional logo. * * @example * }> * * */ declare function AuthShell({ children, logo, maxWidth, className, classNames, }: AuthShellProps): react_jsx_runtime.JSX.Element; interface CreateEmailSignerFormProps { walletId: string; onCreated?: (signer: SignerInfo) => void; onError?: (error: Error) => void; className?: string; } declare function CreateEmailSignerForm({ walletId, onCreated, onError, className, }: CreateEmailSignerFormProps): react_jsx_runtime.JSX.Element; interface CreatePhoneSignerFormProps { walletId: string; onCreated?: (signer: SignerInfo) => void; onError?: (error: Error) => void; className?: string; } declare function CreatePhoneSignerForm({ walletId, onCreated, onError, className, }: CreatePhoneSignerFormProps): react_jsx_runtime.JSX.Element; interface AddPasskeyButtonProps { walletId: string; onRegistered?: (signer: SignerInfo) => void; onError?: (error: Error) => void; className?: string; children?: ReactNode; } declare function AddPasskeyButton({ walletId, onRegistered, onError, className, children, }: AddPasskeyButtonProps): react_jsx_runtime.JSX.Element | null; interface SignerListClassNames { root?: string; header?: string; list?: string; item?: string; addButton?: string; message?: string; skeleton?: string; loading?: string; } interface SignerListProps { walletId: string; onRevoke?: (signerId: string) => void; className?: string; classNames?: SignerListClassNames; onSignerAdded?: () => void; useSkeleton?: boolean; children?: (props: { signers: SignerData[]; isLoading: boolean; error: string | null; refresh: () => Promise; openAddSigner: () => void; }) => React.ReactNode; } declare function SignerList({ walletId, onRevoke, className, classNames, onSignerAdded, useSkeleton, children, }: SignerListProps): react_jsx_runtime.JSX.Element; declare function getSignerPublicKey(walletId: string, signer: SignerData, signerType: string, signerId: string): Promise; /** Result shape aligned with SDK SignMessageDataDto (signature base64, message) plus optional helper fields. */ interface SignMessageResult { /** Signature in base64 (SDK SignMessageDataDto shape). */ signature: string; /** Original message that was signed (SDK SignMessageDataDto shape). */ message: string; publicKey?: string; signerType: string; signer?: string; } declare function signMessageWithSigner(walletId: string, signer: SignerData, messageText: string): Promise; /** Connection-like interface for sign-and-send (passkey). Consumer provides from their Solana config. */ interface SignAndSendConnection { getLatestBlockhash: (commitment?: string) => Promise<{ blockhash: string; lastValidBlockHeight: number; }>; confirmTransaction: (opts: { signature: string; blockhash: string; lastValidBlockHeight: number; }) => Promise; } /** SDK submit transaction data (SubmitTransactionResponseDto.data). */ type SubmitTransactionDataDto = WalletControllerSubmitTransactionResult["data"]; declare function signTransactionWithSigner(walletId: string, signer: SignerData, transactionBuffer: Uint8Array): Promise<{ signature: string; signerType: string; }>; /** Result of sign-and-send; status is the SDK SubmitTransactionDataDto.status, confirmationStatus is the same for backward compat. */ interface SignAndSendResult { signature: string; status: string; confirmationStatus: string; } declare function signAndSendTransactionWithSigner(walletId: string, signer: SignerData, transaction: Transaction, connection?: SignAndSendConnection | null): Promise; declare function getWalletData(walletId: string): Promise<{ walletPublicKey: PublicKey; adminSignerPubkey: PublicKey; }>; declare const SIGNER_TYPES: { readonly EMAIL: "email"; readonly PHONE: "phone"; readonly PASSKEY: "passkey"; readonly EXTERNAL: "external"; readonly API_KEY: "apiKey"; }; type SignerType$1 = (typeof SIGNER_TYPES)[keyof typeof SIGNER_TYPES]; interface SignerSelectorClassNames { root?: string; list?: string; item?: string; message?: string; skeleton?: string; loading?: string; } /** Guide API: walletId + value + onChange(signerId, signerType) */ interface SignerSelectorProps { walletId: string; value?: string; onChange: (signerId: string, signerType: SignerType$1) => void; className?: string; classNames?: SignerSelectorClassNames; useSkeleton?: boolean; /** Legacy: when provided with availableSigners/selectedSigner/onSignerSelect, use legacy API */ selectedWalletId?: string; availableSigners?: SignerData[]; selectedSigner?: SignerData | null; isLoadingSigners?: boolean; onSignerSelect?: (signer: SignerData) => void; renderList?: (props: { signers: SignerData[]; selectedSigner: SignerData | null; onSelect: (signer: SignerData) => void; isLoading: boolean; getSignerDisplayName: (s: SignerData) => string; getSignerTypeLabel: (type: string) => string; getSignerUniqueId: (s: SignerData) => string; }) => React.ReactNode; children?: (props: { signers: SignerData[]; selectedSigner: SignerData | null; onSignerSelect: (signer: SignerData) => void; isLoading: boolean; }) => React.ReactNode; } declare function SignerSelector({ walletId, value, onChange, className, classNames, useSkeleton, selectedWalletId, availableSigners: availableSignersProp, selectedSigner: selectedSignerProp, isLoadingSigners: isLoadingSignersProp, onSignerSelect, renderList, children, }: SignerSelectorProps): react_jsx_runtime.JSX.Element | null; interface ConnectWalletButtonProps { onConnect?: (publicKey: string, wallet: SolanaWallet) => void; onDisconnect?: () => void; className?: string; children?: ReactNode; } declare function ConnectWalletButton({ onConnect, onDisconnect, className, children, }: ConnectWalletButtonProps): react_jsx_runtime.JSX.Element; interface CreateWalletFormProps { userId?: string; onCreated?: (wallet: WalletControllerCreateResult) => void; onError?: (error: Error) => void; className?: string; } declare function CreateWalletForm({ userId, onCreated, onError, className, }: CreateWalletFormProps): react_jsx_runtime.JSX.Element; interface WalletSelectorClassNames { root?: string; trigger?: string; content?: string; item?: string; skeleton?: string; loading?: string; } interface WalletSelectorProps { value?: string; onChange?: (walletId: string) => void; onWalletChange?: (walletId: string, wallet: WalletData | null) => void; className?: string; classNames?: WalletSelectorClassNames; useSkeleton?: boolean; placeholder?: string; renderTrigger?: (props: { selectedWallet: WalletData | null; wallets: WalletData[]; isLoading: boolean; open: boolean; setOpen: (open: boolean) => void; }) => React.ReactNode; renderList?: (props: { wallets: WalletData[]; selectedWallet: WalletData | null; onSelect: (wallet: WalletData) => void; isLoading: boolean; }) => React.ReactNode; children?: (props: { wallets: WalletData[]; selectedWallet: WalletData | null; selectWallet: (walletId: string) => void; isLoading: boolean; refreshWallets: () => Promise; }) => React.ReactNode; } declare function WalletSelector(props: WalletSelectorProps): react_jsx_runtime.JSX.Element; interface WalletAddressProps { address: string; short?: boolean; copyable?: boolean; className?: string; } declare function WalletAddress({ address, short, copyable, className, }: WalletAddressProps): react_jsx_runtime.JSX.Element; interface WalletBalanceProps { walletId: string; showTokens?: boolean; className?: string; } declare function WalletBalance({ walletId, showTokens, className, }: WalletBalanceProps): react_jsx_runtime.JSX.Element; type SignerType = "email" | "phone" | "passkey" | "external"; interface SendSOLFormProps { walletId: string; signerId?: string; signerType?: SignerType; onSuccess?: (result: SubmitTransactionResult) => void; onError?: (error: Error) => void; className?: string; } declare function SendSOLForm({ walletId, signerId, signerType, onSuccess, onError, className, }: SendSOLFormProps): react_jsx_runtime.JSX.Element; interface SendSPLFormProps { walletId: string; signerId?: string; signerType?: SignerType$2; mintAddress?: string; onSuccess?: (result: SubmitTransactionResult) => void; onError?: (error: Error) => void; className?: string; } declare function SendSPLForm({ walletId, signerId, signerType, mintAddress: initialMint, onSuccess, onError, className, }: SendSPLFormProps): react_jsx_runtime.JSX.Element; interface TransactionStatusProps { signature: string; cluster?: "mainnet-beta" | "devnet" | "testnet"; className?: string; } declare function TransactionStatus({ signature, cluster, className, }: TransactionStatusProps): react_jsx_runtime.JSX.Element; interface TransactionHistoryProps { walletId: string; pageSize?: number; className?: string; } declare function TransactionHistory({ walletId, pageSize, className, }: TransactionHistoryProps): react_jsx_runtime.JSX.Element; interface WalletInfo extends WalletData { } interface CilantroConnectProps { onConnect?: (wallet: WalletInfo, signers: SignerInfo[]) => void; onDisconnect?: () => void; className?: string; } declare function CilantroConnect({ onConnect, onDisconnect, className, }: CilantroConnectProps): react_jsx_runtime.JSX.Element; interface LoadingOverlayProps { isLoading: boolean; message?: string; children: ReactNode; className?: string; } declare function LoadingOverlay({ isLoading, message, children, className, }: LoadingOverlayProps): react_jsx_runtime.JSX.Element; interface ErrorBoundaryProps { fallback?: ReactNode; onRetry?: () => void; children: ReactNode; } interface State { hasError: boolean; error: Error | null; } declare class ErrorBoundary extends Component { state: State; static getDerivedStateFromError(error: Error): State; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; handleRetry: () => void; render(): string | number | bigint | boolean | Iterable | Promise> | Iterable | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined; } interface SkeletonProps extends React$1.HTMLAttributes { } declare const Skeleton: React$1.ForwardRefExoticComponent>; type Theme = "light" | "dark" | "system"; type ResolvedTheme = "light" | "dark"; interface ThemeProviderProps { /** Current theme: "light", "dark", or "system" (follows prefers-color-scheme). */ theme?: Theme; /** Default theme when theme is "system" or for initial render. */ defaultTheme?: ResolvedTheme; /** Optional localStorage key for persisting theme when using "system". */ storageKey?: string; /** Optional class for the wrapper div. */ className?: string; children: React$1.ReactNode; /** When true, inject the default theme CSS variables (light/dark). Your app must still use Tailwind. */ injectStyles?: boolean; } declare function ThemeProvider({ theme, defaultTheme, storageKey, className, children, injectStyles, }: ThemeProviderProps): react_jsx_runtime.JSX.Element; /** * Type Utilities - common types and utilities for SDK interactions */ type ActionState = { status: "idle" | "loading" | "success" | "error"; message?: string; detail?: T; }; interface ErrorResponse { message?: string; error?: string; code?: string | number; status?: number; statusText?: string; data?: unknown; stack?: string; type?: string; } type ApiResponse = T | { data: T; } | { success: boolean; data: T; }; declare function extractResponseData(response: unknown): T | null; /** * Normalization at the boundary: map SDK DTOs to a consistent shape with id/address (and aliases). * Use these when ingesting wallet/signer data from the SDK so consumers can rely on id and address. */ /** Normalized wallet shape: always has id and address. */ interface NormalizedWallet { id: string; address: string; active?: boolean; [key: string]: unknown; } /** * Normalize a wallet DTO so that id and address are always present. * Use at the boundary when loading wallets from the SDK. * Accepts any object with optional walletId/id, walletAddress/address, isActive. */ declare function normalizeWallet(dto: Record): NormalizedWallet; /** Wallet-like object with optional id/walletId and address/walletAddress. */ type WalletLike = { id?: string; walletId?: string; address?: string; walletAddress?: string; } & Record; /** * Get wallet ID from a wallet-like object. Prefer id; fallback to walletId. */ declare function getWalletId(wallet: WalletLike | null | undefined): string; /** * Get wallet address from a wallet-like object. Prefer address; fallback to walletAddress. */ declare function getWalletAddress(wallet: WalletLike | null | undefined): string; declare function extractErrorMessage(error: unknown): string; declare function isAuthError(error: unknown): boolean; /** * Check if a JWT is expired using the payload `exp` claim. * @param token - JWT string (assumes 3 segments separated by dots). * @param bufferSeconds - Optional buffer in seconds; if exp is within this many seconds of now, treat as expired (default 60). * @returns true if token is expired or invalid/not a JWT. */ declare function isJwtExpired(token: string, bufferSeconds?: number): boolean; /** * Adapter to use @solana/web3.js Connection for sign-and-send (advanced usage). * Pass the result as the connection prop so you don't need type assertions. */ /** Connection shape expected for sign-and-send (advanced usage). */ interface SignAndSendConnectionAdapter { sendRawTransaction: (buf: Buffer) => Promise; getLatestBlockhash: () => Promise<{ blockhash: string; lastValidBlockHeight: number; }>; confirmTransaction: (opts: { signature: string; blockhash: string; lastValidBlockHeight: number; }) => Promise; } /** * Wrap a @solana/web3.js Connection for sign-and-send (advanced usage). * Use when you have a Solana Connection and need the adapter shape without type assertions. * * @example * import { Connection } from '@solana/web3.js'; * import { adaptSolanaConnection } from 'cilantro-react'; * * const connection = new Connection(rpcUrl); * const adapter = adaptSolanaConnection(connection); */ declare function adaptSolanaConnection(connection: Connection): SignAndSendConnectionAdapter; export { type ActionState, AddPasskeyButton, type AddPasskeyButtonProps, type ApiResponse, AuthShell, type AuthShellClassNames, type AuthShellProps, type CilantroAuthContextType, type CilantroConfig, CilantroConnect, type CilantroConnectProps, CilantroContextProvider, type CilantroContextValue, CilantroProvider, type CilantroProviderProps, ConnectWalletButton, type ConnectWalletButtonProps, CreateEmailSignerForm, type CreateEmailSignerFormProps, CreatePhoneSignerForm, type CreatePhoneSignerFormProps, CreateWalletForm, type CreateWalletFormProps, type DeviceKeyStorage, ErrorBoundary, type ErrorBoundaryProps, type ErrorResponse, LoadingOverlay, type LoadingOverlayProps, LoginForm, type LoginFormClassNames, type LoginFormProps, LogoutButton, type LogoutButtonProps, type NormalizedWallet, RegisterForm, type RegisterFormClassNames, type RegisterFormProps, type ResolvedTheme, SIGNER_TYPES, SendSOLForm, type SendSOLFormProps, type SignerType as SendSOLSignerType, SendSPLForm, type SendSPLFormProps, type SignerType$2 as SendTransactionSignerType, type SignAndSendConnection, type SignAndSendConnectionAdapter, type SignAndSendResult, type SignMessageResult, type SignerData, SignerList, type SignerListClassNames, type SignerListProps, SignerSelector, type SignerSelectorClassNames, type SignerSelectorProps, type SignerType$1 as SignerType, Skeleton, type SocialAuthConfig, SocialLoginButtons, type SocialLoginButtonsClassNames, type SocialLoginButtonsProps, type SocialLoginParams, type SocialProvider, type SolanaWallet, type SubmitTransactionDataDto, type SubmitTransactionResult, type Theme, ThemeProvider, type ThemeProviderProps, TransactionHistory, type TransactionHistoryProps, TransactionStatus, type TransactionStatusProps, type UseAuthResult, type UseCilantroConfigResult, type UseExternalWalletResult, type UsePasskeyResult, type UseReturnUrlOptions, type UseSendTransactionResult, type UseSignersOptions, type UseSignersResult, type UseWalletResult, type User, WalletAddress, type WalletAddressProps, WalletBalance, type WalletBalanceProps, type WalletContextType, type WalletData, type WalletDataDto$1 as WalletDataDto, type WalletDataDto as WalletDataDtoFromHook, type WalletData as WalletDataFromHook, type WalletInfo, type WalletLike, WalletSelector, type WalletSelectorClassNames, type WalletSelectorProps, adaptSolanaConnection, extractErrorMessage, extractResponseData, getSignerPublicKey, getWalletAddress, getWalletData, getWalletId, isAuthError, isJwtExpired, normalizeSigner, normalizeWallet, signAndSendTransactionWithSigner, signMessageWithSigner, signTransactionWithSigner, useAuth, useCilantroAuth, useCilantroConfig, useCilantroContext, useExternalWallet, usePasskey, useReturnUrl, useSendTransaction, useSigners, useWallet, useWallets };