Skip to content

[Backend] Replace simulated wallet withdrawals with Stellar settlement #304

@Kaylahray

Description

@Kaylahray

Description

The withdrawal route still returns a placeholder for the on-chain flow and only decrements the local balance in simulated mode.

User Story

As a wallet user,
I want to withdraw funds to a real Stellar destination,
so that I can move value off-platform when needed.

Requirements and Context

  • Files: app/app/api/wallet/withdraw/route.ts, app/lib/sep10.ts, app/lib/prisma.ts
  • Build and submit a real Stellar payment transaction when simulated=false
  • Persist the pending and completed withdrawal states correctly
  • Surface on-chain submission failures with useful errors

Suggested Implementation

// WITHDRAW ROUTE
// 1. Build the Stellar payment transaction.
// 2. Submit it to the network.
// 3. Store the withdrawal record with chain metadata.
// 4. Update local balance only after a valid settlement path.

Acceptance Criteria

  • The non-simulated withdrawal path no longer returns a placeholder error.
  • Successful withdrawals are reflected in wallet history.
  • Balance changes are consistent with the transaction result.

Submission Guidelines

  • Branch: feat/stellar-withdrawals
  • Depends on: Stellar submission utilities
  • PR: feat(backend): settle wallet withdrawals on Stellar

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions