Skip to main content

security_token_client/generated/instructions/
initialize_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::InitializeVerificationConfigArgs;
9use borsh::BorshDeserialize;
10use borsh::BorshSerialize;
11
12pub const INITIALIZE_VERIFICATION_CONFIG_DISCRIMINATOR: u8 = 2;
13
14/// Accounts.
15#[derive(Debug)]
16pub struct InitializeVerificationConfig {
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 payer: solana_pubkey::Pubkey,
24
25    pub mint_account: solana_pubkey::Pubkey,
26
27    pub config_account: 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 InitializeVerificationConfig {
39    pub fn instruction(
40        &self,
41        args: InitializeVerificationConfigInstructionArgs,
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: InitializeVerificationConfigInstructionArgs,
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(self.payer, true));
65        accounts.push(solana_instruction::AccountMeta::new_readonly(
66            self.mint_account,
67            false,
68        ));
69        accounts.push(solana_instruction::AccountMeta::new(
70            self.config_account,
71            false,
72        ));
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(&InitializeVerificationConfigInstructionData::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 InitializeVerificationConfigInstructionData {
126    discriminator: u8,
127}
128
129impl InitializeVerificationConfigInstructionData {
130    pub fn new() -> Self {
131        Self { discriminator: 2 }
132    }
133}
134
135impl Default for InitializeVerificationConfigInstructionData {
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 InitializeVerificationConfigInstructionArgs {
144    pub initialize_verification_config_args: InitializeVerificationConfigArgs,
145}
146
147/// Instruction builder for `InitializeVerificationConfig`.
148///
149/// ### Accounts:
150///
151///   0. `[]` mint
152///   1. `[]` verification_config_or_mint_authority
153///   2. `[]` instructions_sysvar_or_creator
154///   3. `[writable, signer]` payer
155///   4. `[]` mint_account
156///   5. `[writable]` config_account
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 InitializeVerificationConfigBuilder {
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    payer: Option<solana_pubkey::Pubkey>,
167    mint_account: Option<solana_pubkey::Pubkey>,
168    config_account: 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    initialize_verification_config_args: Option<InitializeVerificationConfigArgs>,
174    __remaining_accounts: Vec<solana_instruction::AccountMeta>,
175}
176
177impl InitializeVerificationConfigBuilder {
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 payer(&mut self, payer: solana_pubkey::Pubkey) -> &mut Self {
204        self.payer = Some(payer);
205        self
206    }
207    #[inline(always)]
208    pub fn mint_account(&mut self, mint_account: solana_pubkey::Pubkey) -> &mut Self {
209        self.mint_account = Some(mint_account);
210        self
211    }
212    #[inline(always)]
213    pub fn config_account(&mut self, config_account: solana_pubkey::Pubkey) -> &mut Self {
214        self.config_account = Some(config_account);
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 initialize_verification_config_args(
252        &mut self,
253        initialize_verification_config_args: InitializeVerificationConfigArgs,
254    ) -> &mut Self {
255        self.initialize_verification_config_args = Some(initialize_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 = InitializeVerificationConfig {
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            payer: self.payer.expect("payer is not set"),
284            mint_account: self.mint_account.expect("mint_account is not set"),
285            config_account: self.config_account.expect("config_account 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 = InitializeVerificationConfigInstructionArgs {
294            initialize_verification_config_args: self
295                .initialize_verification_config_args
296                .clone()
297                .expect("initialize_verification_config_args is not set"),
298        };
299
300        accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
301    }
302}
303
304/// `initialize_verification_config` CPI accounts.
305pub struct InitializeVerificationConfigCpiAccounts<'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 payer: &'b solana_account_info::AccountInfo<'a>,
313
314    pub mint_account: &'b solana_account_info::AccountInfo<'a>,
315
316    pub config_account: &'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/// `initialize_verification_config` CPI instruction.
328pub struct InitializeVerificationConfigCpi<'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 payer: &'b solana_account_info::AccountInfo<'a>,
339
340    pub mint_account: &'b solana_account_info::AccountInfo<'a>,
341
342    pub config_account: &'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: InitializeVerificationConfigInstructionArgs,
353}
354
355impl<'a, 'b> InitializeVerificationConfigCpi<'a, 'b> {
356    pub fn new(
357        program: &'b solana_account_info::AccountInfo<'a>,
358        accounts: InitializeVerificationConfigCpiAccounts<'a, 'b>,
359        args: InitializeVerificationConfigInstructionArgs,
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            payer: accounts.payer,
367            mint_account: accounts.mint_account,
368            config_account: accounts.config_account,
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(*self.payer.key, true));
413        accounts.push(solana_instruction::AccountMeta::new_readonly(
414            *self.mint_account.key,
415            false,
416        ));
417        accounts.push(solana_instruction::AccountMeta::new(
418            *self.config_account.key,
419            false,
420        ));
421        accounts.push(solana_instruction::AccountMeta::new_readonly(
422            *self.system_program.key,
423            false,
424        ));
425        if let Some(account_metas_pda) = self.account_metas_pda {
426            accounts.push(solana_instruction::AccountMeta::new(
427                *account_metas_pda.key,
428                false,
429            ));
430        } else {
431            accounts.push(solana_instruction::AccountMeta::new_readonly(
432                crate::SECURITY_TOKEN_PROGRAM_ID,
433                false,
434            ));
435        }
436        if let Some(transfer_hook_pda) = self.transfer_hook_pda {
437            accounts.push(solana_instruction::AccountMeta::new_readonly(
438                *transfer_hook_pda.key,
439                false,
440            ));
441        } else {
442            accounts.push(solana_instruction::AccountMeta::new_readonly(
443                crate::SECURITY_TOKEN_PROGRAM_ID,
444                false,
445            ));
446        }
447        if let Some(transfer_hook_program) = self.transfer_hook_program {
448            accounts.push(solana_instruction::AccountMeta::new_readonly(
449                *transfer_hook_program.key,
450                false,
451            ));
452        } else {
453            accounts.push(solana_instruction::AccountMeta::new_readonly(
454                crate::SECURITY_TOKEN_PROGRAM_ID,
455                false,
456            ));
457        }
458        remaining_accounts.iter().for_each(|remaining_account| {
459            accounts.push(solana_instruction::AccountMeta {
460                pubkey: *remaining_account.0.key,
461                is_signer: remaining_account.1,
462                is_writable: remaining_account.2,
463            })
464        });
465        let mut data = borsh::to_vec(&InitializeVerificationConfigInstructionData::new()).unwrap();
466        let mut args = borsh::to_vec(&self.__args).unwrap();
467        data.append(&mut args);
468
469        let instruction = solana_instruction::Instruction {
470            program_id: crate::SECURITY_TOKEN_PROGRAM_ID,
471            accounts,
472            data,
473        };
474        let mut account_infos = Vec::with_capacity(11 + remaining_accounts.len());
475        account_infos.push(self.__program.clone());
476        account_infos.push(self.mint.clone());
477        account_infos.push(self.verification_config_or_mint_authority.clone());
478        account_infos.push(self.instructions_sysvar_or_creator.clone());
479        account_infos.push(self.payer.clone());
480        account_infos.push(self.mint_account.clone());
481        account_infos.push(self.config_account.clone());
482        account_infos.push(self.system_program.clone());
483        if let Some(account_metas_pda) = self.account_metas_pda {
484            account_infos.push(account_metas_pda.clone());
485        }
486        if let Some(transfer_hook_pda) = self.transfer_hook_pda {
487            account_infos.push(transfer_hook_pda.clone());
488        }
489        if let Some(transfer_hook_program) = self.transfer_hook_program {
490            account_infos.push(transfer_hook_program.clone());
491        }
492        remaining_accounts
493            .iter()
494            .for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
495
496        if signers_seeds.is_empty() {
497            solana_cpi::invoke(&instruction, &account_infos)
498        } else {
499            solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
500        }
501    }
502}
503
504/// Instruction builder for `InitializeVerificationConfig` via CPI.
505///
506/// ### Accounts:
507///
508///   0. `[]` mint
509///   1. `[]` verification_config_or_mint_authority
510///   2. `[]` instructions_sysvar_or_creator
511///   3. `[writable, signer]` payer
512///   4. `[]` mint_account
513///   5. `[writable]` config_account
514///   6. `[]` system_program
515///   7. `[writable, optional]` account_metas_pda
516///   8. `[optional]` transfer_hook_pda
517///   9. `[optional]` transfer_hook_program
518#[derive(Clone, Debug)]
519pub struct InitializeVerificationConfigCpiBuilder<'a, 'b> {
520    instruction: Box<InitializeVerificationConfigCpiBuilderInstruction<'a, 'b>>,
521}
522
523impl<'a, 'b> InitializeVerificationConfigCpiBuilder<'a, 'b> {
524    pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
525        let instruction = Box::new(InitializeVerificationConfigCpiBuilderInstruction {
526            __program: program,
527            mint: None,
528            verification_config_or_mint_authority: None,
529            instructions_sysvar_or_creator: None,
530            payer: None,
531            mint_account: None,
532            config_account: None,
533            system_program: None,
534            account_metas_pda: None,
535            transfer_hook_pda: None,
536            transfer_hook_program: None,
537            initialize_verification_config_args: None,
538            __remaining_accounts: Vec::new(),
539        });
540        Self { instruction }
541    }
542    #[inline(always)]
543    pub fn mint(&mut self, mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
544        self.instruction.mint = Some(mint);
545        self
546    }
547    #[inline(always)]
548    pub fn verification_config_or_mint_authority(
549        &mut self,
550        verification_config_or_mint_authority: &'b solana_account_info::AccountInfo<'a>,
551    ) -> &mut Self {
552        self.instruction.verification_config_or_mint_authority =
553            Some(verification_config_or_mint_authority);
554        self
555    }
556    #[inline(always)]
557    pub fn instructions_sysvar_or_creator(
558        &mut self,
559        instructions_sysvar_or_creator: &'b solana_account_info::AccountInfo<'a>,
560    ) -> &mut Self {
561        self.instruction.instructions_sysvar_or_creator = Some(instructions_sysvar_or_creator);
562        self
563    }
564    #[inline(always)]
565    pub fn payer(&mut self, payer: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
566        self.instruction.payer = Some(payer);
567        self
568    }
569    #[inline(always)]
570    pub fn mint_account(
571        &mut self,
572        mint_account: &'b solana_account_info::AccountInfo<'a>,
573    ) -> &mut Self {
574        self.instruction.mint_account = Some(mint_account);
575        self
576    }
577    #[inline(always)]
578    pub fn config_account(
579        &mut self,
580        config_account: &'b solana_account_info::AccountInfo<'a>,
581    ) -> &mut Self {
582        self.instruction.config_account = Some(config_account);
583        self
584    }
585    #[inline(always)]
586    pub fn system_program(
587        &mut self,
588        system_program: &'b solana_account_info::AccountInfo<'a>,
589    ) -> &mut Self {
590        self.instruction.system_program = Some(system_program);
591        self
592    }
593    /// `[optional account]`
594    #[inline(always)]
595    pub fn account_metas_pda(
596        &mut self,
597        account_metas_pda: Option<&'b solana_account_info::AccountInfo<'a>>,
598    ) -> &mut Self {
599        self.instruction.account_metas_pda = account_metas_pda;
600        self
601    }
602    /// `[optional account]`
603    #[inline(always)]
604    pub fn transfer_hook_pda(
605        &mut self,
606        transfer_hook_pda: Option<&'b solana_account_info::AccountInfo<'a>>,
607    ) -> &mut Self {
608        self.instruction.transfer_hook_pda = transfer_hook_pda;
609        self
610    }
611    /// `[optional account]`
612    #[inline(always)]
613    pub fn transfer_hook_program(
614        &mut self,
615        transfer_hook_program: Option<&'b solana_account_info::AccountInfo<'a>>,
616    ) -> &mut Self {
617        self.instruction.transfer_hook_program = transfer_hook_program;
618        self
619    }
620    #[inline(always)]
621    pub fn initialize_verification_config_args(
622        &mut self,
623        initialize_verification_config_args: InitializeVerificationConfigArgs,
624    ) -> &mut Self {
625        self.instruction.initialize_verification_config_args =
626            Some(initialize_verification_config_args);
627        self
628    }
629    /// Add an additional account to the instruction.
630    #[inline(always)]
631    pub fn add_remaining_account(
632        &mut self,
633        account: &'b solana_account_info::AccountInfo<'a>,
634        is_writable: bool,
635        is_signer: bool,
636    ) -> &mut Self {
637        self.instruction
638            .__remaining_accounts
639            .push((account, is_writable, is_signer));
640        self
641    }
642    /// Add additional accounts to the instruction.
643    ///
644    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
645    /// and a `bool` indicating whether the account is a signer or not.
646    #[inline(always)]
647    pub fn add_remaining_accounts(
648        &mut self,
649        accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)],
650    ) -> &mut Self {
651        self.instruction
652            .__remaining_accounts
653            .extend_from_slice(accounts);
654        self
655    }
656    #[inline(always)]
657    pub fn invoke(&self) -> solana_program_error::ProgramResult {
658        self.invoke_signed(&[])
659    }
660    #[allow(clippy::clone_on_copy)]
661    #[allow(clippy::vec_init_then_push)]
662    pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
663        let args = InitializeVerificationConfigInstructionArgs {
664            initialize_verification_config_args: self
665                .instruction
666                .initialize_verification_config_args
667                .clone()
668                .expect("initialize_verification_config_args is not set"),
669        };
670        let instruction = InitializeVerificationConfigCpi {
671            __program: self.instruction.__program,
672
673            mint: self.instruction.mint.expect("mint is not set"),
674
675            verification_config_or_mint_authority: self
676                .instruction
677                .verification_config_or_mint_authority
678                .expect("verification_config_or_mint_authority is not set"),
679
680            instructions_sysvar_or_creator: self
681                .instruction
682                .instructions_sysvar_or_creator
683                .expect("instructions_sysvar_or_creator is not set"),
684
685            payer: self.instruction.payer.expect("payer 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            system_program: self
698                .instruction
699                .system_program
700                .expect("system_program is not set"),
701
702            account_metas_pda: self.instruction.account_metas_pda,
703
704            transfer_hook_pda: self.instruction.transfer_hook_pda,
705
706            transfer_hook_program: self.instruction.transfer_hook_program,
707            __args: args,
708        };
709        instruction.invoke_signed_with_remaining_accounts(
710            signers_seeds,
711            &self.instruction.__remaining_accounts,
712        )
713    }
714}
715
716#[derive(Clone, Debug)]
717struct InitializeVerificationConfigCpiBuilderInstruction<'a, 'b> {
718    __program: &'b solana_account_info::AccountInfo<'a>,
719    mint: Option<&'b solana_account_info::AccountInfo<'a>>,
720    verification_config_or_mint_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
721    instructions_sysvar_or_creator: Option<&'b solana_account_info::AccountInfo<'a>>,
722    payer: Option<&'b solana_account_info::AccountInfo<'a>>,
723    mint_account: Option<&'b solana_account_info::AccountInfo<'a>>,
724    config_account: Option<&'b solana_account_info::AccountInfo<'a>>,
725    system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
726    account_metas_pda: Option<&'b solana_account_info::AccountInfo<'a>>,
727    transfer_hook_pda: Option<&'b solana_account_info::AccountInfo<'a>>,
728    transfer_hook_program: Option<&'b solana_account_info::AccountInfo<'a>>,
729    initialize_verification_config_args: Option<InitializeVerificationConfigArgs>,
730    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
731    __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
732}