pub fn stake(
        &self,
        signer: &dyn Signer,
        farm_name: &str,
        ui_amount: f64,
    ) -> Result<Signature, FarmClientError> {
        let mut inst = Vec::<Instruction>::new();
        let mut signers = Vec::<Box<dyn Signer>>::new();
        let _ = self.check_farm_accounts(signer, farm_name, ui_amount, &mut inst, &mut signers)?;
        inst.push(self.new_instruction_stake(&signer.pubkey(), farm_name, ui_amount)?);

        let mut unboxed_signers: Vec<&dyn Signer> = vec![signer];
        unboxed_signers.append(&mut signers.iter().map(|x| x.as_ref()).collect());
        self.sign_and_send_instructions(&unboxed_signers, inst.as_slice())
    }
/// Stakes tokens to the Farm.
/// If the amount is set to zero entire LP tokens balance will be staked.
Stakes tokens to the Farm.
If the amount is set to zero entire LP tokens balance will be staked.
Stakes tokens to the Farm . If the amount is set to zero entire LP tokens balance will be staked .
pub fn stake(
        &self,
        signer: &dyn Signer,
        farm_name: &str,
        ui_amount: f64,
    ) -> Result<Signature, FarmClientError> {
        let mut inst = Vec::<Instruction>::new();
        let mut signers = Vec::<Box<dyn Signer>>::new();
        let _ = self.check_farm_accounts(signer, farm_name, ui_amount, &mut inst, &mut signers)?;
        inst.push(self.new_instruction_stake(&signer.pubkey(), farm_name, ui_amount)?);
        let mut unboxed_signers: Vec<&dyn Signer> = vec![signer];
        unboxed_signers.append(&mut signers.iter().map(|x| x.as_ref()).collect());
        self.sign_and_send_instructions(&unboxed_signers, inst.as_slice())
    }
pub fn stake ( & self , signer : & dyn Signer , farm_name : & str , ui_amount : f64 , ) -> Result < Signature , FarmClientError > { let mut inst = Vec :: < Instruction > :: new ( ) ; let mut signers = Vec :: < Box < dyn Signer > > :: new ( ) ; let _ = self . check_farm_accounts ( signer , farm_name , ui_amount , & mut inst , & mut signers ) ? ; inst . push ( self . new_instruction_stake ( & signer . pubkey ( ) , farm_name , ui_amount ) ? ) ; let mut unboxed_signers : Vec < & dyn Signer > = vec ! [ signer ] ; unboxed_signers . append ( & mut signers . iter ( ) . map ( | x | x . as_ref ( ) ) . collect ( ) ) ; self . sign_and_send_instructions ( & unboxed_signers , inst . as_slice ( ) ) }
Stakes tokens to the Farm.
Stakes tokens to the Farm .
&self
signer
&dyn Signer
farm_name
&str
ui_amount
f64
&self
signer
&dyn Signer
farm_name
&str
ui_amount
f64