Skip to content

feat: sponsor withdrawal flow with transaction signing #12

@EmeditWeb

Description

@EmeditWeb

Problem

The withdraw form on Sponsors page has no actual
transaction signing. Sponsors cannot withdraw their
funds.

What To Build

When sponsor submits withdrawal shares amount:

  1. Show preview: shares -> USDC calculation
  2. Call POST /liquidity/withdraw with shares
  3. API returns unsigned XDR
  4. Pass XDR to Freighter signTransaction()
  5. Submit signed XDR to Stellar
  6. Show success with amount returned and profit

Files To Touch

  • src/pages/Sponsors.tsx
  • src/services/sponsors.service.ts
  • src/hooks/useTransaction.ts

Acceptance Criteria

  • Preview shows correct USDC calculation
  • Full withdrawal flow works end to end
  • Transaction hash shown on success
  • Error shown if user rejects in wallet

Mandatory Checks Before PR

  • npm run build passes
  • No any types
  • PR references this issue

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions