lib.rs 667 B

12345678910111213141516171819202122232425
  1. mod transfer_sol_with_cpi;
  2. mod transfer_sol_with_program;
  3. use transfer_sol_with_cpi::*;
  4. use transfer_sol_with_program::*;
  5. use transfer_sol_api::prelude::*;
  6. use steel::*;
  7. pub fn process_instruction(
  8. program_id: &Pubkey,
  9. accounts: &[AccountInfo],
  10. data: &[u8],
  11. ) -> ProgramResult {
  12. let (ix, data) = parse_instruction(&transfer_sol_api::ID, program_id, data)?;
  13. match ix {
  14. TransferSolInstruction::TransferSolWithCpi => process_transfer_sol_with_cpi(accounts, data)?,
  15. TransferSolInstruction::TransferSolWithProgram => process_transfer_sol_with_program(accounts, data)?,
  16. }
  17. Ok(())
  18. }
  19. entrypoint!(process_instruction);