use borsh::BorshDeserialize;
use borsh::BorshSerialize;
pub struct RemoveLiquiditySingleSide {
pub pool: solana_program::pubkey::Pubkey,
pub lp_mint: solana_program::pubkey::Pubkey,
pub user_pool_lp: solana_program::pubkey::Pubkey,
pub a_vault_lp: solana_program::pubkey::Pubkey,
pub b_vault_lp: solana_program::pubkey::Pubkey,
pub a_vault: solana_program::pubkey::Pubkey,
pub b_vault: solana_program::pubkey::Pubkey,
pub a_vault_lp_mint: solana_program::pubkey::Pubkey,
pub b_vault_lp_mint: solana_program::pubkey::Pubkey,
pub a_token_vault: solana_program::pubkey::Pubkey,
pub b_token_vault: solana_program::pubkey::Pubkey,
pub user_destination_token: solana_program::pubkey::Pubkey,
pub user: solana_program::pubkey::Pubkey,
pub vault_program: solana_program::pubkey::Pubkey,
pub token_program: solana_program::pubkey::Pubkey,
}
impl RemoveLiquiditySingleSide {
pub fn instruction(
&self,
args: RemoveLiquiditySingleSideInstructionArgs,
) -> solana_program::instruction::Instruction {
self.instruction_with_remaining_accounts(args, &[])
}
#[allow(clippy::vec_init_then_push)]
pub fn instruction_with_remaining_accounts(
&self,
args: RemoveLiquiditySingleSideInstructionArgs,
remaining_accounts: &[solana_program::instruction::AccountMeta],
) -> solana_program::instruction::Instruction {
let mut accounts = Vec::with_capacity(15 + remaining_accounts.len());
accounts.push(solana_program::instruction::AccountMeta::new(
self.pool, false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.lp_mint,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.user_pool_lp,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.a_vault_lp,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.b_vault_lp,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.a_vault,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.b_vault,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.a_vault_lp_mint,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.b_vault_lp_mint,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.a_token_vault,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.b_token_vault,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
self.user_destination_token,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new_readonly(
self.user, true,
));
accounts.push(solana_program::instruction::AccountMeta::new_readonly(
self.vault_program,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new_readonly(
self.token_program,
false,
));
accounts.extend_from_slice(remaining_accounts);
let mut data = RemoveLiquiditySingleSideInstructionData::new()
.try_to_vec()
.unwrap();
let mut args = args.try_to_vec().unwrap();
data.append(&mut args);
solana_program::instruction::Instruction {
program_id: crate::AMM_ID,
accounts,
data,
}
}
}
#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct RemoveLiquiditySingleSideInstructionData {
discriminator: [u8; 8],
}
impl RemoveLiquiditySingleSideInstructionData {
pub fn new() -> Self {
Self {
discriminator: [84, 84, 177, 66, 254, 185, 10, 251],
}
}
}
impl Default for RemoveLiquiditySingleSideInstructionData {
fn default() -> Self {
Self::new()
}
}
#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct RemoveLiquiditySingleSideInstructionArgs {
pub pool_token_amount: u64,
pub minimum_out_amount: u64,
}
#[derive(Clone, Debug, Default)]
pub struct RemoveLiquiditySingleSideBuilder {
pool: Option<solana_program::pubkey::Pubkey>,
lp_mint: Option<solana_program::pubkey::Pubkey>,
user_pool_lp: Option<solana_program::pubkey::Pubkey>,
a_vault_lp: Option<solana_program::pubkey::Pubkey>,
b_vault_lp: Option<solana_program::pubkey::Pubkey>,
a_vault: Option<solana_program::pubkey::Pubkey>,
b_vault: Option<solana_program::pubkey::Pubkey>,
a_vault_lp_mint: Option<solana_program::pubkey::Pubkey>,
b_vault_lp_mint: Option<solana_program::pubkey::Pubkey>,
a_token_vault: Option<solana_program::pubkey::Pubkey>,
b_token_vault: Option<solana_program::pubkey::Pubkey>,
user_destination_token: Option<solana_program::pubkey::Pubkey>,
user: Option<solana_program::pubkey::Pubkey>,
vault_program: Option<solana_program::pubkey::Pubkey>,
token_program: Option<solana_program::pubkey::Pubkey>,
pool_token_amount: Option<u64>,
minimum_out_amount: Option<u64>,
__remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
}
impl RemoveLiquiditySingleSideBuilder {
pub fn new() -> Self {
Self::default()
}
#[inline(always)]
pub fn pool(&mut self, pool: solana_program::pubkey::Pubkey) -> &mut Self {
self.pool = Some(pool);
self
}
#[inline(always)]
pub fn lp_mint(&mut self, lp_mint: solana_program::pubkey::Pubkey) -> &mut Self {
self.lp_mint = Some(lp_mint);
self
}
#[inline(always)]
pub fn user_pool_lp(&mut self, user_pool_lp: solana_program::pubkey::Pubkey) -> &mut Self {
self.user_pool_lp = Some(user_pool_lp);
self
}
#[inline(always)]
pub fn a_vault_lp(&mut self, a_vault_lp: solana_program::pubkey::Pubkey) -> &mut Self {
self.a_vault_lp = Some(a_vault_lp);
self
}
#[inline(always)]
pub fn b_vault_lp(&mut self, b_vault_lp: solana_program::pubkey::Pubkey) -> &mut Self {
self.b_vault_lp = Some(b_vault_lp);
self
}
#[inline(always)]
pub fn a_vault(&mut self, a_vault: solana_program::pubkey::Pubkey) -> &mut Self {
self.a_vault = Some(a_vault);
self
}
#[inline(always)]
pub fn b_vault(&mut self, b_vault: solana_program::pubkey::Pubkey) -> &mut Self {
self.b_vault = Some(b_vault);
self
}
#[inline(always)]
pub fn a_vault_lp_mint(
&mut self,
a_vault_lp_mint: solana_program::pubkey::Pubkey,
) -> &mut Self {
self.a_vault_lp_mint = Some(a_vault_lp_mint);
self
}
#[inline(always)]
pub fn b_vault_lp_mint(
&mut self,
b_vault_lp_mint: solana_program::pubkey::Pubkey,
) -> &mut Self {
self.b_vault_lp_mint = Some(b_vault_lp_mint);
self
}
#[inline(always)]
pub fn a_token_vault(&mut self, a_token_vault: solana_program::pubkey::Pubkey) -> &mut Self {
self.a_token_vault = Some(a_token_vault);
self
}
#[inline(always)]
pub fn b_token_vault(&mut self, b_token_vault: solana_program::pubkey::Pubkey) -> &mut Self {
self.b_token_vault = Some(b_token_vault);
self
}
#[inline(always)]
pub fn user_destination_token(
&mut self,
user_destination_token: solana_program::pubkey::Pubkey,
) -> &mut Self {
self.user_destination_token = Some(user_destination_token);
self
}
#[inline(always)]
pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self {
self.user = Some(user);
self
}
#[inline(always)]
pub fn vault_program(&mut self, vault_program: solana_program::pubkey::Pubkey) -> &mut Self {
self.vault_program = Some(vault_program);
self
}
#[inline(always)]
pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self {
self.token_program = Some(token_program);
self
}
#[inline(always)]
pub fn pool_token_amount(&mut self, pool_token_amount: u64) -> &mut Self {
self.pool_token_amount = Some(pool_token_amount);
self
}
#[inline(always)]
pub fn minimum_out_amount(&mut self, minimum_out_amount: u64) -> &mut Self {
self.minimum_out_amount = Some(minimum_out_amount);
self
}
#[inline(always)]
pub fn add_remaining_account(
&mut self,
account: solana_program::instruction::AccountMeta,
) -> &mut Self {
self.__remaining_accounts.push(account);
self
}
#[inline(always)]
pub fn add_remaining_accounts(
&mut self,
accounts: &[solana_program::instruction::AccountMeta],
) -> &mut Self {
self.__remaining_accounts.extend_from_slice(accounts);
self
}
#[allow(clippy::clone_on_copy)]
pub fn instruction(&self) -> solana_program::instruction::Instruction {
let accounts = RemoveLiquiditySingleSide {
pool: self.pool.expect("pool is not set"),
lp_mint: self.lp_mint.expect("lp_mint is not set"),
user_pool_lp: self.user_pool_lp.expect("user_pool_lp is not set"),
a_vault_lp: self.a_vault_lp.expect("a_vault_lp is not set"),
b_vault_lp: self.b_vault_lp.expect("b_vault_lp is not set"),
a_vault: self.a_vault.expect("a_vault is not set"),
b_vault: self.b_vault.expect("b_vault is not set"),
a_vault_lp_mint: self.a_vault_lp_mint.expect("a_vault_lp_mint is not set"),
b_vault_lp_mint: self.b_vault_lp_mint.expect("b_vault_lp_mint is not set"),
a_token_vault: self.a_token_vault.expect("a_token_vault is not set"),
b_token_vault: self.b_token_vault.expect("b_token_vault is not set"),
user_destination_token: self
.user_destination_token
.expect("user_destination_token is not set"),
user: self.user.expect("user is not set"),
vault_program: self.vault_program.expect("vault_program is not set"),
token_program: self.token_program.unwrap_or(solana_program::pubkey!(
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
)),
};
let args = RemoveLiquiditySingleSideInstructionArgs {
pool_token_amount: self
.pool_token_amount
.clone()
.expect("pool_token_amount is not set"),
minimum_out_amount: self
.minimum_out_amount
.clone()
.expect("minimum_out_amount is not set"),
};
accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
}
}
pub struct RemoveLiquiditySingleSideCpiAccounts<'a, 'b> {
pub pool: &'b solana_program::account_info::AccountInfo<'a>,
pub lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
pub user_pool_lp: &'b solana_program::account_info::AccountInfo<'a>,
pub a_vault_lp: &'b solana_program::account_info::AccountInfo<'a>,
pub b_vault_lp: &'b solana_program::account_info::AccountInfo<'a>,
pub a_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub b_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub a_vault_lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
pub b_vault_lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
pub a_token_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub b_token_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub user_destination_token: &'b solana_program::account_info::AccountInfo<'a>,
pub user: &'b solana_program::account_info::AccountInfo<'a>,
pub vault_program: &'b solana_program::account_info::AccountInfo<'a>,
pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
}
pub struct RemoveLiquiditySingleSideCpi<'a, 'b> {
pub __program: &'b solana_program::account_info::AccountInfo<'a>,
pub pool: &'b solana_program::account_info::AccountInfo<'a>,
pub lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
pub user_pool_lp: &'b solana_program::account_info::AccountInfo<'a>,
pub a_vault_lp: &'b solana_program::account_info::AccountInfo<'a>,
pub b_vault_lp: &'b solana_program::account_info::AccountInfo<'a>,
pub a_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub b_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub a_vault_lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
pub b_vault_lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
pub a_token_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub b_token_vault: &'b solana_program::account_info::AccountInfo<'a>,
pub user_destination_token: &'b solana_program::account_info::AccountInfo<'a>,
pub user: &'b solana_program::account_info::AccountInfo<'a>,
pub vault_program: &'b solana_program::account_info::AccountInfo<'a>,
pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
pub __args: RemoveLiquiditySingleSideInstructionArgs,
}
impl<'a, 'b> RemoveLiquiditySingleSideCpi<'a, 'b> {
pub fn new(
program: &'b solana_program::account_info::AccountInfo<'a>,
accounts: RemoveLiquiditySingleSideCpiAccounts<'a, 'b>,
args: RemoveLiquiditySingleSideInstructionArgs,
) -> Self {
Self {
__program: program,
pool: accounts.pool,
lp_mint: accounts.lp_mint,
user_pool_lp: accounts.user_pool_lp,
a_vault_lp: accounts.a_vault_lp,
b_vault_lp: accounts.b_vault_lp,
a_vault: accounts.a_vault,
b_vault: accounts.b_vault,
a_vault_lp_mint: accounts.a_vault_lp_mint,
b_vault_lp_mint: accounts.b_vault_lp_mint,
a_token_vault: accounts.a_token_vault,
b_token_vault: accounts.b_token_vault,
user_destination_token: accounts.user_destination_token,
user: accounts.user,
vault_program: accounts.vault_program,
token_program: accounts.token_program,
__args: args,
}
}
#[inline(always)]
pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
self.invoke_signed_with_remaining_accounts(&[], &[])
}
#[inline(always)]
pub fn invoke_with_remaining_accounts(
&self,
remaining_accounts: &[(
&'b solana_program::account_info::AccountInfo<'a>,
bool,
bool,
)],
) -> solana_program::entrypoint::ProgramResult {
self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
}
#[inline(always)]
pub fn invoke_signed(
&self,
signers_seeds: &[&[&[u8]]],
) -> solana_program::entrypoint::ProgramResult {
self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
}
#[allow(clippy::clone_on_copy)]
#[allow(clippy::vec_init_then_push)]
pub fn invoke_signed_with_remaining_accounts(
&self,
signers_seeds: &[&[&[u8]]],
remaining_accounts: &[(
&'b solana_program::account_info::AccountInfo<'a>,
bool,
bool,
)],
) -> solana_program::entrypoint::ProgramResult {
let mut accounts = Vec::with_capacity(15 + remaining_accounts.len());
accounts.push(solana_program::instruction::AccountMeta::new(
*self.pool.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.lp_mint.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.user_pool_lp.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.a_vault_lp.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.b_vault_lp.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.a_vault.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.b_vault.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.a_vault_lp_mint.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.b_vault_lp_mint.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.a_token_vault.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.b_token_vault.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new(
*self.user_destination_token.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new_readonly(
*self.user.key,
true,
));
accounts.push(solana_program::instruction::AccountMeta::new_readonly(
*self.vault_program.key,
false,
));
accounts.push(solana_program::instruction::AccountMeta::new_readonly(
*self.token_program.key,
false,
));
remaining_accounts.iter().for_each(|remaining_account| {
accounts.push(solana_program::instruction::AccountMeta {
pubkey: *remaining_account.0.key,
is_signer: remaining_account.1,
is_writable: remaining_account.2,
})
});
let mut data = RemoveLiquiditySingleSideInstructionData::new()
.try_to_vec()
.unwrap();
let mut args = self.__args.try_to_vec().unwrap();
data.append(&mut args);
let instruction = solana_program::instruction::Instruction {
program_id: crate::AMM_ID,
accounts,
data,
};
let mut account_infos = Vec::with_capacity(16 + remaining_accounts.len());
account_infos.push(self.__program.clone());
account_infos.push(self.pool.clone());
account_infos.push(self.lp_mint.clone());
account_infos.push(self.user_pool_lp.clone());
account_infos.push(self.a_vault_lp.clone());
account_infos.push(self.b_vault_lp.clone());
account_infos.push(self.a_vault.clone());
account_infos.push(self.b_vault.clone());
account_infos.push(self.a_vault_lp_mint.clone());
account_infos.push(self.b_vault_lp_mint.clone());
account_infos.push(self.a_token_vault.clone());
account_infos.push(self.b_token_vault.clone());
account_infos.push(self.user_destination_token.clone());
account_infos.push(self.user.clone());
account_infos.push(self.vault_program.clone());
account_infos.push(self.token_program.clone());
remaining_accounts
.iter()
.for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
if signers_seeds.is_empty() {
solana_program::program::invoke(&instruction, &account_infos)
} else {
solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds)
}
}
}
#[derive(Clone, Debug)]
pub struct RemoveLiquiditySingleSideCpiBuilder<'a, 'b> {
instruction: Box<RemoveLiquiditySingleSideCpiBuilderInstruction<'a, 'b>>,
}
impl<'a, 'b> RemoveLiquiditySingleSideCpiBuilder<'a, 'b> {
pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
let instruction = Box::new(RemoveLiquiditySingleSideCpiBuilderInstruction {
__program: program,
pool: None,
lp_mint: None,
user_pool_lp: None,
a_vault_lp: None,
b_vault_lp: None,
a_vault: None,
b_vault: None,
a_vault_lp_mint: None,
b_vault_lp_mint: None,
a_token_vault: None,
b_token_vault: None,
user_destination_token: None,
user: None,
vault_program: None,
token_program: None,
pool_token_amount: None,
minimum_out_amount: None,
__remaining_accounts: Vec::new(),
});
Self { instruction }
}
#[inline(always)]
pub fn pool(&mut self, pool: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
self.instruction.pool = Some(pool);
self
}
#[inline(always)]
pub fn lp_mint(
&mut self,
lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.lp_mint = Some(lp_mint);
self
}
#[inline(always)]
pub fn user_pool_lp(
&mut self,
user_pool_lp: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.user_pool_lp = Some(user_pool_lp);
self
}
#[inline(always)]
pub fn a_vault_lp(
&mut self,
a_vault_lp: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.a_vault_lp = Some(a_vault_lp);
self
}
#[inline(always)]
pub fn b_vault_lp(
&mut self,
b_vault_lp: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.b_vault_lp = Some(b_vault_lp);
self
}
#[inline(always)]
pub fn a_vault(
&mut self,
a_vault: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.a_vault = Some(a_vault);
self
}
#[inline(always)]
pub fn b_vault(
&mut self,
b_vault: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.b_vault = Some(b_vault);
self
}
#[inline(always)]
pub fn a_vault_lp_mint(
&mut self,
a_vault_lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.a_vault_lp_mint = Some(a_vault_lp_mint);
self
}
#[inline(always)]
pub fn b_vault_lp_mint(
&mut self,
b_vault_lp_mint: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.b_vault_lp_mint = Some(b_vault_lp_mint);
self
}
#[inline(always)]
pub fn a_token_vault(
&mut self,
a_token_vault: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.a_token_vault = Some(a_token_vault);
self
}
#[inline(always)]
pub fn b_token_vault(
&mut self,
b_token_vault: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.b_token_vault = Some(b_token_vault);
self
}
#[inline(always)]
pub fn user_destination_token(
&mut self,
user_destination_token: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.user_destination_token = Some(user_destination_token);
self
}
#[inline(always)]
pub fn user(&mut self, user: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
self.instruction.user = Some(user);
self
}
#[inline(always)]
pub fn vault_program(
&mut self,
vault_program: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.vault_program = Some(vault_program);
self
}
#[inline(always)]
pub fn token_program(
&mut self,
token_program: &'b solana_program::account_info::AccountInfo<'a>,
) -> &mut Self {
self.instruction.token_program = Some(token_program);
self
}
#[inline(always)]
pub fn pool_token_amount(&mut self, pool_token_amount: u64) -> &mut Self {
self.instruction.pool_token_amount = Some(pool_token_amount);
self
}
#[inline(always)]
pub fn minimum_out_amount(&mut self, minimum_out_amount: u64) -> &mut Self {
self.instruction.minimum_out_amount = Some(minimum_out_amount);
self
}
#[inline(always)]
pub fn add_remaining_account(
&mut self,
account: &'b solana_program::account_info::AccountInfo<'a>,
is_writable: bool,
is_signer: bool,
) -> &mut Self {
self.instruction
.__remaining_accounts
.push((account, is_writable, is_signer));
self
}
#[inline(always)]
pub fn add_remaining_accounts(
&mut self,
accounts: &[(
&'b solana_program::account_info::AccountInfo<'a>,
bool,
bool,
)],
) -> &mut Self {
self.instruction
.__remaining_accounts
.extend_from_slice(accounts);
self
}
#[inline(always)]
pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
self.invoke_signed(&[])
}
#[allow(clippy::clone_on_copy)]
#[allow(clippy::vec_init_then_push)]
pub fn invoke_signed(
&self,
signers_seeds: &[&[&[u8]]],
) -> solana_program::entrypoint::ProgramResult {
let args = RemoveLiquiditySingleSideInstructionArgs {
pool_token_amount: self
.instruction
.pool_token_amount
.clone()
.expect("pool_token_amount is not set"),
minimum_out_amount: self
.instruction
.minimum_out_amount
.clone()
.expect("minimum_out_amount is not set"),
};
let instruction = RemoveLiquiditySingleSideCpi {
__program: self.instruction.__program,
pool: self.instruction.pool.expect("pool is not set"),
lp_mint: self.instruction.lp_mint.expect("lp_mint is not set"),
user_pool_lp: self
.instruction
.user_pool_lp
.expect("user_pool_lp is not set"),
a_vault_lp: self.instruction.a_vault_lp.expect("a_vault_lp is not set"),
b_vault_lp: self.instruction.b_vault_lp.expect("b_vault_lp is not set"),
a_vault: self.instruction.a_vault.expect("a_vault is not set"),
b_vault: self.instruction.b_vault.expect("b_vault is not set"),
a_vault_lp_mint: self
.instruction
.a_vault_lp_mint
.expect("a_vault_lp_mint is not set"),
b_vault_lp_mint: self
.instruction
.b_vault_lp_mint
.expect("b_vault_lp_mint is not set"),
a_token_vault: self
.instruction
.a_token_vault
.expect("a_token_vault is not set"),
b_token_vault: self
.instruction
.b_token_vault
.expect("b_token_vault is not set"),
user_destination_token: self
.instruction
.user_destination_token
.expect("user_destination_token is not set"),
user: self.instruction.user.expect("user is not set"),
vault_program: self
.instruction
.vault_program
.expect("vault_program is not set"),
token_program: self
.instruction
.token_program
.expect("token_program is not set"),
__args: args,
};
instruction.invoke_signed_with_remaining_accounts(
signers_seeds,
&self.instruction.__remaining_accounts,
)
}
}
#[derive(Clone, Debug)]
struct RemoveLiquiditySingleSideCpiBuilderInstruction<'a, 'b> {
__program: &'b solana_program::account_info::AccountInfo<'a>,
pool: Option<&'b solana_program::account_info::AccountInfo<'a>>,
lp_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
user_pool_lp: Option<&'b solana_program::account_info::AccountInfo<'a>>,
a_vault_lp: Option<&'b solana_program::account_info::AccountInfo<'a>>,
b_vault_lp: Option<&'b solana_program::account_info::AccountInfo<'a>>,
a_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
b_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
a_vault_lp_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
b_vault_lp_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
a_token_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
b_token_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
user_destination_token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
user: Option<&'b solana_program::account_info::AccountInfo<'a>>,
vault_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
pool_token_amount: Option<u64>,
minimum_out_amount: Option<u64>,
__remaining_accounts: Vec<(
&'b solana_program::account_info::AccountInfo<'a>,
bool,
bool,
)>,
}