pub fn transfer(
    from_keypair: &Keypair,
    to: &Pubkey,
    lamports: u64,
    recent_blockhash: Hash,
) -> Transaction {
    let from_pubkey = from_keypair.pubkey();
    let transfer_instruction = system_instruction::transfer(&from_pubkey, to, lamports);
    let instructions = vec![transfer_instruction];
    Transaction::new_signed_instructions(&[from_keypair], instructions, recent_blockhash)
}
/// Create and sign new system_instruction::Transfer transaction
Create and sign new system_instruction::Transfer transaction
Create and sign new system_instruction :: Transfer transaction
pub fn transfer(
    from_keypair: &Keypair,
    to: &Pubkey,
    lamports: u64,
    recent_blockhash: Hash,
) -> Transaction {
    let from_pubkey = from_keypair.pubkey();
    let transfer_instruction = system_instruction::transfer(&from_pubkey, to, lamports);
    let instructions = vec![transfer_instruction];
    Transaction::new_signed_instructions(&[from_keypair], instructions, recent_blockhash)
}
pub fn transfer ( from_keypair : & Keypair , to : & Pubkey , lamports : u64 , recent_blockhash : Hash , ) -> Transaction { let from_pubkey = from_keypair . pubkey ( ) ; let transfer_instruction = system_instruction :: transfer ( & from_pubkey , to , lamports ) ; let instructions = vec ! [ transfer_instruction ] ; Transaction :: new_signed_instructions ( & [ from_keypair ] , instructions , recent_blockhash ) }
Create and sign new system_instruction::Transfer transaction
Create and sign new system_instruction :: Transfer transaction
from_keypair
&Keypair
to
&Pubkey
lamports
u64
recent_blockhash
Hash
from_keypair
&Keypair
to
&Pubkey
lamports
u64
recent_blockhash
Hash