import { Platform } from 'react-native'; import NativeHyperswitchModule from '../codegen/modules/NativeHyperswitchModule'; import type { WalletName } from '../types/walletSession'; export function isGooglePaySupported(): Promise { return NativeHyperswitchModule.isGooglePaySupported().catch(() => false); } export function isApplePaySupported(): Promise { return NativeHyperswitchModule.isApplePaySupported().catch(() => false); } export function isWalletSupported(wallet: WalletName): Promise { return wallet === 'google_pay' ? isGooglePaySupported() : isApplePaySupported(); } export function isPlatformPaySupported(): Promise { if (Platform.OS === 'ios') { return isApplePaySupported(); } if (Platform.OS === 'android') { return isGooglePaySupported(); } return Promise.resolve(false); }