Skip to content

Build invoice payment analytics oracle #144

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Other Soroban contracts need access to StellarSplit payment data without reading raw storage. This issue adds a standardised oracle interface — get_invoice_stats(invoice_id) returns a InvoiceStats struct with funded amount, payment count, unique payer count, and completion percentage — callable by external contracts.

Technical Context

Involves lib.rs — new get_invoice_stats(env, invoice_id: u64) -> InvoiceStats. Define InvoiceStats { funded: i128, total: i128, payment_count: u32, unique_payers: u32, completion_bps: u32 } in types.rs. Compute unique payers by deduplicating invoice.payments payer addresses. No auth required.

Acceptance Criteria

  • get_invoice_stats() returns correct funded and total
  • payment_count equals total number of payment entries
  • unique_payers correctly deduplicates addresses
  • completion_bps equals funded * 10_000 / total
  • No auth required (read-only oracle interface)
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 pts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions