Skip to content

Backend API the front end needs #16

Closed

Description

@Lexirieru

Owner: James (@Lin1er) · Branch: feat/16-backend-api · Milestone: M2 · Blocked by: #6

What to build

A read-only surface over chain state, so the front end does not reimplement contract decoding:

  • an advance's status
  • the repayment position for an address
  • whether a given nullifier has already been spent

Plus a health endpoint, CORS configured for the deployed front-end origin, and a /config that reports the contract addresses the API is actually pointed at.

Why /config matters more than it looks

Sterun caught a whole class of "which network is this talking to?" confusion this way — a worktree .env written before a redeploy still named the old contract pair, and a run that silently used it would have proven nothing. Making the API state its own wiring turns a silent mismatch into a visible one.

CORS is also the one thing that cannot be tested before the front end is deployed, and on Sterun it was left at localhost until after the deploy, which would have refused every authenticated request from the real origin.

Done when

Every route answers against live testnet, and a test asserts /config's addresses match docs/deployments.md exactly.


Working agreement

  1. One issue, one owner. 2. Branch per issue, named above — not the GitHub-suggested one. 3. MCP Stellar Raven for any Stellar/Soroban fact that gets written down. 4. Merge through PR review by Axel (PM); no self-merge. If an ACC has not arrived within two days on something already verified, merge and say so in the PR. 5. Deploys need evidence: contract address or tx hash on stellar.expert, recorded in docs/deployments.md. 6. Secrets live in .env, gitignored, chmod 600 — never printed, never committed, never pasted into an issue or PR. Only public G… and C… addresses appear anywhere. 7. Issues, commits and PRs in English.

Scope: instawards/Forepay Instawards SOW.pdf. Timeline assumes 2026-10-09 → 2026-11-08; tell Axel if the real window differs.

Activity

  1. added
    deliverable-2SOW Deliverable 2 — Reclaim provider and application
    on Oct 9, 2026
  2. added 4 commits that reference this issue on Oct 15, 2026
  3. Nabil-Aufa commented on Oct 16, 2026

    @Nabil-Aufa
    Collaborator

    @Lin1er, the front end needs these from #16. #58 (#21, Repayment) reads them through fe/src/lib/api/client.ts. Until the routes exist it answers from fixtures, so this is the only thing between #21 and real figures.

    1. GET /advances?borrower=<G…>: every advance for that wallet, newest first, shaped as AdvanceSummary in fe/src/lib/api/types.ts. Amounts (stroops) and timestamps (seconds) go as strings.
    2. Each advance needs its nullifier (32 bytes, hex) and the disbursement txHash. repay(from, nullifier, amount) takes the nullifier, and the UI links the receipt.
    3. GET /transactions?borrower=<G…>: every advance and repayment, newest first, shaped as LedgerTransaction.
    4. A transaction kind "trustline" (with an empty nullifier), for the "USDC allowed in wallet" row on 3b.
    5. What does status: "failed" mean? Did the transaction never reach the ledger (nothing charged), or fail on it (fee spent)? The failed row's wording depends on it.

    If any shape is easier another way, say so: the types and client.ts are the only places that change.

  4. added 6 commits that reference this issue on Oct 17, 2026
  5. 6 remaining items

  6. added 2 commits that reference this issue on Oct 19, 2026
  7. added 9 commits that reference this issue on Oct 20, 2026
  8. Lin1er commented on Oct 20, 2026

    @Lin1er
    Collaborator

    Done, closing. Both "Done when" points:

    Merged in #66 after Axel's review.

  9. added a commit that references this issue on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

M2-contractWeek 2 — the advance contract on Sorobandeliverable-2SOW Deliverable 2 — Reclaim provider and application

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions