sablier_thread_program/instructions/
thread_instruction_remove.rsuse {
crate::{constants::*, state::*},
anchor_lang::prelude::*,
};
#[derive(Accounts)]
#[instruction(index: u64)]
pub struct ThreadInstructionRemove<'info> {
pub authority: Signer<'info>,
#[account(
mut,
seeds = [
SEED_THREAD,
thread.authority.as_ref(),
thread.id.as_slice(),
thread.domain.as_ref().unwrap_or(&Vec::new()).as_slice()
],
bump = thread.bump,
has_one = authority
)]
pub thread: Account<'info, Thread>,
}
pub fn handler(ctx: Context<ThreadInstructionRemove>, index: u64) -> Result<()> {
let thread = &mut ctx.accounts.thread;
thread.instructions.remove(index as usize);
Ok(())
}