Skip to content

fix: Sponsor onboarding step 4 has no actual deposit flow #56

Description

@EmeditWeb

Problem

The SponsorOnboarding page at src/pages/SponsorOnboarding.tsx:267-316 has a final step titled "Deposit" that does not actually let sponsors deposit USDC. The StepDeposit component only shows a "Connect Freighter Wallet" button (when disconnected) or a "Go to Sponsor Dashboard" link (when connected). There is no deposit amount input, no XDR generation, and no transaction signing.

User impact: New sponsors complete the 4-step onboarding wizard expecting to make their first deposit, but reach a dead end. They are redirected to the sponsor dashboard, which also has no deposit form (only a withdraw form). First-time depositors cannot onboard through the intended flow.

Before Starting

Read ALL of these before writing any code:

  • context/architecture-context.md
  • context/code-standards.md

Your PR will be rejected if it conflicts with
anything in the context files regardless of
whether CI passes.

Root Cause

Step 4 of the onboarding wizard was designed as a "Deposit" step but was never wired to the backend. The StepDeposit component is a stub — it connects the wallet but never calls sponsorsService.deposit() or sponsorsService.buildDepositXdr() to generate the unsigned XDR.

What To Build

Replace the stub StepDeposit component with a real deposit flow:

  1. Add a deposit amount input field with validation (min $10)
  2. Call sponsorsService.buildDepositXdr() to get unsigned XDR
  3. Sign the XDR with Freighter
  4. Submit signed XDR via sponsorsService.submitTransaction()
  5. Show success state with Stellar Expert link
  6. On success, mark onboarding complete and navigate to dashboard

Files To Touch

  • src/pages/SponsorOnboarding.tsx — replace StepDeposit stub with real deposit flow
  • src/services/sponsors.service.ts — already has buildDepositXdr and submitTransaction

Acceptance Criteria

  • Deposit amount input with $10 minimum validation
  • Unsigned XDR fetched from API
  • XDR signed via Freighter
  • Signed XDR submitted
  • Success state shown with Stellar Expert link
  • Onboarding marked complete after successful deposit

Mandatory Checks Before Opening PR

  • All context/ files read and understood
  • Code follows context/code-standards.md exactly
  • npm run lint passes with zero errors
  • npm run build passes with zero errors
  • npm test passes with all tests passing
  • Test count has NOT decreased from baseline
  • No new any types introduced
  • PR template filled out completely
  • PR references this issue number

PRs that fail any check above will be closed
without review. No exceptions.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions