Skip to content

fix: wire StepDeposit onboarding to real deposit XDR flow#91

Open
Muyideen-js wants to merge 3 commits into
StepFi-app:mainfrom
Muyideen-js:fix/sponsor-onboarding-deposit-flow
Open

fix: wire StepDeposit onboarding to real deposit XDR flow#91
Muyideen-js wants to merge 3 commits into
StepFi-app:mainfrom
Muyideen-js:fix/sponsor-onboarding-deposit-flow

Conversation

@Muyideen-js

@Muyideen-js Muyideen-js commented Jul 22, 2026

Copy link
Copy Markdown

Closes #56

Summary

Replace the stub StepDeposit component in the sponsor onboarding wizard with a fully functional deposit flow. Sponsors completing the 4-step onboarding can now actually deposit USDC — amount input with $10 minimum validation, unsigned XDR fetched from the API, signed via Freighter, submitted on-chain, and a success state with a Stellar Expert link. On success, onboarding is marked complete and the sponsor is navigated to the dashboard.

This repo is for the React web app only

This app targets sponsors, vendors, and mentors.
It does NOT serve learners. Learner features
belong in StepFi-App.

Before submitting, confirm your changes belong here:

  • My changes are inside src/
  • I have NOT added Rust, Soroban, or
    contract code
  • I have NOT added React Native or
    Expo-specific code
  • I have NOT hardcoded hex color values
    (use Tailwind classes or constants/colors.ts)
  • All icons are from lucide-react only
  • No API calls made directly in page files
    (use services/ layer only)

Type of change

  • Bug fix
  • New page or component
  • Service layer addition
  • Styling or responsive fix
  • Accessibility improvement
  • Performance improvement

Testing

  • npm run build passes with zero errors
  • npm run lint passes with zero errors
  • Loading, error, and empty states handled
  • Page tested on mobile viewport (375px)
  • No console errors in browser

Context files reviewed

  • context/architecture-context.md
  • context/code-standards.md
  • context/progress-tracker.md updated

Mandatory before requesting review

Running these must all exit 0:

  • npm run lint — 0 errors
  • npm test — 36 tests passed, 0 failures
  • npm run build — 0 errors

What changed

src/pages/SponsorOnboarding.tsx — Replaced the StepDeposit stub with a real deposit flow:

  • Amount input with $10 minimum validation and inline error messaging (aria-invalid, role="alert")
  • Unsigned XDR fetched via sponsorsService.deposit(amount)
  • Freighter signing handled by the existing useTransaction hook (which calls @stellar/freighter-api's signTransaction)
  • Signed XDR submission via transactionsService.submit(signedXdr, 'deposit')
  • Success state showing deposit amount, transaction hash, and a Stellar Expert link
  • Onboarding completiononComplete fires after a successful deposit, setting onboardingComplete: true and navigating to /sponsors
  • Error state displayed inline using the existing error card pattern from the Sponsors dashboard
  • Disconnected state still shows "Connect Freighter Wallet" with Freighter download link and GrantFox fallback

All patterns mirror the existing deposit flow in src/pages/Sponsors.tsx exactly — useTransaction, useToast, invalidatesubtree.pool, and the success card layout.

Files changed

File Change
src/pages/SponsorOnboarding.tsx Replaced StepDeposit stub with full deposit flow (+ imports)

Replace stub StepDeposit component with a functional deposit flow that calls sponsorsService.deposit(), signs via Freighter through useTransaction, and submits via transactionsService.submit(). Adds deposit amount input with $10 minimum validation, error state, and success state with Stellar Expert link.
@Muyideen-js
Muyideen-js requested a review from EmeditWeb as a code owner July 22, 2026 17:29
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.

fix: Sponsor onboarding step 4 has no actual deposit flow

1 participant