sablier_thread_program/instructions/
get_crate_info.rs

1use {anchor_lang::prelude::*, sablier_utils::CrateInfo};
2
3/// Accounts required for the `get_crate_info` instruction.
4/// We are not using system program actually
5/// But anchor does not support empty structs: https://github.com/coral-xyz/anchor/pull/1659
6#[derive(Accounts)]
7pub struct GetCrateInfo<'info> {
8    pub system_program: Program<'info, System>,
9}
10
11pub fn handler(_ctx: Context<GetCrateInfo>) -> Result<CrateInfo> {
12    let spec = format!(
13        "https://github.com/sablier-xyz/sablier/blob/v{}/programs/thread/Cargo.toml",
14        version!()
15    );
16    let blob = "";
17    let info = CrateInfo {
18        spec,
19        blob: blob.into(),
20    };
21    msg!("{}", info);
22
23    Ok(info)
24}