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
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