defituna_client/generated/instructions/
collect_reward_orca.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use borsh::BorshSerialize;
9use borsh::BorshDeserialize;
10
11/// Accounts.
12#[derive(Debug)]
13pub struct CollectRewardOrca {
14            /// 
15/// TUNA accounts
16/// 
17
18    
19              
20          pub authority: solana_program::pubkey::Pubkey,
21          
22              
23          pub tuna_config: solana_program::pubkey::Pubkey,
24          
25              
26          pub reward_mint: solana_program::pubkey::Pubkey,
27          
28              
29          pub reward_token_program: solana_program::pubkey::Pubkey,
30          
31              
32          pub tuna_position: solana_program::pubkey::Pubkey,
33          
34              
35          pub tuna_position_ata: solana_program::pubkey::Pubkey,
36          
37              
38          pub tuna_position_owner_reward_ata: solana_program::pubkey::Pubkey,
39                /// 
40/// ORCA accounts
41/// 
42
43    
44              
45          pub whirlpool_program: solana_program::pubkey::Pubkey,
46          
47              
48          pub whirlpool: solana_program::pubkey::Pubkey,
49          
50              
51          pub orca_position: solana_program::pubkey::Pubkey,
52          
53              
54          pub reward_vault: solana_program::pubkey::Pubkey,
55          
56              
57          pub tick_array_lower: solana_program::pubkey::Pubkey,
58          
59              
60          pub tick_array_upper: solana_program::pubkey::Pubkey,
61          
62              
63          pub memo_program: solana_program::pubkey::Pubkey,
64      }
65
66impl CollectRewardOrca {
67  pub fn instruction(&self, args: CollectRewardOrcaInstructionArgs) -> solana_program::instruction::Instruction {
68    self.instruction_with_remaining_accounts(args, &[])
69  }
70  #[allow(clippy::arithmetic_side_effects)]
71  #[allow(clippy::vec_init_then_push)]
72  pub fn instruction_with_remaining_accounts(&self, args: CollectRewardOrcaInstructionArgs, remaining_accounts: &[solana_program::instruction::AccountMeta]) -> solana_program::instruction::Instruction {
73    let mut accounts = Vec::with_capacity(14+ remaining_accounts.len());
74                            accounts.push(solana_program::instruction::AccountMeta::new(
75            self.authority,
76            true
77          ));
78                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
79            self.tuna_config,
80            false
81          ));
82                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
83            self.reward_mint,
84            false
85          ));
86                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
87            self.reward_token_program,
88            false
89          ));
90                                          accounts.push(solana_program::instruction::AccountMeta::new(
91            self.tuna_position,
92            false
93          ));
94                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
95            self.tuna_position_ata,
96            false
97          ));
98                                          accounts.push(solana_program::instruction::AccountMeta::new(
99            self.tuna_position_owner_reward_ata,
100            false
101          ));
102                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
103            self.whirlpool_program,
104            false
105          ));
106                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
107            self.whirlpool,
108            false
109          ));
110                                          accounts.push(solana_program::instruction::AccountMeta::new(
111            self.orca_position,
112            false
113          ));
114                                          accounts.push(solana_program::instruction::AccountMeta::new(
115            self.reward_vault,
116            false
117          ));
118                                          accounts.push(solana_program::instruction::AccountMeta::new(
119            self.tick_array_lower,
120            false
121          ));
122                                          accounts.push(solana_program::instruction::AccountMeta::new(
123            self.tick_array_upper,
124            false
125          ));
126                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
127            self.memo_program,
128            false
129          ));
130                      accounts.extend_from_slice(remaining_accounts);
131    let mut data = borsh::to_vec(&CollectRewardOrcaInstructionData::new()).unwrap();
132          let mut args = borsh::to_vec(&args).unwrap();
133      data.append(&mut args);
134    
135    solana_program::instruction::Instruction {
136      program_id: crate::TUNA_ID,
137      accounts,
138      data,
139    }
140  }
141}
142
143#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
144#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
145 pub struct CollectRewardOrcaInstructionData {
146            discriminator: [u8; 8],
147            }
148
149impl CollectRewardOrcaInstructionData {
150  pub fn new() -> Self {
151    Self {
152                        discriminator: [99, 253, 84, 63, 250, 243, 165, 191],
153                                }
154  }
155}
156
157impl Default for CollectRewardOrcaInstructionData {
158  fn default() -> Self {
159    Self::new()
160  }
161}
162
163#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
164#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
165 pub struct CollectRewardOrcaInstructionArgs {
166                  pub reward_index: u8,
167      }
168
169
170/// Instruction builder for `CollectRewardOrca`.
171///
172/// ### Accounts:
173///
174                      ///   0. `[writable, signer]` authority
175          ///   1. `[]` tuna_config
176          ///   2. `[]` reward_mint
177          ///   3. `[]` reward_token_program
178                ///   4. `[writable]` tuna_position
179          ///   5. `[]` tuna_position_ata
180                ///   6. `[writable]` tuna_position_owner_reward_ata
181          ///   7. `[]` whirlpool_program
182          ///   8. `[]` whirlpool
183                ///   9. `[writable]` orca_position
184                ///   10. `[writable]` reward_vault
185                ///   11. `[writable]` tick_array_lower
186                ///   12. `[writable]` tick_array_upper
187          ///   13. `[]` memo_program
188#[derive(Clone, Debug, Default)]
189pub struct CollectRewardOrcaBuilder {
190            authority: Option<solana_program::pubkey::Pubkey>,
191                tuna_config: Option<solana_program::pubkey::Pubkey>,
192                reward_mint: Option<solana_program::pubkey::Pubkey>,
193                reward_token_program: Option<solana_program::pubkey::Pubkey>,
194                tuna_position: Option<solana_program::pubkey::Pubkey>,
195                tuna_position_ata: Option<solana_program::pubkey::Pubkey>,
196                tuna_position_owner_reward_ata: Option<solana_program::pubkey::Pubkey>,
197                whirlpool_program: Option<solana_program::pubkey::Pubkey>,
198                whirlpool: Option<solana_program::pubkey::Pubkey>,
199                orca_position: Option<solana_program::pubkey::Pubkey>,
200                reward_vault: Option<solana_program::pubkey::Pubkey>,
201                tick_array_lower: Option<solana_program::pubkey::Pubkey>,
202                tick_array_upper: Option<solana_program::pubkey::Pubkey>,
203                memo_program: Option<solana_program::pubkey::Pubkey>,
204                        reward_index: Option<u8>,
205        __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
206}
207
208impl CollectRewardOrcaBuilder {
209  pub fn new() -> Self {
210    Self::default()
211  }
212            /// 
213/// TUNA accounts
214/// 
215#[inline(always)]
216    pub fn authority(&mut self, authority: solana_program::pubkey::Pubkey) -> &mut Self {
217                        self.authority = Some(authority);
218                    self
219    }
220            #[inline(always)]
221    pub fn tuna_config(&mut self, tuna_config: solana_program::pubkey::Pubkey) -> &mut Self {
222                        self.tuna_config = Some(tuna_config);
223                    self
224    }
225            #[inline(always)]
226    pub fn reward_mint(&mut self, reward_mint: solana_program::pubkey::Pubkey) -> &mut Self {
227                        self.reward_mint = Some(reward_mint);
228                    self
229    }
230            #[inline(always)]
231    pub fn reward_token_program(&mut self, reward_token_program: solana_program::pubkey::Pubkey) -> &mut Self {
232                        self.reward_token_program = Some(reward_token_program);
233                    self
234    }
235            #[inline(always)]
236    pub fn tuna_position(&mut self, tuna_position: solana_program::pubkey::Pubkey) -> &mut Self {
237                        self.tuna_position = Some(tuna_position);
238                    self
239    }
240            #[inline(always)]
241    pub fn tuna_position_ata(&mut self, tuna_position_ata: solana_program::pubkey::Pubkey) -> &mut Self {
242                        self.tuna_position_ata = Some(tuna_position_ata);
243                    self
244    }
245            #[inline(always)]
246    pub fn tuna_position_owner_reward_ata(&mut self, tuna_position_owner_reward_ata: solana_program::pubkey::Pubkey) -> &mut Self {
247                        self.tuna_position_owner_reward_ata = Some(tuna_position_owner_reward_ata);
248                    self
249    }
250            /// 
251/// ORCA accounts
252/// 
253#[inline(always)]
254    pub fn whirlpool_program(&mut self, whirlpool_program: solana_program::pubkey::Pubkey) -> &mut Self {
255                        self.whirlpool_program = Some(whirlpool_program);
256                    self
257    }
258            #[inline(always)]
259    pub fn whirlpool(&mut self, whirlpool: solana_program::pubkey::Pubkey) -> &mut Self {
260                        self.whirlpool = Some(whirlpool);
261                    self
262    }
263            #[inline(always)]
264    pub fn orca_position(&mut self, orca_position: solana_program::pubkey::Pubkey) -> &mut Self {
265                        self.orca_position = Some(orca_position);
266                    self
267    }
268            #[inline(always)]
269    pub fn reward_vault(&mut self, reward_vault: solana_program::pubkey::Pubkey) -> &mut Self {
270                        self.reward_vault = Some(reward_vault);
271                    self
272    }
273            #[inline(always)]
274    pub fn tick_array_lower(&mut self, tick_array_lower: solana_program::pubkey::Pubkey) -> &mut Self {
275                        self.tick_array_lower = Some(tick_array_lower);
276                    self
277    }
278            #[inline(always)]
279    pub fn tick_array_upper(&mut self, tick_array_upper: solana_program::pubkey::Pubkey) -> &mut Self {
280                        self.tick_array_upper = Some(tick_array_upper);
281                    self
282    }
283            #[inline(always)]
284    pub fn memo_program(&mut self, memo_program: solana_program::pubkey::Pubkey) -> &mut Self {
285                        self.memo_program = Some(memo_program);
286                    self
287    }
288                    #[inline(always)]
289      pub fn reward_index(&mut self, reward_index: u8) -> &mut Self {
290        self.reward_index = Some(reward_index);
291        self
292      }
293        /// Add an additional account to the instruction.
294  #[inline(always)]
295  pub fn add_remaining_account(&mut self, account: solana_program::instruction::AccountMeta) -> &mut Self {
296    self.__remaining_accounts.push(account);
297    self
298  }
299  /// Add additional accounts to the instruction.
300  #[inline(always)]
301  pub fn add_remaining_accounts(&mut self, accounts: &[solana_program::instruction::AccountMeta]) -> &mut Self {
302    self.__remaining_accounts.extend_from_slice(accounts);
303    self
304  }
305  #[allow(clippy::clone_on_copy)]
306  pub fn instruction(&self) -> solana_program::instruction::Instruction {
307    let accounts = CollectRewardOrca {
308                              authority: self.authority.expect("authority is not set"),
309                                        tuna_config: self.tuna_config.expect("tuna_config is not set"),
310                                        reward_mint: self.reward_mint.expect("reward_mint is not set"),
311                                        reward_token_program: self.reward_token_program.expect("reward_token_program is not set"),
312                                        tuna_position: self.tuna_position.expect("tuna_position is not set"),
313                                        tuna_position_ata: self.tuna_position_ata.expect("tuna_position_ata is not set"),
314                                        tuna_position_owner_reward_ata: self.tuna_position_owner_reward_ata.expect("tuna_position_owner_reward_ata is not set"),
315                                        whirlpool_program: self.whirlpool_program.expect("whirlpool_program is not set"),
316                                        whirlpool: self.whirlpool.expect("whirlpool is not set"),
317                                        orca_position: self.orca_position.expect("orca_position is not set"),
318                                        reward_vault: self.reward_vault.expect("reward_vault is not set"),
319                                        tick_array_lower: self.tick_array_lower.expect("tick_array_lower is not set"),
320                                        tick_array_upper: self.tick_array_upper.expect("tick_array_upper is not set"),
321                                        memo_program: self.memo_program.expect("memo_program is not set"),
322                      };
323          let args = CollectRewardOrcaInstructionArgs {
324                                                              reward_index: self.reward_index.clone().expect("reward_index is not set"),
325                                    };
326    
327    accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
328  }
329}
330
331  /// `collect_reward_orca` CPI accounts.
332  pub struct CollectRewardOrcaCpiAccounts<'a, 'b> {
333                  /// 
334/// TUNA accounts
335/// 
336
337      
338                    
339              pub authority: &'b solana_program::account_info::AccountInfo<'a>,
340                
341                    
342              pub tuna_config: &'b solana_program::account_info::AccountInfo<'a>,
343                
344                    
345              pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
346                
347                    
348              pub reward_token_program: &'b solana_program::account_info::AccountInfo<'a>,
349                
350                    
351              pub tuna_position: &'b solana_program::account_info::AccountInfo<'a>,
352                
353                    
354              pub tuna_position_ata: &'b solana_program::account_info::AccountInfo<'a>,
355                
356                    
357              pub tuna_position_owner_reward_ata: &'b solana_program::account_info::AccountInfo<'a>,
358                        /// 
359/// ORCA accounts
360/// 
361
362      
363                    
364              pub whirlpool_program: &'b solana_program::account_info::AccountInfo<'a>,
365                
366                    
367              pub whirlpool: &'b solana_program::account_info::AccountInfo<'a>,
368                
369                    
370              pub orca_position: &'b solana_program::account_info::AccountInfo<'a>,
371                
372                    
373              pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
374                
375                    
376              pub tick_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
377                
378                    
379              pub tick_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
380                
381                    
382              pub memo_program: &'b solana_program::account_info::AccountInfo<'a>,
383            }
384
385/// `collect_reward_orca` CPI instruction.
386pub struct CollectRewardOrcaCpi<'a, 'b> {
387  /// The program to invoke.
388  pub __program: &'b solana_program::account_info::AccountInfo<'a>,
389            /// 
390/// TUNA accounts
391/// 
392
393    
394              
395          pub authority: &'b solana_program::account_info::AccountInfo<'a>,
396          
397              
398          pub tuna_config: &'b solana_program::account_info::AccountInfo<'a>,
399          
400              
401          pub reward_mint: &'b solana_program::account_info::AccountInfo<'a>,
402          
403              
404          pub reward_token_program: &'b solana_program::account_info::AccountInfo<'a>,
405          
406              
407          pub tuna_position: &'b solana_program::account_info::AccountInfo<'a>,
408          
409              
410          pub tuna_position_ata: &'b solana_program::account_info::AccountInfo<'a>,
411          
412              
413          pub tuna_position_owner_reward_ata: &'b solana_program::account_info::AccountInfo<'a>,
414                /// 
415/// ORCA accounts
416/// 
417
418    
419              
420          pub whirlpool_program: &'b solana_program::account_info::AccountInfo<'a>,
421          
422              
423          pub whirlpool: &'b solana_program::account_info::AccountInfo<'a>,
424          
425              
426          pub orca_position: &'b solana_program::account_info::AccountInfo<'a>,
427          
428              
429          pub reward_vault: &'b solana_program::account_info::AccountInfo<'a>,
430          
431              
432          pub tick_array_lower: &'b solana_program::account_info::AccountInfo<'a>,
433          
434              
435          pub tick_array_upper: &'b solana_program::account_info::AccountInfo<'a>,
436          
437              
438          pub memo_program: &'b solana_program::account_info::AccountInfo<'a>,
439            /// The arguments for the instruction.
440    pub __args: CollectRewardOrcaInstructionArgs,
441  }
442
443impl<'a, 'b> CollectRewardOrcaCpi<'a, 'b> {
444  pub fn new(
445    program: &'b solana_program::account_info::AccountInfo<'a>,
446          accounts: CollectRewardOrcaCpiAccounts<'a, 'b>,
447              args: CollectRewardOrcaInstructionArgs,
448      ) -> Self {
449    Self {
450      __program: program,
451              authority: accounts.authority,
452              tuna_config: accounts.tuna_config,
453              reward_mint: accounts.reward_mint,
454              reward_token_program: accounts.reward_token_program,
455              tuna_position: accounts.tuna_position,
456              tuna_position_ata: accounts.tuna_position_ata,
457              tuna_position_owner_reward_ata: accounts.tuna_position_owner_reward_ata,
458              whirlpool_program: accounts.whirlpool_program,
459              whirlpool: accounts.whirlpool,
460              orca_position: accounts.orca_position,
461              reward_vault: accounts.reward_vault,
462              tick_array_lower: accounts.tick_array_lower,
463              tick_array_upper: accounts.tick_array_upper,
464              memo_program: accounts.memo_program,
465                    __args: args,
466          }
467  }
468  #[inline(always)]
469  pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
470    self.invoke_signed_with_remaining_accounts(&[], &[])
471  }
472  #[inline(always)]
473  pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)]) -> solana_program::entrypoint::ProgramResult {
474    self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
475  }
476  #[inline(always)]
477  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program::entrypoint::ProgramResult {
478    self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
479  }
480  #[allow(clippy::arithmetic_side_effects)]
481  #[allow(clippy::clone_on_copy)]
482  #[allow(clippy::vec_init_then_push)]
483  pub fn invoke_signed_with_remaining_accounts(
484    &self,
485    signers_seeds: &[&[&[u8]]],
486    remaining_accounts: &[(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)]
487  ) -> solana_program::entrypoint::ProgramResult {
488    let mut accounts = Vec::with_capacity(14+ remaining_accounts.len());
489                            accounts.push(solana_program::instruction::AccountMeta::new(
490            *self.authority.key,
491            true
492          ));
493                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
494            *self.tuna_config.key,
495            false
496          ));
497                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
498            *self.reward_mint.key,
499            false
500          ));
501                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
502            *self.reward_token_program.key,
503            false
504          ));
505                                          accounts.push(solana_program::instruction::AccountMeta::new(
506            *self.tuna_position.key,
507            false
508          ));
509                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
510            *self.tuna_position_ata.key,
511            false
512          ));
513                                          accounts.push(solana_program::instruction::AccountMeta::new(
514            *self.tuna_position_owner_reward_ata.key,
515            false
516          ));
517                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
518            *self.whirlpool_program.key,
519            false
520          ));
521                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
522            *self.whirlpool.key,
523            false
524          ));
525                                          accounts.push(solana_program::instruction::AccountMeta::new(
526            *self.orca_position.key,
527            false
528          ));
529                                          accounts.push(solana_program::instruction::AccountMeta::new(
530            *self.reward_vault.key,
531            false
532          ));
533                                          accounts.push(solana_program::instruction::AccountMeta::new(
534            *self.tick_array_lower.key,
535            false
536          ));
537                                          accounts.push(solana_program::instruction::AccountMeta::new(
538            *self.tick_array_upper.key,
539            false
540          ));
541                                          accounts.push(solana_program::instruction::AccountMeta::new_readonly(
542            *self.memo_program.key,
543            false
544          ));
545                      remaining_accounts.iter().for_each(|remaining_account| {
546      accounts.push(solana_program::instruction::AccountMeta {
547          pubkey: *remaining_account.0.key,
548          is_signer: remaining_account.1,
549          is_writable: remaining_account.2,
550      })
551    });
552    let mut data = borsh::to_vec(&CollectRewardOrcaInstructionData::new()).unwrap();
553          let mut args = borsh::to_vec(&self.__args).unwrap();
554      data.append(&mut args);
555    
556    let instruction = solana_program::instruction::Instruction {
557      program_id: crate::TUNA_ID,
558      accounts,
559      data,
560    };
561    let mut account_infos = Vec::with_capacity(15 + remaining_accounts.len());
562    account_infos.push(self.__program.clone());
563                  account_infos.push(self.authority.clone());
564                        account_infos.push(self.tuna_config.clone());
565                        account_infos.push(self.reward_mint.clone());
566                        account_infos.push(self.reward_token_program.clone());
567                        account_infos.push(self.tuna_position.clone());
568                        account_infos.push(self.tuna_position_ata.clone());
569                        account_infos.push(self.tuna_position_owner_reward_ata.clone());
570                        account_infos.push(self.whirlpool_program.clone());
571                        account_infos.push(self.whirlpool.clone());
572                        account_infos.push(self.orca_position.clone());
573                        account_infos.push(self.reward_vault.clone());
574                        account_infos.push(self.tick_array_lower.clone());
575                        account_infos.push(self.tick_array_upper.clone());
576                        account_infos.push(self.memo_program.clone());
577              remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
578
579    if signers_seeds.is_empty() {
580      solana_program::program::invoke(&instruction, &account_infos)
581    } else {
582      solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds)
583    }
584  }
585}
586
587/// Instruction builder for `CollectRewardOrca` via CPI.
588///
589/// ### Accounts:
590///
591                      ///   0. `[writable, signer]` authority
592          ///   1. `[]` tuna_config
593          ///   2. `[]` reward_mint
594          ///   3. `[]` reward_token_program
595                ///   4. `[writable]` tuna_position
596          ///   5. `[]` tuna_position_ata
597                ///   6. `[writable]` tuna_position_owner_reward_ata
598          ///   7. `[]` whirlpool_program
599          ///   8. `[]` whirlpool
600                ///   9. `[writable]` orca_position
601                ///   10. `[writable]` reward_vault
602                ///   11. `[writable]` tick_array_lower
603                ///   12. `[writable]` tick_array_upper
604          ///   13. `[]` memo_program
605#[derive(Clone, Debug)]
606pub struct CollectRewardOrcaCpiBuilder<'a, 'b> {
607  instruction: Box<CollectRewardOrcaCpiBuilderInstruction<'a, 'b>>,
608}
609
610impl<'a, 'b> CollectRewardOrcaCpiBuilder<'a, 'b> {
611  pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
612    let instruction = Box::new(CollectRewardOrcaCpiBuilderInstruction {
613      __program: program,
614              authority: None,
615              tuna_config: None,
616              reward_mint: None,
617              reward_token_program: None,
618              tuna_position: None,
619              tuna_position_ata: None,
620              tuna_position_owner_reward_ata: None,
621              whirlpool_program: None,
622              whirlpool: None,
623              orca_position: None,
624              reward_vault: None,
625              tick_array_lower: None,
626              tick_array_upper: None,
627              memo_program: None,
628                                            reward_index: None,
629                    __remaining_accounts: Vec::new(),
630    });
631    Self { instruction }
632  }
633      /// 
634/// TUNA accounts
635/// 
636#[inline(always)]
637    pub fn authority(&mut self, authority: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
638                        self.instruction.authority = Some(authority);
639                    self
640    }
641      #[inline(always)]
642    pub fn tuna_config(&mut self, tuna_config: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
643                        self.instruction.tuna_config = Some(tuna_config);
644                    self
645    }
646      #[inline(always)]
647    pub fn reward_mint(&mut self, reward_mint: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
648                        self.instruction.reward_mint = Some(reward_mint);
649                    self
650    }
651      #[inline(always)]
652    pub fn reward_token_program(&mut self, reward_token_program: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
653                        self.instruction.reward_token_program = Some(reward_token_program);
654                    self
655    }
656      #[inline(always)]
657    pub fn tuna_position(&mut self, tuna_position: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
658                        self.instruction.tuna_position = Some(tuna_position);
659                    self
660    }
661      #[inline(always)]
662    pub fn tuna_position_ata(&mut self, tuna_position_ata: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
663                        self.instruction.tuna_position_ata = Some(tuna_position_ata);
664                    self
665    }
666      #[inline(always)]
667    pub fn tuna_position_owner_reward_ata(&mut self, tuna_position_owner_reward_ata: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
668                        self.instruction.tuna_position_owner_reward_ata = Some(tuna_position_owner_reward_ata);
669                    self
670    }
671      /// 
672/// ORCA accounts
673/// 
674#[inline(always)]
675    pub fn whirlpool_program(&mut self, whirlpool_program: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
676                        self.instruction.whirlpool_program = Some(whirlpool_program);
677                    self
678    }
679      #[inline(always)]
680    pub fn whirlpool(&mut self, whirlpool: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
681                        self.instruction.whirlpool = Some(whirlpool);
682                    self
683    }
684      #[inline(always)]
685    pub fn orca_position(&mut self, orca_position: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
686                        self.instruction.orca_position = Some(orca_position);
687                    self
688    }
689      #[inline(always)]
690    pub fn reward_vault(&mut self, reward_vault: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
691                        self.instruction.reward_vault = Some(reward_vault);
692                    self
693    }
694      #[inline(always)]
695    pub fn tick_array_lower(&mut self, tick_array_lower: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
696                        self.instruction.tick_array_lower = Some(tick_array_lower);
697                    self
698    }
699      #[inline(always)]
700    pub fn tick_array_upper(&mut self, tick_array_upper: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
701                        self.instruction.tick_array_upper = Some(tick_array_upper);
702                    self
703    }
704      #[inline(always)]
705    pub fn memo_program(&mut self, memo_program: &'b solana_program::account_info::AccountInfo<'a>) -> &mut Self {
706                        self.instruction.memo_program = Some(memo_program);
707                    self
708    }
709                    #[inline(always)]
710      pub fn reward_index(&mut self, reward_index: u8) -> &mut Self {
711        self.instruction.reward_index = Some(reward_index);
712        self
713      }
714        /// Add an additional account to the instruction.
715  #[inline(always)]
716  pub fn add_remaining_account(&mut self, account: &'b solana_program::account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
717    self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
718    self
719  }
720  /// Add additional accounts to the instruction.
721  ///
722  /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
723  /// and a `bool` indicating whether the account is a signer or not.
724  #[inline(always)]
725  pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
726    self.instruction.__remaining_accounts.extend_from_slice(accounts);
727    self
728  }
729  #[inline(always)]
730  pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
731    self.invoke_signed(&[])
732  }
733  #[allow(clippy::clone_on_copy)]
734  #[allow(clippy::vec_init_then_push)]
735  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program::entrypoint::ProgramResult {
736          let args = CollectRewardOrcaInstructionArgs {
737                                                              reward_index: self.instruction.reward_index.clone().expect("reward_index is not set"),
738                                    };
739        let instruction = CollectRewardOrcaCpi {
740        __program: self.instruction.__program,
741                  
742          authority: self.instruction.authority.expect("authority is not set"),
743                  
744          tuna_config: self.instruction.tuna_config.expect("tuna_config is not set"),
745                  
746          reward_mint: self.instruction.reward_mint.expect("reward_mint is not set"),
747                  
748          reward_token_program: self.instruction.reward_token_program.expect("reward_token_program is not set"),
749                  
750          tuna_position: self.instruction.tuna_position.expect("tuna_position is not set"),
751                  
752          tuna_position_ata: self.instruction.tuna_position_ata.expect("tuna_position_ata is not set"),
753                  
754          tuna_position_owner_reward_ata: self.instruction.tuna_position_owner_reward_ata.expect("tuna_position_owner_reward_ata is not set"),
755                  
756          whirlpool_program: self.instruction.whirlpool_program.expect("whirlpool_program is not set"),
757                  
758          whirlpool: self.instruction.whirlpool.expect("whirlpool is not set"),
759                  
760          orca_position: self.instruction.orca_position.expect("orca_position is not set"),
761                  
762          reward_vault: self.instruction.reward_vault.expect("reward_vault is not set"),
763                  
764          tick_array_lower: self.instruction.tick_array_lower.expect("tick_array_lower is not set"),
765                  
766          tick_array_upper: self.instruction.tick_array_upper.expect("tick_array_upper is not set"),
767                  
768          memo_program: self.instruction.memo_program.expect("memo_program is not set"),
769                          __args: args,
770            };
771    instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
772  }
773}
774
775#[derive(Clone, Debug)]
776struct CollectRewardOrcaCpiBuilderInstruction<'a, 'b> {
777  __program: &'b solana_program::account_info::AccountInfo<'a>,
778            authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
779                tuna_config: Option<&'b solana_program::account_info::AccountInfo<'a>>,
780                reward_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
781                reward_token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
782                tuna_position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
783                tuna_position_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
784                tuna_position_owner_reward_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
785                whirlpool_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
786                whirlpool: Option<&'b solana_program::account_info::AccountInfo<'a>>,
787                orca_position: Option<&'b solana_program::account_info::AccountInfo<'a>>,
788                reward_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
789                tick_array_lower: Option<&'b solana_program::account_info::AccountInfo<'a>>,
790                tick_array_upper: Option<&'b solana_program::account_info::AccountInfo<'a>>,
791                memo_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
792                        reward_index: Option<u8>,
793        /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
794  __remaining_accounts: Vec<(&'b solana_program::account_info::AccountInfo<'a>, bool, bool)>,
795}
796