Skip to main content

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