Superstream is a protocol and a collection of libraries for real-time money streaming on Solana. It allows anyone to continuously stream money to anyone else transparently and efficiently.
Superstream protocol is completely open-source. View it on GitHub.
Learn more about Superstream on superstream.finance.
A Solana on-chain program that maintains the state of all the streams on-chain. Other Solana on-chain programs can interact with it directly using Cross-Program Invocation (CPI for short). Read more about it here.
NOTE: For a complete example, see superstream-cpi-example
toml
superstream = { version = "0.2.0", features = ["cpi"] }
```rust
pub mod superstreamcpiexample {
/// Cancel a stream.
pub fn cancel(ctx: Context
superstream::cpi::cancel(cpi_ctx, seed, name, recipient)
}
// ... other stuff
}
/// Accounts struct for cancelling a stream.
pub struct Cancel<'info> { /// Stream PDA account. #[account(mut)] pub stream: AccountInfo<'info>,
/// Signer wallet.
pub signer: Signer<'info>,
/// Stream sender account.
pub sender: AccountInfo<'info>,
/// SPL token mint account.
pub mint: Box<Account<'info, Mint>>,
/// Associated token account of the signer.
#[account(mut)]
pub signer_token: Box<Account<'info, TokenAccount>>,
/// Associated token account of the sender.
#[account(mut)]
pub sender_token: Box<Account<'info, TokenAccount>>,
/// Associated token account of the recipient.
#[account(mut)]
pub recipient_token: Box<Account<'info, TokenAccount>>,
/// Associated token escrow account holding the funds for this stream.
#[account(mut)]
pub escrow_token: Box<Account<'info, TokenAccount>>,
/// SPL token program.
pub token_program: Program<'info, Token>,
/// Superstream program.
pub superstream_program: Program<'info, superstream::program::Superstream>,
}
// ... other stuff ```
shell
pnpm build
shell
solana-test-validator
shell
anchor deploy --provider.cluster localnet