pub fn transfer_sol_to_wsol(
        &self,
        signer: &dyn Signer,
        sol_ui_amount: f64,
    ) -> Result<Signature, FarmClientError> {
        let target_account = self.get_associated_token_address(&signer.pubkey(), "SOL")?;
        let mut inst = Vec::<Instruction>::new();
        if !self.has_active_token_account(&signer.pubkey(), "SOL") {
            inst.push(self.new_instruction_create_token_account(&signer.pubkey(), "SOL")?);
        }
        inst.push(self.new_instruction_transfer(
            &signer.pubkey(),
            &target_account,
            sol_ui_amount,
        )?);
        self.sign_and_send_instructions(&[signer], inst.as_slice())
    }
/// Transfers native SOL from the wallet to the associated Wrapped SOL account.
Transfers native SOL from the wallet to the associated Wrapped SOL account.
Transfers native SOL from the wallet to the associated Wrapped SOL account .
pub fn transfer_sol_to_wsol(
        &self,
        signer: &dyn Signer,
        sol_ui_amount: f64,
    ) -> Result<Signature, FarmClientError> {
        let target_account = self.get_associated_token_address(&signer.pubkey(), "SOL")?;
        let mut inst = Vec::<Instruction>::new();
        if !self.has_active_token_account(&signer.pubkey(), "SOL") {
            inst.push(self.new_instruction_create_token_account(&signer.pubkey(), "SOL")?);
        }
        inst.push(self.new_instruction_transfer(
            &signer.pubkey(),
            &target_account,
            sol_ui_amount,
        )?);
        self.sign_and_send_instructions(&[signer], inst.as_slice())
    }
pub fn transfer_sol_to_wsol ( & self , signer : & dyn Signer , sol_ui_amount : f64 , ) -> Result < Signature , FarmClientError > { let target_account = self . get_associated_token_address ( & signer . pubkey ( ) , " " ) ? ; let mut inst = Vec :: < Instruction > :: new ( ) ; if ! self . has_active_token_account ( & signer . pubkey ( ) , " " ) { inst . push ( self . new_instruction_create_token_account ( & signer . pubkey ( ) , " " ) ? ) ; } inst . push ( self . new_instruction_transfer ( & signer . pubkey ( ) , & target_account , sol_ui_amount , ) ? ) ; self . sign_and_send_instructions ( & [ signer ] , inst . as_slice ( ) ) }
Transfers native SOL from the wallet to the associated Wrapped SOL account.
Transfers native SOL from the wallet to the associated Wrapped SOL account .
&self
signer
&dyn Signer
sol_ui_amount
f64
&self
signer
&dyn Signer
sol_ui_amount
f64