Skip to content

feat(backend): implement SEP-10/SEP-24/SEP-6 Stellar Anchor Client#858

Open
Faithy5 wants to merge 1 commit into
Fracverse:masterfrom
Faithy5:feat/sep10-sep24-sep6-anchor-client
Open

feat(backend): implement SEP-10/SEP-24/SEP-6 Stellar Anchor Client#858
Faithy5 wants to merge 1 commit into
Fracverse:masterfrom
Faithy5:feat/sep10-sep24-sep6-anchor-client

Conversation

@Faithy5

@Faithy5 Faithy5 commented Jun 25, 2026

Copy link
Copy Markdown

Summary

Implements the Stellar Anchor client in stellar_anchor.rs per issue #816.

Changes

backend/src/stellar_anchor.rs

  • SEP-10 authentication: fetches challenge transaction from anchor's WEB_AUTH_ENDPOINT, submits (mock-)signed transaction, receives JWT
  • SEP-24 interactive off-ramp: POST /transactions/withdraw/interactive with asset code, account, and bank detail fields (dest, dest_extra, type) formatted per SEP-9 KYC spec
  • SEP-6 non-interactive off-ramp: GET /withdraw fallback when SEP-24 transfer server is not available
  • stellar.toml discovery: fetches /.well-known/stellar.toml to resolve WEB_AUTH_ENDPOINT, TRANSFER_SERVER_SEP0024, and TRANSFER_SERVER
  • Status polling: polls GET /transaction up to 10× (3 s apart) mapping anchor statuses to AnchorPayoutStatus
  • AnchorRegistry: in-memory payout store, create_payout spawns a background Tokio task running the full SEP flow and advancing payout status
  • Anchor transaction ID stored on the payout record after handshake

backend/Cargo.toml

  • Added: reqwest 0.12 (rustls-tls), hmac 0.12, sha2 0.10, hex 0.4, base64 0.22

Acceptance Criteria

  • Connects to Testnet anchors and completes mock withdrawal flows (SEP-10 → SEP-24/SEP-6)
  • Parses anchor responses and maps transaction IDs
  • Skeletons properly filled with SDK modules
  • cargo build passes with zero errors and zero warnings from project code

Closes #816

- SEP-10: authenticate with anchor via challenge/response JWT flow
- SEP-24: interactive withdrawal with bank detail fields (dest, dest_extra)
- SEP-6: non-interactive withdrawal fallback
- AnchorRegistry: in-memory payout store with background polling state machine
- fetch stellar.toml to discover web_auth and transfer_server endpoints
- map anchor transaction statuses to AnchorPayoutStatus enum
- spawn async task per payout to run SEP flow and advance status

Closes Fracverse#816
@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@Faithy5 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ONEONUORA

Copy link
Copy Markdown
Contributor

@Faithy5
Run cargo fmt --all -- --check
and

clippy

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.

[Backend] Module: Implement Separated SEP-24/SEP-6 Stellar Anchor Client

2 participants