Skip to content

Stellar base reserve and fee estimates: user-facing and API fields for pre-flight #135

@greatest0fallt1me

Description

@greatest0fallt1me

Expose min_balance_xlm and estimated_fees on stream create preflight

    ## Description

    **Help users and wallets** avoid `op_underfunded` and **min reserve** surprises: add

pre-flight or GET that returns required XLM and per-tx fee estimates
for a proposed stream, including any Soroban and escrow overhead. This is
backend truth; the Figma side has a separate design issue in StreamPay-Frontend.

    ## Requirements and context

    - **Plain** `amounts` in stroops and human-readable; **rounding** policy repeated.
  • Cite which Horizon/RPC calls back the numbers (and cache policy).

  • Tests with fixture responses; no live network in unit tests.

  • Rate limit: these can be high volume; add cache and limits.

  • Security: no PII; only for authenticated user’s accounts or public estimate only if safe.

      ## Suggested execution
    
      1. `git checkout -b feature/preflight-reserve-estimates`
    
  1. Add GET /streams/estimate or POST with dry-run.

  2. PR with OpenAPI and example response for two assets.

  3. Cross-link to contracts for exact lock amounts.

  4. Timeframe: 96h; extend for multi-hop paths.

     ## Test and commit
    
  • Run the full test suite; add or update tests until the agreed coverage bar is met.
  • Cover edge cases listed in this issue; document any intentional exclusions with brief rationale in the PR.
  • Include relevant test output (e.g. test runner summary) or a link to a passing CI run in the pull request.
  • Add security notes for auth, keys, PII, chain settlement, or money movement (assumptions verified, out-of-scope items).

Example commit message

feat(stellar): add reserve and fee estimate preflight for stream and escrow planning

Guidelines

  • Target: at least 95% coverage on new or meaningfully changed code (per the repo’s standard tooling).
  • Documentation: update contributor-facing or API documentation where a reviewer would be blocked without it.
  • Timeframe: 96 hours to ready-for-review (surface blockers early).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-uxStreamPay ghit: area-uxdomain-stellarStreamPay ghit: domain-stellarpriority-p3StreamPay ghit: priority-p3type-featureStreamPay ghit: type-feature

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions