Skip to main content

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