Skip to content

feat: streaming payments — allow pay() to accept partial amounts up to a per-period cap #56

Description

@MarcusDavidG

Summary

Add streaming payment support: invoices can define a stream_rate (amount per second) and payers drip funds over time instead of paying in full upfront.

Motivation

Streaming payments are the natural primitive for salaries, retainers, and compute billing. This is one of Stellar's key advantages over EVM chains.

Proposed Change

  • Add stream_enabled: bool and stream_rate: i128 to InvoiceOptions
  • Add stream_pay(payer, invoice_id) that transfers stream_rate * elapsed_seconds
  • Track last stream timestamp per payer in storage

Acceptance Criteria

  • stream_pay transfers correct amount based on elapsed time
  • stream_rate stored in Invoice
  • test: stream_pay at correct rate
  • test: stream_pay at zero elapsed time transfers nothing
  • test: stream_pay after full stream is complete panics

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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