1use borsh::BorshSerialize;
9use borsh::BorshDeserialize;
10
11pub const EXECUTE_PUBLIC_AUTOMATION_DISCRIMINATOR: [u8; 8] = [212, 191, 100, 136, 18, 213, 42, 72];
12
13#[derive(Debug)]
15pub struct ExecutePublicAutomation {
16 pub authority: solana_address::Address,
22
23
24 pub satrush_config: solana_address::Address,
25
26
27 pub board: solana_address::Address,
28 pub round: solana_address::Address,
33 pub public_automation: solana_address::Address,
40
41
42 pub usd_mint: solana_address::Address,
43 pub automation_usd_ata: solana_address::Address,
48 pub board_usd_ata: solana_address::Address,
53 pub public_deployment: solana_address::Address,
59 pub miner: solana_address::Address,
65 pub affiliate: Option<solana_address::Address>,
73 pub slot_hashes: solana_address::Address,
79
80
81 pub token_program: solana_address::Address,
82
83
84 pub system_program: solana_address::Address,
85
86
87 pub event_authority: solana_address::Address,
88
89
90 pub program: solana_address::Address,
91 }
92
93impl ExecutePublicAutomation {
94 pub fn instruction(&self, args: ExecutePublicAutomationInstructionArgs) -> solana_instruction::Instruction {
95 self.instruction_with_remaining_accounts(args, &[])
96 }
97 #[allow(clippy::arithmetic_side_effects)]
98 #[allow(clippy::vec_init_then_push)]
99 pub fn instruction_with_remaining_accounts(&self, args: ExecutePublicAutomationInstructionArgs, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
100 let mut accounts = Vec::with_capacity(16+ remaining_accounts.len());
101 accounts.push(solana_instruction::AccountMeta::new(
102 self.authority,
103 true
104 ));
105 accounts.push(solana_instruction::AccountMeta::new_readonly(
106 self.satrush_config,
107 false
108 ));
109 accounts.push(solana_instruction::AccountMeta::new(
110 self.board,
111 false
112 ));
113 accounts.push(solana_instruction::AccountMeta::new(
114 self.round,
115 false
116 ));
117 accounts.push(solana_instruction::AccountMeta::new(
118 self.public_automation,
119 false
120 ));
121 accounts.push(solana_instruction::AccountMeta::new_readonly(
122 self.usd_mint,
123 false
124 ));
125 accounts.push(solana_instruction::AccountMeta::new(
126 self.automation_usd_ata,
127 false
128 ));
129 accounts.push(solana_instruction::AccountMeta::new(
130 self.board_usd_ata,
131 false
132 ));
133 accounts.push(solana_instruction::AccountMeta::new(
134 self.public_deployment,
135 false
136 ));
137 accounts.push(solana_instruction::AccountMeta::new(
138 self.miner,
139 false
140 ));
141 if let Some(affiliate) = self.affiliate {
142 accounts.push(solana_instruction::AccountMeta::new(
143 affiliate,
144 false,
145 ));
146 } else {
147 accounts.push(solana_instruction::AccountMeta::new_readonly(
148 crate::SATRUSH_ID,
149 false,
150 ));
151 }
152 accounts.push(solana_instruction::AccountMeta::new_readonly(
153 self.slot_hashes,
154 false
155 ));
156 accounts.push(solana_instruction::AccountMeta::new_readonly(
157 self.token_program,
158 false
159 ));
160 accounts.push(solana_instruction::AccountMeta::new_readonly(
161 self.system_program,
162 false
163 ));
164 accounts.push(solana_instruction::AccountMeta::new_readonly(
165 self.event_authority,
166 false
167 ));
168 accounts.push(solana_instruction::AccountMeta::new_readonly(
169 self.program,
170 false
171 ));
172 accounts.extend_from_slice(remaining_accounts);
173 let mut data = ExecutePublicAutomationInstructionData::new().try_to_vec().unwrap();
174 let mut args = args.try_to_vec().unwrap();
175 data.append(&mut args);
176
177 solana_instruction::Instruction {
178 program_id: crate::SATRUSH_ID,
179 accounts,
180 data,
181 }
182 }
183}
184
185#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
186 pub struct ExecutePublicAutomationInstructionData {
187 discriminator: [u8; 8],
188 }
189
190impl ExecutePublicAutomationInstructionData {
191 pub fn new() -> Self {
192 Self {
193 discriminator: [212, 191, 100, 136, 18, 213, 42, 72],
194 }
195 }
196
197 pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
198 borsh::to_vec(self)
199 }
200 }
201
202impl Default for ExecutePublicAutomationInstructionData {
203 fn default() -> Self {
204 Self::new()
205 }
206}
207
208#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
209 pub struct ExecutePublicAutomationInstructionArgs {
210 pub selection_mask: Option<u32>,
211 }
212
213impl ExecutePublicAutomationInstructionArgs {
214 pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
215 borsh::to_vec(self)
216 }
217}
218
219
220#[derive(Clone, Debug, Default)]
241pub struct ExecutePublicAutomationBuilder {
242 authority: Option<solana_address::Address>,
243 satrush_config: Option<solana_address::Address>,
244 board: Option<solana_address::Address>,
245 round: Option<solana_address::Address>,
246 public_automation: Option<solana_address::Address>,
247 usd_mint: Option<solana_address::Address>,
248 automation_usd_ata: Option<solana_address::Address>,
249 board_usd_ata: Option<solana_address::Address>,
250 public_deployment: Option<solana_address::Address>,
251 miner: Option<solana_address::Address>,
252 affiliate: Option<solana_address::Address>,
253 slot_hashes: Option<solana_address::Address>,
254 token_program: Option<solana_address::Address>,
255 system_program: Option<solana_address::Address>,
256 event_authority: Option<solana_address::Address>,
257 program: Option<solana_address::Address>,
258 selection_mask: Option<u32>,
259 __remaining_accounts: Vec<solana_instruction::AccountMeta>,
260}
261
262impl ExecutePublicAutomationBuilder {
263 pub fn new() -> Self {
264 Self::default()
265 }
266 #[inline(always)]
269 pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
270 self.authority = Some(authority);
271 self
272 }
273 #[inline(always)]
274 pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
275 self.satrush_config = Some(satrush_config);
276 self
277 }
278 #[inline(always)]
279 pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
280 self.board = Some(board);
281 self
282 }
283 #[inline(always)]
285 pub fn round(&mut self, round: solana_address::Address) -> &mut Self {
286 self.round = Some(round);
287 self
288 }
289 #[inline(always)]
293 pub fn public_automation(&mut self, public_automation: solana_address::Address) -> &mut Self {
294 self.public_automation = Some(public_automation);
295 self
296 }
297 #[inline(always)]
298 pub fn usd_mint(&mut self, usd_mint: solana_address::Address) -> &mut Self {
299 self.usd_mint = Some(usd_mint);
300 self
301 }
302 #[inline(always)]
304 pub fn automation_usd_ata(&mut self, automation_usd_ata: solana_address::Address) -> &mut Self {
305 self.automation_usd_ata = Some(automation_usd_ata);
306 self
307 }
308 #[inline(always)]
310 pub fn board_usd_ata(&mut self, board_usd_ata: solana_address::Address) -> &mut Self {
311 self.board_usd_ata = Some(board_usd_ata);
312 self
313 }
314 #[inline(always)]
317 pub fn public_deployment(&mut self, public_deployment: solana_address::Address) -> &mut Self {
318 self.public_deployment = Some(public_deployment);
319 self
320 }
321 #[inline(always)]
324 pub fn miner(&mut self, miner: solana_address::Address) -> &mut Self {
325 self.miner = Some(miner);
326 self
327 }
328 #[inline(always)]
334 pub fn affiliate(&mut self, affiliate: Option<solana_address::Address>) -> &mut Self {
335 self.affiliate = affiliate;
336 self
337 }
338 #[inline(always)]
342 pub fn slot_hashes(&mut self, slot_hashes: solana_address::Address) -> &mut Self {
343 self.slot_hashes = Some(slot_hashes);
344 self
345 }
346 #[inline(always)]
348 pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
349 self.token_program = Some(token_program);
350 self
351 }
352 #[inline(always)]
354 pub fn system_program(&mut self, system_program: solana_address::Address) -> &mut Self {
355 self.system_program = Some(system_program);
356 self
357 }
358 #[inline(always)]
359 pub fn event_authority(&mut self, event_authority: solana_address::Address) -> &mut Self {
360 self.event_authority = Some(event_authority);
361 self
362 }
363 #[inline(always)]
364 pub fn program(&mut self, program: solana_address::Address) -> &mut Self {
365 self.program = Some(program);
366 self
367 }
368 #[inline(always)]
370 pub fn selection_mask(&mut self, selection_mask: u32) -> &mut Self {
371 self.selection_mask = Some(selection_mask);
372 self
373 }
374 #[inline(always)]
376 pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
377 self.__remaining_accounts.push(account);
378 self
379 }
380 #[inline(always)]
382 pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
383 self.__remaining_accounts.extend_from_slice(accounts);
384 self
385 }
386 #[allow(clippy::clone_on_copy)]
387 pub fn instruction(&self) -> solana_instruction::Instruction {
388 let accounts = ExecutePublicAutomation {
389 authority: self.authority.expect("authority is not set"),
390 satrush_config: self.satrush_config.expect("satrush_config is not set"),
391 board: self.board.expect("board is not set"),
392 round: self.round.expect("round is not set"),
393 public_automation: self.public_automation.expect("public_automation is not set"),
394 usd_mint: self.usd_mint.expect("usd_mint is not set"),
395 automation_usd_ata: self.automation_usd_ata.expect("automation_usd_ata is not set"),
396 board_usd_ata: self.board_usd_ata.expect("board_usd_ata is not set"),
397 public_deployment: self.public_deployment.expect("public_deployment is not set"),
398 miner: self.miner.expect("miner is not set"),
399 affiliate: self.affiliate,
400 slot_hashes: self.slot_hashes.unwrap_or(solana_address::address!("SysvarS1otHashes111111111111111111111111111")),
401 token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
402 system_program: self.system_program.unwrap_or(solana_address::address!("11111111111111111111111111111111")),
403 event_authority: self.event_authority.expect("event_authority is not set"),
404 program: self.program.expect("program is not set"),
405 };
406 let args = ExecutePublicAutomationInstructionArgs {
407 selection_mask: self.selection_mask.clone(),
408 };
409
410 accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
411 }
412}
413
414 pub struct ExecutePublicAutomationCpiAccounts<'a, 'b> {
416 pub authority: &'b solana_account_info::AccountInfo<'a>,
422
423
424 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
425
426
427 pub board: &'b solana_account_info::AccountInfo<'a>,
428 pub round: &'b solana_account_info::AccountInfo<'a>,
433 pub public_automation: &'b solana_account_info::AccountInfo<'a>,
440
441
442 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
443 pub automation_usd_ata: &'b solana_account_info::AccountInfo<'a>,
448 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
453 pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
459 pub miner: &'b solana_account_info::AccountInfo<'a>,
465 pub affiliate: Option<&'b solana_account_info::AccountInfo<'a>>,
473 pub slot_hashes: &'b solana_account_info::AccountInfo<'a>,
479
480
481 pub token_program: &'b solana_account_info::AccountInfo<'a>,
482
483
484 pub system_program: &'b solana_account_info::AccountInfo<'a>,
485
486
487 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
488
489
490 pub program: &'b solana_account_info::AccountInfo<'a>,
491 }
492
493pub struct ExecutePublicAutomationCpi<'a, 'b> {
495 pub __program: &'b solana_account_info::AccountInfo<'a>,
497 pub authority: &'b solana_account_info::AccountInfo<'a>,
503
504
505 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
506
507
508 pub board: &'b solana_account_info::AccountInfo<'a>,
509 pub round: &'b solana_account_info::AccountInfo<'a>,
514 pub public_automation: &'b solana_account_info::AccountInfo<'a>,
521
522
523 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
524 pub automation_usd_ata: &'b solana_account_info::AccountInfo<'a>,
529 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
534 pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
540 pub miner: &'b solana_account_info::AccountInfo<'a>,
546 pub affiliate: Option<&'b solana_account_info::AccountInfo<'a>>,
554 pub slot_hashes: &'b solana_account_info::AccountInfo<'a>,
560
561
562 pub token_program: &'b solana_account_info::AccountInfo<'a>,
563
564
565 pub system_program: &'b solana_account_info::AccountInfo<'a>,
566
567
568 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
569
570
571 pub program: &'b solana_account_info::AccountInfo<'a>,
572 pub __args: ExecutePublicAutomationInstructionArgs,
574 }
575
576impl<'a, 'b> ExecutePublicAutomationCpi<'a, 'b> {
577 pub fn new(
578 program: &'b solana_account_info::AccountInfo<'a>,
579 accounts: ExecutePublicAutomationCpiAccounts<'a, 'b>,
580 args: ExecutePublicAutomationInstructionArgs,
581 ) -> Self {
582 Self {
583 __program: program,
584 authority: accounts.authority,
585 satrush_config: accounts.satrush_config,
586 board: accounts.board,
587 round: accounts.round,
588 public_automation: accounts.public_automation,
589 usd_mint: accounts.usd_mint,
590 automation_usd_ata: accounts.automation_usd_ata,
591 board_usd_ata: accounts.board_usd_ata,
592 public_deployment: accounts.public_deployment,
593 miner: accounts.miner,
594 affiliate: accounts.affiliate,
595 slot_hashes: accounts.slot_hashes,
596 token_program: accounts.token_program,
597 system_program: accounts.system_program,
598 event_authority: accounts.event_authority,
599 program: accounts.program,
600 __args: args,
601 }
602 }
603 #[inline(always)]
604 pub fn invoke(&self) -> solana_program_error::ProgramResult {
605 self.invoke_signed_with_remaining_accounts(&[], &[])
606 }
607 #[inline(always)]
608 pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
609 self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
610 }
611 #[inline(always)]
612 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
613 self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
614 }
615 #[allow(clippy::arithmetic_side_effects)]
616 #[allow(clippy::clone_on_copy)]
617 #[allow(clippy::vec_init_then_push)]
618 pub fn invoke_signed_with_remaining_accounts(
619 &self,
620 signers_seeds: &[&[&[u8]]],
621 remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
622 ) -> solana_program_error::ProgramResult {
623 let mut accounts = Vec::with_capacity(16+ remaining_accounts.len());
624 accounts.push(solana_instruction::AccountMeta::new(
625 *self.authority.key,
626 true
627 ));
628 accounts.push(solana_instruction::AccountMeta::new_readonly(
629 *self.satrush_config.key,
630 false
631 ));
632 accounts.push(solana_instruction::AccountMeta::new(
633 *self.board.key,
634 false
635 ));
636 accounts.push(solana_instruction::AccountMeta::new(
637 *self.round.key,
638 false
639 ));
640 accounts.push(solana_instruction::AccountMeta::new(
641 *self.public_automation.key,
642 false
643 ));
644 accounts.push(solana_instruction::AccountMeta::new_readonly(
645 *self.usd_mint.key,
646 false
647 ));
648 accounts.push(solana_instruction::AccountMeta::new(
649 *self.automation_usd_ata.key,
650 false
651 ));
652 accounts.push(solana_instruction::AccountMeta::new(
653 *self.board_usd_ata.key,
654 false
655 ));
656 accounts.push(solana_instruction::AccountMeta::new(
657 *self.public_deployment.key,
658 false
659 ));
660 accounts.push(solana_instruction::AccountMeta::new(
661 *self.miner.key,
662 false
663 ));
664 if let Some(affiliate) = self.affiliate {
665 accounts.push(solana_instruction::AccountMeta::new(
666 *affiliate.key,
667 false,
668 ));
669 } else {
670 accounts.push(solana_instruction::AccountMeta::new_readonly(
671 crate::SATRUSH_ID,
672 false,
673 ));
674 }
675 accounts.push(solana_instruction::AccountMeta::new_readonly(
676 *self.slot_hashes.key,
677 false
678 ));
679 accounts.push(solana_instruction::AccountMeta::new_readonly(
680 *self.token_program.key,
681 false
682 ));
683 accounts.push(solana_instruction::AccountMeta::new_readonly(
684 *self.system_program.key,
685 false
686 ));
687 accounts.push(solana_instruction::AccountMeta::new_readonly(
688 *self.event_authority.key,
689 false
690 ));
691 accounts.push(solana_instruction::AccountMeta::new_readonly(
692 *self.program.key,
693 false
694 ));
695 remaining_accounts.iter().for_each(|remaining_account| {
696 accounts.push(solana_instruction::AccountMeta {
697 pubkey: *remaining_account.0.key,
698 is_signer: remaining_account.1,
699 is_writable: remaining_account.2,
700 })
701 });
702 let mut data = ExecutePublicAutomationInstructionData::new().try_to_vec().unwrap();
703 let mut args = self.__args.try_to_vec().unwrap();
704 data.append(&mut args);
705
706 let instruction = solana_instruction::Instruction {
707 program_id: crate::SATRUSH_ID,
708 accounts,
709 data,
710 };
711 let mut account_infos = Vec::with_capacity(17 + remaining_accounts.len());
712 account_infos.push(self.__program.clone());
713 account_infos.push(self.authority.clone());
714 account_infos.push(self.satrush_config.clone());
715 account_infos.push(self.board.clone());
716 account_infos.push(self.round.clone());
717 account_infos.push(self.public_automation.clone());
718 account_infos.push(self.usd_mint.clone());
719 account_infos.push(self.automation_usd_ata.clone());
720 account_infos.push(self.board_usd_ata.clone());
721 account_infos.push(self.public_deployment.clone());
722 account_infos.push(self.miner.clone());
723 if let Some(affiliate) = self.affiliate {
724 account_infos.push(affiliate.clone());
725 }
726 account_infos.push(self.slot_hashes.clone());
727 account_infos.push(self.token_program.clone());
728 account_infos.push(self.system_program.clone());
729 account_infos.push(self.event_authority.clone());
730 account_infos.push(self.program.clone());
731 remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
732
733 if signers_seeds.is_empty() {
734 solana_cpi::invoke(&instruction, &account_infos)
735 } else {
736 solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
737 }
738 }
739}
740
741#[derive(Clone, Debug)]
762pub struct ExecutePublicAutomationCpiBuilder<'a, 'b> {
763 instruction: Box<ExecutePublicAutomationCpiBuilderInstruction<'a, 'b>>,
764}
765
766impl<'a, 'b> ExecutePublicAutomationCpiBuilder<'a, 'b> {
767 pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
768 let instruction = Box::new(ExecutePublicAutomationCpiBuilderInstruction {
769 __program: program,
770 authority: None,
771 satrush_config: None,
772 board: None,
773 round: None,
774 public_automation: None,
775 usd_mint: None,
776 automation_usd_ata: None,
777 board_usd_ata: None,
778 public_deployment: None,
779 miner: None,
780 affiliate: None,
781 slot_hashes: None,
782 token_program: None,
783 system_program: None,
784 event_authority: None,
785 program: None,
786 selection_mask: None,
787 __remaining_accounts: Vec::new(),
788 });
789 Self { instruction }
790 }
791 #[inline(always)]
794 pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
795 self.instruction.authority = Some(authority);
796 self
797 }
798 #[inline(always)]
799 pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
800 self.instruction.satrush_config = Some(satrush_config);
801 self
802 }
803 #[inline(always)]
804 pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
805 self.instruction.board = Some(board);
806 self
807 }
808 #[inline(always)]
810 pub fn round(&mut self, round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
811 self.instruction.round = Some(round);
812 self
813 }
814 #[inline(always)]
818 pub fn public_automation(&mut self, public_automation: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
819 self.instruction.public_automation = Some(public_automation);
820 self
821 }
822 #[inline(always)]
823 pub fn usd_mint(&mut self, usd_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
824 self.instruction.usd_mint = Some(usd_mint);
825 self
826 }
827 #[inline(always)]
829 pub fn automation_usd_ata(&mut self, automation_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
830 self.instruction.automation_usd_ata = Some(automation_usd_ata);
831 self
832 }
833 #[inline(always)]
835 pub fn board_usd_ata(&mut self, board_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
836 self.instruction.board_usd_ata = Some(board_usd_ata);
837 self
838 }
839 #[inline(always)]
842 pub fn public_deployment(&mut self, public_deployment: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
843 self.instruction.public_deployment = Some(public_deployment);
844 self
845 }
846 #[inline(always)]
849 pub fn miner(&mut self, miner: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
850 self.instruction.miner = Some(miner);
851 self
852 }
853 #[inline(always)]
859 pub fn affiliate(&mut self, affiliate: Option<&'b solana_account_info::AccountInfo<'a>>) -> &mut Self {
860 self.instruction.affiliate = affiliate;
861 self
862 }
863 #[inline(always)]
866 pub fn slot_hashes(&mut self, slot_hashes: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
867 self.instruction.slot_hashes = Some(slot_hashes);
868 self
869 }
870 #[inline(always)]
871 pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
872 self.instruction.token_program = Some(token_program);
873 self
874 }
875 #[inline(always)]
876 pub fn system_program(&mut self, system_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
877 self.instruction.system_program = Some(system_program);
878 self
879 }
880 #[inline(always)]
881 pub fn event_authority(&mut self, event_authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
882 self.instruction.event_authority = Some(event_authority);
883 self
884 }
885 #[inline(always)]
886 pub fn program(&mut self, program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
887 self.instruction.program = Some(program);
888 self
889 }
890 #[inline(always)]
892 pub fn selection_mask(&mut self, selection_mask: u32) -> &mut Self {
893 self.instruction.selection_mask = Some(selection_mask);
894 self
895 }
896 #[inline(always)]
898 pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
899 self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
900 self
901 }
902 #[inline(always)]
907 pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
908 self.instruction.__remaining_accounts.extend_from_slice(accounts);
909 self
910 }
911 #[inline(always)]
912 pub fn invoke(&self) -> solana_program_error::ProgramResult {
913 self.invoke_signed(&[])
914 }
915 #[allow(clippy::clone_on_copy)]
916 #[allow(clippy::vec_init_then_push)]
917 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
918 let args = ExecutePublicAutomationInstructionArgs {
919 selection_mask: self.instruction.selection_mask.clone(),
920 };
921 let instruction = ExecutePublicAutomationCpi {
922 __program: self.instruction.__program,
923
924 authority: self.instruction.authority.expect("authority is not set"),
925
926 satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
927
928 board: self.instruction.board.expect("board is not set"),
929
930 round: self.instruction.round.expect("round is not set"),
931
932 public_automation: self.instruction.public_automation.expect("public_automation is not set"),
933
934 usd_mint: self.instruction.usd_mint.expect("usd_mint is not set"),
935
936 automation_usd_ata: self.instruction.automation_usd_ata.expect("automation_usd_ata is not set"),
937
938 board_usd_ata: self.instruction.board_usd_ata.expect("board_usd_ata is not set"),
939
940 public_deployment: self.instruction.public_deployment.expect("public_deployment is not set"),
941
942 miner: self.instruction.miner.expect("miner is not set"),
943
944 affiliate: self.instruction.affiliate,
945
946 slot_hashes: self.instruction.slot_hashes.expect("slot_hashes is not set"),
947
948 token_program: self.instruction.token_program.expect("token_program is not set"),
949
950 system_program: self.instruction.system_program.expect("system_program is not set"),
951
952 event_authority: self.instruction.event_authority.expect("event_authority is not set"),
953
954 program: self.instruction.program.expect("program is not set"),
955 __args: args,
956 };
957 instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
958 }
959}
960
961#[derive(Clone, Debug)]
962struct ExecutePublicAutomationCpiBuilderInstruction<'a, 'b> {
963 __program: &'b solana_account_info::AccountInfo<'a>,
964 authority: Option<&'b solana_account_info::AccountInfo<'a>>,
965 satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
966 board: Option<&'b solana_account_info::AccountInfo<'a>>,
967 round: Option<&'b solana_account_info::AccountInfo<'a>>,
968 public_automation: Option<&'b solana_account_info::AccountInfo<'a>>,
969 usd_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
970 automation_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
971 board_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
972 public_deployment: Option<&'b solana_account_info::AccountInfo<'a>>,
973 miner: Option<&'b solana_account_info::AccountInfo<'a>>,
974 affiliate: Option<&'b solana_account_info::AccountInfo<'a>>,
975 slot_hashes: Option<&'b solana_account_info::AccountInfo<'a>>,
976 token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
977 system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
978 event_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
979 program: Option<&'b solana_account_info::AccountInfo<'a>>,
980 selection_mask: Option<u32>,
981 __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
983}
984