pub fn new_instruction_init_vault(
        &self,
        admin_address: &Pubkey,
        vault_name: &str,
        step: u64,
    ) -> Result<Instruction, FarmClientError> {
        // get vault info
        let vault = self.get_vault(vault_name)?;

        // fill in accounts and instruction data
        let (accounts, data) = match vault.strategy {
            VaultStrategy::StakeLpCompoundRewards { pool_id_ref, .. } => {
                let pool = self.get_pool_by_ref(&pool_id_ref)?;
                match pool.route {
                    PoolRoute::Raydium { .. } => {
                        self.get_stc_init_accounts_raydium(admin_address, vault_name, step)
                    }
                    PoolRoute::Saber { .. } => {
                        self.get_stc_init_accounts_saber(admin_address, vault_name, step)
                    }
                    _ => unreachable!(),
                }
            }
            _ => {
                unreachable!()
            }
        }?;

        Ok(Instruction {
            program_id: vault.vault_program_id,
            data,
            accounts,
        })
    }
/// Creates a new Vault Init Instruction
Creates a new Vault Init Instruction
Creates a new Vault Init Instruction
pub fn new_instruction_init_vault(
        &self,
        admin_address: &Pubkey,
        vault_name: &str,
        step: u64,
    ) -> Result<Instruction, FarmClientError> {
        // get vault info
        let vault = self.get_vault(vault_name)?;
        // fill in accounts and instruction data
        let (accounts, data) = match vault.strategy {
            VaultStrategy::StakeLpCompoundRewards { pool_id_ref, .. } => {
                let pool = self.get_pool_by_ref(&pool_id_ref)?;
                match pool.route {
                    PoolRoute::Raydium { .. } => {
                        self.get_stc_init_accounts_raydium(admin_address, vault_name, step)
                    }
                    PoolRoute::Saber { .. } => {
                        self.get_stc_init_accounts_saber(admin_address, vault_name, step)
                    }
                    _ => unreachable!(),
                }
            }
            _ => {
                unreachable!()
            }
        }?;
        Ok(Instruction {
            program_id: vault.vault_program_id,
            data,
            accounts,
        })
    }
pub fn new_instruction_init_vault ( & self , admin_address : & Pubkey , vault_name : & str , step : u64 , ) -> Result < Instruction , FarmClientError > { // get vault info let vault = self . get_vault ( vault_name ) ? ; // fill in accounts and instruction data let ( accounts , data ) = match vault . strategy { VaultStrategy :: StakeLpCompoundRewards { pool_id_ref , .. } => { let pool = self . get_pool_by_ref ( & pool_id_ref ) ? ; match pool . route { PoolRoute :: Raydium { .. } => { self . get_stc_init_accounts_raydium ( admin_address , vault_name , step ) } PoolRoute :: Saber { .. } => { self . get_stc_init_accounts_saber ( admin_address , vault_name , step ) } _ => unreachable ! ( ) , } } _ => { unreachable ! ( ) } } ? ; Ok ( Instruction { program_id : vault . vault_program_id , data , accounts , } ) }
Creates a new Vault Init Instruction
Creates a new Vault Init Instruction
&self
admin_address
&Pubkey
vault_name
&str
step
u64
&self
admin_address
&Pubkey
vault_name
&str
step
u64