1use borsh::BorshSerialize;
9use borsh::BorshDeserialize;
10
11pub const SETTLE_DEPLOY_PUBLIC_DISCRIMINATOR: [u8; 8] = [249, 111, 122, 103, 93, 86, 76, 198];
12
13#[derive(Debug)]
15pub struct SettleDeployPublic {
16 pub authority: solana_address::Address,
22
23
24 pub satrush_config: solana_address::Address,
25 pub round: solana_address::Address,
30 pub board: solana_address::Address,
35 pub rent_recipient: solana_address::Address,
41 pub public_deployment: solana_address::Address,
47 pub miner: solana_address::Address,
52 pub public_automation: solana_address::Address,
59 pub automation_usd_ata: solana_address::Address,
65 pub miner_usd_ata: solana_address::Address,
71 pub sats_vault: solana_address::Address,
76
77
78 pub btc_mint: solana_address::Address,
79 pub usd_mint: solana_address::Address,
84 pub board_usd_ata: solana_address::Address,
90 pub board_btc_ata: solana_address::Address,
95 pub sats_vault_btc_ata: solana_address::Address,
100
101
102 pub token_program: solana_address::Address,
103
104
105 pub associated_token_program: solana_address::Address,
106
107
108 pub system_program: solana_address::Address,
109
110
111 pub event_authority: solana_address::Address,
112
113
114 pub program: solana_address::Address,
115 }
116
117impl SettleDeployPublic {
118 pub fn instruction(&self) -> solana_instruction::Instruction {
119 self.instruction_with_remaining_accounts(&[])
120 }
121 #[allow(clippy::arithmetic_side_effects)]
122 #[allow(clippy::vec_init_then_push)]
123 pub fn instruction_with_remaining_accounts(&self, remaining_accounts: &[solana_instruction::AccountMeta]) -> solana_instruction::Instruction {
124 let mut accounts = Vec::with_capacity(21+ remaining_accounts.len());
125 accounts.push(solana_instruction::AccountMeta::new(
126 self.authority,
127 true
128 ));
129 accounts.push(solana_instruction::AccountMeta::new_readonly(
130 self.satrush_config,
131 false
132 ));
133 accounts.push(solana_instruction::AccountMeta::new(
134 self.round,
135 false
136 ));
137 accounts.push(solana_instruction::AccountMeta::new_readonly(
138 self.board,
139 false
140 ));
141 accounts.push(solana_instruction::AccountMeta::new(
142 self.rent_recipient,
143 false
144 ));
145 accounts.push(solana_instruction::AccountMeta::new(
146 self.public_deployment,
147 false
148 ));
149 accounts.push(solana_instruction::AccountMeta::new(
150 self.miner,
151 false
152 ));
153 accounts.push(solana_instruction::AccountMeta::new(
154 self.public_automation,
155 false
156 ));
157 accounts.push(solana_instruction::AccountMeta::new(
158 self.automation_usd_ata,
159 false
160 ));
161 accounts.push(solana_instruction::AccountMeta::new(
162 self.miner_usd_ata,
163 false
164 ));
165 accounts.push(solana_instruction::AccountMeta::new(
166 self.sats_vault,
167 false
168 ));
169 accounts.push(solana_instruction::AccountMeta::new_readonly(
170 self.btc_mint,
171 false
172 ));
173 accounts.push(solana_instruction::AccountMeta::new_readonly(
174 self.usd_mint,
175 false
176 ));
177 accounts.push(solana_instruction::AccountMeta::new(
178 self.board_usd_ata,
179 false
180 ));
181 accounts.push(solana_instruction::AccountMeta::new(
182 self.board_btc_ata,
183 false
184 ));
185 accounts.push(solana_instruction::AccountMeta::new(
186 self.sats_vault_btc_ata,
187 false
188 ));
189 accounts.push(solana_instruction::AccountMeta::new_readonly(
190 self.token_program,
191 false
192 ));
193 accounts.push(solana_instruction::AccountMeta::new_readonly(
194 self.associated_token_program,
195 false
196 ));
197 accounts.push(solana_instruction::AccountMeta::new_readonly(
198 self.system_program,
199 false
200 ));
201 accounts.push(solana_instruction::AccountMeta::new_readonly(
202 self.event_authority,
203 false
204 ));
205 accounts.push(solana_instruction::AccountMeta::new_readonly(
206 self.program,
207 false
208 ));
209 accounts.extend_from_slice(remaining_accounts);
210 let data = SettleDeployPublicInstructionData::new().try_to_vec().unwrap();
211
212 solana_instruction::Instruction {
213 program_id: crate::SATRUSH_ID,
214 accounts,
215 data,
216 }
217 }
218}
219
220#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
221 pub struct SettleDeployPublicInstructionData {
222 discriminator: [u8; 8],
223 }
224
225impl SettleDeployPublicInstructionData {
226 pub fn new() -> Self {
227 Self {
228 discriminator: [249, 111, 122, 103, 93, 86, 76, 198],
229 }
230 }
231
232 pub(crate) fn try_to_vec(&self) -> Result<Vec<u8>, std::io::Error> {
233 borsh::to_vec(self)
234 }
235 }
236
237impl Default for SettleDeployPublicInstructionData {
238 fn default() -> Self {
239 Self::new()
240 }
241}
242
243
244
245#[derive(Clone, Debug, Default)]
271pub struct SettleDeployPublicBuilder {
272 authority: Option<solana_address::Address>,
273 satrush_config: Option<solana_address::Address>,
274 round: Option<solana_address::Address>,
275 board: Option<solana_address::Address>,
276 rent_recipient: Option<solana_address::Address>,
277 public_deployment: Option<solana_address::Address>,
278 miner: Option<solana_address::Address>,
279 public_automation: Option<solana_address::Address>,
280 automation_usd_ata: Option<solana_address::Address>,
281 miner_usd_ata: Option<solana_address::Address>,
282 sats_vault: Option<solana_address::Address>,
283 btc_mint: Option<solana_address::Address>,
284 usd_mint: Option<solana_address::Address>,
285 board_usd_ata: Option<solana_address::Address>,
286 board_btc_ata: Option<solana_address::Address>,
287 sats_vault_btc_ata: Option<solana_address::Address>,
288 token_program: Option<solana_address::Address>,
289 associated_token_program: Option<solana_address::Address>,
290 system_program: Option<solana_address::Address>,
291 event_authority: Option<solana_address::Address>,
292 program: Option<solana_address::Address>,
293 __remaining_accounts: Vec<solana_instruction::AccountMeta>,
294}
295
296impl SettleDeployPublicBuilder {
297 pub fn new() -> Self {
298 Self::default()
299 }
300 #[inline(always)]
303 pub fn authority(&mut self, authority: solana_address::Address) -> &mut Self {
304 self.authority = Some(authority);
305 self
306 }
307 #[inline(always)]
308 pub fn satrush_config(&mut self, satrush_config: solana_address::Address) -> &mut Self {
309 self.satrush_config = Some(satrush_config);
310 self
311 }
312 #[inline(always)]
314 pub fn round(&mut self, round: solana_address::Address) -> &mut Self {
315 self.round = Some(round);
316 self
317 }
318 #[inline(always)]
320 pub fn board(&mut self, board: solana_address::Address) -> &mut Self {
321 self.board = Some(board);
322 self
323 }
324 #[inline(always)]
327 pub fn rent_recipient(&mut self, rent_recipient: solana_address::Address) -> &mut Self {
328 self.rent_recipient = Some(rent_recipient);
329 self
330 }
331 #[inline(always)]
334 pub fn public_deployment(&mut self, public_deployment: solana_address::Address) -> &mut Self {
335 self.public_deployment = Some(public_deployment);
336 self
337 }
338 #[inline(always)]
340 pub fn miner(&mut self, miner: solana_address::Address) -> &mut Self {
341 self.miner = Some(miner);
342 self
343 }
344 #[inline(always)]
348 pub fn public_automation(&mut self, public_automation: solana_address::Address) -> &mut Self {
349 self.public_automation = Some(public_automation);
350 self
351 }
352 #[inline(always)]
355 pub fn automation_usd_ata(&mut self, automation_usd_ata: solana_address::Address) -> &mut Self {
356 self.automation_usd_ata = Some(automation_usd_ata);
357 self
358 }
359 #[inline(always)]
362 pub fn miner_usd_ata(&mut self, miner_usd_ata: solana_address::Address) -> &mut Self {
363 self.miner_usd_ata = Some(miner_usd_ata);
364 self
365 }
366 #[inline(always)]
368 pub fn sats_vault(&mut self, sats_vault: solana_address::Address) -> &mut Self {
369 self.sats_vault = Some(sats_vault);
370 self
371 }
372 #[inline(always)]
373 pub fn btc_mint(&mut self, btc_mint: solana_address::Address) -> &mut Self {
374 self.btc_mint = Some(btc_mint);
375 self
376 }
377 #[inline(always)]
379 pub fn usd_mint(&mut self, usd_mint: solana_address::Address) -> &mut Self {
380 self.usd_mint = Some(usd_mint);
381 self
382 }
383 #[inline(always)]
386 pub fn board_usd_ata(&mut self, board_usd_ata: solana_address::Address) -> &mut Self {
387 self.board_usd_ata = Some(board_usd_ata);
388 self
389 }
390 #[inline(always)]
392 pub fn board_btc_ata(&mut self, board_btc_ata: solana_address::Address) -> &mut Self {
393 self.board_btc_ata = Some(board_btc_ata);
394 self
395 }
396 #[inline(always)]
398 pub fn sats_vault_btc_ata(&mut self, sats_vault_btc_ata: solana_address::Address) -> &mut Self {
399 self.sats_vault_btc_ata = Some(sats_vault_btc_ata);
400 self
401 }
402 #[inline(always)]
404 pub fn token_program(&mut self, token_program: solana_address::Address) -> &mut Self {
405 self.token_program = Some(token_program);
406 self
407 }
408 #[inline(always)]
410 pub fn associated_token_program(&mut self, associated_token_program: solana_address::Address) -> &mut Self {
411 self.associated_token_program = Some(associated_token_program);
412 self
413 }
414 #[inline(always)]
416 pub fn system_program(&mut self, system_program: solana_address::Address) -> &mut Self {
417 self.system_program = Some(system_program);
418 self
419 }
420 #[inline(always)]
421 pub fn event_authority(&mut self, event_authority: solana_address::Address) -> &mut Self {
422 self.event_authority = Some(event_authority);
423 self
424 }
425 #[inline(always)]
426 pub fn program(&mut self, program: solana_address::Address) -> &mut Self {
427 self.program = Some(program);
428 self
429 }
430 #[inline(always)]
432 pub fn add_remaining_account(&mut self, account: solana_instruction::AccountMeta) -> &mut Self {
433 self.__remaining_accounts.push(account);
434 self
435 }
436 #[inline(always)]
438 pub fn add_remaining_accounts(&mut self, accounts: &[solana_instruction::AccountMeta]) -> &mut Self {
439 self.__remaining_accounts.extend_from_slice(accounts);
440 self
441 }
442 #[allow(clippy::clone_on_copy)]
443 pub fn instruction(&self) -> solana_instruction::Instruction {
444 let accounts = SettleDeployPublic {
445 authority: self.authority.expect("authority is not set"),
446 satrush_config: self.satrush_config.expect("satrush_config is not set"),
447 round: self.round.expect("round is not set"),
448 board: self.board.expect("board is not set"),
449 rent_recipient: self.rent_recipient.expect("rent_recipient is not set"),
450 public_deployment: self.public_deployment.expect("public_deployment is not set"),
451 miner: self.miner.expect("miner is not set"),
452 public_automation: self.public_automation.expect("public_automation is not set"),
453 automation_usd_ata: self.automation_usd_ata.expect("automation_usd_ata is not set"),
454 miner_usd_ata: self.miner_usd_ata.expect("miner_usd_ata is not set"),
455 sats_vault: self.sats_vault.expect("sats_vault is not set"),
456 btc_mint: self.btc_mint.expect("btc_mint is not set"),
457 usd_mint: self.usd_mint.expect("usd_mint is not set"),
458 board_usd_ata: self.board_usd_ata.expect("board_usd_ata is not set"),
459 board_btc_ata: self.board_btc_ata.expect("board_btc_ata is not set"),
460 sats_vault_btc_ata: self.sats_vault_btc_ata.expect("sats_vault_btc_ata is not set"),
461 token_program: self.token_program.unwrap_or(solana_address::address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")),
462 associated_token_program: self.associated_token_program.unwrap_or(solana_address::address!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL")),
463 system_program: self.system_program.unwrap_or(solana_address::address!("11111111111111111111111111111111")),
464 event_authority: self.event_authority.expect("event_authority is not set"),
465 program: self.program.expect("program is not set"),
466 };
467
468 accounts.instruction_with_remaining_accounts(&self.__remaining_accounts)
469 }
470}
471
472 pub struct SettleDeployPublicCpiAccounts<'a, 'b> {
474 pub authority: &'b solana_account_info::AccountInfo<'a>,
480
481
482 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
483 pub round: &'b solana_account_info::AccountInfo<'a>,
488 pub board: &'b solana_account_info::AccountInfo<'a>,
493 pub rent_recipient: &'b solana_account_info::AccountInfo<'a>,
499 pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
505 pub miner: &'b solana_account_info::AccountInfo<'a>,
510 pub public_automation: &'b solana_account_info::AccountInfo<'a>,
517 pub automation_usd_ata: &'b solana_account_info::AccountInfo<'a>,
523 pub miner_usd_ata: &'b solana_account_info::AccountInfo<'a>,
529 pub sats_vault: &'b solana_account_info::AccountInfo<'a>,
534
535
536 pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
537 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
542 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
548 pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
553 pub sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
558
559
560 pub token_program: &'b solana_account_info::AccountInfo<'a>,
561
562
563 pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
564
565
566 pub system_program: &'b solana_account_info::AccountInfo<'a>,
567
568
569 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
570
571
572 pub program: &'b solana_account_info::AccountInfo<'a>,
573 }
574
575pub struct SettleDeployPublicCpi<'a, 'b> {
577 pub __program: &'b solana_account_info::AccountInfo<'a>,
579 pub authority: &'b solana_account_info::AccountInfo<'a>,
585
586
587 pub satrush_config: &'b solana_account_info::AccountInfo<'a>,
588 pub round: &'b solana_account_info::AccountInfo<'a>,
593 pub board: &'b solana_account_info::AccountInfo<'a>,
598 pub rent_recipient: &'b solana_account_info::AccountInfo<'a>,
604 pub public_deployment: &'b solana_account_info::AccountInfo<'a>,
610 pub miner: &'b solana_account_info::AccountInfo<'a>,
615 pub public_automation: &'b solana_account_info::AccountInfo<'a>,
622 pub automation_usd_ata: &'b solana_account_info::AccountInfo<'a>,
628 pub miner_usd_ata: &'b solana_account_info::AccountInfo<'a>,
634 pub sats_vault: &'b solana_account_info::AccountInfo<'a>,
639
640
641 pub btc_mint: &'b solana_account_info::AccountInfo<'a>,
642 pub usd_mint: &'b solana_account_info::AccountInfo<'a>,
647 pub board_usd_ata: &'b solana_account_info::AccountInfo<'a>,
653 pub board_btc_ata: &'b solana_account_info::AccountInfo<'a>,
658 pub sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>,
663
664
665 pub token_program: &'b solana_account_info::AccountInfo<'a>,
666
667
668 pub associated_token_program: &'b solana_account_info::AccountInfo<'a>,
669
670
671 pub system_program: &'b solana_account_info::AccountInfo<'a>,
672
673
674 pub event_authority: &'b solana_account_info::AccountInfo<'a>,
675
676
677 pub program: &'b solana_account_info::AccountInfo<'a>,
678 }
679
680impl<'a, 'b> SettleDeployPublicCpi<'a, 'b> {
681 pub fn new(
682 program: &'b solana_account_info::AccountInfo<'a>,
683 accounts: SettleDeployPublicCpiAccounts<'a, 'b>,
684 ) -> Self {
685 Self {
686 __program: program,
687 authority: accounts.authority,
688 satrush_config: accounts.satrush_config,
689 round: accounts.round,
690 board: accounts.board,
691 rent_recipient: accounts.rent_recipient,
692 public_deployment: accounts.public_deployment,
693 miner: accounts.miner,
694 public_automation: accounts.public_automation,
695 automation_usd_ata: accounts.automation_usd_ata,
696 miner_usd_ata: accounts.miner_usd_ata,
697 sats_vault: accounts.sats_vault,
698 btc_mint: accounts.btc_mint,
699 usd_mint: accounts.usd_mint,
700 board_usd_ata: accounts.board_usd_ata,
701 board_btc_ata: accounts.board_btc_ata,
702 sats_vault_btc_ata: accounts.sats_vault_btc_ata,
703 token_program: accounts.token_program,
704 associated_token_program: accounts.associated_token_program,
705 system_program: accounts.system_program,
706 event_authority: accounts.event_authority,
707 program: accounts.program,
708 }
709 }
710 #[inline(always)]
711 pub fn invoke(&self) -> solana_program_error::ProgramResult {
712 self.invoke_signed_with_remaining_accounts(&[], &[])
713 }
714 #[inline(always)]
715 pub fn invoke_with_remaining_accounts(&self, remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> solana_program_error::ProgramResult {
716 self.invoke_signed_with_remaining_accounts(&[], remaining_accounts)
717 }
718 #[inline(always)]
719 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
720 self.invoke_signed_with_remaining_accounts(signers_seeds, &[])
721 }
722 #[allow(clippy::arithmetic_side_effects)]
723 #[allow(clippy::clone_on_copy)]
724 #[allow(clippy::vec_init_then_push)]
725 pub fn invoke_signed_with_remaining_accounts(
726 &self,
727 signers_seeds: &[&[&[u8]]],
728 remaining_accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]
729 ) -> solana_program_error::ProgramResult {
730 let mut accounts = Vec::with_capacity(21+ remaining_accounts.len());
731 accounts.push(solana_instruction::AccountMeta::new(
732 *self.authority.key,
733 true
734 ));
735 accounts.push(solana_instruction::AccountMeta::new_readonly(
736 *self.satrush_config.key,
737 false
738 ));
739 accounts.push(solana_instruction::AccountMeta::new(
740 *self.round.key,
741 false
742 ));
743 accounts.push(solana_instruction::AccountMeta::new_readonly(
744 *self.board.key,
745 false
746 ));
747 accounts.push(solana_instruction::AccountMeta::new(
748 *self.rent_recipient.key,
749 false
750 ));
751 accounts.push(solana_instruction::AccountMeta::new(
752 *self.public_deployment.key,
753 false
754 ));
755 accounts.push(solana_instruction::AccountMeta::new(
756 *self.miner.key,
757 false
758 ));
759 accounts.push(solana_instruction::AccountMeta::new(
760 *self.public_automation.key,
761 false
762 ));
763 accounts.push(solana_instruction::AccountMeta::new(
764 *self.automation_usd_ata.key,
765 false
766 ));
767 accounts.push(solana_instruction::AccountMeta::new(
768 *self.miner_usd_ata.key,
769 false
770 ));
771 accounts.push(solana_instruction::AccountMeta::new(
772 *self.sats_vault.key,
773 false
774 ));
775 accounts.push(solana_instruction::AccountMeta::new_readonly(
776 *self.btc_mint.key,
777 false
778 ));
779 accounts.push(solana_instruction::AccountMeta::new_readonly(
780 *self.usd_mint.key,
781 false
782 ));
783 accounts.push(solana_instruction::AccountMeta::new(
784 *self.board_usd_ata.key,
785 false
786 ));
787 accounts.push(solana_instruction::AccountMeta::new(
788 *self.board_btc_ata.key,
789 false
790 ));
791 accounts.push(solana_instruction::AccountMeta::new(
792 *self.sats_vault_btc_ata.key,
793 false
794 ));
795 accounts.push(solana_instruction::AccountMeta::new_readonly(
796 *self.token_program.key,
797 false
798 ));
799 accounts.push(solana_instruction::AccountMeta::new_readonly(
800 *self.associated_token_program.key,
801 false
802 ));
803 accounts.push(solana_instruction::AccountMeta::new_readonly(
804 *self.system_program.key,
805 false
806 ));
807 accounts.push(solana_instruction::AccountMeta::new_readonly(
808 *self.event_authority.key,
809 false
810 ));
811 accounts.push(solana_instruction::AccountMeta::new_readonly(
812 *self.program.key,
813 false
814 ));
815 remaining_accounts.iter().for_each(|remaining_account| {
816 accounts.push(solana_instruction::AccountMeta {
817 pubkey: *remaining_account.0.key,
818 is_signer: remaining_account.1,
819 is_writable: remaining_account.2,
820 })
821 });
822 let data = SettleDeployPublicInstructionData::new().try_to_vec().unwrap();
823
824 let instruction = solana_instruction::Instruction {
825 program_id: crate::SATRUSH_ID,
826 accounts,
827 data,
828 };
829 let mut account_infos = Vec::with_capacity(22 + remaining_accounts.len());
830 account_infos.push(self.__program.clone());
831 account_infos.push(self.authority.clone());
832 account_infos.push(self.satrush_config.clone());
833 account_infos.push(self.round.clone());
834 account_infos.push(self.board.clone());
835 account_infos.push(self.rent_recipient.clone());
836 account_infos.push(self.public_deployment.clone());
837 account_infos.push(self.miner.clone());
838 account_infos.push(self.public_automation.clone());
839 account_infos.push(self.automation_usd_ata.clone());
840 account_infos.push(self.miner_usd_ata.clone());
841 account_infos.push(self.sats_vault.clone());
842 account_infos.push(self.btc_mint.clone());
843 account_infos.push(self.usd_mint.clone());
844 account_infos.push(self.board_usd_ata.clone());
845 account_infos.push(self.board_btc_ata.clone());
846 account_infos.push(self.sats_vault_btc_ata.clone());
847 account_infos.push(self.token_program.clone());
848 account_infos.push(self.associated_token_program.clone());
849 account_infos.push(self.system_program.clone());
850 account_infos.push(self.event_authority.clone());
851 account_infos.push(self.program.clone());
852 remaining_accounts.iter().for_each(|remaining_account| account_infos.push(remaining_account.0.clone()));
853
854 if signers_seeds.is_empty() {
855 solana_cpi::invoke(&instruction, &account_infos)
856 } else {
857 solana_cpi::invoke_signed(&instruction, &account_infos, signers_seeds)
858 }
859 }
860}
861
862#[derive(Clone, Debug)]
888pub struct SettleDeployPublicCpiBuilder<'a, 'b> {
889 instruction: Box<SettleDeployPublicCpiBuilderInstruction<'a, 'b>>,
890}
891
892impl<'a, 'b> SettleDeployPublicCpiBuilder<'a, 'b> {
893 pub fn new(program: &'b solana_account_info::AccountInfo<'a>) -> Self {
894 let instruction = Box::new(SettleDeployPublicCpiBuilderInstruction {
895 __program: program,
896 authority: None,
897 satrush_config: None,
898 round: None,
899 board: None,
900 rent_recipient: None,
901 public_deployment: None,
902 miner: None,
903 public_automation: None,
904 automation_usd_ata: None,
905 miner_usd_ata: None,
906 sats_vault: None,
907 btc_mint: None,
908 usd_mint: None,
909 board_usd_ata: None,
910 board_btc_ata: None,
911 sats_vault_btc_ata: None,
912 token_program: None,
913 associated_token_program: None,
914 system_program: None,
915 event_authority: None,
916 program: None,
917 __remaining_accounts: Vec::new(),
918 });
919 Self { instruction }
920 }
921 #[inline(always)]
924 pub fn authority(&mut self, authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
925 self.instruction.authority = Some(authority);
926 self
927 }
928 #[inline(always)]
929 pub fn satrush_config(&mut self, satrush_config: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
930 self.instruction.satrush_config = Some(satrush_config);
931 self
932 }
933 #[inline(always)]
935 pub fn round(&mut self, round: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
936 self.instruction.round = Some(round);
937 self
938 }
939 #[inline(always)]
941 pub fn board(&mut self, board: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
942 self.instruction.board = Some(board);
943 self
944 }
945 #[inline(always)]
948 pub fn rent_recipient(&mut self, rent_recipient: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
949 self.instruction.rent_recipient = Some(rent_recipient);
950 self
951 }
952 #[inline(always)]
955 pub fn public_deployment(&mut self, public_deployment: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
956 self.instruction.public_deployment = Some(public_deployment);
957 self
958 }
959 #[inline(always)]
961 pub fn miner(&mut self, miner: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
962 self.instruction.miner = Some(miner);
963 self
964 }
965 #[inline(always)]
969 pub fn public_automation(&mut self, public_automation: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
970 self.instruction.public_automation = Some(public_automation);
971 self
972 }
973 #[inline(always)]
976 pub fn automation_usd_ata(&mut self, automation_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
977 self.instruction.automation_usd_ata = Some(automation_usd_ata);
978 self
979 }
980 #[inline(always)]
983 pub fn miner_usd_ata(&mut self, miner_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
984 self.instruction.miner_usd_ata = Some(miner_usd_ata);
985 self
986 }
987 #[inline(always)]
989 pub fn sats_vault(&mut self, sats_vault: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
990 self.instruction.sats_vault = Some(sats_vault);
991 self
992 }
993 #[inline(always)]
994 pub fn btc_mint(&mut self, btc_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
995 self.instruction.btc_mint = Some(btc_mint);
996 self
997 }
998 #[inline(always)]
1000 pub fn usd_mint(&mut self, usd_mint: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1001 self.instruction.usd_mint = Some(usd_mint);
1002 self
1003 }
1004 #[inline(always)]
1007 pub fn board_usd_ata(&mut self, board_usd_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1008 self.instruction.board_usd_ata = Some(board_usd_ata);
1009 self
1010 }
1011 #[inline(always)]
1013 pub fn board_btc_ata(&mut self, board_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1014 self.instruction.board_btc_ata = Some(board_btc_ata);
1015 self
1016 }
1017 #[inline(always)]
1019 pub fn sats_vault_btc_ata(&mut self, sats_vault_btc_ata: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1020 self.instruction.sats_vault_btc_ata = Some(sats_vault_btc_ata);
1021 self
1022 }
1023 #[inline(always)]
1024 pub fn token_program(&mut self, token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1025 self.instruction.token_program = Some(token_program);
1026 self
1027 }
1028 #[inline(always)]
1029 pub fn associated_token_program(&mut self, associated_token_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1030 self.instruction.associated_token_program = Some(associated_token_program);
1031 self
1032 }
1033 #[inline(always)]
1034 pub fn system_program(&mut self, system_program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1035 self.instruction.system_program = Some(system_program);
1036 self
1037 }
1038 #[inline(always)]
1039 pub fn event_authority(&mut self, event_authority: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1040 self.instruction.event_authority = Some(event_authority);
1041 self
1042 }
1043 #[inline(always)]
1044 pub fn program(&mut self, program: &'b solana_account_info::AccountInfo<'a>) -> &mut Self {
1045 self.instruction.program = Some(program);
1046 self
1047 }
1048 #[inline(always)]
1050 pub fn add_remaining_account(&mut self, account: &'b solana_account_info::AccountInfo<'a>, is_writable: bool, is_signer: bool) -> &mut Self {
1051 self.instruction.__remaining_accounts.push((account, is_writable, is_signer));
1052 self
1053 }
1054 #[inline(always)]
1059 pub fn add_remaining_accounts(&mut self, accounts: &[(&'b solana_account_info::AccountInfo<'a>, bool, bool)]) -> &mut Self {
1060 self.instruction.__remaining_accounts.extend_from_slice(accounts);
1061 self
1062 }
1063 #[inline(always)]
1064 pub fn invoke(&self) -> solana_program_error::ProgramResult {
1065 self.invoke_signed(&[])
1066 }
1067 #[allow(clippy::clone_on_copy)]
1068 #[allow(clippy::vec_init_then_push)]
1069 pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
1070 let instruction = SettleDeployPublicCpi {
1071 __program: self.instruction.__program,
1072
1073 authority: self.instruction.authority.expect("authority is not set"),
1074
1075 satrush_config: self.instruction.satrush_config.expect("satrush_config is not set"),
1076
1077 round: self.instruction.round.expect("round is not set"),
1078
1079 board: self.instruction.board.expect("board is not set"),
1080
1081 rent_recipient: self.instruction.rent_recipient.expect("rent_recipient is not set"),
1082
1083 public_deployment: self.instruction.public_deployment.expect("public_deployment is not set"),
1084
1085 miner: self.instruction.miner.expect("miner is not set"),
1086
1087 public_automation: self.instruction.public_automation.expect("public_automation is not set"),
1088
1089 automation_usd_ata: self.instruction.automation_usd_ata.expect("automation_usd_ata is not set"),
1090
1091 miner_usd_ata: self.instruction.miner_usd_ata.expect("miner_usd_ata is not set"),
1092
1093 sats_vault: self.instruction.sats_vault.expect("sats_vault is not set"),
1094
1095 btc_mint: self.instruction.btc_mint.expect("btc_mint is not set"),
1096
1097 usd_mint: self.instruction.usd_mint.expect("usd_mint is not set"),
1098
1099 board_usd_ata: self.instruction.board_usd_ata.expect("board_usd_ata is not set"),
1100
1101 board_btc_ata: self.instruction.board_btc_ata.expect("board_btc_ata is not set"),
1102
1103 sats_vault_btc_ata: self.instruction.sats_vault_btc_ata.expect("sats_vault_btc_ata is not set"),
1104
1105 token_program: self.instruction.token_program.expect("token_program is not set"),
1106
1107 associated_token_program: self.instruction.associated_token_program.expect("associated_token_program is not set"),
1108
1109 system_program: self.instruction.system_program.expect("system_program is not set"),
1110
1111 event_authority: self.instruction.event_authority.expect("event_authority is not set"),
1112
1113 program: self.instruction.program.expect("program is not set"),
1114 };
1115 instruction.invoke_signed_with_remaining_accounts(signers_seeds, &self.instruction.__remaining_accounts)
1116 }
1117}
1118
1119#[derive(Clone, Debug)]
1120struct SettleDeployPublicCpiBuilderInstruction<'a, 'b> {
1121 __program: &'b solana_account_info::AccountInfo<'a>,
1122 authority: Option<&'b solana_account_info::AccountInfo<'a>>,
1123 satrush_config: Option<&'b solana_account_info::AccountInfo<'a>>,
1124 round: Option<&'b solana_account_info::AccountInfo<'a>>,
1125 board: Option<&'b solana_account_info::AccountInfo<'a>>,
1126 rent_recipient: Option<&'b solana_account_info::AccountInfo<'a>>,
1127 public_deployment: Option<&'b solana_account_info::AccountInfo<'a>>,
1128 miner: Option<&'b solana_account_info::AccountInfo<'a>>,
1129 public_automation: Option<&'b solana_account_info::AccountInfo<'a>>,
1130 automation_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1131 miner_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1132 sats_vault: Option<&'b solana_account_info::AccountInfo<'a>>,
1133 btc_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
1134 usd_mint: Option<&'b solana_account_info::AccountInfo<'a>>,
1135 board_usd_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1136 board_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1137 sats_vault_btc_ata: Option<&'b solana_account_info::AccountInfo<'a>>,
1138 token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1139 associated_token_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1140 system_program: Option<&'b solana_account_info::AccountInfo<'a>>,
1141 event_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
1142 program: Option<&'b solana_account_info::AccountInfo<'a>>,
1143 __remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
1145}
1146