Skip to content

Implement SEP-24 interactive withdrawal (cash-out) flow in anchor service #408

Description

@Wilfred007

What

Add SEP-24 (interactive deposit/withdrawal) support to backend/src/services/anchorService.ts. It currently discovers only WEB_AUTH_ENDPOINT and TRANSFER_SERVER_SEP0031 and implements SEP-31; there is no SEP-24 path for employee-initiated cash-out.

Why

The README lists employee 'Withdrawal Options' via 'Local Anchors (Cash-out)' as a core actor flow. SEP-31 is cross-border/send-side; employee self-service cash-out to local currency is the SEP-24 interactive flow. Without it, employees cannot actually convert received ORGUSD to local fiat through the platform.

Scope

In scope:

  • Parse the SEP-24 transfer server endpoint from stellar.toml discovery.
  • Implement SEP-24 /info, initiate interactive withdrawal (returns the anchor's interactive URL), and transaction status polling.
  • Reuse the existing SEP-10 authentication.
  • Expose controller/routes mirroring the SEP-31 endpoints.

Out of scope:

  • Frontend withdrawal UI (separate frontend issue).
  • Supporting every optional SEP-24 field.

Acceptance criteria

  • Anchor discovery reads the SEP-24 endpoint when present.
  • A withdrawal can be initiated and its status queried against a testnet anchor (or mocked in tests).
  • Unit tests cover discovery, initiate, and status.

Technical context

  • File: backend/src/services/anchorService.ts (SEP-1 discovery ~line 30, SEP-10 auth, getSEP31Info ~line 83).
  • Controller/routes: backend/src/controllers/paymentController.ts, backend/src/routes/paymentRoutes.ts.

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions