Function create

Source
pub fn create(
    ctx: Context<'_, '_, '_, '_, Create<'_>>,
    start_time: u64,
    net_amount_deposited: u64,
    period: u64,
    amount_per_period: u64,
    cliff: u64,
    cliff_amount: u64,
    cancelable_by_sender: bool,
    cancelable_by_recipient: bool,
    automatic_withdrawal: bool,
    transferable_by_sender: bool,
    transferable_by_recipient: bool,
    can_topup: bool,
    stream_name: [u8; 64],
    withdraw_frequency: u64,
    pausable: Option<bool>,
    can_update_rate: Option<bool>,
) -> Result<()>
Expand description

Create a Stream

ยงArguments

  • ctx - Accounts that will be used on Stream creation
  • start_time - Unix Timestamp for Stream start, can be 0 to use current time
  • net_amount_deposited - Amount of Tokens to deposit to the Stream
  • period - Unlock Period in Seconds, tokens will be unlocked every period seconds
  • amount_per_period - Unlock Amount, every period we unlock amount_per_period tokens
  • cliff - Unix Timestamp of Cliff (first unlock), can be 0 to use current time or not use at all
  • cliff_amount - Cliff Amount of tokens, can 0 to not use Cliff at all
  • cancelable_by_sender - Whether Stream can by cancelled by Sender
  • cancelable_by_recipient - Whether Stream can be cancelled by Recipient
  • automatic_withdrawal - Whether automatic withdrawals are enabled
  • transferable_by_sender - Whether Stream can be transferred by Sender
  • transferable_by_recipient - Whether Stream can be transferred by Recipient
  • can_topup - Whether Stream can be topped up (deposit additional tokens) by Sender
  • stream_name - Name of the Stream
  • withdraw_frequency - if automatic_withdrawal is on, every withdraw_frequency seconds all unlocked tokens will be sent to the recipient
  • pausable - Whether Stream can be paused by Sender
  • can_update_rate - Whether Sender can update amount_per_period value of the Stream via update method