Browse Source

refactor(renderers-rust): extract `solana-instruction` from `solana-program` (#641)

Sonic 5 months ago
parent
commit
dbeea5302d
100 changed files with 236 additions and 30667 deletions
  1. 5 0
      .changeset/cyan-boxes-hunt.md
  2. 1 0
      packages/renderers-rust/e2e/anchor/Cargo.lock
  3. 1 0
      packages/renderers-rust/e2e/anchor/Cargo.toml
  4. 26 47
      packages/renderers-rust/e2e/anchor/src/generated/instructions/create_guard.rs
  5. 24 30
      packages/renderers-rust/e2e/anchor/src/generated/instructions/execute.rs
  6. 22 30
      packages/renderers-rust/e2e/anchor/src/generated/instructions/initialize.rs
  7. 22 33
      packages/renderers-rust/e2e/anchor/src/generated/instructions/update_guard.rs
  8. 1 0
      packages/renderers-rust/e2e/dummy/Cargo.lock
  9. 1 0
      packages/renderers-rust/e2e/dummy/Cargo.toml
  10. 10 13
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction1.rs
  11. 10 13
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction2.rs
  12. 10 13
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction3.rs
  13. 10 13
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction4.rs
  14. 10 13
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction5.rs
  15. 12 18
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction6.rs
  16. 14 22
      packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction7.rs
  17. 1 0
      packages/renderers-rust/e2e/memo/Cargo.lock
  18. 1 0
      packages/renderers-rust/e2e/memo/Cargo.toml
  19. 10 16
      packages/renderers-rust/e2e/memo/src/generated/instructions/add_memo.rs
  20. 1 0
      packages/renderers-rust/e2e/meteora/Cargo.toml
  21. 0 79
      packages/renderers-rust/e2e/meteora/src/generated/accounts/bin_array.rs
  22. 0 71
      packages/renderers-rust/e2e/meteora/src/generated/accounts/bin_array_bitmap_extension.rs
  23. 0 157
      packages/renderers-rust/e2e/meteora/src/generated/accounts/lb_pair.rs
  24. 0 22
      packages/renderers-rust/e2e/meteora/src/generated/accounts/mod.rs
  25. 0 67
      packages/renderers-rust/e2e/meteora/src/generated/accounts/oracle.rs
  26. 0 100
      packages/renderers-rust/e2e/meteora/src/generated/accounts/position.rs
  27. 0 116
      packages/renderers-rust/e2e/meteora/src/generated/accounts/position_v2.rs
  28. 0 81
      packages/renderers-rust/e2e/meteora/src/generated/accounts/preset_parameter.rs
  29. 0 223
      packages/renderers-rust/e2e/meteora/src/generated/errors/lb_clmm.rs
  30. 0 10
      packages/renderers-rust/e2e/meteora/src/generated/errors/mod.rs
  31. 0 1000
      packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity.rs
  32. 0 1041
      packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_by_strategy.rs
  33. 0 851
      packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_by_strategy_one_side.rs
  34. 0 1047
      packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_by_weight.rs
  35. 0 857
      packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_one_side.rs
  36. 0 808
      packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_one_side_precise.rs
  37. 0 807
      packages/renderers-rust/e2e/meteora/src/generated/instructions/claim_fee.rs
  38. 0 740
      packages/renderers-rust/e2e/meteora/src/generated/instructions/claim_reward.rs
  39. 0 570
      packages/renderers-rust/e2e/meteora/src/generated/instructions/close_position.rs
  40. 0 373
      packages/renderers-rust/e2e/meteora/src/generated/instructions/close_preset_parameter.rs
  41. 0 693
      packages/renderers-rust/e2e/meteora/src/generated/instructions/fund_reward.rs
  42. 0 582
      packages/renderers-rust/e2e/meteora/src/generated/instructions/go_to_a_bin.rs
  43. 0 499
      packages/renderers-rust/e2e/meteora/src/generated/instructions/increase_oracle_length.rs
  44. 0 449
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_bin_array.rs
  45. 0 457
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_bin_array_bitmap_extension.rs
  46. 0 990
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_customizable_permissionless_lb_pair.rs
  47. 0 883
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_lb_pair.rs
  48. 0 956
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_permission_lb_pair.rs
  49. 0 614
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_position.rs
  50. 0 777
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_position_by_operator.rs
  51. 0 649
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_position_pda.rs
  52. 0 649
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_preset_parameter.rs
  53. 0 687
      packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_reward.rs
  54. 0 290
      packages/renderers-rust/e2e/meteora/src/generated/instructions/migrate_bin_array.rs
  55. 0 652
      packages/renderers-rust/e2e/meteora/src/generated/instructions/migrate_position.rs
  56. 0 92
      packages/renderers-rust/e2e/meteora/src/generated/instructions/mod.rs
  57. 0 912
      packages/renderers-rust/e2e/meteora/src/generated/instructions/remove_all_liquidity.rs
  58. 0 960
      packages/renderers-rust/e2e/meteora/src/generated/instructions/remove_liquidity.rs
  59. 0 997
      packages/renderers-rust/e2e/meteora/src/generated/instructions/remove_liquidity_by_range.rs
  60. 0 372
      packages/renderers-rust/e2e/meteora/src/generated/instructions/set_activation_point.rs
  61. 0 376
      packages/renderers-rust/e2e/meteora/src/generated/instructions/set_pre_activation_duration.rs
  62. 0 383
      packages/renderers-rust/e2e/meteora/src/generated/instructions/set_pre_activation_swap_address.rs
  63. 0 941
      packages/renderers-rust/e2e/meteora/src/generated/instructions/swap.rs
  64. 0 941
      packages/renderers-rust/e2e/meteora/src/generated/instructions/swap_exact_out.rs
  65. 0 963
      packages/renderers-rust/e2e/meteora/src/generated/instructions/swap_with_price_impact.rs
  66. 0 323
      packages/renderers-rust/e2e/meteora/src/generated/instructions/toggle_pair_status.rs
  67. 0 472
      packages/renderers-rust/e2e/meteora/src/generated/instructions/update_fee_parameters.rs
  68. 0 450
      packages/renderers-rust/e2e/meteora/src/generated/instructions/update_fees_and_rewards.rs
  69. 0 450
      packages/renderers-rust/e2e/meteora/src/generated/instructions/update_position_operator.rs
  70. 0 506
      packages/renderers-rust/e2e/meteora/src/generated/instructions/update_reward_duration.rs
  71. 0 470
      packages/renderers-rust/e2e/meteora/src/generated/instructions/update_reward_funder.rs
  72. 0 658
      packages/renderers-rust/e2e/meteora/src/generated/instructions/withdraw_ineligible_reward.rs
  73. 0 682
      packages/renderers-rust/e2e/meteora/src/generated/instructions/withdraw_protocol_fee.rs
  74. 0 14
      packages/renderers-rust/e2e/meteora/src/generated/mod.rs
  75. 0 11
      packages/renderers-rust/e2e/meteora/src/generated/programs.rs
  76. 0 29
      packages/renderers-rust/e2e/meteora/src/generated/types/activation_type.rs
  77. 0 32
      packages/renderers-rust/e2e/meteora/src/generated/types/bin.rs
  78. 0 20
      packages/renderers-rust/e2e/meteora/src/generated/types/bin_liquidity_distribution.rs
  79. 0 18
      packages/renderers-rust/e2e/meteora/src/generated/types/bin_liquidity_distribution_by_weight.rs
  80. 0 16
      packages/renderers-rust/e2e/meteora/src/generated/types/bin_liquidity_reduction.rs
  81. 0 16
      packages/renderers-rust/e2e/meteora/src/generated/types/compressed_bin_deposit_amount.rs
  82. 0 18
      packages/renderers-rust/e2e/meteora/src/generated/types/fee_info.rs
  83. 0 29
      packages/renderers-rust/e2e/meteora/src/generated/types/layout_version.rs
  84. 0 46
      packages/renderers-rust/e2e/meteora/src/generated/types/mod.rs
  85. 0 20
      packages/renderers-rust/e2e/meteora/src/generated/types/observation.rs
  86. 0 29
      packages/renderers-rust/e2e/meteora/src/generated/types/pair_status.rs
  87. 0 30
      packages/renderers-rust/e2e/meteora/src/generated/types/pair_type.rs
  88. 0 16
      packages/renderers-rust/e2e/meteora/src/generated/types/protocol_fee.rs
  89. 0 44
      packages/renderers-rust/e2e/meteora/src/generated/types/reward_info.rs
  90. 0 28
      packages/renderers-rust/e2e/meteora/src/generated/types/rounding.rs
  91. 0 35
      packages/renderers-rust/e2e/meteora/src/generated/types/static_parameters.rs
  92. 0 24
      packages/renderers-rust/e2e/meteora/src/generated/types/strategy_parameters.rs
  93. 0 35
      packages/renderers-rust/e2e/meteora/src/generated/types/strategy_type.rs
  94. 0 16
      packages/renderers-rust/e2e/meteora/src/generated/types/user_reward_info.rs
  95. 0 28
      packages/renderers-rust/e2e/meteora/src/generated/types/variable_parameters.rs
  96. 1 0
      packages/renderers-rust/e2e/system/Cargo.lock
  97. 1 0
      packages/renderers-rust/e2e/system/Cargo.toml
  98. 16 19
      packages/renderers-rust/e2e/system/src/generated/instructions/advance_nonce_account.rs
  99. 12 21
      packages/renderers-rust/e2e/system/src/generated/instructions/allocate.rs
  100. 14 17
      packages/renderers-rust/e2e/system/src/generated/instructions/allocate_with_seed.rs

+ 5 - 0
.changeset/cyan-boxes-hunt.md

@@ -0,0 +1,5 @@
+---
+"@codama/renderers-rust": minor
+---
+
+Extract `solana-instruction` from `solana-program`

+ 1 - 0
packages/renderers-rust/e2e/anchor/Cargo.lock

@@ -1009,6 +1009,7 @@ dependencies = [
  "serde",
  "serde_with 3.12.0",
  "solana-client",
+ "solana-instruction",
  "solana-program 2.2.1",
  "solana-pubkey",
  "solana-sdk 1.18.26",

+ 1 - 0
packages/renderers-rust/e2e/anchor/Cargo.toml

@@ -19,6 +19,7 @@ num-traits = "^0.2"
 serde = { version = "^1.0", features = ["derive"], optional = true }
 serde_with = { version = "^3.0", optional = true }
 solana-program = "2.2.1"
+solana-instruction = "2.2.1"
 solana-pubkey = { version = "2.2.1", features = ["curve25519"] }
 solana-client = { version = "~1.18", optional = true }
 solana-sdk = { version = "~1.18", optional = true }

+ 26 - 47
packages/renderers-rust/e2e/anchor/src/generated/instructions/create_guard.rs

@@ -32,10 +32,7 @@ pub struct CreateGuard {
 }
 
 impl CreateGuard {
-    pub fn instruction(
-        &self,
-        args: CreateGuardInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self, args: CreateGuardInstructionArgs) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -43,35 +40,29 @@ impl CreateGuard {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: CreateGuardInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(8 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.guard, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.mint, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(self.guard, false));
+        accounts.push(solana_instruction::AccountMeta::new(self.mint, true));
+        accounts.push(solana_instruction::AccountMeta::new(
             self.mint_token_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.guard_authority,
             true,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.payer, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new(self.payer, true));
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.associated_token_program,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.token_program,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.system_program,
             false,
         ));
@@ -80,7 +71,7 @@ impl CreateGuard {
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,
@@ -147,7 +138,7 @@ pub struct CreateGuardBuilder {
     cpi_rule: Option<CpiRule>,
     transfer_amount_rule: Option<TransferAmountRule>,
     additional_fields_rule: Option<Vec<MetadataAdditionalFieldRule>>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl CreateGuardBuilder {
@@ -237,10 +228,7 @@ impl CreateGuardBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -248,13 +236,13 @@ impl CreateGuardBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = CreateGuard {
             guard: self.guard.expect("guard is not set"),
             mint: self.mint.expect("mint is not set"),
@@ -386,40 +374,31 @@ impl<'a, 'b> CreateGuardCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(8 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.guard.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.mint.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(*self.guard.key, false));
+        accounts.push(solana_instruction::AccountMeta::new(*self.mint.key, true));
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.mint_token_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.guard_authority.key,
             true,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.payer.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new(*self.payer.key, true));
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.associated_token_program.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.token_program.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.system_program.key,
             false,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -429,7 +408,7 @@ impl<'a, 'b> CreateGuardCpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,

+ 24 - 30
packages/renderers-rust/e2e/anchor/src/generated/instructions/execute.rs

@@ -27,10 +27,7 @@ pub struct Execute {
 }
 
 impl Execute {
-    pub fn instruction(
-        &self,
-        args: ExecuteInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self, args: ExecuteInstructionArgs) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -38,32 +35,32 @@ impl Execute {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: ExecuteInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(7 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.source_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.mint, false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.destination_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.owner_delegate,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.extra_metas_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.guard, false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.instruction_sysvar_account,
             false,
         ));
@@ -72,7 +69,7 @@ impl Execute {
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,
@@ -127,7 +124,7 @@ pub struct ExecuteBuilder {
     guard: Option<solana_pubkey::Pubkey>,
     instruction_sysvar_account: Option<solana_pubkey::Pubkey>,
     amount: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl ExecuteBuilder {
@@ -180,10 +177,7 @@ impl ExecuteBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -191,13 +185,13 @@ impl ExecuteBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Execute {
             source_account: self.source_account.expect("source_account is not set"),
             mint: self.mint.expect("mint is not set"),
@@ -313,36 +307,36 @@ impl<'a, 'b> ExecuteCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(7 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.source_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.mint.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.destination_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.owner_delegate.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.extra_metas_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.guard.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.instruction_sysvar_account.key,
             false,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -352,7 +346,7 @@ impl<'a, 'b> ExecuteCpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,

+ 22 - 30
packages/renderers-rust/e2e/anchor/src/generated/instructions/initialize.rs

@@ -25,41 +25,39 @@ pub struct Initialize {
 }
 
 impl Initialize {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(6 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             self.extra_metas_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.guard, false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.mint, false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             self.transfer_hook_authority,
             true,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.system_program,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.payer, true,
-        ));
+        accounts.push(solana_instruction::AccountMeta::new(self.payer, true));
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&InitializeInstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,
@@ -105,7 +103,7 @@ pub struct InitializeBuilder {
     transfer_hook_authority: Option<solana_pubkey::Pubkey>,
     system_program: Option<solana_pubkey::Pubkey>,
     payer: Option<solana_pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl InitializeBuilder {
@@ -148,10 +146,7 @@ impl InitializeBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -159,13 +154,13 @@ impl InitializeBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Initialize {
             extra_metas_account: self
                 .extra_metas_account
@@ -268,32 +263,29 @@ impl<'a, 'b> InitializeCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(6 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.extra_metas_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.guard.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.mint.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.transfer_hook_authority.key,
             true,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.system_program.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.payer.key,
-            true,
-        ));
+        accounts.push(solana_instruction::AccountMeta::new(*self.payer.key, true));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -301,7 +293,7 @@ impl<'a, 'b> InitializeCpi<'a, 'b> {
         });
         let data = borsh::to_vec(&InitializeInstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,

+ 22 - 33
packages/renderers-rust/e2e/anchor/src/generated/instructions/update_guard.rs

@@ -28,10 +28,7 @@ pub struct UpdateGuard {
 }
 
 impl UpdateGuard {
-    pub fn instruction(
-        &self,
-        args: UpdateGuardInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self, args: UpdateGuardInstructionArgs) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -39,28 +36,26 @@ impl UpdateGuard {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: UpdateGuardInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(6 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.guard, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new(self.guard, false));
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.mint, false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.token_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.guard_authority,
             true,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.token_program,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.system_program,
             false,
         ));
@@ -69,7 +64,7 @@ impl UpdateGuard {
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,
@@ -126,7 +121,7 @@ pub struct UpdateGuardBuilder {
     cpi_rule: Option<CpiRule>,
     transfer_amount_rule: Option<TransferAmountRule>,
     additional_fields_rule: Option<Vec<MetadataAdditionalFieldRule>>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl UpdateGuardBuilder {
@@ -187,10 +182,7 @@ impl UpdateGuardBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -198,13 +190,13 @@ impl UpdateGuardBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = UpdateGuard {
             guard: self.guard.expect("guard is not set"),
             mint: self.mint.expect("mint is not set"),
@@ -317,32 +309,29 @@ impl<'a, 'b> UpdateGuardCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(6 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.guard.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new(*self.guard.key, false));
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.mint.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.token_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.guard_authority.key,
             true,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.token_program.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.system_program.key,
             false,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -352,7 +341,7 @@ impl<'a, 'b> UpdateGuardCpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::WEN_TRANSFER_GUARD_ID,
             accounts,
             data,

+ 1 - 0
packages/renderers-rust/e2e/dummy/Cargo.lock

@@ -706,6 +706,7 @@ dependencies = [
  "serde",
  "serde-big-array",
  "serde_with",
+ "solana-instruction",
  "solana-program 2.2.1",
  "solana-pubkey",
  "solana-sdk",

+ 1 - 0
packages/renderers-rust/e2e/dummy/Cargo.toml

@@ -18,6 +18,7 @@ num-traits = "^0.2"
 serde = { version = "^1.0", features = ["derive"], optional = true }
 serde_with = { version = "^3.0", optional = true }
 solana-program = "2.2.1"
+solana-instruction = "2.2.1"
 solana-pubkey = { version = "2.2.1", features = ["curve25519"] }
 serde-big-array = { version = "^0.5", optional = true }
 thiserror = "^1.0"

+ 10 - 13
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction1.rs

@@ -13,20 +13,20 @@ use borsh::BorshSerialize;
 pub struct Instruction1 {}
 
 impl Instruction1 {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&Instruction1InstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -56,7 +56,7 @@ impl Default for Instruction1InstructionData {
 ///
 #[derive(Clone, Debug, Default)]
 pub struct Instruction1Builder {
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction1Builder {
@@ -65,10 +65,7 @@ impl Instruction1Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -76,13 +73,13 @@ impl Instruction1Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction1 {};
 
         accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
@@ -135,7 +132,7 @@ impl<'a, 'b> Instruction1Cpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -143,7 +140,7 @@ impl<'a, 'b> Instruction1Cpi<'a, 'b> {
         });
         let data = borsh::to_vec(&Instruction1InstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 10 - 13
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction2.rs

@@ -13,20 +13,20 @@ use borsh::BorshSerialize;
 pub struct Instruction2 {}
 
 impl Instruction2 {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&Instruction2InstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -56,7 +56,7 @@ impl Default for Instruction2InstructionData {
 ///
 #[derive(Clone, Debug, Default)]
 pub struct Instruction2Builder {
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction2Builder {
@@ -65,10 +65,7 @@ impl Instruction2Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -76,13 +73,13 @@ impl Instruction2Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction2 {};
 
         accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
@@ -135,7 +132,7 @@ impl<'a, 'b> Instruction2Cpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -143,7 +140,7 @@ impl<'a, 'b> Instruction2Cpi<'a, 'b> {
         });
         let data = borsh::to_vec(&Instruction2InstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 10 - 13
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction3.rs

@@ -13,20 +13,20 @@ use borsh::BorshSerialize;
 pub struct Instruction3 {}
 
 impl Instruction3 {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&Instruction3InstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -58,7 +58,7 @@ impl Default for Instruction3InstructionData {
 ///
 #[derive(Clone, Debug, Default)]
 pub struct Instruction3Builder {
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction3Builder {
@@ -67,10 +67,7 @@ impl Instruction3Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -78,13 +75,13 @@ impl Instruction3Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction3 {};
 
         accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
@@ -137,7 +134,7 @@ impl<'a, 'b> Instruction3Cpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -145,7 +142,7 @@ impl<'a, 'b> Instruction3Cpi<'a, 'b> {
         });
         let data = borsh::to_vec(&Instruction3InstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 10 - 13
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction4.rs

@@ -16,7 +16,7 @@ impl Instruction4 {
     pub fn instruction(
         &self,
         args: Instruction4InstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    ) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -24,15 +24,15 @@ impl Instruction4 {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: Instruction4InstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         accounts.extend_from_slice(remaining_accounts);
         let mut data = borsh::to_vec(&Instruction4InstructionData::new()).unwrap();
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -69,7 +69,7 @@ pub struct Instruction4InstructionArgs {
 #[derive(Clone, Debug, Default)]
 pub struct Instruction4Builder {
     my_argument: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction4Builder {
@@ -83,10 +83,7 @@ impl Instruction4Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -94,13 +91,13 @@ impl Instruction4Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction4 {};
         let args = Instruction4InstructionArgs {
             my_argument: self.my_argument.clone().expect("my_argument is not set"),
@@ -164,7 +161,7 @@ impl<'a, 'b> Instruction4Cpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -174,7 +171,7 @@ impl<'a, 'b> Instruction4Cpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 10 - 13
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction5.rs

@@ -16,7 +16,7 @@ impl Instruction5 {
     pub fn instruction(
         &self,
         args: Instruction5InstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    ) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -24,15 +24,15 @@ impl Instruction5 {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: Instruction5InstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         accounts.extend_from_slice(remaining_accounts);
         let mut data = borsh::to_vec(&Instruction5InstructionData::new()).unwrap();
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -69,7 +69,7 @@ pub struct Instruction5InstructionArgs {
 #[derive(Clone, Debug, Default)]
 pub struct Instruction5Builder {
     my_argument: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction5Builder {
@@ -84,10 +84,7 @@ impl Instruction5Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -95,13 +92,13 @@ impl Instruction5Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction5 {};
         let args = Instruction5InstructionArgs {
             my_argument: self.my_argument.clone().unwrap_or(42),
@@ -165,7 +162,7 @@ impl<'a, 'b> Instruction5Cpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -175,7 +172,7 @@ impl<'a, 'b> Instruction5Cpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 12 - 18
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction6.rs

@@ -15,24 +15,21 @@ pub struct Instruction6 {
 }
 
 impl Instruction6 {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.my_account,
-            false,
-        ));
+        accounts.push(solana_instruction::AccountMeta::new(self.my_account, false));
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&Instruction6InstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -64,7 +61,7 @@ impl Default for Instruction6InstructionData {
 #[derive(Clone, Debug, Default)]
 pub struct Instruction6Builder {
     my_account: Option<solana_pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction6Builder {
@@ -78,10 +75,7 @@ impl Instruction6Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -89,13 +83,13 @@ impl Instruction6Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction6 {
             my_account: self.my_account.expect("my_account is not set"),
         };
@@ -162,12 +156,12 @@ impl<'a, 'b> Instruction6Cpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.my_account.key,
             false,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -175,7 +169,7 @@ impl<'a, 'b> Instruction6Cpi<'a, 'b> {
         });
         let data = borsh::to_vec(&Instruction6InstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 14 - 22
packages/renderers-rust/e2e/dummy/src/generated/instructions/instruction7.rs

@@ -15,22 +15,20 @@ pub struct Instruction7 {
 }
 
 impl Instruction7 {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
         if let Some(my_account) = self.my_account {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                my_account, false,
-            ));
+            accounts.push(solana_instruction::AccountMeta::new(my_account, false));
         } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+            accounts.push(solana_instruction::AccountMeta::new_readonly(
                 crate::DUMMY_ID,
                 false,
             ));
@@ -38,7 +36,7 @@ impl Instruction7 {
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&Instruction7InstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,
@@ -70,7 +68,7 @@ impl Default for Instruction7InstructionData {
 #[derive(Clone, Debug, Default)]
 pub struct Instruction7Builder {
     my_account: Option<solana_pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl Instruction7Builder {
@@ -85,10 +83,7 @@ impl Instruction7Builder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -96,13 +91,13 @@ impl Instruction7Builder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Instruction7 {
             my_account: self.my_account,
         };
@@ -170,18 +165,15 @@ impl<'a, 'b> Instruction7Cpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
         if let Some(my_account) = self.my_account {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *my_account.key,
-                false,
-            ));
+            accounts.push(solana_instruction::AccountMeta::new(*my_account.key, false));
         } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+            accounts.push(solana_instruction::AccountMeta::new_readonly(
                 crate::DUMMY_ID,
                 false,
             ));
         }
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -189,7 +181,7 @@ impl<'a, 'b> Instruction7Cpi<'a, 'b> {
         });
         let data = borsh::to_vec(&Instruction7InstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::DUMMY_ID,
             accounts,
             data,

+ 1 - 0
packages/renderers-rust/e2e/memo/Cargo.lock

@@ -694,6 +694,7 @@ dependencies = [
  "serde",
  "serde-big-array",
  "serde_with",
+ "solana-instruction",
  "solana-program 2.2.1",
  "solana-pubkey",
  "solana-sdk",

+ 1 - 0
packages/renderers-rust/e2e/memo/Cargo.toml

@@ -18,6 +18,7 @@ num-traits = "^0.2"
 serde = { version = "^1.0", features = ["derive"], optional = true }
 serde_with = { version = "^3.0", optional = true }
 solana-program = "2.2.1"
+solana-instruction = "2.2.1"
 solana-pubkey = { version = "2.2.1", features = ["curve25519"] }
 serde-big-array = { version = "^0.5", optional = true }
 thiserror = "^1.0"

+ 10 - 16
packages/renderers-rust/e2e/memo/src/generated/instructions/add_memo.rs

@@ -14,10 +14,7 @@ use kaigan::types::RemainderStr;
 pub struct AddMemo {}
 
 impl AddMemo {
-    pub fn instruction(
-        &self,
-        args: AddMemoInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self, args: AddMemoInstructionArgs) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -25,15 +22,15 @@ impl AddMemo {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: AddMemoInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         accounts.extend_from_slice(remaining_accounts);
         let mut data = borsh::to_vec(&AddMemoInstructionData::new()).unwrap();
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::MEMO_ID,
             accounts,
             data,
@@ -70,7 +67,7 @@ pub struct AddMemoInstructionArgs {
 #[derive(Clone, Debug, Default)]
 pub struct AddMemoBuilder {
     memo: Option<RemainderStr>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl AddMemoBuilder {
@@ -84,10 +81,7 @@ impl AddMemoBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -95,13 +89,13 @@ impl AddMemoBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = AddMemo {};
         let args = AddMemoInstructionArgs {
             memo: self.memo.clone().expect("memo is not set"),
@@ -165,7 +159,7 @@ impl<'a, 'b> AddMemoCpi<'a, 'b> {
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(remaining_accounts.len());
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -175,7 +169,7 @@ impl<'a, 'b> AddMemoCpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::MEMO_ID,
             accounts,
             data,

+ 1 - 0
packages/renderers-rust/e2e/meteora/Cargo.toml

@@ -19,6 +19,7 @@ num-traits = "^0.2"
 serde = { version = "^1.0", features = ["derive"], optional = true }
 serde_with = { version = "^3.0", optional = true }
 solana-program = "2.2.1"
+solana-instruction = "2.2.1"
 solana-pubkey = { version = "2.2.1", features = ["curve25519"] }
 solana-client = { version = "~1.18", optional = true }
 solana-sdk = { version = "~1.18", optional = true }

+ 0 - 79
packages/renderers-rust/e2e/meteora/src/generated/accounts/bin_array.rs

@@ -1,79 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::Bin;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// An account to contain a range of bin. For example: Bin 100 <-> 200.
-/// For example:
-/// BinArray index: 0 contains bin 0 <-> 599
-/// index: 2 contains bin 600 <-> 1199, ...
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct BinArray {
-    pub discriminator: [u8; 8],
-    pub index: i64,
-    /// Version of binArray
-    pub version: u8,
-    pub padding: [u8; 7],
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub lb_pair: Pubkey,
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub bins: [Bin; 70],
-}
-
-impl BinArray {
-    pub const LEN: usize = 10136;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for BinArray {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for BinArray {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for BinArray {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for BinArray {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for BinArray {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for BinArray {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 71
packages/renderers-rust/e2e/meteora/src/generated/accounts/bin_array_bitmap_extension.rs

@@ -1,71 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct BinArrayBitmapExtension {
-    pub discriminator: [u8; 8],
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub lb_pair: Pubkey,
-    /// Packed initialized bin array state for start_bin_index is positive
-    pub positive_bin_array_bitmap: [[u64; 8]; 12],
-    /// Packed initialized bin array state for start_bin_index is negative
-    pub negative_bin_array_bitmap: [[u64; 8]; 12],
-}
-
-impl BinArrayBitmapExtension {
-    pub const LEN: usize = 1576;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for BinArrayBitmapExtension {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for BinArrayBitmapExtension {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for BinArrayBitmapExtension {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for BinArrayBitmapExtension {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for BinArrayBitmapExtension {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for BinArrayBitmapExtension {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 157
packages/renderers-rust/e2e/meteora/src/generated/accounts/lb_pair.rs

@@ -1,157 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::ProtocolFee;
-use crate::generated::types::RewardInfo;
-use crate::generated::types::StaticParameters;
-use crate::generated::types::VariableParameters;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct LbPair {
-    pub discriminator: [u8; 8],
-    pub parameters: StaticParameters,
-    pub v_parameters: VariableParameters,
-    pub bump_seed: [u8; 1],
-    /// Bin step signer seed
-    pub bin_step_seed: [u8; 2],
-    /// Type of the pair
-    pub pair_type: u8,
-    /// Active bin id
-    pub active_id: i32,
-    /// Bin step. Represent the price increment / decrement.
-    pub bin_step: u16,
-    /// Status of the pair. Check PairStatus enum.
-    pub status: u8,
-    /// Require base factor seed
-    pub require_base_factor_seed: u8,
-    /// Base factor seed
-    pub base_factor_seed: [u8; 2],
-    /// Activation type
-    pub activation_type: u8,
-    /// padding 0
-    pub padding0: u8,
-    /// Token X mint
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub token_x_mint: Pubkey,
-    /// Token Y mint
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub token_y_mint: Pubkey,
-    /// LB token X vault
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub reserve_x: Pubkey,
-    /// LB token Y vault
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub reserve_y: Pubkey,
-    /// Uncollected protocol fee
-    pub protocol_fee: ProtocolFee,
-    /// _padding_1, previous Fee owner, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!
-    pub padding1: [u8; 32],
-    /// Farming reward information
-    pub reward_infos: [RewardInfo; 2],
-    /// Oracle pubkey
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub oracle: Pubkey,
-    /// Packed initialized bin array state
-    pub bin_array_bitmap: [u64; 16],
-    /// Last time the pool fee parameter was updated
-    pub last_updated_at: i64,
-    /// _padding_2, previous whitelisted_wallet, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!
-    pub padding2: [u8; 32],
-    /// Address allowed to swap when the current point is greater than or equal to the pre-activation point. The pre-activation point is calculated as `activation_point - pre_activation_duration`.
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub pre_activation_swap_address: Pubkey,
-    /// Base keypair. Only required for permission pair
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub base_key: Pubkey,
-    /// Time point to enable the pair. Only applicable for permission pair.
-    pub activation_point: u64,
-    /// Duration before activation activation_point. Used to calculate pre-activation time point for pre_activation_swap_address
-    pub pre_activation_duration: u64,
-    /// _padding 3 is reclaimed free space from swap_cap_deactivate_point and swap_cap_amount before, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!
-    pub padding3: [u8; 8],
-    /// _padding_4, previous lock_duration, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!
-    pub padding4: u64,
-    /// Pool creator
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub creator: Pubkey,
-    /// Reserved space for future use
-    pub reserved: [u8; 24],
-}
-
-impl LbPair {
-    pub const LEN: usize = 904;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for LbPair {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for LbPair {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for LbPair {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for LbPair {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for LbPair {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for LbPair {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 22
packages/renderers-rust/e2e/meteora/src/generated/accounts/mod.rs

@@ -1,22 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-pub(crate) mod r#bin_array;
-pub(crate) mod r#bin_array_bitmap_extension;
-pub(crate) mod r#lb_pair;
-pub(crate) mod r#oracle;
-pub(crate) mod r#position;
-pub(crate) mod r#position_v2;
-pub(crate) mod r#preset_parameter;
-
-pub use self::r#bin_array::*;
-pub use self::r#bin_array_bitmap_extension::*;
-pub use self::r#lb_pair::*;
-pub use self::r#oracle::*;
-pub use self::r#position::*;
-pub use self::r#position_v2::*;
-pub use self::r#preset_parameter::*;

+ 0 - 67
packages/renderers-rust/e2e/meteora/src/generated/accounts/oracle.rs

@@ -1,67 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct Oracle {
-    pub discriminator: [u8; 8],
-    /// Index of latest observation
-    pub idx: u64,
-    /// Size of active sample. Active sample is initialized observation.
-    pub active_size: u64,
-    /// Number of observations
-    pub length: u64,
-}
-
-impl Oracle {
-    pub const LEN: usize = 32;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for Oracle {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for Oracle {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for Oracle {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for Oracle {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for Oracle {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for Oracle {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 100
packages/renderers-rust/e2e/meteora/src/generated/accounts/position.rs

@@ -1,100 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::FeeInfo;
-use crate::generated::types::UserRewardInfo;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct Position {
-    pub discriminator: [u8; 8],
-    /// The LB pair of this position
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub lb_pair: Pubkey,
-    /// Owner of the position. Client rely on this to to fetch their positions.
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub owner: Pubkey,
-    /// Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept.
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub liquidity_shares: [u64; 70],
-    /// Farming reward information
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub reward_infos: [UserRewardInfo; 70],
-    /// Swap fee to claim information
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub fee_infos: [FeeInfo; 70],
-    /// Lower bin ID
-    pub lower_bin_id: i32,
-    /// Upper bin ID
-    pub upper_bin_id: i32,
-    /// Last updated timestamp
-    pub last_updated_at: i64,
-    /// Total claimed token fee X
-    pub total_claimed_fee_x_amount: u64,
-    /// Total claimed token fee Y
-    pub total_claimed_fee_y_amount: u64,
-    /// Total claimed rewards
-    pub total_claimed_rewards: [u64; 2],
-    /// Reserved space for future use
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub reserved: [u8; 160],
-}
-
-impl Position {
-    pub const LEN: usize = 7560;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for Position {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for Position {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for Position {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for Position {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for Position {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for Position {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 116
packages/renderers-rust/e2e/meteora/src/generated/accounts/position_v2.rs

@@ -1,116 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::FeeInfo;
-use crate::generated::types::UserRewardInfo;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct PositionV2 {
-    pub discriminator: [u8; 8],
-    /// The LB pair of this position
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub lb_pair: Pubkey,
-    /// Owner of the position. Client rely on this to to fetch their positions.
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub owner: Pubkey,
-    /// Liquidity shares of this position in bins (lower_bin_id <-> upper_bin_id). This is the same as LP concept.
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub liquidity_shares: [u128; 70],
-    /// Farming reward information
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub reward_infos: [UserRewardInfo; 70],
-    /// Swap fee to claim information
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub fee_infos: [FeeInfo; 70],
-    /// Lower bin ID
-    pub lower_bin_id: i32,
-    /// Upper bin ID
-    pub upper_bin_id: i32,
-    /// Last updated timestamp
-    pub last_updated_at: i64,
-    /// Total claimed token fee X
-    pub total_claimed_fee_x_amount: u64,
-    /// Total claimed token fee Y
-    pub total_claimed_fee_y_amount: u64,
-    /// Total claimed rewards
-    pub total_claimed_rewards: [u64; 2],
-    /// Operator of position
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub operator: Pubkey,
-    /// Time point which the locked liquidity can be withdraw
-    pub lock_release_point: u64,
-    /// _padding_0, previous subjected_to_bootstrap_liquidity_locking, BE CAREFUL FOR TOMBSTONE WHEN REUSE !!
-    pub padding0: u8,
-    /// Address is able to claim fee in this position, only valid for bootstrap_liquidity_position
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub fee_owner: Pubkey,
-    /// Reserved space for future use
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub reserved: [u8; 87],
-}
-
-impl PositionV2 {
-    pub const LEN: usize = 8120;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for PositionV2 {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for PositionV2 {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for PositionV2 {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for PositionV2 {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for PositionV2 {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for PositionV2 {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 81
packages/renderers-rust/e2e/meteora/src/generated/accounts/preset_parameter.rs

@@ -1,81 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct PresetParameter {
-    pub discriminator: [u8; 8],
-    /// Bin step. Represent the price increment / decrement.
-    pub bin_step: u16,
-    /// Used for base fee calculation. base_fee_rate = base_factor * bin_step
-    pub base_factor: u16,
-    /// Filter period determine high frequency trading time window.
-    pub filter_period: u16,
-    /// Decay period determine when the volatile fee start decay / decrease.
-    pub decay_period: u16,
-    /// Reduction factor controls the volatile fee rate decrement rate.
-    pub reduction_factor: u16,
-    /// Used to scale the variable fee component depending on the dynamic of the market
-    pub variable_fee_control: u32,
-    /// Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate.
-    pub max_volatility_accumulator: u32,
-    /// Min bin id supported by the pool based on the configured bin step.
-    pub min_bin_id: i32,
-    /// Max bin id supported by the pool based on the configured bin step.
-    pub max_bin_id: i32,
-    /// Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee
-    pub protocol_share: u16,
-}
-
-impl PresetParameter {
-    pub const LEN: usize = 36;
-
-    #[inline(always)]
-    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
-        let mut data = data;
-        Self::deserialize(&mut data)
-    }
-}
-
-impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for PresetParameter {
-    type Error = std::io::Error;
-
-    fn try_from(
-        account_info: &solana_program::account_info::AccountInfo<'a>,
-    ) -> Result<Self, Self::Error> {
-        let mut data: &[u8] = &(*account_info.data).borrow();
-        Self::deserialize(&mut data)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountDeserialize for PresetParameter {
-    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
-        Ok(Self::deserialize(buf)?)
-    }
-}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::AccountSerialize for PresetParameter {}
-
-#[cfg(feature = "anchor")]
-impl anchor_lang::Owner for PresetParameter {
-    fn owner() -> Pubkey {
-        crate::LB_CLMM_ID
-    }
-}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::IdlBuild for PresetParameter {}
-
-#[cfg(feature = "anchor-idl-build")]
-impl anchor_lang::Discriminator for PresetParameter {
-    const DISCRIMINATOR: [u8; 8] = [0; 8];
-}

+ 0 - 223
packages/renderers-rust/e2e/meteora/src/generated/errors/lb_clmm.rs

@@ -1,223 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use num_derive::FromPrimitive;
-use thiserror::Error;
-
-#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
-pub enum LbClmmError {
-    /// 6000 - Invalid start bin index
-    #[error("Invalid start bin index")]
-    InvalidStartBinIndex = 0x1770,
-    /// 6001 - Invalid bin id
-    #[error("Invalid bin id")]
-    InvalidBinId = 0x1771,
-    /// 6002 - Invalid input data
-    #[error("Invalid input data")]
-    InvalidInput = 0x1772,
-    /// 6003 - Exceeded amount slippage tolerance
-    #[error("Exceeded amount slippage tolerance")]
-    ExceededAmountSlippageTolerance = 0x1773,
-    /// 6004 - Exceeded bin slippage tolerance
-    #[error("Exceeded bin slippage tolerance")]
-    ExceededBinSlippageTolerance = 0x1774,
-    /// 6005 - Composition factor flawed
-    #[error("Composition factor flawed")]
-    CompositionFactorFlawed = 0x1775,
-    /// 6006 - Non preset bin step
-    #[error("Non preset bin step")]
-    NonPresetBinStep = 0x1776,
-    /// 6007 - Zero liquidity
-    #[error("Zero liquidity")]
-    ZeroLiquidity = 0x1777,
-    /// 6008 - Invalid position
-    #[error("Invalid position")]
-    InvalidPosition = 0x1778,
-    /// 6009 - Bin array not found
-    #[error("Bin array not found")]
-    BinArrayNotFound = 0x1779,
-    /// 6010 - Invalid token mint
-    #[error("Invalid token mint")]
-    InvalidTokenMint = 0x177A,
-    /// 6011 - Invalid account for single deposit
-    #[error("Invalid account for single deposit")]
-    InvalidAccountForSingleDeposit = 0x177B,
-    /// 6012 - Pair insufficient liquidity
-    #[error("Pair insufficient liquidity")]
-    PairInsufficientLiquidity = 0x177C,
-    /// 6013 - Invalid fee owner
-    #[error("Invalid fee owner")]
-    InvalidFeeOwner = 0x177D,
-    /// 6014 - Invalid fee withdraw amount
-    #[error("Invalid fee withdraw amount")]
-    InvalidFeeWithdrawAmount = 0x177E,
-    /// 6015 - Invalid admin
-    #[error("Invalid admin")]
-    InvalidAdmin = 0x177F,
-    /// 6016 - Identical fee owner
-    #[error("Identical fee owner")]
-    IdenticalFeeOwner = 0x1780,
-    /// 6017 - Invalid basis point
-    #[error("Invalid basis point")]
-    InvalidBps = 0x1781,
-    /// 6018 - Math operation overflow
-    #[error("Math operation overflow")]
-    MathOverflow = 0x1782,
-    /// 6019 - Type cast error
-    #[error("Type cast error")]
-    TypeCastFailed = 0x1783,
-    /// 6020 - Invalid reward index
-    #[error("Invalid reward index")]
-    InvalidRewardIndex = 0x1784,
-    /// 6021 - Invalid reward duration
-    #[error("Invalid reward duration")]
-    InvalidRewardDuration = 0x1785,
-    /// 6022 - Reward already initialized
-    #[error("Reward already initialized")]
-    RewardInitialized = 0x1786,
-    /// 6023 - Reward not initialized
-    #[error("Reward not initialized")]
-    RewardUninitialized = 0x1787,
-    /// 6024 - Identical funder
-    #[error("Identical funder")]
-    IdenticalFunder = 0x1788,
-    /// 6025 - Reward campaign in progress
-    #[error("Reward campaign in progress")]
-    RewardCampaignInProgress = 0x1789,
-    /// 6026 - Reward duration is the same
-    #[error("Reward duration is the same")]
-    IdenticalRewardDuration = 0x178A,
-    /// 6027 - Invalid bin array
-    #[error("Invalid bin array")]
-    InvalidBinArray = 0x178B,
-    /// 6028 - Bin arrays must be continuous
-    #[error("Bin arrays must be continuous")]
-    NonContinuousBinArrays = 0x178C,
-    /// 6029 - Invalid reward vault
-    #[error("Invalid reward vault")]
-    InvalidRewardVault = 0x178D,
-    /// 6030 - Position is not empty
-    #[error("Position is not empty")]
-    NonEmptyPosition = 0x178E,
-    /// 6031 - Unauthorized access
-    #[error("Unauthorized access")]
-    UnauthorizedAccess = 0x178F,
-    /// 6032 - Invalid fee parameter
-    #[error("Invalid fee parameter")]
-    InvalidFeeParameter = 0x1790,
-    /// 6033 - Missing oracle account
-    #[error("Missing oracle account")]
-    MissingOracle = 0x1791,
-    /// 6034 - Insufficient observation sample
-    #[error("Insufficient observation sample")]
-    InsufficientSample = 0x1792,
-    /// 6035 - Invalid lookup timestamp
-    #[error("Invalid lookup timestamp")]
-    InvalidLookupTimestamp = 0x1793,
-    /// 6036 - Bitmap extension account is not provided
-    #[error("Bitmap extension account is not provided")]
-    BitmapExtensionAccountIsNotProvided = 0x1794,
-    /// 6037 - Cannot find non-zero liquidity binArrayId
-    #[error("Cannot find non-zero liquidity binArrayId")]
-    CannotFindNonZeroLiquidityBinArrayId = 0x1795,
-    /// 6038 - Bin id out of bound
-    #[error("Bin id out of bound")]
-    BinIdOutOfBound = 0x1796,
-    /// 6039 - Insufficient amount in for minimum out
-    #[error("Insufficient amount in for minimum out")]
-    InsufficientOutAmount = 0x1797,
-    /// 6040 - Invalid position width
-    #[error("Invalid position width")]
-    InvalidPositionWidth = 0x1798,
-    /// 6041 - Excessive fee update
-    #[error("Excessive fee update")]
-    ExcessiveFeeUpdate = 0x1799,
-    /// 6042 - Pool disabled
-    #[error("Pool disabled")]
-    PoolDisabled = 0x179A,
-    /// 6043 - Invalid pool type
-    #[error("Invalid pool type")]
-    InvalidPoolType = 0x179B,
-    /// 6044 - Whitelist for wallet is full
-    #[error("Whitelist for wallet is full")]
-    ExceedMaxWhitelist = 0x179C,
-    /// 6045 - Invalid index
-    #[error("Invalid index")]
-    InvalidIndex = 0x179D,
-    /// 6046 - Reward not ended
-    #[error("Reward not ended")]
-    RewardNotEnded = 0x179E,
-    /// 6047 - Must withdraw ineligible reward
-    #[error("Must withdraw ineligible reward")]
-    MustWithdrawnIneligibleReward = 0x179F,
-    /// 6048 - Unauthorized address
-    #[error("Unauthorized address")]
-    UnauthorizedAddress = 0x17A0,
-    /// 6049 - Cannot update because operators are the same
-    #[error("Cannot update because operators are the same")]
-    OperatorsAreTheSame = 0x17A1,
-    /// 6050 - Withdraw to wrong token account
-    #[error("Withdraw to wrong token account")]
-    WithdrawToWrongTokenAccount = 0x17A2,
-    /// 6051 - Wrong rent receiver
-    #[error("Wrong rent receiver")]
-    WrongRentReceiver = 0x17A3,
-    /// 6052 - Already activated
-    #[error("Already activated")]
-    AlreadyPassActivationPoint = 0x17A4,
-    /// 6053 - Swapped amount is exceeded max swapped amount
-    #[error("Swapped amount is exceeded max swapped amount")]
-    ExceedMaxSwappedAmount = 0x17A5,
-    /// 6054 - Invalid strategy parameters
-    #[error("Invalid strategy parameters")]
-    InvalidStrategyParameters = 0x17A6,
-    /// 6055 - Liquidity locked
-    #[error("Liquidity locked")]
-    LiquidityLocked = 0x17A7,
-    /// 6056 - Bin range is not empty
-    #[error("Bin range is not empty")]
-    BinRangeIsNotEmpty = 0x17A8,
-    /// 6057 - Amount out is not matched with exact amount out
-    #[error("Amount out is not matched with exact amount out")]
-    NotExactAmountOut = 0x17A9,
-    /// 6058 - Invalid activation type
-    #[error("Invalid activation type")]
-    InvalidActivationType = 0x17AA,
-    /// 6059 - Invalid activation duration
-    #[error("Invalid activation duration")]
-    InvalidActivationDuration = 0x17AB,
-    /// 6060 - Missing token amount as token launch owner proof
-    #[error("Missing token amount as token launch owner proof")]
-    MissingTokenAmountAsTokenLaunchProof = 0x17AC,
-    /// 6061 - Quote token must be SOL or USDC
-    #[error("Quote token must be SOL or USDC")]
-    InvalidQuoteToken = 0x17AD,
-    /// 6062 - Invalid bin step
-    #[error("Invalid bin step")]
-    InvalidBinStep = 0x17AE,
-    /// 6063 - Invalid base fee
-    #[error("Invalid base fee")]
-    InvalidBaseFee = 0x17AF,
-    /// 6064 - Invalid pre-activation duration
-    #[error("Invalid pre-activation duration")]
-    InvalidPreActivationDuration = 0x17B0,
-    /// 6065 - Already pass pre-activation swap point
-    #[error("Already pass pre-activation swap point")]
-    AlreadyPassPreActivationSwapPoint = 0x17B1,
-}
-
-impl solana_program::program_error::PrintProgramError for LbClmmError {
-    fn print<E>(&self) {
-        solana_program::msg!(&self.to_string());
-    }
-}
-
-impl<T> solana_program::decode_error::DecodeError<T> for LbClmmError {
-    fn type_of() -> &'static str {
-        "LbClmmError"
-    }
-}

+ 0 - 10
packages/renderers-rust/e2e/meteora/src/generated/errors/mod.rs

@@ -1,10 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-pub(crate) mod lb_clmm;
-
-pub use self::lb_clmm::LbClmmError;

+ 0 - 1000
packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity.rs

@@ -1,1000 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::BinLiquidityDistribution;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct AddLiquidity {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl AddLiquidity {
-    pub fn instruction(
-        &self,
-        args: AddLiquidityInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: AddLiquidityInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = AddLiquidityInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl AddLiquidityInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [181, 157, 89, 67, 143, 182, 52, 72],
-        }
-    }
-}
-
-impl Default for AddLiquidityInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityInstructionArgs {
-    pub amount_x: u64,
-    pub amount_y: u64,
-    pub bin_liquidity_dist: Vec<BinLiquidityDistribution>,
-}
-
-/// Instruction builder for `AddLiquidity`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct AddLiquidityBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    bin_liquidity_dist: Option<Vec<BinLiquidityDistribution>>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl AddLiquidityBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.amount_y = Some(amount_y);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_dist(
-        &mut self,
-        bin_liquidity_dist: Vec<BinLiquidityDistribution>,
-    ) -> &mut Self {
-        self.bin_liquidity_dist = Some(bin_liquidity_dist);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = AddLiquidity {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = AddLiquidityInstructionArgs {
-            amount_x: self.amount_x.clone().expect("amount_x is not set"),
-            amount_y: self.amount_y.clone().expect("amount_y is not set"),
-            bin_liquidity_dist: self
-                .bin_liquidity_dist
-                .clone()
-                .expect("bin_liquidity_dist is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `add_liquidity` CPI accounts.
-pub struct AddLiquidityCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `add_liquidity` CPI instruction.
-pub struct AddLiquidityCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: AddLiquidityInstructionArgs,
-}
-
-impl<'a, 'b> AddLiquidityCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: AddLiquidityCpiAccounts<'a, 'b>,
-        args: AddLiquidityInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = AddLiquidityInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `AddLiquidity` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug)]
-pub struct AddLiquidityCpiBuilder<'a, 'b> {
-    instruction: Box<AddLiquidityCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> AddLiquidityCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(AddLiquidityCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token_x: None,
-            user_token_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            amount_x: None,
-            amount_y: None,
-            bin_liquidity_dist: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.instruction.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.instruction.amount_y = Some(amount_y);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_dist(
-        &mut self,
-        bin_liquidity_dist: Vec<BinLiquidityDistribution>,
-    ) -> &mut Self {
-        self.instruction.bin_liquidity_dist = Some(bin_liquidity_dist);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = AddLiquidityInstructionArgs {
-            amount_x: self
-                .instruction
-                .amount_x
-                .clone()
-                .expect("amount_x is not set"),
-            amount_y: self
-                .instruction
-                .amount_y
-                .clone()
-                .expect("amount_y is not set"),
-            bin_liquidity_dist: self
-                .instruction
-                .bin_liquidity_dist
-                .clone()
-                .expect("bin_liquidity_dist is not set"),
-        };
-        let instruction = AddLiquidityCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct AddLiquidityCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    bin_liquidity_dist: Option<Vec<BinLiquidityDistribution>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 1041
packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_by_strategy.rs

@@ -1,1041 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::StrategyParameters;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct AddLiquidityByStrategy {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl AddLiquidityByStrategy {
-    pub fn instruction(
-        &self,
-        args: AddLiquidityByStrategyInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: AddLiquidityByStrategyInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = AddLiquidityByStrategyInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityByStrategyInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl AddLiquidityByStrategyInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [7, 3, 150, 127, 148, 40, 61, 200],
-        }
-    }
-}
-
-impl Default for AddLiquidityByStrategyInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityByStrategyInstructionArgs {
-    pub amount_x: u64,
-    pub amount_y: u64,
-    pub active_id: i32,
-    pub max_active_bin_slippage: i32,
-    pub strategy_parameters: StrategyParameters,
-}
-
-/// Instruction builder for `AddLiquidityByStrategy`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct AddLiquidityByStrategyBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    strategy_parameters: Option<StrategyParameters>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl AddLiquidityByStrategyBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.amount_y = Some(amount_y);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn strategy_parameters(&mut self, strategy_parameters: StrategyParameters) -> &mut Self {
-        self.strategy_parameters = Some(strategy_parameters);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = AddLiquidityByStrategy {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = AddLiquidityByStrategyInstructionArgs {
-            amount_x: self.amount_x.clone().expect("amount_x is not set"),
-            amount_y: self.amount_y.clone().expect("amount_y is not set"),
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            strategy_parameters: self
-                .strategy_parameters
-                .clone()
-                .expect("strategy_parameters is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `add_liquidity_by_strategy` CPI accounts.
-pub struct AddLiquidityByStrategyCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `add_liquidity_by_strategy` CPI instruction.
-pub struct AddLiquidityByStrategyCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: AddLiquidityByStrategyInstructionArgs,
-}
-
-impl<'a, 'b> AddLiquidityByStrategyCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: AddLiquidityByStrategyCpiAccounts<'a, 'b>,
-        args: AddLiquidityByStrategyInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = AddLiquidityByStrategyInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `AddLiquidityByStrategy` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug)]
-pub struct AddLiquidityByStrategyCpiBuilder<'a, 'b> {
-    instruction: Box<AddLiquidityByStrategyCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> AddLiquidityByStrategyCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(AddLiquidityByStrategyCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token_x: None,
-            user_token_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            amount_x: None,
-            amount_y: None,
-            active_id: None,
-            max_active_bin_slippage: None,
-            strategy_parameters: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.instruction.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.instruction.amount_y = Some(amount_y);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.instruction.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn strategy_parameters(&mut self, strategy_parameters: StrategyParameters) -> &mut Self {
-        self.instruction.strategy_parameters = Some(strategy_parameters);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = AddLiquidityByStrategyInstructionArgs {
-            amount_x: self
-                .instruction
-                .amount_x
-                .clone()
-                .expect("amount_x is not set"),
-            amount_y: self
-                .instruction
-                .amount_y
-                .clone()
-                .expect("amount_y is not set"),
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .instruction
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            strategy_parameters: self
-                .instruction
-                .strategy_parameters
-                .clone()
-                .expect("strategy_parameters is not set"),
-        };
-        let instruction = AddLiquidityByStrategyCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct AddLiquidityByStrategyCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    strategy_parameters: Option<StrategyParameters>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 851
packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_by_strategy_one_side.rs

@@ -1,851 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::StrategyParameters;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct AddLiquidityByStrategyOneSide {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token: solana_program::pubkey::Pubkey,
-
-    pub reserve: solana_program::pubkey::Pubkey,
-
-    pub token_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl AddLiquidityByStrategyOneSide {
-    pub fn instruction(
-        &self,
-        args: AddLiquidityByStrategyOneSideInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: AddLiquidityByStrategyOneSideInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(12 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = AddLiquidityByStrategyOneSideInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityByStrategyOneSideInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl AddLiquidityByStrategyOneSideInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [41, 5, 238, 175, 100, 225, 6, 205],
-        }
-    }
-}
-
-impl Default for AddLiquidityByStrategyOneSideInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityByStrategyOneSideInstructionArgs {
-    pub amount: u64,
-    pub active_id: i32,
-    pub max_active_bin_slippage: i32,
-    pub strategy_parameters: StrategyParameters,
-}
-
-/// Instruction builder for `AddLiquidityByStrategyOneSide`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token
-///   4. `[writable]` reserve
-///   5. `[]` token_mint
-///   6. `[writable]` bin_array_lower
-///   7. `[writable]` bin_array_upper
-///   8. `[signer]` sender
-///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   10. `[]` event_authority
-///   11. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct AddLiquidityByStrategyOneSideBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token: Option<solana_program::pubkey::Pubkey>,
-    reserve: Option<solana_program::pubkey::Pubkey>,
-    token_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    strategy_parameters: Option<StrategyParameters>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl AddLiquidityByStrategyOneSideBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token(&mut self, user_token: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token = Some(user_token);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve(&mut self, reserve: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve = Some(reserve);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint(&mut self, token_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint = Some(token_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount(&mut self, amount: u64) -> &mut Self {
-        self.amount = Some(amount);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn strategy_parameters(&mut self, strategy_parameters: StrategyParameters) -> &mut Self {
-        self.strategy_parameters = Some(strategy_parameters);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = AddLiquidityByStrategyOneSide {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token: self.user_token.expect("user_token is not set"),
-            reserve: self.reserve.expect("reserve is not set"),
-            token_mint: self.token_mint.expect("token_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = AddLiquidityByStrategyOneSideInstructionArgs {
-            amount: self.amount.clone().expect("amount is not set"),
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            strategy_parameters: self
-                .strategy_parameters
-                .clone()
-                .expect("strategy_parameters is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `add_liquidity_by_strategy_one_side` CPI accounts.
-pub struct AddLiquidityByStrategyOneSideCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `add_liquidity_by_strategy_one_side` CPI instruction.
-pub struct AddLiquidityByStrategyOneSideCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: AddLiquidityByStrategyOneSideInstructionArgs,
-}
-
-impl<'a, 'b> AddLiquidityByStrategyOneSideCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: AddLiquidityByStrategyOneSideCpiAccounts<'a, 'b>,
-        args: AddLiquidityByStrategyOneSideInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token: accounts.user_token,
-            reserve: accounts.reserve,
-            token_mint: accounts.token_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(12 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = AddLiquidityByStrategyOneSideInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(13 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token.clone());
-        account_infos.push(self.reserve.clone());
-        account_infos.push(self.token_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `AddLiquidityByStrategyOneSide` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token
-///   4. `[writable]` reserve
-///   5. `[]` token_mint
-///   6. `[writable]` bin_array_lower
-///   7. `[writable]` bin_array_upper
-///   8. `[signer]` sender
-///   9. `[]` token_program
-///   10. `[]` event_authority
-///   11. `[]` program
-#[derive(Clone, Debug)]
-pub struct AddLiquidityByStrategyOneSideCpiBuilder<'a, 'b> {
-    instruction: Box<AddLiquidityByStrategyOneSideCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> AddLiquidityByStrategyOneSideCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(AddLiquidityByStrategyOneSideCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token: None,
-            reserve: None,
-            token_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            amount: None,
-            active_id: None,
-            max_active_bin_slippage: None,
-            strategy_parameters: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token(
-        &mut self,
-        user_token: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token = Some(user_token);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve(
-        &mut self,
-        reserve: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve = Some(reserve);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint(
-        &mut self,
-        token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint = Some(token_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount(&mut self, amount: u64) -> &mut Self {
-        self.instruction.amount = Some(amount);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.instruction.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn strategy_parameters(&mut self, strategy_parameters: StrategyParameters) -> &mut Self {
-        self.instruction.strategy_parameters = Some(strategy_parameters);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = AddLiquidityByStrategyOneSideInstructionArgs {
-            amount: self.instruction.amount.clone().expect("amount is not set"),
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .instruction
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            strategy_parameters: self
-                .instruction
-                .strategy_parameters
-                .clone()
-                .expect("strategy_parameters is not set"),
-        };
-        let instruction = AddLiquidityByStrategyOneSideCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token: self.instruction.user_token.expect("user_token is not set"),
-
-            reserve: self.instruction.reserve.expect("reserve is not set"),
-
-            token_mint: self.instruction.token_mint.expect("token_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct AddLiquidityByStrategyOneSideCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    strategy_parameters: Option<StrategyParameters>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 1047
packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_by_weight.rs

@@ -1,1047 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::BinLiquidityDistributionByWeight;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct AddLiquidityByWeight {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl AddLiquidityByWeight {
-    pub fn instruction(
-        &self,
-        args: AddLiquidityByWeightInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: AddLiquidityByWeightInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = AddLiquidityByWeightInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityByWeightInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl AddLiquidityByWeightInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [28, 140, 238, 99, 231, 162, 21, 149],
-        }
-    }
-}
-
-impl Default for AddLiquidityByWeightInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityByWeightInstructionArgs {
-    pub amount_x: u64,
-    pub amount_y: u64,
-    pub active_id: i32,
-    pub max_active_bin_slippage: i32,
-    pub bin_liquidity_dist: Vec<BinLiquidityDistributionByWeight>,
-}
-
-/// Instruction builder for `AddLiquidityByWeight`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct AddLiquidityByWeightBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    bin_liquidity_dist: Option<Vec<BinLiquidityDistributionByWeight>>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl AddLiquidityByWeightBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.amount_y = Some(amount_y);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_dist(
-        &mut self,
-        bin_liquidity_dist: Vec<BinLiquidityDistributionByWeight>,
-    ) -> &mut Self {
-        self.bin_liquidity_dist = Some(bin_liquidity_dist);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = AddLiquidityByWeight {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = AddLiquidityByWeightInstructionArgs {
-            amount_x: self.amount_x.clone().expect("amount_x is not set"),
-            amount_y: self.amount_y.clone().expect("amount_y is not set"),
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            bin_liquidity_dist: self
-                .bin_liquidity_dist
-                .clone()
-                .expect("bin_liquidity_dist is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `add_liquidity_by_weight` CPI accounts.
-pub struct AddLiquidityByWeightCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `add_liquidity_by_weight` CPI instruction.
-pub struct AddLiquidityByWeightCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: AddLiquidityByWeightInstructionArgs,
-}
-
-impl<'a, 'b> AddLiquidityByWeightCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: AddLiquidityByWeightCpiAccounts<'a, 'b>,
-        args: AddLiquidityByWeightInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = AddLiquidityByWeightInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `AddLiquidityByWeight` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug)]
-pub struct AddLiquidityByWeightCpiBuilder<'a, 'b> {
-    instruction: Box<AddLiquidityByWeightCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> AddLiquidityByWeightCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(AddLiquidityByWeightCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token_x: None,
-            user_token_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            amount_x: None,
-            amount_y: None,
-            active_id: None,
-            max_active_bin_slippage: None,
-            bin_liquidity_dist: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.instruction.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.instruction.amount_y = Some(amount_y);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.instruction.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_dist(
-        &mut self,
-        bin_liquidity_dist: Vec<BinLiquidityDistributionByWeight>,
-    ) -> &mut Self {
-        self.instruction.bin_liquidity_dist = Some(bin_liquidity_dist);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = AddLiquidityByWeightInstructionArgs {
-            amount_x: self
-                .instruction
-                .amount_x
-                .clone()
-                .expect("amount_x is not set"),
-            amount_y: self
-                .instruction
-                .amount_y
-                .clone()
-                .expect("amount_y is not set"),
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .instruction
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            bin_liquidity_dist: self
-                .instruction
-                .bin_liquidity_dist
-                .clone()
-                .expect("bin_liquidity_dist is not set"),
-        };
-        let instruction = AddLiquidityByWeightCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct AddLiquidityByWeightCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    bin_liquidity_dist: Option<Vec<BinLiquidityDistributionByWeight>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 857
packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_one_side.rs

@@ -1,857 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::BinLiquidityDistributionByWeight;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct AddLiquidityOneSide {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token: solana_program::pubkey::Pubkey,
-
-    pub reserve: solana_program::pubkey::Pubkey,
-
-    pub token_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl AddLiquidityOneSide {
-    pub fn instruction(
-        &self,
-        args: AddLiquidityOneSideInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: AddLiquidityOneSideInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(12 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = AddLiquidityOneSideInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityOneSideInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl AddLiquidityOneSideInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [94, 155, 103, 151, 70, 95, 220, 165],
-        }
-    }
-}
-
-impl Default for AddLiquidityOneSideInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityOneSideInstructionArgs {
-    pub amount: u64,
-    pub active_id: i32,
-    pub max_active_bin_slippage: i32,
-    pub bin_liquidity_dist: Vec<BinLiquidityDistributionByWeight>,
-}
-
-/// Instruction builder for `AddLiquidityOneSide`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token
-///   4. `[writable]` reserve
-///   5. `[]` token_mint
-///   6. `[writable]` bin_array_lower
-///   7. `[writable]` bin_array_upper
-///   8. `[signer]` sender
-///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   10. `[]` event_authority
-///   11. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct AddLiquidityOneSideBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token: Option<solana_program::pubkey::Pubkey>,
-    reserve: Option<solana_program::pubkey::Pubkey>,
-    token_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    bin_liquidity_dist: Option<Vec<BinLiquidityDistributionByWeight>>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl AddLiquidityOneSideBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token(&mut self, user_token: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token = Some(user_token);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve(&mut self, reserve: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve = Some(reserve);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint(&mut self, token_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint = Some(token_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount(&mut self, amount: u64) -> &mut Self {
-        self.amount = Some(amount);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_dist(
-        &mut self,
-        bin_liquidity_dist: Vec<BinLiquidityDistributionByWeight>,
-    ) -> &mut Self {
-        self.bin_liquidity_dist = Some(bin_liquidity_dist);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = AddLiquidityOneSide {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token: self.user_token.expect("user_token is not set"),
-            reserve: self.reserve.expect("reserve is not set"),
-            token_mint: self.token_mint.expect("token_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = AddLiquidityOneSideInstructionArgs {
-            amount: self.amount.clone().expect("amount is not set"),
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            bin_liquidity_dist: self
-                .bin_liquidity_dist
-                .clone()
-                .expect("bin_liquidity_dist is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `add_liquidity_one_side` CPI accounts.
-pub struct AddLiquidityOneSideCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `add_liquidity_one_side` CPI instruction.
-pub struct AddLiquidityOneSideCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: AddLiquidityOneSideInstructionArgs,
-}
-
-impl<'a, 'b> AddLiquidityOneSideCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: AddLiquidityOneSideCpiAccounts<'a, 'b>,
-        args: AddLiquidityOneSideInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token: accounts.user_token,
-            reserve: accounts.reserve,
-            token_mint: accounts.token_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(12 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = AddLiquidityOneSideInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(13 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token.clone());
-        account_infos.push(self.reserve.clone());
-        account_infos.push(self.token_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `AddLiquidityOneSide` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token
-///   4. `[writable]` reserve
-///   5. `[]` token_mint
-///   6. `[writable]` bin_array_lower
-///   7. `[writable]` bin_array_upper
-///   8. `[signer]` sender
-///   9. `[]` token_program
-///   10. `[]` event_authority
-///   11. `[]` program
-#[derive(Clone, Debug)]
-pub struct AddLiquidityOneSideCpiBuilder<'a, 'b> {
-    instruction: Box<AddLiquidityOneSideCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> AddLiquidityOneSideCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(AddLiquidityOneSideCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token: None,
-            reserve: None,
-            token_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            amount: None,
-            active_id: None,
-            max_active_bin_slippage: None,
-            bin_liquidity_dist: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token(
-        &mut self,
-        user_token: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token = Some(user_token);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve(
-        &mut self,
-        reserve: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve = Some(reserve);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint(
-        &mut self,
-        token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint = Some(token_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount(&mut self, amount: u64) -> &mut Self {
-        self.instruction.amount = Some(amount);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_active_bin_slippage(&mut self, max_active_bin_slippage: i32) -> &mut Self {
-        self.instruction.max_active_bin_slippage = Some(max_active_bin_slippage);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_dist(
-        &mut self,
-        bin_liquidity_dist: Vec<BinLiquidityDistributionByWeight>,
-    ) -> &mut Self {
-        self.instruction.bin_liquidity_dist = Some(bin_liquidity_dist);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = AddLiquidityOneSideInstructionArgs {
-            amount: self.instruction.amount.clone().expect("amount is not set"),
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            max_active_bin_slippage: self
-                .instruction
-                .max_active_bin_slippage
-                .clone()
-                .expect("max_active_bin_slippage is not set"),
-            bin_liquidity_dist: self
-                .instruction
-                .bin_liquidity_dist
-                .clone()
-                .expect("bin_liquidity_dist is not set"),
-        };
-        let instruction = AddLiquidityOneSideCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token: self.instruction.user_token.expect("user_token is not set"),
-
-            reserve: self.instruction.reserve.expect("reserve is not set"),
-
-            token_mint: self.instruction.token_mint.expect("token_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct AddLiquidityOneSideCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount: Option<u64>,
-    active_id: Option<i32>,
-    max_active_bin_slippage: Option<i32>,
-    bin_liquidity_dist: Option<Vec<BinLiquidityDistributionByWeight>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 808
packages/renderers-rust/e2e/meteora/src/generated/instructions/add_liquidity_one_side_precise.rs

@@ -1,808 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::CompressedBinDepositAmount;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct AddLiquidityOneSidePrecise {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token: solana_program::pubkey::Pubkey,
-
-    pub reserve: solana_program::pubkey::Pubkey,
-
-    pub token_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl AddLiquidityOneSidePrecise {
-    pub fn instruction(
-        &self,
-        args: AddLiquidityOneSidePreciseInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: AddLiquidityOneSidePreciseInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(12 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = AddLiquidityOneSidePreciseInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityOneSidePreciseInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl AddLiquidityOneSidePreciseInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [161, 194, 103, 84, 171, 71, 250, 154],
-        }
-    }
-}
-
-impl Default for AddLiquidityOneSidePreciseInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct AddLiquidityOneSidePreciseInstructionArgs {
-    pub bins: Vec<CompressedBinDepositAmount>,
-    pub decompress_multiplier: u64,
-}
-
-/// Instruction builder for `AddLiquidityOneSidePrecise`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token
-///   4. `[writable]` reserve
-///   5. `[]` token_mint
-///   6. `[writable]` bin_array_lower
-///   7. `[writable]` bin_array_upper
-///   8. `[signer]` sender
-///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   10. `[]` event_authority
-///   11. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct AddLiquidityOneSidePreciseBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token: Option<solana_program::pubkey::Pubkey>,
-    reserve: Option<solana_program::pubkey::Pubkey>,
-    token_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    bins: Option<Vec<CompressedBinDepositAmount>>,
-    decompress_multiplier: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl AddLiquidityOneSidePreciseBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token(&mut self, user_token: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token = Some(user_token);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve(&mut self, reserve: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve = Some(reserve);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint(&mut self, token_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint = Some(token_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn bins(&mut self, bins: Vec<CompressedBinDepositAmount>) -> &mut Self {
-        self.bins = Some(bins);
-        self
-    }
-    #[inline(always)]
-    pub fn decompress_multiplier(&mut self, decompress_multiplier: u64) -> &mut Self {
-        self.decompress_multiplier = Some(decompress_multiplier);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = AddLiquidityOneSidePrecise {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token: self.user_token.expect("user_token is not set"),
-            reserve: self.reserve.expect("reserve is not set"),
-            token_mint: self.token_mint.expect("token_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = AddLiquidityOneSidePreciseInstructionArgs {
-            bins: self.bins.clone().expect("bins is not set"),
-            decompress_multiplier: self
-                .decompress_multiplier
-                .clone()
-                .expect("decompress_multiplier is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `add_liquidity_one_side_precise` CPI accounts.
-pub struct AddLiquidityOneSidePreciseCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `add_liquidity_one_side_precise` CPI instruction.
-pub struct AddLiquidityOneSidePreciseCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: AddLiquidityOneSidePreciseInstructionArgs,
-}
-
-impl<'a, 'b> AddLiquidityOneSidePreciseCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: AddLiquidityOneSidePreciseCpiAccounts<'a, 'b>,
-        args: AddLiquidityOneSidePreciseInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token: accounts.user_token,
-            reserve: accounts.reserve,
-            token_mint: accounts.token_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(12 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = AddLiquidityOneSidePreciseInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(13 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token.clone());
-        account_infos.push(self.reserve.clone());
-        account_infos.push(self.token_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `AddLiquidityOneSidePrecise` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token
-///   4. `[writable]` reserve
-///   5. `[]` token_mint
-///   6. `[writable]` bin_array_lower
-///   7. `[writable]` bin_array_upper
-///   8. `[signer]` sender
-///   9. `[]` token_program
-///   10. `[]` event_authority
-///   11. `[]` program
-#[derive(Clone, Debug)]
-pub struct AddLiquidityOneSidePreciseCpiBuilder<'a, 'b> {
-    instruction: Box<AddLiquidityOneSidePreciseCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> AddLiquidityOneSidePreciseCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(AddLiquidityOneSidePreciseCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token: None,
-            reserve: None,
-            token_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            bins: None,
-            decompress_multiplier: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token(
-        &mut self,
-        user_token: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token = Some(user_token);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve(
-        &mut self,
-        reserve: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve = Some(reserve);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint(
-        &mut self,
-        token_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint = Some(token_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn bins(&mut self, bins: Vec<CompressedBinDepositAmount>) -> &mut Self {
-        self.instruction.bins = Some(bins);
-        self
-    }
-    #[inline(always)]
-    pub fn decompress_multiplier(&mut self, decompress_multiplier: u64) -> &mut Self {
-        self.instruction.decompress_multiplier = Some(decompress_multiplier);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = AddLiquidityOneSidePreciseInstructionArgs {
-            bins: self.instruction.bins.clone().expect("bins is not set"),
-            decompress_multiplier: self
-                .instruction
-                .decompress_multiplier
-                .clone()
-                .expect("decompress_multiplier is not set"),
-        };
-        let instruction = AddLiquidityOneSidePreciseCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token: self.instruction.user_token.expect("user_token is not set"),
-
-            reserve: self.instruction.reserve.expect("reserve is not set"),
-
-            token_mint: self.instruction.token_mint.expect("token_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct AddLiquidityOneSidePreciseCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bins: Option<Vec<CompressedBinDepositAmount>>,
-    decompress_multiplier: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 807
packages/renderers-rust/e2e/meteora/src/generated/instructions/claim_fee.rs

@@ -1,807 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct ClaimFee {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl ClaimFee {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = ClaimFeeInstructionData::new().try_to_vec().unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct ClaimFeeInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl ClaimFeeInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [169, 32, 79, 137, 136, 232, 70, 137],
-        }
-    }
-}
-
-impl Default for ClaimFeeInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `ClaimFee`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` position
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` sender
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[writable]` user_token_x
-///   8. `[writable]` user_token_y
-///   9. `[]` token_x_mint
-///   10. `[]` token_y_mint
-///   11. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct ClaimFeeBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    position: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl ClaimFeeBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = ClaimFee {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            position: self.position.expect("position is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `claim_fee` CPI accounts.
-pub struct ClaimFeeCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `claim_fee` CPI instruction.
-pub struct ClaimFeeCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> ClaimFeeCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: ClaimFeeCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            position: accounts.position,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.program,
-        }
-    }
-    #[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(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 data = ClaimFeeInstructionData::new().try_to_vec().unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(15 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `ClaimFee` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` position
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` sender
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[writable]` user_token_x
-///   8. `[writable]` user_token_y
-///   9. `[]` token_x_mint
-///   10. `[]` token_y_mint
-///   11. `[]` token_program
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug)]
-pub struct ClaimFeeCpiBuilder<'a, 'b> {
-    instruction: Box<ClaimFeeCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> ClaimFeeCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(ClaimFeeCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            position: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            reserve_x: None,
-            reserve_y: None,
-            user_token_x: None,
-            user_token_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = ClaimFeeCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            position: self.instruction.position.expect("position is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct ClaimFeeCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 740
packages/renderers-rust/e2e/meteora/src/generated/instructions/claim_reward.rs

@@ -1,740 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct ClaimReward {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub reward_vault: solana_program::pubkey::Pubkey,
-
-    pub reward_mint: solana_program::pubkey::Pubkey,
-
-    pub user_token_account: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl ClaimReward {
-    pub fn instruction(
-        &self,
-        args: ClaimRewardInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: ClaimRewardInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(11 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reward_vault,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.reward_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_account,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = ClaimRewardInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct ClaimRewardInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl ClaimRewardInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [149, 95, 181, 242, 94, 90, 158, 162],
-        }
-    }
-}
-
-impl Default for ClaimRewardInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct ClaimRewardInstructionArgs {
-    pub reward_index: u64,
-}
-
-/// Instruction builder for `ClaimReward`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` position
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` sender
-///   5. `[writable]` reward_vault
-///   6. `[]` reward_mint
-///   7. `[writable]` user_token_account
-///   8. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   9. `[]` event_authority
-///   10. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct ClaimRewardBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    position: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    reward_vault: Option<solana_program::pubkey::Pubkey>,
-    reward_mint: Option<solana_program::pubkey::Pubkey>,
-    user_token_account: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    reward_index: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl ClaimRewardBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(&mut self, reward_vault: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(&mut self, reward_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_account(
-        &mut self,
-        user_token_account: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.user_token_account = Some(user_token_account);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.reward_index = Some(reward_index);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = ClaimReward {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            position: self.position.expect("position is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            reward_vault: self.reward_vault.expect("reward_vault is not set"),
-            reward_mint: self.reward_mint.expect("reward_mint is not set"),
-            user_token_account: self
-                .user_token_account
-                .expect("user_token_account is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = ClaimRewardInstructionArgs {
-            reward_index: self.reward_index.clone().expect("reward_index is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `claim_reward` CPI accounts.
-pub struct ClaimRewardCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `claim_reward` CPI instruction.
-pub struct ClaimRewardCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: ClaimRewardInstructionArgs,
-}
-
-impl<'a, 'b> ClaimRewardCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: ClaimRewardCpiAccounts<'a, 'b>,
-        args: ClaimRewardInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            position: accounts.position,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            reward_vault: accounts.reward_vault,
-            reward_mint: accounts.reward_mint,
-            user_token_account: accounts.user_token_account,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(11 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reward_vault.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.reward_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_account.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = ClaimRewardInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(12 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.reward_vault.clone());
-        account_infos.push(self.reward_mint.clone());
-        account_infos.push(self.user_token_account.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `ClaimReward` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` position
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` sender
-///   5. `[writable]` reward_vault
-///   6. `[]` reward_mint
-///   7. `[writable]` user_token_account
-///   8. `[]` token_program
-///   9. `[]` event_authority
-///   10. `[]` program
-#[derive(Clone, Debug)]
-pub struct ClaimRewardCpiBuilder<'a, 'b> {
-    instruction: Box<ClaimRewardCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> ClaimRewardCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(ClaimRewardCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            position: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            reward_vault: None,
-            reward_mint: None,
-            user_token_account: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            reward_index: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(
-        &mut self,
-        reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(
-        &mut self,
-        reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_account(
-        &mut self,
-        user_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_account = Some(user_token_account);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.instruction.reward_index = Some(reward_index);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = ClaimRewardInstructionArgs {
-            reward_index: self
-                .instruction
-                .reward_index
-                .clone()
-                .expect("reward_index is not set"),
-        };
-        let instruction = ClaimRewardCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            position: self.instruction.position.expect("position is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            reward_vault: self
-                .instruction
-                .reward_vault
-                .expect("reward_vault is not set"),
-
-            reward_mint: self
-                .instruction
-                .reward_mint
-                .expect("reward_mint is not set"),
-
-            user_token_account: self
-                .instruction
-                .user_token_account
-                .expect("user_token_account is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct ClaimRewardCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_account: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_index: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 570
packages/renderers-rust/e2e/meteora/src/generated/instructions/close_position.rs

@@ -1,570 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct ClosePosition {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub rent_receiver: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl ClosePosition {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(8 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.rent_receiver,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = ClosePositionInstructionData::new().try_to_vec().unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct ClosePositionInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl ClosePositionInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [123, 134, 81, 0, 49, 68, 98, 98],
-        }
-    }
-}
-
-impl Default for ClosePositionInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `ClosePosition`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` sender
-///   5. `[writable]` rent_receiver
-///   6. `[]` event_authority
-///   7. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct ClosePositionBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    rent_receiver: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl ClosePositionBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn rent_receiver(&mut self, rent_receiver: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent_receiver = Some(rent_receiver);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = ClosePosition {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            rent_receiver: self.rent_receiver.expect("rent_receiver is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `close_position` CPI accounts.
-pub struct ClosePositionCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `close_position` CPI instruction.
-pub struct ClosePositionCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> ClosePositionCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: ClosePositionCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            rent_receiver: accounts.rent_receiver,
-            event_authority: accounts.event_authority,
-            program: accounts.program,
-        }
-    }
-    #[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(8 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.rent_receiver.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 data = ClosePositionInstructionData::new().try_to_vec().unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(9 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.rent_receiver.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `ClosePosition` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` sender
-///   5. `[writable]` rent_receiver
-///   6. `[]` event_authority
-///   7. `[]` program
-#[derive(Clone, Debug)]
-pub struct ClosePositionCpiBuilder<'a, 'b> {
-    instruction: Box<ClosePositionCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> ClosePositionCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(ClosePositionCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            rent_receiver: None,
-            event_authority: None,
-            program: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn rent_receiver(
-        &mut self,
-        rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.rent_receiver = Some(rent_receiver);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = ClosePositionCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            rent_receiver: self
-                .instruction
-                .rent_receiver
-                .expect("rent_receiver is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct ClosePositionCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent_receiver: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 373
packages/renderers-rust/e2e/meteora/src/generated/instructions/close_preset_parameter.rs

@@ -1,373 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct ClosePresetParameter {
-    pub preset_parameter: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub rent_receiver: solana_program::pubkey::Pubkey,
-}
-
-impl ClosePresetParameter {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(3 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.preset_parameter,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.rent_receiver,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = ClosePresetParameterInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct ClosePresetParameterInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl ClosePresetParameterInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [4, 148, 145, 100, 134, 26, 181, 61],
-        }
-    }
-}
-
-impl Default for ClosePresetParameterInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `ClosePresetParameter`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` preset_parameter
-///   1. `[writable, signer]` admin
-///   2. `[writable]` rent_receiver
-#[derive(Clone, Debug, Default)]
-pub struct ClosePresetParameterBuilder {
-    preset_parameter: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    rent_receiver: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl ClosePresetParameterBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn preset_parameter(
-        &mut self,
-        preset_parameter: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.preset_parameter = Some(preset_parameter);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn rent_receiver(&mut self, rent_receiver: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent_receiver = Some(rent_receiver);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = ClosePresetParameter {
-            preset_parameter: self.preset_parameter.expect("preset_parameter is not set"),
-            admin: self.admin.expect("admin is not set"),
-            rent_receiver: self.rent_receiver.expect("rent_receiver is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `close_preset_parameter` CPI accounts.
-pub struct ClosePresetParameterCpiAccounts<'a, 'b> {
-    pub preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `close_preset_parameter` CPI instruction.
-pub struct ClosePresetParameterCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> ClosePresetParameterCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: ClosePresetParameterCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            preset_parameter: accounts.preset_parameter,
-            admin: accounts.admin,
-            rent_receiver: accounts.rent_receiver,
-        }
-    }
-    #[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(3 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.preset_parameter.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.rent_receiver.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 data = ClosePresetParameterInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(4 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.preset_parameter.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.rent_receiver.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)
-        }
-    }
-}
-
-/// Instruction builder for `ClosePresetParameter` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` preset_parameter
-///   1. `[writable, signer]` admin
-///   2. `[writable]` rent_receiver
-#[derive(Clone, Debug)]
-pub struct ClosePresetParameterCpiBuilder<'a, 'b> {
-    instruction: Box<ClosePresetParameterCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> ClosePresetParameterCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(ClosePresetParameterCpiBuilderInstruction {
-            __program: program,
-            preset_parameter: None,
-            admin: None,
-            rent_receiver: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn preset_parameter(
-        &mut self,
-        preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.preset_parameter = Some(preset_parameter);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn rent_receiver(
-        &mut self,
-        rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.rent_receiver = Some(rent_receiver);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = ClosePresetParameterCpi {
-            __program: self.instruction.__program,
-
-            preset_parameter: self
-                .instruction
-                .preset_parameter
-                .expect("preset_parameter is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            rent_receiver: self
-                .instruction
-                .rent_receiver
-                .expect("rent_receiver is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct ClosePresetParameterCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    preset_parameter: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent_receiver: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 693
packages/renderers-rust/e2e/meteora/src/generated/instructions/fund_reward.rs

@@ -1,693 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct FundReward {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub reward_vault: solana_program::pubkey::Pubkey,
-
-    pub reward_mint: solana_program::pubkey::Pubkey,
-
-    pub funder_token_account: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub bin_array: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl FundReward {
-    pub fn instruction(
-        &self,
-        args: FundRewardInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: FundRewardInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reward_vault,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.reward_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder_token_account,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = FundRewardInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct FundRewardInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl FundRewardInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [188, 50, 249, 165, 93, 151, 38, 63],
-        }
-    }
-}
-
-impl Default for FundRewardInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct FundRewardInstructionArgs {
-    pub reward_index: u64,
-    pub amount: u64,
-    pub carry_forward: bool,
-}
-
-/// Instruction builder for `FundReward`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reward_vault
-///   2. `[]` reward_mint
-///   3. `[writable]` funder_token_account
-///   4. `[signer]` funder
-///   5. `[writable]` bin_array
-///   6. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct FundRewardBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    reward_vault: Option<solana_program::pubkey::Pubkey>,
-    reward_mint: Option<solana_program::pubkey::Pubkey>,
-    funder_token_account: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    bin_array: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    reward_index: Option<u64>,
-    amount: Option<u64>,
-    carry_forward: Option<bool>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl FundRewardBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(&mut self, reward_vault: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(&mut self, reward_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn funder_token_account(
-        &mut self,
-        funder_token_account: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.funder_token_account = Some(funder_token_account);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(&mut self, bin_array: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.bin_array = Some(bin_array);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn amount(&mut self, amount: u64) -> &mut Self {
-        self.amount = Some(amount);
-        self
-    }
-    #[inline(always)]
-    pub fn carry_forward(&mut self, carry_forward: bool) -> &mut Self {
-        self.carry_forward = Some(carry_forward);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = FundReward {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            reward_vault: self.reward_vault.expect("reward_vault is not set"),
-            reward_mint: self.reward_mint.expect("reward_mint is not set"),
-            funder_token_account: self
-                .funder_token_account
-                .expect("funder_token_account is not set"),
-            funder: self.funder.expect("funder is not set"),
-            bin_array: self.bin_array.expect("bin_array is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = FundRewardInstructionArgs {
-            reward_index: self.reward_index.clone().expect("reward_index is not set"),
-            amount: self.amount.clone().expect("amount is not set"),
-            carry_forward: self
-                .carry_forward
-                .clone()
-                .expect("carry_forward is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `fund_reward` CPI accounts.
-pub struct FundRewardCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `fund_reward` CPI instruction.
-pub struct FundRewardCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: FundRewardInstructionArgs,
-}
-
-impl<'a, 'b> FundRewardCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: FundRewardCpiAccounts<'a, 'b>,
-        args: FundRewardInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            reward_vault: accounts.reward_vault,
-            reward_mint: accounts.reward_mint,
-            funder_token_account: accounts.funder_token_account,
-            funder: accounts.funder,
-            bin_array: accounts.bin_array,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reward_vault.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.reward_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder_token_account.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = FundRewardInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(10 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.reward_vault.clone());
-        account_infos.push(self.reward_mint.clone());
-        account_infos.push(self.funder_token_account.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.bin_array.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `FundReward` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reward_vault
-///   2. `[]` reward_mint
-///   3. `[writable]` funder_token_account
-///   4. `[signer]` funder
-///   5. `[writable]` bin_array
-///   6. `[]` token_program
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug)]
-pub struct FundRewardCpiBuilder<'a, 'b> {
-    instruction: Box<FundRewardCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> FundRewardCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(FundRewardCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            reward_vault: None,
-            reward_mint: None,
-            funder_token_account: None,
-            funder: None,
-            bin_array: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            reward_index: None,
-            amount: None,
-            carry_forward: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(
-        &mut self,
-        reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(
-        &mut self,
-        reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn funder_token_account(
-        &mut self,
-        funder_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder_token_account = Some(funder_token_account);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(
-        &mut self,
-        bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array = Some(bin_array);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.instruction.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn amount(&mut self, amount: u64) -> &mut Self {
-        self.instruction.amount = Some(amount);
-        self
-    }
-    #[inline(always)]
-    pub fn carry_forward(&mut self, carry_forward: bool) -> &mut Self {
-        self.instruction.carry_forward = Some(carry_forward);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = FundRewardInstructionArgs {
-            reward_index: self
-                .instruction
-                .reward_index
-                .clone()
-                .expect("reward_index is not set"),
-            amount: self.instruction.amount.clone().expect("amount is not set"),
-            carry_forward: self
-                .instruction
-                .carry_forward
-                .clone()
-                .expect("carry_forward is not set"),
-        };
-        let instruction = FundRewardCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            reward_vault: self
-                .instruction
-                .reward_vault
-                .expect("reward_vault is not set"),
-
-            reward_mint: self
-                .instruction
-                .reward_mint
-                .expect("reward_mint is not set"),
-
-            funder_token_account: self
-                .instruction
-                .funder_token_account
-                .expect("funder_token_account is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            bin_array: self.instruction.bin_array.expect("bin_array is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct FundRewardCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder_token_account: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_index: Option<u64>,
-    amount: Option<u64>,
-    carry_forward: Option<bool>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 582
packages/renderers-rust/e2e/meteora/src/generated/instructions/go_to_a_bin.rs

@@ -1,582 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct GoToABin {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub from_bin_array: Option<solana_program::pubkey::Pubkey>,
-
-    pub to_bin_array: Option<solana_program::pubkey::Pubkey>,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl GoToABin {
-    pub fn instruction(
-        &self,
-        args: GoToABinInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: GoToABinInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(6 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        if let Some(from_bin_array) = self.from_bin_array {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                from_bin_array,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        if let Some(to_bin_array) = self.to_bin_array {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                to_bin_array,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = GoToABinInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct GoToABinInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl GoToABinInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [146, 72, 174, 224, 40, 253, 84, 174],
-        }
-    }
-}
-
-impl Default for GoToABinInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct GoToABinInstructionArgs {
-    pub bin_id: i32,
-}
-
-/// Instruction builder for `GoToABin`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[optional]` from_bin_array
-///   3. `[optional]` to_bin_array
-///   4. `[]` event_authority
-///   5. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct GoToABinBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    from_bin_array: Option<solana_program::pubkey::Pubkey>,
-    to_bin_array: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    bin_id: Option<i32>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl GoToABinBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn from_bin_array(
-        &mut self,
-        from_bin_array: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.from_bin_array = from_bin_array;
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn to_bin_array(
-        &mut self,
-        to_bin_array: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.to_bin_array = to_bin_array;
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_id(&mut self, bin_id: i32) -> &mut Self {
-        self.bin_id = Some(bin_id);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = GoToABin {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            from_bin_array: self.from_bin_array,
-            to_bin_array: self.to_bin_array,
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = GoToABinInstructionArgs {
-            bin_id: self.bin_id.clone().expect("bin_id is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `go_to_a_bin` CPI accounts.
-pub struct GoToABinCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub from_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub to_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `go_to_a_bin` CPI instruction.
-pub struct GoToABinCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub from_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub to_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: GoToABinInstructionArgs,
-}
-
-impl<'a, 'b> GoToABinCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: GoToABinCpiAccounts<'a, 'b>,
-        args: GoToABinInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            from_bin_array: accounts.from_bin_array,
-            to_bin_array: accounts.to_bin_array,
-            event_authority: accounts.event_authority,
-            program: accounts.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(6 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        if let Some(from_bin_array) = self.from_bin_array {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                *from_bin_array.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        if let Some(to_bin_array) = self.to_bin_array {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                *to_bin_array.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = GoToABinInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(7 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        if let Some(from_bin_array) = self.from_bin_array {
-            account_infos.push(from_bin_array.clone());
-        }
-        if let Some(to_bin_array) = self.to_bin_array {
-            account_infos.push(to_bin_array.clone());
-        }
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `GoToABin` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[optional]` from_bin_array
-///   3. `[optional]` to_bin_array
-///   4. `[]` event_authority
-///   5. `[]` program
-#[derive(Clone, Debug)]
-pub struct GoToABinCpiBuilder<'a, 'b> {
-    instruction: Box<GoToABinCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> GoToABinCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(GoToABinCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            from_bin_array: None,
-            to_bin_array: None,
-            event_authority: None,
-            program: None,
-            bin_id: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn from_bin_array(
-        &mut self,
-        from_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.from_bin_array = from_bin_array;
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn to_bin_array(
-        &mut self,
-        to_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.to_bin_array = to_bin_array;
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_id(&mut self, bin_id: i32) -> &mut Self {
-        self.instruction.bin_id = Some(bin_id);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = GoToABinInstructionArgs {
-            bin_id: self.instruction.bin_id.clone().expect("bin_id is not set"),
-        };
-        let instruction = GoToABinCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            from_bin_array: self.instruction.from_bin_array,
-
-            to_bin_array: self.instruction.to_bin_array,
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct GoToABinCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    from_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    to_bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_id: Option<i32>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 499
packages/renderers-rust/e2e/meteora/src/generated/instructions/increase_oracle_length.rs

@@ -1,499 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct IncreaseOracleLength {
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl IncreaseOracleLength {
-    pub fn instruction(
-        &self,
-        args: IncreaseOracleLengthInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: IncreaseOracleLengthInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = IncreaseOracleLengthInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct IncreaseOracleLengthInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl IncreaseOracleLengthInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [190, 61, 125, 87, 103, 79, 158, 173],
-        }
-    }
-}
-
-impl Default for IncreaseOracleLengthInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct IncreaseOracleLengthInstructionArgs {
-    pub length_to_add: u64,
-}
-
-/// Instruction builder for `IncreaseOracleLength`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` oracle
-///   1. `[writable, signer]` funder
-///   2. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   3. `[]` event_authority
-///   4. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct IncreaseOracleLengthBuilder {
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    length_to_add: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl IncreaseOracleLengthBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn length_to_add(&mut self, length_to_add: u64) -> &mut Self {
-        self.length_to_add = Some(length_to_add);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = IncreaseOracleLength {
-            oracle: self.oracle.expect("oracle is not set"),
-            funder: self.funder.expect("funder is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = IncreaseOracleLengthInstructionArgs {
-            length_to_add: self
-                .length_to_add
-                .clone()
-                .expect("length_to_add is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `increase_oracle_length` CPI accounts.
-pub struct IncreaseOracleLengthCpiAccounts<'a, 'b> {
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `increase_oracle_length` CPI instruction.
-pub struct IncreaseOracleLengthCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: IncreaseOracleLengthInstructionArgs,
-}
-
-impl<'a, 'b> IncreaseOracleLengthCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: IncreaseOracleLengthCpiAccounts<'a, 'b>,
-        args: IncreaseOracleLengthInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            oracle: accounts.oracle,
-            funder: accounts.funder,
-            system_program: accounts.system_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = IncreaseOracleLengthInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(6 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.oracle.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `IncreaseOracleLength` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` oracle
-///   1. `[writable, signer]` funder
-///   2. `[]` system_program
-///   3. `[]` event_authority
-///   4. `[]` program
-#[derive(Clone, Debug)]
-pub struct IncreaseOracleLengthCpiBuilder<'a, 'b> {
-    instruction: Box<IncreaseOracleLengthCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> IncreaseOracleLengthCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(IncreaseOracleLengthCpiBuilderInstruction {
-            __program: program,
-            oracle: None,
-            funder: None,
-            system_program: None,
-            event_authority: None,
-            program: None,
-            length_to_add: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn length_to_add(&mut self, length_to_add: u64) -> &mut Self {
-        self.instruction.length_to_add = Some(length_to_add);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = IncreaseOracleLengthInstructionArgs {
-            length_to_add: self
-                .instruction
-                .length_to_add
-                .clone()
-                .expect("length_to_add is not set"),
-        };
-        let instruction = IncreaseOracleLengthCpi {
-            __program: self.instruction.__program,
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct IncreaseOracleLengthCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    length_to_add: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 449
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_bin_array.rs

@@ -1,449 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializeBinArray {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializeBinArray {
-    pub fn instruction(
-        &self,
-        args: InitializeBinArrayInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializeBinArrayInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializeBinArrayInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeBinArrayInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializeBinArrayInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [35, 86, 19, 185, 78, 212, 75, 211],
-        }
-    }
-}
-
-impl Default for InitializeBinArrayInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeBinArrayInstructionArgs {
-    pub index: i64,
-}
-
-/// Instruction builder for `InitializeBinArray`.
-///
-/// ### Accounts:
-///
-///   0. `[]` lb_pair
-///   1. `[writable]` bin_array
-///   2. `[writable, signer]` funder
-///   3. `[optional]` system_program (default to `11111111111111111111111111111111`)
-#[derive(Clone, Debug, Default)]
-pub struct InitializeBinArrayBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    index: Option<i64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializeBinArrayBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(&mut self, bin_array: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.bin_array = Some(bin_array);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn index(&mut self, index: i64) -> &mut Self {
-        self.index = Some(index);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializeBinArray {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array: self.bin_array.expect("bin_array is not set"),
-            funder: self.funder.expect("funder is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-        };
-        let args = InitializeBinArrayInstructionArgs {
-            index: self.index.clone().expect("index is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_bin_array` CPI accounts.
-pub struct InitializeBinArrayCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_bin_array` CPI instruction.
-pub struct InitializeBinArrayCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializeBinArrayInstructionArgs,
-}
-
-impl<'a, 'b> InitializeBinArrayCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializeBinArrayCpiAccounts<'a, 'b>,
-        args: InitializeBinArrayInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array: accounts.bin_array,
-            funder: accounts.funder,
-            system_program: accounts.system_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(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_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 = InitializeBinArrayInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.bin_array.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.system_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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializeBinArray` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[]` lb_pair
-///   1. `[writable]` bin_array
-///   2. `[writable, signer]` funder
-///   3. `[]` system_program
-#[derive(Clone, Debug)]
-pub struct InitializeBinArrayCpiBuilder<'a, 'b> {
-    instruction: Box<InitializeBinArrayCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializeBinArrayCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializeBinArrayCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array: None,
-            funder: None,
-            system_program: None,
-            index: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(
-        &mut self,
-        bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array = Some(bin_array);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn index(&mut self, index: i64) -> &mut Self {
-        self.instruction.index = Some(index);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializeBinArrayInstructionArgs {
-            index: self.instruction.index.clone().expect("index is not set"),
-        };
-        let instruction = InitializeBinArrayCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array: self.instruction.bin_array.expect("bin_array is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializeBinArrayCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    index: Option<i64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 457
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_bin_array_bitmap_extension.rs

@@ -1,457 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializeBinArrayBitmapExtension {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-    /// Initialize an account to store if a bin array is initialized.
-    pub bin_array_bitmap_extension: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-}
-
-impl InitializeBinArrayBitmapExtension {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_bitmap_extension,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = InitializeBinArrayBitmapExtensionInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeBinArrayBitmapExtensionInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializeBinArrayBitmapExtensionInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [47, 157, 226, 180, 12, 240, 33, 71],
-        }
-    }
-}
-
-impl Default for InitializeBinArrayBitmapExtensionInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `InitializeBinArrayBitmapExtension`.
-///
-/// ### Accounts:
-///
-///   0. `[]` lb_pair
-///   1. `[writable]` bin_array_bitmap_extension
-///   2. `[writable, signer]` funder
-///   3. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   4. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-#[derive(Clone, Debug, Default)]
-pub struct InitializeBinArrayBitmapExtensionBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializeBinArrayBitmapExtensionBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// Initialize an account to store if a bin array is initialized.
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = Some(bin_array_bitmap_extension);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializeBinArrayBitmapExtension {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self
-                .bin_array_bitmap_extension
-                .expect("bin_array_bitmap_extension is not set"),
-            funder: self.funder.expect("funder is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `initialize_bin_array_bitmap_extension` CPI accounts.
-pub struct InitializeBinArrayBitmapExtensionCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    /// Initialize an account to store if a bin array is initialized.
-    pub bin_array_bitmap_extension: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_bin_array_bitmap_extension` CPI instruction.
-pub struct InitializeBinArrayBitmapExtensionCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    /// Initialize an account to store if a bin array is initialized.
-    pub bin_array_bitmap_extension: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> InitializeBinArrayBitmapExtensionCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializeBinArrayBitmapExtensionCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            funder: accounts.funder,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-        }
-    }
-    #[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(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_bitmap_extension.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.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 data = InitializeBinArrayBitmapExtensionInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(6 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.bin_array_bitmap_extension.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializeBinArrayBitmapExtension` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[]` lb_pair
-///   1. `[writable]` bin_array_bitmap_extension
-///   2. `[writable, signer]` funder
-///   3. `[]` system_program
-///   4. `[]` rent
-#[derive(Clone, Debug)]
-pub struct InitializeBinArrayBitmapExtensionCpiBuilder<'a, 'b> {
-    instruction: Box<InitializeBinArrayBitmapExtensionCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializeBinArrayBitmapExtensionCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializeBinArrayBitmapExtensionCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            funder: None,
-            system_program: None,
-            rent: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// Initialize an account to store if a bin array is initialized.
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = Some(bin_array_bitmap_extension);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = InitializeBinArrayBitmapExtensionCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self
-                .instruction
-                .bin_array_bitmap_extension
-                .expect("bin_array_bitmap_extension is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializeBinArrayBitmapExtensionCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 990
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_customizable_permissionless_lb_pair.rs

@@ -1,990 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializeCustomizablePermissionlessLbPair {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub token_mint_x: solana_program::pubkey::Pubkey,
-
-    pub token_mint_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializeCustomizablePermissionlessLbPair {
-    pub fn instruction(
-        &self,
-        args: InitializeCustomizablePermissionlessLbPairInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializeCustomizablePermissionlessLbPairInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializeCustomizablePermissionlessLbPairInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeCustomizablePermissionlessLbPairInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializeCustomizablePermissionlessLbPairInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [46, 39, 41, 135, 111, 183, 200, 64],
-        }
-    }
-}
-
-impl Default for InitializeCustomizablePermissionlessLbPairInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeCustomizablePermissionlessLbPairInstructionArgs {
-    pub active_id: i32,
-    pub bin_step: u16,
-    pub base_factor: u16,
-    pub activation_type: u8,
-    pub has_alpha_vault: bool,
-    pub activation_point: Option<u64>,
-    pub padding: [u8; 64],
-}
-
-/// Instruction builder for `InitializeCustomizablePermissionlessLbPair`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable, optional]` bin_array_bitmap_extension
-///   2. `[]` token_mint_x
-///   3. `[]` token_mint_y
-///   4. `[writable]` reserve_x
-///   5. `[writable]` reserve_y
-///   6. `[writable]` oracle
-///   7. `[]` user_token_x
-///   8. `[writable, signer]` funder
-///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   10. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   11. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializeCustomizablePermissionlessLbPairBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    token_mint_x: Option<solana_program::pubkey::Pubkey>,
-    token_mint_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    active_id: Option<i32>,
-    bin_step: Option<u16>,
-    base_factor: Option<u16>,
-    activation_type: Option<u8>,
-    has_alpha_vault: Option<bool>,
-    activation_point: Option<u64>,
-    padding: Option<[u8; 64]>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializeCustomizablePermissionlessLbPairBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_x(&mut self, token_mint_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint_x = Some(token_mint_x);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_y(&mut self, token_mint_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint_y = Some(token_mint_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[inline(always)]
-    pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_program = Some(token_program);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.bin_step = Some(bin_step);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.base_factor = Some(base_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn activation_type(&mut self, activation_type: u8) -> &mut Self {
-        self.activation_type = Some(activation_type);
-        self
-    }
-    #[inline(always)]
-    pub fn has_alpha_vault(&mut self, has_alpha_vault: bool) -> &mut Self {
-        self.has_alpha_vault = Some(has_alpha_vault);
-        self
-    }
-    /// `[optional argument]`
-    #[inline(always)]
-    pub fn activation_point(&mut self, activation_point: u64) -> &mut Self {
-        self.activation_point = Some(activation_point);
-        self
-    }
-    #[inline(always)]
-    pub fn padding(&mut self, padding: [u8; 64]) -> &mut Self {
-        self.padding = Some(padding);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializeCustomizablePermissionlessLbPair {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            token_mint_x: self.token_mint_x.expect("token_mint_x is not set"),
-            token_mint_y: self.token_mint_y.expect("token_mint_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            oracle: self.oracle.expect("oracle is not set"),
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            funder: self.funder.expect("funder is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializeCustomizablePermissionlessLbPairInstructionArgs {
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            bin_step: self.bin_step.clone().expect("bin_step is not set"),
-            base_factor: self.base_factor.clone().expect("base_factor is not set"),
-            activation_type: self
-                .activation_type
-                .clone()
-                .expect("activation_type is not set"),
-            has_alpha_vault: self
-                .has_alpha_vault
-                .clone()
-                .expect("has_alpha_vault is not set"),
-            activation_point: self.activation_point.clone(),
-            padding: self.padding.clone().expect("padding is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_customizable_permissionless_lb_pair` CPI accounts.
-pub struct InitializeCustomizablePermissionlessLbPairCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_customizable_permissionless_lb_pair` CPI instruction.
-pub struct InitializeCustomizablePermissionlessLbPairCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializeCustomizablePermissionlessLbPairInstructionArgs,
-}
-
-impl<'a, 'b> InitializeCustomizablePermissionlessLbPairCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializeCustomizablePermissionlessLbPairCpiAccounts<'a, 'b>,
-        args: InitializeCustomizablePermissionlessLbPairInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            token_mint_x: accounts.token_mint_x,
-            token_mint_y: accounts.token_mint_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            oracle: accounts.oracle,
-            user_token_x: accounts.user_token_x,
-            funder: accounts.funder,
-            token_program: accounts.token_program,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            event_authority: accounts.event_authority,
-            program: accounts.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(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializeCustomizablePermissionlessLbPairInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(15 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.token_mint_x.clone());
-        account_infos.push(self.token_mint_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.oracle.clone());
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializeCustomizablePermissionlessLbPair` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable, optional]` bin_array_bitmap_extension
-///   2. `[]` token_mint_x
-///   3. `[]` token_mint_y
-///   4. `[writable]` reserve_x
-///   5. `[writable]` reserve_y
-///   6. `[writable]` oracle
-///   7. `[]` user_token_x
-///   8. `[writable, signer]` funder
-///   9. `[]` token_program
-///   10. `[]` system_program
-///   11. `[]` rent
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializeCustomizablePermissionlessLbPairCpiBuilder<'a, 'b> {
-    instruction: Box<InitializeCustomizablePermissionlessLbPairCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializeCustomizablePermissionlessLbPairCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(
-            InitializeCustomizablePermissionlessLbPairCpiBuilderInstruction {
-                __program: program,
-                lb_pair: None,
-                bin_array_bitmap_extension: None,
-                token_mint_x: None,
-                token_mint_y: None,
-                reserve_x: None,
-                reserve_y: None,
-                oracle: None,
-                user_token_x: None,
-                funder: None,
-                token_program: None,
-                system_program: None,
-                rent: None,
-                event_authority: None,
-                program: None,
-                active_id: None,
-                bin_step: None,
-                base_factor: None,
-                activation_type: None,
-                has_alpha_vault: None,
-                activation_point: None,
-                padding: None,
-                __remaining_accounts: Vec::new(),
-            },
-        );
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_x(
-        &mut self,
-        token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint_x = Some(token_mint_x);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_y(
-        &mut self,
-        token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint_y = Some(token_mint_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        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 system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.instruction.bin_step = Some(bin_step);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.instruction.base_factor = Some(base_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn activation_type(&mut self, activation_type: u8) -> &mut Self {
-        self.instruction.activation_type = Some(activation_type);
-        self
-    }
-    #[inline(always)]
-    pub fn has_alpha_vault(&mut self, has_alpha_vault: bool) -> &mut Self {
-        self.instruction.has_alpha_vault = Some(has_alpha_vault);
-        self
-    }
-    /// `[optional argument]`
-    #[inline(always)]
-    pub fn activation_point(&mut self, activation_point: u64) -> &mut Self {
-        self.instruction.activation_point = Some(activation_point);
-        self
-    }
-    #[inline(always)]
-    pub fn padding(&mut self, padding: [u8; 64]) -> &mut Self {
-        self.instruction.padding = Some(padding);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializeCustomizablePermissionlessLbPairInstructionArgs {
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            bin_step: self
-                .instruction
-                .bin_step
-                .clone()
-                .expect("bin_step is not set"),
-            base_factor: self
-                .instruction
-                .base_factor
-                .clone()
-                .expect("base_factor is not set"),
-            activation_type: self
-                .instruction
-                .activation_type
-                .clone()
-                .expect("activation_type is not set"),
-            has_alpha_vault: self
-                .instruction
-                .has_alpha_vault
-                .clone()
-                .expect("has_alpha_vault is not set"),
-            activation_point: self.instruction.activation_point.clone(),
-            padding: self
-                .instruction
-                .padding
-                .clone()
-                .expect("padding is not set"),
-        };
-        let instruction = InitializeCustomizablePermissionlessLbPairCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            token_mint_x: self
-                .instruction
-                .token_mint_x
-                .expect("token_mint_x is not set"),
-
-            token_mint_y: self
-                .instruction
-                .token_mint_y
-                .expect("token_mint_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializeCustomizablePermissionlessLbPairCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    active_id: Option<i32>,
-    bin_step: Option<u16>,
-    base_factor: Option<u16>,
-    activation_type: Option<u8>,
-    has_alpha_vault: Option<bool>,
-    activation_point: Option<u64>,
-    padding: Option<[u8; 64]>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 883
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_lb_pair.rs

@@ -1,883 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializeLbPair {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub token_mint_x: solana_program::pubkey::Pubkey,
-
-    pub token_mint_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub preset_parameter: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializeLbPair {
-    pub fn instruction(
-        &self,
-        args: InitializeLbPairInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializeLbPairInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.preset_parameter,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializeLbPairInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeLbPairInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializeLbPairInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [45, 154, 237, 210, 221, 15, 166, 92],
-        }
-    }
-}
-
-impl Default for InitializeLbPairInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeLbPairInstructionArgs {
-    pub active_id: i32,
-    pub bin_step: u16,
-}
-
-/// Instruction builder for `InitializeLbPair`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable, optional]` bin_array_bitmap_extension
-///   2. `[]` token_mint_x
-///   3. `[]` token_mint_y
-///   4. `[writable]` reserve_x
-///   5. `[writable]` reserve_y
-///   6. `[writable]` oracle
-///   7. `[]` preset_parameter
-///   8. `[writable, signer]` funder
-///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   10. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   11. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializeLbPairBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    token_mint_x: Option<solana_program::pubkey::Pubkey>,
-    token_mint_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    preset_parameter: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    active_id: Option<i32>,
-    bin_step: Option<u16>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializeLbPairBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_x(&mut self, token_mint_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint_x = Some(token_mint_x);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_y(&mut self, token_mint_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint_y = Some(token_mint_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn preset_parameter(
-        &mut self,
-        preset_parameter: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.preset_parameter = Some(preset_parameter);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[inline(always)]
-    pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_program = Some(token_program);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.bin_step = Some(bin_step);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializeLbPair {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            token_mint_x: self.token_mint_x.expect("token_mint_x is not set"),
-            token_mint_y: self.token_mint_y.expect("token_mint_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            oracle: self.oracle.expect("oracle is not set"),
-            preset_parameter: self.preset_parameter.expect("preset_parameter is not set"),
-            funder: self.funder.expect("funder is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializeLbPairInstructionArgs {
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            bin_step: self.bin_step.clone().expect("bin_step is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_lb_pair` CPI accounts.
-pub struct InitializeLbPairCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_lb_pair` CPI instruction.
-pub struct InitializeLbPairCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializeLbPairInstructionArgs,
-}
-
-impl<'a, 'b> InitializeLbPairCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializeLbPairCpiAccounts<'a, 'b>,
-        args: InitializeLbPairInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            token_mint_x: accounts.token_mint_x,
-            token_mint_y: accounts.token_mint_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            oracle: accounts.oracle,
-            preset_parameter: accounts.preset_parameter,
-            funder: accounts.funder,
-            token_program: accounts.token_program,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            event_authority: accounts.event_authority,
-            program: accounts.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(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.preset_parameter.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializeLbPairInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(15 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.token_mint_x.clone());
-        account_infos.push(self.token_mint_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.oracle.clone());
-        account_infos.push(self.preset_parameter.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializeLbPair` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable, optional]` bin_array_bitmap_extension
-///   2. `[]` token_mint_x
-///   3. `[]` token_mint_y
-///   4. `[writable]` reserve_x
-///   5. `[writable]` reserve_y
-///   6. `[writable]` oracle
-///   7. `[]` preset_parameter
-///   8. `[writable, signer]` funder
-///   9. `[]` token_program
-///   10. `[]` system_program
-///   11. `[]` rent
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializeLbPairCpiBuilder<'a, 'b> {
-    instruction: Box<InitializeLbPairCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializeLbPairCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializeLbPairCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            token_mint_x: None,
-            token_mint_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            oracle: None,
-            preset_parameter: None,
-            funder: None,
-            token_program: None,
-            system_program: None,
-            rent: None,
-            event_authority: None,
-            program: None,
-            active_id: None,
-            bin_step: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_x(
-        &mut self,
-        token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint_x = Some(token_mint_x);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_y(
-        &mut self,
-        token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint_y = Some(token_mint_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn preset_parameter(
-        &mut self,
-        preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.preset_parameter = Some(preset_parameter);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        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 system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.instruction.bin_step = Some(bin_step);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializeLbPairInstructionArgs {
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            bin_step: self
-                .instruction
-                .bin_step
-                .clone()
-                .expect("bin_step is not set"),
-        };
-        let instruction = InitializeLbPairCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            token_mint_x: self
-                .instruction
-                .token_mint_x
-                .expect("token_mint_x is not set"),
-
-            token_mint_y: self
-                .instruction
-                .token_mint_y
-                .expect("token_mint_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            preset_parameter: self
-                .instruction
-                .preset_parameter
-                .expect("preset_parameter is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializeLbPairCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    preset_parameter: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    active_id: Option<i32>,
-    bin_step: Option<u16>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 956
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_permission_lb_pair.rs

@@ -1,956 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializePermissionLbPair {
-    pub base: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub token_mint_x: solana_program::pubkey::Pubkey,
-
-    pub token_mint_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializePermissionLbPair {
-    pub fn instruction(
-        &self,
-        args: InitializePermissionLbPairInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializePermissionLbPairInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.base, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_mint_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializePermissionLbPairInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePermissionLbPairInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializePermissionLbPairInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [108, 102, 213, 85, 251, 3, 53, 21],
-        }
-    }
-}
-
-impl Default for InitializePermissionLbPairInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePermissionLbPairInstructionArgs {
-    pub active_id: i32,
-    pub bin_step: u16,
-    pub base_factor: u16,
-    pub min_bin_id: i32,
-    pub max_bin_id: i32,
-    pub activation_type: u8,
-}
-
-/// Instruction builder for `InitializePermissionLbPair`.
-///
-/// ### Accounts:
-///
-///   0. `[signer]` base
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[]` token_mint_x
-///   4. `[]` token_mint_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[writable]` oracle
-///   8. `[writable, signer]` admin
-///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   10. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   11. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializePermissionLbPairBuilder {
-    base: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    token_mint_x: Option<solana_program::pubkey::Pubkey>,
-    token_mint_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    active_id: Option<i32>,
-    bin_step: Option<u16>,
-    base_factor: Option<u16>,
-    min_bin_id: Option<i32>,
-    max_bin_id: Option<i32>,
-    activation_type: Option<u8>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializePermissionLbPairBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn base(&mut self, base: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.base = Some(base);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_x(&mut self, token_mint_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint_x = Some(token_mint_x);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_y(&mut self, token_mint_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_mint_y = Some(token_mint_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[inline(always)]
-    pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_program = Some(token_program);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.bin_step = Some(bin_step);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.base_factor = Some(base_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn min_bin_id(&mut self, min_bin_id: i32) -> &mut Self {
-        self.min_bin_id = Some(min_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_bin_id(&mut self, max_bin_id: i32) -> &mut Self {
-        self.max_bin_id = Some(max_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn activation_type(&mut self, activation_type: u8) -> &mut Self {
-        self.activation_type = Some(activation_type);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializePermissionLbPair {
-            base: self.base.expect("base is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            token_mint_x: self.token_mint_x.expect("token_mint_x is not set"),
-            token_mint_y: self.token_mint_y.expect("token_mint_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            oracle: self.oracle.expect("oracle is not set"),
-            admin: self.admin.expect("admin is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializePermissionLbPairInstructionArgs {
-            active_id: self.active_id.clone().expect("active_id is not set"),
-            bin_step: self.bin_step.clone().expect("bin_step is not set"),
-            base_factor: self.base_factor.clone().expect("base_factor is not set"),
-            min_bin_id: self.min_bin_id.clone().expect("min_bin_id is not set"),
-            max_bin_id: self.max_bin_id.clone().expect("max_bin_id is not set"),
-            activation_type: self
-                .activation_type
-                .clone()
-                .expect("activation_type is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_permission_lb_pair` CPI accounts.
-pub struct InitializePermissionLbPairCpiAccounts<'a, 'b> {
-    pub base: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_permission_lb_pair` CPI instruction.
-pub struct InitializePermissionLbPairCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub base: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializePermissionLbPairInstructionArgs,
-}
-
-impl<'a, 'b> InitializePermissionLbPairCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializePermissionLbPairCpiAccounts<'a, 'b>,
-        args: InitializePermissionLbPairInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            base: accounts.base,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            token_mint_x: accounts.token_mint_x,
-            token_mint_y: accounts.token_mint_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            oracle: accounts.oracle,
-            admin: accounts.admin,
-            token_program: accounts.token_program,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            event_authority: accounts.event_authority,
-            program: accounts.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(14 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.base.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_mint_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializePermissionLbPairInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(15 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.base.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.token_mint_x.clone());
-        account_infos.push(self.token_mint_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.oracle.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializePermissionLbPair` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[signer]` base
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[]` token_mint_x
-///   4. `[]` token_mint_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[writable]` oracle
-///   8. `[writable, signer]` admin
-///   9. `[]` token_program
-///   10. `[]` system_program
-///   11. `[]` rent
-///   12. `[]` event_authority
-///   13. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializePermissionLbPairCpiBuilder<'a, 'b> {
-    instruction: Box<InitializePermissionLbPairCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializePermissionLbPairCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializePermissionLbPairCpiBuilderInstruction {
-            __program: program,
-            base: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            token_mint_x: None,
-            token_mint_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            oracle: None,
-            admin: None,
-            token_program: None,
-            system_program: None,
-            rent: None,
-            event_authority: None,
-            program: None,
-            active_id: None,
-            bin_step: None,
-            base_factor: None,
-            min_bin_id: None,
-            max_bin_id: None,
-            activation_type: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn base(&mut self, base: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.base = Some(base);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_x(
-        &mut self,
-        token_mint_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint_x = Some(token_mint_x);
-        self
-    }
-    #[inline(always)]
-    pub fn token_mint_y(
-        &mut self,
-        token_mint_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_mint_y = Some(token_mint_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        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 system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.instruction.bin_step = Some(bin_step);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.instruction.base_factor = Some(base_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn min_bin_id(&mut self, min_bin_id: i32) -> &mut Self {
-        self.instruction.min_bin_id = Some(min_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_bin_id(&mut self, max_bin_id: i32) -> &mut Self {
-        self.instruction.max_bin_id = Some(max_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn activation_type(&mut self, activation_type: u8) -> &mut Self {
-        self.instruction.activation_type = Some(activation_type);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializePermissionLbPairInstructionArgs {
-            active_id: self
-                .instruction
-                .active_id
-                .clone()
-                .expect("active_id is not set"),
-            bin_step: self
-                .instruction
-                .bin_step
-                .clone()
-                .expect("bin_step is not set"),
-            base_factor: self
-                .instruction
-                .base_factor
-                .clone()
-                .expect("base_factor is not set"),
-            min_bin_id: self
-                .instruction
-                .min_bin_id
-                .clone()
-                .expect("min_bin_id is not set"),
-            max_bin_id: self
-                .instruction
-                .max_bin_id
-                .clone()
-                .expect("max_bin_id is not set"),
-            activation_type: self
-                .instruction
-                .activation_type
-                .clone()
-                .expect("activation_type is not set"),
-        };
-        let instruction = InitializePermissionLbPairCpi {
-            __program: self.instruction.__program,
-
-            base: self.instruction.base.expect("base is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            token_mint_x: self
-                .instruction
-                .token_mint_x
-                .expect("token_mint_x is not set"),
-
-            token_mint_y: self
-                .instruction
-                .token_mint_y
-                .expect("token_mint_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializePermissionLbPairCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    base: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_mint_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    active_id: Option<i32>,
-    bin_step: Option<u16>,
-    base_factor: Option<u16>,
-    min_bin_id: Option<i32>,
-    max_bin_id: Option<i32>,
-    activation_type: Option<u8>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 614
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_position.rs

@@ -1,614 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializePosition {
-    pub payer: solana_program::pubkey::Pubkey,
-
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub owner: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializePosition {
-    pub fn instruction(
-        &self,
-        args: InitializePositionInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializePositionInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(8 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.payer, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.owner, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializePositionInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePositionInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializePositionInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [219, 192, 234, 71, 190, 191, 102, 80],
-        }
-    }
-}
-
-impl Default for InitializePositionInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePositionInstructionArgs {
-    pub lower_bin_id: i32,
-    pub width: i32,
-}
-
-/// Instruction builder for `InitializePosition`.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` payer
-///   1. `[writable, signer]` position
-///   2. `[]` lb_pair
-///   3. `[signer]` owner
-///   4. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   5. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-///   6. `[]` event_authority
-///   7. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializePositionBuilder {
-    payer: Option<solana_program::pubkey::Pubkey>,
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    owner: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    lower_bin_id: Option<i32>,
-    width: Option<i32>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializePositionBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.payer = Some(payer);
-        self
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner = Some(owner);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn lower_bin_id(&mut self, lower_bin_id: i32) -> &mut Self {
-        self.lower_bin_id = Some(lower_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn width(&mut self, width: i32) -> &mut Self {
-        self.width = Some(width);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializePosition {
-            payer: self.payer.expect("payer is not set"),
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            owner: self.owner.expect("owner is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializePositionInstructionArgs {
-            lower_bin_id: self.lower_bin_id.clone().expect("lower_bin_id is not set"),
-            width: self.width.clone().expect("width is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_position` CPI accounts.
-pub struct InitializePositionCpiAccounts<'a, 'b> {
-    pub payer: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_position` CPI instruction.
-pub struct InitializePositionCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub payer: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializePositionInstructionArgs,
-}
-
-impl<'a, 'b> InitializePositionCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializePositionCpiAccounts<'a, 'b>,
-        args: InitializePositionInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            payer: accounts.payer,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            owner: accounts.owner,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            event_authority: accounts.event_authority,
-            program: accounts.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(8 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.payer.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.owner.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializePositionInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(9 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.payer.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.owner.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializePosition` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` payer
-///   1. `[writable, signer]` position
-///   2. `[]` lb_pair
-///   3. `[signer]` owner
-///   4. `[]` system_program
-///   5. `[]` rent
-///   6. `[]` event_authority
-///   7. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializePositionCpiBuilder<'a, 'b> {
-    instruction: Box<InitializePositionCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializePositionCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializePositionCpiBuilderInstruction {
-            __program: program,
-            payer: None,
-            position: None,
-            lb_pair: None,
-            owner: None,
-            system_program: None,
-            rent: None,
-            event_authority: None,
-            program: None,
-            lower_bin_id: None,
-            width: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.payer = Some(payer);
-        self
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.owner = Some(owner);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn lower_bin_id(&mut self, lower_bin_id: i32) -> &mut Self {
-        self.instruction.lower_bin_id = Some(lower_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn width(&mut self, width: i32) -> &mut Self {
-        self.instruction.width = Some(width);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializePositionInstructionArgs {
-            lower_bin_id: self
-                .instruction
-                .lower_bin_id
-                .clone()
-                .expect("lower_bin_id is not set"),
-            width: self.instruction.width.clone().expect("width is not set"),
-        };
-        let instruction = InitializePositionCpi {
-            __program: self.instruction.__program,
-
-            payer: self.instruction.payer.expect("payer is not set"),
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            owner: self.instruction.owner.expect("owner is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializePositionCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    payer: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lower_bin_id: Option<i32>,
-    width: Option<i32>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 777
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_position_by_operator.rs

@@ -1,777 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializePositionByOperator {
-    pub payer: solana_program::pubkey::Pubkey,
-
-    pub base: solana_program::pubkey::Pubkey,
-
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub owner: solana_program::pubkey::Pubkey,
-    /// operator
-    pub operator: solana_program::pubkey::Pubkey,
-
-    pub operator_token_x: solana_program::pubkey::Pubkey,
-
-    pub owner_token_x: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializePositionByOperator {
-    pub fn instruction(
-        &self,
-        args: InitializePositionByOperatorInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializePositionByOperatorInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(11 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.payer, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.base, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.owner, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.operator,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.operator_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.owner_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializePositionByOperatorInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePositionByOperatorInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializePositionByOperatorInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [251, 189, 190, 244, 117, 254, 35, 148],
-        }
-    }
-}
-
-impl Default for InitializePositionByOperatorInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePositionByOperatorInstructionArgs {
-    pub lower_bin_id: i32,
-    pub width: i32,
-    pub fee_owner: Pubkey,
-    pub lock_release_point: u64,
-}
-
-/// Instruction builder for `InitializePositionByOperator`.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` payer
-///   1. `[signer]` base
-///   2. `[writable]` position
-///   3. `[]` lb_pair
-///   4. `[]` owner
-///   5. `[signer]` operator
-///   6. `[]` operator_token_x
-///   7. `[]` owner_token_x
-///   8. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   9. `[]` event_authority
-///   10. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializePositionByOperatorBuilder {
-    payer: Option<solana_program::pubkey::Pubkey>,
-    base: Option<solana_program::pubkey::Pubkey>,
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    owner: Option<solana_program::pubkey::Pubkey>,
-    operator: Option<solana_program::pubkey::Pubkey>,
-    operator_token_x: Option<solana_program::pubkey::Pubkey>,
-    owner_token_x: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    lower_bin_id: Option<i32>,
-    width: Option<i32>,
-    fee_owner: Option<Pubkey>,
-    lock_release_point: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializePositionByOperatorBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.payer = Some(payer);
-        self
-    }
-    #[inline(always)]
-    pub fn base(&mut self, base: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.base = Some(base);
-        self
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner = Some(owner);
-        self
-    }
-    /// operator
-    #[inline(always)]
-    pub fn operator(&mut self, operator: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.operator = Some(operator);
-        self
-    }
-    #[inline(always)]
-    pub fn operator_token_x(
-        &mut self,
-        operator_token_x: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.operator_token_x = Some(operator_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn owner_token_x(&mut self, owner_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner_token_x = Some(owner_token_x);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn lower_bin_id(&mut self, lower_bin_id: i32) -> &mut Self {
-        self.lower_bin_id = Some(lower_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn width(&mut self, width: i32) -> &mut Self {
-        self.width = Some(width);
-        self
-    }
-    #[inline(always)]
-    pub fn fee_owner(&mut self, fee_owner: Pubkey) -> &mut Self {
-        self.fee_owner = Some(fee_owner);
-        self
-    }
-    #[inline(always)]
-    pub fn lock_release_point(&mut self, lock_release_point: u64) -> &mut Self {
-        self.lock_release_point = Some(lock_release_point);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializePositionByOperator {
-            payer: self.payer.expect("payer is not set"),
-            base: self.base.expect("base is not set"),
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            owner: self.owner.expect("owner is not set"),
-            operator: self.operator.expect("operator is not set"),
-            operator_token_x: self.operator_token_x.expect("operator_token_x is not set"),
-            owner_token_x: self.owner_token_x.expect("owner_token_x is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializePositionByOperatorInstructionArgs {
-            lower_bin_id: self.lower_bin_id.clone().expect("lower_bin_id is not set"),
-            width: self.width.clone().expect("width is not set"),
-            fee_owner: self.fee_owner.clone().expect("fee_owner is not set"),
-            lock_release_point: self
-                .lock_release_point
-                .clone()
-                .expect("lock_release_point is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_position_by_operator` CPI accounts.
-pub struct InitializePositionByOperatorCpiAccounts<'a, 'b> {
-    pub payer: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub base: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-    /// operator
-    pub operator: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub operator_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_position_by_operator` CPI instruction.
-pub struct InitializePositionByOperatorCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub payer: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub base: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-    /// operator
-    pub operator: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub operator_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializePositionByOperatorInstructionArgs,
-}
-
-impl<'a, 'b> InitializePositionByOperatorCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializePositionByOperatorCpiAccounts<'a, 'b>,
-        args: InitializePositionByOperatorInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            payer: accounts.payer,
-            base: accounts.base,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            owner: accounts.owner,
-            operator: accounts.operator,
-            operator_token_x: accounts.operator_token_x,
-            owner_token_x: accounts.owner_token_x,
-            system_program: accounts.system_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(11 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.payer.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.base.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.owner.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.operator.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.operator_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.owner_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializePositionByOperatorInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(12 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.payer.clone());
-        account_infos.push(self.base.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.owner.clone());
-        account_infos.push(self.operator.clone());
-        account_infos.push(self.operator_token_x.clone());
-        account_infos.push(self.owner_token_x.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializePositionByOperator` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` payer
-///   1. `[signer]` base
-///   2. `[writable]` position
-///   3. `[]` lb_pair
-///   4. `[]` owner
-///   5. `[signer]` operator
-///   6. `[]` operator_token_x
-///   7. `[]` owner_token_x
-///   8. `[]` system_program
-///   9. `[]` event_authority
-///   10. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializePositionByOperatorCpiBuilder<'a, 'b> {
-    instruction: Box<InitializePositionByOperatorCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializePositionByOperatorCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializePositionByOperatorCpiBuilderInstruction {
-            __program: program,
-            payer: None,
-            base: None,
-            position: None,
-            lb_pair: None,
-            owner: None,
-            operator: None,
-            operator_token_x: None,
-            owner_token_x: None,
-            system_program: None,
-            event_authority: None,
-            program: None,
-            lower_bin_id: None,
-            width: None,
-            fee_owner: None,
-            lock_release_point: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.payer = Some(payer);
-        self
-    }
-    #[inline(always)]
-    pub fn base(&mut self, base: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.base = Some(base);
-        self
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.owner = Some(owner);
-        self
-    }
-    /// operator
-    #[inline(always)]
-    pub fn operator(
-        &mut self,
-        operator: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.operator = Some(operator);
-        self
-    }
-    #[inline(always)]
-    pub fn operator_token_x(
-        &mut self,
-        operator_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.operator_token_x = Some(operator_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn owner_token_x(
-        &mut self,
-        owner_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.owner_token_x = Some(owner_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn lower_bin_id(&mut self, lower_bin_id: i32) -> &mut Self {
-        self.instruction.lower_bin_id = Some(lower_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn width(&mut self, width: i32) -> &mut Self {
-        self.instruction.width = Some(width);
-        self
-    }
-    #[inline(always)]
-    pub fn fee_owner(&mut self, fee_owner: Pubkey) -> &mut Self {
-        self.instruction.fee_owner = Some(fee_owner);
-        self
-    }
-    #[inline(always)]
-    pub fn lock_release_point(&mut self, lock_release_point: u64) -> &mut Self {
-        self.instruction.lock_release_point = Some(lock_release_point);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializePositionByOperatorInstructionArgs {
-            lower_bin_id: self
-                .instruction
-                .lower_bin_id
-                .clone()
-                .expect("lower_bin_id is not set"),
-            width: self.instruction.width.clone().expect("width is not set"),
-            fee_owner: self
-                .instruction
-                .fee_owner
-                .clone()
-                .expect("fee_owner is not set"),
-            lock_release_point: self
-                .instruction
-                .lock_release_point
-                .clone()
-                .expect("lock_release_point is not set"),
-        };
-        let instruction = InitializePositionByOperatorCpi {
-            __program: self.instruction.__program,
-
-            payer: self.instruction.payer.expect("payer is not set"),
-
-            base: self.instruction.base.expect("base is not set"),
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            owner: self.instruction.owner.expect("owner is not set"),
-
-            operator: self.instruction.operator.expect("operator is not set"),
-
-            operator_token_x: self
-                .instruction
-                .operator_token_x
-                .expect("operator_token_x is not set"),
-
-            owner_token_x: self
-                .instruction
-                .owner_token_x
-                .expect("owner_token_x is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializePositionByOperatorCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    payer: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    base: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    operator: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    operator_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lower_bin_id: Option<i32>,
-    width: Option<i32>,
-    fee_owner: Option<Pubkey>,
-    lock_release_point: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 649
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_position_pda.rs

@@ -1,649 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializePositionPda {
-    pub payer: solana_program::pubkey::Pubkey,
-
-    pub base: solana_program::pubkey::Pubkey,
-
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-    /// owner
-    pub owner: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializePositionPda {
-    pub fn instruction(
-        &self,
-        args: InitializePositionPdaInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializePositionPdaInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.payer, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.base, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.owner, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializePositionPdaInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePositionPdaInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializePositionPdaInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [46, 82, 125, 146, 85, 141, 228, 153],
-        }
-    }
-}
-
-impl Default for InitializePositionPdaInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePositionPdaInstructionArgs {
-    pub lower_bin_id: i32,
-    pub width: i32,
-}
-
-/// Instruction builder for `InitializePositionPda`.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` payer
-///   1. `[signer]` base
-///   2. `[writable]` position
-///   3. `[]` lb_pair
-///   4. `[signer]` owner
-///   5. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   6. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializePositionPdaBuilder {
-    payer: Option<solana_program::pubkey::Pubkey>,
-    base: Option<solana_program::pubkey::Pubkey>,
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    owner: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    lower_bin_id: Option<i32>,
-    width: Option<i32>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializePositionPdaBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn payer(&mut self, payer: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.payer = Some(payer);
-        self
-    }
-    #[inline(always)]
-    pub fn base(&mut self, base: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.base = Some(base);
-        self
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// owner
-    #[inline(always)]
-    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner = Some(owner);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn lower_bin_id(&mut self, lower_bin_id: i32) -> &mut Self {
-        self.lower_bin_id = Some(lower_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn width(&mut self, width: i32) -> &mut Self {
-        self.width = Some(width);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializePositionPda {
-            payer: self.payer.expect("payer is not set"),
-            base: self.base.expect("base is not set"),
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            owner: self.owner.expect("owner is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializePositionPdaInstructionArgs {
-            lower_bin_id: self.lower_bin_id.clone().expect("lower_bin_id is not set"),
-            width: self.width.clone().expect("width is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_position_pda` CPI accounts.
-pub struct InitializePositionPdaCpiAccounts<'a, 'b> {
-    pub payer: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub base: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    /// owner
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_position_pda` CPI instruction.
-pub struct InitializePositionPdaCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub payer: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub base: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    /// owner
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializePositionPdaInstructionArgs,
-}
-
-impl<'a, 'b> InitializePositionPdaCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializePositionPdaCpiAccounts<'a, 'b>,
-        args: InitializePositionPdaInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            payer: accounts.payer,
-            base: accounts.base,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            owner: accounts.owner,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            event_authority: accounts.event_authority,
-            program: accounts.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(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.payer.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.base.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.owner.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializePositionPdaInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(10 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.payer.clone());
-        account_infos.push(self.base.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.owner.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializePositionPda` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` payer
-///   1. `[signer]` base
-///   2. `[writable]` position
-///   3. `[]` lb_pair
-///   4. `[signer]` owner
-///   5. `[]` system_program
-///   6. `[]` rent
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializePositionPdaCpiBuilder<'a, 'b> {
-    instruction: Box<InitializePositionPdaCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializePositionPdaCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializePositionPdaCpiBuilderInstruction {
-            __program: program,
-            payer: None,
-            base: None,
-            position: None,
-            lb_pair: None,
-            owner: None,
-            system_program: None,
-            rent: None,
-            event_authority: None,
-            program: None,
-            lower_bin_id: None,
-            width: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn payer(&mut self, payer: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.payer = Some(payer);
-        self
-    }
-    #[inline(always)]
-    pub fn base(&mut self, base: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.base = Some(base);
-        self
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// owner
-    #[inline(always)]
-    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.owner = Some(owner);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn lower_bin_id(&mut self, lower_bin_id: i32) -> &mut Self {
-        self.instruction.lower_bin_id = Some(lower_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn width(&mut self, width: i32) -> &mut Self {
-        self.instruction.width = Some(width);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializePositionPdaInstructionArgs {
-            lower_bin_id: self
-                .instruction
-                .lower_bin_id
-                .clone()
-                .expect("lower_bin_id is not set"),
-            width: self.instruction.width.clone().expect("width is not set"),
-        };
-        let instruction = InitializePositionPdaCpi {
-            __program: self.instruction.__program,
-
-            payer: self.instruction.payer.expect("payer is not set"),
-
-            base: self.instruction.base.expect("base is not set"),
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            owner: self.instruction.owner.expect("owner is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializePositionPdaCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    payer: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    base: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lower_bin_id: Option<i32>,
-    width: Option<i32>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 649
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_preset_parameter.rs

@@ -1,649 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializePresetParameter {
-    pub preset_parameter: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-}
-
-impl InitializePresetParameter {
-    pub fn instruction(
-        &self,
-        args: InitializePresetParameterInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializePresetParameterInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.preset_parameter,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializePresetParameterInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePresetParameterInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializePresetParameterInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [66, 188, 71, 211, 98, 109, 14, 186],
-        }
-    }
-}
-
-impl Default for InitializePresetParameterInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializePresetParameterInstructionArgs {
-    pub bin_step: u16,
-    pub base_factor: u16,
-    pub filter_period: u16,
-    pub decay_period: u16,
-    pub reduction_factor: u16,
-    pub variable_fee_control: u32,
-    pub max_volatility_accumulator: u32,
-    pub min_bin_id: i32,
-    pub max_bin_id: i32,
-    pub protocol_share: u16,
-}
-
-/// Instruction builder for `InitializePresetParameter`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` preset_parameter
-///   1. `[writable, signer]` admin
-///   2. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   3. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-#[derive(Clone, Debug, Default)]
-pub struct InitializePresetParameterBuilder {
-    preset_parameter: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    bin_step: Option<u16>,
-    base_factor: Option<u16>,
-    filter_period: Option<u16>,
-    decay_period: Option<u16>,
-    reduction_factor: Option<u16>,
-    variable_fee_control: Option<u32>,
-    max_volatility_accumulator: Option<u32>,
-    min_bin_id: Option<i32>,
-    max_bin_id: Option<i32>,
-    protocol_share: Option<u16>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializePresetParameterBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn preset_parameter(
-        &mut self,
-        preset_parameter: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.preset_parameter = Some(preset_parameter);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.bin_step = Some(bin_step);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.base_factor = Some(base_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn filter_period(&mut self, filter_period: u16) -> &mut Self {
-        self.filter_period = Some(filter_period);
-        self
-    }
-    #[inline(always)]
-    pub fn decay_period(&mut self, decay_period: u16) -> &mut Self {
-        self.decay_period = Some(decay_period);
-        self
-    }
-    #[inline(always)]
-    pub fn reduction_factor(&mut self, reduction_factor: u16) -> &mut Self {
-        self.reduction_factor = Some(reduction_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn variable_fee_control(&mut self, variable_fee_control: u32) -> &mut Self {
-        self.variable_fee_control = Some(variable_fee_control);
-        self
-    }
-    #[inline(always)]
-    pub fn max_volatility_accumulator(&mut self, max_volatility_accumulator: u32) -> &mut Self {
-        self.max_volatility_accumulator = Some(max_volatility_accumulator);
-        self
-    }
-    #[inline(always)]
-    pub fn min_bin_id(&mut self, min_bin_id: i32) -> &mut Self {
-        self.min_bin_id = Some(min_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_bin_id(&mut self, max_bin_id: i32) -> &mut Self {
-        self.max_bin_id = Some(max_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn protocol_share(&mut self, protocol_share: u16) -> &mut Self {
-        self.protocol_share = Some(protocol_share);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializePresetParameter {
-            preset_parameter: self.preset_parameter.expect("preset_parameter is not set"),
-            admin: self.admin.expect("admin is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-        };
-        let args = InitializePresetParameterInstructionArgs {
-            bin_step: self.bin_step.clone().expect("bin_step is not set"),
-            base_factor: self.base_factor.clone().expect("base_factor is not set"),
-            filter_period: self
-                .filter_period
-                .clone()
-                .expect("filter_period is not set"),
-            decay_period: self.decay_period.clone().expect("decay_period is not set"),
-            reduction_factor: self
-                .reduction_factor
-                .clone()
-                .expect("reduction_factor is not set"),
-            variable_fee_control: self
-                .variable_fee_control
-                .clone()
-                .expect("variable_fee_control is not set"),
-            max_volatility_accumulator: self
-                .max_volatility_accumulator
-                .clone()
-                .expect("max_volatility_accumulator is not set"),
-            min_bin_id: self.min_bin_id.clone().expect("min_bin_id is not set"),
-            max_bin_id: self.max_bin_id.clone().expect("max_bin_id is not set"),
-            protocol_share: self
-                .protocol_share
-                .clone()
-                .expect("protocol_share is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_preset_parameter` CPI accounts.
-pub struct InitializePresetParameterCpiAccounts<'a, 'b> {
-    pub preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_preset_parameter` CPI instruction.
-pub struct InitializePresetParameterCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializePresetParameterInstructionArgs,
-}
-
-impl<'a, 'b> InitializePresetParameterCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializePresetParameterCpiAccounts<'a, 'b>,
-        args: InitializePresetParameterInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            preset_parameter: accounts.preset_parameter,
-            admin: accounts.admin,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            __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(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.preset_parameter.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.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 = InitializePresetParameterInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.preset_parameter.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializePresetParameter` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` preset_parameter
-///   1. `[writable, signer]` admin
-///   2. `[]` system_program
-///   3. `[]` rent
-#[derive(Clone, Debug)]
-pub struct InitializePresetParameterCpiBuilder<'a, 'b> {
-    instruction: Box<InitializePresetParameterCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializePresetParameterCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializePresetParameterCpiBuilderInstruction {
-            __program: program,
-            preset_parameter: None,
-            admin: None,
-            system_program: None,
-            rent: None,
-            bin_step: None,
-            base_factor: None,
-            filter_period: None,
-            decay_period: None,
-            reduction_factor: None,
-            variable_fee_control: None,
-            max_volatility_accumulator: None,
-            min_bin_id: None,
-            max_bin_id: None,
-            protocol_share: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn preset_parameter(
-        &mut self,
-        preset_parameter: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.preset_parameter = Some(preset_parameter);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_step(&mut self, bin_step: u16) -> &mut Self {
-        self.instruction.bin_step = Some(bin_step);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.instruction.base_factor = Some(base_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn filter_period(&mut self, filter_period: u16) -> &mut Self {
-        self.instruction.filter_period = Some(filter_period);
-        self
-    }
-    #[inline(always)]
-    pub fn decay_period(&mut self, decay_period: u16) -> &mut Self {
-        self.instruction.decay_period = Some(decay_period);
-        self
-    }
-    #[inline(always)]
-    pub fn reduction_factor(&mut self, reduction_factor: u16) -> &mut Self {
-        self.instruction.reduction_factor = Some(reduction_factor);
-        self
-    }
-    #[inline(always)]
-    pub fn variable_fee_control(&mut self, variable_fee_control: u32) -> &mut Self {
-        self.instruction.variable_fee_control = Some(variable_fee_control);
-        self
-    }
-    #[inline(always)]
-    pub fn max_volatility_accumulator(&mut self, max_volatility_accumulator: u32) -> &mut Self {
-        self.instruction.max_volatility_accumulator = Some(max_volatility_accumulator);
-        self
-    }
-    #[inline(always)]
-    pub fn min_bin_id(&mut self, min_bin_id: i32) -> &mut Self {
-        self.instruction.min_bin_id = Some(min_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_bin_id(&mut self, max_bin_id: i32) -> &mut Self {
-        self.instruction.max_bin_id = Some(max_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn protocol_share(&mut self, protocol_share: u16) -> &mut Self {
-        self.instruction.protocol_share = Some(protocol_share);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializePresetParameterInstructionArgs {
-            bin_step: self
-                .instruction
-                .bin_step
-                .clone()
-                .expect("bin_step is not set"),
-            base_factor: self
-                .instruction
-                .base_factor
-                .clone()
-                .expect("base_factor is not set"),
-            filter_period: self
-                .instruction
-                .filter_period
-                .clone()
-                .expect("filter_period is not set"),
-            decay_period: self
-                .instruction
-                .decay_period
-                .clone()
-                .expect("decay_period is not set"),
-            reduction_factor: self
-                .instruction
-                .reduction_factor
-                .clone()
-                .expect("reduction_factor is not set"),
-            variable_fee_control: self
-                .instruction
-                .variable_fee_control
-                .clone()
-                .expect("variable_fee_control is not set"),
-            max_volatility_accumulator: self
-                .instruction
-                .max_volatility_accumulator
-                .clone()
-                .expect("max_volatility_accumulator is not set"),
-            min_bin_id: self
-                .instruction
-                .min_bin_id
-                .clone()
-                .expect("min_bin_id is not set"),
-            max_bin_id: self
-                .instruction
-                .max_bin_id
-                .clone()
-                .expect("max_bin_id is not set"),
-            protocol_share: self
-                .instruction
-                .protocol_share
-                .clone()
-                .expect("protocol_share is not set"),
-        };
-        let instruction = InitializePresetParameterCpi {
-            __program: self.instruction.__program,
-
-            preset_parameter: self
-                .instruction
-                .preset_parameter
-                .expect("preset_parameter is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializePresetParameterCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    preset_parameter: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_step: Option<u16>,
-    base_factor: Option<u16>,
-    filter_period: Option<u16>,
-    decay_period: Option<u16>,
-    reduction_factor: Option<u16>,
-    variable_fee_control: Option<u32>,
-    max_volatility_accumulator: Option<u32>,
-    min_bin_id: Option<i32>,
-    max_bin_id: Option<i32>,
-    protocol_share: Option<u16>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 687
packages/renderers-rust/e2e/meteora/src/generated/instructions/initialize_reward.rs

@@ -1,687 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct InitializeReward {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub reward_vault: solana_program::pubkey::Pubkey,
-
-    pub reward_mint: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl InitializeReward {
-    pub fn instruction(
-        &self,
-        args: InitializeRewardInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: InitializeRewardInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reward_vault,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.reward_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.rent, false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = InitializeRewardInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeRewardInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl InitializeRewardInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [95, 135, 192, 196, 242, 129, 230, 68],
-        }
-    }
-}
-
-impl Default for InitializeRewardInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct InitializeRewardInstructionArgs {
-    pub reward_index: u64,
-    pub reward_duration: u64,
-    pub funder: Pubkey,
-}
-
-/// Instruction builder for `InitializeReward`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reward_vault
-///   2. `[]` reward_mint
-///   3. `[writable, signer]` admin
-///   4. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   5. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   6. `[optional]` rent (default to `SysvarRent111111111111111111111111111111111`)
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct InitializeRewardBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    reward_vault: Option<solana_program::pubkey::Pubkey>,
-    reward_mint: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    reward_index: Option<u64>,
-    reward_duration: Option<u64>,
-    funder: Option<Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl InitializeRewardBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(&mut self, reward_vault: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(&mut self, reward_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[inline(always)]
-    pub fn token_program(&mut self, token_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_program = Some(token_program);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    /// `[optional account, default to 'SysvarRent111111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn rent(&mut self, rent: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_duration(&mut self, reward_duration: u64) -> &mut Self {
-        self.reward_duration = Some(reward_duration);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = InitializeReward {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            reward_vault: self.reward_vault.expect("reward_vault is not set"),
-            reward_mint: self.reward_mint.expect("reward_mint is not set"),
-            admin: self.admin.expect("admin is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent: self.rent.unwrap_or(solana_program::pubkey!(
-                "SysvarRent111111111111111111111111111111111"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = InitializeRewardInstructionArgs {
-            reward_index: self.reward_index.clone().expect("reward_index is not set"),
-            reward_duration: self
-                .reward_duration
-                .clone()
-                .expect("reward_duration is not set"),
-            funder: self.funder.clone().expect("funder is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `initialize_reward` CPI accounts.
-pub struct InitializeRewardCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `initialize_reward` CPI instruction.
-pub struct InitializeRewardCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: InitializeRewardInstructionArgs,
-}
-
-impl<'a, 'b> InitializeRewardCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: InitializeRewardCpiAccounts<'a, 'b>,
-        args: InitializeRewardInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            reward_vault: accounts.reward_vault,
-            reward_mint: accounts.reward_mint,
-            admin: accounts.admin,
-            token_program: accounts.token_program,
-            system_program: accounts.system_program,
-            rent: accounts.rent,
-            event_authority: accounts.event_authority,
-            program: accounts.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(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reward_vault.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.reward_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.rent.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = InitializeRewardInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(10 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.reward_vault.clone());
-        account_infos.push(self.reward_mint.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `InitializeReward` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reward_vault
-///   2. `[]` reward_mint
-///   3. `[writable, signer]` admin
-///   4. `[]` token_program
-///   5. `[]` system_program
-///   6. `[]` rent
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug)]
-pub struct InitializeRewardCpiBuilder<'a, 'b> {
-    instruction: Box<InitializeRewardCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> InitializeRewardCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(InitializeRewardCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            reward_vault: None,
-            reward_mint: None,
-            admin: None,
-            token_program: None,
-            system_program: None,
-            rent: None,
-            event_authority: None,
-            program: None,
-            reward_index: None,
-            reward_duration: None,
-            funder: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(
-        &mut self,
-        reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(
-        &mut self,
-        reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        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 system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent(&mut self, rent: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.rent = Some(rent);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.instruction.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_duration(&mut self, reward_duration: u64) -> &mut Self {
-        self.instruction.reward_duration = Some(reward_duration);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: Pubkey) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = InitializeRewardInstructionArgs {
-            reward_index: self
-                .instruction
-                .reward_index
-                .clone()
-                .expect("reward_index is not set"),
-            reward_duration: self
-                .instruction
-                .reward_duration
-                .clone()
-                .expect("reward_duration is not set"),
-            funder: self.instruction.funder.clone().expect("funder is not set"),
-        };
-        let instruction = InitializeRewardCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            reward_vault: self
-                .instruction
-                .reward_vault
-                .expect("reward_vault is not set"),
-
-            reward_mint: self
-                .instruction
-                .reward_mint
-                .expect("reward_mint is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent: self.instruction.rent.expect("rent is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct InitializeRewardCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_index: Option<u64>,
-    reward_duration: Option<u64>,
-    funder: Option<Pubkey>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 290
packages/renderers-rust/e2e/meteora/src/generated/instructions/migrate_bin_array.rs

@@ -1,290 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct MigrateBinArray {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-}
-
-impl MigrateBinArray {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = MigrateBinArrayInstructionData::new().try_to_vec().unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct MigrateBinArrayInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl MigrateBinArrayInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [17, 23, 159, 211, 101, 184, 41, 241],
-        }
-    }
-}
-
-impl Default for MigrateBinArrayInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `MigrateBinArray`.
-///
-/// ### Accounts:
-///
-///   0. `[]` lb_pair
-#[derive(Clone, Debug, Default)]
-pub struct MigrateBinArrayBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl MigrateBinArrayBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = MigrateBinArray {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `migrate_bin_array` CPI accounts.
-pub struct MigrateBinArrayCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `migrate_bin_array` CPI instruction.
-pub struct MigrateBinArrayCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> MigrateBinArrayCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: MigrateBinArrayCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-        }
-    }
-    #[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(1 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.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 data = MigrateBinArrayInstructionData::new().try_to_vec().unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(2 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.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)
-        }
-    }
-}
-
-/// Instruction builder for `MigrateBinArray` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[]` lb_pair
-#[derive(Clone, Debug)]
-pub struct MigrateBinArrayCpiBuilder<'a, 'b> {
-    instruction: Box<MigrateBinArrayCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> MigrateBinArrayCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(MigrateBinArrayCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = MigrateBinArrayCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct MigrateBinArrayCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 652
packages/renderers-rust/e2e/meteora/src/generated/instructions/migrate_position.rs

@@ -1,652 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct MigratePosition {
-    pub position_v2: solana_program::pubkey::Pubkey,
-
-    pub position_v1: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub owner: solana_program::pubkey::Pubkey,
-
-    pub system_program: solana_program::pubkey::Pubkey,
-
-    pub rent_receiver: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl MigratePosition {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(10 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position_v2,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position_v1,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.owner, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.system_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.rent_receiver,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = MigratePositionInstructionData::new().try_to_vec().unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct MigratePositionInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl MigratePositionInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [15, 132, 59, 50, 199, 6, 251, 46],
-        }
-    }
-}
-
-impl Default for MigratePositionInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `MigratePosition`.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` position_v2
-///   1. `[writable]` position_v1
-///   2. `[]` lb_pair
-///   3. `[writable]` bin_array_lower
-///   4. `[writable]` bin_array_upper
-///   5. `[writable, signer]` owner
-///   6. `[optional]` system_program (default to `11111111111111111111111111111111`)
-///   7. `[writable]` rent_receiver
-///   8. `[]` event_authority
-///   9. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct MigratePositionBuilder {
-    position_v2: Option<solana_program::pubkey::Pubkey>,
-    position_v1: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    owner: Option<solana_program::pubkey::Pubkey>,
-    system_program: Option<solana_program::pubkey::Pubkey>,
-    rent_receiver: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl MigratePositionBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position_v2(&mut self, position_v2: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position_v2 = Some(position_v2);
-        self
-    }
-    #[inline(always)]
-    pub fn position_v1(&mut self, position_v1: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position_v1 = Some(position_v1);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner = Some(owner);
-        self
-    }
-    /// `[optional account, default to '11111111111111111111111111111111']`
-    #[inline(always)]
-    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent_receiver(&mut self, rent_receiver: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.rent_receiver = Some(rent_receiver);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = MigratePosition {
-            position_v2: self.position_v2.expect("position_v2 is not set"),
-            position_v1: self.position_v1.expect("position_v1 is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            owner: self.owner.expect("owner is not set"),
-            system_program: self
-                .system_program
-                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
-            rent_receiver: self.rent_receiver.expect("rent_receiver is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `migrate_position` CPI accounts.
-pub struct MigratePositionCpiAccounts<'a, 'b> {
-    pub position_v2: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position_v1: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `migrate_position` CPI instruction.
-pub struct MigratePositionCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position_v2: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position_v1: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> MigratePositionCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: MigratePositionCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            position_v2: accounts.position_v2,
-            position_v1: accounts.position_v1,
-            lb_pair: accounts.lb_pair,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            owner: accounts.owner,
-            system_program: accounts.system_program,
-            rent_receiver: accounts.rent_receiver,
-            event_authority: accounts.event_authority,
-            program: accounts.program,
-        }
-    }
-    #[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(10 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position_v2.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position_v1.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.owner.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.system_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.rent_receiver.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 data = MigratePositionInstructionData::new().try_to_vec().unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(11 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position_v2.clone());
-        account_infos.push(self.position_v1.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.owner.clone());
-        account_infos.push(self.system_program.clone());
-        account_infos.push(self.rent_receiver.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `MigratePosition` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable, signer]` position_v2
-///   1. `[writable]` position_v1
-///   2. `[]` lb_pair
-///   3. `[writable]` bin_array_lower
-///   4. `[writable]` bin_array_upper
-///   5. `[writable, signer]` owner
-///   6. `[]` system_program
-///   7. `[writable]` rent_receiver
-///   8. `[]` event_authority
-///   9. `[]` program
-#[derive(Clone, Debug)]
-pub struct MigratePositionCpiBuilder<'a, 'b> {
-    instruction: Box<MigratePositionCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> MigratePositionCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(MigratePositionCpiBuilderInstruction {
-            __program: program,
-            position_v2: None,
-            position_v1: None,
-            lb_pair: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            owner: None,
-            system_program: None,
-            rent_receiver: None,
-            event_authority: None,
-            program: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position_v2(
-        &mut self,
-        position_v2: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position_v2 = Some(position_v2);
-        self
-    }
-    #[inline(always)]
-    pub fn position_v1(
-        &mut self,
-        position_v1: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position_v1 = Some(position_v1);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.owner = Some(owner);
-        self
-    }
-    #[inline(always)]
-    pub fn system_program(
-        &mut self,
-        system_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.system_program = Some(system_program);
-        self
-    }
-    #[inline(always)]
-    pub fn rent_receiver(
-        &mut self,
-        rent_receiver: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.rent_receiver = Some(rent_receiver);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = MigratePositionCpi {
-            __program: self.instruction.__program,
-
-            position_v2: self
-                .instruction
-                .position_v2
-                .expect("position_v2 is not set"),
-
-            position_v1: self
-                .instruction
-                .position_v1
-                .expect("position_v1 is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            owner: self.instruction.owner.expect("owner is not set"),
-
-            system_program: self
-                .instruction
-                .system_program
-                .expect("system_program is not set"),
-
-            rent_receiver: self
-                .instruction
-                .rent_receiver
-                .expect("rent_receiver is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct MigratePositionCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position_v2: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    position_v1: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    rent_receiver: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 92
packages/renderers-rust/e2e/meteora/src/generated/instructions/mod.rs

@@ -1,92 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-pub(crate) mod r#add_liquidity;
-pub(crate) mod r#add_liquidity_by_strategy;
-pub(crate) mod r#add_liquidity_by_strategy_one_side;
-pub(crate) mod r#add_liquidity_by_weight;
-pub(crate) mod r#add_liquidity_one_side;
-pub(crate) mod r#add_liquidity_one_side_precise;
-pub(crate) mod r#claim_fee;
-pub(crate) mod r#claim_reward;
-pub(crate) mod r#close_position;
-pub(crate) mod r#close_preset_parameter;
-pub(crate) mod r#fund_reward;
-pub(crate) mod r#go_to_a_bin;
-pub(crate) mod r#increase_oracle_length;
-pub(crate) mod r#initialize_bin_array;
-pub(crate) mod r#initialize_bin_array_bitmap_extension;
-pub(crate) mod r#initialize_customizable_permissionless_lb_pair;
-pub(crate) mod r#initialize_lb_pair;
-pub(crate) mod r#initialize_permission_lb_pair;
-pub(crate) mod r#initialize_position;
-pub(crate) mod r#initialize_position_by_operator;
-pub(crate) mod r#initialize_position_pda;
-pub(crate) mod r#initialize_preset_parameter;
-pub(crate) mod r#initialize_reward;
-pub(crate) mod r#migrate_bin_array;
-pub(crate) mod r#migrate_position;
-pub(crate) mod r#remove_all_liquidity;
-pub(crate) mod r#remove_liquidity;
-pub(crate) mod r#remove_liquidity_by_range;
-pub(crate) mod r#set_activation_point;
-pub(crate) mod r#set_pre_activation_duration;
-pub(crate) mod r#set_pre_activation_swap_address;
-pub(crate) mod r#swap;
-pub(crate) mod r#swap_exact_out;
-pub(crate) mod r#swap_with_price_impact;
-pub(crate) mod r#toggle_pair_status;
-pub(crate) mod r#update_fee_parameters;
-pub(crate) mod r#update_fees_and_rewards;
-pub(crate) mod r#update_position_operator;
-pub(crate) mod r#update_reward_duration;
-pub(crate) mod r#update_reward_funder;
-pub(crate) mod r#withdraw_ineligible_reward;
-pub(crate) mod r#withdraw_protocol_fee;
-
-pub use self::r#add_liquidity::*;
-pub use self::r#add_liquidity_by_strategy::*;
-pub use self::r#add_liquidity_by_strategy_one_side::*;
-pub use self::r#add_liquidity_by_weight::*;
-pub use self::r#add_liquidity_one_side::*;
-pub use self::r#add_liquidity_one_side_precise::*;
-pub use self::r#claim_fee::*;
-pub use self::r#claim_reward::*;
-pub use self::r#close_position::*;
-pub use self::r#close_preset_parameter::*;
-pub use self::r#fund_reward::*;
-pub use self::r#go_to_a_bin::*;
-pub use self::r#increase_oracle_length::*;
-pub use self::r#initialize_bin_array::*;
-pub use self::r#initialize_bin_array_bitmap_extension::*;
-pub use self::r#initialize_customizable_permissionless_lb_pair::*;
-pub use self::r#initialize_lb_pair::*;
-pub use self::r#initialize_permission_lb_pair::*;
-pub use self::r#initialize_position::*;
-pub use self::r#initialize_position_by_operator::*;
-pub use self::r#initialize_position_pda::*;
-pub use self::r#initialize_preset_parameter::*;
-pub use self::r#initialize_reward::*;
-pub use self::r#migrate_bin_array::*;
-pub use self::r#migrate_position::*;
-pub use self::r#remove_all_liquidity::*;
-pub use self::r#remove_liquidity::*;
-pub use self::r#remove_liquidity_by_range::*;
-pub use self::r#set_activation_point::*;
-pub use self::r#set_pre_activation_duration::*;
-pub use self::r#set_pre_activation_swap_address::*;
-pub use self::r#swap::*;
-pub use self::r#swap_exact_out::*;
-pub use self::r#swap_with_price_impact::*;
-pub use self::r#toggle_pair_status::*;
-pub use self::r#update_fee_parameters::*;
-pub use self::r#update_fees_and_rewards::*;
-pub use self::r#update_position_operator::*;
-pub use self::r#update_reward_duration::*;
-pub use self::r#update_reward_funder::*;
-pub use self::r#withdraw_ineligible_reward::*;
-pub use self::r#withdraw_protocol_fee::*;

+ 0 - 912
packages/renderers-rust/e2e/meteora/src/generated/instructions/remove_all_liquidity.rs

@@ -1,912 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct RemoveAllLiquidity {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl RemoveAllLiquidity {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = RemoveAllLiquidityInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct RemoveAllLiquidityInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl RemoveAllLiquidityInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [10, 51, 61, 35, 112, 105, 24, 85],
-        }
-    }
-}
-
-impl Default for RemoveAllLiquidityInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `RemoveAllLiquidity`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct RemoveAllLiquidityBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl RemoveAllLiquidityBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = RemoveAllLiquidity {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `remove_all_liquidity` CPI accounts.
-pub struct RemoveAllLiquidityCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `remove_all_liquidity` CPI instruction.
-pub struct RemoveAllLiquidityCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> RemoveAllLiquidityCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: RemoveAllLiquidityCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.program,
-        }
-    }
-    #[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(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 data = RemoveAllLiquidityInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `RemoveAllLiquidity` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug)]
-pub struct RemoveAllLiquidityCpiBuilder<'a, 'b> {
-    instruction: Box<RemoveAllLiquidityCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> RemoveAllLiquidityCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(RemoveAllLiquidityCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token_x: None,
-            user_token_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = RemoveAllLiquidityCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct RemoveAllLiquidityCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 960
packages/renderers-rust/e2e/meteora/src/generated/instructions/remove_liquidity.rs

@@ -1,960 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::BinLiquidityReduction;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct RemoveLiquidity {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl RemoveLiquidity {
-    pub fn instruction(
-        &self,
-        args: RemoveLiquidityInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: RemoveLiquidityInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = RemoveLiquidityInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct RemoveLiquidityInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl RemoveLiquidityInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [80, 85, 209, 72, 24, 206, 177, 108],
-        }
-    }
-}
-
-impl Default for RemoveLiquidityInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct RemoveLiquidityInstructionArgs {
-    pub bin_liquidity_removal: Vec<BinLiquidityReduction>,
-}
-
-/// Instruction builder for `RemoveLiquidity`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct RemoveLiquidityBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    bin_liquidity_removal: Option<Vec<BinLiquidityReduction>>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl RemoveLiquidityBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_removal(
-        &mut self,
-        bin_liquidity_removal: Vec<BinLiquidityReduction>,
-    ) -> &mut Self {
-        self.bin_liquidity_removal = Some(bin_liquidity_removal);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = RemoveLiquidity {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = RemoveLiquidityInstructionArgs {
-            bin_liquidity_removal: self
-                .bin_liquidity_removal
-                .clone()
-                .expect("bin_liquidity_removal is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `remove_liquidity` CPI accounts.
-pub struct RemoveLiquidityCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `remove_liquidity` CPI instruction.
-pub struct RemoveLiquidityCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: RemoveLiquidityInstructionArgs,
-}
-
-impl<'a, 'b> RemoveLiquidityCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: RemoveLiquidityCpiAccounts<'a, 'b>,
-        args: RemoveLiquidityInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = RemoveLiquidityInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `RemoveLiquidity` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug)]
-pub struct RemoveLiquidityCpiBuilder<'a, 'b> {
-    instruction: Box<RemoveLiquidityCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> RemoveLiquidityCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(RemoveLiquidityCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token_x: None,
-            user_token_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            bin_liquidity_removal: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_liquidity_removal(
-        &mut self,
-        bin_liquidity_removal: Vec<BinLiquidityReduction>,
-    ) -> &mut Self {
-        self.instruction.bin_liquidity_removal = Some(bin_liquidity_removal);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = RemoveLiquidityInstructionArgs {
-            bin_liquidity_removal: self
-                .instruction
-                .bin_liquidity_removal
-                .clone()
-                .expect("bin_liquidity_removal is not set"),
-        };
-        let instruction = RemoveLiquidityCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct RemoveLiquidityCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_liquidity_removal: Option<Vec<BinLiquidityReduction>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 997
packages/renderers-rust/e2e/meteora/src/generated/instructions/remove_liquidity_by_range.rs

@@ -1,997 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct RemoveLiquidityByRange {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub user_token_x: solana_program::pubkey::Pubkey,
-
-    pub user_token_y: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub sender: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl RemoveLiquidityByRange {
-    pub fn instruction(
-        &self,
-        args: RemoveLiquidityByRangeInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: RemoveLiquidityByRangeInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.sender,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = RemoveLiquidityByRangeInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct RemoveLiquidityByRangeInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl RemoveLiquidityByRangeInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [26, 82, 102, 152, 240, 74, 105, 26],
-        }
-    }
-}
-
-impl Default for RemoveLiquidityByRangeInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct RemoveLiquidityByRangeInstructionArgs {
-    pub from_bin_id: i32,
-    pub to_bin_id: i32,
-    pub bps_to_remove: u16,
-}
-
-/// Instruction builder for `RemoveLiquidityByRange`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct RemoveLiquidityByRangeBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    user_token_x: Option<solana_program::pubkey::Pubkey>,
-    user_token_y: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    sender: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    from_bin_id: Option<i32>,
-    to_bin_id: Option<i32>,
-    bps_to_remove: Option<u16>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl RemoveLiquidityByRangeBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(&mut self, user_token_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(&mut self, user_token_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(&mut self, sender: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn from_bin_id(&mut self, from_bin_id: i32) -> &mut Self {
-        self.from_bin_id = Some(from_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn to_bin_id(&mut self, to_bin_id: i32) -> &mut Self {
-        self.to_bin_id = Some(to_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bps_to_remove(&mut self, bps_to_remove: u16) -> &mut Self {
-        self.bps_to_remove = Some(bps_to_remove);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = RemoveLiquidityByRange {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            user_token_x: self.user_token_x.expect("user_token_x is not set"),
-            user_token_y: self.user_token_y.expect("user_token_y is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            sender: self.sender.expect("sender is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = RemoveLiquidityByRangeInstructionArgs {
-            from_bin_id: self.from_bin_id.clone().expect("from_bin_id is not set"),
-            to_bin_id: self.to_bin_id.clone().expect("to_bin_id is not set"),
-            bps_to_remove: self
-                .bps_to_remove
-                .clone()
-                .expect("bps_to_remove is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `remove_liquidity_by_range` CPI accounts.
-pub struct RemoveLiquidityByRangeCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `remove_liquidity_by_range` CPI instruction.
-pub struct RemoveLiquidityByRangeCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub sender: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: RemoveLiquidityByRangeInstructionArgs,
-}
-
-impl<'a, 'b> RemoveLiquidityByRangeCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: RemoveLiquidityByRangeCpiAccounts<'a, 'b>,
-        args: RemoveLiquidityByRangeInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            user_token_x: accounts.user_token_x,
-            user_token_y: accounts.user_token_y,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            sender: accounts.sender,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(16 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.sender.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = RemoveLiquidityByRangeInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.user_token_x.clone());
-        account_infos.push(self.user_token_y.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.sender.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `RemoveLiquidityByRange` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable, optional]` bin_array_bitmap_extension
-///   3. `[writable]` user_token_x
-///   4. `[writable]` user_token_y
-///   5. `[writable]` reserve_x
-///   6. `[writable]` reserve_y
-///   7. `[]` token_x_mint
-///   8. `[]` token_y_mint
-///   9. `[writable]` bin_array_lower
-///   10. `[writable]` bin_array_upper
-///   11. `[signer]` sender
-///   12. `[]` token_x_program
-///   13. `[]` token_y_program
-///   14. `[]` event_authority
-///   15. `[]` program
-#[derive(Clone, Debug)]
-pub struct RemoveLiquidityByRangeCpiBuilder<'a, 'b> {
-    instruction: Box<RemoveLiquidityByRangeCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> RemoveLiquidityByRangeCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(RemoveLiquidityByRangeCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            user_token_x: None,
-            user_token_y: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            sender: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            from_bin_id: None,
-            to_bin_id: None,
-            bps_to_remove: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_x(
-        &mut self,
-        user_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_x = Some(user_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_y(
-        &mut self,
-        user_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_y = Some(user_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn sender(
-        &mut self,
-        sender: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.sender = Some(sender);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn from_bin_id(&mut self, from_bin_id: i32) -> &mut Self {
-        self.instruction.from_bin_id = Some(from_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn to_bin_id(&mut self, to_bin_id: i32) -> &mut Self {
-        self.instruction.to_bin_id = Some(to_bin_id);
-        self
-    }
-    #[inline(always)]
-    pub fn bps_to_remove(&mut self, bps_to_remove: u16) -> &mut Self {
-        self.instruction.bps_to_remove = Some(bps_to_remove);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = RemoveLiquidityByRangeInstructionArgs {
-            from_bin_id: self
-                .instruction
-                .from_bin_id
-                .clone()
-                .expect("from_bin_id is not set"),
-            to_bin_id: self
-                .instruction
-                .to_bin_id
-                .clone()
-                .expect("to_bin_id is not set"),
-            bps_to_remove: self
-                .instruction
-                .bps_to_remove
-                .clone()
-                .expect("bps_to_remove is not set"),
-        };
-        let instruction = RemoveLiquidityByRangeCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            user_token_x: self
-                .instruction
-                .user_token_x
-                .expect("user_token_x is not set"),
-
-            user_token_y: self
-                .instruction
-                .user_token_y
-                .expect("user_token_y is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            sender: self.instruction.sender.expect("sender is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct RemoveLiquidityByRangeCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    sender: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    from_bin_id: Option<i32>,
-    to_bin_id: Option<i32>,
-    bps_to_remove: Option<u16>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 372
packages/renderers-rust/e2e/meteora/src/generated/instructions/set_activation_point.rs

@@ -1,372 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct SetActivationPoint {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-}
-
-impl SetActivationPoint {
-    pub fn instruction(
-        &self,
-        args: SetActivationPointInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: SetActivationPointInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.admin, true,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = SetActivationPointInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SetActivationPointInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl SetActivationPointInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [91, 249, 15, 165, 26, 129, 254, 125],
-        }
-    }
-}
-
-impl Default for SetActivationPointInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SetActivationPointInstructionArgs {
-    pub activation_point: u64,
-}
-
-/// Instruction builder for `SetActivationPoint`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable, signer]` admin
-#[derive(Clone, Debug, Default)]
-pub struct SetActivationPointBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    activation_point: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl SetActivationPointBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn activation_point(&mut self, activation_point: u64) -> &mut Self {
-        self.activation_point = Some(activation_point);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = SetActivationPoint {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            admin: self.admin.expect("admin is not set"),
-        };
-        let args = SetActivationPointInstructionArgs {
-            activation_point: self
-                .activation_point
-                .clone()
-                .expect("activation_point is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `set_activation_point` CPI accounts.
-pub struct SetActivationPointCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `set_activation_point` CPI instruction.
-pub struct SetActivationPointCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: SetActivationPointInstructionArgs,
-}
-
-impl<'a, 'b> SetActivationPointCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: SetActivationPointCpiAccounts<'a, 'b>,
-        args: SetActivationPointInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            admin: accounts.admin,
-            __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(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.admin.key,
-            true,
-        ));
-        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 = SetActivationPointInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(3 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.admin.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)
-        }
-    }
-}
-
-/// Instruction builder for `SetActivationPoint` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable, signer]` admin
-#[derive(Clone, Debug)]
-pub struct SetActivationPointCpiBuilder<'a, 'b> {
-    instruction: Box<SetActivationPointCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> SetActivationPointCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(SetActivationPointCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            admin: None,
-            activation_point: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn activation_point(&mut self, activation_point: u64) -> &mut Self {
-        self.instruction.activation_point = Some(activation_point);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = SetActivationPointInstructionArgs {
-            activation_point: self
-                .instruction
-                .activation_point
-                .clone()
-                .expect("activation_point is not set"),
-        };
-        let instruction = SetActivationPointCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct SetActivationPointCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    activation_point: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 376
packages/renderers-rust/e2e/meteora/src/generated/instructions/set_pre_activation_duration.rs

@@ -1,376 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct SetPreActivationDuration {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub creator: solana_program::pubkey::Pubkey,
-}
-
-impl SetPreActivationDuration {
-    pub fn instruction(
-        &self,
-        args: SetPreActivationDurationInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: SetPreActivationDurationInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.creator,
-            true,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = SetPreActivationDurationInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SetPreActivationDurationInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl SetPreActivationDurationInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [165, 61, 201, 244, 130, 159, 22, 100],
-        }
-    }
-}
-
-impl Default for SetPreActivationDurationInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SetPreActivationDurationInstructionArgs {
-    pub pre_activation_duration: u64,
-}
-
-/// Instruction builder for `SetPreActivationDuration`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` creator
-#[derive(Clone, Debug, Default)]
-pub struct SetPreActivationDurationBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    creator: Option<solana_program::pubkey::Pubkey>,
-    pre_activation_duration: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl SetPreActivationDurationBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.creator = Some(creator);
-        self
-    }
-    #[inline(always)]
-    pub fn pre_activation_duration(&mut self, pre_activation_duration: u64) -> &mut Self {
-        self.pre_activation_duration = Some(pre_activation_duration);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = SetPreActivationDuration {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            creator: self.creator.expect("creator is not set"),
-        };
-        let args = SetPreActivationDurationInstructionArgs {
-            pre_activation_duration: self
-                .pre_activation_duration
-                .clone()
-                .expect("pre_activation_duration is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `set_pre_activation_duration` CPI accounts.
-pub struct SetPreActivationDurationCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub creator: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `set_pre_activation_duration` CPI instruction.
-pub struct SetPreActivationDurationCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub creator: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: SetPreActivationDurationInstructionArgs,
-}
-
-impl<'a, 'b> SetPreActivationDurationCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: SetPreActivationDurationCpiAccounts<'a, 'b>,
-        args: SetPreActivationDurationInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            creator: accounts.creator,
-            __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(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.creator.key,
-            true,
-        ));
-        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 = SetPreActivationDurationInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(3 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.creator.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)
-        }
-    }
-}
-
-/// Instruction builder for `SetPreActivationDuration` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` creator
-#[derive(Clone, Debug)]
-pub struct SetPreActivationDurationCpiBuilder<'a, 'b> {
-    instruction: Box<SetPreActivationDurationCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> SetPreActivationDurationCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(SetPreActivationDurationCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            creator: None,
-            pre_activation_duration: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn creator(
-        &mut self,
-        creator: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.creator = Some(creator);
-        self
-    }
-    #[inline(always)]
-    pub fn pre_activation_duration(&mut self, pre_activation_duration: u64) -> &mut Self {
-        self.instruction.pre_activation_duration = Some(pre_activation_duration);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = SetPreActivationDurationInstructionArgs {
-            pre_activation_duration: self
-                .instruction
-                .pre_activation_duration
-                .clone()
-                .expect("pre_activation_duration is not set"),
-        };
-        let instruction = SetPreActivationDurationCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            creator: self.instruction.creator.expect("creator is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct SetPreActivationDurationCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    creator: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    pre_activation_duration: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 383
packages/renderers-rust/e2e/meteora/src/generated/instructions/set_pre_activation_swap_address.rs

@@ -1,383 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct SetPreActivationSwapAddress {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub creator: solana_program::pubkey::Pubkey,
-}
-
-impl SetPreActivationSwapAddress {
-    pub fn instruction(
-        &self,
-        args: SetPreActivationSwapAddressInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: SetPreActivationSwapAddressInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.creator,
-            true,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = SetPreActivationSwapAddressInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SetPreActivationSwapAddressInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl SetPreActivationSwapAddressInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [57, 139, 47, 123, 216, 80, 223, 10],
-        }
-    }
-}
-
-impl Default for SetPreActivationSwapAddressInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SetPreActivationSwapAddressInstructionArgs {
-    pub pre_activation_swap_address: Pubkey,
-}
-
-/// Instruction builder for `SetPreActivationSwapAddress`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` creator
-#[derive(Clone, Debug, Default)]
-pub struct SetPreActivationSwapAddressBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    creator: Option<solana_program::pubkey::Pubkey>,
-    pre_activation_swap_address: Option<Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl SetPreActivationSwapAddressBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.creator = Some(creator);
-        self
-    }
-    #[inline(always)]
-    pub fn pre_activation_swap_address(
-        &mut self,
-        pre_activation_swap_address: Pubkey,
-    ) -> &mut Self {
-        self.pre_activation_swap_address = Some(pre_activation_swap_address);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = SetPreActivationSwapAddress {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            creator: self.creator.expect("creator is not set"),
-        };
-        let args = SetPreActivationSwapAddressInstructionArgs {
-            pre_activation_swap_address: self
-                .pre_activation_swap_address
-                .clone()
-                .expect("pre_activation_swap_address is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `set_pre_activation_swap_address` CPI accounts.
-pub struct SetPreActivationSwapAddressCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub creator: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `set_pre_activation_swap_address` CPI instruction.
-pub struct SetPreActivationSwapAddressCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub creator: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: SetPreActivationSwapAddressInstructionArgs,
-}
-
-impl<'a, 'b> SetPreActivationSwapAddressCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: SetPreActivationSwapAddressCpiAccounts<'a, 'b>,
-        args: SetPreActivationSwapAddressInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            creator: accounts.creator,
-            __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(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.creator.key,
-            true,
-        ));
-        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 = SetPreActivationSwapAddressInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(3 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.creator.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)
-        }
-    }
-}
-
-/// Instruction builder for `SetPreActivationSwapAddress` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` creator
-#[derive(Clone, Debug)]
-pub struct SetPreActivationSwapAddressCpiBuilder<'a, 'b> {
-    instruction: Box<SetPreActivationSwapAddressCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> SetPreActivationSwapAddressCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(SetPreActivationSwapAddressCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            creator: None,
-            pre_activation_swap_address: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn creator(
-        &mut self,
-        creator: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.creator = Some(creator);
-        self
-    }
-    #[inline(always)]
-    pub fn pre_activation_swap_address(
-        &mut self,
-        pre_activation_swap_address: Pubkey,
-    ) -> &mut Self {
-        self.instruction.pre_activation_swap_address = Some(pre_activation_swap_address);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = SetPreActivationSwapAddressInstructionArgs {
-            pre_activation_swap_address: self
-                .instruction
-                .pre_activation_swap_address
-                .clone()
-                .expect("pre_activation_swap_address is not set"),
-        };
-        let instruction = SetPreActivationSwapAddressCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            creator: self.instruction.creator.expect("creator is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct SetPreActivationSwapAddressCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    creator: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    pre_activation_swap_address: Option<Pubkey>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 941
packages/renderers-rust/e2e/meteora/src/generated/instructions/swap.rs

@@ -1,941 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct Swap {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub user_token_in: solana_program::pubkey::Pubkey,
-
-    pub user_token_out: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub host_fee_in: Option<solana_program::pubkey::Pubkey>,
-
-    pub user: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl Swap {
-    pub fn instruction(
-        &self,
-        args: SwapInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: SwapInstructionArgs,
-        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.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_in,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_out,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        if let Some(host_fee_in) = self.host_fee_in {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                host_fee_in,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.user, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = SwapInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SwapInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl SwapInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [248, 198, 158, 145, 225, 117, 135, 200],
-        }
-    }
-}
-
-impl Default for SwapInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SwapInstructionArgs {
-    pub amount_in: u64,
-    pub min_amount_out: u64,
-}
-
-/// Instruction builder for `Swap`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[writable]` reserve_x
-///   3. `[writable]` reserve_y
-///   4. `[writable]` user_token_in
-///   5. `[writable]` user_token_out
-///   6. `[]` token_x_mint
-///   7. `[]` token_y_mint
-///   8. `[writable]` oracle
-///   9. `[writable, optional]` host_fee_in
-///   10. `[signer]` user
-///   11. `[]` token_x_program
-///   12. `[]` token_y_program
-///   13. `[]` event_authority
-///   14. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct SwapBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    user_token_in: Option<solana_program::pubkey::Pubkey>,
-    user_token_out: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    host_fee_in: Option<solana_program::pubkey::Pubkey>,
-    user: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount_in: Option<u64>,
-    min_amount_out: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl SwapBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_in(&mut self, user_token_in: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_in = Some(user_token_in);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_out(&mut self, user_token_out: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_out = Some(user_token_out);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn host_fee_in(
-        &mut self,
-        host_fee_in: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.host_fee_in = host_fee_in;
-        self
-    }
-    #[inline(always)]
-    pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user = Some(user);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_in(&mut self, amount_in: u64) -> &mut Self {
-        self.amount_in = Some(amount_in);
-        self
-    }
-    #[inline(always)]
-    pub fn min_amount_out(&mut self, min_amount_out: u64) -> &mut Self {
-        self.min_amount_out = Some(min_amount_out);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = Swap {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            user_token_in: self.user_token_in.expect("user_token_in is not set"),
-            user_token_out: self.user_token_out.expect("user_token_out is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            oracle: self.oracle.expect("oracle is not set"),
-            host_fee_in: self.host_fee_in,
-            user: self.user.expect("user is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = SwapInstructionArgs {
-            amount_in: self.amount_in.clone().expect("amount_in is not set"),
-            min_amount_out: self
-                .min_amount_out
-                .clone()
-                .expect("min_amount_out is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `swap` CPI accounts.
-pub struct SwapCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `swap` CPI instruction.
-pub struct SwapCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: SwapInstructionArgs,
-}
-
-impl<'a, 'b> SwapCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: SwapCpiAccounts<'a, 'b>,
-        args: SwapInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            user_token_in: accounts.user_token_in,
-            user_token_out: accounts.user_token_out,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            oracle: accounts.oracle,
-            host_fee_in: accounts.host_fee_in,
-            user: accounts.user,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_in.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_out.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        if let Some(host_fee_in) = self.host_fee_in {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *host_fee_in.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.user.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = SwapInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(16 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.user_token_in.clone());
-        account_infos.push(self.user_token_out.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.oracle.clone());
-        if let Some(host_fee_in) = self.host_fee_in {
-            account_infos.push(host_fee_in.clone());
-        }
-        account_infos.push(self.user.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `Swap` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[writable]` reserve_x
-///   3. `[writable]` reserve_y
-///   4. `[writable]` user_token_in
-///   5. `[writable]` user_token_out
-///   6. `[]` token_x_mint
-///   7. `[]` token_y_mint
-///   8. `[writable]` oracle
-///   9. `[writable, optional]` host_fee_in
-///   10. `[signer]` user
-///   11. `[]` token_x_program
-///   12. `[]` token_y_program
-///   13. `[]` event_authority
-///   14. `[]` program
-#[derive(Clone, Debug)]
-pub struct SwapCpiBuilder<'a, 'b> {
-    instruction: Box<SwapCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> SwapCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(SwapCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            reserve_x: None,
-            reserve_y: None,
-            user_token_in: None,
-            user_token_out: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            oracle: None,
-            host_fee_in: None,
-            user: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            amount_in: None,
-            min_amount_out: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_in(
-        &mut self,
-        user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_in = Some(user_token_in);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_out(
-        &mut self,
-        user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_out = Some(user_token_out);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn host_fee_in(
-        &mut self,
-        host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.host_fee_in = host_fee_in;
-        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 token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_in(&mut self, amount_in: u64) -> &mut Self {
-        self.instruction.amount_in = Some(amount_in);
-        self
-    }
-    #[inline(always)]
-    pub fn min_amount_out(&mut self, min_amount_out: u64) -> &mut Self {
-        self.instruction.min_amount_out = Some(min_amount_out);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = SwapInstructionArgs {
-            amount_in: self
-                .instruction
-                .amount_in
-                .clone()
-                .expect("amount_in is not set"),
-            min_amount_out: self
-                .instruction
-                .min_amount_out
-                .clone()
-                .expect("min_amount_out is not set"),
-        };
-        let instruction = SwapCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            user_token_in: self
-                .instruction
-                .user_token_in
-                .expect("user_token_in is not set"),
-
-            user_token_out: self
-                .instruction
-                .user_token_out
-                .expect("user_token_out is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            host_fee_in: self.instruction.host_fee_in,
-
-            user: self.instruction.user.expect("user is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct SwapCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_out: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount_in: Option<u64>,
-    min_amount_out: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 941
packages/renderers-rust/e2e/meteora/src/generated/instructions/swap_exact_out.rs

@@ -1,941 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct SwapExactOut {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub user_token_in: solana_program::pubkey::Pubkey,
-
-    pub user_token_out: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub host_fee_in: Option<solana_program::pubkey::Pubkey>,
-
-    pub user: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl SwapExactOut {
-    pub fn instruction(
-        &self,
-        args: SwapExactOutInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: SwapExactOutInstructionArgs,
-        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.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_in,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_out,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        if let Some(host_fee_in) = self.host_fee_in {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                host_fee_in,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.user, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = SwapExactOutInstructionData::new().try_to_vec().unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SwapExactOutInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl SwapExactOutInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [250, 73, 101, 33, 38, 207, 75, 184],
-        }
-    }
-}
-
-impl Default for SwapExactOutInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SwapExactOutInstructionArgs {
-    pub max_in_amount: u64,
-    pub out_amount: u64,
-}
-
-/// Instruction builder for `SwapExactOut`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[writable]` reserve_x
-///   3. `[writable]` reserve_y
-///   4. `[writable]` user_token_in
-///   5. `[writable]` user_token_out
-///   6. `[]` token_x_mint
-///   7. `[]` token_y_mint
-///   8. `[writable]` oracle
-///   9. `[writable, optional]` host_fee_in
-///   10. `[signer]` user
-///   11. `[]` token_x_program
-///   12. `[]` token_y_program
-///   13. `[]` event_authority
-///   14. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct SwapExactOutBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    user_token_in: Option<solana_program::pubkey::Pubkey>,
-    user_token_out: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    host_fee_in: Option<solana_program::pubkey::Pubkey>,
-    user: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    max_in_amount: Option<u64>,
-    out_amount: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl SwapExactOutBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_in(&mut self, user_token_in: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_in = Some(user_token_in);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_out(&mut self, user_token_out: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_out = Some(user_token_out);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn host_fee_in(
-        &mut self,
-        host_fee_in: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.host_fee_in = host_fee_in;
-        self
-    }
-    #[inline(always)]
-    pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user = Some(user);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn max_in_amount(&mut self, max_in_amount: u64) -> &mut Self {
-        self.max_in_amount = Some(max_in_amount);
-        self
-    }
-    #[inline(always)]
-    pub fn out_amount(&mut self, out_amount: u64) -> &mut Self {
-        self.out_amount = Some(out_amount);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = SwapExactOut {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            user_token_in: self.user_token_in.expect("user_token_in is not set"),
-            user_token_out: self.user_token_out.expect("user_token_out is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            oracle: self.oracle.expect("oracle is not set"),
-            host_fee_in: self.host_fee_in,
-            user: self.user.expect("user is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = SwapExactOutInstructionArgs {
-            max_in_amount: self
-                .max_in_amount
-                .clone()
-                .expect("max_in_amount is not set"),
-            out_amount: self.out_amount.clone().expect("out_amount is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `swap_exact_out` CPI accounts.
-pub struct SwapExactOutCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `swap_exact_out` CPI instruction.
-pub struct SwapExactOutCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: SwapExactOutInstructionArgs,
-}
-
-impl<'a, 'b> SwapExactOutCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: SwapExactOutCpiAccounts<'a, 'b>,
-        args: SwapExactOutInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            user_token_in: accounts.user_token_in,
-            user_token_out: accounts.user_token_out,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            oracle: accounts.oracle,
-            host_fee_in: accounts.host_fee_in,
-            user: accounts.user,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_in.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_out.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        if let Some(host_fee_in) = self.host_fee_in {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *host_fee_in.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.user.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = SwapExactOutInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(16 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.user_token_in.clone());
-        account_infos.push(self.user_token_out.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.oracle.clone());
-        if let Some(host_fee_in) = self.host_fee_in {
-            account_infos.push(host_fee_in.clone());
-        }
-        account_infos.push(self.user.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `SwapExactOut` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[writable]` reserve_x
-///   3. `[writable]` reserve_y
-///   4. `[writable]` user_token_in
-///   5. `[writable]` user_token_out
-///   6. `[]` token_x_mint
-///   7. `[]` token_y_mint
-///   8. `[writable]` oracle
-///   9. `[writable, optional]` host_fee_in
-///   10. `[signer]` user
-///   11. `[]` token_x_program
-///   12. `[]` token_y_program
-///   13. `[]` event_authority
-///   14. `[]` program
-#[derive(Clone, Debug)]
-pub struct SwapExactOutCpiBuilder<'a, 'b> {
-    instruction: Box<SwapExactOutCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> SwapExactOutCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(SwapExactOutCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            reserve_x: None,
-            reserve_y: None,
-            user_token_in: None,
-            user_token_out: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            oracle: None,
-            host_fee_in: None,
-            user: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            max_in_amount: None,
-            out_amount: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_in(
-        &mut self,
-        user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_in = Some(user_token_in);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_out(
-        &mut self,
-        user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_out = Some(user_token_out);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn host_fee_in(
-        &mut self,
-        host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.host_fee_in = host_fee_in;
-        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 token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn max_in_amount(&mut self, max_in_amount: u64) -> &mut Self {
-        self.instruction.max_in_amount = Some(max_in_amount);
-        self
-    }
-    #[inline(always)]
-    pub fn out_amount(&mut self, out_amount: u64) -> &mut Self {
-        self.instruction.out_amount = Some(out_amount);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = SwapExactOutInstructionArgs {
-            max_in_amount: self
-                .instruction
-                .max_in_amount
-                .clone()
-                .expect("max_in_amount is not set"),
-            out_amount: self
-                .instruction
-                .out_amount
-                .clone()
-                .expect("out_amount is not set"),
-        };
-        let instruction = SwapExactOutCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            user_token_in: self
-                .instruction
-                .user_token_in
-                .expect("user_token_in is not set"),
-
-            user_token_out: self
-                .instruction
-                .user_token_out
-                .expect("user_token_out is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            host_fee_in: self.instruction.host_fee_in,
-
-            user: self.instruction.user.expect("user is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct SwapExactOutCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_out: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    max_in_amount: Option<u64>,
-    out_amount: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 963
packages/renderers-rust/e2e/meteora/src/generated/instructions/swap_with_price_impact.rs

@@ -1,963 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct SwapWithPriceImpact {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub user_token_in: solana_program::pubkey::Pubkey,
-
-    pub user_token_out: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub oracle: solana_program::pubkey::Pubkey,
-
-    pub host_fee_in: Option<solana_program::pubkey::Pubkey>,
-
-    pub user: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl SwapWithPriceImpact {
-    pub fn instruction(
-        &self,
-        args: SwapWithPriceImpactInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: SwapWithPriceImpactInstructionArgs,
-        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.lb_pair,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                bin_array_bitmap_extension,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_in,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.user_token_out,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.oracle,
-            false,
-        ));
-        if let Some(host_fee_in) = self.host_fee_in {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                host_fee_in,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.user, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = SwapWithPriceImpactInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SwapWithPriceImpactInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl SwapWithPriceImpactInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [56, 173, 230, 208, 173, 228, 156, 205],
-        }
-    }
-}
-
-impl Default for SwapWithPriceImpactInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct SwapWithPriceImpactInstructionArgs {
-    pub amount_in: u64,
-    pub active_id: Option<i32>,
-    pub max_price_impact_bps: u16,
-}
-
-/// Instruction builder for `SwapWithPriceImpact`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[writable]` reserve_x
-///   3. `[writable]` reserve_y
-///   4. `[writable]` user_token_in
-///   5. `[writable]` user_token_out
-///   6. `[]` token_x_mint
-///   7. `[]` token_y_mint
-///   8. `[writable]` oracle
-///   9. `[writable, optional]` host_fee_in
-///   10. `[signer]` user
-///   11. `[]` token_x_program
-///   12. `[]` token_y_program
-///   13. `[]` event_authority
-///   14. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct SwapWithPriceImpactBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    user_token_in: Option<solana_program::pubkey::Pubkey>,
-    user_token_out: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    oracle: Option<solana_program::pubkey::Pubkey>,
-    host_fee_in: Option<solana_program::pubkey::Pubkey>,
-    user: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    amount_in: Option<u64>,
-    active_id: Option<i32>,
-    max_price_impact_bps: Option<u16>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl SwapWithPriceImpactBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_in(&mut self, user_token_in: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_in = Some(user_token_in);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_out(&mut self, user_token_out: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user_token_out = Some(user_token_out);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(&mut self, oracle: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.oracle = Some(oracle);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn host_fee_in(
-        &mut self,
-        host_fee_in: Option<solana_program::pubkey::Pubkey>,
-    ) -> &mut Self {
-        self.host_fee_in = host_fee_in;
-        self
-    }
-    #[inline(always)]
-    pub fn user(&mut self, user: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.user = Some(user);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_in(&mut self, amount_in: u64) -> &mut Self {
-        self.amount_in = Some(amount_in);
-        self
-    }
-    /// `[optional argument]`
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_price_impact_bps(&mut self, max_price_impact_bps: u16) -> &mut Self {
-        self.max_price_impact_bps = Some(max_price_impact_bps);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = SwapWithPriceImpact {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_bitmap_extension: self.bin_array_bitmap_extension,
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            user_token_in: self.user_token_in.expect("user_token_in is not set"),
-            user_token_out: self.user_token_out.expect("user_token_out is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            oracle: self.oracle.expect("oracle is not set"),
-            host_fee_in: self.host_fee_in,
-            user: self.user.expect("user is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = SwapWithPriceImpactInstructionArgs {
-            amount_in: self.amount_in.clone().expect("amount_in is not set"),
-            active_id: self.active_id.clone(),
-            max_price_impact_bps: self
-                .max_price_impact_bps
-                .clone()
-                .expect("max_price_impact_bps is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `swap_with_price_impact` CPI accounts.
-pub struct SwapWithPriceImpactCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `swap_with_price_impact` CPI instruction.
-pub struct SwapWithPriceImpactCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub oracle: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-
-    pub user: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: SwapWithPriceImpactInstructionArgs,
-}
-
-impl<'a, 'b> SwapWithPriceImpactCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: SwapWithPriceImpactCpiAccounts<'a, 'b>,
-        args: SwapWithPriceImpactInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            bin_array_bitmap_extension: accounts.bin_array_bitmap_extension,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            user_token_in: accounts.user_token_in,
-            user_token_out: accounts.user_token_out,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            oracle: accounts.oracle,
-            host_fee_in: accounts.host_fee_in,
-            user: accounts.user,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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.lb_pair.key,
-            false,
-        ));
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                *bin_array_bitmap_extension.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_in.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.user_token_out.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.oracle.key,
-            false,
-        ));
-        if let Some(host_fee_in) = self.host_fee_in {
-            accounts.push(solana_program::instruction::AccountMeta::new(
-                *host_fee_in.key,
-                false,
-            ));
-        } else {
-            accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-                crate::LB_CLMM_ID,
-                false,
-            ));
-        }
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.user.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = SwapWithPriceImpactInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(16 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        if let Some(bin_array_bitmap_extension) = self.bin_array_bitmap_extension {
-            account_infos.push(bin_array_bitmap_extension.clone());
-        }
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.user_token_in.clone());
-        account_infos.push(self.user_token_out.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.oracle.clone());
-        if let Some(host_fee_in) = self.host_fee_in {
-            account_infos.push(host_fee_in.clone());
-        }
-        account_infos.push(self.user.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `SwapWithPriceImpact` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[optional]` bin_array_bitmap_extension
-///   2. `[writable]` reserve_x
-///   3. `[writable]` reserve_y
-///   4. `[writable]` user_token_in
-///   5. `[writable]` user_token_out
-///   6. `[]` token_x_mint
-///   7. `[]` token_y_mint
-///   8. `[writable]` oracle
-///   9. `[writable, optional]` host_fee_in
-///   10. `[signer]` user
-///   11. `[]` token_x_program
-///   12. `[]` token_y_program
-///   13. `[]` event_authority
-///   14. `[]` program
-#[derive(Clone, Debug)]
-pub struct SwapWithPriceImpactCpiBuilder<'a, 'b> {
-    instruction: Box<SwapWithPriceImpactCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> SwapWithPriceImpactCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(SwapWithPriceImpactCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            bin_array_bitmap_extension: None,
-            reserve_x: None,
-            reserve_y: None,
-            user_token_in: None,
-            user_token_out: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            oracle: None,
-            host_fee_in: None,
-            user: None,
-            token_x_program: None,
-            token_y_program: None,
-            event_authority: None,
-            program: None,
-            amount_in: None,
-            active_id: None,
-            max_price_impact_bps: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn bin_array_bitmap_extension(
-        &mut self,
-        bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.bin_array_bitmap_extension = bin_array_bitmap_extension;
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_in(
-        &mut self,
-        user_token_in: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_in = Some(user_token_in);
-        self
-    }
-    #[inline(always)]
-    pub fn user_token_out(
-        &mut self,
-        user_token_out: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.user_token_out = Some(user_token_out);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn oracle(
-        &mut self,
-        oracle: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.oracle = Some(oracle);
-        self
-    }
-    /// `[optional account]`
-    #[inline(always)]
-    pub fn host_fee_in(
-        &mut self,
-        host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    ) -> &mut Self {
-        self.instruction.host_fee_in = host_fee_in;
-        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 token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_in(&mut self, amount_in: u64) -> &mut Self {
-        self.instruction.amount_in = Some(amount_in);
-        self
-    }
-    /// `[optional argument]`
-    #[inline(always)]
-    pub fn active_id(&mut self, active_id: i32) -> &mut Self {
-        self.instruction.active_id = Some(active_id);
-        self
-    }
-    #[inline(always)]
-    pub fn max_price_impact_bps(&mut self, max_price_impact_bps: u16) -> &mut Self {
-        self.instruction.max_price_impact_bps = Some(max_price_impact_bps);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = SwapWithPriceImpactInstructionArgs {
-            amount_in: self
-                .instruction
-                .amount_in
-                .clone()
-                .expect("amount_in is not set"),
-            active_id: self.instruction.active_id.clone(),
-            max_price_impact_bps: self
-                .instruction
-                .max_price_impact_bps
-                .clone()
-                .expect("max_price_impact_bps is not set"),
-        };
-        let instruction = SwapWithPriceImpactCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_bitmap_extension: self.instruction.bin_array_bitmap_extension,
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            user_token_in: self
-                .instruction
-                .user_token_in
-                .expect("user_token_in is not set"),
-
-            user_token_out: self
-                .instruction
-                .user_token_out
-                .expect("user_token_out is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            oracle: self.instruction.oracle.expect("oracle is not set"),
-
-            host_fee_in: self.instruction.host_fee_in,
-
-            user: self.instruction.user.expect("user is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct SwapWithPriceImpactCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_bitmap_extension: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user_token_out: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    oracle: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    host_fee_in: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    user: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount_in: Option<u64>,
-    active_id: Option<i32>,
-    max_price_impact_bps: Option<u16>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 323
packages/renderers-rust/e2e/meteora/src/generated/instructions/toggle_pair_status.rs

@@ -1,323 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct TogglePairStatus {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-}
-
-impl TogglePairStatus {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.admin, true,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = TogglePairStatusInstructionData::new().try_to_vec().unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct TogglePairStatusInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl TogglePairStatusInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [61, 115, 52, 23, 46, 13, 31, 144],
-        }
-    }
-}
-
-impl Default for TogglePairStatusInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `TogglePairStatus`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-#[derive(Clone, Debug, Default)]
-pub struct TogglePairStatusBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl TogglePairStatusBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = TogglePairStatus {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            admin: self.admin.expect("admin is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `toggle_pair_status` CPI accounts.
-pub struct TogglePairStatusCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `toggle_pair_status` CPI instruction.
-pub struct TogglePairStatusCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> TogglePairStatusCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: TogglePairStatusCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            admin: accounts.admin,
-        }
-    }
-    #[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(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.admin.key,
-            true,
-        ));
-        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 data = TogglePairStatusInstructionData::new().try_to_vec().unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(3 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.admin.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)
-        }
-    }
-}
-
-/// Instruction builder for `TogglePairStatus` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-#[derive(Clone, Debug)]
-pub struct TogglePairStatusCpiBuilder<'a, 'b> {
-    instruction: Box<TogglePairStatusCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> TogglePairStatusCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(TogglePairStatusCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            admin: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = TogglePairStatusCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct TogglePairStatusCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 472
packages/renderers-rust/e2e/meteora/src/generated/instructions/update_fee_parameters.rs

@@ -1,472 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct UpdateFeeParameters {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl UpdateFeeParameters {
-    pub fn instruction(
-        &self,
-        args: UpdateFeeParametersInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: UpdateFeeParametersInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = UpdateFeeParametersInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateFeeParametersInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl UpdateFeeParametersInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [128, 128, 208, 91, 246, 53, 31, 176],
-        }
-    }
-}
-
-impl Default for UpdateFeeParametersInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateFeeParametersInstructionArgs {
-    pub protocol_share: u16,
-    pub base_factor: u16,
-}
-
-/// Instruction builder for `UpdateFeeParameters`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-///   2. `[]` event_authority
-///   3. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct UpdateFeeParametersBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    protocol_share: Option<u16>,
-    base_factor: Option<u16>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl UpdateFeeParametersBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn protocol_share(&mut self, protocol_share: u16) -> &mut Self {
-        self.protocol_share = Some(protocol_share);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.base_factor = Some(base_factor);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = UpdateFeeParameters {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            admin: self.admin.expect("admin is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = UpdateFeeParametersInstructionArgs {
-            protocol_share: self
-                .protocol_share
-                .clone()
-                .expect("protocol_share is not set"),
-            base_factor: self.base_factor.clone().expect("base_factor is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `update_fee_parameters` CPI accounts.
-pub struct UpdateFeeParametersCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `update_fee_parameters` CPI instruction.
-pub struct UpdateFeeParametersCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: UpdateFeeParametersInstructionArgs,
-}
-
-impl<'a, 'b> UpdateFeeParametersCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: UpdateFeeParametersCpiAccounts<'a, 'b>,
-        args: UpdateFeeParametersInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            admin: accounts.admin,
-            event_authority: accounts.event_authority,
-            program: accounts.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(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = UpdateFeeParametersInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `UpdateFeeParameters` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-///   2. `[]` event_authority
-///   3. `[]` program
-#[derive(Clone, Debug)]
-pub struct UpdateFeeParametersCpiBuilder<'a, 'b> {
-    instruction: Box<UpdateFeeParametersCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> UpdateFeeParametersCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(UpdateFeeParametersCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            admin: None,
-            event_authority: None,
-            program: None,
-            protocol_share: None,
-            base_factor: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn protocol_share(&mut self, protocol_share: u16) -> &mut Self {
-        self.instruction.protocol_share = Some(protocol_share);
-        self
-    }
-    #[inline(always)]
-    pub fn base_factor(&mut self, base_factor: u16) -> &mut Self {
-        self.instruction.base_factor = Some(base_factor);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = UpdateFeeParametersInstructionArgs {
-            protocol_share: self
-                .instruction
-                .protocol_share
-                .clone()
-                .expect("protocol_share is not set"),
-            base_factor: self
-                .instruction
-                .base_factor
-                .clone()
-                .expect("base_factor is not set"),
-        };
-        let instruction = UpdateFeeParametersCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct UpdateFeeParametersCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    protocol_share: Option<u16>,
-    base_factor: Option<u16>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 450
packages/renderers-rust/e2e/meteora/src/generated/instructions/update_fees_and_rewards.rs

@@ -1,450 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct UpdateFeesAndRewards {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub bin_array_lower: solana_program::pubkey::Pubkey,
-
-    pub bin_array_upper: solana_program::pubkey::Pubkey,
-
-    pub owner: solana_program::pubkey::Pubkey,
-}
-
-impl UpdateFeesAndRewards {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(&[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_lower,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array_upper,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.owner, true,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let data = UpdateFeesAndRewardsInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateFeesAndRewardsInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl UpdateFeesAndRewardsInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [154, 230, 250, 13, 236, 209, 75, 223],
-        }
-    }
-}
-
-impl Default for UpdateFeesAndRewardsInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-/// Instruction builder for `UpdateFeesAndRewards`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` owner
-#[derive(Clone, Debug, Default)]
-pub struct UpdateFeesAndRewardsBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    bin_array_lower: Option<solana_program::pubkey::Pubkey>,
-    bin_array_upper: Option<solana_program::pubkey::Pubkey>,
-    owner: Option<solana_program::pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl UpdateFeesAndRewardsBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner = Some(owner);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = UpdateFeesAndRewards {
-            position: self.position.expect("position is not set"),
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            bin_array_lower: self.bin_array_lower.expect("bin_array_lower is not set"),
-            bin_array_upper: self.bin_array_upper.expect("bin_array_upper is not set"),
-            owner: self.owner.expect("owner is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
-    }
-}
-
-/// `update_fees_and_rewards` CPI accounts.
-pub struct UpdateFeesAndRewardsCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `update_fees_and_rewards` CPI instruction.
-pub struct UpdateFeesAndRewardsCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-impl<'a, 'b> UpdateFeesAndRewardsCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: UpdateFeesAndRewardsCpiAccounts<'a, 'b>,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            lb_pair: accounts.lb_pair,
-            bin_array_lower: accounts.bin_array_lower,
-            bin_array_upper: accounts.bin_array_upper,
-            owner: accounts.owner,
-        }
-    }
-    #[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(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_lower.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array_upper.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.owner.key,
-            true,
-        ));
-        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 data = UpdateFeesAndRewardsInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-
-        let instruction = solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(6 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.bin_array_lower.clone());
-        account_infos.push(self.bin_array_upper.clone());
-        account_infos.push(self.owner.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)
-        }
-    }
-}
-
-/// Instruction builder for `UpdateFeesAndRewards` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[writable]` lb_pair
-///   2. `[writable]` bin_array_lower
-///   3. `[writable]` bin_array_upper
-///   4. `[signer]` owner
-#[derive(Clone, Debug)]
-pub struct UpdateFeesAndRewardsCpiBuilder<'a, 'b> {
-    instruction: Box<UpdateFeesAndRewardsCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> UpdateFeesAndRewardsCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(UpdateFeesAndRewardsCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            lb_pair: None,
-            bin_array_lower: None,
-            bin_array_upper: None,
-            owner: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_lower(
-        &mut self,
-        bin_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_lower = Some(bin_array_lower);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array_upper(
-        &mut self,
-        bin_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array_upper = Some(bin_array_upper);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.owner = Some(owner);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 instruction = UpdateFeesAndRewardsCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            bin_array_lower: self
-                .instruction
-                .bin_array_lower
-                .expect("bin_array_lower is not set"),
-
-            bin_array_upper: self
-                .instruction
-                .bin_array_upper
-                .expect("bin_array_upper is not set"),
-
-            owner: self.instruction.owner.expect("owner is not set"),
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct UpdateFeesAndRewardsCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 450
packages/renderers-rust/e2e/meteora/src/generated/instructions/update_position_operator.rs

@@ -1,450 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct UpdatePositionOperator {
-    pub position: solana_program::pubkey::Pubkey,
-
-    pub owner: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl UpdatePositionOperator {
-    pub fn instruction(
-        &self,
-        args: UpdatePositionOperatorInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: UpdatePositionOperatorInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.position,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.owner, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = UpdatePositionOperatorInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdatePositionOperatorInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl UpdatePositionOperatorInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [202, 184, 103, 143, 180, 191, 116, 217],
-        }
-    }
-}
-
-impl Default for UpdatePositionOperatorInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdatePositionOperatorInstructionArgs {
-    pub operator: Pubkey,
-}
-
-/// Instruction builder for `UpdatePositionOperator`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[signer]` owner
-///   2. `[]` event_authority
-///   3. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct UpdatePositionOperatorBuilder {
-    position: Option<solana_program::pubkey::Pubkey>,
-    owner: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    operator: Option<Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl UpdatePositionOperatorBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn position(&mut self, position: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.owner = Some(owner);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn operator(&mut self, operator: Pubkey) -> &mut Self {
-        self.operator = Some(operator);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = UpdatePositionOperator {
-            position: self.position.expect("position is not set"),
-            owner: self.owner.expect("owner is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = UpdatePositionOperatorInstructionArgs {
-            operator: self.operator.clone().expect("operator is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `update_position_operator` CPI accounts.
-pub struct UpdatePositionOperatorCpiAccounts<'a, 'b> {
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `update_position_operator` CPI instruction.
-pub struct UpdatePositionOperatorCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub position: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub owner: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: UpdatePositionOperatorInstructionArgs,
-}
-
-impl<'a, 'b> UpdatePositionOperatorCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: UpdatePositionOperatorCpiAccounts<'a, 'b>,
-        args: UpdatePositionOperatorInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            position: accounts.position,
-            owner: accounts.owner,
-            event_authority: accounts.event_authority,
-            program: accounts.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(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.position.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.owner.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = UpdatePositionOperatorInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.position.clone());
-        account_infos.push(self.owner.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `UpdatePositionOperator` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` position
-///   1. `[signer]` owner
-///   2. `[]` event_authority
-///   3. `[]` program
-#[derive(Clone, Debug)]
-pub struct UpdatePositionOperatorCpiBuilder<'a, 'b> {
-    instruction: Box<UpdatePositionOperatorCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> UpdatePositionOperatorCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(UpdatePositionOperatorCpiBuilderInstruction {
-            __program: program,
-            position: None,
-            owner: None,
-            event_authority: None,
-            program: None,
-            operator: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn position(
-        &mut self,
-        position: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.position = Some(position);
-        self
-    }
-    #[inline(always)]
-    pub fn owner(&mut self, owner: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.owner = Some(owner);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn operator(&mut self, operator: Pubkey) -> &mut Self {
-        self.instruction.operator = Some(operator);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = UpdatePositionOperatorInstructionArgs {
-            operator: self
-                .instruction
-                .operator
-                .clone()
-                .expect("operator is not set"),
-        };
-        let instruction = UpdatePositionOperatorCpi {
-            __program: self.instruction.__program,
-
-            position: self.instruction.position.expect("position is not set"),
-
-            owner: self.instruction.owner.expect("owner is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct UpdatePositionOperatorCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    owner: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    operator: Option<Pubkey>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 506
packages/renderers-rust/e2e/meteora/src/generated/instructions/update_reward_duration.rs

@@ -1,506 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct UpdateRewardDuration {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub bin_array: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl UpdateRewardDuration {
-    pub fn instruction(
-        &self,
-        args: UpdateRewardDurationInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: UpdateRewardDurationInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = UpdateRewardDurationInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateRewardDurationInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl UpdateRewardDurationInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [138, 174, 196, 169, 213, 235, 254, 107],
-        }
-    }
-}
-
-impl Default for UpdateRewardDurationInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateRewardDurationInstructionArgs {
-    pub reward_index: u64,
-    pub new_duration: u64,
-}
-
-/// Instruction builder for `UpdateRewardDuration`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-///   2. `[writable]` bin_array
-///   3. `[]` event_authority
-///   4. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct UpdateRewardDurationBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    bin_array: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    reward_index: Option<u64>,
-    new_duration: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl UpdateRewardDurationBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(&mut self, bin_array: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.bin_array = Some(bin_array);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn new_duration(&mut self, new_duration: u64) -> &mut Self {
-        self.new_duration = Some(new_duration);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = UpdateRewardDuration {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            admin: self.admin.expect("admin is not set"),
-            bin_array: self.bin_array.expect("bin_array is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = UpdateRewardDurationInstructionArgs {
-            reward_index: self.reward_index.clone().expect("reward_index is not set"),
-            new_duration: self.new_duration.clone().expect("new_duration is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `update_reward_duration` CPI accounts.
-pub struct UpdateRewardDurationCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `update_reward_duration` CPI instruction.
-pub struct UpdateRewardDurationCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: UpdateRewardDurationInstructionArgs,
-}
-
-impl<'a, 'b> UpdateRewardDurationCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: UpdateRewardDurationCpiAccounts<'a, 'b>,
-        args: UpdateRewardDurationInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            admin: accounts.admin,
-            bin_array: accounts.bin_array,
-            event_authority: accounts.event_authority,
-            program: accounts.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(5 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = UpdateRewardDurationInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(6 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.bin_array.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `UpdateRewardDuration` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-///   2. `[writable]` bin_array
-///   3. `[]` event_authority
-///   4. `[]` program
-#[derive(Clone, Debug)]
-pub struct UpdateRewardDurationCpiBuilder<'a, 'b> {
-    instruction: Box<UpdateRewardDurationCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> UpdateRewardDurationCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(UpdateRewardDurationCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            admin: None,
-            bin_array: None,
-            event_authority: None,
-            program: None,
-            reward_index: None,
-            new_duration: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(
-        &mut self,
-        bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array = Some(bin_array);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.instruction.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn new_duration(&mut self, new_duration: u64) -> &mut Self {
-        self.instruction.new_duration = Some(new_duration);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = UpdateRewardDurationInstructionArgs {
-            reward_index: self
-                .instruction
-                .reward_index
-                .clone()
-                .expect("reward_index is not set"),
-            new_duration: self
-                .instruction
-                .new_duration
-                .clone()
-                .expect("new_duration is not set"),
-        };
-        let instruction = UpdateRewardDurationCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            bin_array: self.instruction.bin_array.expect("bin_array is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct UpdateRewardDurationCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_index: Option<u64>,
-    new_duration: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 470
packages/renderers-rust/e2e/meteora/src/generated/instructions/update_reward_funder.rs

@@ -1,470 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct UpdateRewardFunder {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub admin: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl UpdateRewardFunder {
-    pub fn instruction(
-        &self,
-        args: UpdateRewardFunderInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: UpdateRewardFunderInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.admin, true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = UpdateRewardFunderInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateRewardFunderInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl UpdateRewardFunderInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [211, 28, 48, 32, 215, 160, 35, 23],
-        }
-    }
-}
-
-impl Default for UpdateRewardFunderInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UpdateRewardFunderInstructionArgs {
-    pub reward_index: u64,
-    pub new_funder: Pubkey,
-}
-
-/// Instruction builder for `UpdateRewardFunder`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-///   2. `[]` event_authority
-///   3. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct UpdateRewardFunderBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    admin: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    reward_index: Option<u64>,
-    new_funder: Option<Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl UpdateRewardFunderBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn new_funder(&mut self, new_funder: Pubkey) -> &mut Self {
-        self.new_funder = Some(new_funder);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = UpdateRewardFunder {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            admin: self.admin.expect("admin is not set"),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = UpdateRewardFunderInstructionArgs {
-            reward_index: self.reward_index.clone().expect("reward_index is not set"),
-            new_funder: self.new_funder.clone().expect("new_funder is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `update_reward_funder` CPI accounts.
-pub struct UpdateRewardFunderCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `update_reward_funder` CPI instruction.
-pub struct UpdateRewardFunderCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub admin: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: UpdateRewardFunderInstructionArgs,
-}
-
-impl<'a, 'b> UpdateRewardFunderCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: UpdateRewardFunderCpiAccounts<'a, 'b>,
-        args: UpdateRewardFunderInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            admin: accounts.admin,
-            event_authority: accounts.event_authority,
-            program: accounts.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(4 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.admin.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = UpdateRewardFunderInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(5 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.admin.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `UpdateRewardFunder` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[signer]` admin
-///   2. `[]` event_authority
-///   3. `[]` program
-#[derive(Clone, Debug)]
-pub struct UpdateRewardFunderCpiBuilder<'a, 'b> {
-    instruction: Box<UpdateRewardFunderCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> UpdateRewardFunderCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(UpdateRewardFunderCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            admin: None,
-            event_authority: None,
-            program: None,
-            reward_index: None,
-            new_funder: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn admin(&mut self, admin: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
-        self.instruction.admin = Some(admin);
-        self
-    }
-    #[inline(always)]
-    pub fn event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.instruction.reward_index = Some(reward_index);
-        self
-    }
-    #[inline(always)]
-    pub fn new_funder(&mut self, new_funder: Pubkey) -> &mut Self {
-        self.instruction.new_funder = Some(new_funder);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = UpdateRewardFunderInstructionArgs {
-            reward_index: self
-                .instruction
-                .reward_index
-                .clone()
-                .expect("reward_index is not set"),
-            new_funder: self
-                .instruction
-                .new_funder
-                .clone()
-                .expect("new_funder is not set"),
-        };
-        let instruction = UpdateRewardFunderCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            admin: self.instruction.admin.expect("admin is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct UpdateRewardFunderCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    admin: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_index: Option<u64>,
-    new_funder: Option<Pubkey>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 658
packages/renderers-rust/e2e/meteora/src/generated/instructions/withdraw_ineligible_reward.rs

@@ -1,658 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct WithdrawIneligibleReward {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub reward_vault: solana_program::pubkey::Pubkey,
-
-    pub reward_mint: solana_program::pubkey::Pubkey,
-
-    pub funder_token_account: solana_program::pubkey::Pubkey,
-
-    pub funder: solana_program::pubkey::Pubkey,
-
-    pub bin_array: solana_program::pubkey::Pubkey,
-
-    pub token_program: solana_program::pubkey::Pubkey,
-
-    pub event_authority: solana_program::pubkey::Pubkey,
-
-    pub program: solana_program::pubkey::Pubkey,
-}
-
-impl WithdrawIneligibleReward {
-    pub fn instruction(
-        &self,
-        args: WithdrawIneligibleRewardInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: WithdrawIneligibleRewardInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reward_vault,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.reward_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.funder_token_account,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.funder,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.bin_array,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.event_authority,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = WithdrawIneligibleRewardInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct WithdrawIneligibleRewardInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl WithdrawIneligibleRewardInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [148, 206, 42, 195, 247, 49, 103, 8],
-        }
-    }
-}
-
-impl Default for WithdrawIneligibleRewardInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct WithdrawIneligibleRewardInstructionArgs {
-    pub reward_index: u64,
-}
-
-/// Instruction builder for `WithdrawIneligibleReward`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reward_vault
-///   2. `[]` reward_mint
-///   3. `[writable]` funder_token_account
-///   4. `[signer]` funder
-///   5. `[writable]` bin_array
-///   6. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug, Default)]
-pub struct WithdrawIneligibleRewardBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    reward_vault: Option<solana_program::pubkey::Pubkey>,
-    reward_mint: Option<solana_program::pubkey::Pubkey>,
-    funder_token_account: Option<solana_program::pubkey::Pubkey>,
-    funder: Option<solana_program::pubkey::Pubkey>,
-    bin_array: Option<solana_program::pubkey::Pubkey>,
-    token_program: Option<solana_program::pubkey::Pubkey>,
-    event_authority: Option<solana_program::pubkey::Pubkey>,
-    program: Option<solana_program::pubkey::Pubkey>,
-    reward_index: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl WithdrawIneligibleRewardBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(&mut self, reward_vault: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(&mut self, reward_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn funder_token_account(
-        &mut self,
-        funder_token_account: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.funder_token_account = Some(funder_token_account);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(&mut self, funder: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(&mut self, bin_array: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.bin_array = Some(bin_array);
-        self
-    }
-    /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
-    #[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 event_authority(
-        &mut self,
-        event_authority: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(&mut self, program: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.reward_index = Some(reward_index);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = WithdrawIneligibleReward {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            reward_vault: self.reward_vault.expect("reward_vault is not set"),
-            reward_mint: self.reward_mint.expect("reward_mint is not set"),
-            funder_token_account: self
-                .funder_token_account
-                .expect("funder_token_account is not set"),
-            funder: self.funder.expect("funder is not set"),
-            bin_array: self.bin_array.expect("bin_array is not set"),
-            token_program: self.token_program.unwrap_or(solana_program::pubkey!(
-                "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
-            )),
-            event_authority: self.event_authority.expect("event_authority is not set"),
-            program: self.program.expect("program is not set"),
-        };
-        let args = WithdrawIneligibleRewardInstructionArgs {
-            reward_index: self.reward_index.clone().expect("reward_index is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `withdraw_ineligible_reward` CPI accounts.
-pub struct WithdrawIneligibleRewardCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `withdraw_ineligible_reward` CPI instruction.
-pub struct WithdrawIneligibleRewardCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub funder: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: WithdrawIneligibleRewardInstructionArgs,
-}
-
-impl<'a, 'b> WithdrawIneligibleRewardCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: WithdrawIneligibleRewardCpiAccounts<'a, 'b>,
-        args: WithdrawIneligibleRewardInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            reward_vault: accounts.reward_vault,
-            reward_mint: accounts.reward_mint,
-            funder_token_account: accounts.funder_token_account,
-            funder: accounts.funder,
-            bin_array: accounts.bin_array,
-            token_program: accounts.token_program,
-            event_authority: accounts.event_authority,
-            program: accounts.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(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reward_vault.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.reward_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.funder_token_account.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.funder.key,
-            true,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.bin_array.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.event_authority.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.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 = WithdrawIneligibleRewardInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(10 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.reward_vault.clone());
-        account_infos.push(self.reward_mint.clone());
-        account_infos.push(self.funder_token_account.clone());
-        account_infos.push(self.funder.clone());
-        account_infos.push(self.bin_array.clone());
-        account_infos.push(self.token_program.clone());
-        account_infos.push(self.event_authority.clone());
-        account_infos.push(self.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)
-        }
-    }
-}
-
-/// Instruction builder for `WithdrawIneligibleReward` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reward_vault
-///   2. `[]` reward_mint
-///   3. `[writable]` funder_token_account
-///   4. `[signer]` funder
-///   5. `[writable]` bin_array
-///   6. `[]` token_program
-///   7. `[]` event_authority
-///   8. `[]` program
-#[derive(Clone, Debug)]
-pub struct WithdrawIneligibleRewardCpiBuilder<'a, 'b> {
-    instruction: Box<WithdrawIneligibleRewardCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> WithdrawIneligibleRewardCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(WithdrawIneligibleRewardCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            reward_vault: None,
-            reward_mint: None,
-            funder_token_account: None,
-            funder: None,
-            bin_array: None,
-            token_program: None,
-            event_authority: None,
-            program: None,
-            reward_index: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_vault(
-        &mut self,
-        reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_vault = Some(reward_vault);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_mint(
-        &mut self,
-        reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reward_mint = Some(reward_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn funder_token_account(
-        &mut self,
-        funder_token_account: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder_token_account = Some(funder_token_account);
-        self
-    }
-    #[inline(always)]
-    pub fn funder(
-        &mut self,
-        funder: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.funder = Some(funder);
-        self
-    }
-    #[inline(always)]
-    pub fn bin_array(
-        &mut self,
-        bin_array: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.bin_array = Some(bin_array);
-        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 event_authority(
-        &mut self,
-        event_authority: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.event_authority = Some(event_authority);
-        self
-    }
-    #[inline(always)]
-    pub fn program(
-        &mut self,
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.program = Some(program);
-        self
-    }
-    #[inline(always)]
-    pub fn reward_index(&mut self, reward_index: u64) -> &mut Self {
-        self.instruction.reward_index = Some(reward_index);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = WithdrawIneligibleRewardInstructionArgs {
-            reward_index: self
-                .instruction
-                .reward_index
-                .clone()
-                .expect("reward_index is not set"),
-        };
-        let instruction = WithdrawIneligibleRewardCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            reward_vault: self
-                .instruction
-                .reward_vault
-                .expect("reward_vault is not set"),
-
-            reward_mint: self
-                .instruction
-                .reward_mint
-                .expect("reward_mint is not set"),
-
-            funder_token_account: self
-                .instruction
-                .funder_token_account
-                .expect("funder_token_account is not set"),
-
-            funder: self.instruction.funder.expect("funder is not set"),
-
-            bin_array: self.instruction.bin_array.expect("bin_array is not set"),
-
-            token_program: self
-                .instruction
-                .token_program
-                .expect("token_program is not set"),
-
-            event_authority: self
-                .instruction
-                .event_authority
-                .expect("event_authority is not set"),
-
-            program: self.instruction.program.expect("program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct WithdrawIneligibleRewardCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder_token_account: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    funder: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    bin_array: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    event_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reward_index: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 682
packages/renderers-rust/e2e/meteora/src/generated/instructions/withdraw_protocol_fee.rs

@@ -1,682 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Accounts.
-#[derive(Debug)]
-pub struct WithdrawProtocolFee {
-    pub lb_pair: solana_program::pubkey::Pubkey,
-
-    pub reserve_x: solana_program::pubkey::Pubkey,
-
-    pub reserve_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_mint: solana_program::pubkey::Pubkey,
-
-    pub token_y_mint: solana_program::pubkey::Pubkey,
-
-    pub receiver_token_x: solana_program::pubkey::Pubkey,
-
-    pub receiver_token_y: solana_program::pubkey::Pubkey,
-
-    pub token_x_program: solana_program::pubkey::Pubkey,
-
-    pub token_y_program: solana_program::pubkey::Pubkey,
-}
-
-impl WithdrawProtocolFee {
-    pub fn instruction(
-        &self,
-        args: WithdrawProtocolFeeInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
-        self.instruction_with_remaining_accounts(args, &[])
-    }
-    #[allow(clippy::vec_init_then_push)]
-    pub fn instruction_with_remaining_accounts(
-        &self,
-        args: WithdrawProtocolFeeInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
-        let mut accounts = Vec::with_capacity(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.lb_pair,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.reserve_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_mint,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.receiver_token_x,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.receiver_token_y,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_x_program,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            self.token_y_program,
-            false,
-        ));
-        accounts.extend_from_slice(remaining_accounts);
-        let mut data = WithdrawProtocolFeeInstructionData::new()
-            .try_to_vec()
-            .unwrap();
-        let mut args = args.try_to_vec().unwrap();
-        data.append(&mut args);
-
-        solana_program::instruction::Instruction {
-            program_id: crate::LB_CLMM_ID,
-            accounts,
-            data,
-        }
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct WithdrawProtocolFeeInstructionData {
-    discriminator: [u8; 8],
-}
-
-impl WithdrawProtocolFeeInstructionData {
-    pub fn new() -> Self {
-        Self {
-            discriminator: [158, 201, 158, 189, 33, 93, 162, 103],
-        }
-    }
-}
-
-impl Default for WithdrawProtocolFeeInstructionData {
-    fn default() -> Self {
-        Self::new()
-    }
-}
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct WithdrawProtocolFeeInstructionArgs {
-    pub amount_x: u64,
-    pub amount_y: u64,
-}
-
-/// Instruction builder for `WithdrawProtocolFee`.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reserve_x
-///   2. `[writable]` reserve_y
-///   3. `[]` token_x_mint
-///   4. `[]` token_y_mint
-///   5. `[writable]` receiver_token_x
-///   6. `[writable]` receiver_token_y
-///   7. `[]` token_x_program
-///   8. `[]` token_y_program
-#[derive(Clone, Debug, Default)]
-pub struct WithdrawProtocolFeeBuilder {
-    lb_pair: Option<solana_program::pubkey::Pubkey>,
-    reserve_x: Option<solana_program::pubkey::Pubkey>,
-    reserve_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_mint: Option<solana_program::pubkey::Pubkey>,
-    token_y_mint: Option<solana_program::pubkey::Pubkey>,
-    receiver_token_x: Option<solana_program::pubkey::Pubkey>,
-    receiver_token_y: Option<solana_program::pubkey::Pubkey>,
-    token_x_program: Option<solana_program::pubkey::Pubkey>,
-    token_y_program: Option<solana_program::pubkey::Pubkey>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
-}
-
-impl WithdrawProtocolFeeBuilder {
-    pub fn new() -> Self {
-        Self::default()
-    }
-    #[inline(always)]
-    pub fn lb_pair(&mut self, lb_pair: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(&mut self, reserve_x: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(&mut self, reserve_y: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(&mut self, token_x_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(&mut self, token_y_mint: solana_program::pubkey::Pubkey) -> &mut Self {
-        self.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn receiver_token_x(
-        &mut self,
-        receiver_token_x: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.receiver_token_x = Some(receiver_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn receiver_token_y(
-        &mut self,
-        receiver_token_y: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.receiver_token_y = Some(receiver_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: solana_program::pubkey::Pubkey,
-    ) -> &mut Self {
-        self.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.amount_y = Some(amount_y);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
-        self.__remaining_accounts.push(account);
-        self
-    }
-    /// Add additional accounts to the instruction.
-    #[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 = WithdrawProtocolFee {
-            lb_pair: self.lb_pair.expect("lb_pair is not set"),
-            reserve_x: self.reserve_x.expect("reserve_x is not set"),
-            reserve_y: self.reserve_y.expect("reserve_y is not set"),
-            token_x_mint: self.token_x_mint.expect("token_x_mint is not set"),
-            token_y_mint: self.token_y_mint.expect("token_y_mint is not set"),
-            receiver_token_x: self.receiver_token_x.expect("receiver_token_x is not set"),
-            receiver_token_y: self.receiver_token_y.expect("receiver_token_y is not set"),
-            token_x_program: self.token_x_program.expect("token_x_program is not set"),
-            token_y_program: self.token_y_program.expect("token_y_program is not set"),
-        };
-        let args = WithdrawProtocolFeeInstructionArgs {
-            amount_x: self.amount_x.clone().expect("amount_x is not set"),
-            amount_y: self.amount_y.clone().expect("amount_y is not set"),
-        };
-
-        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
-    }
-}
-
-/// `withdraw_protocol_fee` CPI accounts.
-pub struct WithdrawProtocolFeeCpiAccounts<'a, 'b> {
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub receiver_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub receiver_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-}
-
-/// `withdraw_protocol_fee` CPI instruction.
-pub struct WithdrawProtocolFeeCpi<'a, 'b> {
-    /// The program to invoke.
-    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub receiver_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub receiver_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-
-    pub token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    /// The arguments for the instruction.
-    pub __args: WithdrawProtocolFeeInstructionArgs,
-}
-
-impl<'a, 'b> WithdrawProtocolFeeCpi<'a, 'b> {
-    pub fn new(
-        program: &'b solana_program::account_info::AccountInfo<'a>,
-        accounts: WithdrawProtocolFeeCpiAccounts<'a, 'b>,
-        args: WithdrawProtocolFeeInstructionArgs,
-    ) -> Self {
-        Self {
-            __program: program,
-            lb_pair: accounts.lb_pair,
-            reserve_x: accounts.reserve_x,
-            reserve_y: accounts.reserve_y,
-            token_x_mint: accounts.token_x_mint,
-            token_y_mint: accounts.token_y_mint,
-            receiver_token_x: accounts.receiver_token_x,
-            receiver_token_y: accounts.receiver_token_y,
-            token_x_program: accounts.token_x_program,
-            token_y_program: accounts.token_y_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(9 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.lb_pair.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.reserve_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_mint.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.receiver_token_x.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            *self.receiver_token_y.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_x_program.key,
-            false,
-        ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
-            *self.token_y_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 = WithdrawProtocolFeeInstructionData::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::LB_CLMM_ID,
-            accounts,
-            data,
-        };
-        let mut account_infos = Vec::with_capacity(10 + remaining_accounts.len());
-        account_infos.push(self.__program.clone());
-        account_infos.push(self.lb_pair.clone());
-        account_infos.push(self.reserve_x.clone());
-        account_infos.push(self.reserve_y.clone());
-        account_infos.push(self.token_x_mint.clone());
-        account_infos.push(self.token_y_mint.clone());
-        account_infos.push(self.receiver_token_x.clone());
-        account_infos.push(self.receiver_token_y.clone());
-        account_infos.push(self.token_x_program.clone());
-        account_infos.push(self.token_y_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)
-        }
-    }
-}
-
-/// Instruction builder for `WithdrawProtocolFee` via CPI.
-///
-/// ### Accounts:
-///
-///   0. `[writable]` lb_pair
-///   1. `[writable]` reserve_x
-///   2. `[writable]` reserve_y
-///   3. `[]` token_x_mint
-///   4. `[]` token_y_mint
-///   5. `[writable]` receiver_token_x
-///   6. `[writable]` receiver_token_y
-///   7. `[]` token_x_program
-///   8. `[]` token_y_program
-#[derive(Clone, Debug)]
-pub struct WithdrawProtocolFeeCpiBuilder<'a, 'b> {
-    instruction: Box<WithdrawProtocolFeeCpiBuilderInstruction<'a, 'b>>,
-}
-
-impl<'a, 'b> WithdrawProtocolFeeCpiBuilder<'a, 'b> {
-    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
-        let instruction = Box::new(WithdrawProtocolFeeCpiBuilderInstruction {
-            __program: program,
-            lb_pair: None,
-            reserve_x: None,
-            reserve_y: None,
-            token_x_mint: None,
-            token_y_mint: None,
-            receiver_token_x: None,
-            receiver_token_y: None,
-            token_x_program: None,
-            token_y_program: None,
-            amount_x: None,
-            amount_y: None,
-            __remaining_accounts: Vec::new(),
-        });
-        Self { instruction }
-    }
-    #[inline(always)]
-    pub fn lb_pair(
-        &mut self,
-        lb_pair: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.lb_pair = Some(lb_pair);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_x(
-        &mut self,
-        reserve_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_x = Some(reserve_x);
-        self
-    }
-    #[inline(always)]
-    pub fn reserve_y(
-        &mut self,
-        reserve_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.reserve_y = Some(reserve_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_mint(
-        &mut self,
-        token_x_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_mint = Some(token_x_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_mint(
-        &mut self,
-        token_y_mint: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_mint = Some(token_y_mint);
-        self
-    }
-    #[inline(always)]
-    pub fn receiver_token_x(
-        &mut self,
-        receiver_token_x: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.receiver_token_x = Some(receiver_token_x);
-        self
-    }
-    #[inline(always)]
-    pub fn receiver_token_y(
-        &mut self,
-        receiver_token_y: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.receiver_token_y = Some(receiver_token_y);
-        self
-    }
-    #[inline(always)]
-    pub fn token_x_program(
-        &mut self,
-        token_x_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_x_program = Some(token_x_program);
-        self
-    }
-    #[inline(always)]
-    pub fn token_y_program(
-        &mut self,
-        token_y_program: &'b solana_program::account_info::AccountInfo<'a>,
-    ) -> &mut Self {
-        self.instruction.token_y_program = Some(token_y_program);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_x(&mut self, amount_x: u64) -> &mut Self {
-        self.instruction.amount_x = Some(amount_x);
-        self
-    }
-    #[inline(always)]
-    pub fn amount_y(&mut self, amount_y: u64) -> &mut Self {
-        self.instruction.amount_y = Some(amount_y);
-        self
-    }
-    /// Add an additional account to the instruction.
-    #[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
-    }
-    /// Add additional accounts to the instruction.
-    ///
-    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
-    /// and a `bool` indicating whether the account is a signer or not.
-    #[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 = WithdrawProtocolFeeInstructionArgs {
-            amount_x: self
-                .instruction
-                .amount_x
-                .clone()
-                .expect("amount_x is not set"),
-            amount_y: self
-                .instruction
-                .amount_y
-                .clone()
-                .expect("amount_y is not set"),
-        };
-        let instruction = WithdrawProtocolFeeCpi {
-            __program: self.instruction.__program,
-
-            lb_pair: self.instruction.lb_pair.expect("lb_pair is not set"),
-
-            reserve_x: self.instruction.reserve_x.expect("reserve_x is not set"),
-
-            reserve_y: self.instruction.reserve_y.expect("reserve_y is not set"),
-
-            token_x_mint: self
-                .instruction
-                .token_x_mint
-                .expect("token_x_mint is not set"),
-
-            token_y_mint: self
-                .instruction
-                .token_y_mint
-                .expect("token_y_mint is not set"),
-
-            receiver_token_x: self
-                .instruction
-                .receiver_token_x
-                .expect("receiver_token_x is not set"),
-
-            receiver_token_y: self
-                .instruction
-                .receiver_token_y
-                .expect("receiver_token_y is not set"),
-
-            token_x_program: self
-                .instruction
-                .token_x_program
-                .expect("token_x_program is not set"),
-
-            token_y_program: self
-                .instruction
-                .token_y_program
-                .expect("token_y_program is not set"),
-            __args: args,
-        };
-        instruction.invoke_signed_with_remaining_accounts(
-            signers_seeds,
-            &self.instruction.__remaining_accounts,
-        )
-    }
-}
-
-#[derive(Clone, Debug)]
-struct WithdrawProtocolFeeCpiBuilderInstruction<'a, 'b> {
-    __program: &'b solana_program::account_info::AccountInfo<'a>,
-    lb_pair: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    reserve_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    receiver_token_x: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    receiver_token_y: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_x_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    token_y_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
-    amount_x: Option<u64>,
-    amount_y: Option<u64>,
-    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
-    __remaining_accounts: Vec<(
-        &'b solana_program::account_info::AccountInfo<'a>,
-        bool,
-        bool,
-    )>,
-}

+ 0 - 14
packages/renderers-rust/e2e/meteora/src/generated/mod.rs

@@ -1,14 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-pub mod accounts;
-pub mod errors;
-pub mod instructions;
-pub mod programs;
-pub mod types;
-
-pub(crate) use programs::*;

+ 0 - 11
packages/renderers-rust/e2e/meteora/src/generated/programs.rs

@@ -1,11 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use solana_program::{pubkey, pubkey::Pubkey};
-
-/// `lb_clmm` program ID.
-pub const LB_CLMM_ID: Pubkey = pubkey!("LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo");

+ 0 - 29
packages/renderers-rust/e2e/meteora/src/generated/types/activation_type.rs

@@ -1,29 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use num_derive::FromPrimitive;
-
-/// Type of the activation
-#[derive(
-    BorshSerialize,
-    BorshDeserialize,
-    Clone,
-    Debug,
-    Eq,
-    PartialEq,
-    Copy,
-    PartialOrd,
-    Hash,
-    FromPrimitive,
-)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub enum ActivationType {
-    Slot,
-    Timestamp,
-}

+ 0 - 32
packages/renderers-rust/e2e/meteora/src/generated/types/bin.rs

@@ -1,32 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct Bin {
-    /// Amount of token X in the bin. This already excluded protocol fees.
-    pub amount_x: u64,
-    /// Amount of token Y in the bin. This already excluded protocol fees.
-    pub amount_y: u64,
-    /// Bin price
-    pub price: u128,
-    /// Liquidities of the bin. This is the same as LP mint supply. q-number
-    pub liquidity_supply: u128,
-    /// reward_a_per_token_stored
-    pub reward_per_token_stored: [u128; 2],
-    /// Swap fee amount of token X per liquidity deposited.
-    pub fee_amount_x_per_token_stored: u128,
-    /// Swap fee amount of token Y per liquidity deposited.
-    pub fee_amount_y_per_token_stored: u128,
-    /// Total token X swap into the bin. Only used for tracking purpose.
-    pub amount_x_in: u128,
-    /// Total token Y swap into he bin. Only used for tracking purpose.
-    pub amount_y_in: u128,
-}

+ 0 - 20
packages/renderers-rust/e2e/meteora/src/generated/types/bin_liquidity_distribution.rs

@@ -1,20 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct BinLiquidityDistribution {
-    /// Define the bin ID wish to deposit to.
-    pub bin_id: i32,
-    /// DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin.
-    pub distribution_x: u16,
-    /// DistributionX (or distributionY) is the percentages of amountX (or amountY) you want to add to each bin.
-    pub distribution_y: u16,
-}

+ 0 - 18
packages/renderers-rust/e2e/meteora/src/generated/types/bin_liquidity_distribution_by_weight.rs

@@ -1,18 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct BinLiquidityDistributionByWeight {
-    /// Define the bin ID wish to deposit to.
-    pub bin_id: i32,
-    /// weight of liquidity distributed for this bin id
-    pub weight: u16,
-}

+ 0 - 16
packages/renderers-rust/e2e/meteora/src/generated/types/bin_liquidity_reduction.rs

@@ -1,16 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct BinLiquidityReduction {
-    pub bin_id: i32,
-    pub bps_to_remove: u16,
-}

+ 0 - 16
packages/renderers-rust/e2e/meteora/src/generated/types/compressed_bin_deposit_amount.rs

@@ -1,16 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct CompressedBinDepositAmount {
-    pub bin_id: i32,
-    pub amount: u32,
-}

+ 0 - 18
packages/renderers-rust/e2e/meteora/src/generated/types/fee_info.rs

@@ -1,18 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct FeeInfo {
-    pub fee_x_per_token_complete: u128,
-    pub fee_y_per_token_complete: u128,
-    pub fee_x_pending: u64,
-    pub fee_y_pending: u64,
-}

+ 0 - 29
packages/renderers-rust/e2e/meteora/src/generated/types/layout_version.rs

@@ -1,29 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use num_derive::FromPrimitive;
-
-/// Layout version
-#[derive(
-    BorshSerialize,
-    BorshDeserialize,
-    Clone,
-    Debug,
-    Eq,
-    PartialEq,
-    Copy,
-    PartialOrd,
-    Hash,
-    FromPrimitive,
-)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub enum LayoutVersion {
-    V0,
-    V1,
-}

+ 0 - 46
packages/renderers-rust/e2e/meteora/src/generated/types/mod.rs

@@ -1,46 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-pub(crate) mod r#activation_type;
-pub(crate) mod r#bin;
-pub(crate) mod r#bin_liquidity_distribution;
-pub(crate) mod r#bin_liquidity_distribution_by_weight;
-pub(crate) mod r#bin_liquidity_reduction;
-pub(crate) mod r#compressed_bin_deposit_amount;
-pub(crate) mod r#fee_info;
-pub(crate) mod r#layout_version;
-pub(crate) mod r#observation;
-pub(crate) mod r#pair_status;
-pub(crate) mod r#pair_type;
-pub(crate) mod r#protocol_fee;
-pub(crate) mod r#reward_info;
-pub(crate) mod r#rounding;
-pub(crate) mod r#static_parameters;
-pub(crate) mod r#strategy_parameters;
-pub(crate) mod r#strategy_type;
-pub(crate) mod r#user_reward_info;
-pub(crate) mod r#variable_parameters;
-
-pub use self::r#activation_type::*;
-pub use self::r#bin::*;
-pub use self::r#bin_liquidity_distribution::*;
-pub use self::r#bin_liquidity_distribution_by_weight::*;
-pub use self::r#bin_liquidity_reduction::*;
-pub use self::r#compressed_bin_deposit_amount::*;
-pub use self::r#fee_info::*;
-pub use self::r#layout_version::*;
-pub use self::r#observation::*;
-pub use self::r#pair_status::*;
-pub use self::r#pair_type::*;
-pub use self::r#protocol_fee::*;
-pub use self::r#reward_info::*;
-pub use self::r#rounding::*;
-pub use self::r#static_parameters::*;
-pub use self::r#strategy_parameters::*;
-pub use self::r#strategy_type::*;
-pub use self::r#user_reward_info::*;
-pub use self::r#variable_parameters::*;

+ 0 - 20
packages/renderers-rust/e2e/meteora/src/generated/types/observation.rs

@@ -1,20 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct Observation {
-    /// Cumulative active bin ID
-    pub cumulative_active_bin_id: i128,
-    /// Observation sample created timestamp
-    pub created_at: i64,
-    /// Observation sample last updated timestamp
-    pub last_updated_at: i64,
-}

+ 0 - 29
packages/renderers-rust/e2e/meteora/src/generated/types/pair_status.rs

@@ -1,29 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use num_derive::FromPrimitive;
-
-/// Pair status. 0 = Enabled, 1 = Disabled. Putting 0 as enabled for backward compatibility.
-#[derive(
-    BorshSerialize,
-    BorshDeserialize,
-    Clone,
-    Debug,
-    Eq,
-    PartialEq,
-    Copy,
-    PartialOrd,
-    Hash,
-    FromPrimitive,
-)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub enum PairStatus {
-    Enabled,
-    Disabled,
-}

+ 0 - 30
packages/renderers-rust/e2e/meteora/src/generated/types/pair_type.rs

@@ -1,30 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use num_derive::FromPrimitive;
-
-/// Type of the Pair. 0 = Permissionless, 1 = Permission, 2 = CustomizablePermissionless. Putting 0 as permissionless for backward compatibility.
-#[derive(
-    BorshSerialize,
-    BorshDeserialize,
-    Clone,
-    Debug,
-    Eq,
-    PartialEq,
-    Copy,
-    PartialOrd,
-    Hash,
-    FromPrimitive,
-)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub enum PairType {
-    Permissionless,
-    Permission,
-    CustomizablePermissionless,
-}

+ 0 - 16
packages/renderers-rust/e2e/meteora/src/generated/types/protocol_fee.rs

@@ -1,16 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct ProtocolFee {
-    pub amount_x: u64,
-    pub amount_y: u64,
-}

+ 0 - 44
packages/renderers-rust/e2e/meteora/src/generated/types/reward_info.rs

@@ -1,44 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use solana_program::pubkey::Pubkey;
-
-/// Stores the state relevant for tracking liquidity mining rewards
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct RewardInfo {
-    /// Reward token mint.
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub mint: Pubkey,
-    /// Reward vault token account.
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub vault: Pubkey,
-    /// Authority account that allows to fund rewards
-    #[cfg_attr(
-        feature = "serde",
-        serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
-    )]
-    pub funder: Pubkey,
-    /// TODO check whether we need to store it in pool
-    pub reward_duration: u64,
-    /// TODO check whether we need to store it in pool
-    pub reward_duration_end: u64,
-    /// TODO check whether we need to store it in pool
-    pub reward_rate: u128,
-    /// The last time reward states were updated.
-    pub last_update_time: u64,
-    /// Accumulated seconds where when farm distribute rewards, but the bin is empty. The reward will be accumulated for next reward time window.
-    pub cumulative_seconds_with_empty_liquidity_reward: u64,
-}

+ 0 - 28
packages/renderers-rust/e2e/meteora/src/generated/types/rounding.rs

@@ -1,28 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use num_derive::FromPrimitive;
-
-#[derive(
-    BorshSerialize,
-    BorshDeserialize,
-    Clone,
-    Debug,
-    Eq,
-    PartialEq,
-    Copy,
-    PartialOrd,
-    Hash,
-    FromPrimitive,
-)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub enum Rounding {
-    Up,
-    Down,
-}

+ 0 - 35
packages/renderers-rust/e2e/meteora/src/generated/types/static_parameters.rs

@@ -1,35 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Parameter that set by the protocol
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct StaticParameters {
-    /// Used for base fee calculation. base_fee_rate = base_factor * bin_step
-    pub base_factor: u16,
-    /// Filter period determine high frequency trading time window.
-    pub filter_period: u16,
-    /// Decay period determine when the volatile fee start decay / decrease.
-    pub decay_period: u16,
-    /// Reduction factor controls the volatile fee rate decrement rate.
-    pub reduction_factor: u16,
-    /// Used to scale the variable fee component depending on the dynamic of the market
-    pub variable_fee_control: u32,
-    /// Maximum number of bin crossed can be accumulated. Used to cap volatile fee rate.
-    pub max_volatility_accumulator: u32,
-    /// Min bin id supported by the pool based on the configured bin step.
-    pub min_bin_id: i32,
-    /// Max bin id supported by the pool based on the configured bin step.
-    pub max_bin_id: i32,
-    /// Portion of swap fees retained by the protocol by controlling protocol_share parameter. protocol_swap_fee = protocol_share * total_swap_fee
-    pub protocol_share: u16,
-    /// Padding for bytemuck safe alignment
-    pub padding: [u8; 6],
-}

+ 0 - 24
packages/renderers-rust/e2e/meteora/src/generated/types/strategy_parameters.rs

@@ -1,24 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use crate::generated::types::StrategyType;
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct StrategyParameters {
-    /// min bin id
-    pub min_bin_id: i32,
-    /// max bin id
-    pub max_bin_id: i32,
-    /// strategy type
-    pub strategy_type: StrategyType,
-    /// parameters
-    #[cfg_attr(feature = "serde", serde(with = "serde_with::As::<serde_with::Bytes>"))]
-    pub parameteres: [u8; 64],
-}

+ 0 - 35
packages/renderers-rust/e2e/meteora/src/generated/types/strategy_type.rs

@@ -1,35 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-use num_derive::FromPrimitive;
-
-#[derive(
-    BorshSerialize,
-    BorshDeserialize,
-    Clone,
-    Debug,
-    Eq,
-    PartialEq,
-    Copy,
-    PartialOrd,
-    Hash,
-    FromPrimitive,
-)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub enum StrategyType {
-    SpotOneSide,
-    CurveOneSide,
-    BidAskOneSide,
-    SpotBalanced,
-    CurveBalanced,
-    BidAskBalanced,
-    SpotImBalanced,
-    CurveImBalanced,
-    BidAskImBalanced,
-}

+ 0 - 16
packages/renderers-rust/e2e/meteora/src/generated/types/user_reward_info.rs

@@ -1,16 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct UserRewardInfo {
-    pub reward_per_token_completes: [u128; 2],
-    pub reward_pendings: [u64; 2],
-}

+ 0 - 28
packages/renderers-rust/e2e/meteora/src/generated/types/variable_parameters.rs

@@ -1,28 +0,0 @@
-//! This code was AUTOGENERATED using the codama library.
-//! Please DO NOT EDIT THIS FILE, instead use visitors
-//! to add features, then rerun codama to update it.
-//!
-//! <https://github.com/codama-idl/codama>
-//!
-
-use borsh::BorshDeserialize;
-use borsh::BorshSerialize;
-
-/// Parameters that changes based on dynamic of the market
-#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
-#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
-pub struct VariableParameters {
-    /// Volatility accumulator measure the number of bin crossed since reference bin ID. Normally (without filter period taken into consideration), reference bin ID is the active bin of last swap.
-    /// It affects the variable fee rate
-    pub volatility_accumulator: u32,
-    /// Volatility reference is decayed volatility accumulator. It is always <= volatility_accumulator
-    pub volatility_reference: u32,
-    /// Active bin id of last swap.
-    pub index_reference: i32,
-    /// Padding for bytemuck safe alignment
-    pub padding: [u8; 4],
-    /// Last timestamp the variable parameters was updated
-    pub last_update_timestamp: i64,
-    /// Padding for bytemuck safe alignment
-    pub padding1: [u8; 8],
-}

+ 1 - 0
packages/renderers-rust/e2e/system/Cargo.lock

@@ -1009,6 +1009,7 @@ dependencies = [
  "serde-big-array",
  "serde_with 3.12.0",
  "solana-client",
+ "solana-instruction",
  "solana-program 2.2.1",
  "solana-pubkey",
  "solana-sdk 1.18.26",

+ 1 - 0
packages/renderers-rust/e2e/system/Cargo.toml

@@ -19,6 +19,7 @@ serde = { version = "^1.0", features = ["derive"], optional = true }
 serde_with = { version = "^3.0", optional = true }
 serde-big-array = { version = "^0.5", optional = true }
 solana-program = "2.2.1"
+solana-instruction = "2.2.1"
 solana-pubkey = { version = "2.2.1", features = ["curve25519"] }
 solana-client = { version = "~1.18", optional = true }
 solana-sdk = { version = "~1.18", optional = true }

+ 16 - 19
packages/renderers-rust/e2e/system/src/generated/instructions/advance_nonce_account.rs

@@ -19,32 +19,32 @@ pub struct AdvanceNonceAccount {
 }
 
 impl AdvanceNonceAccount {
-    pub fn instruction(&self) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(&[])
     }
     #[allow(clippy::arithmetic_side_effects)]
     #[allow(clippy::vec_init_then_push)]
     pub fn instruction_with_remaining_accounts(
         &self,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(3 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             self.nonce_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.recent_blockhashes_sysvar,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.nonce_authority,
             true,
         ));
         accounts.extend_from_slice(remaining_accounts);
         let data = borsh::to_vec(&AdvanceNonceAccountInstructionData::new()).unwrap();
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::SYSTEM_ID,
             accounts,
             data,
@@ -82,7 +82,7 @@ pub struct AdvanceNonceAccountBuilder {
     nonce_account: Option<solana_pubkey::Pubkey>,
     recent_blockhashes_sysvar: Option<solana_pubkey::Pubkey>,
     nonce_authority: Option<solana_pubkey::Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl AdvanceNonceAccountBuilder {
@@ -110,10 +110,7 @@ impl AdvanceNonceAccountBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -121,13 +118,13 @@ impl AdvanceNonceAccountBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = AdvanceNonceAccount {
             nonce_account: self.nonce_account.expect("nonce_account is not set"),
             recent_blockhashes_sysvar: self.recent_blockhashes_sysvar.unwrap_or(
@@ -208,20 +205,20 @@ impl<'a, 'b> AdvanceNonceAccountCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(3 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.nonce_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.recent_blockhashes_sysvar.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.nonce_authority.key,
             true,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -229,7 +226,7 @@ impl<'a, 'b> AdvanceNonceAccountCpi<'a, 'b> {
         });
         let data = borsh::to_vec(&AdvanceNonceAccountInstructionData::new()).unwrap();
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::SYSTEM_ID,
             accounts,
             data,

+ 12 - 21
packages/renderers-rust/e2e/system/src/generated/instructions/allocate.rs

@@ -15,10 +15,7 @@ pub struct Allocate {
 }
 
 impl Allocate {
-    pub fn instruction(
-        &self,
-        args: AllocateInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    pub fn instruction(&self, args: AllocateInstructionArgs) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -26,19 +23,16 @@ impl Allocate {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: AllocateInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
-            self.new_account,
-            true,
-        ));
+        accounts.push(solana_instruction::AccountMeta::new(self.new_account, true));
         accounts.extend_from_slice(remaining_accounts);
         let mut data = borsh::to_vec(&AllocateInstructionData::new()).unwrap();
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::SYSTEM_ID,
             accounts,
             data,
@@ -79,7 +73,7 @@ pub struct AllocateInstructionArgs {
 pub struct AllocateBuilder {
     new_account: Option<solana_pubkey::Pubkey>,
     space: Option<u64>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl AllocateBuilder {
@@ -98,10 +92,7 @@ impl AllocateBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -109,13 +100,13 @@ impl AllocateBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = Allocate {
             new_account: self.new_account.expect("new_account is not set"),
         };
@@ -189,12 +180,12 @@ impl<'a, 'b> AllocateCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(1 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.new_account.key,
             true,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -204,7 +195,7 @@ impl<'a, 'b> AllocateCpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::SYSTEM_ID,
             accounts,
             data,

+ 14 - 17
packages/renderers-rust/e2e/system/src/generated/instructions/allocate_with_seed.rs

@@ -21,7 +21,7 @@ impl AllocateWithSeed {
     pub fn instruction(
         &self,
         args: AllocateWithSeedInstructionArgs,
-    ) -> solana_program::instruction::Instruction {
+    ) -> solana_instruction::Instruction {
         self.instruction_with_remaining_accounts(args, &[])
     }
     #[allow(clippy::arithmetic_side_effects)]
@@ -29,14 +29,14 @@ impl AllocateWithSeed {
     pub fn instruction_with_remaining_accounts(
         &self,
         args: AllocateWithSeedInstructionArgs,
-        remaining_accounts: &[solana_program::instruction::AccountMeta],
-    ) -> solana_program::instruction::Instruction {
+        remaining_accounts: &[solana_instruction::AccountMeta],
+    ) -> solana_instruction::Instruction {
         let mut accounts = Vec::with_capacity(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             self.new_account,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             self.base_account,
             true,
         ));
@@ -45,7 +45,7 @@ impl AllocateWithSeed {
         let mut args = borsh::to_vec(&args).unwrap();
         data.append(&mut args);
 
-        solana_program::instruction::Instruction {
+        solana_instruction::Instruction {
             program_id: crate::SYSTEM_ID,
             accounts,
             data,
@@ -94,7 +94,7 @@ pub struct AllocateWithSeedBuilder {
     seed: Option<String>,
     space: Option<u64>,
     program_address: Option<Pubkey>,
-    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
+    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
 }
 
 impl AllocateWithSeedBuilder {
@@ -133,10 +133,7 @@ impl AllocateWithSeedBuilder {
     }
     /// Add an additional account to the instruction.
     #[inline(always)]
-    pub fn add_remaining_account(
-        &mut self,
-        account: solana_program::instruction::AccountMeta,
-    ) -> &mut Self {
+    pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
         self.__remaining_accounts.push(account);
         self
     }
@@ -144,13 +141,13 @@ impl AllocateWithSeedBuilder {
     #[inline(always)]
     pub fn add_remaining_accounts(
         &mut self,
-        accounts: &[solana_program::instruction::AccountMeta],
+        accounts: &[solana_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 {
+    pub fn instruction(&self) -> solana_instruction::Instruction {
         let accounts = AllocateWithSeed {
             new_account: self.new_account.expect("new_account is not set"),
             base_account: self.base_account.expect("base_account is not set"),
@@ -236,16 +233,16 @@ impl<'a, 'b> AllocateWithSeedCpi<'a, 'b> {
         )],
     ) -> solana_program::entrypoint::ProgramResult {
         let mut accounts = Vec::with_capacity(2 + remaining_accounts.len());
-        accounts.push(solana_program::instruction::AccountMeta::new(
+        accounts.push(solana_instruction::AccountMeta::new(
             *self.new_account.key,
             false,
         ));
-        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
+        accounts.push(solana_instruction::AccountMeta::new_readonly(
             *self.base_account.key,
             true,
         ));
         remaining_accounts.iter().for_each(|remaining_account| {
-            accounts.push(solana_program::instruction::AccountMeta {
+            accounts.push(solana_instruction::AccountMeta {
                 pubkey: *remaining_account.0.key,
                 is_signer: remaining_account.1,
                 is_writable: remaining_account.2,
@@ -255,7 +252,7 @@ impl<'a, 'b> AllocateWithSeedCpi<'a, 'b> {
         let mut args = borsh::to_vec(&self.__args).unwrap();
         data.append(&mut args);
 
-        let instruction = solana_program::instruction::Instruction {
+        let instruction = solana_instruction::Instruction {
             program_id: crate::SYSTEM_ID,
             accounts,
             data,

Some files were not shown because too many files changed in this diff