1use borsh::BorshDeserialize;
9use borsh::BorshSerialize;
10
11#[derive(Debug)]
13pub struct GraduateManual {
14 pub signer: solana_program::pubkey::Pubkey,
16 pub creator: solana_program::pubkey::Pubkey,
18 pub fee_authority: solana_program::pubkey::Pubkey,
20 pub destination: solana_program::pubkey::Pubkey,
22 pub bonding_curve: solana_program::pubkey::Pubkey,
24 pub config: solana_program::pubkey::Pubkey,
26 pub quote_mint: solana_program::pubkey::Pubkey,
28 pub quote_vault: solana_program::pubkey::Pubkey,
30 pub creator_quote_ata: solana_program::pubkey::Pubkey,
32 pub signer_quote_ata: solana_program::pubkey::Pubkey,
34 pub fee_authority_quote_ata: solana_program::pubkey::Pubkey,
36 pub destination_quote_ata: solana_program::pubkey::Pubkey,
38 pub base_mint: solana_program::pubkey::Pubkey,
40 pub fee_authority_base_ata: solana_program::pubkey::Pubkey,
42 pub destination_base_ata: solana_program::pubkey::Pubkey,
44 pub system_program: solana_program::pubkey::Pubkey,
46 pub ata_program: solana_program::pubkey::Pubkey,
48 pub quote_token_program: solana_program::pubkey::Pubkey,
50 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#[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 #[inline(always)]
223 pub fn signer(&mut self, signer: solana_program::pubkey::Pubkey) -> &mut Self {
224 self.signer = Some(signer);
225 self
226 }
227 #[inline(always)]
229 pub fn creator(&mut self, creator: solana_program::pubkey::Pubkey) -> &mut Self {
230 self.creator = Some(creator);
231 self
232 }
233 #[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 #[inline(always)]
241 pub fn destination(&mut self, destination: solana_program::pubkey::Pubkey) -> &mut Self {
242 self.destination = Some(destination);
243 self
244 }
245 #[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 #[inline(always)]
253 pub fn config(&mut self, config: solana_program::pubkey::Pubkey) -> &mut Self {
254 self.config = Some(config);
255 self
256 }
257 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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
425pub struct GraduateManualCpiAccounts<'a, 'b> {
427 pub signer: &'b solana_program::account_info::AccountInfo<'a>,
429 pub creator: &'b solana_program::account_info::AccountInfo<'a>,
431 pub fee_authority: &'b solana_program::account_info::AccountInfo<'a>,
433 pub destination: &'b solana_program::account_info::AccountInfo<'a>,
435 pub bonding_curve: &'b solana_program::account_info::AccountInfo<'a>,
437 pub config: &'b solana_program::account_info::AccountInfo<'a>,
439 pub quote_mint: &'b solana_program::account_info::AccountInfo<'a>,
441 pub quote_vault: &'b solana_program::account_info::AccountInfo<'a>,
443 pub creator_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
445 pub signer_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
447 pub fee_authority_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
449 pub destination_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
451 pub base_mint: &'b solana_program::account_info::AccountInfo<'a>,
453 pub fee_authority_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
455 pub destination_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
457 pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
459 pub ata_program: &'b solana_program::account_info::AccountInfo<'a>,
461 pub quote_token_program: &'b solana_program::account_info::AccountInfo<'a>,
463 pub base_token_program: &'b solana_program::account_info::AccountInfo<'a>,
465}
466
467pub struct GraduateManualCpi<'a, 'b> {
469 pub __program: &'b solana_program::account_info::AccountInfo<'a>,
471 pub signer: &'b solana_program::account_info::AccountInfo<'a>,
473 pub creator: &'b solana_program::account_info::AccountInfo<'a>,
475 pub fee_authority: &'b solana_program::account_info::AccountInfo<'a>,
477 pub destination: &'b solana_program::account_info::AccountInfo<'a>,
479 pub bonding_curve: &'b solana_program::account_info::AccountInfo<'a>,
481 pub config: &'b solana_program::account_info::AccountInfo<'a>,
483 pub quote_mint: &'b solana_program::account_info::AccountInfo<'a>,
485 pub quote_vault: &'b solana_program::account_info::AccountInfo<'a>,
487 pub creator_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
489 pub signer_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
491 pub fee_authority_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
493 pub destination_quote_ata: &'b solana_program::account_info::AccountInfo<'a>,
495 pub base_mint: &'b solana_program::account_info::AccountInfo<'a>,
497 pub fee_authority_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
499 pub destination_base_ata: &'b solana_program::account_info::AccountInfo<'a>,
501 pub system_program: &'b solana_program::account_info::AccountInfo<'a>,
503 pub ata_program: &'b solana_program::account_info::AccountInfo<'a>,
505 pub quote_token_program: &'b solana_program::account_info::AccountInfo<'a>,
507 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#[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 __remaining_accounts: Vec<(
1078 &'b solana_program::account_info::AccountInfo<'a>,
1079 bool,
1080 bool,
1081 )>,
1082}