Wiezzel / stream-payments

Substrate pallet for stream payments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stream payments

License Rust check

This pallet supports creating streams i.e. ongoing payments. Once a stream is opened, on every block a specified amount of funds will be transferred from the origin account to the given target account, until the stream is closed.

Interface

Config

  • MaxStreams: u32 – The maximum number of streams per account.

Dispatchable functions

  • open_stream(origin, target, spend_rate)
    Open a new stream. From the next block on, on each block spend_rate will be transferred to the target account. The stream can be closed by calling close_stream.
  • close_stream(origin, index)
    Close a stream. From the next block on, transfers will stop.

Planned features

  • Add an optional total spend limit for stream and reserve funds for limited streams.
  • Use fixed stream identifiers instead of indices.
  • Introduce fees/deposits for opening streams.
  • Keep the starting block and total amount transferred (stats for front-end).
  • Introduce payment block interval and grace period.

About

Substrate pallet for stream payments

License:Apache License 2.0


Languages

Language:Rust 100.0%