Skip to content

#30 Connect Create Account flow to backend (nonce, verify, profile) and navigate to Pay Screen#44

Open
samuelgodsgift wants to merge 1 commit intoTrustUp-app:mainfrom
samuelgodsgift:feat/issue-30-create-account-api-flow
Open

#30 Connect Create Account flow to backend (nonce, verify, profile) and navigate to Pay Screen#44
samuelgodsgift wants to merge 1 commit intoTrustUp-app:mainfrom
samuelgodsgift:feat/issue-30-create-account-api-flow

Conversation

@samuelgodsgift
Copy link
Copy Markdown

🔗 Related Issue

Closes #30


🔖 Title

Connect Create Account flow to backend (nonce, verify, profile) and navigate to Pay Screen


📝 Description

Replaces the mock account creation (setTimeout + Alert) in useCreateAccount with a real wallet auth flow against the TrustUp API. On success, the app navigates to PayScreen.


🔄 Changes Made

  • Added lib/apiClient.ts — central HTTP client using EXPO_PUBLIC_API_URL
  • Added lib/tokenStorage.ts — secure token storage using expo-secure-store
  • Added api/auth.tsPOST /auth/nonce and POST /auth/verify
  • Added api/users.tsGET /users/me and PATCH /users/me
  • Updated hooks/auth/use-create-account.ts — real nonce → sign → verify → persist → profile flow; signNonce() is stubbed pending wallet SDK decision
  • Updated components/pages/CreateAccountScreen.tsx — typed navigation prop, navigates to Pay Screen on success
  • Updated App.tsx — added NavigationContainer and native stack with Invest, Create Account, and Pay screens

📸 Screenshots (if applicable)

N/A — functional flow only, existing UI unchanged.


🗒️ Additional Notes

  • signNonce() in use-create-account.ts is a stub with a TODO comment. It returns the nonce as a placeholder signature until the Stellar wallet SDK (e.g. Freighter) is integrated.
  • New dependencies added: expo-secure-store, @react-navigation/native, @react-navigation/native-stack, react-native-screens

@D240021
Copy link
Copy Markdown
Contributor

D240021 commented Mar 29, 2026

Hey, @samuelgodsgift! Nice job but:

  1. Don't remove code that was previously there. For instante, in CreateAccountScreen.tsx you deleted the page structure and it's not necessary.
  2. Don't remove comments in code either.
  3. Please, check the issue description again, please!

Keep going! I'm here to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connect Create Account flow to backend (nonce, verify, profile) and navigate to Pay Screen

2 participants