Skip to content

Contributor Payment History Query #527

Description

@Kingsman-99

Description

There is no way to query all contributions ever made by a specific payer address across all invoices. An indexed payment history keyed by payer should allow wallets and dashboards to retrieve a full contribution history without off-chain indexing.

Technical Context

Store PayerHistory(payer) -> Vec<(invoice_id: u64, amount: i128, ledger: u32)> in storage::persistent in contracts/split/src/lib.rs. Append to this list on every successful contribute. Add get_payer_history(payer: Address, offset: u32, limit: u32) -> Vec<PaymentRecord> with pagination support. Define PaymentRecord in types.rs.

Acceptance Criteria

  • Every successful contribute appends a record to PayerHistory(payer)
  • get_payer_history returns paginated results using offset and limit
  • History includes invoice_id, amount, and ledger for each entry
  • History is append-only — withdrawals do not remove entries (only the balance changes)
  • List is bounded by a max cap to prevent unbounded storage growth per payer
  • All CI checks (cargo build --target wasm32-unknown-unknown, cargo test, cargo clippy) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptsstorageStorage layout and TTL optimisation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions