so what i want to do is I want to do a CPI call From program B to program A, But I want to this via a rust crate, not from program B. Like this
use Crate::create_cpi;
fn do_something(ctx ...) -> Result<()>{
create_cpi( data)?;
}
here Crate is a rust crate, i want to do the CPI from the rust Crate (If Possible), Or it should return something like CPI Context or Instruction, so The user can just sign that instruction and send that transaction without much hassle. i want the user to pass as less data as possible. so they can write their code more without worrying about the CPI.
does anyone have any idea how to pull it off or any example they know of? Any reference will be helpful Thanks!