import { G as GeolocationClient, H as UseGeolocationOptions, I as UseGeolocationResult, $ as UseLocationRequestsOptions, a0 as UseLocationRequestsResult, a1 as UseLocationCaptureOptions, a2 as UseLocationCaptureResult, b as CipherTextOptions, c as CipherTextResult, D as DeviceFingerprintRequest } from './client-C_A7QLcB.js'; import { ComplianceClient, RegistrationVerificationResponse, RegistrationVerificationRequest, LoginVerificationResponse, LoginVerificationRequest, TransactionVerificationResponse, TransactionVerificationRequest } from './compliance/index.js'; import { RiskProfileClient } from './risk-profile/index.js'; import { C as CustomerProfile } from './types-X5Md_dD_.js'; import { KycClient, UseKycSubmissionOptions, UseKycSubmissionResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, CheckKycStatusResponse } from './kyc/index.js'; import './client-ePzhQKp9.js'; import './types-B4Ezqo7V.js'; /** * Detect browser information from user agent. * Returns safe defaults when running server-side. */ declare function getBrowserInfo(): { browser: string; browser_version: string; os: string; os_version: string; }; /** * React Hooks for Vesant Geolocation SDK * * Provides convenient React hooks for using the geolocation service in Next.js applications. */ /** * React hook for IP verification and compliance checking * * @param client - GeolocationClient instance * @param options - Hook options * @returns Geolocation verification state and methods * * @example * ```tsx * function LoginPage() { * const { verification, loading, error, verifyIP } = useGeolocation(client, { * autoVerify: true, * eventType: "login", * includeDeviceFingerprint: true * }); * * useEffect(() => { * if (verification?.is_blocked) { * alert("Access blocked: " + verification.risk_reasons.join(", ")); * } * }, [verification]); * * return
Risk Level: {verification?.risk_level}
; * } * ``` */ declare function useGeolocation(client: GeolocationClient, options?: UseGeolocationOptions): UseGeolocationResult; /** * Create a complete device fingerprint for the current browser. * Returns safe defaults when running server-side. */ declare function createDeviceFingerprint(): DeviceFingerprintRequest; /** * React hook for generating cipherText * * @example * ```tsx * function LoginForm() { * const { generate, configLoading, configError } = useCipherText(geoClient); * * const handleLogin = async () => { * const result = await generate({ reason: 'login' }); * if (result) { * await loginMutation({ email, password, cipherText: result.cipherText }); * } * }; * } * ``` */ declare function useCipherText(client?: GeolocationClient): { generate: (options: CipherTextOptions) => Promise; configLoading: boolean; configError: Error | null; }; /** * React hook for managing location requests (admin/compliance officer) * * @param client - GeolocationClient instance * @param options - Hook options * @returns Location request state and management methods */ declare function useLocationRequests(client: GeolocationClient, options?: UseLocationRequestsOptions): UseLocationRequestsResult; /** * React hook for location capture (customer-facing) * * Use this hook in the customer's browser to capture and submit their location. * The token is obtained from the share link sent via SMS/email. * * @param client - GeolocationClient instance * @param options - Hook options with token * @returns Location capture state and methods */ declare function useLocationCapture(client: GeolocationClient, options: UseLocationCaptureOptions): UseLocationCaptureResult; /** * React hooks for compliance verification workflows */ interface UseRegistrationOptions { onSuccess?: (result: RegistrationVerificationResponse) => void; onBlocked?: (result: RegistrationVerificationResponse) => void; onError?: (error: Error) => void; } interface UseRegistrationResult { verification: RegistrationVerificationResponse | null; loading: boolean; error: Error | null; verifyRegistration: (request: RegistrationVerificationRequest) => Promise; } /** * Hook for registration verification workflow * * @param client - ComplianceClient instance * @param options - Hook options with callbacks * * @example * ```typescript * const { verifyRegistration, loading, error } = useRegistration(sdk, { * onSuccess: (result) => { * console.log('Registration approved!', result.profile); * navigate('/dashboard'); * }, * onBlocked: (result) => { * alert(`Registration blocked: ${result.blockReasons.join(', ')}`); * } * }); * * const handleSubmit = async (formData) => { * await verifyRegistration({ * customerId: formData.customerId, * fullName: formData.fullName, * emailAddress: formData.email, * ipAddress: await getClientIP(), * deviceFingerprint: getDeviceFingerprint() * }); * }; * ``` */ declare function useRegistration(client: ComplianceClient, options?: UseRegistrationOptions): UseRegistrationResult; interface UseLoginVerificationOptions { onSuccess?: (result: LoginVerificationResponse) => void; onBlocked?: (result: LoginVerificationResponse) => void; onStepUpRequired?: (result: LoginVerificationResponse) => void; onError?: (error: Error) => void; } interface UseLoginVerificationResult { verification: LoginVerificationResponse | null; loading: boolean; error: Error | null; verifyLogin: (request: LoginVerificationRequest) => Promise; } /** * Hook for login verification workflow * * @param client - ComplianceClient instance * @param options - Hook options with callbacks */ declare function useLoginVerification(client: ComplianceClient, options?: UseLoginVerificationOptions): UseLoginVerificationResult; interface UseTransactionVerificationOptions { onSuccess?: (result: TransactionVerificationResponse) => void; onBlocked?: (result: TransactionVerificationResponse) => void; onApprovalRequired?: (result: TransactionVerificationResponse) => void; onError?: (error: Error) => void; } interface UseTransactionVerificationResult { verification: TransactionVerificationResponse | null; loading: boolean; error: Error | null; verifyTransaction: (request: TransactionVerificationRequest) => Promise; } /** * Hook for transaction verification workflow * * @param client - ComplianceClient instance * @param options - Hook options with callbacks * * @example * ```typescript * const { verifyTransaction, loading } = useTransactionVerification(sdk, { * onSuccess: (result) => { * processTransaction(result); * }, * onApprovalRequired: (result) => { * queueForReview(result); * }, * onBlocked: (result) => { * alert(`Transaction blocked: ${result.blockReasons.join(', ')}`); * } * }); * ``` */ declare function useTransactionVerification(client: ComplianceClient, options?: UseTransactionVerificationOptions): UseTransactionVerificationResult; /** * React hooks for customer risk profile management */ interface UseCustomerProfileOptions { autoFetch?: boolean; } interface UseCustomerProfileResult { profile: CustomerProfile | null; loading: boolean; error: Error | null; fetchProfile: () => Promise; updateProfile: (updates: Partial) => Promise; refresh: () => Promise; } /** * Hook for managing customer risk profiles * * @param client - RiskProfileClient instance * @param customerId - Customer ID to fetch profile for * @param options - Hook options * * @example * ```typescript * const { profile, loading, error, updateProfile } = useCustomerProfile( * riskClient, * 'CUST-12345', * { autoFetch: true } * ); * * if (loading) return ; * if (error) return ; * if (!profile) return ; * * return ( *
*

{profile.full_name}

* *
* ); * ``` */ declare function useCustomerProfile(client: RiskProfileClient, customerId: string, options?: UseCustomerProfileOptions): UseCustomerProfileResult; /** * React Hooks for Vesant KYC SDK * * Provides convenient React hooks for using the KYC service in Next.js applications. */ /** * React hook for submitting KYC document verification * * @param client - KycClient instance * @param options - Hook options * @returns KYC submission state and methods * * @example * ```tsx * function KycForm() { * const { submit, submission, loading, error, reset } = useKycSubmission(client, { * onComplete: (result) => { * console.log("Verification submitted:", result.reference); * }, * onError: (err) => { * console.error("Submission failed:", err.message); * } * }); * * const handleSubmit = async (formData: FormData) => { * await submit({ * reference: formData.get("customerId"), * email: formData.get("email"), * document: { * proof: formData.get("documentImage"), * selected_type: ["id_card", "passport"] * } * }); * }; * * return ( *
* {loading && } * {error && {error.message}} * {submission && Submitted: {submission.reference}} * * ); * } * ``` */ declare function useKycSubmission(client: KycClient, options?: UseKycSubmissionOptions): UseKycSubmissionResult; /** * React hook for managing KYC requests * * @param client - KycClient instance * @param options - Hook options * @returns KYC requests state and management methods * * @example * ```tsx * function KycDashboard() { * const { * requests, * total, * loading, * fetchRequests, * updateStatus * } = useKycRequests(client, { * autoFetch: true, * filters: { status: "pending" }, * pagination: { page: 1, page_size: 20 } * }); * * return ( *
*

{total} Pending KYC Requests

* {requests.map(req => ( * updateStatus(req.reference, "accepted", "Verified")} * onReject={() => updateStatus(req.reference, "declined", "Invalid document")} * /> * ))} *
* ); * } * ``` */ declare function useKycRequests(client: KycClient, options?: UseKycRequestsOptions): UseKycRequestsResult; /** * React hook for managing KYC alerts * * @param client - KycClient instance * @param options - Hook options * @returns KYC alerts state and management methods * * @example * ```tsx * function AlertsPanel() { * const { * alerts, * total, * loading, * fetchAlerts, * updateAlert * } = useKycAlerts(client, { * autoFetch: true, * filters: { status: ["pending", "in_progress"], risk: "critical" }, * pollInterval: 30000 * }); * * return ( *
*

{total} Critical Alerts

* {alerts.map(alert => ( * updateAlert(alert.id, { assigned_for: userId, status: "in_progress" })} * onResolve={() => updateAlert(alert.id, { status: "resolved", reason: "Verified" })} * /> * ))} *
* ); * } * ``` */ declare function useKycAlerts(client: KycClient, options?: UseKycAlertsOptions): UseKycAlertsResult; /** * React hook for KYC overview statistics * * @param client - KycClient instance * @param options - Hook options * @returns KYC overview state * * @example * ```tsx * function KycStats() { * const { overview, loading, refresh } = useKycOverview(client, { * autoFetch: true, * fromDate: "2024-01-01T00:00:00Z", * toDate: "2024-12-31T23:59:59Z" * }); * * if (loading) return ; * * return ( *
* * * * * *
* ); * } * ``` */ declare function useKycOverview(client: KycClient, options?: UseKycOverviewOptions): UseKycOverviewResult; /** * React hook for managing KYC preferences * * @param client - KycClient instance * @param autoFetch - Auto-fetch preferences on mount (default: true) * @returns KYC preferences state and methods * * @example * ```tsx * function PreferencesForm() { * const { preferences, loading, updatePreferences, refresh } = useKycPreferences(client); * * const handleUpdate = async (e: FormEvent) => { * e.preventDefault(); * await updatePreferences({ * is_face_verification_required: true, * required_document_count: 2 * }); * }; * * if (loading) return ; * * return ( *
* * * * * ); * } * ``` */ declare function useKycPreferences(client: KycClient, autoFetch?: boolean): UseKycPreferencesResult; /** * Convert a File to base64 string for document upload * * @param file - File object from input or drag-drop * @returns Base64 encoded string * * @example * ```typescript * const handleFileSelect = async (e: ChangeEvent) => { * const file = e.target.files?.[0]; * if (file) { * const base64 = await fileToBase64(file); * setDocumentProof(base64); * } * }; * ``` */ declare function fileToBase64(file: File): Promise; /** * Validate file type for document upload * * @param file - File object to validate * @param allowedTypes - Array of allowed MIME types * @returns boolean indicating if file type is valid * * @example * ```typescript * const validTypes = ['image/jpeg', 'image/png', 'application/pdf']; * if (!isValidFileType(file, validTypes)) { * alert('Invalid file type. Please upload a JPG, PNG, or PDF.'); * } * ``` */ declare function isValidFileType(file: File, allowedTypes?: string[]): boolean; /** * Validate file size for document upload * * @param file - File object to validate * @param maxSizeBytes - Maximum file size in bytes (default: 10MB) * @returns boolean indicating if file size is valid * * @example * ```typescript * const maxSize = 5 * 1024 * 1024; // 5MB * if (!isValidFileSize(file, maxSize)) { * alert('File too large. Maximum size is 5MB.'); * } * ``` */ declare function isValidFileSize(file: File, maxSizeBytes?: number): boolean; /** * Format KYC status for display * * @param status - KYC status * @returns Human-readable status string */ declare function formatKycStatus(status: string): string; /** * Get status color for UI display * * @param status - KYC status * @returns CSS color class or hex color */ declare function getStatusColor(status: string): string; /** * Get risk level color for UI display * * @param risk - Risk level * @returns CSS color class or hex color */ declare function getRiskColor(risk: string): string; declare function useReuseKYCSubmission(client: KycClient): { verifyFace: (reference: string, token: string) => Promise; }; export { type UseCustomerProfileOptions, type UseCustomerProfileResult, UseGeolocationOptions, UseGeolocationResult, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, UseLocationCaptureOptions, UseLocationCaptureResult, UseLocationRequestsOptions, UseLocationRequestsResult, type UseLoginVerificationOptions, type UseLoginVerificationResult, type UseRegistrationOptions, type UseRegistrationResult, type UseTransactionVerificationOptions, type UseTransactionVerificationResult, createDeviceFingerprint, fileToBase64, formatKycStatus, getBrowserInfo, getRiskColor, getStatusColor, isValidFileSize, isValidFileType, useCipherText, useCustomerProfile, useGeolocation, useKycAlerts, useKycOverview, useKycPreferences, useKycRequests, useKycSubmission, useLocationCapture, useLocationRequests, useLoginVerification, useRegistration, useReuseKYCSubmission, useTransactionVerification };