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
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 aInvoiceStatsstruct with funded amount, payment count, unique payer count, and completion percentage — callable by external contracts.Technical Context
Involves
lib.rs— newget_invoice_stats(env, invoice_id: u64) -> InvoiceStats. DefineInvoiceStats { funded: i128, total: i128, payment_count: u32, unique_payers: u32, completion_bps: u32 }intypes.rs. Compute unique payers by deduplicatinginvoice.paymentspayer addresses. No auth required.Acceptance Criteria
get_invoice_stats()returns correctfundedandtotalpayment_countequals total number of payment entriesunique_payerscorrectly deduplicates addressescompletion_bpsequalsfunded * 10_000 / totalcargo clippypasses with zero warnings