Skip to main content

satrush_client/generated/instructions/
create_token_vault.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
11pub const CREATE_TOKEN_VAULT_DISCRIMINATOR: [u8; 8] = [161, 29, 12, 45, 127, 88, 61, 49];
12
13/// Accounts.
14#[derive(Debug)]
15pub struct CreateTokenVault {
16      
17              
18          pub authority: solana_address::Address,
19          
20              
21          pub satrush_config: solana_address::Address,
22          
23              
24          pub token_vault: solana_address::Address,
25          
26              
27          pub board: solana_address::Address,
28          
29              
30          pub epoch_vault: solana_address::Address,
31          
32              
33          pub token_mint: solana_address::Address,
34                /// The vault's reserves — holds exactly `token_amount + leftovers`.
35
36    
37              
38          pub token_vault_token_ata: solana_address::Address,
39                /// The mint program's destination: every round's tokens land here.
40
41    
42              
43          pub board_token_ata: solana_address::Address,
44                /// Receives the epoch leg at every rotation.
45
46    
47              
48          pub epoch_vault_token_ata: solana_address::Address,
49          
50              
51          pub token_program: solana_address::Address,
52          
53              
54          pub associated_token_program: solana_address::Address,
55          
56              
57          pub system_program: solana_address::Address,
58      }
59
60impl CreateTokenVault {
61  pub fn instruction(&self) -> solana_instruction::Instruction {
62    self.instruction_with_remaining_accounts(&[])
63  }
64  #[allow(clippy::arithmetic_side_effects)]
65  #[allow(clippy::vec_init_then_push)]
66  pub fn instruction_with_remaining_accounts(&self, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
67    let mut accounts = Vec::with_capacity(12+ remaining_accounts.len());
68                            accounts.push(solana_instruction::AccountMeta::new(
69            self.authority,
70            true
71          ));
72                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
73            self.satrush_config,
74            false
75          ));
76                                          accounts.push(solana_instruction::AccountMeta::new(
77            self.token_vault,
78            false
79          ));
80                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
81            self.board,
82            false
83          ));
84                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
85            self.epoch_vault,
86            false
87          ));
88                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
89            self.token_mint,
90            false
91          ));
92                                          accounts.push(solana_instruction::AccountMeta::new(
93            self.token_vault_token_ata,
94            false
95          ));
96                                          accounts.push(solana_instruction::AccountMeta::new(
97            self.board_token_ata,
98            false
99          ));
100                                          accounts.push(solana_instruction::AccountMeta::new(
101            self.epoch_vault_token_ata,
102            false
103          ));
104                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
105            self.token_program,
106            false
107          ));
108                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
109            self.associated_token_program,
110            false
111          ));
112                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
113            self.system_program,
114            false
115          ));
116                      accounts.extend_from_slice(remaining_accounts);
117    let data = CreateTokenVaultInstructionData::new().try_to_vec().unwrap();
118    
119    solana_instruction::Instruction {
120      program_id: crate::SATRUSH_ID,
121      accounts,
122      data,
123    }
124  }
125}
126
127#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
128 pub struct CreateTokenVaultInstructionData {
129            discriminator: [u8; 8],
130      }
131
132impl CreateTokenVaultInstructionData {
133  pub fn new() -> Self {
134    Self {
135                        discriminator: [161, 29, 12, 45, 127, 88, 61, 49],
136                  }
137  }
138
139    pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
140    borsh::to_vec(self)
141  }
142  }
143
144impl Default for CreateTokenVaultInstructionData {
145  fn default() -> Self {
146    Self::new()
147  }
148}
149
150
151
152/// Instruction builder for `CreateTokenVault`.
153///
154/// ### Accounts:
155///
156                      ///   0. `[writable, signer]` authority
157          ///   1. `[]` satrush_config
158                ///   2. `[writable]` token_vault
159          ///   3. `[]` board
160          ///   4. `[]` epoch_vault
161          ///   5. `[]` token_mint
162                ///   6. `[writable]` token_vault_token_ata
163                ///   7. `[writable]` board_token_ata
164                ///   8. `[writable]` epoch_vault_token_ata
165                ///   9. `[optional]` token_program (default to `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`)
166                ///   10. `[optional]` associated_token_program (default to `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`)
167                ///   11. `[optional]` system_program (default to `11111111111111111111111111111111`)
168#[derive(Clone, Debug, Default)]
169pub struct CreateTokenVaultBuilder {
170            authority: Option<solana_address::Address>,
171                satrush_config: Option<solana_address::Address>,
172                token_vault: Option<solana_address::Address>,
173                board: Option<solana_address::Address>,
174                epoch_vault: Option<solana_address::Address>,
175                token_mint: Option<solana_address::Address>,
176                token_vault_token_ata: Option<solana_address::Address>,
177                board_token_ata: Option<solana_address::Address>,
178                epoch_vault_token_ata: Option<solana_address::Address>,
179                token_program: Option<solana_address::Address>,
180                associated_token_program: Option<solana_address::Address>,
181                system_program: Option<solana_address::Address>,
182                __remaining_accounts: Vec<solana_instruction::AccountMeta>,
183}
184
185impl CreateTokenVaultBuilder {
186  pub fn new() -> Self {
187    Self::default()
188  }
189            #[inline(always)]
190    pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
191                        self.authority = Some(authority);
192                    self
193    }
194            #[inline(always)]
195    pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
196                        self.satrush_config = Some(satrush_config);
197                    self
198    }
199            #[inline(always)]
200    pub fn token_vault(&mut self, token_vault: solana_address::Address) -> &mut Self {
201                        self.token_vault = Some(token_vault);
202                    self
203    }
204            #[inline(always)]
205    pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
206                        self.board = Some(board);
207                    self
208    }
209            #[inline(always)]
210    pub fn epoch_vault(&mut self, epoch_vault: solana_address::Address) -> &mut Self {
211                        self.epoch_vault = Some(epoch_vault);
212                    self
213    }
214            #[inline(always)]
215    pub fn token_mint(&mut self, token_mint: solana_address::Address) -> &mut Self {
216                        self.token_mint = Some(token_mint);
217                    self
218    }
219            /// The vault's reserves — holds exactly `token_amount + leftovers`.
220#[inline(always)]
221    pub fn token_vault_token_ata(&mut self, token_vault_token_ata: solana_address::Address) -> &mut Self {
222                        self.token_vault_token_ata = Some(token_vault_token_ata);
223                    self
224    }
225            /// The mint program's destination: every round's tokens land here.
226#[inline(always)]
227    pub fn board_token_ata(&mut self, board_token_ata: solana_address::Address) -> &mut Self {
228                        self.board_token_ata = Some(board_token_ata);
229                    self
230    }
231            /// Receives the epoch leg at every rotation.
232#[inline(always)]
233    pub fn epoch_vault_token_ata(&mut self, epoch_vault_token_ata: solana_address::Address) -> &mut Self {
234                        self.epoch_vault_token_ata = Some(epoch_vault_token_ata);
235                    self
236    }
237            /// `[optional account, default to 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA']`
238#[inline(always)]
239    pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
240                        self.token_program = Some(token_program);
241                    self
242    }
243            /// `[optional account, default to 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL']`
244#[inline(always)]
245    pub fn associated_token_program(&mut self, associated_token_program: solana_address::Address) -> &mut Self {
246                        self.associated_token_program = Some(associated_token_program);
247                    self
248    }
249            /// `[optional account, default to '11111111111111111111111111111111']`
250#[inline(always)]
251    pub fn system_program(&mut self, system_program: solana_address::Address) -> &mut Self {
252                        self.system_program = Some(system_program);
253                    self
254    }
255            /// Add an additional account to the instruction.
256  #[inline(always)]
257  pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
258    self.__remaining_accounts.push(account);
259    self
260  }
261  /// Add additional accounts to the instruction.
262  #[inline(always)]
263  pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
264    self.__remaining_accounts.extend_from_slice(accounts);
265    self
266  }
267  #[allow(clippy::clone_on_copy)]
268  pub fn instruction(&self) -> solana_instruction::Instruction {
269    let accounts = CreateTokenVault {
270                              authority: self.authority.expect("authority is not set"),
271                                        satrush_config: self.satrush_config.expect("satrush_config is not set"),
272                                        token_vault: self.token_vault.expect("token_vault is not set"),
273                                        board: self.board.expect("board is not set"),
274                                        epoch_vault: self.epoch_vault.expect("epoch_vault is not set"),
275                                        token_mint: self.token_mint.expect("token_mint is not set"),
276                                        token_vault_token_ata: self.token_vault_token_ata.expect("token_vault_token_ata is not set"),
277                                        board_token_ata: self.board_token_ata.expect("board_token_ata is not set"),
278                                        epoch_vault_token_ata: self.epoch_vault_token_ata.expect("epoch_vault_token_ata is not set"),
279                                        token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
280                                        associated_token_program: self.associated_token_program.unwrap_or(solana_address::address!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")),
281                                        system_program: self.system_program.unwrap_or(solana_address::address!("11111111111111111111111111111111")),
282                      };
283    
284    accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
285  }
286}
287
288  /// `create_token_vault` CPI accounts.
289  pub struct CreateTokenVaultCpiAccounts<'a, 'b> {
290          
291                    
292              pub authority: &'b solana_account_info::AccountInfo<'a>,
293                
294                    
295              pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
296                
297                    
298              pub token_vault: &'b solana_account_info::AccountInfo<'a>,
299                
300                    
301              pub board: &'b solana_account_info::AccountInfo<'a>,
302                
303                    
304              pub epoch_vault: &'b solana_account_info::AccountInfo<'a>,
305                
306                    
307              pub token_mint: &'b solana_account_info::AccountInfo<'a>,
308                        /// The vault's reserves — holds exactly `token_amount + leftovers`.
309
310      
311                    
312              pub token_vault_token_ata: &'b solana_account_info::AccountInfo<'a>,
313                        /// The mint program's destination: every round's tokens land here.
314
315      
316                    
317              pub board_token_ata: &'b solana_account_info::AccountInfo<'a>,
318                        /// Receives the epoch leg at every rotation.
319
320      
321                    
322              pub epoch_vault_token_ata: &'b solana_account_info::AccountInfo<'a>,
323                
324                    
325              pub token_program: &'b solana_account_info::AccountInfo<'a>,
326                
327                    
328              pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
329                
330                    
331              pub system_program: &'b solana_account_info::AccountInfo<'a>,
332            }
333
334/// `create_token_vault` CPI instruction.
335pub struct CreateTokenVaultCpi<'a, 'b> {
336  /// The program to invoke.
337  pub __program: &'b solana_account_info::AccountInfo<'a>,
338      
339              
340          pub authority: &'b solana_account_info::AccountInfo<'a>,
341          
342              
343          pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
344          
345              
346          pub token_vault: &'b solana_account_info::AccountInfo<'a>,
347          
348              
349          pub board: &'b solana_account_info::AccountInfo<'a>,
350          
351              
352          pub epoch_vault: &'b solana_account_info::AccountInfo<'a>,
353          
354              
355          pub token_mint: &'b solana_account_info::AccountInfo<'a>,
356                /// The vault's reserves — holds exactly `token_amount + leftovers`.
357
358    
359              
360          pub token_vault_token_ata: &'b solana_account_info::AccountInfo<'a>,
361                /// The mint program's destination: every round's tokens land here.
362
363    
364              
365          pub board_token_ata: &'b solana_account_info::AccountInfo<'a>,
366                /// Receives the epoch leg at every rotation.
367
368    
369              
370          pub epoch_vault_token_ata: &'b solana_account_info::AccountInfo<'a>,
371          
372              
373          pub token_program: &'b solana_account_info::AccountInfo<'a>,
374          
375              
376          pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
377          
378              
379          pub system_program: &'b solana_account_info::AccountInfo<'a>,
380        }
381
382impl<'a, 'b> CreateTokenVaultCpi<'a, 'b> {
383  pub fn new(
384    program: &'b solana_account_info::AccountInfo<'a>,
385          accounts: CreateTokenVaultCpiAccounts<'a, 'b>,
386          ) -> Self {
387    Self {
388      __program: program,
389              authority: accounts.authority,
390              satrush_config: accounts.satrush_config,
391              token_vault: accounts.token_vault,
392              board: accounts.board,
393              epoch_vault: accounts.epoch_vault,
394              token_mint: accounts.token_mint,
395              token_vault_token_ata: accounts.token_vault_token_ata,
396              board_token_ata: accounts.board_token_ata,
397              epoch_vault_token_ata: accounts.epoch_vault_token_ata,
398              token_program: accounts.token_program,
399              associated_token_program: accounts.associated_token_program,
400              system_program: accounts.system_program,
401                }
402  }
403  #[inline(always)]
404  pub fn invoke(&self) -> solana_program_error::ProgramResult {
405    self.invoke_signed_with_remaining_accounts(&[], &[])
406  }
407  #[inline(always)]
408  pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
409    self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
410  }
411  #[inline(always)]
412  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
413    self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
414  }
415  #[allow(clippy::arithmetic_side_effects)]
416  #[allow(clippy::clone_on_copy)]
417  #[allow(clippy::vec_init_then_push)]
418  pub fn invoke_signed_with_remaining_accounts(
419    &self,
420    signers_seeds: &[&[&[u8]]],
421    remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
422  ) -> solana_program_error::ProgramResult {
423    let mut accounts = Vec::with_capacity(12+ remaining_accounts.len());
424                            accounts.push(solana_instruction::AccountMeta::new(
425            *self.authority.key,
426            true
427          ));
428                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
429            *self.satrush_config.key,
430            false
431          ));
432                                          accounts.push(solana_instruction::AccountMeta::new(
433            *self.token_vault.key,
434            false
435          ));
436                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
437            *self.board.key,
438            false
439          ));
440                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
441            *self.epoch_vault.key,
442            false
443          ));
444                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
445            *self.token_mint.key,
446            false
447          ));
448                                          accounts.push(solana_instruction::AccountMeta::new(
449            *self.token_vault_token_ata.key,
450            false
451          ));
452                                          accounts.push(solana_instruction::AccountMeta::new(
453            *self.board_token_ata.key,
454            false
455          ));
456                                          accounts.push(solana_instruction::AccountMeta::new(
457            *self.epoch_vault_token_ata.key,
458            false
459          ));
460                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
461            *self.token_program.key,
462            false
463          ));
464                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
465            *self.associated_token_program.key,
466            false
467          ));
468                                          accounts.push(solana_instruction::AccountMeta::new_readonly(
469            *self.system_program.key,
470            false
471          ));
472                      remaining_accounts.iter().for_each(|remaining_account| {
473      accounts.push(solana_instruction::AccountMeta {
474          pubkey: *remaining_account.0.key,
475          is_signer: remaining_account.1,
476          is_writable: remaining_account.2,
477      })
478    });
479    let data = CreateTokenVaultInstructionData::new().try_to_vec().unwrap();
480    
481    let instruction = solana_instruction::Instruction {
482      program_id: crate::SATRUSH_ID,
483      accounts,
484      data,
485    };
486    let mut account_infos = Vec::with_capacity(13 + remaining_accounts.len());
487    account_infos.push(self.__program.clone());
488                  account_infos.push(self.authority.clone());
489                        account_infos.push(self.satrush_config.clone());
490                        account_infos.push(self.token_vault.clone());
491                        account_infos.push(self.board.clone());
492                        account_infos.push(self.epoch_vault.clone());
493                        account_infos.push(self.token_mint.clone());
494                        account_infos.push(self.token_vault_token_ata.clone());
495                        account_infos.push(self.board_token_ata.clone());
496                        account_infos.push(self.epoch_vault_token_ata.clone());
497                        account_infos.push(self.token_program.clone());
498                        account_infos.push(self.associated_token_program.clone());
499                        account_infos.push(self.system_program.clone());
500              remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
501
502    if signers_seeds.is_empty() {
503      solana_cpi::invoke(&instruction, &account_infos)
504    } else {
505      solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
506    }
507  }
508}
509
510/// Instruction builder for `CreateTokenVault` via CPI.
511///
512/// ### Accounts:
513///
514                      ///   0. `[writable, signer]` authority
515          ///   1. `[]` satrush_config
516                ///   2. `[writable]` token_vault
517          ///   3. `[]` board
518          ///   4. `[]` epoch_vault
519          ///   5. `[]` token_mint
520                ///   6. `[writable]` token_vault_token_ata
521                ///   7. `[writable]` board_token_ata
522                ///   8. `[writable]` epoch_vault_token_ata
523          ///   9. `[]` token_program
524          ///   10. `[]` associated_token_program
525          ///   11. `[]` system_program
526#[derive(Clone, Debug)]
527pub struct CreateTokenVaultCpiBuilder<'a, 'b> {
528  instruction: Box<CreateTokenVaultCpiBuilderInstruction<'a, 'b>>,
529}
530
531impl<'a, 'b> CreateTokenVaultCpiBuilder<'a, 'b> {
532  pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
533    let instruction = Box::new(CreateTokenVaultCpiBuilderInstruction {
534      __program: program,
535              authority: None,
536              satrush_config: None,
537              token_vault: None,
538              board: None,
539              epoch_vault: None,
540              token_mint: None,
541              token_vault_token_ata: None,
542              board_token_ata: None,
543              epoch_vault_token_ata: None,
544              token_program: None,
545              associated_token_program: None,
546              system_program: None,
547                                __remaining_accounts: Vec::new(),
548    });
549    Self { instruction }
550  }
551      #[inline(always)]
552    pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
553                        self.instruction.authority = Some(authority);
554                    self
555    }
556      #[inline(always)]
557    pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
558                        self.instruction.satrush_config = Some(satrush_config);
559                    self
560    }
561      #[inline(always)]
562    pub fn token_vault(&mut self, token_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
563                        self.instruction.token_vault = Some(token_vault);
564                    self
565    }
566      #[inline(always)]
567    pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
568                        self.instruction.board = Some(board);
569                    self
570    }
571      #[inline(always)]
572    pub fn epoch_vault(&mut self, epoch_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
573                        self.instruction.epoch_vault = Some(epoch_vault);
574                    self
575    }
576      #[inline(always)]
577    pub fn token_mint(&mut self, token_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
578                        self.instruction.token_mint = Some(token_mint);
579                    self
580    }
581      /// The vault's reserves — holds exactly `token_amount + leftovers`.
582#[inline(always)]
583    pub fn token_vault_token_ata(&mut self, token_vault_token_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
584                        self.instruction.token_vault_token_ata = Some(token_vault_token_ata);
585                    self
586    }
587      /// The mint program's destination: every round's tokens land here.
588#[inline(always)]
589    pub fn board_token_ata(&mut self, board_token_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
590                        self.instruction.board_token_ata = Some(board_token_ata);
591                    self
592    }
593      /// Receives the epoch leg at every rotation.
594#[inline(always)]
595    pub fn epoch_vault_token_ata(&mut self, epoch_vault_token_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
596                        self.instruction.epoch_vault_token_ata = Some(epoch_vault_token_ata);
597                    self
598    }
599      #[inline(always)]
600    pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
601                        self.instruction.token_program = Some(token_program);
602                    self
603    }
604      #[inline(always)]
605    pub fn associated_token_program(&mut self, associated_token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
606                        self.instruction.associated_token_program = Some(associated_token_program);
607                    self
608    }
609      #[inline(always)]
610    pub fn system_program(&mut self, system_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
611                        self.instruction.system_program = Some(system_program);
612                    self
613    }
614            /// Add an additional account to the instruction.
615  #[inline(always)]
616  pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
617    self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
618    self
619  }
620  /// Add additional accounts to the instruction.
621  ///
622  /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
623  /// and a `bool` indicating whether the account is a signer or not.
624  #[inline(always)]
625  pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
626    self.instruction.__remaining_accounts.extend_from_slice(accounts);
627    self
628  }
629  #[inline(always)]
630  pub fn invoke(&self) -> solana_program_error::ProgramResult {
631    self.invoke_signed(&[])
632  }
633  #[allow(clippy::clone_on_copy)]
634  #[allow(clippy::vec_init_then_push)]
635  pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
636        let instruction = CreateTokenVaultCpi {
637        __program: self.instruction.__program,
638                  
639          authority: self.instruction.authority.expect("authority is not set"),
640                  
641          satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
642                  
643          token_vault: self.instruction.token_vault.expect("token_vault is not set"),
644                  
645          board: self.instruction.board.expect("board is not set"),
646                  
647          epoch_vault: self.instruction.epoch_vault.expect("epoch_vault is not set"),
648                  
649          token_mint: self.instruction.token_mint.expect("token_mint is not set"),
650                  
651          token_vault_token_ata: self.instruction.token_vault_token_ata.expect("token_vault_token_ata is not set"),
652                  
653          board_token_ata: self.instruction.board_token_ata.expect("board_token_ata is not set"),
654                  
655          epoch_vault_token_ata: self.instruction.epoch_vault_token_ata.expect("epoch_vault_token_ata is not set"),
656                  
657          token_program: self.instruction.token_program.expect("token_program is not set"),
658                  
659          associated_token_program: self.instruction.associated_token_program.expect("associated_token_program is not set"),
660                  
661          system_program: self.instruction.system_program.expect("system_program is not set"),
662                    };
663    instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
664  }
665}
666
667#[derive(Clone, Debug)]
668struct CreateTokenVaultCpiBuilderInstruction<'a, 'b> {
669  __program: &'b solana_account_info::AccountInfo<'a>,
670            authority: Option<&'b solana_account_info::AccountInfo<'a>>,
671                satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
672                token_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
673                board: Option<&'b solana_account_info::AccountInfo<'a>>,
674                epoch_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
675                token_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
676                token_vault_token_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
677                board_token_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
678                epoch_vault_token_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
679                token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
680                associated_token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
681                system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
682                /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
683  __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
684}
685