Skip to content

Fetch real transaction history from Stellar Horizon API to auto-populate proof inputs #8

Description

@IyanuOluwaJesuloba

Currently all private inputs (txCount, disputeCount, avgBalance, monthsActive) are manually entered by the user. The README notes this as a known limitation: "Financial data is self-reported; production would integrate Stellar Horizon API or an oracle."

Horizon exposes /accounts/{id} and /accounts/{id}/payments endpoints. We can fetch real data client-side (data stays in the browser, never hits our servers) and pre-fill the proof inputs form.

Proposed flow:

After Freighter connects, call https://horizon-testnet.stellar.org/accounts/{publicKey}
Fetch payment history to count transactions and calculate average balance
Pre-populate the ProofGenerator form — user can review/adjust before proving

Acceptance criteria:

New horizon.ts module with fetchAccountStats(publicKey): Promise
ProofGenerator.tsx shows a "Auto-fill from Horizon" button when wallet is connected
Data fetched from Horizon, not from user input, is used as default values
Manual override still supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions