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