orca_wavebreak/generated/instructions/
graduate_manual.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::BorshDeserialize;
9use borsh::BorshSerialize;
10
11/// Accounts.
12#[derive(Debug)]
13pub struct GraduateManual {
14    /// The signer of the transaction
15    pub signer: solana_program::pubkey::Pubkey,
16    /// The creator of the token
17    pub creator: solana_program::pubkey::Pubkey,
18    /// The fee authority of the token
19    pub fee_authority: solana_program::pubkey::Pubkey,
20    /// The destination of the token
21    pub destination: solana_program::pubkey::Pubkey,
22    /// The bonding curve account
23    pub bonding_curve: solana_program::pubkey::Pubkey,
24    /// The config account
25    pub config: solana_program::pubkey::Pubkey,
26    /// The quote mint account
27    pub quote_mint: solana_program::pubkey::Pubkey,
28    /// The quote vault account
29    pub quote_vault: solana_program::pubkey::Pubkey,
30    /// The creator quote ata account
31    pub creator_quote_ata: solana_program::pubkey::Pubkey,
32    /// The signer quote ata account
33    pub signer_quote_ata: solana_program::pubkey::Pubkey,
34    /// The fee authority quote ata account
35    pub fee_authority_quote_ata: solana_program::pubkey::Pubkey,
36    /// The destination quote ata account
37    pub destination_quote_ata: solana_program::pubkey::Pubkey,
38    /// The base mint account
39    pub base_mint: solana_program::pubkey::Pubkey,
40    /// The fee authority base ata account
41    pub fee_authority_base_ata: solana_program::pubkey::Pubkey,
42    /// The destination base ata account
43    pub destination_base_ata: solana_program::pubkey::Pubkey,
44    /// The system program account
45    pub system_program: solana_program::pubkey::Pubkey,
46    /// The ata program account
47    pub ata_program: solana_program::pubkey::Pubkey,
48    /// The quote token program account
49    pub quote_token_program: solana_program::pubkey::Pubkey,
50    /// The base token program account
51    pub base_token_program: solana_program::pubkey::Pubkey,
52}
53
54impl GraduateManual {
55    pub fn instruction(&self) -> solana_program::instruction::Instruction {
56        self.instruction_with_remaining_accounts(&[])
57    }
58    #[allow(clippy::arithmetic_side_effects)]
59    #[allow(clippy::vec_init_then_push)]
60    pub fn instruction_with_remaining_accounts(
61        &self,
62        remaining_accounts: &[solana_program::instruction::AccountMeta],
63    ) -> solana_program::instruction::Instruction {
64        let mut accounts = Vec::with_capacity(19 + remaining_accounts.len());
65        accounts.push(solana_program::instruction::AccountMeta::new(
66            self.signer,
67            true,
68        ));
69        accounts.push(solana_program::instruction::AccountMeta::new(
70            self.creator,
71            false,
72        ));
73        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
74            self.fee_authority,
75            false,
76        ));
77        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
78            self.destination,
79            false,
80        ));
81        accounts.push(solana_program::instruction::AccountMeta::new(
82            self.bonding_curve,
83            false,
84        ));
85        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
86            self.config,
87            false,
88        ));
89        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
90            self.quote_mint,
91            false,
92        ));
93        accounts.push(solana_program::instruction::AccountMeta::new(
94            self.quote_vault,
95            false,
96        ));
97        accounts.push(solana_program::instruction::AccountMeta::new(
98            self.creator_quote_ata,
99            false,
100        ));
101        accounts.push(solana_program::instruction::AccountMeta::new(
102            self.signer_quote_ata,
103            false,
104        ));
105        accounts.push(solana_program::instruction::AccountMeta::new(
106            self.fee_authority_quote_ata,
107            false,
108        ));
109        accounts.push(solana_program::instruction::AccountMeta::new(
110            self.destination_quote_ata,
111            false,
112        ));
113        accounts.push(solana_program::instruction::AccountMeta::new(
114            self.base_mint,
115            false,
116        ));
117        accounts.push(solana_program::instruction::AccountMeta::new(
118            self.fee_authority_base_ata,
119            false,
120        ));
121        accounts.push(solana_program::instruction::AccountMeta::new(
122            self.destination_base_ata,
123            false,
124        ));
125        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
126            self.system_program,
127            false,
128        ));
129        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
130            self.ata_program,
131            false,
132        ));
133        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
134            self.quote_token_program,
135            false,
136        ));
137        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
138            self.base_token_program,
139            false,
140        ));
141        accounts.extend_from_slice(remaining_accounts);
142        let data = borsh::to_vec(&GraduateManualInstructionData::new()).unwrap();
143
144        solana_program::instruction::Instruction {
145            program_id: crate::WAVEBREAK_ID,
146            accounts,
147            data,
148        }
149    }
150}
151
152#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
153#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
154pub struct GraduateManualInstructionData {
155    discriminator: u8,
156}
157
158impl GraduateManualInstructionData {
159    pub fn new() -> Self {
160        Self { discriminator: 33 }
161    }
162}
163
164impl Default for GraduateManualInstructionData {
165    fn default() -> Self {
166        Self::new()
167    }
168}
169
170/// Instruction builder for `GraduateManual`.
171///
172/// ### Accounts:
173///
174///   0. `[writable, signer]` signer
175///   1. `[writable]` creator
176///   2. `[]` fee_authority
177///   3. `[]` destination
178///   4. `[writable]` bonding_curve
179///   5. `[]` config
180///   6. `[]` quote_mint
181///   7. `[writable]` quote_vault
182///   8. `[writable]` creator_quote_ata
183///   9. `[writable]` signer_quote_ata
184///   10. `[writable]` fee_authority_quote_ata
185///   11. `[writable]` destination_quote_ata
186///   12. `[writable]` base_mint
187///   13. `[writable]` fee_authority_base_ata
188///   14. `[writable]` destination_base_ata
189///   15. `[optional]` system_program (default to `11111111111111111111111111111111`)
190///   16. `[optional]` ata_program (default to `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`)
191///   17. `[]` quote_token_program
192///   18. `[]` base_token_program
193#[derive(Clone, Debug, Default)]
194pub struct GraduateManualBuilder {
195    signer: Option<solana_program::pubkey::Pubkey>,
196    creator: Option<solana_program::pubkey::Pubkey>,
197    fee_authority: Option<solana_program::pubkey::Pubkey>,
198    destination: Option<solana_program::pubkey::Pubkey>,
199    bonding_curve: Option<solana_program::pubkey::Pubkey>,
200    config: Option<solana_program::pubkey::Pubkey>,
201    quote_mint: Option<solana_program::pubkey::Pubkey>,
202    quote_vault: Option<solana_program::pubkey::Pubkey>,
203    creator_quote_ata: Option<solana_program::pubkey::Pubkey>,
204    signer_quote_ata: Option<solana_program::pubkey::Pubkey>,
205    fee_authority_quote_ata: Option<solana_program::pubkey::Pubkey>,
206    destination_quote_ata: Option<solana_program::pubkey::Pubkey>,
207    base_mint: Option<solana_program::pubkey::Pubkey>,
208    fee_authority_base_ata: Option<solana_program::pubkey::Pubkey>,
209    destination_base_ata: Option<solana_program::pubkey::Pubkey>,
210    system_program: Option<solana_program::pubkey::Pubkey>,
211    ata_program: Option<solana_program::pubkey::Pubkey>,
212    quote_token_program: Option<solana_program::pubkey::Pubkey>,
213    base_token_program: Option<solana_program::pubkey::Pubkey>,
214    __remaining_accounts: Vec<solana_program::instruction::AccountMeta>,
215}
216
217impl GraduateManualBuilder {
218    pub fn new() -> Self {
219        Self::default()
220    }
221    /// The signer of the transaction
222    #[inline(always)]
223    pub fn signer(&mut self, signer: solana_program::pubkey::Pubkey) -> &mut Self {
224        self.signer = Some(signer);
225        self
226    }
227    /// The creator of the token
228    #[inline(always)]
229    pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self {
230        self.creator = Some(creator);
231        self
232    }
233    /// The fee authority of the token
234    #[inline(always)]
235    pub fn fee_authority(&mut self, fee_authority: solana_program::pubkey::Pubkey) -> &mut Self {
236        self.fee_authority = Some(fee_authority);
237        self
238    }
239    /// The destination of the token
240    #[inline(always)]
241    pub fn destination(&mut self, destination: solana_program::pubkey::Pubkey) -> &mut Self {
242        self.destination = Some(destination);
243        self
244    }
245    /// The bonding curve account
246    #[inline(always)]
247    pub fn bonding_curve(&mut self, bonding_curve: solana_program::pubkey::Pubkey) -> &mut Self {
248        self.bonding_curve = Some(bonding_curve);
249        self
250    }
251    /// The config account
252    #[inline(always)]
253    pub fn config(&mut self, config: solana_program::pubkey::Pubkey) -> &mut Self {
254        self.config = Some(config);
255        self
256    }
257    /// The quote mint account
258    #[inline(always)]
259    pub fn quote_mint(&mut self, quote_mint: solana_program::pubkey::Pubkey) -> &mut Self {
260        self.quote_mint = Some(quote_mint);
261        self
262    }
263    /// The quote vault account
264    #[inline(always)]
265    pub fn quote_vault(&mut self, quote_vault: solana_program::pubkey::Pubkey) -> &mut Self {
266        self.quote_vault = Some(quote_vault);
267        self
268    }
269    /// The creator quote ata account
270    #[inline(always)]
271    pub fn creator_quote_ata(
272        &mut self,
273        creator_quote_ata: solana_program::pubkey::Pubkey,
274    ) -> &mut Self {
275        self.creator_quote_ata = Some(creator_quote_ata);
276        self
277    }
278    /// The signer quote ata account
279    #[inline(always)]
280    pub fn signer_quote_ata(
281        &mut self,
282        signer_quote_ata: solana_program::pubkey::Pubkey,
283    ) -> &mut Self {
284        self.signer_quote_ata = Some(signer_quote_ata);
285        self
286    }
287    /// The fee authority quote ata account
288    #[inline(always)]
289    pub fn fee_authority_quote_ata(
290        &mut self,
291        fee_authority_quote_ata: solana_program::pubkey::Pubkey,
292    ) -> &mut Self {
293        self.fee_authority_quote_ata = Some(fee_authority_quote_ata);
294        self
295    }
296    /// The destination quote ata account
297    #[inline(always)]
298    pub fn destination_quote_ata(
299        &mut self,
300        destination_quote_ata: solana_program::pubkey::Pubkey,
301    ) -> &mut Self {
302        self.destination_quote_ata = Some(destination_quote_ata);
303        self
304    }
305    /// The base mint account
306    #[inline(always)]
307    pub fn base_mint(&mut self, base_mint: solana_program::pubkey::Pubkey) -> &mut Self {
308        self.base_mint = Some(base_mint);
309        self
310    }
311    /// The fee authority base ata account
312    #[inline(always)]
313    pub fn fee_authority_base_ata(
314        &mut self,
315        fee_authority_base_ata: solana_program::pubkey::Pubkey,
316    ) -> &mut Self {
317        self.fee_authority_base_ata = Some(fee_authority_base_ata);
318        self
319    }
320    /// The destination base ata account
321    #[inline(always)]
322    pub fn destination_base_ata(
323        &mut self,
324        destination_base_ata: solana_program::pubkey::Pubkey,
325    ) -> &mut Self {
326        self.destination_base_ata = Some(destination_base_ata);
327        self
328    }
329    /// `[optional account, default to '11111111111111111111111111111111']`
330    /// The system program account
331    #[inline(always)]
332    pub fn system_program(&mut self, system_program: solana_program::pubkey::Pubkey) -> &mut Self {
333        self.system_program = Some(system_program);
334        self
335    }
336    /// `[optional account, default to 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL']`
337    /// The ata program account
338    #[inline(always)]
339    pub fn ata_program(&mut self, ata_program: solana_program::pubkey::Pubkey) -> &mut Self {
340        self.ata_program = Some(ata_program);
341        self
342    }
343    /// The quote token program account
344    #[inline(always)]
345    pub fn quote_token_program(
346        &mut self,
347        quote_token_program: solana_program::pubkey::Pubkey,
348    ) -> &mut Self {
349        self.quote_token_program = Some(quote_token_program);
350        self
351    }
352    /// The base token program account
353    #[inline(always)]
354    pub fn base_token_program(
355        &mut self,
356        base_token_program: solana_program::pubkey::Pubkey,
357    ) -> &mut Self {
358        self.base_token_program = Some(base_token_program);
359        self
360    }
361    /// Add an additional account to the instruction.
362    #[inline(always)]
363    pub fn add_remaining_account(
364        &mut self,
365        account: solana_program::instruction::AccountMeta,
366    ) -> &mut Self {
367        self.__remaining_accounts.push(account);
368        self
369    }
370    /// Add additional accounts to the instruction.
371    #[inline(always)]
372    pub fn add_remaining_accounts(
373        &mut self,
374        accounts: &[solana_program::instruction::AccountMeta],
375    ) -> &mut Self {
376        self.__remaining_accounts.extend_from_slice(accounts);
377        self
378    }
379    #[allow(clippy::clone_on_copy)]
380    pub fn instruction(&self) -> solana_program::instruction::Instruction {
381        let accounts = GraduateManual {
382            signer: self.signer.expect("signer is not set"),
383            creator: self.creator.expect("creator is not set"),
384            fee_authority: self.fee_authority.expect("fee_authority is not set"),
385            destination: self.destination.expect("destination is not set"),
386            bonding_curve: self.bonding_curve.expect("bonding_curve is not set"),
387            config: self.config.expect("config is not set"),
388            quote_mint: self.quote_mint.expect("quote_mint is not set"),
389            quote_vault: self.quote_vault.expect("quote_vault is not set"),
390            creator_quote_ata: self
391                .creator_quote_ata
392                .expect("creator_quote_ata is not set"),
393            signer_quote_ata: self.signer_quote_ata.expect("signer_quote_ata is not set"),
394            fee_authority_quote_ata: self
395                .fee_authority_quote_ata
396                .expect("fee_authority_quote_ata is not set"),
397            destination_quote_ata: self
398                .destination_quote_ata
399                .expect("destination_quote_ata is not set"),
400            base_mint: self.base_mint.expect("base_mint is not set"),
401            fee_authority_base_ata: self
402                .fee_authority_base_ata
403                .expect("fee_authority_base_ata is not set"),
404            destination_base_ata: self
405                .destination_base_ata
406                .expect("destination_base_ata is not set"),
407            system_program: self
408                .system_program
409                .unwrap_or(solana_program::pubkey!("11111111111111111111111111111111")),
410            ata_program: self.ata_program.unwrap_or(solana_program::pubkey!(
411                "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
412            )),
413            quote_token_program: self
414                .quote_token_program
415                .expect("quote_token_program is not set"),
416            base_token_program: self
417                .base_token_program
418                .expect("base_token_program is not set"),
419        };
420
421        accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
422    }
423}
424
425/// `graduate_manual` CPI accounts.
426pub struct GraduateManualCpiAccounts<'a, 'b> {
427    /// The signer of the transaction
428    pub signer: &'b solana_program::account_info::AccountInfo<'a>,
429    /// The creator of the token
430    pub creator: &'b solana_program::account_info::AccountInfo<'a>,
431    /// The fee authority of the token
432    pub fee_authority: &'b solana_program::account_info::AccountInfo<'a>,
433    /// The destination of the token
434    pub destination: &'b solana_program::account_info::AccountInfo<'a>,
435    /// The bonding curve account
436    pub bonding_curve: &'b solana_program::account_info::AccountInfo<'a>,
437    /// The config account
438    pub config: &'b solana_program::account_info::AccountInfo<'a>,
439    /// The quote mint account
440    pub quote_mint: &'b solana_program::account_info::AccountInfo<'a>,
441    /// The quote vault account
442    pub quote_vault: &'b solana_program::account_info::AccountInfo<'a>,
443    /// The creator quote ata account
444    pub creator_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
445    /// The signer quote ata account
446    pub signer_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
447    /// The fee authority quote ata account
448    pub fee_authority_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
449    /// The destination quote ata account
450    pub destination_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
451    /// The base mint account
452    pub base_mint: &'b solana_program::account_info::AccountInfo<'a>,
453    /// The fee authority base ata account
454    pub fee_authority_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
455    /// The destination base ata account
456    pub destination_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
457    /// The system program account
458    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
459    /// The ata program account
460    pub ata_program: &'b solana_program::account_info::AccountInfo<'a>,
461    /// The quote token program account
462    pub quote_token_program: &'b solana_program::account_info::AccountInfo<'a>,
463    /// The base token program account
464    pub base_token_program: &'b solana_program::account_info::AccountInfo<'a>,
465}
466
467/// `graduate_manual` CPI instruction.
468pub struct GraduateManualCpi<'a, 'b> {
469    /// The program to invoke.
470    pub __program: &'b solana_program::account_info::AccountInfo<'a>,
471    /// The signer of the transaction
472    pub signer: &'b solana_program::account_info::AccountInfo<'a>,
473    /// The creator of the token
474    pub creator: &'b solana_program::account_info::AccountInfo<'a>,
475    /// The fee authority of the token
476    pub fee_authority: &'b solana_program::account_info::AccountInfo<'a>,
477    /// The destination of the token
478    pub destination: &'b solana_program::account_info::AccountInfo<'a>,
479    /// The bonding curve account
480    pub bonding_curve: &'b solana_program::account_info::AccountInfo<'a>,
481    /// The config account
482    pub config: &'b solana_program::account_info::AccountInfo<'a>,
483    /// The quote mint account
484    pub quote_mint: &'b solana_program::account_info::AccountInfo<'a>,
485    /// The quote vault account
486    pub quote_vault: &'b solana_program::account_info::AccountInfo<'a>,
487    /// The creator quote ata account
488    pub creator_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
489    /// The signer quote ata account
490    pub signer_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
491    /// The fee authority quote ata account
492    pub fee_authority_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
493    /// The destination quote ata account
494    pub destination_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
495    /// The base mint account
496    pub base_mint: &'b solana_program::account_info::AccountInfo<'a>,
497    /// The fee authority base ata account
498    pub fee_authority_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
499    /// The destination base ata account
500    pub destination_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
501    /// The system program account
502    pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
503    /// The ata program account
504    pub ata_program: &'b solana_program::account_info::AccountInfo<'a>,
505    /// The quote token program account
506    pub quote_token_program: &'b solana_program::account_info::AccountInfo<'a>,
507    /// The base token program account
508    pub base_token_program: &'b solana_program::account_info::AccountInfo<'a>,
509}
510
511impl<'a, 'b> GraduateManualCpi<'a, 'b> {
512    pub fn new(
513        program: &'b solana_program::account_info::AccountInfo<'a>,
514        accounts: GraduateManualCpiAccounts<'a, 'b>,
515    ) -> Self {
516        Self {
517            __program: program,
518            signer: accounts.signer,
519            creator: accounts.creator,
520            fee_authority: accounts.fee_authority,
521            destination: accounts.destination,
522            bonding_curve: accounts.bonding_curve,
523            config: accounts.config,
524            quote_mint: accounts.quote_mint,
525            quote_vault: accounts.quote_vault,
526            creator_quote_ata: accounts.creator_quote_ata,
527            signer_quote_ata: accounts.signer_quote_ata,
528            fee_authority_quote_ata: accounts.fee_authority_quote_ata,
529            destination_quote_ata: accounts.destination_quote_ata,
530            base_mint: accounts.base_mint,
531            fee_authority_base_ata: accounts.fee_authority_base_ata,
532            destination_base_ata: accounts.destination_base_ata,
533            system_program: accounts.system_program,
534            ata_program: accounts.ata_program,
535            quote_token_program: accounts.quote_token_program,
536            base_token_program: accounts.base_token_program,
537        }
538    }
539    #[inline(always)]
540    pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
541        self.invoke_signed_with_remaining_accounts(&[], &[])
542    }
543    #[inline(always)]
544    pub fn invoke_with_remaining_accounts(
545        &self,
546        remaining_accounts: &[(
547            &'b solana_program::account_info::AccountInfo<'a>,
548            bool,
549            bool,
550        )],
551    ) -> solana_program::entrypoint::ProgramResult {
552        self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
553    }
554    #[inline(always)]
555    pub fn invoke_signed(
556        &self,
557        signers_seeds: &[&[&[u8]]],
558    ) -> solana_program::entrypoint::ProgramResult {
559        self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
560    }
561    #[allow(clippy::arithmetic_side_effects)]
562    #[allow(clippy::clone_on_copy)]
563    #[allow(clippy::vec_init_then_push)]
564    pub fn invoke_signed_with_remaining_accounts(
565        &self,
566        signers_seeds: &[&[&[u8]]],
567        remaining_accounts: &[(
568            &'b solana_program::account_info::AccountInfo<'a>,
569            bool,
570            bool,
571        )],
572    ) -> solana_program::entrypoint::ProgramResult {
573        let mut accounts = Vec::with_capacity(19 + remaining_accounts.len());
574        accounts.push(solana_program::instruction::AccountMeta::new(
575            *self.signer.key,
576            true,
577        ));
578        accounts.push(solana_program::instruction::AccountMeta::new(
579            *self.creator.key,
580            false,
581        ));
582        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
583            *self.fee_authority.key,
584            false,
585        ));
586        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
587            *self.destination.key,
588            false,
589        ));
590        accounts.push(solana_program::instruction::AccountMeta::new(
591            *self.bonding_curve.key,
592            false,
593        ));
594        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
595            *self.config.key,
596            false,
597        ));
598        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
599            *self.quote_mint.key,
600            false,
601        ));
602        accounts.push(solana_program::instruction::AccountMeta::new(
603            *self.quote_vault.key,
604            false,
605        ));
606        accounts.push(solana_program::instruction::AccountMeta::new(
607            *self.creator_quote_ata.key,
608            false,
609        ));
610        accounts.push(solana_program::instruction::AccountMeta::new(
611            *self.signer_quote_ata.key,
612            false,
613        ));
614        accounts.push(solana_program::instruction::AccountMeta::new(
615            *self.fee_authority_quote_ata.key,
616            false,
617        ));
618        accounts.push(solana_program::instruction::AccountMeta::new(
619            *self.destination_quote_ata.key,
620            false,
621        ));
622        accounts.push(solana_program::instruction::AccountMeta::new(
623            *self.base_mint.key,
624            false,
625        ));
626        accounts.push(solana_program::instruction::AccountMeta::new(
627            *self.fee_authority_base_ata.key,
628            false,
629        ));
630        accounts.push(solana_program::instruction::AccountMeta::new(
631            *self.destination_base_ata.key,
632            false,
633        ));
634        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
635            *self.system_program.key,
636            false,
637        ));
638        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
639            *self.ata_program.key,
640            false,
641        ));
642        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
643            *self.quote_token_program.key,
644            false,
645        ));
646        accounts.push(solana_program::instruction::AccountMeta::new_readonly(
647            *self.base_token_program.key,
648            false,
649        ));
650        remaining_accounts.iter().for_each(|remaining_account| {
651            accounts.push(solana_program::instruction::AccountMeta {
652                pubkey: *remaining_account.0.key,
653                is_signer: remaining_account.1,
654                is_writable: remaining_account.2,
655            })
656        });
657        let data = borsh::to_vec(&GraduateManualInstructionData::new()).unwrap();
658
659        let instruction = solana_program::instruction::Instruction {
660            program_id: crate::WAVEBREAK_ID,
661            accounts,
662            data,
663        };
664        let mut account_infos = Vec::with_capacity(20 + remaining_accounts.len());
665        account_infos.push(self.__program.clone());
666        account_infos.push(self.signer.clone());
667        account_infos.push(self.creator.clone());
668        account_infos.push(self.fee_authority.clone());
669        account_infos.push(self.destination.clone());
670        account_infos.push(self.bonding_curve.clone());
671        account_infos.push(self.config.clone());
672        account_infos.push(self.quote_mint.clone());
673        account_infos.push(self.quote_vault.clone());
674        account_infos.push(self.creator_quote_ata.clone());
675        account_infos.push(self.signer_quote_ata.clone());
676        account_infos.push(self.fee_authority_quote_ata.clone());
677        account_infos.push(self.destination_quote_ata.clone());
678        account_infos.push(self.base_mint.clone());
679        account_infos.push(self.fee_authority_base_ata.clone());
680        account_infos.push(self.destination_base_ata.clone());
681        account_infos.push(self.system_program.clone());
682        account_infos.push(self.ata_program.clone());
683        account_infos.push(self.quote_token_program.clone());
684        account_infos.push(self.base_token_program.clone());
685        remaining_accounts
686            .iter()
687            .for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
688
689        if signers_seeds.is_empty() {
690            solana_program::program::invoke(&instruction, &account_infos)
691        } else {
692            solana_program::program::invoke_signed(&instruction, &account_infos, signers_seeds)
693        }
694    }
695}
696
697/// Instruction builder for `GraduateManual` via CPI.
698///
699/// ### Accounts:
700///
701///   0. `[writable, signer]` signer
702///   1. `[writable]` creator
703///   2. `[]` fee_authority
704///   3. `[]` destination
705///   4. `[writable]` bonding_curve
706///   5. `[]` config
707///   6. `[]` quote_mint
708///   7. `[writable]` quote_vault
709///   8. `[writable]` creator_quote_ata
710///   9. `[writable]` signer_quote_ata
711///   10. `[writable]` fee_authority_quote_ata
712///   11. `[writable]` destination_quote_ata
713///   12. `[writable]` base_mint
714///   13. `[writable]` fee_authority_base_ata
715///   14. `[writable]` destination_base_ata
716///   15. `[]` system_program
717///   16. `[]` ata_program
718///   17. `[]` quote_token_program
719///   18. `[]` base_token_program
720#[derive(Clone, Debug)]
721pub struct GraduateManualCpiBuilder<'a, 'b> {
722    instruction: Box<GraduateManualCpiBuilderInstruction<'a, 'b>>,
723}
724
725impl<'a, 'b> GraduateManualCpiBuilder<'a, 'b> {
726    pub fn new(program: &'b solana_program::account_info::AccountInfo<'a>) -> Self {
727        let instruction = Box::new(GraduateManualCpiBuilderInstruction {
728            __program: program,
729            signer: None,
730            creator: None,
731            fee_authority: None,
732            destination: None,
733            bonding_curve: None,
734            config: None,
735            quote_mint: None,
736            quote_vault: None,
737            creator_quote_ata: None,
738            signer_quote_ata: None,
739            fee_authority_quote_ata: None,
740            destination_quote_ata: None,
741            base_mint: None,
742            fee_authority_base_ata: None,
743            destination_base_ata: None,
744            system_program: None,
745            ata_program: None,
746            quote_token_program: None,
747            base_token_program: None,
748            __remaining_accounts: Vec::new(),
749        });
750        Self { instruction }
751    }
752    /// The signer of the transaction
753    #[inline(always)]
754    pub fn signer(
755        &mut self,
756        signer: &'b solana_program::account_info::AccountInfo<'a>,
757    ) -> &mut Self {
758        self.instruction.signer = Some(signer);
759        self
760    }
761    /// The creator of the token
762    #[inline(always)]
763    pub fn creator(
764        &mut self,
765        creator: &'b solana_program::account_info::AccountInfo<'a>,
766    ) -> &mut Self {
767        self.instruction.creator = Some(creator);
768        self
769    }
770    /// The fee authority of the token
771    #[inline(always)]
772    pub fn fee_authority(
773        &mut self,
774        fee_authority: &'b solana_program::account_info::AccountInfo<'a>,
775    ) -> &mut Self {
776        self.instruction.fee_authority = Some(fee_authority);
777        self
778    }
779    /// The destination of the token
780    #[inline(always)]
781    pub fn destination(
782        &mut self,
783        destination: &'b solana_program::account_info::AccountInfo<'a>,
784    ) -> &mut Self {
785        self.instruction.destination = Some(destination);
786        self
787    }
788    /// The bonding curve account
789    #[inline(always)]
790    pub fn bonding_curve(
791        &mut self,
792        bonding_curve: &'b solana_program::account_info::AccountInfo<'a>,
793    ) -> &mut Self {
794        self.instruction.bonding_curve = Some(bonding_curve);
795        self
796    }
797    /// The config account
798    #[inline(always)]
799    pub fn config(
800        &mut self,
801        config: &'b solana_program::account_info::AccountInfo<'a>,
802    ) -> &mut Self {
803        self.instruction.config = Some(config);
804        self
805    }
806    /// The quote mint account
807    #[inline(always)]
808    pub fn quote_mint(
809        &mut self,
810        quote_mint: &'b solana_program::account_info::AccountInfo<'a>,
811    ) -> &mut Self {
812        self.instruction.quote_mint = Some(quote_mint);
813        self
814    }
815    /// The quote vault account
816    #[inline(always)]
817    pub fn quote_vault(
818        &mut self,
819        quote_vault: &'b solana_program::account_info::AccountInfo<'a>,
820    ) -> &mut Self {
821        self.instruction.quote_vault = Some(quote_vault);
822        self
823    }
824    /// The creator quote ata account
825    #[inline(always)]
826    pub fn creator_quote_ata(
827        &mut self,
828        creator_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
829    ) -> &mut Self {
830        self.instruction.creator_quote_ata = Some(creator_quote_ata);
831        self
832    }
833    /// The signer quote ata account
834    #[inline(always)]
835    pub fn signer_quote_ata(
836        &mut self,
837        signer_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
838    ) -> &mut Self {
839        self.instruction.signer_quote_ata = Some(signer_quote_ata);
840        self
841    }
842    /// The fee authority quote ata account
843    #[inline(always)]
844    pub fn fee_authority_quote_ata(
845        &mut self,
846        fee_authority_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
847    ) -> &mut Self {
848        self.instruction.fee_authority_quote_ata = Some(fee_authority_quote_ata);
849        self
850    }
851    /// The destination quote ata account
852    #[inline(always)]
853    pub fn destination_quote_ata(
854        &mut self,
855        destination_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
856    ) -> &mut Self {
857        self.instruction.destination_quote_ata = Some(destination_quote_ata);
858        self
859    }
860    /// The base mint account
861    #[inline(always)]
862    pub fn base_mint(
863        &mut self,
864        base_mint: &'b solana_program::account_info::AccountInfo<'a>,
865    ) -> &mut Self {
866        self.instruction.base_mint = Some(base_mint);
867        self
868    }
869    /// The fee authority base ata account
870    #[inline(always)]
871    pub fn fee_authority_base_ata(
872        &mut self,
873        fee_authority_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
874    ) -> &mut Self {
875        self.instruction.fee_authority_base_ata = Some(fee_authority_base_ata);
876        self
877    }
878    /// The destination base ata account
879    #[inline(always)]
880    pub fn destination_base_ata(
881        &mut self,
882        destination_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
883    ) -> &mut Self {
884        self.instruction.destination_base_ata = Some(destination_base_ata);
885        self
886    }
887    /// The system program account
888    #[inline(always)]
889    pub fn system_program(
890        &mut self,
891        system_program: &'b solana_program::account_info::AccountInfo<'a>,
892    ) -> &mut Self {
893        self.instruction.system_program = Some(system_program);
894        self
895    }
896    /// The ata program account
897    #[inline(always)]
898    pub fn ata_program(
899        &mut self,
900        ata_program: &'b solana_program::account_info::AccountInfo<'a>,
901    ) -> &mut Self {
902        self.instruction.ata_program = Some(ata_program);
903        self
904    }
905    /// The quote token program account
906    #[inline(always)]
907    pub fn quote_token_program(
908        &mut self,
909        quote_token_program: &'b solana_program::account_info::AccountInfo<'a>,
910    ) -> &mut Self {
911        self.instruction.quote_token_program = Some(quote_token_program);
912        self
913    }
914    /// The base token program account
915    #[inline(always)]
916    pub fn base_token_program(
917        &mut self,
918        base_token_program: &'b solana_program::account_info::AccountInfo<'a>,
919    ) -> &mut Self {
920        self.instruction.base_token_program = Some(base_token_program);
921        self
922    }
923    /// Add an additional account to the instruction.
924    #[inline(always)]
925    pub fn add_remaining_account(
926        &mut self,
927        account: &'b solana_program::account_info::AccountInfo<'a>,
928        is_writable: bool,
929        is_signer: bool,
930    ) -> &mut Self {
931        self.instruction
932            .__remaining_accounts
933            .push((account, is_writable, is_signer));
934        self
935    }
936    /// Add additional accounts to the instruction.
937    ///
938    /// Each account is represented by a tuple of the `AccountInfo`, a `bool` indicating whether the account is writable or not,
939    /// and a `bool` indicating whether the account is a signer or not.
940    #[inline(always)]
941    pub fn add_remaining_accounts(
942        &mut self,
943        accounts: &[(
944            &'b solana_program::account_info::AccountInfo<'a>,
945            bool,
946            bool,
947        )],
948    ) -> &mut Self {
949        self.instruction
950            .__remaining_accounts
951            .extend_from_slice(accounts);
952        self
953    }
954    #[inline(always)]
955    pub fn invoke(&self) -> solana_program::entrypoint::ProgramResult {
956        self.invoke_signed(&[])
957    }
958    #[allow(clippy::clone_on_copy)]
959    #[allow(clippy::vec_init_then_push)]
960    pub fn invoke_signed(
961        &self,
962        signers_seeds: &[&[&[u8]]],
963    ) -> solana_program::entrypoint::ProgramResult {
964        let instruction = GraduateManualCpi {
965            __program: self.instruction.__program,
966
967            signer: self.instruction.signer.expect("signer is not set"),
968
969            creator: self.instruction.creator.expect("creator is not set"),
970
971            fee_authority: self
972                .instruction
973                .fee_authority
974                .expect("fee_authority is not set"),
975
976            destination: self
977                .instruction
978                .destination
979                .expect("destination is not set"),
980
981            bonding_curve: self
982                .instruction
983                .bonding_curve
984                .expect("bonding_curve is not set"),
985
986            config: self.instruction.config.expect("config is not set"),
987
988            quote_mint: self.instruction.quote_mint.expect("quote_mint is not set"),
989
990            quote_vault: self
991                .instruction
992                .quote_vault
993                .expect("quote_vault is not set"),
994
995            creator_quote_ata: self
996                .instruction
997                .creator_quote_ata
998                .expect("creator_quote_ata is not set"),
999
1000            signer_quote_ata: self
1001                .instruction
1002                .signer_quote_ata
1003                .expect("signer_quote_ata is not set"),
1004
1005            fee_authority_quote_ata: self
1006                .instruction
1007                .fee_authority_quote_ata
1008                .expect("fee_authority_quote_ata is not set"),
1009
1010            destination_quote_ata: self
1011                .instruction
1012                .destination_quote_ata
1013                .expect("destination_quote_ata is not set"),
1014
1015            base_mint: self.instruction.base_mint.expect("base_mint is not set"),
1016
1017            fee_authority_base_ata: self
1018                .instruction
1019                .fee_authority_base_ata
1020                .expect("fee_authority_base_ata is not set"),
1021
1022            destination_base_ata: self
1023                .instruction
1024                .destination_base_ata
1025                .expect("destination_base_ata is not set"),
1026
1027            system_program: self
1028                .instruction
1029                .system_program
1030                .expect("system_program is not set"),
1031
1032            ata_program: self
1033                .instruction
1034                .ata_program
1035                .expect("ata_program is not set"),
1036
1037            quote_token_program: self
1038                .instruction
1039                .quote_token_program
1040                .expect("quote_token_program is not set"),
1041
1042            base_token_program: self
1043                .instruction
1044                .base_token_program
1045                .expect("base_token_program is not set"),
1046        };
1047        instruction.invoke_signed_with_remaining_accounts(
1048            signers_seeds,
1049            &self.instruction.__remaining_accounts,
1050        )
1051    }
1052}
1053
1054#[derive(Clone, Debug)]
1055struct GraduateManualCpiBuilderInstruction<'a, 'b> {
1056    __program: &'b solana_program::account_info::AccountInfo<'a>,
1057    signer: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1058    creator: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1059    fee_authority: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1060    destination: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1061    bonding_curve: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1062    config: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1063    quote_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1064    quote_vault: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1065    creator_quote_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1066    signer_quote_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1067    fee_authority_quote_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1068    destination_quote_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1069    base_mint: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1070    fee_authority_base_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1071    destination_base_ata: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1072    system_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1073    ata_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1074    quote_token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1075    base_token_program: Option<&'b solana_program::account_info::AccountInfo<'a>>,
1076    /// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
1077    __remaining_accounts: Vec<(
1078        &'b solana_program::account_info::AccountInfo<'a>,
1079        bool,
1080        bool,
1081    )>,
1082}