feat(mobile): wire SDK and port WalletProvider with secure session persistence - #594
feat(mobile): wire SDK and port WalletProvider with secure session persistence#594Big-Rahm wants to merge 1 commit into
Conversation
…rsistence - Create WalletProvider component using @veil/sdk useInvisibleWallet with AsyncStorage adapter - Persist session (signer keypair) in expo-secure-store for OS background/kill survival - Add walletConfig export to network.ts with factoryContractId - Add setSignerSecret to walletStore.ts - Mount WalletProvider in app/_layout.tsx wrapping the navigation stack - Add invisible-wallet-sdk dependency and tsconfig path aliases Closes Miracle656#443
|
Someone is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Big-Rahm Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Thanks for this. It's conflicting with |
Overview
This PR wires the
@veil/sdk(useInvisibleWallet) into the mobile app and ports theWalletProviderfrom the web wallet, adapted for React Native.Unlike the web wallet (which keeps the signer keypair in React state only), the mobile provider persists the session in
expo-secure-storeso it survives the app being backgrounded or killed by the OS. The SDK credentials (key ID, public key, address) are persisted viaAsyncStorage(configured as the SDK'sStorageAdapter).Related Issue
Closes #443
Changes
Mobile WalletProvider
[ADD]
frontend/mobile/components/WalletProvider.tsxuseInvisibleWallet(walletConfig)withAsyncStorageas the storage adaptersession,setSession,wallet,clearSessionvia React contextexpo-secure-storeon mount (reads wallet_address + signer_secret)expo-secure-storeuseWallet()hook matching the web interface[MODIFY]
frontend/mobile/app/_layout.tsx<WalletProvider>wrapping the navigation Stack and WalletConnectApprovalModalSDK / Network Wiring
[MODIFY]
frontend/mobile/lib/network.tsfactoryContractIdtoVeilNetworktype and both network definitions (testnet/mainnet)walletConfigexport (mirrorsfrontend/wallet/lib/network.ts)[MODIFY]
frontend/mobile/lib/walletStore.tssetSignerSecret(secret)for persisting the fee-payer secret toexpo-secure-storegetWalletAddress()declarationDependencies
[MODIFY]
frontend/mobile/package.jsoninvisible-wallet-sdk: file:../../sdkdependency[MODIFY]
frontend/mobile/tsconfig.json@veil/sdkand other@veil/*modules pointing to SDK sourceVerification Results
useWallet()returns a liveuseInvisibleWallet(walletConfig)from any screensession,setSession,wallet,clearSessionexpo-secure-storeacross app restartWalletProvider.tsx